File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed
Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 2323 "nette/tester" : " ^2.6" ,
2424 "nette/security" : " ^3.0" ,
2525 "tracy/tracy" : " ^2.8" ,
26- "phpstan/phpstan-nette" : " ^2.0@stable"
26+ "phpstan/phpstan" : " ^2.1@stable" ,
27+ "phpstan/extension-installer" : " ^1.4@stable" ,
28+ "nette/phpstan-rules" : " ^1.0"
2729 },
2830 "conflict" : {
2931 "nette/di" : " <3.0.3" ,
5052 "branch-alias" : {
5153 "dev-master" : " 3.3-dev"
5254 }
55+ },
56+ "config" : {
57+ "allow-plugins" : {
58+ "phpstan/extension-installer" : true
59+ }
5360 }
5461}
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ require __DIR__ . '/../bootstrap.php ' ;
4+
5+ use Nette \PHPStan \Tester \TypeAssert ;
6+
7+ TypeAssert::assertTypes (__DIR__ . '/http-types.php ' );
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ /**
4+ * PHPStan type tests for Http.
5+ * Run: vendor/bin/phpstan analyse tests/types
6+ */
7+
8+ use Nette \Http \FileUpload ;
9+ use Nette \Http \SessionSection ;
10+ use function PHPStan \Testing \assertType ;
11+
12+
13+ function testSessionSectionIterator (SessionSection $ section ): void
14+ {
15+ foreach ($ section as $ key => $ value ) {
16+ assertType ('string ' , $ key );
17+ assertType ('mixed ' , $ value );
18+ }
19+ }
20+
21+
22+ function testSessionSectionArrayAccess (SessionSection $ section ): void
23+ {
24+ $ section ->remove ();
25+ $ value = $ section ['key ' ];
26+ assertType ('mixed ' , $ value );
27+ }
28+
29+
30+ function testFileUploadGetImageSize (FileUpload $ upload ): void
31+ {
32+ $ size = $ upload ->getImageSize ();
33+ assertType ('array{int, int}|null ' , $ size );
34+ }
You can’t perform that action at this time.
0 commit comments