diff --git a/.travis.yml b/.travis.yml index 6abbe89..57992e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,11 @@ language: php php: - 5.6 - 7.0 +- 7.1 - hhvm +branches: + only: + - master before_script: - composer self-update - sh -c 'if [ "$TRAVIS_PHP_VERSION" = "hhvm" -o "$TRAVIS_PHP_VERSION" = "hhvm-nightly" diff --git a/composer.json b/composer.json index a34d844..93629e6 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,6 @@ } }, "require": { - "lstrojny/phpunit-function-mocker": "0.2.*" + "lstrojny/phpunit-function-mocker": "0.4.*" } } diff --git a/src/SellerLabs/Nucleus/Data/Collection.php b/src/SellerLabs/Nucleus/Data/Collection.php index bb1a379..17ee9ea 100644 --- a/src/SellerLabs/Nucleus/Data/Collection.php +++ b/src/SellerLabs/Nucleus/Data/Collection.php @@ -8,7 +8,7 @@ * @author Eduardo Trujillo * @package SellerLabs\Nucleus\Data */ -abstract class Collection extends Iterable +abstract class Collection extends IterableType { // -} \ No newline at end of file +} diff --git a/src/SellerLabs/Nucleus/Data/Iterable.php b/src/SellerLabs/Nucleus/Data/IterableType.php similarity index 91% rename from src/SellerLabs/Nucleus/Data/Iterable.php rename to src/SellerLabs/Nucleus/Data/IterableType.php index 1168ce8..c2b26e0 100644 --- a/src/SellerLabs/Nucleus/Data/Iterable.php +++ b/src/SellerLabs/Nucleus/Data/IterableType.php @@ -13,12 +13,12 @@ use SellerLabs\Nucleus\Meditation\Constraints\AbstractTypeConstraint; /** - * Class Iterable. + * Class IterableType. * * @author Eduardo Trujillo * @package SellerLabs\Nucleus\Data */ -abstract class Iterable extends BaseObject implements +abstract class IterableType extends BaseObject implements ArrayableInterface, FunctorInterface, FoldableInterface, @@ -82,14 +82,14 @@ public function last() } /** - * @param array|Iterable $searchKeyPath + * @param array|IterableType $searchKeyPath * * @return Maybe */ abstract public function lookupIn($searchKeyPath); /** - * @param array|Iterable $searchKeyPath + * @param array|IterableType $searchKeyPath * * @return mixed */ @@ -103,14 +103,14 @@ abstract public function toArray(); /** * @param callable $callable * - * @return Iterable + * @return IterableType */ abstract public function fmap(callable $callable); /** * @param callable $callable * - * @return static|Iterable + * @return static|IterableType */ public function map(callable $callable) { @@ -120,14 +120,14 @@ public function map(callable $callable) /** * @param callable $callable * - * @return Iterable + * @return IterableType */ abstract public function filter(callable $callable); /** * @param callable $callable * - * @return Iterable + * @return IterableType */ public function filterNot(callable $callable) { @@ -139,14 +139,14 @@ function ($value, $key, $iterable) use ($callable) { } /** - * @return Iterable + * @return IterableType */ abstract public function reverse(); /** * @param callable $comparator * - * @return Iterable + * @return IterableType */ abstract public function sort(callable $comparator = null); @@ -154,7 +154,7 @@ abstract public function sort(callable $comparator = null); * @param callable $comparatorValueMapper * @param callable|null $comparator * - * @return Iterable + * @return IterableType */ public function sortBy( callable $comparatorValueMapper, @@ -174,12 +174,12 @@ abstract public function each(callable $sideEffect); * @param int $begin * @param int|null $end * - * @return Iterable + * @return IterableType */ abstract public function slice($begin, $end = null); /** - * @return Iterable + * @return IterableType */ public function tail() { @@ -187,7 +187,7 @@ public function tail() } /** - * @return Iterable + * @return IterableType */ public function init() { @@ -197,7 +197,7 @@ public function init() /** * @param int $amount * - * @return Iterable + * @return IterableType */ public function take($amount) { @@ -212,7 +212,7 @@ public function take($amount) /** * @param int $amount * - * @return Iterable + * @return IterableType */ public function takeLast($amount) { @@ -222,14 +222,14 @@ public function takeLast($amount) /** * @param callable $predicate * - * @return Iterable + * @return IterableType */ abstract public function takeWhile(callable $predicate); /** * @param callable $predicate * - * @return Iterable + * @return IterableType */ public function takeUntil(callable $predicate) { diff --git a/src/SellerLabs/Nucleus/Data/Traits/ArrayBackingTrait.php b/src/SellerLabs/Nucleus/Data/Traits/ArrayBackingTrait.php index d4526d5..dce3962 100644 --- a/src/SellerLabs/Nucleus/Data/Traits/ArrayBackingTrait.php +++ b/src/SellerLabs/Nucleus/Data/Traits/ArrayBackingTrait.php @@ -8,7 +8,7 @@ use SellerLabs\Nucleus\Data\Interfaces\FunctorInterface; use SellerLabs\Nucleus\Data\Interfaces\ListInterface; use SellerLabs\Nucleus\Data\Interfaces\MonoidInterface; -use SellerLabs\Nucleus\Data\Iterable; +use SellerLabs\Nucleus\Data\IterableType; use SellerLabs\Nucleus\Exceptions\CoreException; use SellerLabs\Nucleus\Exceptions\MindTheGapException; use SellerLabs\Nucleus\Meditation\Arguments; @@ -130,7 +130,7 @@ public function foldlWithKeys(callable $callback, $initial) * @param int $begin * @param int $end * - * @return Iterable + * @return IterableType * @throws CoreException * @throws InvalidArgumentException */ @@ -174,7 +174,7 @@ public function slice($begin, $end = null) /** * @param callable $predicate * - * @return Iterable + * @return IterableType */ public function takeWhile(callable $predicate) { @@ -250,7 +250,7 @@ public function member($key) } /** - * @param array|Iterable $searchKeyPath + * @param array|IterableType $searchKeyPath * * @return Maybe */ @@ -274,7 +274,7 @@ public function lookupIn($searchKeyPath) $innerValue = Maybe::fromJust($value); - if ($innerValue instanceof Iterable) { + if ($innerValue instanceof IterableType) { return $innerValue->lookupIn($path->tail()); } @@ -282,7 +282,7 @@ public function lookupIn($searchKeyPath) } /** - * @param array|Iterable $searchKeyPath + * @param array|IterableType $searchKeyPath * * @return bool * @throws MindTheGapException @@ -305,7 +305,7 @@ public function memberIn($searchKeyPath) $innerValue = Maybe::fromJust($this->lookup($path->head())); - if ($innerValue instanceof Iterable) { + if ($innerValue instanceof IterableType) { return $innerValue->memberIn($path->tail()); } @@ -315,7 +315,7 @@ public function memberIn($searchKeyPath) /** * @param callable $comparator * - * @return Iterable + * @return IterableType */ public function sort(callable $comparator = null) { @@ -372,7 +372,7 @@ public function delete($key) * * @param array $excluded * - * @return static|Iterable + * @return static|IterableType * @throws InvalidArgumentException */ public function exceptValues($excluded = []) diff --git a/src/SellerLabs/Nucleus/Meditation/Spec.php b/src/SellerLabs/Nucleus/Meditation/Spec.php index 5547dc5..48c9c88 100644 --- a/src/SellerLabs/Nucleus/Meditation/Spec.php +++ b/src/SellerLabs/Nucleus/Meditation/Spec.php @@ -13,7 +13,7 @@ use SellerLabs\Nucleus\Data\ArrayList; use SellerLabs\Nucleus\Data\ArrayMap; use SellerLabs\Nucleus\Data\Interfaces\LeftKeyFoldableInterface; -use SellerLabs\Nucleus\Data\Iterable; +use SellerLabs\Nucleus\Data\IterableType; use SellerLabs\Nucleus\Exceptions\CoreException; use SellerLabs\Nucleus\Foundation\BaseObject; use SellerLabs\Nucleus\Meditation\Constraints\AbstractConstraint; @@ -240,7 +240,7 @@ function ($constraint) use ( * * @param string $fieldName * - * @return Iterable + * @return IterableType */ protected function getInternalFieldConstraints($fieldName) { @@ -252,7 +252,7 @@ protected function getInternalFieldConstraints($fieldName) * * @param string $fieldName * - * @return Iterable + * @return IterableType */ public function getFieldConstraints($fieldName) { @@ -268,7 +268,7 @@ public function getFieldConstraints($fieldName) if (is_array($constraints)) { return ArrayList::of($constraints); - } elseif ($constraints instanceof Iterable) { + } elseif ($constraints instanceof IterableType) { return $constraints; } @@ -400,7 +400,7 @@ public function getFieldAnnotations($fieldName) * Set the constraints for a field. * * @param string $fieldName - * @param Iterable|array|AbstractConstraint $constraints + * @param IterableType|array|AbstractConstraint $constraints * * @return static */ diff --git a/src/SellerLabs/Nucleus/Meditation/TypedSpec.php b/src/SellerLabs/Nucleus/Meditation/TypedSpec.php index caac0fb..b6f2c83 100644 --- a/src/SellerLabs/Nucleus/Meditation/TypedSpec.php +++ b/src/SellerLabs/Nucleus/Meditation/TypedSpec.php @@ -5,7 +5,7 @@ use SellerLabs\Nucleus\Control\Maybe; use SellerLabs\Nucleus\Data\ArrayList; use SellerLabs\Nucleus\Data\ArrayMap; -use SellerLabs\Nucleus\Data\Iterable; +use SellerLabs\Nucleus\Data\IterableType; use SellerLabs\Nucleus\Meditation\Constraints\AbstractTypeConstraint; /** @@ -50,7 +50,7 @@ public function getTypes() * * @param string $fieldName * - * @return Iterable + * @return IterableType */ protected function getInternalFieldConstraints($fieldName) { @@ -72,4 +72,4 @@ public function getFieldType($fieldName) $this->getFieldAnnotation($fieldName, static::ANNOTATION_TYPE) ); } -} \ No newline at end of file +}