Completed
Pull Request — master (#25)
by Konrad
23s
created
src/Parser/IcoParser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         }
194 194
 
195 195
         $bitmapInfoHeader = unpack(
196
-            'LSize/LWidth/LHeight/SPlanes/SBitCount/LCompression/LImageSize/'.
196
+            'LSize/LWidth/LHeight/SPlanes/SBitCount/LCompression/LImageSize/' .
197 197
             'LXpixelsPerM/LYpixelsPerM/LColorsUsed/LColorsImportant',
198 198
             substr($data, $entry->fileOffset, self::BMP_INFO_HEADER_SIZE),
199 199
         );
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
         for ($j = 0; $j < $entry->colorCount; ++$j) {
240 240
             $offset = $j * 4 + 1; // unpack is 1-indexed
241 241
             $entry->addToBmpPalette(
242
-                $paletteBytes[$offset + 2],  // red
243
-                $paletteBytes[$offset + 1],  // green
244
-                $paletteBytes[$offset],      // blue
245
-                $paletteBytes[$offset + 3],   // alpha
242
+                $paletteBytes[$offset + 2], // red
243
+                $paletteBytes[$offset + 1], // green
244
+                $paletteBytes[$offset], // blue
245
+                $paletteBytes[$offset + 3], // alpha
246 246
             );
247 247
         }
248 248
 
Please login to merge, or discard this patch.
rector.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@
 block discarded – undo
16 16
 use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector;
17 17
 use Rector\ValueObject\PhpVersion;
18 18
 
19
-return static function (RectorConfig $rectorConfig): void {
19
+return static function(RectorConfig $rectorConfig): void {
20 20
     Config::create($rectorConfig, PhpVersion::PHP_81)
21 21
         ->in(
22
-            __DIR__.'/src',
23
-            __DIR__.'/tests',
22
+            __DIR__ . '/src',
23
+            __DIR__ . '/tests',
24 24
         )
25 25
         ->withSymfony()
26 26
         ->withPHPUnit()
Please login to merge, or discard this patch.
tests/Parser/ZeroBitDepthTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         // first, let's be sure our test file has got a zero for the bitDepth in the ICONDIRENTRY
30 30
         $data = file_get_contents('./tests/assets/zero-bit-depth-sample.ico');
31 31
         $hdr = unpack(
32
-            'SReserved/SType/SCount/'.
32
+            'SReserved/SType/SCount/' .
33 33
             'Cwidth/Cheight/CcolorCount/Creserved/Splanes/SbitCount/LsizeInBytes/LfileOffset',
34 34
             $data,
35 35
         );
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
11 11
  * file that was distributed with this source code.
12 12
  */
13 13
 
14
-$loader = require __DIR__.'/../vendor/autoload.php';
15
-$loader->addPsr4('KonradMichalik\\PhpIcoFileLoader\\', __DIR__.'/src');
14
+$loader = require __DIR__ . '/../vendor/autoload.php';
15
+$loader->addPsr4('KonradMichalik\\PhpIcoFileLoader\\', __DIR__ . '/src');
Please login to merge, or discard this patch.
tests/IcoTestCase.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $this->assertIsObject($im);
36 36
 
37
-        $expectedFile = './tests/assets/'.$expected;
37
+        $expectedFile = './tests/assets/' . $expected;
38 38
         // can regenerate expected results by deleting and re-running test
39 39
         if (!file_exists($expectedFile)) {
40 40
             imagepng($im, $expectedFile, 0);
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 
50 50
         // it's possible this might break if the gd results change anything in their png encoding
51 51
         // but that should be rare - the aim here to catch everyday problems in library maintenance
52
-        $expectedData = file_get_contents('./tests/assets/'.$expected);
52
+        $expectedData = file_get_contents('./tests/assets/' . $expected);
53 53
         if ($expectedData !== $imageData) {
54 54
             $observedFile = str_replace('.png', '-OBSERVED.png', $expectedFile);
55 55
             file_put_contents($observedFile, $imageData);
56 56
         }
57
-        $this->assertSame($imageData, $expectedData, 'generated image did not match expected '.$expected);
57
+        $this->assertSame($imageData, $expectedData, 'generated image did not match expected ' . $expected);
58 58
     }
59 59
 
60 60
     /**
@@ -64,6 +64,6 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $parser = new IcoParser();
66 66
 
67
-        return $parser->parse(file_get_contents('./tests/assets/'.$asset));
67
+        return $parser->parse(file_get_contents('./tests/assets/' . $asset));
68 68
     }
69 69
 }
Please login to merge, or discard this patch.