@@ -102,7 +102,9 @@ |
||
| 102 | 102 | $versions = []; |
| 103 | 103 | foreach($gitVersions as $v) { |
| 104 | 104 | $v = substr($v, strrpos($v, "/")+1); |
| 105 | - if ($v == '') continue; |
|
| 105 | + if ($v == '') { |
|
| 106 | + continue; |
|
| 107 | + } |
|
| 106 | 108 | $versions[] = $v ; |
| 107 | 109 | } |
| 108 | 110 | if (in_array($version, $versions)) { |
@@ -66,7 +66,9 @@ discard block |
||
| 66 | 66 | ]); |
| 67 | 67 | |
| 68 | 68 | // assuming operation using DDS where form $name maps to dds classType |
| 69 | - if (!$this->hasForm()) return; |
|
| 69 | + if (!$this->hasForm()) { |
|
| 70 | + return; |
|
| 71 | + } |
|
| 70 | 72 | $classType = $this->getForm()->getName(); |
| 71 | 73 | Event::on(DdsObjectManager::class, "dds.afterAdd.$classType", [$this, 'addCmsUrl']); |
| 72 | 74 | Event::on(DdsObjectManager::class, "dds.afterEdit.$classType", [$this, 'editCmsUrl']); |
@@ -91,12 +93,16 @@ discard block |
||
| 91 | 93 | */ |
| 92 | 94 | public function editCmsUrl(ObjectEditEvent $event) |
| 93 | 95 | { |
| 94 | - if (!isset($event->object[$this->name])) return; |
|
| 96 | + if (!isset($event->object[$this->name])) { |
|
| 97 | + return; |
|
| 98 | + } |
|
| 95 | 99 | $originalSlug = $event->originalValues[$this->name]; |
| 96 | 100 | $newSlug = $event->object[$this->name]; |
| 97 | 101 | // edit the slug in the cms_url table |
| 98 | 102 | $url = CmsUrl::findOne(['url' => $originalSlug]); |
| 99 | - if ($url === null) $url = new CmsUrl(); |
|
| 103 | + if ($url === null) { |
|
| 104 | + $url = new CmsUrl(); |
|
| 105 | + } |
|
| 100 | 106 | $url->url = $newSlug; |
| 101 | 107 | $url->nice_id = $this->pageId; |
| 102 | 108 | $url->save(); |
@@ -108,7 +114,9 @@ discard block |
||
| 108 | 114 | */ |
| 109 | 115 | public function addCmsUrl(ObjectAddEvent $event) |
| 110 | 116 | { |
| 111 | - if (!isset($event->object[$this->name])) return; |
|
| 117 | + if (!isset($event->object[$this->name])) { |
|
| 118 | + return; |
|
| 119 | + } |
|
| 112 | 120 | $slug = $event->object[$this->name]; |
| 113 | 121 | // add a new slug to cms url table |
| 114 | 122 | $cmsUrl = new CmsUrl(); |