Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
139 views

I'm trying to use Psalm to detect SQL Injections. I have the following code : $pdo = new PDO("mysql:host=db;dbname=tp;port=3306", "user", "password");; // VULNERABLE ...
0 votes
1 answer
733 views

I have a PHP 8.1 application with Symfony 5.4 and Doctrine 2.17. We use psalm 5.18. With Doctrine ODM bundle (v4.7) there is a ServiceDocumentRepository class: <?php declare(strict_types=1); ...
0 votes
1 answer
210 views

I am trying to figure out how to properly document some code, mostly so that tools like PHPStan and Psalm don't complain. Simplified, I have an abstract class that defines methods for setting and ...
1 vote
0 answers
283 views

Psalm speaks of mistakes... UndefinedMagicMethod Magic method App\Models\User::wherenull() does not exist UndefinedMagicMethod Magic method App\Models\User::create() UndefinedMagicMethod Magic ...
Goryyn's user avatar
  • 393
0 votes
0 answers
137 views

When I extend an ArrayObject and use vimeo/psalm static analyzer to check my code, I get the following error: ERROR: ParamNameMismatch at /var/www/file.php:13:37 Argument 1 of ...
0 votes
1 answer
207 views

Is something wrong with templates in this example: https://psalm.dev/r/113297eeaf? Why Psalm doesn't agree that Pet<Cat|Dog> and Cat|Dog are the same types here? Can this be solved somehow (...
Storm's user avatar
  • 364
1 vote
2 answers
516 views

I have the following code and want to get it through Psalm static checks: if ( empty($sessions[$token]->product) || !is_object($sessions[$token]->product) ) { continue; } if ( ...
Alex's user avatar
  • 35.8k
0 votes
1 answer
952 views

I'm working on a Symfony project and I'm starting using Psalm. Almost everything is fine, as I keep getting an error that I don't understand: ERROR: PossiblyUnusedMethod - src/Repository/...
Xem's user avatar
  • 23
1 vote
1 answer
677 views

I have an interface that implements a method which takes an array of format X and returns an array with the same format X. I tried using generics to express this, but apparently I can't do so because ...
1 vote
2 answers
563 views

I have the simplified code example from my library, to which psalm, for reasons I don't understand, outputs warnings. class Example { public const C_1 = 'val1'; public const C_2 = 'val2'; ...
XYZ's user avatar
  • 165
1 vote
2 answers
243 views

What is the correct returning object definition in psalm? /** * @psalm-return \stdClass{foo?: string} */ function returnObject(): \stdClass { $item2 = new \stdClass(); $item2->foo = "asd&...
3 votes
1 answer
1k views

I'm trying to remove some code duplication that has proven to be prone to human errors. I created a working sample code at https://3v4l.org/QFA6m#v8.2.7 and a demo of PHPStan failing where expected, ...
0 votes
1 answer
795 views

I've read the documentation from PhpStan and Psalm, and i couldn't find the rules where it checks the Cyclomatic Complexity like Phpmd does here Also, is it possible to cusomise rules within levels ...
3 votes
0 answers
248 views

The PHP linter "Psalm" has a feature called baseline. It can be used to "ignore" errors that are tracked by a baseline file but prevent new errors from accumulating. This is useful ...
FabianTe's user avatar
  • 659
2 votes
0 answers
206 views

I have a case in PHP psalm that can be represented by this snippet: https://psalm.dev/r/c31997fed4 The handleNode() method does not care about the type of node used, it should only care about that it ...
Jan Sverre's user avatar
  • 4,793

15 30 50 per page
1
2 3 4 5

AltStyle によって変換されたページ (->オリジナル) /