Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 2, 2020
1 parent d391c8e commit 5b4cd94
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,11 @@ public function testAlwaysUsedTags(): void
]);
}

public function testTrait(): void
{
$this->alwaysWrittenTags = [];
$this->alwaysReadTags = [];
$this->analyse([__DIR__ . '/data/private-property-trait.php'], []);
}

}
29 changes: 29 additions & 0 deletions tests/PHPStan/Rules/DeadCode/data/private-property-trait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace UnusedPropertyTrait;

trait FooTrait
{

private $prop1;

private $prop2;

public function doFoo()
{
echo $this->prop1;
}

public function setFoo($prop1)
{
$this->prop1 = $prop1;
}

}

class ClassUsingTrait
{

use FooTrait;

}
26 changes: 0 additions & 26 deletions tests/PHPStan/Rules/DeadCode/data/unused-private-property.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,29 +154,3 @@ class TextExtension
private $used;

}

trait FooTrait
{

private $prop1;

private $prop2;

public function doFoo()
{
echo $this->prop1;
}

public function setFoo($prop1)
{
$this->prop1 = $prop1;
}

}

class ClassUsingTrait
{

use FooTrait;

}

0 comments on commit 5b4cd94

Please sign in to comment.