Completed
Push — master ( b31a50...084e6b )
by Guillaume
03:54
created
src/Compiler/Compiler.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function compile()
32 32
     {
33
-        $pharFilePath = dirname(__FILE__).'/../../build/monitor.phar';
33
+        $pharFilePath = dirname(__FILE__) . '/../../build/monitor.phar';
34 34
         if (file_exists($pharFilePath)) {
35 35
             unlink($pharFilePath);
36 36
         }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $phar->setSignatureAlgorithm(\Phar::SHA1);
42 42
 
43 43
         $phar->startBuffering();
44
-        $root = __DIR__.'/../..';
44
+        $root = __DIR__ . '/../..';
45 45
 
46 46
         $finder = new Finder();
47 47
         $finder->files()
@@ -52,34 +52,34 @@  discard block
 block discarded – undo
52 52
             ->exclude('Tests')
53 53
             ->exclude('tests')
54 54
             ->exclude('docs')
55
-            ->in($root.'/src')
56
-            ->in($root.'/vendor/guzzlehttp')
57
-            ->in($root.'/vendor/rtheunissen')
58
-            ->in($root.'/vendor/eljam')
59
-            ->in($root.'/vendor/hogosha')
60
-            ->in($root.'/vendor/webmozart')
61
-            ->in($root.'/vendor/psr')
62
-            ->in($root.'/vendor/guzzle')
63
-            ->in($root.'/vendor/symfony')
55
+            ->in($root . '/src')
56
+            ->in($root . '/vendor/guzzlehttp')
57
+            ->in($root . '/vendor/rtheunissen')
58
+            ->in($root . '/vendor/eljam')
59
+            ->in($root . '/vendor/hogosha')
60
+            ->in($root . '/vendor/webmozart')
61
+            ->in($root . '/vendor/psr')
62
+            ->in($root . '/vendor/guzzle')
63
+            ->in($root . '/vendor/symfony')
64 64
         ;
65 65
 
66 66
         foreach ($finder as $file) {
67 67
             $this->addFile($phar, $file);
68 68
         }
69 69
 
70
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/autoload.php'));
71
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_namespaces.php'));
72
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_psr4.php'));
73
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_classmap.php'));
74
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_files.php'));
75
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/autoload_real.php'));
70
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/autoload.php'));
71
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_namespaces.php'));
72
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_psr4.php'));
73
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_classmap.php'));
74
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_files.php'));
75
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/autoload_real.php'));
76 76
 
77
-        if (file_exists($root.'/vendor/composer/include_paths.php')) {
78
-            $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/include_paths.php'));
77
+        if (file_exists($root . '/vendor/composer/include_paths.php')) {
78
+            $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/include_paths.php'));
79 79
         }
80
-        $this->addFile($phar, new \SplFileInfo($root.'/vendor/composer/ClassLoader.php'));
80
+        $this->addFile($phar, new \SplFileInfo($root . '/vendor/composer/ClassLoader.php'));
81 81
 
82
-        $binContent = file_get_contents($root.'/bin/monitor');
82
+        $binContent = file_get_contents($root . '/bin/monitor');
83 83
         $binContent = preg_replace('{^#!/usr/bin/env php\s*}', '', $binContent);
84 84
         $phar->addFromString('bin/monitor', $binContent);
85 85
 
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
 
92 92
     protected function addFile(\Phar $phar, \SplFileInfo $file, $strip = true)
93 93
     {
94
-        $path = str_replace(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR, '', $file->getRealPath());
94
+        $path = str_replace(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR, '', $file->getRealPath());
95 95
         $content = file_get_contents($file);
96 96
         if ($strip) {
97 97
             $content = self::stripWhitespace($content);
98 98
         } elseif ('LICENSE' === basename($file)) {
99
-            $content = "\n".$content."\n";
99
+            $content = "\n" . $content . "\n";
100 100
         }
101 101
 
102 102
         if ($path === 'src/Monitor.php') {
Please login to merge, or discard this patch.