commit c9164c4aa8bc6ac8aa402e96021e208641f48307 Author: Viktor Smagin Date: Fri Dec 12 09:19:05 2025 +0400 Version 1.0.0 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e994499 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dd5252 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +vendor/ + +.phpunit.cache/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c1acc01 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright 2025 Viktor S. + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e5c7b0c --- /dev/null +++ b/README.md @@ -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 diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c73ef1b --- /dev/null +++ b/composer.json @@ -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" + } + ] +} diff --git a/src/Object/ArrayInstantiable.php b/src/Object/ArrayInstantiable.php new file mode 100644 index 0000000..915f1de --- /dev/null +++ b/src/Object/ArrayInstantiable.php @@ -0,0 +1,10 @@ +