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

Crash when guides-cli is run without a configuration file #824

Closed
greg0ire opened this issue Jan 21, 2024 · 1 comment · Fixed by #826
Closed

Crash when guides-cli is run without a configuration file #824

greg0ire opened this issue Jan 21, 2024 · 1 comment · Fixed by #826

Comments

@greg0ire
Copy link
Contributor

greg0ire commented Jan 21, 2024

I thought I would test 0.3.0 on doctrine, and was greeted with this crash.

$ vendor/bin/guides -vvv --no-progress docs/en
PHP Fatal error:  Uncaught TypeError: is_file(): Argument #1 ($filename) must be of type string, bool given in /home/greg/dev/doctrine-orm/minor/vendor/phpdocumentor/guides-cli/bin/guides:44
Stack trace:
#0 /home/greg/dev/doctrine-orm/minor/vendor/phpdocumentor/guides-cli/bin/guides(44): is_file()
#1 /home/greg/dev/doctrine-orm/minor/vendor/bin/guides(119): include('...')
#2 {main}
  thrown in /home/greg/dev/doctrine-orm/minor/vendor/phpdocumentor/guides-cli/bin/guides on line 44

I believe it's caused by #768 (realpath returns false, and then false is passed to is_dir)

@wouterj
Copy link
Contributor

wouterj commented Jan 21, 2024

Hmm, indeed. We should move $projectConfig = realpath($projectConfig); in the if statement

greg0ire added a commit to greg0ire/guides that referenced this issue Jan 21, 2024
Running the tool without creating a guides.xml is a valid scenario, and
should be supported. This means realpath() may return false, which is not
a valid input for is_file().

Fixes phpDocumentor#824
greg0ire added a commit to greg0ire/guides that referenced this issue Jan 21, 2024
Running the tool without creating a guides.xml is a valid scenario, and
should be supported. This means realpath() may return false, which is not
a valid input for is_file().

Fixes phpDocumentor#824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants