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

phpleague ReflectionContainer uses deprecated ReflectionParameter::getClass #1226

Closed
yookoala opened this issue Jan 27, 2021 · 2 comments · Fixed by #1241
Closed

phpleague ReflectionContainer uses deprecated ReflectionParameter::getClass #1226

yookoala opened this issue Jan 27, 2021 · 2 comments · Fixed by #1241

Comments

@yookoala
Copy link
Member

yookoala commented Jan 27, 2021

Describe the bug
The ArgumentResolverTrait in phpleague 2.4.1 still uses the deprecated ReflectionParameter::getClass method. This issue is fixed in eb23e27, which got merged into v3.3.3.

As for the 2.x branch, the last update was 2016. And the getClass call is still there:
https://github.com/thephpleague/container/blob/7b57d9455cac5fd1107ba1836a293cda64371fa3/src/Argument/ArgumentResolverTrait.php#L54

The most obvious way to fix this is to upgrade the "phpleague/container" package. It's 3.x branch claims to support PHP 7.0 - PHP 8.0 (experimental) while its 2.x branch supports PHP up to 7.1 only. One difference between this and #1214 is that it is not a development dependency. Changing the container library would change a bunch of files in /vendor unless either #1123 or #1209 is merged first.

To Reproduce

  1. Checkout GibbonEdu latest source commit (e.g. 18d25c8)
  2. Using the source folder as docroot, start a PHP 8 test server with display_error=1 and error_reporting=E_ALL (i.e. showing deprecated warnings). For example with this command:
    php --server 127.0.0.1:8888 \
            --docroot . \
            --define display_startup_errors=1 \
            --define display_errors=1 \
            --define error_reporting=E_ALL
    
  3. Visit the site with browser. The message should be easily seen.

Expected behavior
Do not see this kind of message at all.

Screenshots
2021-02-02 12-41-45 的螢幕擷圖
2021-01-27 23-45-40 的螢幕擷圖
2021-01-28 00-02-05 的螢幕擷圖

Your System

  • Gibbon version: v22.0.00 latest
  • Browser: PhpBrowser of Codeception
@abdirooble
Copy link

hey guys!
I have two questions.
can someone tell me which stacks Gibbon has?
and do you use a framework for PHP (laravel) or only PHP?

@yookoala
Copy link
Member Author

yookoala commented Feb 2, 2021

hey guys!
I have two questions.
can someone tell me which stacks Gibbon has?
and do you use a framework for PHP (laravel) or only PHP?

The question is not related to this issue.

For general enquiries and support, please use the forum site:
https://ask.gibbonedu.org/

P.S. No. Gibbon is not using any framework.

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