From 2f9c13df49981fcaf329118daf401d751b3c240a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Wed, 27 Mar 2024 20:34:48 +0700 Subject: [PATCH 01/11] experiment: add tests for /modules/miguel/orders.php --- tests/Unit/OrdersTest.php | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/Unit/OrdersTest.php diff --git a/tests/Unit/OrdersTest.php b/tests/Unit/OrdersTest.php new file mode 100644 index 0000000..42705d3 --- /dev/null +++ b/tests/Unit/OrdersTest.php @@ -0,0 +1,44 @@ + + * @copyright 2022 - 2024 Servantes + * @license LICENSE.txt + */ + +namespace Tests\Unit; + +use GuzzleHttp\Client; + +final class OrdersTest extends \DatabaseTestCase +{ + private $client; + + protected function setUp(): void + { + parent::setUp(); + + $this->client = new Client([ + 'base_uri' => 'http://localhost:8000/modules/miguel/', + 'request.options' => [ + 'exceptions' => false, + ], + ]); + } + + public function testRequest() + { + // make a request to our API + $response = $this->client->request('GET', 'orders.php'); + + // check if the response is OK + $this->assertEquals(200, $response->getStatusCode()); + } +} From bc34fac48fd20ea6d48928efad7cf87af20f8b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Wed, 27 Mar 2024 22:17:44 +0700 Subject: [PATCH 02/11] experiment: add autoload + namespace --- .github/scripts/build-zip.sh | 2 +- .github/workflows/php_tests.yml | 15 ++++++++++ composer.json | 3 ++ composer.lock | 2 +- miguel.php | 8 +++--- order-state-callback.php | 3 ++ orders.php | 46 ------------------------------- products.php | 2 ++ src/api/index.php | 23 ++++++++++++++++ src/api/orders.php | 44 +++++++++++++++++++++++++++++ src/utils/miguel-api-error.php | 5 +++- src/utils/miguel-api-response.php | 5 +++- src/utils/miguel-settings.php | 31 +++++++++++---------- tests/Unit/DatabaseTestCase.php | 2 ++ tests/Unit/MiguelTest.php | 6 ++-- tests/Unit/OrdersTest.php | 2 +- tests/Unit/bootstrap.php | 4 ++- tests/phpstan/phpstan.neon | 1 - upgrade/upgrade-1.0.1.php | 2 ++ 19 files changed, 133 insertions(+), 73 deletions(-) delete mode 100644 orders.php create mode 100644 src/api/index.php create mode 100644 src/api/orders.php diff --git a/.github/scripts/build-zip.sh b/.github/scripts/build-zip.sh index 5d23de8..7733620 100644 --- a/.github/scripts/build-zip.sh +++ b/.github/scripts/build-zip.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash tmpdir=$(mktemp -d) -ignore=".git .github .idea .vscode .gitignore .php-cs-fixer.dist.php .php-cs-fixer.cache composer.* tests run doc vendor vendor2 docker-compose.yml docker-compose.test.yml Makefile *.zip" +ignore=".git .github .idea .vscode .gitignore .php-cs-fixer.dist.php .php-cs-fixer.cache composer.lock tests run doc vendor vendor2 docker-compose.yml docker-compose.test.yml Makefile *.zip" result="$(PWD)/miguel.zip" rm -rf "$result" diff --git a/.github/workflows/php_tests.yml b/.github/workflows/php_tests.yml index 4a5cd0d..531b353 100644 --- a/.github/workflows/php_tests.yml +++ b/.github/workflows/php_tests.yml @@ -158,6 +158,21 @@ jobs: tools: composer:v2, phpunit:${{ matrix.phpunit-version }} extensions: gd, mbstring, zip, mcrypt, pdo_mysql, dom + - name: Cache vendor folder + uses: actions/cache@v4 + with: + path: vendor + key: php-${{ hashFiles('composer.lock') }} + + - name: Cache composer folder + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: php-composer-cache + + - name: Composer install + run: composer install --prefer-dist --no-progress --no-ansi --no-interaction + - name: Test MySQL Connection uses: nick-fields/retry@v3 with: diff --git a/composer.json b/composer.json index c8aafff..1bde048 100644 --- a/composer.json +++ b/composer.json @@ -7,5 +7,8 @@ "require-dev": { "prestashop/php-dev-tools": "^4.3", "phpunit/phpunit": "^9" + }, + "autoload": { + "psr-4": {"Miguel\\": "src/"} } } diff --git a/composer.lock b/composer.lock index ecc523f..82b0d23 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6f3d504e5d33c296231cdffda0563d1d", + "content-hash": "58cf60f412c20396d65aee7a8ad92ddf", "packages": [], "packages-dev": [ { diff --git a/miguel.php b/miguel.php index 8446ae6..aae91a6 100644 --- a/miguel.php +++ b/miguel.php @@ -13,6 +13,10 @@ * @license LICENSE.txt */ +use Miguel\Utils\MiguelApiError; +use Miguel\Utils\MiguelApiResponse; +use Miguel\Utils\MiguelSettings; + // uncomment this line for debugging (look for debug.log in the module directory) // define('_LOGGER_', 1); @@ -20,10 +24,6 @@ exit; } -require_once 'src/utils/miguel-settings.php'; -include_once 'src/utils/miguel-api-response.php'; -include_once 'src/utils/miguel-api-error.php'; - class Miguel extends Module { public const HOOKS = [ diff --git a/order-state-callback.php b/order-state-callback.php index 5d81ca3..776d0cd 100644 --- a/order-state-callback.php +++ b/order-state-callback.php @@ -13,6 +13,9 @@ * @license LICENSE.txt */ +use Miguel\Utils\MiguelApiError; +use Miguel\Utils\MiguelApiResponse; + /* tato stránka slouží jako API, pro automatickou změnu stavů v PS */ diff --git a/orders.php b/orders.php deleted file mode 100644 index e2a9f7a..0000000 --- a/orders.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ - -/* -tato stránka slouží jako API a vrací objednávky za zvolené období -je nutné se ověřit pomocí tokenu -*/ -header('Content-Type: application/json; charset=UTF-8'); - -include_once '../../config/config.inc.php'; -include_once 'miguel.php'; - -// required thing for PrestaShop validator (needs to be after config.inc.php) -if (!defined('_PS_VERSION_')) { - exit; -} - -$module = new Miguel(); -$context = Context::getContext(); -$context->controller = new FrontController(); - -$valid = $module->validateApiAccess(); -if ($valid !== true) { - echo json_encode($valid, JSON_PRETTY_PRINT); - exit; -} - -if (false == Tools::getIsset('updated_since')) { - $output = MiguelApiResponse::error(MiguelApiError::argumentNotSet('updated_since')); -} else { - $output = MiguelApiResponse::success($module->getUpdatedOrders(Tools::getValue('updated_since')), 'orders'); -} - -echo json_encode($output, JSON_PRETTY_PRINT); diff --git a/products.php b/products.php index 5fbcdd0..efc2ba8 100644 --- a/products.php +++ b/products.php @@ -13,6 +13,8 @@ * @license LICENSE.txt */ +use Miguel\Utils\MiguelApiResponse; + /* tato stránka slouží jako API a vrací seznamu názvu produktů je nutné se ověřit pomocí tokenu diff --git a/src/api/index.php b/src/api/index.php new file mode 100644 index 0000000..14618b7 --- /dev/null +++ b/src/api/index.php @@ -0,0 +1,23 @@ + + * @copyright 2022 - 2023 Servantes + * @license LICENSE.txt + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/api/orders.php b/src/api/orders.php new file mode 100644 index 0000000..3b5f8f4 --- /dev/null +++ b/src/api/orders.php @@ -0,0 +1,44 @@ + + * @copyright 2022 - 2023 Servantes + * @license LICENSE.txt + */ + +namespace Miguel\Api; + +if (!defined('_PS_VERSION_')) { + exit; +} + +use Miguel\Utils\MiguelApiResponse; +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +class MiguelApiOrdersController extends Controller +{ + /** + * @var \Miguel + */ + private $module; + + public function __construct() + { + $this->module = new \Miguel(); + } + + public function index() + { + $updated_since = \Tools::getValue('updated_since'); + $orders = $this->module->getUpdatedOrders($updated_since); + + return $this->json(MiguelApiResponse::success($orders, 'orders')); + } +} diff --git a/src/utils/miguel-api-error.php b/src/utils/miguel-api-error.php index 3f895d5..053911f 100644 --- a/src/utils/miguel-api-error.php +++ b/src/utils/miguel-api-error.php @@ -12,11 +12,14 @@ * @copyright 2022 - 2024 Servantes * @license LICENSE.txt */ + +namespace Miguel\Utils; + if (!defined('_PS_VERSION_')) { exit; } -class MiguelApiError implements JsonSerializable +class MiguelApiError implements \JsonSerializable { /** * @var string diff --git a/src/utils/miguel-api-response.php b/src/utils/miguel-api-response.php index c9c524a..5454703 100644 --- a/src/utils/miguel-api-response.php +++ b/src/utils/miguel-api-response.php @@ -12,11 +12,14 @@ * @copyright 2022 - 2024 Servantes * @license LICENSE.txt */ + +namespace Miguel\Utils; + if (!defined('_PS_VERSION_')) { exit; } -class MiguelApiResponse implements JsonSerializable +class MiguelApiResponse implements \JsonSerializable { /** * True when everything is ok, otherwise false. diff --git a/src/utils/miguel-settings.php b/src/utils/miguel-settings.php index 3b6e2bc..d86a377 100644 --- a/src/utils/miguel-settings.php +++ b/src/utils/miguel-settings.php @@ -12,6 +12,9 @@ * @copyright 2022 - 2024 Servantes * @license LICENSE.txt */ + +namespace Miguel\Utils; + if (!defined('_PS_VERSION_')) { exit; } @@ -72,14 +75,14 @@ public static function getAllKeys() public static function reset() { foreach (self::getDefaultValues() as $key => $value) { - Configuration::updateValue($key, $value); + \Configuration::updateValue($key, $value); } } public static function deleteAll() { foreach (self::getAllKeys() as $key) { - Configuration::deleteByName($key); + \Configuration::deleteByName($key); } } @@ -87,7 +90,7 @@ public static function getAll() { $values = []; foreach (self::getAllKeys() as $key) { - $values[$key] = Configuration::get($key); + $values[$key] = \Configuration::get($key); } return $values; @@ -101,7 +104,7 @@ public static function getAll() */ public static function save($key, $value) { - Configuration::updateValue($key, $value); + \Configuration::updateValue($key, $value); } // Custom getters and setters @@ -111,12 +114,12 @@ public static function save($key, $value) */ public static function getEnabled(): bool { - return Configuration::get(self::API_ENABLE_KEY); + return \Configuration::get(self::API_ENABLE_KEY); } public static function setEnabled($value) { - Configuration::updateValue(self::API_ENABLE_KEY, $value); + \Configuration::updateValue(self::API_ENABLE_KEY, $value); } /** @@ -126,7 +129,7 @@ public static function setEnabled($value) */ public static function getServer() { - return Configuration::get(self::API_SERVER_KEY); + return \Configuration::get(self::API_SERVER_KEY); } /** @@ -144,7 +147,7 @@ public static function getServerUrl($env) case MiguelSettings::ENV_TEST: return 'https://miguel-test.servantes.cz'; case MiguelSettings::ENV_OWN: - return Configuration::get(self::API_SERVER_OWN_KEY); + return \Configuration::get(self::API_SERVER_OWN_KEY); } return false; @@ -159,13 +162,13 @@ public static function getServerToken($env) { switch ($env) { case MiguelSettings::ENV_PROD: - return Configuration::get(self::API_TOKEN_PRODUCTION_KEY); + return \Configuration::get(self::API_TOKEN_PRODUCTION_KEY); case MiguelSettings::ENV_STAGING: - return Configuration::get(self::API_TOKEN_STAGING_KEY); + return \Configuration::get(self::API_TOKEN_STAGING_KEY); case MiguelSettings::ENV_TEST: - return Configuration::get(self::API_TOKEN_TEST_KEY); + return \Configuration::get(self::API_TOKEN_TEST_KEY); case MiguelSettings::ENV_OWN: - return Configuration::get(self::API_TOKEN_OWN_KEY); + return \Configuration::get(self::API_TOKEN_OWN_KEY); } return false; @@ -178,9 +181,9 @@ public static function getNewStateAutoChange($miguel_only) { $new_state_id_raw = false; if ($miguel_only) { - $new_state_id_raw = Configuration::get(self::NEW_STATE_AUTO_CHANGE_MIGUEL_ONLY_KEY); + $new_state_id_raw = \Configuration::get(self::NEW_STATE_AUTO_CHANGE_MIGUEL_ONLY_KEY); } else { - $new_state_id_raw = Configuration::get(self::NEW_STATE_AUTO_CHANGE_MIGUEL_OTHERS_KEY); + $new_state_id_raw = \Configuration::get(self::NEW_STATE_AUTO_CHANGE_MIGUEL_OTHERS_KEY); } if ($new_state_id_raw === false) { diff --git a/tests/Unit/DatabaseTestCase.php b/tests/Unit/DatabaseTestCase.php index f1bf0bc..419d58b 100644 --- a/tests/Unit/DatabaseTestCase.php +++ b/tests/Unit/DatabaseTestCase.php @@ -13,6 +13,8 @@ * @license LICENSE.txt */ +namespace Tests\Unit; + use PHPUnit\Framework\TestCase; class DatabaseTestCase extends TestCase diff --git a/tests/Unit/MiguelTest.php b/tests/Unit/MiguelTest.php index 2f4c471..3f95273 100644 --- a/tests/Unit/MiguelTest.php +++ b/tests/Unit/MiguelTest.php @@ -15,7 +15,9 @@ namespace Tests\Unit; -final class MiguelTest extends \DatabaseTestCase +use Miguel\Utils\MiguelApiResponse; + +final class MiguelTest extends DatabaseTestCase { private $sut; @@ -37,7 +39,7 @@ public function testMiguelWithoutAnyConfig() $res = $this->sut->validateApiAccess(); // VERIFY - $this->assertInstanceOf(\MiguelApiResponse::class, $res); + $this->assertInstanceOf(MiguelApiResponse::class, $res); $this->assertEquals(false, $res->getResult()); diff --git a/tests/Unit/OrdersTest.php b/tests/Unit/OrdersTest.php index 42705d3..ef5b305 100644 --- a/tests/Unit/OrdersTest.php +++ b/tests/Unit/OrdersTest.php @@ -17,7 +17,7 @@ use GuzzleHttp\Client; -final class OrdersTest extends \DatabaseTestCase +final class OrdersTest extends DatabaseTestCase { private $client; diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php index 3cfd344..159f010 100644 --- a/tests/Unit/bootstrap.php +++ b/tests/Unit/bootstrap.php @@ -12,6 +12,8 @@ * @copyright 2022 - 2024 Servantes * @license LICENSE.txt */ +require_once __DIR__ . '/../../vendor/autoload.php'; + if (file_exists(__DIR__ . '/../../vendor2/PrestaShop/tests-legacy')) { require_once __DIR__ . '/../../vendor2/PrestaShop/tests-legacy/bootstrap.php'; } else { @@ -29,4 +31,4 @@ $module = new Miguel(); $module->install(); -MiguelSettings::reset(); +Miguel\Utils\MiguelSettings::reset(); diff --git a/tests/phpstan/phpstan.neon b/tests/phpstan/phpstan.neon index 4417753..8e7806b 100644 --- a/tests/phpstan/phpstan.neon +++ b/tests/phpstan/phpstan.neon @@ -11,7 +11,6 @@ parameters: - ../../views - ../../miguel.php - ../../order-state-callback.php - - ../../orders.php - ../../products.php reportUnmatchedIgnoredErrors: false diff --git a/upgrade/upgrade-1.0.1.php b/upgrade/upgrade-1.0.1.php index c5140ee..9bf655f 100644 --- a/upgrade/upgrade-1.0.1.php +++ b/upgrade/upgrade-1.0.1.php @@ -16,6 +16,8 @@ exit; } +use Miguel\Utils\MiguelSettings; + function upgrade_module_1_0_1($module) { // migrate settings keys From 32739e6e1c68caba1bd8805af8200ee692aa7581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Thu, 28 Mar 2024 10:46:46 +0700 Subject: [PATCH 03/11] remove composer.lock from git + less strict dev requirements --- composer.json | 8 +- composer.lock | 3708 ----------------- .../MiguelApiOrdersController.php} | 0 src/{api => Api}/index.php | 0 .../MiguelApiError.php} | 0 .../MiguelApiResponse.php} | 0 .../MiguelSettings.php} | 0 src/{utils => Utils}/index.php | 0 tests/Unit/DatabaseTestCase.php | 3 +- tests/Unit/MiguelTest.php | 5 +- .../{utils => Utils}/MiguelSettingsTest.php | 13 +- 11 files changed, 18 insertions(+), 3719 deletions(-) delete mode 100644 composer.lock rename src/{api/orders.php => Api/MiguelApiOrdersController.php} (100%) rename src/{api => Api}/index.php (100%) rename src/{utils/miguel-api-error.php => Utils/MiguelApiError.php} (100%) rename src/{utils/miguel-api-response.php => Utils/MiguelApiResponse.php} (100%) rename src/{utils/miguel-settings.php => Utils/MiguelSettings.php} (100%) rename src/{utils => Utils}/index.php (100%) rename tests/Unit/{utils => Utils}/MiguelSettingsTest.php (61%) diff --git a/composer.json b/composer.json index 1bde048..0ee98f7 100644 --- a/composer.json +++ b/composer.json @@ -5,10 +5,14 @@ "php": ">=7.1.0" }, "require-dev": { - "prestashop/php-dev-tools": "^4.3", - "phpunit/phpunit": "^9" + "prestashop/php-dev-tools": "^4.3 || ^3.16", + "phpunit/phpunit": "^7 || ^8 || ^9" }, "autoload": { "psr-4": {"Miguel\\": "src/"} + }, + "type": "prestashop-module", + "config": { + "prepend-autoloader": false } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 82b0d23..0000000 --- a/composer.lock +++ /dev/null @@ -1,3708 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "58cf60f412c20396d65aee7a8ad92ddf", - "packages": [], - "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.4.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", - "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": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.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": "2023-08-31T09:50:34+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/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.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%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.27.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "e73ccaae1208f017bb7860986eebb3da48bd25d6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e73ccaae1208f017bb7860986eebb3da48bd25d6", - "reference": "e73ccaae1208f017bb7860986eebb3da48bd25d6", - "shasum": "" - }, - "require": { - "composer/semver": "^3.3", - "composer/xdebug-handler": "^3.0.3", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "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": { - "facile-it/paraunit": "^1.3 || ^2.0", - "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.27.0" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2023-09-17T14:37:54+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.17.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "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.17.1" - }, - "time": "2023-08-13T19:53:39+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": "9.2.29", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "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-master": "9.2-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/9.2.29" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-09-19T04:57:46+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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": "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", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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": "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/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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": "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/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.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/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.6.13", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1 || ^2", - "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": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.6-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/9.6.13" - }, - "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-09-19T05:39:22+00:00" - }, - { - "name": "prestashop/autoindex", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/PrestaShopCorp/autoindex.git", - "reference": "235f3ec115432ffc32d582198ea498467b3946d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/235f3ec115432ffc32d582198ea498467b3946d0", - "reference": "235f3ec115432ffc32d582198ea498467b3946d0", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.10", - "php": "^8.0 || ^7.2", - "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", - "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.83", - "prestashop/php-dev-tools": "1.*" - }, - "bin": [ - "bin/autoindex" - ], - "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\AutoIndex\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "AFL-3.0" - ], - "authors": [ - { - "name": "PrestaShop SA", - "email": "contact@prestashop.com" - } - ], - "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", - "homepage": "https://github.com/PrestaShopCorp/autoindex", - "support": { - "source": "https://github.com/PrestaShopCorp/autoindex/tree/v2.1.0" - }, - "time": "2022-10-10T08:35:00+00:00" - }, - { - "name": "prestashop/header-stamp", - "version": "v2.3", - "source": { - "type": "git", - "url": "https://github.com/PrestaShopCorp/header-stamp.git", - "reference": "3104b69ad73b6039c7082dbba4af9dbeb0b936b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/3104b69ad73b6039c7082dbba4af9dbeb0b936b3", - "reference": "3104b69ad73b6039c7082dbba4af9dbeb0b936b3", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.10", - "php": "^8.0 || ^7.2", - "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", - "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.83", - "prestashop/php-dev-tools": "1.*" - }, - "bin": [ - "bin/header-stamp" - ], - "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\HeaderStamp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "AFL-3.0" - ], - "authors": [ - { - "name": "PrestaShop SA", - "email": "contact@prestashop.com" - } - ], - "description": "Rewrite your file headers to add the license or to make them up-to-date", - "homepage": "https://github.com/PrestaShopCorp/header-stamp", - "support": { - "issues": "https://github.com/PrestaShopCorp/header-stamp/issues", - "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v2.3" - }, - "time": "2023-03-23T14:44:10+00:00" - }, - { - "name": "prestashop/php-dev-tools", - "version": "v4.3.0", - "source": { - "type": "git", - "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "843275b19729ba810d8ba2b9c97b568e5bbabe03" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/843275b19729ba810d8ba2b9c97b568e5bbabe03", - "reference": "843275b19729ba810d8ba2b9c97b568e5bbabe03", - "shasum": "" - }, - "require": { - "friendsofphp/php-cs-fixer": "^3.2", - "php": ">=7.2.5", - "prestashop/autoindex": "^2.0", - "prestashop/header-stamp": "^2.0", - "squizlabs/php_codesniffer": "^3.4", - "symfony/console": "~3.2 || ~4.0 || ~5.0 || ~6.0", - "symfony/filesystem": "~3.2 || ~4.0 || ~5.0 || ~6.0" - }, - "bin": [ - "bin/prestashop-coding-standards" - ], - "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\CodingStandards\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PrestaShop coding standards", - "support": { - "issues": "https://github.com/PrestaShop/php-dev-tools/issues", - "source": "https://github.com/PrestaShop/php-dev-tools/tree/v4.3.0" - }, - "time": "2022-10-18T14:19:51+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": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.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/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.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/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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 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/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.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", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-05-07T05:35:17+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-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": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.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/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T06:03:37+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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": "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/5.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-08-02T09:26:13+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.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/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.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/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.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/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-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/3.2.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:13:03+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "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 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/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.7.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2023-02-22T23:07:41+00:00" - }, - { - "name": "symfony/console", - "version": "v6.3.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", - "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.4" - }, - "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-08-16T10:10:12+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/event-dispatcher", - "version": "v6.3.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", - "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", - "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.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": "2023-07-06T06:56:43+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.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", - "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", - "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.3" - }, - "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-07-31T08:31:44+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.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-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.28.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-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-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.28.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-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-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.28.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-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-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.28.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-07-28T09:04:16+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-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.28.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-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-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.28.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-01-26T09:26:14+00:00" - }, - { - "name": "symfony/process", - "version": "v6.3.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", - "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.4" - }, - "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-08-07T10:39:22+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.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "53d1a83225002635bca3482fcbf963001313fb68" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", - "reference": "53d1a83225002635bca3482fcbf963001313fb68", - "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.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": "2023-07-05T08:41:27+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" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.6.0" -} diff --git a/src/api/orders.php b/src/Api/MiguelApiOrdersController.php similarity index 100% rename from src/api/orders.php rename to src/Api/MiguelApiOrdersController.php diff --git a/src/api/index.php b/src/Api/index.php similarity index 100% rename from src/api/index.php rename to src/Api/index.php diff --git a/src/utils/miguel-api-error.php b/src/Utils/MiguelApiError.php similarity index 100% rename from src/utils/miguel-api-error.php rename to src/Utils/MiguelApiError.php diff --git a/src/utils/miguel-api-response.php b/src/Utils/MiguelApiResponse.php similarity index 100% rename from src/utils/miguel-api-response.php rename to src/Utils/MiguelApiResponse.php diff --git a/src/utils/miguel-settings.php b/src/Utils/MiguelSettings.php similarity index 100% rename from src/utils/miguel-settings.php rename to src/Utils/MiguelSettings.php diff --git a/src/utils/index.php b/src/Utils/index.php similarity index 100% rename from src/utils/index.php rename to src/Utils/index.php diff --git a/tests/Unit/DatabaseTestCase.php b/tests/Unit/DatabaseTestCase.php index 419d58b..3654f13 100644 --- a/tests/Unit/DatabaseTestCase.php +++ b/tests/Unit/DatabaseTestCase.php @@ -15,6 +15,7 @@ namespace Tests\Unit; +use Miguel\Utils\MiguelSettings; use PHPUnit\Framework\TestCase; class DatabaseTestCase extends TestCase @@ -23,6 +24,6 @@ protected function setUp(): void { parent::setUp(); - \MiguelSettings::reset(); + MiguelSettings::reset(); } } diff --git a/tests/Unit/MiguelTest.php b/tests/Unit/MiguelTest.php index 3f95273..99c222b 100644 --- a/tests/Unit/MiguelTest.php +++ b/tests/Unit/MiguelTest.php @@ -16,6 +16,7 @@ namespace Tests\Unit; use Miguel\Utils\MiguelApiResponse; +use Miguel\Utils\MiguelSettings; final class MiguelTest extends DatabaseTestCase { @@ -51,8 +52,8 @@ public function testMiguelWithoutAnyConfig() public function testFullConfig() { // SETUP - \MiguelSettings::save(\MiguelSettings::API_TOKEN_PRODUCTION_KEY, '1234'); - \MiguelSettings::setEnabled(true); + MiguelSettings::save(MiguelSettings::API_TOKEN_PRODUCTION_KEY, '1234'); + MiguelSettings::setEnabled(true); $_SERVER['Authorization'] = 'Bearer 1234'; diff --git a/tests/Unit/utils/MiguelSettingsTest.php b/tests/Unit/Utils/MiguelSettingsTest.php similarity index 61% rename from tests/Unit/utils/MiguelSettingsTest.php rename to tests/Unit/Utils/MiguelSettingsTest.php index f7570cb..a76e07f 100644 --- a/tests/Unit/utils/MiguelSettingsTest.php +++ b/tests/Unit/Utils/MiguelSettingsTest.php @@ -13,21 +13,22 @@ * @license LICENSE.txt */ -namespace Tests\Unit\utils; +namespace Tests\Unit\Utils; -require_once __DIR__ . '/../../../src/utils/miguel-settings.php'; +use Miguel\Utils\MiguelSettings; +use Tests\Unit\DatabaseTestCase; -final class MiguelSettingsTest extends \DatabaseTestCase +final class MiguelSettingsTest extends DatabaseTestCase { public function testSaveValue() { // PREPARE - $this->assertFalse(\Configuration::get(\MiguelSettings::API_ENABLE_KEY)); + $this->assertFalse(\Configuration::get(MiguelSettings::API_ENABLE_KEY)); // TEST - \MiguelSettings::setEnabled(true); + MiguelSettings::setEnabled(true); // VERIFY - $this->assertTrue(\Configuration::get(\MiguelSettings::API_ENABLE_KEY)); + $this->assertTrue(\Configuration::get(MiguelSettings::API_ENABLE_KEY)); } } From a587dbc21bf3232b0b430ab7debc6b2c798a1d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Thu, 28 Mar 2024 18:24:37 +0700 Subject: [PATCH 04/11] fix(tests): remove not working test --- tests/Unit/OrdersTest.php | 44 --------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 tests/Unit/OrdersTest.php diff --git a/tests/Unit/OrdersTest.php b/tests/Unit/OrdersTest.php deleted file mode 100644 index ef5b305..0000000 --- a/tests/Unit/OrdersTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ - -namespace Tests\Unit; - -use GuzzleHttp\Client; - -final class OrdersTest extends DatabaseTestCase -{ - private $client; - - protected function setUp(): void - { - parent::setUp(); - - $this->client = new Client([ - 'base_uri' => 'http://localhost:8000/modules/miguel/', - 'request.options' => [ - 'exceptions' => false, - ], - ]); - } - - public function testRequest() - { - // make a request to our API - $response = $this->client->request('GET', 'orders.php'); - - // check if the response is OK - $this->assertEquals(200, $response->getStatusCode()); - } -} From 1aac875115ceac5be1678c2e41ccbdcad12d5aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Thu, 28 Mar 2024 18:29:55 +0700 Subject: [PATCH 05/11] fix(lint): issues found by PHP CS fixer --- controllers/front/purchased.php | 4 ++-- miguel.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/front/purchased.php b/controllers/front/purchased.php index 5e5cb4b..958d1a0 100644 --- a/controllers/front/purchased.php +++ b/controllers/front/purchased.php @@ -46,8 +46,8 @@ public function getBreadcrumbLinks() $breadcrumb['links'][] = $this->addMyAccountToBreadcrumb(); $breadcrumb['links'][] = [ - 'title' => $this->module->l('Purchased e-books'), - 'url' => $this->context->link->getModuleLink('miguel', 'purchased'), + 'title' => $this->module->l('Purchased e-books'), + 'url' => $this->context->link->getModuleLink('miguel', 'purchased'), ]; return $breadcrumb; diff --git a/miguel.php b/miguel.php index aae91a6..3855d19 100644 --- a/miguel.php +++ b/miguel.php @@ -184,8 +184,8 @@ protected function getConfigForm() return [ 'form' => [ 'legend' => [ - 'title' => $this->l('Settings'), - 'icon' => 'icon-cogs', + 'title' => $this->l('Settings'), + 'icon' => 'icon-cogs', ], 'input' => array_filter([ [ From 3c38242dbc5f4e2b5352d9e59de6b290856ea4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Fri, 29 Mar 2024 11:32:18 +0700 Subject: [PATCH 06/11] refactor: store license header in one file + autogenerate index.php files --- .github/scripts/build-zip.sh | 41 ++++++++++++++++++++++++- .github/workflows/php_tests.yml | 28 ----------------- .php-cs-fixer.dist.php | 2 +- assets/license-header.txt | 13 ++++++++ composer.json | 9 ++++-- controllers/front/index.php | 23 -------------- controllers/front/purchased.php | 14 +-------- controllers/index.php | 23 -------------- index.php | 23 -------------- src/Api/MiguelApiOrdersController.php | 13 -------- src/Api/index.php | 23 -------------- src/Utils/MiguelApiError.php | 13 -------- src/Utils/MiguelApiResponse.php | 13 -------- src/Utils/MiguelSettings.php | 13 -------- src/Utils/index.php | 23 -------------- src/index.php | 23 -------------- src/sql/index.php | 23 -------------- src/sql/install.php | 14 +-------- tests/Unit/DatabaseTestCase.php | 13 -------- tests/Unit/MiguelTest.php | 13 -------- tests/Unit/Utils/MiguelSettingsTest.php | 13 -------- tests/Unit/bootstrap.php | 14 +-------- translations/cs.php | 14 +-------- translations/index.php | 23 -------------- upgrade/index.php | 23 -------------- upgrade/upgrade-1.0.1.php | 14 +-------- views/css/back.css | 14 --------- views/css/front.css | 13 -------- views/css/index.php | 23 -------------- views/img/index.php | 23 -------------- views/index.php | 23 -------------- views/js/back.js | 14 --------- views/js/front.js | 13 -------- views/js/index.php | 23 -------------- views/templates/admin/index.php | 23 -------------- views/templates/front/index.php | 23 -------------- views/templates/hook/index.php | 23 -------------- views/templates/index.php | 23 -------------- 38 files changed, 65 insertions(+), 634 deletions(-) create mode 100644 assets/license-header.txt delete mode 100644 controllers/front/index.php delete mode 100644 controllers/index.php delete mode 100644 index.php delete mode 100644 src/Api/index.php delete mode 100644 src/Utils/index.php delete mode 100644 src/index.php delete mode 100644 src/sql/index.php delete mode 100644 translations/index.php delete mode 100644 upgrade/index.php delete mode 100644 views/css/index.php delete mode 100644 views/img/index.php delete mode 100644 views/index.php delete mode 100644 views/js/index.php delete mode 100644 views/templates/admin/index.php delete mode 100644 views/templates/front/index.php delete mode 100644 views/templates/hook/index.php delete mode 100644 views/templates/index.php diff --git a/.github/scripts/build-zip.sh b/.github/scripts/build-zip.sh index 7733620..e5b3b1a 100644 --- a/.github/scripts/build-zip.sh +++ b/.github/scripts/build-zip.sh @@ -1,7 +1,24 @@ #!/usr/bin/env bash +set -e + +# Function to remove space after the first PHPDoc comment +remove_space_after_phpdoc() { + file="$1" + echo "Removing space after PHPDoc comment in $file" + + # Check if the file exists + if [ ! -f "$file" ]; then + echo "File $file does not exist." + exit 1 + fi + + # Find the first PHPdoc and remove spaces after it + perl -CSD -i -pe 'BEGIN{undef $/;} s/\*\/\n\n/*\/\n/smg;' "$file" +} + tmpdir=$(mktemp -d) -ignore=".git .github .idea .vscode .gitignore .php-cs-fixer.dist.php .php-cs-fixer.cache composer.lock tests run doc vendor vendor2 docker-compose.yml docker-compose.test.yml Makefile *.zip" +ignore=".git .github .idea .vscode .gitignore .php-cs-fixer.dist.php .php-cs-fixer.cache composer.lock assets tests run doc vendor2 docker-compose.yml docker-compose.test.yml Makefile *.zip" result="$(PWD)/miguel.zip" rm -rf "$result" @@ -10,6 +27,28 @@ mkdir -p $tmpdir/miguel rsync -a --exclude=.git --exclude=run --exclude=vendor --exclude=vendor2 "." "${tmpdir}/miguel/" pushd $tmpdir > /dev/null + if [[ -f "miguel/composer.json" ]]; then + pushd miguel > /dev/null + composer install + + composer exec autoindex + cp src/index.php . + + composer exec header-stamp -- --license=assets/license-header.txt --exclude=.github,node_modules,vendor,tests,_dev,run,composer.json + + for file in $(find . -type f -name "*.php" ! -path "./vendor/*"); do + remove_space_after_phpdoc "$file" + done + cat index.php + + composer exec php-cs-fixer fix -- --using-cache=no + + rm -rf vendor/ + + composer install --no-dev + popd > /dev/null + fi + for i in $ignore; do rm -rf miguel/$i done diff --git a/.github/workflows/php_tests.yml b/.github/workflows/php_tests.yml index 531b353..df849fa 100644 --- a/.github/workflows/php_tests.yml +++ b/.github/workflows/php_tests.yml @@ -10,34 +10,6 @@ permissions: checks: write jobs: - header-stamp: - name: Check license headers - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP 8.2 - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - - - name: Cache vendor folder - uses: actions/cache@v4 - with: - path: vendor - key: php-${{ hashFiles('composer.lock') }} - - - name: Cache composer folder - uses: actions/cache@v4 - with: - path: ~/.composer/cache - key: php-composer-cache - - - run: composer install - - - name: Run Header Stamp in Dry Run mode - run: php vendor/bin/header-stamp --license=LICENSE.txt --exclude=.github,node_modules,vendor,tests,_dev,run,composer.json --dry-run php-linter: name: PHP Syntax check 7.1|7.2|7.3|7.4|8.0|8.1|8.2 runs-on: ubuntu-latest diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 4418360..c75b333 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,6 +4,6 @@ /** @var \Symfony\Component\Finder\Finder $finder */ $finder = $config->setUsingCache(true)->getFinder(); -$finder->in(__DIR__)->exclude(['vendor', 'run']); +$finder->in(__DIR__)->exclude(['vendor', 'vendor2', 'run']); return $config; diff --git a/assets/license-header.txt b/assets/license-header.txt new file mode 100644 index 0000000..17e2141 --- /dev/null +++ b/assets/license-header.txt @@ -0,0 +1,13 @@ +/** + * 2024 Servantes + * + * This file is licenced under the Software License Agreement. + * With the purchase or the installation of the software in your application + * you accept the licence agreement. + * + * You must not modify, adapt or create derivative works of this source code + * + * @author Roman Kříž + * @copyright 2022 - 2024 Servantes + * @license LICENSE.txt + */ diff --git a/composer.json b/composer.json index 0ee98f7..9c7491e 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,20 @@ { "author": "Servantes", "license": "MIT", + "type": "prestashop-module", "require": { "php": ">=7.1.0" }, "require-dev": { "prestashop/php-dev-tools": "^4.3 || ^3.16", - "phpunit/phpunit": "^7 || ^8 || ^9" + "phpunit/phpunit": "^7 || ^8 || ^9", + "prestashop/autoindex": "^2.1 || ^1", + "friendsofphp/php-cs-fixer": "^3.52 || ^2" }, "autoload": { - "psr-4": {"Miguel\\": "src/"} + "psr-4": {"Miguel\\": "src/"}, + "classmap": ["miguel.php"] }, - "type": "prestashop-module", "config": { "prepend-autoloader": false } diff --git a/controllers/front/index.php b/controllers/front/index.php deleted file mode 100644 index 14618b7..0000000 --- a/controllers/front/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/controllers/front/purchased.php b/controllers/front/purchased.php index 958d1a0..802d508 100644 --- a/controllers/front/purchased.php +++ b/controllers/front/purchased.php @@ -1,17 +1,5 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ + if (!defined('_PS_VERSION_')) { exit; } diff --git a/controllers/index.php b/controllers/index.php deleted file mode 100644 index 28f1ff7..0000000 --- a/controllers/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/index.php b/index.php deleted file mode 100644 index 0bad41e..0000000 --- a/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license https://opensource.org/licenses/MIT MIT License - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/Api/MiguelApiOrdersController.php b/src/Api/MiguelApiOrdersController.php index 3b5f8f4..e7e695e 100644 --- a/src/Api/MiguelApiOrdersController.php +++ b/src/Api/MiguelApiOrdersController.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ namespace Miguel\Api; diff --git a/src/Api/index.php b/src/Api/index.php deleted file mode 100644 index 14618b7..0000000 --- a/src/Api/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/Utils/MiguelApiError.php b/src/Utils/MiguelApiError.php index 053911f..9ce28c4 100644 --- a/src/Utils/MiguelApiError.php +++ b/src/Utils/MiguelApiError.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ namespace Miguel\Utils; diff --git a/src/Utils/MiguelApiResponse.php b/src/Utils/MiguelApiResponse.php index 5454703..e789ad7 100644 --- a/src/Utils/MiguelApiResponse.php +++ b/src/Utils/MiguelApiResponse.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ namespace Miguel\Utils; diff --git a/src/Utils/MiguelSettings.php b/src/Utils/MiguelSettings.php index d86a377..e86ed19 100644 --- a/src/Utils/MiguelSettings.php +++ b/src/Utils/MiguelSettings.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ namespace Miguel\Utils; diff --git a/src/Utils/index.php b/src/Utils/index.php deleted file mode 100644 index 0bad41e..0000000 --- a/src/Utils/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license https://opensource.org/licenses/MIT MIT License - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/index.php b/src/index.php deleted file mode 100644 index 0bad41e..0000000 --- a/src/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license https://opensource.org/licenses/MIT MIT License - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/sql/index.php b/src/sql/index.php deleted file mode 100644 index 14618b7..0000000 --- a/src/sql/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/sql/install.php b/src/sql/install.php index d37d46b..a424c50 100644 --- a/src/sql/install.php +++ b/src/sql/install.php @@ -1,17 +1,5 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ + if (!defined('_PS_VERSION_')) { exit; } diff --git a/tests/Unit/DatabaseTestCase.php b/tests/Unit/DatabaseTestCase.php index 3654f13..3e03393 100644 --- a/tests/Unit/DatabaseTestCase.php +++ b/tests/Unit/DatabaseTestCase.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ namespace Tests\Unit; diff --git a/tests/Unit/MiguelTest.php b/tests/Unit/MiguelTest.php index 99c222b..192814d 100644 --- a/tests/Unit/MiguelTest.php +++ b/tests/Unit/MiguelTest.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ namespace Tests\Unit; diff --git a/tests/Unit/Utils/MiguelSettingsTest.php b/tests/Unit/Utils/MiguelSettingsTest.php index a76e07f..372fbee 100644 --- a/tests/Unit/Utils/MiguelSettingsTest.php +++ b/tests/Unit/Utils/MiguelSettingsTest.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ namespace Tests\Unit\Utils; diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php index 159f010..166a294 100644 --- a/tests/Unit/bootstrap.php +++ b/tests/Unit/bootstrap.php @@ -1,17 +1,5 @@ - * @copyright 2022 - 2024 Servantes - * @license LICENSE.txt - */ + require_once __DIR__ . '/../../vendor/autoload.php'; if (file_exists(__DIR__ . '/../../vendor2/PrestaShop/tests-legacy')) { diff --git a/translations/cs.php b/translations/cs.php index 08246b9..2088fa7 100644 --- a/translations/cs.php +++ b/translations/cs.php @@ -1,17 +1,5 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ + global $_MODULE; $_MODULE = []; $_MODULE['<{miguel}prestashop>miguel_651faef175451b43088ed6fab4aab961'] = 'Miguel'; diff --git a/translations/index.php b/translations/index.php deleted file mode 100644 index 14618b7..0000000 --- a/translations/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/upgrade/index.php b/upgrade/index.php deleted file mode 100644 index 14618b7..0000000 --- a/upgrade/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/upgrade/upgrade-1.0.1.php b/upgrade/upgrade-1.0.1.php index 9bf655f..df2831a 100644 --- a/upgrade/upgrade-1.0.1.php +++ b/upgrade/upgrade-1.0.1.php @@ -1,17 +1,5 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ + if (!defined('_PS_VERSION_')) { exit; } diff --git a/views/css/back.css b/views/css/back.css index 00f4386..55ee82d 100644 --- a/views/css/back.css +++ b/views/css/back.css @@ -1,17 +1,3 @@ -/** -* 2023 Servantes -* -* This file is licenced under the Software License Agreement. -* With the purchase or the installation of the software in your application -* you accept the licence agreement. -* -* You must not modify, adapt or create derivative works of this source code -* -* @author Pavel Vejnar -* @copyright 2022 - 2023 Servantes -* @license LICENSE.txt -*/ - /* skryje wrapper formuláře, než se přes jquery nastaví viditelné položky dle selectu */ diff --git a/views/css/front.css b/views/css/front.css index 3f31b80..e69de29 100644 --- a/views/css/front.css +++ b/views/css/front.css @@ -1,13 +0,0 @@ -/** -* 2023 Servantes -* -* This file is licenced under the Software License Agreement. -* With the purchase or the installation of the software in your application -* you accept the licence agreement. -* -* You must not modify, adapt or create derivative works of this source code -* -* @author Pavel Vejnar -* @copyright 2022 - 2023 Servantes -* @license LICENSE.txt -*/ diff --git a/views/css/index.php b/views/css/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/css/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/img/index.php b/views/img/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/img/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/index.php b/views/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/js/back.js b/views/js/back.js index 8a583e6..6a6822e 100644 --- a/views/js/back.js +++ b/views/js/back.js @@ -1,17 +1,3 @@ -/** -* 2023 Servantes -* -* This file is licenced under the Software License Agreement. -* With the purchase or the installation of the software in your application -* you accept the licence agreement. -* -* You must not modify, adapt or create derivative works of this source code -* -* @author Pavel Vejnar -* @copyright 2022 - 2023 Servantes -* @license LICENSE.txt -*/ - function tokenInputNameForServer(server) { if (server == 'prod') { server = 'production'; diff --git a/views/js/front.js b/views/js/front.js index 3f31b80..e69de29 100644 --- a/views/js/front.js +++ b/views/js/front.js @@ -1,13 +0,0 @@ -/** -* 2023 Servantes -* -* This file is licenced under the Software License Agreement. -* With the purchase or the installation of the software in your application -* you accept the licence agreement. -* -* You must not modify, adapt or create derivative works of this source code -* -* @author Pavel Vejnar -* @copyright 2022 - 2023 Servantes -* @license LICENSE.txt -*/ diff --git a/views/js/index.php b/views/js/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/js/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/templates/admin/index.php b/views/templates/admin/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/templates/admin/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/templates/front/index.php b/views/templates/front/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/templates/front/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/templates/hook/index.php b/views/templates/hook/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/templates/hook/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/templates/index.php b/views/templates/index.php deleted file mode 100644 index 14618b7..0000000 --- a/views/templates/index.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; From a4bebb055a2b4ca01297e21735bbfdc4f230e7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Fri, 29 Mar 2024 11:52:39 +0700 Subject: [PATCH 07/11] chore: remove header from rest of php source files --- miguel.php | 13 ------------- order-state-callback.php | 13 ------------- products.php | 13 ------------- 3 files changed, 39 deletions(-) diff --git a/miguel.php b/miguel.php index 3855d19..24d308d 100644 --- a/miguel.php +++ b/miguel.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ use Miguel\Utils\MiguelApiError; use Miguel\Utils\MiguelApiResponse; diff --git a/order-state-callback.php b/order-state-callback.php index 776d0cd..85e4597 100644 --- a/order-state-callback.php +++ b/order-state-callback.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ use Miguel\Utils\MiguelApiError; use Miguel\Utils\MiguelApiResponse; diff --git a/products.php b/products.php index efc2ba8..2ef4f63 100644 --- a/products.php +++ b/products.php @@ -1,17 +1,4 @@ - * @copyright 2022 - 2023 Servantes - * @license LICENSE.txt - */ use Miguel\Utils\MiguelApiResponse; From 22a543de921df26d52e430598c27ca0e3ff8951e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Fri, 29 Mar 2024 19:37:31 +0700 Subject: [PATCH 08/11] refactor: convert orders.php to Controller --- composer.json | 8 +- controllers/front/ApiOrders.php | 22 +++ miguel.php | 18 ++ src/Api/MiguelApiOrdersController.php | 31 ---- .../MiguelApiAbstractFrontController.php | 57 +++++++ src/Utils/MiguelApiError.php | 48 ++++-- src/Utils/MiguelApiResponse.php | 19 ++- .../Unit/Controllers/Front/ApiOrdersTest.php | 12 ++ tests/Unit/MiguelTest.php | 1 + tests/Unit/Utility/ApiTestCase.php | 104 ++++++++++++ tests/Unit/Utility/ContextMocker.php | 160 ++++++++++++++++++ tests/Unit/Utility/ContextMockerTrait.php | 88 ++++++++++ tests/Unit/{ => Utility}/DatabaseTestCase.php | 2 +- tests/Unit/Utils/MiguelSettingsTest.php | 2 +- tests/Unit/bootstrap.php | 2 - 15 files changed, 518 insertions(+), 56 deletions(-) create mode 100644 controllers/front/ApiOrders.php delete mode 100644 src/Api/MiguelApiOrdersController.php create mode 100644 src/Controllers/MiguelApiAbstractFrontController.php create mode 100644 tests/Unit/Controllers/Front/ApiOrdersTest.php create mode 100644 tests/Unit/Utility/ApiTestCase.php create mode 100644 tests/Unit/Utility/ContextMocker.php create mode 100644 tests/Unit/Utility/ContextMockerTrait.php rename tests/Unit/{ => Utility}/DatabaseTestCase.php (88%) diff --git a/composer.json b/composer.json index 9c7491e..d77ae45 100644 --- a/composer.json +++ b/composer.json @@ -9,10 +9,14 @@ "prestashop/php-dev-tools": "^4.3 || ^3.16", "phpunit/phpunit": "^7 || ^8 || ^9", "prestashop/autoindex": "^2.1 || ^1", - "friendsofphp/php-cs-fixer": "^3.52 || ^2" + "friendsofphp/php-cs-fixer": "^3.52 || ^2", + "lchrusciel/api-test-case": "^5.3 || ^4.1" }, "autoload": { - "psr-4": {"Miguel\\": "src/"}, + "psr-4": { + "Miguel\\": "src/", + "Tests\\": "tests/" + }, "classmap": ["miguel.php"] }, "config": { diff --git a/controllers/front/ApiOrders.php b/controllers/front/ApiOrders.php new file mode 100644 index 0000000..a56e997 --- /dev/null +++ b/controllers/front/ApiOrders.php @@ -0,0 +1,22 @@ +module->getUpdatedOrders($updated_since); + + return MiguelApiResponse::success($orders, 'orders'); + } +} diff --git a/miguel.php b/miguel.php index 24d308d..f44a43d 100644 --- a/miguel.php +++ b/miguel.php @@ -1,5 +1,7 @@ fetch('module:miguel/views/templates/hook/displayCustomerAccount.tpl'); } + public function hookModuleRoutes() + { + return [ + 'module-miguel-orders' => [ + 'rule' => 'modules/miguel/orders.php', + 'keywords' => [], + 'controller' => 'ApiOrders', + 'params' => [ + 'fc' => 'module', + 'module' => 'miguel', + ], + ], + ]; + } + private function arrayWithCode($arr, $code) { foreach ($arr['orders'] as $key => $item) { diff --git a/src/Api/MiguelApiOrdersController.php b/src/Api/MiguelApiOrdersController.php deleted file mode 100644 index e7e695e..0000000 --- a/src/Api/MiguelApiOrdersController.php +++ /dev/null @@ -1,31 +0,0 @@ -module = new \Miguel(); - } - - public function index() - { - $updated_since = \Tools::getValue('updated_since'); - $orders = $this->module->getUpdatedOrders($updated_since); - - return $this->json(MiguelApiResponse::success($orders, 'orders')); - } -} diff --git a/src/Controllers/MiguelApiAbstractFrontController.php b/src/Controllers/MiguelApiAbstractFrontController.php new file mode 100644 index 0000000..3c73754 --- /dev/null +++ b/src/Controllers/MiguelApiAbstractFrontController.php @@ -0,0 +1,57 @@ +ajax = true; + } + + public function displayAjax() + { + if (!in_array($_SERVER['REQUEST_METHOD'], $this->methods)) { + return $this->ajaxRender(json_encode(MiguelApiResponse::error(new MiguelApiError('method.not_allowed', 'Method not allowed', 405)))); + } + + if ($this->validateRequest() != true) { + return $this->returnJsonResponse(MiguelApiResponse::error(MiguelApiError::unauthorized())); + } + + return $this->returnJsonResponse($this->getResponse()); + } + + protected function validateRequest() + { + $valid = $this->module->validateApiAccess(); + if ($valid !== true) { + return $this->returnJsonResponse($valid); + } + + return true; + } + + /** + * @param MiguelApiResponse $content + */ + private function returnJsonResponse($content) + { + header('Content-Type: application/json; charset=UTF-8'); + http_response_code($content->getStatus()); + + return $this->ajaxRender(json_encode($content)); + } + + abstract protected function getResponse(); +} diff --git a/src/Utils/MiguelApiError.php b/src/Utils/MiguelApiError.php index 9ce28c4..8a5f9ec 100644 --- a/src/Utils/MiguelApiError.php +++ b/src/Utils/MiguelApiError.php @@ -17,10 +17,31 @@ class MiguelApiError implements \JsonSerializable */ private $message; - public function __construct(string $code, string $message) + /** + * @var int + */ + private $status; + + public function __construct(string $code, string $message, int $status) { $this->code = $code; $this->message = $message; + $this->status = $status; + } + + public function getCode(): string + { + return $this->code; + } + + public function getMessage(): string + { + return $this->message; + } + + public function getStatus(): int + { + return $this->status; } // JsonSerializable @@ -34,50 +55,45 @@ public function jsonSerialize() ]; } - public function getCode(): string - { - return $this->code; - } + // Make functions - public function getMessage(): string + public static function unauthorized(): MiguelApiError { - return $this->message; + return new self('unauthorized', 'Unauthorized', 401); } - // Make functions - public static function apiKeyNotSet(): MiguelApiError { - return new self('api_key.not_set', 'API key not set'); + return new self('api_key.not_set', 'API key not set', 400); } public static function apiKeyInvalid(): MiguelApiError { - return new self('api_key.invalid', 'API key invalid'); + return new self('api_key.invalid', 'API key invalid', 403); } public static function moduleDisabled(): MiguelApiError { - return new self('module.disabled', 'Module is disabled'); + return new self('module.disabled', 'Module is disabled', 400); } public static function configurationNotSet(): MiguelApiError { - return new self('configuration.not_set', 'Configuration not set'); + return new self('configuration.not_set', 'Configuration not set', 400); } public static function argumentNotSet($argument): MiguelApiError { - return new self('argument.not_set', "Argument $argument not set"); + return new self('argument.not_set', "Argument $argument not set", 400); } public static function invalidPayload($message): MiguelApiError { - return new self('payload.invalid', "Invalid payload: $message"); + return new self('payload.invalid', "Invalid payload: $message", 400); } public static function unknownError(): MiguelApiError { - return new self('unknown.error', 'Unknown error'); + return new self('unknown.error', 'Unknown error', 400); } } diff --git a/src/Utils/MiguelApiResponse.php b/src/Utils/MiguelApiResponse.php index e789ad7..3fa22a7 100644 --- a/src/Utils/MiguelApiResponse.php +++ b/src/Utils/MiguelApiResponse.php @@ -25,16 +25,22 @@ class MiguelApiResponse implements \JsonSerializable */ private $data_key; + /** + * @var int + */ + private $status; + /** * @param bool $result * @param mixed $data * @param string $data_key */ - public function __construct(bool $result, $data, string $data_key) + public function __construct(bool $result, $data, string $data_key, int $status = 200) { $this->result = $result; $this->data = $data; $this->data_key = $data_key; + $this->status = $status; } public function getResult(): bool @@ -55,6 +61,11 @@ public function getDataKey(): string return $this->data_key; } + public function getStatus(): int + { + return $this->status; + } + // JsonSerializable #[\ReturnTypeWillChange] @@ -74,8 +85,10 @@ public static function success($data, string $data_key): MiguelApiResponse return new self(true, $data, $data_key); } - public static function error(MiguelApiError $error): MiguelApiResponse + public static function error(MiguelApiError $error, ?int $status = null): MiguelApiResponse { - return new self(false, $error, 'error'); + $status = $status != null ? $status : $error->getStatus(); + + return new self(false, $error, 'error', $status); } } diff --git a/tests/Unit/Controllers/Front/ApiOrdersTest.php b/tests/Unit/Controllers/Front/ApiOrdersTest.php new file mode 100644 index 0000000..03c735b --- /dev/null +++ b/tests/Unit/Controllers/Front/ApiOrdersTest.php @@ -0,0 +1,12 @@ +request('GET', '/modules/miguel/orders.php'); + $this->assertResponseIsSuccessful(); + } +} diff --git a/tests/Unit/MiguelTest.php b/tests/Unit/MiguelTest.php index 192814d..f966e84 100644 --- a/tests/Unit/MiguelTest.php +++ b/tests/Unit/MiguelTest.php @@ -4,6 +4,7 @@ use Miguel\Utils\MiguelApiResponse; use Miguel\Utils\MiguelSettings; +use Tests\Unit\Utility\DatabaseTestCase; final class MiguelTest extends DatabaseTestCase { diff --git a/tests/Unit/Utility/ApiTestCase.php b/tests/Unit/Utility/ApiTestCase.php new file mode 100644 index 0000000..c4c6dc9 --- /dev/null +++ b/tests/Unit/Utility/ApiTestCase.php @@ -0,0 +1,104 @@ +getContainer()->get('test.client'); + self::$client->setServerParameters([]); + self::$container = self::$client->getContainer(); + $this->router = self::$container->get('router'); + } + + /** + * @param string $route + * @param array $params + */ + protected function assertBadRequest(string $route, array $params): void + { + $route = $this->router->generate($route, $params); + self::$client->request('GET', $route); + + $response = self::$client->getResponse(); + $this->assertEquals(400, $response->getStatusCode(), 'It should return a response with "Bad Request" Status.'); + } + + /** + * @param string $route + * @param array $params + */ + protected function assertOkRequest(string $route, array $params): void + { + $route = $this->router->generate($route, $params); + self::$client->request('GET', $route); + + $response = self::$client->getResponse(); + $this->assertEquals(200, $response->getStatusCode(), 'It should return a response with "OK" Status.'); + } + + /** + * @param int $expectedStatusCode + * + * @return array + */ + protected function assertResponseBodyValidJson(int $expectedStatusCode): array + { + $response = self::$client->getResponse(); + + $message = 'Unexpected status code.'; + + switch ($expectedStatusCode) { + case 200: + $message = 'It should return a response with "OK" Status.'; + + break; + case 400: + $message = 'It should return a response with "Bad Request" Status.'; + + break; + case 404: + $message = 'It should return a response with "Not Found" Status.'; + + break; + + default: + $this->fail($message); + } + + $this->assertEquals($expectedStatusCode, $response->getStatusCode(), $message); + + $content = json_decode($response->getContent(), true); + + $this->assertEquals( + JSON_ERROR_NONE, + json_last_error(), + 'The response body should be a valid json document.' + ); + + return $content; + } +} diff --git a/tests/Unit/Utility/ContextMocker.php b/tests/Unit/Utility/ContextMocker.php new file mode 100644 index 0000000..11972c6 --- /dev/null +++ b/tests/Unit/Utility/ContextMocker.php @@ -0,0 +1,160 @@ +contextMocker = (new ContextMocker())->mockContext(); + * } + * + * + * public function tearDown(): void + * { + * parent::tearDown(); + * $this->contextMocker->resetContext(); + * } + */ +class ContextMocker +{ + /** + * @var Context + */ + private $backupContext; + + /** + * @var Context|null + */ + private $mockedContext; + + /** + * properly mock global context object with required properties + * with this mock front controllers are able to be tested + * + * @return static + */ + public function mockContext() + { + global $smarty; + + // need to reset loooot of things + Product::flushPriceCache(); + SpecificPrice::flushCache(); + Configuration::resetStaticCache(); + Configuration::loadConfiguration(); + Cache::clear(); + Cart::resetStaticCache(); + Carrier::resetStaticCache(); + CartRule::resetStaticCache(); + Currency::resetStaticCache(); + Shop::resetContext(); + SymfonyContainer::resetStaticCache(); + Pack::resetStaticCache(); + Tools::$round_mode = null; + Customer::resetAddressCache(); + Address::resetStaticCache(); + ObjectModel::resetStaticCache(); + Tools::resetStaticCache(); + + Cache::clean('*'); + + $this->backupContext(); + $context = clone $this->backupContext; + Context::setInstanceForTesting($context); + LegacyContext::setInstanceForTesting($context); + Module::setContextInstanceForTesting($context); + $context->shop = new Shop((int) Configuration::get('PS_SHOP_DEFAULT')); + Shop::setContext(Shop::CONTEXT_SHOP, (int) Context::getContext()->shop->id); + $context->customer = new Customer(); + $context->cookie = new Cookie('mycookie'); + $context->country = new Country((int) Configuration::get('PS_LANG_DEFAULT')); + $context->language = new Language((int) Configuration::get('PS_LANG_DEFAULT')); + // Use super admin employee by default + $context->employee = new Employee(1); + $context->employee->id_lang = $context->language->id; + $context->currency = Currency::getDefaultCurrency(); + $protocol_link = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) + ? 'https://' : 'http://'; + $protocol_content = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) + ? 'https://' : 'http://'; + $context->link = new Link($protocol_link, $protocol_content); + $context->cart = new Cart(); + $context->smarty = $smarty; + + $this->mockedContext = $context; + + return $this; + } + + /** + * Backup current context + */ + public function backupContext(): void + { + $this->backupContext = Context::getContext(); + } + + /** + * Restore previous context to avoid modifying global properties through tests + */ + public function resetContext() + { + Context::setInstanceForTesting($this->backupContext); + LegacyContext::setInstanceForTesting($this->backupContext); + // If a shop context was previously reset it, if not rest shop context + if (Context::getContext()->shop && Context::getContext()->shop->id) { + Shop::setContext(Shop::CONTEXT_SHOP, (int) Context::getContext()->shop->id); + } else { + Shop::resetContext(); + } + Module::setContextInstanceForTesting($this->backupContext); + } + + public function getMockedContext(): ?Context + { + return $this->mockedContext; + } + + public function getBackupContext(): ?Context + { + return $this->backupContext; + } + + public function getContext(): Context + { + if ($this->mockedContext) { + return $this->mockedContext; + } + + return $this->backupContext; + } +} diff --git a/tests/Unit/Utility/ContextMockerTrait.php b/tests/Unit/Utility/ContextMockerTrait.php new file mode 100644 index 0000000..8f4bb22 --- /dev/null +++ b/tests/Unit/Utility/ContextMockerTrait.php @@ -0,0 +1,88 @@ +backupContext(); + } + + /** + * Optionally you can ask for the context to be mocked, it will then be replaced with mock values and filled with + * most of the required context's values. + */ + protected static function mockContext(): void + { + if (!static::$contextMocker) { + static::$contextMocker = new ContextMocker(); + } + static::$contextMocker->mockContext(); + } + + protected static function getContext(): \Context + { + if (!static::$contextMocker) { + throw new \RuntimeException('No context mocker set, you cannot get a context that was never mocked or saved.'); + } + + return static::$contextMocker->getContext(); + } + + protected static function getMockedContext(): \Context + { + if (!static::$contextMocker) { + throw new \RuntimeException('No context mocker set, you cannot get a mocked context that was never mocked.'); + } + if (null === static::$contextMocker->getMockedContext()) { + throw new \RuntimeException('No context was mocked, to get a mocked context you need to first use ContextMockerTrait::mockContext method.'); + } + + return static::$contextMocker->getMockedContext(); + } + + protected static function resetContext(): void + { + if (!static::$contextMocker) { + throw new \RuntimeException('No context mocker set, you cannot reset a context that was never mocked or saved.'); + } + static::$contextMocker->resetContext(); + } +} diff --git a/tests/Unit/DatabaseTestCase.php b/tests/Unit/Utility/DatabaseTestCase.php similarity index 88% rename from tests/Unit/DatabaseTestCase.php rename to tests/Unit/Utility/DatabaseTestCase.php index 3e03393..18aa4a3 100644 --- a/tests/Unit/DatabaseTestCase.php +++ b/tests/Unit/Utility/DatabaseTestCase.php @@ -1,6 +1,6 @@ install(); From f4ac4306bf017f210b25e828131fadd7380d6391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Sat, 30 Mar 2024 18:03:08 +0700 Subject: [PATCH 09/11] chore: ignore tests for php cs fixer --- .php-cs-fixer.dist.php | 2 +- tests/Unit/Controllers/Front/ApiOrdersTest.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index c75b333..3864476 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,6 +4,6 @@ /** @var \Symfony\Component\Finder\Finder $finder */ $finder = $config->setUsingCache(true)->getFinder(); -$finder->in(__DIR__)->exclude(['vendor', 'vendor2', 'run']); +$finder->in(__DIR__)->exclude(['vendor', 'vendor2', 'run', 'tests']); return $config; diff --git a/tests/Unit/Controllers/Front/ApiOrdersTest.php b/tests/Unit/Controllers/Front/ApiOrdersTest.php index 03c735b..8676d29 100644 --- a/tests/Unit/Controllers/Front/ApiOrdersTest.php +++ b/tests/Unit/Controllers/Front/ApiOrdersTest.php @@ -6,7 +6,9 @@ class ApiOrdersTest extends ApiTestCase { public function testGetOrders(): void { - static::createClient()->request('GET', '/modules/miguel/orders.php'); + $route = $this->router->generate('module-miguel-orders'); + static::createClient()->request('GET', $route); + $this->assertResponseIsSuccessful(); } } From 96cb754fc2244e2fb19a6c774ece0f4b735aa48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Sat, 30 Mar 2024 22:22:02 +0700 Subject: [PATCH 10/11] ci: install module before running tests --- .github/scripts/build-zip.sh | 2 +- .github/workflows/php_tests.yml | 14 ++++++++++--- miguel.php | 2 +- .../Unit/Controllers/Front/ApiOrdersTest.php | 20 +++++++++++++++++-- tests/Unit/bootstrap.php | 14 +++++++------ 5 files changed, 39 insertions(+), 13 deletions(-) diff --git a/.github/scripts/build-zip.sh b/.github/scripts/build-zip.sh index e5b3b1a..2cde28c 100644 --- a/.github/scripts/build-zip.sh +++ b/.github/scripts/build-zip.sh @@ -19,7 +19,7 @@ remove_space_after_phpdoc() { tmpdir=$(mktemp -d) ignore=".git .github .idea .vscode .gitignore .php-cs-fixer.dist.php .php-cs-fixer.cache composer.lock assets tests run doc vendor2 docker-compose.yml docker-compose.test.yml Makefile *.zip" -result="$(PWD)/miguel.zip" +result="$(pwd)/miguel.zip" rm -rf "$result" diff --git a/.github/workflows/php_tests.yml b/.github/workflows/php_tests.yml index df849fa..278d8aa 100644 --- a/.github/workflows/php_tests.yml +++ b/.github/workflows/php_tests.yml @@ -168,8 +168,16 @@ jobs: env: MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - - name: Create module folder - run: mkdir -p vendor2/PrestaShop/modules/miguel + - name: Install module + run: | + bash .github/scripts/build-zip.sh + unzip -q miguel.zip -d vendor2/PrestaShop/modules/ + ls -al vendor2/PrestaShop/modules/ + php vendor2/PrestaShop/bin/console prestashop:module install miguel + + cp -r tests vendor2/PrestaShop/modules/miguel/ + ls -al vendor2/PrestaShop/modules/miguel/ - name: Run PHPUnit - run: phpunit -c ./tests/Unit/phpunit.xml + run: composer exec phpunit -- -c ./tests/Unit/phpunit.xml + working-directory: vendor2/PrestaShop/modules/miguel diff --git a/miguel.php b/miguel.php index f44a43d..b0172bb 100644 --- a/miguel.php +++ b/miguel.php @@ -736,7 +736,7 @@ public function hookDisplayCustomerAccount(array $params) public function hookModuleRoutes() { return [ - 'module-miguel-orders' => [ + 'module_miguel_orders' => [ 'rule' => 'modules/miguel/orders.php', 'keywords' => [], 'controller' => 'ApiOrders', diff --git a/tests/Unit/Controllers/Front/ApiOrdersTest.php b/tests/Unit/Controllers/Front/ApiOrdersTest.php index 8676d29..66fddef 100644 --- a/tests/Unit/Controllers/Front/ApiOrdersTest.php +++ b/tests/Unit/Controllers/Front/ApiOrdersTest.php @@ -1,14 +1,30 @@ router->generate('module-miguel-orders'); + $this->expectOutputString('{"orders":[]}'); + + $route = $this->router->generate('module_miguel_orders'); static::createClient()->request('GET', $route); $this->assertResponseIsSuccessful(); } + + public function testGetOrders(): void + { + $this->expectOutputString('{"orders":[]}'); + + $sut = new \MiguelApiOrdersModuleFrontController(); + $sut->displayAjax(); + + $this->assertResponseIsSuccessful(); + } } diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php index 337c452..90d4de5 100644 --- a/tests/Unit/bootstrap.php +++ b/tests/Unit/bootstrap.php @@ -2,15 +2,17 @@ require_once __DIR__ . '/../../vendor/autoload.php'; -if (file_exists(__DIR__ . '/../../vendor2/PrestaShop/tests-legacy')) { - require_once __DIR__ . '/../../vendor2/PrestaShop/tests-legacy/bootstrap.php'; +define('MIGUEL_PS_ROOT_DIR', dirname(__DIR__, 4)); + +if (file_exists(MIGUEL_PS_ROOT_DIR . '/tests-legacy')) { + require_once MIGUEL_PS_ROOT_DIR . '/tests-legacy/bootstrap.php'; } else { - require_once __DIR__ . '/../../vendor2/PrestaShop/tests/Unit/bootstrap.php'; + require_once MIGUEL_PS_ROOT_DIR . '/tests/Unit/bootstrap.php'; } -require_once __DIR__ . '/../../vendor2/PrestaShop/config/config.inc.php'; -require_once __DIR__ . '/../../vendor2/PrestaShop/config/defines_uri.inc.php'; -require_once __DIR__ . '/../../vendor2/PrestaShop/init.php'; +require_once MIGUEL_PS_ROOT_DIR . '/config/config.inc.php'; +require_once MIGUEL_PS_ROOT_DIR . '/config/defines_uri.inc.php'; +require_once MIGUEL_PS_ROOT_DIR . '/init.php'; require_once __DIR__ . '/../../miguel.php'; From 5bd8fe40d9fe201ef42d59e27329528774f42de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20K=C5=99=C3=AD=C5=BE?= Date: Sun, 31 Mar 2024 11:09:41 +0700 Subject: [PATCH 11/11] tests: make controller testing working --- .github/workflows/php_tests.yml | 28 +++++++++++++------ .../Unit/Controllers/Front/ApiOrdersTest.php | 4 +-- tests/Unit/Utility/ApiTestCase.php | 5 ++++ tests/Unit/bootstrap.php | 8 +++--- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/php_tests.yml b/.github/workflows/php_tests.yml index 278d8aa..a419997 100644 --- a/.github/workflows/php_tests.yml +++ b/.github/workflows/php_tests.yml @@ -92,24 +92,18 @@ jobs: # PrestaShop v1.7.8.x - php-version: '7.1' prestashop-version: '1.7.8.x' - phpunit-version: '^7.5' - php-version: '7.4' prestashop-version: '1.7.8.x' - phpunit-version: '^7.5' # PrestaShop v8.0.x - php-version: '7.2' prestashop-version: '8.0.x' - phpunit-version: '^8' - php-version: '8.1' prestashop-version: '8.0.x' - phpunit-version: '^9' # PrestaShop v8.1.x - php-version: '7.2' prestashop-version: '8.1.x' - phpunit-version: '^8' - php-version: '8.1' prestashop-version: '8.1.x' - phpunit-version: '^9' services: mysql: image: mysql:5.7 @@ -127,7 +121,7 @@ jobs: with: php-version: ${{ matrix.php-version }} coverage: xdebug - tools: composer:v2, phpunit:${{ matrix.phpunit-version }} + tools: composer:v2 extensions: gd, mbstring, zip, mcrypt, pdo_mysql, dom - name: Cache vendor folder @@ -171,13 +165,31 @@ jobs: - name: Install module run: | bash .github/scripts/build-zip.sh + + rm -rf vendor2/PrestaShop/modules/miguel unzip -q miguel.zip -d vendor2/PrestaShop/modules/ + ls -al vendor2/PrestaShop/modules/ php vendor2/PrestaShop/bin/console prestashop:module install miguel + rm -r vendor2/PrestaShop/modules/miguel/vendor cp -r tests vendor2/PrestaShop/modules/miguel/ + pushd vendor2/PrestaShop/modules/miguel/ + composer install --prefer-dist --no-progress --no-ansi --no-interaction + popd ls -al vendor2/PrestaShop/modules/miguel/ - name: Run PHPUnit - run: composer exec phpunit -- -c ./tests/Unit/phpunit.xml + run: | + php -d xdebug.auto_trace=ON -d xdebug.trace_output_dir=mytracedir/ vendor/bin/phpunit -c ./tests/Unit/phpunit.xml || true + if [ -d mytracedir ]; then + ls -al mytracedir + for file in mytracedir/*; do + echo "File: $file" + cat $file + done + + echo "Xdebug trace files found" + exit 1 + fi working-directory: vendor2/PrestaShop/modules/miguel diff --git a/tests/Unit/Controllers/Front/ApiOrdersTest.php b/tests/Unit/Controllers/Front/ApiOrdersTest.php index 66fddef..b221e20 100644 --- a/tests/Unit/Controllers/Front/ApiOrdersTest.php +++ b/tests/Unit/Controllers/Front/ApiOrdersTest.php @@ -12,8 +12,8 @@ public function testGetOrders2(): void { $this->expectOutputString('{"orders":[]}'); - $route = $this->router->generate('module_miguel_orders'); - static::createClient()->request('GET', $route); + $route = $this->getContext()->link->getModuleLink('miguel', 'ApiOrders'); + // static::createClient()->request('GET', $route); $this->assertResponseIsSuccessful(); } diff --git a/tests/Unit/Utility/ApiTestCase.php b/tests/Unit/Utility/ApiTestCase.php index c4c6dc9..e7d77f9 100644 --- a/tests/Unit/Utility/ApiTestCase.php +++ b/tests/Unit/Utility/ApiTestCase.php @@ -34,6 +34,11 @@ protected function setUp(): void $this->router = self::$container->get('router'); } + public function getContext(): \Context + { + return static::getContext(); + } + /** * @param string $route * @param array $params diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php index 90d4de5..7982a91 100644 --- a/tests/Unit/bootstrap.php +++ b/tests/Unit/bootstrap.php @@ -11,12 +11,12 @@ } require_once MIGUEL_PS_ROOT_DIR . '/config/config.inc.php'; -require_once MIGUEL_PS_ROOT_DIR . '/config/defines_uri.inc.php'; -require_once MIGUEL_PS_ROOT_DIR . '/init.php'; +// require_once MIGUEL_PS_ROOT_DIR . '/config/defines_uri.inc.php'; +// require_once MIGUEL_PS_ROOT_DIR . '/init.php'; require_once __DIR__ . '/../../miguel.php'; -$module = new Miguel(); -$module->install(); +// $module = new Miguel(); +// $module->install(); Miguel\Utils\MiguelSettings::reset();