implement Potter\Cloneable
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Cloneable;
|
||||||
|
|
||||||
|
interface CloneableInterface
|
||||||
|
{
|
||||||
|
public function clone(): static;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Potter\Cloneable;
|
||||||
|
|
||||||
|
trait CloneableTrait
|
||||||
|
{
|
||||||
|
final public function clone(): static
|
||||||
|
{
|
||||||
|
return clone $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user