| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function testClassBoundCacheContract(): void |
||
| 17 | { |
||
| 18 | $cache = new ArrayAdapter(); |
||
| 19 | $fileBoundCache = new FileBoundCache($cache, 'prefix'); |
||
| 20 | $classBoundCache = new ClassBoundCache($fileBoundCache, true, true, true); |
||
| 21 | $classBoundCacheContract = new ClassBoundCacheContract($classBoundCache); |
||
| 22 | |||
| 23 | $val = 0; |
||
| 24 | |||
| 25 | $newVal = $classBoundCacheContract->get(new ReflectionClass(A::class), function() use (&$val) { |
||
| 26 | return ++$val; |
||
| 27 | }); |
||
| 28 | |||
| 29 | $this->assertSame(1, $newVal); |
||
| 30 | |||
| 31 | $newVal2 = $classBoundCacheContract->get(new ReflectionClass(A::class), function() use (&$val) { |
||
| 32 | return ++$val; |
||
| 33 | }); |
||
| 34 | |||
| 35 | $this->assertSame(1, $newVal2); |
||
| 36 | |||
| 37 | $classToTouch = new ReflectionClass(A::class); |
||
| 38 | sleep(1); |
||
| 39 | clearstatcache($classToTouch->getFileName()); |
||
| 40 | touch($classToTouch->getFileName()); |
||
| 41 | |||
| 42 | $newVal3 = $classBoundCacheContract->get(new ReflectionClass(A::class), function() use (&$val) { |
||
| 43 | return ++$val; |
||
| 44 | }); |
||
| 45 | |||
| 46 | $this->assertSame(2, $newVal3); |
||
| 47 | } |
||
| 50 |
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