@@ -18,7 +18,6 @@ |
||
18 | 18 | |
19 | 19 | use Symfony\Component\Console\Input; |
20 | 20 | use Symfony\Component\Console\Output; |
21 | - |
|
22 | 21 | use IPub; |
23 | 22 | use IPub\Packages; |
24 | 23 | use IPub\Packages\DependencyResolver; |
@@ -18,7 +18,6 @@ |
||
18 | 18 | |
19 | 19 | use Symfony\Component\Console\Input; |
20 | 20 | use Symfony\Component\Console\Output; |
21 | - |
|
22 | 21 | use IPub; |
23 | 22 | use IPub\Packages; |
24 | 23 | use IPub\Packages\DependencyResolver; |
@@ -18,10 +18,8 @@ |
||
18 | 18 | |
19 | 19 | use Symfony\Component\Console\Input; |
20 | 20 | use Symfony\Component\Console\Output; |
21 | - |
|
22 | 21 | use IPub; |
23 | 22 | use IPub\Packages; |
24 | -use IPub\Packages\DependencyResolver; |
|
25 | 23 | use IPub\Packages\Exceptions; |
26 | 24 | |
27 | 25 | /** |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | foreach ($packages as $package) { |
75 | 75 | $output->writeln(sprintf( |
76 | - '<info>%'. $maxLength .'s</info> | status: <comment>%-12s</comment> | version: <comment>%s</comment>', |
|
76 | + '<info>%'.$maxLength.'s</info> | status: <comment>%-12s</comment> | version: <comment>%s</comment>', |
|
77 | 77 | $package->getName(), |
78 | 78 | $this->packageManager->getStatus($package), |
79 | 79 | $this->packageManager->getVersion($package) |
@@ -19,10 +19,8 @@ |
||
19 | 19 | |
20 | 20 | use Symfony\Component\Console\Input; |
21 | 21 | use Symfony\Component\Console\Output; |
22 | - |
|
23 | 22 | use IPub; |
24 | 23 | use IPub\Packages; |
25 | -use IPub\Packages\DependencyResolver; |
|
26 | 24 | use IPub\Packages\Exceptions; |
27 | 25 | |
28 | 26 | /** |
@@ -18,7 +18,6 @@ discard block |
||
18 | 18 | |
19 | 19 | use Nette; |
20 | 20 | use Nette\Utils; |
21 | - |
|
22 | 21 | use IPub; |
23 | 22 | use IPub\Packages; |
24 | 23 | use IPub\Packages\DependencyResolver; |
@@ -27,7 +26,6 @@ discard block |
||
27 | 26 | use IPub\Packages\Installers; |
28 | 27 | use IPub\Packages\Repository; |
29 | 28 | use IPub\Packages\Scripts; |
30 | -use Tracy\Debugger; |
|
31 | 29 | |
32 | 30 | /** |
33 | 31 | * Packages manager |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | throw new \RuntimeException('Package path is missing.'); |
184 | 184 | } |
185 | 185 | |
186 | - if (!file_exists($file = $path . DIRECTORY_SEPARATOR . 'composer.json')) { |
|
186 | + if (!file_exists($file = $path.DIRECTORY_SEPARATOR.'composer.json')) { |
|
187 | 187 | throw new \RuntimeException('\'composer.json\' is missing.'); |
188 | 188 | } |
189 | 189 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | return $packageData['version']; |
194 | 194 | } |
195 | 195 | |
196 | - if (file_exists($file = $this->vendorDir . DIRECTORY_SEPARATOR . 'composer' . DIRECTORY_SEPARATOR . 'installed.json')) { |
|
196 | + if (file_exists($file = $this->vendorDir.DIRECTORY_SEPARATOR.'composer'.DIRECTORY_SEPARATOR.'installed.json')) { |
|
197 | 197 | $installed = Utils\Json::decode(file_get_contents($file), Utils\Json::FORCE_ARRAY); |
198 | 198 | |
199 | 199 | foreach ($installed as $packageData) { |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | |
579 | 579 | // Check if package is registered |
580 | 580 | if (!$packagesConfig->offsetExists($package->getName())) { |
581 | - throw new Exceptions\InvalidStateException(sprintf('Package "%s" is not registered. Please call ' . get_called_class() . '::registerAvailable first.', $package->getName())); |
|
581 | + throw new Exceptions\InvalidStateException(sprintf('Package "%s" is not registered. Please call '.get_called_class().'::registerAvailable first.', $package->getName())); |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | $packagesConfig[$package->getName()][self::PACKAGE_STATUS] = $status; |
@@ -662,6 +662,6 @@ discard block |
||
662 | 662 | */ |
663 | 663 | private function getPackageConfigPath() : string |
664 | 664 | { |
665 | - return $this->configDir . DIRECTORY_SEPARATOR . 'packages.php'; |
|
665 | + return $this->configDir.DIRECTORY_SEPARATOR.'packages.php'; |
|
666 | 666 | } |
667 | 667 | } |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | * @var array |
51 | 51 | */ |
52 | 52 | private $defaults = [ |
53 | - 'path' => NULL, // Paths where to search for packages |
|
54 | - 'dirs' => [ // Define path to folders |
|
55 | - 'configDir' => '%appDir%/config', // Path where is stored app configuration |
|
56 | - 'vendorDir' => '%appDir%/../vendor', // Path to composer vendor folder |
|
57 | - 'tempDir' => '%tempDir%', // Path to temporary folder |
|
53 | + 'path' => NULL, // Paths where to search for packages |
|
54 | + 'dirs' => [// Define path to folders |
|
55 | + 'configDir' => '%appDir%/config', // Path where is stored app configuration |
|
56 | + 'vendorDir' => '%appDir%/../vendor', // Path to composer vendor folder |
|
57 | + 'tempDir' => '%tempDir%', // Path to temporary folder |
|
58 | 58 | ], |
59 | - 'configFile' => 'config.neon', // Filename with enabled packages extensions |
|
59 | + 'configFile' => 'config.neon', // Filename with enabled packages extensions |
|
60 | 60 | 'loader' => [ |
61 | 61 | 'packageFiles' => [ |
62 | 62 | 'package.php', |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | |
84 | 84 | $builder->parameters['packages'] = []; |
85 | 85 | |
86 | - if (is_file($configuration['dirs']['configDir'] . DIRECTORY_SEPARATOR . 'packages.php')) { |
|
87 | - $packages = require $configuration['dirs']['configDir'] . DIRECTORY_SEPARATOR . 'packages.php'; |
|
86 | + if (is_file($configuration['dirs']['configDir'].DIRECTORY_SEPARATOR.'packages.php')) { |
|
87 | + $packages = require $configuration['dirs']['configDir'].DIRECTORY_SEPARATOR.'packages.php'; |
|
88 | 88 | |
89 | 89 | foreach ($packages as $name => $data) { |
90 | 90 | $builder->parameters['packages'][$name] = $data; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | ]; |
141 | 141 | |
142 | 142 | foreach ($commands as $name => $cmd) { |
143 | - $builder->addDefinition($this->prefix('commands' . lcfirst($name))) |
|
143 | + $builder->addDefinition($this->prefix('commands'.lcfirst($name))) |
|
144 | 144 | ->setClass($cmd) |
145 | 145 | ->addTag(Console\DI\ConsoleExtension::TAG_COMMAND); |
146 | 146 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $this->composerData = $composerData; |
46 | 46 | |
47 | 47 | if (!isset($composerData['name'])) { |
48 | - throw new Exceptions\UnexpectedValueException('Unknown package has no name defined (' . json_encode($composerData) . ').'); |
|
48 | + throw new Exceptions\UnexpectedValueException('Unknown package has no name defined ('.json_encode($composerData).').'); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 |
@@ -83,7 +83,7 @@ |
||
83 | 83 | throw new Exceptions\InvalidArgumentException(sprintf('Package \'%s\' does not exist.', $package)); |
84 | 84 | } |
85 | 85 | |
86 | - $path = $this->repository->findPackage($package)->getPath() . ($localPrefix ? '/' . $localPrefix : '') . ($pos ? substr($path, $pos) : ''); |
|
86 | + $path = $this->repository->findPackage($package)->getPath().($localPrefix ? '/'.$localPrefix : '').($pos ? substr($path, $pos) : ''); |
|
87 | 87 | |
88 | 88 | return Utils\Strings::replace($path, '~\\\~', '/'); |
89 | 89 | } |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | foreach ($this->packageFiles as $packageFile) { |
112 | - if (is_file($path . DIRECTORY_SEPARATOR . $packageFile)) { |
|
113 | - $class = $this->getPackageClassByFile($path . DIRECTORY_SEPARATOR . $packageFile); |
|
112 | + if (is_file($path.DIRECTORY_SEPARATOR.$packageFile)) { |
|
113 | + $class = $this->getPackageClassByFile($path.DIRECTORY_SEPARATOR.$packageFile); |
|
114 | 114 | |
115 | - include_once $path . DIRECTORY_SEPARATOR . $packageFile; |
|
115 | + include_once $path.DIRECTORY_SEPARATOR.$packageFile; |
|
116 | 116 | |
117 | 117 | return new $class($data); |
118 | 118 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | if (isset($tokens[$i][1])) { |
228 | - $namespace = $namespace ? $namespace . "\\" . $tokens[$i][1] : $tokens[$i][1]; |
|
228 | + $namespace = $namespace ? $namespace."\\".$tokens[$i][1] : $tokens[$i][1]; |
|
229 | 229 | $dlm = TRUE; |
230 | 230 | } |
231 | 231 |