We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $process = new Process($command, null, null, null, 300, null); |
| 68 | 68 | |
| 69 | - $process->run(function ($type, $buffer) { |
|
| 69 | + $process->run(function($type, $buffer) { |
|
| 70 | 70 | if (Process::ERR === $type) { |
| 71 | 71 | $this->line($buffer); |
| 72 | 72 | } else { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | 77 | // executes after the command finishes |
| 78 | - if (! $process->isSuccessful()) { |
|
| 78 | + if (!$process->isSuccessful()) { |
|
| 79 | 79 | throw new ProcessFailedException($process); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | // otherwise, in case the last line HAS been modified |
| 96 | 96 | // return the last line that has an ending in it |
| 97 | - $possible_end_lines = array_filter($file_lines, function ($k) { |
|
| 97 | + $possible_end_lines = array_filter($file_lines, function($k) { |
|
| 98 | 98 | return strpos($k, '});') === 0; |
| 99 | 99 | }); |
| 100 | 100 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function getAttributeValue($key) |
| 26 | 26 | { |
| 27 | - if (! $this->isTranslatableAttribute($key)) { |
|
| 27 | + if (!$this->isTranslatableAttribute($key)) { |
|
| 28 | 28 | return parent::getAttributeValue($key); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function update(array $attributes = [], array $options = []) |
| 74 | 74 | { |
| 75 | - if (! $this->exists) { |
|
| 75 | + if (!$this->exists) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $separator = $config['separator']; |
| 49 | 49 | $attribute = $attribute.'->'.$this->getLocale(); |
| 50 | 50 | |
| 51 | - return $query->where(function (Builder $q) use ($attribute, $slug, $separator) { |
|
| 51 | + return $query->where(function(Builder $q) use ($attribute, $slug, $separator) { |
|
| 52 | 52 | $q->where($attribute, '=', $slug) |
| 53 | 53 | ->orWhere($attribute, 'LIKE', $slug.$separator.'%') |
| 54 | 54 | // Fixes issues with Json data types in MySQL where data is sourrounded by " |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Query scope for finding "similar" slugs, used to determine uniqueness. |
| 39 | 39 | * |
| 40 | 40 | * @param \Illuminate\Database\Eloquent\Builder $query |
| 41 | - * @param \Illuminate\Database\Eloquent\Model $model |
|
| 42 | 41 | * @param string $attribute |
| 43 | 42 | * @param array $config |
| 44 | 43 | * @param string $slug |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | protected function makeSlugUnique(string $slug, array $config, string $attribute): string |
| 51 | 51 | { |
| 52 | - if (! $config['unique']) { |
|
| 52 | + if (!$config['unique']) { |
|
| 53 | 53 | return $slug; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | $button = $this->buttons()->firstWhere('name', $name); |
| 94 | 94 | |
| 95 | - if (! $button) { |
|
| 95 | + if (!$button) { |
|
| 96 | 96 | abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.'); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function removeButton($name, $stack = null) |
| 115 | 115 | { |
| 116 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
| 116 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
| 117 | 117 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
| 118 | 118 | })); |
| 119 | 119 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function removeButtons($names, $stack = null) |
| 126 | 126 | { |
| 127 | - if (! empty($names)) { |
|
| 127 | + if (!empty($names)) { |
|
| 128 | 128 | foreach ($names as $name) { |
| 129 | 129 | $this->removeButton($name, $stack); |
| 130 | 130 | } |
@@ -138,14 +138,14 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public function removeAllButtonsFromStack($stack) |
| 140 | 140 | { |
| 141 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
|
| 141 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($stack) { |
|
| 142 | 142 | return $button->stack == $stack; |
| 143 | 143 | })); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | public function removeButtonFromStack($name, $stack) |
| 147 | 147 | { |
| 148 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
| 148 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
| 149 | 149 | return $button->name == $name && $button->stack == $stack; |
| 150 | 150 | })); |
| 151 | 151 | } |
@@ -62,6 +62,9 @@ discard block |
||
| 62 | 62 | $this->addButton($stack, $name, 'model_function', $model_function_name, $position); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + /** |
|
| 66 | + * @param string $view |
|
| 67 | + */ |
|
| 65 | 68 | public function addButtonFromView($stack, $name, $view, $position = false) |
| 66 | 69 | { |
| 67 | 70 | $view = 'crud::buttons.'.$view; |
@@ -119,7 +122,7 @@ discard block |
||
| 119 | 122 | } |
| 120 | 123 | |
| 121 | 124 | /** |
| 122 | - * @param array $names Button names |
|
| 125 | + * @param string[] $names Button names |
|
| 123 | 126 | * @param string|null $stack Optional stack name. |
| 124 | 127 | */ |
| 125 | 128 | public function removeButtons($names, $stack = null) |
@@ -136,6 +139,9 @@ discard block |
||
| 136 | 139 | $this->setOperationSetting('buttons', collect()); |
| 137 | 140 | } |
| 138 | 141 | |
| 142 | + /** |
|
| 143 | + * @param string $stack |
|
| 144 | + */ |
|
| 139 | 145 | public function removeAllButtonsFromStack($stack) |
| 140 | 146 | { |
| 141 | 147 | $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
@@ -158,6 +164,12 @@ discard block |
||
| 158 | 164 | public $type = 'view'; |
| 159 | 165 | public $content; |
| 160 | 166 | |
| 167 | + /** |
|
| 168 | + * @param string $stack |
|
| 169 | + * @param string $name |
|
| 170 | + * @param string $type |
|
| 171 | + * @param string $content |
|
| 172 | + */ |
|
| 161 | 173 | public function __construct($stack, $name, $type, $content) |
| 162 | 174 | { |
| 163 | 175 | $this->stack = $stack; |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $revisionDate = date('Y-m-d', strtotime((string) $history->created_at)); |
| 22 | 22 | |
| 23 | 23 | // Be sure to instantiate the initial grouping array |
| 24 | - if (! array_key_exists($revisionDate, $revisions)) { |
|
| 24 | + if (!array_key_exists($revisionDate, $revisions)) { |
|
| 25 | 25 | $revisions[$revisionDate] = []; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function getTitle($action = false) |
| 23 | 23 | { |
| 24 | - if (! $action) { |
|
| 24 | + if (!$action) { |
|
| 25 | 25 | $action = $this->getActionMethod(); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function setTitle($string, $action = false) |
| 40 | 40 | { |
| 41 | - if (! $action) { |
|
| 41 | + if (!$action) { |
|
| 42 | 42 | $action = $this->getActionMethod(); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function getHeading($action = false) |
| 60 | 60 | { |
| 61 | - if (! $action) { |
|
| 61 | + if (!$action) { |
|
| 62 | 62 | $action = $this->getActionMethod(); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function setHeading($string, $action = false) |
| 77 | 77 | { |
| 78 | - if (! $action) { |
|
| 78 | + if (!$action) { |
|
| 79 | 79 | $action = $this->getActionMethod(); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function getSubheading($action = false) |
| 97 | 97 | { |
| 98 | - if (! $action) { |
|
| 98 | + if (!$action) { |
|
| 99 | 99 | $action = $this->getActionMethod(); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function setSubheading($string, $action = false) |
| 114 | 114 | { |
| 115 | - if (! $action) { |
|
| 115 | + if (!$action) { |
|
| 116 | 116 | $action = $this->getActionMethod(); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | foreach ($fields as &$field) { |
| 53 | 53 | // set the value |
| 54 | - if (! isset($field['value'])) { |
|
| 54 | + if (!isset($field['value'])) { |
|
| 55 | 55 | if (isset($field['subfields'])) { |
| 56 | 56 | $field['value'] = []; |
| 57 | 57 | foreach ($field['subfields'] as $subfield) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // always have a hidden input for the entry id |
| 67 | - if (! array_key_exists('id', $fields)) { |
|
| 67 | + if (!array_key_exists('id', $fields)) { |
|
| 68 | 68 | $fields['id'] = [ |
| 69 | 69 | 'name' => $entry->getKeyName(), |
| 70 | 70 | 'value' => $entry->getKey(), |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | if (isset($field['entity'])) { |
| 89 | 89 | $relationArray = explode('.', $field['entity']); |
| 90 | - $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) { |
|
| 90 | + $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) { |
|
| 91 | 91 | return $obj->{$method} ? $obj->{$method} : $obj; |
| 92 | 92 | }, $model); |
| 93 | 93 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $this->set($op.'.access', false); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - return ! $this->hasAccessToAny($operation); |
|
| 36 | + return !$this->hasAccessToAny($operation); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | public function hasAccessToAll($operation_array) |
| 74 | 74 | { |
| 75 | 75 | foreach ((array) $operation_array as $key => $operation) { |
| 76 | - if (! $this->get($operation.'.access')) { |
|
| 76 | + if (!$this->get($operation.'.access')) { |
|
| 77 | 77 | return false; |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function hasAccessOrFail($operation) |
| 92 | 92 | { |
| 93 | - if (! $this->get($operation.'.access')) { |
|
| 93 | + if (!$this->get($operation.'.access')) { |
|
| 94 | 94 | throw new AccessDeniedException(trans('backpack::crud.unauthorized_access', ['access' => $operation])); |
| 95 | 95 | } |
| 96 | 96 | |