@@ -54,31 +54,31 @@ discard block |
||
54 | 54 | * @return Collection |
55 | 55 | */ |
56 | 56 | protected function compile(CommandContextInterface $commandContext) { |
57 | - $this->logFile = storage_path('logs/async/' . (string) round(microtime(true) * 1000) . |
|
58 | - mt_rand(1, 10000) . '.log'); |
|
57 | + $this->logFile = storage_path('logs/async/'.(string) round(microtime(true) * 1000). |
|
58 | + mt_rand(1, 10000).'.log'); |
|
59 | 59 | |
60 | 60 | $memoryLimit = config('satis.memory_limit'); |
61 | 61 | $buildVerbosity = config('satis.build_verbosity'); |
62 | 62 | |
63 | 63 | $chunks = new Collection([ |
64 | - 'php' . ($memoryLimit !== null ? ' -dmemory_limit=' . $memoryLimit : ''), |
|
64 | + 'php'.($memoryLimit !== null ? ' -dmemory_limit='.$memoryLimit : ''), |
|
65 | 65 | sprintf($this->executable, DIRECTORY_SEPARATOR), |
66 | - $this->command . ($buildVerbosity !== null ? ' -' . $buildVerbosity : ''), |
|
66 | + $this->command.($buildVerbosity !== null ? ' -'.$buildVerbosity : ''), |
|
67 | 67 | $this->configPath, |
68 | 68 | $this->buildDirectory |
69 | 69 | ]); |
70 | 70 | |
71 | - if($this->item !== null) { |
|
71 | + if ($this->item !== null) { |
|
72 | 72 | $chunks->push($this->item); |
73 | 73 | } |
74 | 74 | |
75 | 75 | $chunks->push($commandContext->getOutputRedirection($this->logFile)); |
76 | 76 | $chunks->push($commandContext->getShouldUnlockOnCompletion()); |
77 | 77 | |
78 | - foreach(['http', 'https'] as $protocol) { |
|
78 | + foreach (['http', 'https'] as $protocol) { |
|
79 | 79 | $proxy = $this->proxySettings->get($protocol); |
80 | - if($proxy !== null) { |
|
81 | - $chunks->prepend(strtoupper($protocol) . '_PROXY=' . $proxy); |
|
80 | + if ($proxy !== null) { |
|
81 | + $chunks->prepend(strtoupper($protocol).'_PROXY='.$proxy); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $logger = $commandContext->getLogger(); |
113 | 113 | |
114 | 114 | $logger->info(str_repeat('=', 30)); |
115 | - $logger->info('Running command => ' . PHP_EOL . $commandChunks->implode(' ')); |
|
115 | + $logger->info('Running command => '.PHP_EOL.$commandChunks->implode(' ')); |
|
116 | 116 | |
117 | 117 | chdir($this->directory); |
118 | 118 | |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | |
121 | 121 | chdir($this->currentDirectory); |
122 | 122 | |
123 | - if($commandContext instanceof SyncCommand) { |
|
124 | - $logger->info('Command output => ' . implode(PHP_EOL, $output)); |
|
123 | + if ($commandContext instanceof SyncCommand) { |
|
124 | + $logger->info('Command output => '.implode(PHP_EOL, $output)); |
|
125 | 125 | } else { |
126 | - $logger->notice('Command output can be found in "' . $this->logFile . '".'); |
|
126 | + $logger->notice('Command output can be found in "'.$this->logFile.'".'); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | $this->setCommandOutput($output); |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | * @param string $item |
170 | 170 | */ |
171 | 171 | public function setItem($item) { |
172 | - if($item === null) { |
|
172 | + if ($item === null) { |
|
173 | 173 | return; |
174 | 174 | } |
175 | 175 | |
176 | - if(preg_match(Repository::REGEX, $item)) { |
|
177 | - $this->item = '--repository-url ' . escapeshellarg($item); |
|
176 | + if (preg_match(Repository::REGEX, $item)) { |
|
177 | + $this->item = '--repository-url '.escapeshellarg($item); |
|
178 | 178 | } else { |
179 | 179 | $this->item = escapeshellarg($item); |
180 | 180 | } |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | public function run($asyncMode = true) { |
210 | 210 | # -- force sync |
211 | 211 | #if(true) { |
212 | - if($asyncMode === false || $this->isWindows() === true) { |
|
213 | - if($this->isWindows() === true) { |
|
212 | + if ($asyncMode === false || $this->isWindows() === true) { |
|
213 | + if ($this->isWindows() === true) { |
|
214 | 214 | $this->getLogger() |
215 | 215 | ->warn('OS does not support async mode, forcing sync.'); |
216 | 216 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | $result = $this->exec(new SyncCommand()); |
234 | 234 | |
235 | - if($result !== 0) { |
|
235 | + if ($result !== 0) { |
|
236 | 236 | throw new PackageBuildFailedException('Package build failed. Check build log for details.'); |
237 | 237 | } |
238 | 238 |
@@ -13,85 +13,85 @@ |
||
13 | 13 | */ |
14 | 14 | class Repository { |
15 | 15 | |
16 | - const REGEX = '#((git|ssh|http(s)?)|(git@[\w.]+))(:(\/\/)?)([\w.@:\/\-~]+)(.git)(\/)?#'; |
|
16 | + const REGEX = '#((git|ssh|http(s)?)|(git@[\w.]+))(:(\/\/)?)([\w.@:\/\-~]+)(.git)(\/)?#'; |
|
17 | 17 | |
18 | - /** |
|
19 | - * @Type("string") |
|
20 | - */ |
|
21 | - private $type; |
|
18 | + /** |
|
19 | + * @Type("string") |
|
20 | + */ |
|
21 | + private $type; |
|
22 | 22 | |
23 | - /** |
|
24 | - * @Type("string") |
|
25 | - */ |
|
26 | - private $url; |
|
23 | + /** |
|
24 | + * @Type("string") |
|
25 | + */ |
|
26 | + private $url; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Initialize with default opinionated values |
|
30 | - */ |
|
31 | - public function __construct() { |
|
28 | + /** |
|
29 | + * Initialize with default opinionated values |
|
30 | + */ |
|
31 | + public function __construct() { |
|
32 | 32 | $this->type = config('satis.default_repository_type'); |
33 | 33 | $this->url = ''; |
34 | - } |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Get the string representation |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function __toString() { |
|
36 | + /** |
|
37 | + * Get the string representation |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function __toString() { |
|
42 | 42 | return $this->url; |
43 | - } |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * Get type |
|
47 | - * |
|
48 | - * @return string $type |
|
49 | - */ |
|
50 | - public function getType() { |
|
45 | + /** |
|
46 | + * Get type |
|
47 | + * |
|
48 | + * @return string $type |
|
49 | + */ |
|
50 | + public function getType() { |
|
51 | 51 | return $this->type; |
52 | - } |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Set type |
|
56 | - * |
|
57 | - * @param string $type |
|
58 | - * |
|
59 | - * @return static |
|
60 | - */ |
|
61 | - public function setType($type) { |
|
54 | + /** |
|
55 | + * Set type |
|
56 | + * |
|
57 | + * @param string $type |
|
58 | + * |
|
59 | + * @return static |
|
60 | + */ |
|
61 | + public function setType($type) { |
|
62 | 62 | $this->type = strtolower($type); |
63 | 63 | |
64 | 64 | return $this; |
65 | - } |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * Get url |
|
69 | - * |
|
70 | - * @return string $url |
|
71 | - */ |
|
72 | - public function getUrl() { |
|
67 | + /** |
|
68 | + * Get url |
|
69 | + * |
|
70 | + * @return string $url |
|
71 | + */ |
|
72 | + public function getUrl() { |
|
73 | 73 | return $this->url; |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * Set url |
|
78 | - * |
|
79 | - * @param string $url |
|
80 | - * |
|
81 | - * @return static |
|
82 | - */ |
|
83 | - public function setUrl($url) { |
|
76 | + /** |
|
77 | + * Set url |
|
78 | + * |
|
79 | + * @param string $url |
|
80 | + * |
|
81 | + * @return static |
|
82 | + */ |
|
83 | + public function setUrl($url) { |
|
84 | 84 | $this->url = urldecode(strtolower($url)); |
85 | 85 | |
86 | 86 | return $this; |
87 | - } |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * Get repository ID |
|
91 | - * |
|
92 | - * @return string |
|
93 | - */ |
|
94 | - public function getId() { |
|
89 | + /** |
|
90 | + * Get repository ID |
|
91 | + * |
|
92 | + * @return string |
|
93 | + */ |
|
94 | + public function getId() { |
|
95 | 95 | return ConfigManager::nameToId($this->url); |
96 | - } |
|
96 | + } |
|
97 | 97 | } |