Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basePath() doesn't use match properly #307

Closed
htmlburger-git opened this issue Sep 7, 2023 · 1 comment
Closed

basePath() doesn't use match properly #307

htmlburger-git opened this issue Sep 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@htmlburger-git
Copy link

Version

3.2

What did you expect to happen?

to be able to boot the app

What actually happens?

it didn't boot the app

Steps to reproduce

https://github.com/roots/acorn/blob/main/src/Roots/Acorn/Bootloader.php#L300-L319

Create an app without any of the folowing:

$_ENV['APP_BASE_PATH'],
constant('ACORN_BASEPATH'),
get_theme_file_path('composer.json')
get_theme_file_path('app')

It's supposed to get the path from this match branch:

$vendor_path = (new Filesystem())->closest(dirname(__DIR__, 4), 'composer.json')) => dirname($vendor_path

However, it doesn't because match expression requires boolean value in, and $vendor_path is a string. As a result, it falls back to

            default => dirname(__DIR__, 3)

See: https://www.php.net/manual/en/control-structures.match.php

A match arm compares values strictly (===) instead of loosely as the switch statement does.

System info

No response

Log output

No response

Please confirm this isn't a support request.

Yes

@htmlburger-git htmlburger-git added the bug Something isn't working label Sep 7, 2023
@QWp6t QWp6t closed this as completed in 3143aa7 Nov 24, 2023
@QWp6t
Copy link
Member

QWp6t commented Nov 24, 2023

Thanks for the heads up! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants