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

Deprecations with php8 #186

Closed
WeaponsTheyFear opened this issue Nov 28, 2020 · 5 comments · Fixed by #189
Closed

Deprecations with php8 #186

WeaponsTheyFear opened this issue Nov 28, 2020 · 5 comments · Fixed by #189

Comments

@WeaponsTheyFear
Copy link

Not sure if you plan to support php 8, but I am getting deprecation issues in CachingReflector.

Method ReflectionParameter::getClass() is deprecated

        if ($reflectionClass = $param->getClass()) {
            $typeHint = $reflectionClass->getName();
            $classCacheKey = self::CACHE_KEY_CLASSES . strtolower($typeHint);
            $this->cache->store($classCacheKey, $reflectionClass);
        } else {
            $typeHint = null;
        }
@trowski
Copy link

trowski commented Nov 29, 2020

Yes, I'm going to upgrade it to PHP 8, add types here and there, and make some API tweaks. This repo will be moved to amphp/auryn.

@WeaponsTheyFear
Copy link
Author

This solved my issue in CachingReflector:

       if ($param->getType() && !$param->getType()->isBuiltin()) {
            $typeHint = $param->getType()->getName();
            $classCacheKey = self::CACHE_KEY_CLASSES . strtolower($typeHint);
            $reflectionClass = new \ReflectionClass($param->getType()->getName());
            $this->cache->store($classCacheKey, $reflectionClass);
        } else {
            $typeHint = null;
        }

@dlgoodchild
Copy link

Is Auryn effectively unmaintained now? I'm wondering if it should be forked now as it's usable with PHP8.

@kelunik
Copy link
Collaborator

kelunik commented Dec 21, 2020

No, I'll get it sorted. But the next major will be released under @amphp.

@trowski
Copy link

trowski commented Dec 21, 2020

@kelunik I merged the PR to fix the 8 deprecation errors in amphp/auryn if you wanted to tag there and alter the readme here to redirect there.

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.

4 participants