Compare commits
2 Commits
9dadc3518a
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c9332a0f4 | |||
| 3dd31e21fe |
@@ -1,3 +1,3 @@
|
|||||||
# Template
|
# Cloneable
|
||||||
|
|
||||||
Potter Framework Component Template
|
Potter Framework Cloneable Interface
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "potter/template",
|
"name": "potter/cloneable",
|
||||||
"description": "Potter Framework Component Template",
|
"description": "Potter Framework Cloneable Interface",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.5"
|
"php": "^8.5"
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Potter\\": "src/Potter/"
|
"Potter\\Cloneable\\": "src/Potter/Cloneable/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|||||||
@@ -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