From a76c5b444f08787732719bc28758aea81ea4a7f3 Mon Sep 17 00:00:00 2001 From: Zain Mehdi Date: Sat, 5 Dec 2015 15:24:14 -0800 Subject: [PATCH 1/5] Remove dependency on PHP 5.6 and allow use of this package on PHP >=5.4 --- README.md | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 397b48d..2e88562 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Cast your Eloquent model attributes to value objects with ease! ### Requirements -This package requires PHP >= 5.6. Using the latest version of PHP is highly recommended. Laravel 4.x and 5.x are supported. +This package requires PHP >= 5.4. Using the latest version of PHP is highly recommended. Laravel 4.x and 5.x are supported. ### Install diff --git a/composer.json b/composer.json index a141da1..44afdc1 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,10 @@ ] }, "require": { - "php": ">=5.6", + "php": ">=5.4", "laravel/framework": ">=4.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^4.0" } } From 48cef754d07d9a625b6c0e3ee0b7d02bbeb95b62 Mon Sep 17 00:00:00 2001 From: Zain Mehdi Date: Sat, 5 Dec 2015 15:24:48 -0800 Subject: [PATCH 2/5] Update docblocks to provide type information for method arguments. --- src/CastsValueObjects.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CastsValueObjects.php b/src/CastsValueObjects.php index 31c7339..56a2252 100644 --- a/src/CastsValueObjects.php +++ b/src/CastsValueObjects.php @@ -12,7 +12,7 @@ trait CastsValueObjects protected $cachedObjects = []; /** - * @param $key + * @param string $key * * @return mixed */ @@ -44,8 +44,8 @@ public function getAttribute($key) } /** - * @param $key - * @param $value + * @param string $key + * @param mixed $value */ public function setAttribute($key, $value) { @@ -78,7 +78,7 @@ public function setAttribute($key, $value) } /** - * @param $key + * @param string $key * * @return mixed */ @@ -90,7 +90,7 @@ private function createValueObject($key, $value) } /** - * @param $key + * @param string $key * @param ValueObject $object */ private function cacheValueObject($key, ValueObject $object) @@ -99,7 +99,7 @@ private function cacheValueObject($key, ValueObject $object) } /** - * @param $key + * @param string $key */ private function invalidateValueObjectCache($key) { @@ -107,7 +107,7 @@ private function invalidateValueObjectCache($key) } /** - * @param $key + * @param string $key * * @return bool */ @@ -117,7 +117,7 @@ private function isValueObjectCached($key) } /** - * @param $key + * @param string $key * * @return ValueObject */ From 9e11117b1fcc25e5bd22ee2895817f1269b52543 Mon Sep 17 00:00:00 2001 From: Zain Mehdi Date: Sat, 5 Dec 2015 15:27:08 -0800 Subject: [PATCH 3/5] Update travis config to test on PHP >=5.4 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index e5aa5ef..6aa6f78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: php php: + - 5.4 + - 5.5 - 5.6 - nightly - hhvm From 3778ec30de388bb59beba59b9ecc39ba6956638c Mon Sep 17 00:00:00 2001 From: Zain Mehdi Date: Sat, 5 Dec 2015 15:42:47 -0800 Subject: [PATCH 4/5] Revert "Update travis config to test on PHP >=5.4" This reverts commit 9e11117b1fcc25e5bd22ee2895817f1269b52543. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6aa6f78..e5aa5ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - nightly - hhvm From 87e3ed8edc42bb2088a04bbde76cd9cf29815d52 Mon Sep 17 00:00:00 2001 From: Zain Mehdi Date: Sat, 5 Dec 2015 15:44:34 -0800 Subject: [PATCH 5/5] Re-upgrade to phpunit 5.x. Added note in README to explain dependency on PHP 5.6 for tests. --- README.md | 2 ++ composer.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e88562..0ccf340 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Cast your Eloquent model attributes to value objects with ease! This package requires PHP >= 5.4. Using the latest version of PHP is highly recommended. Laravel 4.x and 5.x are supported. +> **Note:** Running tests for this package requires PHP >=5.6. + ### Install Require this package with composer using the following command: diff --git a/composer.json b/composer.json index 44afdc1..0657090 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,6 @@ "laravel/framework": ">=4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "^5.0" } }