Skip to content
Permalink
Browse files

Fix #2041 - make sure property is always set

  • Loading branch information...
muglug committed Aug 21, 2019
1 parent 3001eb9 commit 98359432946bc384f928b097f4511f06a3475a01
@@ -51,11 +51,9 @@
<MissingConstructor>
<errorLevel type="suppress">
<file name="src/Psalm/Internal/Scanner/FunctionDocblockComment.php"/>
<file name="src/Psalm/Internal/Scanner/VarDocblockComment.php"/>
<file name="src/Psalm/Storage/FunctionLikeStorage.php"/>
<file name="src/Psalm/Storage/MethodStorage.php"/>
<file name="src/Psalm/Storage/PropertyStorage.php"/>
<file name="src/Psalm/Internal/Scanner/VarDocblockComment.php"/>
<file name="src/Psalm/Internal/Scope/CaseScope.php"/>
</errorLevel>
</MissingConstructor>
@@ -104,7 +104,7 @@ public static function analyze(
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->var_id) {
if (!$var_comment->var_id || !$var_comment->type) {
continue;
}
@@ -250,7 +250,7 @@ public static function analyze(
);
foreach ($var_comments as $var_comment) {
if (!$var_comment->var_id) {
if (!$var_comment->var_id || !$var_comment->type) {
continue;
}
@@ -111,6 +111,10 @@ public static function analyze(
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->type) {
continue;
}
try {
$var_comment_type = ExpressionAnalyzer::fleshOutType(
$codebase,
@@ -521,6 +525,10 @@ public static function analyze(
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->type) {
continue;
}
try {
if ($var_comment->var_id === $list_var_id) {
$var_comment_type = ExpressionAnalyzer::fleshOutType(
@@ -1437,6 +1437,10 @@ protected static function analyzeYield(
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->type) {
continue;
}
$comment_type = ExpressionAnalyzer::fleshOutType(
$codebase,
$var_comment->type,
@@ -75,6 +75,10 @@ public static function analyze(
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->type) {
continue;
}
$comment_type = ExpressionAnalyzer::fleshOutType(
$codebase,
$var_comment->type,
@@ -753,7 +753,7 @@ function ($line) {
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->var_id) {
if (!$var_comment->var_id || !$var_comment->type) {
continue;
}
@@ -1326,6 +1326,10 @@ private function analyzeStatic(PhpParser\Node\Stmt\Static_ $stmt, Context $conte
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->type) {
continue;
}
try {
$var_comment_type = ExpressionAnalyzer::fleshOutType(
$codebase,
@@ -9,12 +9,12 @@
class VarDocblockComment
{
/**
* @var Type\Union
* @var ?Type\Union
*/
public $type;
/**
* @var string
* @var ?string
*/
public $original_type;
@@ -457,6 +457,10 @@ public function enterNode(PhpParser\Node $node)
}
foreach ($var_comments as $var_comment) {
if (!$var_comment->type) {
continue;
}
$var_type = $var_comment->type;
$var_type->queueClassLikesForScanning($this->codebase, $this->file_storage);
}
@@ -33,6 +33,11 @@ public static function barBar(): void {
}
}',
],
'annotationOnStatement' => [
'<?php
/** @deprecated */
$a = "A";'
],
];
}

0 comments on commit 9835943

Please sign in to comment.
You can’t perform that action at this time.