1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-24 13:52:56 +02:00

refactor(site-plugin): fix code standard for index.php #347

This commit is contained in:
Awilum
2020-01-09 00:09:01 +03:00
parent d2490bfac5
commit 0e010d5607

View File

@@ -41,7 +41,7 @@ class SiteController extends Controller
$uri = $args['uri'];
// Is JSON Format
$is_json = (isset($query['format']) && $query['format'] == 'json') ? true : false;
$is_json = isset($query['format']) && $query['format'] === 'json';
// If uri is empty then it is main entry else use entry uri
if ($uri === '/') {
@@ -61,13 +61,13 @@ class SiteController extends Controller
// Get 404 page if entry visibility is draft or hidden and if routable is false
if ((isset($entry_body['visibility']) && ($entry_body['visibility'] === 'draft' || $entry_body['visibility'] === 'hidden')) ||
(isset($entry_body['routable']) && ($entry_body['routable'] === false))) {
$entry = $this->error404();
$entry = $this->error404();
$is_entry_not_found = true;
} else {
$entry = $entry_body;
}
} else {
$entry = $this->error404();
$entry = $this->error404();
$is_entry_not_found = true;
}
@@ -103,13 +103,13 @@ class SiteController extends Controller
*
* @access public
*/
public function error404()
{
return [
'title' => $this->registry->get('settings.entries.error404.title'),
'description' => $this->registry->get('settings.entries.error404.description'),
'content' => $this->registry->get('settings.entries.error404.content'),
'template' => $this->registry->get('settings.entries.error404.template')
];
}
public function error404() : array
{
return [
'title' => $this->registry->get('settings.entries.error404.title'),
'description' => $this->registry->get('settings.entries.error404.description'),
'content' => $this->registry->get('settings.entries.error404.content'),
'template' => $this->registry->get('settings.entries.error404.template'),
];
}
}