| @@ -30,13 +30,13 @@ | ||
| 30 | 30 | */ | 
| 31 | 31 | public function parseRequest($manager, $request) | 
| 32 | 32 |  	{ | 
| 33 | - $pathInfo = '/' . $request->getPathInfo(); | |
| 33 | + $pathInfo = '/'.$request->getPathInfo(); | |
| 34 | 34 |  		$url = neon()->cache->getOrSet($pathInfo, function() use ($pathInfo) { | 
| 35 | 35 | return CmsUrl::find()->where(['url' => $pathInfo])->limit(1)->one(); | 
| 36 | 36 | }); | 
| 37 | 37 | // if the url is not in the url table then return false to continue processing other route rules | 
| 38 | 38 | // typically in a neon setup the module/controller/action rule | 
| 39 | - if (! $url) return false; | |
| 39 | + if (!$url) return false; | |
| 40 | 40 | // check if the url found represents a redirect | 
| 41 | 41 |  		if ($url['redirect'] !== null) { | 
| 42 | 42 | neon()->response->redirect($url['redirect'], 301)->send(); | 
| @@ -36,7 +36,9 @@ | ||
| 36 | 36 | }); | 
| 37 | 37 | // if the url is not in the url table then return false to continue processing other route rules | 
| 38 | 38 | // typically in a neon setup the module/controller/action rule | 
| 39 | - if (! $url) return false; | |
| 39 | +		if (! $url) { | |
| 40 | + return false; | |
| 41 | + } | |
| 40 | 42 | // check if the url found represents a redirect | 
| 41 | 43 |  		if ($url['redirect'] !== null) { | 
| 42 | 44 | neon()->response->redirect($url['redirect'], 301)->send(); | 
| @@ -48,12 +48,14 @@ discard block | ||
| 48 | 48 | // set up the theme directories | 
| 49 | 49 |  		foreach ($themeHierarchy as $theme) { | 
| 50 | 50 |  			if (isset($theme['templates'])) { | 
| 51 | - foreach ($theme['templates'] as $tplDir) | |
| 52 | - $this->smarty->addTemplateDir($tplDir); | |
| 51 | +				foreach ($theme['templates'] as $tplDir) { | |
| 52 | + $this->smarty->addTemplateDir($tplDir); | |
| 53 | + } | |
| 53 | 54 | } | 
| 54 | 55 |  			if (isset($theme['plugins'])) { | 
| 55 | - foreach ($theme['plugins'] as $pluginDir) | |
| 56 | - $this->smarty->addPluginsDir($pluginDir); | |
| 56 | +				foreach ($theme['plugins'] as $pluginDir) { | |
| 57 | + $this->smarty->addPluginsDir($pluginDir); | |
| 58 | + } | |
| 57 | 59 | } | 
| 58 | 60 | } | 
| 59 | 61 | |
| @@ -84,8 +86,9 @@ discard block | ||
| 84 | 86 | $this->smarty->force_compile = neon()->isDevMode(); | 
| 85 | 87 | |
| 86 | 88 | // ensure all errors are thrown when in debug mode | 
| 87 | - if (neon()->isDevMode()) | |
| 88 | - $this->smarty->error_reporting = E_ALL; | |
| 89 | +		if (neon()->isDevMode()) { | |
| 90 | + $this->smarty->error_reporting = E_ALL; | |
| 91 | + } | |
| 89 | 92 | } | 
| 90 | 93 | |
| 91 | 94 | /** | 
| @@ -121,7 +124,9 @@ discard block | ||
| 121 | 124 | |
| 122 | 125 | public static function component($params, $content, $tagName, $template, $repeat) | 
| 123 | 126 |  	{ | 
| 124 | - if ($repeat) return; | |
| 127 | +		if ($repeat) { | |
| 128 | + return; | |
| 129 | + } | |
| 125 | 130 | $params['content'] = $content; | 
| 126 | 131 | $params['slot'] = $content; | 
| 127 | 132 | $params['type'] = $tagName; | 
| @@ -150,8 +155,9 @@ discard block | ||
| 150 | 155 |  		$this->smarty->assign('site', $this->_page->getSiteData()); | 
| 151 | 156 | |
| 152 | 157 | // an expensive-ish call so reduce need for it in repeated renders | 
| 153 | - if (!isset($templates[$template])) | |
| 154 | - $templates[$template] = $this->smarty->createTemplate($template); | |
| 158 | +		if (!isset($templates[$template])) { | |
| 159 | + $templates[$template] = $this->smarty->createTemplate($template); | |
| 160 | + } | |
| 155 | 161 | $tpl = $templates[$template]; | 
| 156 | 162 | |
| 157 | 163 | // reset any parameters for the new render | 
| @@ -39,12 +39,14 @@ discard block | ||
| 39 | 39 |  	{ | 
| 40 | 40 | // get firefly image if the source is a firefly id | 
| 41 | 41 |  		if (Hash::isUuid64($source)) { | 
| 42 | - if (!neon()->firefly->fileManager->exists($source)) | |
| 43 | - throw new HttpException(404); | |
| 42 | +			if (!neon()->firefly->fileManager->exists($source)) { | |
| 43 | + throw new HttpException(404); | |
| 44 | + } | |
| 44 | 45 | $meta = neon()->firefly->fileManager->getMeta($source); | 
| 45 | 46 | // can be 'image/svg' or 'image/svg+xml' | 
| 46 | - if (Str::startsWith($meta['mime_type'], 'image/svg')) | |
| 47 | - return neon()->firefly->fileManager->read($source); | |
| 47 | +			if (Str::startsWith($meta['mime_type'], 'image/svg')) { | |
| 48 | + return neon()->firefly->fileManager->read($source); | |
| 49 | + } | |
| 48 | 50 | $source = neon()->firefly->fileManager->readStream($source); | 
| 49 | 51 | } | 
| 50 | 52 | $manager = new InterventionImageManager(); | 
| @@ -124,7 +126,9 @@ discard block | ||
| 124 | 126 | public function imageRotate(Image & $image, $params) | 
| 125 | 127 |  	{ | 
| 126 | 128 | $rotate = Arr::get($params, 'rotate', false); | 
| 127 | - if ($rotate) $image->rotate($rotate); | |
| 129 | +		if ($rotate) { | |
| 130 | + $image->rotate($rotate); | |
| 131 | + } | |
| 128 | 132 | } | 
| 129 | 133 | |
| 130 | 134 | /** |