From 84f77efcbee319bdbf530bbb9cf73246e4d75e31 Mon Sep 17 00:00:00 2001 From: fedy95 Date: Sun, 31 Jan 2021 15:29:07 +0300 Subject: [PATCH] add-front --- README.md | 8 +- composer.json | 14 +- composer.lock | 1639 ++++++++++++++--- config/bundles.php | 2 + config/packages/dev/monolog.yaml | 11 + config/packages/prod/deprecations.yaml | 7 + config/packages/prod/monolog.yaml | 16 + config/packages/test/monolog.yaml | 12 + config/packages/test/twig.yaml | 2 + config/packages/twig.yaml | 2 + config/services.yaml | 1 + devops/dist/.env-dist | 2 +- devops/docker/.env | 4 +- devops/docker/php/Dockerfile | 4 +- devops/docker/redis/redis.conf | 1 - docker-compose.yaml | 29 +- src/Controller/IndexController.php | 42 +- src/Form/WeatherFormType.php | 24 + src/Service/Endpoint/WeatherHistory.php | 57 + .../Endpoint/WeatherHistoryInterface.php | 14 + symfony.lock | 59 + templates/base.html.twig | 66 + tests/_support/ApiTester.php | 10 - tests/_support/Helper/Api.php | 9 - tests/acceptance.suite.yml | 2 +- .../Controller/IndexControllerCest.php | 60 + .../Controller/PageControllerCest.php | 23 - tests/api.suite.yml | 8 - tests/api/Controller/PageControllerCest.php | 36 - 29 files changed, 1740 insertions(+), 424 deletions(-) create mode 100644 config/packages/dev/monolog.yaml create mode 100644 config/packages/prod/deprecations.yaml create mode 100644 config/packages/prod/monolog.yaml create mode 100644 config/packages/test/monolog.yaml create mode 100644 config/packages/test/twig.yaml create mode 100644 config/packages/twig.yaml delete mode 100644 devops/docker/redis/redis.conf create mode 100644 src/Form/WeatherFormType.php create mode 100644 src/Service/Endpoint/WeatherHistory.php create mode 100644 src/Service/Endpoint/WeatherHistoryInterface.php create mode 100644 templates/base.html.twig delete mode 100644 tests/_support/ApiTester.php delete mode 100644 tests/_support/Helper/Api.php create mode 100644 tests/acceptance/Controller/IndexControllerCest.php delete mode 100644 tests/acceptance/Controller/PageControllerCest.php delete mode 100644 tests/api.suite.yml delete mode 100644 tests/api/Controller/PageControllerCest.php diff --git a/README.md b/README.md index db0dcf2..b24bf3f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ -# symfony-5-cli-template +# weather_site -Template repo "pure-skeleton" with symfony 5.2. Includes: -- local devops via docker-compose and make -- codeception support with acceptance/api/unit-testing -- php/yaml linters -- php/composer code style fixers +Front for a weather_history project ### Requirements diff --git a/composer.json b/composer.json index 3fd251d..e36e4e0 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,14 @@ "ext-apcu": "5.1.*", "ext-ctype": "7.4.*", "ext-iconv": "7.4.*", + "ext-json": "*", "symfony/console": "5.2.*", "symfony/dotenv": "5.2.*", "symfony/flex": "^1.3.1", + "symfony/form": "5.2.*", "symfony/framework-bundle": "5.2.*", + "symfony/monolog-bundle": "^3.6", + "symfony/twig-bundle": "5.2.*", "symfony/yaml": "5.2.*" }, "replace": { @@ -82,10 +86,8 @@ "parallel-lint --no-progress --no-colors --blame ./src", "parallel-lint --no-progress --no-colors --blame ./tests/_support/Helper", "parallel-lint --no-progress --no-colors --blame ./tests/_support/AcceptanceTester.php", - "parallel-lint --no-progress --no-colors --blame ./tests/_support/ApiTester.php", "parallel-lint --no-progress --no-colors --blame ./tests/_support/UnitTester.php", "parallel-lint --no-progress --no-colors --blame ./tests/acceptance", - "parallel-lint --no-progress --no-colors --blame ./tests/api", "parallel-lint --no-progress --no-colors --blame ./tests/unit", "parallel-lint --no-progress --no-colors --blame ./.php_cs" ], @@ -95,7 +97,6 @@ "bin/console --quiet --no-debug l:yaml ./config/routes.yaml", "bin/console --quiet --no-debug l:yaml ./config/services.yaml", "bin/console --quiet --no-debug l:yaml ./tests/acceptance.suite.yml", - "bin/console --quiet --no-debug l:yaml ./tests/api.suite.yml", "bin/console --quiet --no-debug l:yaml ./tests/codeception.yml", "bin/console --quiet --no-debug l:yaml ./tests/unit.suite.yml" ], @@ -107,10 +108,8 @@ "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache src", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/Helper", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/AcceptanceTester.php", - "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/ApiTester.php", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/_support/UnitTester.php", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/acceptance", - "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/api", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache tests/unit", "php vendor/bin/php-cs-fixer fix --cache-file=var/php-cs-fixer/.php-cs.cache .php_cs" ], @@ -121,17 +120,12 @@ "@lint:container", "@php-cs-fix", "@test:unit", - "@test:api", "@test:acceptance" ], "test:acceptance": [ "@codecept build -q", "@codecept run acceptance" ], - "test:api": [ - "@codecept build -q", - "@codecept run api" - ], "test:unit": [ "@codecept build -q", "@codecept run unit --no-rebuild --coverage-html --coverage-text --no-colors" diff --git a/composer.lock b/composer.lock index 940fed2..eaff6b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,104 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6a8bd6e7067476da729289b79de15fc5", + "content-hash": "36d66eb90e9689f33129535cb83a1b0f", "packages": [ + { + "name": "monolog/monolog", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7", + "graylog2/gelf-php": "^1.4.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", + "ruflin/elastica": ">=0.90 <7.0.1", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2020-12-14T13:15:25+00:00" + }, { "name": "psr/cache", "version": "1.0.1", @@ -1205,6 +1301,107 @@ ], "time": "2020-12-03T10:57:35+00:00" }, + { + "name": "symfony/form", + "version": "v5.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/form.git", + "reference": "b9fc4092f5c138ec89604ee5faa9cb0c12e2b601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/form/zipball/b9fc4092f5c138ec89604ee5faa9cb0c12e2b601", + "reference": "b9fc4092f5c138ec89604ee5faa9cb0c12e2b601", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/intl": "^4.4|^5.0", + "symfony/options-resolver": "^5.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.15", + "symfony/property-access": "^5.0.8", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<4.4", + "symfony/doctrine-bridge": "<4.4", + "symfony/error-handler": "<4.4.5", + "symfony/framework-bundle": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/intl": "<4.4", + "symfony/translation": "<4.4", + "symfony/translation-contracts": "<1.1.7", + "symfony/twig-bridge": "<4.4" + }, + "require-dev": { + "doctrine/collections": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/console": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/security-csrf": "^4.4|^5.0", + "symfony/translation": "^4.4|^5.0", + "symfony/validator": "^4.4.17|^5.1.9", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "symfony/security-csrf": "For protecting forms against CSRF attacks.", + "symfony/twig-bridge": "For templating with Twig.", + "symfony/validator": "For form validation." + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Form\\": "" + }, + "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": "Allows to easily create, process and reuse HTML forms", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/form/tree/v5.2.2" + }, + "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": "2021-01-27T12:56:27+00:00" + }, { "name": "symfony/framework-bundle", "version": "v5.2.2", @@ -1618,41 +1815,40 @@ "time": "2021-01-27T14:45:46+00:00" }, { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.0", + "name": "symfony/intl", + "version": "v5.2.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" + "url": "https://github.com/symfony/intl.git", + "reference": "930f17689729cc47d2ce18be21ed403bcbeeb6a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", + "url": "https://api.github.com/repos/symfony/intl/zipball/930f17689729cc47d2ce18be21ed403bcbeeb6a9", + "reference": "930f17689729cc47d2ce18be21ed403bcbeeb6a9", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "symfony/filesystem": "^4.4|^5.0" }, "suggest": { - "ext-intl": "For best performance" + "ext-intl": "to use the component with locales other than \"en\"" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + "Symfony\\Component\\Intl\\": "" }, - "files": [ - "bootstrap.php" + "classmap": [ + "Resources/stubs" + ], + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1661,26 +1857,34 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Eriksen Costa", + "email": "eriksen.costa@infranology.com.br" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's grapheme_* functions", + "description": "Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "grapheme", + "i18n", + "icu", + "internationalization", "intl", - "polyfill", - "portable", - "shim" + "l10n", + "localization" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.0" + "source": "https://github.com/symfony/intl/tree/v5.2.2" }, "funding": [ { @@ -1696,47 +1900,53 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-27T10:01:46+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.0", + "name": "symfony/monolog-bridge", + "version": "v5.2.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba" + "url": "https://github.com/symfony/monolog-bridge.git", + "reference": "aca99c4135001224b917eed17cc846e8c0ba981c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/aca99c4135001224b917eed17cc846e8c0ba981c", + "reference": "aca99c4135001224b917eed17cc846e8c0ba981c", "shasum": "" }, "require": { - "php": ">=7.1" + "monolog/monolog": "^1.25.1|^2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2" }, - "suggest": { - "ext-intl": "For best performance" + "conflict": { + "symfony/console": "<4.4", + "symfony/http-foundation": "<4.4" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "symfony/console": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/mailer": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0", + "symfony/security-core": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", + "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." }, + "type": "symfony-bridge", "autoload": { "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "Symfony\\Bridge\\Monolog\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1745,26 +1955,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.0" + "source": "https://github.com/symfony/monolog-bridge/tree/v5.2.2" }, "funding": [ { @@ -1780,44 +1982,194 @@ "type": "tidelift" } ], - "time": "2021-01-07T17:09:11+00:00" + "time": "2021-01-27T11:24:50+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.22.0", + "name": "symfony/monolog-bundle", + "version": "v3.6.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" + "url": "https://github.com/symfony/monolog-bundle.git", + "reference": "e495f5c7e4e672ffef4357d4a4d85f010802f940" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/e495f5c7e4e672ffef4357d4a4d85f010802f940", + "reference": "e495f5c7e4e672ffef4357d4a4d85f010802f940", "shasum": "" }, "require": { - "php": ">=7.1" + "monolog/monolog": "~1.22 || ~2.0", + "php": ">=5.6", + "symfony/config": "~3.4 || ~4.0 || ^5.0", + "symfony/dependency-injection": "~3.4.10 || ^4.0.10 || ^5.0", + "symfony/http-kernel": "~3.4 || ~4.0 || ^5.0", + "symfony/monolog-bridge": "~3.4 || ~4.0 || ^5.0" }, - "suggest": { - "ext-mbstring": "For best performance" + "require-dev": { + "symfony/console": "~3.4 || ~4.0 || ^5.0", + "symfony/phpunit-bridge": "^4.4 || ^5.0", + "symfony/yaml": "~3.4 || ~4.0 || ^5.0" }, - "type": "library", + "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Bundle\\MonologBundle\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony MonologBundle", + "homepage": "http://symfony.com", + "keywords": [ + "log", + "logging" + ], + "support": { + "issues": "https://github.com/symfony/monolog-bundle/issues", + "source": "https://github.com/symfony/monolog-bundle/tree/v3.6.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": "2020-10-06T15:12:11+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", + "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "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/v5.2.2" + }, + "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": "2021-01-27T12:56:27+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.22.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", + "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1834,17 +2186,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "grapheme", + "intl", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.0" }, "funding": [ { @@ -1863,22 +2216,25 @@ "time": "2021-01-07T16:49:33+00:00" }, { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-intl-icu", "version": "v1.22.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "url": "https://github.com/symfony/polyfill-intl-icu.git", + "reference": "b2b1e732a6c039f1a3ea3414b3379a2433e183d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/b2b1e732a6c039f1a3ea3414b3379a2433e183d6", + "reference": "b2b1e732a6c039f1a3ea3414b3379a2433e183d6", "shasum": "" }, "require": { "php": ">=7.1" }, + "suggest": { + "ext-intl": "For best performance and support of other locales than \"en\"" + }, "type": "library", "extra": { "branch-alias": { @@ -1890,14 +2246,17 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Icu\\": "" + }, "classmap": [ "Resources/stubs" + ], + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1914,16 +2273,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill for intl's ICU-related data and classes", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "icu", + "intl", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.22.0" }, "funding": [ { @@ -1942,22 +2303,25 @@ "time": "2021-01-07T16:49:33+00:00" }, { - "name": "symfony/polyfill-php80", + "name": "symfony/polyfill-intl-normalizer", "version": "v1.22.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "6e971c891537eb617a00bb07a43d182a6915faba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba", + "reference": "6e971c891537eb617a00bb07a43d182a6915faba", "shasum": "" }, "require": { "php": ">=7.1" }, + "suggest": { + "ext-intl": "For best performance" + }, "type": "library", "extra": { "branch-alias": { @@ -1970,7 +2334,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, "files": [ "bootstrap.php" @@ -1984,10 +2348,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -1997,16 +2357,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "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-php80/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.0" }, "funding": [ { @@ -2022,55 +2384,44 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-07T17:09:11+00:00" }, { - "name": "symfony/routing", - "version": "v5.2.2", + "name": "symfony/polyfill-mbstring", + "version": "v1.22.0", "source": { "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/348b5917e56546c6d96adbf21d7f92c9ef563661", - "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php80": "^1.15" - }, - "conflict": { - "symfony/config": "<5.0", - "symfony/dependency-injection": "<4.4", - "symfony/yaml": "<4.4" - }, - "require-dev": { - "doctrine/annotations": "^1.10.4", - "psr/log": "~1.0", - "symfony/config": "^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/http-foundation": "^4.4|^5.0", - "symfony/yaml": "^4.4|^5.0" + "php": ">=7.1" }, "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" + "ext-mbstring": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Routing\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2079,24 +2430,688 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "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.22.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": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.22.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.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": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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.22.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": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/property-access", + "version": "v5.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "3af8ed262bd3217512a13b023981fe68f36ad5f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/3af8ed262bd3217512a13b023981fe68f36ad5f3", + "reference": "3af8ed262bd3217512a13b023981fe68f36ad5f3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15", + "symfony/property-info": "^5.2" + }, + "require-dev": { + "symfony/cache": "^4.4|^5.0" + }, + "suggest": { + "psr/cache-implementation": "To cache access methods." + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyAccess\\": "" + }, + "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 functions to read and write from/to an object or array using a simple string notation", + "homepage": "https://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "support": { + "source": "https://github.com/symfony/property-access/tree/v5.2.2" + }, + "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": "2021-01-27T10:15:41+00:00" + }, + { + "name": "symfony/property-info", + "version": "v5.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-info.git", + "reference": "4e4f368c3737b1c175d66f4fc0b99a5bcd161a77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-info/zipball/4e4f368c3737b1c175d66f4fc0b99a5bcd161a77", + "reference": "4e4f368c3737b1c175d66f4fc0b99a5bcd161a77", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15", + "symfony/string": "^5.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/dependency-injection": "<4.4" + }, + "require-dev": { + "doctrine/annotations": "^1.10.4", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/cache": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/serializer": "^4.4|^5.0" + }, + "suggest": { + "phpdocumentor/reflection-docblock": "To use the PHPDoc", + "psr/cache-implementation": "To cache results", + "symfony/doctrine-bridge": "To use Doctrine metadata", + "symfony/serializer": "To use Serializer metadata" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyInfo\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Extracts information about PHP class' properties using metadata of popular sources", + "homepage": "https://symfony.com", + "keywords": [ + "doctrine", + "phpdoc", + "property", + "symfony", + "type", + "validator" + ], + "support": { + "source": "https://github.com/symfony/property-info/tree/v5.2.2" + }, + "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": "2021-01-27T10:15:41+00:00" + }, + { + "name": "symfony/routing", + "version": "v5.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/348b5917e56546c6d96adbf21d7f92c9ef563661", + "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/config": "<5.0", + "symfony/dependency-injection": "<4.4", + "symfony/yaml": "<4.4" + }, + "require-dev": { + "doctrine/annotations": "^1.10.4", + "psr/log": "~1.0", + "symfony/config": "^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/yaml": "^4.4|^5.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "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": "Maps an HTTP request to a set of configuration variables", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "support": { + "source": "https://github.com/symfony/routing/tree/v5.2.2" + }, + "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": "2021-01-27T10:15:41+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "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/master" + }, + "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": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/string", + "version": "v5.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "c95468897f408dd0aca2ff582074423dd0455122" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", + "reference": "c95468897f408dd0aca2ff582074423dd0455122", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "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/v5.2.2" + }, + "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": "2021-01-25T15:14:59+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105", + "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "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": "Maps an HTTP request to a set of configuration variables", + "description": "Generic abstractions related to translation", "homepage": "https://symfony.com", "keywords": [ - "router", - "routing", - "uri", - "url" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.2.2" + "source": "https://github.com/symfony/translation-contracts/tree/v2.3.0" }, "funding": [ { @@ -2112,43 +3127,91 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2020-09-28T13:05:58+00:00" }, { - "name": "symfony/service-contracts", - "version": "v2.2.0", + "name": "symfony/twig-bridge", + "version": "v5.2.2", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "url": "https://github.com/symfony/twig-bridge.git", + "reference": "5618cadebf28dff5c375f6c3c8e6f1d52df397e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/5618cadebf28dff5c375f6c3c8e6f1d52df397e1", + "reference": "5618cadebf28dff5c375f6c3c8e6f1d52df397e1", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.0" + "symfony/polyfill-php80": "^1.15", + "symfony/translation-contracts": "^1.1|^2", + "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "symfony/service-implementation": "" + "conflict": { + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/console": "<4.4", + "symfony/form": "<5.1", + "symfony/http-foundation": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/translation": "<5.2", + "symfony/workflow": "<5.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } + "require-dev": { + "egulias/email-validator": "^2.1.10", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/asset": "^4.4|^5.0", + "symfony/console": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/form": "^5.1.9", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/mime": "^5.2", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/property-info": "^4.4|^5.1", + "symfony/routing": "^4.4|^5.0", + "symfony/security-acl": "^2.8|^3.0", + "symfony/security-core": "^4.4|^5.0", + "symfony/security-csrf": "^4.4|^5.0", + "symfony/security-http": "^4.4|^5.0", + "symfony/serializer": "^5.2", + "symfony/stopwatch": "^4.4|^5.0", + "symfony/translation": "^5.2", + "symfony/web-link": "^4.4|^5.0", + "symfony/workflow": "^5.2", + "symfony/yaml": "^4.4|^5.0", + "twig/cssinliner-extra": "^2.12", + "twig/inky-extra": "^2.12", + "twig/markdown-extra": "^2.12" }, + "suggest": { + "symfony/asset": "For using the AssetExtension", + "symfony/expression-language": "For using the ExpressionExtension", + "symfony/finder": "", + "symfony/form": "For using the FormExtension", + "symfony/http-kernel": "For using the HttpKernelExtension", + "symfony/routing": "For using the RoutingExtension", + "symfony/security-core": "For using the SecurityExtension", + "symfony/security-csrf": "For using the CsrfExtension", + "symfony/security-http": "For using the LogoutUrlExtension", + "symfony/stopwatch": "For using the StopwatchExtension", + "symfony/translation": "For using the TranslationExtension", + "symfony/var-dumper": "For using the DumpExtension", + "symfony/web-link": "For using the WebLinkExtension", + "symfony/yaml": "For using the YamlExtension" + }, + "type": "symfony-bridge", "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } + "Symfony\\Bridge\\Twig\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2156,26 +3219,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to writing services", + "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/master" + "source": "https://github.com/symfony/twig-bridge/tree/v5.2.2" }, "funding": [ { @@ -2191,44 +3246,56 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-01-27T10:15:41+00:00" }, { - "name": "symfony/string", + "name": "symfony/twig-bundle", "version": "v5.2.2", "source": { "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "c95468897f408dd0aca2ff582074423dd0455122" + "url": "https://github.com/symfony/twig-bundle.git", + "reference": "5ebbb5f0e8bfaa0b4b37cb25ff97f83b18caf221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", - "reference": "c95468897f408dd0aca2ff582074423dd0455122", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/5ebbb5f0e8bfaa0b4b37cb25ff97f83b18caf221", + "reference": "5ebbb5f0e8bfaa0b4b37cb25ff97f83b18caf221", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/config": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/http-kernel": "^5.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/twig-bridge": "^5.0", + "twig/twig": "^2.13|^3.0.4" + }, + "conflict": { + "symfony/dependency-injection": "<5.2", + "symfony/framework-bundle": "<5.0", + "symfony/translation": "<5.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" + "doctrine/annotations": "^1.10.4", + "doctrine/cache": "~1.0", + "symfony/asset": "^4.4|^5.0", + "symfony/dependency-injection": "^5.2", + "symfony/expression-language": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/form": "^4.4|^5.0", + "symfony/framework-bundle": "^5.0", + "symfony/routing": "^4.4|^5.0", + "symfony/stopwatch": "^4.4|^5.0", + "symfony/translation": "^5.0", + "symfony/web-link": "^4.4|^5.0", + "symfony/yaml": "^4.4|^5.0" }, - "type": "library", + "type": "symfony-bundle", "autoload": { "psr-4": { - "Symfony\\Component\\String\\": "" + "Symfony\\Bundle\\TwigBundle\\": "" }, - "files": [ - "Resources/functions.php" - ], "exclude-from-classmap": [ "/Tests/" ] @@ -2239,26 +3306,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.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", + "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.2" + "source": "https://github.com/symfony/twig-bundle/tree/v5.2.2" }, "funding": [ { @@ -2274,7 +3333,7 @@ "type": "tidelift" } ], - "time": "2021-01-25T15:14:59+00:00" + "time": "2021-01-27T10:15:41+00:00" }, { "name": "symfony/var-dumper", @@ -2511,6 +3570,82 @@ } ], "time": "2021-01-27T10:01:46+00:00" + }, + { + "name": "twig/twig", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "f795ca686d38530045859b0350b5352f7d63447d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/f795ca686d38530045859b0350b5352f7d63447d", + "reference": "f795ca686d38530045859b0350b5352f7d63447d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.2.1" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2021-01-05T15:40:36+00:00" } ], "packages-dev": [ @@ -6788,75 +7923,6 @@ ], "time": "2021-01-27T10:01:46+00:00" }, - { - "name": "symfony/options-resolver", - "version": "v5.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.15" - }, - "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/v5.2.2" - }, - "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": "2021-01-27T12:56:27+00:00" - }, { "name": "symfony/polyfill-php70", "version": "v1.20.0", @@ -7164,7 +8230,8 @@ "php": "7.4.*", "ext-apcu": "5.1.*", "ext-ctype": "7.4.*", - "ext-iconv": "7.4.*" + "ext-iconv": "7.4.*", + "ext-json": "*" }, "platform-dev": [], "plugin-api-version": "2.0.0" diff --git a/config/bundles.php b/config/bundles.php index 49d3fb6..af69a2d 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -2,4 +2,6 @@ return [ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], + Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], ]; diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml new file mode 100644 index 0000000..7155458 --- /dev/null +++ b/config/packages/dev/monolog.yaml @@ -0,0 +1,11 @@ +monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] diff --git a/config/packages/prod/deprecations.yaml b/config/packages/prod/deprecations.yaml new file mode 100644 index 0000000..5639f57 --- /dev/null +++ b/config/packages/prod/deprecations.yaml @@ -0,0 +1,7 @@ +monolog: + channels: [deprecation] + handlers: + deprecation: + type: stream + channels: [deprecation] + path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log" diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml new file mode 100644 index 0000000..e466c24 --- /dev/null +++ b/config/packages/prod/monolog.yaml @@ -0,0 +1,16 @@ +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + buffer_size: 50 + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine"] diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml new file mode 100644 index 0000000..fc40641 --- /dev/null +++ b/config/packages/test/monolog.yaml @@ -0,0 +1,12 @@ +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + channels: ["!event"] + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug diff --git a/config/packages/test/twig.yaml b/config/packages/test/twig.yaml new file mode 100644 index 0000000..8c6e0b4 --- /dev/null +++ b/config/packages/test/twig.yaml @@ -0,0 +1,2 @@ +twig: + strict_variables: true diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml new file mode 100644 index 0000000..b3cdf30 --- /dev/null +++ b/config/packages/twig.yaml @@ -0,0 +1,2 @@ +twig: + default_path: '%kernel.project_dir%/templates' diff --git a/config/services.yaml b/config/services.yaml index 2755ee4..d67917d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -1,4 +1,5 @@ parameters: + weather_history_server: '%env(string:WEATHER_HISTORY_SERVER)%' services: _defaults: diff --git a/devops/dist/.env-dist b/devops/dist/.env-dist index d71cae4..e3300e5 100644 --- a/devops/dist/.env-dist +++ b/devops/dist/.env-dist @@ -1,4 +1,4 @@ APP_ENV=dev APP_SECRET=a1def1573d162b7d97ed994df9d37949 -DATABASE_URL=mysql://root:rootroot@mysql:3306/template?serverVersion=5.7 +WEATHER_HISTORY_SERVER=http://weather_history_nginx_1:80 diff --git a/devops/docker/.env b/devops/docker/.env index d24384d..10b43eb 100644 --- a/devops/docker/.env +++ b/devops/docker/.env @@ -1,5 +1,5 @@ -COMPOSE_PROJECT_NAME=template -PROJECT_ID=001 +COMPOSE_PROJECT_NAME=weather_site +PROJECT_ID=003 COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 diff --git a/devops/docker/php/Dockerfile b/devops/docker/php/Dockerfile index 83ab388..60f03b8 100644 --- a/devops/docker/php/Dockerfile +++ b/devops/docker/php/Dockerfile @@ -15,9 +15,7 @@ RUN docker-php-ext-install zip RUN apt-get install -y git RUN docker-php-ext-install \ - pcntl \ - mysqli \ - pdo_mysql + pcntl # APCU RUN pecl install apcu-5.1.17 && docker-php-ext-enable apcu diff --git a/devops/docker/redis/redis.conf b/devops/docker/redis/redis.conf deleted file mode 100644 index c920e89..0000000 --- a/devops/docker/redis/redis.conf +++ /dev/null @@ -1 +0,0 @@ -bind 0.0.0.0 \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 171ff05..669d809 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,24 +1,10 @@ version: "3" -services: - mysql: - image: mysql:5.7 - restart: on-failure +networks: + weather_history_gate: + external: true - environment: - MYSQL_USER: ${MYSQL_USER} - MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD} - MYSQL_PASSWORD: ${MYSQL_PASSWORD} - MYSQL_DATABASE: ${COMPOSE_PROJECT_NAME} - ports: - - "3$PROJECT_ID:3306" - redis: - image: redis:6.0.10-alpine - volumes: - - ./devops/docker/redis/redis.conf:/redis.conf - command: [ "redis-server", "/redis.conf" ] - ports: - - "6$PROJECT_ID:6379" +services: php: build: context: devops/docker/php @@ -28,9 +14,6 @@ services: UID: "$UID" GID: "$GID" restart: unless-stopped - depends_on: - - mysql - - redis environment: - COMPOSER_MEMORY_LIMIT=-1 - PHP_IDE_CONFIG=serverName=${COMPOSE_PROJECT_NAME} @@ -42,6 +25,8 @@ services: - ${HOME}/.ssh:${HOME}/.ssh expose: - "9000" + networks: + - weather_history_gate nginx: image: nginx:1.19 restart: unless-stopped @@ -52,3 +37,5 @@ services: - ./devops/docker/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf ports: - "8$PROJECT_ID:80" + networks: + - weather_history_gate \ No newline at end of file diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 926a02a..9982ada 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -4,19 +4,47 @@ declare(strict_types=1); namespace App\Controller; -use Symfony\Component\HttpFoundation\JsonResponse; +use App\Form\WeatherFormType; +use App\Service\Endpoint\WeatherHistoryInterface; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; -class IndexController +class IndexController extends AbstractController { + private WeatherHistoryInterface $weatherHistory; + + public function __construct(WeatherHistoryInterface $weatherHistory) + { + $this->weatherHistory = $weatherHistory; + } + /** * @Route("/", name="index.any") */ - public function index(): JsonResponse + public function index(Request $request): \Symfony\Component\HttpFoundation\Response { - return new JsonResponse( - JsonResponse::$statusTexts[JsonResponse::HTTP_BAD_REQUEST], - JsonResponse::HTTP_BAD_REQUEST - ); + $weatherForm = null; + $weather = null; + $history = null; + + try { + $form = $this->createForm(WeatherFormType::class); + $form->handleRequest($request); + $weatherForm = $form->createView(); + + if ($form->isSubmitted() && $form->isValid()) { + $weather = $this->weatherHistory->getByDate($form->getData()['date']); + } + + $history = $this->weatherHistory->getHistory(); + } catch (\Exception $e) { + } finally { + return $this->render('base.html.twig', [ + 'weatherForm' => $weatherForm, + 'weather' => $weather, + 'history' => $history, + ]); + } } } diff --git a/src/Form/WeatherFormType.php b/src/Form/WeatherFormType.php new file mode 100644 index 0000000..eefd11b --- /dev/null +++ b/src/Form/WeatherFormType.php @@ -0,0 +1,24 @@ +add('date', DateType::class, [ + 'widget' => 'single_text', + 'format' => 'yyyy-MM-dd', + ]) + ->add('send', SubmitType::class) + ; + } +} diff --git a/src/Service/Endpoint/WeatherHistory.php b/src/Service/Endpoint/WeatherHistory.php new file mode 100644 index 0000000..1f20938 --- /dev/null +++ b/src/Service/Endpoint/WeatherHistory.php @@ -0,0 +1,57 @@ +client = new Client(); + + $this->weatherHistoryServer = $parameterBag->get('weather_history_server'); + } + + public function getByDate(DateTime $date): array + { + $url = sprintf('%s/json-rpc', $this->weatherHistoryServer); + $response = $this->client->request('POST', $url, [ + 'headers' => [ + 'Accept-Encoding' => 'gzip', + 'Content-Type' => 'text/plain', + ], + 'body' => sprintf( + '{"jsonrpc": "2.0", "method": "weather.getByDate", "params": {"date": "%s"}, "id": 1}', + $date->format('Y-m-d') + ), + ]); + + return json_decode($response->getBody()->getContents(), true); + } + + public function getHistory(int $numberOfDays = 30): array + { + $url = sprintf('%s/json-rpc', $this->weatherHistoryServer); + $response = $this->client->request('POST', $url, [ + 'headers' => [ + 'Accept-Encoding' => 'gzip', + 'Content-Type' => 'text/plain', + ], + 'body' => sprintf( + '{"jsonrpc": "2.0", "method": "weather.getHistory", "params": {"lastDays": %d}, "id": 1}', + $numberOfDays + ), + ]); + + return json_decode($response->getBody()->getContents(), true); + } +} diff --git a/src/Service/Endpoint/WeatherHistoryInterface.php b/src/Service/Endpoint/WeatherHistoryInterface.php new file mode 100644 index 0000000..2d488e9 --- /dev/null +++ b/src/Service/Endpoint/WeatherHistoryInterface.php @@ -0,0 +1,14 @@ + + + + + {% block title %}Welcome!{% endblock %} + {% block stylesheets %}{% endblock %} + + {% block javascripts %}{% endblock %} + + + {% block body %} + {% if weatherForm is defined and weatherForm %} +

