From 4c67f021cd4968416c3d26e628110b47adcd1d00 Mon Sep 17 00:00:00 2001 From: gjerokrsteski Date: Wed, 19 Mar 2014 13:07:11 +0100 Subject: [PATCH] remove unused things --- php-pimf/pimf-framework/.travis.yml | 6 +++--- .../pimf-framework/core/Pimf/Cache/Storages/File.php | 8 +++++--- php-pimf/pimf-framework/core/Pimf/Param.php | 2 +- php-pimf/pimf-framework/core/Pimf/View.php | 11 ++++------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/php-pimf/pimf-framework/.travis.yml b/php-pimf/pimf-framework/.travis.yml index 66f242c1fa3..22082ecd60b 100644 --- a/php-pimf/pimf-framework/.travis.yml +++ b/php-pimf/pimf-framework/.travis.yml @@ -1,10 +1,10 @@ language: php php: - - 5.3 - - 5.4 - - 5.5 - 5.6 + - 5.5 + - 5.4 + - 5.3 before_script: - phpenv rehash diff --git a/php-pimf/pimf-framework/core/Pimf/Cache/Storages/File.php b/php-pimf/pimf-framework/core/Pimf/Cache/Storages/File.php index a734d5dd343..a0d1de99d6c 100644 --- a/php-pimf/pimf-framework/core/Pimf/Cache/Storages/File.php +++ b/php-pimf/pimf-framework/core/Pimf/Cache/Storages/File.php @@ -64,8 +64,8 @@ protected function retrieve($key) */ public function put($key, $value, $minutes) { - if ($minutes <= 0) { - return; + if ((int)$minutes <= 0) { + return null; } $value = $this->expiration($minutes) . serialize($value); @@ -91,7 +91,7 @@ public function forever($key, $value) * * @param string $key * - * @return bool|void + * @return bool */ public function forget($key) { @@ -103,5 +103,7 @@ public function forget($key) return true; } + + return false; } } diff --git a/php-pimf/pimf-framework/core/Pimf/Param.php b/php-pimf/pimf-framework/core/Pimf/Param.php index 77fe5e3643e..02b71201b51 100644 --- a/php-pimf/pimf-framework/core/Pimf/Param.php +++ b/php-pimf/pimf-framework/core/Pimf/Param.php @@ -37,7 +37,7 @@ public function getAll() /** * @param string $index - * @param null $defaultValue + * @param mixed $defaultValue * @param bool $filtered If you trust foreign input introduced to your PHP code - set to FALSE! * * @return string diff --git a/php-pimf/pimf-framework/core/Pimf/View.php b/php-pimf/pimf-framework/core/Pimf/View.php index 8b4fe06d9c8..c24a5766b3d 100644 --- a/php-pimf/pimf-framework/core/Pimf/View.php +++ b/php-pimf/pimf-framework/core/Pimf/View.php @@ -125,11 +125,10 @@ public function pump(array $model) } /** - * Is utilized for reading data from inaccessible properties. - * * @param string $name * - * @return mixed|null + * @return mixed + * @throws \OutOfBoundsException If undefined property at the template. */ public function __get($name) { @@ -138,11 +137,9 @@ public function __get($name) } $trace = debug_backtrace(); - trigger_error( - 'undefined property "' . $name . '" at file ' . $trace[0]['file'] . ' line ' . $trace[0]['line'], E_USER_WARNING + throw new \OutOfBoundsException( + 'undefined property "' . $name . '" at file ' . $trace[0]['file'] . ' line ' . $trace[0]['line'] ); - - return null; } /**