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

require calls in autoload files #11

Open
staabm opened this issue Sep 15, 2022 · 0 comments
Open

require calls in autoload files #11

staabm opened this issue Sep 15, 2022 · 0 comments

Comments

@staabm
Copy link
Contributor

staabm commented Sep 15, 2022

What is this feature about (expected vs actual behaviour)?

requiring a file from within a autoload file doesn't work

How can I reproduce it?

php phpdoctor.phar analyse . --autoload-file=phpstan-bootstrap.php

with a phpstan-bootstrap.php file like

<?php

require_once __DIR__.'/vendor/autoload.php';

errors like

PHP Warning:  require_once(C:\dvl\Workspace\php-rocket\phpstan-bootstrap.php/../vendor/autoload.php): Failed to open stream: No such file or directory in phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/voku/simple-php-code-parser/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php on line 86
Warning: require_once(C:\dvl\Workspace\php-rocket\phpstan-bootstrap.php/../vendor/autoload.php): Failed to open stream: No such file or directory in phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/voku/simple-php-code-parser/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php on line 86
PHP Fatal error:  Uncaught Error: Failed opening required 'C:\dvl\Workspace\php-rocket\phpstan-bootstrap.php/../vendor/autoload.php' (include_path='.;C:\php\pear') in phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/voku/simple-php-code-parser/src/voku/SimplePhpParser/Parsers/PhpCodeParser.php:86
Stack trace:
#0 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/src/voku/PHPDoctor/PhpDocCheck/PhpCodeChecker.php(70): voku\SimplePhpParser\Parsers\PhpCodeParser::getPhpFiles()
#1 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/src/voku/PHPDoctor/CliCommand/PhpDoctorCommand.php(167): voku\PHPDoctor\PhpDocCheck\PhpCodeChecker::checkPhpFiles()
#2 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/symfony/console/Command/Command.php(291): voku\PHPDoctor\CliCommand\PhpDoctorCommand->execute()
#3 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/symfony/console/Application.php(1002): Symfony\Component\Console\Command\Command->run()
#4 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#5 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#6 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/bin/phpdoctor.php(75): Symfony\Component\Console\Application->run()
#7 phar://C:/dvl/Workspace/php-rocket/phpdoctor.phar/bin/phpdoctor.php(76): voku\PHPDoctor\{closure}()
#8 C:\dvl\Workspace\php-rocket\phpdoctor.phar(8): require('...')
#9 {main}

Does it take minutes, hours or days to fix?

don't know

Any additional information?

the bootstrap file I want to pass to PHPDoctor works in the same form for phpstan without problems

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

No branches or pull requests

1 participant