diff --git a/composer.json b/composer.json index 8bbd638..ad1c730 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ "php": "^7.1.3", "symfony/expression-language": "^4.1", "psr/log": "^1.0", - "doctrine/collections": "^1.5", "dusank/knapsack": "^10.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index a5bd1f1..f5b65c6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,75 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "492a2af4f32227b2157929118fbbe541", + "content-hash": "fe1963ed64aab0076a092eb85b5f393d", "packages": [ - { - "name": "doctrine/collections", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "doctrine/coding-standard": "~0.1@dev", - "phpunit/phpunit": "^5.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ], - "time": "2017-07-22T10:37:32+00:00" - }, { "name": "dusank/knapsack", "version": "10.0.0", diff --git a/src/Engine/ExecutionPath.php b/src/Engine/ExecutionPath.php index ad442a1..93d0552 100644 --- a/src/Engine/ExecutionPath.php +++ b/src/Engine/ExecutionPath.php @@ -2,15 +2,13 @@ namespace Phlow\Engine; -use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\Collections\Collection; use Phlow\Model\WorkflowObject; use Traversable; class ExecutionPath implements \IteratorAggregate, \Countable { /** - * @var Collection Sequence of Workflow Connectors and Nodes + * @var array Sequence of Workflow Connectors and Nodes */ private $sequence; @@ -19,7 +17,7 @@ class ExecutionPath implements \IteratorAggregate, \Countable */ public function __construct() { - $this->sequence = new ArrayCollection(); + $this->sequence = []; } /** @@ -29,7 +27,7 @@ public function __construct() */ public function add(WorkflowObject $element) { - $this->sequence->add($element); + array_push($this->sequence, $element); } /** @@ -41,7 +39,7 @@ public function add(WorkflowObject $element) */ public function getIterator() { - return $this->sequence->getIterator(); + return new \ArrayIterator($this->sequence); } /** @@ -55,7 +53,7 @@ public function getIterator() */ public function count() { - return $this->sequence->count(); + return count($this->sequence); } /** @@ -65,6 +63,6 @@ public function count() */ public function contains(WorkflowObject $workflowObject) { - return $this->sequence->contains($workflowObject); + return in_array($workflowObject, $this->sequence, true); } }