phpstan Questions

3

Solved

I'm running PHPStan on a Symfony project where I have the following relation in a Doctrine entity: /** * @ORM\OneToMany(targetEntity="App\Entity\Course\Slide", mappedBy="chapter", cascade={"persi...
Ermine asked 24/4, 2020 at 22:15

3

Solved

I have both xdebug and PHP_CodeSniffer (PHPCS) working great on my installation of PHPStorm, but the one really annoying part is that the debugger now seems to be treating Code Sniffer errors as br...
Quiroz asked 17/7, 2012 at 17:49

4

Solved

I am using PHP8, symfony5 and doctrine2 with phpstan and getting these errors: Property App\Entity\User::$id is never written, only read. The code: <?php namespace App\Entity; use App\Reposi...
Rema asked 5/11, 2021 at 10:4

1

How to deal with scopes in Laravel when analyzing code with phpstan/larastan? I'm getting this error: Call to an undefined method Illuminate\Database\Eloquent\Builder::active(). Do I need to typeh...
Lepper asked 20/3, 2023 at 6:23

1

Solved

If, for example, I have a class like this: class Foo { /** * @var array<string, array{name: string, age: int}> */ private array $things; /** * @return array */ public function getThi...
Crine asked 8/10, 2022 at 19:25

1

Solved

To implement checks for some magic _get() functions, I'm trying to implement a "class reflection extension". The manual mentions how to write the extension files themselves, and to instal...
Lunsford asked 28/8, 2020 at 14:10

2

How do you deal with these scenarios in PHPStan: Say you're using plain PHP as template engine. E.g., // view.php <b><?=$foo?></b> Say you have 2 files a.php and b.php /...
Kymry asked 11/12, 2018 at 21:12

1

Solved

While using PHP RedBean on a project, PHPStan reports problems like this one: 87 Access to an undefined property RedBeanPHP\OODBBean::$token. This is happening because RedBean's OODBBean class u...
Uniformitarian asked 8/3, 2019 at 11:15

1

Im trying to setup PHPStan on a older, bigger, codebase. How could i exclude everything and than maybe by config define what to analyse. I have thought about using a separate folder for it, but th...
Annotate asked 14/7, 2018 at 7:34

2

Solved

I have a project built on Symfony 3.4 with Flex and I've added phpstan to it for static analysis. It is complaining about not finding my migration classes: Class DoctrineMigrations\Version2018083...
Dishpan asked 10/9, 2018 at 10:59
1

© 2022 - 2024 — McMap. All rights reserved.