@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | $targetModel = $this->findModel($targetClassName, $targetId); |
26 | 26 | |
27 | 27 | /** @var TemplateApplicator $applicator */ |
28 | - foreach($this->applicators as $applicator) { |
|
29 | - if(!$applicator->shouldApply($sourceModel, $targetModel)) { |
|
28 | + foreach ($this->applicators as $applicator) { |
|
29 | + if (!$applicator->shouldApply($sourceModel, $targetModel)) { |
|
30 | 30 | continue; |
31 | 31 | } |
32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
38 | - $availableApplicatorsString = implode(array_map(function($applicator){ return get_class($applicator);}, $this->applicators), ','); |
|
38 | + $availableApplicatorsString = implode(array_map(function($applicator) { return get_class($applicator); }, $this->applicators), ','); |
|
39 | 39 | |
40 | 40 | throw new \RuntimeException("No proper template applicator found. $sourceClassName [$sourceId] cannot be applied as template. Available applicators: [$availableApplicatorsString]"); |
41 | 41 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | private function findModel(string $className, string $sourceId): Model |
50 | 50 | { |
51 | - if($morphedClassName = Relation::getMorphedModel($className)) { |
|
51 | + if ($morphedClassName = Relation::getMorphedModel($className)) { |
|
52 | 52 | $className = $morphedClassName; |
53 | 53 | } |
54 | 54 |
@@ -55,13 +55,13 @@ |
||
55 | 55 | if ($child instanceof Module && $child->isPageSpecific()) |
56 | 56 | { |
57 | 57 | $duplicatedChild = $child::create([ |
58 | - 'slug' => $targetModel->title ? $targetModel->title . '-' . $child->slug : $child->slug . '-copy', |
|
58 | + 'slug' => $targetModel->title ? $targetModel->title.'-'.$child->slug : $child->slug.'-copy', |
|
59 | 59 | 'page_id' => $targetModel->id, |
60 | 60 | 'page_morph_key' => $targetModel->getMorphClass() |
61 | 61 | ]); |
62 | 62 | |
63 | 63 | $this->moduleTemplateApplicator->handle($child, $duplicatedChild); |
64 | - } else |
|
64 | + }else |
|
65 | 65 | { |
66 | 66 | $duplicatedChild = $child; |
67 | 67 | } |