@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('packages_path')) { |
|
3 | +if (!function_exists('packages_path')) { |
|
4 | 4 | function packages_path($path = '') |
5 | 5 | { |
6 | 6 | $pathPrefix = rtrim(Storage::disk('packages')->getAdapter()->getPathPrefix(), DIRECTORY_SEPARATOR); |
7 | 7 | |
8 | - if (! empty($path)) { |
|
8 | + if (!empty($path)) { |
|
9 | 9 | $pathPrefix .= DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR); |
10 | 10 | } |
11 | 11 |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | $packagerJson = self::$temp.DIRECTORY_SEPARATOR.'packager.json'; |
128 | 128 | |
129 | - if (! $this->storage->exists($packagerJson)) { |
|
129 | + if (!$this->storage->exists($packagerJson)) { |
|
130 | 130 | return false; |
131 | 131 | } |
132 | 132 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | private function buildLicense() |
151 | 151 | { |
152 | 152 | $licenseFile = self::$temp.DIRECTORY_SEPARATOR.'license.md'; |
153 | - if (! $this->storage->exists($licenseFile)) { |
|
153 | + if (!$this->storage->exists($licenseFile)) { |
|
154 | 154 | return false; |
155 | 155 | } |
156 | 156 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $package = Str::lower($this->argument('package')); |
30 | 30 | $this->alert("Creating a new package $package"); |
31 | 31 | |
32 | - if (! $this->packagist->checkFormat($package)) { |
|
32 | + if (!$this->packagist->checkFormat($package)) { |
|
33 | 33 | $this->error('Package name format must be vendor/package'); |
34 | 34 | |
35 | 35 | return 1; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->info("Require package $vendor/$package..."); |
89 | 89 | $this->composer->require("$vendor/$package:@dev", $this->option('dev')); |
90 | 90 | |
91 | - if (! is_link(base_path('vendor'.DIRECTORY_SEPARATOR.$vendor.DIRECTORY_SEPARATOR.$package))) { |
|
91 | + if (!is_link(base_path('vendor'.DIRECTORY_SEPARATOR.$vendor.DIRECTORY_SEPARATOR.$package))) { |
|
92 | 92 | $this->error('Package installed is not the local version!'); |
93 | 93 | |
94 | 94 | return 1; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | $result = $this->ask($question, $default); |
107 | 107 | |
108 | - if (! $result) { |
|
108 | + if (!$result) { |
|
109 | 109 | $this->error('Answer cannot be empty'); |
110 | 110 | |
111 | 111 | return $this->forceAnswer($question, $default); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'require-dev' => '-', |
48 | 48 | ]; |
49 | 49 | |
50 | - (new Process(['git', 'branch'], packages_path($package)))->run(function ( |
|
50 | + (new Process(['git', 'branch'], packages_path($package)))->run(function( |
|
51 | 51 | $type, |
52 | 52 | $buffer |
53 | 53 | ) use ( |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | }); |
61 | 61 | |
62 | - (new Process(['git', 'config', '--get', 'remote.origin.url'], packages_path($package)))->run(function ( |
|
62 | + (new Process(['git', 'config', '--get', 'remote.origin.url'], packages_path($package)))->run(function( |
|
63 | 63 | $type, |
64 | 64 | $buffer |
65 | 65 | ) use ( |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $package = $this->argument('package'); |
29 | 29 | |
30 | - if (! $package) { |
|
30 | + if (!$package) { |
|
31 | 31 | $choices = []; |
32 | 32 | foreach ($this->storage->directories() as $vendor) { |
33 | 33 | foreach ($this->storage->directories($vendor) as $package) { |
@@ -38,30 +38,30 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | // If is format vendor/name get information from packagist |
41 | - if (! $this->packagist->checkFormat($package)) { |
|
41 | + if (!$this->packagist->checkFormat($package)) { |
|
42 | 42 | $this->error('The package format must be vendor/name'); |
43 | 43 | |
44 | 44 | return 1; |
45 | 45 | } |
46 | 46 | |
47 | - if (! $this->composer->isInstalled($package)) { |
|
47 | + if (!$this->composer->isInstalled($package)) { |
|
48 | 48 | $this->error("The package $package is not installed!"); |
49 | 49 | |
50 | 50 | return 1; |
51 | 51 | } |
52 | 52 | |
53 | - if (! $this->storage->exists($package)) { |
|
53 | + if (!$this->storage->exists($package)) { |
|
54 | 54 | $this->error("The package $package is not a local package, you have to remove it manually!"); |
55 | 55 | |
56 | 56 | return 1; |
57 | 57 | } |
58 | 58 | |
59 | - if (! $this->confirm("<bg=red>You are about to remove the package $package, are you sure?</>")) { |
|
59 | + if (!$this->confirm("<bg=red>You are about to remove the package $package, are you sure?</>")) { |
|
60 | 60 | return 0; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $this->info("Removing package $package from composer..."); |
64 | - if (! $this->composer->remove($package)) { |
|
64 | + if (!$this->composer->remove($package)) { |
|
65 | 65 | $this->error('Fail to remove from composer!'); |
66 | 66 | |
67 | 67 | return 1; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // If is format vendor/name get information from packagist |
31 | 31 | if ($this->packagist->checkFormat($url)) { |
32 | 32 | $this->info('Getting package information from packagist.org...'); |
33 | - if (! $this->packagist->exists($url)) { |
|
33 | + if (!$this->packagist->exists($url)) { |
|
34 | 34 | $this->error('Package does not exists on packagist.org'); |
35 | 35 | |
36 | 36 | return 1; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | // Get information from the given repository URL |
45 | - if (! ($package = $this->package->parseFromUrl($url))) { |
|
45 | + if (!($package = $this->package->parseFromUrl($url))) { |
|
46 | 46 | $this->error('Package name or repository URL is invalid!'); |
47 | 47 | |
48 | 48 | return 1; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return 1; |
55 | 55 | } |
56 | 56 | |
57 | - if (! strpos(@get_headers($url)[0], '200')) { |
|
57 | + if (!strpos(@get_headers($url)[0], '200')) { |
|
58 | 58 | $this->error('Package URL is not readable!'); |
59 | 59 | |
60 | 60 | return 1; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | exec("git clone -q $url $tempPath", $output, $exit_code); |
68 | 68 | |
69 | 69 | // Get information from composer.json |
70 | - if (! $this->storage->exists(self::$temp.DIRECTORY_SEPARATOR.$package->vendor.DIRECTORY_SEPARATOR.$package->name.DIRECTORY_SEPARATOR.'composer.json')) { |
|
70 | + if (!$this->storage->exists(self::$temp.DIRECTORY_SEPARATOR.$package->vendor.DIRECTORY_SEPARATOR.$package->name.DIRECTORY_SEPARATOR.'composer.json')) { |
|
71 | 71 | $this->error('Package has no composer.json file!'); |
72 | 72 | $this->storage->deleteDirectory(self::$temp); |
73 | 73 | |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | $this->info("Installing package $vendor/$name..."); |
82 | 82 | |
83 | 83 | if ($this->storage->exists($vendor.DIRECTORY_SEPARATOR.$name)) { |
84 | - if (! $this->confirm('<fg=yellow>The package already exists in local folder, require current local package?</>')) { |
|
85 | - if (! $this->confirm('<fg=yellow>Clear local package and install the downloaded one?</>')) { |
|
84 | + if (!$this->confirm('<fg=yellow>The package already exists in local folder, require current local package?</>')) { |
|
85 | + if (!$this->confirm('<fg=yellow>Clear local package and install the downloaded one?</>')) { |
|
86 | 86 | $this->storage->deleteDirectory(self::$temp); |
87 | 87 | |
88 | 88 | return 0; |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | $this->storage->deleteDirectory(self::$temp); |
99 | 99 | |
100 | 100 | $this->info("Require package $vendor/$name..."); |
101 | - if (! $this->composer->require("$vendor/$name:@dev", $this->option('dev'))) { |
|
101 | + if (!$this->composer->require("$vendor/$name:@dev", $this->option('dev'))) { |
|
102 | 102 | $this->error('Package installation failed, require has failed!'); |
103 | 103 | |
104 | 104 | return 1; |
105 | 105 | } |
106 | 106 | |
107 | - if (! is_link(base_path("vendor/$package->vendor/$package->name"))) { |
|
107 | + if (!is_link(base_path("vendor/$package->vendor/$package->name"))) { |
|
108 | 108 | $this->error('Package installation failed, symlink has not been created!'); |
109 | 109 | |
110 | 110 | return 1; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | { |
60 | 60 | $action = $this->argument('action'); |
61 | 61 | |
62 | - if (! in_array($action, ['create', 'require', 'remove', 'list'])) { |
|
62 | + if (!in_array($action, ['create', 'require', 'remove', 'list'])) { |
|
63 | 63 | $this->help(); |
64 | 64 | |
65 | 65 | return 0; |