mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
parent
6b04503cc4
commit
66bbe5bb74
@ -991,13 +991,17 @@ class CommentAnalyzer
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($next_char === '|') {
|
||||
++$i;
|
||||
$type .= $next_char;
|
||||
continue;
|
||||
if ($next_char === '|' || $next_char === '&') {
|
||||
$nexter_char = $i < $l - 2 ? $return_block[$i + 2] : null;
|
||||
|
||||
if ($nexter_char === ' ') {
|
||||
++$i;
|
||||
$type .= $next_char;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($last_char === '|') {
|
||||
if ($last_char === '|' || $last_char === '&') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -974,6 +974,21 @@ class AnnotationTest extends TestCase
|
||||
private $s = null;
|
||||
}',
|
||||
],
|
||||
'intersectionWithSpace' => [
|
||||
'<?php
|
||||
interface A {
|
||||
public function foo() : void;
|
||||
}
|
||||
interface B {
|
||||
public function bar() : void;
|
||||
}
|
||||
|
||||
/** @param A & B $a */
|
||||
function f(A $a) : void {
|
||||
$a->foo();
|
||||
$a->bar();
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user