@@ -43,7 +43,7 @@ |
||
43 | 43 | * @Action |
44 | 44 | * @Logged |
45 | 45 | */ |
46 | - public function defaultAction($name, $selfedit="false") { |
|
46 | + public function defaultAction($name, $selfedit = "false") { |
|
47 | 47 | $this->initController($name, $selfedit); |
48 | 48 | |
49 | 49 | $patchService = new InstanceProxy($name, $selfedit == "true"); |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | <?php |
20 | 20 | echo '<button class="btn btn-large btn-success patch-run-all"><i class="icon-arrow-right icon-white"></i> Apply '; |
21 | 21 | if ($this->nbAwaiting != 0) { |
22 | - echo $this->nbAwaiting." awaiting patch".(($this->nbAwaiting != 1)?"es":""); |
|
22 | + echo $this->nbAwaiting." awaiting patch".(($this->nbAwaiting != 1) ? "es" : ""); |
|
23 | 23 | if ($this->nbError != 0) { |
24 | 24 | echo " and "; |
25 | 25 | } |
26 | 26 | } |
27 | 27 | if ($this->nbError != 0) { |
28 | - echo $this->nbError." patch".(($this->nbError != 1)?"es":"")." in error"; |
|
28 | + echo $this->nbError." patch".(($this->nbError != 1) ? "es" : "")." in error"; |
|
29 | 29 | } |
30 | 30 | echo '</button>'; |
31 | 31 | ?> |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | <td> |
67 | 67 | <?php |
68 | 68 | |
69 | - echo '<button class="btn btn-mini btn-success patch-apply" '.(($patch['status'] == PatchInterface::STATUS_APPLIED)?'disabled="disabled"':'').'><i class="icon-arrow-right icon-white"></i> Apply</button>'; |
|
70 | - echo ' <button class="btn btn-mini btn-info patch-skip" '.(($patch['status'] == PatchInterface::STATUS_APPLIED || $patch['status'] == PatchInterface::STATUS_SKIPPED)?'disabled="disabled"':'').'><i class="icon-share-alt icon-white"></i> Skip</button>'; |
|
69 | + echo '<button class="btn btn-mini btn-success patch-apply" '.(($patch['status'] == PatchInterface::STATUS_APPLIED) ? 'disabled="disabled"' : '').'><i class="icon-arrow-right icon-white"></i> Apply</button>'; |
|
70 | + echo ' <button class="btn btn-mini btn-info patch-skip" '.(($patch['status'] == PatchInterface::STATUS_APPLIED || $patch['status'] == PatchInterface::STATUS_SKIPPED) ? 'disabled="disabled"' : '').'><i class="icon-share-alt icon-white"></i> Skip</button>'; |
|
71 | 71 | if ($patch['canRevert']) { |
72 | - echo ' <button class="btn btn-mini btn-inverse patch-revert" '.(($patch['status'] == PatchInterface::STATUS_AWAITING)?'disabled="disabled"':'').'><i class="icon-arrow-left icon-white"></i> Revert</button>'; |
|
72 | + echo ' <button class="btn btn-mini btn-inverse patch-revert" '.(($patch['status'] == PatchInterface::STATUS_AWAITING) ? 'disabled="disabled"' : '').'><i class="icon-arrow-left icon-white"></i> Revert</button>'; |
|
73 | 73 | } |
74 | 74 | if ($patch['edit_url']) { |
75 | 75 | echo ' <a class="btn btn-mini btn-danger patch-edit" href="'.ROOT_URL.$patch['edit_url'].'"><i class="icon-edit icon-white"></i> Edit</a>'; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <tr> |
83 | 83 | <td colspan="4"> |
84 | 84 | <div class="alert alert-error"> |
85 | - <strong>Last error message</strong>: <?php echo plainstring_to_htmlprotected($patch['error_message']);?> |
|
85 | + <strong>Last error message</strong>: <?php echo plainstring_to_htmlprotected($patch['error_message']); ?> |
|
86 | 86 | </div> |
87 | 87 | </td> |
88 | 88 | </tr> |
@@ -3,8 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Mouf\Utils\Patcher\PatchInterface; |
5 | 5 | use Mouf\Utils\Patcher\PatchService; |
6 | -use Symfony\Component\Console\Helper\Table; |
|
7 | -use Symfony\Component\Console\Input\InputArgument; |
|
8 | 6 | use Symfony\Component\Console\Input\InputOption; |
9 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
10 | 8 | use Symfony\Component\Console\Input\InputInterface; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | <input name="name" type="hidden" value="<?php echo plainstring_to_htmlprotected($this->instanceName); ?>"></input> |
9 | 9 | <input name="selfedit" type="hidden" value="<?php echo plainstring_to_htmlprotected($this->selfedit); ?>"></input> |
10 | 10 | <?php foreach ($this->nbPatchesByType as $name => $number): ?> |
11 | - <label class="checkbox"><input type="checkbox" name="types[]" value="<?= plainstring_to_htmlprotected($name) ?>" <?php if ($name == '') { echo "checked readonly"; } ?> /> <?= plainstring_to_htmlprotected($name?:'default') ?> (<?= $number ?> patch<?= $number > 1 ? 'es':'' ?>)</label> |
|
11 | + <label class="checkbox"><input type="checkbox" name="types[]" value="<?= plainstring_to_htmlprotected($name) ?>" <?php if ($name == '') { echo "checked readonly"; } ?> /> <?= plainstring_to_htmlprotected($name ?: 'default') ?> (<?= $number ?> patch<?= $number > 1 ? 'es' : '' ?>)</label> |
|
12 | 12 | <?php endforeach; ?> |
13 | 13 | |
14 | 14 | <button class="btn btn-large btn-success"><i class="icon-arrow-right icon-white"></i> Apply selected patches</button> |
@@ -197,15 +197,15 @@ |
||
197 | 197 | |
198 | 198 | $html = '<strong>Patcher</strong>: <a href="'.ROOT_URL.'vendor/mouf/mouf/patcher/?name='.$instanceName.'" class="btn btn-large btn-success patch-run-all"><i class="icon-arrow-right icon-white"></i> Apply '; |
199 | 199 | if ($nbAwaitingPatchs != 0) { |
200 | - $html .= $nbAwaitingPatchs." awaiting patch".(($nbAwaitingPatchs != 1)?"es":""); |
|
200 | + $html .= $nbAwaitingPatchs." awaiting patch".(($nbAwaitingPatchs != 1) ? "es" : ""); |
|
201 | 201 | if ($nbPatchesInError != 0) { |
202 | - $html .=" and"; |
|
202 | + $html .= " and"; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | if ($nbPatchesInError != 0) { |
206 | - $html .=$nbPatchesInError." patch".(($nbPatchesInError != 1)?"es":"")." in error"; |
|
206 | + $html .= $nbPatchesInError." patch".(($nbPatchesInError != 1) ? "es" : "")." in error"; |
|
207 | 207 | } |
208 | - $html .='</a>'; |
|
208 | + $html .= '</a>'; |
|
209 | 209 | |
210 | 210 | |
211 | 211 | return new MoufValidatorResult($status, $html); |
@@ -86,7 +86,7 @@ |
||
86 | 86 | * |
87 | 87 | * @return string |
88 | 88 | */ |
89 | - public function getLastErrorMessage(): ?string; |
|
89 | + public function getLastErrorMessage(): ? string; |
|
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Returns the URL that can be used to edit this patch. |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Mouf\Utils\Patcher; |
5 | 5 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $patches = $this->patchService->getView(); |
55 | 55 | |
56 | 56 | $rows = array_map(function($row) { |
57 | - return [ $row['uniqueName'], $this->renderStatus($row['status']), $row['patch_type'] ?: '(default)' ]; |
|
57 | + return [$row['uniqueName'], $this->renderStatus($row['status']), $row['patch_type'] ?: '(default)']; |
|
58 | 58 | }, $patches); |
59 | 59 | |
60 | 60 | $table = new Table($output); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $patchService = InstallUtils::getOrCreateInstance('patchService', PatchService::class, $moufManager); |
40 | 40 | |
41 | 41 | if (empty($patchService->getConstructorArgumentProperty('types')->getValue())) { |
42 | - $patchService->getConstructorArgumentProperty('types')->setValue([ $patchDefaultType, $patchTestDataType ]); |
|
42 | + $patchService->getConstructorArgumentProperty('types')->setValue([$patchDefaultType, $patchTestDataType]); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $consoleUtils = new ConsoleUtils($moufManager); |