From 0414c82b0c5605578f0695e3c9b2e2a73796d7b7 Mon Sep 17 00:00:00 2001 From: rbairwell Date: Tue, 19 Mar 2019 14:47:16 +0000 Subject: [PATCH 1/2] Change to Doctrine based coding standards --- .circleci/config.yml | 4 + .idea/PublicWhipV2.iml | 16 +- .idea/codeStyles/Project.xml | 3 +- .../includes/PHP Class Doc Comment.php | 2 +- .../includes/PHP Interface Doc Comment.php | 2 +- .../includes/PHP Trait Doc Comment.php | 2 +- .idea/fileTemplates/internal/PHP Class.php | 1 - .idea/fileTemplates/internal/PHP Trait.php | 1 - .idea/fileTemplates/internal/PHPUnit Test.php | 1 - .idea/inspectionProfiles/Project_Default.xml | 4 +- .idea/php.xml | 207 ++-- README.md | 1 - composer.json | 64 +- composer.lock | 922 +++++++++--------- composerRequireChecker.json | 5 +- config/develop.php | 6 +- config/docker.php | 9 +- config/production.php | 6 +- docker/php/Dockerfile | 8 +- docs/CODE_OF_CONDUCT.md | 3 +- docs/ChangeLog.md | 6 +- phpcs.xml | 316 ++---- phpstan.neon | 3 +- src/Config.php | 56 +- src/Entities/DivisionEntity.php | 75 +- src/Exceptions/AbstractException.php | 6 +- .../Factories/AbstractFactoryException.php | 6 +- .../Factories/BadDateTimeException.php | 5 +- ...ntityFactoryUnrecognisedFieldException.php | 6 +- .../EntityFieldWrongTypeException.php | 6 +- .../EntityMissingRequiredFieldException.php | 6 +- .../MissingConfigurationException.php | 5 +- .../Providers/AbstractProviderException.php | 6 +- src/Exceptions/Providers/WikiFailedRegExp.php | 6 +- .../Services/AbstractServicesException.php | 6 +- .../Services/BadDatabaseReturnException.php | 6 +- src/Factories/DateTimeFactory.php | 14 +- src/Factories/DateTimeFactoryInterface.php | 8 +- src/Factories/EntityFactory.php | 204 ++-- src/Factories/EntityFactoryInterface.php | 10 +- src/Providers/CallableResolverProvider.php | 16 +- .../CallableResolverProviderInterface.php | 14 +- src/Providers/ControllerInvokerProvider.php | 17 +- src/Providers/DatabaseProvider.php | 42 +- src/Providers/DatabaseProviderInterface.php | 32 +- src/Providers/DebuggerProvider.php | 91 +- src/Providers/DebuggerProviderInterface.php | 20 +- src/Providers/DebuggerTwigExtension.php | 22 +- src/Providers/MailerProvider.php | 140 ++- src/Providers/MailerProviderInterface.php | 27 +- src/Providers/MailerTransportProvider.php | 98 ++ .../MailerTransportProviderInterface.php | 19 + src/Providers/TemplateProvider.php | 17 +- src/Providers/TemplateProviderInterface.php | 11 +- src/Providers/WikiParserProvider.php | 144 +-- src/Providers/WikiParserProviderInterface.php | 16 +- src/Services/DivisionService.php | 54 +- src/Services/DivisionServiceInterface.php | 14 +- src/Web.php | 61 +- src/Web/Controllers/DebugBarController.php | 2 +- src/Web/Controllers/DivisionController.php | 2 +- src/Web/Controllers/DocsController.php | 4 +- src/Web/Controllers/IndexController.php | 2 +- src/Web/Controllers/PingController.php | 23 +- src/Web/ErrorHandlers/ErrorHandler.php | 74 +- src/Web/ErrorHandlers/NotFoundHandler.php | 2 +- src/Web/ErrorHandlers/PhpErrorHandler.php | 77 +- src/Web/Routing.php | 91 +- .../Unit/Providers/WikiParserProviderTest.php | 36 +- .../Web/Controllers/PingControllerTest.php | 54 + tests/bootstrap.php | 2 +- v1migrationUtils/compare.php | 28 +- v1migrationUtils/divisionExtractorToTests.php | 48 +- v1migrationUtils/htmlMarkupToTests.php | 6 +- 74 files changed, 1799 insertions(+), 1530 deletions(-) create mode 100644 src/Providers/MailerTransportProvider.php create mode 100644 src/Providers/MailerTransportProviderInterface.php create mode 100644 tests/Unit/Web/Controllers/PingControllerTest.php diff --git a/.circleci/config.yml b/.circleci/config.yml index bdbef8f..80a6ed4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,10 @@ jobs: - run: sudo apt update - run: sudo docker-php-ext-install pdo_mysql + # check composer is in sync + - run: + name: Checking composer.lock + command: composer validate --no-check-all --strict # Download and cache dependencies - restore_cache: keys: diff --git a/.idea/PublicWhipV2.iml b/.idea/PublicWhipV2.iml index 4ba10b3..a4bcbe9 100644 --- a/.idea/PublicWhipV2.iml +++ b/.idea/PublicWhipV2.iml @@ -2,8 +2,9 @@ + - + @@ -14,14 +15,14 @@ + + + - - - @@ -49,10 +50,10 @@ + - @@ -64,6 +65,7 @@ + @@ -76,7 +78,6 @@ - @@ -111,12 +112,13 @@ + + - diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index d6fc450..546edc7 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -3,13 +3,14 @@