Погода за день

+ + {{ form_errors(weatherForm) }} + {{ form_start(weatherForm) }} + {{ form_widget(weatherForm) }} + {{ form_end(weatherForm) }} + + {% if weather.error.code is defined and weather.error.code + and weather.error.message is defined and weather.error.message + %} +

{{ weather.error.code }} {{ weather.error.message }}.

+ {% else %} + {% if weather.result.temp is defined and weather.result.temp %} +

Температура {{ weather.result.temp }} градусов

+ {% else %} +

Температура за указанный день не указана

+ {% endif %} + {% endif %} + {% endif %} + + {% if history is defined and history %} +

Погода за последние 30 дней

+ {% if history.error.code is defined and history.error.code + and history.error.message is defined and history.error.message + %} +

{{ history.error.code }} {{ history.error.message }}

+ {% else %} + {% if history.result is defined and history.result %} + + + + + + {% for element in history.result %} + + + + + {% endfor %} +
ДатаТемпература
+ {% if element.date_at is defined and element.date_at %} + {{ element.date_at }} + {% endif %} + + {% if element.temp is defined and element.temp %} + {{ element.temp }} + {% endif %} +
+ {% endif %} + {% endif %} + {% endif %} + {% endblock %} + + diff --git a/tests/_support/ApiTester.php b/tests/_support/ApiTester.php deleted file mode 100644 index 5cfb808..0000000 --- a/tests/_support/ApiTester.php +++ /dev/null @@ -1,10 +0,0 @@ -tester = $tester; + } + + public function testBaseAvailability(): void + { + $this->tester->amOnPage('/'); + $this->tester->seeResponseCodeIs(200); + } + + /** + * @dataProvider dataDateForm + */ + public function testDateForm(Example $example): void + { + $this->tester->amOnPage('/'); + $this->tester->fillField("//input[@id='weather_form_date']", $example['fillField']); + $this->tester->click('Send'); + $this->tester->seeCurrentUrlEquals('/'); + $this->tester->seeResponseCodeIs(200); + $this->tester->see($example['see']); + } + + protected function dataDateForm(): array + { + return [ + [ + 'fillField' => (new DateTime())->format('Y-m-d'), + 'see' => 'градусов', + ], + [ + 'fillField' => '9999-01-01', + 'see' => 'Температура за указанный день не указана', + ], + ]; + } + + public function testWeatherTable(): void + { + $this->tester->amOnPage('/'); + $this->tester->see('Погода за последние 30 дней'); + $this->tester->see('Дата', '//th'); + $this->tester->see('Температура', '//th'); + } +} diff --git a/tests/acceptance/Controller/PageControllerCest.php b/tests/acceptance/Controller/PageControllerCest.php deleted file mode 100644 index 3f1bdb1..0000000 --- a/tests/acceptance/Controller/PageControllerCest.php +++ /dev/null @@ -1,23 +0,0 @@ -tester = $tester; - } - - public function testBaseAvailability(): void - { - $this->tester->amOnPage('/'); - $this->tester->seeResponseCodeIs(400); - } -} diff --git a/tests/api.suite.yml b/tests/api.suite.yml deleted file mode 100644 index f47d860..0000000 --- a/tests/api.suite.yml +++ /dev/null @@ -1,8 +0,0 @@ -actor: ApiTester -modules: - enabled: - - REST: - url: http://nginx/ - depends: PhpBrowser - part: Json - - \App\Tests\Helper\Api diff --git a/tests/api/Controller/PageControllerCest.php b/tests/api/Controller/PageControllerCest.php deleted file mode 100644 index 531c827..0000000 --- a/tests/api/Controller/PageControllerCest.php +++ /dev/null @@ -1,36 +0,0 @@ -tester = $tester; - } - - /** - * @dataProvider dataTestBaseAvailability - */ - public function testBaseAvailability(Example $example): void - { - $this->tester->sendGet($example['url']); - $this->tester->seeResponseCodeIs(400); - $this->tester->seeResponseIsJson(); - } - - protected static function dataTestBaseAvailability(): Iterator - { - yield [ - 'url' => '/', - ]; - } -}