mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
parent
ef64e6e8eb
commit
c5fa07920c
@ -1094,9 +1094,9 @@ class PropertyAssignmentAnalyzer
|
|||||||
Type\Union $assignment_value_type,
|
Type\Union $assignment_value_type,
|
||||||
Context $context
|
Context $context
|
||||||
) {
|
) {
|
||||||
$var_id = ExpressionAnalyzer::getVarId(
|
$var_id = ExpressionAnalyzer::getArrayVarId(
|
||||||
$stmt,
|
$stmt,
|
||||||
$statements_analyzer->getFQCLN(),
|
$context->self,
|
||||||
$statements_analyzer
|
$statements_analyzer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2566,6 +2566,26 @@ class ConditionalTest extends \Psalm\Tests\TestCase
|
|||||||
*/
|
*/
|
||||||
if(!(count($colonnes) == 37 || count($colonnes) == 40)) {}',
|
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