diff --git a/composer.json b/composer.json index e429aba..10477f8 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "potter/cloneable", "description": "Potter Framework Cloneable Interface", - "version": "1.0.1", + "version": "1.0.0", "type": "library", "homepage": "https://gitpotter.com/Potter/Cloneable", "license": "MIT", @@ -19,8 +19,6 @@ }, "minimum-stability": "stable", "require": { - "php": "^8.3", - "potter/event": "^1.0", - "league/event": "^3.0" + "php": "^8.3" } } diff --git a/src/Potter/Cloneable/CloneableInterface.php b/src/Potter/Cloneable/CloneableInterface.php index 8391928..ef2fe5c 100644 --- a/src/Potter/Cloneable/CloneableInterface.php +++ b/src/Potter/Cloneable/CloneableInterface.php @@ -4,9 +4,7 @@ declare(strict_types=1); namespace Potter\Cloneable; -use \Potter\Event\DispatcherAwareInterface; - -interface CloneableInterface extends DispatcherAwareInterface +interface CloneableInterface { public function clone(): static; public function __clone(): void; diff --git a/src/Potter/Cloneable/CloneableTrait.php b/src/Potter/Cloneable/CloneableTrait.php index 6a9c98a..7b8404d 100644 --- a/src/Potter/Cloneable/CloneableTrait.php +++ b/src/Potter/Cloneable/CloneableTrait.php @@ -4,30 +4,13 @@ declare(strict_types=1); namespace Potter\Cloneable; -use \League\Event\EventDispatcher as BaseDispatcher; - trait CloneableTrait { - private const string BEFORE_CLONE = 'beforeClone'; - private const string AFTER_CLONE = 'afterClone'; - final public function clone(): static { - if ($this->hasEventDispatcher()) { - $this->eventDispatcher()->dispatch(self::BEFORE_CLONE); - } return clone $this; } public function __clone(): void - { - if (!$this->hasEventDispatcher()) { - return; - } - $this->eventDispatcher()->dispatch(self::AFTER_CLONE); - } - - abstract public function eventDispatcher(): BaseDispatcher; - abstract public function hasEventDispatcher(): bool; - + { } }