Skip to content

Commit 8e9eac0

Browse files
committed
Code style fixes.
1 parent 3080851 commit 8e9eac0

12 files changed

Lines changed: 25 additions & 24 deletions

File tree

src/Application.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,16 @@ protected function handleRequestInner(): Response
118118
}
119119

120120
if (!$this->controllerExists($this->route)) {
121-
throw new NotFoundException('Controller ' . $this->toPhpName($this->route['controller']) . ' does not exist!');
121+
throw new NotFoundException(
122+
'Controller ' . $this->toPhpName($this->route['controller']) . ' does not exist!'
123+
);
122124
}
123125

124126
$action = lcfirst($this->toPhpName($this->route['action']));
125127
if (!$this->getController()->hasAction($action)) {
126-
throw new NotFoundException('Controller ' . $this->toPhpName($this->route['controller']) . ' does not have action ' . $action . '!');
128+
throw new NotFoundException(
129+
'Controller ' . $this->toPhpName($this->route['controller']) . ' does not have action ' . $action . '!'
130+
);
127131
}
128132

129133
return $this->getController()->handleAction($action, $this->route['args']);

src/Builder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,12 @@ public function logExecOutput(bool $enableLog = true): void
319319
*
320320
* @throws Exception when no binary has been found.
321321
*/
322-
public function findBinary($binary, string $priorityPath = 'local', string $binaryPath = '', array $binaryName = []): string
323-
{
322+
public function findBinary(
323+
$binary,
324+
string $priorityPath = 'local',
325+
string $binaryPath = '',
326+
array $binaryName = []
327+
): string {
324328
return $this->commandExecutor->findBinary($binary, $priorityPath, $binaryPath, $binaryName);
325329
}
326330

src/Command/WorkerCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
*/
2828
class WorkerCommand extends Command
2929
{
30-
public const MIN_QUEUE_PRIORITY = 24;
31-
public const MAX_QUEUE_PRIORITY = 2025;
30+
private const MIN_QUEUE_PRIORITY = 24;
31+
private const MAX_QUEUE_PRIORITY = 2025;
3232

3333
protected BuildService $buildService;
3434

src/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242
class Application extends BaseApplication
4343
{
44-
public const LOGO = <<<'LOGO'
44+
private const LOGO = <<<'LOGO'
4545
____ __ ______ ______
4646
/ __ \/ / / / __ \ / ____/__ ____ _________ _____
4747
/ /_/ / /_/ / /_/ / / / / _ \/ __ \/ ___/ __ \/ ___/

src/Controller/BuildController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ protected function cleanLog(string $log): string
355355

356356
/**
357357
* Formats a list of builds into rows suitable for the dropdowns in the header bar.
358-
*
359-
*
360358
*/
361359
protected function formatBuilds(array $builds): array
362360
{

src/Model/Base/Build.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ public function getExtra($key = null)
454454

455455
/**
456456
* @return bool
457-
*
458457
*/
459458
public function setExtra(array $value)
460459
{

src/Model/Build.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,9 @@ public function handleConfigBeforeClone(Builder $builder)
238238
}
239239

240240
/**
241-
* @param string $buildPath
242-
*
243-
* @return bool
244-
*
245241
* @throws Exception
246242
*/
247-
protected function handleConfig(Builder $builder, $buildPath)
243+
protected function handleConfig(Builder $builder, string $buildPath): bool
248244
{
249245
$yamlParser = new YamlParser();
250246
$overwriteBuildConfig = $this->getProject()->getOverwriteBuildConfig();

src/Model/Project.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ public function setEnvironments($value)
212212
if ($key !== false) {
213213
// already exist
214214
unset($environmentsNames[$key]);
215-
$environment->setBranches(!empty($environmentsConfig[$environment->getName()]) ? $environmentsConfig[$environment->getName()] : []);
215+
$branches = !empty($environmentsConfig[$environment->getName()])
216+
? $environmentsConfig[$environment->getName()]
217+
: [];
218+
$environment->setBranches($branches);
216219
$store->save($environment);
217220
} else {
218221
// remove
@@ -235,7 +238,7 @@ public function setEnvironments($value)
235238
/**
236239
* @param string $branch
237240
*
238-
* @return string[]
241+
* @return int[]
239242
*/
240243
public function getEnvironmentsNamesByBranch($branch)
241244
{

src/Plugin/Env.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ public function execute()
3232
foreach ($this->options as $key => $value) {
3333
if (\is_numeric($key)) {
3434
// This allows the developer to specify env vars like " - FOO=bar" or " - FOO: bar"
35-
$envVar = \is_array($value) ? \key($value) . '=' . \current($value) : $value;
35+
$envVar = \is_array($value)
36+
? (\key($value) . '=' . \current($value))
37+
: $value;
3638
} else {
3739
// This allows the standard syntax: "FOO: bar"
3840
$envVar = "$key=$value";

src/Service/BuildService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function createBuild(
6565
?string $committerEmail = null,
6666
?string $commitMessage = null,
6767
int $source = Build::SOURCE_UNKNOWN,
68-
int $userId = null,
68+
?int $userId = null,
6969
?array $extra = null
7070
): Build {
7171
$build = new Build($this->storeRegistry);

0 commit comments

Comments
 (0)