1

I am trying to check for errors via phpcs and PHPCompatibility standard on a laravel project, here is the command:

phpcs -psvw app --extensions=php --standard=PHPCompatibility --runtime-set testVersion 8.0

The command works fine. However, I am supposed to receive following error but I am not:

Deprecated: Method ReflectionParameter::getClass() is deprecated in somefile.php on line 838

The actual code where PHP8 fails but PHPCS does not inform:

$results[] = is_null($dependency->getClass()) ? $this->resolvePrimitive($dependency) : $this->resolveClass($dependency);

The reason PHPCompatibility standard should tell me about this error is that when I try to run my app in PHP 8 I get above error, however PHPCS with PHPCompatibility does not report above error.

Any idea how can I make PHPCompatibility report above error ?

kuba
  • 3,670
  • 3
  • 31
  • 41
dev0010
  • 95
  • 1
  • 5
  • When posting a question, please show us a _concrete_ and _actual_ example of your issue instead of telling us to "ignore that and imagine if". – M. Eriksson Sep 12 '21 at 08:56
  • 1
    @MagnusEriksson: Here is problematic code: `$results[] = is_null($dependency->getClass()) ? $this->resolvePrimitive($dependency) : $this->resolveClass($dependency);`. Updated in question too. – dev0010 Sep 12 '21 at 08:59

0 Answers0