From 0bff5ada1f315fb9e5165415160c06dffb8b8dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 5 Oct 2021 15:22:29 +0200 Subject: [PATCH] Adjust to CS fixer v3.2 rules --- demos/basic/button.php | 2 +- src/Form/Control/Calendar.php | 6 +++--- src/Form/Control/Multiline.php | 2 +- src/Form/Control/ScopeBuilder.php | 2 +- src/JsSse.php | 2 +- src/Table/Column/ColorRating.php | 2 +- src/UserAction/ConfirmationExecutor.php | 2 +- src/UserAction/ModalExecutor.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/demos/basic/button.php b/demos/basic/button.php index 1cc9c62a5e..0189833bd2 100644 --- a/demos/basic/button.php +++ b/demos/basic/button.php @@ -56,7 +56,7 @@ // Creating your own button component example /** @var Button $forkButtonClass */ -$forkButtonClass = get_class(new class(0) extends Button { // need 0 argument here for constructor +$forkButtonClass = get_class(new class(0) /* need 0 argument here for constructor */ extends Button { public function __construct($n) { Icon::addTo(Button::addTo($this, ['Forks', 'blue']), ['fork']); diff --git a/src/Form/Control/Calendar.php b/src/Form/Control/Calendar.php index 4d1d27ea67..37575bb000 100644 --- a/src/Form/Control/Calendar.php +++ b/src/Form/Control/Calendar.php @@ -80,14 +80,14 @@ protected function init(): void if ($this->type === 'datetime' || $this->type === 'time') { $this->options['enableTime'] = true; - $this->options['time_24hr'] = $this->options['time_24hr'] ?? $this->use24hrTimeFormat($this->options['altFormat'] ?? $this->options['dateFormat']); + $this->options['time_24hr'] ??= $this->use24hrTimeFormat($this->options['altFormat'] ?? $this->options['dateFormat']); $this->options['noCalendar'] = ($this->type === 'time'); // Add seconds picker if set - $this->options['enableSeconds'] = $this->options['enableSeconds'] ?? $this->useSeconds($this->options['altFormat'] ?? $this->options['dateFormat']); + $this->options['enableSeconds'] ??= $this->useSeconds($this->options['altFormat'] ?? $this->options['dateFormat']); // Allow edit if microseconds is set. - $this->options['allowInput'] = $this->options['allowInput'] ?? $this->allowMicroSecondsInput($this->options['altFormat'] ?? $this->options['dateFormat']); + $this->options['allowInput'] ??= $this->allowMicroSecondsInput($this->options['altFormat'] ?? $this->options['dateFormat']); } } diff --git a/src/Form/Control/Multiline.php b/src/Form/Control/Multiline.php index 26fe7c099b..4a63cf8b26 100644 --- a/src/Form/Control/Multiline.php +++ b/src/Form/Control/Multiline.php @@ -553,7 +553,7 @@ protected function getLookupProps(Field $field): array $props['config']['search'] = true; } - $props['config']['placeholder'] = $props['config']['placeholder'] ?? 'Select ' . $field->getCaption(); + $props['config']['placeholder'] ??= 'Select ' . $field->getCaption(); $this->valuePropsBinding[$field->short_name] = [__CLASS__, 'setLookupOptionValue']; diff --git a/src/Form/Control/ScopeBuilder.php b/src/Form/Control/ScopeBuilder.php index 47122de59f..fb6a2364a2 100644 --- a/src/Form/Control/ScopeBuilder.php +++ b/src/Form/Control/ScopeBuilder.php @@ -417,7 +417,7 @@ protected function getLookupProps(Field $field): array $props['search'] = true; } - $props['placeholder'] = $props['placeholder'] ?? 'Select ' . $field->getCaption(); + $props['placeholder'] ??= 'Select ' . $field->getCaption(); return $props; } diff --git a/src/JsSse.php b/src/JsSse.php index 0ce1240e8c..01224325ab 100644 --- a/src/JsSse.php +++ b/src/JsSse.php @@ -137,7 +137,7 @@ public function sendBlock(string $id, string $data, string $name = null): void } $this->output('id: ' . $id . "\n"); - if (strlen($name) > 0) { + if ($name !== null) { $this->output('event: ' . $name . "\n"); } $this->output($this->wrapData($data) . "\n"); diff --git a/src/Table/Column/ColorRating.php b/src/Table/Column/ColorRating.php index 9453dd9d4f..a9708217cb 100644 --- a/src/Table/Column/ColorRating.php +++ b/src/Table/Column/ColorRating.php @@ -183,7 +183,7 @@ private function createGradientSingle(&$gradients, $hexFrom, $hexTo, $steps) public function getTagAttributes($position, array $attr = []): array { - $attr['style'] = $attr['style'] ?? ''; + $attr['style'] ??= ''; $attr['style'] .= '{$_' . $this->short_name . '_color_rating}'; return parent::getTagAttributes($position, $attr); diff --git a/src/UserAction/ConfirmationExecutor.php b/src/UserAction/ConfirmationExecutor.php index fae64f4d7d..c32698103d 100644 --- a/src/UserAction/ConfirmationExecutor.php +++ b/src/UserAction/ConfirmationExecutor.php @@ -100,7 +100,7 @@ public function setAction(Model\UserAction $action): Modal $this->action = $action; $this->afterActionInit($action); - $this->title = $this->title ?? $action->getDescription(); + $this->title ??= $action->getDescription(); $this->step = $this->stickyGet('step'); $this->actionInitialized = true; diff --git a/src/UserAction/ModalExecutor.php b/src/UserAction/ModalExecutor.php index 73c0ec8d56..1270e86f01 100644 --- a/src/UserAction/ModalExecutor.php +++ b/src/UserAction/ModalExecutor.php @@ -78,7 +78,7 @@ public function setAction(Model\UserAction $action): View // get necessary step need prior to execute action. if ($this->steps = $this->getSteps($action)) { - $this->title = $this->title ?? $action->getDescription(); + $this->title ??= $action->getDescription(); // get current step. $this->step = $this->stickyGet('step') ?? $this->steps[0];