Completed
Push — master ( 023e21...5ec956 )
by Guillaume
07:09
created
src/Compiler/Compiler.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function compile()
21 21
     {
22
-        $pharFilePath = dirname(__FILE__).'/../../build/monitor.phar';
22
+        $pharFilePath = dirname(__FILE__) . '/../../build/monitor.phar';
23 23
         if (file_exists($pharFilePath)) {
24 24
             unlink($pharFilePath);
25 25
         }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $phar->setSignatureAlgorithm(\Phar::SHA1);
31 31
 
32 32
         $phar->startBuffering();
33
-        $root = __DIR__.'/../..';
33
+        $root = __DIR__ . '/../..';
34 34
 
35 35
         $finder = new Finder();
36 36
         $finder->files()
@@ -41,31 +41,31 @@  discard block
 block discarded – undo
41 41
             ->exclude('Tests')
42 42
             ->exclude('tests')
43 43
             ->exclude('docs')
44
-            ->in($root.'/src')
45
-            ->in($root.'/vendor/guzzlehttp')
46
-            ->in($root.'/vendor/webmozart')
47
-            ->in($root.'/vendor/psr')
48
-            ->in($root.'/vendor/guzzle')
49
-            ->in($root.'/vendor/symfony')
44
+            ->in($root . '/src')
45
+            ->in($root . '/vendor/guzzlehttp')
46
+            ->in($root . '/vendor/webmozart')
47
+            ->in($root . '/vendor/psr')
48
+            ->in($root . '/vendor/guzzle')
49
+            ->in($root . '/vendor/symfony')
50 50
         ;
51 51
 
52 52
         foreach ($finder as $file) {
53 53
             $this->addFile($phar, $file);
54 54
         }
55 55
 
56
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/autoload.php'));
57
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_namespaces.php'));
58
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_psr4.php'));
59
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_classmap.php'));
60
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_files.php'));
61
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_real.php'));
56
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/autoload.php'));
57
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_namespaces.php'));
58
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_psr4.php'));
59
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_classmap.php'));
60
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_files.php'));
61
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_real.php'));
62 62
 
63
-        if (file_exists($root.'/vendor/composer/include_paths.php')) {
64
-            $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/include_paths.php'));
63
+        if (file_exists($root . '/vendor/composer/include_paths.php')) {
64
+            $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/include_paths.php'));
65 65
         }
66
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/ClassLoader.php'));
66
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/ClassLoader.php'));
67 67
 
68
-        $binContent = file_get_contents($root.'/bin/monitor');
68
+        $binContent = file_get_contents($root . '/bin/monitor');
69 69
         $binContent = preg_replace('{^#!/usr/bin/env php\s*}', '', $binContent);
70 70
         $phar->addFromString('bin/monitor', $binContent);
71 71
 
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 
78 78
     protected function addFile(\Phar $phar, \SplFileInfo $file, $strip = true)
79 79
     {
80
-        $path = str_replace(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR, '', $file->getRealPath());
80
+        $path = str_replace(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR, '', $file->getRealPath());
81 81
         $content = file_get_contents($file);
82 82
         if ($strip) {
83 83
             $content = self::stripWhitespace($content);
84 84
         } elseif ('LICENSE' === basename($file)) {
85
-            $content = "\n".$content."\n";
85
+            $content = "\n" . $content . "\n";
86 86
         }
87 87
 
88 88
         if ($path === 'src/Monitor.php') {
Please login to merge, or discard this patch.