From 41f64b96dd5fdfd5c0a9c467c81c20317ca523b0 Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 4 Dec 2018 03:10:35 +0300 Subject: [PATCH] Code formating fixes --- flextype/Cache.php | 35 +++++++++++++++++++++++------------ flextype/Content.php | 26 ++++++++++++++++---------- flextype/Flextype.php | 20 ++++++++++++++------ flextype/Plugins.php | 26 ++++++++++++++++---------- flextype/Themes.php | 18 ++++++++++++------ 5 files changed, 81 insertions(+), 44 deletions(-) diff --git a/flextype/Cache.php b/flextype/Cache.php index 8aac452c..8ae125d1 100755 --- a/flextype/Cache.php +++ b/flextype/Cache.php @@ -12,7 +12,8 @@ namespace Flextype; -use Flextype\Component\{Filesystem\Filesystem, Registry\Registry}; +use Flextype\Component\Filesystem\Filesystem; +use Flextype\Component\Registry\Registry; use \Doctrine\Common\Cache as DoctrineCache; class Cache @@ -58,14 +59,18 @@ class Cache * * @access private */ - private function __clone() { } + private function __clone() + { + } /** * Private wakeup method to enforce singleton behavior. * * @access private */ - private function __wakeup() { } + private function __wakeup() + { + } /** * Private construct method to enforce singleton behavior. @@ -137,15 +142,19 @@ class Cache break; case 'memcache': $memcache = new \Memcache(); - $memcache->connect(Registry::get('system.cache.memcache.server', 'localhost'), - Registry::get('system.cache.memcache.port', 11211)); + $memcache->connect( + Registry::get('system.cache.memcache.server', 'localhost'), + Registry::get('system.cache.memcache.port', 11211) + ); $driver = new DoctrineCache\MemcacheCache(); $driver->setMemcache($memcache); break; case 'memcached': $memcached = new \Memcached(); - $memcached->addServer(Registry::get('system.cache.memcached.server', 'localhost'), - Registry::get('system.cache.memcache.port', 11211)); + $memcached->addServer( + Registry::get('system.cache.memcached.server', 'localhost'), + Registry::get('system.cache.memcache.port', 11211) + ); $driver = new DoctrineCache\MemcachedCache(); $driver->setMemcached($memcached); break; @@ -157,8 +166,10 @@ class Cache if ($socket) { $redis->connect($socket); } else { - $redis->connect(Registry::get('system.cache.redis.server', 'localhost'), - Registry::get('system.cache.redis.port', 6379)); + $redis->connect( + Registry::get('system.cache.redis.server', 'localhost'), + Registry::get('system.cache.redis.port', 6379) + ); } // Authenticate with password if set @@ -306,12 +317,12 @@ class Cache * @access public * @return object */ - public static function getInstance() - { + public static function getInstance() + { if (is_null(Cache::$instance)) { Cache::$instance = new self; } return Cache::$instance; - } + } } diff --git a/flextype/Content.php b/flextype/Content.php index 4324456d..bbb46044 100755 --- a/flextype/Content.php +++ b/flextype/Content.php @@ -12,7 +12,11 @@ namespace Flextype; -use Flextype\Component\{Arr\Arr, Http\Http, Filesystem\Filesystem, Event\Event, Registry\Registry}; +use Flextype\Component\Arr\Arr; +use Flextype\Component\Http\Http; +use Flextype\Component\Filesystem\Filesystem; +use Flextype\Component\Event\Event; +use Flextype\Component\Registry\Registry; use Symfony\Component\Yaml\Yaml; use Thunder\Shortcode\ShortcodeFacade; use Thunder\Shortcode\Shortcode\ShortcodeInterface; @@ -48,14 +52,18 @@ class Content * * @access private */ - private function __clone() { } + private function __clone() + { + } /** * Private wakeup method to enforce singleton behavior. * * @access private */ - private function __wakeup() { } + private function __wakeup() + { + } /** * Private construct method to enforce singleton behavior. @@ -234,7 +242,7 @@ class Content if ($url === '') { // Get pages list - $pages_list = Filesystem::getFilesList($file_path , 'html'); + $pages_list = Filesystem::getFilesList($file_path, 'html'); // Create pages cached id foreach ($pages_list as $key => $page) { @@ -251,7 +259,6 @@ class Content Cache::save($pages_cache_id, $pages); } - } else { // Get pages list @@ -293,7 +300,6 @@ class Content // Return pages array return $pages; - } /** @@ -340,7 +346,7 @@ class Content $_page = Yaml::parse(Content::processShortcodes($page_frontmatter)); // Create page url item - $url = str_replace(PATH['pages'] , Http::getBaseUrl(), $file_path); + $url = str_replace(PATH['pages'], Http::getBaseUrl(), $file_path); $url = str_replace('page.html', '', $url); $url = str_replace('.html', '', $url); $url = str_replace('\\', '/', $url); @@ -448,12 +454,12 @@ class Content * @access public * @return object */ - public static function getInstance() - { + public static function getInstance() + { if (is_null(Content::$instance)) { Content::$instance = new self; } return Content::$instance; - } + } } diff --git a/flextype/Flextype.php b/flextype/Flextype.php index f2c9f42f..a0641bfa 100755 --- a/flextype/Flextype.php +++ b/flextype/Flextype.php @@ -12,7 +12,11 @@ namespace Flextype; -use Flextype\Component\{Http\Http, Session\Session, ErrorHandler\ErrorHandler, Registry\Registry, Filesystem\Filesystem}; +use Flextype\Component\Http\Http; +use Flextype\Component\Session\Session; +use Flextype\Component\ErrorHandler\ErrorHandler; +use Flextype\Component\Registry\Registry; +use Flextype\Component\Filesystem\Filesystem; use Symfony\Component\Yaml\Yaml; class Flextype @@ -37,14 +41,18 @@ class Flextype * * @access private */ - private function __clone() { } + private function __clone() + { + } /** * Private wakeup method to enforce singleton behavior. * * @access private */ - private function __wakeup() { } + private function __wakeup() + { + } /** * Private construct method to enforce singleton behavior. @@ -158,12 +166,12 @@ class Flextype * @access public * @return object */ - public static function getInstance() - { + public static function getInstance() + { if (is_null(Flextype::$instance)) { Flextype::$instance = new self; } return Flextype::$instance; - } + } } diff --git a/flextype/Plugins.php b/flextype/Plugins.php index 23bde314..e43c4949 100755 --- a/flextype/Plugins.php +++ b/flextype/Plugins.php @@ -12,7 +12,10 @@ namespace Flextype; -use Flextype\Component\{Filesystem\Filesystem, Event\Event, I18n\I18n, Registry\Registry}; +use Flextype\Component\Filesystem\Filesystem; +use Flextype\Component\Event\Event; +use Flextype\Component\I18n\I18n; +use Flextype\Component\Registry\Registry; use Symfony\Component\Yaml\Yaml; class Plugins @@ -70,14 +73,18 @@ class Plugins * * @access private */ - private function __clone() { } + private function __clone() + { + } /** * Private wakeup method to enforce singleton behavior. * * @access private */ - private function __wakeup() { } + private function __wakeup() + { + } /** * Private construct method to enforce singleton behavior. @@ -131,7 +138,6 @@ class Plugins // Go through... foreach ($plugins_list as $plugin) { - if (Filesystem::fileExists($_plugin_settings = PATH['plugins'] . '/' . $plugin . '/settings.yaml')) { $plugin_settings = Yaml::parseFile($_plugin_settings); } @@ -179,10 +185,10 @@ class Plugins * @access public * @return object */ - public static function getLocales() - { + public static function getLocales() + { return Plugins::$locales; - } + } /** * Get the Plugins instance. @@ -190,12 +196,12 @@ class Plugins * @access public * @return object */ - public static function getInstance() - { + public static function getInstance() + { if (is_null(Plugins::$instance)) { Plugins::$instance = new self; } return Plugins::$instance; - } + } } diff --git a/flextype/Themes.php b/flextype/Themes.php index 70b7ef9b..8aeadfde 100644 --- a/flextype/Themes.php +++ b/flextype/Themes.php @@ -12,7 +12,9 @@ namespace Flextype; -use Flextype\Component\{Filesystem\Filesystem, View\View, Registry\Registry}; +use Flextype\Component\Filesystem\Filesystem; +use Flextype\Component\View\View; +use Flextype\Component\Registry\Registry; use Symfony\Component\Yaml\Yaml; class Themes @@ -29,14 +31,18 @@ class Themes * * @access private */ - private function __clone() { } + private function __clone() + { + } /** * Private wakeup method to enforce singleton behavior. * * @access private */ - private function __wakeup() { } + private function __wakeup() + { + } /** * Private construct method to enforce singleton behavior. @@ -115,12 +121,12 @@ class Themes * @access public * @return object */ - public static function getInstance() - { + public static function getInstance() + { if (is_null(Themes::$instance)) { Themes::$instance = new self; } return Themes::$instance; - } + } }