File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,12 @@ public function testBug5529(): void
432
432
$ this ->assertCount (0 , $ errors );
433
433
}
434
434
435
+ public function testBug5527 (): void
436
+ {
437
+ $ errors = $ this ->runAnalyse (__DIR__ . '/data/bug-5527.php ' );
438
+ $ this ->assertCount (0 , $ errors );
439
+ }
440
+
435
441
/**
436
442
* @param string $file
437
443
* @return \PHPStan\Analyser\Error[]
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Bug5527 ;
4
+
5
+ use function PHPStan \Testing \assertType ;
6
+
7
+ class Base64
8
+ {
9
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ ' ;
10
+
11
+ public function decode (string $ buf ): void
12
+ {
13
+ $ chars = array_flip (str_split (self ::chars));
14
+ $ res = $ chars [$ buf [0 ]] << 18 ;
15
+ $ res += $ chars [$ buf [1 ]] << 12 ;
16
+ $ res += $ chars [$ buf [2 ]] << 6 ;
17
+ $ res += $ chars [$ buf [3 ]];
18
+ assertType ('int ' , $ res );
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments