File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
tests/PHPStan/Rules/Classes Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -499,4 +499,9 @@ public function testBug10248(): void
499499 $ this ->analyse ([__DIR__ . '/data/bug-10248.php ' ], []);
500500 }
501501
502+ public function testBug11815 (): void
503+ {
504+ $ this ->analyse ([__DIR__ . '/data/bug-11815.php ' ], []);
505+ }
506+
502507}
Original file line number Diff line number Diff line change 1+ <?php // lint >= 8.0
2+
3+ declare (strict_types = 1 );
4+
5+ class Dimensions
6+ {
7+ public function __construct (
8+ public int $ width ,
9+ public int $ height ,
10+ ) {
11+ }
12+ }
13+
14+ class StoreProcessorResult
15+ {
16+ public function __construct (
17+ public string $ path ,
18+ public string $ mimetype ,
19+ public Dimensions $ dimensions ,
20+ public int $ filesize ,
21+ public true |null $ identical = null ,
22+ ) {
23+ }
24+ }
25+
26+ /**
27+ * @return array{path: string, identical?: true}
28+ */
29+ function getPath (): array
30+ {
31+ $ data = ['path ' => 'some/path ' ];
32+ if ((bool )rand (0 , 1 )) {
33+ $ data ['identical ' ] = true ;
34+ }
35+ return $ data ;
36+ }
37+
38+ $ data = getPath ();
39+ $ data ['dimensions ' ] = new Dimensions (100 , 100 );
40+ $ data ['mimetype ' ] = 'image/png ' ;
41+ $ data ['filesize ' ] = 123456 ;
42+
43+ $ dto = new StoreProcessorResult (...$ data );
You can’t perform that action at this time.
0 commit comments