| 1 | <?php |
||
| 2 | |||
| 3 | namespace LeKoala\DebugBar\Test\Extension; |
||
| 4 | |||
| 5 | use LeKoala\DebugBar\DebugBar; |
||
| 6 | use LeKoala\DebugBar\Extension\LeftAndMainExtension; |
||
| 7 | use SilverStripe\Dev\SapphireTest; |
||
| 8 | |||
| 9 | class LeftAndMainExtensionTest extends SapphireTest |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var LeftAndMainExtension |
||
| 13 | */ |
||
| 14 | protected $extension; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var DebugBar\DataCollector\TimeDataCollector |
||
|
0 ignored issues
–
show
|
|||
| 18 | */ |
||
| 19 | protected $timeCollector; |
||
| 20 | |||
| 21 | public function setUp(): void |
||
| 22 | { |
||
| 23 | parent::setUp(); |
||
| 24 | |||
| 25 | $this->extension = new LeftAndMainExtension; |
||
| 26 | DebugBar::initDebugBar(); |
||
| 27 | $this->timeCollector = DebugBar::getDebugBar()->getCollector('time'); |
||
|
0 ignored issues
–
show
It seems like
LeKoala\DebugBar\DebugBa...)->getCollector('time') of type DebugBar\DataCollector\DataCollectorInterface is incompatible with the declared type LeKoala\DebugBar\DebugBa...ector\TimeDataCollector of property $timeCollector.
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. Loading history...
|
|||
| 28 | } |
||
| 29 | |||
| 30 | public function tearDown(): void |
||
| 31 | { |
||
| 32 | DebugBar::clearDebugBar(); |
||
| 33 | |||
| 34 | parent::tearDown(); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function testAccessedCms() |
||
| 38 | { |
||
| 39 | $this->extension->accessedCMS(); |
||
| 40 | $this->assertFalse($this->timeCollector->hasStartedMeasure('init')); |
||
| 41 | $this->assertTrue($this->timeCollector->hasStartedMeasure('cms_accessed')); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function testInit() |
||
| 45 | { |
||
| 46 | $this->extension->init(); |
||
| 47 | $this->assertFalse($this->timeCollector->hasStartedMeasure('cms_accessed')); |
||
| 48 | $this->assertTrue($this->timeCollector->hasStartedMeasure('cms_init')); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths