Version 1.0.0
This commit is contained in:
22
.editorconfig
Normal file
22
.editorconfig
Normal file
@@ -0,0 +1,22 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
vendor/
|
||||
|
||||
.phpunit.cache/
|
||||
19
LICENSE
Normal file
19
LICENSE
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright 2025 Viktor S. <thinlineseverywhere@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the “Software”),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
18
README.md
Normal file
18
README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# PHP Interfaces
|
||||
|
||||
A collection of common interfaces for PHP objects and data transfer patterns.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
composer require diffhead/php-interfaces
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- **ArrayInstantiable** — Interface for objects that can be created from arrays
|
||||
- **HasUuid** — Interface for objects with UUID support
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
26
composer.json
Normal file
26
composer.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "diffhead/php-interfaces",
|
||||
"description": "A comprehensive PHP library providing common interfaces for regular objects. Designed to standardize object manipulation patterns across applications.",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"version": "1.0.0",
|
||||
"keywords": [
|
||||
"php", "data interaction", "interface",
|
||||
"object", "library", "package", "php8", "php7"
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Diffhead\\PHP\\Interfaces\\": "src/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0"
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Viktor S.",
|
||||
"email": "thinlineseverywhere@gmail.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
src/Object/ArrayInstantiable.php
Normal file
10
src/Object/ArrayInstantiable.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Diffhead\PHP\Interfaces\Object;
|
||||
|
||||
interface ArrayInstantiable
|
||||
{
|
||||
public static function fromArray(array $data): self;
|
||||
}
|
||||
10
src/Object/HasUuid.php
Normal file
10
src/Object/HasUuid.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Diffhead\PHP\Interfaces\Object;
|
||||
|
||||
interface HasUuid
|
||||
{
|
||||
public function uuid(): string;
|
||||
}
|
||||
Reference in New Issue
Block a user