diff --git a/composer.json b/composer.json index cad1681..39adffd 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": ">=5.5.9", + "php": ">=5.6.4", "illuminate/support": "~5", "simplepie/simplepie": "~1.4" }, @@ -18,4 +18,4 @@ "Awjudd\\FeedReader\\": "src/" } } -} +} \ No newline at end of file diff --git a/config/rss-feed-reader.php b/config/rss-feed-reader.php index 8eabd84..bf6d205 100644 --- a/config/rss-feed-reader.php +++ b/config/rss-feed-reader.php @@ -60,4 +60,4 @@ 'order-by-date' => false, ], ], -]; \ No newline at end of file +]; diff --git a/src/Facade.php b/src/Facade.php index 1647fd9..fc64f1d 100644 --- a/src/Facade.php +++ b/src/Facade.php @@ -11,4 +11,4 @@ protected static function getFacadeAccessor() { return 'rss-feed-reader'; } -} \ No newline at end of file +} diff --git a/src/FeedReader.php b/src/FeedReader.php index 584a305..b49a9a3 100644 --- a/src/FeedReader.php +++ b/src/FeedReader.php @@ -1,4 +1,5 @@ setup_cache_directory($configuration)) !== false) - { - // Enable caching, and set the folder + if (($cache = $this->setup_cache_directory($configuration)) !== false) { + // Enable caching, and set the folder $sp->enable_cache(true); $sp->set_cache_location($cache); $sp->set_cache_duration($this->read_config($configuration, 'cache.duration', 3600)); - } - else - { + } else { // Disable caching $sp->enable_cache(false); } @@ -53,7 +51,7 @@ public function read($url, $configuration = 'default') /** * Used in order to setup the cache directory for future use. - * + * * @param string The configuration to use * @return string The folder that is being cached to */ @@ -63,9 +61,8 @@ private function setup_cache_directory($configuration) $cache_enabled = $this->read_config($configuration, 'cache.enabled', false); // Is caching enabled? - if(!$cache_enabled) - { - // It is disabled, so skip it + if (!$cache_enabled) { + // It is disabled, so skip it return false; } @@ -73,16 +70,14 @@ private function setup_cache_directory($configuration) $cache_location = storage_path($this->read_config($configuration, 'cache.location', 'rss-feeds')); // Is the last character a slash? - if(substr($cache_location, -1) != DIRECTORY_SEPARATOR) - { - // Add in the slash at the end + if (substr($cache_location, -1) != DIRECTORY_SEPARATOR) { + // Add in the slash at the end $cache_location .= DIRECTORY_SEPARATOR; } // Check if the folder is available - if(!file_exists($cache_location)) - { - // It didn't, so make it + if (!file_exists($cache_location)) { + // It didn't, so make it mkdir($cache_location, 0777); // Also add in a .gitignore file @@ -95,7 +90,7 @@ private function setup_cache_directory($configuration) /** * Used internally in order to retrieve a sepcific value from the configuration * file. - * + * * @param string $configuration The name of the configuration to use * @param string $name The name of the value in the configuration file to retrieve * @param mixed $default The default value diff --git a/src/FeedReaderServiceProvider.php b/src/FeedReaderServiceProvider.php index e8c987d..3cee8e6 100644 --- a/src/FeedReaderServiceProvider.php +++ b/src/FeedReaderServiceProvider.php @@ -37,5 +37,4 @@ private function setupProcessor() { $this->app->singleton(FeedReader::class); } - -} \ No newline at end of file +}