From 49a21e7e617e473e444750b909a0ef53d081a53e Mon Sep 17 00:00:00 2001 From: jkapuscik2 Date: Mon, 10 Jul 2023 22:44:51 +0200 Subject: [PATCH 1/5] Updated to PHP 8.2 --- .gitignore | 1 - README.md | 50 +- .../ChainOfResponsibility/ApiMiddleware.php | 22 - .../ChainOfResponsibility/Middleware.php | 22 - .../ChainOfResponsibility/MiddlewareError.php | 6 - behavioral/ChainOfResponsibility/Request.php | 34 - behavioral/ChainOfResponsibility/Response.php | 25 - behavioral/ChainOfResponsibility/index.php | 8 - behavioral/Command/Command.php | 8 - behavioral/Command/CreateListing.php | 46 - behavioral/Command/DeleteListing.php | 20 - behavioral/Iterator/CompanyEmployeeTeam.php | 44 - behavioral/Iterator/Employee.php | 14 - behavioral/Iterator/EmployeeTeamIterator.php | 47 - behavioral/Iterator/demo.php | 32 - behavioral/NullObject/Cache.php | 12 - behavioral/NullObject/DummyCache.php | 19 - behavioral/Observer/Communicator.php | 34 - behavioral/Observer/Employee.php | 24 - behavioral/Observer/HumanResources.php | 28 - behavioral/Observer/demo.php | 22 - behavioral/Specification/AgeSpecification.php | 19 - behavioral/Specification/Candidate.php | 40 - behavioral/Specification/Education.php | 24 - behavioral/Specification/NotSpecification.php | 18 - behavioral/Specification/Specification.php | 8 - behavioral/Specification/WorkExperience.php | 26 - .../WorkExperienceSpecification.php | 24 - behavioral/State/Angry.php | 20 - behavioral/State/Happy.php | 19 - behavioral/State/Mood.php | 12 - behavioral/State/Person.php | 34 - behavioral/Strategy/Context.php | 28 - behavioral/Strategy/JSONFormatter.php | 10 - behavioral/Strategy/OutputFormatter.php | 9 - behavioral/Strategy/StringFormatter.php | 12 - behavioral/TemplateMethod/ActionMovie.php | 24 - behavioral/TemplateMethod/ComedyMovie.php | 22 - behavioral/TemplateMethod/Movie.php | 33 - behavioral/Visitor/SickLeave.php | 25 - behavioral/Visitor/University.php | 30 - behavioral/Visitor/Visitable.php | 8 - behavioral/Visitor/Visitor.php | 11 - composer.json | 18 +- composer.lock | 4397 +++++++++++++++++ creational/AbstractFactory/DeviceFactory.php | 11 - creational/AbstractFactory/DisplayFactory.php | 14 - creational/AbstractFactory/IndoorDisplay.php | 15 - creational/AbstractFactory/IndoorIot.php | 16 - creational/AbstractFactory/IndoorProduct.php | 12 - creational/AbstractFactory/IotFactory.php | 15 - creational/AbstractFactory/OutdoorDisplay.php | 16 - creational/AbstractFactory/OutdoorIot.php | 16 - creational/AbstractFactory/OutdoorProduct.php | 12 - creational/Builder/DeviceBuilder.php | 18 - creational/Builder/Director.php | 17 - creational/Builder/InteractiveMirror.php | 13 - .../Builder/InteractiveMirrorBuilder.php | 33 - creational/FactoryMethod/AudioBox.php | 11 - creational/FactoryMethod/Box.php | 15 - creational/FactoryMethod/BoxFactory.php | 27 - creational/FactoryMethod/Factory.php | 8 - creational/FactoryMethod/FileItem.php | 27 - creational/FactoryMethod/ImgBox.php | 11 - creational/FactoryMethod/VideoBox.php | 11 - creational/FactoryMethod/demo.php | 13 - creational/Prototype/Computer.php | 22 - creational/Prototype/Device.php | 13 - creational/Prototype/DevicesGroup.php | 23 - creational/Prototype/demo.php | 25 - creational/Singleton/singleton.php | 37 - .../ChainOfResponsibility/ApiMiddleware.php | 23 + .../Behavioral}/ChainOfResponsibility/App.php | 23 +- .../ChainOfResponsibility/GetMiddleware.php | 15 +- .../ChainOfResponsibility/Middleware.php | 23 + .../ChainOfResponsibility/MiddlewareError.php | 7 + .../ChainOfResponsibility/Request.php | 35 + .../ChainOfResponsibility/Response.php | 25 + .../ChainOfResponsibility/index.php | 8 + .../ChainOfResponsibility/server.sh | 0 .../Behavioral}/Command/Client.php | 16 +- src/Behavioral/Command/Command.php | 8 + src/Behavioral/Command/CreateListing.php | 44 + src/Behavioral/Command/DeleteListing.php | 15 + .../Behavioral}/Command/ListingRepository.php | 10 +- .../Behavioral}/Command/demo.php | 6 +- src/Behavioral/Iterator/Employee.php | 22 + src/Behavioral/Iterator/Team.php | 64 + src/Behavioral/Iterator/TeamIterator.php | 56 + src/Behavioral/Iterator/demo.php | 24 + .../Behavioral}/NullObject/ArrayCache.php | 10 +- src/Behavioral/NullObject/Cache.php | 12 + src/Behavioral/NullObject/DummyCache.php | 20 + src/Behavioral/Observer/Communicator.php | 42 + src/Behavioral/Observer/Employee.php | 28 + src/Behavioral/Observer/HumanResources.php | 32 + src/Behavioral/Observer/demo.php | 21 + .../Specification/AndSpecification.php | 8 +- src/Behavioral/Specification/Candidate.php | 31 + .../Specification/ConvictedSpecification.php | 7 +- src/Behavioral/Specification/Education.php | 18 + .../Specification/MaxAgeSpecification.php | 16 + .../Specification/NotSpecification.php | 15 + .../Specification/OrSpecification.php | 8 +- .../RecentGraduateSpecification.php | 4 +- .../Specification/Specification.php | 8 + .../Specification/StudentSpecification.php | 10 +- .../Specification/WorkExperience.php | 19 + .../WorkExperienceSpecification.php | 21 + .../Behavioral}/Specification/demo.php | 19 +- src/Behavioral/State/Angry.php | 23 + src/Behavioral/State/Happy.php | 22 + src/Behavioral/State/Mood.php | 12 + .../Behavioral}/State/Neutral.php | 17 +- src/Behavioral/State/Person.php | 40 + {behavioral => src/Behavioral}/State/demo.php | 4 +- src/Behavioral/Strategy/Context.php | 23 + src/Behavioral/Strategy/JSONFormatter.php | 11 + src/Behavioral/Strategy/OutputFormatter.php | 8 + src/Behavioral/Strategy/StringFormatter.php | 13 + .../Behavioral}/Strategy/XMLFormatter.php | 14 +- .../Behavioral}/Strategy/demo.php | 12 +- src/Behavioral/TemplateMethod/ActionMovie.php | 27 + src/Behavioral/TemplateMethod/ComedyMovie.php | 25 + src/Behavioral/TemplateMethod/Movie.php | 36 + .../Behavioral}/TemplateMethod/demo.php | 6 +- src/Behavioral/Visitor/SickLeave.php | 20 + .../Behavioral}/Visitor/SickLeaveReport.php | 15 +- .../Behavioral}/Visitor/Student.php | 12 +- src/Behavioral/Visitor/University.php | 25 + src/Behavioral/Visitor/Visitable.php | 8 + src/Behavioral/Visitor/Visitor.php | 10 + .../Behavioral}/Visitor/demo.php | 15 +- .../AbstractFactory/DeviceFactory.php | 10 + .../AbstractFactory/DisplayFactory.php | 16 + .../AbstractFactory/IndoorDisplay.php | 16 + src/Creational/AbstractFactory/IndoorIot.php | 16 + .../AbstractFactory/IndoorProduct.php | 10 + src/Creational/AbstractFactory/IotFactory.php | 16 + .../AbstractFactory/OutdoorDisplay.php | 16 + src/Creational/AbstractFactory/OutdoorIot.php | 16 + .../AbstractFactory/OutdoorProduct.php | 10 + .../Creational}/AbstractFactory/demo.php | 6 +- src/Creational/Builder/Device.php | 12 + src/Creational/Builder/DeviceBuilder.php | 14 + src/Creational/Builder/Director.php | 14 + src/Creational/Builder/InteractiveMirror.php | 25 + .../Builder/InteractiveMirrorBuilder.php | 41 + .../Creational}/Builder/demo.php | 7 +- src/Creational/FactoryMethod/AudioBox.php | 11 + src/Creational/FactoryMethod/Box.php | 15 + src/Creational/FactoryMethod/BoxFactory.php | 18 + src/Creational/FactoryMethod/Factory.php | 8 + src/Creational/FactoryMethod/FileItem.php | 26 + src/Creational/FactoryMethod/ImgBox.php | 11 + src/Creational/FactoryMethod/VideoBox.php | 11 + src/Creational/FactoryMethod/demo.php | 13 + src/Creational/Prototype/Computer.php | 25 + src/Creational/Prototype/Device.php | 12 + src/Creational/Prototype/DeviceGroup.php | 22 + src/Creational/Prototype/demo.php | 23 + src/Creational/Singleton/ActiveUser.php | 37 + .../Structural}/Adapter/.env.example | 4 - .../Structural}/Adapter/AWSFileStorage.php | 45 +- src/Structural/Adapter/Client.php | 35 + src/Structural/Adapter/File.php | 20 + src/Structural/Adapter/FileAdapter.php | 12 + src/Structural/Adapter/LocalFileStorage.php | 32 + .../Structural}/Adapter/assets/logo.png | Bin .../Structural}/Adapter/index.php | 11 +- .../Structural}/Adapter/server.sh | 0 .../Structural}/Adapter/storage/.gitkeep | 0 src/Structural/Bridge/Blurred.php | 24 + src/Structural/Bridge/Content.php | 15 + src/Structural/Bridge/Display.php | 13 + .../Structural}/Bridge/Image.php | 15 +- .../Structural}/Bridge/Standard.php | 13 +- .../Structural}/Bridge/Video.php | 15 +- .../Structural}/Bridge/demo.php | 4 +- src/Structural/Composite/Budgeted.php | 8 + .../Composite/BudgetedComposite.php | 14 + .../Structural}/Composite/Department.php | 24 +- src/Structural/Composite/Employee.php | 15 + .../Structural}/Composite/demo.php | 5 +- src/Structural/Decorator/Product.php | 10 + src/Structural/Decorator/ProductDecorator.php | 18 + src/Structural/Decorator/Shirt.php | 22 + src/Structural/Decorator/SummerSale.php | 19 + src/Structural/Decorator/TV.php | 22 + src/Structural/Decorator/WinterSale.php | 19 + .../Structural}/Decorator/demo.php | 6 +- .../DependencyInjection/Storage.php | 8 + .../Structural}/DependencyInjection/User.php | 19 +- .../DependencyInjection/UserStorage.php | 14 +- .../DependencyInjection/UserTest.php | 27 +- .../Structural}/Facade/Image.php | 20 +- src/Structural/Facade/demo.php | 8 + .../FluentInterface/QueryBuilder.php | 7 +- .../Structural}/FluentInterface/demo.php | 5 +- src/Structural/Flyweight/Device.php | 21 + .../Structural}/Flyweight/DeviceStorage.php | 30 +- src/Structural/Flyweight/DeviceType.php | 20 + .../Flyweight/DeviceTypeFactory.php | 31 +- .../Structural/Flyweight/Generator.php | 41 +- .../Structural}/Flyweight/demo.php | 19 +- .../Structural}/Proxy/AuthFile.php | 28 +- src/Structural/Proxy/File.php | 12 + src/Structural/Proxy/FileProvider.php | 21 + {structural => src/Structural}/Proxy/User.php | 14 +- {structural => src/Structural}/Proxy/demo.php | 4 +- structural/Adapter/AzureFileStorage.php | 36 - structural/Adapter/Client.php | 38 - structural/Adapter/File.php | 23 - structural/Adapter/FileAdapter.php | 13 - structural/Adapter/LocalFileStorage.php | 27 - structural/Bridge/Blurred.php | 30 - structural/Bridge/Content.php | 18 - structural/Bridge/Display.php | 16 - structural/Composite/Budgeted.php | 7 - structural/Composite/BudgetedComposite.php | 14 - structural/Composite/Employee.php | 18 - structural/Decorator/Product.php | 10 - structural/Decorator/ProductDecorator.php | 17 - structural/Decorator/Shirt.php | 24 - structural/Decorator/SummerSale.php | 17 - structural/Decorator/TV.php | 24 - structural/Decorator/WinterSale.php | 17 - structural/DependencyInjection/Storage.php | 8 - structural/Facade/demo.php | 8 - structural/Flyweight/Device.php | 26 - structural/Flyweight/DeviceType.php | 27 - structural/Proxy/File.php | 11 - structural/Proxy/FileProvider.php | 18 - 233 files changed, 6559 insertions(+), 2165 deletions(-) delete mode 100644 behavioral/ChainOfResponsibility/ApiMiddleware.php delete mode 100644 behavioral/ChainOfResponsibility/Middleware.php delete mode 100644 behavioral/ChainOfResponsibility/MiddlewareError.php delete mode 100644 behavioral/ChainOfResponsibility/Request.php delete mode 100644 behavioral/ChainOfResponsibility/Response.php delete mode 100644 behavioral/ChainOfResponsibility/index.php delete mode 100644 behavioral/Command/Command.php delete mode 100644 behavioral/Command/CreateListing.php delete mode 100644 behavioral/Command/DeleteListing.php delete mode 100644 behavioral/Iterator/CompanyEmployeeTeam.php delete mode 100644 behavioral/Iterator/Employee.php delete mode 100644 behavioral/Iterator/EmployeeTeamIterator.php delete mode 100644 behavioral/Iterator/demo.php delete mode 100644 behavioral/NullObject/Cache.php delete mode 100644 behavioral/NullObject/DummyCache.php delete mode 100644 behavioral/Observer/Communicator.php delete mode 100644 behavioral/Observer/Employee.php delete mode 100644 behavioral/Observer/HumanResources.php delete mode 100644 behavioral/Observer/demo.php delete mode 100644 behavioral/Specification/AgeSpecification.php delete mode 100644 behavioral/Specification/Candidate.php delete mode 100644 behavioral/Specification/Education.php delete mode 100644 behavioral/Specification/NotSpecification.php delete mode 100644 behavioral/Specification/Specification.php delete mode 100644 behavioral/Specification/WorkExperience.php delete mode 100644 behavioral/Specification/WorkExperienceSpecification.php delete mode 100644 behavioral/State/Angry.php delete mode 100644 behavioral/State/Happy.php delete mode 100644 behavioral/State/Mood.php delete mode 100644 behavioral/State/Person.php delete mode 100644 behavioral/Strategy/Context.php delete mode 100644 behavioral/Strategy/JSONFormatter.php delete mode 100644 behavioral/Strategy/OutputFormatter.php delete mode 100644 behavioral/Strategy/StringFormatter.php delete mode 100644 behavioral/TemplateMethod/ActionMovie.php delete mode 100644 behavioral/TemplateMethod/ComedyMovie.php delete mode 100644 behavioral/TemplateMethod/Movie.php delete mode 100644 behavioral/Visitor/SickLeave.php delete mode 100644 behavioral/Visitor/University.php delete mode 100644 behavioral/Visitor/Visitable.php delete mode 100644 behavioral/Visitor/Visitor.php create mode 100644 composer.lock delete mode 100644 creational/AbstractFactory/DeviceFactory.php delete mode 100644 creational/AbstractFactory/DisplayFactory.php delete mode 100644 creational/AbstractFactory/IndoorDisplay.php delete mode 100644 creational/AbstractFactory/IndoorIot.php delete mode 100644 creational/AbstractFactory/IndoorProduct.php delete mode 100644 creational/AbstractFactory/IotFactory.php delete mode 100644 creational/AbstractFactory/OutdoorDisplay.php delete mode 100644 creational/AbstractFactory/OutdoorIot.php delete mode 100644 creational/AbstractFactory/OutdoorProduct.php delete mode 100644 creational/Builder/DeviceBuilder.php delete mode 100644 creational/Builder/Director.php delete mode 100644 creational/Builder/InteractiveMirror.php delete mode 100644 creational/Builder/InteractiveMirrorBuilder.php delete mode 100644 creational/FactoryMethod/AudioBox.php delete mode 100644 creational/FactoryMethod/Box.php delete mode 100644 creational/FactoryMethod/BoxFactory.php delete mode 100644 creational/FactoryMethod/Factory.php delete mode 100644 creational/FactoryMethod/FileItem.php delete mode 100644 creational/FactoryMethod/ImgBox.php delete mode 100644 creational/FactoryMethod/VideoBox.php delete mode 100644 creational/FactoryMethod/demo.php delete mode 100644 creational/Prototype/Computer.php delete mode 100644 creational/Prototype/Device.php delete mode 100644 creational/Prototype/DevicesGroup.php delete mode 100644 creational/Prototype/demo.php delete mode 100644 creational/Singleton/singleton.php create mode 100644 src/Behavioral/ChainOfResponsibility/ApiMiddleware.php rename {behavioral => src/Behavioral}/ChainOfResponsibility/App.php (55%) rename {behavioral => src/Behavioral}/ChainOfResponsibility/GetMiddleware.php (55%) create mode 100644 src/Behavioral/ChainOfResponsibility/Middleware.php create mode 100644 src/Behavioral/ChainOfResponsibility/MiddlewareError.php create mode 100644 src/Behavioral/ChainOfResponsibility/Request.php create mode 100644 src/Behavioral/ChainOfResponsibility/Response.php create mode 100644 src/Behavioral/ChainOfResponsibility/index.php rename {behavioral => src/Behavioral}/ChainOfResponsibility/server.sh (100%) rename {behavioral => src/Behavioral}/Command/Client.php (56%) create mode 100644 src/Behavioral/Command/Command.php create mode 100644 src/Behavioral/Command/CreateListing.php create mode 100644 src/Behavioral/Command/DeleteListing.php rename {behavioral => src/Behavioral}/Command/ListingRepository.php (69%) rename {behavioral => src/Behavioral}/Command/demo.php (56%) create mode 100644 src/Behavioral/Iterator/Employee.php create mode 100644 src/Behavioral/Iterator/Team.php create mode 100644 src/Behavioral/Iterator/TeamIterator.php create mode 100644 src/Behavioral/Iterator/demo.php rename {behavioral => src/Behavioral}/NullObject/ArrayCache.php (64%) create mode 100644 src/Behavioral/NullObject/Cache.php create mode 100644 src/Behavioral/NullObject/DummyCache.php create mode 100644 src/Behavioral/Observer/Communicator.php create mode 100644 src/Behavioral/Observer/Employee.php create mode 100644 src/Behavioral/Observer/HumanResources.php create mode 100644 src/Behavioral/Observer/demo.php rename {behavioral => src/Behavioral}/Specification/AndSpecification.php (80%) create mode 100644 src/Behavioral/Specification/Candidate.php rename {behavioral => src/Behavioral}/Specification/ConvictedSpecification.php (55%) create mode 100644 src/Behavioral/Specification/Education.php create mode 100644 src/Behavioral/Specification/MaxAgeSpecification.php create mode 100644 src/Behavioral/Specification/NotSpecification.php rename {behavioral => src/Behavioral}/Specification/OrSpecification.php (82%) rename {behavioral => src/Behavioral}/Specification/RecentGraduateSpecification.php (93%) create mode 100644 src/Behavioral/Specification/Specification.php rename {behavioral => src/Behavioral}/Specification/StudentSpecification.php (58%) create mode 100644 src/Behavioral/Specification/WorkExperience.php create mode 100644 src/Behavioral/Specification/WorkExperienceSpecification.php rename {behavioral => src/Behavioral}/Specification/demo.php (77%) create mode 100644 src/Behavioral/State/Angry.php create mode 100644 src/Behavioral/State/Happy.php create mode 100644 src/Behavioral/State/Mood.php rename {behavioral => src/Behavioral}/State/Neutral.php (50%) create mode 100644 src/Behavioral/State/Person.php rename {behavioral => src/Behavioral}/State/demo.php (65%) create mode 100644 src/Behavioral/Strategy/Context.php create mode 100644 src/Behavioral/Strategy/JSONFormatter.php create mode 100644 src/Behavioral/Strategy/OutputFormatter.php create mode 100644 src/Behavioral/Strategy/StringFormatter.php rename {behavioral => src/Behavioral}/Strategy/XMLFormatter.php (59%) rename {behavioral => src/Behavioral}/Strategy/demo.php (56%) create mode 100644 src/Behavioral/TemplateMethod/ActionMovie.php create mode 100644 src/Behavioral/TemplateMethod/ComedyMovie.php create mode 100644 src/Behavioral/TemplateMethod/Movie.php rename {behavioral => src/Behavioral}/TemplateMethod/demo.php (51%) create mode 100644 src/Behavioral/Visitor/SickLeave.php rename {behavioral => src/Behavioral}/Visitor/SickLeaveReport.php (57%) rename {behavioral => src/Behavioral}/Visitor/Student.php (77%) create mode 100644 src/Behavioral/Visitor/University.php create mode 100644 src/Behavioral/Visitor/Visitable.php create mode 100644 src/Behavioral/Visitor/Visitor.php rename {behavioral => src/Behavioral}/Visitor/demo.php (62%) create mode 100644 src/Creational/AbstractFactory/DeviceFactory.php create mode 100644 src/Creational/AbstractFactory/DisplayFactory.php create mode 100644 src/Creational/AbstractFactory/IndoorDisplay.php create mode 100644 src/Creational/AbstractFactory/IndoorIot.php create mode 100644 src/Creational/AbstractFactory/IndoorProduct.php create mode 100644 src/Creational/AbstractFactory/IotFactory.php create mode 100644 src/Creational/AbstractFactory/OutdoorDisplay.php create mode 100644 src/Creational/AbstractFactory/OutdoorIot.php create mode 100644 src/Creational/AbstractFactory/OutdoorProduct.php rename {creational => src/Creational}/AbstractFactory/demo.php (78%) create mode 100644 src/Creational/Builder/Device.php create mode 100644 src/Creational/Builder/DeviceBuilder.php create mode 100644 src/Creational/Builder/Director.php create mode 100644 src/Creational/Builder/InteractiveMirror.php create mode 100644 src/Creational/Builder/InteractiveMirrorBuilder.php rename {creational => src/Creational}/Builder/demo.php (56%) create mode 100644 src/Creational/FactoryMethod/AudioBox.php create mode 100644 src/Creational/FactoryMethod/Box.php create mode 100644 src/Creational/FactoryMethod/BoxFactory.php create mode 100644 src/Creational/FactoryMethod/Factory.php create mode 100644 src/Creational/FactoryMethod/FileItem.php create mode 100644 src/Creational/FactoryMethod/ImgBox.php create mode 100644 src/Creational/FactoryMethod/VideoBox.php create mode 100644 src/Creational/FactoryMethod/demo.php create mode 100644 src/Creational/Prototype/Computer.php create mode 100644 src/Creational/Prototype/Device.php create mode 100644 src/Creational/Prototype/DeviceGroup.php create mode 100644 src/Creational/Prototype/demo.php create mode 100644 src/Creational/Singleton/ActiveUser.php rename {structural => src/Structural}/Adapter/.env.example (53%) rename {structural => src/Structural}/Adapter/AWSFileStorage.php (53%) create mode 100644 src/Structural/Adapter/Client.php create mode 100644 src/Structural/Adapter/File.php create mode 100644 src/Structural/Adapter/FileAdapter.php create mode 100644 src/Structural/Adapter/LocalFileStorage.php rename {structural => src/Structural}/Adapter/assets/logo.png (100%) rename {structural => src/Structural}/Adapter/index.php (94%) rename {structural => src/Structural}/Adapter/server.sh (100%) rename {structural => src/Structural}/Adapter/storage/.gitkeep (100%) create mode 100644 src/Structural/Bridge/Blurred.php create mode 100644 src/Structural/Bridge/Content.php create mode 100644 src/Structural/Bridge/Display.php rename {structural => src/Structural}/Bridge/Image.php (56%) rename {structural => src/Structural}/Bridge/Standard.php (59%) rename {structural => src/Structural}/Bridge/Video.php (60%) rename {structural => src/Structural}/Bridge/demo.php (82%) create mode 100644 src/Structural/Composite/Budgeted.php create mode 100644 src/Structural/Composite/BudgetedComposite.php rename {structural => src/Structural}/Composite/Department.php (50%) create mode 100644 src/Structural/Composite/Employee.php rename {structural => src/Structural}/Composite/demo.php (87%) create mode 100644 src/Structural/Decorator/Product.php create mode 100644 src/Structural/Decorator/ProductDecorator.php create mode 100644 src/Structural/Decorator/Shirt.php create mode 100644 src/Structural/Decorator/SummerSale.php create mode 100644 src/Structural/Decorator/TV.php create mode 100644 src/Structural/Decorator/WinterSale.php rename {structural => src/Structural}/Decorator/demo.php (77%) create mode 100644 src/Structural/DependencyInjection/Storage.php rename {structural => src/Structural}/DependencyInjection/User.php (57%) rename {structural => src/Structural}/DependencyInjection/UserStorage.php (51%) rename {structural => src/Structural}/DependencyInjection/UserTest.php (69%) rename {structural => src/Structural}/Facade/Image.php (63%) create mode 100644 src/Structural/Facade/demo.php rename {structural => src/Structural}/FluentInterface/QueryBuilder.php (92%) rename {structural => src/Structural}/FluentInterface/demo.php (67%) create mode 100644 src/Structural/Flyweight/Device.php rename {structural => src/Structural}/Flyweight/DeviceStorage.php (62%) create mode 100644 src/Structural/Flyweight/DeviceType.php rename {structural => src/Structural}/Flyweight/DeviceTypeFactory.php (59%) rename structural/Flyweight/create_csv.php => src/Structural/Flyweight/Generator.php (56%) rename {structural => src/Structural}/Flyweight/demo.php (57%) rename {structural => src/Structural}/Proxy/AuthFile.php (61%) create mode 100644 src/Structural/Proxy/File.php create mode 100644 src/Structural/Proxy/FileProvider.php rename {structural => src/Structural}/Proxy/User.php (58%) rename {structural => src/Structural}/Proxy/demo.php (86%) delete mode 100644 structural/Adapter/AzureFileStorage.php delete mode 100644 structural/Adapter/Client.php delete mode 100644 structural/Adapter/File.php delete mode 100644 structural/Adapter/FileAdapter.php delete mode 100644 structural/Adapter/LocalFileStorage.php delete mode 100644 structural/Bridge/Blurred.php delete mode 100644 structural/Bridge/Content.php delete mode 100644 structural/Bridge/Display.php delete mode 100644 structural/Composite/Budgeted.php delete mode 100644 structural/Composite/BudgetedComposite.php delete mode 100644 structural/Composite/Employee.php delete mode 100644 structural/Decorator/Product.php delete mode 100644 structural/Decorator/ProductDecorator.php delete mode 100644 structural/Decorator/Shirt.php delete mode 100644 structural/Decorator/SummerSale.php delete mode 100644 structural/Decorator/TV.php delete mode 100644 structural/Decorator/WinterSale.php delete mode 100644 structural/DependencyInjection/Storage.php delete mode 100644 structural/Facade/demo.php delete mode 100644 structural/Flyweight/Device.php delete mode 100644 structural/Flyweight/DeviceType.php delete mode 100644 structural/Proxy/File.php delete mode 100644 structural/Proxy/FileProvider.php diff --git a/.gitignore b/.gitignore index 9ea668e..4a5caae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -structural/Adapter/Config.php vendor .idea .env \ No newline at end of file diff --git a/README.md b/README.md index 88ebcf5..c3c46cd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This project is set of simple examples of usage of different design patterns in a real world scenarios. Each one have a short description and guideline: - [Factory Method](https://medium.com/@j.kapuscik2/getting-started-with-design-patterns-in-php-4d451ccdfb71) -- [Creational Patterns](https://medium.com/@j.kapuscik2/creational-design-patterns-in-php-db365d3245ce) +- [src/Creational Patterns](https://medium.com/@j.kapuscik2/src/Creational-design-patterns-in-php-db365d3245ce) - [Observer](https://medium.com/@j.kapuscik2/observer-pattern-in-php-2ba240f89fb2) - [Iterator](https://medium.com/@j.kapuscik2/iterator-pattern-in-php-b7624f6bdbcf) - [State & Strategy](https://medium.com/@j.kapuscik2/state-strategy-design-patterns-by-example-f57ebd7b6211) @@ -25,31 +25,31 @@ This project is set of simple examples of usage of different design patterns in ### Following patterns have so far been described: #### Creational: -1. [Factory Method](/creational/FactoryMethod) -2. [Abstract Factory](/creational/AbstractFactory) -3. [Singleton](/creational/Singleton) -4. [Builder](/creational/Builder) -5. [Prototype](/creational/Prototype) +1. [Factory Method](/src/Creational/FactoryMethod) +2. [Abstract Factory](/src/Creational/AbstractFactory) +3. [Singleton](/src/Creational/Singleton) +4. [Builder](/src/Creational/Builder) +5. [Prototype](/src/Creational/Prototype) #### Behavioral: -1. [Iterator](/behavioral/Iterator) -2. [Observer](/behavioral/Observer) -3. [State](/behavioral/State) -4. [Strategy](/behavioral/Strategy) -5. [Template Method](/behavioral/TemplateMethod) -6. [Chain of Responsibility](/behavioral/ChainOfResponsibility) -7. [Visitor](/behavioral/Visitor) -8. [Command](/behavioral/Command) -9. [Null Object](/behavioral/NullObject) -10. [Specification](/behavioral/Specification) +1. [Iterator](src/Behavioral/Iterator) +2. [Observer](src/Behavioral/Observer) +3. [State](src/Behavioral/State) +4. [Strategy](src/Behavioral/Strategy) +5. [Template Method](src/Behavioral/TemplateMethod) +6. [Chain of Responsibility](src/Behavioral/ChainOfResponsibility) +7. [Visitor](src/Behavioral/Visitor) +8. [Command](src/Behavioral/Command) +9. [Null Object](src/Behavioral/NullObject) +10. [Specification](src/Behavioral/Specification) #### Structural: -1. [Adapter](/structural/Adapter) -2. [Decorator](/structural/Decorator) -3. [Proxy](/structural/Proxy) -4. [Dependency Injection](/structural/DependencyInjection) -5. [Facade](/structural/Facade) -6. [Composite](/structural/Composite) -7. [Bridge](/structural/Bridge) -8. [Flyweight](/structural/Flyweight) -9. [Fluent Interface](/structural/FluentInterface) +1. [Adapter](src/Structural/Adapter) +2. [Decorator](src/Structural/Decorator) +3. [Proxy](src/Structural/Proxy) +4. [Dependency Injection](src/Structural/DependencyInjection) +5. [Facade](src/Structural/Facade) +6. [Composite](src/Structural/Composite) +7. [Bridge](src/Structural/Bridge) +8. [Flyweight](src/Structural/Flyweight) +9. [Fluent Interface](src/Structural/FluentInterface) diff --git a/behavioral/ChainOfResponsibility/ApiMiddleware.php b/behavioral/ChainOfResponsibility/ApiMiddleware.php deleted file mode 100644 index 2127023..0000000 --- a/behavioral/ChainOfResponsibility/ApiMiddleware.php +++ /dev/null @@ -1,22 +0,0 @@ -hasParam($this->apiKeyName) - && in_array($request->getParam($this->apiKeyName), $this->apiKeys)) { - - return parent::process($request); - } else { - throw new MiddlewareError("Api key validation error"); - } - } -} \ No newline at end of file diff --git a/behavioral/ChainOfResponsibility/Middleware.php b/behavioral/ChainOfResponsibility/Middleware.php deleted file mode 100644 index d46c70f..0000000 --- a/behavioral/ChainOfResponsibility/Middleware.php +++ /dev/null @@ -1,22 +0,0 @@ -next = $middleware; - - return $middleware; - } - - public function process (Request $request) { - if ($this->next) { - return $this->next->process($request); - } else { - return true; - } - } -} \ No newline at end of file diff --git a/behavioral/ChainOfResponsibility/MiddlewareError.php b/behavioral/ChainOfResponsibility/MiddlewareError.php deleted file mode 100644 index 5d9e514..0000000 --- a/behavioral/ChainOfResponsibility/MiddlewareError.php +++ /dev/null @@ -1,6 +0,0 @@ -params = $params; - $this->server = $server; - } - - public function getParam ($name) { - return $this->params[$name]; - } - - public function getParams () { - return $this->params; - } - - public function hasParam (string $name) { - return array_key_exists($name, $this->params); - } - - public function getServerParam (string $name) { - return $this->server[$name]; - } - - public function hasServerParam (string $name) { - return array_key_exists($name, $this->server); - } -} \ No newline at end of file diff --git a/behavioral/ChainOfResponsibility/Response.php b/behavioral/ChainOfResponsibility/Response.php deleted file mode 100644 index 6722e47..0000000 --- a/behavioral/ChainOfResponsibility/Response.php +++ /dev/null @@ -1,25 +0,0 @@ -request = $request; - } - - public function handle () { - http_response_code(self::CODE_OK); - header(self::CONTENT_TYPE_JSON); - - echo json_encode([ - "statusCode" => self::CODE_OK, - "message" => "Request proceeded correctly", - "params" => $this->request->getParams() - ]); - } -} \ No newline at end of file diff --git a/behavioral/ChainOfResponsibility/index.php b/behavioral/ChainOfResponsibility/index.php deleted file mode 100644 index ff96b12..0000000 --- a/behavioral/ChainOfResponsibility/index.php +++ /dev/null @@ -1,8 +0,0 @@ -run(); \ No newline at end of file diff --git a/behavioral/Command/Command.php b/behavioral/Command/Command.php deleted file mode 100644 index 5d8bf8a..0000000 --- a/behavioral/Command/Command.php +++ /dev/null @@ -1,8 +0,0 @@ -repository = $repository; - $this->title = $title; - $this->content = $content; - $this->author = $author; - } - - private function validate(): void - { - if (strlen($this->title) < self::MIN_TITLE_LENGTH) { - throw new LengthException(sprintf("Title is too short. Must be at least %d characters", - self::MIN_TITLE_LENGTH)); - } - if (strlen($this->content) < self::MIN_CONTENT_LENGTH) { - throw new LengthException(sprintf("Content is too short. Must be at least %d characters", - self::MIN_CONTENT_LENGTH)); - } - if (strlen($this->author) < self::MIN_AUTHOR_LENGTH) { - throw new LengthException(sprintf("Author name is too short. Must be at least %d characters", - self::MIN_AUTHOR_LENGTH)); - } - } - - public function handle(): void - { - $this->validate(); - $this->repository->create($this->title, $this->content, $this->author); - } -} \ No newline at end of file diff --git a/behavioral/Command/DeleteListing.php b/behavioral/Command/DeleteListing.php deleted file mode 100644 index 2d3a94f..0000000 --- a/behavioral/Command/DeleteListing.php +++ /dev/null @@ -1,20 +0,0 @@ -repository = $repository; - $this->listingUid = $listingUid; - } - - public function handle(): void - { - $this->repository->delete($this->listingUid); - } -} \ No newline at end of file diff --git a/behavioral/Iterator/CompanyEmployeeTeam.php b/behavioral/Iterator/CompanyEmployeeTeam.php deleted file mode 100644 index 9d1c316..0000000 --- a/behavioral/Iterator/CompanyEmployeeTeam.php +++ /dev/null @@ -1,44 +0,0 @@ -subordinates = new SplObjectStorage(); - $this->person = $person; - } - - public function addSubordinate (CompanyEmployeeTeam $subordinate): void { - $this->subordinates->attach($subordinate); - } - - public function removeSubordinate (CompanyEmployeeTeam $subordinate): void { - $this->subordinates->detach($subordinate); - } - - public function getSubordinates (): SplObjectStorage { - return $this->subordinates; - } - - public function getIterator (): EmployeeTeamIterator { - return new EmployeeTeamIterator($this); - } - - public function count (): int { - return count(new EmployeeTeamIterator($this)); - } - - public function getName (): string { - return $this->person->name; - } - - public function getPosition (): string { - return $this->person->position; - } -} \ No newline at end of file diff --git a/behavioral/Iterator/Employee.php b/behavioral/Iterator/Employee.php deleted file mode 100644 index 758688d..0000000 --- a/behavioral/Iterator/Employee.php +++ /dev/null @@ -1,14 +0,0 @@ -name = $name; - $this->position = $position; - } -} \ No newline at end of file diff --git a/behavioral/Iterator/EmployeeTeamIterator.php b/behavioral/Iterator/EmployeeTeamIterator.php deleted file mode 100644 index 70e0584..0000000 --- a/behavioral/Iterator/EmployeeTeamIterator.php +++ /dev/null @@ -1,47 +0,0 @@ -addTeam($employee); - $this->position = 0; - } - - protected function addTeam (CompanyEmployeeTeam $employee): void { - foreach ($employee->getSubordinates() as $member) { - array_push($this->teamMembers, $member); - $this->addTeam($member); - } - } - - public function current (): CompanyEmployeeTeam { - return $this->teamMembers[$this->position]; - } - - public function next (): void { - ++$this->position; - } - - public function key (): int { - return $this->position; - } - - public function valid (): bool { - return isset($this->teamMembers[$this->position]); - } - - public function rewind (): void { - $this->position = 0; - } - - public function count (): int { - return count($this->teamMembers); - } -} \ No newline at end of file diff --git a/behavioral/Iterator/demo.php b/behavioral/Iterator/demo.php deleted file mode 100644 index f249348..0000000 --- a/behavioral/Iterator/demo.php +++ /dev/null @@ -1,32 +0,0 @@ -addSubordinate($tom); -$john->addSubordinate($johny); -$ceo->addSubordinate($john); - -showTeam($ceo); - -$jan = new CompanyEmployeeTeam(new Employee("Jan", 'Developer')); -$ceo->addSubordinate($jan); - -showTeam($ceo); - -$ceo->removeSubordinate($jan); - -showTeam($ceo); - -function showTeam ($users) { - foreach ($users as $user) { - echo $user->getPosition() . ": " . $user->getName() . PHP_EOL; - } - echo "Number of subordinates of " . $users->getName() . ": " . count($users) . PHP_EOL; -} \ No newline at end of file diff --git a/behavioral/NullObject/Cache.php b/behavioral/NullObject/Cache.php deleted file mode 100644 index 221028b..0000000 --- a/behavioral/NullObject/Cache.php +++ /dev/null @@ -1,12 +0,0 @@ -employees = new SplObjectStorage(); - } - - public function attach (SplObserver $employee): void { - $this->employees->attach($employee); - } - - public function detach (SplObserver $employee): void { - $this->employees->detach($employee); - } - - public function inform (string $message): void { - $this->message = $message; - $this->notify(); - } - - public function notify (): void { - foreach ($this->employees as $employee) { - $employee->update($this); - } - } -} diff --git a/behavioral/Observer/Employee.php b/behavioral/Observer/Employee.php deleted file mode 100644 index c7822ca..0000000 --- a/behavioral/Observer/Employee.php +++ /dev/null @@ -1,24 +0,0 @@ -name = $name; - $this->email = $email; - } - - public function update (SplSubject $communicator): void { - $this->sendEmail($communicator->message); - } - - protected function sendEmail (string $message) { - echo "Sending email to: " . $this->email . " - Hello " . $this->name . ", " . $message . PHP_EOL; - } -} diff --git a/behavioral/Observer/HumanResources.php b/behavioral/Observer/HumanResources.php deleted file mode 100644 index faa7f53..0000000 --- a/behavioral/Observer/HumanResources.php +++ /dev/null @@ -1,28 +0,0 @@ -communicator = new Communicator(); - - foreach ($employees as $employee) { - $this->communicator->attach($employee); - } - } - - public function inform (string $message): void { - $this->communicator->inform($message); - } - - public function layOf (Employee $employee) { - $this->communicator->detach($employee); - } - - public function employ (Employee $employee) { - $this->communicator->attach($employee); - } -} diff --git a/behavioral/Observer/demo.php b/behavioral/Observer/demo.php deleted file mode 100644 index c37f927..0000000 --- a/behavioral/Observer/demo.php +++ /dev/null @@ -1,22 +0,0 @@ -inform("Important news everyone"); - -$software = new Employee("Ben", "software"); -$hr->employ($software); - -$hr->inform("New employee: " . $software->name); - -$hr->layOf($software); -$hr->inform("New employee laid off: " . $software->name); diff --git a/behavioral/Specification/AgeSpecification.php b/behavioral/Specification/AgeSpecification.php deleted file mode 100644 index edcf9db..0000000 --- a/behavioral/Specification/AgeSpecification.php +++ /dev/null @@ -1,19 +0,0 @@ -maxAge = $maxAge; - } - - public function isSatisfiedBy(Candidate $candidate) : bool - { - return $candidate->getAge() <= $this->maxAge; - } - -} \ No newline at end of file diff --git a/behavioral/Specification/Candidate.php b/behavioral/Specification/Candidate.php deleted file mode 100644 index 4a64797..0000000 --- a/behavioral/Specification/Candidate.php +++ /dev/null @@ -1,40 +0,0 @@ -age = $age; - $this->workExperience = $workExperience; - $this->education = $education; - $this->isConvicted = $isConvicted; - } - - public function getAge(): int - { - return $this->age; - } - - public function getWorkExperience(): array - { - return $this->workExperience; - } - - public function getEducation() - { - return $this->education; - } - - public function isConvicted(): bool - { - return $this->isConvicted; - } - -} \ No newline at end of file diff --git a/behavioral/Specification/Education.php b/behavioral/Specification/Education.php deleted file mode 100644 index f5bcd9e..0000000 --- a/behavioral/Specification/Education.php +++ /dev/null @@ -1,24 +0,0 @@ -university = $university; - $this->start = $start; - $this->end = $end; - } - - public function getEndDate() : DateTime { - return $this->end; - } - -} \ No newline at end of file diff --git a/behavioral/Specification/NotSpecification.php b/behavioral/Specification/NotSpecification.php deleted file mode 100644 index 677a55f..0000000 --- a/behavioral/Specification/NotSpecification.php +++ /dev/null @@ -1,18 +0,0 @@ -specification = $specification; - } - - public function isSatisfiedBy(Candidate $candidate): bool - { - return !$this->specification->isSatisfiedBy($candidate); - } -} \ No newline at end of file diff --git a/behavioral/Specification/Specification.php b/behavioral/Specification/Specification.php deleted file mode 100644 index b1a4044..0000000 --- a/behavioral/Specification/Specification.php +++ /dev/null @@ -1,8 +0,0 @@ -companyName = $companyName; - $this->start = $start; - $this->end = $end; - } - - public function getWorkedMonths() : int { - $workedInterval = $this->start->diff($this->end); - var_dump("months", $workedInterval->m); - return ($workedInterval->y * 12) + $workedInterval->m; - } - -} \ No newline at end of file diff --git a/behavioral/Specification/WorkExperienceSpecification.php b/behavioral/Specification/WorkExperienceSpecification.php deleted file mode 100644 index a35a6bb..0000000 --- a/behavioral/Specification/WorkExperienceSpecification.php +++ /dev/null @@ -1,24 +0,0 @@ -minYearsOfExperience = $minYearsOfExperience; - } - - public function isSatisfiedBy(Candidate $candidate) : bool - { - $totalMonthsOfExperience = 0; - - foreach ($candidate->getWorkExperience() as $experience) { - $totalMonthsOfExperience += $experience->getWorkedMonths(); - } - - return $totalMonthsOfExperience / 12 >= $this->minYearsOfExperience; - } -} \ No newline at end of file diff --git a/behavioral/State/Angry.php b/behavioral/State/Angry.php deleted file mode 100644 index 142be90..0000000 --- a/behavioral/State/Angry.php +++ /dev/null @@ -1,20 +0,0 @@ -say("You too..."); - } - - public function hug (Person $context) { - $context->say("Hm..."); - $context->setState(new Neutral()); - } - - public function getName (Person $context, string $name) { - $context->say("{$name}. What's your problem?"); - } - -} \ No newline at end of file diff --git a/behavioral/State/Happy.php b/behavioral/State/Happy.php deleted file mode 100644 index 2294fb1..0000000 --- a/behavioral/State/Happy.php +++ /dev/null @@ -1,19 +0,0 @@ -say("Oh! That wasn't nice"); - $context->setState(new Neutral()); - } - - public function hug (Person $context) { - $context->say("Oh! That was nice, thanks"); - } - - public function getName (Person $context, string $name) { - $context->say("Oh! Hello dear friend. My name is {$name}"); - } -} \ No newline at end of file diff --git a/behavioral/State/Mood.php b/behavioral/State/Mood.php deleted file mode 100644 index 3520bc7..0000000 --- a/behavioral/State/Mood.php +++ /dev/null @@ -1,12 +0,0 @@ -setState($mood); - $this->name = $name; - } - - public function setState (Mood $mood) { - $this->currentMood = $mood; - } - - public function insult () { - $this->currentMood->insult($this); - } - - public function getName () { - $this->currentMood->getName($this, $this->name); - } - - public function hug () { - $this->currentMood->hug($this); - } - - public function say (string $msg) { - echo($msg . PHP_EOL); - } -} \ No newline at end of file diff --git a/behavioral/Strategy/Context.php b/behavioral/Strategy/Context.php deleted file mode 100644 index 439bcf3..0000000 --- a/behavioral/Strategy/Context.php +++ /dev/null @@ -1,28 +0,0 @@ -formatter = new JSONFormatter(); - break; - case "xml": - $this->formatter = new XMLFormatter(); - break; - case "string": - $this->formatter = new StringFormatter(); - break; - default: - throw new \InvalidArgumentException("{$outputType} is not supported"); - } - } - - public function formatData (array $data): string { - return $this->formatter->format($data); - } -} \ No newline at end of file diff --git a/behavioral/Strategy/JSONFormatter.php b/behavioral/Strategy/JSONFormatter.php deleted file mode 100644 index c7fe85d..0000000 --- a/behavioral/Strategy/JSONFormatter.php +++ /dev/null @@ -1,10 +0,0 @@ -budget = 100000; - } - - protected function castActors () { - foreach (array_rand(self::AVAILABLE_ACTORS, self::NUM_ROLES) as $actor) { - $this->cast[] = self::AVAILABLE_ACTORS[$actor]; - } - } - - protected function castDirector () { - $this->director = self::AVAILABLE_DIRECTORS[array_rand(self::AVAILABLE_DIRECTORS)]; - } -} \ No newline at end of file diff --git a/behavioral/TemplateMethod/ComedyMovie.php b/behavioral/TemplateMethod/ComedyMovie.php deleted file mode 100644 index 96a6414..0000000 --- a/behavioral/TemplateMethod/ComedyMovie.php +++ /dev/null @@ -1,22 +0,0 @@ -budget = 500000; - } - - protected function castActors () { - $this->cast[] = 'Adam Sandler'; - $this->cast[] = self::AVAILABLE_ACTORS[array_rand(self::AVAILABLE_ACTORS)]; - } - - protected function castDirector () { - $this->director = self::AVAILABLE_DIRECTORS[array_rand(self::AVAILABLE_DIRECTORS)]; - } -} \ No newline at end of file diff --git a/behavioral/TemplateMethod/Movie.php b/behavioral/TemplateMethod/Movie.php deleted file mode 100644 index 9238c4e..0000000 --- a/behavioral/TemplateMethod/Movie.php +++ /dev/null @@ -1,33 +0,0 @@ -name = $name; - } - - public final function publish () { - $this->raiseMoney(); - $this->castActors(); - $this->castDirector(); - $this->promote(); - } - - abstract protected function raiseMoney (); - - abstract protected function castActors (); - - abstract protected function castDirector (); - - protected function promote () { - $actors = implode(", ", $this->cast); - echo "New movie '{$this->name}' directed by {$this->director}. Starring {$actors} and budget of \${$this->budget}!" . PHP_EOL; - } -} \ No newline at end of file diff --git a/behavioral/Visitor/SickLeave.php b/behavioral/Visitor/SickLeave.php deleted file mode 100644 index 9650a4d..0000000 --- a/behavioral/Visitor/SickLeave.php +++ /dev/null @@ -1,25 +0,0 @@ -start = $start; - $this->end = $end; - } - - public function getStart(): \DateTime - { - return $this->start; - } - - public function getEnd(): \DateTime - { - return $this->end; - } -} \ No newline at end of file diff --git a/behavioral/Visitor/University.php b/behavioral/Visitor/University.php deleted file mode 100644 index bd89718..0000000 --- a/behavioral/Visitor/University.php +++ /dev/null @@ -1,30 +0,0 @@ -name = $name; - $this->students = $students; - } - - public function getName(): string - { - return $this->name; - } - - public function getStudents(): array - { - return $this->students; - } - - public function accept(Visitor $visitor): array - { - return $visitor->visitUniversity($this); - } -} \ No newline at end of file diff --git a/behavioral/Visitor/Visitable.php b/behavioral/Visitor/Visitable.php deleted file mode 100644 index 4a0e6ac..0000000 --- a/behavioral/Visitor/Visitable.php +++ /dev/null @@ -1,8 +0,0 @@ -=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality." + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "https://github.com/awslabs/aws-crt-php", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "support": { + "issues": "https://github.com/awslabs/aws-crt-php/issues", + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.1" + }, + "time": "2023-03-24T20:22:19+00:00" + }, + { + "name": "aws/aws-sdk-php", + "version": "3.275.5", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-php.git", + "reference": "d46961b82e857f77059c0c78160719ecb26f6cc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d46961b82e857f77059c0c78160719ecb26f6cc6", + "reference": "d46961b82e857f77059c0c78160719ecb26f6cc6", + "shasum": "" + }, + "require": { + "aws/aws-crt-php": "^1.0.4", + "ext-json": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "guzzlehttp/promises": "^1.4.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "mtdowling/jmespath.php": "^2.6", + "php": ">=5.5", + "psr/http-message": "^1.0" + }, + "require-dev": { + "andrewsville/php-token-reflection": "^1.4", + "aws/aws-php-sns-message-validator": "~1.0", + "behat/behat": "~3.0", + "composer/composer": "^1.10.22", + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "doctrine/cache": "~1.4", + "ext-dom": "*", + "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", + "nette/neon": "^2.3", + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^4.8.35 || ^5.6.3 || ^9.5", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "sebastian/comparator": "^1.2.3 || ^4.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", + "doctrine/cache": "To use the DoctrineCacheAdapter", + "ext-curl": "To send requests using cURL", + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Aws\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Amazon Web Services", + "homepage": "http://aws.amazon.com" + } + ], + "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "cloud", + "dynamodb", + "ec2", + "glacier", + "s3", + "sdk" + ], + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sdk-php/issues", + "source": "https://github.com/aws/aws-sdk-php/tree/3.275.5" + }, + "time": "2023-07-07T18:20:11+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", + "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.7.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2023-05-21T14:04:53+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2023-05-21T12:31:43+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", + "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.5.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2023-04-17T16:11:26+00:00" + }, + { + "name": "mtdowling/jmespath.php", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^7.5.15" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "files": [ + "src/JmesPath.php" + ], + "psr-4": { + "JmesPath\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1" + }, + "time": "2021-06-14T00:11:39+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.16.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + }, + "time": "2023-06-25T14:52:30+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "10.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/db1497ec8dd382e82c962f7abbe0320e4882ee4e", + "reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.15", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-22T09:04:27+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "5647d65443818959172645e7ed999217360654b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/5647d65443818959172645e7ed999217360654b6", + "reference": "5647d65443818959172645e7ed999217360654b6", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-07T09:13:23+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:46+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "35c8cac1734ede2ae354a6644f7088356ff5b08e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35c8cac1734ede2ae354a6644f7088356ff5b08e", + "reference": "35c8cac1734ede2ae354a6644f7088356ff5b08e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.2-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.3" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2023-06-30T06:17:38+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/1.0.2" + }, + "time": "2023-04-10T20:12:12+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, + "time": "2023-04-10T20:10:41+00:00" + }, + { + "name": "psr/http-message", + "version": "1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/1.1" + }, + "time": "2023-04-04T09:50:52+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:15+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:07:16+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.10", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:47+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-01T07:48:21+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-04-11T05:39:26+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:49+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "aab257c712de87b90194febd52e4d184551c2d44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", + "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:07:38+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.10", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:02+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:05:40+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:10:45+00:00" + }, + { + "name": "sebastian/version", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-07T11:34:05+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/dotenv", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/dotenv.git", + "reference": "ceadb434fe2a6763a03d2d110441745834f3dd1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/ceadb434fe2a6763a03d2d110441745834f3dd1e", + "reference": "ceadb434fe2a6763a03d2d110441745834f3dd1e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "conflict": { + "symfony/console": "<5.4", + "symfony/process": "<5.4" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Dotenv\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Registers environment variables from a .env file", + "homepage": "https://symfony.com", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "source": "https://github.com/symfony/dotenv/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-21T14:41:17+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + } + ], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-11-17T09:50:14+00:00" + }, + { + "name": "composer/semver", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-04-01T19:23:25+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "doctrine/annotations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2 || ^3", + "ext-tokenizer": "*", + "php": "^7.2 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^2.0", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/2.0.1" + }, + "time": "2023-02-02T22:02:53+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "84a527db05647743d50373e0ec53a152f2cde568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", + "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^9.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-12-15T16:57:16+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.21.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "229b55b3eae4729a8e2a321441ba40fcb3720b86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/229b55b3eae4729a8e2a321441ba40fcb3720b86", + "reference": "229b55b3eae4729a8e2a321441ba40fcb3720b86", + "shasum": "" + }, + "require": { + "composer/semver": "^3.3", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^2", + "doctrine/lexer": "^2 || ^3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^8.0.1", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.0", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.5.3", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.16", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", + "symfony/phpunit-bridge": "^6.2.3", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.21.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-07-05T21:50:25+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "symfony/console", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-29T12:49:39+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-21T14:41:17+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.3.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-06-01T08:30:39+00:00" + }, + { + "name": "symfony/finder", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-02T01:25:41+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-12T14:21:09+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/process", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-19T08:06:44+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-16T10:14:28+00:00" + }, + { + "name": "symfony/string", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-03-21T21:06:29+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^8.2" + }, + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/creational/AbstractFactory/DeviceFactory.php b/creational/AbstractFactory/DeviceFactory.php deleted file mode 100644 index 6d3e6d2..0000000 --- a/creational/AbstractFactory/DeviceFactory.php +++ /dev/null @@ -1,11 +0,0 @@ -createDevice(); - $builder->setHardware(); - $builder->setSoftware(); - $builder->setupSLA(); - - return $builder->getDevice(); - } -} \ No newline at end of file diff --git a/creational/Builder/InteractiveMirror.php b/creational/Builder/InteractiveMirror.php deleted file mode 100644 index 2caddb6..0000000 --- a/creational/Builder/InteractiveMirror.php +++ /dev/null @@ -1,13 +0,0 @@ -device->hardware[] = $component; - } - } - - public function setSoftware () { - $this->device->software = 'Mirror software'; - } - - public function setupSLA () { - $this->device->sla = 'Mirror SLA V2'; - } - - public function createDevice () { - $this->device = new InteractiveMirror(); - } - - public function getDevice () { - return $this->device; - } -} \ No newline at end of file diff --git a/creational/FactoryMethod/AudioBox.php b/creational/FactoryMethod/AudioBox.php deleted file mode 100644 index eb4cfb3..0000000 --- a/creational/FactoryMethod/AudioBox.php +++ /dev/null @@ -1,11 +0,0 @@ -file->getFilePath()}' />"; - } -} diff --git a/creational/FactoryMethod/Box.php b/creational/FactoryMethod/Box.php deleted file mode 100644 index abfbb0b..0000000 --- a/creational/FactoryMethod/Box.php +++ /dev/null @@ -1,15 +0,0 @@ -file = $file; - } - - abstract function getHtml (): string; -} \ No newline at end of file diff --git a/creational/FactoryMethod/BoxFactory.php b/creational/FactoryMethod/BoxFactory.php deleted file mode 100644 index 70b743b..0000000 --- a/creational/FactoryMethod/BoxFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -getType()) { - case FileItem::TYPE_IMG: - return new ImgBox($item); - break; - case FileItem::TYPE_VIDEO: - return new VideoBox($item); - break; - case FileItem::TYPE_AUDIO: - return new AudioBox($item); - break; - default: - throw new InvalidArgumentException("Wrong file type provided: {$item->getType()}"); - break; - } - } -} \ No newline at end of file diff --git a/creational/FactoryMethod/Factory.php b/creational/FactoryMethod/Factory.php deleted file mode 100644 index 22554e6..0000000 --- a/creational/FactoryMethod/Factory.php +++ /dev/null @@ -1,8 +0,0 @@ -type = $type; - $this->filePath = $filePath; - } - - public function getType (): string { - return $this->type; - } - - public function getFilePath (): string { - return $this->filePath; - } -} \ No newline at end of file diff --git a/creational/FactoryMethod/ImgBox.php b/creational/FactoryMethod/ImgBox.php deleted file mode 100644 index a844c62..0000000 --- a/creational/FactoryMethod/ImgBox.php +++ /dev/null @@ -1,11 +0,0 @@ -file->getFilePath()}' />"; - } -} diff --git a/creational/FactoryMethod/VideoBox.php b/creational/FactoryMethod/VideoBox.php deleted file mode 100644 index a81c0b5..0000000 --- a/creational/FactoryMethod/VideoBox.php +++ /dev/null @@ -1,11 +0,0 @@ -file->getFilePath()}' />"; - } -} diff --git a/creational/FactoryMethod/demo.php b/creational/FactoryMethod/demo.php deleted file mode 100644 index b1dba4e..0000000 --- a/creational/FactoryMethod/demo.php +++ /dev/null @@ -1,13 +0,0 @@ -getHtml()); -var_dump(BoxFactory::createBox($video)->getHtml()); -var_dump(BoxFactory::createBox($audio)->getHtml()); diff --git a/creational/Prototype/Computer.php b/creational/Prototype/Computer.php deleted file mode 100644 index 6364911..0000000 --- a/creational/Prototype/Computer.php +++ /dev/null @@ -1,22 +0,0 @@ -group = $group; - } - - public function setUid (string $uid): void { - $this->uid = $uid; - } - - public function save (): void { - echo "Saving device with UID {$this->uid} to group {$this->group->getName()}" . PHP_EOL; - } -} \ No newline at end of file diff --git a/creational/Prototype/Device.php b/creational/Prototype/Device.php deleted file mode 100644 index f497e54..0000000 --- a/creational/Prototype/Device.php +++ /dev/null @@ -1,13 +0,0 @@ -name = $name; - $this->location = $location; - } - - public function getName (): string { - return $this->name; - } - - public function getLocation (): string { - $this->location; - } -} \ No newline at end of file diff --git a/creational/Prototype/demo.php b/creational/Prototype/demo.php deleted file mode 100644 index ef359f5..0000000 --- a/creational/Prototype/demo.php +++ /dev/null @@ -1,25 +0,0 @@ -setUid($uid); - $device->save(); -} \ No newline at end of file diff --git a/creational/Singleton/singleton.php b/creational/Singleton/singleton.php deleted file mode 100644 index 92594b1..0000000 --- a/creational/Singleton/singleton.php +++ /dev/null @@ -1,37 +0,0 @@ -email = "active@user.com"; - } - - private function __clone () { - } - - public function setName (string $email): void { - $this->email = $email; - } - - public function changeEmail (): string { - return $this->email; - } - - - private static function get (): ActiveUser { - return new ActiveUser(); - } - - public static function getInstance (): ActiveUser { - if (!self::$instance) { - self::$instance = self::get(); - } - return self::$instance; - } -} diff --git a/src/Behavioral/ChainOfResponsibility/ApiMiddleware.php b/src/Behavioral/ChainOfResponsibility/ApiMiddleware.php new file mode 100644 index 0000000..ec60d2e --- /dev/null +++ b/src/Behavioral/ChainOfResponsibility/ApiMiddleware.php @@ -0,0 +1,23 @@ +hasParam(self::API_KEY_NAME) + && in_array($request->getParam(self::API_KEY_NAME), self::API_KEYS)) { + + return parent::process($request); + } else { + throw new MiddlewareError("Api key validation error"); + } + } +} diff --git a/behavioral/ChainOfResponsibility/App.php b/src/Behavioral/ChainOfResponsibility/App.php similarity index 55% rename from behavioral/ChainOfResponsibility/App.php rename to src/Behavioral/ChainOfResponsibility/App.php index 9069ab9..b36f854 100644 --- a/behavioral/ChainOfResponsibility/App.php +++ b/src/Behavioral/ChainOfResponsibility/App.php @@ -1,25 +1,30 @@ request = new Request($_GET, $_SERVER); $this->setMiddleware(); } - private function setMiddleware () { + private function setMiddleware(): void + { $this->middleware = new GetMiddleware(); $this->middleware->setNext(new ApiMiddleware()); } - public function run () { + public function run(): string + { if ($this->middleware->process($this->request)) { return (new Response($this->request))->handle(); } + + return ""; } -} \ No newline at end of file +} diff --git a/behavioral/ChainOfResponsibility/GetMiddleware.php b/src/Behavioral/ChainOfResponsibility/GetMiddleware.php similarity index 55% rename from behavioral/ChainOfResponsibility/GetMiddleware.php rename to src/Behavioral/ChainOfResponsibility/GetMiddleware.php index bc2efdd..80c74f5 100644 --- a/behavioral/ChainOfResponsibility/GetMiddleware.php +++ b/src/Behavioral/ChainOfResponsibility/GetMiddleware.php @@ -1,13 +1,14 @@ hasServerParam($this->methodKey) && $request->getServerParam($this->methodKey) === $this->allowedMethod) { @@ -16,4 +17,4 @@ public function process (Request $request) { throw new MiddlewareError("Only GET requests allowed"); } } -} \ No newline at end of file +} diff --git a/src/Behavioral/ChainOfResponsibility/Middleware.php b/src/Behavioral/ChainOfResponsibility/Middleware.php new file mode 100644 index 0000000..f65b372 --- /dev/null +++ b/src/Behavioral/ChainOfResponsibility/Middleware.php @@ -0,0 +1,23 @@ +next = $middleware; + + return $middleware; + } + + public function process(Request $request): bool + { + if (isset($this->next)) { + return $this->next->process($request); + } + return true; + } +} diff --git a/src/Behavioral/ChainOfResponsibility/MiddlewareError.php b/src/Behavioral/ChainOfResponsibility/MiddlewareError.php new file mode 100644 index 0000000..59a8fc4 --- /dev/null +++ b/src/Behavioral/ChainOfResponsibility/MiddlewareError.php @@ -0,0 +1,7 @@ +params[$name]; + } + + public function getParams(): array + { + return $this->params; + } + + public function hasParam(string $name): bool + { + return array_key_exists($name, $this->params); + } + + public function getServerParam(string $name) + { + return $this->server[$name]; + } + + public function hasServerParam(string $name): bool + { + return array_key_exists($name, $this->server); + } +} diff --git a/src/Behavioral/ChainOfResponsibility/Response.php b/src/Behavioral/ChainOfResponsibility/Response.php new file mode 100644 index 0000000..5a2c46e --- /dev/null +++ b/src/Behavioral/ChainOfResponsibility/Response.php @@ -0,0 +1,25 @@ + self::CODE_OK, + "message" => "Request proceeded correctly", + "params" => $this->request->getParams() + ]); + } +} diff --git a/src/Behavioral/ChainOfResponsibility/index.php b/src/Behavioral/ChainOfResponsibility/index.php new file mode 100644 index 0000000..0ac0c29 --- /dev/null +++ b/src/Behavioral/ChainOfResponsibility/index.php @@ -0,0 +1,8 @@ +run(); diff --git a/behavioral/ChainOfResponsibility/server.sh b/src/Behavioral/ChainOfResponsibility/server.sh similarity index 100% rename from behavioral/ChainOfResponsibility/server.sh rename to src/Behavioral/ChainOfResponsibility/server.sh diff --git a/behavioral/Command/Client.php b/src/Behavioral/Command/Client.php similarity index 56% rename from behavioral/Command/Client.php rename to src/Behavioral/Command/Client.php index ff1de46..65ae5ca 100644 --- a/behavioral/Command/Client.php +++ b/src/Behavioral/Command/Client.php @@ -1,14 +1,11 @@ listingRepository = $repository; } public function createListing(string $title, string $content, string $author): void @@ -17,10 +14,9 @@ public function createListing(string $title, string $content, string $author): v $command->handle(); } - public function deleteListing(string $listingUid) : void + public function deleteListing(string $listingUuid): void { - $command = new DeleteListing($this->listingRepository, $listingUid); + $command = new DeleteListing($this->listingRepository, $listingUuid); $command->handle(); } - -} \ No newline at end of file +} diff --git a/src/Behavioral/Command/Command.php b/src/Behavioral/Command/Command.php new file mode 100644 index 0000000..28f2d37 --- /dev/null +++ b/src/Behavioral/Command/Command.php @@ -0,0 +1,8 @@ +title) < self::MIN_TITLE_LENGTH) { + throw new LengthException(sprintf( + "Title is too short. Must be at least %d characters", + self::MIN_TITLE_LENGTH + )); + } + if (mb_strlen($this->content) < self::MIN_CONTENT_LENGTH) { + throw new LengthException(sprintf( + "Content is too short. Must be at least %d characters", + self::MIN_CONTENT_LENGTH + )); + } + if (mb_strlen($this->author) < self::MIN_AUTHOR_LENGTH) { + throw new LengthException(sprintf( + "Author name is too short. Must be at least %d characters", + self::MIN_AUTHOR_LENGTH + )); + } + } + + public function handle(): void + { + $this->validate(); + $this->repository->create($this->title, $this->content, $this->author); + } +} diff --git a/src/Behavioral/Command/DeleteListing.php b/src/Behavioral/Command/DeleteListing.php new file mode 100644 index 0000000..e24e6c3 --- /dev/null +++ b/src/Behavioral/Command/DeleteListing.php @@ -0,0 +1,15 @@ +repository->delete($this->listingUid); + } +} diff --git a/behavioral/Command/ListingRepository.php b/src/Behavioral/Command/ListingRepository.php similarity index 69% rename from behavioral/Command/ListingRepository.php rename to src/Behavioral/Command/ListingRepository.php index 05be259..63b5570 100644 --- a/behavioral/Command/ListingRepository.php +++ b/src/Behavioral/Command/ListingRepository.php @@ -1,6 +1,6 @@ createListing( @@ -10,4 +10,4 @@ "This is a content of a listing", "Company" ); -$client->deleteListing("Unique id"); \ No newline at end of file +$client->deleteListing("Unique id"); diff --git a/src/Behavioral/Iterator/Employee.php b/src/Behavioral/Iterator/Employee.php new file mode 100644 index 0000000..a60c126 --- /dev/null +++ b/src/Behavioral/Iterator/Employee.php @@ -0,0 +1,22 @@ +name; + } + + public function getPosition(): string + { + return $this->position; + } +} diff --git a/src/Behavioral/Iterator/Team.php b/src/Behavioral/Iterator/Team.php new file mode 100644 index 0000000..be85288 --- /dev/null +++ b/src/Behavioral/Iterator/Team.php @@ -0,0 +1,64 @@ +teams = new SplObjectStorage(); + } + + public function addTeam(Team $subordinate): void + { + $this->teams->attach($subordinate); + } + + public function detachTeam(Team $subordinate): void + { + $this->teams->detach($subordinate); + } + + public function getTeams(): SplObjectStorage + { + return $this->teams; + } + + public function getIterator(): TeamIterator + { + return new TeamIterator($this); + } + + public function count(): int + { + return count(new TeamIterator($this)); + } + + public function getName(): string + { + return $this->name; + } + + public function getLeader(): Employee + { + return $this->leader; + } + + public function printSummary(): void + { + echo $this->leader->getPosition() . ": " . $this->leader->getName() . " manages " . count($this) . " teams" . PHP_EOL; + + foreach ($this as $team) { + echo $team->getName() . " led by: " . $team->getLeader()->getName() . PHP_EOL; + } + echo PHP_EOL; + } +} diff --git a/src/Behavioral/Iterator/TeamIterator.php b/src/Behavioral/Iterator/TeamIterator.php new file mode 100644 index 0000000..1a10f8f --- /dev/null +++ b/src/Behavioral/Iterator/TeamIterator.php @@ -0,0 +1,56 @@ +addTeam($employee); + $this->position = 0; + } + + protected function addTeam(Team $employee): void + { + foreach ($employee->getTeams() as $member) { + $this->teams[] = $member; + $this->addTeam($member); + } + } + + public function current(): Team + { + return $this->teams[$this->position]; + } + + public function next(): void + { + ++$this->position; + } + + public function key(): int + { + return $this->position; + } + + public function valid(): bool + { + return isset($this->teams[$this->position]); + } + + public function rewind(): void + { + $this->position = 0; + } + + public function count(): int + { + return count($this->teams); + } +} diff --git a/src/Behavioral/Iterator/demo.php b/src/Behavioral/Iterator/demo.php new file mode 100644 index 0000000..d245cc6 --- /dev/null +++ b/src/Behavioral/Iterator/demo.php @@ -0,0 +1,24 @@ +addTeam($teamA); +$tech->addTeam($teamB); +$ceo->addTeam($tech); + +$ceo->printSummary(); + +$teamC = new Team("Team C", new Employee("Jan", 'Team Leader')); +$tech->addTeam($teamC); + +$ceo->printSummary(); + +$ceo->detachTeam($teamC); +$tech->printSummary(); diff --git a/behavioral/NullObject/ArrayCache.php b/src/Behavioral/NullObject/ArrayCache.php similarity index 64% rename from behavioral/NullObject/ArrayCache.php rename to src/Behavioral/NullObject/ArrayCache.php index 1f44947..efe39b6 100644 --- a/behavioral/NullObject/ArrayCache.php +++ b/src/Behavioral/NullObject/ArrayCache.php @@ -1,12 +1,12 @@ has($key)) { return $this->data[$key]; @@ -14,7 +14,7 @@ public function get(string $key) return false; } - public function set(string $key, $data): void + public function set(string $key, string $data): void { $this->data[$key] = $data; } @@ -23,4 +23,4 @@ public function has(string $key): bool { return array_key_exists($key, $this->data); } -} \ No newline at end of file +} diff --git a/src/Behavioral/NullObject/Cache.php b/src/Behavioral/NullObject/Cache.php new file mode 100644 index 0000000..63a29d2 --- /dev/null +++ b/src/Behavioral/NullObject/Cache.php @@ -0,0 +1,12 @@ +employees = new SplObjectStorage(); + } + + public function attach(SplObserver $employee): void + { + $this->employees->attach($employee); + } + + public function detach(SplObserver $employee): void + { + $this->employees->detach($employee); + } + + public function inform(string $message): void + { + $this->notify($message); + } + + public function notify(string $message = ""): void + { + foreach ($this->employees as $employee) { + /** + * @var $employee Employee + */ + $employee->update($this, $message); + } + } +} diff --git a/src/Behavioral/Observer/Employee.php b/src/Behavioral/Observer/Employee.php new file mode 100644 index 0000000..791f12b --- /dev/null +++ b/src/Behavioral/Observer/Employee.php @@ -0,0 +1,28 @@ +sendEmail($message); + } + + protected function sendEmail(string $message): void + { + echo "Sending email to: " . $this->email . " - Hello " . $this->name . ", " . $message . PHP_EOL; + } + + public function getName(): string + { + return $this->name; + } +} diff --git a/src/Behavioral/Observer/HumanResources.php b/src/Behavioral/Observer/HumanResources.php new file mode 100644 index 0000000..ae17afb --- /dev/null +++ b/src/Behavioral/Observer/HumanResources.php @@ -0,0 +1,32 @@ +communicator = new Communicator(); + + foreach ($employees as $employee) { + $this->communicator->attach($employee); + } + } + + public function inform(string $message): void + { + $this->communicator->inform($message); + } + + public function layOf(Employee $employee): void + { + $this->communicator->detach($employee); + } + + public function employ(Employee $employee): void + { + $this->communicator->attach($employee); + } +} diff --git a/src/Behavioral/Observer/demo.php b/src/Behavioral/Observer/demo.php new file mode 100644 index 0000000..8e6ffe3 --- /dev/null +++ b/src/Behavioral/Observer/demo.php @@ -0,0 +1,21 @@ +inform("Some important news"); + +$software = new Employee("Ben", "ben@gmail.com"); +$hr->inform("New employee: " . $software->getName()); +$hr->employ($software); + +$hr->layOf($software); +$hr->inform("Employee was laid off: " . $software->getName()); diff --git a/behavioral/Specification/AndSpecification.php b/src/Behavioral/Specification/AndSpecification.php similarity index 80% rename from behavioral/Specification/AndSpecification.php rename to src/Behavioral/Specification/AndSpecification.php index c6d9de4..95742b1 100644 --- a/behavioral/Specification/AndSpecification.php +++ b/src/Behavioral/Specification/AndSpecification.php @@ -1,9 +1,9 @@ age; + } + + public function getWorkExperience(): array + { + return $this->workExperience; + } + + public function getEducation(): array + { + return $this->education; + } + + public function isConvicted(): bool + { + return $this->isConvicted; + } + +} diff --git a/behavioral/Specification/ConvictedSpecification.php b/src/Behavioral/Specification/ConvictedSpecification.php similarity index 55% rename from behavioral/Specification/ConvictedSpecification.php rename to src/Behavioral/Specification/ConvictedSpecification.php index 9e76094..8e96962 100644 --- a/behavioral/Specification/ConvictedSpecification.php +++ b/src/Behavioral/Specification/ConvictedSpecification.php @@ -1,12 +1,11 @@ isConvicted(); } -} \ No newline at end of file +} diff --git a/src/Behavioral/Specification/Education.php b/src/Behavioral/Specification/Education.php new file mode 100644 index 0000000..49d8773 --- /dev/null +++ b/src/Behavioral/Specification/Education.php @@ -0,0 +1,18 @@ +end; + } + +} diff --git a/src/Behavioral/Specification/MaxAgeSpecification.php b/src/Behavioral/Specification/MaxAgeSpecification.php new file mode 100644 index 0000000..95356e4 --- /dev/null +++ b/src/Behavioral/Specification/MaxAgeSpecification.php @@ -0,0 +1,16 @@ +getAge() <= $this->maxAge; + } + +} diff --git a/src/Behavioral/Specification/NotSpecification.php b/src/Behavioral/Specification/NotSpecification.php new file mode 100644 index 0000000..3bfa16f --- /dev/null +++ b/src/Behavioral/Specification/NotSpecification.php @@ -0,0 +1,15 @@ +specification->isSatisfiedBy($candidate); + } +} diff --git a/behavioral/Specification/OrSpecification.php b/src/Behavioral/Specification/OrSpecification.php similarity index 82% rename from behavioral/Specification/OrSpecification.php rename to src/Behavioral/Specification/OrSpecification.php index e9b9a11..30f827c 100644 --- a/behavioral/Specification/OrSpecification.php +++ b/src/Behavioral/Specification/OrSpecification.php @@ -1,9 +1,9 @@ getEducation() as $education) { if ($education->getEndDate() > new DateTime()) { @@ -16,4 +16,4 @@ public function isSatisfiedBy(Candidate $candidate) : bool return false; } -} \ No newline at end of file +} diff --git a/src/Behavioral/Specification/WorkExperience.php b/src/Behavioral/Specification/WorkExperience.php new file mode 100644 index 0000000..ba58822 --- /dev/null +++ b/src/Behavioral/Specification/WorkExperience.php @@ -0,0 +1,19 @@ +start->diff($this->end); + return ($workedInterval->y * 12) + $workedInterval->m; + } + +} diff --git a/src/Behavioral/Specification/WorkExperienceSpecification.php b/src/Behavioral/Specification/WorkExperienceSpecification.php new file mode 100644 index 0000000..3ddabc3 --- /dev/null +++ b/src/Behavioral/Specification/WorkExperienceSpecification.php @@ -0,0 +1,21 @@ +getWorkExperience() as $experience) { + $totalMonthsOfExperience += $experience->getWorkedMonths(); + } + + return $totalMonthsOfExperience / 12 >= $this->minYearsOfExperience; + } +} diff --git a/behavioral/Specification/demo.php b/src/Behavioral/Specification/demo.php similarity index 77% rename from behavioral/Specification/demo.php rename to src/Behavioral/Specification/demo.php index 67d0df7..7846621 100644 --- a/behavioral/Specification/demo.php +++ b/src/Behavioral/Specification/demo.php @@ -1,10 +1,10 @@ say("You too..."); + } + + public function hug(Person $context): void + { + $context->say("Hm..."); + $context->setState(new Neutral()); + } + + public function getName(Person $context, string $name): void + { + $context->say("{$name}. What's your problem?"); + } + +} diff --git a/src/Behavioral/State/Happy.php b/src/Behavioral/State/Happy.php new file mode 100644 index 0000000..2f9d234 --- /dev/null +++ b/src/Behavioral/State/Happy.php @@ -0,0 +1,22 @@ +say("Oh! That wasn't nice"); + $context->setState(new Neutral()); + } + + public function hug(Person $context): void + { + $context->say("Oh! That was nice, thanks"); + } + + public function getName(Person $context, string $name): void + { + $context->say("Oh! Hello dear friend. My name is {$name}"); + } +} diff --git a/src/Behavioral/State/Mood.php b/src/Behavioral/State/Mood.php new file mode 100644 index 0000000..da7a68e --- /dev/null +++ b/src/Behavioral/State/Mood.php @@ -0,0 +1,12 @@ +say("What the heck do you want?"); $context->setState(new Angry()); } - public function hug (Person $context) { + public function hug(Person $context): void + { $context->say("Thanks"); $context->setState(new Happy()); } - public function getName (Person $context, string $name) { + public function getName(Person $context, string $name): void + { $context->say("My name is {$name}"); } -} \ No newline at end of file +} diff --git a/src/Behavioral/State/Person.php b/src/Behavioral/State/Person.php new file mode 100644 index 0000000..430cffa --- /dev/null +++ b/src/Behavioral/State/Person.php @@ -0,0 +1,40 @@ +setState($mood); + $this->name = $name; + } + + public function setState(Mood $mood): void + { + $this->currentMood = $mood; + } + + public function insult(): void + { + $this->currentMood->insult($this); + } + + public function getName(): void + { + $this->currentMood->getName($this, $this->name); + } + + public function hug(): void + { + $this->currentMood->hug($this); + } + + public function say(string $msg): void + { + echo($msg . PHP_EOL); + } +} diff --git a/behavioral/State/demo.php b/src/Behavioral/State/demo.php similarity index 65% rename from behavioral/State/demo.php rename to src/Behavioral/State/demo.php index fb42d7d..35c8e94 100644 --- a/behavioral/State/demo.php +++ b/src/Behavioral/State/demo.php @@ -1,8 +1,8 @@ getName(); diff --git a/src/Behavioral/Strategy/Context.php b/src/Behavioral/Strategy/Context.php new file mode 100644 index 0000000..25aafba --- /dev/null +++ b/src/Behavioral/Strategy/Context.php @@ -0,0 +1,23 @@ +formatter = match ($outputType) { + "json" => new JSONFormatter(), + "xml" => new XMLFormatter(), + "string" => new StringFormatter(), + default => throw new \InvalidArgumentException("{$outputType} is not supported"), + }; + } + + public function formatData(array $data): string + { + return $this->formatter->format($data); + } +} diff --git a/src/Behavioral/Strategy/JSONFormatter.php b/src/Behavioral/Strategy/JSONFormatter.php new file mode 100644 index 0000000..1eee2d7 --- /dev/null +++ b/src/Behavioral/Strategy/JSONFormatter.php @@ -0,0 +1,11 @@ +addData($data, new SimpleXMLElement('')); return $xml->asXML(); } - protected function addData (array $data, SimpleXMLElement $xml) { + protected function addData(array $data, SimpleXMLElement $xml): SimpleXMLElement + { foreach ($data as $k => $v) { is_array($v) ? $this->addData($v, $xml->addChild($k)) @@ -20,4 +22,4 @@ protected function addData (array $data, SimpleXMLElement $xml) { } return $xml; } -} \ No newline at end of file +} diff --git a/behavioral/Strategy/demo.php b/src/Behavioral/Strategy/demo.php similarity index 56% rename from behavioral/Strategy/demo.php rename to src/Behavioral/Strategy/demo.php index 47db62b..8a40724 100644 --- a/behavioral/Strategy/demo.php +++ b/src/Behavioral/Strategy/demo.php @@ -1,13 +1,13 @@ "Johhny", - "surname" => "Marrony", - "company" => "Company", + "name" => "Johny", + "surname" => "Marony", + "company" => "Company Name", "position" => "Senior Doorkeeper" ]; @@ -18,4 +18,4 @@ echo $stringContext->formatData($exampleData) . PHP_EOL; $xmlContext = new Context('xml'); -echo $xmlContext->formatData($exampleData) . PHP_EOL; \ No newline at end of file +echo $xmlContext->formatData($exampleData) . PHP_EOL; diff --git a/src/Behavioral/TemplateMethod/ActionMovie.php b/src/Behavioral/TemplateMethod/ActionMovie.php new file mode 100644 index 0000000..18e0277 --- /dev/null +++ b/src/Behavioral/TemplateMethod/ActionMovie.php @@ -0,0 +1,27 @@ +budget = 100000; + } + + protected function castActors(): void + { + foreach (array_rand(self::AVAILABLE_ACTORS, self::NUM_ROLES) as $actor) { + $this->cast[] = self::AVAILABLE_ACTORS[$actor]; + } + } + + protected function castDirector(): void + { + $this->director = self::AVAILABLE_DIRECTORS[array_rand(self::AVAILABLE_DIRECTORS)]; + } +} diff --git a/src/Behavioral/TemplateMethod/ComedyMovie.php b/src/Behavioral/TemplateMethod/ComedyMovie.php new file mode 100644 index 0000000..d580661 --- /dev/null +++ b/src/Behavioral/TemplateMethod/ComedyMovie.php @@ -0,0 +1,25 @@ +budget = 500000; + } + + protected function castActors(): void + { + $this->cast[] = 'Adam Sandler'; + $this->cast[] = self::AVAILABLE_ACTORS[array_rand(self::AVAILABLE_ACTORS)]; + } + + protected function castDirector(): void + { + $this->director = self::AVAILABLE_DIRECTORS[array_rand(self::AVAILABLE_DIRECTORS)]; + } +} diff --git a/src/Behavioral/TemplateMethod/Movie.php b/src/Behavioral/TemplateMethod/Movie.php new file mode 100644 index 0000000..2a908bd --- /dev/null +++ b/src/Behavioral/TemplateMethod/Movie.php @@ -0,0 +1,36 @@ +name = $name; + } + + final public function publish(): void + { + $this->raiseMoney(); + $this->castActors(); + $this->castDirector(); + $this->promote(); + } + + abstract protected function raiseMoney(): void; + + abstract protected function castActors(): void; + + abstract protected function castDirector(): void; + + protected function promote(): void + { + $actors = implode(", ", $this->cast); + echo "New movie '{$this->name}' directed by {$this->director}. Starring {$actors} and budget of \${$this->budget}!" . PHP_EOL; + } +} diff --git a/behavioral/TemplateMethod/demo.php b/src/Behavioral/TemplateMethod/demo.php similarity index 51% rename from behavioral/TemplateMethod/demo.php rename to src/Behavioral/TemplateMethod/demo.php index aded3a2..187876d 100644 --- a/behavioral/TemplateMethod/demo.php +++ b/src/Behavioral/TemplateMethod/demo.php @@ -1,11 +1,11 @@ publish(); $comedyMovie = new ComedyMovie("Comedy 2"); -$comedyMovie->publish(); \ No newline at end of file +$comedyMovie->publish(); diff --git a/src/Behavioral/Visitor/SickLeave.php b/src/Behavioral/Visitor/SickLeave.php new file mode 100644 index 0000000..f1d92a9 --- /dev/null +++ b/src/Behavioral/Visitor/SickLeave.php @@ -0,0 +1,20 @@ +start; + } + + public function getEnd(): \DateTime + { + return $this->end; + } +} diff --git a/behavioral/Visitor/SickLeaveReport.php b/src/Behavioral/Visitor/SickLeaveReport.php similarity index 57% rename from behavioral/Visitor/SickLeaveReport.php rename to src/Behavioral/Visitor/SickLeaveReport.php index 5ead9bc..6e1b58a 100644 --- a/behavioral/Visitor/SickLeaveReport.php +++ b/src/Behavioral/Visitor/SickLeaveReport.php @@ -1,19 +1,18 @@ getName()}\""; + $msg = "Generating sick leave report for: {$university->getName()}" . PHP_EOL; foreach ($university->getStudents() as $student) { - $msgs[] = $this->visitStudent($student); + $msg .= $this->visitStudent($student) . PHP_EOL; } - return $msgs; + return $msg; } public function visitStudent(Student $student): string @@ -26,4 +25,4 @@ public function visitStudent(Student $student): string return "Student: {$student->getName()} missed {$daysMissed} days"; } -} \ No newline at end of file +} diff --git a/behavioral/Visitor/Student.php b/src/Behavioral/Visitor/Student.php similarity index 77% rename from behavioral/Visitor/Student.php rename to src/Behavioral/Visitor/Student.php index f3fcf3a..2bb14f8 100644 --- a/behavioral/Visitor/Student.php +++ b/src/Behavioral/Visitor/Student.php @@ -1,18 +1,18 @@ name = $name; } - public function addSickLeave(\DateTime $start, \DateTime $end) : void + public function addSickLeave(\DateTime $start, \DateTime $end): void { $this->sickLeaves[] = new SickLeave($start, $end); } @@ -31,4 +31,4 @@ public function accept(Visitor $visitor): string { return $visitor->visitStudent($this); } -} \ No newline at end of file +} diff --git a/src/Behavioral/Visitor/University.php b/src/Behavioral/Visitor/University.php new file mode 100644 index 0000000..3bda165 --- /dev/null +++ b/src/Behavioral/Visitor/University.php @@ -0,0 +1,25 @@ +name; + } + + public function getStudents(): array + { + return $this->students; + } + + public function accept(Visitor $visitor): string + { + return $visitor->visitUniversity($this); + } +} diff --git a/src/Behavioral/Visitor/Visitable.php b/src/Behavioral/Visitor/Visitable.php new file mode 100644 index 0000000..fe34082 --- /dev/null +++ b/src/Behavioral/Visitor/Visitable.php @@ -0,0 +1,8 @@ +addSickLeave(new \DateTime("2019-10-01"), new \DateTime("2019-10-21")); @@ -14,13 +14,4 @@ $ann = new Student("Ann"); $university = new University("Visitor University", [$john, $jan, $ann]); -$results = $university->accept(new SickLeaveReport()); - -function show($data) -{ - foreach ($data as $datum) { - echo $datum.PHP_EOL; - } -} - -show($results); \ No newline at end of file +echo $university->accept(new SickLeaveReport()); \ No newline at end of file diff --git a/src/Creational/AbstractFactory/DeviceFactory.php b/src/Creational/AbstractFactory/DeviceFactory.php new file mode 100644 index 0000000..1c0fbc5 --- /dev/null +++ b/src/Creational/AbstractFactory/DeviceFactory.php @@ -0,0 +1,10 @@ +makeIndoor(); @@ -20,4 +20,4 @@ $indoorIot->testTouch(); $indoorIot->testSensors(); $outdoorIot->testForVandalism(); -$outdoorIot->testForWeatherConditions(); \ No newline at end of file +$outdoorIot->testForWeatherConditions(); diff --git a/src/Creational/Builder/Device.php b/src/Creational/Builder/Device.php new file mode 100644 index 0000000..3607f5d --- /dev/null +++ b/src/Creational/Builder/Device.php @@ -0,0 +1,12 @@ +setHardware() + ->setSoftware() + ->setSLA() + ->getDevice(); + } +} diff --git a/src/Creational/Builder/InteractiveMirror.php b/src/Creational/Builder/InteractiveMirror.php new file mode 100644 index 0000000..6bec9b2 --- /dev/null +++ b/src/Creational/Builder/InteractiveMirror.php @@ -0,0 +1,25 @@ +hardware[] = $hardware; + } + + public function setSoftware(string $software): void + { + $this->software = $software; + } + + public function setSLA(string $SLA): void + { + $this->SLA = $SLA; + } +} diff --git a/src/Creational/Builder/InteractiveMirrorBuilder.php b/src/Creational/Builder/InteractiveMirrorBuilder.php new file mode 100644 index 0000000..f0499d2 --- /dev/null +++ b/src/Creational/Builder/InteractiveMirrorBuilder.php @@ -0,0 +1,41 @@ +device->attachHardware($component); + } + + return $this; + } + + public function setSoftware(): self + { + $this->device->setSoftware('Mirror software'); + + return $this; + } + + public function setSLA(): self + { + $this->device->setSLA('Mirror SLA V2'); + + return $this; + } + + public function getDevice(): Device + { + return $this->device; + } +} diff --git a/creational/Builder/demo.php b/src/Creational/Builder/demo.php similarity index 56% rename from creational/Builder/demo.php rename to src/Creational/Builder/demo.php index f7b833d..9a8682a 100644 --- a/creational/Builder/demo.php +++ b/src/Creational/Builder/demo.php @@ -1,12 +1,11 @@ buildDevice($mirrorBuilder); -var_dump($mirror); \ No newline at end of file +var_dump($mirror); diff --git a/src/Creational/FactoryMethod/AudioBox.php b/src/Creational/FactoryMethod/AudioBox.php new file mode 100644 index 0000000..f40ee85 --- /dev/null +++ b/src/Creational/FactoryMethod/AudioBox.php @@ -0,0 +1,11 @@ +file->getFilePath()}' />"; + } +} diff --git a/src/Creational/FactoryMethod/Box.php b/src/Creational/FactoryMethod/Box.php new file mode 100644 index 0000000..e97ef99 --- /dev/null +++ b/src/Creational/FactoryMethod/Box.php @@ -0,0 +1,15 @@ +file = $file; + } + + abstract public function getHtml(): string; +} diff --git a/src/Creational/FactoryMethod/BoxFactory.php b/src/Creational/FactoryMethod/BoxFactory.php new file mode 100644 index 0000000..c98129f --- /dev/null +++ b/src/Creational/FactoryMethod/BoxFactory.php @@ -0,0 +1,18 @@ +getType()) { + FileItem::TYPE_IMG => new ImgBox($item), + FileItem::TYPE_VIDEO => new VideoBox($item), + FileItem::TYPE_AUDIO => new AudioBox($item), + default => throw new InvalidArgumentException("Wrong file type provided: {$item->getType()}"), + }; + } +} diff --git a/src/Creational/FactoryMethod/Factory.php b/src/Creational/FactoryMethod/Factory.php new file mode 100644 index 0000000..b1fd211 --- /dev/null +++ b/src/Creational/FactoryMethod/Factory.php @@ -0,0 +1,8 @@ +type; + } + + public function getFilePath(): string + { + return $this->filePath; + } +} diff --git a/src/Creational/FactoryMethod/ImgBox.php b/src/Creational/FactoryMethod/ImgBox.php new file mode 100644 index 0000000..28cc4c4 --- /dev/null +++ b/src/Creational/FactoryMethod/ImgBox.php @@ -0,0 +1,11 @@ +file->getFilePath()}' />"; + } +} diff --git a/src/Creational/FactoryMethod/VideoBox.php b/src/Creational/FactoryMethod/VideoBox.php new file mode 100644 index 0000000..9876eac --- /dev/null +++ b/src/Creational/FactoryMethod/VideoBox.php @@ -0,0 +1,11 @@ +file->getFilePath()}' />"; + } +} diff --git a/src/Creational/FactoryMethod/demo.php b/src/Creational/FactoryMethod/demo.php new file mode 100644 index 0000000..494a89a --- /dev/null +++ b/src/Creational/FactoryMethod/demo.php @@ -0,0 +1,13 @@ +getHtml() . PHP_EOL; +echo BoxFactory::createBox($video)->getHtml() . PHP_EOL; +echo BoxFactory::createBox($audio)->getHtml() . PHP_EOL; diff --git a/src/Creational/Prototype/Computer.php b/src/Creational/Prototype/Computer.php new file mode 100644 index 0000000..00a3e19 --- /dev/null +++ b/src/Creational/Prototype/Computer.php @@ -0,0 +1,25 @@ +uuid = $uuid; + + return $this; + } + + public function save(): void + { + echo "Saving device with UID {$this->uuid} to group {$this->group->getName()} in {$this->group->getLocation()}" . PHP_EOL; + } +} diff --git a/src/Creational/Prototype/Device.php b/src/Creational/Prototype/Device.php new file mode 100644 index 0000000..6a94751 --- /dev/null +++ b/src/Creational/Prototype/Device.php @@ -0,0 +1,12 @@ +name; + } + + public function getLocation(): string + { + return $this->location; + } +} diff --git a/src/Creational/Prototype/demo.php b/src/Creational/Prototype/demo.php new file mode 100644 index 0000000..9b57b9b --- /dev/null +++ b/src/Creational/Prototype/demo.php @@ -0,0 +1,23 @@ +setUuid($uid)->save(); +} diff --git a/src/Creational/Singleton/ActiveUser.php b/src/Creational/Singleton/ActiveUser.php new file mode 100644 index 0000000..d8c13a5 --- /dev/null +++ b/src/Creational/Singleton/ActiveUser.php @@ -0,0 +1,37 @@ +email = "active@user.com"; + } + + private function __clone() + { + } + + public function setName(string $email): void + { + $this->email = $email; + } + + public function changeEmail(): string + { + return $this->email; + } + + public static function getInstance(): ActiveUser + { + if (!self::$instance) { + self::$instance = new ActiveUser(); + } + return self::$instance; + } +} diff --git a/structural/Adapter/.env.example b/src/Structural/Adapter/.env.example similarity index 53% rename from structural/Adapter/.env.example rename to src/Structural/Adapter/.env.example index df7e668..405580b 100644 --- a/structural/Adapter/.env.example +++ b/src/Structural/Adapter/.env.example @@ -1,7 +1,3 @@ -AZURE_ACCOUNT_NAME="" -AZURE_ACCOUNT_KEY="" -AZURE_CONTAINER_NAME="" - AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" diff --git a/structural/Adapter/AWSFileStorage.php b/src/Structural/Adapter/AWSFileStorage.php similarity index 53% rename from structural/Adapter/AWSFileStorage.php rename to src/Structural/Adapter/AWSFileStorage.php index 26d4d77..b24bc24 100644 --- a/structural/Adapter/AWSFileStorage.php +++ b/src/Structural/Adapter/AWSFileStorage.php @@ -1,22 +1,22 @@ load('.env'); - $this->bucket = getenv('AWS_BUCKET_NAME'); + $this->bucket = getenv('AWS_BUCKET_NAME') ?? ""; $this->client = new S3Client([ 'version' => 'latest', @@ -25,7 +25,8 @@ public function __construct () { ]); } - public function get (string $name): File { + public function get(string $name): File + { try { $file = $this->client->getObject([ 'Bucket' => $this->bucket, @@ -33,12 +34,13 @@ public function get (string $name): File { ]); return new File($name, $file['Body']->getContents()); - } catch (\Exception $e) { - throw new \Exception($e->getMessage()); + } catch (\Throwable $e) { + throw new \LogicException($e->getMessage()); } } - public function save (string $path, string $name): void { + public function save(string $path, string $name): void + { $this->client->putObject([ 'Bucket' => $this->bucket, 'Key' => $name, @@ -46,10 +48,17 @@ public function save (string $path, string $name): void { ]); } - public function delete (string $name): void { - $this->client->deleteObject([ - 'Bucket' => $this->bucket, - 'Key' => $name - ]); + public function delete(string $name): bool + { + try { + $this->client->deleteObject([ + 'Bucket' => $this->bucket, + 'Key' => $name + ]); + } catch (\Throwable $e) { + return false; + } + + return true; } -} \ No newline at end of file +} diff --git a/src/Structural/Adapter/Client.php b/src/Structural/Adapter/Client.php new file mode 100644 index 0000000..a9d9e3e --- /dev/null +++ b/src/Structural/Adapter/Client.php @@ -0,0 +1,35 @@ +storageProvider = match ($storage) { + 'local' => new LocalFileStorage(), + 'aws' => new AWSFileStorage(), + default => throw new \Exception("Unsupported storage requested $storage"), + }; + } + + public function save(string $filePath, string $name): void + { + $this->storageProvider->save($filePath, $name); + } + + public function get(string $name): File + { + return $this->storageProvider->get($name); + } + + public function delete(string $name) + { + return $this->storageProvider->delete($name); + } +} diff --git a/src/Structural/Adapter/File.php b/src/Structural/Adapter/File.php new file mode 100644 index 0000000..500a701 --- /dev/null +++ b/src/Structural/Adapter/File.php @@ -0,0 +1,20 @@ +content; + } + + public function getName(): string + { + return $this->name; + } +} diff --git a/src/Structural/Adapter/FileAdapter.php b/src/Structural/Adapter/FileAdapter.php new file mode 100644 index 0000000..227d668 --- /dev/null +++ b/src/Structural/Adapter/FileAdapter.php @@ -0,0 +1,12 @@ + -
- - -
@@ -124,7 +119,7 @@ class="form-control" aria-describedby="emailHelp" placeholder="Enter file name" required> - Enter filename, choose it's storage and action + Enter filename, choose its storage and action
diff --git a/structural/Adapter/server.sh b/src/Structural/Adapter/server.sh similarity index 100% rename from structural/Adapter/server.sh rename to src/Structural/Adapter/server.sh diff --git a/structural/Adapter/storage/.gitkeep b/src/Structural/Adapter/storage/.gitkeep similarity index 100% rename from structural/Adapter/storage/.gitkeep rename to src/Structural/Adapter/storage/.gitkeep diff --git a/src/Structural/Bridge/Blurred.php b/src/Structural/Bridge/Blurred.php new file mode 100644 index 0000000..5837126 --- /dev/null +++ b/src/Structural/Bridge/Blurred.php @@ -0,0 +1,24 @@ +content->getHtml(); + $css = $this->content->getCss(); + + return << + $css + .content { + filter: blur(5px); + -webkit-filter: blur(5px); + } + +CONTENT; + } +} diff --git a/src/Structural/Bridge/Content.php b/src/Structural/Bridge/Content.php new file mode 100644 index 0000000..0c2a9d0 --- /dev/null +++ b/src/Structural/Bridge/Content.php @@ -0,0 +1,15 @@ +filePath' />"; } -} \ No newline at end of file +} diff --git a/structural/Bridge/Standard.php b/src/Structural/Bridge/Standard.php similarity index 59% rename from structural/Bridge/Standard.php rename to src/Structural/Bridge/Standard.php index 3d3646c..b6ea942 100644 --- a/structural/Bridge/Standard.php +++ b/src/Structural/Bridge/Standard.php @@ -1,12 +1,11 @@ content->getHtml(); $css = $this->content->getCss(); @@ -19,4 +18,4 @@ public function render (): string { CONTENT; } -} \ No newline at end of file +} diff --git a/structural/Bridge/Video.php b/src/Structural/Bridge/Video.php similarity index 60% rename from structural/Bridge/Video.php rename to src/Structural/Bridge/Video.php index f86df3d..efd6dc0 100644 --- a/structural/Bridge/Video.php +++ b/src/Structural/Bridge/Video.php @@ -1,11 +1,11 @@ filePath' autoplay muted loop>"; } -} \ No newline at end of file +} diff --git a/structural/Bridge/demo.php b/src/Structural/Bridge/demo.php similarity index 82% rename from structural/Bridge/demo.php rename to src/Structural/Bridge/demo.php index 4b02527..e277962 100644 --- a/structural/Bridge/demo.php +++ b/src/Structural/Bridge/demo.php @@ -1,8 +1,8 @@ dependencies = new SplObjectStorage(); $this->name = $name; } - public function calculateBudget (): int { + public function calculateBudget(): int + { $total = 0; foreach ($this->getDependent() as $dependent) { @@ -24,11 +26,13 @@ public function calculateBudget (): int { return $total; } - public function getDependent (): SplObjectStorage { + public function getDependent(): SplObjectStorage + { return $this->dependencies; } - public function addDependent (Budgeted $item): void { + public function addDependent(Budgeted $item): void + { $this->dependencies->attach($item); } -} \ No newline at end of file +} diff --git a/src/Structural/Composite/Employee.php b/src/Structural/Composite/Employee.php new file mode 100644 index 0000000..4454be8 --- /dev/null +++ b/src/Structural/Composite/Employee.php @@ -0,0 +1,15 @@ +salary; + } +} diff --git a/structural/Composite/demo.php b/src/Structural/Composite/demo.php similarity index 87% rename from structural/Composite/demo.php rename to src/Structural/Composite/demo.php index 360d8fb..bc1bfe3 100644 --- a/structural/Composite/demo.php +++ b/src/Structural/Composite/demo.php @@ -1,8 +1,8 @@ addDependent($it); echo("Total company salaries: \${$company->calculateBudget()}" . PHP_EOL); - diff --git a/src/Structural/Decorator/Product.php b/src/Structural/Decorator/Product.php new file mode 100644 index 0000000..fb03584 --- /dev/null +++ b/src/Structural/Decorator/Product.php @@ -0,0 +1,10 @@ +product = $product; + } + + abstract public function getName(): string; + + abstract public function getPrice(): int; + +} diff --git a/src/Structural/Decorator/Shirt.php b/src/Structural/Decorator/Shirt.php new file mode 100644 index 0000000..bdd53f1 --- /dev/null +++ b/src/Structural/Decorator/Shirt.php @@ -0,0 +1,22 @@ +name}"; + } + + public function getPrice(): int + { + return round($this->price * self::TAX_RATE); + } +} diff --git a/src/Structural/Decorator/SummerSale.php b/src/Structural/Decorator/SummerSale.php new file mode 100644 index 0000000..390649e --- /dev/null +++ b/src/Structural/Decorator/SummerSale.php @@ -0,0 +1,19 @@ +product->getName()} ONLY {$this->getPrice()} EUR"; + } + + public function getPrice(): int + { + return round($this->product->getPrice() * self::DISCOUNT_FACTOR); + } + +} diff --git a/src/Structural/Decorator/TV.php b/src/Structural/Decorator/TV.php new file mode 100644 index 0000000..8bdffa5 --- /dev/null +++ b/src/Structural/Decorator/TV.php @@ -0,0 +1,22 @@ +name"; + } + + public function getPrice(): int + { + return round($this->price * self::TAX_RATE); + } +} diff --git a/src/Structural/Decorator/WinterSale.php b/src/Structural/Decorator/WinterSale.php new file mode 100644 index 0000000..d40a4dd --- /dev/null +++ b/src/Structural/Decorator/WinterSale.php @@ -0,0 +1,19 @@ +product->getName()} ONLY {$this->getPrice()} EUR"; + } + + public function getPrice(): int + { + return round($this->product->getPrice() * self::DISCOUNT_FACTOR); + } + +} diff --git a/structural/Decorator/demo.php b/src/Structural/Decorator/demo.php similarity index 77% rename from structural/Decorator/demo.php rename to src/Structural/Decorator/demo.php index 5a43c70..f3deeb3 100644 --- a/structural/Decorator/demo.php +++ b/src/Structural/Decorator/demo.php @@ -1,14 +1,14 @@ getName() . PHP_EOL); -echo ($tv->getName()) . PHP_EOL; +echo($tv->getName()) . PHP_EOL; $winterShirt = new WinterSale($shirt); $winterTv = new WinterSale($tv); diff --git a/src/Structural/DependencyInjection/Storage.php b/src/Structural/DependencyInjection/Storage.php new file mode 100644 index 0000000..7174ddd --- /dev/null +++ b/src/Structural/DependencyInjection/Storage.php @@ -0,0 +1,8 @@ +userStorage = $userStorage; } - protected function validate ($email, $password) { + protected function validate($email, $password): bool + { if (strlen($email) > 3 && strlen($password) > 3) { return true; } else { @@ -18,7 +20,8 @@ protected function validate ($email, $password) { } } - public function register (string $email, string $password) { + public function register(string $email, string $password): bool + { if ($this->validate($email, $password) && $this->userStorage->save($email, $password)) { @@ -27,4 +30,4 @@ public function register (string $email, string $password) { return false; } } -} \ No newline at end of file +} diff --git a/structural/DependencyInjection/UserStorage.php b/src/Structural/DependencyInjection/UserStorage.php similarity index 51% rename from structural/DependencyInjection/UserStorage.php rename to src/Structural/DependencyInjection/UserStorage.php index 898b9d0..aa5a923 100644 --- a/structural/DependencyInjection/UserStorage.php +++ b/src/Structural/DependencyInjection/UserStorage.php @@ -1,17 +1,19 @@ connectDb(); echo "Inserting new user record with email: {$email} and password {$password}"; return true; } -} \ No newline at end of file +} diff --git a/structural/DependencyInjection/UserTest.php b/src/Structural/DependencyInjection/UserTest.php similarity index 69% rename from structural/DependencyInjection/UserTest.php rename to src/Structural/DependencyInjection/UserTest.php index e2a5a7d..2d10a41 100644 --- a/structural/DependencyInjection/UserTest.php +++ b/src/Structural/DependencyInjection/UserTest.php @@ -1,15 +1,16 @@ getMockBuilder(UserStorage::class) ->disableOriginalConstructor() - ->setMethods(["save"]) + ->onlyMethods(["save"]) ->getMock(); $userStorage->expects($this->once())->method("save")->willReturn(true); @@ -20,10 +21,11 @@ public function testRegisterOk () { $this->assertTrue($user->register($testEmail, $testPassword)); } - public function testRegisterFail () { + public function testRegisterFail() + { $userStorage = $this->getMockBuilder(UserStorage::class) ->disableOriginalConstructor() - ->setMethods(["save"]) + ->onlyMethods(["save"]) ->getMock(); $userStorage->expects($this->once())->method("save")->willReturn(false); @@ -34,22 +36,19 @@ public function testRegisterFail () { $this->assertFalse($user->register($testEmail, $testPassword)); } - public function testRegisterValidationFail () { + public function testRegisterValidationFail() + { $userStorage = $this->getMockBuilder(UserStorage::class) ->disableOriginalConstructor() - ->setMethods(["save"]) + ->onlyMethods(["save"]) ->getMock(); $userStorage->expects($this->never())->method("save"); $user = new User($userStorage); $wrongEmail = "aa"; - $rightEmail = "aaaa@wp.pl"; $wrongPassword = "12"; - $rightPassword = "123456"; $this->assertFalse($user->register($wrongEmail, $wrongPassword)); - $this->assertFalse($user->register($wrongEmail, $rightPassword)); - $this->assertFalse($user->register($rightEmail, $wrongPassword)); } -} \ No newline at end of file +} diff --git a/structural/Facade/Image.php b/src/Structural/Facade/Image.php similarity index 63% rename from structural/Facade/Image.php rename to src/Structural/Facade/Image.php index dc15996..a9ee6d5 100644 --- a/structural/Facade/Image.php +++ b/src/Structural/Facade/Image.php @@ -1,19 +1,21 @@ imagick = new Imagick(); } - public function thumbnail (string $filePath, int $width, int $height) { + public function thumbnail(string $filePath, int $width, int $height): true + { $this->imagick->readImage($filePath); $this->imagick->setbackgroundcolor('rgb(0, 0, 0)'); $this->imagick->thumbnailImage($width, $height, true, true); @@ -24,7 +26,7 @@ public function thumbnail (string $filePath, int $width, int $height) { if (file_put_contents($thumbPath, $this->imagick)) { return true; } else { - throw new \Exception("Could not create thumbnail."); + throw new \RuntimeException("Could not create thumbnail."); } } } diff --git a/src/Structural/Facade/demo.php b/src/Structural/Facade/demo.php new file mode 100644 index 0000000..b4ccf12 --- /dev/null +++ b/src/Structural/Facade/demo.php @@ -0,0 +1,8 @@ +thumbnail(__DIR__ . "/../../../demo.jpg", 100, 100); diff --git a/structural/FluentInterface/QueryBuilder.php b/src/Structural/FluentInterface/QueryBuilder.php similarity index 92% rename from structural/FluentInterface/QueryBuilder.php rename to src/Structural/FluentInterface/QueryBuilder.php index 365c3fd..0f27752 100644 --- a/structural/FluentInterface/QueryBuilder.php +++ b/src/Structural/FluentInterface/QueryBuilder.php @@ -1,10 +1,9 @@ query; } -} \ No newline at end of file +} diff --git a/structural/FluentInterface/demo.php b/src/Structural/FluentInterface/demo.php similarity index 67% rename from structural/FluentInterface/demo.php rename to src/Structural/FluentInterface/demo.php index 600a70b..2a13f7e 100644 --- a/structural/FluentInterface/demo.php +++ b/src/Structural/FluentInterface/demo.php @@ -1,8 +1,8 @@ select(["name", "surname"]) @@ -11,4 +11,3 @@ ->orderBy("date ASC") ->limit(10) ->getQuery(); - diff --git a/src/Structural/Flyweight/Device.php b/src/Structural/Flyweight/Device.php new file mode 100644 index 0000000..88713f8 --- /dev/null +++ b/src/Structural/Flyweight/Device.php @@ -0,0 +1,21 @@ +uuid} is active" . PHP_EOL; + echo $this->type->reportType() . PHP_EOL; + echo "Calling it on ip {$this->ip}" . PHP_EOL; + } +} diff --git a/structural/Flyweight/DeviceStorage.php b/src/Structural/Flyweight/DeviceStorage.php similarity index 62% rename from structural/Flyweight/DeviceStorage.php rename to src/Structural/Flyweight/DeviceStorage.php index be096aa..6d73cbc 100644 --- a/structural/Flyweight/DeviceStorage.php +++ b/src/Structural/Flyweight/DeviceStorage.php @@ -1,24 +1,29 @@ deviceFactory = new DeviceTypeFactory(); } - public function addDevice ( + public function addDevice( string $uuid, string $location, string $resolution, string $producer, string $operatingSystem, string $ip - ) { + ): void + { $type = $this->deviceFactory->getType( $location, $resolution, @@ -29,10 +34,11 @@ public function addDevice ( $this->devices[] = new Device($uuid, $ip, $type); } - public function checkDevicesHealth () { + public function checkDevicesHealth(): void + { foreach ($this->devices as $device) { $device->ping(); } } -} \ No newline at end of file +} diff --git a/src/Structural/Flyweight/DeviceType.php b/src/Structural/Flyweight/DeviceType.php new file mode 100644 index 0000000..18db65e --- /dev/null +++ b/src/Structural/Flyweight/DeviceType.php @@ -0,0 +1,20 @@ +location} with resolution {$this->resolution} crated by {$this->producer} and running {$this->operatingSystem}"; + } +} diff --git a/structural/Flyweight/DeviceTypeFactory.php b/src/Structural/Flyweight/DeviceTypeFactory.php similarity index 59% rename from structural/Flyweight/DeviceTypeFactory.php rename to src/Structural/Flyweight/DeviceTypeFactory.php index 8d78ae0..942c051 100644 --- a/structural/Flyweight/DeviceTypeFactory.php +++ b/src/Structural/Flyweight/DeviceTypeFactory.php @@ -1,41 +1,44 @@ getKey( $location, $resolution, $producer, - $operatingSystem); + $operatingSystem + ); - if (!array_key_exists($key, $this->deviceTypes)) { +// if (!array_key_exists($key, $this->deviceTypes)) { $this->deviceTypes[$key] = new DeviceType( $location, $resolution, $producer, $operatingSystem ); - } +// } return $this->deviceTypes[$key]; } - protected function getKey ( + protected function getKey( string $location, string $resolution, string $producer, - string $operatingSystem) { - + string $operatingSystem + ): string + { return md5(implode("_", func_get_args())); } -} \ No newline at end of file +} diff --git a/structural/Flyweight/create_csv.php b/src/Structural/Flyweight/Generator.php similarity index 56% rename from structural/Flyweight/create_csv.php rename to src/Structural/Flyweight/Generator.php index a6aedb6..4693554 100644 --- a/structural/Flyweight/create_csv.php +++ b/src/Structural/Flyweight/Generator.php @@ -1,41 +1,49 @@ numItems = $numItems; $this->fileName = $fileName; } - protected function createHeader (): void { + protected function createHeader(): void + { fputcsv($this->file, self::COLUMNS); } - protected function generateRandomString (int $length): string { + protected function generateRandomString(int $length): string + { return substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length / strlen($x)))), 1, $length); } - protected function getRand (array $arr): string { + protected function getRand(array $arr): string + { $key = array_rand($arr); return $arr[$key]; } - protected function getRandIp () { + protected function getRandIp(): string + { return mt_rand(0, 255) . "." . mt_rand(0, 255) . "." . mt_rand(0, 255) . "." . mt_rand(0, 255); } - protected function generateData (): void { + protected function generateData(): void + { for ($idx = 0; $idx < $this->numItems; $idx++) { fputcsv($this->file, [ $idx + 1, @@ -49,7 +57,8 @@ protected function generateData (): void { } } - public function create (): void { + public function create(): void + { $this->file = fopen($this->fileName, 'w'); $this->createHeader(); $this->generateData(); @@ -57,5 +66,3 @@ public function create (): void { } } -$csv = new CSV("demo.csv", 5000); -$csv->create(); \ No newline at end of file diff --git a/structural/Flyweight/demo.php b/src/Structural/Flyweight/demo.php similarity index 57% rename from structural/Flyweight/demo.php rename to src/Structural/Flyweight/demo.php index 766fad2..51589cd 100644 --- a/structural/Flyweight/demo.php +++ b/src/Structural/Flyweight/demo.php @@ -1,15 +1,17 @@ create(); $file = fopen('demo.csv', 'r'); $devicesDB = new DeviceStorage(); for ($i = 0; $row = fgetcsv($file); ++$i) { - // Omitting file headers if ($i) { $devicesDB->addDevice( @@ -26,10 +28,11 @@ fclose($file); $devicesDB->checkDevicesHealth(); -// 2189456 -// 4194304 RAM USED true -// 3427248 RAM USED -// 4194304 RAM USED +// 3.4 MB RAM USED +// 22.92 MB RAM USED + +// 2.21 MB RAM USED +// 10.91 MB RAM USED -echo memory_get_usage() / 1024 / 1024 . " RAM USED"; \ No newline at end of file +echo round(memory_get_usage() / 1024 / 1024, 2) . " MB RAM USED"; diff --git a/structural/Proxy/AuthFile.php b/src/Structural/Proxy/AuthFile.php similarity index 61% rename from structural/Proxy/AuthFile.php rename to src/Structural/Proxy/AuthFile.php index be176ad..46e20df 100644 --- a/structural/Proxy/AuthFile.php +++ b/src/Structural/Proxy/AuthFile.php @@ -1,38 +1,42 @@ file = $file; + public function __construct( + private readonly File $file) + { } - public function add (string $name, string $path): void { + public function add(string $name, string $path): void + { if ($this->loggedIn()) { $this->file->add($name, $path); } } - public function get (string $name): void { + public function get(string $name): void + { if ($this->loggedIn()) { $this->file->get($name); } } - public function remove (string $name): void { + public function remove(string $name): void + { if ($this->loggedIn()) { $this->file->remove($name); } } - private function loggedIn () { + private function loggedIn(): bool + { if (isset($_SESSION["username"]) && in_array($_SESSION["username"], self::ALLOWED_USERS)) { echo "User can perform action" . PHP_EOL; @@ -43,4 +47,4 @@ private function loggedIn () { return false; } } -} \ No newline at end of file +} diff --git a/src/Structural/Proxy/File.php b/src/Structural/Proxy/File.php new file mode 100644 index 0000000..e16e7c9 --- /dev/null +++ b/src/Structural/Proxy/File.php @@ -0,0 +1,12 @@ +load('.env'); - - $connectionString = "DefaultEndpointsProtocol=https;AccountName=" . getenv('AZURE_ACCOUNT_NAME') . ";AccountKey=" . getenv("AZURE_ACCOUNT_KEY") . ";EndpointSuffix=core.windows.net"; - $this->client = BlobRestProxy::createBlobService($connectionString); - $this->containerName = getenv("AZURE_CONTAINER_NAME"); - } - - public function get (string $name): File { - $blob = $this->client->getBlob($this->containerName, $name); - - return new File($name, stream_get_contents($blob->getContentStream())); - } - - public function save (string $path, string $name): void { - $this->client->createBlockBlob($this->containerName, $name, fopen($path, "r")); - } - - public function delete (string $name): void { - $this->client->deleteBlob($this->containerName, $name); - } -} \ No newline at end of file diff --git a/structural/Adapter/Client.php b/structural/Adapter/Client.php deleted file mode 100644 index d405675..0000000 --- a/structural/Adapter/Client.php +++ /dev/null @@ -1,38 +0,0 @@ -storageProvider = new LocalFileStorage(); - break; - case 'azure': - $this->storageProvider = new AzureFileStorage(); - break; - case 'aws': - $this->storageProvider = new AWSFileStorage(); - break; - default: - throw new \Exception("Unsupported storage requested $storage"); - } - } - - public function save (string $filePath, string $name) { - $this->storageProvider->save($filePath, $name); - } - - public function get (string $name) { - return $this->storageProvider->get($name); - } - - public function delete (string $name) { - return $this->storageProvider->delete($name); - } -} \ No newline at end of file diff --git a/structural/Adapter/File.php b/structural/Adapter/File.php deleted file mode 100644 index 0a5310d..0000000 --- a/structural/Adapter/File.php +++ /dev/null @@ -1,23 +0,0 @@ -name = $name; - $this->content = $content; - } - - public function getContent () { - return $this->content; - } - - public function getName () { - return $this->name; - } -} \ No newline at end of file diff --git a/structural/Adapter/FileAdapter.php b/structural/Adapter/FileAdapter.php deleted file mode 100644 index d7b9487..0000000 --- a/structural/Adapter/FileAdapter.php +++ /dev/null @@ -1,13 +0,0 @@ -content->getHtml(); - $css = $this->content->getCss(); - - return << - $css - $this->blurredRules - -CONTENT; - } -} \ No newline at end of file diff --git a/structural/Bridge/Content.php b/structural/Bridge/Content.php deleted file mode 100644 index 5254855..0000000 --- a/structural/Bridge/Content.php +++ /dev/null @@ -1,18 +0,0 @@ -filePath = $filePath; - } - - abstract public function getHtml (): string; - - abstract public function getCss (): string; - -} \ No newline at end of file diff --git a/structural/Bridge/Display.php b/structural/Bridge/Display.php deleted file mode 100644 index 55a5ba6..0000000 --- a/structural/Bridge/Display.php +++ /dev/null @@ -1,16 +0,0 @@ -content = $content; - } - - abstract public function render (): string; - -} \ No newline at end of file diff --git a/structural/Composite/Budgeted.php b/structural/Composite/Budgeted.php deleted file mode 100644 index e457b4a..0000000 --- a/structural/Composite/Budgeted.php +++ /dev/null @@ -1,7 +0,0 @@ -name = $name; - $this->salary = $salary; - } - - public function calculateBudget (): int { - return $this->salary; - } -} \ No newline at end of file diff --git a/structural/Decorator/Product.php b/structural/Decorator/Product.php deleted file mode 100644 index bb1bd3a..0000000 --- a/structural/Decorator/Product.php +++ /dev/null @@ -1,10 +0,0 @@ -product = $product; - } - - public abstract function getName (): string; - - public abstract function getPrice (): float; - -} \ No newline at end of file diff --git a/structural/Decorator/Shirt.php b/structural/Decorator/Shirt.php deleted file mode 100644 index 1273ff1..0000000 --- a/structural/Decorator/Shirt.php +++ /dev/null @@ -1,24 +0,0 @@ -price = $price; - $this->name = $name; - } - - public function getName (): string { - return "Shirt {$this->name}"; - } - - public function getPrice (): float { - return $this->price * self::TAX_RATE; - } -} \ No newline at end of file diff --git a/structural/Decorator/SummerSale.php b/structural/Decorator/SummerSale.php deleted file mode 100644 index 65573c1..0000000 --- a/structural/Decorator/SummerSale.php +++ /dev/null @@ -1,17 +0,0 @@ -product->getName()} ONLY {$this->getPrice()} EUR"; - } - - public function getPrice (): float { - return $this->product->getPrice() * self::DISCOUNT_FACTOR; - } - -} \ No newline at end of file diff --git a/structural/Decorator/TV.php b/structural/Decorator/TV.php deleted file mode 100644 index f1885e8..0000000 --- a/structural/Decorator/TV.php +++ /dev/null @@ -1,24 +0,0 @@ -price = $price; - $this->name = $name; - } - - public function getName (): string { - return "TV $this->name"; - } - - public function getPrice (): float { - return $this->price * self::TAX_RATE; - } -} \ No newline at end of file diff --git a/structural/Decorator/WinterSale.php b/structural/Decorator/WinterSale.php deleted file mode 100644 index c58e6a3..0000000 --- a/structural/Decorator/WinterSale.php +++ /dev/null @@ -1,17 +0,0 @@ -product->getName()} ONLY {$this->getPrice()} EUR"; - } - - public function getPrice (): float { - return $this->product->getPrice() * self::DISCOUNT_FACTOR; - } - -} \ No newline at end of file diff --git a/structural/DependencyInjection/Storage.php b/structural/DependencyInjection/Storage.php deleted file mode 100644 index 4d31f79..0000000 --- a/structural/DependencyInjection/Storage.php +++ /dev/null @@ -1,8 +0,0 @@ -thumbnail("demo.jpg", 100, 100); \ No newline at end of file diff --git a/structural/Flyweight/Device.php b/structural/Flyweight/Device.php deleted file mode 100644 index 3d7141e..0000000 --- a/structural/Flyweight/Device.php +++ /dev/null @@ -1,26 +0,0 @@ -uid = $uuid; - $this->ip = $ip; - $this->type = $type; - } - - public function ping () { - echo "Checking if device {$this->uid} is active" . PHP_EOL; - $this->type->reportType() . PHP_EOL; - echo "Calling it on ip {$this->ip}" . PHP_EOL; - } -} \ No newline at end of file diff --git a/structural/Flyweight/DeviceType.php b/structural/Flyweight/DeviceType.php deleted file mode 100644 index c81d3b1..0000000 --- a/structural/Flyweight/DeviceType.php +++ /dev/null @@ -1,27 +0,0 @@ -location = $location; - $this->resolution = $resolution; - $this->producer = $producer; - $this->operatingSystem = $operatingSystem; - } - - public function reportType () { - return "Working on device in {$this->location} with resolution {$this->resolution} crated by {$this->producer} and running {$this->operatingSystem}"; - } -} \ No newline at end of file diff --git a/structural/Proxy/File.php b/structural/Proxy/File.php deleted file mode 100644 index 0d857e3..0000000 --- a/structural/Proxy/File.php +++ /dev/null @@ -1,11 +0,0 @@ - Date: Thu, 30 Jan 2025 20:10:58 +0100 Subject: [PATCH 2/5] Update UserStorage.php --- src/Structural/DependencyInjection/UserStorage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Structural/DependencyInjection/UserStorage.php b/src/Structural/DependencyInjection/UserStorage.php index aa5a923..c45c99b 100644 --- a/src/Structural/DependencyInjection/UserStorage.php +++ b/src/Structural/DependencyInjection/UserStorage.php @@ -9,7 +9,7 @@ protected function connectDb(): void echo "Making connection to DB" . PHP_EOL; } - public function save($email, $password): bool + public function save(string $email, string $password): bool { $this->connectDb(); echo "Inserting new user record with email: {$email} and password {$password}"; From 384b5d03ae04b445cbca7a2f61332cadb8aff515 Mon Sep 17 00:00:00 2001 From: Jakub Kapuscik Date: Thu, 30 Jan 2025 20:11:51 +0100 Subject: [PATCH 3/5] Update User.php --- src/Structural/DependencyInjection/User.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Structural/DependencyInjection/User.php b/src/Structural/DependencyInjection/User.php index 9472369..71aecc9 100644 --- a/src/Structural/DependencyInjection/User.php +++ b/src/Structural/DependencyInjection/User.php @@ -4,16 +4,13 @@ class User { - protected Storage $userStorage; - - public function __construct(Storage $userStorage) + public function __construct(private Storage $userStorage) { - $this->userStorage = $userStorage; } - protected function validate($email, $password): bool + protected function validate(string $email, string $password): bool { - if (strlen($email) > 3 && strlen($password) > 3) { + if (mb_strlen($email) > 3 && mb_strlen($password) > 3) { return true; } else { return false; From 2b77455dcbcd803bad06bca4806dff08c7b64bb3 Mon Sep 17 00:00:00 2001 From: Jakub Kapuscik Date: Thu, 30 Jan 2025 20:18:31 +0100 Subject: [PATCH 4/5] Update Storage.php --- src/Structural/DependencyInjection/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Structural/DependencyInjection/Storage.php b/src/Structural/DependencyInjection/Storage.php index 7174ddd..eba5fa8 100644 --- a/src/Structural/DependencyInjection/Storage.php +++ b/src/Structural/DependencyInjection/Storage.php @@ -4,5 +4,5 @@ interface Storage { - public function save($email, $password): bool ; + public function save(string $email, string $password): bool ; } From 824df7fd86743fa6aaae0cae9ed99cfa1318409a Mon Sep 17 00:00:00 2001 From: Jakub Kapuscik Date: Thu, 30 Jan 2025 20:27:04 +0100 Subject: [PATCH 5/5] Update Department.php --- src/Structural/Composite/Department.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Structural/Composite/Department.php b/src/Structural/Composite/Department.php index 27c1e67..75c773f 100644 --- a/src/Structural/Composite/Department.php +++ b/src/Structural/Composite/Department.php @@ -7,12 +7,10 @@ final class Department implements BudgetedComposite { private SplObjectStorage $dependencies; - private string $name; - public function __construct(string $name) + public function __construct(private string $name) { $this->dependencies = new SplObjectStorage(); - $this->name = $name; } public function calculateBudget(): int