From 8015ed720397db4617ada1fdcb94a375580c6f6c Mon Sep 17 00:00:00 2001 From: Nikolay Murha Date: Tue, 30 Aug 2022 18:39:51 +0300 Subject: [PATCH] Fix StyleCI issues --- src/Form/Field.php | 2 +- src/Form/Field/BelongsToMany.php | 2 +- src/Form/Field/MorphTo.php | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Form/Field.php b/src/Form/Field.php index 3acf8ed6d8..fb6426e7d0 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -23,7 +23,7 @@ class Field implements Renderable const FILE_SORT_FLAG = '_file_sort_'; /** - * Uniq id for field container + * Uniq id for field container. * * @var string */ diff --git a/src/Form/Field/BelongsToMany.php b/src/Form/Field/BelongsToMany.php index c50bb470ff..d5f01f051d 100644 --- a/src/Form/Field/BelongsToMany.php +++ b/src/Form/Field/BelongsToMany.php @@ -9,7 +9,7 @@ class BelongsToMany extends MultipleSelect use BelongsToRelation; protected $variables = [ - 'multiple' => true + 'multiple' => true, ]; protected function addScript() diff --git a/src/Form/Field/MorphTo.php b/src/Form/Field/MorphTo.php index 26e07b75d8..4c0cfcf94a 100644 --- a/src/Form/Field/MorphTo.php +++ b/src/Form/Field/MorphTo.php @@ -12,8 +12,8 @@ class MorphTo extends BelongsTo public function __construct($morphName, $arguments = []) { - $this->typeColumn = $morphName . '_type'; - $column = $morphName . '_id'; + $this->typeColumn = $morphName.'_type'; + $column = $morphName.'_id'; parent::__construct($column, $arguments); if (empty($arguments[1])) { @@ -22,7 +22,7 @@ public function __construct($morphName, $arguments = []) $this->addVariables([ 'typeColumn' => $this->typeColumn, - 'morphClass' => $this->morphClass() + 'morphClass' => $this->morphClass(), ]); } @@ -32,9 +32,10 @@ public function __construct($morphName, $arguments = []) public function morphClass() { if (!$this->morphClass) { - $modelClass = (new $this->selectable)->model; - $this->morphClass = (new $modelClass)->getMorphClass(); + $modelClass = (new $this->selectable())->model; + $this->morphClass = (new $modelClass())->getMorphClass(); } + return $this->morphClass; } @@ -47,6 +48,7 @@ public function value($value = null) if ($this->currenMorphClass() == $this->morphClass()) { return parent::value(); } + return null; }