File tree Expand file tree Collapse file tree 3 files changed +23
-21
lines changed Expand file tree Collapse file tree 3 files changed +23
-21
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,6 @@ public function dataFileAsserts(): iterable
21
21
22
22
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/tree_builder.php ' );
23
23
24
- if (interface_exists ('\Symfony\Contracts\Cache\CacheInterface ' )) {
25
- yield from $ this ->gatherAssertTypes (__DIR__ . '/data/ExampleCacheInterface.php ' );
26
- }
27
-
28
24
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/ExampleBaseCommand.php ' );
29
25
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/ExampleOptionCommand.php ' );
30
26
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/ExampleOptionLazyCommand.php ' );
@@ -56,6 +52,7 @@ public function dataFileAsserts(): iterable
56
52
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/denormalizer.php ' );
57
53
58
54
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/FormInterface_getErrors.php ' );
55
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/cache.php ' );
59
56
}
60
57
61
58
/**
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace PHPStan \Type \Symfony \cache ;
4
+
5
+ use function PHPStan \Testing \assertType ;
6
+
7
+ function testCacheCallable (\Symfony \Contracts \Cache \CacheInterface $ cache ): void {
8
+ $ result = $ cache ->get ('foo ' , function (): string {
9
+ return '' ;
10
+ });
11
+
12
+ assertType ('string ' , $ result );
13
+ };
14
+
15
+ /**
16
+ * @param \Symfony\Contracts\Cache\CallbackInterface<\stdClass> $cb
17
+ */
18
+ function testCacheCallbackInterface (\Symfony \Contracts \Cache \CacheInterface $ cache , \Symfony \Contracts \Cache \CallbackInterface $ cb ): void {
19
+ $ result = $ cache ->get ('foo ' ,$ cb );
20
+
21
+ assertType ('stdClass ' , $ result );
22
+ };
You can’t perform that action at this time.
0 commit comments