Completed
Pull Request — master (#22)
by
unknown
02:08
created
src/LEtudiant/Composer/Installer/Config/SharedPackageInstallerConfig.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         if (!isset($extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['vendor-dir'])) {
66 66
             throw new \InvalidArgumentException(
67
-                'The "vendor-dir" parameter for "' . SharedPackageInstaller::PACKAGE_TYPE . '" configuration '
67
+                'The "vendor-dir" parameter for "'.SharedPackageInstaller::PACKAGE_TYPE.'" configuration '
68 68
                 . 'should be provided in your project composer.json ("extra" key)'
69 69
             );
70 70
         }
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
      */
87 87
     protected function setSymlinkDirectory($baseDir, array $extraConfigs)
88 88
     {
89
-        $this->symlinkDir = $baseDir . 'vendor-shared';
89
+        $this->symlinkDir = $baseDir.'vendor-shared';
90 90
 
91 91
         if (isset($extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['symlink-dir'])) {
92 92
             $this->symlinkDir = $extraConfigs[SharedPackageInstaller::PACKAGE_TYPE]['symlink-dir'];
93 93
 
94 94
             if ('/' != $this->symlinkDir[0]) {
95
-                $this->symlinkDir = $baseDir . $this->symlinkDir;
95
+                $this->symlinkDir = $baseDir.$this->symlinkDir;
96 96
             }
97 97
         }
98 98
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         }
113 113
 
114 114
         if ('/' != $this->vendorDir[0]) {
115
-            $this->vendorDir = $baseDir . $this->vendorDir;
115
+            $this->vendorDir = $baseDir.$this->vendorDir;
116 116
         }
117 117
     }
118 118
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         // Up to the project root directory
144 144
         if (0 < strpos($this->symlinkBasePath, '/')) {
145
-            $this->symlinkBasePath = '../../' . $this->symlinkBasePath;
145
+            $this->symlinkBasePath = '../../'.$this->symlinkBasePath;
146 146
         }
147 147
     }
