Skip to content

Commit

Permalink
Trait properties - test property from a trait from a parent class
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 19, 2020
1 parent b151601 commit 824a23b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8506,6 +8506,10 @@ public function dataTraitsPhpDocs(): array
'string',
'$this->methodFromTraitUsingTrait()',
],
[
'TraitPhpDocsThree\Foo',
'$this->loremTraitProperty',
],
];
}

Expand Down
12 changes: 12 additions & 0 deletions tests/PHPStan/Analyser/data/traits/Bar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace TraitPhpDocs;

use TraitPhpDocsThree\LoremTrait;

class Bar
{

use LoremTrait;

}
11 changes: 11 additions & 0 deletions tests/PHPStan/Analyser/data/traits/LoremTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace TraitPhpDocsThree;

trait LoremTrait
{

/** @var Foo */
protected $loremTraitProperty;

}
2 changes: 1 addition & 1 deletion tests/PHPStan/Analyser/data/traits/traits.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace TraitPhpDocs;

class Foo
class Foo extends Bar
{

use \TraitPhpDocsTwo\FooTrait, \TraitPhpDocsThree\BarTrait {
Expand Down

0 comments on commit 824a23b

Please sign in to comment.