spiral / framework

High-Performance PHP Framework
https://spiral.dev
MIT License
1.82k stars 89 forks source link

Fix psalm issue: remove internal annotation from LoggerTrait::$logger #1118

Closed gam6itko closed 3 months ago

gam6itko commented 3 months ago
Q A
Bugfix?
Breaks BC?
New feature?
Issues #...
Docs PR spiral/docs#...

This class triggers psalm level 4 error

use Spiral\Logger\Traits\LoggerTrait;

class Foo
{
    use LoggerTrait;

    public function __construct() {
        $this->logger = $this->allocateLogger('bar');
    }
ERROR: InternalProperty
at /home/gam6itko/Foo.php:24:9
Foo::$logger is internal to Spiral but called from Foo (see https://psalm.dev/176)
        $this->logger = $this->allocateLogger('bar');