mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
parent
ef64e6e8eb
commit
c5fa07920c
@ -1094,9 +1094,9 @@ class PropertyAssignmentAnalyzer
|
||||
Type\Union $assignment_value_type,
|
||||
Context $context
|
||||
) {
|
||||
$var_id = ExpressionAnalyzer::getVarId(
|
||||
$var_id = ExpressionAnalyzer::getArrayVarId(
|
||||
$stmt,
|
||||
$statements_analyzer->getFQCLN(),
|
||||
$context->self,
|
||||
$statements_analyzer
|
||||
);
|
||||
|
||||
|
@ -2566,6 +2566,26 @@ class ConditionalTest extends \Psalm\Tests\TestCase
|
||||
*/
|
||||
if(!(count($colonnes) == 37 || count($colonnes) == 40)) {}',
|
||||
],
|
||||
'reconcilePropertyInTrait' => [
|
||||
'<?php
|
||||
class A {}
|
||||
|
||||
trait T {
|
||||
private static ?A $one = null;
|
||||
|
||||
private static function maybeSetOne(): A {
|
||||
if (null === self::$one) {
|
||||
self::$one = new A();
|
||||
}
|
||||
|
||||
return self::$one;
|
||||
}
|
||||
}
|
||||
|
||||
class Implementer {
|
||||
use T;
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user