148 148
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     public function getOriginalVendorDir($endingSlash = false)
220 220
     {
221 221
         if ($endingSlash && null != $this->originalVendorDir) {
222
-            return $this->originalVendorDir . '/';
222
+            return $this->originalVendorDir.'/';
223 223
         }
224 224
 
225 225
         return $this->originalVendorDir;
Please login to merge, or discard this patch.
src/LEtudiant/Composer/Installer/Solver/SharedPackageSolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -92,12 +92,12 @@
 block discarded – undo
92 92
             if (false !== strpos($packageName, '*')) {
93 93
                 $pattern = str_replace('*', '[a-zA-Z0-9-_]+', str_replace('/', '\/', $packageName));
94 94
 
95
-                $callbacks[] = function ($packagePrettyName) use ($pattern) {
96
-                    return 1 === preg_match('/' . $pattern . '/', $packagePrettyName);
95
+                $callbacks[] = function($packagePrettyName) use ($pattern) {
96
+                    return 1 === preg_match('/'.$pattern.'/', $packagePrettyName);
97 97
                 };
98 98
             // Raw package name
99 99
             } else {
100
-                $callbacks[] = function ($packagePrettyName) use ($packageName) {
100
+                $callbacks[] = function($packagePrettyName) use ($packageName) {
101 101
                     return $packageName === $packagePrettyName;
102 102
                 };
103 103
             }
Please login to merge, or discard this patch.
src/LEtudiant/Composer/Installer/Solver/SharedPackageInstallerSolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             $this->defaultInstaller->update($repo, $initial, $target);
117 117
         } else {
118 118
             if (!$repo->hasPackage($initial)) {
119
-                throw new \InvalidArgumentException('Package is not installed : ' . $initial->getPrettyName());
119
+                throw new \InvalidArgumentException('Package is not installed : '.$initial->getPrettyName());
120 120
             }
121 121
 
122 122
             $this->symlinkInstaller->update($repo, $initial, $target);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     {
134 134
         if ($this->solver->isSharedPackage($package)) {
135 135
             if (!$repo->hasPackage($package)) {
136
-                throw new \InvalidArgumentException('Package is not installed : ' . $package->getPrettyName());
136
+                throw new \InvalidArgumentException('Package is not installed : '.$package->getPrettyName());
137 137
             }
138 138
 
139 139
             $this->symlinkInstaller->uninstall($repo, $package);
Please login to merge, or discard this patch.
src/LEtudiant/Composer/Util/SymlinkFilesystem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         if (is_link($symlinkPath)) {
50 50
             if (!$this->unlink($symlinkPath)) {
51 51
                 // @codeCoverageIgnoreStart
52
-                throw new \RuntimeException('Unable to remove the symlink : ' . $symlinkPath);
52
+                throw new \RuntimeException('Unable to remove the symlink : '.$symlinkPath);
53 53
                 // @codeCoverageIgnoreEnd
54 54
             }
55 55
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         if (is_dir($directoryPath) && $this->isDirEmpty($directoryPath)) {
72 72
             if (!$this->removeDirectory($directoryPath)) {
73 73
                 // @codeCoverageIgnoreStart
74
-                throw new \RuntimeException('Unable to remove the directory : ' . $directoryPath);
74
+                throw new \RuntimeException('Unable to remove the directory : '.$directoryPath);
75 75
                 // @codeCoverageIgnoreEnd
76 76
             }
77 77
 
Please login to merge, or discard this patch.
src/LEtudiant/Composer/Data/Package/SharedPackageDataManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function updatePackageUsageFile(PackageInterface $package, array $packageData)
61 61
     {
62
-        $packageKey = $package->getPrettyName() . '/' . $package->getPrettyVersion();
62
+        $packageKey = $package->getPrettyName().'/'.$package->getPrettyVersion();
63 63
 
64 64
         // Remove the row if there is no data anymore
65 65
         if (!isset($packageData[0])) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         }
77 77
 
78 78
         file_put_contents(
79
-            $this->vendorDir . DIRECTORY_SEPARATOR . self::PACKAGE_DATA_FILENAME,
79
+            $this->vendorDir.DIRECTORY_SEPARATOR.self::PACKAGE_DATA_FILENAME,
80 80
             json_encode($this->packagesData)
81 81
         );
82 82
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     protected function initializePackageData()
137 137
     {
138
-        $filePath = $this->vendorDir . DIRECTORY_SEPARATOR . self::PACKAGE_DATA_FILENAME;
138
+        $filePath = $this->vendorDir.DIRECTORY_SEPARATOR.self::PACKAGE_DATA_FILENAME;
139 139
         if (!is_file($filePath)) {
140 140
             $this->packagesData = array();
141 141
         } else {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $this->initializePackageData();
157 157
         }
158 158
 
159
-        $packageKey = $package->getPrettyName() . '/' . $package->getPrettyVersion();
159
+        $packageKey = $package->getPrettyName().'/'.$package->getPrettyVersion();
160 160
         if (!isset($this->packagesData[$packageKey])) {
161 161
             return $defaultValue;
162 162
         }
Please login to merge, or discard this patch.
src/LEtudiant/Composer/Installer/SharedPackageInstaller.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
         $this->initializeVendorDir();
86 86
 
87 87
         $basePath =
88
-            $this->vendorDir . DIRECTORY_SEPARATOR
89
-            . $package->getPrettyName() . DIRECTORY_SEPARATOR
88
+            $this->vendorDir.DIRECTORY_SEPARATOR
89
+            . $package->getPrettyName().DIRECTORY_SEPARATOR
90 90
             . $package->getPrettyVersion()
91 91
         ;
92 92
 
93 93
         $targetDir = $package->getTargetDir();
94 94
 
95
-        return $basePath . ($targetDir ? '/' . $targetDir : '');
95
+        return $basePath.($targetDir ? '/'.$targetDir : '');
96 96
     }
97 97
 
98 98
     /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     protected function getPackageVendorSymlink(PackageInterface $package)
104 104
     {
105
-        return $this->config->getSymlinkDir() . DIRECTORY_SEPARATOR . $package->getPrettyName();
105
+        return $this->config->getSymlinkDir().DIRECTORY_SEPARATOR.$package->getPrettyName();
106 106
     }
107 107
 
108 108
     /**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $this->packageDataManager->addPackageUsage($package);
123 123
 
124 124
         $binaries = $package->getBinaries();
125
-        if (!empty($binaries) && !file_exists($this->getInstallPath($package) . '/vendor')) {
125
+        if (!empty($binaries) && !file_exists($this->getInstallPath($package).'/vendor')) {
126 126
 
127 127
             $factory = new Factory();
128 128
             $subcomposer = $factory->createComposer(
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
     public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
201 201
     {
202 202
         if ($this->isSourceDirUnused($package) && $this->io->askConfirmation(
203
-                "The package version <info>" . $package->getPrettyName() . "</info> "
204
-                . "(<fg=yellow>" . $package->getPrettyVersion() . "</fg=yellow>) seems to be unused."
203
+                "The package version <info>".$package->getPrettyName()."</info> "
204
+                . "(<fg=yellow>".$package->getPrettyVersion()."</fg=yellow>) seems to be unused."
205 205
                 . PHP_EOL
206 206
                 . 'Do you want to <fg=red>delete the source folder</fg=red> ? [y/n] (default: no) : ',
207 207
                 false
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
             )
244 244
         ) {
245 245
             $this->io->write(array(
246
-                '  - Creating symlink for <info>' . $package->getPrettyName()
247
-                . '</info> (<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)',
246
+                '  - Creating symlink for <info>'.$package->getPrettyName()
247
+                . '</info> (<fg=yellow>'.$package->getPrettyVersion().'</fg=yellow>)',
248 248
                 ''
249 249
             ));
250 250
         }
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
             $targetDir = $package->getTargetDir();
262 262
             $sourcePath =
263 263
                 $this->config->getSymlinkBasePath()
264
-                . '/' . $package->getPrettyName()
265
-                . '/' . $package->getPrettyVersion()
266
-                . ($targetDir ? '/' . $targetDir : '')
264
+                . '/'.$package->getPrettyName()
265
+                . '/'.$package->getPrettyVersion()
266
+                . ($targetDir ? '/'.$targetDir : '')
267 267
             ;
268 268
         } else {
269 269
             $sourcePath = $this->getInstallPath($package);
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
             && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))
285 285
         ) {
286 286
             $this->io->write(array(
287
-                '  - Deleting symlink for <info>' . $package->getPrettyName() . '</info> '
288
-                . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)',
287
+                '  - Deleting symlink for <info>'.$package->getPrettyName().'</info> '
288
+                . '(<fg=yellow>'.$package->getPrettyVersion().'</fg=yellow>)',
289 289
                 ''
290 290
             ));
291 291
 
Please login to merge, or discard this patch.