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

Deprecation exception on dynamic properties using PHP 8.2 on src/Doctum.php line 225 #62

Closed
Abdillah opened this issue Nov 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Abdillah
Copy link
Contributor

Abdillah commented Nov 26, 2023

My configuration is as follows.

return new Doctum($iterator, [
    'title'                => 'PHP References',
    'language'             => 'en',
    'build_dir'            => __DIR__ . '/../build/php_refs',
    'cache_dir'            => __DIR__ . '/../build/php_refs/.cache',
]);

When language is removed, no errors occurs. But, generally this error occurs when unknown config key is supplied.

I think, it needs to limit what the config possible or handle it more gracefully.

Here is a snippet of the errors.

$ php doctum.phar parse config/doctum.php -vvv

In ErrorHandler.php line 53:

  [ErrorException]
  Deprecated: Creation of dynamic property Doctum\Doctum::$language is deprecated in phar:///path/to/binary/doctum.phar/src/Doctum.php line 225


Exception trace:
  at phar:///path/to/binary/doctum.phar/src/ErrorHandler.php:53
 Doctum\ErrorHandler->handle() at phar:///path/to/binary/doctum.phar/src/Doctum.php:225
 Doctum\Doctum->__construct() at /path/to/binary/config/doctum.php:15
 require() at phar:///path/to/binary/doctum.phar/src/Console/Command/Command.php:501
 Doctum\Console\Command\Command->loadDoctum() at phar:///path/to/binary/doctum.phar/src/Console/Command/Command.php:170
 Doctum\Console\Command\Command->initialize() at phar:///path/to/binary/doctum.phar/vendor/symfony/console/Command/Command.php:264
 Symfony\Component\Console\Command\Command->run() at phar:///path/to/binary/doctum.phar/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at phar:///path/to/binary/doctum.phar/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at phar:///path/to/binary/doctum.phar/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///path/to/binary/doctum.phar/bin/doctum-binary.php:26
 include() at /path/to/binary/doctum.phar:16

parse [--only-version ONLY-VERSION] [--force] [--output-format OUTPUT-FORMAT] [--no-progress] [--ignore-parse-errors] [--print-frozen-errors] [--] <config>
@williamdes williamdes added the bug Something isn't working label Dec 9, 2023
@williamdes
Copy link
Member

Thank you for this report, this is still on my TODO list but I hope to do it soon

@williamdes williamdes self-assigned this Dec 9, 2023
williamdes added a commit that referenced this issue Dec 16, 2023
@williamdes
Copy link
Member

Seems like dc6cb2e fixed it, I added b88cd7f to ensure this case is handled and 758d472 to ensure I did not break the language switcher

@williamdes williamdes added this to the v5.5.4 milestone Dec 16, 2023
@williamdes
Copy link
Member

williamdes commented Dec 16, 2023

I released the changes in 5.5.4, would you mind confirming that everything is okay for you @Abdillah ?

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

No branches or pull requests

2 participants