@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $availableChildren = AvailableChildren::forParent($model); |
50 | 50 | |
51 | - $modules = $availableChildren->onlyModules()->reject(function ($module) use ($model) { |
|
51 | + $modules = $availableChildren->onlyModules()->reject(function($module) use ($model) { |
|
52 | 52 | return $module->page_id != null && $module->page_id != $model->id; |
53 | 53 | }); |
54 | 54 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $available_sets = FlatReferencePresenter::toGroupedSelectValues($availableChildren->onlySets())->toArray(); |
58 | 58 | |
59 | 59 | // Current sections |
60 | - $sections = $model->children()->map(function ($section, $index) { |
|
60 | + $sections = $model->children()->map(function($section, $index) { |
|
61 | 61 | if ($section instanceof TranslatableContract) { |
62 | 62 | $section->injectTranslationForForm(); |
63 | 63 | } |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function filter(callable $callback): self |
48 | 48 | { |
49 | - if (! is_callable($callback)) { |
|
49 | + if (!is_callable($callback)) { |
|
50 | 50 | return new static($this->registrations); |
51 | 51 | } |
52 | 52 | |
53 | 53 | $registrations = $this->registrations; |
54 | 54 | |
55 | 55 | foreach ($registrations as $k => $registration) { |
56 | - if (!! call_user_func($callback, $registration)) { |
|
56 | + if (!!call_user_func($callback, $registration)) { |
|
57 | 57 | unset($registrations[$k]); |
58 | 58 | } |
59 | 59 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function filterByTag($tag): self |
80 | 80 | { |
81 | 81 | try { |
82 | - return $this->filterBy('tags', (array) $tag); |
|
82 | + return $this->filterBy('tags', (array)$tag); |
|
83 | 83 | } catch (NonRegisteredManager $e) { |
84 | 84 | return new static(); |
85 | 85 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | foreach ($registrations as $k => $registration) { |
108 | 108 | $containsValue = $registration->has($key, $value); |
109 | 109 | |
110 | - if ($type == 'filter' && ! $containsValue) { |
|
110 | + if ($type == 'filter' && !$containsValue) { |
|
111 | 111 | unset($registrations[$k]); |
112 | 112 | } |
113 | 113 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | private function registrationMustExistConstraint(string $key, $value, $registrations): void |
137 | 137 | { |
138 | 138 | if (empty($registrations) && count($registrations) != $this->registrations) { |
139 | - throw new NonRegisteredManager('No manager found for ' . $key . ' [' . print_r($value, true) . ']. Did you perhaps forgot to register the manager?'); |
|
139 | + throw new NonRegisteredManager('No manager found for '.$key.' ['.print_r($value, true).']. Did you perhaps forgot to register the manager?'); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
5 | 5 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\Fields\Types; |
6 | 6 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $value = parent::__get($key); |
51 | 51 | |
52 | 52 | // Default empty array for these following values |
53 | - if (!$value && in_array($key, ['sections','availableModules','availablePages', 'availableSets'])) { |
|
53 | + if (!$value && in_array($key, ['sections', 'availableModules', 'availablePages', 'availableSets'])) { |
|
54 | 54 | return []; |
55 | 55 | } |
56 | 56 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Thinktomorrow\Chief\Fields\Types; |
4 | 4 | |
5 | 5 | class HtmlField extends Field |
@@ -6,15 +6,15 @@ discard block |
||
6 | 6 | |
7 | 7 | class FieldType |
8 | 8 | { |
9 | - const INPUT = 'input'; // oneliner text (input) |
|
10 | - const TEXT = 'text'; // Plain text (textarea) |
|
11 | - const DATE = 'date'; // Timestamp input |
|
12 | - const HTML = 'html'; // Html text (wysiwyg) |
|
13 | - const SELECT = 'select'; // Select options |
|
14 | - const MEDIA = 'media'; // media file (slim uploader) |
|
15 | - const DOCUMENT = 'document'; // documents |
|
16 | - const RADIO = 'radio'; // media file (slim uploader) |
|
17 | - const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
9 | + const INPUT = 'input'; // oneliner text (input) |
|
10 | + const TEXT = 'text'; // Plain text (textarea) |
|
11 | + const DATE = 'date'; // Timestamp input |
|
12 | + const HTML = 'html'; // Html text (wysiwyg) |
|
13 | + const SELECT = 'select'; // Select options |
|
14 | + const MEDIA = 'media'; // media file (slim uploader) |
|
15 | + const DOCUMENT = 'document'; // documents |
|
16 | + const RADIO = 'radio'; // media file (slim uploader) |
|
17 | + const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @var string |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | static::RADIO, |
35 | 35 | static::PAGEBUILDER, |
36 | 36 | ])) { |
37 | - throw new \Exception('Invalid type identifier given [' . $type . '].'); |
|
37 | + throw new \Exception('Invalid type identifier given ['.$type.'].'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $this->type = $type; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public static function fromString(string $type) |
44 | 44 | { |
45 | - $class = 'Thinktomorrow\Chief\Fields\Types\\' . ucfirst($type . 'Field'); |
|
45 | + $class = 'Thinktomorrow\Chief\Fields\Types\\'.ucfirst($type.'Field'); |
|
46 | 46 | |
47 | 47 | return new $class(new static($type)); |
48 | 48 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Thinktomorrow\Chief\Fields\Types; |
4 | 4 | |
5 | 5 | class DateField extends Field |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | private function validateTabs(array $tabs) |
49 | 49 | { |
50 | - array_map(function (FieldsTab $tab) { |
|
50 | + array_map(function(FieldsTab $tab) { |
|
51 | 51 | }, $tabs); |
52 | 52 | } |
53 | 53 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $this->model = $model; |
19 | 19 | $this->blacklist = $blacklist; |
20 | 20 | |
21 | - $this->slugResolver = function ($slug) { |
|
21 | + $this->slugResolver = function($slug) { |
|
22 | 22 | return str_slug($slug); |
23 | 23 | }; |
24 | 24 | } |