-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Bug6715Functions; | ||
|
||
trait T | ||
{ | ||
/** @return array<mixed> */ | ||
public function getCreateTableSQL(): array | ||
{ | ||
$sqls = array_merge( | ||
$this->a(), | ||
parent::b() // @phpstan-ignore-line | ||
); | ||
|
||
return $sqls; | ||
} | ||
} | ||
|
||
class A { | ||
public function a(): mixed { | ||
throw new \Exception(); | ||
} | ||
|
||
/** @return null */ | ||
public function b() { | ||
throw new \Exception(); | ||
} | ||
} | ||
|
||
class B extends A | ||
{ | ||
use T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Bug6175; | ||
|
||
class A {} | ||
class B extends A {} | ||
class C extends B {} | ||
|
||
trait RefsTrait | ||
{ | ||
/** | ||
* @return B|C | ||
*/ | ||
public function foo() | ||
{ | ||
return new A(); // @phpstan-ignore-line | ||
} | ||
|
||
public function dumpType(): void | ||
{ | ||
\PHPStan\dumpType($this->foo()); | ||
} | ||
} | ||
|
||
class Model | ||
{ | ||
use RefsTrait; | ||
|
||
/** | ||
* @return B|C | ||
*/ | ||
public function foo2() | ||
{ | ||
return new A(); // @phpstan-ignore-line | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Bug6175TooWide; | ||
|
||
trait SomeTrait { | ||
private function sayHello(): ?string // @phpstan-ignore-line | ||
{ | ||
return $this->value; | ||
} | ||
} | ||
|
||
class HelloWorld2 | ||
{ | ||
use SomeTrait; | ||
private string $value = ''; | ||
public function sayIt(): void | ||
{ | ||
echo $this->sayHello(); | ||
} | ||
} |