diff --git a/docker/crontabs/root b/.docker/crontabs/root similarity index 100% rename from docker/crontabs/root rename to .docker/crontabs/root diff --git a/docker/logs/nginx/.gitkeep b/.docker/logs/nginx/.gitkeep similarity index 100% rename from docker/logs/nginx/.gitkeep rename to .docker/logs/nginx/.gitkeep diff --git a/docker/nginx/scripts/nginx.conf b/.docker/nginx/scripts/nginx.conf similarity index 93% rename from docker/nginx/scripts/nginx.conf rename to .docker/nginx/scripts/nginx.conf index c09bb9fe..3aa0b6b2 100644 --- a/docker/nginx/scripts/nginx.conf +++ b/.docker/nginx/scripts/nginx.conf @@ -32,10 +32,11 @@ http { include /etc/nginx/conf.d/*.conf; server { - listen 80; - listen [::]:80; - listen 443 default_server ssl http2; - listen [::]:443 ssl http2; + listen 80; + listen [::]:80; + listen 443 default_server ssl; + listen [::]:443 ssl; + http2 on; server_name _; root /app/public; diff --git a/docker/nginx/scripts/start.sh b/.docker/nginx/scripts/start.sh similarity index 100% rename from docker/nginx/scripts/start.sh rename to .docker/nginx/scripts/start.sh diff --git a/docker/nginx/scripts/v3.ext b/.docker/nginx/scripts/v3.ext similarity index 100% rename from docker/nginx/scripts/v3.ext rename to .docker/nginx/scripts/v3.ext diff --git a/docker/nginx/ssl/certs/.gitkeep b/.docker/nginx/ssl/certs/.gitkeep similarity index 100% rename from docker/nginx/ssl/certs/.gitkeep rename to .docker/nginx/ssl/certs/.gitkeep diff --git a/docker/nginx/ssl/private/.gitkeep b/.docker/nginx/ssl/private/.gitkeep similarity index 100% rename from docker/nginx/ssl/private/.gitkeep rename to .docker/nginx/ssl/private/.gitkeep diff --git a/.dockerignore b/.dockerignore index 30ae1aaa..31bb8931 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,10 +2,15 @@ /.gitignore /buddy.yml /ansible -/docker -!/docker/nginx/cert +/.docker +!/.docker/nginx/cert /tests /var/* +/phpstan* +/docker-compose.yml +/Dockerfile +/*.md +/.codecov.yml ###> php-cs-fixer/shim ### /.php-cs-fixer.cache diff --git a/.env b/.env index 48243088..8a79b222 100644 --- a/.env +++ b/.env @@ -33,9 +33,9 @@ APP_SECRET=c7dbd995176e079f857b6649b60ccf68 ###> doctrine/doctrine-bundle ### # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" -# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" +# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=17&charset=utf8" # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -DATABASE_URL=postgresql://127.0.0.1:5432/main?serverVersion=11&charset=utf8 +DATABASE_URL=postgresql://127.0.0.1:5432/main?serverVersion=17&charset=utf8 ###< doctrine/doctrine-bundle ### ###> symfony/messenger ### diff --git a/.env.docker b/.env.docker index 74b445db..38f8e50b 100644 --- a/.env.docker +++ b/.env.docker @@ -22,7 +22,7 @@ APP_HOST=repman.wip APP_DOMAIN_SEPARATOR=. APP_ORGANIZATION_SEPARATOR=. APP_URL_SCHEME=https -APP_ALLOWED_PACKAGE_TYPES=git,github,gitlab,bitbucket,subversion,mercurial,pear,artifact,path +APP_ALLOWED_PACKAGE_TYPES=git,github,gitlab,bitbucket,pear,artifact,path APP_GITLAB_API_URL=https://gitlab.com ###< app ### @@ -37,9 +37,9 @@ APP_SECRET=c7dbd995176e079f857b6649b60ccf68 ###> doctrine/doctrine-bundle ### # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" -# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" +# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=17&charset=utf8" # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -DATABASE_URL=postgresql://main:main@database:5432/main?serverVersion=11&charset=utf8 +DATABASE_URL=postgresql://main:main@database:5432/main?serverVersion=17&charset=utf8 ###< doctrine/doctrine-bundle ### ###> symfony/messenger ### diff --git a/.gitattributes b/.gitattributes index 1be8b777..ad36afa6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,7 +2,7 @@ /ansible export-ignore /bin/coverage-checker export-ignore -/docker export-ignore +/.docker export-ignore /tests export-ignore /.codecov.yml export-ignore /.dockerignore export-ignore diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 22d887ac..67805b76 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -29,17 +29,14 @@ jobs: fail-fast: false matrix: php: - - "7.4" - "8.0" postgresql: - - "11" + - "17" include: - - php: "7.4" - php-version: "7.4.2" - php: "8.0" php-version: "8.0.30" - - postgresql: "11" - postgresql-version: "11.7" + - postgresql: "17" + postgresql-version: "17.7" steps: - name: "Install OS dependencies" diff --git a/.gitignore b/.gitignore index b499ada6..896b39b9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,12 +27,12 @@ ###> Docker ### docker-compose.*.yml -/docker/logs/nginx/* -!/docker/logs/nginx/.gitkeep -/docker/nginx/ssl/certs/* -!/docker/nginx/ssl/certs/.gitkeep -/docker/nginx/ssl/private/* -!/docker/nginx/ssl/private/.gitkeep +/.docker/logs/nginx/* +!/.docker/logs/nginx/.gitkeep +/.docker/nginx/ssl/certs/* +!/.docker/nginx/ssl/certs/.gitkeep +/.docker/nginx/ssl/private/* +!/.docker/nginx/ssl/private/.gitkeep ###< Docker ### composer.phar diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index d75868b5..9395fa54 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,14 +1,17 @@ in(__DIR__.'/bin') + ->in(__DIR__.'/config') ->in(__DIR__.'/src') + ->in(__DIR__.'/public') ->in(__DIR__.'/tests') ; $config = new PhpCsFixer\Config(); return $config->setRiskyAllowed(true) ->setRules([ - '@PHP74Migration' => true, + '@PHP81Migration' => true, '@Symfony' => true, 'array_syntax' => ['syntax' => 'short'], 'blank_line_between_import_groups' => false, @@ -19,6 +22,7 @@ 'no_useless_return' => true, 'no_unused_imports' => true, 'declare_strict_types' => true, + 'native_function_invocation' => false, 'ordered_imports' => [ 'imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha', @@ -30,12 +34,11 @@ 'increment_style' => true, 'single_quote' => true, 'trim_array_spaces' => true, - 'single_blank_line_before_namespace' => true, 'yoda_style' => false, 'global_namespace_import' => [ - 'import_classes' => false, - 'import_constants' => false, - 'import_functions' => false, + 'import_classes' => true, + 'import_constants' => true, + 'import_functions' => true, ], // risky --> 'strict_param' => true, diff --git a/Dockerfile b/Dockerfile index e6ead352..278ffbdf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0.19-fpm-alpine +FROM php:8.1-fpm-alpine ARG TIMEZONE="UTC" diff --git a/bin/console b/bin/console index 760b980b..742f8531 100755 --- a/bin/console +++ b/bin/console @@ -1,6 +1,8 @@ #!/usr/bin/env php =5.5" }, "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3" + "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality." }, "type": "library", "autoload": { @@ -174,7 +161,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -185,7 +172,7 @@ } ], "description": "AWS Common Runtime for PHP", - "homepage": "http://aws.amazon.com/sdkforphp", + "homepage": "https://github.com/awslabs/aws-crt-php", "keywords": [ "amazon", "aws", @@ -194,40 +181,35 @@ ], "support": { "issues": "https://github.com/awslabs/aws-crt-php/issues", - "source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.2" + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.7" }, - "time": "2021-09-03T22:57:30+00:00" + "time": "2024-10-18T22:15:13+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.238.0", + "version": "3.337.3", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "f55a1f9e34e45d87628937f04bba170fe56015bb" + "reference": "06dfc8f76423b49aaa181debd25bbdc724c346d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f55a1f9e34e45d87628937f04bba170fe56015bb", - "reference": "f55a1f9e34e45d87628937f04bba170fe56015bb", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/06dfc8f76423b49aaa181debd25bbdc724c346d6", + "reference": "06dfc8f76423b49aaa181debd25bbdc724c346d6", + "shasum": "" }, "require": { - "aws/aws-crt-php": "^1.0.2", + "aws/aws-crt-php": "^1.2.3", "ext-json": "*", "ext-pcre": "*", "ext-simplexml": "*", "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", - "guzzlehttp/promises": "^1.4.0", - "guzzlehttp/psr7": "^1.8.5 || ^2.3", + "guzzlehttp/promises": "^1.4.0 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", "mtdowling/jmespath.php": "^2.6", - "php": ">=5.5" + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { "andrewsville/php-token-reflection": "^1.4", @@ -242,9 +224,9 @@ "ext-sockets": "*", "nette/neon": "^2.3", "paragonie/random_compat": ">= 2", - "phpunit/phpunit": "^4.8.35 || ^5.6.3 || ^9.5", - "psr/cache": "^1.0", - "psr/simple-cache": "^1.0", + "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", "sebastian/comparator": "^1.2.3 || ^4.0", "yoast/phpunit-polyfills": "^1.0" }, @@ -267,9 +249,12 @@ ], "psr-4": { "Aws\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/data/" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -294,57 +279,57 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.238.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.337.3" }, - "time": "2022-10-04T18:18:02+00:00" + "time": "2025-01-21T19:10:05+00:00" }, { "name": "bitbucket/client", - "version": "v4.1.0", + "version": "v4.7.0", "source": { "type": "git", "url": "https://github.com/BitbucketPHP/Client.git", - "reference": "c8a6e24ec71e987dde37207d4bd0810989c7a8b8" + "reference": "ef3a4eb1963572d7745afb7d707f56cbdb328ee4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/BitbucketPHP/Client/zipball/c8a6e24ec71e987dde37207d4bd0810989c7a8b8", - "reference": "c8a6e24ec71e987dde37207d4bd0810989c7a8b8", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/BitbucketPHP/Client/zipball/ef3a4eb1963572d7745afb7d707f56cbdb328ee4", + "reference": "ef3a4eb1963572d7745afb7d707f56cbdb328ee4", + "shasum": "" }, "require": { "ext-json": "*", - "php": "^7.2.5 || ^8.0", - "php-http/cache-plugin": "^1.7.5", - "php-http/client-common": "^2.5", - "php-http/discovery": "^1.14", - "php-http/httplug": "^2.2", - "php-http/multipart-stream-builder": "^1.2", + "php": "^7.4.15 || ^8.0.2", + "php-http/cache-plugin": "^1.8.1 || ^2.0", + "php-http/client-common": "^2.7.1", + "php-http/discovery": "^1.19.2", + "php-http/httplug": "^2.4", + "php-http/multipart-stream-builder": "^1.3", "psr/cache": "^1.0 || ^2.0 || ^3.0", "psr/http-client-implementation": "^1.0", "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.0", - "symfony/polyfill-php80": "^1.17" + "psr/http-message": "^1.1 || ^2.0", + "symfony/polyfill-php80": "^1.26" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "guzzlehttp/guzzle": "^7.4", - "http-interop/http-factory-guzzle": "^1.0", - "php-http/mock-client": "^1.5" + "bamarni/composer-bin-plugin": "^1.8.2", + "guzzlehttp/guzzle": "^7.8", + "http-interop/http-factory-guzzle": "^1.2", + "php-http/mock-client": "^1.6" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { "psr-4": { "Bitbucket\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -367,7 +352,7 @@ ], "support": { "issues": "https://github.com/BitbucketPHP/Client/issues", - "source": "https://github.com/BitbucketPHP/Client/tree/v4.1.0" + "source": "https://github.com/BitbucketPHP/Client/tree/v4.7.0" }, "funding": [ { @@ -379,36 +364,29 @@ "type": "tidelift" } ], - "time": "2022-01-23T19:14:04+00:00" + "time": "2024-03-17T21:09:02+00:00" }, { "name": "brick/math", - "version": "0.9.3", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", - "vimeo/psalm": "4.9.2" + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" }, "type": "library", "autoload": { @@ -416,7 +394,7 @@ "Brick\\Math\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -428,55 +406,50 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.9.3" + "source": "https://github.com/brick/math/tree/0.12.1" }, "funding": [ { "url": "https://github.com/BenMorel", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/brick/math", - "type": "tidelift" } ], - "time": "2021-08-15T20:50:18+00:00" + "time": "2023-11-29T23:19:16+00:00" }, { "name": "buddy-works/buddy-works-php-api", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/buddy-works/buddy-works-php-api.git", - "reference": "1c590b6801875f8c11d660c9dd43d077d20532e4" + "reference": "3f40e7439d690f632d294707e42f9cb4d61c81ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/buddy-works/buddy-works-php-api/zipball/1c590b6801875f8c11d660c9dd43d077d20532e4", - "reference": "1c590b6801875f8c11d660c9dd43d077d20532e4", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/buddy-works/buddy-works-php-api/zipball/3f40e7439d690f632d294707e42f9cb4d61c81ed", + "reference": "3f40e7439d690f632d294707e42f9cb4d61c81ed", + "shasum": "" }, "require": { "ext-mbstring": "*", "guzzlehttp/guzzle": "~6.0", - "php": "^7.3" + "php": "^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "phpstan/phpstan": "^0.11.19", - "phpunit/phpunit": "^8.4", - "rector/rector": "^0.5.22" + "friendsofphp/php-cs-fixer": "^3.0", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.11" }, "type": "library", "autoload": { @@ -484,7 +457,7 @@ "Buddy\\": "src/Buddy/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -514,9 +487,9 @@ ], "support": { "issues": "https://github.com/buddy-works/buddy-works-php-api/issues", - "source": "https://github.com/buddy-works/buddy-works-php-api/tree/master" + "source": "https://github.com/buddy-works/buddy-works-php-api/tree/1.4.0" }, - "time": "2020-04-01T09:42:46+00:00" + "time": "2021-08-26T08:05:09+00:00" }, { "name": "buddy-works/oauth2-client", @@ -530,13 +503,7 @@ "type": "zip", "url": "https://api.github.com/repos/buddy-works/oauth2-client/zipball/6544494863bf899634e77f95031d7fc67447cab3", "reference": "6544494863bf899634e77f95031d7fc67447cab3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-json": "*", @@ -554,7 +521,7 @@ "Buddy\\OAuth2\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -583,13 +550,7 @@ "type": "zip", "url": "https://api.github.com/repos/cbschuld/Browser.php/zipball/9d07d6410977d494d7b8ecc2f3c877645c5477d9", "reference": "9d07d6410977d494d7b8ecc2f3c877645c5477d9", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2" @@ -608,7 +569,7 @@ "src/Browser.php" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -634,30 +595,24 @@ }, { "name": "clue/mq-react", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/clue/reactphp-mq.git", - "reference": "6b57d63655760d6476b816ec481398afea52d677" + "reference": "cab0147723017bc2deb3f248c607ad8e3c87e509" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-mq/zipball/6b57d63655760d6476b816ec481398afea52d677", - "reference": "6b57d63655760d6476b816ec481398afea52d677", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/clue/reactphp-mq/zipball/cab0147723017bc2deb3f248c607ad8e3c87e509", + "reference": "cab0147723017bc2deb3f248c607ad8e3c87e509", + "shasum": "" }, "require": { "php": ">=5.3", "react/promise": "^3 || ^2.2.1 || ^1.2.1" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", "react/async": "^4 || ^3 || ^2", "react/event-loop": "^1.2", "react/http": "^1.8" @@ -668,7 +623,7 @@ "Clue\\React\\Mq\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -695,7 +650,7 @@ ], "support": { "issues": "https://github.com/clue/reactphp-mq/issues", - "source": "https://github.com/clue/reactphp-mq/tree/v1.5.0" + "source": "https://github.com/clue/reactphp-mq/tree/v1.6.0" }, "funding": [ { @@ -707,33 +662,27 @@ "type": "github" } ], - "time": "2022-09-30T11:30:02+00:00" + "time": "2023-07-28T14:12:19+00:00" }, { "name": "clue/stream-filter", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", + "shasum": "" }, "require": { "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -744,7 +693,7 @@ "Clue\\StreamFilter\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -755,7 +704,7 @@ } ], "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", + "homepage": "https://github.com/clue/stream-filter", "keywords": [ "bucket brigade", "callback", @@ -767,7 +716,7 @@ ], "support": { "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" + "source": "https://github.com/clue/stream-filter/tree/v1.7.0" }, "funding": [ { @@ -779,38 +728,32 @@ "type": "github" } ], - "time": "2022-02-21T13:15:14+00:00" + "time": "2023-12-20T15:40:13+00:00" }, { "name": "composer/ca-bundle", - "version": "1.3.3", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "30897edbfb15e784fe55587b4f73ceefd3c4d98c" + "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/30897edbfb15e784fe55587b4f73ceefd3c4d98c", - "reference": "30897edbfb15e784fe55587b4f73ceefd3c4d98c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/08c50d5ec4c6ced7d0271d2862dec8c1033283e6", + "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6", + "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8 || ^9", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -823,7 +766,7 @@ "Composer\\CaBundle\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -845,7 +788,80 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.3" + "source": "https://github.com/composer/ca-bundle/tree/1.5.5" + }, + "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": "2025-01-08T16:17:16+00:00" + }, + { + "name": "composer/class-map-generator", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/composer/class-map-generator.git", + "reference": "ffe442c5974c44a9343e37a0abcb1cc37319f5b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/ffe442c5974c44a9343e37a0abcb1cc37319f5b9", + "reference": "ffe442c5974c44a9343e37a0abcb1cc37319f5b9", + "shasum": "" + }, + "require": { + "composer/pcre": "^2.1 || ^3.1", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-phpunit": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1.1 || ^2", + "phpunit/phpunit": "^8", + "symfony/filesystem": "^5.4 || ^6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\ClassMapGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.6.0" }, "funding": [ { @@ -861,49 +877,52 @@ "type": "tidelift" } ], - "time": "2022-07-20T07:14:26+00:00" + "time": "2025-02-05T10:05:34+00:00" }, { "name": "composer/composer", - "version": "1.10.26", + "version": "2.8.5", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "3e196135eacf9e519a6b00986bc6fe6aff977997" + "reference": "ae208dc1e182bd45d99fcecb956501da212454a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/3e196135eacf9e519a6b00986bc6fe6aff977997", - "reference": "3e196135eacf9e519a6b00986bc6fe6aff977997", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/composer/composer/zipball/ae208dc1e182bd45d99fcecb956501da212454a1", + "reference": "ae208dc1e182bd45d99fcecb956501da212454a1", + "shasum": "" }, "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^5.2.10", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0", + "composer/ca-bundle": "^1.5", + "composer/class-map-generator": "^1.4.0", + "composer/metadata-minifier": "^1.0", + "composer/pcre": "^2.2 || ^3.2", + "composer/semver": "^3.3", + "composer/spdx-licenses": "^1.5.7", + "composer/xdebug-handler": "^2.0.2 || ^3.0.3", + "justinrainbow/json-schema": "^5.3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "react/promise": "^2.11 || ^3.2", "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" - }, - "conflict": { - "symfony/console": "2.8.38" + "seld/phar-utils": "^1.2", + "seld/signal-handler": "^2.0", + "symfony/console": "^5.4.35 || ^6.3.12 || ^7.0.3", + "symfony/filesystem": "^5.4.35 || ^6.3.12 || ^7.0.3", + "symfony/finder": "^5.4.35 || ^6.3.12 || ^7.0.3", + "symfony/polyfill-php73": "^1.24", + "symfony/polyfill-php80": "^1.24", + "symfony/polyfill-php81": "^1.24", + "symfony/process": "^5.4.35 || ^6.3.12 || ^7.0.3" }, "require-dev": { - "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2" + "phpstan/phpstan": "^1.11.8", + "phpstan/phpstan-deprecation-rules": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.0", + "phpstan/phpstan-symfony": "^1.4.0", + "symfony/phpunit-bridge": "^6.4.3 || ^7.0.1" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -915,16 +934,21 @@ ], "type": "library", "extra": { + "phpstan": { + "includes": [ + "phpstan/rules.neon" + ] + }, "branch-alias": { - "dev-master": "1.10-dev" + "dev-main": "2.8-dev" } }, "autoload": { "psr-4": { - "Composer\\": "src/Composer" + "Composer\\": "src/Composer/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -932,12 +956,12 @@ { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" + "homepage": "https://www.naderman.de" }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", @@ -948,9 +972,158 @@ "package" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.10.26" + "security": "https://github.com/composer/composer/security/policy", + "source": "https://github.com/composer/composer/tree/2.8.5" + }, + "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": "2025-01-21T14:23:40+00:00" + }, + { + "name": "composer/metadata-minifier", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2", + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\MetadataMinifier\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.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": "2021-04-07T13:37:33+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "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.3.2" }, "funding": [ { @@ -966,38 +1139,33 @@ "type": "tidelift" } ], - "time": "2022-04-13T14:39:56+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "1.7.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -1005,7 +1173,7 @@ "Composer\\Semver\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1034,9 +1202,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.7.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -1052,27 +1220,21 @@ "type": "tidelift" } ], - "time": "2020-12-03T15:47:16+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.7", + "version": "1.5.8", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "c848241796da2abf65837d51dce1fae55a960149" + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149", - "reference": "c848241796da2abf65837d51dce1fae55a960149", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" @@ -1092,7 +1254,7 @@ "Composer\\Spdx\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1120,9 +1282,9 @@ "validator" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" }, "funding": [ { @@ -1138,35 +1300,31 @@ "type": "tidelift" } ], - "time": "2022-05-23T07:37:50+00:00" + "time": "2023-11-20T07:44:33+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.6", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -1174,7 +1332,7 @@ "Composer\\XdebugHandler\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1190,9 +1348,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -1208,49 +1366,121 @@ "type": "tidelift" } ], - "time": "2021-03-25T17:01:18+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "doctrine/annotations", - "version": "1.13.3", + "name": "dflydev/dot-access-data", + "version": "v3.0.3", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", - "vimeo/psalm": "^4.10" + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + "Dflydev\\DotAccessData\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" + }, + "time": "2024-07-08T12:26:09+00:00" + }, + { + "name": "doctrine/annotations", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/901c2ee5d26eb64ff43c47976e114bf00843acf7", + "reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2 || ^3", + "ext-tokenizer": "*", + "php": "^7.2 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^2.0", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.10.28", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1285,9 +1515,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" + "source": "https://github.com/doctrine/annotations/tree/2.0.2" }, - "time": "2022-07-02T10:48:51+00:00" + "time": "2024-09-05T10:17:24+00:00" }, { "name": "doctrine/cache", @@ -1301,13 +1531,7 @@ "type": "zip", "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "~7.1 || ^8.0" @@ -1329,7 +1553,7 @@ "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1390,41 +1614,37 @@ }, { "name": "doctrine/collections", - "version": "1.8.0", + "version": "2.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" + "reference": "d8af7f248c74f195f7347424600fd9e17b57af59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", - "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/collections/zipball/d8af7f248c74f195f7347424600fd9e17b57af59", + "reference": "d8af7f248c74f195f7347424600fd9e17b57af59", + "shasum": "" }, "require": { - "doctrine/deprecations": "^0.5.3 || ^1", - "php": "^7.1.3 || ^8.0" + "doctrine/deprecations": "^1", + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9.0 || ^10.0", - "phpstan/phpstan": "^1.4.8", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", - "vimeo/psalm": "^4.22" + "doctrine/coding-standard": "^12", + "ext-json": "*", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.11" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + "Doctrine\\Common\\Collections\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1460,32 +1680,40 @@ ], "support": { "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/1.8.0" + "source": "https://github.com/doctrine/collections/tree/2.2.2" }, - "time": "2022-09-01T20:12:10+00:00" + "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%2Fcollections", + "type": "tidelift" + } + ], + "time": "2024-04-18T06:56:21+00:00" }, { "name": "doctrine/common", - "version": "3.4.2", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "609c3a7b6af49a7b4b13945ca2fdf4af801946af" + "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/609c3a7b6af49a7b4b13945ca2fdf4af801946af", - "reference": "609c3a7b6af49a7b4b13945ca2fdf4af801946af", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/common/zipball/d9ea4a54ca2586db781f0265d36bea731ac66ec5", + "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5", + "shasum": "" }, "require": { - "doctrine/persistence": "^2.0 || ^3.0", + "doctrine/persistence": "^2.0 || ^3.0 || ^4.0", "php": "^7.1 || ^8.0" }, "require-dev": { @@ -1504,7 +1732,7 @@ "Doctrine\\Common\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1543,7 +1771,7 @@ ], "support": { "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.4.2" + "source": "https://github.com/doctrine/common/tree/3.5.0" }, "funding": [ { @@ -1559,48 +1787,42 @@ "type": "tidelift" } ], - "time": "2022-09-28T14:20:50+00:00" + "time": "2025-01-01T22:12:03+00:00" }, { "name": "doctrine/dbal", - "version": "3.4.5", + "version": "3.9.4", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "a5a58773109c0abb13e658c8ccd92aeec8d07f9e" + "reference": "ec16c82f20be1a7224e65ac67144a29199f87959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/a5a58773109c0abb13e658c8ccd92aeec8d07f9e", - "reference": "a5a58773109c0abb13e658c8ccd92aeec8d07f9e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/dbal/zipball/ec16c82f20be1a7224e65ac67144a29199f87959", + "reference": "ec16c82f20be1a7224e65ac67144a29199f87959", + "shasum": "" }, "require": { "composer-runtime-api": "^2", "doctrine/cache": "^1.11|^2.0", "doctrine/deprecations": "^0.5.3|^1", - "doctrine/event-manager": "^1.0", + "doctrine/event-manager": "^1|^2", "php": "^7.4 || ^8.0", "psr/cache": "^1|^2|^3", "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "10.0.0", - "jetbrains/phpstorm-stubs": "2022.2", - "phpstan/phpstan": "1.8.3", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "9.5.24", - "psalm/plugin-phpunit": "0.17.0", - "squizlabs/php_codesniffer": "3.7.1", - "symfony/cache": "^5.4|^6.0", - "symfony/console": "^4.4|^5.4|^6.0", - "vimeo/psalm": "4.27.0" + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "9.6.22", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.10.2", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -1614,7 +1836,7 @@ "Doctrine\\DBAL\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1660,7 +1882,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.4.5" + "source": "https://github.com/doctrine/dbal/tree/3.9.4" }, "funding": [ { @@ -1676,35 +1898,31 @@ "type": "tidelift" } ], - "time": "2022-09-23T17:48:57+00:00" + "time": "2025-01-16T08:28:55+00:00" }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1712,10 +1930,10 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1723,68 +1941,68 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2022-05-02T15:47:09+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/doctrine-bundle", - "version": "2.7.0", + "version": "2.13.2", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "d2088fc50494e4e7441fecca54732245a613eeb6" + "reference": "2363c43d9815a11657e452625cd64172d5587486" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/d2088fc50494e4e7441fecca54732245a613eeb6", - "reference": "d2088fc50494e4e7441fecca54732245a613eeb6", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/2363c43d9815a11657e452625cd64172d5587486", + "reference": "2363c43d9815a11657e452625cd64172d5587486", + "shasum": "" }, "require": { - "doctrine/annotations": "^1", "doctrine/cache": "^1.11 || ^2.0", - "doctrine/dbal": "^2.13.1|^3.3.2", - "doctrine/persistence": "^2.2|^3", + "doctrine/dbal": "^3.7.0 || ^4.0", + "doctrine/persistence": "^2.2 || ^3", "doctrine/sql-formatter": "^1.0.1", - "php": "^7.1 || ^8.0", - "symfony/cache": "^4.3.3|^5.0|^6.0", - "symfony/config": "^4.4.3|^5.0|^6.0", - "symfony/console": "^3.4.30|^4.3.3|^5.0|^6.0", - "symfony/dependency-injection": "^4.4.18|^5.0|^6.0", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/doctrine-bridge": "^4.4.22|^5.2.7|^6.0", - "symfony/framework-bundle": "^3.4.30|^4.3.3|^5.0|^6.0", - "symfony/service-contracts": "^1.1.1|^2.0|^3" + "php": "^7.4 || ^8.0", + "symfony/cache": "^5.4 || ^6.0 || ^7.0", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/doctrine-bridge": "^5.4.46 || ~6.3.12 || ^6.4.3 || ^7.0.3", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1.1 || ^2.0 || ^3" }, "conflict": { - "doctrine/orm": "<2.10|>=3.0", - "twig/twig": "<1.34|>=2.0,<2.4" + "doctrine/annotations": ">=3.0", + "doctrine/orm": "<2.17 || >=4.0", + "twig/twig": "<1.34 || >=2.0 <2.4" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "doctrine/orm": "^2.11 || ^3.0", + "doctrine/annotations": "^1 || ^2", + "doctrine/coding-standard": "^12", + "doctrine/deprecations": "^1.0", + "doctrine/orm": "^2.17 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.3 || ^10.0", - "psalm/plugin-phpunit": "^0.16.1", - "psalm/plugin-symfony": "^3", - "psr/log": "^1.1.4|^2.0|^3.0", - "symfony/phpunit-bridge": "^5.2|^6.0", - "symfony/property-info": "^4.3.3|^5.0|^6.0", - "symfony/proxy-manager-bridge": "^3.4|^4.3.3|^5.0|^6.0", - "symfony/security-bundle": "^4.4|^5.0|^6.0", - "symfony/twig-bridge": "^3.4.30|^4.3.3|^5.0|^6.0", - "symfony/validator": "^3.4.30|^4.3.3|^5.0|^6.0", - "symfony/web-profiler-bundle": "^3.4.30|^4.3.3|^5.0|^6.0", - "symfony/yaml": "^3.4.30|^4.3.3|^5.0|^6.0", - "twig/twig": "^1.34|^2.12|^3.0", - "vimeo/psalm": "^4.7" + "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-phpunit": "2.0.3", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^9.5.26", + "psr/log": "^1.1.4 || ^2.0 || ^3.0", + "symfony/phpunit-bridge": "^6.1 || ^7.0", + "symfony/property-info": "^5.4 || ^6.0 || ^7.0", + "symfony/proxy-manager-bridge": "^5.4 || ^6.0", + "symfony/security-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", + "symfony/string": "^5.4 || ^6.0 || ^7.0", + "symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0", + "symfony/validator": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^5.4 || ^6.2 || ^7.0", + "symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0", + "twig/twig": "^1.34 || ^2.12 || ^3.0" }, "suggest": { "doctrine/orm": "The Doctrine ORM integration is optional in the bundle.", @@ -1794,10 +2012,10 @@ "type": "symfony-bundle", "autoload": { "psr-4": { - "Doctrine\\Bundle\\DoctrineBundle\\": "" + "Doctrine\\Bundle\\DoctrineBundle\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1829,7 +2047,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineBundle/issues", - "source": "https://github.com/doctrine/DoctrineBundle/tree/2.7.0" + "source": "https://github.com/doctrine/DoctrineBundle/tree/2.13.2" }, "funding": [ { @@ -1845,55 +2063,50 @@ "type": "tidelift" } ], - "time": "2022-06-10T10:55:26+00:00" + "time": "2025-01-15T11:12:38+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", - "version": "3.2.2", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", - "reference": "3393f411ba25ade21969c33f2053220044854d01" + "reference": "e858ce0f5c12b266dce7dce24834448355155da7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/3393f411ba25ade21969c33f2053220044854d01", - "reference": "3393f411ba25ade21969c33f2053220044854d01", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/e858ce0f5c12b266dce7dce24834448355155da7", + "reference": "e858ce0f5c12b266dce7dce24834448355155da7", + "shasum": "" }, "require": { - "doctrine/doctrine-bundle": "~1.0|~2.0", + "doctrine/doctrine-bundle": "^2.4", "doctrine/migrations": "^3.2", - "php": "^7.2|^8.0", - "symfony/framework-bundle": "~3.4|~4.0|~5.0|~6.0" + "php": "^7.2 || ^8.0", + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", - "doctrine/orm": "^2.6", - "doctrine/persistence": "^1.3||^2.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^8.0|^9.0", - "vimeo/psalm": "^4.11" + "composer/semver": "^3.0", + "doctrine/coding-standard": "^12", + "doctrine/orm": "^2.6 || ^3", + "doctrine/persistence": "^2.0 || ^3", + "phpstan/phpstan": "^1.4 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-phpunit": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1.1 || ^2", + "phpstan/phpstan-symfony": "^1.3 || ^2", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/phpunit-bridge": "^6.3 || ^7", + "symfony/var-exporter": "^5.4 || ^6 || ^7" }, "type": "symfony-bundle", "autoload": { "psr-4": { - "Doctrine\\Bundle\\MigrationsBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Doctrine\\Bundle\\MigrationsBundle\\": "src" + } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1920,7 +2133,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineMigrationsBundle/issues", - "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.2.2" + "source": "https://github.com/doctrine/DoctrineMigrationsBundle/tree/3.4.1" }, "funding": [ { @@ -1936,47 +2149,41 @@ "type": "tidelift" } ], - "time": "2022-02-01T18:08:07+00:00" + "time": "2025-01-27T22:48:22+00:00" }, { "name": "doctrine/event-manager", - "version": "1.1.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "eb2ecf80e3093e8f3c2769ac838e27d8ede8e683" + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/eb2ecf80e3093e8f3c2769ac838e27d8ede8e683", - "reference": "eb2ecf80e3093e8f3c2769ac838e27d8ede8e683", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e", + "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "conflict": { "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "~1.4.10 || ^1.5.4", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" + "Doctrine\\Common\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2017,7 +2224,7 @@ ], "support": { "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.1.2" + "source": "https://github.com/doctrine/event-manager/tree/2.0.1" }, "funding": [ { @@ -2033,38 +2240,32 @@ "type": "tidelift" } ], - "time": "2022-07-27T22:18:11+00:00" + "time": "2024-05-22T20:47:39+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.5", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "ade2b3bbfb776f27f0558e26eed43b5d9fe1b392" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/ade2b3bbfb776f27f0558e26eed43b5d9fe1b392", - "reference": "ade2b3bbfb776f27f0558e26eed43b5d9fe1b392", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { @@ -2072,7 +2273,7 @@ "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2114,7 +2315,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.5" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -2130,40 +2331,34 @@ "type": "tidelift" } ], - "time": "2022-09-07T09:01:28+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "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": { @@ -2171,7 +2366,7 @@ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2190,7 +2385,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -2206,44 +2401,39 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.3", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2272,7 +2462,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "source": "https://github.com/doctrine/lexer/tree/3.0.1" }, "funding": [ { @@ -2288,58 +2478,52 @@ "type": "tidelift" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2024-02-05T11:56:58+00:00" }, { "name": "doctrine/migrations", - "version": "3.5.2", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "61c6ef3a10b7df43c3b6388a184754f26e58700a" + "reference": "5007eb1168691225ac305fe16856755c20860842" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/61c6ef3a10b7df43c3b6388a184754f26e58700a", - "reference": "61c6ef3a10b7df43c3b6388a184754f26e58700a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/migrations/zipball/5007eb1168691225ac305fe16856755c20860842", + "reference": "5007eb1168691225ac305fe16856755c20860842", + "shasum": "" }, "require": { "composer-runtime-api": "^2", - "doctrine/dbal": "^3.3", + "doctrine/dbal": "^3.6 || ^4", "doctrine/deprecations": "^0.5.3 || ^1", - "doctrine/event-manager": "^1.0", - "friendsofphp/proxy-manager-lts": "^1.0", - "php": "^7.4 || ^8.0", + "doctrine/event-manager": "^1.2 || ^2.0", + "php": "^8.1", "psr/log": "^1.1.3 || ^2 || ^3", - "symfony/console": "^4.4.16 || ^5.4 || ^6.0", - "symfony/stopwatch": "^4.4 || ^5.4 || ^6.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^6.2 || ^7.0" }, "conflict": { - "doctrine/orm": "<2.12" + "doctrine/orm": "<2.12 || >=4" }, "require-dev": { - "doctrine/coding-standard": "^9", - "doctrine/orm": "^2.12", + "doctrine/coding-standard": "^12", + "doctrine/orm": "^2.13 || ^3", "doctrine/persistence": "^2 || ^3", "doctrine/sql-formatter": "^1.0", - "ergebnis/composer-normalize": "^2.9", "ext-pdo_sqlite": "*", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.1", - "phpstan/phpstan-symfony": "^1.1", - "phpunit/phpunit": "^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "symfony/process": "^4.4 || ^5.4 || ^6.0", - "symfony/yaml": "^4.4 || ^5.4 || ^6.0" + "fig/log-test": "^1", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.4", + "phpstan/phpstan-symfony": "^1.3", + "phpunit/phpunit": "^10.3", + "symfony/cache": "^5.4 || ^6.0 || ^7.0", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", @@ -2349,18 +2533,12 @@ "bin/doctrine-migrations" ], "type": "library", - "extra": { - "composer-normalize": { - "indent-size": 4, - "indent-style": "space" - } - }, "autoload": { "psr-4": { - "Doctrine\\Migrations\\": "lib/Doctrine/Migrations" + "Doctrine\\Migrations\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2387,7 +2565,7 @@ ], "support": { "issues": "https://github.com/doctrine/migrations/issues", - "source": "https://github.com/doctrine/migrations/tree/3.5.2" + "source": "https://github.com/doctrine/migrations/tree/3.8.2" }, "funding": [ { @@ -2403,61 +2581,57 @@ "type": "tidelift" } ], - "time": "2022-08-04T14:29:49+00:00" + "time": "2024-10-10T21:35:27+00:00" }, { "name": "doctrine/orm", - "version": "2.13.2", + "version": "2.20.2", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "a8b02fd70fa777ca8278b9604fdef75c15c6a12f" + "reference": "19912de9270fa6abb3d25a1a37784af6b818d534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/a8b02fd70fa777ca8278b9604fdef75c15c6a12f", - "reference": "a8b02fd70fa777ca8278b9604fdef75c15c6a12f", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/orm/zipball/19912de9270fa6abb3d25a1a37784af6b818d534", + "reference": "19912de9270fa6abb3d25a1a37784af6b818d534", + "shasum": "" }, "require": { "composer-runtime-api": "^2", "doctrine/cache": "^1.12.1 || ^2.1.1", - "doctrine/collections": "^1.5", + "doctrine/collections": "^1.5 || ^2.1", "doctrine/common": "^3.0.3", "doctrine/dbal": "^2.13.1 || ^3.2", "doctrine/deprecations": "^0.5.3 || ^1", - "doctrine/event-manager": "^1.1", + "doctrine/event-manager": "^1.2 || ^2", "doctrine/inflector": "^1.4 || ^2.0", - "doctrine/instantiator": "^1.3", - "doctrine/lexer": "^1.2.3", + "doctrine/instantiator": "^1.3 || ^2", + "doctrine/lexer": "^2 || ^3", "doctrine/persistence": "^2.4 || ^3", "ext-ctype": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3", - "symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", "symfony/polyfill-php72": "^1.23", "symfony/polyfill-php80": "^1.16" }, "conflict": { - "doctrine/annotations": "<1.13 || >= 2.0" + "doctrine/annotations": "<1.13 || >= 3.0" }, "require-dev": { - "doctrine/annotations": "^1.13", - "doctrine/coding-standard": "^9.0.2 || ^10.0", + "doctrine/annotations": "^1.13 || ^2", + "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "~1.4.10 || 1.8.5", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpstan/extension-installer": "~1.1.0 || ^1.4", + "phpstan/phpstan": "~1.4.10 || 2.0.3", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", - "squizlabs/php_codesniffer": "3.7.1", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.27.0" + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-dom": "Provides support for XSD validation for XML mapping files", @@ -2470,10 +2644,10 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\ORM\\": "lib/Doctrine/ORM" + "Doctrine\\ORM\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2507,50 +2681,40 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.13.2" + "source": "https://github.com/doctrine/orm/tree/2.20.2" }, - "time": "2022-09-22T13:36:43+00:00" + "time": "2025-02-04T19:17:01+00:00" }, { "name": "doctrine/persistence", - "version": "3.0.3", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "ac6fce61f037d7e54dbb2435f5b5648d86548e23" + "reference": "0ea965320cec355dba75031c1b23d4c78362e3ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/ac6fce61f037d7e54dbb2435f5b5648d86548e23", - "reference": "ac6fce61f037d7e54dbb2435f5b5648d86548e23", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/persistence/zipball/0ea965320cec355dba75031c1b23d4c78362e3ff", + "reference": "0ea965320cec355dba75031c1b23d4c78362e3ff", + "shasum": "" }, "require": { - "doctrine/event-manager": "^1.0", + "doctrine/event-manager": "^1 || ^2", "php": "^7.2 || ^8.0", "psr/cache": "^1.0 || ^2.0 || ^3.0" }, "conflict": { - "doctrine/annotations": "<1.7 || >=2.0", "doctrine/common": "<2.10" }, "require-dev": { - "composer/package-versions-deprecated": "^1.11", - "doctrine/annotations": "^1.7", - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^12", "doctrine/common": "^3.0", - "phpstan/phpstan": "1.5.0", + "phpstan/phpstan": "1.12.7", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "vimeo/psalm": "4.22.0" + "phpunit/phpunit": "^8.5.38 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0 || ^7.0" }, "type": "library", "autoload": { @@ -2558,7 +2722,7 @@ "Doctrine\\Persistence\\": "src/Persistence" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2599,7 +2763,7 @@ ], "support": { "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/3.0.3" + "source": "https://github.com/doctrine/persistence/tree/3.4.0" }, "funding": [ { @@ -2615,33 +2779,30 @@ "type": "tidelift" } ], - "time": "2022-08-04T21:14:21+00:00" + "time": "2024-10-30T19:48:12+00:00" }, { "name": "doctrine/sql-formatter", - "version": "1.1.3", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/doctrine/sql-formatter.git", - "reference": "25a06c7bf4c6b8218f47928654252863ffc890a5" + "reference": "d6d00aba6fd2957fe5216fe2b7673e9985db20c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/25a06c7bf4c6b8218f47928654252863ffc890a5", - "reference": "25a06c7bf4c6b8218f47928654252863ffc890a5", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/d6d00aba6fd2957fe5216fe2b7673e9985db20c8", + "reference": "d6d00aba6fd2957fe5216fe2b7673e9985db20c8", + "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4" + "doctrine/coding-standard": "^12", + "ergebnis/phpunit-slow-test-detector": "^2.14", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5" }, "bin": [ "bin/sql-formatter" @@ -2652,7 +2813,7 @@ "Doctrine\\SqlFormatter\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2671,39 +2832,32 @@ ], "support": { "issues": "https://github.com/doctrine/sql-formatter/issues", - "source": "https://github.com/doctrine/sql-formatter/tree/1.1.3" + "source": "https://github.com/doctrine/sql-formatter/tree/1.5.2" }, - "time": "2022-05-23T21:33:49+00:00" + "time": "2025-01-24T11:45:48+00:00" }, { "name": "egulias/email-validator", - "version": "3.2.1", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715" + "reference": "b115554301161fa21467629f1e1391c1936de517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/f88dcf4b14af14a98ad96b14b2b317969eab6715", - "reference": "f88dcf4b14af14a98ad96b14b2b317969eab6715", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b115554301161fa21467629f1e1391c1936de517", + "reference": "b115554301161fa21467629f1e1391c1936de517", + "shasum": "" }, "require": { - "doctrine/lexer": "^1.2", - "php": ">=7.2", - "symfony/polyfill-intl-idn": "^1.15" + "doctrine/lexer": "^2.0 || ^3.0", + "php": ">=8.1", + "symfony/polyfill-intl-idn": "^1.26" }, "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -2711,7 +2865,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -2719,7 +2873,7 @@ "Egulias\\EmailValidator\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2739,7 +2893,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.2.1" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.3" }, "funding": [ { @@ -2747,41 +2901,35 @@ "type": "github" } ], - "time": "2022-06-18T20:57:19+00:00" + "time": "2024-12-27T00:36:43+00:00" }, { "name": "evenement/evenement", - "version": "v3.0.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/igorw/evenement.git", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" }, "require": { "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9 || ^6" }, "type": "library", "autoload": { - "psr-0": { - "Evenement": "src" + "psr-4": { + "Evenement\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2798,38 +2946,32 @@ ], "support": { "issues": "https://github.com/igorw/evenement/issues", - "source": "https://github.com/igorw/evenement/tree/master" + "source": "https://github.com/igorw/evenement/tree/v3.0.2" }, - "time": "2017-07-23T21:35:13+00:00" + "time": "2023-08-08T05:53:35+00:00" }, { "name": "excelwebzone/recaptcha-bundle", - "version": "v1.5.35", + "version": "v1.5.42", "source": { "type": "git", "url": "https://github.com/excelwebzone/EWZRecaptchaBundle.git", - "reference": "8dad97a2017dcb650c18ff17ff1b8c54c1847dac" + "reference": "c1728fab6dc1a880e1b76298c5092f2ca25dac8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/excelwebzone/EWZRecaptchaBundle/zipball/8dad97a2017dcb650c18ff17ff1b8c54c1847dac", - "reference": "8dad97a2017dcb650c18ff17ff1b8c54c1847dac", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/excelwebzone/EWZRecaptchaBundle/zipball/c1728fab6dc1a880e1b76298c5092f2ca25dac8f", + "reference": "c1728fab6dc1a880e1b76298c5092f2ca25dac8f", + "shasum": "" }, "require": { "google/recaptcha": "^1.1", "php": "^7.1 || ^8.0", - "symfony/form": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/security-bundle": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/validator": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/yaml": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/form": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/security-bundle": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/validator": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/yaml": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", "twig/twig": "^1.40 || ^2.9 || ^3.0" }, "require-dev": { @@ -2846,7 +2988,7 @@ "EWZ\\Bundle\\RecaptchaBundle\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2864,9 +3006,9 @@ ], "support": { "issues": "https://github.com/excelwebzone/EWZRecaptchaBundle/issues", - "source": "https://github.com/excelwebzone/EWZRecaptchaBundle/tree/v1.5.35" + "source": "https://github.com/excelwebzone/EWZRecaptchaBundle/tree/v1.5.42" }, - "time": "2022-04-22T16:52:19+00:00" + "time": "2025-02-03T20:57:06+00:00" }, { "name": "fig/http-message-util", @@ -2880,13 +3022,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" @@ -2905,7 +3041,7 @@ "Fig\\Http\\Message\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2930,126 +3066,32 @@ }, "time": "2020-11-24T22:02:12+00:00" }, - { - "name": "friendsofphp/proxy-manager-lts", - "version": "v1.0.12", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/proxy-manager-lts.git", - "reference": "8419f0158715b30d4b99a5bd37c6a39671994ad7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/proxy-manager-lts/zipball/8419f0158715b30d4b99a5bd37c6a39671994ad7", - "reference": "8419f0158715b30d4b99a5bd37c6a39671994ad7", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "laminas/laminas-code": "~3.4.1|^4.0", - "php": ">=7.1", - "symfony/filesystem": "^4.4.17|^5.0|^6.0" - }, - "conflict": { - "laminas/laminas-stdlib": "<3.2.1", - "zendframework/zend-stdlib": "<3.2.1" - }, - "replace": { - "ocramius/proxy-manager": "^2.1" - }, - "require-dev": { - "ext-phar": "*", - "symfony/phpunit-bridge": "^5.4|^6.0" - }, - "type": "library", - "extra": { - "thanks": { - "name": "ocramius/proxy-manager", - "url": "https://github.com/Ocramius/ProxyManager" - } - }, - "autoload": { - "psr-4": { - "ProxyManager\\": "src/ProxyManager" - } - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - } - ], - "description": "Adding support for a wider range of PHP versions to ocramius/proxy-manager", - "homepage": "https://github.com/FriendsOfPHP/proxy-manager-lts", - "keywords": [ - "aop", - "lazy loading", - "proxy", - "proxy pattern", - "service proxies" - ], - "support": { - "issues": "https://github.com/FriendsOfPHP/proxy-manager-lts/issues", - "source": "https://github.com/FriendsOfPHP/proxy-manager-lts/tree/v1.0.12" - }, - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ocramius/proxy-manager", - "type": "tidelift" - } - ], - "time": "2022-05-05T09:31:05+00:00" - }, { "name": "google/recaptcha", - "version": "1.2.4", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/google/recaptcha.git", - "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419" + "reference": "d59a801e98a4e9174814a6d71bbc268dff1202df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/recaptcha/zipball/614f25a9038be4f3f2da7cbfd778dc5b357d2419", - "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/google/recaptcha/zipball/d59a801e98a4e9174814a6d71bbc268dff1202df", + "reference": "d59a801e98a4e9174814a6d71bbc268dff1202df", + "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=8" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.2.20|^2.15", - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11" + "friendsofphp/php-cs-fixer": "^3.14", + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^10" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -3057,7 +3099,7 @@ "ReCaptcha\\": "src/ReCaptcha" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -3074,7 +3116,7 @@ "issues": "https://github.com/google/recaptcha/issues", "source": "https://github.com/google/recaptcha" }, - "time": "2020-03-31T17:50:54+00:00" + "time": "2023-02-18T17:41:46+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3088,13 +3130,7 @@ "type": "zip", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-json": "*", @@ -3125,7 +3161,7 @@ "GuzzleHttp\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3199,23 +3235,17 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "shasum": "" }, "require": { "php": ">=5.5" @@ -3224,11 +3254,6 @@ "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -3237,7 +3262,7 @@ "GuzzleHttp\\Promise\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3269,7 +3294,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/1.5.3" }, "funding": [ { @@ -3285,27 +3310,21 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:55:35+00:00" + "time": "2023-05-21T12:31:43+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "shasum": "" }, "require": { "php": ">=5.4.0", @@ -3323,11 +3342,6 @@ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -3336,7 +3350,7 @@ "GuzzleHttp\\Psr7\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3385,7 +3399,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.0" + "source": "https://github.com/guzzle/psr7/tree/1.9.1" }, "funding": [ { @@ -3401,7 +3415,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:03+00:00" + "time": "2023-04-17T16:00:37+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -3415,13 +3429,7 @@ "type": "zip", "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "guzzlehttp/psr7": "^1.7||^2.0", @@ -3444,7 +3452,7 @@ "Http\\Factory\\Guzzle\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3469,34 +3477,28 @@ }, { "name": "jean85/pretty-package-versions", - "version": "2.0.5", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^0.12.66", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -3509,7 +3511,7 @@ "Jean85\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3528,32 +3530,26 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2021-10-08T21:21:46+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.12", + "version": "5.3.0", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + "url": "https://github.com/jsonrainbow/json-schema.git", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", @@ -3564,17 +3560,12 @@ "bin/validate-json" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, "autoload": { "psr-4": { "JsonSchema\\": "src/JsonSchema/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3603,35 +3594,29 @@ "schema" ], "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" }, - "time": "2022-04-13T08:02:27+00:00" + "time": "2024-07-06T21:00:26+00:00" }, { "name": "knplabs/github-api", - "version": "v3.8.0", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "a43662d7c9d4032768ec829dde2cf143878a4104" + "reference": "25d7bafd6b0dd088d4850aef7fcc74dc4fba8b28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/a43662d7c9d4032768ec829dde2cf143878a4104", - "reference": "a43662d7c9d4032768ec829dde2cf143878a4104", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/25d7bafd6b0dd088d4850aef7fcc74dc4fba8b28", + "reference": "25d7bafd6b0dd088d4850aef7fcc74dc4fba8b28", + "shasum": "" }, "require": { "ext-json": "*", "php": "^7.2.5 || ^8.0", - "php-http/cache-plugin": "^1.7.1", + "php-http/cache-plugin": "^1.7.1|^2.0", "php-http/client-common": "^2.3", "php-http/discovery": "^1.12", "php-http/httplug": "^2.2", @@ -3639,13 +3624,13 @@ "psr/cache": "^1.0|^2.0|^3.0", "psr/http-client-implementation": "^1.0", "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0|^2.0", "symfony/deprecation-contracts": "^2.2|^3.0", "symfony/polyfill-php80": "^1.17" }, "require-dev": { "guzzlehttp/guzzle": "^7.2", - "guzzlehttp/psr7": "^1.7", + "guzzlehttp/psr7": "^2.7", "http-interop/http-factory-guzzle": "^1.0", "php-http/mock-client": "^1.4.1", "phpstan/extension-installer": "^1.0.5", @@ -3659,7 +3644,7 @@ "extra": { "branch-alias": { "dev-2.x": "2.20.x-dev", - "dev-master": "3.4.x-dev" + "dev-master": "3.15-dev" } }, "autoload": { @@ -3667,7 +3652,7 @@ "Github\\": "lib/Github/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3692,7 +3677,7 @@ ], "support": { "issues": "https://github.com/KnpLabs/php-github-api/issues", - "source": "https://github.com/KnpLabs/php-github-api/tree/v3.8.0" + "source": "https://github.com/KnpLabs/php-github-api/tree/v3.16.0" }, "funding": [ { @@ -3700,42 +3685,35 @@ "type": "github" } ], - "time": "2022-08-01T18:58:16+00:00" + "time": "2024-11-07T19:35:30+00:00" }, { "name": "knpuniversity/oauth2-client-bundle", - "version": "v2.10.1", + "version": "v2.18.3", "source": { "type": "git", "url": "https://github.com/knpuniversity/oauth2-client-bundle.git", - "reference": "0f4b238f16793ea6d2225044cfeae41b148a5c49" + "reference": "c38ca88a70aae3694ca346a41b13b9a8f6e33ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/knpuniversity/oauth2-client-bundle/zipball/0f4b238f16793ea6d2225044cfeae41b148a5c49", - "reference": "0f4b238f16793ea6d2225044cfeae41b148a5c49", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/knpuniversity/oauth2-client-bundle/zipball/c38ca88a70aae3694ca346a41b13b9a8f6e33ed4", + "reference": "c38ca88a70aae3694ca346a41b13b9a8f6e33ed4", + "shasum": "" }, "require": { "league/oauth2-client": "^2.0", - "php": ">=7.2.5", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0" + "php": ">=8.1", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0" }, "require-dev": { "league/oauth2-facebook": "^1.1|^2.0", - "phpstan/phpstan": "^0.12", - "symfony/phpunit-bridge": "^5.3.1|^6.0", - "symfony/security-guard": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/phpunit-bridge": "^5.4|^6.0|^7.0", + "symfony/security-guard": "^5.4", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "suggest": { "symfony/security-guard": "For integration with Symfony's Guard Security layer" @@ -3746,7 +3724,7 @@ "KnpU\\OAuth2ClientBundle\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3764,132 +3742,155 @@ ], "support": { "issues": "https://github.com/knpuniversity/oauth2-client-bundle/issues", - "source": "https://github.com/knpuniversity/oauth2-client-bundle/tree/v2.10.1" + "source": "https://github.com/knpuniversity/oauth2-client-bundle/tree/v2.18.3" }, - "time": "2022-05-24T17:36:38+00:00" + "time": "2024-10-02T14:26:09+00:00" }, { - "name": "laminas/laminas-code", - "version": "4.7.0", + "name": "league/commonmark", + "version": "2.6.1", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-code.git", - "reference": "0337d9265bc2e6376babad8c511500821620cb30" + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "d990688c91cedfb69753ffc2512727ec646df2ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/0337d9265bc2e6376babad8c511500821620cb30", - "reference": "0337d9265bc2e6376babad8c511500821620cb30", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d990688c91cedfb69753ffc2512727ec646df2ad", + "reference": "d990688c91cedfb69753ffc2512727ec646df2ad", + "shasum": "" }, "require": { - "php": ">=7.4, <8.2" + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "doctrine/annotations": "^1.13.2", - "ext-phar": "*", - "laminas/laminas-coding-standard": "^2.3.0", - "laminas/laminas-stdlib": "^3.6.1", - "phpunit/phpunit": "^9.5.10", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.13.1" + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 | ^7.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0" }, "suggest": { - "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", - "laminas/laminas-stdlib": "Laminas\\Stdlib component" + "symfony/yaml": "v2.3+ required if using the Front Matter extension" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.7-dev" + } + }, "autoload": { - "files": [ - "polyfill/ReflectionEnumPolyfill.php" - ], "psr-4": { - "Laminas\\Code\\": "src/" + "League\\CommonMark\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Extensions to the PHP Reflection API, static code scanning, and code generation", - "homepage": "https://laminas.dev", - "keywords": [ - "code", - "laminas", - "laminasframework" - ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-code/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-code/issues", - "rss": "https://github.com/laminas/laminas-code/releases.atom", - "source": "https://github.com/laminas/laminas-code" + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" }, "funding": [ { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" } ], - "time": "2022-09-13T10:33:30+00:00" + "time": "2024-12-29T14:10:59+00:00" }, { - "name": "league/commonmark", - "version": "1.6.7", + "name": "league/config", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/commonmark.git", - "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b" + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2b8185c13bc9578367a5bf901881d1c1b5bbd09b", - "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" }, "require-dev": { - "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.2", - "erusev/parsedown": "~1.0", - "ext-json": "*", - "github/gfm": "0.29.0", - "michelf/php-markdown": "~1.4", - "mikehaertl/php-shellcommand": "^1.4", - "phpstan/phpstan": "^0.12.90", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", - "scrutinizer/ocular": "^1.5", - "symfony/finder": "^4.2" + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" }, - "bin": [ - "bin/commonmark" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, "autoload": { "psr-4": { - "League\\CommonMark\\": "src" + "League\\Config\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -3901,23 +3902,22 @@ "role": "Lead Developer" } ], - "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)", - "homepage": "https://commonmark.thephpleague.com", + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", "keywords": [ - "commonmark", - "flavored", - "gfm", - "github", - "github-flavored", - "markdown", - "md", - "parser" + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" ], "support": { - "docs": "https://commonmark.thephpleague.com/", - "issues": "https://github.com/thephpleague/commonmark/issues", - "rss": "https://github.com/thephpleague/commonmark/releases.atom", - "source": "https://github.com/thephpleague/commonmark" + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" }, "funding": [ { @@ -3931,172 +3931,152 @@ { "url": "https://github.com/colinodell", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/commonmark", - "type": "tidelift" } ], - "time": "2022-01-13T17:18:13+00:00" + "time": "2022-12-11T20:36:23+00:00" }, { "name": "league/flysystem", - "version": "1.1.10", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + "reference": "8aaffb653c5777781b0f7f69a5d937baf7ab6cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8aaffb653c5777781b0f7f69a5d937baf7ab6cdb", + "reference": "8aaffb653c5777781b0f7f69a5d937baf7ab6cdb", + "shasum": "" }, "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" + "ext-json": "*", + "league/mime-type-detection": "^1.0.0", + "php": "^7.2 || ^8.0" }, "conflict": { - "league/flysystem-sftp": "<1.0.6" + "guzzlehttp/ringphp": "<1.1.1" }, "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + "async-aws/s3": "^1.5", + "async-aws/simple-s3": "^1.0", + "aws/aws-sdk-php": "^3.132.4", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "friendsofphp/php-cs-fixer": "^3.2", + "google/cloud-storage": "^1.23", + "phpseclib/phpseclib": "^2.0", + "phpstan/phpstan": "^0.12.26", + "phpunit/phpunit": "^8.5 || ^9.4", + "sabre/dav": "^4.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { - "League\\Flysystem\\": "src/" + "League\\Flysystem\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" + "email": "info@frankdejonge.nl" } ], - "description": "Filesystem abstraction: Many filesystems, one API.", + "description": "File storage abstraction for PHP", "keywords": [ - "Cloud Files", "WebDAV", - "abstraction", "aws", "cloud", - "copy.com", - "dropbox", - "file systems", + "file", "files", "filesystem", "filesystems", "ftp", - "rackspace", - "remote", "s3", "sftp", "storage" ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + "source": "https://github.com/thephpleague/flysystem/tree/2.5.0" }, "funding": [ { - "url": "https://offset.earth/frankdejonge", - "type": "other" + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" } ], - "time": "2022-10-04T09:16:37+00:00" + "time": "2022-09-17T21:02:32+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "1.0.30", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "af286f291ebab6877bac0c359c6c2cb017eb061d" + "reference": "2ae435f7177fd5d3afc0090bc7f849093d8361e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/af286f291ebab6877bac0c359c6c2cb017eb061d", - "reference": "af286f291ebab6877bac0c359c6c2cb017eb061d", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/2ae435f7177fd5d3afc0090bc7f849093d8361e8", + "reference": "2ae435f7177fd5d3afc0090bc7f849093d8361e8", + "shasum": "" }, "require": { - "aws/aws-sdk-php": "^3.20.0", - "league/flysystem": "^1.0.40", - "php": ">=5.5.0" + "aws/aws-sdk-php": "^3.132.4", + "league/flysystem": "^2.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^7.2 || ^8.0" }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "~1.0.1", - "phpspec/phpspec": "^2.0.0" + "conflict": { + "guzzlehttp/ringphp": "<1.1.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { - "League\\Flysystem\\AwsS3v3\\": "src/" + "League\\Flysystem\\AwsS3V3\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" + "email": "info@frankdejonge.nl" } ], - "description": "Flysystem adapter for the AWS S3 SDK v3.x", + "description": "AWS S3 filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "aws", + "file", + "files", + "filesystem", + "s3", + "storage" + ], "support": { "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/1.0.30" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/2.5.0" }, "funding": [ { - "url": "https://offset.earth/frankdejonge", + "url": "https://ecologi.com/frankdejonge", "type": "custom" }, { @@ -4108,59 +4088,46 @@ "type": "tidelift" } ], - "time": "2022-07-02T13:51:38+00:00" + "time": "2022-09-09T19:33:51+00:00" }, { "name": "league/flysystem-bundle", - "version": "1.6.1", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-bundle.git", - "reference": "f022c006e09ed3bb58d7783696183bfa9d46c775" + "reference": "52fa43da7901a1d8098082e5c182aae0fe6f02f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-bundle/zipball/f022c006e09ed3bb58d7783696183bfa9d46c775", - "reference": "f022c006e09ed3bb58d7783696183bfa9d46c775", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/flysystem-bundle/zipball/52fa43da7901a1d8098082e5c182aae0fe6f02f0", + "reference": "52fa43da7901a1d8098082e5c182aae0fe6f02f0", + "shasum": "" }, "require": { - "league/flysystem": "^1.0.40", - "php": ">=7.1", - "symfony/config": "^4.2|^5.0", - "symfony/dependency-injection": "^4.2|^5.0", - "symfony/http-kernel": "^4.2|^5.0", - "symfony/options-resolver": "^4.2|^5.0" + "league/flysystem": "^2.1|^3.0", + "php": ">=7.2", + "symfony/config": "^4.2|^5.0|^6.0", + "symfony/dependency-injection": "^4.2|^5.0|^6.0", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^4.2|^5.0|^6.0", + "symfony/options-resolver": "^4.2|^5.0|^6.0" }, "conflict": { - "async-aws/flysystem-s3": "<1.0", - "league/flysystem-aws-s3-v3": "<1.0.22", "league/flysystem-cached-adapter": "<1.0.9" }, "require-dev": { - "async-aws/flysystem-s3": "^1.0", - "league/flysystem-aws-s3-v3": "^1.0.22", - "league/flysystem-azure-blob-storage": "^0.1.5", - "league/flysystem-cached-adapter": "^1.0.9", - "league/flysystem-memory": "^1.0", - "league/flysystem-rackspace": "^1.0", - "league/flysystem-replicate-adapter": "^1.0", - "league/flysystem-sftp": "^1.0", - "league/flysystem-webdav": "^1.0", - "league/flysystem-ziparchive": "^1.0", - "phpunit/phpunit": "^7.4", - "spatie/flysystem-dropbox": "^1.0", - "superbalist/flysystem-google-storage": "^7.2", - "symfony/dotenv": "^4.2|^5.0", - "symfony/framework-bundle": "^4.2|^5.0", - "symfony/var-dumper": "^4.1|^5.0", - "symfony/yaml": "^4.2|^5.0" + "league/flysystem-async-aws-s3": "^2.0|^3.0", + "league/flysystem-aws-s3-v3": "^2.0|^3.0", + "league/flysystem-ftp": "^2.0|^3.0", + "league/flysystem-google-cloud-storage": "^2.0|^3.0", + "league/flysystem-memory": "^2.0|^3.0", + "league/flysystem-sftp-v3": "^2.0|^3.0", + "symfony/dotenv": "^4.2|^5.0|^6.0", + "symfony/framework-bundle": "^4.2|^5.0|^6.0", + "symfony/phpunit-bridge": "^5.2", + "symfony/var-dumper": "^4.1|^5.0|^6.0", + "symfony/yaml": "^4.2|^5.0|^6.0" }, "type": "symfony-bundle", "autoload": { @@ -4168,7 +4135,7 @@ "League\\FlysystemBundle\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4181,95 +4148,32 @@ "description": "Symfony bundle integrating Flysystem into Symfony 4.2+ applications", "support": { "issues": "https://github.com/thephpleague/flysystem-bundle/issues", - "source": "https://github.com/thephpleague/flysystem-bundle/tree/1.6.1" - }, - "time": "2022-09-12T07:30:01+00:00" - }, - { - "name": "league/flysystem-cached-adapter", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "league/flysystem": "~1.0", - "psr/cache": "^1.0.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" - }, - "type": "library", - "autoload": { - "psr-4": { - "League\\Flysystem\\Cached\\": "src/" - } - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "frankdejonge", - "email": "info@frenky.net" - } - ], - "description": "An adapter decorator to enable meta-data caching.", - "support": { - "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues", - "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master" + "source": "https://github.com/thephpleague/flysystem-bundle/tree/2.4.0" }, - "time": "2020-07-25T15:56:04+00:00" + "time": "2022-09-12T07:31:10+00:00" }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -4277,7 +4181,7 @@ "League\\MimeTypeDetection\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4290,7 +4194,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" }, "funding": [ { @@ -4302,51 +4206,40 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2024-09-21T08:32:55+00:00" }, { "name": "league/oauth2-client", - "version": "2.6.1", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "2334c249907190c132364f5dae0287ab8666aa19" + "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/2334c249907190c132364f5dae0287ab8666aa19", - "reference": "2334c249907190c132364f5dae0287ab8666aa19", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/3d5cf8d0543731dfb725ab30e4d7289891991e13", + "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13", + "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0 || ^7.0", - "paragonie/random_compat": "^1 || ^2 || ^9.99", - "php": "^5.6 || ^7.0 || ^8.0" + "ext-json": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "php": "^7.1 || >=8.0.0 <8.5.0" }, "require-dev": { "mockery/mockery": "^1.3.5", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpunit/phpunit": "^5.7 || ^6.0 || ^9.5", - "squizlabs/php_codesniffer": "^2.3 || ^3.0" + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "League\\OAuth2\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4376,29 +4269,23 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth2-client/issues", - "source": "https://github.com/thephpleague/oauth2-client/tree/2.6.1" + "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.0" }, - "time": "2021-12-22T16:42:49+00:00" + "time": "2024-12-11T05:05:52+00:00" }, { "name": "league/oauth2-github", - "version": "3.0.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-github.git", - "reference": "266e9589a99e75bf696314e9ad8224009fccb91c" + "reference": "84211f62b757f7266fe605a0aa874a32f52c24fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-github/zipball/266e9589a99e75bf696314e9ad8224009fccb91c", - "reference": "266e9589a99e75bf696314e9ad8224009fccb91c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/oauth2-github/zipball/84211f62b757f7266fe605a0aa874a32f52c24fd", + "reference": "84211f62b757f7266fe605a0aa874a32f52c24fd", + "shasum": "" }, "require": { "ext-json": "*", @@ -4421,7 +4308,7 @@ "League\\OAuth2\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4448,58 +4335,58 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth2-github/issues", - "source": "https://github.com/thephpleague/oauth2-github/tree/3.0.0" + "source": "https://github.com/thephpleague/oauth2-github/tree/3.1.1" }, - "time": "2021-05-10T13:15:40+00:00" + "time": "2024-09-03T10:42:10+00:00" }, { "name": "m4tthumphrey/php-gitlab-api", - "version": "11.6.0", + "version": "11.14.0", "source": { "type": "git", "url": "https://github.com/GitLabPHP/Client.git", - "reference": "0f38333b31499d3bd850bbb2267eb719df2e279b" + "reference": "6b805882e1478873cc89ee62d2decf74eee2d5f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GitLabPHP/Client/zipball/0f38333b31499d3bd850bbb2267eb719df2e279b", - "reference": "0f38333b31499d3bd850bbb2267eb719df2e279b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/GitLabPHP/Client/zipball/6b805882e1478873cc89ee62d2decf74eee2d5f2", + "reference": "6b805882e1478873cc89ee62d2decf74eee2d5f2", + "shasum": "" }, "require": { "ext-json": "*", "ext-xml": "*", - "php": "^7.2.5 || ^8.0", - "php-http/cache-plugin": "^1.7.5", - "php-http/client-common": "^2.5", - "php-http/discovery": "^1.14", - "php-http/httplug": "^2.2", - "php-http/multipart-stream-builder": "^1.2", + "php": "^7.4.15 || ^8.0.2", + "php-http/cache-plugin": "^1.8.1 || ^2.0", + "php-http/client-common": "^2.7.1", + "php-http/discovery": "^1.19.2", + "php-http/httplug": "^2.4", + "php-http/multipart-stream-builder": "^1.3", "psr/cache": "^1.0 || ^2.0 || ^3.0", "psr/http-client-implementation": "^1.0", "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.0", - "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" + "psr/http-message": "^1.1 || ^2.0", + "symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/polyfill-php80": "^1.26" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "guzzlehttp/guzzle": "^7.4", - "http-interop/http-factory-guzzle": "^1.0" + "bamarni/composer-bin-plugin": "^1.8.2", + "guzzlehttp/guzzle": "^7.8", + "http-interop/http-factory-guzzle": "^1.2" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { "psr-4": { "Gitlab\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4532,7 +4419,7 @@ ], "support": { "issues": "https://github.com/GitLabPHP/Client/issues", - "source": "https://github.com/GitLabPHP/Client/tree/11.6.0" + "source": "https://github.com/GitLabPHP/Client/tree/11.14.0" }, "funding": [ { @@ -4540,52 +4427,47 @@ "type": "github" } ], - "time": "2022-01-23T19:13:35+00:00" + "time": "2024-03-17T21:35:56+00:00" }, { "name": "monolog/monolog", - "version": "2.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50" + "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/720488632c590286b88b80e62aa3d3d551ad4a50", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4", + "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4", + "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "psr/log-implementation": "3.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "aws/aws-sdk-php": "^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2", - "guzzlehttp/guzzle": "^7.4", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -4608,7 +4490,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -4616,7 +4498,7 @@ "Monolog\\": "src/Monolog" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4636,7 +4518,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.8.0" + "source": "https://github.com/Seldaek/monolog/tree/3.8.1" }, "funding": [ { @@ -4648,35 +4530,29 @@ "type": "tidelift" } ], - "time": "2022-07-24T11:55:47+00:00" + "time": "2024-12-05T17:15:07+00:00" }, { "name": "mtdowling/jmespath.php", - "version": "2.6.1", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/jmespath/jmespath.php.git", - "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" + "reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", - "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/a2a865e05d5f420b50cc2f85bb78d565db12a6bc", + "reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc", + "shasum": "" }, "require": { - "php": "^5.4 || ^7.0 || ^8.0", + "php": "^7.2.5 || ^8.0", "symfony/polyfill-mbstring": "^1.17" }, "require-dev": { - "composer/xdebug-handler": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^7.5.15" + "composer/xdebug-handler": "^3.0.3", + "phpunit/phpunit": "^8.5.33" }, "bin": [ "bin/jp.php" @@ -4684,7 +4560,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.8-dev" } }, "autoload": { @@ -4695,11 +4571,16 @@ "JmesPath\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", @@ -4713,9 +4594,9 @@ ], "support": { "issues": "https://github.com/jmespath/jmespath.php/issues", - "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1" + "source": "https://github.com/jmespath/jmespath.php/tree/2.8.0" }, - "time": "2021-06-14T00:11:39+00:00" + "time": "2024-09-04T18:46:31+00:00" }, { "name": "munusphp/munus", @@ -4729,13 +4610,7 @@ "type": "zip", "url": "https://api.github.com/repos/munusphp/munus/zipball/486f85ca7a8dbdcaac6b9ce4229c2f522b748169", "reference": "486f85ca7a8dbdcaac6b9ce4229c2f522b748169", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" @@ -4753,7 +4628,7 @@ "Munus\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4772,76 +4647,81 @@ }, { "name": "nelmio/api-doc-bundle", - "version": "v4.10.1", + "version": "v4.36.1", "source": { "type": "git", "url": "https://github.com/nelmio/NelmioApiDocBundle.git", - "reference": "b42ac43bebe0dc3372e9feb0ef0a43ae3cfbb349" + "reference": "cdc855ef8e6a811336c3a6c72fe99fbe13a78e37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/b42ac43bebe0dc3372e9feb0ef0a43ae3cfbb349", - "reference": "b42ac43bebe0dc3372e9feb0ef0a43ae3cfbb349", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/cdc855ef8e6a811336c3a6c72fe99fbe13a78e37", + "reference": "cdc855ef8e6a811336c3a6c72fe99fbe13a78e37", + "shasum": "" }, "require": { - "doctrine/annotations": "^1.11", "ext-json": "*", - "php": ">=7.2", - "phpdocumentor/reflection-docblock": "^3.1|^4.0|^5.0", - "psr/cache": "^1.0|^2.0|^3.0", - "psr/container": "^1.0|^2.0", - "psr/log": "^1.0|^2.0|^3.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/options-resolver": "^4.4|^5.0|^6.0", - "symfony/property-info": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "zircote/swagger-php": "^4.2.15" + "php": ">=7.4", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0", + "phpdocumentor/type-resolver": "^1.8.2", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/container": "^1.0 || ^2.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/config": "^5.4 || ^6.4 || ^7.1", + "symfony/console": "^5.4 || ^6.4 || ^7.1", + "symfony/dependency-injection": "^5.4 || ^6.4 || ^7.1", + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/framework-bundle": "^5.4.24 || ^6.4 || ^7.1", + "symfony/http-foundation": "^5.4 || ^6.4 || ^7.1", + "symfony/http-kernel": "^5.4 || ^6.4 || ^7.1", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.1", + "symfony/property-info": "^5.4.10 || ^6.4 || ^7.1", + "symfony/routing": "^5.4 || ^6.4 || ^7.1", + "zircote/swagger-php": "^4.11.1 || ^5.0" }, "conflict": { - "symfony/framework-bundle": "4.2.7" + "zircote/swagger-php": "4.8.7" }, "require-dev": { - "api-platform/core": "^2.7.0|^3@dev", + "api-platform/core": "^2.7.0 || ^3", "composer/package-versions-deprecated": "1.11.99.1", - "friendsofsymfony/rest-bundle": "^2.8|^3.0", - "jms/serializer": "^1.14|^3.0", - "jms/serializer-bundle": "^2.3|^3.0|^4.0|^5.0@beta", - "sensio/framework-extra-bundle": "^4.4|^5.2|^6.0", - "symfony/asset": "^4.4|^5.2|^6.0", - "symfony/browser-kit": "^4.4|^5.2|^6.0", - "symfony/cache": "^4.4|^5.2|^6.0", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/dom-crawler": "^4.4|^5.2|^6.0", - "symfony/form": "^4.4|^5.2|^6.0", - "symfony/phpunit-bridge": "^5.2", - "symfony/property-access": "^4.4|^5.2|^6.0", - "symfony/serializer": "^4.4|^5.2|^6.0", - "symfony/stopwatch": "^4.4|^5.2|^6.0", - "symfony/templating": "^4.4|^5.2|^6.0", - "symfony/twig-bundle": "^4.4|^5.2|^6.0", - "symfony/validator": "^4.4|^5.2|^6.0", - "willdurand/hateoas-bundle": "^1.0|^2.0" + "doctrine/annotations": "^2.0", + "friendsofphp/php-cs-fixer": "^3.52", + "friendsofsymfony/rest-bundle": "^2.8 || ^3.0", + "jms/serializer": "^1.14 || ^3.0", + "jms/serializer-bundle": "^2.3 || ^3.0 || ^4.0 || ^5.0", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpstan/phpstan-symfony": "^1.3", + "phpunit/phpunit": "^9.6 || ^10.5", + "symfony/asset": "^5.4 || ^6.4 || ^7.1", + "symfony/browser-kit": "^5.4 || ^6.4 || ^7.1", + "symfony/cache": "^5.4 || ^6.4 || ^7.1", + "symfony/dom-crawler": "^5.4 || ^6.4 || ^7.1", + "symfony/expression-language": "^5.4 || ^6.4 || ^7.1", + "symfony/form": "^5.4 || ^6.4 || ^7.1", + "symfony/phpunit-bridge": "^6.4", + "symfony/property-access": "^5.4 || ^6.4 || ^7.1", + "symfony/security-csrf": "^5.4 || ^6.4 || ^7.1", + "symfony/serializer": "^5.4 || ^6.4 || ^7.1", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.1", + "symfony/templating": "^5.4 || ^6.4 || ^7.1", + "symfony/twig-bundle": "^5.4 || ^6.4 || ^7.1", + "symfony/uid": "^5.4 || ^6.4 || ^7.1", + "symfony/validator": "^5.4 || ^6.4 || ^7.1", + "willdurand/hateoas-bundle": "^1.0 || ^2.0" }, "suggest": { "api-platform/core": "For using an API oriented framework.", + "doctrine/annotations": "For using doctrine annotations", "friendsofsymfony/rest-bundle": "For using the parameters annotations.", "jms/serializer-bundle": "For describing your models.", "symfony/asset": "For using the Swagger UI.", "symfony/cache": "For using a PSR-6 compatible cache implementation with the API doc generator.", "symfony/form": "For describing your form type models.", "symfony/monolog-bundle": "For using a PSR-3 compatible logger implementation with the API PHP describer.", + "symfony/security-csrf": "For using csrf protection tokens in forms.", "symfony/serializer": "For describing your models.", "symfony/twig-bundle": "For using the Swagger UI.", "symfony/validator": "For describing the validation constraints in your models.", @@ -4855,27 +4735,20 @@ }, "autoload": { "psr-4": { - "Nelmio\\ApiDocBundle\\": "" - }, - "exclude-from-classmap": [ - "Tests/" - ] + "Nelmio\\ApiDocBundle\\": "src/" + } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Nelmio", - "homepage": "http://nelm.io" - }, { "name": "Symfony Community", "homepage": "https://github.com/nelmio/NelmioApiDocBundle/contributors" } ], - "description": "Generates documentation for your REST API from annotations", + "description": "Generates documentation for your REST API from annotations and attributes", "keywords": [ "api", "doc", @@ -4884,41 +4757,42 @@ ], "support": { "issues": "https://github.com/nelmio/NelmioApiDocBundle/issues", - "source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.10.1" + "source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.36.1" }, - "time": "2022-09-28T20:10:51+00:00" + "funding": [ + { + "url": "https://github.com/DjordyKoert", + "type": "github" + } + ], + "time": "2025-01-19T17:01:30+00:00" }, { "name": "nelmio/cors-bundle", - "version": "2.2.0", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/nelmio/NelmioCorsBundle.git", - "reference": "0ee5ee30b0ee08ea122d431ae6e0ddeb87f035c0" + "reference": "3a526fe025cd20e04a6a11370cf5ab28dbb5a544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/0ee5ee30b0ee08ea122d431ae6e0ddeb87f035c0", - "reference": "0ee5ee30b0ee08ea122d431ae6e0ddeb87f035c0", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/3a526fe025cd20e04a6a11370cf5ab28dbb5a544", + "reference": "3a526fe025cd20e04a6a11370cf5ab28dbb5a544", + "shasum": "" }, "require": { - "symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0" + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "mockery/mockery": "^1.2", - "symfony/phpunit-bridge": "^4.3 || ^5.0 || ^6.0" + "mockery/mockery": "^1.3.6", + "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -4929,7 +4803,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4951,80 +4825,281 @@ ], "support": { "issues": "https://github.com/nelmio/NelmioCorsBundle/issues", - "source": "https://github.com/nelmio/NelmioCorsBundle/tree/2.2.0" + "source": "https://github.com/nelmio/NelmioCorsBundle/tree/2.5.0" }, - "time": "2021-12-01T09:34:27+00:00" + "time": "2024-06-24T21:25:28+00:00" }, { - "name": "nyholm/psr7", - "version": "1.5.1", + "name": "nette/schema", + "version": "v1.3.2", "source": { "type": "git", - "url": "https://github.com/Nyholm/psr7.git", - "reference": "f734364e38a876a23be4d906a2a089e1315be18a" + "url": "https://github.com/nette/schema.git", + "reference": "da801d52f0354f70a638673c4a0f04e16529431d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/f734364e38a876a23be4d906a2a089e1315be18a", - "reference": "f734364e38a876a23be4d906a2a089e1315be18a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/nette/schema/zipball/da801d52f0354f70a638673c4a0f04e16529431d", + "reference": "da801d52f0354f70a638673c4a0f04e16529431d", + "shasum": "" }, "require": { - "php": ">=7.1", - "php-http/message-factory": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" + "nette/utils": "^4.0", + "php": "8.1 - 8.4" }, "require-dev": { - "http-interop/http-factory-tests": "^0.9", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", - "symfony/error-handler": "^4.4" + "nette/tester": "^2.5.2", + "phpstan/phpstan-nette": "^1.0", + "tracy/tracy": "^2.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.3-dev" } }, "autoload": { - "psr-4": { - "Nyholm\\Psr7\\": "src/" - } + "classmap": [ + "src/" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" ], "authors": [ { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" + "name": "David Grudl", + "homepage": "https://davidgrudl.com" }, { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" + "name": "Nette Community", + "homepage": "https://nette.org/contributors" } ], - "description": "A fast PHP7 implementation of PSR-7", - "homepage": "https://tnyholm.se", + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", "keywords": [ - "psr-17", - "psr-7" + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.2" + }, + "time": "2024-10-06T23:10:23+00:00" + }, + { + "name": "nette/utils", + "version": "v4.0.5", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", + "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", + "shasum": "" + }, + "require": { + "php": "8.0 - 8.4" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "dev-master", + "nette/tester": "^2.5", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.0.5" + }, + "time": "2024-08-07T15:39:19+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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/v5.4.0" + }, + "time": "2024-12-30T11:07:19+00:00" + }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.5.1" + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" }, "funding": [ { @@ -5036,40 +5111,41 @@ "type": "github" } ], - "time": "2022-06-22T07:13:36+00:00" + "time": "2024-09-09T07:06:30+00:00" }, { "name": "omines/oauth2-gitlab", - "version": "3.4.0", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/omines/oauth2-gitlab.git", - "reference": "0c37361c54fae71a85350c445bda1834db5859af" + "reference": "3dee862326d999b0517da4dd83b169e08f5ddf0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/omines/oauth2-gitlab/zipball/0c37361c54fae71a85350c445bda1834db5859af", - "reference": "0c37361c54fae71a85350c445bda1834db5859af", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/omines/oauth2-gitlab/zipball/3dee862326d999b0517da4dd83b169e08f5ddf0a", + "reference": "3dee862326d999b0517da4dd83b169e08f5ddf0a", + "shasum": "" }, "require": { + "ext-intl": "*", + "ext-mbstring": "*", "league/oauth2-client": "^2.4.1", - "php": ">=7.2" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "guzzlehttp/psr7": "^1.6", - "http-interop/http-factory-guzzle": "^1.0", - "m4tthumphrey/php-gitlab-api": "^10.0|^11.0", - "mockery/mockery": "^1.0", - "php-http/guzzle7-adapter": "^0.1", - "phpunit/phpunit": "^8.0|^9.0" + "php": ">=8.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.65.0", + "guzzlehttp/psr7": "^2.7.0", + "http-interop/http-factory-guzzle": "^1.2", + "infection/infection": "^0.27.11", + "m4tthumphrey/php-gitlab-api": "^11.14", + "mockery/mockery": "^1.6.12", + "php-http/guzzle7-adapter": "^1.1.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.0.4", + "phpstan/phpstan-mockery": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0.3", + "phpunit/phpunit": "^10.5.39" }, "suggest": { "m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token" @@ -5085,7 +5161,7 @@ "Omines\\OAuth2\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5107,52 +5183,42 @@ ], "support": { "issues": "https://github.com/omines/oauth2-gitlab/issues", - "source": "https://github.com/omines/oauth2-gitlab/tree/3.4.0" + "source": "https://github.com/omines/oauth2-gitlab/tree/3.7.0" }, - "time": "2021-02-08T12:15:55+00:00" + "time": "2024-12-20T15:42:03+00:00" }, { "name": "php-http/cache-plugin", - "version": "1.7.5", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/php-http/cache-plugin.git", - "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2" + "reference": "5c591e9e04602cec12307e3e1be3abefeb005e29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/63bc3f7242825c9a817db8f78e4c9703b0c471e2", - "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/5c591e9e04602cec12307e3e1be3abefeb005e29", + "reference": "5c591e9e04602cec12307e3e1be3abefeb005e29", + "shasum": "" }, "require": { "php": "^7.1 || ^8.0", "php-http/client-common": "^1.9 || ^2.0", - "php-http/message-factory": "^1.0", "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "psr/http-factory-implementation": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { - "phpspec/phpspec": "^5.1 || ^6.0" + "nyholm/psr7": "^1.6.1", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, "autoload": { "psr-4": { "Http\\Client\\Common\\Plugin\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5172,39 +5238,32 @@ ], "support": { "issues": "https://github.com/php-http/cache-plugin/issues", - "source": "https://github.com/php-http/cache-plugin/tree/1.7.5" + "source": "https://github.com/php-http/cache-plugin/tree/2.0.1" }, - "time": "2022-01-18T12:24:56+00:00" + "time": "2024-10-02T11:25:38+00:00" }, { "name": "php-http/client-common", - "version": "2.6.0", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "45db684cd4e186dcdc2b9c06b22970fe123796c0" + "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/45db684cd4e186dcdc2b9c06b22970fe123796c0", - "reference": "45db684cd4e186dcdc2b9c06b22970fe123796c0", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/client-common/zipball/0cfe9858ab9d3b213041b947c881d5b19ceeca46", + "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46", + "shasum": "" }, "require": { "php": "^7.1 || ^8.0", "php-http/httplug": "^2.0", "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", + "psr/http-message": "^1.0 || ^2.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0", "symfony/polyfill-php80": "^1.17" }, "require-dev": { @@ -5213,7 +5272,7 @@ "nyholm/psr7": "^1.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" }, "suggest": { "ext-json": "To detect JSON responses with the ContentTypePlugin", @@ -5223,17 +5282,12 @@ "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, "autoload": { "psr-4": { "Http\\Client\\Common\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5253,57 +5307,62 @@ ], "support": { "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.6.0" + "source": "https://github.com/php-http/client-common/tree/2.7.2" }, - "time": "2022-09-29T09:59:43+00:00" + "time": "2024-09-24T06:21:48+00:00" }, { "name": "php-http/discovery", - "version": "1.14.3", + "version": "1.20.0", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "31d8ee46d0215108df16a8527c7438e96a4d7735" + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/31d8ee46d0215108df16a8527c7438e96a4d7735", - "reference": "31d8ee46d0215108df16a8527c7438e96a4d7735", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" }, "require": { + "composer-plugin-api": "^1.0|^2.0", "php": "^7.1 || ^8.0" }, "conflict": { - "nyholm/psr7": "<1.0" + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" }, "require-dev": { + "composer/composer": "^1.0.2|^2.0", "graham-campbell/phpspec-skip-example-extension": "^5.0", "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1" + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" }, - "suggest": { - "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" - }, - "type": "library", + "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true }, "autoload": { "psr-4": { "Http\\Discovery\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5313,7 +5372,7 @@ "email": "mark.sagikazar@gmail.com" } ], - "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", "homepage": "http://php-http.org", "keywords": [ "adapter", @@ -5322,56 +5381,46 @@ "factory", "http", "message", + "psr17", "psr7" ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.14.3" + "source": "https://github.com/php-http/discovery/tree/1.20.0" }, - "time": "2022-07-11T14:04:40+00:00" + "time": "2024-10-02T11:20:13+00:00" }, { "name": "php-http/httplug", - "version": "2.3.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "f640739f80dfa1152533976e3c112477f69274eb" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/f640739f80dfa1152533976e3c112477f69274eb", - "reference": "f640739f80dfa1152533976e3c112477f69274eb", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", + "shasum": "" }, "require": { "php": "^7.1 || ^8.0", "php-http/promise": "^1.1", "psr/http-client": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1", - "phpspec/phpspec": "^5.1 || ^6.0" + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { "psr-4": { "Http\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5394,35 +5443,28 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.3.0" + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, - "time": "2022-02-21T09:52:22+00:00" + "time": "2024-09-23T11:39:58+00:00" }, { "name": "php-http/message", - "version": "1.13.0", + "version": "1.16.2", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361" + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/7886e647a30a966a1a8d1dad1845b71ca8678361", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "shasum": "" }, "require": { "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0" @@ -5430,8 +5472,9 @@ "require-dev": { "ergebnis/composer-normalize": "^2.6", "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "laminas/laminas-diactoros": "^2.0 || ^3.0", + "php-http/message-factory": "^1.0.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "slim/slim": "^3.0" }, @@ -5442,11 +5485,6 @@ "slim/slim": "Used with Slim Framework PSR-7 implementation" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, "autoload": { "files": [ "src/filters.php" @@ -5455,7 +5493,7 @@ "Http\\Message\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5474,38 +5512,32 @@ ], "support": { "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.13.0" + "source": "https://github.com/php-http/message/tree/1.16.2" }, - "time": "2022-02-11T13:41:14+00:00" + "time": "2024-10-02T11:34:13+00:00" }, { "name": "php-http/message-factory", - "version": "v1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57", + "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57", + "shasum": "" }, "require": { "php": ">=5.4", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -5513,7 +5545,7 @@ "Http\\Message\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5534,54 +5566,43 @@ ], "support": { "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/master" + "source": "https://github.com/php-http/message-factory/tree/1.1.0" }, - "time": "2015-12-19T14:08:53+00:00" + "abandoned": "psr/http-factory", + "time": "2023-04-14T14:16:17+00:00" }, { "name": "php-http/multipart-stream-builder", - "version": "1.2.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/php-http/multipart-stream-builder.git", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" + "reference": "10086e6de6f53489cca5ecc45b6f468604d3460e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/10086e6de6f53489cca5ecc45b6f468604d3460e", + "reference": "10086e6de6f53489cca5ecc45b6f468604d3460e", + "shasum": "" }, "require": { "php": "^7.1 || ^8.0", - "php-http/discovery": "^1.7", - "php-http/message-factory": "^1.0.2", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "php-http/discovery": "^1.15", + "psr/http-factory-implementation": "^1.0" }, "require-dev": { "nyholm/psr7": "^1.0", "php-http/message": "^1.5", + "php-http/message-factory": "^1.0.2", "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { "Http\\Message\\MultipartStream\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5602,49 +5623,38 @@ ], "support": { "issues": "https://github.com/php-http/multipart-stream-builder/issues", - "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.4.2" }, - "time": "2021-05-21T08:32:01+00:00" + "time": "2024-09-04T13:22:54+00:00" }, { "name": "php-http/promise", - "version": "1.1.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", - "phpspec/phpspec": "^5.1.2 || ^6.2" + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { "Http\\Promise\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5665,9 +5675,9 @@ ], "support": { "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.1.0" + "source": "https://github.com/php-http/promise/tree/1.3.1" }, - "time": "2020-07-07T09:29:14+00:00" + "time": "2024-03-15T13:55:21+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -5681,13 +5691,7 @@ "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" @@ -5703,7 +5707,7 @@ "phpDocumentor\\Reflection\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5730,34 +5734,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "shasum": "" }, "require": { + "doctrine/deprecations": "^1.1", "ext-filter": "*", - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "mockery/mockery": "~1.3.5 || ~1.6.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -5770,7 +5775,7 @@ "phpDocumentor\\Reflection\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5781,157 +5786,247 @@ }, { "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "email": "opensource@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" + }, + "time": "2024-11-09T15:12:26+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^5.3.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" + }, + "time": "2024-10-13T11:29:49+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "Psr\\Cache\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "source": "https://github.com/php-fig/cache/tree/3.0.0" }, - "time": "2022-03-15T21:29:03+00:00" + "time": "2021-02-03T23:26:27+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "psr/clock", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.0 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "Psr\\Clock\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for caching libraries", + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", "keywords": [ - "cache", + "clock", + "now", "psr", - "psr-6" + "psr-20", + "time" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2022-11-25T14:36:26+00:00" }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "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://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5952,9 +6047,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -5968,13 +6063,7 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.2.0" @@ -5990,7 +6079,7 @@ "Psr\\EventDispatcher\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6014,27 +6103,21 @@ }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -6047,14 +6130,14 @@ "Psr\\Http\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -6066,33 +6149,27 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -6105,17 +6182,17 @@ "Psr\\Http\\Message\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -6127,37 +6204,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -6165,7 +6236,7 @@ "Psr\\Http\\Message\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6186,45 +6257,39 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6242,9 +6307,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "ralouphie/getallheaders", @@ -6258,13 +6323,7 @@ "type": "zip", "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6" @@ -6279,7 +6338,7 @@ "src/getallheaders.php" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6298,54 +6357,58 @@ }, { "name": "ramsey/collection", - "version": "1.2.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" }, "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" }, "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, "autoload": { "psr-4": { "Ramsey\\Collection\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6367,7 +6430,7 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.2.2" + "source": "https://github.com/ramsey/collection/tree/2.0.0" }, "funding": [ { @@ -6379,35 +6442,27 @@ "type": "tidelift" } ], - "time": "2021-10-10T03:01:02+00:00" + "time": "2022-12-31T21:50:55+00:00" }, { "name": "ramsey/uuid", - "version": "4.2.3", + "version": "4.7.6", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", "ext-json": "*", - "php": "^7.2 || ^8.0", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" }, "replace": { "rhumsaa/uuid": "self.version" @@ -6419,24 +6474,23 @@ "doctrine/annotations": "^1.8", "ergebnis/composer-normalize": "^2.15", "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", "paragonie/random-lib": "^2", "php-mock/php-mock": "^2.2", "php-mock/php-mock-mockery": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.1", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.9" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -6444,9 +6498,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - }, "captainhook": { "force-install": true } @@ -6459,7 +6510,7 @@ "Ramsey\\Uuid\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6471,7 +6522,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.3" + "source": "https://github.com/ramsey/uuid/tree/4.7.6" }, "funding": [ { @@ -6483,27 +6534,21 @@ "type": "tidelift" } ], - "time": "2021-09-25T23:10:38+00:00" + "time": "2024-04-27T21:32:50+00:00" }, { "name": "ramsey/uuid-doctrine", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/ramsey/uuid-doctrine.git", - "reference": "1a6f235ba3faf1cd9ba18daf5b54d8dc9d3bc7d0" + "reference": "6867db3f39b9088dd8909b2523c1d2bfe274e541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid-doctrine/zipball/1a6f235ba3faf1cd9ba18daf5b54d8dc9d3bc7d0", - "reference": "1a6f235ba3faf1cd9ba18daf5b54d8dc9d3bc7d0", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/ramsey/uuid-doctrine/zipball/6867db3f39b9088dd8909b2523c1d2bfe274e541", + "reference": "6867db3f39b9088dd8909b2523c1d2bfe274e541", + "shasum": "" }, "require": { "doctrine/dbal": "^2.5 || ^3.0", @@ -6523,7 +6568,7 @@ "Ramsey\\Uuid\\Doctrine\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6544,7 +6589,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid-doctrine/issues", - "source": "https://github.com/ramsey/uuid-doctrine/tree/1.8.1" + "source": "https://github.com/ramsey/uuid-doctrine/tree/1.8.2" }, "funding": [ { @@ -6556,34 +6601,28 @@ "type": "tidelift" } ], - "time": "2022-01-15T23:54:44+00:00" + "time": "2022-11-03T19:30:26+00:00" }, { "name": "react/cache", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/cache.git", - "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e" + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/4bf736a2cccec7298bdf745db77585966fc2ca7e", - "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" }, "require": { "php": ">=5.3.0", "react/promise": "^3.0 || ^2.0 || ^1.1" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { @@ -6591,7 +6630,7 @@ "React\\Cache\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6626,58 +6665,48 @@ ], "support": { "issues": "https://github.com/reactphp/cache/issues", - "source": "https://github.com/reactphp/cache/tree/v1.1.1" + "source": "https://github.com/reactphp/cache/tree/v1.2.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2021-02-02T06:47:52+00:00" + "time": "2022-11-30T15:59:55+00:00" }, { "name": "react/dns", - "version": "v1.10.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/reactphp/dns.git", - "reference": "a5427e7dfa47713e438016905605819d101f238c" + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/a5427e7dfa47713e438016905605819d101f238c", - "reference": "a5427e7dfa47713e438016905605819d101f238c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" }, "require": { "php": ">=5.3.0", "react/cache": "^1.0 || ^0.6 || ^0.5", "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7 || ^1.2.1", - "react/promise-timer": "^1.9" + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^4.8.35", - "react/async": "^4 || ^3 || ^2" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { "psr-4": { - "React\\Dns\\": "src" + "React\\Dns\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6712,58 +6741,46 @@ ], "support": { "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.10.0" + "source": "https://github.com/reactphp/dns/tree/v1.13.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-09-08T12:22:46+00:00" + "time": "2024-06-13T14:18:03+00:00" }, { "name": "react/event-loop", - "version": "v1.3.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/reactphp/event-loop.git", - "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137" + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/187fb56f46d424afb6ec4ad089269c72eec2e137", - "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "suggest": { - "ext-event": "~1.0 for ExtEventLoop", - "ext-pcntl": "For signal handling support when using the StreamSelectLoop", - "ext-uv": "* for ExtUvLoop" + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, "type": "library", "autoload": { "psr-4": { - "React\\EventLoop\\": "src" + "React\\EventLoop\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6796,39 +6813,29 @@ ], "support": { "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.3.0" + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-03-17T11:10:22+00:00" + "time": "2023-11-13T13:48:05+00:00" }, { "name": "react/http", - "version": "v1.8.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/reactphp/http.git", - "reference": "aa7512ee17258c88466de30f9cb44ec5f9df3ff3" + "reference": "8db02de41dcca82037367f67a2d4be365b1c4db9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/http/zipball/aa7512ee17258c88466de30f9cb44ec5f9df3ff3", - "reference": "aa7512ee17258c88466de30f9cb44ec5f9df3ff3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/http/zipball/8db02de41dcca82037367f67a2d4be365b1c4db9", + "reference": "8db02de41dcca82037367f67a2d4be365b1c4db9", + "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", @@ -6836,202 +6843,26 @@ "php": ">=5.3.0", "psr/http-message": "^1.0", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.3 || ^1.2.1", - "react/promise-stream": "^1.4", - "react/socket": "^1.12", - "react/stream": "^1.2", - "ringcentral/psr7": "^1.2" + "react/promise": "^3.2 || ^2.3 || ^1.2.1", + "react/socket": "^1.16", + "react/stream": "^1.4" }, "require-dev": { "clue/http-proxy-react": "^1.8", "clue/reactphp-ssh-proxy": "^1.4", "clue/socks-react": "^1.4", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/async": "^4 || ^3 || ^2", - "react/promise-timer": "^1.9" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Http\\": "src" - } - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", - "keywords": [ - "async", - "client", - "event-driven", - "http", - "http client", - "http server", - "https", - "psr-7", - "reactphp", - "server", - "streaming" - ], - "support": { - "issues": "https://github.com/reactphp/http/issues", - "source": "https://github.com/reactphp/http/tree/v1.8.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-09-29T12:55:52+00:00" - }, - { - "name": "react/promise", - "version": "v2.9.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-11T10:27:51+00:00" - }, - { - "name": "react/promise-stream", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise-stream.git", - "reference": "e6d2805e09ad50c4896f65f5e8705fe4ee7731a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-stream/zipball/e6d2805e09ad50c4896f65f5e8705fe4ee7731a3", - "reference": "e6d2805e09ad50c4896f65f5e8705fe4ee7731a3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3", - "react/promise": "^3 || ^2.1 || ^1.2", - "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.2 || ^3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], + "autoload": { "psr-4": { - "React\\Promise\\Stream\\": "src/" + "React\\Http\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7057,59 +6888,52 @@ "homepage": "https://cboden.dev/" } ], - "description": "The missing link between Promise-land and Stream-land for ReactPHP", - "homepage": "https://github.com/reactphp/promise-stream", + "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", "keywords": [ - "Buffer", "async", - "promise", + "client", + "event-driven", + "http", + "http client", + "http server", + "https", + "psr-7", "reactphp", - "stream", - "unwrap" + "server", + "streaming" ], "support": { - "issues": "https://github.com/reactphp/promise-stream/issues", - "source": "https://github.com/reactphp/promise-stream/tree/v1.5.0" + "issues": "https://github.com/reactphp/http/issues", + "source": "https://github.com/reactphp/http/tree/v1.11.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-09-09T11:42:18+00:00" + "time": "2024-11-20T15:24:08+00:00" }, { - "name": "react/promise-timer", - "version": "v1.9.0", + "name": "react/promise", + "version": "v3.2.0", "source": { "type": "git", - "url": "https://github.com/reactphp/promise-timer.git", - "reference": "aa7a73c74b8d8c0f622f5982ff7b0351bc29e495" + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/aa7a73c74b8d8c0f622f5982ff7b0351bc29e495", - "reference": "aa7a73c74b8d8c0f622f5982ff7b0351bc29e495", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" }, "require": { - "php": ">=5.3", - "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7.0 || ^1.2.1" + "php": ">=7.1.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", "autoload": { @@ -7117,14 +6941,19 @@ "src/functions_include.php" ], "psr-4": { - "React\\Promise\\Timer\\": "src/" + "React\\Promise\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, { "name": "Christian Lück", "email": "christian@clue.engineering", @@ -7135,84 +6964,64 @@ "email": "reactphp@ceesjankiewiet.nl", "homepage": "https://wyrihaximus.net/" }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, { "name": "Chris Boden", "email": "cboden@gmail.com", "homepage": "https://cboden.dev/" } ], - "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", - "homepage": "https://github.com/reactphp/promise-timer", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "async", - "event-loop", "promise", - "reactphp", - "timeout", - "timer" + "promises" ], "support": { - "issues": "https://github.com/reactphp/promise-timer/issues", - "source": "https://github.com/reactphp/promise-timer/tree/v1.9.0" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-06-13T13:41:03+00:00" + "time": "2024-05-24T10:39:05+00:00" }, { "name": "react/socket", - "version": "v1.12.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b", - "reference": "81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.8", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/promise-timer": "^1.9", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/async": "^4 || ^3 || ^2", - "react/promise-stream": "^1.4" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { "psr-4": { - "React\\Socket\\": "src" + "React\\Socket\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7248,39 +7057,29 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.12.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-08-25T12:32:25+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", - "version": "v1.2.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", - "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", @@ -7289,15 +7088,15 @@ }, "require-dev": { "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { "psr-4": { - "React\\Stream\\": "src" + "React\\Stream\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7336,112 +7135,35 @@ ], "support": { "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.2.0" + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2021-07-11T12:37:55+00:00" - }, - { - "name": "ringcentral/psr7", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/ringcentral/psr7.git", - "reference": "360faaec4b563958b673fb52bbe94e37f14bc686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ringcentral/psr7/zipball/360faaec4b563958b673fb52bbe94e37f14bc686", - "reference": "360faaec4b563958b673fb52bbe94e37f14bc686", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "RingCentral\\Psr7\\": "src/" - } - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "support": { - "source": "https://github.com/ringcentral/psr7/tree/master" - }, - "time": "2018-05-29T20:21:04+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { "name": "seld/jsonlint", - "version": "1.9.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "4211420d25eba80712bff236a98960ef68b866b7" + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", - "reference": "4211420d25eba80712bff236a98960ef68b866b7", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -7453,7 +7175,7 @@ "Seld\\JsonLint\\": "src/Seld/JsonLint/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7461,7 +7183,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "JSON Linter", @@ -7473,7 +7195,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" }, "funding": [ { @@ -7485,7 +7207,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T13:37:23+00:00" + "time": "2024-07-11T14:55:45+00:00" }, { "name": "seld/phar-utils", @@ -7499,13 +7221,7 @@ "type": "zip", "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3" @@ -7521,7 +7237,7 @@ "Seld\\PharUtils\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7541,33 +7257,88 @@ }, "time": "2022-08-31T10:31:18+00:00" }, + { + "name": "seld/signal-handler", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/signal-handler.git", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", + "psr/log": "^1 || ^2 || ^3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\Signal\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", + "keywords": [ + "posix", + "sigint", + "signal", + "sigterm", + "unix" + ], + "support": { + "issues": "https://github.com/Seldaek/signal-handler/issues", + "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" + }, + "time": "2023-09-03T09:24:00+00:00" + }, { "name": "sensio/framework-extra-bundle", - "version": "v5.6.1", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", - "reference": "430d14c01836b77c28092883d195a43ce413ee32" + "reference": "2f886f4b31f23c76496901acaedfedb6936ba61f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/430d14c01836b77c28092883d195a43ce413ee32", - "reference": "430d14c01836b77c28092883d195a43ce413ee32", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/2f886f4b31f23c76496901acaedfedb6936ba61f", + "reference": "2f886f4b31f23c76496901acaedfedb6936ba61f", + "shasum": "" }, "require": { - "doctrine/annotations": "^1.0", + "doctrine/annotations": "^1.0|^2.0", "php": ">=7.2.5", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/framework-bundle": "^4.4|^5.0", - "symfony/http-kernel": "^4.4|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/framework-bundle": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0" }, "conflict": { "doctrine/doctrine-cache-bundle": "<1.3.1", @@ -7577,25 +7348,23 @@ "doctrine/dbal": "^2.10|^3.0", "doctrine/doctrine-bundle": "^1.11|^2.0", "doctrine/orm": "^2.5", - "nyholm/psr7": "^1.1", - "symfony/browser-kit": "^4.4|^5.0", - "symfony/doctrine-bridge": "^4.4|^5.0", - "symfony/dom-crawler": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/monolog-bridge": "^4.0|^5.0", + "symfony/browser-kit": "^4.4|^5.0|^6.0", + "symfony/doctrine-bridge": "^4.4|^5.0|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/monolog-bridge": "^4.0|^5.0|^6.0", "symfony/monolog-bundle": "^3.2", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9", - "symfony/psr-http-message-bridge": "^1.1", - "symfony/security-bundle": "^4.4|^5.0", - "symfony/twig-bundle": "^4.4|^5.0", - "symfony/yaml": "^4.4|^5.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", + "symfony/security-bundle": "^4.4|^5.0|^6.0", + "symfony/twig-bundle": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0", "twig/twig": "^1.34|^2.4|^3.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "5.6.x-dev" + "dev-master": "6.1.x-dev" } }, "autoload": { @@ -7606,7 +7375,7 @@ "/tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7622,38 +7391,32 @@ "controllers" ], "support": { - "issues": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues", - "source": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/v5.6.1" + "source": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/v6.2.10" }, - "time": "2020-08-25T19:10:18+00:00" + "abandoned": "Symfony", + "time": "2023-02-24T14:57:12+00:00" }, { "name": "sentry/sdk", - "version": "3.2.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php-sdk.git", - "reference": "6d78bd83b43efbb52f81d6824f4af344fa9ba292" + "reference": "24c235ff2027401cbea099bf88689e1a1f197c7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/6d78bd83b43efbb52f81d6824f4af344fa9ba292", - "reference": "6d78bd83b43efbb52f81d6824f4af344fa9ba292", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/24c235ff2027401cbea099bf88689e1a1f197c7a", + "reference": "24c235ff2027401cbea099bf88689e1a1f197c7a", + "shasum": "" }, "require": { "http-interop/http-factory-guzzle": "^1.0", - "sentry/sentry": "^3.5", - "symfony/http-client": "^4.3|^5.0|^6.0" + "sentry/sentry": "^3.22", + "symfony/http-client": "^4.3|^5.0|^6.0|^7.0" }, "type": "metapackage", - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7676,7 +7439,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php-sdk/issues", - "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.2.0" + "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.6.0" }, "funding": [ { @@ -7688,44 +7451,38 @@ "type": "custom" } ], - "time": "2022-05-21T11:10:11+00:00" + "time": "2023-12-04T10:49:33+00:00" }, { "name": "sentry/sentry", - "version": "3.8.1", + "version": "3.22.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "5150776a0a9835c4ea56ff0ecd94e0a109b6c163" + "reference": "8859631ba5ab15bc1af420b0eeed19ecc6c9d81d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/5150776a0a9835c4ea56ff0ecd94e0a109b6c163", - "reference": "5150776a0a9835c4ea56ff0ecd94e0a109b6c163", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/8859631ba5ab15bc1af420b0eeed19ecc6c9d81d", + "reference": "8859631ba5ab15bc1af420b0eeed19ecc6c9d81d", + "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.8.4|^2.1.1", + "guzzlehttp/promises": "^1.5.3|^2.0", "jean85/pretty-package-versions": "^1.5|^2.0.4", "php": "^7.2|^8.0", "php-http/async-client-implementation": "^1.0", "php-http/client-common": "^1.5|^2.0", - "php-http/discovery": "^1.11", + "php-http/discovery": "^1.15", "php-http/httplug": "^1.1|^2.0", "php-http/message": "^1.5", + "php-http/message-factory": "^1.1", "psr/http-factory": "^1.0", - "psr/http-message-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", "psr/log": "^1.0|^2.0|^3.0", - "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0", + "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0|^7.0", "symfony/polyfill-php80": "^1.17" }, "conflict": { @@ -7734,6 +7491,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.19|3.4.*", + "guzzlehttp/psr7": "^1.8.4|^2.1.1", "http-interop/http-factory-guzzle": "^1.0", "monolog/monolog": "^1.6|^2.0|^3.0", "nikic/php-parser": "^4.10.3", @@ -7750,11 +7508,6 @@ "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.8.x-dev" - } - }, "autoload": { "files": [ "src/functions.php" @@ -7763,9 +7516,9 @@ "Sentry\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { @@ -7786,7 +7539,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.8.1" + "source": "https://github.com/getsentry/sentry-php/tree/3.22.1" }, "funding": [ { @@ -7798,67 +7551,61 @@ "type": "custom" } ], - "time": "2022-09-21T11:01:17+00:00" + "time": "2023-11-13T11:47:28+00:00" }, { "name": "sentry/sentry-symfony", - "version": "4.3.0", + "version": "4.14.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-symfony.git", - "reference": "12d0f9674b8a829fdf1a2cfbb3fd6b94ec4de893" + "reference": "001c4cfd8fe93cbb00edaca903ffbfac28259170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-symfony/zipball/12d0f9674b8a829fdf1a2cfbb3fd6b94ec4de893", - "reference": "12d0f9674b8a829fdf1a2cfbb3fd6b94ec4de893", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/getsentry/sentry-symfony/zipball/001c4cfd8fe93cbb00edaca903ffbfac28259170", + "reference": "001c4cfd8fe93cbb00edaca903ffbfac28259170", + "shasum": "" }, "require": { + "guzzlehttp/psr7": "^1.7 || ^2.0", "jean85/pretty-package-versions": "^1.5 || ^2.0", "php": "^7.2||^8.0", - "php-http/discovery": "^1.11", - "sentry/sdk": "^3.2", + "sentry/sdk": "^3.6", + "sentry/sentry": "^3.22.1", "symfony/cache-contracts": "^1.1||^2.4||^3.0", - "symfony/config": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/console": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/dependency-injection": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/event-dispatcher": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/http-kernel": "^3.4.44||^4.4.20||^5.0.11||^6.0", + "symfony/config": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/console": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/dependency-injection": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/event-dispatcher": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/http-kernel": "^4.4.20||^5.0.11||^6.0||^7.0", "symfony/polyfill-php80": "^1.22", - "symfony/psr-http-message-bridge": "^1.2||^2.0", - "symfony/security-core": "^3.4.44||^4.4.20||^5.0.11||^6.0" + "symfony/psr-http-message-bridge": "^1.2||^2.0||^6.4||^7.0", + "symfony/security-core": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/security-http": "^4.4.20||^5.0.11||^6.0||^7.0" }, "require-dev": { - "doctrine/dbal": "^2.13||^3.0", - "doctrine/doctrine-bundle": "^1.12||^2.5", - "friendsofphp/php-cs-fixer": "^2.19||^3.6", - "jangregor/phpstan-prophecy": "^1.0", - "monolog/monolog": "^1.3||^2.0", - "phpspec/prophecy": "!=1.11.0", - "phpspec/prophecy-phpunit": "^1.1||^2.0", + "doctrine/dbal": "^2.13||^3.3||^4.0", + "doctrine/doctrine-bundle": "^2.6", + "friendsofphp/php-cs-fixer": "^2.19||^3.40", + "masterminds/html5": "^2.8", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.3", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-symfony": "^1.0", "phpunit/phpunit": "^8.5.14||^9.3.9", - "symfony/browser-kit": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/cache": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/dom-crawler": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/framework-bundle": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/messenger": "^4.4.20||^5.0.11||^6.0", + "symfony/browser-kit": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/cache": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/dom-crawler": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/framework-bundle": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/http-client": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/messenger": "^4.4.20||^5.0.11||^6.0||^7.0", "symfony/monolog-bundle": "^3.4", - "symfony/phpunit-bridge": "^5.2.6||^6.0", - "symfony/process": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/twig-bundle": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "symfony/yaml": "^3.4.44||^4.4.20||^5.0.11||^6.0", - "vimeo/psalm": "^4.3" + "symfony/phpunit-bridge": "^5.2.6||^6.0||^7.0", + "symfony/process": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/twig-bundle": "^4.4.20||^5.0.11||^6.0||^7.0", + "symfony/yaml": "^4.4.20||^5.0.11||^6.0||^7.0", + "vimeo/psalm": "^4.3||^5.16.0" }, "suggest": { "doctrine/doctrine-bundle": "Allow distributed tracing of database queries using Sentry.", @@ -7869,10 +7616,9 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "4.3.x-dev", - "releases/3.2.x": "3.2.x-dev", + "releases/1.x": "1.x-dev", "releases/2.x": "2.x-dev", - "releases/1.x": "1.x-dev" + "releases/3.2.x": "3.2.x-dev" } }, "autoload": { @@ -7883,9 +7629,9 @@ "Sentry\\SentryBundle\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { @@ -7907,7 +7653,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-symfony/issues", - "source": "https://github.com/getsentry/sentry-symfony/tree/4.3.0" + "source": "https://github.com/getsentry/sentry-symfony/tree/4.14.0" }, "funding": [ { @@ -7919,7 +7665,7 @@ "type": "custom" } ], - "time": "2022-05-30T12:09:35+00:00" + "time": "2024-02-26T09:27:19+00:00" }, { "name": "stevenmaguire/oauth2-bitbucket", @@ -7933,13 +7679,7 @@ "type": "zip", "url": "https://api.github.com/repos/stevenmaguire/oauth2-bitbucket/zipball/7ab903e7ac47b3fb18ff27fe5b7c8d2a494bd39c", "reference": "7ab903e7ac47b3fb18ff27fe5b7c8d2a494bd39c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "league/oauth2-client": "^2.0" @@ -7960,7 +7700,7 @@ "Stevenmaguire\\OAuth2\\Client\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -7973,134 +7713,51 @@ ], "description": "Bitbucket OAuth 2.0 Client Provider for The PHP League OAuth2-Client", "keywords": [ - "authorisation", - "authorization", - "bitbucket", - "client", - "oauth", - "oauth2" - ], - "support": { - "issues": "https://github.com/stevenmaguire/oauth2-bitbucket/issues", - "source": "https://github.com/stevenmaguire/oauth2-bitbucket/tree/master" - }, - "time": "2018-05-03T22:50:12+00:00" - }, - { - "name": "symfony/amazon-mailer", - "version": "v5.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/amazon-mailer.git", - "reference": "b29080ec459364c4fc9478b2633c0915480f22ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/amazon-mailer/zipball/b29080ec459364c4fc9478b2633c0915480f22ea", - "reference": "b29080ec459364c4fc9478b2633c0915480f22ea", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "async-aws/ses": "^1.0", - "php": ">=7.2.5", - "psr/event-dispatcher": "^1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/mailer": "^4.4.21|^5.2.6|^6.0" - }, - "require-dev": { - "symfony/http-client": "^4.4|^5.0|^6.0" - }, - "type": "symfony-mailer-bridge", - "autoload": { - "psr-4": { - "Symfony\\Component\\Mailer\\Bridge\\Amazon\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Amazon Mailer Bridge", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/amazon-mailer/tree/v5.4.8" - }, - "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" - } + "authorisation", + "authorization", + "bitbucket", + "client", + "oauth", + "oauth2" ], - "time": "2022-04-12T16:18:39+00:00" + "support": { + "issues": "https://github.com/stevenmaguire/oauth2-bitbucket/issues", + "source": "https://github.com/stevenmaguire/oauth2-bitbucket/tree/master" + }, + "time": "2018-05-03T22:50:12+00:00" }, { - "name": "symfony/amqp-messenger", - "version": "v5.4.13", + "name": "symfony/amazon-mailer", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/amqp-messenger.git", - "reference": "def93f2a7841cfa1a4a1fa487b84054d0d53e521" + "url": "https://github.com/symfony/amazon-mailer.git", + "reference": "9f02a352ceefdb89b318fd98230a6f9f6ae0ba95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/amqp-messenger/zipball/def93f2a7841cfa1a4a1fa487b84054d0d53e521", - "reference": "def93f2a7841cfa1a4a1fa487b84054d0d53e521", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/amazon-mailer/zipball/9f02a352ceefdb89b318fd98230a6f9f6ae0ba95", + "reference": "9f02a352ceefdb89b318fd98230a6f9f6ae0ba95", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/messenger": "^5.3|^6.0" + "async-aws/ses": "^1.0", + "php": ">=8.1", + "symfony/mailer": "^5.4.21|^6.2.7|^7.0" }, "require-dev": { - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" + "symfony/http-client": "^5.4|^6.0|^7.0" }, - "type": "symfony-messenger-bridge", + "type": "symfony-mailer-bridge", "autoload": { "psr-4": { - "Symfony\\Component\\Messenger\\Bridge\\Amqp\\": "" + "Symfony\\Component\\Mailer\\Bridge\\Amazon\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8114,10 +7771,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony AMQP extension Messenger Bridge", + "description": "Symfony Amazon Mailer Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/amqp-messenger/tree/v5.4.13" + "source": "https://github.com/symfony/amazon-mailer/tree/v6.4.13" }, "funding": [ { @@ -8133,43 +7790,32 @@ "type": "tidelift" } ], - "time": "2022-09-11T09:11:59+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/asset", - "version": "v5.4.13", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "9aa867206711cb6fcca51ef127ba52a018170be9" + "reference": "2466c17d61d14539cddf77e57ebb9cc971185302" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/9aa867206711cb6fcca51ef127ba52a018170be9", - "reference": "9aa867206711cb6fcca51ef127ba52a018170be9", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/asset/zipball/2466c17d61d14539cddf77e57ebb9cc971185302", + "reference": "2466c17d61d14539cddf77e57ebb9cc971185302", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "conflict": { - "symfony/http-foundation": "<5.3" + "symfony/http-foundation": "<5.4" }, "require-dev": { - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^5.3|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/http-foundation": "" + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8180,7 +7826,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8197,7 +7843,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v5.4.13" + "source": "https://github.com/symfony/asset/tree/v6.4.13" }, "funding": [ { @@ -8213,73 +7859,66 @@ "type": "tidelift" } ], - "time": "2022-08-31T08:17:19+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/cache", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "89bb6a0fe27205636d80e568ffaf9bbb52f691e3" + "reference": "b209751ed25f735ea90ca4c9c969d9413a17dfee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/89bb6a0fe27205636d80e568ffaf9bbb52f691e3", - "reference": "89bb6a0fe27205636d80e568ffaf9bbb52f691e3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/cache/zipball/b209751ed25f735ea90ca4c9c969d9413a17dfee", + "reference": "b209751ed25f735ea90ca4c9c969d9413a17dfee", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0", + "php": ">=8.1", + "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", - "symfony/cache-contracts": "^1.1.7|^2", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/cache-contracts": "^2.5|^3", + "symfony/service-contracts": "^2.5|^3", + "symfony/var-exporter": "^6.3.6|^7.0" }, "conflict": { "doctrine/dbal": "<2.13.1", - "symfony/dependency-injection": "<4.4", - "symfony/http-kernel": "<4.4", - "symfony/var-dumper": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/var-dumper": "<5.4" }, "provide": { - "psr/cache-implementation": "1.0|2.0", - "psr/simple-cache-implementation": "1.0|2.0", - "symfony/cache-implementation": "1.0|2.0" + "psr/cache-implementation": "2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0", + "symfony/cache-implementation": "1.1|2.0|3.0" }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.13.1|^3.0", - "predis/predis": "^1.1", - "psr/simple-cache": "^1.0|^2.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { "psr-4": { "Symfony\\Component\\Cache\\": "" }, + "classmap": [ + "Traits/ValueWrapper.php" + ], "exclude-from-classmap": [ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8300,7 +7939,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.13" + "source": "https://github.com/symfony/cache/tree/v6.4.18" }, "funding": [ { @@ -8316,43 +7955,34 @@ "type": "tidelift" } ], - "time": "2022-09-06T13:23:31+00:00" + "time": "2025-01-22T14:13:52+00:00" }, { "name": "symfony/cache-contracts", - "version": "v2.5.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" + "reference": "15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b", + "reference": "15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0|^3.0" - }, - "suggest": { - "symfony/cache-implementation": "" + "php": ">=8.1", + "psr/cache": "^3.0" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -8360,7 +7990,7 @@ "Symfony\\Contracts\\Cache\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8385,7 +8015,81 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/cache-contracts/tree/v3.5.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": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/clock", + "version": "v6.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "b2bf55c4dd115003309eafa87ee7df9ed3dde81b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/b2bf55c4dd115003309eafa87ee7df9ed3dde81b", + "reference": "b2bf55c4dd115003309eafa87ee7df9ed3dde81b", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "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": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v6.4.13" }, "funding": [ { @@ -8401,48 +8105,38 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/config", - "version": "v5.4.11", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "ec79e03125c1d2477e43dde8528535d90cc78379" + "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/ec79e03125c1d2477e43dde8528535d90cc78379", - "reference": "ec79e03125c1d2477e43dde8528535d90cc78379", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/config/zipball/4e55e7e4ffddd343671ea972216d4509f46c22ef", + "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<4.4" + "symfony/finder": "<5.4", + "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8453,7 +8147,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8470,7 +8164,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.11" + "source": "https://github.com/symfony/config/tree/v6.4.14" }, "funding": [ { @@ -8486,62 +8180,51 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2024-11-04T11:33:53+00:00" }, { "name": "symfony/console", - "version": "v5.4.13", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3f97f6c7b7e26848a90c0c0cfb91eeb2bb8618be" + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3f97f6c7b7e26848a90c0c0cfb91eeb2bb8618be", - "reference": "3f97f6c7b7e26848a90c0c0cfb91eeb2bb8618be", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "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" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8552,7 +8235,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8570,12 +8253,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.13" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, "funding": [ { @@ -8591,58 +8274,44 @@ "type": "tidelift" } ], - "time": "2022-08-26T13:50:20+00:00" + "time": "2024-12-07T12:07:30+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "24cf522668845391c0542bc1de496366072a6d0e" + "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/24cf522668845391c0542bc1de496366072a6d0e", - "reference": "24cf522668845391c0542bc1de496366072a6d0e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7a379d8871f6a36f01559c14e11141cc02eb8dc8", + "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/service-contracts": "^1.1.6|^2" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/service-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.2.10|^7.0" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<5.3", - "symfony/finder": "<4.4", - "symfony/proxy-manager-bridge": "<4.4", - "symfony/yaml": "<4.4.26" + "symfony/config": "<6.1", + "symfony/finder": "<5.4", + "symfony/proxy-manager-bridge": "<6.3", + "symfony/yaml": "<5.4" }, "provide": { - "psr/container-implementation": "1.0", - "symfony/service-implementation": "1.0|2.0" + "psr/container-implementation": "1.1|2.0", + "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^5.3|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4.26|^5.0|^6.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "symfony/config": "^6.1|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -8653,7 +8322,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8670,7 +8339,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.13" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.16" }, "funding": [ { @@ -8686,39 +8355,33 @@ "type": "tidelift" } ], - "time": "2022-08-30T19:10:13+00:00" + "time": "2024-11-25T14:52:46+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -8726,7 +8389,7 @@ "function.php" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8743,7 +8406,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -8759,86 +8422,71 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/doctrine-bridge", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "6ac912989e0c31b178aa534eb9ed75f7fa485fae" + "reference": "fd0094d4648bf6bbdafcd1f0c8aafb6e93d735e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/6ac912989e0c31b178aa534eb9ed75f7fa485fae", - "reference": "6ac912989e0c31b178aa534eb9ed75f7fa485fae", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/fd0094d4648bf6bbdafcd1f0c8aafb6e93d735e6", + "reference": "fd0094d4648bf6bbdafcd1f0c8aafb6e93d735e6", + "shasum": "" }, "require": { - "doctrine/event-manager": "~1.0", - "doctrine/persistence": "^2|^3", - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "doctrine/event-manager": "^1.2|^2", + "doctrine/persistence": "^2.5|^3.1|^4", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3" + "symfony/service-contracts": "^2.5|^3" }, "conflict": { "doctrine/dbal": "<2.13.1", "doctrine/lexer": "<1.1", - "doctrine/orm": "<2.7.4", - "phpunit/phpunit": "<5.4.3", + "doctrine/orm": "<2.15", "symfony/cache": "<5.4", - "symfony/dependency-injection": "<4.4", - "symfony/form": "<5.1", - "symfony/http-kernel": "<5", - "symfony/messenger": "<4.4", - "symfony/property-info": "<5", - "symfony/proxy-manager-bridge": "<4.4.19", - "symfony/security-bundle": "<5", - "symfony/security-core": "<5.3", - "symfony/validator": "<5.2" + "symfony/dependency-injection": "<6.2", + "symfony/form": "<5.4.38|>=6,<6.4.6|>=7,<7.0.6", + "symfony/http-foundation": "<6.3", + "symfony/http-kernel": "<6.2", + "symfony/lock": "<6.3", + "symfony/messenger": "<5.4", + "symfony/property-info": "<5.4", + "symfony/security-bundle": "<5.4", + "symfony/security-core": "<6.4", + "symfony/validator": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", - "doctrine/collections": "~1.0", - "doctrine/data-fixtures": "^1.1", - "doctrine/dbal": "^2.13.1|^3.0", - "doctrine/orm": "^2.7.4", + "doctrine/collections": "^1.0|^2.0", + "doctrine/data-fixtures": "^1.1|^2", + "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/orm": "^2.15|^3", "psr/log": "^1|^2|^3", - "symfony/cache": "^5.4|^6.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/doctrine-messenger": "^5.1|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/form": "^5.4.9|^6.0.9", - "symfony/http-kernel": "^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/property-info": "^5.0|^6.0", - "symfony/proxy-manager-bridge": "^4.4|^5.0|^6.0", - "symfony/security-core": "^5.3|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/uid": "^5.1|^6.0", - "symfony/validator": "^5.2|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "doctrine/data-fixtures": "", - "doctrine/dbal": "", - "doctrine/orm": "", - "symfony/form": "", - "symfony/property-info": "", - "symfony/validator": "" + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.2|^7.0", + "symfony/doctrine-messenger": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4.38|^6.4.6|^7.0.6", + "symfony/http-kernel": "^6.3|^7.0", + "symfony/lock": "^6.3|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/proxy-manager-bridge": "^6.4", + "symfony/security-core": "^6.4|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "symfony-bridge", "autoload": { @@ -8849,7 +8497,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8866,7 +8514,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v5.4.13" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.18" }, "funding": [ { @@ -8882,42 +8530,35 @@ "type": "tidelift" } ], - "time": "2022-09-06T13:23:31+00:00" + "time": "2025-01-25T08:04:58+00:00" }, { "name": "symfony/doctrine-messenger", - "version": "v5.4.12", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-messenger.git", - "reference": "7649a80e917b47c5072480a2d763c2422da239d2" + "reference": "5437d2cde244a4a4b657bc7f3aceb1ce6c56ea7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/7649a80e917b47c5072480a2d763c2422da239d2", - "reference": "7649a80e917b47c5072480a2d763c2422da239d2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/doctrine-messenger/zipball/5437d2cde244a4a4b657bc7f3aceb1ce6c56ea7f", + "reference": "5437d2cde244a4a4b657bc7f3aceb1ce6c56ea7f", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/messenger": "^5.1|^6.0", - "symfony/service-contracts": "^1.1|^2|^3" + "doctrine/dbal": "^2.13|^3|^4", + "php": ">=8.1", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "doctrine/dbal": "<2.13", "doctrine/persistence": "<1.3" }, "require-dev": { - "doctrine/dbal": "^2.13|^3.0", "doctrine/persistence": "^1.3|^2|^3", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/serializer": "^5.4|^6.0|^7.0" }, "type": "symfony-messenger-bridge", "autoload": { @@ -8928,7 +8569,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -8945,7 +8586,7 @@ "description": "Symfony Doctrine Messenger Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-messenger/tree/v5.4.12" + "source": "https://github.com/symfony/doctrine-messenger/tree/v6.4.18" }, "funding": [ { @@ -8961,35 +8602,32 @@ "type": "tidelift" } ], - "time": "2022-08-09T12:54:00+00:00" + "time": "2025-01-06T15:50:19+00:00" }, { "name": "symfony/dotenv", - "version": "v5.4.5", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "83a2310904a4f5d4f42526227b5a578ac82232a9" + "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/83a2310904a4f5d4f42526227b5a578ac82232a9", - "reference": "83a2310904a4f5d4f42526227b5a578ac82232a9", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/dotenv/zipball/1ac5e7e7e862d4d574258daf08bd569ba926e4a5", + "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1" + }, + "conflict": { + "symfony/console": "<5.4", + "symfony/process": "<5.4" }, "require-dev": { - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9000,7 +8638,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9022,7 +8660,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v5.4.5" + "source": "https://github.com/symfony/dotenv/tree/v6.4.16" }, "funding": [ { @@ -9038,37 +8676,35 @@ "type": "tidelift" } ], - "time": "2022-02-15T17:04:12+00:00" + "time": "2024-11-27T11:08:19+00:00" }, { "name": "symfony/error-handler", - "version": "v5.4.11", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "f75d17cb4769eb38cd5fccbda95cd80a054d35c8" + "reference": "e8d3b5b1975e67812a54388b1ba8e9ec28eb770e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/f75d17cb4769eb38cd5fccbda95cd80a054d35c8", - "reference": "f75d17cb4769eb38cd5fccbda95cd80a054d35c8", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/error-handler/zipball/e8d3b5b1975e67812a54388b1ba8e9ec28eb770e", + "reference": "e8d3b5b1975e67812a54388b1ba8e9ec28eb770e", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" }, "require-dev": { - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/serializer": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -9082,7 +8718,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9099,7 +8735,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.11" + "source": "https://github.com/symfony/error-handler/tree/v6.4.18" }, "funding": [ { @@ -9115,54 +8751,43 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2025-01-06T09:38:16+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.9", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9173,7 +8798,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9190,7 +8815,7 @@ "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/v5.4.9" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.13" }, "funding": [ { @@ -9206,43 +8831,34 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:45:39+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -9250,7 +8866,7 @@ "Symfony\\Contracts\\EventDispatcher\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9275,7 +8891,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -9291,33 +8907,29 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.13", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { @@ -9328,7 +8940,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9345,7 +8957,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + "source": "https://github.com/symfony/filesystem/tree/v6.4.13" }, "funding": [ { @@ -9361,32 +8973,27 @@ "type": "tidelift" } ], - "time": "2022-09-21T19:53:16+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/finder", - "version": "v5.4.11", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/finder/zipball/1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { @@ -9397,7 +9004,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9414,7 +9021,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.11" + "source": "https://github.com/symfony/finder/tree/v6.4.17" }, "funding": [ { @@ -9430,32 +9037,29 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2024-12-29T13:51:37+00:00" }, { "name": "symfony/flex", - "version": "v1.19.3", + "version": "v1.21.8", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "ab0453b16029e131c112df1a76e59eb2a47e1f67" + "reference": "bda5f869ac51c8e985a6fe9f964c4cb78228a369" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/ab0453b16029e131c112df1a76e59eb2a47e1f67", - "reference": "ab0453b16029e131c112df1a76e59eb2a47e1f67", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/flex/zipball/bda5f869ac51c8e985a6fe9f964c4cb78228a369", + "reference": "bda5f869ac51c8e985a6fe9f964c4cb78228a369", + "shasum": "" }, "require": { "composer-plugin-api": "^1.0|^2.0", "php": ">=7.1" }, + "conflict": { + "composer/semver": "<1.7.2" + }, "require-dev": { "composer/composer": "^1.0.2|^2.0", "symfony/dotenv": "^4.4|^5.0|^6.0", @@ -9472,7 +9076,7 @@ "Symfony\\Flex\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9485,7 +9089,7 @@ "description": "Composer plugin for Symfony", "support": { "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v1.19.3" + "source": "https://github.com/symfony/flex/tree/v1.21.8" }, "funding": [ { @@ -9501,72 +9105,60 @@ "type": "tidelift" } ], - "time": "2022-08-07T09:39:08+00:00" + "time": "2024-10-07T08:51:39+00:00" }, { "name": "symfony/form", - "version": "v5.4.13", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "d9d661776636ce689bc879b66fb06c6a6895f1a7" + "reference": "0fe17f90af23908ddc11dc23507db98e66572046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/d9d661776636ce689bc879b66fb06c6a6895f1a7", - "reference": "d9d661776636ce689bc879b66fb06c6a6895f1a7", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/form/zipball/0fe17f90af23908ddc11dc23507db98e66572046", + "reference": "0fe17f90af23908ddc11dc23507db98e66572046", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/options-resolver": "^5.1|^6.0", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/options-resolver": "^5.4|^6.0|^7.0", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-icu": "^1.21", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.23", - "symfony/property-access": "^5.0.8|^6.0", - "symfony/service-contracts": "^1.1|^2|^3" + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4", - "symfony/dependency-injection": "<4.4", - "symfony/doctrine-bridge": "<4.4", - "symfony/error-handler": "<4.4.5", - "symfony/framework-bundle": "<4.4", - "symfony/http-kernel": "<4.4", - "symfony/translation": "<4.4", - "symfony/translation-contracts": "<1.1.7", - "symfony/twig-bridge": "<4.4" - }, - "require-dev": { - "doctrine/collections": "~1.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/security-csrf": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/uid": "^5.1|^6.0", - "symfony/validator": "^4.4.17|^5.1.9|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/security-csrf": "For protecting forms against CSRF attacks.", - "symfony/twig-bridge": "For templating with Twig.", - "symfony/validator": "For form validation." + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/doctrine-bridge": "<5.4.21|>=6,<6.2.7", + "symfony/error-handler": "<5.4", + "symfony/framework-bundle": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", + "symfony/translation-contracts": "<2.5", + "symfony/twig-bridge": "<6.3" + }, + "require-dev": { + "doctrine/collections": "^1.0|^2.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/html-sanitizer": "^6.1|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.2|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9577,7 +9169,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9594,7 +9186,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v5.4.13" + "source": "https://github.com/symfony/form/tree/v6.4.13" }, "funding": [ { @@ -9610,120 +9202,112 @@ "type": "tidelift" } ], - "time": "2022-09-28T15:33:58+00:00" + "time": "2024-10-09T08:40:40+00:00" }, { "name": "symfony/framework-bundle", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "394866c2cb8bb189b9bd5ebd043b66f89c800363" + "reference": "91df8ee37543ebc01756c9e5eaf94d1878ff1ccd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/394866c2cb8bb189b9bd5ebd043b66f89c800363", - "reference": "394866c2cb8bb189b9bd5ebd043b66f89c800363", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/91df8ee37543ebc01756c9e5eaf94d1878ff1ccd", + "reference": "91df8ee37543ebc01756c9e5eaf94d1878ff1ccd", + "shasum": "" }, "require": { + "composer-runtime-api": ">=2.1", "ext-xml": "*", - "php": ">=7.2.5", - "symfony/cache": "^5.2|^6.0", - "symfony/config": "^5.3|^6.0", - "symfony/dependency-injection": "^5.4.5|^6.0.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^4.4.1|^5.0.1|^6.0", - "symfony/event-dispatcher": "^5.1|^6.0", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^5.3|^6.0", - "symfony/http-kernel": "^5.4|^6.0", + "php": ">=8.1", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/dependency-injection": "^6.4.12|^7.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.1|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/routing": "^5.3|^6.0" + "symfony/routing": "^6.4|^7.0" }, "conflict": { "doctrine/annotations": "<1.13.1", - "doctrine/cache": "<1.11", "doctrine/persistence": "<1.3", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "phpunit/phpunit": "<5.4.3", - "symfony/asset": "<5.3", - "symfony/console": "<5.2.5", - "symfony/dom-crawler": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/form": "<5.2", - "symfony/http-client": "<4.4", - "symfony/lock": "<4.4", - "symfony/mailer": "<5.2", - "symfony/messenger": "<5.4", - "symfony/mime": "<4.4", - "symfony/property-access": "<5.3", - "symfony/property-info": "<4.4", - "symfony/security-csrf": "<5.3", - "symfony/serializer": "<5.2", - "symfony/service-contracts": ">=3.0", - "symfony/stopwatch": "<4.4", - "symfony/translation": "<5.3", - "symfony/twig-bridge": "<4.4", - "symfony/twig-bundle": "<4.4", - "symfony/validator": "<5.2", - "symfony/web-profiler-bundle": "<4.4", - "symfony/workflow": "<5.2" - }, - "require-dev": { - "doctrine/annotations": "^1.13.1", - "doctrine/cache": "^1.11|^2.0", + "symfony/asset": "<5.4", + "symfony/asset-mapper": "<6.4", + "symfony/clock": "<6.3", + "symfony/console": "<5.4|>=7.0", + "symfony/dom-crawler": "<6.4", + "symfony/dotenv": "<5.4", + "symfony/form": "<5.4", + "symfony/http-client": "<6.3", + "symfony/lock": "<5.4", + "symfony/mailer": "<5.4", + "symfony/messenger": "<6.3", + "symfony/mime": "<6.4", + "symfony/property-access": "<5.4", + "symfony/property-info": "<5.4", + "symfony/runtime": "<5.4.45|>=6.0,<6.4.13|>=7.0,<7.1.6", + "symfony/scheduler": "<6.4.4|>=7.0.0,<7.0.4", + "symfony/security-core": "<5.4", + "symfony/security-csrf": "<5.4", + "symfony/serializer": "<6.4", + "symfony/stopwatch": "<5.4", + "symfony/translation": "<6.4", + "symfony/twig-bridge": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/validator": "<6.4", + "symfony/web-profiler-bundle": "<6.4", + "symfony/workflow": "<6.4" + }, + "require-dev": { + "doctrine/annotations": "^1.13.1|^2", "doctrine/persistence": "^1.3|^2|^3", + "dragonmantank/cron-expression": "^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/asset": "^5.3|^6.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/console": "^5.4.9|^6.0.9", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dom-crawler": "^4.4.30|^5.3.7|^6.0", - "symfony/dotenv": "^5.1|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/form": "^5.2|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/mailer": "^5.2|^6.0", - "symfony/messenger": "^5.4|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/notifier": "^5.4|^6.0", + "seld/jsonlint": "^1.10", + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/asset-mapper": "^6.4|^7.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.2|^7.0", + "symfony/console": "^5.4.9|^6.0.9|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^6.4|^7.0", + "symfony/dotenv": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/html-sanitizer": "^6.1|^7.0", + "symfony/http-client": "^6.3|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/mailer": "^5.4|^6.0|^7.0", + "symfony/messenger": "^6.3|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/notifier": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/property-info": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0", - "symfony/security-bundle": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/string": "^5.0|^6.0", - "symfony/translation": "^5.3|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", - "symfony/validator": "^5.2|^6.0", - "symfony/web-link": "^4.4|^5.0|^6.0", - "symfony/workflow": "^5.2|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0", - "twig/twig": "^2.10|^3.0" - }, - "suggest": { - "ext-apcu": "For best performance of the system caches", - "symfony/console": "For using the console commands", - "symfony/form": "For using forms", - "symfony/property-info": "For using the property_info service", - "symfony/serializer": "For using the serializer service", - "symfony/validator": "For using validation", - "symfony/web-link": "For using web links, features such as preloading, prefetching or prerendering", - "symfony/yaml": "For using the debug:config and lint:yaml commands" + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/scheduler": "^6.4.4|^7.0.4", + "symfony/security-bundle": "^5.4|^6.0|^7.0", + "symfony/semaphore": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/string": "^5.4|^6.0|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/workflow": "^6.4|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", + "twig/twig": "^2.10|^3.0.4" }, "type": "symfony-bundle", "autoload": { @@ -9734,7 +9318,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9751,7 +9335,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v5.4.13" + "source": "https://github.com/symfony/framework-bundle/tree/v6.4.18" }, "funding": [ { @@ -9767,56 +9351,53 @@ "type": "tidelift" } ], - "time": "2022-09-29T08:12:55+00:00" + "time": "2025-01-28T18:47:02+00:00" }, { "name": "symfony/http-client", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "596fd752f00e0205d895cd6b184d135c27bb5d6a" + "reference": "394b440934056b8d9d6ba250001458e9d7998b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/596fd752f00e0205d895cd6b184d135c27bb5d6a", - "reference": "596fd752f00e0205d895cd6b184d135c27bb5d6a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/http-client/zipball/394b440934056b8d9d6ba250001458e9d7998b7f", + "reference": "394b440934056b8d9d6ba250001458e9d7998b7f", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-client-contracts": "^2.4", - "symfony/polyfill-php73": "^1.11", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.0|^2|^3" + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.3" }, "provide": { "php-http/async-client-implementation": "*", "php-http/client-implementation": "*", "psr/http-client-implementation": "1.0", - "symfony/http-client-implementation": "2.4" + "symfony/http-client-implementation": "3.0" }, "require-dev": { "amphp/amp": "^2.5", "amphp/http-client": "^4.2.1", "amphp/http-tunnel": "^1.0", "amphp/socket": "^1.1", - "guzzlehttp/promises": "^1.4", + "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4.13|^5.1.5|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9827,7 +9408,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9843,8 +9424,11 @@ ], "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", + "keywords": [ + "http" + ], "support": { - "source": "https://github.com/symfony/http-client/tree/v5.4.13" + "source": "https://github.com/symfony/http-client/tree/v6.4.18" }, "funding": [ { @@ -9860,50 +9444,44 @@ "type": "tidelift" } ], - "time": "2022-09-08T18:41:21+00:00" + "time": "2025-01-28T15:49:13+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v2.5.2", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70" + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70", - "reference": "ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", + "shasum": "" }, "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/http-client-implementation": "" + "php": ">=8.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\HttpClient\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -9928,7 +9506,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" }, "funding": [ { @@ -9944,45 +9522,40 @@ "type": "tidelift" } ], - "time": "2022-04-12T15:48:08+00:00" + "time": "2024-12-07T08:49:48+00:00" }, { "name": "symfony/http-foundation", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "54be067587a4f2b7fffb7a699f9481ec3daf9379" + "reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/54be067587a4f2b7fffb7a699f9481ec3daf9379", - "reference": "54be067587a4f2b7fffb7a699f9481ec3daf9379", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0492d6217e5ab48f51fca76f64cf8e78919d0db", + "reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-php83": "^1.27" }, - "require-dev": { - "predis/predis": "~1.0", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" + "conflict": { + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" }, - "suggest": { - "symfony/mime": "To use the file extension guesser" + "require-dev": { + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4.12|^7.1.5", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -9993,7 +9566,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10010,7 +9583,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.13" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.18" }, "funding": [ { @@ -10026,82 +9599,78 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:31:22+00:00" + "time": "2025-01-09T15:48:56+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "4f25330c216b7bb178603b2e25fb7a9325015507" + "reference": "fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4f25330c216b7bb178603b2e25fb7a9325015507", - "reference": "4f25330c216b7bb178603b2e25fb7a9325015507", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7", + "reference": "fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/log": "^1|^2", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^5.0|^6.0", - "symfony/http-foundation": "^5.3.7|^6.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.4|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/polyfill-ctype": "^1.8" }, "conflict": { "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.0", - "symfony/config": "<5.0", - "symfony/console": "<4.4", - "symfony/dependency-injection": "<5.3", - "symfony/doctrine-bridge": "<5.0", - "symfony/form": "<5.0", - "symfony/http-client": "<5.0", - "symfony/mailer": "<5.0", - "symfony/messenger": "<5.0", - "symfony/translation": "<5.0", - "symfony/twig-bridge": "<5.0", - "symfony/validator": "<5.0", + "symfony/cache": "<5.4", + "symfony/config": "<6.1", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<6.4", + "symfony/doctrine-bridge": "<5.4", + "symfony/form": "<5.4", + "symfony/http-client": "<5.4", + "symfony/http-client-contracts": "<2.5", + "symfony/mailer": "<5.4", + "symfony/messenger": "<5.4", + "symfony/translation": "<5.4", + "symfony/translation-contracts": "<2.5", + "symfony/twig-bridge": "<5.4", + "symfony/validator": "<6.4", + "symfony/var-dumper": "<6.3", "twig/twig": "<2.13" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.2|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4.5|^6.0.5|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.4|^7.0.4", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.4|^7.0", + "symfony/var-exporter": "^6.2|^7.0", "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" - }, "type": "library", "autoload": { "psr-4": { @@ -10111,7 +9680,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10128,7 +9697,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.13" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.18" }, "funding": [ { @@ -10144,52 +9713,41 @@ "type": "tidelift" } ], - "time": "2022-09-30T07:40:28+00:00" + "time": "2025-01-29T07:25:58+00:00" }, { "name": "symfony/intl", - "version": "v5.4.11", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "d305c0c1d31b30b3876e041804c35e49e5f8a96e" + "reference": "b1d5e8d82615b60f229216edfee0b59e2ef66da6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/d305c0c1d31b30b3876e041804c35e49e5f8a96e", - "reference": "d305c0c1d31b30b3876e041804c35e49e5f8a96e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/intl/zipball/b1d5e8d82615b60f229216edfee0b59e2ef66da6", + "reference": "b1d5e8d82615b60f229216edfee0b59e2ef66da6", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "require-dev": { - "symfony/filesystem": "^4.4|^5.0|^6.0" + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { - "files": [ - "Resources/functions.php" - ], "psr-4": { "Symfony\\Component\\Intl\\": "" }, - "classmap": [ - "Resources/stubs" - ], "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/data/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10211,7 +9769,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library", + "description": "Provides access to the localization data of the ICU library", "homepage": "https://symfony.com", "keywords": [ "i18n", @@ -10222,7 +9780,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v5.4.11" + "source": "https://github.com/symfony/intl/tree/v6.4.15" }, "funding": [ { @@ -10238,40 +9796,34 @@ "type": "tidelift" } ], - "time": "2022-07-20T11:34:24+00:00" + "time": "2024-11-08T15:28:48+00:00" }, { "name": "symfony/lock", - "version": "v5.4.10", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/lock.git", - "reference": "41a308008d92d30cae5615d903c4d46d95932eea" + "reference": "a69c3dd151ab7e14925f119164cfdf65d55392a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/lock/zipball/41a308008d92d30cae5615d903c4d46d95932eea", - "reference": "41a308008d92d30cae5615d903c4d46d95932eea", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/lock/zipball/a69c3dd151ab7e14925f119164cfdf65d55392a4", + "reference": "a69c3dd151ab7e14925f119164cfdf65d55392a4", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { - "doctrine/dbal": "<2.13" + "doctrine/dbal": "<2.13", + "symfony/cache": "<6.2" }, "require-dev": { - "doctrine/dbal": "^2.13|^3.0", - "predis/predis": "~1.0" + "doctrine/dbal": "^2.13|^3|^4", + "predis/predis": "^1.1|^2.0" }, "type": "library", "autoload": { @@ -10282,7 +9834,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10307,7 +9859,7 @@ "semaphore" ], "support": { - "source": "https://github.com/symfony/lock/tree/v5.4.10" + "source": "https://github.com/symfony/lock/tree/v6.4.13" }, "funding": [ { @@ -10323,45 +9875,43 @@ "type": "tidelift" } ], - "time": "2022-06-09T13:29:56+00:00" + "time": "2024-10-25T15:19:46+00:00" }, { "name": "symfony/mailer", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "63bf36a5150ac0bfed1c4d0a4e0b114a57b77e11" + "reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/63bf36a5150ac0bfed1c4d0a4e0b114a57b77e11", - "reference": "63bf36a5150ac0bfed1c4d0a4e0b114a57b77e11", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/mailer/zipball/e93a6ae2767d7f7578c2b7961d9d8e27580b2b11", + "reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11", + "shasum": "" }, "require": { - "egulias/email-validator": "^2.1.10|^3", - "php": ">=7.2.5", + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.1", "psr/event-dispatcher": "^1", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/mime": "^5.2.6|^6.0", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3" + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/mime": "^6.2|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/http-kernel": "<4.4" + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<5.4", + "symfony/messenger": "<6.2", + "symfony/mime": "<6.2", + "symfony/twig-bridge": "<6.2.1" }, "require-dev": { - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/messenger": "^4.4|^5.0|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/messenger": "^6.2|^7.0", + "symfony/twig-bridge": "^6.2|^7.0" }, "type": "library", "autoload": { @@ -10372,7 +9922,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10389,7 +9939,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v5.4.13" + "source": "https://github.com/symfony/mailer/tree/v6.4.18" }, "funding": [ { @@ -10405,59 +9955,50 @@ "type": "tidelift" } ], - "time": "2022-08-29T06:47:07+00:00" + "time": "2025-01-24T15:27:15+00:00" }, { "name": "symfony/messenger", - "version": "v5.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "8f8d3425991e627902f8288088609a8d8f6c6ea4" + "reference": "b20092876c3d23c172a6469f9c0d7ef1de445257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/8f8d3425991e627902f8288088609a8d8f6c6ea4", - "reference": "8f8d3425991e627902f8288088609a8d8f6c6ea4", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/messenger/zipball/b20092876c3d23c172a6469f9c0d7ef1de445257", + "reference": "b20092876c3d23c172a6469f9c0d7ef1de445257", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/log": "^1|^2|^3", - "symfony/amqp-messenger": "^5.1|^6.0", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/doctrine-messenger": "^5.1|^6.0", - "symfony/polyfill-php80": "^1.16", - "symfony/redis-messenger": "^5.1|^6.0" + "symfony/clock": "^6.3|^7.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { - "symfony/event-dispatcher": "<4.4", - "symfony/framework-bundle": "<4.4", - "symfony/http-kernel": "<4.4", - "symfony/serializer": "<5.0" + "symfony/console": "<6.3", + "symfony/event-dispatcher": "<5.4", + "symfony/event-dispatcher-contracts": "<2.5", + "symfony/framework-bundle": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/serializer": "<5.4" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/serializer": "^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/validator": "^4.4|^5.0|^6.0" - }, - "suggest": { - "enqueue/messenger-adapter": "For using the php-enqueue library as a transport." + "symfony/console": "^6.3|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/serializer": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/validator": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -10468,7 +10009,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10485,7 +10026,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v5.4.13" + "source": "https://github.com/symfony/messenger/tree/v6.4.16" }, "funding": [ { @@ -10501,48 +10042,44 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:31:22+00:00" + "time": "2024-11-25T02:02:03+00:00" }, { "name": "symfony/mime", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "bb2ccf759e2b967dcd11bdee5bdf30dddd2290bd" + "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/bb2ccf759e2b967dcd11bdee5bdf30dddd2290bd", - "reference": "bb2ccf759e2b967dcd11bdee5bdf30dddd2290bd", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/mime/zipball/917d77981eb1ea963608d5cda4d9c0cf72eaa68e", + "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<4.4" + "symfony/mailer": "<5.4", + "symfony/serializer": "<6.4.3|>7.0,<7.0.3" }, "require-dev": { - "egulias/email-validator": "^2.1.10|^3.1", + "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.1|^6.0", - "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.2|^6.0" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.4|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.3|^7.0.3" }, "type": "library", "autoload": { @@ -10553,7 +10090,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10574,7 +10111,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.13" + "source": "https://github.com/symfony/mime/tree/v6.4.18" }, "funding": [ { @@ -10590,53 +10127,42 @@ "type": "tidelift" } ], - "time": "2022-09-01T18:18:29+00:00" + "time": "2025-01-23T13:10:52+00:00" }, { "name": "symfony/monolog-bridge", - "version": "v5.4.10", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "b3b0890e76e7eb626f27b165a5c501f2754dfbbd" + "reference": "9d14621e59f22c2b6d030d92d37ffe5ae1e60452" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/b3b0890e76e7eb626f27b165a5c501f2754dfbbd", - "reference": "b3b0890e76e7eb626f27b165a5c501f2754dfbbd", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/9d14621e59f22c2b6d030d92d37ffe5ae1e60452", + "reference": "9d14621e59f22c2b6d030d92d37ffe5ae1e60452", + "shasum": "" }, "require": { - "monolog/monolog": "^1.25.1|^2", - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^5.3|^6.0", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3" + "monolog/monolog": "^1.25.1|^2|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/console": "<4.4", - "symfony/http-foundation": "<5.3" + "symfony/console": "<5.4", + "symfony/http-foundation": "<5.4", + "symfony/security-core": "<5.4" }, "require-dev": { - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/mailer": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/security-core": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", - "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", - "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/mailer": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/security-core": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "symfony-bridge", "autoload": { @@ -10647,7 +10173,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10664,7 +10190,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v5.4.10" + "source": "https://github.com/symfony/monolog-bridge/tree/v6.4.13" }, "funding": [ { @@ -10680,40 +10206,34 @@ "type": "tidelift" } ], - "time": "2022-06-19T12:03:50+00:00" + "time": "2024-10-14T08:49:08+00:00" }, { "name": "symfony/monolog-bundle", - "version": "v3.8.0", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d" + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d", - "reference": "a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", + "shasum": "" }, "require": { - "monolog/monolog": "^1.22 || ^2.0 || ^3.0", - "php": ">=7.1.3", - "symfony/config": "~4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "~4.4 || ^5.0 || ^6.0", - "symfony/monolog-bridge": "~4.4 || ^5.0 || ^6.0" + "monolog/monolog": "^1.25.1 || ^2.0 || ^3.0", + "php": ">=7.2.5", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", + "symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "symfony/console": "~4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.2 || ^6.0", - "symfony/yaml": "~4.4 || ^5.0 || ^6.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^6.3 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "type": "symfony-bundle", "extra": { @@ -10729,7 +10249,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10751,7 +10271,7 @@ ], "support": { "issues": "https://github.com/symfony/monolog-bundle/issues", - "source": "https://github.com/symfony/monolog-bundle/tree/v3.8.0" + "source": "https://github.com/symfony/monolog-bundle/tree/v3.10.0" }, "funding": [ { @@ -10767,33 +10287,25 @@ "type": "tidelift" } ], - "time": "2022-05-10T14:24:36+00:00" + "time": "2023-11-06T17:08:13+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.11", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -10804,7 +10316,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10826,7 +10338,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" }, "funding": [ { @@ -10842,38 +10354,31 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { "name": "symfony/password-hasher", - "version": "v5.4.11", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "b0169ed8f09a4ae39eb119218ea1685079a9b179" + "reference": "e97a1b31f60b8bdfc1fdedab4398538da9441d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/b0169ed8f09a4ae39eb119218ea1685079a9b179", - "reference": "b0169ed8f09a4ae39eb119218ea1685079a9b179", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/e97a1b31f60b8bdfc1fdedab4398538da9441d47", + "reference": "e97a1b31f60b8bdfc1fdedab4398538da9441d47", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "php": ">=8.1" }, "conflict": { - "symfony/security-core": "<5.3" + "symfony/security-core": "<5.4" }, "require-dev": { - "symfony/console": "^5.3|^6.0", - "symfony/security-core": "^5.3|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/security-core": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -10884,7 +10389,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10905,7 +10410,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v5.4.11" + "source": "https://github.com/symfony/password-hasher/tree/v6.4.13" }, "funding": [ { @@ -10921,42 +10426,33 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -10967,7 +10463,7 @@ "Symfony\\Polyfill\\Intl\\Grapheme\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -10992,7 +10488,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -11008,42 +10504,33 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "e407643d610e5f2c8a4b14189150f68934bf5e48" + "reference": "d80a05e9904d2c2b9b95929f3e4b5d3a8f418d78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/e407643d610e5f2c8a4b14189150f68934bf5e48", - "reference": "e407643d610e5f2c8a4b14189150f68934bf5e48", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/d80a05e9904d2c2b9b95929f3e4b5d3a8f418d78", + "reference": "d80a05e9904d2c2b9b95929f3e4b5d3a8f418d78", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance and support of other locales than \"en\"" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11060,7 +10547,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11085,7 +10572,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.31.0" }, "funding": [ { @@ -11101,44 +10588,34 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", + "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11149,7 +10626,7 @@ "Symfony\\Polyfill\\Intl\\Idn\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11178,7 +10655,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -11194,42 +10671,33 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11243,7 +10711,7 @@ "Resources/stubs" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11268,7 +10736,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -11284,30 +10752,24 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -11317,12 +10779,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11333,7 +10792,7 @@ "Symfony\\Polyfill\\Mbstring\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11357,7 +10816,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -11373,39 +10832,30 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11419,7 +10869,7 @@ "Resources/stubs" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11442,7 +10892,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -11458,39 +10908,30 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11504,7 +10945,7 @@ "Resources/stubs" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11531,7 +10972,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -11547,39 +10988,30 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11593,7 +11025,7 @@ "Resources/stubs" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11616,7 +11048,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -11632,45 +11064,30 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-uuid", - "version": "v1.24.0", + "name": "symfony/polyfill-php83", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "7529922412d23ac44413d0f308861d50cf68d3ee" + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/7529922412d23ac44413d0f308861d50cf68d3ee", - "reference": "7529922412d23ac44413d0f308861d50cf68d3ee", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491", + "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491", + "shasum": "" }, "require": { - "php": ">=7.1" - }, - "provide": { - "ext-uuid": "*" - }, - "suggest": { - "ext-uuid": "For best performance" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -11678,33 +11095,36 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Uuid\\": "" - } + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Grégoire Pineau", - "email": "lyrixx@lyrixx.info" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for uuid functions", + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", "polyfill", "portable", - "uuid" + "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0" }, "funding": [ { @@ -11720,31 +11140,24 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.11", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -11755,7 +11168,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11772,7 +11185,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.11" + "source": "https://github.com/symfony/process/tree/v6.4.15" }, "funding": [ { @@ -11788,39 +11201,29 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "symfony/property-access", - "version": "v5.4.11", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "c641d63e943ed31981bad4b4dcf29fe7da2ffa8c" + "reference": "80e0378f2f058b60d87dedc3c760caec882e992c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/c641d63e943ed31981bad4b4dcf29fe7da2ffa8c", - "reference": "c641d63e943ed31981bad4b4dcf29fe7da2ffa8c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/property-access/zipball/80e0378f2f058b60d87dedc3c760caec882e992c", + "reference": "80e0378f2f058b60d87dedc3c760caec882e992c", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16", - "symfony/property-info": "^5.2|^6.0" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/property-info": "^5.4|^6.0|^7.0" }, "require-dev": { - "symfony/cache": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/cache-implementation": "To cache access methods." + "symfony/cache": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -11831,7 +11234,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11855,11 +11258,11 @@ "injection", "object", "property", - "property path", + "property-path", "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v5.4.11" + "source": "https://github.com/symfony/property-access/tree/v6.4.18" }, "funding": [ { @@ -11875,52 +11278,41 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2024-12-16T14:42:05+00:00" }, { "name": "symfony/property-info", - "version": "v5.4.11", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "8a9a2b638a808cc92a2fbce185b9318e76b0e20c" + "reference": "94d18e5cc11a37fd92856d38b61d9cdf72536a1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/8a9a2b638a808cc92a2fbce185b9318e76b0e20c", - "reference": "8a9a2b638a808cc92a2fbce185b9318e76b0e20c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/property-info/zipball/94d18e5cc11a37fd92856d38b61d9cdf72536a1e", + "reference": "94d18e5cc11a37fd92856d38b61d9cdf72536a1e", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16", - "symfony/string": "^5.1|^6.0" + "php": ">=8.1", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/dependency-injection": "<4.4" + "doctrine/annotations": "<1.12", + "phpdocumentor/reflection-docblock": "<5.2", + "phpdocumentor/type-resolver": "<1.5.1", + "symfony/cache": "<5.4", + "symfony/dependency-injection": "<5.4|>=6.0,<6.4", + "symfony/serializer": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "phpstan/phpdoc-parser": "^1.0", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" - }, - "suggest": { - "phpdocumentor/reflection-docblock": "To use the PHPDoc", - "psr/cache-implementation": "To cache results", - "symfony/doctrine-bridge": "To use Doctrine metadata", - "symfony/serializer": "To use Serializer metadata" + "doctrine/annotations": "^1.12|^2", + "phpdocumentor/reflection-docblock": "^5.2", + "phpstan/phpdoc-parser": "^1.0|^2.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/serializer": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { @@ -11931,7 +11323,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -11956,7 +11348,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v5.4.11" + "source": "https://github.com/symfony/property-info/tree/v6.4.18" }, "funding": [ { @@ -11972,52 +11364,42 @@ "type": "tidelift" } ], - "time": "2022-07-19T08:07:51+00:00" + "time": "2025-01-21T10:52:27+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v2.1.3", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "d444f85dddf65c7e57c58d8e5b3a4dbb593b1840" + "reference": "c9cf83326a1074f83a738fc5320945abf7fb7fec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/d444f85dddf65c7e57c58d8e5b3a4dbb593b1840", - "reference": "d444f85dddf65c7e57c58d8e5b3a4dbb593b1840", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/c9cf83326a1074f83a738fc5320945abf7fb7fec", + "reference": "c9cf83326a1074f83a738fc5320945abf7fb7fec", + "shasum": "" }, "require": { - "php": ">=7.1", - "psr/http-message": "^1.0", - "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0" + "php": ">=8.1", + "psr/http-message": "^1.0|^2.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-kernel": "<6.2" }, "require-dev": { "nyholm/psr7": "^1.1", - "psr/log": "^1.1 || ^2 || ^3", - "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.4@dev || ^6.0" - }, - "suggest": { - "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + "php-http/discovery": "^1.15", + "psr/log": "^1.1.4|^2|^3", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^6.2|^7.0", + "symfony/http-kernel": "^6.2|^7.0" }, "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-main": "2.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" @@ -12026,7 +11408,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12037,11 +11419,11 @@ }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "PSR HTTP message bridge", - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "keywords": [ "http", "http-message", @@ -12049,81 +11431,7 @@ "psr-7" ], "support": { - "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.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": "2022-09-05T10:34:54+00:00" - }, - { - "name": "symfony/redis-messenger", - "version": "v5.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/redis-messenger.git", - "reference": "d3028b772de91e9aa0342c92ff71c77b130ac9c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/redis-messenger/zipball/d3028b772de91e9aa0342c92ff71c77b130ac9c4", - "reference": "d3028b772de91e9aa0342c92ff71c77b130ac9c4", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/messenger": "^5.1|^6.0" - }, - "require-dev": { - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" - }, - "type": "symfony-messenger-bridge", - "autoload": { - "psr-4": { - "Symfony\\Component\\Messenger\\Bridge\\Redis\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Redis extension Messenger Bridge", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/redis-messenger/tree/v5.4.13" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v6.4.13" }, "funding": [ { @@ -12139,53 +11447,40 @@ "type": "tidelift" } ], - "time": "2022-09-11T09:11:59+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/routing", - "version": "v5.4.11", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3e01ccd9b2a3a4167ba2b3c53612762300300226" + "reference": "e9bfc94953019089acdfb9be51c1b9142c4afa68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3e01ccd9b2a3a4167ba2b3c53612762300300226", - "reference": "3e01ccd9b2a3a4167ba2b3c53612762300300226", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/routing/zipball/e9bfc94953019089acdfb9be51c1b9142c4afa68", + "reference": "e9bfc94953019089acdfb9be51c1b9142c4afa68", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "doctrine/annotations": "<1.12", - "symfony/config": "<5.3", - "symfony/dependency-injection": "<4.4", - "symfony/yaml": "<4.4" + "symfony/config": "<6.2", + "symfony/dependency-injection": "<5.4", + "symfony/yaml": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.12", + "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", - "symfony/config": "^5.3|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" + "symfony/config": "^6.2|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -12196,7 +11491,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12214,120 +11509,12 @@ "homepage": "https://symfony.com", "keywords": [ "router", - "routing", - "uri", - "url" - ], - "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.11" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-07-20T13:00:38+00:00" - }, - { - "name": "symfony/security-bundle", - "version": "v5.4.11", - "source": { - "type": "git", - "url": "https://github.com/symfony/security-bundle.git", - "reference": "86b49feb056b840f2b79a03fcfa2d378d6d34234" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/86b49feb056b840f2b79a03fcfa2d378d6d34234", - "reference": "86b49feb056b840f2b79a03fcfa2d378d6d34234", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-xml": "*", - "php": ">=7.2.5", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher": "^5.1|^6.0", - "symfony/http-foundation": "^5.3|^6.0", - "symfony/http-kernel": "^5.3|^6.0", - "symfony/password-hasher": "^5.3|^6.0", - "symfony/polyfill-php80": "^1.16", - "symfony/security-core": "^5.4|^6.0", - "symfony/security-csrf": "^4.4|^5.0|^6.0", - "symfony/security-guard": "^5.3", - "symfony/security-http": "^5.4|^6.0" - }, - "conflict": { - "symfony/browser-kit": "<4.4", - "symfony/console": "<4.4", - "symfony/framework-bundle": "<4.4", - "symfony/ldap": "<5.1", - "symfony/twig-bundle": "<4.4" - }, - "require-dev": { - "doctrine/annotations": "^1.10.4", - "symfony/asset": "^4.4|^5.0|^6.0", - "symfony/browser-kit": "^4.4|^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/form": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^5.3|^6.0", - "symfony/ldap": "^5.3|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/twig-bridge": "^4.4|^5.0|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", - "symfony/validator": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0", - "twig/twig": "^2.13|^3.0.4" - }, - "type": "symfony-bundle", - "autoload": { - "psr-4": { - "Symfony\\Bundle\\SecurityBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://repo.repman.io/downloads", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } + "routing", + "uri", + "url" ], - "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", - "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v5.4.11" + "source": "https://github.com/symfony/routing/tree/v6.4.18" }, "funding": [ { @@ -12343,73 +11530,86 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2025-01-09T08:51:02+00:00" }, { - "name": "symfony/security-core", - "version": "v5.4.13", + "name": "symfony/security-bundle", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/security-core.git", - "reference": "71bc477807d9afc9c904fd62b3b5d48f97308460" + "url": "https://github.com/symfony/security-bundle.git", + "reference": "181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/71bc477807d9afc9c904fd62b3b5d48f97308460", - "reference": "71bc477807d9afc9c904fd62b3b5d48f97308460", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3", + "reference": "181d1fcf5f88ef8212ed7f6434e5ff51c9d7dff3", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^1.1|^2|^3", - "symfony/password-hasher": "^5.3|^6.0", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1.6|^2|^3" + "composer-runtime-api": ">=2.1", + "ext-xml": "*", + "php": ">=8.1", + "symfony/clock": "^6.3|^7.0", + "symfony/config": "^6.1|^7.0", + "symfony/dependency-injection": "^6.4.11|^7.1.4", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.2|^7.0", + "symfony/http-kernel": "^6.2", + "symfony/password-hasher": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.2|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/security-http": "^6.3.6|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/event-dispatcher": "<4.4", - "symfony/http-foundation": "<5.3", - "symfony/ldap": "<4.4", - "symfony/security-guard": "<4.4", - "symfony/validator": "<5.2" - }, - "require-dev": { - "psr/cache": "^1.0|^2.0|^3.0", - "psr/container": "^1.0|^2.0", - "psr/log": "^1|^2|^3", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^5.3|^6.0", - "symfony/ldap": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/validator": "^5.2|^6.0" - }, - "suggest": { - "psr/container-implementation": "To instantiate the Security class", - "symfony/event-dispatcher": "", - "symfony/expression-language": "For using the expression voter", - "symfony/http-foundation": "", - "symfony/ldap": "For using LDAP integration", - "symfony/validator": "For using the user password constraint" + "symfony/browser-kit": "<5.4", + "symfony/console": "<5.4", + "symfony/framework-bundle": "<6.4", + "symfony/http-client": "<5.4", + "symfony/ldap": "<5.4", + "symfony/serializer": "<6.4", + "symfony/twig-bundle": "<5.4", + "symfony/validator": "<6.4" + }, + "require-dev": { + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/ldap": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/twig-bridge": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", + "twig/twig": "^2.13|^3.0.4", + "web-token/jwt-checker": "^3.1", + "web-token/jwt-signature-algorithm-ecdsa": "^3.1", + "web-token/jwt-signature-algorithm-eddsa": "^3.1", + "web-token/jwt-signature-algorithm-hmac": "^3.1", + "web-token/jwt-signature-algorithm-none": "^3.1", + "web-token/jwt-signature-algorithm-rsa": "^3.1" }, - "type": "library", + "type": "symfony-bundle", "autoload": { "psr-4": { - "Symfony\\Component\\Security\\Core\\": "" + "Symfony\\Bundle\\SecurityBundle\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12423,10 +11623,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Security Component - Core Library", + "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v5.4.13" + "source": "https://github.com/symfony/security-bundle/tree/v6.4.13" }, "funding": [ { @@ -12442,52 +11642,60 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:31:22+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { - "name": "symfony/security-csrf", - "version": "v5.4.11", + "name": "symfony/security-core", + "version": "v6.4.18", "source": { "type": "git", - "url": "https://github.com/symfony/security-csrf.git", - "reference": "b97ab244b6dda80abb84a4a236d682871695db4a" + "url": "https://github.com/symfony/security-core.git", + "reference": "0ae7ae716968e00287ab9b7768405e0dc9cad109" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-csrf/zipball/b97ab244b6dda80abb84a4a236d682871695db4a", - "reference": "b97ab244b6dda80abb84a4a236d682871695db4a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/security-core/zipball/0ae7ae716968e00287ab9b7768405e0dc9cad109", + "reference": "0ae7ae716968e00287ab9b7768405e0dc9cad109", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16", - "symfony/security-core": "^4.4|^5.0|^6.0" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/event-dispatcher-contracts": "^2.5|^3", + "symfony/password-hasher": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/http-foundation": "<5.3" + "symfony/event-dispatcher": "<5.4", + "symfony/http-foundation": "<5.4", + "symfony/ldap": "<5.4", + "symfony/security-guard": "<5.4", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", + "symfony/validator": "<5.4" }, "require-dev": { - "symfony/http-foundation": "^5.3|^6.0" - }, - "suggest": { - "symfony/http-foundation": "For using the class SessionTokenStorage." + "psr/cache": "^1.0|^2.0|^3.0", + "psr/container": "^1.1|^2.0", + "psr/log": "^1|^2|^3", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/ldap": "^5.4|^6.0|^7.0", + "symfony/string": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", + "symfony/validator": "^6.4|^7.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Security\\Csrf\\": "" + "Symfony\\Component\\Security\\Core\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12501,10 +11709,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Security Component - CSRF Library", + "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-csrf/tree/v5.4.11" + "source": "https://github.com/symfony/security-core/tree/v6.4.18" }, "funding": [ { @@ -12520,47 +11728,42 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2025-01-22T20:59:03+00:00" }, { - "name": "symfony/security-guard", - "version": "v5.4.13", + "name": "symfony/security-csrf", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/security-guard.git", - "reference": "83f647fcdc17aa14908f0e02a302d3d9d0f63fbc" + "url": "https://github.com/symfony/security-csrf.git", + "reference": "c34421b7d34efbaef5d611ab2e646a0ec464ffe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-guard/zipball/83f647fcdc17aa14908f0e02a302d3d9d0f63fbc", - "reference": "83f647fcdc17aa14908f0e02a302d3d9d0f63fbc", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/c34421b7d34efbaef5d611ab2e646a0ec464ffe3", + "reference": "c34421b7d34efbaef5d611ab2e646a0ec464ffe3", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15", - "symfony/security-core": "^5.0", - "symfony/security-http": "^5.3" + "php": ">=8.1", + "symfony/security-core": "^5.4|^6.0|^7.0" + }, + "conflict": { + "symfony/http-foundation": "<5.4" }, "require-dev": { - "psr/log": "^1|^2|^3" + "symfony/http-foundation": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Security\\Guard\\": "" + "Symfony\\Component\\Security\\Csrf\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12574,10 +11777,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Security Component - Guard", + "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-guard/tree/v5.4.13" + "source": "https://github.com/symfony/security-csrf/tree/v6.4.13" }, "funding": [ { @@ -12593,54 +11796,51 @@ "type": "tidelift" } ], - "time": "2022-09-28T13:19:49+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/security-http", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "64e9926b8ab8e4460e4dfdc53dc098fed2dad837" + "reference": "54f2ccce1f3822eee3fb3a85debd9a67d12762b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/64e9926b8ab8e4460e4dfdc53dc098fed2dad837", - "reference": "64e9926b8ab8e4460e4dfdc53dc098fed2dad837", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/security-http/zipball/54f2ccce1f3822eee3fb3a85debd9a67d12762b8", + "reference": "54f2ccce1f3822eee3fb3a85debd9a67d12762b8", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-foundation": "^5.3|^6.0", - "symfony/http-kernel": "^5.3|^6.0", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-foundation": "^6.2|^7.0", + "symfony/http-kernel": "^6.3|^7.0", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/security-core": "^5.4|^6.0" + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3" }, "conflict": { - "symfony/event-dispatcher": "<4.3", - "symfony/security-bundle": "<5.3", - "symfony/security-csrf": "<4.4" + "symfony/clock": "<6.3", + "symfony/event-dispatcher": "<5.4.9|>=6,<6.0.9", + "symfony/http-client-contracts": "<3.0", + "symfony/security-bundle": "<5.4", + "symfony/security-csrf": "<5.4" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/security-csrf": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", - "symfony/security-csrf": "For using tokens to protect authentication/logout attempts" + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/clock": "^6.3|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^3.0", + "symfony/rate-limiter": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "web-token/jwt-checker": "^3.1", + "web-token/jwt-signature-algorithm-ecdsa": "^3.1" }, "type": "library", "autoload": { @@ -12651,7 +11851,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12668,7 +11868,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v5.4.13" + "source": "https://github.com/symfony/security-http/tree/v6.4.18" }, "funding": [ { @@ -12684,55 +11884,49 @@ "type": "tidelift" } ], - "time": "2022-09-29T19:14:22+00:00" + "time": "2025-01-28T14:53:52+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12757,7 +11951,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -12773,31 +11967,25 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.13", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69" + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6df7a3effde34d81717bbef4591e5ffe32226d69", - "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2cae0a6f8d04937d02f6d19806251e2104d54f92", + "reference": "2cae0a6f8d04937d02f6d19806251e2104d54f92", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.1", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -12808,7 +11996,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12825,7 +12013,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.13" + "source": "https://github.com/symfony/stopwatch/tree/v6.4.13" }, "funding": [ { @@ -12841,44 +12029,38 @@ "type": "tidelift" } ], - "time": "2022-09-28T13:19:49+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/string", - "version": "v5.4.13", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "2900c668a32138a34118740de3e4d5a701801f53" + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/2900c668a32138a34118740de3e4d5a701801f53", - "reference": "2900c668a32138a34118740de3e4d5a701801f53", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "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", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -12892,7 +12074,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -12917,7 +12099,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.13" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -12933,50 +12115,44 @@ "type": "tidelift" } ], - "time": "2022-09-01T01:52:16+00:00" + "time": "2024-11-13T13:31:12+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe" + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe", - "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c", + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c", + "shasum": "" }, "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/translation-implementation": "" + "php": ">=8.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13001,7 +12177,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.1" }, "funding": [ { @@ -13017,91 +12193,73 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/twig-bridge", - "version": "v5.4.12", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "94c3b38514c953e3e84719c96d4e578a01ca1819" + "reference": "238e1aac992b5231c66faf10131ace7bdba97065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/94c3b38514c953e3e84719c96d4e578a01ca1819", - "reference": "94c3b38514c953e3e84719c96d4e578a01ca1819", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/238e1aac992b5231c66faf10131ace7bdba97065", + "reference": "238e1aac992b5231c66faf10131ace7bdba97065", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^1.1|^2|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/translation-contracts": "^2.5|^3", "twig/twig": "^2.13|^3.0.4" }, "conflict": { "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/console": "<5.3", - "symfony/form": "<5.3", - "symfony/http-foundation": "<5.3", - "symfony/http-kernel": "<4.4", - "symfony/translation": "<5.2", - "symfony/workflow": "<5.2" - }, - "require-dev": { - "doctrine/annotations": "^1.12", - "egulias/email-validator": "^2.1.10|^3", + "symfony/console": "<5.4", + "symfony/form": "<6.3", + "symfony/http-foundation": "<5.4", + "symfony/http-kernel": "<6.4", + "symfony/mime": "<6.2", + "symfony/serializer": "<6.4", + "symfony/translation": "<5.4", + "symfony/workflow": "<5.4" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3|^4", + "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/asset": "^4.4|^5.0|^6.0", - "symfony/console": "^5.3|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/form": "^5.3|^6.0", - "symfony/http-foundation": "^5.3|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/mime": "^5.2|^6.0", + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/asset-mapper": "^6.3|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/form": "^6.4|^7.0", + "symfony/html-sanitizer": "^6.1|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/mime": "^6.2|^7.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", "symfony/security-acl": "^2.8|^3.0", - "symfony/security-core": "^4.4|^5.0|^6.0", - "symfony/security-csrf": "^4.4|^5.0|^6.0", - "symfony/security-http": "^4.4|^5.0|^6.0", - "symfony/serializer": "^5.2|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^5.2|^6.0", - "symfony/web-link": "^4.4|^5.0|^6.0", - "symfony/workflow": "^5.2|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0", + "symfony/security-core": "^5.4|^6.0|^7.0", + "symfony/security-csrf": "^5.4|^6.0|^7.0", + "symfony/security-http": "^5.4|^6.0|^7.0", + "symfony/serializer": "^6.4.3|^7.0.3", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^6.1|^7.0", + "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/workflow": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "twig/cssinliner-extra": "^2.12|^3", "twig/inky-extra": "^2.12|^3", "twig/markdown-extra": "^2.12|^3" }, - "suggest": { - "symfony/asset": "For using the AssetExtension", - "symfony/expression-language": "For using the ExpressionExtension", - "symfony/finder": "", - "symfony/form": "For using the FormExtension", - "symfony/http-kernel": "For using the HttpKernelExtension", - "symfony/routing": "For using the RoutingExtension", - "symfony/security-core": "For using the SecurityExtension", - "symfony/security-csrf": "For using the CsrfExtension", - "symfony/security-http": "For using the LogoutUrlExtension", - "symfony/stopwatch": "For using the StopwatchExtension", - "symfony/translation": "For using the TranslationExtension", - "symfony/var-dumper": "For using the DumpExtension", - "symfony/web-link": "For using the WebLinkExtension", - "symfony/yaml": "For using the YamlExtension" - }, "type": "symfony-bridge", "autoload": { "psr-4": { @@ -13111,7 +12269,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13128,7 +12286,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v5.4.12" + "source": "https://github.com/symfony/twig-bridge/tree/v6.4.17" }, "funding": [ { @@ -13144,58 +12302,47 @@ "type": "tidelift" } ], - "time": "2022-08-03T13:09:21+00:00" + "time": "2024-12-19T14:08:41+00:00" }, { "name": "symfony/twig-bundle", - "version": "v5.4.8", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "c992b4474c3a31f3c40a1ca593d213833f91b818" + "reference": "c3beeb5336aba1ea03c37e526968c2fde3ef25c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/c992b4474c3a31f3c40a1ca593d213833f91b818", - "reference": "c992b4474c3a31f3c40a1ca593d213833f91b818", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/c3beeb5336aba1ea03c37e526968c2fde3ef25c4", + "reference": "c3beeb5336aba1ea03c37e526968c2fde3ef25c4", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^5.0|^6.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/twig-bridge": "^5.3|^6.0", + "composer-runtime-api": ">=2.1", + "php": ">=8.1", + "symfony/config": "^6.1|^7.0", + "symfony/dependency-injection": "^6.1|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^6.2", + "symfony/twig-bridge": "^6.4", "twig/twig": "^2.13|^3.0.4" }, "conflict": { - "symfony/dependency-injection": "<5.3", - "symfony/framework-bundle": "<5.0", - "symfony/service-contracts": ">=3.0", - "symfony/translation": "<5.0" + "symfony/framework-bundle": "<5.4", + "symfony/translation": "<5.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", - "doctrine/cache": "^1.0|^2.0", - "symfony/asset": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/form": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^5.0|^6.0", - "symfony/web-link": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/asset": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/web-link": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -13206,7 +12353,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13223,7 +12370,7 @@ "description": "Provides a tight integration of Twig into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bundle/tree/v5.4.8" + "source": "https://github.com/symfony/twig-bundle/tree/v6.4.13" }, "funding": [ { @@ -13239,82 +12386,59 @@ "type": "tidelift" } ], - "time": "2022-04-03T13:03:10+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/validator", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "8fba40ed3c21054cb9a543ccecd4f3175b6a011b" + "reference": "ce20367d07b2592202e9c266b16a93fa50145207" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/8fba40ed3c21054cb9a543ccecd4f3175b6a011b", - "reference": "8fba40ed3c21054cb9a543ccecd4f3175b6a011b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/validator/zipball/ce20367d07b2592202e9c266b16a93fa50145207", + "reference": "ce20367d07b2592202e9c266b16a93fa50145207", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/translation-contracts": "^1.1|^2|^3" + "symfony/polyfill-php83": "^1.27", + "symfony/translation-contracts": "^2.5|^3" }, "conflict": { "doctrine/annotations": "<1.13", - "doctrine/cache": "<1.11", "doctrine/lexer": "<1.1", - "phpunit/phpunit": "<5.4.3", - "symfony/dependency-injection": "<4.4", - "symfony/expression-language": "<5.1", - "symfony/http-kernel": "<4.4", - "symfony/intl": "<4.4", - "symfony/property-info": "<5.3", - "symfony/translation": "<4.4", - "symfony/yaml": "<4.4" - }, - "require-dev": { - "doctrine/annotations": "^1.13", - "doctrine/cache": "^1.11|^2.0", - "egulias/email-validator": "^2.1.10|^3", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^5.1|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/property-info": "^5.3|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "egulias/email-validator": "Strict (RFC compliant) email validation", - "psr/cache-implementation": "For using the mapping cache.", - "symfony/config": "", - "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For accessing properties within comparison constraints", - "symfony/property-info": "To automatically add NotNull and Type constraints", - "symfony/translation": "For translating validation errors.", - "symfony/yaml": "" + "symfony/dependency-injection": "<5.4", + "symfony/expression-language": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/intl": "<5.4", + "symfony/property-info": "<5.4", + "symfony/translation": "<5.4.35|>=6.0,<6.3.12|>=6.4,<6.4.3|>=7.0,<7.0.3", + "symfony/yaml": "<5.4" + }, + "require-dev": { + "doctrine/annotations": "^1.13|^2", + "egulias/email-validator": "^2.1.10|^3|^4", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "symfony/property-info": "^5.4|^6.0|^7.0", + "symfony/translation": "^5.4.35|~6.3.12|^6.4.3|^7.0.3", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -13322,10 +12446,11 @@ "Symfony\\Component\\Validator\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/bin/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13342,7 +12467,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v5.4.13" + "source": "https://github.com/symfony/validator/tree/v6.4.18" }, "funding": [ { @@ -13358,49 +12483,39 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:31:22+00:00" + "time": "2025-01-27T16:05:44+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2bf2ccab581bec363191672f0df40e0c85569e1c" + "reference": "4ad10cf8b020e77ba665305bb7804389884b4837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2bf2ccab581bec363191672f0df40e0c85569e1c", - "reference": "2bf2ccab581bec363191672f0df40e0c85569e1c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4ad10cf8b020e77ba665305bb7804389884b4837", + "reference": "4ad10cf8b020e77ba665305bb7804389884b4837", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "symfony/console": "<5.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/uid": "^5.1|^6.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^6.3|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/uid": "^5.4|^6.0|^7.0", "twig/twig": "^2.13|^3.0.4" }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, "bin": [ "Resources/bin/var-dump-server" ], @@ -13416,7 +12531,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13437,7 +12552,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.13" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.18" }, "funding": [ { @@ -13453,34 +12568,30 @@ "type": "tidelift" } ], - "time": "2022-09-06T13:23:31+00:00" + "time": "2025-01-17T11:26:11+00:00" }, { "name": "symfony/var-exporter", - "version": "v5.4.10", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "8fc03ee75eeece3d9be1ef47d26d79bea1afb340" + "reference": "0f605f72a363f8743001038a176eeb2a11223b51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/8fc03ee75eeece3d9be1ef47d26d79bea1afb340", - "reference": "8fc03ee75eeece3d9be1ef47d26d79bea1afb340", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0f605f72a363f8743001038a176eeb2a11223b51", + "reference": "0f605f72a363f8743001038a176eeb2a11223b51", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "require-dev": { - "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -13491,7 +12602,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13513,10 +12624,12 @@ "export", "hydrate", "instantiate", + "lazy-loading", + "proxy", "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.10" + "source": "https://github.com/symfony/var-exporter/tree/v6.4.13" }, "funding": [ { @@ -13532,41 +12645,32 @@ "type": "tidelift" } ], - "time": "2022-05-27T12:56:18+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.12", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c" + "reference": "bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", - "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/yaml/zipball/bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5", + "reference": "bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/console": "<5.3" + "symfony/console": "<5.4" }, "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "symfony/console": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -13580,7 +12684,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13597,7 +12701,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.12" + "source": "https://github.com/symfony/yaml/tree/v6.4.18" }, "funding": [ { @@ -13613,51 +12717,40 @@ "type": "tidelift" } ], - "time": "2022-08-02T15:52:22+00:00" + "time": "2025-01-07T09:44:41+00:00" }, { "name": "twig/extra-bundle", - "version": "v3.4.0", + "version": "v3.19.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", - "reference": "2e58256b0e9fe52f30149347c0547e4633304765" + "reference": "9746573ca4bc1cd03a767a183faadaf84e0c31fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/2e58256b0e9fe52f30149347c0547e4633304765", - "reference": "2e58256b0e9fe52f30149347c0547e4633304765", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/9746573ca4bc1cd03a767a183faadaf84e0c31fa", + "reference": "9746573ca4bc1cd03a767a183faadaf84e0c31fa", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", - "twig/twig": "^2.7|^3.0" + "php": ">=8.0.2", + "symfony/framework-bundle": "^5.4|^6.4|^7.0", + "symfony/twig-bundle": "^5.4|^6.4|^7.0", + "twig/twig": "^3.2|^4.0" }, "require-dev": { "league/commonmark": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", + "symfony/phpunit-bridge": "^6.4|^7.0", "twig/cache-extra": "^3.0", - "twig/cssinliner-extra": "^2.12|^3.0", - "twig/html-extra": "^2.12|^3.0", - "twig/inky-extra": "^2.12|^3.0", - "twig/intl-extra": "^2.12|^3.0", - "twig/markdown-extra": "^2.12|^3.0", - "twig/string-extra": "^2.12|^3.0" + "twig/cssinliner-extra": "^3.0", + "twig/html-extra": "^3.0", + "twig/inky-extra": "^3.0", + "twig/intl-extra": "^3.0", + "twig/markdown-extra": "^3.0", + "twig/string-extra": "^3.0" }, "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, "autoload": { "psr-4": { "Twig\\Extra\\TwigExtraBundle\\": "" @@ -13666,7 +12759,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13686,7 +12779,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.4.0" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.19.0" }, "funding": [ { @@ -13698,49 +12791,47 @@ "type": "tidelift" } ], - "time": "2022-01-04T13:58:53+00:00" + "time": "2024-09-26T19:22:23+00:00" }, { "name": "twig/twig", - "version": "v3.4.3", + "version": "v3.19.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58" + "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/twigphp/Twig/zipball/d4f8c2b86374f08efc859323dbcd95c590f7124e", + "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e", + "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php81": "^1.29" }, "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "phpstan/phpstan": "^2.0", + "psr/container": "^1.0|^2.0", + "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { + "files": [ + "src/Resources/core.php", + "src/Resources/debug.php", + "src/Resources/escaper.php", + "src/Resources/string_loader.php" + ], "psr-4": { "Twig\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -13768,7 +12859,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.3" + "source": "https://github.com/twigphp/Twig/tree/v3.19.0" }, "funding": [ { @@ -13780,7 +12871,7 @@ "type": "tidelift" } ], - "time": "2022-09-28T08:42:51+00:00" + "time": "2025-01-29T07:06:14+00:00" }, { "name": "webmozart/assert", @@ -13794,13 +12885,7 @@ "type": "zip", "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "ext-ctype": "*", @@ -13824,7 +12909,7 @@ "Webmozart\\Assert\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13848,38 +12933,41 @@ }, { "name": "zircote/swagger-php", - "version": "4.4.9", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "0c1cdd31e8cfeb7116c54696aafdab9c778070fd" + "reference": "7708510b17502a416214148edaa8c9958b23b6cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/0c1cdd31e8cfeb7116c54696aafdab9c778070fd", - "reference": "0c1cdd31e8cfeb7116c54696aafdab9c778070fd", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/7708510b17502a416214148edaa8c9958b23b6cd", + "reference": "7708510b17502a416214148edaa8c9958b23b6cd", + "shasum": "" }, "require": { - "doctrine/annotations": "^1.7", "ext-json": "*", - "php": ">=7.2", + "nikic/php-parser": "^4.19 || ^5.0", + "php": ">=7.4", "psr/log": "^1.1 || ^2.0 || ^3.0", - "symfony/finder": ">=2.2", - "symfony/yaml": ">=3.3" + "symfony/deprecation-contracts": "^2 || ^3", + "symfony/finder": "^5.0 || ^6.0 || ^7.0", + "symfony/yaml": "^5.0 || ^6.0 || ^7.0" + }, + "conflict": { + "symfony/process": ">=6, <6.4.14" }, "require-dev": { "composer/package-versions-deprecated": "^1.11", - "friendsofphp/php-cs-fixer": "^2.17 || ^3.0", - "phpstan/phpstan": "^1.6", - "phpunit/phpunit": ">=8", - "vimeo/psalm": "^4.23" + "doctrine/annotations": "^2.0", + "friendsofphp/php-cs-fixer": "^3.62.0", + "phpstan/phpstan": "^1.6 || ^2.0", + "phpunit/phpunit": "^9.0", + "rector/rector": "^1.0 || ^2.0", + "vimeo/psalm": "^4.30 || ^5.0" + }, + "suggest": { + "doctrine/annotations": "^2.0" }, "bin": [ "bin/openapi" @@ -13887,7 +12975,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -13895,7 +12983,7 @@ "OpenApi\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -13925,37 +13013,32 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/4.4.9" + "source": "https://github.com/zircote/swagger-php/tree/5.0.3" }, - "time": "2022-09-11T20:51:43+00:00" + "time": "2025-01-15T21:02:43+00:00" } ], "packages-dev": [ { "name": "aeon-php/calendar", - "version": "1.0.7", + "version": "1.0.11", "source": { "type": "git", "url": "https://github.com/aeon-php/calendar.git", - "reference": "49e3167815ca6af1f4215eed0719c3d83d749571" + "reference": "41f4b0ff07247c36b232ddfbcddc62af738be6fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aeon-php/calendar/zipball/49e3167815ca6af1f4215eed0719c3d83d749571", - "reference": "49e3167815ca6af1f4215eed0719c3d83d749571", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/aeon-php/calendar/zipball/41f4b0ff07247c36b232ddfbcddc62af738be6fe", + "reference": "41f4b0ff07247c36b232ddfbcddc62af738be6fe", + "shasum": "" }, "require": { - "php": "^7.4.2 || ~8.0 || ~8.1.10" + "php": "~8.2.0 || ~8.3.0 || ~8.4.0" }, "require-dev": { - "ext-bcmath": "*" + "ext-bcmath": "*", + "ext-pcov": "*" }, "suggest": { "ext-bcmath": "Compare time units with high precision" @@ -13968,7 +13051,7 @@ ] } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -13982,42 +13065,50 @@ ], "support": { "issues": "https://github.com/aeon-php/calendar/issues", - "source": "https://github.com/aeon-php/calendar/tree/1.0.7" + "source": "https://github.com/aeon-php/calendar/tree/1.0.11" }, - "time": "2022-09-10T13:11:14+00:00" + "funding": [ + { + "url": "https://flow-php.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/norberttech", + "type": "github" + } + ], + "time": "2025-01-24T04:47:09+00:00" }, { "name": "coduo/php-matcher", - "version": "6.0.9", + "version": "6.0.17", "source": { "type": "git", "url": "https://github.com/coduo/php-matcher.git", - "reference": "e782a9ee7f97bbc4f751324591ec619b5822f721" + "reference": "ec521bba7757d98fc601a80f063de1c4cbc2f92b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coduo/php-matcher/zipball/e782a9ee7f97bbc4f751324591ec619b5822f721", - "reference": "e782a9ee7f97bbc4f751324591ec619b5822f721", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/coduo/php-matcher/zipball/ec521bba7757d98fc601a80f063de1c4cbc2f92b", + "reference": "ec521bba7757d98fc601a80f063de1c4cbc2f92b", + "shasum": "" }, "require": { - "aeon-php/calendar": "^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0 || ^0.18.0 || ^1.0", + "aeon-php/calendar": "^1.0.6", "coduo/php-to-string": "^3", - "doctrine/lexer": "^1.0", + "doctrine/lexer": "^3.0", "ext-filter": "*", "ext-json": "*", "ext-simplexml": "*", - "php": "^7.4.2 || ~8.0 || ~8.1" + "php": "~8.1 || ~8.2 || ~8.3 || ~8.4" }, "require-dev": { + "nikic/php-parser": "^4.0", "openlss/lib-array2xml": "^1.0", - "symfony/expression-language": "^2.3|^3.0|^4.0|^5.0" + "phpunit/phpunit": "^10.4", + "symfony/cache": "^5.4|^6.4", + "symfony/expression-language": "^5.4|^6.4|^7.0", + "symfony/var-exporter": "^5.4|^6.4|^7.0" }, "suggest": { "openlss/lib-array2xml": "In order ot use Coduo\\PHPMatcher\\Matcher\\XmlMatcher", @@ -14029,7 +13120,7 @@ "Coduo\\PHPMatcher\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14052,36 +13143,27 @@ ], "support": { "issues": "https://github.com/coduo/php-matcher/issues", - "source": "https://github.com/coduo/php-matcher/tree/6.0.9" + "source": "https://github.com/coduo/php-matcher/tree/6.0.17" }, - "time": "2022-10-04T08:14:53+00:00" + "time": "2024-12-20T03:49:15+00:00" }, { "name": "coduo/php-to-string", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/coduo/php-to-string.git", - "reference": "a1c8fb40d28252181cdad00b9fdc58ac71c154b1" + "reference": "e467de70e5e7403d969a05e853c7f480cde9fda4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coduo/php-to-string/zipball/a1c8fb40d28252181cdad00b9fdc58ac71c154b1", - "reference": "a1c8fb40d28252181cdad00b9fdc58ac71c154b1", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/coduo/php-to-string/zipball/e467de70e5e7403d969a05e853c7f480cde9fda4", + "reference": "e467de70e5e7403d969a05e853c7f480cde9fda4", + "shasum": "" }, "require": { "php": ">=7.2" }, - "require-dev": { - "phpunit/phpunit": "^8.5|^9.5" - }, "suggest": { "ext-intl": "Required if you are going to use humanizer with locales different than en_EN" }, @@ -14091,7 +13173,7 @@ "Coduo\\ToString\\": "src/Coduo/ToString" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14114,58 +13196,45 @@ ], "support": { "issues": "https://github.com/coduo/php-to-string/issues", - "source": "https://github.com/coduo/php-to-string/tree/3.2.0" + "source": "https://github.com/coduo/php-to-string/tree/3.2.1" }, - "funding": [ - { - "url": "https://github.com/norberttech", - "type": "github" - } - ], - "time": "2021-02-23T21:32:39+00:00" + "time": "2023-03-28T10:10:37+00:00" }, { "name": "dama/doctrine-test-bundle", - "version": "v6.7.5", + "version": "v8.2.2", "source": { "type": "git", "url": "https://github.com/dmaicher/doctrine-test-bundle.git", - "reference": "af6f8e8c56fcfdf2ae039b97607883961a14af9c" + "reference": "eefe54fdf00d910f808efea9cfce9cc261064a0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dmaicher/doctrine-test-bundle/zipball/af6f8e8c56fcfdf2ae039b97607883961a14af9c", - "reference": "af6f8e8c56fcfdf2ae039b97607883961a14af9c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/dmaicher/doctrine-test-bundle/zipball/eefe54fdf00d910f808efea9cfce9cc261064a0a", + "reference": "eefe54fdf00d910f808efea9cfce9cc261064a0a", + "shasum": "" }, "require": { - "doctrine/dbal": "^2.9.3 || ^3.0", - "doctrine/doctrine-bundle": "^1.11 || ^2.0", - "ext-json": "*", - "php": "^7.1 || ^8.0", + "doctrine/dbal": "^3.3 || ^4.0", + "doctrine/doctrine-bundle": "^2.11.0", + "php": "^7.4 || ^8.0", "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/cache": "^4.4 || ^5.3 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0" + "symfony/cache": "^5.4 || ^6.3 || ^7.0", + "symfony/framework-bundle": "^5.4 || ^6.3 || ^7.0" }, "require-dev": { "behat/behat": "^3.0", - "doctrine/cache": "^1.12", - "phpstan/phpstan": "^1.2", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "symfony/phpunit-bridge": "^5.3 || ^6.0", - "symfony/process": "^4.4 || ^5.3 || ^6.0", - "symfony/yaml": "^4.4 || ^5.3 || ^6.0" + "friendsofphp/php-cs-fixer": "^3.27", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "symfony/phpunit-bridge": "^7.2", + "symfony/process": "^5.4 || ^6.3 || ^7.0", + "symfony/yaml": "^5.4 || ^6.3 || ^7.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "6.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -14173,7 +13242,7 @@ "DAMA\\DoctrineTestBundle\\": "src/DAMA/DoctrineTestBundle" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14189,54 +13258,50 @@ "isolation", "performance", "symfony", + "testing", "tests" ], "support": { "issues": "https://github.com/dmaicher/doctrine-test-bundle/issues", - "source": "https://github.com/dmaicher/doctrine-test-bundle/tree/v6.7.5" + "source": "https://github.com/dmaicher/doctrine-test-bundle/tree/v8.2.2" }, - "time": "2022-02-08T16:00:51+00:00" + "time": "2025-02-04T14:37:36+00:00" }, { "name": "doctrine/data-fixtures", - "version": "1.5.3", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/data-fixtures.git", - "reference": "ba37bfb776de763c5bf04a36d074cd5f5a083c42" + "reference": "f7f1e12d6bceb58c204b3e77210a103c1c57601e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/ba37bfb776de763c5bf04a36d074cd5f5a083c42", - "reference": "ba37bfb776de763c5bf04a36d074cd5f5a083c42", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/f7f1e12d6bceb58c204b3e77210a103c1c57601e", + "reference": "f7f1e12d6bceb58c204b3e77210a103c1c57601e", + "shasum": "" }, "require": { - "doctrine/common": "^2.13|^3.0", - "doctrine/persistence": "^1.3.3|^2.0|^3.0", - "php": "^7.2 || ^8.0" + "doctrine/persistence": "^3.1 || ^4.0", + "php": "^8.1", + "psr/log": "^1.1 || ^2 || ^3" }, "conflict": { - "doctrine/dbal": "<2.13", + "doctrine/dbal": "<3.5 || >=5", + "doctrine/orm": "<2.14 || >=4", "doctrine/phpcr-odm": "<1.3.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "doctrine/dbal": "^2.13 || ^3.0", + "doctrine/coding-standard": "^12", + "doctrine/dbal": "^3.5 || ^4", "doctrine/mongodb-odm": "^1.3.0 || ^2.0.0", - "doctrine/orm": "^2.7.0", + "doctrine/orm": "^2.14 || ^3", "ext-sqlite3": "*", - "jangregor/phpstan-prophecy": "^1", - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^8.5 || ^9.5", - "symfony/cache": "^5.0 || ^6.0", - "vimeo/psalm": "^4.10" + "fig/log-test": "^1", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5.3", + "symfony/cache": "^6.4 || ^7", + "symfony/var-exporter": "^6.4 || ^7" }, "suggest": { "alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)", @@ -14247,10 +13312,10 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\DataFixtures\\": "lib/Doctrine/Common/DataFixtures" + "Doctrine\\Common\\DataFixtures\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14267,7 +13332,7 @@ ], "support": { "issues": "https://github.com/doctrine/data-fixtures/issues", - "source": "https://github.com/doctrine/data-fixtures/tree/1.5.3" + "source": "https://github.com/doctrine/data-fixtures/tree/2.0.2" }, "funding": [ { @@ -14283,54 +13348,52 @@ "type": "tidelift" } ], - "time": "2022-04-19T10:01:44+00:00" + "time": "2025-01-21T13:21:31+00:00" }, { "name": "doctrine/doctrine-fixtures-bundle", - "version": "3.4.2", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "601988c5b46dbd20a0f886f967210aba378a6fd5" + "reference": "bd59519a7532b9e1a41cef4049d5326dfac7def9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/601988c5b46dbd20a0f886f967210aba378a6fd5", - "reference": "601988c5b46dbd20a0f886f967210aba378a6fd5", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/bd59519a7532b9e1a41cef4049d5326dfac7def9", + "reference": "bd59519a7532b9e1a41cef4049d5326dfac7def9", + "shasum": "" }, "require": { - "doctrine/data-fixtures": "^1.3", - "doctrine/doctrine-bundle": "^1.11|^2.0", - "doctrine/orm": "^2.6.0", - "doctrine/persistence": "^1.3.7|^2.0|^3.0", - "php": "^7.1 || ^8.0", - "symfony/config": "^3.4|^4.3|^5.0|^6.0", - "symfony/console": "^3.4|^4.3|^5.0|^6.0", - "symfony/dependency-injection": "^3.4.47|^4.3|^5.0|^6.0", - "symfony/doctrine-bridge": "^3.4|^4.1|^5.0|^6.0", - "symfony/http-kernel": "^3.4|^4.3|^5.0|^6.0" + "doctrine/data-fixtures": "^1.5 || ^2.0", + "doctrine/doctrine-bundle": "^2.2", + "doctrine/orm": "^2.14.0 || ^3.0", + "doctrine/persistence": "^2.4 || ^3.0", + "php": "^7.4 || ^8.0", + "psr/log": "^1 || ^2 || ^3", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/doctrine-bridge": "^5.4.48 || ^6.4.16 || ^7.1.9", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0" + }, + "conflict": { + "doctrine/dbal": "< 3" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "^1.4.10", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", - "symfony/phpunit-bridge": "^6.0.8", - "vimeo/psalm": "^4.22" + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^9.6.13", + "symfony/phpunit-bridge": "^6.3.6" }, "type": "symfony-bundle", "autoload": { "psr-4": { - "Doctrine\\Bundle\\FixturesBundle\\": "" + "Doctrine\\Bundle\\FixturesBundle\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14356,7 +13419,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues", - "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.2" + "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.7.1" }, "funding": [ { @@ -14372,7 +13435,7 @@ "type": "tidelift" } ], - "time": "2022-04-28T17:58:29+00:00" + "time": "2024-12-03T17:07:51+00:00" }, { "name": "ekino/phpstan-banned-code", @@ -14386,13 +13449,7 @@ "type": "zip", "url": "https://api.github.com/repos/ekino/phpstan-banned-code/zipball/4f0d7c8a0c9f5d222ffc24234aa6c5b3b71bf4c3", "reference": "4f0d7c8a0c9f5d222ffc24234aa6c5b3b71bf4c3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.3 || ^8.0", @@ -14408,13 +13465,13 @@ }, "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, "phpstan": { "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-master": "1.0-dev" } }, "autoload": { @@ -14422,7 +13479,7 @@ "Ekino\\PHPStanBannedCode\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14447,26 +13504,20 @@ }, { "name": "fakerphp/faker", - "version": "v1.20.0", + "version": "v1.24.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "37f751c67a5372d4e26353bd9384bc03744ec77b" + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/37f751c67a5372d4e26353bd9384bc03744ec77b", - "reference": "37f751c67a5372d4e26353bd9384bc03744ec77b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", + "php": "^7.4 || ^8.0", "psr/container": "^1.0 || ^2.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" }, @@ -14477,7 +13528,8 @@ "bamarni/composer-bin-plugin": "^1.4.1", "doctrine/persistence": "^1.3 || ^2.0", "ext-intl": "*", - "symfony/phpunit-bridge": "^4.4 || ^5.2" + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" }, "suggest": { "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", @@ -14487,17 +13539,12 @@ "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.20-dev" - } - }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14514,159 +13561,213 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.20.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" }, - "time": "2022-07-20T13:12:54+00:00" + "time": "2024-11-21T13:46:39+00:00" }, { "name": "johnkary/phpunit-speedtrap", - "version": "v4.0.0", + "version": "v4.0.1", "source": { "type": "git", "url": "https://github.com/johnkary/phpunit-speedtrap.git", - "reference": "5f9b160eac87e975f1c6ca9faee5125f0616fba3" + "reference": "d6600d2218396b78856c335f83479503957a5fa9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/johnkary/phpunit-speedtrap/zipball/d6600d2218396b78856c335f83479503957a5fa9", + "reference": "d6600d2218396b78856c335f83479503957a5fa9", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "JohnKary\\PHPUnit\\Listener\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Kary", + "email": "john@johnkary.net" + } + ], + "description": "Find and report on slow tests in your PHPUnit test suite", + "homepage": "https://github.com/johnkary/phpunit-speedtrap", + "keywords": [ + "phpunit", + "profile", + "slow" + ], + "support": { + "issues": "https://github.com/johnkary/phpunit-speedtrap/issues", + "source": "https://github.com/johnkary/phpunit-speedtrap/tree/v4.0.1" + }, + "time": "2022-10-17T00:56:56+00:00" + }, + { + "name": "league/flysystem-memory", + "version": "3.13.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-memory.git", + "reference": "c85484b1336a080d4591038315a7b2008ccb4eee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnkary/phpunit-speedtrap/zipball/5f9b160eac87e975f1c6ca9faee5125f0616fba3", - "reference": "5f9b160eac87e975f1c6ca9faee5125f0616fba3", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/thephpleague/flysystem-memory/zipball/c85484b1336a080d4591038315a7b2008ccb4eee", + "reference": "c85484b1336a080d4591038315a7b2008ccb4eee", + "shasum": "" }, "require": { - "php": ">=7.1", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "ext-fileinfo": "*", + "league/flysystem": "^2.0.0 || ^3.0.0", + "php": "^8.0.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { "psr-4": { - "JohnKary\\PHPUnit\\Listener\\": "src/" + "League\\Flysystem\\InMemory\\": "" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "John Kary", - "email": "john@johnkary.net" + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" } ], - "description": "Find and report on slow tests in your PHPUnit test suite", - "homepage": "https://github.com/johnkary/phpunit-speedtrap", + "description": "In-memory filesystem adapter for Flysystem.", "keywords": [ - "phpunit", - "profile", - "slow" + "Flysystem", + "file", + "files", + "filesystem", + "memory" ], "support": { - "issues": "https://github.com/johnkary/phpunit-speedtrap/issues", - "source": "https://github.com/johnkary/phpunit-speedtrap/tree/v4.0.0" + "issues": "https://github.com/thephpleague/flysystem-memory/issues", + "source": "https://github.com/thephpleague/flysystem-memory/tree/3.13.0" }, - "time": "2021-05-03T02:37:05+00:00" + "funding": [ + { + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + } + ], + "time": "2023-04-11T17:15:27+00:00" }, { - "name": "league/flysystem-memory", - "version": "1.0.2", + "name": "masterminds/html5", + "version": "2.9.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/flysystem-memory.git", - "reference": "d0e87477c32e29f999b4de05e64c1adcddb51757" + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-memory/zipball/d0e87477c32e29f999b4de05e64c1adcddb51757", - "reference": "d0e87477c32e29f999b4de05e64c1adcddb51757", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6", + "shasum": "" }, "require": { - "league/flysystem": "~1.0" + "ext-dom": "*", + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.10" + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.7-dev" } }, "autoload": { "psr-4": { - "League\\Flysystem\\Memory\\": "src/" + "Masterminds\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Chris Leppanen", - "email": "chris.leppanen@gmail.com", - "role": "Developer" + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" } ], - "description": "An in-memory adapter for Flysystem.", - "homepage": "https://github.com/thephpleague/flysystem-memory", + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", "keywords": [ - "Flysystem", - "adapter", - "memory" + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" ], "support": { - "issues": "https://github.com/thephpleague/flysystem-memory/issues", - "source": "https://github.com/thephpleague/flysystem-memory/tree/1.0.2" + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.9.0" }, - "time": "2019-05-30T21:34:13+00:00" + "time": "2024-03-31T07:05:07+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -14678,7 +13779,7 @@ "DeepCopy\\": "src/DeepCopy/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14692,7 +13793,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -14700,92 +13801,25 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.15.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] - }, - "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://repo.repman.io/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.15.1" - }, - "time": "2022-09-04T07:30:47+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -14802,7 +13836,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -14826,9 +13860,15 @@ "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" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -14842,13 +13882,7 @@ "type": "zip", "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.2 || ^8.0" @@ -14859,7 +13893,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -14889,38 +13923,36 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.9.3", + "version": "v3.68.5", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "9014ca3ab81b3d73ab22ffdeaf236071db9a047c" + "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/9014ca3ab81b3d73ab22ffdeaf236071db9a047c", - "reference": "9014ca3ab81b3d73ab22ffdeaf236071db9a047c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", + "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", + "shasum": "" }, "require": { "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0" }, + "replace": { + "friendsofphp/php-cs-fixer": "self.version" + }, "suggest": { "ext-dom": "For handling output formats in XML", "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ - "php-cs-fixer" + "php-cs-fixer", + "php-cs-fixer.phar" ], "type": "application", - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -14936,40 +13968,37 @@ ], "description": "A tool to automatically fix PHP code style", "support": { - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.9.3" + "issues": "https://github.com/PHP-CS-Fixer/shim/issues", + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.68.5" }, - "time": "2022-07-13T10:02:07+00:00" + "time": "2025-01-30T17:01:41+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.15.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", + "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "doctrine/instantiator": "^1.2 || ^2.0", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" + "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", + "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" }, "type": "library", "extra": { @@ -14982,7 +14011,7 @@ "Prophecy\\": "src/Prophecy" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -15002,6 +14031,7 @@ "keywords": [ "Double", "Dummy", + "dev", "fake", "mock", "spy", @@ -15009,39 +14039,36 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2024-11-19T13:12:41+00:00" }, { "name": "phpspec/prophecy-phpunit", - "version": "v2.0.1", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy-phpunit.git", - "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177" + "reference": "8819516c1b489ecee4c60db5f5432fac1ea8ac6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/2d7a9df55f257d2cba9b1d0c0963a54960657177", - "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/8819516c1b489ecee4c60db5f5432fac1ea8ac6f", + "reference": "8819516c1b489ecee4c60db5f5432fac1ea8ac6f", + "shasum": "" }, "require": { "php": "^7.3 || ^8", - "phpspec/prophecy": "^1.3", - "phpunit/phpunit": "^9.1" + "phpspec/prophecy": "^1.18", + "phpunit/phpunit": "^9.1 || ^10.1 || ^11.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.10" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -15049,7 +14076,7 @@ "Prophecy\\PhpUnit\\": "src" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -15067,40 +14094,33 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy-phpunit/issues", - "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.0.1" + "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.3.0" }, - "time": "2020-07-09T08:33:42+00:00" + "time": "2024-11-19T13:24:17+00:00" }, { "name": "phpstan/extension-installer", - "version": "1.1.0", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/phpstan/extension-installer.git", - "reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051" + "reference": "85e90b3942d06b2326fba0403ec24fe912372936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/66c7adc9dfa38b6b5838a9fb728b68a7d8348051", - "reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936", + "shasum": "" }, "require": { - "composer-plugin-api": "^1.1 || ^2.0", - "php": "^7.1 || ^8.0", - "phpstan/phpstan": ">=0.11.6" + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0 || ^2.0" }, "require-dev": { - "composer/composer": "^1.8", - "phing/phing": "^2.16.3", + "composer/composer": "^2.0", "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpstan/phpstan-strict-rules": "^0.11 || ^0.12" + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" }, "type": "composer-plugin", "extra": { @@ -15111,36 +14131,34 @@ "PHPStan\\ExtensionInstaller\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Composer plugin for automatic installation of PHPStan extensions", + "keywords": [ + "dev", + "static analysis" + ], "support": { "issues": "https://github.com/phpstan/extension-installer/issues", - "source": "https://github.com/phpstan/extension-installer/tree/1.1.0" + "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" }, - "time": "2020-12-13T13:06:13+00:00" + "time": "2024-09-04T20:21:43+00:00" }, { "name": "phpstan/phpstan", - "version": "1.8.7", + "version": "1.12.17", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "536ff0ed719b5679e9f09c17aeaee9b31969cb8e" + "reference": "7027b3b0270bf392de0cfba12825979768d728bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/536ff0ed719b5679e9f09c17aeaee9b31969cb8e", - "reference": "536ff0ed719b5679e9f09c17aeaee9b31969cb8e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7027b3b0270bf392de0cfba12825979768d728bf", + "reference": "7027b3b0270bf392de0cfba12825979768d728bf", + "shasum": "" }, "require": { "php": "^7.2|^8.0" @@ -15158,7 +14176,7 @@ "bootstrap.php" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -15168,8 +14186,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.7" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -15179,37 +14200,27 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2022-10-04T14:09:33+00:00" + "time": "2025-02-07T15:01:57+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "1.0.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682" + "reference": "f94d246cc143ec5a23da868f8f7e1393b50eaa82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", - "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/f94d246cc143ec5a23da868f8f7e1393b50eaa82", + "reference": "f94d246cc143ec5a23da868f8f7e1393b50eaa82", + "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0" + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.12" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -15218,9 +14229,6 @@ }, "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, "phpstan": { "includes": [ "rules.neon" @@ -15232,40 +14240,34 @@ "PHPStan\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.0.0" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.2.1" }, - "time": "2021-09-23T11:02:21+00:00" + "time": "2024-09-11T15:52:35+00:00" }, { "name": "phpstan/phpstan-doctrine", - "version": "1.3.15", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-doctrine.git", - "reference": "93fe8c18ee955009e2033efeb64284b4e4df66a0" + "reference": "231d3f795ed5ef54c98961fd3958868cbe091207" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/93fe8c18ee955009e2033efeb64284b4e4df66a0", - "reference": "93fe8c18ee955009e2033efeb64284b4e4df66a0", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/231d3f795ed5ef54c98961fd3958868cbe091207", + "reference": "231d3f795ed5ef54c98961fd3958868cbe091207", + "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.8.6" + "phpstan/phpstan": "^1.12.12" }, "conflict": { "doctrine/collections": "<1.0", @@ -15275,23 +14277,26 @@ "doctrine/persistence": "<1.3" }, "require-dev": { - "doctrine/annotations": "^1.11.0", - "doctrine/collections": "^1.6", + "cache/array-adapter": "^1.1", + "composer/semver": "^3.3.2", + "cweagans/composer-patches": "^1.7.3", + "doctrine/annotations": "^1.11 || ^2.0", + "doctrine/collections": "^1.6 || ^2.1", "doctrine/common": "^2.7 || ^3.0", "doctrine/dbal": "^2.13.8 || ^3.3.3", - "doctrine/lexer": "^1.2.1", - "doctrine/mongodb-odm": "^1.3 || ^2.1", - "doctrine/orm": "^2.11.0", - "doctrine/persistence": "^1.3.8 || ^2.2.1", + "doctrine/lexer": "^2.0 || ^3.0", + "doctrine/mongodb-odm": "^1.3 || ^2.4.3", + "doctrine/orm": "^2.16.0", + "doctrine/persistence": "^2.2.1 || ^3.2", "gedmo/doctrine-extensions": "^3.8", "nesbot/carbon": "^2.49", "nikic/php-parser": "^4.13.2", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5.10", - "ramsey/uuid-doctrine": "^1.5.0", - "symfony/cache": "^4.4.35" + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^9.6.20", + "ramsey/uuid": "^4.2", + "symfony/cache": "^5.4" }, "type": "phpstan-extension", "extra": { @@ -15307,40 +14312,34 @@ "PHPStan\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Doctrine extensions for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-doctrine/issues", - "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.3.15" + "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.7" }, - "time": "2022-09-29T20:11:01+00:00" + "time": "2024-12-02T16:47:26+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.1.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "4a3c437c09075736285d1cabb5c75bf27ed0bc84" + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4a3c437c09075736285d1cabb5c75bf27ed0bc84", - "reference": "4a3c437c09075736285d1cabb5c75bf27ed0bc84", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/72a6721c9b64b3e4c9db55abbc38f790b318267e", + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e", + "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.5.0" + "phpstan/phpstan": "^1.12" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -15348,7 +14347,7 @@ "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-strict-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.5.1", "phpunit/phpunit": "^9.5" }, "type": "phpstan-extension", @@ -15365,44 +14364,39 @@ "PHPStan\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.1.1" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.2" }, - "time": "2022-04-20T15:24:25+00:00" + "time": "2024-12-17T17:20:49+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.4.4", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "23e5f377ee6395a1a04842d3d6ed4bd25e7b44a6" + "reference": "b564ca479e7e735f750aaac4935af965572a7845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/23e5f377ee6395a1a04842d3d6ed4bd25e7b44a6", - "reference": "23e5f377ee6395a1a04842d3d6ed4bd25e7b44a6", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b564ca479e7e735f750aaac4935af965572a7845", + "reference": "b564ca479e7e735f750aaac4935af965572a7845", + "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.8.6" + "phpstan/phpstan": "^1.12.4" }, "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5" }, @@ -15419,41 +14413,35 @@ "PHPStan\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.4.4" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.2" }, - "time": "2022-09-21T11:38:17+00:00" + "time": "2025-01-19T13:02:24+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.2.13", + "version": "1.4.13", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "016e441a19a2af79ca0c60920ba0d61747b4e855" + "reference": "dd1aaa7f85f9916222a2ce7e4d21072fe03958f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/016e441a19a2af79ca0c60920ba0d61747b4e855", - "reference": "016e441a19a2af79ca0c60920ba0d61747b4e855", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/dd1aaa7f85f9916222a2ce7e4d21072fe03958f4", + "reference": "dd1aaa7f85f9916222a2ce7e4d21072fe03958f4", + "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.8.2" + "phpstan/phpstan": "^1.12" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -15461,9 +14449,9 @@ "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan-phpunit": "^1.3.11", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^8.5.29 || ^9.5", "psr/container": "1.0 || 1.1.1", "symfony/config": "^5.4 || ^6.1", "symfony/console": "^5.4 || ^6.1", @@ -15473,7 +14461,8 @@ "symfony/http-foundation": "^5.4 || ^6.1", "symfony/messenger": "^5.4", "symfony/polyfill-php80": "^1.24", - "symfony/serializer": "^5.4" + "symfony/serializer": "^5.4", + "symfony/service-contracts": "^2.2.0" }, "type": "phpstan-extension", "extra": { @@ -15489,7 +14478,7 @@ "PHPStan\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -15503,56 +14492,50 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.13" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.13" }, - "time": "2022-08-28T13:34:45+00:00" + "time": "2025-01-04T13:55:31+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.17", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "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" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "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" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -15560,7 +14543,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -15580,7 +14563,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -15588,7 +14572,7 @@ "type": "github" } ], - "time": "2022-08-30T12:24:04+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -15602,13 +14586,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -15627,7 +14605,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -15668,13 +14646,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -15697,7 +14669,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -15737,13 +14709,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -15762,7 +14728,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -15802,13 +14768,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -15827,7 +14787,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -15857,56 +14817,50 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.25", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", - "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.5.0 || ^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", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "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", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "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/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "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" @@ -15914,7 +14868,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -15925,7 +14879,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -15945,7 +14899,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -15961,27 +14916,80 @@ "type": "tidelift" } ], - "time": "2022-09-25T03:44:45+00:00" + "time": "2024-12-05T13:48:26+00:00" + }, + { + "name": "rector/rector", + "version": "1.2.10", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "40f9cf38c05296bd32f444121336a521a293fa61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/40f9cf38c05296bd32f444121336a521a293fa61", + "reference": "40f9cf38c05296bd32f444121336a521a293fa61", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.12.5" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/1.2.10" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-11-08T13:59:10+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" }, "require": { "php": ">=7.3" @@ -16000,7 +15008,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16015,7 +15023,7 @@ "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" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -16023,7 +15031,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -16037,13 +15045,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -16062,7 +15064,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16099,13 +15101,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -16124,7 +15120,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16160,13 +15156,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3", @@ -16187,7 +15177,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16230,26 +15220,20 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -16266,7 +15250,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16281,7 +15265,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -16289,27 +15273,21 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" }, "require": { "php": ">=7.3" @@ -16329,7 +15307,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16353,7 +15331,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -16361,27 +15339,21 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" }, "require": { "php": ">=7.3" @@ -16403,7 +15375,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16422,7 +15394,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -16430,27 +15402,21 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" }, "require": { "php": ">=7.3", @@ -16471,7 +15437,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16505,7 +15471,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -16513,27 +15479,21 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" }, "require": { "php": ">=7.3", @@ -16558,7 +15518,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16575,7 +15535,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -16583,30 +15543,24 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -16623,7 +15577,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16638,7 +15592,7 @@ "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" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -16646,7 +15600,7 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -16660,13 +15614,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3", @@ -16687,7 +15635,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16723,13 +15671,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -16748,7 +15690,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16774,23 +15716,17 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" }, "require": { "php": ">=7.3" @@ -16809,7 +15745,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16828,10 +15764,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "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.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -16839,27 +15775,21 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "shasum": "" }, "require": { "php": ">=7.3" @@ -16870,7 +15800,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -16878,7 +15808,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16891,8 +15821,7 @@ "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" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -16900,27 +15829,21 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" }, "require": { "php": ">=7.3" @@ -16939,7 +15862,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -16954,7 +15877,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -16962,7 +15885,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -16976,13 +15899,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=7.3" @@ -16998,7 +15915,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -17025,37 +15942,27 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.11", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "081fe28a26b6bd671dea85ef3a4b5003f3c88027" + "reference": "65d4b3fd9556e4b5b41287bef93c671f8f9f86ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/081fe28a26b6bd671dea85ef3a4b5003f3c88027", - "reference": "081fe28a26b6bd671dea85ef3a4b5003f3c88027", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/65d4b3fd9556e4b5b41287bef93c671f8f9f86ab", + "reference": "65d4b3fd9556e4b5b41287bef93c671f8f9f86ab", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/dom-crawler": "^5.4|^6.0|^7.0" }, "require-dev": { - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/process": "" + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -17066,7 +15973,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -17083,7 +15990,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.11" + "source": "https://github.com/symfony/browser-kit/tree/v6.4.13" }, "funding": [ { @@ -17099,44 +16006,30 @@ "type": "tidelift" } ], - "time": "2022-07-27T15:50:05+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.4.12", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "291c1e92281a09152dda089f782e23dedd34bd4f" + "reference": "fd07959d3e8992795029bdab3605c2e8e895034e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/291c1e92281a09152dda089f782e23dedd34bd4f", - "reference": "291c1e92281a09152dda089f782e23dedd34bd4f", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/fd07959d3e8992795029bdab3605c2e8e895034e", + "reference": "fd07959d3e8992795029bdab3605c2e8e895034e", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "masterminds/html5": "^2.6", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "masterminds/html5": "<2.6" + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/css-selector": "" + "symfony/css-selector": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -17147,7 +16040,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -17164,7 +16057,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.12" + "source": "https://github.com/symfony/dom-crawler/tree/v6.4.18" }, "funding": [ { @@ -17180,60 +16073,54 @@ "type": "tidelift" } ], - "time": "2022-08-03T13:09:21+00:00" + "time": "2025-01-09T15:35:00+00:00" }, { "name": "symfony/maker-bundle", - "version": "v1.43.0", + "version": "v1.62.1", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "e3f9a1d9e0f4968f68454403e820dffc7db38a59" + "reference": "468ff2708200c95ebc0d85d3174b6c6711b8a590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/e3f9a1d9e0f4968f68454403e820dffc7db38a59", - "reference": "e3f9a1d9e0f4968f68454403e820dffc7db38a59", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/468ff2708200c95ebc0d85d3174b6c6711b8a590", + "reference": "468ff2708200c95ebc0d85d3174b6c6711b8a590", + "shasum": "" }, "require": { "doctrine/inflector": "^2.0", - "nikic/php-parser": "^4.11", - "php": ">=7.2.5", - "symfony/config": "^5.4.7|^6.0", - "symfony/console": "^5.4.7|^6.0", - "symfony/dependency-injection": "^5.4.7|^6.0", + "nikic/php-parser": "^4.18|^5.0", + "php": ">=8.1", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", "symfony/deprecation-contracts": "^2.2|^3", - "symfony/filesystem": "^5.4.7|^6.0", - "symfony/finder": "^5.4.3|^6.0", - "symfony/framework-bundle": "^5.4.7|^6.0", - "symfony/http-kernel": "^5.4.7|^6.0" + "symfony/filesystem": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0" }, "conflict": { - "doctrine/orm": "<2.10" + "doctrine/doctrine-bundle": "<2.10", + "doctrine/orm": "<2.15" }, "require-dev": { "composer/semver": "^3.0", - "doctrine/doctrine-bundle": "^2.4", - "doctrine/orm": "^2.10.0", - "symfony/http-client": "^5.4.7|^6.0", - "symfony/phpunit-bridge": "^5.4.7|^6.0", - "symfony/polyfill-php80": "^1.16.0", - "symfony/process": "^5.4.7|^6.0", - "symfony/security-core": "^5.4.7|^6.0", - "symfony/yaml": "^5.4.3|^6.0", - "twig/twig": "^2.0|^3.0" + "doctrine/doctrine-bundle": "^2.5.0", + "doctrine/orm": "^2.15|^3", + "symfony/http-client": "^6.4|^7.0", + "symfony/phpunit-bridge": "^6.4.1|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0", + "twig/twig": "^3.0|^4.x-dev" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-main": "1.0-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -17241,7 +16128,7 @@ "Symfony\\Bundle\\MakerBundle\\": "src/" } }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -17255,13 +16142,14 @@ "homepage": "https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html", "keywords": [ "code generator", + "dev", "generator", "scaffold", "scaffolding" ], "support": { "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.43.0" + "source": "https://github.com/symfony/maker-bundle/tree/v1.62.1" }, "funding": [ { @@ -17277,49 +16165,42 @@ "type": "tidelift" } ], - "time": "2022-05-17T15:46:50+00:00" + "time": "2025-01-15T00:21:40+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v5.4.13", + "version": "v6.4.18", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "6fefe0a7761a35b33c616e199c19f0c0d069e282" + "reference": "979b623f12d1eb4f6f8f24fd321dfe1dee2444a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/6fefe0a7761a35b33c616e199c19f0c0d069e282", - "reference": "6fefe0a7761a35b33c616e199c19f0c0d069e282", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/979b623f12d1eb4f6f8f24fd321dfe1dee2444a2", + "reference": "979b623f12d1eb4f6f8f24fd321dfe1dee2444a2", + "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/framework-bundle": "^5.3|^6.0", - "symfony/http-kernel": "^5.3|^6.0", - "symfony/polyfill-php80": "^1.16", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", + "php": ">=8.1", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, "conflict": { - "symfony/dependency-injection": "<5.2", - "symfony/form": "<4.4", + "symfony/form": "<5.4", "symfony/mailer": "<5.4", - "symfony/messenger": "<4.4" + "symfony/messenger": "<5.4", + "symfony/twig-bundle": ">=7.0" }, "require-dev": { - "symfony/browser-kit": "^4.4|^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0" + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "symfony-bundle", "autoload": { @@ -17330,7 +16211,7 @@ "/Tests/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -17346,8 +16227,11 @@ ], "description": "Provides a development tool that gives detailed information about the execution of any request", "homepage": "https://symfony.com", + "keywords": [ + "dev" + ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v5.4.13" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.18" }, "funding": [ { @@ -17363,27 +16247,21 @@ "type": "tidelift" } ], - "time": "2022-08-28T23:24:00+00:00" + "time": "2024-12-23T18:38:04+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.repman.io/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" }, "require": { "ext-dom": "*", @@ -17397,7 +16275,7 @@ "src/" ] }, - "notification-url": "https://repo.repman.io/downloads", + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -17411,7 +16289,7 @@ "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" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -17419,27 +16297,28 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4.2 || ^8.0", + "php": "^8.1", "ext-ctype": "*", "ext-curl": "*", "ext-iconv": "*", "ext-intl": "*", "ext-json": "*", "ext-pdo_pgsql": "*", - "ext-zip": "*" + "ext-zip": "*", + "ext-simplexml": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { - "php": "7.4.2" + "php": "8.1" }, "plugin-api-version": "2.6.0" } diff --git a/config/bootstrap.php b/config/bootstrap.php index 976a7763..e741b1c4 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -1,5 +1,7 @@ =1.2) if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) { foreach ($env as $k => $v) { - $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); + $_ENV[$k] ??= isset($_SERVER[$k]) && !str_starts_with($k, 'HTTP_') ? $_SERVER[$k] : $v; } } elseif (!class_exists(Dotenv::class)) { throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); } else { // load all the .env files - (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); + (new Dotenv())->loadEnv(dirname(__DIR__).'/.env'); } $_SERVER += $_ENV; $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; -$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; +$_SERVER['APP_DEBUG'] ??= $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; diff --git a/config/bundles.php b/config/bundles.php index 2e5b00d6..106a382e 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,22 +1,43 @@ ['all' => true], - Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], - Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Sentry\SentryBundle\SentryBundle::class => ['prod' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], - KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true], - League\FlysystemBundle\FlysystemBundle::class => ['all' => true], - Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true], - Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], - EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle::class => ['all' => true], + FrameworkBundle::class => ['all' => true], + SensioFrameworkExtraBundle::class => ['all' => true], + TwigBundle::class => ['all' => true], + TwigExtraBundle::class => ['all' => true], + MonologBundle::class => ['all' => true], + DoctrineBundle::class => ['all' => true], + DoctrineMigrationsBundle::class => ['all' => true], + SecurityBundle::class => ['all' => true], + SentryBundle::class => ['prod' => true], + MakerBundle::class => ['dev' => true], + WebProfilerBundle::class => ['dev' => true, 'test' => true], + DAMADoctrineTestBundle::class => ['test' => true], + DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], + KnpUOAuth2ClientBundle::class => ['all' => true], + FlysystemBundle::class => ['all' => true], + NelmioApiDocBundle::class => ['all' => true], + NelmioCorsBundle::class => ['all' => true], + EWZRecaptchaBundle::class => ['all' => true], ]; diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index b790a96c..c8e5680c 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -4,6 +4,7 @@ doctrine: types: uuid: 'Ramsey\Uuid\Doctrine\UuidType' schema_filter: '~^(?!messenger_messages|organization_package_webhook_request|proxy_package_download|lock_keys)~' + use_savepoints: true orm: auto_generate_proxy_classes: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware diff --git a/config/packages/flysystem.yaml b/config/packages/flysystem.yaml index 1b36b29a..853c240e 100644 --- a/config/packages/flysystem.yaml +++ b/config/packages/flysystem.yaml @@ -6,23 +6,11 @@ flysystem: options: directory: '%dists_dir%' - storage.local.cached.proxy: - adapter: 'cache' - options: - store: 'cache.app' - source: 'storage.local.proxy' - storage.local.repo: adapter: 'local' options: directory: '%repo_dir%' - storage.local.cached.repo: - adapter: 'cache' - options: - store: 'cache.app' - source: 'storage.local.repo' - storage.s3.proxy: adapter: 'aws' options: @@ -30,12 +18,6 @@ flysystem: bucket: '%env(STORAGE_AWS_BUCKET)%' prefix: '%dists_dir%' - storage.s3.cached.proxy: - adapter: 'cache' - options: - store: 'cache.app' - source: 'storage.s3.proxy' - storage.s3.repo: adapter: 'aws' options: @@ -43,12 +25,6 @@ flysystem: bucket: '%env(STORAGE_AWS_BUCKET)%' prefix: '%repo_dir%' - storage.s3.cached.repo: - adapter: 'cache' - options: - store: 'cache.app' - source: 'storage.s3.repo' - repo.storage: adapter: 'lazy' options: diff --git a/config/packages/test/security.yaml b/config/packages/test/security.yaml index e51af197..e82fedbc 100644 --- a/config/packages/test/security.yaml +++ b/config/packages/test/security.yaml @@ -1,5 +1,5 @@ security: - encoders: + password_hashers: Buddy\Repman\Security\Model\User: algorithm: plaintext firewalls: diff --git a/config/preload.php b/config/preload.php index 5ebcdb21..7cbe578d 100644 --- a/config/preload.php +++ b/config/preload.php @@ -1,5 +1,7 @@ @@ -27,7 +34,6 @@ services: bin/console repman:security:update-db && bin/console assets:install && php-fpm' - env_file: .env.docker volumes: - app-var:/app/var - /app/var/cache @@ -36,10 +42,8 @@ services: - database consumer: - << : *restart_policy - image: buddy/repman:1.3.4 + << : *container_default command: ['bin/console', 'messenger:consume', 'async', '--limit=500'] - env_file: .env.docker volumes: - app-var:/app/var - /app/var/cache @@ -47,10 +51,8 @@ services: - app cron: - << : *restart_policy - image: buddy/repman:1.3.4 + << : *container_default command: ['crond', '-f', '-L', '/app/var/log/cron.log'] - env_file: .env.docker volumes: - app-var:/app/var - /app/var/cache @@ -59,12 +61,11 @@ services: - app nginx: - << : *restart_policy - image: nginx:1.17-alpine - env_file: .env.docker + << : *container_default + image: nginx:1.27-alpine command: ['/nginx/start.sh'] ports: - - 443:443 + - "443:443" depends_on: - app volumes: @@ -92,29 +93,29 @@ volumes: driver: local driver_opts: type: none - device: $PWD/docker/logs/nginx + device: $PWD/.docker/logs/nginx o: bind docker-nginx-scripts: driver: local driver_opts: type: none - device: $PWD/docker/nginx/scripts + device: $PWD/.docker/nginx/scripts o: bind docker-nginx-ssl-certs: driver: local driver_opts: type: none - device: $PWD/docker/nginx/ssl/certs + device: $PWD/.docker/nginx/ssl/certs o: bind docker-nginx-ssl-private: driver: local driver_opts: type: none - device: $PWD/docker/nginx/ssl/private + device: $PWD/.docker/nginx/ssl/private o: bind docker-crontabs: driver: local driver_opts: type: none - device: $PWD/docker/crontabs + device: $PWD/.docker/crontabs o: bind diff --git a/phpstan.neon b/phpstan.neon index 2dc1cedc..df290620 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,7 +7,6 @@ parameters: checkExplicitMixed: false paths: - src/ - - tests/ bootstrapFiles: - vendor/twig/twig/src/Extension/CoreExtension.php # twig global functions symfony: diff --git a/public/.htaccess b/public/.htaccess deleted file mode 100644 index 98cfe780..00000000 --- a/public/.htaccess +++ /dev/null @@ -1,7 +0,0 @@ -RewriteEngine on -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*)$ /index.php/$1 [NC,L,QSA] - -# enable this for php-fpm -# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] diff --git a/public/index.php b/public/index.php index 6eddf357..addad94b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,7 @@ withPaths([ + __DIR__.'/bin', + __DIR__.'/config', + __DIR__.'/public', + __DIR__.'/src', + __DIR__.'/tests', + ]) + // uncomment to reach your current PHP version + ->withSets([ + PHPUnitSetList::PHPUNIT_110, + PHPUnitSetList::PHPUNIT_CODE_QUALITY, + LevelSetList::UP_TO_PHP_81, + SetList::CODE_QUALITY, + SetList::CODING_STYLE, + SetList::EARLY_RETURN, + SetList::PRIVATIZATION, + SymfonySetList::SYMFONY_CODE_QUALITY, + SymfonySetList::SYMFONY_64, + ]) + ->withTypeCoverageLevel(0) + ->withImportNames(removeUnusedImports: true); diff --git a/src/Command/ClearMetadataCacheCommand.php b/src/Command/ClearMetadataCacheCommand.php index 3d7fa301..0e3c62e1 100644 --- a/src/Command/ClearMetadataCacheCommand.php +++ b/src/Command/ClearMetadataCacheCommand.php @@ -4,45 +4,48 @@ namespace Buddy\Repman\Command; +use ArrayIterator; use Buddy\Repman\Service\Dist\FilePatternFilterIterator; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function sprintf; final class ClearMetadataCacheCommand extends Command { protected static $defaultName = 'repman:metadata:clear-cache'; - private FilesystemInterface $repoFilesystem; - /** @var array */ private const VCS_PATTERNS = [ '.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg', ]; - public function __construct(FilesystemInterface $repoFilesystem) + public function __construct(private readonly FilesystemOperator $repoFilesystem) { - $this->repoFilesystem = $repoFilesystem; parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Clear packages metadata cache (json files)') ; } + /** + * @throws FilesystemException + */ protected function execute(InputInterface $input, OutputInterface $output): int { $files = $this->repoFilesystem->listContents('/', true); $iterator = new FilePatternFilterIterator( - new \ArrayIterator($files), + new ArrayIterator($files), self::VCS_PATTERNS, '/.*json$/' ); @@ -55,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $count > 0 ? - $output->writeln(\sprintf('Deleted %s file(s).', $count)) + $output->writeln(sprintf('Deleted %s file(s).', $count)) : $output->writeln('No metadata files found.'); return 0; diff --git a/src/Command/ClearOldPrivateDistsCommand.php b/src/Command/ClearOldPrivateDistsCommand.php index cbac3cf4..ccd19c27 100644 --- a/src/Command/ClearOldPrivateDistsCommand.php +++ b/src/Command/ClearOldPrivateDistsCommand.php @@ -12,21 +12,15 @@ final class ClearOldPrivateDistsCommand extends Command { - private PackageQuery $query; - private PackageManager $packageManager; - - public function __construct(PackageQuery $query, PackageManager $packageManager) + public function __construct(private readonly PackageQuery $query, private readonly PackageManager $packageManager) { - $this->query = $query; - $this->packageManager = $packageManager; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setName('repman:package:clear-old-dists') diff --git a/src/Command/CreateAdminCommand.php b/src/Command/CreateAdminCommand.php index c8f0df6f..3a6c0323 100644 --- a/src/Command/CreateAdminCommand.php +++ b/src/Command/CreateAdminCommand.php @@ -22,28 +22,20 @@ final class CreateAdminCommand extends Command { protected static $defaultName = 'repman:create:admin'; - private MessageBusInterface $bus; - private Telemetry $telemetry; - private Config $config; - - public function __construct(MessageBusInterface $bus, Telemetry $telemetry, Config $config) + public function __construct(private readonly MessageBusInterface $bus, private readonly Telemetry $telemetry, private readonly Config $config) { - $this->bus = $bus; - $this->telemetry = $telemetry; - $this->config = $config; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Create admin user') ->addArgument('email', InputArgument::REQUIRED, 'e-mail used to log in') - ->addArgument('password', InputArgument::OPTIONAL, 'plain password, if you don\'t provide it, you\'ll be asked for it') + ->addArgument('password', InputArgument::OPTIONAL, "plain password, if you don't provide it, you'll be asked for it") ; } @@ -80,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int private function askForTelemetry(InputInterface $input, OutputInterface $output): void { $question = new ConfirmationQuestion( - "Allow for sending anonymous usage statistic? [{$this->telemetry->docsUrl()}] (y/n)", + sprintf('Allow for sending anonymous usage statistic? [%s] (y/n)', $this->telemetry->docsUrl()), true ); diff --git a/src/Command/CreateUserCommand.php b/src/Command/CreateUserCommand.php index e4920257..1c6e362d 100644 --- a/src/Command/CreateUserCommand.php +++ b/src/Command/CreateUserCommand.php @@ -17,23 +17,20 @@ final class CreateUserCommand extends Command { protected static $defaultName = 'repman:create:user'; - private MessageBusInterface $bus; - - public function __construct(MessageBusInterface $bus) + public function __construct(private readonly MessageBusInterface $bus) { - $this->bus = $bus; parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Create normal user') ->addArgument('email', InputArgument::REQUIRED, 'e-mail used to log in') - ->addArgument('password', InputArgument::OPTIONAL, 'plain password, if you don\'t provide it, you\'ll be asked for it') + ->addArgument('password', InputArgument::OPTIONAL, "plain password, if you don't provide it, you'll be asked for it") ; } diff --git a/src/Command/ProxySyncMetadataCommand.php b/src/Command/ProxySyncMetadataCommand.php index 68a6fcde..ae5de346 100644 --- a/src/Command/ProxySyncMetadataCommand.php +++ b/src/Command/ProxySyncMetadataCommand.php @@ -6,6 +6,8 @@ use Buddy\Repman\Service\Proxy; use Buddy\Repman\Service\Proxy\ProxyRegister; +use JsonException; +use League\Flysystem\FilesystemException; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -14,25 +16,20 @@ final class ProxySyncMetadataCommand extends Command { public const LOCK_TTL = 60; + public const LOCK_NAME = 'proxy_metadata'; protected static $defaultName = 'repman:proxy:sync-metadata'; - private ProxyRegister $register; - private LockFactory $lockFactory; - - public function __construct(ProxyRegister $register, LockFactory $lockFactory) + public function __construct(private readonly ProxyRegister $register, private readonly LockFactory $lockFactory) { - $this->register = $register; - $this->lockFactory = $lockFactory; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Sync proxy metadata with origins') @@ -53,6 +50,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $proxy->updateLatestProviders(); $lock->refresh(); }); + } catch (FilesystemException|JsonException) { + return 1; } finally { $lock->release(); } diff --git a/src/Command/ProxySyncReleasesCommand.php b/src/Command/ProxySyncReleasesCommand.php index f7b3b25e..9e9e086a 100644 --- a/src/Command/ProxySyncReleasesCommand.php +++ b/src/Command/ProxySyncReleasesCommand.php @@ -7,12 +7,19 @@ use Buddy\Repman\Service\Downloader; use Buddy\Repman\Service\Proxy\ProxyRegister; use Buddy\Repman\Service\Stream; -use Symfony\Component\Cache\Adapter\AdapterInterface; +use DateMalformedStringException; +use DateTimeImmutable; +use League\Flysystem\FilesystemException; +use Psr\Cache\CacheItemPoolInterface; +use Psr\Cache\InvalidArgumentException; +use RuntimeException; +use SimpleXMLElement; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Lock\LockFactory; use Symfony\Component\Lock\LockInterface; +use Throwable; final class ProxySyncReleasesCommand extends Command { @@ -20,26 +27,17 @@ final class ProxySyncReleasesCommand extends Command protected static $defaultName = 'repman:proxy:sync-releases'; - private ProxyRegister $register; - private Downloader $downloader; - private AdapterInterface $cache; private LockInterface $lock; - private LockFactory $lockFactory; - public function __construct(ProxyRegister $register, Downloader $downloader, AdapterInterface $packagistReleasesFeedCache, LockFactory $lockFactory) + public function __construct(private readonly ProxyRegister $register, private readonly Downloader $downloader, private readonly CacheItemPoolInterface $cache, private readonly LockFactory $lockFactory) { - $this->register = $register; - $this->downloader = $downloader; - $this->cache = $packagistReleasesFeedCache; - $this->lockFactory = $lockFactory; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Sync proxy releases with packagist.org') @@ -60,6 +58,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->alreadySynced((string) $feed->channel->pubDate)) { $this->syncPackages($feed); } + } catch (FilesystemException|Throwable) { + return 1; } finally { $this->lock->release(); } @@ -67,7 +67,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function syncPackages(\SimpleXMLElement $feed): void + /** + * @throws FilesystemException + * @throws Throwable + */ + private function syncPackages(SimpleXMLElement $feed): void { $proxy = $this ->register @@ -87,6 +91,10 @@ private function syncPackages(\SimpleXMLElement $feed): void } } + /** + * @throws DateMalformedStringException + * @throws InvalidArgumentException + */ private function alreadySynced(string $pubDate): bool { $lastPubDateCashed = $this->cache->getItem('pub_date'); @@ -99,10 +107,10 @@ private function alreadySynced(string $pubDate): bool $lastPubDate = $lastPubDateCashed->get(); - return new \DateTimeImmutable($pubDate) <= new \DateTimeImmutable($lastPubDate); + return new DateTimeImmutable($pubDate) <= new DateTimeImmutable($lastPubDate); } - private function loadFeed(): \SimpleXMLElement + private function loadFeed(): SimpleXMLElement { $stream = $this ->downloader @@ -111,7 +119,7 @@ private function loadFeed(): \SimpleXMLElement $xml = @simplexml_load_string((string) stream_get_contents($stream)); if ($xml === false) { - throw new \RuntimeException('Unable to parse RSS feed'); + throw new RuntimeException('Unable to parse RSS feed'); } return $xml; diff --git a/src/Command/ScanAllPackagesCommand.php b/src/Command/ScanAllPackagesCommand.php index 90303d6d..1e98f2bc 100644 --- a/src/Command/ScanAllPackagesCommand.php +++ b/src/Command/ScanAllPackagesCommand.php @@ -18,25 +18,15 @@ final class ScanAllPackagesCommand extends Command { protected static $defaultName = 'repman:security:scan-all'; - private PackageScanner $scanner; - private PackageQuery $packageQuery; - private PackageRepository $packageRepository; - private EntityManagerInterface $em; - - public function __construct(PackageScanner $scanner, PackageQuery $packageQuery, PackageRepository $packageRepository, EntityManagerInterface $em) + public function __construct(private readonly PackageScanner $scanner, private readonly PackageQuery $packageQuery, private readonly PackageRepository $packageRepository, private readonly EntityManagerInterface $em) { - $this->scanner = $scanner; - $this->packageQuery = $packageQuery; - $this->packageRepository = $packageRepository; - $this->em = $em; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Scan all synchronized packages') @@ -58,6 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $progressBar->advance(); } + $this->em->clear(); } diff --git a/src/Command/SendTelemetryCommand.php b/src/Command/SendTelemetryCommand.php index ca864c1a..14ba475a 100644 --- a/src/Command/SendTelemetryCommand.php +++ b/src/Command/SendTelemetryCommand.php @@ -6,6 +6,7 @@ use Buddy\Repman\Service\Config; use Buddy\Repman\Service\Telemetry; +use DateTimeImmutable; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -14,21 +15,15 @@ final class SendTelemetryCommand extends Command { protected static $defaultName = 'repman:telemetry:send'; - private Config $config; - private Telemetry $telemetry; - - public function __construct(Config $config, Telemetry $telemetry) + public function __construct(private readonly Config $config, private readonly Telemetry $telemetry) { - $this->config = $config; - $this->telemetry = $telemetry; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Send telemetry data'); @@ -45,7 +40,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $this->telemetry - ->collectAndSend((new \DateTimeImmutable())->modify('-1 day')); + ->collectAndSend((new DateTimeImmutable())->modify('-1 day')); return 0; } diff --git a/src/Command/SynchronizeAllPackagesCommand.php b/src/Command/SynchronizeAllPackagesCommand.php index 2a0d99e1..148c610c 100644 --- a/src/Command/SynchronizeAllPackagesCommand.php +++ b/src/Command/SynchronizeAllPackagesCommand.php @@ -7,6 +7,7 @@ use Buddy\Repman\Entity\Organization; use Buddy\Repman\Message\Organization\SynchronizePackage; use Buddy\Repman\Repository\OrganizationRepository; +use InvalidArgumentException; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -17,22 +18,15 @@ final class SynchronizeAllPackagesCommand extends Command { protected static $defaultName = 'repman:package:synchronize-all'; - private MessageBusInterface $bus; - - private OrganizationRepository $organizations; - - public function __construct(MessageBusInterface $bus, OrganizationRepository $organizations) + public function __construct(private readonly MessageBusInterface $bus, private readonly OrganizationRepository $organizations) { - $this->bus = $bus; - $this->organizations = $organizations; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Synchronize all packages') @@ -60,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** * @return Organization[] */ - protected function getOrganizationsToSync(?string $organizationAlias): array + private function getOrganizationsToSync(?string $organizationAlias): array { if ($organizationAlias === null) { return $this->organizations->findAll(); @@ -69,7 +63,7 @@ protected function getOrganizationsToSync(?string $organizationAlias): array $organization = $this->organizations->findOneBy(['alias' => $organizationAlias]); if (!$organization instanceof Organization) { - throw new \InvalidArgumentException(sprintf('Organization with alias %s not found.', $organizationAlias)); + throw new InvalidArgumentException(sprintf('Organization with alias %s not found.', $organizationAlias)); } return [$organization]; diff --git a/src/Command/SynchronizePackageCommand.php b/src/Command/SynchronizePackageCommand.php index fcd48b76..3b6556ac 100644 --- a/src/Command/SynchronizePackageCommand.php +++ b/src/Command/SynchronizePackageCommand.php @@ -18,21 +18,15 @@ final class SynchronizePackageCommand extends Command { protected static $defaultName = 'repman:package:synchronize'; - private MessageBusInterface $bus; - private PackageRepository $packages; - - public function __construct(MessageBusInterface $bus, PackageRepository $packages) + public function __construct(private readonly MessageBusInterface $bus, private readonly PackageRepository $packages) { - $this->bus = $bus; - $this->packages = $packages; - parent::__construct(); } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Synchronize given package') diff --git a/src/Command/UpdateAdvisoriesDbCommand.php b/src/Command/UpdateAdvisoriesDbCommand.php index 0d6c6644..5d14b6d1 100644 --- a/src/Command/UpdateAdvisoriesDbCommand.php +++ b/src/Command/UpdateAdvisoriesDbCommand.php @@ -15,21 +15,15 @@ final class UpdateAdvisoriesDbCommand extends Command { protected static $defaultName = 'repman:security:update-db'; - private SecurityChecker $checker; - private ScanAllPackagesCommand $scanCommand; - - public function __construct(SecurityChecker $checker, ScanAllPackagesCommand $scanCommand) + public function __construct(private readonly SecurityChecker $checker, private readonly ScanAllPackagesCommand $scanCommand) { parent::__construct(); - - $this->checker = $checker; - $this->scanCommand = $scanCommand; } /** * @return void */ - protected function configure() + protected function configure(): void { $this ->setDescription('Update security advisories database, scan all packages if updated.') diff --git a/src/Controller/Admin/ConfigController.php b/src/Controller/Admin/ConfigController.php index 17e1778d..dfe16794 100644 --- a/src/Controller/Admin/ConfigController.php +++ b/src/Controller/Admin/ConfigController.php @@ -16,18 +16,8 @@ final class ConfigController extends AbstractController { - private Config $config; - private Telemetry $telemetry; - private MessageBusInterface $messageBus; - - public function __construct( - Config $config, - Telemetry $telemetry, - MessageBusInterface $messageBus - ) { - $this->config = $config; - $this->telemetry = $telemetry; - $this->messageBus = $messageBus; + public function __construct(private readonly Config $config, private readonly Telemetry $telemetry, private readonly MessageBusInterface $messageBus) + { } /** diff --git a/src/Controller/Admin/OrganizationController.php b/src/Controller/Admin/OrganizationController.php index 116729f6..11e4f24f 100644 --- a/src/Controller/Admin/OrganizationController.php +++ b/src/Controller/Admin/OrganizationController.php @@ -10,6 +10,7 @@ use Buddy\Repman\Query\Admin\OrganizationQuery; use Buddy\Repman\Query\Filter; use Buddy\Repman\Query\User\Model\Organization; +use Buddy\Repman\Security\Model\User; use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; @@ -19,15 +20,8 @@ final class OrganizationController extends AbstractController { - private OrganizationQuery $organizationQuery; - private MessageBusInterface $messageBus; - - public function __construct( - OrganizationQuery $organizationQuery, - MessageBusInterface $messageBus - ) { - $this->organizationQuery = $organizationQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly OrganizationQuery $organizationQuery, private readonly MessageBusInterface $messageBus) + { } /** @@ -60,7 +54,7 @@ public function remove(Organization $organization, Request $request): Response */ public function addAdmin(Organization $organization, Request $request): Response { - /** @var \Buddy\Repman\Security\Model\User $user */ + /** @var User $user */ $user = $this->getUser(); $this->messageBus->dispatch(new InviteUser( diff --git a/src/Controller/Admin/ProxyController.php b/src/Controller/Admin/ProxyController.php index 17796e6a..da3aac75 100644 --- a/src/Controller/Admin/ProxyController.php +++ b/src/Controller/Admin/ProxyController.php @@ -7,7 +7,6 @@ use Buddy\Repman\Message\Proxy\RemoveDist; use Buddy\Repman\Query\Admin\Proxy\DownloadsQuery; use Buddy\Repman\Query\Filter; -use Buddy\Repman\Service\Proxy; use Buddy\Repman\Service\Proxy\ProxyRegister; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -18,18 +17,8 @@ final class ProxyController extends AbstractController { - private ProxyRegister $register; - private DownloadsQuery $downloadsQuery; - private MessageBusInterface $messageBus; - - public function __construct( - ProxyRegister $register, - DownloadsQuery $downloadsQuery, - MessageBusInterface $messageBus - ) { - $this->register = $register; - $this->downloadsQuery = $downloadsQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly ProxyRegister $register, private readonly DownloadsQuery $downloadsQuery, private readonly MessageBusInterface $messageBus) + { } /** diff --git a/src/Controller/Admin/UserController.php b/src/Controller/Admin/UserController.php index eae5a9fa..f7f030db 100644 --- a/src/Controller/Admin/UserController.php +++ b/src/Controller/Admin/UserController.php @@ -19,15 +19,8 @@ final class UserController extends AbstractController { - private UserQuery $userQuery; - private MessageBusInterface $messageBus; - - public function __construct( - UserQuery $userQuery, - MessageBusInterface $messageBus - ) { - $this->userQuery = $userQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly UserQuery $userQuery, private readonly MessageBusInterface $messageBus) + { } /** @@ -47,7 +40,7 @@ public function list(Request $request): Response /** * @Route("/admin/user/{user}/disable", name="admin_user_disable", methods={"POST"}, requirements={"user"="%uuid_pattern%"}) */ - public function disable(User $user, Request $request): Response + public function disable(User $user): Response { $this->messageBus->dispatch(new DisableUser($user->id())); $this->addFlash('success', sprintf('User %s has been successfully disabled', $user->email())); @@ -58,7 +51,7 @@ public function disable(User $user, Request $request): Response /** * @Route("/admin/user/{user}/enable", name="admin_user_enable", methods={"POST"}, requirements={"user"="%uuid_pattern%"}) */ - public function enable(User $user, Request $request): Response + public function enable(User $user): Response { $this->messageBus->dispatch(new EnableUser($user->id())); $this->addFlash('success', sprintf('User %s has been successfully enabled', $user->email())); diff --git a/src/Controller/Api/ApiController.php b/src/Controller/Api/ApiController.php index 56fafbb4..df775f6d 100644 --- a/src/Controller/Api/ApiController.php +++ b/src/Controller/Api/ApiController.php @@ -8,6 +8,7 @@ use Buddy\Repman\Query\Api\Model\Errors; use Buddy\Repman\Query\Api\Model\Links; use Buddy\Repman\Security\Model\User; +use JsonException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormInterface; @@ -39,7 +40,7 @@ protected function parseJson(Request $request): array try { $data = json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $th) { + } catch (JsonException) { throw new BadRequestHttpException(); } @@ -68,29 +69,25 @@ protected function paginate(callable $listFunction, int $total, int $perPage, in if ($pages === 0) { $pages = 1; } + $page = $page <= 0 ? $page = 1 : $page; $page = $page > $pages ? $pages : $page; + $offset = ($perPage * $page) - $perPage; return [ - $listFunction($perPage, $offset < 0 ? 0 : $offset), + $listFunction($perPage, max(0, $offset)), $total, new Links($baseUrl, $page, $pages), ]; } - /** - * @param mixed $data - */ - protected function created($data = []): JsonResponse + protected function created(mixed $data = []): JsonResponse { return $this->json($data, Response::HTTP_CREATED); } - /** - * @param mixed $data - */ - protected function badRequest($data = []): JsonResponse + protected function badRequest(mixed $data = []): JsonResponse { return $this->json($data, Response::HTTP_BAD_REQUEST); } diff --git a/src/Controller/Api/OrganizationController.php b/src/Controller/Api/OrganizationController.php index 0090ef23..cd7bf019 100644 --- a/src/Controller/Api/OrganizationController.php +++ b/src/Controller/Api/OrganizationController.php @@ -15,22 +15,14 @@ use Ramsey\Uuid\Uuid; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; final class OrganizationController extends ApiController { - private OrganizationQuery $organizationQuery; - private MessageBusInterface $messageBus; - - public function __construct( - OrganizationQuery $organizationQuery, - MessageBusInterface $messageBus - ) { - $this->organizationQuery = $organizationQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly OrganizationQuery $organizationQuery, private readonly MessageBusInterface $messageBus) + { } /** @@ -49,6 +41,7 @@ public function __construct( * @OA\Response( * response=200, * description="Returns list of user's organizations", + * * @OA\JsonContent( * ref=@Model(type=Organizations::class) * ) @@ -77,12 +70,14 @@ public function organizations(Request $request): JsonResponse * methods={"POST"}) * * @OA\RequestBody( + * * @Model(type=CreateOrganizationType::class) * ) * * @OA\Response( * response=201, * description="Create a new organization", + * * @OA\JsonContent( * ref=@Model(type=Organization::class) * ) @@ -91,6 +86,7 @@ public function organizations(Request $request): JsonResponse * @OA\Response( * response=400, * description="Bad request", + * * @OA\JsonContent( * ref=@Model(type=Errors::class) * ) diff --git a/src/Controller/Api/PackageController.php b/src/Controller/Api/PackageController.php index 5ef915a4..f9c045b7 100644 --- a/src/Controller/Api/PackageController.php +++ b/src/Controller/Api/PackageController.php @@ -25,15 +25,17 @@ use Buddy\Repman\Query\User\Model\Organization; use Buddy\Repman\Service\IntegrationRegister; use Buddy\Repman\Service\User\UserOAuthTokenProvider; +use DateTimeImmutable; +use InvalidArgumentException; use Nelmio\ApiDocBundle\Annotation\Model; use OpenApi\Annotations as OA; use Ramsey\Uuid\Uuid; +use RuntimeException; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Messenger\Exception\HandlerFailedException; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Annotation\Route; @@ -41,21 +43,8 @@ final class PackageController extends ApiController { - private PackageQuery $packageQuery; - private UserOAuthTokenProvider $oauthProvider; - private IntegrationRegister $integrations; - private MessageBusInterface $messageBus; - - public function __construct( - PackageQuery $packageQuery, - UserOAuthTokenProvider $oauthProvider, - IntegrationRegister $integrations, - MessageBusInterface $messageBus - ) { - $this->packageQuery = $packageQuery; - $this->oauthProvider = $oauthProvider; - $this->integrations = $integrations; - $this->messageBus = $messageBus; + public function __construct(private readonly PackageQuery $packageQuery, private readonly UserOAuthTokenProvider $oauthProvider, private readonly IntegrationRegister $integrations, private readonly MessageBusInterface $messageBus) + { } /** @@ -75,6 +64,7 @@ public function __construct( * @OA\Response( * response=200, * description="Returns list of organization's packages", + * * @OA\JsonContent( * ref=@Model(type=Packages::class) * ) @@ -120,6 +110,7 @@ public function packages(Organization $organization, Request $request): JsonResp * @OA\Response( * response=200, * description="Returns a single package", + * * @OA\JsonContent( * ref=@Model(type=Package::class) * ) @@ -129,7 +120,6 @@ public function packages(Organization $organization, Request $request): JsonResp * response=404, * description="Package not found" * ) - * * @OA\Response( * response=403, * description="Forbidden" @@ -163,12 +153,10 @@ public function getPackage(Organization $organization, Package $package): JsonRe * response=200, * description="Package removed, if there was a problem with removing the webhook, the 'warning' field will appear" * ) - * * @OA\Response( * response=404, * description="Package not found" * ) - * * @OA\Response( * response=403, * description="Forbidden" @@ -205,7 +193,6 @@ public function removePackage(Organization $organization, Package $package): Jso * response=200, * description="Package updated" * ) - * * @OA\Response( * response=404, * description="Package not found" @@ -238,6 +225,7 @@ public function synchronizePackage(Organization $organization, Package $package) * ) * * @OA\RequestBody( + * * @Model(type=EditPackageType::class) * ) * @@ -245,17 +233,14 @@ public function synchronizePackage(Organization $organization, Package $package) * response=200, * description="Package updated" * ) - * * @OA\Response( * response=404, * description="Package not found" * ) - * * @OA\Response( * response=403, * description="Forbidden" * ) - * * @OA\Response( * response=400, * description="Bad request" @@ -300,12 +285,14 @@ public function updatePackage(Organization $organization, Package $package, Requ * ) * * @OA\RequestBody( + * * @Model(type=AddPackageType::class) * ) * * @OA\Response( * response=201, * description="Returns added package", + * * @OA\JsonContent( * ref=@Model(type=Package::class) * ) @@ -314,6 +301,7 @@ public function updatePackage(Organization $organization, Package $package, Requ * @OA\Response( * response=400, * description="Bad request", + * * @OA\JsonContent( * ref=@Model(type=Errors::class) * ) @@ -335,12 +323,13 @@ public function addPackage(Organization $organization, Request $request): JsonRe try { $id = $this->handleAddPackage($type, $form, $organization, $json); - } catch (\InvalidArgumentException $exception) { + } catch (InvalidArgumentException $exception) { if (!$form->isSubmitted()) { $form->submit($json); } + $form->get('type')->addError(new FormError($exception->getMessage())); - } catch (\RuntimeException $exception) { + } catch (RuntimeException $exception) { $form->get('repository')->addError(new FormError($exception->getMessage())); } @@ -429,7 +418,7 @@ private function packageNewFromGitHub(FormInterface $form, Organization $organiz $this->messageBus->dispatch(new AddPackage( $id = Uuid::uuid4()->toString(), $organization->id(), - "https://github.com/{$repo}", + 'https://github.com/'.$repo, 'github-oauth', [Metadata::GITHUB_REPO_NAME => $repo], $form->get('keepLastReleases')->getData() @@ -456,7 +445,7 @@ private function packageNewFromGitLab(FormInterface $form, Organization $organiz $projectId = $byNames[$repo] ?? null; if ($projectId === null) { - throw new \RuntimeException("Repository '$repo' not found."); + throw new RuntimeException(sprintf("Repository '%s' not found.", $repo)); } $this->messageBus->dispatch(new AddPackage( @@ -489,7 +478,7 @@ private function packageNewFromBitbucket(FormInterface $form, Organization $orga $repoUuid = $byNames[$repo] ?? null; if ($repoUuid === null) { - throw new \RuntimeException("Repository '$repo' not found."); + throw new RuntimeException(sprintf("Repository '%s' not found.", $repo)); } $this->messageBus->dispatch(new AddPackage( @@ -510,7 +499,7 @@ private function getToken(string $type): string { $token = $this->oauthProvider->findAccessToken($this->getUser()->id(), $type); if ($token === null) { - throw new \InvalidArgumentException("Missing $type integration."); + throw new InvalidArgumentException(sprintf('Missing %s integration.', $type)); } return $token; @@ -519,7 +508,7 @@ private function getToken(string $type): string private function tryToRemoveWebhook(Package $package): ?string { $warning = null; - if ($package->getWebhookCreatedAt() !== null) { + if ($package->getWebhookCreatedAt() instanceof DateTimeImmutable) { try { switch ($package->getType()) { case 'github-oauth': diff --git a/src/Controller/Api/TokenController.php b/src/Controller/Api/TokenController.php index ee20cb79..75d1b8dc 100644 --- a/src/Controller/Api/TokenController.php +++ b/src/Controller/Api/TokenController.php @@ -23,15 +23,8 @@ final class TokenController extends ApiController { - private OrganizationQuery $organizationQuery; - private MessageBusInterface $messageBus; - - public function __construct( - OrganizationQuery $organizationQuery, - MessageBusInterface $messageBus - ) { - $this->organizationQuery = $organizationQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly OrganizationQuery $organizationQuery, private readonly MessageBusInterface $messageBus) + { } /** @@ -51,6 +44,7 @@ public function __construct( * @OA\Response( * response=200, * description="Returns list of organization's tokens", + * * @OA\JsonContent( * ref=@Model(type=Tokens::class) * ) @@ -88,12 +82,14 @@ public function tokens(Organization $organization, Request $request): JsonRespon * ) * * @OA\RequestBody( + * * @Model(type=GenerateTokenType::class) * ) * * @OA\Response( * response=201, * description="Returns generated token", + * * @OA\JsonContent( * ref=@Model(type=Token::class) * ) @@ -102,6 +98,7 @@ public function tokens(Organization $organization, Request $request): JsonRespon * @OA\Response( * response=400, * description="Bad request", + * * @OA\JsonContent( * ref=@Model(type=Errors::class) * ) @@ -148,12 +145,10 @@ public function generateToken(Organization $organization, Request $request): Jso * response=200, * description="Token deleted" * ) - * * @OA\Response( * response=404, * description="Token not found" * ) - * * @OA\Response( * response=403, * description="Forbidden" @@ -181,12 +176,10 @@ public function removeToken(Organization $organization, Token $token): JsonRespo * response=200, * description="Token regenerated" * ) - * * @OA\Response( * response=404, * description="Token not found" * ) - * * @OA\Response( * response=403, * description="Forbidden" diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index ef0f90c5..8aee96bc 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -12,11 +12,8 @@ final class IndexController extends AbstractController { - private Telemetry $telemetry; - - public function __construct(Telemetry $telemetry) + public function __construct(private readonly Telemetry $telemetry) { - $this->telemetry = $telemetry; } /** diff --git a/src/Controller/OAuth/BitbucketController.php b/src/Controller/OAuth/BitbucketController.php index 5275b910..2c4cca30 100644 --- a/src/Controller/OAuth/BitbucketController.php +++ b/src/Controller/OAuth/BitbucketController.php @@ -52,6 +52,7 @@ public function registerCheck(Request $request, BitbucketApi $api): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/package/add-from-bitbucket", name="fetch_bitbucket_package_token", methods={"GET"}, requirements={"organization"="%organization_pattern%"}) */ public function packageAddFromBitbucket(Request $request, Organization $organization, UserQuery $userQuery): Response @@ -61,6 +62,7 @@ public function packageAddFromBitbucket(Request $request, Organization $organiza if ($userQuery->hasOAuthAccessToken($user->id(), OAuthToken::TYPE_BITBUCKET)) { return $this->redirectToRoute('organization_package_new', ['organization' => $organization->alias(), 'type' => OAuthToken::TYPE_BITBUCKET]); } + $request->getSession()->set('organization', $organization->alias()); return $this->oauth->getClient('bitbucket')->redirect(['repository', 'webhook'], ['redirect_uri' => $this->generateUrl('package_bitbucket_check', [], UrlGeneratorInterface::ABSOLUTE_URL)]); @@ -74,9 +76,7 @@ public function storeBitbucketRepoToken(Request $request): Response return $this->storeRepoToken( $request, OAuthToken::TYPE_BITBUCKET, - function (): AccessToken { - return $this->oauth->getClient('bitbucket')->getAccessToken(['redirect_uri' => $this->generateUrl('package_bitbucket_check', [], UrlGeneratorInterface::ABSOLUTE_URL)]); - }, + fn (): AccessToken => $this->oauth->getClient('bitbucket')->getAccessToken(['redirect_uri' => $this->generateUrl('package_bitbucket_check', [], UrlGeneratorInterface::ABSOLUTE_URL)]), 'organization_package_new' ); } diff --git a/src/Controller/OAuth/GitHubController.php b/src/Controller/OAuth/GitHubController.php index 7a9ee323..3a481687 100644 --- a/src/Controller/OAuth/GitHubController.php +++ b/src/Controller/OAuth/GitHubController.php @@ -55,6 +55,7 @@ public function registerCheck(Request $request, GitHubApi $api): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/package/add-from-github", name="fetch_github_package_token", methods={"GET"}, requirements={"organization"="%organization_pattern%"}) */ public function packageAddFromGithub(Request $request, Organization $organization, UserQuery $userQuery): Response @@ -64,6 +65,7 @@ public function packageAddFromGithub(Request $request, Organization $organizatio if ($userQuery->hasOAuthAccessToken($user->id(), OAuthToken::TYPE_GITHUB)) { return $this->redirectToRoute('organization_package_new', ['organization' => $organization->alias(), 'type' => OAuthToken::TYPE_GITHUB]); } + $request->getSession()->set('organization', $organization->alias()); return $this->oauth->getClient('github') @@ -81,9 +83,7 @@ public function storeGitHubRepoToken(Request $request): Response return $this->storeRepoToken( $request, OAuthToken::TYPE_GITHUB, - function (): AccessToken { - return $this->oauth->getClient('github')->getAccessToken(); - }, + fn (): AccessToken => $this->oauth->getClient('github')->getAccessToken(), 'organization_package_new' ); } diff --git a/src/Controller/OAuth/GitLabController.php b/src/Controller/OAuth/GitLabController.php index 1d6bf769..77860937 100644 --- a/src/Controller/OAuth/GitLabController.php +++ b/src/Controller/OAuth/GitLabController.php @@ -57,6 +57,7 @@ function (): string { /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/package/add-from-gitlab", name="fetch_gitlab_package_token", methods={"GET"}, requirements={"organization"="%organization_pattern%"}) */ public function packageAddFromGitLab(Request $request, Organization $organization, UserQuery $userQuery): Response @@ -66,6 +67,7 @@ public function packageAddFromGitLab(Request $request, Organization $organizatio if ($userQuery->hasOAuthAccessToken($user->id(), OAuthToken::TYPE_GITLAB)) { return $this->redirectToRoute('organization_package_new', ['organization' => $organization->alias(), 'type' => OAuthToken::TYPE_GITLAB]); } + $request->getSession()->set('organization', $organization->alias()); return $this->oauth->getClient('gitlab')->redirect(['read_user', 'api'], ['redirect_uri' => $this->generateUrl('package_gitlab_check', [], UrlGeneratorInterface::ABSOLUTE_URL)]); @@ -79,9 +81,7 @@ public function storeGitLabRepoToken(Request $request): Response return $this->storeRepoToken( $request, OAuthToken::TYPE_GITLAB, - function (): AccessToken { - return $this->oauth->getClient('gitlab')->getAccessToken(['redirect_uri' => $this->generateUrl('package_gitlab_check', [], UrlGeneratorInterface::ABSOLUTE_URL)]); - }, + fn (): AccessToken => $this->oauth->getClient('gitlab')->getAccessToken(['redirect_uri' => $this->generateUrl('package_gitlab_check', [], UrlGeneratorInterface::ABSOLUTE_URL)]), 'organization_package_new' ); } diff --git a/src/Controller/OAuth/OAuthController.php b/src/Controller/OAuth/OAuthController.php index 0654f441..5eee955c 100644 --- a/src/Controller/OAuth/OAuthController.php +++ b/src/Controller/OAuth/OAuthController.php @@ -9,6 +9,7 @@ use Buddy\Repman\Security\Model\User; use Buddy\Repman\Security\UserGuardHelper; use Buddy\Repman\Service\Config; +use DateTimeImmutable; use Http\Client\Exception as HttpException; use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use KnpU\OAuth2ClientBundle\Exception\OAuth2ClientException; @@ -20,24 +21,12 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Messenger\MessageBusInterface; +use Symfony\Component\Security\Core\User\UserInterface; abstract class OAuthController extends AbstractController { - protected UserGuardHelper $guard; - protected ClientRegistry $oauth; - private Config $config; - private MessageBusInterface $messageBus; - - public function __construct( - UserGuardHelper $guard, - ClientRegistry $oauth, - Config $config, - MessageBusInterface $messageBus - ) { - $this->guard = $guard; - $this->oauth = $oauth; - $this->config = $config; - $this->messageBus = $messageBus; + public function __construct(protected UserGuardHelper $guard, protected ClientRegistry $oauth, private readonly Config $config, private readonly MessageBusInterface $messageBus) + { } /** @@ -45,7 +34,7 @@ public function __construct( */ protected function createAndAuthenticateUser(string $type, callable $emailProvider, Request $request): Response { - if ($this->getUser() !== null) { + if ($this->getUser() instanceof UserInterface) { return $this->redirectToRoute('index'); } @@ -59,10 +48,11 @@ protected function createAndAuthenticateUser(string $type, callable $emailProvid } else { $this->addFlash('success', 'Your account already exists. You have been logged in automatically'); } + $this->guard->authenticateUser($email, $request); return $this->redirectToRoute('organization_create', $params); - } catch (OAuth2ClientException $exception) { + } catch (OAuth2ClientException) { $this->addFlash('danger', 'Authentication failed! Did you authorize our app?'); } catch (IdentityProviderException|HttpException $e) { $this->addFlash('danger', $e->getMessage()); @@ -85,7 +75,7 @@ protected function storeRepoToken(Request $request, string $type, callable $toke $type, $token->getToken(), $token->getRefreshToken(), - $token->getExpires() !== null ? (new \DateTimeImmutable())->setTimestamp($token->getExpires()) : null + $token->getExpires() !== null ? (new DateTimeImmutable())->setTimestamp($token->getExpires()) : null ) ); diff --git a/src/Controller/Organization/MembersController.php b/src/Controller/Organization/MembersController.php index d9447fe2..d8fbe59b 100644 --- a/src/Controller/Organization/MembersController.php +++ b/src/Controller/Organization/MembersController.php @@ -27,18 +27,8 @@ final class MembersController extends AbstractController { - private OrganizationQuery $organizations; - private TokenStorageInterface $tokenStorage; - private MessageBusInterface $messageBus; - - public function __construct( - OrganizationQuery $organizations, - TokenStorageInterface $tokenStorage, - MessageBusInterface $messageBus - ) { - $this->organizations = $organizations; - $this->tokenStorage = $tokenStorage; - $this->messageBus = $messageBus; + public function __construct(private readonly OrganizationQuery $organizations, private readonly TokenStorageInterface $tokenStorage, private readonly MessageBusInterface $messageBus) + { } /** @@ -75,7 +65,7 @@ public function acceptInvitation(Request $request, string $token): Response $organization = $this->organizations->getByInvitation($token, $user->email()); if ($organization->isEmpty()) { $this->addFlash('danger', 'Invitation not found or belongs to different user'); - $this->tokenStorage->setToken(); + $this->tokenStorage->setToken(null); return $this->redirectToRoute('app_login'); } @@ -89,6 +79,7 @@ public function acceptInvitation(Request $request, string $token): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/member/invite", name="organization_invite_member", methods={"GET", "POST"}, requirements={"organization"="%organization_pattern%"}) */ public function invite(Organization $organization, Request $request): Response @@ -117,6 +108,7 @@ public function invite(Organization $organization, Request $request): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/invitation", name="organization_invitations", methods={"GET"}, requirements={"organization"="%organization_pattern%"}) */ public function listInvitations(Organization $organization, Request $request): Response @@ -133,6 +125,7 @@ public function listInvitations(Organization $organization, Request $request): R /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/invitation/{token}", name="organization_remove_invitation", methods={"DELETE"}, requirements={"organization"="%organization_pattern%"}) */ public function removeInvitation(Organization $organization, string $token): Response @@ -145,6 +138,7 @@ public function removeInvitation(Organization $organization, string $token): Res /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/member/{member}", name="organization_remove_member", methods={"DELETE"}, requirements={"organization"="%organization_pattern%", "member"="%uuid_pattern%"}) */ public function removeMember(Organization $organization, Member $member): Response @@ -161,6 +155,7 @@ public function removeMember(Organization $organization, Member $member): Respon /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/member/{member}/role", name="organization_change_member_role", methods={"GET", "POST"}, requirements={"organization"="%organization_pattern%", "member"="%uuid_pattern%"}) */ public function changeRole(Organization $organization, Member $member, Request $request): Response diff --git a/src/Controller/Organization/PackageController.php b/src/Controller/Organization/PackageController.php index 6cc2609a..c35861f8 100644 --- a/src/Controller/Organization/PackageController.php +++ b/src/Controller/Organization/PackageController.php @@ -33,25 +33,17 @@ use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Validator\Constraints\NotBlank; +use function ucfirst; final class PackageController extends AbstractController { - private UserOAuthTokenProvider $oauthProvider; - private IntegrationRegister $integrations; - private MessageBusInterface $messageBus; - - public function __construct( - UserOAuthTokenProvider $oauthProvider, - IntegrationRegister $integrations, - MessageBusInterface $messageBus - ) { - $this->oauthProvider = $oauthProvider; - $this->integrations = $integrations; - $this->messageBus = $messageBus; + public function __construct(private readonly UserOAuthTokenProvider $oauthProvider, private readonly IntegrationRegister $integrations, private readonly MessageBusInterface $messageBus) + { } /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/package/new/{type?}", name="organization_package_new", methods={"GET","POST"}, requirements={"organization"="%organization_pattern%"}) */ public function packageNew(Organization $organization, Request $request, ?string $type): Response @@ -96,13 +88,13 @@ public function packageNew(Organization $organization, Request $request, ?string if ($response instanceof Response) { return $response; } - } catch (HttpException $exception) { + } catch (HttpException $httpException) { $this->addFlash('danger', sprintf( 'Failed to fetch repositories (reason: %s). Please try again. If the problem persists, try to remove Repman OAuth application from your provider or unlink %s integration in your Profile and try again.', - $exception->getMessage(), - \ucfirst((string) $type) + $httpException->getMessage(), + ucfirst((string) $type) )); $form->get('type')->setData(null); } @@ -127,6 +119,7 @@ public function updatePackage(Organization $organization, Package $package): Res /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/package/{package}/edit", name="organization_package_edit", methods={"GET","POST"}, requirements={"organization"="%organization_pattern%","package"="%uuid_pattern%"}) */ public function editPackage(Organization $organization, Package $package, Request $request): Response @@ -235,7 +228,7 @@ private function packageNewFromGitHub(FormInterface $form, Organization $organiz $this->messageBus->dispatch(new AddPackage( $id = Uuid::uuid4()->toString(), $organization->id(), - "https://github.com/{$repo}", + 'https://github.com/'.$repo, 'github-oauth', [Metadata::GITHUB_REPO_NAME => $repo], $form->get('keepLastReleases')->getData() diff --git a/src/Controller/OrganizationController.php b/src/Controller/OrganizationController.php index 094457d4..1989b346 100644 --- a/src/Controller/OrganizationController.php +++ b/src/Controller/OrganizationController.php @@ -33,6 +33,7 @@ use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Query\User\PackageQuery\Filter as PackageFilter; use Buddy\Repman\Security\Model\User; +use DateTimeImmutable; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; @@ -44,18 +45,8 @@ final class OrganizationController extends AbstractController { - private PackageQuery $packageQuery; - private OrganizationQuery $organizationQuery; - private MessageBusInterface $messageBus; - - public function __construct( - PackageQuery $packageQuery, - OrganizationQuery $organizationQuery, - MessageBusInterface $messageBus - ) { - $this->packageQuery = $packageQuery; - $this->organizationQuery = $organizationQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly PackageQuery $packageQuery, private readonly OrganizationQuery $organizationQuery, private readonly MessageBusInterface $messageBus) + { } /** @@ -94,6 +85,7 @@ public function packages(Organization $organization, Request $request): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/package/{package}", name="organization_package_remove", methods={"DELETE"}, requirements={"organization"="%organization_pattern%","package"="%uuid_pattern%"}) */ public function removePackage(Organization $organization, Package $package): Response @@ -175,6 +167,7 @@ public function packageWebhook(Organization $organization, Package $package, Req $this->messageBus->dispatch(new AddBitbucketHook($package->id())); break; } + $this->addFlash('success', sprintf('Webhook for "%s" will be synchronized in background.', $package->name())); return $this->redirectToRoute('organization_package_webhook', ['organization' => $organization->alias(), 'package' => $package->id()]); @@ -259,6 +252,7 @@ public function removeToken(Organization $organization, Token $token): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}/settings", name="organization_settings", methods={"GET","POST"}, requirements={"organization"="%organization_pattern%"}) */ public function settings(Organization $organization, Request $request): Response @@ -300,12 +294,13 @@ public function settings(Organization $organization, Request $request): Response /** * @IsGranted("ROLE_ORGANIZATION_OWNER", subject="organization") + * * @Route("/organization/{organization}", name="organization_remove", methods={"DELETE"}, requirements={"organization"="%organization_pattern%"}) */ public function removeOrganization(Organization $organization): Response { $offset = 0; - while (($packages = $this->packageQuery->findAll($organization->id(), new PackageQuery\Filter($offset, $limit = 100))) !== []) { + while (($packages = $this->packageQuery->findAll($organization->id(), new PackageFilter($offset, $limit = 100))) !== []) { array_walk($packages, [$this, 'tryToRemoveWebhook']); $offset += $limit; } @@ -360,7 +355,7 @@ public function packageScanResults(Organization $organization, Package $package, private function tryToRemoveWebhook(Package $package): void { - if ($package->webhookCreatedAt() !== null) { + if ($package->webhookCreatedAt() instanceof DateTimeImmutable) { try { switch ($package->type()) { case 'github-oauth': @@ -387,8 +382,8 @@ private function hasNoPackages(Organization $organization): bool { $user = parent::getUser(); - return $user instanceof User && - $organization->isOwner($user->id()) && - $this->packageQuery->count($organization->id(), new PackageFilter()) === 0; + return $user instanceof User + && $organization->isOwner($user->id()) + && $this->packageQuery->count($organization->id(), new PackageFilter()) === 0; } } diff --git a/src/Controller/ProxyController.php b/src/Controller/ProxyController.php index d7e5221d..c52e8c1a 100644 --- a/src/Controller/ProxyController.php +++ b/src/Controller/ProxyController.php @@ -11,6 +11,9 @@ use Buddy\Repman\Service\Proxy\Metadata; use Buddy\Repman\Service\Proxy\ProxyRegister; use Buddy\Repman\Service\Symfony\ResponseCallback; +use DateTime; +use DateTimeImmutable; +use League\Flysystem\FilesystemException; use Munus\Control\Option; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; @@ -20,19 +23,17 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Routing\RouterInterface; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Throwable; +use function array_filter; +use function array_map; +use function is_array; +use function json_decode; final class ProxyController extends AbstractController { - private ProxyRegister $register; - private MessageBusInterface $messageBus; - - public function __construct( - ProxyRegister $register, - MessageBusInterface $messageBus - ) { - $this->register = $register; - $this->messageBus = $messageBus; + public function __construct(private readonly ProxyRegister $register, private readonly MessageBusInterface $messageBus) + { } /** @@ -44,18 +45,20 @@ public function __construct( * defaults={"domain"="%domain%","domain_separator"="%domain_separator%"}, * requirements={"domain"="%domain%","domain_separator"="%domain_separator%"} * ) + * @throws FilesystemException + * @throws Throwable */ public function packages(Request $request): JsonResponse { - $metadata = $this->register->getByHost('packagist.org')->latestProvider(); + $metadata = $this->register->getByHost('repo.packagist.org')->latestProvider(); $response = (new JsonResponse([ - 'notify-batch' => $this->generateUrl('package_downloads', [], RouterInterface::ABSOLUTE_URL), + 'notify-batch' => $this->generateUrl('package_downloads', [], UrlGeneratorInterface::ABSOLUTE_URL), 'providers-url' => '/p/%package%$%hash%.json', 'metadata-url' => '/p2/%package%.json', 'search' => 'https://packagist.org/search.json?q=%query%&type=%type%', 'mirrors' => [ [ - 'dist-url' => $this->generateUrl('index', [], RouterInterface::ABSOLUTE_URL).'dists/%package%/%version%/%reference%.%type%', + 'dist-url' => $this->generateUrl('index', [], UrlGeneratorInterface::ABSOLUTE_URL).'dists/%package%/%version%/%reference%.%type%', 'preferred' => true, ], ], @@ -65,7 +68,7 @@ public function packages(Request $request): JsonResponse ->setPublic() ; - $now = new \DateTime(); + $now = new DateTime(); $response->setLastModified( $metadata->isPresent() ? $now->setTimestamp($metadata->get()->timestamp()) : @@ -84,6 +87,8 @@ public function packages(Request $request): JsonResponse * defaults={"domain"="%domain%","domain_separator"="%domain_separator%"}, * requirements={"package"="%package_name_pattern%","domain"="%domain%","domain_separator"="%domain_separator%"}, * methods={"GET"}) + * + * @throws Throwable */ public function legacyMetadata(string $package, string $hash, Request $request): Response { @@ -94,13 +99,13 @@ public function legacyMetadata(string $package, string $hash, Request $request): ->map(fn (Option $option) => $option->get()) ->getOrElseThrow(new NotFoundHttpException('Provider not found')); - $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), 200, [ + $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), Response::HTTP_OK, [ 'Accept-Ranges' => 'bytes', 'Content-Type' => 'application/json', 'Content-Length' => $metadata->contentSize(), ])) ->setPublic() - ->setLastModified((new \DateTime())->setTimestamp($metadata->timestamp())) + ->setLastModified((new DateTime())->setTimestamp($metadata->timestamp())) ; $response->isNotModified($request); @@ -115,6 +120,8 @@ public function legacyMetadata(string $package, string $hash, Request $request): * defaults={"domain"="%domain%","domain_separator"="%domain_separator%"}, * requirements={"package"="%package_name_pattern%","domain"="%domain%","domain_separator"="%domain_separator%"}, * methods={"GET"}) + * + * @throws FilesystemException */ public function legacyMetadataLazy(string $package, Request $request): Response { @@ -125,13 +132,13 @@ public function legacyMetadataLazy(string $package, Request $request): Response ->map(fn (Option $option) => $option->get()) ->getOrElse(Metadata::fromString('{"packages": {}}')); - $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), 200, [ + $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), Response::HTTP_OK, [ 'Accept-Ranges' => 'bytes', 'Content-Type' => 'application/json', 'Content-Length' => $metadata->contentSize(), ])) ->setPublic() - ->setLastModified((new \DateTime())->setTimestamp($metadata->timestamp())) + ->setLastModified((new DateTime())->setTimestamp($metadata->timestamp())) ; $response->isNotModified($request); @@ -148,6 +155,8 @@ public function legacyMetadataLazy(string $package, Request $request): Response * defaults={"domain"="%domain%","domain_separator"="%domain_separator%"}, * requirements={"domain"="%domain%","domain_separator"="%domain_separator%"} * ) + * + * @throws Throwable */ public function providers(string $version, string $hash, Request $request): Response { @@ -158,13 +167,13 @@ public function providers(string $version, string $hash, Request $request): Resp ->map(fn (Option $option) => $option->get()) ->getOrElseThrow(new NotFoundHttpException('Provider not found')); - $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), 200, [ + $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), Response::HTTP_OK, [ 'Accept-Ranges' => 'bytes', 'Content-Type' => 'application/json', 'Content-Length' => $metadata->contentSize(), ])) ->setPublic() - ->setLastModified((new \DateTime())->setTimestamp($metadata->timestamp())) + ->setLastModified((new DateTime())->setTimestamp($metadata->timestamp())) ; $response->isNotModified($request); @@ -179,6 +188,8 @@ public function providers(string $version, string $hash, Request $request): Resp * defaults={"domain"="%domain%","domain_separator"="%domain_separator%"}, * requirements={"package"="%package_name_pattern%","domain"="%domain%","domain_separator"="%domain_separator%"}, * methods={"GET"}) + * + * @throws Throwable */ public function metadata(string $package, Request $request): Response { @@ -189,13 +200,13 @@ public function metadata(string $package, Request $request): Response ->map(fn (Option $option) => $option->get()) ->getOrElseThrow(new NotFoundHttpException('Metadata not found')); - $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), 200, [ + $response = (new StreamedResponse(ResponseCallback::fromStream($metadata->stream()), Response::HTTP_OK, [ 'Accept-Ranges' => 'bytes', 'Content-Type' => 'application/json', 'Content-Length' => $metadata->contentSize(), ])) ->setPublic() - ->setLastModified((new \DateTime())->setTimestamp($metadata->timestamp())) + ->setLastModified((new DateTime())->setTimestamp($metadata->timestamp())) ; $response->isNotModified($request); @@ -210,6 +221,7 @@ public function metadata(string $package, Request $request): Response * defaults={"domain"="%domain%","domain_separator"="%domain_separator%"}, * requirements={"package"="%package_name_pattern%","ref"="[a-f0-9]*?","type"="zip|tar","domain"="%domain%","domain_separator"="%domain_separator%"}, * methods={"GET"}) + * @throws Throwable */ public function distribution(string $package, string $version, string $ref, string $type, Request $request): Response { @@ -220,7 +232,7 @@ public function distribution(string $package, string $version, string $ref, stri ->map(fn (Option $option) => $option->get()) ->getOrElseThrow(new NotFoundHttpException('This distribution file can not be found or downloaded from origin url.')); - $response = (new StreamedResponse(ResponseCallback::fromStream($distFile->stream()), 200, [ + $response = (new StreamedResponse(ResponseCallback::fromStream($distFile->stream()), Response::HTTP_OK, [ 'Accept-Ranges' => 'bytes', 'Content-Type' => 'application/zip', 'Content-Length' => $distFile->fileSize(), @@ -244,25 +256,21 @@ public function distribution(string $package, string $version, string $ref, stri */ public function downloads(Request $request): JsonResponse { - $contents = \json_decode($request->getContent(), true); - if (!isset($contents['downloads']) || !\is_array($contents['downloads']) || $contents['downloads'] === []) { + $contents = json_decode($request->getContent(), true); + if (!isset($contents['downloads']) || !is_array($contents['downloads']) || $contents['downloads'] === []) { return new JsonResponse([ 'status' => 'error', 'message' => 'Invalid request format, must be a json object containing a downloads key filled with an array of name/version objects', - ], JsonResponse::HTTP_BAD_REQUEST); + ], Response::HTTP_BAD_REQUEST); } $this->messageBus->dispatch(new AddDownloads( - \array_map(function (array $data): Package { - return new Package($data['name'], $data['version']); - }, \array_filter($contents['downloads'], function (array $row): bool { - return isset($row['name'], $row['version']); - })), - new \DateTimeImmutable(), + array_map(fn (array $data): Package => new Package($data['name'], $data['version']), array_filter($contents['downloads'], fn (array $row): bool => isset($row['name'], $row['version']))), + new DateTimeImmutable(), $request->getClientIp(), $request->headers->get('User-Agent') )); - return new JsonResponse(['status' => 'success'], JsonResponse::HTTP_CREATED); + return new JsonResponse(['status' => 'success'], Response::HTTP_CREATED); } } diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index b32622fd..c2368f10 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -10,7 +10,9 @@ use Buddy\Repman\Message\User\SendConfirmToken; use Buddy\Repman\Security\UserGuardHelper; use Buddy\Repman\Service\Config; +use InvalidArgumentException; use Ramsey\Uuid\Uuid; +use RuntimeException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -20,18 +22,8 @@ class RegistrationController extends AbstractController { - private UserGuardHelper $guard; - private Config $config; - private MessageBusInterface $messageBus; - - public function __construct( - UserGuardHelper $guard, - Config $config, - MessageBusInterface $messageBus - ) { - $this->guard = $guard; - $this->config = $config; - $this->messageBus = $messageBus; + public function __construct(private readonly UserGuardHelper $guard, private readonly Config $config, private readonly MessageBusInterface $messageBus) + { } /** @@ -58,7 +50,7 @@ public function register(Request $request): Response $confirmToken )); - $this->addFlash('warning', "Please click the activation link for {$email} to verify your email."); + $this->addFlash('warning', sprintf('Please click the activation link for %s to verify your email.', $email)); $this->guard->authenticateUser($email, $request); @@ -90,7 +82,7 @@ public function confirm(string $token): Response try { $this->messageBus->dispatch(new ConfirmEmail($token)); $this->addFlash('success', 'E-mail address was confirmed. Enjoy your Repman account.'); - } catch (\RuntimeException|\InvalidArgumentException $exception) { + } catch (RuntimeException|InvalidArgumentException) { $this->addFlash('danger', 'Invalid or expired e-mail confirm token'); } diff --git a/src/Controller/RepoController.php b/src/Controller/RepoController.php index 1eee1319..e7c9eecb 100644 --- a/src/Controller/RepoController.php +++ b/src/Controller/RepoController.php @@ -9,6 +9,7 @@ use Buddy\Repman\Query\User\Model\PackageName; use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Service\Organization\PackageManager; +use DateTimeImmutable; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; @@ -20,25 +21,18 @@ use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\RouterInterface; +use function fopen; +use function stream_copy_to_stream; final class RepoController extends AbstractController { - private PackageQuery $packageQuery; - private PackageManager $packageManager; - private MessageBusInterface $messageBus; - - public function __construct( - PackageQuery $packageQuery, - PackageManager $packageManager, - MessageBusInterface $messageBus - ) { - $this->packageQuery = $packageQuery; - $this->packageManager = $packageManager; - $this->messageBus = $messageBus; + public function __construct(private readonly PackageQuery $packageQuery, private readonly PackageManager $packageManager, private readonly MessageBusInterface $messageBus) + { } /** * @Route("/packages.json", host="{organization}{sep1}repo{sep2}{domain}", name="repo_packages", methods={"GET"}, defaults={"domain":"%domain%","sep1"="%organization_separator%","sep2"="%domain_separator%"}, requirements={"domain"="%domain%","sep1"="%organization_separator%","sep2"="%domain_separator%"}) + * * @Cache(public=false) */ public function packages(Request $request, Organization $organization): JsonResponse @@ -80,6 +74,7 @@ public function packages(Request $request, Organization $organization): JsonResp * defaults={"domain":"%domain%","sep1"="%organization_separator%","sep2"="%domain_separator%"}, * requirements={"package"="%package_name_pattern%","ref"="[a-f0-9]*?","type"="zip|tar","domain"="%domain%","sep1"="%organization_separator%","sep2"="%domain_separator%"}, * methods={"GET"}) + * * @Cache(public=false) */ public function distribution(Organization $organization, string $package, string $version, string $ref, string $type): StreamedResponse @@ -89,12 +84,13 @@ public function distribution(Organization $organization, string $package, string ->getOrElseThrow(new NotFoundHttpException('This distribution file can not be found or downloaded from origin url.')); return new StreamedResponse(function () use ($filename): void { - $outputStream = \fopen('php://output', 'wb'); + $outputStream = fopen('php://output', 'wb'); if (false === $outputStream) { throw new HttpException(500, 'Could not open output stream to send binary file.'); // @codeCoverageIgnore } + $fileStream = $this->packageManager->getDistFileReference($filename); - \stream_copy_to_stream( + stream_copy_to_stream( $fileStream ->getOrElseThrow(new NotFoundHttpException('This distribution file can not be found or downloaded from origin url.')), $outputStream @@ -122,7 +118,11 @@ public function downloads(Request $request, Organization $organization): JsonRes $packageMap = $this->getPackageNameMap($organization->id()); foreach ($contents['downloads'] as $package) { - if (!isset($package['name']) || !isset($package['version'])) { + if (!isset($package['name'])) { + continue; + } + + if (!isset($package['version'])) { continue; } @@ -130,7 +130,7 @@ public function downloads(Request $request, Organization $organization): JsonRes $this->messageBus->dispatch(new AddDownload( $packageMap[$package['name']], $package['version'], - new \DateTimeImmutable(), + new DateTimeImmutable(), $request->getClientIp(), $request->headers->get('User-Agent') )); @@ -147,6 +147,7 @@ public function downloads(Request $request, Organization $organization): JsonRes * methods={"GET"}, * defaults={"domain":"%domain%","sep1"="%organization_separator%","sep2"="%domain_separator%"}, * requirements={"domain"="%domain%","package"="%package_name_pattern%","sep1"="%organization_separator%","sep2"="%domain_separator%"}) + * * @Cache(public=false) */ public function providerV2Dev(Request $request, Organization $organization, string $package): JsonResponse @@ -165,6 +166,7 @@ public function providerV2Dev(Request $request, Organization $organization, stri * methods={"GET"}, * defaults={"domain":"%domain%","sep1"="%organization_separator%","sep2"="%domain_separator%"}, * requirements={"domain"="%domain%","package"="%package_name_pattern%","sep1"="%organization_separator%","sep2"="%domain_separator%"}) + * * @Cache(public=false) */ public function providerV2(Request $request, Organization $organization, string $package): JsonResponse diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index 3b509276..e7426931 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -4,6 +4,7 @@ namespace Buddy\Repman\Controller; +use Browser; use Buddy\Repman\Form\Type\User\ResetPasswordType; use Buddy\Repman\Form\Type\User\SendResetPasswordLinkType; use Buddy\Repman\Message\User\ResetPassword; @@ -15,22 +16,13 @@ use Symfony\Component\Messenger\Exception\HandlerFailedException; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class SecurityController extends AbstractController { - private AuthenticationUtils $authenticationUtils; - private Config $config; - private MessageBusInterface $messageBus; - - public function __construct( - AuthenticationUtils $authenticationUtils, - Config $config, - MessageBusInterface $messageBus - ) { - $this->authenticationUtils = $authenticationUtils; - $this->config = $config; - $this->messageBus = $messageBus; + public function __construct(private readonly AuthenticationUtils $authenticationUtils, private readonly Config $config, private readonly MessageBusInterface $messageBus) + { } /** @@ -38,7 +30,7 @@ public function __construct( */ public function login(): Response { - if ($this->getUser() !== null) { + if ($this->getUser() instanceof UserInterface) { return $this->redirectToRoute('index'); } @@ -57,7 +49,7 @@ public function sendResetPasswordLink(Request $request): Response $form = $this->createForm(SendResetPasswordLinkType::class); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $browser = new \Browser(); + $browser = new Browser(); $this->messageBus->dispatch(new SendPasswordResetLink( $form->get('email')->getData(), $browser->getPlatform(), @@ -85,7 +77,7 @@ public function resetPassword(Request $request): Response $form->get('password')->getData() )); $this->addFlash('success', 'Your password has been changed, you can now log in'); - } catch (HandlerFailedException $exception) { + } catch (HandlerFailedException) { $this->addFlash('danger', 'Invalid or expired password reset token'); } diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index a8a9ae3c..3048f1ed 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -30,18 +30,12 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Annotation\Route; +use function ucfirst; final class UserController extends AbstractController { - private UserQuery $userQuery; - private MessageBusInterface $messageBus; - - public function __construct( - UserQuery $userQuery, - MessageBusInterface $messageBus - ) { - $this->userQuery = $userQuery; - $this->messageBus = $messageBus; + public function __construct(private readonly UserQuery $userQuery, private readonly MessageBusInterface $messageBus) + { } /** @@ -150,7 +144,7 @@ public function removeOAuthToken(string $type): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); $this->messageBus->dispatch(new RemoveOAuthToken($this->getUser()->id(), $type)); - $this->addFlash('success', sprintf('%s has been successfully unlinked.', \ucfirst($type))); + $this->addFlash('success', sprintf('%s has been successfully unlinked.', ucfirst($type))); return $this->redirectToRoute('user_profile'); } diff --git a/src/Controller/WebhookController.php b/src/Controller/WebhookController.php index 5cba8e91..37cbe8cc 100644 --- a/src/Controller/WebhookController.php +++ b/src/Controller/WebhookController.php @@ -7,6 +7,7 @@ use Buddy\Repman\Message\Organization\SynchronizePackage; use Buddy\Repman\Query\User\Model\Package; use Buddy\Repman\Service\Organization\WebhookRequests; +use DateTimeImmutable; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -16,15 +17,8 @@ final class WebhookController extends AbstractController { - private WebhookRequests $webhookRequests; - private MessageBusInterface $messageBus; - - public function __construct( - WebhookRequests $webhookRequests, - MessageBusInterface $messageBus - ) { - $this->webhookRequests = $webhookRequests; - $this->messageBus = $messageBus; + public function __construct(private readonly WebhookRequests $webhookRequests, private readonly MessageBusInterface $messageBus) + { } /** @@ -33,7 +27,7 @@ public function __construct( public function package(Package $package, Request $request): Response { $this->messageBus->dispatch(new SynchronizePackage($package->id())); - $this->webhookRequests->add($package->id(), new \DateTimeImmutable(), $request->getClientIp(), $request->headers->get('User-Agent')); + $this->webhookRequests->add($package->id(), new DateTimeImmutable(), $request->getClientIp(), $request->headers->get('User-Agent')); return new JsonResponse(null, Response::HTTP_ACCEPTED); } diff --git a/src/DataFixtures/PrivatePackageDownloadFixtures.php b/src/DataFixtures/PrivatePackageDownloadFixtures.php index 55df740d..ce58afd9 100644 --- a/src/DataFixtures/PrivatePackageDownloadFixtures.php +++ b/src/DataFixtures/PrivatePackageDownloadFixtures.php @@ -9,6 +9,7 @@ use Buddy\Repman\Query\Filter; use Buddy\Repman\Query\User\Model\PackageName; use Buddy\Repman\Query\User\PackageQuery; +use DateTimeImmutable; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ObjectManager; @@ -24,16 +25,10 @@ */ final class PrivatePackageDownloadFixtures extends Fixture { - private OrganizationQuery $organizations; - private PackageQuery $packages; - private Generator $faker; - private EntityManagerInterface $em; + private readonly Generator $faker; - public function __construct(OrganizationQuery $organizations, PackageQuery $packages, EntityManagerInterface $em) + public function __construct(private readonly OrganizationQuery $organizations, private readonly PackageQuery $packages, private readonly EntityManagerInterface $em) { - $this->organizations = $organizations; - $this->packages = $packages; - $this->em = $em; $this->faker = Factory::create(); } @@ -60,18 +55,21 @@ private function loadDownloads(PackageName $package): void $this->em->persist(new Download( Uuid::uuid4(), Uuid::fromString($package->id()), - (new \DateTimeImmutable())->modify(sprintf('-%s days', $i)), + (new DateTimeImmutable())->modify(sprintf('-%s days', $i)), $this->faker->randomElement($versions), $this->faker->ipv4, $this->faker->userAgent )); $this->em->flush(); } + $progress->advance(); } + $this->em->commit(); $this->em->beginTransaction(); $this->em->clear(); + $output->writeln(''); } } diff --git a/src/DataFixtures/ProxyPackageDownloadFixtures.php b/src/DataFixtures/ProxyPackageDownloadFixtures.php index 012f8078..e74c5f84 100644 --- a/src/DataFixtures/ProxyPackageDownloadFixtures.php +++ b/src/DataFixtures/ProxyPackageDownloadFixtures.php @@ -4,9 +4,10 @@ namespace Buddy\Repman\DataFixtures; -use Buddy\Repman\Entity\Organization\Package\Download; use Buddy\Repman\Service\Proxy\Downloads; +use Buddy\Repman\Service\Proxy\Downloads\Package; use Buddy\Repman\Service\Proxy\ProxyRegister; +use DateTimeImmutable; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ObjectManager; @@ -21,16 +22,10 @@ */ final class ProxyPackageDownloadFixtures extends Fixture { - private Downloads $downloads; - private ProxyRegister $register; - private Generator $faker; - private EntityManagerInterface $em; + private readonly Generator $faker; - public function __construct(Downloads $downloads, ProxyRegister $register, EntityManagerInterface $em) + public function __construct(private readonly Downloads $downloads, private readonly ProxyRegister $register, private readonly EntityManagerInterface $em) { - $this->downloads = $downloads; - $this->register = $register; - $this->em = $em; $this->faker = Factory::create(); } @@ -53,16 +48,19 @@ private function loadDownloads(string $package): void $dayDownloads = random_int(0, 100); for ($j = 0; $j < $dayDownloads; ++$j) { $this->downloads->save( - [new Downloads\Package($package, $this->faker->randomElement($versions))], - (new \DateTimeImmutable())->modify(sprintf('-%s days', $i)), + [new Package($package, $this->faker->randomElement($versions))], + (new DateTimeImmutable())->modify(sprintf('-%s days', $i)), $this->faker->ipv4, $this->faker->userAgent ); } + $progress->advance(); } + $this->em->commit(); $this->em->beginTransaction(); + $output->writeln(''); } } diff --git a/src/DataFixtures/TokenFixtures.php b/src/DataFixtures/TokenFixtures.php index 1110db9b..db83e6df 100644 --- a/src/DataFixtures/TokenFixtures.php +++ b/src/DataFixtures/TokenFixtures.php @@ -4,7 +4,6 @@ namespace Buddy\Repman\DataFixtures; -use Buddy\Repman\Entity\Organization\Package\Download; use Buddy\Repman\Message\Organization\GenerateToken; use Buddy\Repman\Query\Admin\Model\Organization; use Buddy\Repman\Query\Admin\OrganizationQuery; @@ -23,14 +22,10 @@ */ final class TokenFixtures extends Fixture { - private MessageBusInterface $messageBus; - private OrganizationQuery $organizations; - private Generator $faker; + private readonly Generator $faker; - public function __construct(MessageBusInterface $messageBus, OrganizationQuery $organizations) + public function __construct(private readonly MessageBusInterface $messageBus, private readonly OrganizationQuery $organizations) { - $this->messageBus = $messageBus; - $this->organizations = $organizations; $this->faker = Factory::create(); } @@ -45,6 +40,7 @@ public function load(ObjectManager $manager): void $this->generateTokens($organization); $progress->advance(); } + $output->writeln(''); } diff --git a/src/DataFixtures/UserFixtures.php b/src/DataFixtures/UserFixtures.php index 1e5988e5..e1640259 100644 --- a/src/DataFixtures/UserFixtures.php +++ b/src/DataFixtures/UserFixtures.php @@ -12,11 +12,8 @@ final class UserFixtures extends Fixture { - private MessageBusInterface $messageBus; - - public function __construct(MessageBusInterface $messageBus) + public function __construct(private readonly MessageBusInterface $messageBus) { - $this->messageBus = $messageBus; } public function load(ObjectManager $manager): void diff --git a/src/Entity/Config.php b/src/Entity/Config.php index c2ef7a9a..ed1041ba 100644 --- a/src/Entity/Config.php +++ b/src/Entity/Config.php @@ -13,6 +13,7 @@ class Config { /** * @ORM\Id + * * @ORM\Column(type="string", unique=true, length=255) */ private string $key; diff --git a/src/Entity/Organization.php b/src/Entity/Organization.php index 7b7b70d9..c828fefa 100644 --- a/src/Entity/Organization.php +++ b/src/Entity/Organization.php @@ -9,58 +9,48 @@ use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\Organization\Token; use Buddy\Repman\Entity\User\OAuthToken; +use DateTimeImmutable; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use RuntimeException; /** * @ORM\Entity(repositoryClass="Buddy\Repman\Repository\OrganizationRepository") */ class Organization { - /** - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) - */ - private UuidInterface $id; - /** * @ORM\Column(type="datetime_immutable") */ - private \DateTimeImmutable $createdAt; - - /** - * @ORM\Column(type="string", length=255) - */ - private string $name; - - /** - * @ORM\Column(type="string", unique=true, length=255) - */ - private string $alias; + private DateTimeImmutable $createdAt; /** * @var Collection|Package[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Package", mappedBy="organization", cascade={"persist"}, orphanRemoval=true) */ private Collection $packages; /** * @var Collection|Token[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Token", mappedBy="organization", cascade={"persist"}, orphanRemoval=true) */ private Collection $tokens; /** * @var Collection|Invitation[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Invitation", mappedBy="organization", cascade={"persist"}, orphanRemoval=true) */ private Collection $invitations; /** * @var Collection|Member[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Member", mappedBy="organization", cascade={"persist"}, orphanRemoval=true) */ private Collection $members; @@ -70,17 +60,26 @@ class Organization */ private bool $hasAnonymousAccess = false; - public function __construct(UuidInterface $id, User $owner, string $name, string $alias) + public function __construct(/** + * @ORM\Id + * + * @ORM\Column(type="uuid", unique=true) + */ + private UuidInterface $id, User $owner, /** + * @ORM\Column(type="string", length=255) + */ + private string $name, /** + * @ORM\Column(type="string", unique=true, length=255) + */ + private string $alias) { - $this->id = $id; - $this->name = $name; - $this->alias = $alias; - $this->createdAt = new \DateTimeImmutable(); + $this->createdAt = new DateTimeImmutable(); $this->packages = new ArrayCollection(); $this->tokens = new ArrayCollection(); $this->invitations = new ArrayCollection(); $this->members = new ArrayCollection(); $this->members->add($member = new Member(Uuid::uuid4(), $owner, $this, Member::ROLE_OWNER)); + $owner->addMembership($member); } @@ -207,7 +206,7 @@ public function acceptInvitation(string $token, User $user): void public function removeMember(User $user): void { if ($this->isLastOwner($user)) { - throw new \RuntimeException('Organisation must have at least one owner.'); + throw new RuntimeException('Organisation must have at least one owner.'); } foreach ($this->members as $member) { @@ -221,7 +220,7 @@ public function removeMember(User $user): void public function changeRole(User $user, string $role): void { if ($this->isLastOwner($user) && $role === Member::ROLE_MEMBER) { - throw new \RuntimeException('Organisation must have at least one owner.'); + throw new RuntimeException('Organisation must have at least one owner.'); } foreach ($this->members as $member) { @@ -262,6 +261,7 @@ private function isLastOwner(User $user): bool if ($owners->count() > 1) { return false; } + /** @var Member $lastOwner */ $lastOwner = $owners->first(); diff --git a/src/Entity/Organization/Invitation.php b/src/Entity/Organization/Invitation.php index a351480c..8ffbb98b 100644 --- a/src/Entity/Organization/Invitation.php +++ b/src/Entity/Organization/Invitation.php @@ -6,9 +6,11 @@ use Buddy\Repman\Entity\Organization; use Doctrine\ORM\Mapping as ORM; +use InvalidArgumentException; /** * @ORM\Entity + * * @ORM\Table( * name="organization_invitation", * uniqueConstraints={@ORM\UniqueConstraint(name="email_organization", columns={"email", "organization_id"})} @@ -17,35 +19,29 @@ class Invitation { /** + * @ORM\Column(type="string", length=15) + */ + private string $role; + + public function __construct(/** * @ORM\Id + * * @ORM\Column(type="string", unique=true) */ - private string $token; - - /** + private string $token, /** * @ORM\Column(type="string", length=180) */ - private string $email; - - /** + private string $email, /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization", inversedBy="invitations") + * * @ORM\JoinColumn(nullable=false) */ - private Organization $organization; - - /** - * @ORM\Column(type="string", length=15) - */ - private string $role; - - public function __construct(string $token, string $email, Organization $organization, string $role) + private Organization $organization, string $role) { if (!in_array($role, Member::availableRoles(), true)) { - throw new \InvalidArgumentException(sprintf('Unsupported role: %s', $role)); + throw new InvalidArgumentException(sprintf('Unsupported role: %s', $role)); } - $this->token = $token; - $this->email = $email; - $this->organization = $organization; + $this->role = $role; } diff --git a/src/Entity/Organization/Member.php b/src/Entity/Organization/Member.php index 33017e3b..7222bd2d 100644 --- a/src/Entity/Organization/Member.php +++ b/src/Entity/Organization/Member.php @@ -7,10 +7,12 @@ use Buddy\Repman\Entity\Organization; use Buddy\Repman\Entity\User; use Doctrine\ORM\Mapping as ORM; +use InvalidArgumentException; use Ramsey\Uuid\UuidInterface; /** * @ORM\Entity + * * @ORM\Table( * name="organization_member", * uniqueConstraints={@ORM\UniqueConstraint(name="user_organization", columns={"user_id", "organization_id"})} @@ -19,47 +21,42 @@ class Member { public const ROLE_OWNER = 'owner'; + public const ROLE_MEMBER = 'member'; /** + * @ORM\Column(type="string", length=15) + */ + private string $role; + + public function __construct(/** * @ORM\Id + * * @ORM\Column(type="uuid", unique=true) */ - private UuidInterface $id; - - /** + private UuidInterface $id, /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\User", inversedBy="memberships") + * * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ - private User $user; - - /** + private User $user, /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization", inversedBy="members") + * * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ - private Organization $organization; - - /** - * @ORM\Column(type="string", length=15) - */ - private string $role; - - public function __construct(UuidInterface $id, User $user, Organization $organization, string $role) + private Organization $organization, string $role) { if (!in_array($role, self::availableRoles(), true)) { - throw new \InvalidArgumentException(sprintf('Unsupported role: %s', $role)); + throw new InvalidArgumentException(sprintf('Unsupported role: %s', $role)); } - $this->id = $id; - $this->user = $user; - $this->organization = $organization; $this->role = $role; } public function changeRole(string $role): void { if (!in_array($role, self::availableRoles(), true)) { - throw new \InvalidArgumentException(sprintf('Unsupported role: %s', $role)); + throw new InvalidArgumentException(sprintf('Unsupported role: %s', $role)); } $this->role = $role; diff --git a/src/Entity/Organization/Package.php b/src/Entity/Organization/Package.php index 3515e345..946d7c47 100644 --- a/src/Entity/Organization/Package.php +++ b/src/Entity/Organization/Package.php @@ -8,13 +8,17 @@ use Buddy\Repman\Entity\Organization\Package\Link; use Buddy\Repman\Entity\Organization\Package\Version; use Buddy\Repman\Entity\User\OAuthToken; +use DateTimeImmutable; +use DateTimeInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Ramsey\Uuid\UuidInterface; +use RuntimeException; /** * @ORM\Entity + * * @ORM\Table( * name="organization_package", * uniqueConstraints={@ORM\UniqueConstraint(name="package_name", columns={"organization_id", "name"})} @@ -24,12 +28,6 @@ class Package { public const NAME_PATTERN = '/^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9]([_.-]?[a-z0-9]+)*$/'; - /** - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) - */ - private UuidInterface $id; - /** * @ORM\Column(type="string", length=255, nullable=true) */ @@ -48,20 +46,11 @@ class Package /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $latestReleaseDate = null; - - /** - * @ORM\Column(type="text") - */ - private string $repositoryUrl; - - /** - * @ORM\Column(type="string") - */ - private string $type; + private ?DateTimeImmutable $latestReleaseDate = null; /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization", inversedBy="packages") + * * @ORM\JoinColumn(nullable=false) */ private Organization $organization; @@ -69,12 +58,12 @@ class Package /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeInterface $lastSyncAt; + private ?DateTimeInterface $lastSyncAt = null; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $webhookCreatedAt = null; + private ?DateTimeImmutable $webhookCreatedAt = null; /** * @ORM\Column(type="string", nullable=true) @@ -86,13 +75,6 @@ class Package */ private ?string $lastSyncError = null; - /** - * @ORM\Column(type="json") - * - * @var mixed[] - */ - private array $metadata; - /** * @ORM\Column(type="text", nullable=true) */ @@ -113,30 +95,22 @@ class Package /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $lastScanDate = null; + private ?DateTimeImmutable $lastScanDate = null; /** * @var Collection|Version[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Package\Version", mappedBy="package", cascade={"persist"}, orphanRemoval=true) */ private Collection $versions; /** * @var Collection|Link[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Package\Link", mappedBy="package", cascade={"persist"}, orphanRemoval=true) */ private Collection $links; - /** - * @ORM\Column(type="integer") - */ - private int $keepLastReleases = 0; - - /** - * @ORM\Column(type="boolean", options={"default":"true"}) - */ - private bool $enableSecurityScan = true; - /** * @ORM\Column(type="text", nullable=true) */ @@ -145,14 +119,28 @@ class Package /** * @param mixed[] $metadata */ - public function __construct(UuidInterface $id, string $type, string $url, array $metadata = [], int $keepLastReleases = 0, bool $enableSecurityScan = true) + public function __construct(/** + * @ORM\Id + * + * @ORM\Column(type="uuid", unique=true) + */ + private UuidInterface $id, /** + * @ORM\Column(type="string") + */ + private string $type, /** + * @ORM\Column(type="text") + */ + private string $repositoryUrl, /** + * @ORM\Column(type="json") + */ + private array $metadata = [], /** + * @ORM\Column(type="integer") + */ + private int $keepLastReleases = 0, /** + * @ORM\Column(type="boolean", options={"default":"true"}) + */ + private bool $enableSecurityScan = true) { - $this->id = $id; - $this->type = $type; - $this->repositoryUrl = $url; - $this->metadata = $metadata; - $this->keepLastReleases = $keepLastReleases; - $this->enableSecurityScan = $enableSecurityScan; $this->versions = new ArrayCollection(); $this->links = new ArrayCollection(); } @@ -165,8 +153,9 @@ public function id(): UuidInterface public function setOrganization(Organization $organization): void { if (isset($this->organization)) { - throw new \RuntimeException('You can not change package organization'); + throw new RuntimeException('You can not change package organization'); } + $this->organization = $organization; } @@ -184,7 +173,7 @@ public function repositoryUrl(): string * @param array $encounteredVersions * @param array $encounteredLinks */ - public function syncSuccess(string $name, string $description, string $latestReleasedVersion, array $encounteredVersions, array $encounteredLinks, \DateTimeImmutable $latestReleaseDate): void + public function syncSuccess(string $name, string $description, string $latestReleasedVersion, array $encounteredVersions, array $encounteredLinks, DateTimeImmutable $latestReleaseDate): void { $this->setName($name); $this->description = $description; @@ -211,13 +200,14 @@ public function syncSuccess(string $name, string $description, string $latestRel $this->links->remove($key); } - $this->lastSyncAt = new \DateTimeImmutable(); + + $this->lastSyncAt = new DateTimeImmutable(); $this->lastSyncError = null; } public function syncFailure(string $error): void { - $this->lastSyncAt = new \DateTimeImmutable(); + $this->lastSyncAt = new DateTimeImmutable(); $this->lastSyncError = $error; } @@ -249,8 +239,8 @@ public function isSynchronizedSuccessfully(): bool public function oauthToken(): OAuthToken { $token = $this->organization->oauthToken(str_replace('-oauth', '', $this->type)); - if ($token === null) { - throw new \RuntimeException('Oauth token not found'); + if (!$token instanceof OAuthToken) { + throw new RuntimeException('Oauth token not found'); } return $token; @@ -258,12 +248,12 @@ public function oauthToken(): OAuthToken public function hasOAuthToken(): bool { - return strpos($this->type, 'oauth') !== false; + return str_contains($this->type, 'oauth'); } public function webhookWasCreated(): void { - $this->webhookCreatedAt = new \DateTimeImmutable(); + $this->webhookCreatedAt = new DateTimeImmutable(); $this->webhookCreatedError = null; } @@ -294,7 +284,7 @@ public function scanResultEmails(): array public function metadata(string $key) { if (!isset($this->metadata[$key])) { - throw new \RuntimeException(sprintf('Metadata %s not found for project %s', $key, $this->id->toString())); + throw new RuntimeException(sprintf('Metadata %s not found for project %s', $key, $this->id->toString())); } return $this->metadata[$key]; @@ -318,7 +308,7 @@ public function latestReleasedVersion(): ?string /** * @param mixed[] $result */ - public function setScanResult(string $status, \DateTimeImmutable $date, array $result): void + public function setScanResult(string $status, DateTimeImmutable $date, array $result): void { $this->lastScanDate = $date; $this->lastScanStatus = $status; @@ -328,7 +318,7 @@ public function setScanResult(string $status, \DateTimeImmutable $date, array $r private function setName(string $name): void { if (preg_match(self::NAME_PATTERN, $name, $matches) !== 1) { - throw new \RuntimeException("Package name {$name} is invalid"); + throw new RuntimeException(sprintf('Package name %s is invalid', $name)); } $this->name = $name; diff --git a/src/Entity/Organization/Package/Download.php b/src/Entity/Organization/Package/Download.php index f663d45c..129bcb3b 100644 --- a/src/Entity/Organization/Package/Download.php +++ b/src/Entity/Organization/Package/Download.php @@ -4,15 +4,18 @@ namespace Buddy\Repman\Entity\Organization\Package; +use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\Index; use Ramsey\Uuid\UuidInterface; /** * @ORM\Entity + * * @ORM\Table( * name="organization_package_download", * indexes={ + * * @Index(name="package_id_idx", columns={"package_id"}), * @Index(name="download_date_idx", columns={"date"}), * @Index(name="download_version_idx", columns={"version"}) @@ -21,50 +24,33 @@ */ class Download { - /** - * @ORM\Id() - * @ORM\Column(type="uuid") - */ - private UuidInterface $id; - - /** - * @ORM\Column(type="uuid") - */ - private UuidInterface $packageId; - - /** - * @ORM\Column(type="date_immutable") - */ - private \DateTimeImmutable $date; - - /** - * @ORM\Column(type="string") - */ - private string $version; - - /** - * @ORM\Column(type="string", length=45, nullable=true) - */ - private ?string $ip; - - /** - * @ORM\Column(type="string", nullable=true) - */ - private ?string $userAgent; - public function __construct( - UuidInterface $id, - UuidInterface $packageId, - \DateTimeImmutable $date, - string $version, - ?string $ip = null, - ?string $userAgent = null + /** + * @ORM\Id() + * + * @ORM\Column(type="uuid") + */ + private UuidInterface $id, + /** + * @ORM\Column(type="uuid") + */ + private UuidInterface $packageId, + /** + * @ORM\Column(type="date_immutable") + */ + private DateTimeImmutable $date, + /** + * @ORM\Column(type="string") + */ + private string $version, + /** + * @ORM\Column(type="string", length=45, nullable=true) + */ + private ?string $ip = null, + /** + * @ORM\Column(type="string", nullable=true) + */ + private ?string $userAgent = null, ) { - $this->id = $id; - $this->packageId = $packageId; - $this->date = $date; - $this->version = $version; - $this->ip = $ip; - $this->userAgent = $userAgent; } } diff --git a/src/Entity/Organization/Package/Link.php b/src/Entity/Organization/Package/Link.php index bff6f519..c7c4b046 100644 --- a/src/Entity/Organization/Package/Link.php +++ b/src/Entity/Organization/Package/Link.php @@ -4,16 +4,17 @@ namespace Buddy\Repman\Entity\Organization\Package; -use Buddy\Repman\Entity\Organization; use Buddy\Repman\Entity\Organization\Package; use Doctrine\ORM\Mapping as ORM; use Ramsey\Uuid\UuidInterface; /** * @ORM\Entity + * * @ORM\Table( * name="organization_package_link", * indexes={ + * * @ORM\Index(name="link_package_id_idx", columns={"package_id"}), * @ORM\Index(name="link_target_idx", columns={"target"}), * } @@ -21,45 +22,32 @@ */ class Link { - /** - * @ORM\Id() - * @ORM\Column(type="uuid") - */ - private UuidInterface $id; - - /** - * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization\Package", inversedBy="links") - * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") - */ - private Package $package; - - /** - * @ORM\Column(type="string") - */ - private string $type; - - /** - * @ORM\Column(type="string") - */ - private string $target; - - /** - * @ORM\Column(name="`constraint`",type="string") - */ - private string $constraint; - public function __construct( - UuidInterface $id, - Package $package, - string $type, - string $target, - string $constraint + /** + * @ORM\Id() + * + * @ORM\Column(type="uuid") + */ + private UuidInterface $id, + /** + * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization\Package", inversedBy="links") + * + * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") + */ + private Package $package, + /** + * @ORM\Column(type="string") + */ + private string $type, + /** + * @ORM\Column(type="string") + */ + private string $target, + /** + * @ORM\Column(name="`constraint`",type="string") + */ + private string $constraint, ) { - $this->id = $id; - $this->package = $package; - $this->type = $type; - $this->target = $target; - $this->constraint = $constraint; } public function type(): string diff --git a/src/Entity/Organization/Package/Metadata.php b/src/Entity/Organization/Package/Metadata.php index f859cb63..db2f8709 100644 --- a/src/Entity/Organization/Package/Metadata.php +++ b/src/Entity/Organization/Package/Metadata.php @@ -7,6 +7,8 @@ final class Metadata { public const GITLAB_PROJECT_ID = 'gitLabProjectId'; + public const GITHUB_REPO_NAME = 'gitHubRepoName'; + public const BITBUCKET_REPO_NAME = 'bitbucketRepoName'; } diff --git a/src/Entity/Organization/Package/ScanResult.php b/src/Entity/Organization/Package/ScanResult.php index 638cc6e3..1193191c 100644 --- a/src/Entity/Organization/Package/ScanResult.php +++ b/src/Entity/Organization/Package/ScanResult.php @@ -5,15 +5,18 @@ namespace Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\Organization\Package; +use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\Index; use Ramsey\Uuid\UuidInterface; /** * @ORM\Entity(repositoryClass="Buddy\Repman\Repository\ScanResultRepository") + * * @ORM\Table( * name="organization_package_scan_result", * indexes={ + * * @Index(name="date_idx", columns={"date"}) * } * ) @@ -21,54 +24,44 @@ class ScanResult { public const STATUS_PENDING = 'pending'; + public const STATUS_OK = 'ok'; + public const STATUS_WARNING = 'warning'; + public const STATUS_ERROR = 'error'; + public const STATUS_NOT_AVAILABLE = 'n/a'; /** - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) + * @ORM\Column(type="string", length=255) */ - private UuidInterface $id; + private string $version; /** + * @param array|string> $content + */ + public function __construct(/** + * @ORM\Id + * + * @ORM\Column(type="uuid", unique=true) + */ + private UuidInterface $id, /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization\Package") + * * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ - private Package $package; - - /** + private Package $package, /** * @ORM\Column(type="datetime_immutable") */ - private \DateTimeImmutable $date; - - /** + private DateTimeImmutable $date, /** * @ORM\Column(type="string", length=7) */ - private string $status; - - /** - * @ORM\Column(type="string", length=255) - */ - private string $version; - - /** - * @var array|string> + private string $status, /** * @ORM\Column(type="json") */ - private array $content = []; - - /** - * @param array|string> $content - */ - public function __construct(UuidInterface $id, Package $package, \DateTimeImmutable $date, string $status, array $content) + private array $content) { - $this->id = $id; - $this->package = $package; - $this->date = $date; - $this->status = $status; $this->version = (string) $this->package->latestReleasedVersion(); - $this->content = $content; } } diff --git a/src/Entity/Organization/Package/Version.php b/src/Entity/Organization/Package/Version.php index 6dbc8ca5..047bf49f 100644 --- a/src/Entity/Organization/Package/Version.php +++ b/src/Entity/Organization/Package/Version.php @@ -5,15 +5,19 @@ namespace Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\Organization\Package; +use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Ramsey\Uuid\UuidInterface; +use RuntimeException; /** * @ORM\Entity + * * @ORM\Table( * name="organization_package_version", * uniqueConstraints={@ORM\UniqueConstraint(name="package_version", columns={"package_id", "version"})}, * indexes={ + * * @ORM\Index(name="version_package_id_idx", columns={"package_id"}), * @ORM\Index(name="version_date_idx", columns={"date"}) * } @@ -23,59 +27,43 @@ class Version { public const STABILITY_STABLE = 'stable'; - /** - * @ORM\Id() - * @ORM\Column(type="uuid") - */ - private UuidInterface $id; - /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization\Package", inversedBy="versions") + * * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ private Package $package; - /** - * @ORM\Column(type="string") - */ - private string $version; - - /** - * @ORM\Column(type="string") - */ - private string $reference; - - /** - * @ORM\Column(type="integer") - */ - private int $size; - - /** - * @ORM\Column(type="datetime_immutable") - */ - private \DateTimeImmutable $date; - - /** - * @ORM\Column(type="string") - * - * (dev, alpha, beta, RC, stable) - */ - private string $stability; - public function __construct( - UuidInterface $id, - string $version, - string $reference, - int $size, - \DateTimeImmutable $date, - string $stability + /** + * @ORM\Id() + * + * @ORM\Column(type="uuid") + */ + private UuidInterface $id, + /** + * @ORM\Column(type="string") + */ + private string $version, + /** + * @ORM\Column(type="string") + */ + private string $reference, + /** + * @ORM\Column(type="integer") + */ + private int $size, + /** + * @ORM\Column(type="datetime_immutable") + */ + private DateTimeImmutable $date, + /** + * @ORM\Column(type="string") + * + * (dev, alpha, beta, RC, stable) + */ + private string $stability, ) { - $this->id = $id; - $this->version = $version; - $this->reference = $reference; - $this->size = $size; - $this->date = $date; - $this->stability = $stability; } public function id(): UuidInterface @@ -98,7 +86,7 @@ public function size(): int return $this->size; } - public function date(): \DateTimeImmutable + public function date(): DateTimeImmutable { return $this->date; } @@ -113,7 +101,7 @@ public function setSize(int $size): void $this->size = $size; } - public function setDate(\DateTimeImmutable $date): void + public function setDate(DateTimeImmutable $date): void { $this->date = $date; } @@ -121,8 +109,9 @@ public function setDate(\DateTimeImmutable $date): void public function setPackage(Package $package): void { if (isset($this->package)) { - throw new \RuntimeException('You can not change version package'); + throw new RuntimeException('You can not change version package'); } + $this->package = $package; } } diff --git a/src/Entity/Organization/Token.php b/src/Entity/Organization/Token.php index beea8fdb..0fd503d7 100644 --- a/src/Entity/Organization/Token.php +++ b/src/Entity/Organization/Token.php @@ -5,27 +5,20 @@ namespace Buddy\Repman\Entity\Organization; use Buddy\Repman\Entity\Organization; +use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; +use RuntimeException; /** * @ORM\Entity + * * @ORM\Table(name="organization_token") */ class Token { - /** - * @ORM\Id - * @ORM\Column(type="string", length=64, unique=true) - */ - private string $value; - - /** - * @ORM\Column(type="string") - */ - private string $name; - /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\Organization", inversedBy="tokens") + * * @ORM\JoinColumn(nullable=false) */ private Organization $organization; @@ -33,25 +26,32 @@ class Token /** * @ORM\Column(type="datetime_immutable") */ - private \DateTimeImmutable $createdAt; + private DateTimeImmutable $createdAt; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $lastUsedAt = null; + private ?DateTimeImmutable $lastUsedAt = null; - public function __construct(string $value, string $name) + public function __construct(/** + * @ORM\Id + * + * @ORM\Column(type="string", length=64, unique=true) + */ + private string $value, /** + * @ORM\Column(type="string") + */ + private string $name) { - $this->value = $value; - $this->name = $name; - $this->createdAt = new \DateTimeImmutable(); + $this->createdAt = new DateTimeImmutable(); } public function setOrganization(Organization $organization): void { if (isset($this->organization)) { - throw new \RuntimeException('You can not change token organization'); + throw new RuntimeException('You can not change token organization'); } + $this->organization = $organization; } diff --git a/src/Entity/User.php b/src/Entity/User.php index bef0c020..4c066c13 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -7,14 +7,17 @@ use Buddy\Repman\Entity\Organization\Member; use Buddy\Repman\Entity\User\ApiToken; use Buddy\Repman\Entity\User\OAuthToken; +use DateTimeImmutable; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use Ramsey\Uuid\Uuid; +use InvalidArgumentException; use Ramsey\Uuid\UuidInterface; +use function mb_strtolower; /** * @ORM\Entity(repositoryClass="Buddy\Repman\Repository\UserRepository") + * * @ORM\Table(name="`user`") */ class User @@ -23,12 +26,6 @@ class User public const STATUS_DISABLED = 'disabled'; - /** - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) - */ - private UuidInterface $id; - /** * @ORM\Column(type="string", length=180, unique=true) */ @@ -37,16 +34,18 @@ class User /** * @ORM\Column(type="datetime_immutable") */ - private \DateTimeImmutable $createdAt; + private DateTimeImmutable $createdAt; /** * @var array + * * @ORM\Column(type="json") */ private array $roles = []; /** * @var string The hashed password + * * @ORM\Column(type="string") */ private string $password; @@ -54,12 +53,7 @@ class User /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $emailConfirmedAt = null; - - /** - * @ORM\Column(type="string", unique=true) - */ - private string $emailConfirmToken; + private ?DateTimeImmutable $emailConfirmedAt = null; /** * @ORM\Column(type="string", nullable=true, unique=true) @@ -69,10 +63,11 @@ class User /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $resetPasswordTokenCreatedAt = null; + private ?DateTimeImmutable $resetPasswordTokenCreatedAt = null; /** * @var Collection|Member[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\Organization\Member", mappedBy="user", orphanRemoval=true) */ private Collection $memberships; @@ -84,6 +79,7 @@ class User /** * @var Collection|OAuthToken[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\User\OAuthToken", mappedBy="user", orphanRemoval=true, cascade={"persist"}) */ private Collection $oauthTokens; @@ -95,6 +91,7 @@ class User /** * @var Collection|ApiToken[] + * * @ORM\OneToMany(targetEntity="Buddy\Repman\Entity\User\ApiToken", mappedBy="user", cascade={"persist"}, orphanRemoval=true) */ private Collection $apiTokens; @@ -107,14 +104,20 @@ class User /** * @param array $roles */ - public function __construct(UuidInterface $id, string $email, string $emailConfirmToken, array $roles, ?string $timezone = null) + public function __construct(/** + * @ORM\Id + * + * @ORM\Column(type="uuid", unique=true) + */ + private UuidInterface $id, string $email, /** + * @ORM\Column(type="string", unique=true) + */ + private string $emailConfirmToken, array $roles, ?string $timezone = null) { - $this->id = $id; - $this->email = \mb_strtolower($email); - $this->emailConfirmToken = $emailConfirmToken; + $this->email = mb_strtolower($email); $this->roles = array_values(array_unique($roles)); $this->timezone = $timezone ?? date_default_timezone_get(); - $this->createdAt = new \DateTimeImmutable(); + $this->createdAt = new DateTimeImmutable(); $this->memberships = new ArrayCollection(); $this->oauthTokens = new ArrayCollection(); $this->apiTokens = new ArrayCollection(); @@ -123,17 +126,17 @@ public function __construct(UuidInterface $id, string $email, string $emailConfi public function setResetPasswordToken(string $token): void { $this->resetPasswordToken = $token; - $this->resetPasswordTokenCreatedAt = new \DateTimeImmutable(); + $this->resetPasswordTokenCreatedAt = new DateTimeImmutable(); } public function resetPassword(string $token, string $password, int $tokenTtl): void { if ($token !== $this->resetPasswordToken) { - throw new \InvalidArgumentException('Invalid reset password token'); + throw new InvalidArgumentException('Invalid reset password token'); } - if ($this->resetPasswordTokenCreatedAt === null || $this->resetPasswordTokenCreatedAt->modify(sprintf('%s sec', $tokenTtl)) < new \DateTimeImmutable()) { - throw new \InvalidArgumentException('Token expired'); + if (!$this->resetPasswordTokenCreatedAt instanceof DateTimeImmutable || $this->resetPasswordTokenCreatedAt->modify(sprintf('%s sec', $tokenTtl)) < new DateTimeImmutable()) { + throw new InvalidArgumentException('Token expired'); } $this->password = $password; @@ -143,18 +146,18 @@ public function resetPassword(string $token, string $password, int $tokenTtl): v public function confirmEmail(string $token): void { - if ($this->emailConfirmedAt !== null) { + if ($this->emailConfirmedAt instanceof DateTimeImmutable) { return; } if ($token !== $this->emailConfirmToken) { - throw new \InvalidArgumentException('Invalid confirm e-mail token'); + throw new InvalidArgumentException('Invalid confirm e-mail token'); } - $this->emailConfirmedAt = new \DateTimeImmutable(); + $this->emailConfirmedAt = new DateTimeImmutable(); } - public function emailConfirmedAt(): ?\DateTimeImmutable + public function emailConfirmedAt(): ?DateTimeImmutable { return $this->emailConfirmedAt; } @@ -255,7 +258,7 @@ public function emailScanResult(): bool public function hasEmailConfirmed(): bool { - return $this->emailConfirmedAt !== null; + return $this->emailConfirmedAt instanceof DateTimeImmutable; } public function setEmailScanResult(bool $emailScanResult): void diff --git a/src/Entity/User/ApiToken.php b/src/Entity/User/ApiToken.php index 33105bdd..ce1a0825 100644 --- a/src/Entity/User/ApiToken.php +++ b/src/Entity/User/ApiToken.php @@ -5,27 +5,19 @@ namespace Buddy\Repman\Entity\User; use Buddy\Repman\Entity\User; +use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity + * * @ORM\Table(name="user_api_token") */ class ApiToken { - /** - * @ORM\Id - * @ORM\Column(type="string", length=64, unique=true) - */ - private string $value; - - /** - * @ORM\Column(type="string") - */ - private string $name; - /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\User", inversedBy="apiTokens") + * * @ORM\JoinColumn(nullable=false) */ private User $user; @@ -33,18 +25,24 @@ class ApiToken /** * @ORM\Column(type="datetime_immutable") */ - private \DateTimeImmutable $createdAt; + private DateTimeImmutable $createdAt; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ - private ?\DateTimeImmutable $lastUsedAt = null; + private ?DateTimeImmutable $lastUsedAt = null; - public function __construct(string $value, string $name) + public function __construct(/** + * @ORM\Id + * + * @ORM\Column(type="string", length=64, unique=true) + */ + private string $value, /** + * @ORM\Column(type="string") + */ + private string $name) { - $this->value = $value; - $this->name = $name; - $this->createdAt = new \DateTimeImmutable(); + $this->createdAt = new DateTimeImmutable(); } public function setUser(User $user): void diff --git a/src/Entity/User/OAuthToken.php b/src/Entity/User/OAuthToken.php index 659d533f..2e0832aa 100644 --- a/src/Entity/User/OAuthToken.php +++ b/src/Entity/User/OAuthToken.php @@ -6,12 +6,17 @@ use Buddy\Repman\Entity\User; use Buddy\Repman\Service\User\UserOAuthTokenRefresher; +use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\UniqueConstraint; +use LogicException; use Ramsey\Uuid\UuidInterface; +use RuntimeException; +use Throwable; /** * @ORM\Entity + * * @ORM\Table( * name="user_oauth_token", * uniqueConstraints={@UniqueConstraint(name="token_type", columns={"type", "user_id"})} @@ -20,17 +25,14 @@ class OAuthToken { public const TYPE_GITHUB = 'github'; + public const TYPE_GITLAB = 'gitlab'; - public const TYPE_BITBUCKET = 'bitbucket'; - /** - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) - */ - private UuidInterface $id; + public const TYPE_BITBUCKET = 'bitbucket'; /** * @ORM\ManyToOne(targetEntity="Buddy\Repman\Entity\User", inversedBy="oauthTokens") + * * @ORM\JoinColumn(nullable=false) */ private User $user; @@ -38,43 +40,35 @@ class OAuthToken /** * @ORM\Column(type="datetime_immutable") */ - private \DateTimeImmutable $createdAt; - - /** - * @ORM\Column(type="string", length=9) - */ - private string $type; - - /** - * @ORM\Column(type="string", length=255) - */ - private string $accessToken; - - /** - * @ORM\Column(type="string", length=255, nullable=true) - */ - private ?string $refreshToken = null; - - /** - * @ORM\Column(type="datetime_immutable", nullable=true) - */ - private ?\DateTimeImmutable $expiresAt = null; + private DateTimeImmutable $createdAt; public function __construct( - UuidInterface $id, + /** + * @ORM\Id + * + * @ORM\Column(type="uuid", unique=true) + */ + private UuidInterface $id, User $user, - string $type, - string $accessToken, - ?string $refreshToken = null, - ?\DateTimeImmutable $expiresAt = null + /** + * @ORM\Column(type="string", length=9) + */ + private string $type, + /** + * @ORM\Column(type="string", length=255) + */ + private string $accessToken, + /** + * @ORM\Column(type="string", length=255, nullable=true) + */ + private ?string $refreshToken = null, + /** + * @ORM\Column(type="datetime_immutable", nullable=true) + */ + private ?DateTimeImmutable $expiresAt = null, ) { - $this->id = $id; $this->user = $user->addOAuthToken($this); - $this->type = $type; - $this->accessToken = $accessToken; - $this->refreshToken = $refreshToken; - $this->expiresAt = $expiresAt; - $this->createdAt = new \DateTimeImmutable(); + $this->createdAt = new DateTimeImmutable(); } public function type(): string @@ -89,17 +83,17 @@ public function isType(string $type): bool public function accessToken(UserOAuthTokenRefresher $tokenRefresher): string { - if ($this->expiresAt !== null && (new \DateTimeImmutable()) > $this->expiresAt->modify('-1 min')) { + if ($this->expiresAt instanceof DateTimeImmutable && (new DateTimeImmutable()) > $this->expiresAt->modify('-1 min')) { if ($this->refreshToken === null) { - throw new \LogicException('Unable to refresh access token without refresh token'); + throw new LogicException('Unable to refresh access token without refresh token'); } try { $newToken = $tokenRefresher->refresh($this->type, $this->refreshToken); $this->accessToken = $newToken->token(); $this->expiresAt = $newToken->expiresAt(); - } catch (\Throwable $exception) { - throw new \RuntimeException('An error occurred while refreshing the access token: '.$exception->getMessage()); + } catch (Throwable $exception) { + throw new RuntimeException('An error occurred while refreshing the access token: '.$exception->getMessage(), $exception->getCode(), $exception); } } diff --git a/src/Form/Type/Admin/ConfigType.php b/src/Form/Type/Admin/ConfigType.php index fb12c4f1..5e8da372 100644 --- a/src/Form/Type/Admin/ConfigType.php +++ b/src/Form/Type/Admin/ConfigType.php @@ -15,11 +15,8 @@ class ConfigType extends AbstractType { - private Telemetry $telemetry; - - public function __construct(Telemetry $telemetry) + public function __construct(private readonly Telemetry $telemetry) { - $this->telemetry = $telemetry; } public function getBlockPrefix(): string @@ -61,7 +58,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void Config::TELEMETRY_ENABLED => Config::TELEMETRY_ENABLED, Config::TELEMETRY_DISABLED => Config::TELEMETRY_DISABLED, ], - 'help' => "Enable collecting and sending anonymous usage data (telemetry->docsUrl()}\" target=\"_blank\" rel=\"noopener noreferrer\">more info)", + 'help' => sprintf('Enable collecting and sending anonymous usage data (more info)', $this->telemetry->docsUrl()), 'attr' => [ 'class' => 'form-control selectpicker', 'data-style' => 'btn-secondary', diff --git a/src/Form/Type/Api/AddPackageType.php b/src/Form/Type/Api/AddPackageType.php index 6cc2b8b9..57a12326 100644 --- a/src/Form/Type/Api/AddPackageType.php +++ b/src/Form/Type/Api/AddPackageType.php @@ -14,17 +14,11 @@ class AddPackageType extends AbstractType { - /** - * @var string[] - */ - private array $allowedTypes; - /** * @param string[] $allowedTypes */ - public function __construct(array $allowedTypes = []) + public function __construct(private readonly array $allowedTypes = []) { - $this->allowedTypes = $allowedTypes; } public function getBlockPrefix(): string diff --git a/src/Form/Type/Organization/AddPackageType.php b/src/Form/Type/Organization/AddPackageType.php index f226a834..f4c6d04d 100644 --- a/src/Form/Type/Organization/AddPackageType.php +++ b/src/Form/Type/Organization/AddPackageType.php @@ -15,17 +15,11 @@ class AddPackageType extends AbstractType { - /** - * @var string[] - */ - private array $allowedTypes; - /** * @param string[] $allowedTypes */ - public function __construct(array $allowedTypes = []) + public function __construct(private readonly array $allowedTypes = []) { - $this->allowedTypes = $allowedTypes; } public function getBlockPrefix(): string diff --git a/src/Form/Type/User/ChangePasswordType.php b/src/Form/Type/User/ChangePasswordType.php index a3e42025..b4e2df59 100644 --- a/src/Form/Type/User/ChangePasswordType.php +++ b/src/Form/Type/User/ChangePasswordType.php @@ -35,7 +35,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'type' => PasswordType::class, 'invalid_message' => 'The password fields must match', 'first_options' => ['label' => 'New password'], - 'second_options' => ['label' => 'Repeat new password', 'help' => 'Make sure it\'s at least 6 characters'], + 'second_options' => ['label' => 'Repeat new password', 'help' => "Make sure it's at least 6 characters"], 'constraints' => [ new NotBlank([ 'message' => 'Please enter a password', diff --git a/src/Kernel.php b/src/Kernel.php index 22ee58f9..51b4892e 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -10,24 +10,28 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; +use function dirname; +use const PHP_VERSION_ID; class Kernel extends BaseKernel { use MicroKernelTrait; public const REPMAN_VERSION = '1.3.4'; + private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; public function getProjectDir(): string { - return \dirname(__DIR__); + return dirname(__DIR__); } protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); - $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug); + $container->setParameter('container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug); $container->setParameter('container.dumper.inline_factories', true); + $confDir = $this->getProjectDir().'/config'; $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); diff --git a/src/Message/Admin/AddTechnicalEmail.php b/src/Message/Admin/AddTechnicalEmail.php index 96ae214f..b687ab00 100644 --- a/src/Message/Admin/AddTechnicalEmail.php +++ b/src/Message/Admin/AddTechnicalEmail.php @@ -6,11 +6,8 @@ final class AddTechnicalEmail { - private string $email; - - public function __construct(string $email) + public function __construct(private readonly string $email) { - $this->email = $email; } public function email(): string diff --git a/src/Message/Admin/ChangeConfig.php b/src/Message/Admin/ChangeConfig.php index a636a96f..aa82d640 100644 --- a/src/Message/Admin/ChangeConfig.php +++ b/src/Message/Admin/ChangeConfig.php @@ -6,17 +6,11 @@ final class ChangeConfig { - /** - * @var array - */ - private array $values; - /** * @param array $values */ - public function __construct(array $values) + public function __construct(private readonly array $values) { - $this->values = $values; } /** diff --git a/src/Message/Admin/RemoveTechnicalEmail.php b/src/Message/Admin/RemoveTechnicalEmail.php index cedad558..e7073ce5 100644 --- a/src/Message/Admin/RemoveTechnicalEmail.php +++ b/src/Message/Admin/RemoveTechnicalEmail.php @@ -6,11 +6,8 @@ final class RemoveTechnicalEmail { - private string $email; - - public function __construct(string $email) + public function __construct(private readonly string $email) { - $this->email = $email; } public function email(): string diff --git a/src/Message/Organization/AddDownload.php b/src/Message/Organization/AddDownload.php index 6098811e..035c0996 100644 --- a/src/Message/Organization/AddDownload.php +++ b/src/Message/Organization/AddDownload.php @@ -4,21 +4,12 @@ namespace Buddy\Repman\Message\Organization; +use DateTimeImmutable; + final class AddDownload { - private string $packageId; - private string $version; - private \DateTimeImmutable $date; - private ?string $ip; - private ?string $userAgent; - - public function __construct(string $packageId, string $version, \DateTimeImmutable $date, ?string $ip, ?string $userAgent) + public function __construct(private readonly string $packageId, private readonly string $version, private readonly DateTimeImmutable $date, private readonly ?string $ip, private readonly ?string $userAgent) { - $this->packageId = $packageId; - $this->version = $version; - $this->date = $date; - $this->ip = $ip; - $this->userAgent = $userAgent; } public function packageId(): string @@ -31,7 +22,7 @@ public function version(): string return $this->version; } - public function date(): \DateTimeImmutable + public function date(): DateTimeImmutable { return $this->date; } diff --git a/src/Message/Organization/AddPackage.php b/src/Message/Organization/AddPackage.php index 6e44afb7..2da027ad 100644 --- a/src/Message/Organization/AddPackage.php +++ b/src/Message/Organization/AddPackage.php @@ -6,27 +6,13 @@ final class AddPackage { - private string $id; - private string $url; - private string $type; - private string $organizationId; - private int $keepLastReleases; - - /** - * @var mixed[] - */ - private array $metadata; + private readonly int $keepLastReleases; /** * @param mixed[] $metadata */ - public function __construct(string $id, string $organizationId, string $url, string $type = 'vcs', array $metadata = [], ?int $keepLastReleases = null) + public function __construct(private readonly string $id, private readonly string $organizationId, private readonly string $url, private readonly string $type = 'vcs', private readonly array $metadata = [], ?int $keepLastReleases = null) { - $this->id = $id; - $this->organizationId = $organizationId; - $this->url = $url; - $this->type = $type; - $this->metadata = $metadata; $this->keepLastReleases = $keepLastReleases ?? 0; } diff --git a/src/Message/Organization/ChangeAlias.php b/src/Message/Organization/ChangeAlias.php index 93a115f8..f992f044 100644 --- a/src/Message/Organization/ChangeAlias.php +++ b/src/Message/Organization/ChangeAlias.php @@ -6,13 +6,8 @@ final class ChangeAlias { - private string $organizationId; - private string $alias; - - public function __construct(string $organizationId, string $alias) + public function __construct(private readonly string $organizationId, private readonly string $alias) { - $this->organizationId = $organizationId; - $this->alias = $alias; } public function organizationId(): string diff --git a/src/Message/Organization/ChangeAnonymousAccess.php b/src/Message/Organization/ChangeAnonymousAccess.php index 0ab6e890..f93e278c 100644 --- a/src/Message/Organization/ChangeAnonymousAccess.php +++ b/src/Message/Organization/ChangeAnonymousAccess.php @@ -6,13 +6,8 @@ final class ChangeAnonymousAccess { - private string $organizationId; - private bool $hasAnonymousAccess; - - public function __construct(string $organizationId, bool $hasAnonymousAccess) + public function __construct(private readonly string $organizationId, private readonly bool $hasAnonymousAccess) { - $this->organizationId = $organizationId; - $this->hasAnonymousAccess = $hasAnonymousAccess; } public function organizationId(): string diff --git a/src/Message/Organization/ChangeName.php b/src/Message/Organization/ChangeName.php index 64e27fce..f41e434c 100644 --- a/src/Message/Organization/ChangeName.php +++ b/src/Message/Organization/ChangeName.php @@ -6,13 +6,8 @@ final class ChangeName { - private string $organizationId; - private string $name; - - public function __construct(string $organizationId, string $name) + public function __construct(private readonly string $organizationId, private readonly string $name) { - $this->organizationId = $organizationId; - $this->name = $name; } public function organizationId(): string diff --git a/src/Message/Organization/CreateOrganization.php b/src/Message/Organization/CreateOrganization.php index e56ecbf1..ef316739 100644 --- a/src/Message/Organization/CreateOrganization.php +++ b/src/Message/Organization/CreateOrganization.php @@ -6,15 +6,8 @@ final class CreateOrganization { - private string $id; - private string $name; - private string $ownerId; - - public function __construct(string $id, string $ownerId, string $name) + public function __construct(private readonly string $id, private readonly string $ownerId, private readonly string $name) { - $this->id = $id; - $this->ownerId = $ownerId; - $this->name = $name; } public function id(): string diff --git a/src/Message/Organization/GenerateToken.php b/src/Message/Organization/GenerateToken.php index 9a0c907f..f36d02df 100644 --- a/src/Message/Organization/GenerateToken.php +++ b/src/Message/Organization/GenerateToken.php @@ -6,13 +6,8 @@ final class GenerateToken { - private string $organizationId; - private string $name; - - public function __construct(string $organizationId, string $name) + public function __construct(private readonly string $organizationId, private readonly string $name) { - $this->organizationId = $organizationId; - $this->name = $name; } public function organizationId(): string diff --git a/src/Message/Organization/Member/AcceptInvitation.php b/src/Message/Organization/Member/AcceptInvitation.php index 2310ff1b..958cfac2 100644 --- a/src/Message/Organization/Member/AcceptInvitation.php +++ b/src/Message/Organization/Member/AcceptInvitation.php @@ -6,13 +6,8 @@ final class AcceptInvitation { - private string $token; - private string $userId; - - public function __construct(string $token, string $userId) + public function __construct(private readonly string $token, private readonly string $userId) { - $this->token = $token; - $this->userId = $userId; } public function token(): string diff --git a/src/Message/Organization/Member/ChangeRole.php b/src/Message/Organization/Member/ChangeRole.php index 68c536b9..b3dcd82b 100644 --- a/src/Message/Organization/Member/ChangeRole.php +++ b/src/Message/Organization/Member/ChangeRole.php @@ -6,15 +6,8 @@ final class ChangeRole { - private string $organizationId; - private string $userId; - private string $role; - - public function __construct(string $organizationId, string $userId, string $role) + public function __construct(private readonly string $organizationId, private readonly string $userId, private readonly string $role) { - $this->organizationId = $organizationId; - $this->userId = $userId; - $this->role = $role; } public function organizationId(): string diff --git a/src/Message/Organization/Member/InviteUser.php b/src/Message/Organization/Member/InviteUser.php index 223fdd6a..6cfbb7cf 100644 --- a/src/Message/Organization/Member/InviteUser.php +++ b/src/Message/Organization/Member/InviteUser.php @@ -6,17 +6,8 @@ final class InviteUser { - private string $email; - private string $role; - private string $organizationId; - private string $token; - - public function __construct(string $email, string $role, string $organizationId, string $token) + public function __construct(private readonly string $email, private readonly string $role, private readonly string $organizationId, private readonly string $token) { - $this->email = $email; - $this->role = $role; - $this->organizationId = $organizationId; - $this->token = $token; } public function email(): string diff --git a/src/Message/Organization/Member/RemoveInvitation.php b/src/Message/Organization/Member/RemoveInvitation.php index bf3bab3a..88aca3d6 100644 --- a/src/Message/Organization/Member/RemoveInvitation.php +++ b/src/Message/Organization/Member/RemoveInvitation.php @@ -6,13 +6,8 @@ final class RemoveInvitation { - private string $organizationId; - private string $token; - - public function __construct(string $organizationId, string $token) + public function __construct(private readonly string $organizationId, private readonly string $token) { - $this->organizationId = $organizationId; - $this->token = $token; } public function organizationId(): string diff --git a/src/Message/Organization/Member/RemoveMember.php b/src/Message/Organization/Member/RemoveMember.php index 36731361..d68f8681 100644 --- a/src/Message/Organization/Member/RemoveMember.php +++ b/src/Message/Organization/Member/RemoveMember.php @@ -6,13 +6,8 @@ final class RemoveMember { - private string $organizationId; - private string $userId; - - public function __construct(string $organizationId, string $userId) + public function __construct(private readonly string $organizationId, private readonly string $userId) { - $this->organizationId = $organizationId; - $this->userId = $userId; } public function organizationId(): string diff --git a/src/Message/Organization/Package/AddBitbucketHook.php b/src/Message/Organization/Package/AddBitbucketHook.php index c4a11721..089a31ce 100644 --- a/src/Message/Organization/Package/AddBitbucketHook.php +++ b/src/Message/Organization/Package/AddBitbucketHook.php @@ -6,11 +6,8 @@ final class AddBitbucketHook { - private string $packageId; - - public function __construct(string $packageId) + public function __construct(private readonly string $packageId) { - $this->packageId = $packageId; } public function packageId(): string diff --git a/src/Message/Organization/Package/AddGitHubHook.php b/src/Message/Organization/Package/AddGitHubHook.php index 137f4899..1a71f78e 100644 --- a/src/Message/Organization/Package/AddGitHubHook.php +++ b/src/Message/Organization/Package/AddGitHubHook.php @@ -6,11 +6,8 @@ final class AddGitHubHook { - private string $packageId; - - public function __construct(string $packageId) + public function __construct(private readonly string $packageId) { - $this->packageId = $packageId; } public function packageId(): string diff --git a/src/Message/Organization/Package/AddGitLabHook.php b/src/Message/Organization/Package/AddGitLabHook.php index 3e484f17..65b14bf0 100644 --- a/src/Message/Organization/Package/AddGitLabHook.php +++ b/src/Message/Organization/Package/AddGitLabHook.php @@ -6,11 +6,8 @@ final class AddGitLabHook { - private string $packageId; - - public function __construct(string $packageId) + public function __construct(private readonly string $packageId) { - $this->packageId = $packageId; } public function packageId(): string diff --git a/src/Message/Organization/Package/RemoveBitbucketHook.php b/src/Message/Organization/Package/RemoveBitbucketHook.php index 540b1280..c6939fae 100644 --- a/src/Message/Organization/Package/RemoveBitbucketHook.php +++ b/src/Message/Organization/Package/RemoveBitbucketHook.php @@ -6,11 +6,8 @@ final class RemoveBitbucketHook { - private string $packageId; - - public function __construct(string $packageId) + public function __construct(private readonly string $packageId) { - $this->packageId = $packageId; } public function packageId(): string diff --git a/src/Message/Organization/Package/RemoveGitHubHook.php b/src/Message/Organization/Package/RemoveGitHubHook.php index 64d33b44..9e467a4a 100644 --- a/src/Message/Organization/Package/RemoveGitHubHook.php +++ b/src/Message/Organization/Package/RemoveGitHubHook.php @@ -6,11 +6,8 @@ final class RemoveGitHubHook { - private string $packageId; - - public function __construct(string $packageId) + public function __construct(private readonly string $packageId) { - $this->packageId = $packageId; } public function packageId(): string diff --git a/src/Message/Organization/Package/RemoveGitLabHook.php b/src/Message/Organization/Package/RemoveGitLabHook.php index c1aab4a9..0860aa7a 100644 --- a/src/Message/Organization/Package/RemoveGitLabHook.php +++ b/src/Message/Organization/Package/RemoveGitLabHook.php @@ -6,11 +6,8 @@ final class RemoveGitLabHook { - private string $packageId; - - public function __construct(string $packageId) + public function __construct(private readonly string $packageId) { - $this->packageId = $packageId; } public function packageId(): string diff --git a/src/Message/Organization/Package/Update.php b/src/Message/Organization/Package/Update.php index 030abf90..63cea1a1 100644 --- a/src/Message/Organization/Package/Update.php +++ b/src/Message/Organization/Package/Update.php @@ -6,17 +6,8 @@ final class Update { - private string $packageId; - private string $url; - private int $keepLastReleases; - private bool $enableSecurityScan; - - public function __construct(string $packageId, string $url, int $keepLastReleases, bool $enableSecurityScan) + public function __construct(private readonly string $packageId, private readonly string $url, private readonly int $keepLastReleases, private readonly bool $enableSecurityScan) { - $this->packageId = $packageId; - $this->url = $url; - $this->keepLastReleases = $keepLastReleases; - $this->enableSecurityScan = $enableSecurityScan; } public function packageId(): string diff --git a/src/Message/Organization/RegenerateToken.php b/src/Message/Organization/RegenerateToken.php index fad6ecf5..66c92757 100644 --- a/src/Message/Organization/RegenerateToken.php +++ b/src/Message/Organization/RegenerateToken.php @@ -6,13 +6,8 @@ final class RegenerateToken { - private string $organizationId; - private string $token; - - public function __construct(string $organizationId, string $token) + public function __construct(private readonly string $organizationId, private readonly string $token) { - $this->organizationId = $organizationId; - $this->token = $token; } public function organizationId(): string diff --git a/src/Message/Organization/RemoveOrganization.php b/src/Message/Organization/RemoveOrganization.php index 658a4dbf..ea634cd4 100644 --- a/src/Message/Organization/RemoveOrganization.php +++ b/src/Message/Organization/RemoveOrganization.php @@ -6,11 +6,8 @@ final class RemoveOrganization { - private string $id; - - public function __construct(string $id) + public function __construct(private readonly string $id) { - $this->id = $id; } public function id(): string diff --git a/src/Message/Organization/RemovePackage.php b/src/Message/Organization/RemovePackage.php index aaed75aa..2d9d0ea3 100644 --- a/src/Message/Organization/RemovePackage.php +++ b/src/Message/Organization/RemovePackage.php @@ -6,13 +6,8 @@ final class RemovePackage { - private string $id; - private string $organizationId; - - public function __construct(string $id, string $organizationId) + public function __construct(private readonly string $id, private readonly string $organizationId) { - $this->id = $id; - $this->organizationId = $organizationId; } public function id(): string diff --git a/src/Message/Organization/RemoveToken.php b/src/Message/Organization/RemoveToken.php index 47e569e0..a83f4609 100644 --- a/src/Message/Organization/RemoveToken.php +++ b/src/Message/Organization/RemoveToken.php @@ -6,13 +6,8 @@ final class RemoveToken { - private string $organizationId; - private string $token; - - public function __construct(string $organizationId, string $token) + public function __construct(private readonly string $organizationId, private readonly string $token) { - $this->organizationId = $organizationId; - $this->token = $token; } public function organizationId(): string diff --git a/src/Message/Organization/SynchronizePackage.php b/src/Message/Organization/SynchronizePackage.php index 628b16e9..1393a263 100644 --- a/src/Message/Organization/SynchronizePackage.php +++ b/src/Message/Organization/SynchronizePackage.php @@ -6,11 +6,8 @@ final class SynchronizePackage { - private string $id; - - public function __construct(string $id) + public function __construct(private readonly string $id) { - $this->id = $id; } public function id(): string diff --git a/src/Message/Proxy/AddDownloads.php b/src/Message/Proxy/AddDownloads.php index 6604f250..5b63eabc 100644 --- a/src/Message/Proxy/AddDownloads.php +++ b/src/Message/Proxy/AddDownloads.php @@ -5,26 +5,15 @@ namespace Buddy\Repman\Message\Proxy; use Buddy\Repman\Message\Proxy\AddDownloads\Package; +use DateTimeImmutable; final class AddDownloads { - /** - * @var Package[] - */ - private array $packages; - private \DateTimeImmutable $date; - private ?string $ip; - private ?string $userAgent; - /** * @param Package[] $packages */ - public function __construct(array $packages, \DateTimeImmutable $date, ?string $ip, ?string $userAgent) + public function __construct(private readonly array $packages, private readonly DateTimeImmutable $date, private readonly ?string $ip, private readonly ?string $userAgent) { - $this->packages = $packages; - $this->date = $date; - $this->ip = $ip; - $this->userAgent = $userAgent; } /** @@ -35,7 +24,7 @@ public function packages(): array return $this->packages; } - public function date(): \DateTimeImmutable + public function date(): DateTimeImmutable { return $this->date; } diff --git a/src/Message/Proxy/AddDownloads/Package.php b/src/Message/Proxy/AddDownloads/Package.php index 3740017c..6342c464 100644 --- a/src/Message/Proxy/AddDownloads/Package.php +++ b/src/Message/Proxy/AddDownloads/Package.php @@ -6,13 +6,8 @@ final class Package { - private string $name; - private string $version; - - public function __construct(string $name, string $version) + public function __construct(private readonly string $name, private readonly string $version) { - $this->name = $name; - $this->version = $version; } public function name(): string diff --git a/src/Message/Proxy/RemoveDist.php b/src/Message/Proxy/RemoveDist.php index fdefc5b6..0bdb1d47 100644 --- a/src/Message/Proxy/RemoveDist.php +++ b/src/Message/Proxy/RemoveDist.php @@ -6,13 +6,8 @@ final class RemoveDist { - private string $proxy; - private string $packageName; - - public function __construct(string $proxy, string $packageName) + public function __construct(private readonly string $proxy, private readonly string $packageName) { - $this->proxy = $proxy; - $this->packageName = $packageName; } public function proxy(): string diff --git a/src/Message/Security/ScanPackage.php b/src/Message/Security/ScanPackage.php index 03869848..3ca4b253 100644 --- a/src/Message/Security/ScanPackage.php +++ b/src/Message/Security/ScanPackage.php @@ -6,11 +6,8 @@ final class ScanPackage { - private string $id; - - public function __construct(string $id) + public function __construct(private readonly string $id) { - $this->id = $id; } public function id(): string diff --git a/src/Message/Security/SendScanResult.php b/src/Message/Security/SendScanResult.php index 9ee25aa5..0ae7d28b 100644 --- a/src/Message/Security/SendScanResult.php +++ b/src/Message/Security/SendScanResult.php @@ -6,30 +6,12 @@ final class SendScanResult { - /** - * @var string[] - */ - private array $emails; - private string $organizationAlias; - private string $packageName; - private string $packageId; - - /** - * @var mixed[] - */ - private array $result; - /** * @param string[] $emails * @param mixed[] $result */ - public function __construct(array $emails, string $organizationAlias, string $packageName, string $packageId, array $result) + public function __construct(private readonly array $emails, private readonly string $organizationAlias, private readonly string $packageName, private readonly string $packageId, private readonly array $result) { - $this->emails = $emails; - $this->organizationAlias = $organizationAlias; - $this->result = $result; - $this->packageName = $packageName; - $this->packageId = $packageId; } /** diff --git a/src/Message/User/AddOAuthToken.php b/src/Message/User/AddOAuthToken.php index 0adeea3e..fa7b3aef 100644 --- a/src/Message/User/AddOAuthToken.php +++ b/src/Message/User/AddOAuthToken.php @@ -4,29 +4,12 @@ namespace Buddy\Repman\Message\User; +use DateTimeImmutable; + final class AddOAuthToken { - private string $id; - private string $userId; - private string $type; - private string $accessToken; - private ?string $refreshToken = null; - private ?\DateTimeImmutable $expiresAt = null; - - public function __construct( - string $id, - string $userId, - string $type, - string $accessToken, - ?string $refreshToken = null, - ?\DateTimeImmutable $expiresAt = null - ) { - $this->id = $id; - $this->userId = $userId; - $this->type = $type; - $this->accessToken = $accessToken; - $this->refreshToken = $refreshToken; - $this->expiresAt = $expiresAt; + public function __construct(private readonly string $id, private readonly string $userId, private readonly string $type, private readonly string $accessToken, private readonly ?string $refreshToken = null, private readonly ?DateTimeImmutable $expiresAt = null) + { } public function id(): string @@ -54,7 +37,7 @@ public function refreshToken(): ?string return $this->refreshToken; } - public function expiresAt(): ?\DateTimeImmutable + public function expiresAt(): ?DateTimeImmutable { return $this->expiresAt; } diff --git a/src/Message/User/ChangeEmailPreferences.php b/src/Message/User/ChangeEmailPreferences.php index 1cc5683e..f7f06951 100644 --- a/src/Message/User/ChangeEmailPreferences.php +++ b/src/Message/User/ChangeEmailPreferences.php @@ -6,13 +6,8 @@ final class ChangeEmailPreferences { - private string $userId; - private bool $emailScanResult; - - public function __construct(string $userId, bool $emailScanResult) + public function __construct(private readonly string $userId, private readonly bool $emailScanResult) { - $this->userId = $userId; - $this->emailScanResult = $emailScanResult; } public function userId(): string diff --git a/src/Message/User/ChangePassword.php b/src/Message/User/ChangePassword.php index a0c66771..81b93877 100644 --- a/src/Message/User/ChangePassword.php +++ b/src/Message/User/ChangePassword.php @@ -6,13 +6,8 @@ final class ChangePassword { - private string $userId; - private string $plainPassword; - - public function __construct(string $userId, string $plainPassword) + public function __construct(private readonly string $userId, private readonly string $plainPassword) { - $this->userId = $userId; - $this->plainPassword = $plainPassword; } public function userId(): string diff --git a/src/Message/User/ChangeRoles.php b/src/Message/User/ChangeRoles.php index bd98abdd..d762c54e 100644 --- a/src/Message/User/ChangeRoles.php +++ b/src/Message/User/ChangeRoles.php @@ -6,20 +6,11 @@ final class ChangeRoles { - private string $userId; - - /** - * @var string[] - */ - private array $roles; - /** * @param string[] $roles */ - public function __construct(string $userId, array $roles) + public function __construct(private readonly string $userId, private readonly array $roles) { - $this->userId = $userId; - $this->roles = $roles; } public function userId(): string diff --git a/src/Message/User/ChangeTimezone.php b/src/Message/User/ChangeTimezone.php index 68868dc9..37d88827 100644 --- a/src/Message/User/ChangeTimezone.php +++ b/src/Message/User/ChangeTimezone.php @@ -6,13 +6,8 @@ final class ChangeTimezone { - private string $userId; - private string $timezone; - - public function __construct(string $userId, string $timezone) + public function __construct(private readonly string $userId, private readonly string $timezone) { - $this->userId = $userId; - $this->timezone = $timezone; } public function userId(): string diff --git a/src/Message/User/ConfirmEmail.php b/src/Message/User/ConfirmEmail.php index 8477533d..d0f1e6ac 100644 --- a/src/Message/User/ConfirmEmail.php +++ b/src/Message/User/ConfirmEmail.php @@ -6,11 +6,8 @@ final class ConfirmEmail { - private string $token; - - public function __construct(string $token) + public function __construct(private readonly string $token) { - $this->token = $token; } public function token(): string diff --git a/src/Message/User/CreateOAuthUser.php b/src/Message/User/CreateOAuthUser.php index d6cac25e..14469d87 100644 --- a/src/Message/User/CreateOAuthUser.php +++ b/src/Message/User/CreateOAuthUser.php @@ -6,11 +6,8 @@ final class CreateOAuthUser { - private string $email; - - public function __construct(string $email) + public function __construct(private readonly string $email) { - $this->email = $email; } public function email(): string diff --git a/src/Message/User/CreateUser.php b/src/Message/User/CreateUser.php index da9562f3..1749d48c 100644 --- a/src/Message/User/CreateUser.php +++ b/src/Message/User/CreateUser.php @@ -6,26 +6,11 @@ final class CreateUser { - private string $id; - private string $email; - private string $plainPassword; - private string $confirmToken; - - /** - * @var array - */ - private array $roles; - /** * @param array $roles */ - public function __construct(string $id, string $email, string $plainPassword, string $confirmToken, array $roles = []) + public function __construct(private readonly string $id, private readonly string $email, private readonly string $plainPassword, private readonly string $confirmToken, private readonly array $roles = []) { - $this->id = $id; - $this->email = $email; - $this->plainPassword = $plainPassword; - $this->confirmToken = $confirmToken; - $this->roles = $roles; } public function id(): string diff --git a/src/Message/User/DisableUser.php b/src/Message/User/DisableUser.php index 70fe6dae..33385354 100644 --- a/src/Message/User/DisableUser.php +++ b/src/Message/User/DisableUser.php @@ -6,11 +6,8 @@ final class DisableUser { - private string $id; - - public function __construct(string $id) + public function __construct(private readonly string $id) { - $this->id = $id; } public function id(): string diff --git a/src/Message/User/EnableUser.php b/src/Message/User/EnableUser.php index d811ae2d..2a88dafd 100644 --- a/src/Message/User/EnableUser.php +++ b/src/Message/User/EnableUser.php @@ -6,11 +6,8 @@ final class EnableUser { - private string $id; - - public function __construct(string $id) + public function __construct(private readonly string $id) { - $this->id = $id; } public function id(): string diff --git a/src/Message/User/GenerateApiToken.php b/src/Message/User/GenerateApiToken.php index 039fe453..7cf02b53 100644 --- a/src/Message/User/GenerateApiToken.php +++ b/src/Message/User/GenerateApiToken.php @@ -6,13 +6,8 @@ final class GenerateApiToken { - private string $userId; - private string $name; - - public function __construct(string $userId, string $name) + public function __construct(private readonly string $userId, private readonly string $name) { - $this->userId = $userId; - $this->name = $name; } public function userId(): string diff --git a/src/Message/User/RegenerateApiToken.php b/src/Message/User/RegenerateApiToken.php index 3d2695a5..f7b44070 100644 --- a/src/Message/User/RegenerateApiToken.php +++ b/src/Message/User/RegenerateApiToken.php @@ -6,13 +6,8 @@ final class RegenerateApiToken { - private string $userId; - private string $token; - - public function __construct(string $userId, string $token) + public function __construct(private readonly string $userId, private readonly string $token) { - $this->userId = $userId; - $this->token = $token; } public function userId(): string diff --git a/src/Message/User/RemoveApiToken.php b/src/Message/User/RemoveApiToken.php index dd11ed37..757a3b2c 100644 --- a/src/Message/User/RemoveApiToken.php +++ b/src/Message/User/RemoveApiToken.php @@ -6,13 +6,8 @@ final class RemoveApiToken { - private string $userId; - private string $token; - - public function __construct(string $userId, string $token) + public function __construct(private readonly string $userId, private readonly string $token) { - $this->userId = $userId; - $this->token = $token; } public function userId(): string diff --git a/src/Message/User/RemoveOAuthToken.php b/src/Message/User/RemoveOAuthToken.php index 29ac9f8d..85b7a182 100644 --- a/src/Message/User/RemoveOAuthToken.php +++ b/src/Message/User/RemoveOAuthToken.php @@ -6,13 +6,8 @@ final class RemoveOAuthToken { - private string $userId; - private string $type; - - public function __construct(string $userId, string $type) + public function __construct(private readonly string $userId, private readonly string $type) { - $this->userId = $userId; - $this->type = $type; } public function userId(): string diff --git a/src/Message/User/RemoveUser.php b/src/Message/User/RemoveUser.php index 4b38047f..db9a3172 100644 --- a/src/Message/User/RemoveUser.php +++ b/src/Message/User/RemoveUser.php @@ -6,11 +6,8 @@ final class RemoveUser { - private string $id; - - public function __construct(string $id) + public function __construct(private readonly string $id) { - $this->id = $id; } public function id(): string diff --git a/src/Message/User/ResetPassword.php b/src/Message/User/ResetPassword.php index a77cf3f6..137c82eb 100644 --- a/src/Message/User/ResetPassword.php +++ b/src/Message/User/ResetPassword.php @@ -6,13 +6,8 @@ final class ResetPassword { - private string $token; - private string $password; - - public function __construct(string $token, string $password) + public function __construct(private readonly string $token, private readonly string $password) { - $this->token = $token; - $this->password = $password; } public function token(): string diff --git a/src/Message/User/SendConfirmToken.php b/src/Message/User/SendConfirmToken.php index 8727c363..ad386e0e 100644 --- a/src/Message/User/SendConfirmToken.php +++ b/src/Message/User/SendConfirmToken.php @@ -6,13 +6,8 @@ final class SendConfirmToken { - private string $email; - private string $token; - - public function __construct(string $email, string $token) + public function __construct(private readonly string $email, private readonly string $token) { - $this->email = $email; - $this->token = $token; } public function email(): string diff --git a/src/Message/User/SendPasswordResetLink.php b/src/Message/User/SendPasswordResetLink.php index a9ae7cc8..fea7a27e 100644 --- a/src/Message/User/SendPasswordResetLink.php +++ b/src/Message/User/SendPasswordResetLink.php @@ -6,15 +6,8 @@ final class SendPasswordResetLink { - private string $email; - private string $operatingSystem; - private string $browser; - - public function __construct(string $email, string $operatingSystem, string $browser) + public function __construct(private readonly string $email, private readonly string $operatingSystem, private readonly string $browser) { - $this->email = $email; - $this->operatingSystem = $operatingSystem; - $this->browser = $browser; } public function email(): string diff --git a/src/MessageHandler/Admin/AddTechnicalEmailHandler.php b/src/MessageHandler/Admin/AddTechnicalEmailHandler.php index e0331278..ddd93087 100644 --- a/src/MessageHandler/Admin/AddTechnicalEmailHandler.php +++ b/src/MessageHandler/Admin/AddTechnicalEmailHandler.php @@ -10,11 +10,8 @@ final class AddTechnicalEmailHandler implements MessageHandlerInterface { - private Telemetry $telemetry; - - public function __construct(Telemetry $telemetry) + public function __construct(private readonly Telemetry $telemetry) { - $this->telemetry = $telemetry; } public function __invoke(AddTechnicalEmail $message): void diff --git a/src/MessageHandler/Admin/ChangeConfigHandler.php b/src/MessageHandler/Admin/ChangeConfigHandler.php index a6a21ec9..f4951d34 100644 --- a/src/MessageHandler/Admin/ChangeConfigHandler.php +++ b/src/MessageHandler/Admin/ChangeConfigHandler.php @@ -16,15 +16,8 @@ final class ChangeConfigHandler implements MessageHandlerInterface { - private ConfigRepository $configRepository; - private Config $config; - private MessageBusInterface $messageBus; - - public function __construct(ConfigRepository $configRepository, Config $config, MessageBusInterface $messageBus) + public function __construct(private readonly ConfigRepository $configRepository, private readonly Config $config, private readonly MessageBusInterface $messageBus) { - $this->configRepository = $configRepository; - $this->config = $config; - $this->messageBus = $messageBus; } public function __invoke(ChangeConfig $message): void diff --git a/src/MessageHandler/Admin/RemoveTechnicalEmailHandler.php b/src/MessageHandler/Admin/RemoveTechnicalEmailHandler.php index 0e6d4f17..1f3acbea 100644 --- a/src/MessageHandler/Admin/RemoveTechnicalEmailHandler.php +++ b/src/MessageHandler/Admin/RemoveTechnicalEmailHandler.php @@ -10,11 +10,8 @@ final class RemoveTechnicalEmailHandler implements MessageHandlerInterface { - private Telemetry $telemetry; - - public function __construct(Telemetry $telemetry) + public function __construct(private readonly Telemetry $telemetry) { - $this->telemetry = $telemetry; } public function __invoke(RemoveTechnicalEmail $message): void diff --git a/src/MessageHandler/Organization/AddDownloadHandler.php b/src/MessageHandler/Organization/AddDownloadHandler.php index b3221ef8..6d3e3d6d 100644 --- a/src/MessageHandler/Organization/AddDownloadHandler.php +++ b/src/MessageHandler/Organization/AddDownloadHandler.php @@ -12,11 +12,8 @@ final class AddDownloadHandler implements MessageHandlerInterface { - private PackageRepository $packages; - - public function __construct(PackageRepository $packages) + public function __construct(private readonly PackageRepository $packages) { - $this->packages = $packages; } public function __invoke(AddDownload $message): void diff --git a/src/MessageHandler/Organization/AddPackageHandler.php b/src/MessageHandler/Organization/AddPackageHandler.php index ba5e6ba7..31653822 100644 --- a/src/MessageHandler/Organization/AddPackageHandler.php +++ b/src/MessageHandler/Organization/AddPackageHandler.php @@ -12,11 +12,8 @@ final class AddPackageHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - - public function __construct(OrganizationRepository $organizations) + public function __construct(private readonly OrganizationRepository $organizations) { - $this->organizations = $organizations; } public function __invoke(AddPackage $message): void diff --git a/src/MessageHandler/Organization/ChangeAliasHandler.php b/src/MessageHandler/Organization/ChangeAliasHandler.php index 8749c222..951202e6 100644 --- a/src/MessageHandler/Organization/ChangeAliasHandler.php +++ b/src/MessageHandler/Organization/ChangeAliasHandler.php @@ -11,11 +11,8 @@ final class ChangeAliasHandler implements MessageHandlerInterface { - private OrganizationRepository $repositories; - - public function __construct(OrganizationRepository $repositories) + public function __construct(private readonly OrganizationRepository $repositories) { - $this->repositories = $repositories; } public function __invoke(ChangeAlias $message): void diff --git a/src/MessageHandler/Organization/ChangeAnonymousAccessHandler.php b/src/MessageHandler/Organization/ChangeAnonymousAccessHandler.php index e0aa1aa6..d5b5471c 100644 --- a/src/MessageHandler/Organization/ChangeAnonymousAccessHandler.php +++ b/src/MessageHandler/Organization/ChangeAnonymousAccessHandler.php @@ -11,11 +11,8 @@ final class ChangeAnonymousAccessHandler implements MessageHandlerInterface { - private OrganizationRepository $repositories; - - public function __construct(OrganizationRepository $repositories) + public function __construct(private readonly OrganizationRepository $repositories) { - $this->repositories = $repositories; } public function __invoke(ChangeAnonymousAccess $message): void diff --git a/src/MessageHandler/Organization/ChangeNameHandler.php b/src/MessageHandler/Organization/ChangeNameHandler.php index bba10533..c2461931 100644 --- a/src/MessageHandler/Organization/ChangeNameHandler.php +++ b/src/MessageHandler/Organization/ChangeNameHandler.php @@ -11,11 +11,8 @@ final class ChangeNameHandler implements MessageHandlerInterface { - private OrganizationRepository $repositories; - - public function __construct(OrganizationRepository $repositories) + public function __construct(private readonly OrganizationRepository $repositories) { - $this->repositories = $repositories; } public function __invoke(ChangeName $message): void diff --git a/src/MessageHandler/Organization/CreateOrganizationHandler.php b/src/MessageHandler/Organization/CreateOrganizationHandler.php index 7cbcf4ec..a1f7b624 100644 --- a/src/MessageHandler/Organization/CreateOrganizationHandler.php +++ b/src/MessageHandler/Organization/CreateOrganizationHandler.php @@ -14,15 +14,8 @@ final class CreateOrganizationHandler implements MessageHandlerInterface { - private UserRepository $users; - private OrganizationRepository $organizations; - private AliasGenerator $aliasGenerator; - - public function __construct(UserRepository $users, OrganizationRepository $organizations, AliasGenerator $aliasGenerator) + public function __construct(private readonly UserRepository $users, private readonly OrganizationRepository $organizations, private readonly AliasGenerator $aliasGenerator) { - $this->users = $users; - $this->organizations = $organizations; - $this->aliasGenerator = $aliasGenerator; } public function __invoke(CreateOrganization $message): void diff --git a/src/MessageHandler/Organization/GenerateTokenHandler.php b/src/MessageHandler/Organization/GenerateTokenHandler.php index d8936839..9659a06b 100644 --- a/src/MessageHandler/Organization/GenerateTokenHandler.php +++ b/src/MessageHandler/Organization/GenerateTokenHandler.php @@ -13,13 +13,8 @@ final class GenerateTokenHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private TokenGenerator $tokenGenerator; - - public function __construct(OrganizationRepository $organizations, TokenGenerator $tokenGenerator) + public function __construct(private readonly OrganizationRepository $organizations, private readonly TokenGenerator $tokenGenerator) { - $this->organizations = $organizations; - $this->tokenGenerator = $tokenGenerator; } public function __invoke(GenerateToken $message): void diff --git a/src/MessageHandler/Organization/Member/AcceptInvitationHandler.php b/src/MessageHandler/Organization/Member/AcceptInvitationHandler.php index 4ee25758..f0a6088f 100644 --- a/src/MessageHandler/Organization/Member/AcceptInvitationHandler.php +++ b/src/MessageHandler/Organization/Member/AcceptInvitationHandler.php @@ -12,13 +12,8 @@ final class AcceptInvitationHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private UserRepository $users; - - public function __construct(OrganizationRepository $organizations, UserRepository $users) + public function __construct(private readonly OrganizationRepository $organizations, private readonly UserRepository $users) { - $this->organizations = $organizations; - $this->users = $users; } public function __invoke(AcceptInvitation $message): void diff --git a/src/MessageHandler/Organization/Member/ChangeRoleHandler.php b/src/MessageHandler/Organization/Member/ChangeRoleHandler.php index d502d3ad..cfe8a55e 100644 --- a/src/MessageHandler/Organization/Member/ChangeRoleHandler.php +++ b/src/MessageHandler/Organization/Member/ChangeRoleHandler.php @@ -12,13 +12,8 @@ final class ChangeRoleHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private UserRepository $users; - - public function __construct(OrganizationRepository $organizations, UserRepository $users) + public function __construct(private readonly OrganizationRepository $organizations, private readonly UserRepository $users) { - $this->organizations = $organizations; - $this->users = $users; } public function __invoke(ChangeRole $message): void diff --git a/src/MessageHandler/Organization/Member/InviteUserHandler.php b/src/MessageHandler/Organization/Member/InviteUserHandler.php index 6ac53743..7977b308 100644 --- a/src/MessageHandler/Organization/Member/InviteUserHandler.php +++ b/src/MessageHandler/Organization/Member/InviteUserHandler.php @@ -12,13 +12,8 @@ final class InviteUserHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private Mailer $mailer; - - public function __construct(OrganizationRepository $organizations, Mailer $mailer) + public function __construct(private readonly OrganizationRepository $organizations, private readonly Mailer $mailer) { - $this->organizations = $organizations; - $this->mailer = $mailer; } public function __invoke(InviteUser $message): void diff --git a/src/MessageHandler/Organization/Member/RemoveInvitationHandler.php b/src/MessageHandler/Organization/Member/RemoveInvitationHandler.php index 20d73508..5aaedf1d 100644 --- a/src/MessageHandler/Organization/Member/RemoveInvitationHandler.php +++ b/src/MessageHandler/Organization/Member/RemoveInvitationHandler.php @@ -11,11 +11,8 @@ final class RemoveInvitationHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - - public function __construct(OrganizationRepository $organizations) + public function __construct(private readonly OrganizationRepository $organizations) { - $this->organizations = $organizations; } public function __invoke(RemoveInvitation $message): void diff --git a/src/MessageHandler/Organization/Member/RemoveMemberHandler.php b/src/MessageHandler/Organization/Member/RemoveMemberHandler.php index 813bbcb2..27693ded 100644 --- a/src/MessageHandler/Organization/Member/RemoveMemberHandler.php +++ b/src/MessageHandler/Organization/Member/RemoveMemberHandler.php @@ -12,13 +12,8 @@ final class RemoveMemberHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private UserRepository $users; - - public function __construct(OrganizationRepository $organizations, UserRepository $users) + public function __construct(private readonly OrganizationRepository $organizations, private readonly UserRepository $users) { - $this->organizations = $organizations; - $this->users = $users; } public function __invoke(RemoveMember $message): void diff --git a/src/MessageHandler/Organization/Package/AbstractHookHandler.php b/src/MessageHandler/Organization/Package/AbstractHookHandler.php index 845abcdf..df0f8aed 100644 --- a/src/MessageHandler/Organization/Package/AbstractHookHandler.php +++ b/src/MessageHandler/Organization/Package/AbstractHookHandler.php @@ -12,16 +12,7 @@ abstract class AbstractHookHandler implements MessageHandlerInterface { - protected PackageRepository $packages; - protected IntegrationRegister $integrations; - protected UrlGeneratorInterface $router; - protected UserOAuthTokenRefresher $tokenRefresher; - - public function __construct(PackageRepository $packages, IntegrationRegister $integrations, UrlGeneratorInterface $router, UserOAuthTokenRefresher $tokenRefresher) + public function __construct(protected PackageRepository $packages, protected IntegrationRegister $integrations, protected UrlGeneratorInterface $router, protected UserOAuthTokenRefresher $tokenRefresher) { - $this->packages = $packages; - $this->integrations = $integrations; - $this->router = $router; - $this->tokenRefresher = $tokenRefresher; } } diff --git a/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php b/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php index 0697e115..e0c441d3 100644 --- a/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php +++ b/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php @@ -9,6 +9,7 @@ use Buddy\Repman\Message\Organization\Package\AddBitbucketHook; use Ramsey\Uuid\Uuid; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Throwable; final class AddBitbucketHookHandler extends AbstractHookHandler { @@ -26,8 +27,8 @@ public function __invoke(AddBitbucketHook $message): void $this->router->generate('package_webhook', ['package' => $package->id()->toString()], UrlGeneratorInterface::ABSOLUTE_URL) ); $package->webhookWasCreated(); - } catch (\Throwable $exception) { - $package->webhookWasNotCreated($exception->getMessage()); + } catch (Throwable $throwable) { + $package->webhookWasNotCreated($throwable->getMessage()); } } } diff --git a/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php b/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php index 3f29f5d6..5869f859 100644 --- a/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php +++ b/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php @@ -9,6 +9,7 @@ use Buddy\Repman\Message\Organization\Package\AddGitHubHook; use Ramsey\Uuid\Uuid; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Throwable; final class AddGitHubHookHandler extends AbstractHookHandler { @@ -27,8 +28,8 @@ public function __invoke(AddGitHubHook $message): void ); $package->webhookWasCreated(); - } catch (\Throwable $exception) { - $package->webhookWasNotCreated($exception->getMessage()); + } catch (Throwable $throwable) { + $package->webhookWasNotCreated($throwable->getMessage()); } } } diff --git a/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php b/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php index 5b6ff603..b8f3e174 100644 --- a/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php +++ b/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php @@ -9,6 +9,7 @@ use Buddy\Repman\Message\Organization\Package\AddGitLabHook; use Ramsey\Uuid\Uuid; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Throwable; final class AddGitLabHookHandler extends AbstractHookHandler { @@ -26,8 +27,8 @@ public function __invoke(AddGitLabHook $message): void $this->router->generate('package_webhook', ['package' => $package->id()->toString()], UrlGeneratorInterface::ABSOLUTE_URL) ); $package->webhookWasCreated(); - } catch (\Throwable $exception) { - $package->webhookWasNotCreated($exception->getMessage()); + } catch (Throwable $throwable) { + $package->webhookWasNotCreated($throwable->getMessage()); } } } diff --git a/src/MessageHandler/Organization/Package/UpdateHandler.php b/src/MessageHandler/Organization/Package/UpdateHandler.php index 3ee16cfc..fd5ee9c4 100644 --- a/src/MessageHandler/Organization/Package/UpdateHandler.php +++ b/src/MessageHandler/Organization/Package/UpdateHandler.php @@ -12,11 +12,8 @@ final class UpdateHandler implements MessageHandlerInterface { - private PackageRepository $packages; - - public function __construct(PackageRepository $packages) + public function __construct(private readonly PackageRepository $packages) { - $this->packages = $packages; } public function __invoke(Update $message): void diff --git a/src/MessageHandler/Organization/RegenerateTokenHandler.php b/src/MessageHandler/Organization/RegenerateTokenHandler.php index a508ba41..74169e9b 100644 --- a/src/MessageHandler/Organization/RegenerateTokenHandler.php +++ b/src/MessageHandler/Organization/RegenerateTokenHandler.php @@ -12,13 +12,8 @@ final class RegenerateTokenHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private TokenGenerator $tokenGenerator; - - public function __construct(OrganizationRepository $organizations, TokenGenerator $tokenGenerator) + public function __construct(private readonly OrganizationRepository $organizations, private readonly TokenGenerator $tokenGenerator) { - $this->organizations = $organizations; - $this->tokenGenerator = $tokenGenerator; } public function __invoke(RegenerateToken $message): void diff --git a/src/MessageHandler/Organization/RemoveOrganizationHandler.php b/src/MessageHandler/Organization/RemoveOrganizationHandler.php index 29f40b4d..c097ce58 100644 --- a/src/MessageHandler/Organization/RemoveOrganizationHandler.php +++ b/src/MessageHandler/Organization/RemoveOrganizationHandler.php @@ -12,13 +12,8 @@ final class RemoveOrganizationHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private PackageManager $packageManager; - - public function __construct(OrganizationRepository $organizations, PackageManager $packageManager) + public function __construct(private readonly OrganizationRepository $organizations, private readonly PackageManager $packageManager) { - $this->organizations = $organizations; - $this->packageManager = $packageManager; } public function __invoke(RemoveOrganization $message): void diff --git a/src/MessageHandler/Organization/RemovePackageHandler.php b/src/MessageHandler/Organization/RemovePackageHandler.php index cf250bfe..1c391f02 100644 --- a/src/MessageHandler/Organization/RemovePackageHandler.php +++ b/src/MessageHandler/Organization/RemovePackageHandler.php @@ -13,15 +13,8 @@ final class RemovePackageHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - private PackageManager $packageManager; - private PackageRepository $packages; - - public function __construct(OrganizationRepository $organizations, PackageManager $packageManager, PackageRepository $packages) + public function __construct(private readonly OrganizationRepository $organizations, private readonly PackageManager $packageManager, private readonly PackageRepository $packages) { - $this->organizations = $organizations; - $this->packageManager = $packageManager; - $this->packages = $packages; } public function __invoke(RemovePackage $message): void diff --git a/src/MessageHandler/Organization/RemoveTokenHandler.php b/src/MessageHandler/Organization/RemoveTokenHandler.php index 6b2e08ac..71545162 100644 --- a/src/MessageHandler/Organization/RemoveTokenHandler.php +++ b/src/MessageHandler/Organization/RemoveTokenHandler.php @@ -11,11 +11,8 @@ final class RemoveTokenHandler implements MessageHandlerInterface { - private OrganizationRepository $organizations; - - public function __construct(OrganizationRepository $organizations) + public function __construct(private readonly OrganizationRepository $organizations) { - $this->organizations = $organizations; } public function __invoke(RemoveToken $message): void diff --git a/src/MessageHandler/Organization/SynchronizePackageHandler.php b/src/MessageHandler/Organization/SynchronizePackageHandler.php index bc81b526..8cba2265 100644 --- a/src/MessageHandler/Organization/SynchronizePackageHandler.php +++ b/src/MessageHandler/Organization/SynchronizePackageHandler.php @@ -17,15 +17,8 @@ final class SynchronizePackageHandler implements MessageHandlerInterface { - private PackageSynchronizer $synchronizer; - private PackageRepository $packages; - private MessageBusInterface $messageBus; - - public function __construct(PackageSynchronizer $synchronizer, PackageRepository $packages, MessageBusInterface $messageBus) + public function __construct(private readonly PackageSynchronizer $synchronizer, private readonly PackageRepository $packages, private readonly MessageBusInterface $messageBus) { - $this->synchronizer = $synchronizer; - $this->packages = $packages; - $this->messageBus = $messageBus; } public function __invoke(SynchronizePackage $message): void diff --git a/src/MessageHandler/Proxy/AddDownloadsHandler.php b/src/MessageHandler/Proxy/AddDownloadsHandler.php index bb8d7635..7d4392e7 100644 --- a/src/MessageHandler/Proxy/AddDownloadsHandler.php +++ b/src/MessageHandler/Proxy/AddDownloadsHandler.php @@ -12,19 +12,14 @@ final class AddDownloadsHandler implements MessageHandlerInterface { - private Downloads $downloads; - - public function __construct(Downloads $downloads) + public function __construct(private readonly Downloads $downloads) { - $this->downloads = $downloads; } public function __invoke(AddDownloads $message): void { $this->downloads->save( - array_map(function (MessagePackage $package): Package { - return new Package($package->name(), $package->version()); - }, $message->packages()), + array_map(fn (MessagePackage $package): Package => new Package($package->name(), $package->version()), $message->packages()), $message->date(), $message->ip(), $message->userAgent() diff --git a/src/MessageHandler/Proxy/RemoveDistHandler.php b/src/MessageHandler/Proxy/RemoveDistHandler.php index cad9b705..6f17417c 100644 --- a/src/MessageHandler/Proxy/RemoveDistHandler.php +++ b/src/MessageHandler/Proxy/RemoveDistHandler.php @@ -10,11 +10,8 @@ final class RemoveDistHandler implements MessageHandlerInterface { - private ProxyRegister $register; - - public function __construct(ProxyRegister $register) + public function __construct(private readonly ProxyRegister $register) { - $this->register = $register; } public function __invoke(RemoveDist $message): void diff --git a/src/MessageHandler/Security/ScanPackageHandler.php b/src/MessageHandler/Security/ScanPackageHandler.php index fa351746..3220e0ae 100644 --- a/src/MessageHandler/Security/ScanPackageHandler.php +++ b/src/MessageHandler/Security/ScanPackageHandler.php @@ -13,13 +13,8 @@ final class ScanPackageHandler implements MessageHandlerInterface { - private PackageScanner $scanner; - private PackageRepository $packages; - - public function __construct(PackageScanner $scanner, PackageRepository $packages) + public function __construct(private readonly PackageScanner $scanner, private readonly PackageRepository $packages) { - $this->scanner = $scanner; - $this->packages = $packages; } public function __invoke(ScanPackage $message): void @@ -28,6 +23,7 @@ public function __invoke(ScanPackage $message): void if (!$package instanceof Package) { return; } + if (!$package->isEnabledSecurityScan()) { return; } diff --git a/src/MessageHandler/Security/SendScanResultHandler.php b/src/MessageHandler/Security/SendScanResultHandler.php index be3cde5d..cb1e00aa 100644 --- a/src/MessageHandler/Security/SendScanResultHandler.php +++ b/src/MessageHandler/Security/SendScanResultHandler.php @@ -10,11 +10,8 @@ final class SendScanResultHandler implements MessageHandlerInterface { - private Mailer $mailer; - - public function __construct(Mailer $mailer) + public function __construct(private readonly Mailer $mailer) { - $this->mailer = $mailer; } public function __invoke(SendScanResult $message): void diff --git a/src/MessageHandler/User/AddOAuthTokenHandler.php b/src/MessageHandler/User/AddOAuthTokenHandler.php index 0497123a..bd242799 100644 --- a/src/MessageHandler/User/AddOAuthTokenHandler.php +++ b/src/MessageHandler/User/AddOAuthTokenHandler.php @@ -12,11 +12,8 @@ final class AddOAuthTokenHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(AddOAuthToken $message): void diff --git a/src/MessageHandler/User/ChangeEmailPreferencesHandler.php b/src/MessageHandler/User/ChangeEmailPreferencesHandler.php index e1a604bf..a0cc439f 100644 --- a/src/MessageHandler/User/ChangeEmailPreferencesHandler.php +++ b/src/MessageHandler/User/ChangeEmailPreferencesHandler.php @@ -11,11 +11,8 @@ final class ChangeEmailPreferencesHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(ChangeEmailPreferences $message): void diff --git a/src/MessageHandler/User/ChangePasswordHandler.php b/src/MessageHandler/User/ChangePasswordHandler.php index e69086cd..bebdc572 100644 --- a/src/MessageHandler/User/ChangePasswordHandler.php +++ b/src/MessageHandler/User/ChangePasswordHandler.php @@ -13,13 +13,8 @@ final class ChangePasswordHandler implements MessageHandlerInterface { - private UserRepository $users; - private PasswordHasherFactoryInterface $hasherFactory; - - public function __construct(UserRepository $users, PasswordHasherFactoryInterface $hasherFactory) + public function __construct(private readonly UserRepository $users, private readonly PasswordHasherFactoryInterface $hasherFactory) { - $this->users = $users; - $this->hasherFactory = $hasherFactory; } public function __invoke(ChangePassword $message): void diff --git a/src/MessageHandler/User/ChangeRolesHandler.php b/src/MessageHandler/User/ChangeRolesHandler.php index 852b37f0..6a3b16ba 100644 --- a/src/MessageHandler/User/ChangeRolesHandler.php +++ b/src/MessageHandler/User/ChangeRolesHandler.php @@ -11,11 +11,8 @@ final class ChangeRolesHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(ChangeRoles $message): void diff --git a/src/MessageHandler/User/ChangeTimezoneHandler.php b/src/MessageHandler/User/ChangeTimezoneHandler.php index 4d96a949..fd848be9 100644 --- a/src/MessageHandler/User/ChangeTimezoneHandler.php +++ b/src/MessageHandler/User/ChangeTimezoneHandler.php @@ -7,15 +7,13 @@ use Buddy\Repman\Message\User\ChangeTimezone; use Buddy\Repman\Repository\UserRepository; use Ramsey\Uuid\Uuid; -use Symfony\Component\Messenger\Handler\MessageHandlerInterface; +use Symfony\Component\Messenger\Attribute\AsMessageHandler; -final class ChangeTimezoneHandler implements MessageHandlerInterface +#[AsMessageHandler] +final class ChangeTimezoneHandler { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(ChangeTimezone $message): void diff --git a/src/MessageHandler/User/ConfirmEmailHandler.php b/src/MessageHandler/User/ConfirmEmailHandler.php index 18a6fe21..fc360f8e 100644 --- a/src/MessageHandler/User/ConfirmEmailHandler.php +++ b/src/MessageHandler/User/ConfirmEmailHandler.php @@ -10,11 +10,8 @@ final class ConfirmEmailHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(ConfirmEmail $message): void diff --git a/src/MessageHandler/User/CreateOAuthUserHandler.php b/src/MessageHandler/User/CreateOAuthUserHandler.php index 880123c3..8d18044c 100644 --- a/src/MessageHandler/User/CreateOAuthUserHandler.php +++ b/src/MessageHandler/User/CreateOAuthUserHandler.php @@ -14,13 +14,8 @@ final class CreateOAuthUserHandler implements MessageHandlerInterface { - private UserRepository $users; - private PasswordHasherFactoryInterface $hasherFactory; - - public function __construct(UserRepository $users, PasswordHasherFactoryInterface $hasherFactory) + public function __construct(private readonly UserRepository $users, private readonly PasswordHasherFactoryInterface $hasherFactory) { - $this->users = $users; - $this->hasherFactory = $hasherFactory; } public function __invoke(CreateOAuthUser $message): void diff --git a/src/MessageHandler/User/CreateUserHandler.php b/src/MessageHandler/User/CreateUserHandler.php index d37b696e..643c8c4c 100644 --- a/src/MessageHandler/User/CreateUserHandler.php +++ b/src/MessageHandler/User/CreateUserHandler.php @@ -14,13 +14,8 @@ final class CreateUserHandler implements MessageHandlerInterface { - private UserRepository $users; - private PasswordHasherFactoryInterface $hasherFactory; - - public function __construct(UserRepository $users, PasswordHasherFactoryInterface $hasherFactory) + public function __construct(private readonly UserRepository $users, private readonly PasswordHasherFactoryInterface $hasherFactory) { - $this->users = $users; - $this->hasherFactory = $hasherFactory; } public function __invoke(CreateUser $message): void diff --git a/src/MessageHandler/User/DisableUserHandler.php b/src/MessageHandler/User/DisableUserHandler.php index 86c3d45b..34669577 100644 --- a/src/MessageHandler/User/DisableUserHandler.php +++ b/src/MessageHandler/User/DisableUserHandler.php @@ -11,11 +11,8 @@ final class DisableUserHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(DisableUser $message): void diff --git a/src/MessageHandler/User/EnableUserHandler.php b/src/MessageHandler/User/EnableUserHandler.php index 624d01d8..f18dd17d 100644 --- a/src/MessageHandler/User/EnableUserHandler.php +++ b/src/MessageHandler/User/EnableUserHandler.php @@ -11,11 +11,8 @@ final class EnableUserHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(EnableUser $message): void diff --git a/src/MessageHandler/User/GenerateApiTokenHandler.php b/src/MessageHandler/User/GenerateApiTokenHandler.php index 3ed11cbf..842a7bd2 100644 --- a/src/MessageHandler/User/GenerateApiTokenHandler.php +++ b/src/MessageHandler/User/GenerateApiTokenHandler.php @@ -13,13 +13,8 @@ final class GenerateApiTokenHandler implements MessageHandlerInterface { - private UserRepository $users; - private TokenGenerator $tokenGenerator; - - public function __construct(UserRepository $users, TokenGenerator $tokenGenerator) + public function __construct(private readonly UserRepository $users, private readonly TokenGenerator $tokenGenerator) { - $this->users = $users; - $this->tokenGenerator = $tokenGenerator; } public function __invoke(GenerateApiToken $message): void diff --git a/src/MessageHandler/User/RegenerateApiTokenHandler.php b/src/MessageHandler/User/RegenerateApiTokenHandler.php index 3798aaa7..34fe9b03 100644 --- a/src/MessageHandler/User/RegenerateApiTokenHandler.php +++ b/src/MessageHandler/User/RegenerateApiTokenHandler.php @@ -12,13 +12,8 @@ final class RegenerateApiTokenHandler implements MessageHandlerInterface { - private UserRepository $users; - private TokenGenerator $tokenGenerator; - - public function __construct(UserRepository $users, TokenGenerator $tokenGenerator) + public function __construct(private readonly UserRepository $users, private readonly TokenGenerator $tokenGenerator) { - $this->users = $users; - $this->tokenGenerator = $tokenGenerator; } public function __invoke(RegenerateApiToken $message): void diff --git a/src/MessageHandler/User/RemoveApiTokenHandler.php b/src/MessageHandler/User/RemoveApiTokenHandler.php index 3f3a0412..80e8164d 100644 --- a/src/MessageHandler/User/RemoveApiTokenHandler.php +++ b/src/MessageHandler/User/RemoveApiTokenHandler.php @@ -11,11 +11,8 @@ final class RemoveApiTokenHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(RemoveApiToken $message): void diff --git a/src/MessageHandler/User/RemoveOAuthTokenHandler.php b/src/MessageHandler/User/RemoveOAuthTokenHandler.php index 98b6ecf0..fe8c721b 100644 --- a/src/MessageHandler/User/RemoveOAuthTokenHandler.php +++ b/src/MessageHandler/User/RemoveOAuthTokenHandler.php @@ -11,11 +11,8 @@ final class RemoveOAuthTokenHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(RemoveOAuthToken $message): void diff --git a/src/MessageHandler/User/RemoveUserHandler.php b/src/MessageHandler/User/RemoveUserHandler.php index 3be04711..c28cb365 100644 --- a/src/MessageHandler/User/RemoveUserHandler.php +++ b/src/MessageHandler/User/RemoveUserHandler.php @@ -11,11 +11,8 @@ final class RemoveUserHandler implements MessageHandlerInterface { - private UserRepository $users; - - public function __construct(UserRepository $users) + public function __construct(private readonly UserRepository $users) { - $this->users = $users; } public function __invoke(RemoveUser $message): void diff --git a/src/MessageHandler/User/ResetPasswordHandler.php b/src/MessageHandler/User/ResetPasswordHandler.php index 391e8f50..2957d8a5 100644 --- a/src/MessageHandler/User/ResetPasswordHandler.php +++ b/src/MessageHandler/User/ResetPasswordHandler.php @@ -12,15 +12,8 @@ final class ResetPasswordHandler implements MessageHandlerInterface { - private UserRepository $users; - private PasswordHasherFactoryInterface $hasherFactory; - private int $resetPasswordTokenTtl; - - public function __construct(UserRepository $users, PasswordHasherFactoryInterface $hasherFactory, int $resetPasswordTokenTtl) + public function __construct(private readonly UserRepository $users, private readonly PasswordHasherFactoryInterface $hasherFactory, private readonly int $resetPasswordTokenTtl) { - $this->users = $users; - $this->hasherFactory = $hasherFactory; - $this->resetPasswordTokenTtl = $resetPasswordTokenTtl; } public function __invoke(ResetPassword $message): void diff --git a/src/MessageHandler/User/SendConfirmTokenHandler.php b/src/MessageHandler/User/SendConfirmTokenHandler.php index 6a57e3df..54e9bc07 100644 --- a/src/MessageHandler/User/SendConfirmTokenHandler.php +++ b/src/MessageHandler/User/SendConfirmTokenHandler.php @@ -10,11 +10,8 @@ final class SendConfirmTokenHandler implements MessageHandlerInterface { - private Mailer $mailer; - - public function __construct(Mailer $mailer) + public function __construct(private readonly Mailer $mailer) { - $this->mailer = $mailer; } public function __invoke(SendConfirmToken $message): void diff --git a/src/MessageHandler/User/SendPasswordResetLinkHandler.php b/src/MessageHandler/User/SendPasswordResetLinkHandler.php index 01700d8d..619bef74 100644 --- a/src/MessageHandler/User/SendPasswordResetLinkHandler.php +++ b/src/MessageHandler/User/SendPasswordResetLinkHandler.php @@ -12,15 +12,8 @@ final class SendPasswordResetLinkHandler implements MessageHandlerInterface { - private UserRepository $users; - private Mailer $mailer; - private ResetPasswordTokenGenerator $generator; - - public function __construct(UserRepository $users, Mailer $mailer, ResetPasswordTokenGenerator $generator) + public function __construct(private readonly UserRepository $users, private readonly Mailer $mailer, private readonly ResetPasswordTokenGenerator $generator) { - $this->users = $users; - $this->mailer = $mailer; - $this->generator = $generator; } public function __invoke(SendPasswordResetLink $message): void diff --git a/src/Migrations/Factory/MigrationFactoryDecorator.php b/src/Migrations/Factory/MigrationFactoryDecorator.php index 2b5f47de..aa04bb41 100644 --- a/src/Migrations/Factory/MigrationFactoryDecorator.php +++ b/src/Migrations/Factory/MigrationFactoryDecorator.php @@ -11,13 +11,8 @@ class MigrationFactoryDecorator implements MigrationFactory { - private MigrationFactory $migrationFactory; - private ContainerInterface $container; - - public function __construct(MigrationFactory $migrationFactory, ContainerInterface $container) + public function __construct(private readonly MigrationFactory $migrationFactory, private readonly ContainerInterface $container) { - $this->migrationFactory = $migrationFactory; - $this->container = $container; } public function createVersion(string $migrationClassName): AbstractMigration diff --git a/src/Migrations/Version20200312091436.php b/src/Migrations/Version20200312091436.php index 0b194cd8..9d723107 100644 --- a/src/Migrations/Version20200312091436.php +++ b/src/Migrations/Version20200312091436.php @@ -20,28 +20,28 @@ public function getDescription(): string public function up(Schema $schema): void { - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE organization (id UUID NOT NULL, owner_id UUID NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, name VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX uniq_c1ee637ce16c6b94 ON organization (alias)'); $this->addSql('CREATE INDEX idx_c1ee637c7e3c61f9 ON organization (owner_id)'); - $this->addSql('COMMENT ON COLUMN organization.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization.owner_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization.owner_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization.created_at IS '(DC2Type:datetime_immutable)'"); $this->addSql('CREATE TABLE organization_token (value VARCHAR(64) NOT NULL, organization_id UUID NOT NULL, name VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, last_used_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(value))'); $this->addSql('CREATE INDEX idx_d1b047fc32c8a3de ON organization_token (organization_id)'); - $this->addSql('COMMENT ON COLUMN organization_token.organization_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_token.created_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN organization_token.last_used_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization_token.organization_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_token.created_at IS '(DC2Type:datetime_immutable)'"); + $this->addSql("COMMENT ON COLUMN organization_token.last_used_at IS '(DC2Type:datetime_immutable)'"); $this->addSql('CREATE TABLE user_oauth_token (id UUID NOT NULL, user_id UUID NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, type VARCHAR(9) NOT NULL, access_token VARCHAR(255) NOT NULL, refresh_token VARCHAR(255) DEFAULT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX token_type ON user_oauth_token (type, user_id)'); $this->addSql('CREATE INDEX idx_712f82bfa76ed395 ON user_oauth_token (user_id)'); - $this->addSql('COMMENT ON COLUMN user_oauth_token.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN user_oauth_token.user_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN user_oauth_token.created_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN user_oauth_token.expires_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN user_oauth_token.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN user_oauth_token.user_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN user_oauth_token.created_at IS '(DC2Type:datetime_immutable)'"); + $this->addSql("COMMENT ON COLUMN user_oauth_token.expires_at IS '(DC2Type:datetime_immutable)'"); $this->addSql('CREATE TABLE "user" (id UUID NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, reset_password_token VARCHAR(255) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, reset_password_token_created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, email_confirmed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, email_confirm_token VARCHAR(255) NOT NULL, status VARCHAR(20) NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX uniq_8d93d6495afeb9f9 ON "user" (email_confirm_token)'); @@ -55,24 +55,24 @@ public function up(Schema $schema): void $this->addSql('CREATE TABLE organization_package (id UUID NOT NULL, organization_id UUID NOT NULL, name VARCHAR(255) DEFAULT NULL, repository_url TEXT NOT NULL, description TEXT DEFAULT NULL, latest_released_version VARCHAR(255) DEFAULT NULL, latest_release_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, type VARCHAR(255) NOT NULL, last_sync_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, last_sync_error TEXT DEFAULT NULL, webhook_created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, metadata JSON NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX package_name ON organization_package (organization_id, name)'); $this->addSql('CREATE INDEX IDX_13BAEFD632C8A3DE ON organization_package (organization_id)'); - $this->addSql('COMMENT ON COLUMN organization_package.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package.organization_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package.latest_release_date IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN organization_package.last_sync_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN organization_package.webhook_created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization_package.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package.organization_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package.latest_release_date IS '(DC2Type:datetime_immutable)'"); + $this->addSql("COMMENT ON COLUMN organization_package.last_sync_at IS '(DC2Type:datetime_immutable)'"); + $this->addSql("COMMENT ON COLUMN organization_package.webhook_created_at IS '(DC2Type:datetime_immutable)'"); $this->addSql('CREATE TABLE organization_package_download (id UUID NOT NULL, package_id UUID NOT NULL, date DATE NOT NULL, version VARCHAR(255) NOT NULL, ip VARCHAR(15) DEFAULT NULL, user_agent VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX package_id_idx ON organization_package_download (package_id)'); $this->addSql('CREATE INDEX download_date_idx ON organization_package_download (date)'); - $this->addSql('COMMENT ON COLUMN organization_package_download.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_download.package_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_download.date IS \'(DC2Type:date_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization_package_download.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_download.package_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_download.date IS '(DC2Type:date_immutable)'"); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE organization'); $this->addSql('DROP TABLE organization_token'); diff --git a/src/Migrations/Version20200416172613.php b/src/Migrations/Version20200416172613.php index 6403f890..c227a201 100644 --- a/src/Migrations/Version20200416172613.php +++ b/src/Migrations/Version20200416172613.php @@ -21,19 +21,19 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE organization_member (id UUID NOT NULL, user_id UUID NOT NULL, organization_id UUID NOT NULL, role VARCHAR(15) NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_756A2A8DA76ED395 ON organization_member (user_id)'); $this->addSql('CREATE INDEX IDX_756A2A8D32C8A3DE ON organization_member (organization_id)'); $this->addSql('CREATE UNIQUE INDEX user_organization ON organization_member (user_id, organization_id)'); - $this->addSql('COMMENT ON COLUMN organization_member.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_member.user_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_member.organization_id IS \'(DC2Type:uuid)\''); + $this->addSql("COMMENT ON COLUMN organization_member.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_member.user_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_member.organization_id IS '(DC2Type:uuid)'"); $this->addSql('CREATE TABLE organization_invitation (token VARCHAR(255) NOT NULL, organization_id UUID NOT NULL, email VARCHAR(180) NOT NULL, role VARCHAR(15) NOT NULL, PRIMARY KEY(token))'); $this->addSql('CREATE INDEX IDX_1846F34D32C8A3DE ON organization_invitation (organization_id)'); $this->addSql('CREATE UNIQUE INDEX email_organization ON organization_invitation (email, organization_id)'); - $this->addSql('COMMENT ON COLUMN organization_invitation.organization_id IS \'(DC2Type:uuid)\''); + $this->addSql("COMMENT ON COLUMN organization_invitation.organization_id IS '(DC2Type:uuid)'"); $this->addSql('ALTER TABLE organization_member ADD CONSTRAINT FK_756A2A8DA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE organization_member ADD CONSTRAINT FK_756A2A8D32C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE organization_invitation ADD CONSTRAINT FK_1846F34D32C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -42,7 +42,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE organization_member'); $this->addSql('DROP TABLE organization_invitation'); diff --git a/src/Migrations/Version20200421143358.php b/src/Migrations/Version20200421143358.php index 89f607c1..3b823885 100644 --- a/src/Migrations/Version20200421143358.php +++ b/src/Migrations/Version20200421143358.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE lock_keys (key_id VARCHAR(64) NOT NULL, key_token VARCHAR(44) NOT NULL, key_expiration INT NOT NULL, PRIMARY KEY(key_id))'); } @@ -29,7 +29,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE lock_keys'); } diff --git a/src/Migrations/Version20200422190543.php b/src/Migrations/Version20200422190543.php index e51b8838..3e856c44 100644 --- a/src/Migrations/Version20200422190543.php +++ b/src/Migrations/Version20200422190543.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('UPDATE "user" SET email = lower(email)'); } } diff --git a/src/Migrations/Version20200429045703.php b/src/Migrations/Version20200429045703.php index b5e41de6..664fc0ac 100644 --- a/src/Migrations/Version20200429045703.php +++ b/src/Migrations/Version20200429045703.php @@ -23,7 +23,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization_package ADD CONSTRAINT FK_13BAEFD632C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE organization_token ADD CONSTRAINT FK_D1B047FC32C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -53,14 +53,14 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization_token DROP CONSTRAINT FK_D1B047FC32C8A3DE'); $this->addSql('ALTER TABLE user_oauth_token DROP CONSTRAINT FK_712F82BFA76ED395'); $this->addSql('ALTER TABLE organization_package DROP CONSTRAINT FK_13BAEFD632C8A3DE'); $this->addSql('ALTER TABLE organization ADD owner_id UUID'); - $this->addSql('COMMENT ON COLUMN organization.owner_id IS \'(DC2Type:uuid)\''); + $this->addSql("COMMENT ON COLUMN organization.owner_id IS '(DC2Type:uuid)'"); $this->addSql('ALTER TABLE organization ADD CONSTRAINT FK_C1EE637C7E3C61F9 FOREIGN KEY (owner_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $owners = $this->connection->fetchAllAssociative('SELECT organization_id, user_id FROM organization_member WHERE role = :role', ['role' => Member::ROLE_OWNER]); diff --git a/src/Migrations/Version20200507052339.php b/src/Migrations/Version20200507052339.php index 9dfcd31e..0d8e584a 100644 --- a/src/Migrations/Version20200507052339.php +++ b/src/Migrations/Version20200507052339.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE INDEX download_version_idx ON organization_package_download (version)'); } @@ -29,7 +29,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP INDEX download_version_idx'); } diff --git a/src/Migrations/Version20200508153504.php b/src/Migrations/Version20200508153504.php index e0375f75..8c5f2670 100644 --- a/src/Migrations/Version20200508153504.php +++ b/src/Migrations/Version20200508153504.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE config (key VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, PRIMARY KEY(key))'); $this->addSql("INSERT INTO config (key, value) VALUES ('user_registration', 'enabled')"); @@ -30,7 +30,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE config'); } diff --git a/src/Migrations/Version20200525193652.php b/src/Migrations/Version20200525193652.php index 69314fa6..14130fb5 100644 --- a/src/Migrations/Version20200525193652.php +++ b/src/Migrations/Version20200525193652.php @@ -21,25 +21,25 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE organization_package_scan_result (id UUID NOT NULL, package_id UUID NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, status VARCHAR(7) NOT NULL, version VARCHAR(255) NOT NULL, content JSON NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_9AB3F43AF44CABFF ON organization_package_scan_result (package_id)'); $this->addSql('CREATE INDEX date_idx ON organization_package_scan_result (date)'); - $this->addSql('COMMENT ON COLUMN organization_package_scan_result.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_scan_result.package_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_scan_result.date IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization_package_scan_result.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_scan_result.package_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_scan_result.date IS '(DC2Type:datetime_immutable)'"); $this->addSql('ALTER TABLE organization_package_scan_result ADD CONSTRAINT FK_9AB3F43AF44CABFF FOREIGN KEY (package_id) REFERENCES organization_package (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE organization_package ADD last_scan_result JSON DEFAULT NULL'); $this->addSql('ALTER TABLE organization_package ADD last_scan_status VARCHAR(7) DEFAULT NULL'); $this->addSql('ALTER TABLE organization_package ADD last_scan_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); - $this->addSql('COMMENT ON COLUMN organization_package.last_scan_date IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization_package.last_scan_date IS '(DC2Type:datetime_immutable)'"); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE organization_package_scan_result'); $this->addSql('ALTER TABLE organization_package DROP last_scan_result'); diff --git a/src/Migrations/Version20200604151104.php b/src/Migrations/Version20200604151104.php index f0b8878a..5a197901 100644 --- a/src/Migrations/Version20200604151104.php +++ b/src/Migrations/Version20200604151104.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE "user" ADD email_scan_result BOOLEAN NOT NULL DEFAULT TRUE'); } @@ -29,7 +29,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE "user" DROP email_scan_result'); } diff --git a/src/Migrations/Version20200614133313.php b/src/Migrations/Version20200614133313.php index ecef444d..2f8947eb 100644 --- a/src/Migrations/Version20200614133313.php +++ b/src/Migrations/Version20200614133313.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql("INSERT INTO config (key, value) VALUES ('local_authentication', ( @@ -45,7 +45,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql("INSERT INTO config (key, value) VALUES ('user_registration', ( diff --git a/src/Migrations/Version20200615181216.php b/src/Migrations/Version20200615181216.php index 4baff61b..872aa761 100644 --- a/src/Migrations/Version20200615181216.php +++ b/src/Migrations/Version20200615181216.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization ADD has_anonymous_access BOOLEAN NOT NULL DEFAULT false'); $this->addSql('ALTER TABLE "user" ALTER email_scan_result DROP DEFAULT'); @@ -30,7 +30,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization DROP has_anonymous_access'); $this->addSql('ALTER TABLE "user" ALTER email_scan_result SET DEFAULT \'true\''); diff --git a/src/Migrations/Version20200706181929.php b/src/Migrations/Version20200706181929.php index aaed5c86..f70f63d1 100644 --- a/src/Migrations/Version20200706181929.php +++ b/src/Migrations/Version20200706181929.php @@ -21,22 +21,22 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE organization_package_version (id UUID NOT NULL, package_id UUID NOT NULL, version VARCHAR(255) NOT NULL, reference VARCHAR(255) NOT NULL, size INT NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX version_package_id_idx ON organization_package_version (package_id)'); $this->addSql('CREATE INDEX version_date_idx ON organization_package_version (date)'); $this->addSql('CREATE UNIQUE INDEX package_version ON organization_package_version (package_id, version)'); - $this->addSql('COMMENT ON COLUMN organization_package_version.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_version.package_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_version.date IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN organization_package_version.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_version.package_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_version.date IS '(DC2Type:datetime_immutable)'"); $this->addSql('ALTER TABLE organization_package_version ADD CONSTRAINT FK_62DF469AF44CABFF FOREIGN KEY (package_id) REFERENCES organization_package (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE organization_package_version'); } diff --git a/src/Migrations/Version20200713195731.php b/src/Migrations/Version20200713195731.php index b78918fc..4f610abf 100644 --- a/src/Migrations/Version20200713195731.php +++ b/src/Migrations/Version20200713195731.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization_package_download ALTER ip TYPE VARCHAR(45)'); $this->addSql('ALTER TABLE organization_package_webhook_request ALTER COLUMN ip TYPE VARCHAR(45)'); @@ -30,7 +30,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization_package_webhook_request ALTER COLUMN ip TYPE VARCHAR(15)'); $this->addSql('ALTER TABLE organization_package_download ALTER ip TYPE VARCHAR(15)'); diff --git a/src/Migrations/Version20200720112146.php b/src/Migrations/Version20200720112146.php index cdb97ba4..d96ec44b 100644 --- a/src/Migrations/Version20200720112146.php +++ b/src/Migrations/Version20200720112146.php @@ -8,6 +8,7 @@ use Buddy\Repman\Service\Proxy\ProxyRegister; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; +use InvalidArgumentException; use League\Flysystem\Exception; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -16,10 +17,10 @@ final class Version20200720112146 extends AbstractMigration implements Container { private ContainerInterface $container; - public function setContainer(ContainerInterface $container = null): void + public function setContainer(?ContainerInterface $container = null): void { - if ($container === null) { - throw new \InvalidArgumentException('Container is required'); + if (!$container instanceof ContainerInterface) { + throw new InvalidArgumentException('Container is required'); } $this->container = $container; @@ -36,7 +37,7 @@ public function up(Schema $schema): void $register = $this->container->get(ProxyRegister::class); $register->all()->forEach(function (Proxy $proxy) use ($filesystem): void { - foreach ($filesystem->listContents(sprintf('%s', (string) parse_url($proxy->url(), PHP_URL_HOST)), true) as $file) { + foreach ($filesystem->listContents((string) parse_url($proxy->url(), PHP_URL_HOST), true) as $file) { if ($file['type'] !== 'file') { continue; } @@ -46,12 +47,12 @@ public function up(Schema $schema): void $filesystem->delete($file['path']); } - if (strpos($file['basename'], '_') === false) { + if (!str_contains((string) $file['basename'], '_')) { continue; } // rename old dist files to new format - $newName = $file['dirname'].DIRECTORY_SEPARATOR.substr($file['basename'], strpos($file['basename'], '_') + 1); + $newName = $file['dirname'].DIRECTORY_SEPARATOR.substr((string) $file['basename'], strpos((string) $file['basename'], '_') + 1); if ($filesystem->has($newName)) { continue; } diff --git a/src/Migrations/Version20200723105216.php b/src/Migrations/Version20200723105216.php index c039c328..42c68c7c 100644 --- a/src/Migrations/Version20200723105216.php +++ b/src/Migrations/Version20200723105216.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql("INSERT INTO config (key, value) VALUES ('telemetry', 'disabled')"); } @@ -29,7 +29,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql("DELETE FROM config WHERE key = 'telemetry'"); } diff --git a/src/Migrations/Version20200724131616.php b/src/Migrations/Version20200724131616.php index 7a73c551..b30c0f4d 100644 --- a/src/Migrations/Version20200724131616.php +++ b/src/Migrations/Version20200724131616.php @@ -21,7 +21,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql("INSERT INTO config (key, value) VALUES ('technical_email', '')"); } @@ -29,7 +29,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql("DELETE FROM config WHERE key = 'technical_email'"); } diff --git a/src/Migrations/Version20200811170234.php b/src/Migrations/Version20200811170234.php index dad01f2d..f7fc055e 100644 --- a/src/Migrations/Version20200811170234.php +++ b/src/Migrations/Version20200811170234.php @@ -22,7 +22,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization_package_version ADD stability VARCHAR(255)'); @@ -42,7 +42,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('ALTER TABLE organization_package_version DROP stability'); } diff --git a/src/Migrations/Version20200902191522.php b/src/Migrations/Version20200902191522.php index 4b1c5dd4..d1878c73 100644 --- a/src/Migrations/Version20200902191522.php +++ b/src/Migrations/Version20200902191522.php @@ -21,20 +21,20 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('CREATE TABLE user_api_token (value VARCHAR(64) NOT NULL, user_id UUID NOT NULL, name VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, last_used_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(value))'); $this->addSql('CREATE INDEX IDX_7B42780FA76ED395 ON user_api_token (user_id)'); - $this->addSql('COMMENT ON COLUMN user_api_token.user_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN user_api_token.created_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN user_api_token.last_used_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql("COMMENT ON COLUMN user_api_token.user_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN user_api_token.created_at IS '(DC2Type:datetime_immutable)'"); + $this->addSql("COMMENT ON COLUMN user_api_token.last_used_at IS '(DC2Type:datetime_immutable)'"); $this->addSql('ALTER TABLE user_api_token ADD CONSTRAINT FK_7B42780FA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); + $this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, "Migration can only be executed safely on 'postgresql'."); $this->addSql('DROP TABLE user_api_token'); } diff --git a/src/Migrations/Version20210309201702.php b/src/Migrations/Version20210309201702.php index 3a7086ac..48eeb365 100644 --- a/src/Migrations/Version20210309201702.php +++ b/src/Migrations/Version20210309201702.php @@ -25,9 +25,9 @@ public function up(Schema $schema): void $this->addSql('CREATE INDEX link_package_id_idx ON organization_package_link (package_id)'); $this->addSql('CREATE INDEX IDX_4A06082932C8A3DE ON organization_package_link (organization_id)'); $this->addSql('CREATE INDEX link_target_idx ON organization_package_link (target)'); - $this->addSql('COMMENT ON COLUMN organization_package_link.id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_link.package_id IS \'(DC2Type:uuid)\''); - $this->addSql('COMMENT ON COLUMN organization_package_link.organization_id IS \'(DC2Type:uuid)\''); + $this->addSql("COMMENT ON COLUMN organization_package_link.id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_link.package_id IS '(DC2Type:uuid)'"); + $this->addSql("COMMENT ON COLUMN organization_package_link.organization_id IS '(DC2Type:uuid)'"); $this->addSql('ALTER TABLE organization_package_link ADD CONSTRAINT FK_CAKE4LIFE FOREIGN KEY (package_id) REFERENCES organization_package (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE organization_package_link ADD CONSTRAINT FK_4A06082932C8A3DE FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } diff --git a/src/Migrations/Version20210531095502.php b/src/Migrations/Version20210531095502.php index 230f33f6..7df415c6 100644 --- a/src/Migrations/Version20210531095502.php +++ b/src/Migrations/Version20210531095502.php @@ -29,7 +29,7 @@ public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE organization_package_link ADD organization_id UUID NOT NULL'); - $this->addSql('COMMENT ON COLUMN organization_package_link.organization_id IS \'(DC2Type:uuid)\''); + $this->addSql("COMMENT ON COLUMN organization_package_link.organization_id IS '(DC2Type:uuid)'"); $this->addSql('ALTER TABLE organization_package_link ADD CONSTRAINT fk_4a06082932c8a3de FOREIGN KEY (organization_id) REFERENCES organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('CREATE INDEX idx_4a06082932c8a3de ON organization_package_link (organization_id)'); } diff --git a/src/Migrations/Version20220316201455.php b/src/Migrations/Version20220316201455.php index afd50266..3482628c 100644 --- a/src/Migrations/Version20220316201455.php +++ b/src/Migrations/Version20220316201455.php @@ -20,7 +20,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE organization_package ADD enable_security_scan BOOLEAN DEFAULT \'true\' NOT NULL'); + $this->addSql("ALTER TABLE organization_package ADD enable_security_scan BOOLEAN DEFAULT 'true' NOT NULL"); } public function down(Schema $schema): void diff --git a/src/Query/Admin/ConfigQuery/DbalConfigQuery.php b/src/Query/Admin/ConfigQuery/DbalConfigQuery.php index 56c12e85..b5858111 100644 --- a/src/Query/Admin/ConfigQuery/DbalConfigQuery.php +++ b/src/Query/Admin/ConfigQuery/DbalConfigQuery.php @@ -9,11 +9,8 @@ final class DbalConfigQuery implements ConfigQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** diff --git a/src/Query/Admin/Model/Organization.php b/src/Query/Admin/Model/Organization.php index 3d20bdbf..6fd6b90e 100644 --- a/src/Query/Admin/Model/Organization.php +++ b/src/Query/Admin/Model/Organization.php @@ -6,17 +6,8 @@ final class Organization { - private string $id; - private string $name; - private string $alias; - private int $packagesCount; - - public function __construct(string $id, string $name, string $alias, int $packagesCount) + public function __construct(private readonly string $id, private readonly string $name, private readonly string $alias, private readonly int $packagesCount) { - $this->id = $id; - $this->name = $name; - $this->alias = $alias; - $this->packagesCount = $packagesCount; } public function id(): string diff --git a/src/Query/Admin/Model/User.php b/src/Query/Admin/Model/User.php index 070b0477..a9b80612 100644 --- a/src/Query/Admin/Model/User.php +++ b/src/Query/Admin/Model/User.php @@ -6,24 +6,11 @@ final class User { - private string $id; - private string $email; - private string $status; - - /** - * @var string[] - */ - private array $roles; - /** * @param string[] $roles */ - public function __construct(string $id, string $email, string $status, array $roles) + public function __construct(private readonly string $id, private readonly string $email, private readonly string $status, private readonly array $roles) { - $this->id = $id; - $this->email = $email; - $this->status = $status; - $this->roles = $roles; } public function id(): string diff --git a/src/Query/Admin/OrganizationQuery/DbalOrganizationQuery.php b/src/Query/Admin/OrganizationQuery/DbalOrganizationQuery.php index 5f28e73f..e6918462 100644 --- a/src/Query/Admin/OrganizationQuery/DbalOrganizationQuery.php +++ b/src/Query/Admin/OrganizationQuery/DbalOrganizationQuery.php @@ -8,15 +8,14 @@ use Buddy\Repman\Query\Admin\OrganizationQuery; use Buddy\Repman\Query\Filter; use Buddy\Repman\Query\User\Model\Installs; +use Buddy\Repman\Query\User\Model\Installs\Day; +use DateTimeImmutable; use Doctrine\DBAL\Connection; final class DbalOrganizationQuery implements OrganizationQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -52,9 +51,9 @@ public function getInstalls(int $lastDays = 30): Installs { return new Installs( array_map( - static fn (array $row): Installs\Day => new Installs\Day($row['date'], $row['count']), + static fn (array $row): Day => new Day($row['date'], $row['count']), $this->connection->fetchAllAssociative('SELECT * FROM (SELECT COUNT(package_id), date FROM organization_package_download WHERE date > :date GROUP BY date) AS installs ORDER BY date ASC', [ - 'date' => (new \DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), + 'date' => (new DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), ]), ), $lastDays, diff --git a/src/Query/Admin/Proxy/DownloadsQuery/DbalDownloadsQuery.php b/src/Query/Admin/Proxy/DownloadsQuery/DbalDownloadsQuery.php index ae16bf2d..955de3f2 100644 --- a/src/Query/Admin/Proxy/DownloadsQuery/DbalDownloadsQuery.php +++ b/src/Query/Admin/Proxy/DownloadsQuery/DbalDownloadsQuery.php @@ -7,15 +7,14 @@ use Buddy\Repman\Query\Admin\Proxy\DownloadsQuery; use Buddy\Repman\Query\Admin\Proxy\Model\Package; use Buddy\Repman\Query\User\Model\Installs; +use Buddy\Repman\Query\User\Model\Installs\Day; +use DateTimeImmutable; use Doctrine\DBAL\Connection; final class DbalDownloadsQuery implements DownloadsQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -33,7 +32,7 @@ public function findByNames(array $names): array ]) as $row) { $packages[$row['package']] = new Package( $row['downloads'], - new \DateTimeImmutable($row['date']) + new DateTimeImmutable($row['date']) ); } @@ -44,9 +43,9 @@ public function getInstalls(int $lastDays = 30): Installs { return new Installs( array_map( - static fn (array $row): Installs\Day => new Installs\Day(substr($row['date'], 0, 10), $row['count']), - $this->connection->fetchAllAssociative('SELECT * FROM (SELECT COUNT(*), DATE_TRUNC(\'day\', date) AS date FROM proxy_package_download WHERE date > :date GROUP BY DATE_TRUNC(\'day\', date)) AS installs ORDER BY date ASC', [ - 'date' => (new \DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), + static fn (array $row): Day => new Day(substr((string) $row['date'], 0, 10), $row['count']), + $this->connection->fetchAllAssociative("SELECT * FROM (SELECT COUNT(*), DATE_TRUNC('day', date) AS date FROM proxy_package_download WHERE date > :date GROUP BY DATE_TRUNC('day', date)) AS installs ORDER BY date ASC", [ + 'date' => (new DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), ]), ), $lastDays, diff --git a/src/Query/Admin/Proxy/Model/Package.php b/src/Query/Admin/Proxy/Model/Package.php index 63d67a7b..4e639c3e 100644 --- a/src/Query/Admin/Proxy/Model/Package.php +++ b/src/Query/Admin/Proxy/Model/Package.php @@ -4,15 +4,12 @@ namespace Buddy\Repman\Query\Admin\Proxy\Model; +use DateTimeImmutable; + final class Package { - private int $downloads; - private \DateTimeImmutable $lastDownload; - - public function __construct(int $downloads, \DateTimeImmutable $lastDownload) + public function __construct(private readonly int $downloads, private readonly DateTimeImmutable $lastDownload) { - $this->downloads = $downloads; - $this->lastDownload = $lastDownload; } public function downloads(): int @@ -20,7 +17,7 @@ public function downloads(): int return $this->downloads; } - public function lastDownload(): \DateTimeImmutable + public function lastDownload(): DateTimeImmutable { return $this->lastDownload; } diff --git a/src/Query/Admin/TelemetryQuery.php b/src/Query/Admin/TelemetryQuery.php index 0193497f..05abebef 100644 --- a/src/Query/Admin/TelemetryQuery.php +++ b/src/Query/Admin/TelemetryQuery.php @@ -6,6 +6,7 @@ use Buddy\Repman\Service\Telemetry\Entry\Organization; use Buddy\Repman\Service\Telemetry\Entry\Package; +use DateTimeImmutable; interface TelemetryQuery { @@ -19,13 +20,13 @@ public function organizationsCount(): int; /** * @return Package[] */ - public function packages(string $organizationId, \DateTimeImmutable $till, int $limit = 100, int $offset = 0): array; + public function packages(string $organizationId, DateTimeImmutable $till, int $limit = 100, int $offset = 0): array; public function packagesCount(string $organizationId): int; public function usersCount(): int; - public function privateDownloads(\DateTimeImmutable $till): int; + public function privateDownloads(DateTimeImmutable $till): int; - public function proxyDownloads(\DateTimeImmutable $till): int; + public function proxyDownloads(DateTimeImmutable $till): int; } diff --git a/src/Query/Admin/TelemetryQuery/DbalTelemetryQuery.php b/src/Query/Admin/TelemetryQuery/DbalTelemetryQuery.php index d1b5851e..5d3b5756 100644 --- a/src/Query/Admin/TelemetryQuery/DbalTelemetryQuery.php +++ b/src/Query/Admin/TelemetryQuery/DbalTelemetryQuery.php @@ -8,15 +8,13 @@ use Buddy\Repman\Query\Admin\TelemetryQuery; use Buddy\Repman\Service\Telemetry\Entry\Organization; use Buddy\Repman\Service\Telemetry\Entry\Package; +use DateTimeImmutable; use Doctrine\DBAL\Connection; final class DbalTelemetryQuery implements TelemetryQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } public function usersCount(): int @@ -33,16 +31,14 @@ public function usersCount(): int */ public function organizations(int $limit = 100, int $offset = 0): array { - return array_map(function (array $data): Organization { - return new Organization( - $data['id'], - $data['tokens'], - $data['has_anonymous_access'], - $data['members'], - $data['owners'], - ); - }, $this->connection->fetchAllAssociative( - 'SELECT + return array_map(fn (array $data): Organization => new Organization( + $data['id'], + $data['tokens'], + $data['has_anonymous_access'], + $data['members'], + $data['owners'], + ), $this->connection->fetchAllAssociative( + 'SELECT o.id, COUNT(t.value) tokens, o.has_anonymous_access, @@ -53,12 +49,12 @@ public function organizations(int $limit = 100, int $offset = 0): array LEFT JOIN "organization_member" m ON m.organization_id = o.id GROUP BY o.id LIMIT :limit OFFSET :offset', - [ - 'role_member' => Member::ROLE_MEMBER, - 'role_owner' => Member::ROLE_OWNER, - 'limit' => $limit, - 'offset' => $offset, - ]) + [ + 'role_member' => Member::ROLE_MEMBER, + 'role_owner' => Member::ROLE_OWNER, + 'limit' => $limit, + 'offset' => $offset, + ]) ); } @@ -74,22 +70,20 @@ public function organizationsCount(): int /** * @return Package[] */ - public function packages(string $organizationId, \DateTimeImmutable $till, int $limit = 100, int $offset = 0): array + public function packages(string $organizationId, DateTimeImmutable $till, int $limit = 100, int $offset = 0): array { - return array_map(function (array $data): Package { - return new Package( - $data['type'], - $data['latest_release_date'] === null ? null : new \DateTimeImmutable($data['latest_release_date']), - $data['last_sync_at'] === null ? null : new \DateTimeImmutable($data['last_sync_at']), - $data['last_scan_date'] === null ? null : new \DateTimeImmutable($data['last_scan_date']), - $data['last_sync_error'] !== null, - $data['webhook_created_at'] !== null, - $data['last_scan_status'] ?? '', - $data['downloads'], - $data['webhooks'], - ); - }, $this->connection->fetchAllAssociative( - 'SELECT + return array_map(fn (array $data): Package => new Package( + $data['type'], + $data['latest_release_date'] === null ? null : new DateTimeImmutable($data['latest_release_date']), + $data['last_sync_at'] === null ? null : new DateTimeImmutable($data['last_sync_at']), + $data['last_scan_date'] === null ? null : new DateTimeImmutable($data['last_scan_date']), + $data['last_sync_error'] !== null, + $data['webhook_created_at'] !== null, + $data['last_scan_status'] ?? '', + $data['downloads'], + $data['webhooks'], + ), $this->connection->fetchAllAssociative( + 'SELECT p.type, p.latest_release_date, p.last_sync_at, @@ -102,12 +96,12 @@ public function packages(string $organizationId, \DateTimeImmutable $till, int $ FROM "organization_package" p WHERE p.organization_id = :organization_id LIMIT :limit OFFSET :offset', - [ - 'organization_id' => $organizationId, - 'till' => $till->format('Y-m-d'), - 'limit' => $limit, - 'offset' => $offset, - ]) + [ + 'organization_id' => $organizationId, + 'till' => $till->format('Y-m-d'), + 'limit' => $limit, + 'offset' => $offset, + ]) ); } @@ -124,7 +118,7 @@ public function packagesCount(string $organizationId): int ); } - public function proxyDownloads(\DateTimeImmutable $till): int + public function proxyDownloads(DateTimeImmutable $till): int { return (int) $this ->connection @@ -135,7 +129,7 @@ public function proxyDownloads(\DateTimeImmutable $till): int ); } - public function privateDownloads(\DateTimeImmutable $till): int + public function privateDownloads(DateTimeImmutable $till): int { return (int) $this ->connection diff --git a/src/Query/Admin/UserQuery/DbalUserQuery.php b/src/Query/Admin/UserQuery/DbalUserQuery.php index 9560ed7b..f342c721 100644 --- a/src/Query/Admin/UserQuery/DbalUserQuery.php +++ b/src/Query/Admin/UserQuery/DbalUserQuery.php @@ -9,14 +9,12 @@ use Buddy\Repman\Query\Filter; use Doctrine\DBAL\Connection; use Munus\Control\Option; +use function mb_strtolower; final class DbalUserQuery implements UserQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } public function findAll(Filter $filter): array @@ -36,7 +34,7 @@ public function findAll(Filter $filter): array public function getByEmail(string $email): Option { $data = $this->connection->fetchAssociative('SELECT id, email, status, roles FROM "user" WHERE email = :email', [ - 'email' => \mb_strtolower($email), + 'email' => mb_strtolower($email), ]); if ($data === false) { return Option::none(); @@ -74,7 +72,7 @@ private function hydrateUser(array $data): User $data['id'], $data['email'], $data['status'], - json_decode($data['roles']) + json_decode((string) $data['roles']) ); } } diff --git a/src/Query/Api/Model/Error.php b/src/Query/Api/Model/Error.php index 2c0f2147..33ca4eeb 100644 --- a/src/Query/Api/Model/Error.php +++ b/src/Query/Api/Model/Error.php @@ -4,16 +4,12 @@ namespace Buddy\Repman\Query\Api\Model; -final class Error implements \JsonSerializable -{ - private string $field; - - private string $message; +use JsonSerializable; - public function __construct(string $field, string $message) +final class Error implements JsonSerializable +{ + public function __construct(private readonly string $field, private readonly string $message) { - $this->field = $field; - $this->message = $message; } public function getField(): string @@ -32,8 +28,8 @@ public function getMessage(): string public function jsonSerialize(): array { return [ - 'field' => $this->getField(), - 'message' => $this->getMessage(), + 'field' => $this->field, + 'message' => $this->message, ]; } } diff --git a/src/Query/Api/Model/Errors.php b/src/Query/Api/Model/Errors.php index 1d431e3b..6c485a25 100644 --- a/src/Query/Api/Model/Errors.php +++ b/src/Query/Api/Model/Errors.php @@ -4,19 +4,15 @@ namespace Buddy\Repman\Query\Api\Model; -final class Errors implements \JsonSerializable -{ - /** - * @var Error[] - */ - private array $errors; +use JsonSerializable; +final class Errors implements JsonSerializable +{ /** * @param Error[] $errors */ - public function __construct(array $errors) + public function __construct(private readonly array $errors) { - $this->errors = $errors; } /** @@ -33,7 +29,7 @@ public function getErrors(): array public function jsonSerialize(): array { return [ - 'errors' => $this->getErrors(), + 'errors' => $this->errors, ]; } } diff --git a/src/Query/Api/Model/Links.php b/src/Query/Api/Model/Links.php index b8cfa015..e7825ea9 100644 --- a/src/Query/Api/Model/Links.php +++ b/src/Query/Api/Model/Links.php @@ -4,17 +4,12 @@ namespace Buddy\Repman\Query\Api\Model; -final class Links implements \JsonSerializable -{ - private string $baseUrl; - private int $page; - private int $pages; +use JsonSerializable; - public function __construct(string $baseUrl, int $page, int $pages) +final class Links implements JsonSerializable +{ + public function __construct(private readonly string $baseUrl, private readonly int $page, private readonly int $pages) { - $this->baseUrl = $baseUrl; - $this->page = $page; - $this->pages = $pages; } public function getFirst(): string @@ -39,7 +34,7 @@ public function getLast(): string private function generateUrl(int $page): string { - return $this->baseUrl."?page=$page"; + return $this->baseUrl.('?page='.$page); } /** diff --git a/src/Query/Api/Model/Organization.php b/src/Query/Api/Model/Organization.php index 33c0443f..8d9758f3 100644 --- a/src/Query/Api/Model/Organization.php +++ b/src/Query/Api/Model/Organization.php @@ -4,19 +4,12 @@ namespace Buddy\Repman\Query\Api\Model; -final class Organization implements \JsonSerializable -{ - private string $id; - private string $name; - private string $alias; - private bool $hasAnonymousAccess; +use JsonSerializable; - public function __construct(string $id, string $name, string $alias, bool $hasAnonymousAccess) +final class Organization implements JsonSerializable +{ + public function __construct(private readonly string $id, private readonly string $name, private readonly string $alias, private readonly bool $hasAnonymousAccess) { - $this->id = $id; - $this->name = $name; - $this->alias = $alias; - $this->hasAnonymousAccess = $hasAnonymousAccess; } public function getId(): string @@ -45,10 +38,10 @@ public function getHasAnonymousAccess(): bool public function jsonSerialize(): array { return [ - 'id' => $this->getId(), - 'name' => $this->getName(), - 'alias' => $this->getAlias(), - 'hasAnonymousAccess' => $this->getHasAnonymousAccess(), + 'id' => $this->id, + 'name' => $this->name, + 'alias' => $this->alias, + 'hasAnonymousAccess' => $this->hasAnonymousAccess, ]; } } diff --git a/src/Query/Api/Model/Package.php b/src/Query/Api/Model/Package.php index f4504883..62305089 100644 --- a/src/Query/Api/Model/Package.php +++ b/src/Query/Api/Model/Package.php @@ -5,51 +5,30 @@ namespace Buddy\Repman\Query\Api\Model; use Buddy\Repman\Query\User\Model\ScanResult; +use DateTime; +use DateTimeImmutable; +use JsonSerializable; -final class Package implements \JsonSerializable +final class Package implements JsonSerializable { - private string $id; - private string $type; - private string $url; - private ?string $name; - private ?string $latestReleasedVersion; - private ?\DateTimeImmutable $latestReleaseDate; - private ?string $description; - private ?\DateTimeImmutable $lastSyncAt; - private ?string $lastSyncError; - private ?\DateTimeImmutable $webhookCreatedAt; - private ?ScanResult $scanResult; - private int $keepLastReleases; - private bool $enableSecurityScan; + private readonly ?ScanResult $scanResult; public function __construct( - string $id, - string $type, - string $url, - ?string $name = null, - ?string $latestReleasedVersion = null, - ?\DateTimeImmutable $latestReleaseDate = null, - ?string $description = null, - ?\DateTimeImmutable $lastSyncAt = null, - ?string $lastSyncError = null, - ?\DateTimeImmutable $webhookCreatedAt = null, + private readonly string $id, + private readonly string $type, + private readonly string $url, + private readonly ?string $name = null, + private readonly ?string $latestReleasedVersion = null, + private readonly ?DateTimeImmutable $latestReleaseDate = null, + private readonly ?string $description = null, + private readonly ?DateTimeImmutable $lastSyncAt = null, + private readonly ?string $lastSyncError = null, + private readonly ?DateTimeImmutable $webhookCreatedAt = null, ?ScanResult $scanResult = null, - int $keepLastReleases = 0, - bool $enableSecurityScan = true + private readonly int $keepLastReleases = 0, + private readonly bool $enableSecurityScan = true, ) { - $this->id = $id; - $this->type = $type; - $this->url = $url; - $this->name = $name; - $this->latestReleasedVersion = $latestReleasedVersion; - $this->latestReleaseDate = $latestReleaseDate; - $this->description = $description; - $this->lastSyncAt = $lastSyncAt; - $this->lastSyncError = $lastSyncError; - $this->webhookCreatedAt = $webhookCreatedAt; $this->scanResult = $scanResult ?? null; - $this->keepLastReleases = $keepLastReleases; - $this->enableSecurityScan = $enableSecurityScan; } public function getId(): string @@ -77,7 +56,7 @@ public function getLatestReleasedVersion(): ?string return $this->latestReleasedVersion; } - public function getLatestReleaseDate(): ?\DateTimeImmutable + public function getLatestReleaseDate(): ?DateTimeImmutable { return $this->latestReleaseDate; } @@ -87,7 +66,7 @@ public function getDescription(): ?string return $this->description; } - public function getLastSyncAt(): ?\DateTimeImmutable + public function getLastSyncAt(): ?DateTimeImmutable { return $this->lastSyncAt; } @@ -97,24 +76,24 @@ public function getLastSyncError(): ?string return $this->lastSyncError; } - public function getWebhookCreatedAt(): ?\DateTimeImmutable + public function getWebhookCreatedAt(): ?DateTimeImmutable { return $this->webhookCreatedAt; } public function getIsSynchronizedSuccessfully(): bool { - return $this->getName() !== null && $this->getLastSyncError() === null; + return $this->name !== null && $this->lastSyncError === null; } public function getScanResultStatus(): string { - return $this->scanResult !== null ? $this->scanResult->status() : ScanResult::statusPending(); + return $this->scanResult instanceof ScanResult ? $this->scanResult->status() : ScanResult::statusPending(); } - public function getScanResultDate(): ?\DateTimeImmutable + public function getScanResultDate(): ?DateTimeImmutable { - return $this->scanResult !== null ? $this->scanResult->date() : null; + return $this->scanResult instanceof ScanResult ? $this->scanResult->date() : null; } /** @@ -122,7 +101,7 @@ public function getScanResultDate(): ?\DateTimeImmutable */ public function getLastScanResultContent(): array { - return $this->scanResult !== null ? $this->scanResult->content() : []; + return $this->scanResult instanceof ScanResult ? $this->scanResult->content() : []; } public function getKeepLastReleases(): int @@ -141,22 +120,22 @@ public function isEnabledSecurityScan(): bool public function jsonSerialize(): array { return [ - 'id' => $this->getId(), - 'type' => $this->getType(), - 'url' => $this->getUrl(), - 'name' => $this->getName(), - 'latestReleasedVersion' => $this->getLatestReleasedVersion(), - 'latestReleaseDate' => $this->getLatestReleaseDate() === null ? null : $this->getLatestReleaseDate()->format(\DateTime::ATOM), - 'description' => $this->getDescription(), - 'lastSyncAt' => $this->getLastSyncAt() === null ? null : $this->getLastSyncAt()->format(\DateTime::ATOM), - 'lastSyncError' => $this->getLastSyncError(), - 'webhookCreatedAt' => $this->getWebhookCreatedAt() === null ? null : $this->getWebhookCreatedAt()->format(\DateTime::ATOM), + 'id' => $this->id, + 'type' => $this->type, + 'url' => $this->url, + 'name' => $this->name, + 'latestReleasedVersion' => $this->latestReleasedVersion, + 'latestReleaseDate' => $this->latestReleaseDate instanceof DateTimeImmutable ? $this->latestReleaseDate->format(DateTime::ATOM) : null, + 'description' => $this->description, + 'lastSyncAt' => $this->lastSyncAt instanceof DateTimeImmutable ? $this->lastSyncAt->format(DateTime::ATOM) : null, + 'lastSyncError' => $this->lastSyncError, + 'webhookCreatedAt' => $this->webhookCreatedAt instanceof DateTimeImmutable ? $this->webhookCreatedAt->format(DateTime::ATOM) : null, 'isSynchronizedSuccessfully' => $this->getIsSynchronizedSuccessfully(), - 'scanResultDate' => $this->getScanResultDate() === null ? null : $this->getScanResultDate()->format(\DateTime::ATOM), + 'scanResultDate' => $this->getScanResultDate() instanceof DateTimeImmutable ? $this->getScanResultDate()->format(DateTime::ATOM) : null, 'scanResultStatus' => $this->getScanResultStatus(), 'lastScanResultContent' => $this->getLastScanResultContent(), - 'keepLastReleases' => $this->getKeepLastReleases(), - 'enableSecurityScan' => $this->isEnabledSecurityScan(), + 'keepLastReleases' => $this->keepLastReleases, + 'enableSecurityScan' => $this->enableSecurityScan, ]; } } diff --git a/src/Query/Api/Model/Paginated.php b/src/Query/Api/Model/Paginated.php index de4e43da..aae51770 100644 --- a/src/Query/Api/Model/Paginated.php +++ b/src/Query/Api/Model/Paginated.php @@ -4,23 +4,15 @@ namespace Buddy\Repman\Query\Api\Model; -abstract class Paginated implements \JsonSerializable -{ - /** - * @var object[] - */ - protected array $data; - protected int $total; - protected Links $links; +use JsonSerializable; +abstract class Paginated implements JsonSerializable +{ /** * @param object[] $data */ - public function __construct(array $data, int $total, Links $links) + public function __construct(protected array $data, protected int $total, protected Links $links) { - $this->data = $data; - $this->total = $total; - $this->links = $links; } /** diff --git a/src/Query/Api/Model/Token.php b/src/Query/Api/Model/Token.php index 1203e622..87d06b8c 100644 --- a/src/Query/Api/Model/Token.php +++ b/src/Query/Api/Model/Token.php @@ -4,19 +4,14 @@ namespace Buddy\Repman\Query\Api\Model; -final class Token implements \JsonSerializable -{ - private string $name; - private string $value; - private \DateTimeImmutable $createdAt; - private ?\DateTimeImmutable $lastUsedAt; +use DateTime; +use DateTimeImmutable; +use JsonSerializable; - public function __construct(string $name, string $value, \DateTimeImmutable $createdAt, ?\DateTimeImmutable $lastUsedAt) +final class Token implements JsonSerializable +{ + public function __construct(private readonly string $name, private readonly string $value, private readonly DateTimeImmutable $createdAt, private readonly ?DateTimeImmutable $lastUsedAt) { - $this->name = $name; - $this->value = $value; - $this->createdAt = $createdAt; - $this->lastUsedAt = $lastUsedAt; } public function getName(): string @@ -29,12 +24,12 @@ public function getValue(): string return $this->value; } - public function getCreatedAt(): \DateTimeImmutable + public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } - public function getLastUsedAt(): ?\DateTimeImmutable + public function getLastUsedAt(): ?DateTimeImmutable { return $this->lastUsedAt; } @@ -45,10 +40,10 @@ public function getLastUsedAt(): ?\DateTimeImmutable public function jsonSerialize(): array { return [ - 'name' => $this->getName(), - 'value' => $this->getValue(), - 'createdAt' => $this->getCreatedAt()->format(\DateTime::ATOM), - 'lastUsedAt' => $this->getLastUsedAt() === null ? null : $this->getLastUsedAt()->format(\DateTime::ATOM), + 'name' => $this->name, + 'value' => $this->value, + 'createdAt' => $this->createdAt->format(DateTime::ATOM), + 'lastUsedAt' => $this->lastUsedAt instanceof DateTimeImmutable ? $this->lastUsedAt->format(DateTime::ATOM) : null, ]; } } diff --git a/src/Query/Api/OrganizationQuery/DbalOrganizationQuery.php b/src/Query/Api/OrganizationQuery/DbalOrganizationQuery.php index 7987cfc9..23c61307 100644 --- a/src/Query/Api/OrganizationQuery/DbalOrganizationQuery.php +++ b/src/Query/Api/OrganizationQuery/DbalOrganizationQuery.php @@ -7,16 +7,14 @@ use Buddy\Repman\Query\Api\Model\Organization; use Buddy\Repman\Query\Api\Model\Token; use Buddy\Repman\Query\Api\OrganizationQuery; +use DateTimeImmutable; use Doctrine\DBAL\Connection; use Munus\Control\Option; final class DbalOrganizationQuery implements OrganizationQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -27,8 +25,8 @@ public function getById(string $id): Option $data = $this->connection->fetchAssociative( 'SELECT id, name, alias, has_anonymous_access FROM "organization" WHERE id = :id', [ - 'id' => $id, - ]); + 'id' => $id, + ]); return $data === false ? Option::none() : Option::some($this->hydrateOrganization($data)); } @@ -111,9 +109,9 @@ public function findToken(string $organizationId, string $value): Option FROM organization_token WHERE organization_id = :organization_id AND value = :value LIMIT 1', [ - 'organization_id' => $organizationId, - 'value' => $value, - ]); + 'organization_id' => $organizationId, + 'value' => $value, + ]); if ($data === false) { return Option::none(); @@ -132,9 +130,9 @@ public function findTokenByName(string $organizationId, string $name): Option FROM organization_token WHERE organization_id = :organization_id AND name = :name ORDER BY created_at DESC', [ - 'organization_id' => $organizationId, - 'name' => $name, - ]); + 'organization_id' => $organizationId, + 'name' => $name, + ]); return $data === false ? Option::none() : Option::some($this->hydrateToken($data)); } @@ -160,8 +158,8 @@ private function hydrateToken(array $data): Token return new Token( $data['name'], $data['value'], - new \DateTimeImmutable($data['created_at']), - $data['last_used_at'] !== null ? new \DateTimeImmutable($data['last_used_at']) : null + new DateTimeImmutable($data['created_at']), + $data['last_used_at'] !== null ? new DateTimeImmutable($data['last_used_at']) : null ); } } diff --git a/src/Query/Api/PackageQuery/DbalPackageQuery.php b/src/Query/Api/PackageQuery/DbalPackageQuery.php index 367d7e54..fd09c734 100644 --- a/src/Query/Api/PackageQuery/DbalPackageQuery.php +++ b/src/Query/Api/PackageQuery/DbalPackageQuery.php @@ -7,16 +7,14 @@ use Buddy\Repman\Query\Api\Model\Package; use Buddy\Repman\Query\Api\PackageQuery; use Buddy\Repman\Query\User\Model\ScanResult; +use DateTimeImmutable; use Doctrine\DBAL\Connection; use Munus\Control\Option; final class DbalPackageQuery implements PackageQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -24,10 +22,8 @@ public function __construct(Connection $connection) */ public function findAll(string $organizationId, int $limit = 20, int $offset = 0): array { - return array_map(function (array $data): Package { - return $this->hydratePackage($data); - }, $this->connection->fetchAllAssociative( - 'SELECT + return array_map(fn (array $data): Package => $this->hydratePackage($data), $this->connection->fetchAllAssociative( + 'SELECT id, type, repository_url, @@ -48,10 +44,10 @@ public function findAll(string $organizationId, int $limit = 20, int $offset = 0 GROUP BY id ORDER BY name ASC LIMIT :limit OFFSET :offset', [ - 'organization_id' => $organizationId, - 'limit' => $limit, - 'offset' => $offset, - ])); + 'organization_id' => $organizationId, + 'limit' => $limit, + 'offset' => $offset, + ])); } public function count(string $organizationId): int @@ -91,9 +87,9 @@ public function getById(string $organizationId, string $id): Option enable_security_scan FROM "organization_package" WHERE organization_id = :organization_id AND id = :id', [ - 'organization_id' => $organizationId, - 'id' => $id, - ]); + 'organization_id' => $organizationId, + 'id' => $id, + ]); if ($data === false) { return Option::none(); } @@ -108,7 +104,7 @@ private function hydratePackage(array $data): Package { $scanResult = isset($data['last_scan_status']) ? new ScanResult( - new \DateTimeImmutable($data['last_scan_date']), + new DateTimeImmutable($data['last_scan_date']), $data['last_scan_status'], $data['latest_released_version'], $data['last_scan_result'], @@ -120,11 +116,11 @@ private function hydratePackage(array $data): Package $data['repository_url'], $data['name'], $data['latest_released_version'], - $data['latest_release_date'] !== null ? new \DateTimeImmutable($data['latest_release_date']) : null, + $data['latest_release_date'] !== null ? new DateTimeImmutable($data['latest_release_date']) : null, $data['description'], - $data['last_sync_at'] !== null ? new \DateTimeImmutable($data['last_sync_at']) : null, + $data['last_sync_at'] !== null ? new DateTimeImmutable($data['last_sync_at']) : null, $data['last_sync_error'], - $data['webhook_created_at'] !== null ? new \DateTimeImmutable($data['webhook_created_at']) : null, + $data['webhook_created_at'] !== null ? new DateTimeImmutable($data['webhook_created_at']) : null, $scanResult, $data['keep_last_releases'], $data['enable_security_scan'] diff --git a/src/Query/Filter.php b/src/Query/Filter.php index c2a1f4a4..0d1465cc 100644 --- a/src/Query/Filter.php +++ b/src/Query/Filter.php @@ -9,9 +9,12 @@ class Filter { private int $offset = 0; + private int $limit = 20; + private ?string $sortColumn = null; - private string $sortOrder; + + private readonly string $sortOrder; public function __construct(int $offset = 0, int $limit = 20, ?string $sort = null) { diff --git a/src/Query/User/Model/ApiToken.php b/src/Query/User/Model/ApiToken.php index c326763d..00b11374 100644 --- a/src/Query/User/Model/ApiToken.php +++ b/src/Query/User/Model/ApiToken.php @@ -4,19 +4,12 @@ namespace Buddy\Repman\Query\User\Model; +use DateTimeImmutable; + final class ApiToken { - private string $name; - private string $value; - private \DateTimeImmutable $createdAt; - private ?\DateTimeImmutable $lastUsedAt; - - public function __construct(string $name, string $value, \DateTimeImmutable $createdAt, ?\DateTimeImmutable $lastUsedAt) + public function __construct(private readonly string $name, private readonly string $value, private readonly DateTimeImmutable $createdAt, private readonly ?DateTimeImmutable $lastUsedAt) { - $this->name = $name; - $this->value = $value; - $this->createdAt = $createdAt; - $this->lastUsedAt = $lastUsedAt; } public function name(): string @@ -29,12 +22,12 @@ public function value(): string return $this->value; } - public function createdAt(): \DateTimeImmutable + public function createdAt(): DateTimeImmutable { return $this->createdAt; } - public function lastUsedAt(): ?\DateTimeImmutable + public function lastUsedAt(): ?DateTimeImmutable { return $this->lastUsedAt; } diff --git a/src/Query/User/Model/Installs.php b/src/Query/User/Model/Installs.php index ceb0dd43..ccbc504b 100644 --- a/src/Query/User/Model/Installs.php +++ b/src/Query/User/Model/Installs.php @@ -5,23 +5,21 @@ namespace Buddy\Repman\Query\User\Model; use Buddy\Repman\Query\User\Model\Installs\Day; +use DateTimeImmutable; final class Installs { /** * @var Day[] */ - private array $days; - - private int $total; + private readonly array $days; /** * @param Day[] $days */ - public function __construct(array $days, int $preriod, int $total) + public function __construct(array $days, int $preriod, private readonly int $total) { $this->days = $this->addMissing($days, $preriod); - $this->total = $total; } /** @@ -55,11 +53,12 @@ private function addMissing(array $days, int $period): array } for ($i = 0; $i < $period; ++$i) { - $date = (new \DateTimeImmutable())->modify(sprintf('-%s days', $i))->format('Y-m-d'); + $date = (new DateTimeImmutable())->modify(sprintf('-%s days', $i))->format('Y-m-d'); if (!isset($all[$date])) { $all[$date] = new Day($date, 0); } } + ksort($all); return array_values($all); diff --git a/src/Query/User/Model/Installs/Day.php b/src/Query/User/Model/Installs/Day.php index eec83583..7eeb54b4 100644 --- a/src/Query/User/Model/Installs/Day.php +++ b/src/Query/User/Model/Installs/Day.php @@ -6,13 +6,8 @@ final class Day { - private string $date; - private int $installs; - - public function __construct(string $date, int $installs) + public function __construct(private readonly string $date, private readonly int $installs) { - $this->date = $date; - $this->installs = $installs; } public function date(): string diff --git a/src/Query/User/Model/OAuthToken.php b/src/Query/User/Model/OAuthToken.php index 453de08f..14d1feb7 100644 --- a/src/Query/User/Model/OAuthToken.php +++ b/src/Query/User/Model/OAuthToken.php @@ -4,15 +4,12 @@ namespace Buddy\Repman\Query\User\Model; +use DateTimeImmutable; + final class OAuthToken { - private string $type; - private \DateTimeImmutable $createdAt; - - public function __construct(string $type, \DateTimeImmutable $createdAt) + public function __construct(private readonly string $type, private readonly DateTimeImmutable $createdAt) { - $this->type = $type; - $this->createdAt = $createdAt; } public function type(): string @@ -20,7 +17,7 @@ public function type(): string return $this->type; } - public function createdAt(): \DateTimeImmutable + public function createdAt(): DateTimeImmutable { return $this->createdAt; } diff --git a/src/Query/User/Model/Organization.php b/src/Query/User/Model/Organization.php index c361b6a3..c73c38e0 100644 --- a/src/Query/User/Model/Organization.php +++ b/src/Query/User/Model/Organization.php @@ -9,26 +9,17 @@ final class Organization { - private string $id; - private string $name; - private string $alias; - private bool $hasAnonymousAccess; - /** * @var Member[] */ - private array $members; + private readonly array $members; /** * @param Member[] $members */ - public function __construct(string $id, string $name, string $alias, array $members, bool $hasAnonymousAccess) + public function __construct(private readonly string $id, private readonly string $name, private readonly string $alias, array $members, private readonly bool $hasAnonymousAccess) { - $this->id = $id; - $this->name = $name; - $this->alias = $alias; $this->members = array_map(fn (Member $member) => $member, $members); - $this->hasAnonymousAccess = $hasAnonymousAccess; } public function id(): string diff --git a/src/Query/User/Model/Organization/Invitation.php b/src/Query/User/Model/Organization/Invitation.php index 0a61ec96..b81512ef 100644 --- a/src/Query/User/Model/Organization/Invitation.php +++ b/src/Query/User/Model/Organization/Invitation.php @@ -6,15 +6,8 @@ final class Invitation { - private string $email; - private string $role; - private string $token; - - public function __construct(string $email, string $role, string $token) + public function __construct(private readonly string $email, private readonly string $role, private readonly string $token) { - $this->email = $email; - $this->role = $role; - $this->token = $token; } public function email(): string diff --git a/src/Query/User/Model/Organization/Member.php b/src/Query/User/Model/Organization/Member.php index 5975f598..2ea542ae 100644 --- a/src/Query/User/Model/Organization/Member.php +++ b/src/Query/User/Model/Organization/Member.php @@ -6,15 +6,8 @@ final class Member { - private string $userId; - private string $email; - private string $role; - - public function __construct(string $userId, string $email, string $role) + public function __construct(private readonly string $userId, private readonly string $email, private readonly string $role) { - $this->userId = $userId; - $this->email = $email; - $this->role = $role; } public function userId(): string diff --git a/src/Query/User/Model/Organization/Token.php b/src/Query/User/Model/Organization/Token.php index 4dd432b3..1fbf664f 100644 --- a/src/Query/User/Model/Organization/Token.php +++ b/src/Query/User/Model/Organization/Token.php @@ -4,19 +4,12 @@ namespace Buddy\Repman\Query\User\Model\Organization; +use DateTimeImmutable; + final class Token { - private string $name; - private string $value; - private \DateTimeImmutable $createdAt; - private ?\DateTimeImmutable $lastUsedAt; - - public function __construct(string $name, string $value, \DateTimeImmutable $createdAt, ?\DateTimeImmutable $lastUsedAt) + public function __construct(private readonly string $name, private readonly string $value, private readonly DateTimeImmutable $createdAt, private readonly ?DateTimeImmutable $lastUsedAt) { - $this->name = $name; - $this->value = $value; - $this->createdAt = $createdAt; - $this->lastUsedAt = $lastUsedAt; } public function name(): string @@ -29,12 +22,12 @@ public function value(): string return $this->value; } - public function createdAt(): \DateTimeImmutable + public function createdAt(): DateTimeImmutable { return $this->createdAt; } - public function lastUsedAt(): ?\DateTimeImmutable + public function lastUsedAt(): ?DateTimeImmutable { return $this->lastUsedAt; } diff --git a/src/Query/User/Model/Package.php b/src/Query/User/Model/Package.php index 0952e5d0..679bed4a 100644 --- a/src/Query/User/Model/Package.php +++ b/src/Query/User/Model/Package.php @@ -4,57 +4,30 @@ namespace Buddy\Repman\Query\User\Model; +use DateTimeImmutable; + final class Package { use PackageScanResultTrait; - private string $id; - private string $organizationId; - private string $type; - private string $url; - private ?string $name; - private ?string $latestReleasedVersion; - private ?\DateTimeImmutable $latestReleaseDate; - private ?string $description; - private ?\DateTimeImmutable $lastSyncAt; - private ?string $lastSyncError; - private ?\DateTimeImmutable $webhookCreatedAt; - private ?string $webhookCreatedError; - private int $keepLastReleases; - private bool $enableSecurityScan; - public function __construct( - string $id, - string $organizationId, - string $type, - string $url, - ?string $name = null, - ?string $latestReleasedVersion = null, - ?\DateTimeImmutable $latestReleaseDate = null, - ?string $description = null, - ?\DateTimeImmutable $lastSyncAt = null, - ?string $lastSyncError = null, - ?\DateTimeImmutable $webhookCreatedAt = null, - ?string $webhookCreatedError = null, + private string $id, + private string $organizationId, + private string $type, + private string $url, + private ?string $name = null, + private ?string $latestReleasedVersion = null, + private ?DateTimeImmutable $latestReleaseDate = null, + private ?string $description = null, + private ?DateTimeImmutable $lastSyncAt = null, + private ?string $lastSyncError = null, + private ?DateTimeImmutable $webhookCreatedAt = null, + private ?string $webhookCreatedError = null, ?ScanResult $scanResult = null, - int $keepLastReleases = 0, - bool $enableSecurityScan = true + private int $keepLastReleases = 0, + private bool $enableSecurityScan = true, ) { - $this->id = $id; - $this->organizationId = $organizationId; - $this->type = $type; - $this->url = $url; - $this->name = $name; - $this->latestReleasedVersion = $latestReleasedVersion; - $this->latestReleaseDate = $latestReleaseDate; - $this->description = $description; - $this->lastSyncAt = $lastSyncAt; - $this->lastSyncError = $lastSyncError; - $this->webhookCreatedAt = $webhookCreatedAt; - $this->webhookCreatedError = $webhookCreatedError; $this->scanResult = $scanResult ?? null; - $this->keepLastReleases = $keepLastReleases; - $this->enableSecurityScan = $enableSecurityScan; } public function id(): string @@ -87,7 +60,7 @@ public function latestReleasedVersion(): ?string return $this->latestReleasedVersion; } - public function latestReleaseDate(): ?\DateTimeImmutable + public function latestReleaseDate(): ?DateTimeImmutable { return $this->latestReleaseDate; } @@ -97,7 +70,7 @@ public function description(): ?string return $this->description; } - public function lastSyncAt(): ?\DateTimeImmutable + public function lastSyncAt(): ?DateTimeImmutable { return $this->lastSyncAt; } @@ -107,7 +80,7 @@ public function lastSyncError(): ?string return $this->lastSyncError; } - public function webhookCreatedAt(): ?\DateTimeImmutable + public function webhookCreatedAt(): ?DateTimeImmutable { return $this->webhookCreatedAt; } @@ -124,7 +97,7 @@ public function allowToAutoAddWebhook(): bool public function isSynchronizedSuccessfully(): bool { - return $this->name() !== null && $this->lastSyncError() === null; + return $this->name !== null && $this->lastSyncError === null; } public function keepLastReleases(): int diff --git a/src/Query/User/Model/Package/Link.php b/src/Query/User/Model/Package/Link.php index 52f8d0a0..b2c61e22 100644 --- a/src/Query/User/Model/Package/Link.php +++ b/src/Query/User/Model/Package/Link.php @@ -6,17 +6,8 @@ final class Link { - private string $type; - private string $target; - private string $constraint; - private ?string $targetPackageId; - - public function __construct(string $type, string $target, string $constraint, ?string $targetPackageId = null) + public function __construct(private readonly string $type, private readonly string $target, private readonly string $constraint, private readonly ?string $targetPackageId = null) { - $this->type = $type; - $this->target = $target; - $this->constraint = $constraint; - $this->targetPackageId = $targetPackageId; } public function type(): string diff --git a/src/Query/User/Model/PackageDetails.php b/src/Query/User/Model/PackageDetails.php index 5cab9511..c272f21d 100644 --- a/src/Query/User/Model/PackageDetails.php +++ b/src/Query/User/Model/PackageDetails.php @@ -4,51 +4,28 @@ namespace Buddy\Repman\Query\User\Model; +use DateTimeImmutable; + final class PackageDetails { use PackageScanResultTrait; - private string $id; - private string $organizationId; - private string $url; - private ?string $name; - private ?string $description; - private ?string $latestReleasedVersion; - private ?\DateTimeImmutable $latestReleaseDate; - private ?string $lastSyncError; - private int $keepLastReleases; - private ?string $readme; - private ?string $replacementPackage; - private bool $enableSecurityScan; - public function __construct( - string $id, - string $organizationId, - string $url, - ?string $name = null, - ?string $latestReleasedVersion = null, - ?\DateTimeImmutable $latestReleaseDate = null, - ?string $description = null, - ?string $lastSyncError = null, + private string $id, + private string $organizationId, + private string $url, + private ?string $name = null, + private ?string $latestReleasedVersion = null, + private ?DateTimeImmutable $latestReleaseDate = null, + private ?string $description = null, + private ?string $lastSyncError = null, ?ScanResult $scanResult = null, - int $keepLastReleases = 0, - ?string $readme = null, - ?string $replacementPackage = null, - bool $enableSecurityScan = true + private int $keepLastReleases = 0, + private ?string $readme = null, + private ?string $replacementPackage = null, + private bool $enableSecurityScan = true, ) { - $this->id = $id; - $this->organizationId = $organizationId; - $this->url = $url; - $this->name = $name; - $this->latestReleasedVersion = $latestReleasedVersion; - $this->latestReleaseDate = $latestReleaseDate; - $this->description = $description; - $this->lastSyncError = $lastSyncError; $this->scanResult = $scanResult ?? null; - $this->keepLastReleases = $keepLastReleases; - $this->readme = $readme; - $this->replacementPackage = $replacementPackage; - $this->enableSecurityScan = $enableSecurityScan; } public function id(): string @@ -81,7 +58,7 @@ public function latestReleasedVersion(): ?string return $this->latestReleasedVersion; } - public function latestReleaseDate(): ?\DateTimeImmutable + public function latestReleaseDate(): ?DateTimeImmutable { return $this->latestReleaseDate; } @@ -103,7 +80,7 @@ public function lastSyncError(): ?string public function isSynchronizedSuccessfully(): bool { - return $this->name() !== null && $this->lastSyncError() === null; + return $this->name !== null && $this->lastSyncError === null; } public function isAbandoned(): bool diff --git a/src/Query/User/Model/PackageName.php b/src/Query/User/Model/PackageName.php index 886c88d2..66a4b8ef 100644 --- a/src/Query/User/Model/PackageName.php +++ b/src/Query/User/Model/PackageName.php @@ -6,15 +6,8 @@ final class PackageName { - private string $id; - private string $name; - private string $organization; - - public function __construct(string $id, string $name, string $organization = '') + public function __construct(private readonly string $id, private readonly string $name, private readonly string $organization = '') { - $this->id = $id; - $this->name = $name; - $this->organization = $organization; } public function id(): string diff --git a/src/Query/User/Model/PackageScanResultTrait.php b/src/Query/User/Model/PackageScanResultTrait.php index 3fa90411..c3d16f19 100644 --- a/src/Query/User/Model/PackageScanResultTrait.php +++ b/src/Query/User/Model/PackageScanResultTrait.php @@ -4,6 +4,8 @@ namespace Buddy\Repman\Query\User\Model; +use DateTimeImmutable; + trait PackageScanResultTrait { private ?ScanResult $scanResult; @@ -13,7 +15,7 @@ public function scanResultStatus(): string return $this->scanResult !== null ? $this->scanResult->status() : ScanResult::statusPending(); } - public function scanResultDate(): ?\DateTimeImmutable + public function scanResultDate(): ?DateTimeImmutable { return $this->scanResult !== null ? $this->scanResult->date() : null; } diff --git a/src/Query/User/Model/ScanResult.php b/src/Query/User/Model/ScanResult.php index 10b83b70..88b08729 100644 --- a/src/Query/User/Model/ScanResult.php +++ b/src/Query/User/Model/ScanResult.php @@ -5,25 +5,17 @@ namespace Buddy\Repman\Query\User\Model; use Buddy\Repman\Entity\Organization\Package\ScanResult as ScanResultEntity; +use DateTimeImmutable; final class ScanResult { - private \DateTimeImmutable $date; - private string $status = ScanResultEntity::STATUS_PENDING; - private string $version; - private string $content; - public static function statusPending(): string { return ScanResultEntity::STATUS_PENDING; } - public function __construct(\DateTimeImmutable $date, string $status, string $version, string $content) + public function __construct(private readonly DateTimeImmutable $date, private readonly string $status, private readonly string $version, private readonly string $content) { - $this->date = $date; - $this->status = $status; - $this->version = $version; - $this->content = $content; } public function status(): string @@ -36,24 +28,24 @@ public function version(): string return $this->version; } - public function date(): \DateTimeImmutable + public function date(): DateTimeImmutable { return $this->date; } public function isOk(): bool { - return $this->status() === ScanResultEntity::STATUS_OK; + return $this->status === ScanResultEntity::STATUS_OK; } public function isPending(): bool { - return $this->status() === ScanResultEntity::STATUS_PENDING; + return $this->status === ScanResultEntity::STATUS_PENDING; } public function isNotAvailable(): bool { - return $this->status() === ScanResultEntity::STATUS_NOT_AVAILABLE; + return $this->status === ScanResultEntity::STATUS_NOT_AVAILABLE; } /** diff --git a/src/Query/User/Model/Version.php b/src/Query/User/Model/Version.php index 40e9da58..ee96b39e 100644 --- a/src/Query/User/Model/Version.php +++ b/src/Query/User/Model/Version.php @@ -4,19 +4,12 @@ namespace Buddy\Repman\Query\User\Model; +use DateTimeImmutable; + final class Version { - private string $version; - private string $reference; - private int $size; - private \DateTimeImmutable $date; - - public function __construct(string $version, string $reference, int $size, \DateTimeImmutable $date) + public function __construct(private readonly string $version, private readonly string $reference, private readonly int $size, private readonly DateTimeImmutable $date) { - $this->version = $version; - $this->reference = $reference; - $this->size = $size; - $this->date = $date; } public function version(): string @@ -34,7 +27,7 @@ public function size(): int return $this->size; } - public function date(): \DateTimeImmutable + public function date(): DateTimeImmutable { return $this->date; } diff --git a/src/Query/User/Model/WebhookRequest.php b/src/Query/User/Model/WebhookRequest.php index 0a8de900..5f783333 100644 --- a/src/Query/User/Model/WebhookRequest.php +++ b/src/Query/User/Model/WebhookRequest.php @@ -6,15 +6,8 @@ final class WebhookRequest { - private string $date; - private ?string $ip; - private ?string $userAgent; - - public function __construct(string $date, ?string $ip, ?string $userAgent) + public function __construct(private readonly string $date, private readonly ?string $ip, private readonly ?string $userAgent) { - $this->date = $date; - $this->ip = $ip; - $this->userAgent = $userAgent; } public function date(): string diff --git a/src/Query/User/OrganizationQuery/DbalOrganizationQuery.php b/src/Query/User/OrganizationQuery/DbalOrganizationQuery.php index f2f3973d..1ee89931 100644 --- a/src/Query/User/OrganizationQuery/DbalOrganizationQuery.php +++ b/src/Query/User/OrganizationQuery/DbalOrganizationQuery.php @@ -6,21 +6,20 @@ use Buddy\Repman\Query\Filter; use Buddy\Repman\Query\User\Model\Installs; +use Buddy\Repman\Query\User\Model\Installs\Day; use Buddy\Repman\Query\User\Model\Organization; use Buddy\Repman\Query\User\Model\Organization\Invitation; use Buddy\Repman\Query\User\Model\Organization\Member; use Buddy\Repman\Query\User\Model\Organization\Token; use Buddy\Repman\Query\User\OrganizationQuery; +use DateTimeImmutable; use Doctrine\DBAL\Connection; use Munus\Control\Option; final class DbalOrganizationQuery implements OrganizationQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -31,8 +30,8 @@ public function getByAlias(string $alias): Option $data = $this->connection->fetchAssociative( 'SELECT id, name, alias, has_anonymous_access FROM "organization" WHERE alias = :alias', [ - 'alias' => $alias, - ]); + 'alias' => $alias, + ]); if ($data === false) { return Option::none(); @@ -49,9 +48,9 @@ public function getByInvitation(string $token, string $email): Option JOIN organization_invitation i ON o.id = i.organization_id WHERE i.token = :token AND i.email = :email ', [ - 'token' => $token, - 'email' => $email, - ]); + 'token' => $token, + 'email' => $email, + ]); if ($data === false) { return Option::none(); @@ -107,11 +106,11 @@ public function getInstalls(string $organizationId, int $lastDays = 30): Install return new Installs( array_map( - static fn (array $row): Installs\Day => new Installs\Day($row['date'], $row['count']), + static fn (array $row): Day => new Day($row['date'], $row['count']), $this->connection->fetchAllAssociative( 'SELECT * FROM (SELECT COUNT(package_id), date FROM organization_package_download WHERE date > :date AND package_id IN (:packages) GROUP BY date) AS installs ORDER BY date ASC', [ - 'date' => (new \DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), + 'date' => (new DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), 'packages' => $packagesId, ], ['packages' => Connection::PARAM_STR_ARRAY], @@ -231,9 +230,9 @@ public function findToken(string $organizationId, string $value): Option FROM organization_token WHERE organization_id = :organization_id AND value = :value LIMIT 1', [ - 'organization_id' => $organizationId, - 'value' => $value, - ]); + 'organization_id' => $organizationId, + 'value' => $value, + ]); return $data === false ? Option::none() : Option::some($this->hydrateToken($data)); } @@ -264,8 +263,8 @@ private function hydrateToken(array $data): Token return new Token( $data['name'], $data['value'], - new \DateTimeImmutable($data['created_at']), - $data['last_used_at'] !== null ? new \DateTimeImmutable($data['last_used_at']) : null + new DateTimeImmutable($data['created_at']), + $data['last_used_at'] !== null ? new DateTimeImmutable($data['last_used_at']) : null ); } } diff --git a/src/Query/User/PackageQuery/DbalPackageQuery.php b/src/Query/User/PackageQuery/DbalPackageQuery.php index d6276ecb..7a837969 100644 --- a/src/Query/User/PackageQuery/DbalPackageQuery.php +++ b/src/Query/User/PackageQuery/DbalPackageQuery.php @@ -7,6 +7,7 @@ use Buddy\Repman\Entity\Organization\Package\Version as VersionEntity; use Buddy\Repman\Query\Filter as BaseFilter; use Buddy\Repman\Query\User\Model\Installs; +use Buddy\Repman\Query\User\Model\Installs\Day; use Buddy\Repman\Query\User\Model\Package; use Buddy\Repman\Query\User\Model\Package\Link; use Buddy\Repman\Query\User\Model\PackageDetails; @@ -15,16 +16,14 @@ use Buddy\Repman\Query\User\Model\Version; use Buddy\Repman\Query\User\Model\WebhookRequest; use Buddy\Repman\Query\User\PackageQuery; +use DateTimeImmutable; use Doctrine\DBAL\Connection; use Munus\Control\Option; final class DbalPackageQuery implements PackageQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -32,7 +31,8 @@ public function __construct(Connection $connection) */ public function findAll(string $organizationId, Filter $filter): array { - $filterSQL = $joinSQL = ''; + $filterSQL = ''; + $joinSQL = ''; $params = [ 'organization_id' => $organizationId, 'limit' => $filter->getLimit(), @@ -61,9 +61,7 @@ public function findAll(string $organizationId, Filter $filter): array } return array_map( - function (array $data): Package { - return $this->hydratePackage($data); - }, + fn (array $data): Package => $this->hydratePackage($data), $this->connection->fetchAllAssociative( 'SELECT p.id, @@ -99,20 +97,19 @@ function (array $data): Package { */ public function getAllNames(string $organizationId): array { - return array_map(function (array $data): PackageName { - return new PackageName($data['id'], $data['name']); - }, $this->connection->fetchAllAssociative( - 'SELECT id, name + return array_map(fn (array $data): PackageName => new PackageName($data['id'], $data['name']), $this->connection->fetchAllAssociative( + 'SELECT id, name FROM "organization_package" WHERE organization_id = :organization_id AND name IS NOT NULL', - [ + [ 'organization_id' => $organizationId, - ])); + ])); } public function count(string $organizationId, Filter $filter): int { - $filterSQL = $joinSQL = ''; + $filterSQL = ''; + $joinSQL = ''; $params = [ 'organization_id' => $organizationId, ]; @@ -161,8 +158,8 @@ public function getById(string $id): Option enable_security_scan FROM "organization_package" WHERE id = :id', [ - 'id' => $id, - ]); + 'id' => $id, + ]); if ($data === false) { return Option::none(); } @@ -197,8 +194,8 @@ public function getDetailsById(string $id): Option enable_security_scan FROM "organization_package" WHERE id = :id', [ - 'id' => $id, - ]); + 'id' => $id, + ]); if ($data === false) { return Option::none(); } @@ -227,9 +224,9 @@ public function getDependantCount(string $packageName, string $organizationId): JOIN organization_package p ON p.id = l.package_id WHERE l.target = :package_name AND p.organization_id = :organization_id', [ - 'package_name' => $packageName, - 'organization_id' => $organizationId, - ]); + 'package_name' => $packageName, + 'organization_id' => $organizationId, + ]); } /** @@ -247,9 +244,9 @@ public function getLinks(string $packageId, string $organizationId): array FROM organization_package_link l LEFT JOIN organization_package p ON (p.name = l.target AND p.organization_id = :organization_id) WHERE package_id = :package_id', [ - 'organization_id' => $organizationId, - 'package_id' => $packageId, - ]) as $data) { + 'organization_id' => $organizationId, + 'package_id' => $packageId, + ]) as $data) { $links[(string) $data['type']][] = new Link( $data['type'], $data['target'], @@ -266,15 +263,13 @@ public function getLinks(string $packageId, string $organizationId): array */ public function getVersions(string $packageId, BaseFilter $filter): array { - return array_map(function (array $data): Version { - return new Version( - $data['version'], - $data['reference'], - $data['size'], - new \DateTimeImmutable($data['date']) - ); - }, $this->connection->fetchAllAssociative( - 'SELECT + return array_map(fn (array $data): Version => new Version( + $data['version'], + $data['reference'], + $data['size'], + new DateTimeImmutable($data['date']) + ), $this->connection->fetchAllAssociative( + 'SELECT id, version, reference, @@ -287,13 +282,13 @@ public function getVersions(string $packageId, BaseFilter $filter): array 'package_id' => $packageId, 'limit' => $filter->getLimit(), 'offset' => $filter->getOffset(), - ])); + ])); } public function getInstalls(string $packageId, int $lastDays = 30, ?string $version = null): Installs { $params = [ - 'date' => (new \DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), + 'date' => (new DateTimeImmutable())->modify(sprintf('-%s days', $lastDays))->format('Y-m-d'), 'package' => $packageId, ]; $query = 'SELECT * FROM (SELECT COUNT(package_id), date FROM organization_package_download WHERE date > :date AND package_id = :package '; @@ -306,9 +301,7 @@ public function getInstalls(string $packageId, int $lastDays = 30, ?string $vers $query .= ' GROUP BY date) AS installs ORDER BY date ASC'; return new Installs( - array_map(function (array $row): Installs\Day { - return new Installs\Day($row['date'], $row['count']); - }, $this->connection->fetchAllAssociative($query, $params)), + array_map(fn (array $row): Day => new Day($row['date'], $row['count']), $this->connection->fetchAllAssociative($query, $params)), $lastDays, (int) $this->connection->fetchOne('SELECT COUNT(package_id) FROM organization_package_download WHERE package_id = :package', ['package' => $packageId]) ); @@ -328,9 +321,7 @@ public function getInstallVersions(string $packageId): array public function findRecentWebhookRequests(string $packageId): array { - return array_map(function (array $row): WebhookRequest { - return new WebhookRequest($row['date'], $row['ip'], $row['user_agent']); - }, $this->connection->fetchAllAssociative('SELECT date, ip, user_agent FROM organization_package_webhook_request WHERE package_id = :package ORDER BY date DESC LIMIT 10', ['package' => $packageId])); + return array_map(fn (array $row): WebhookRequest => new WebhookRequest($row['date'], $row['ip'], $row['user_agent']), $this->connection->fetchAllAssociative('SELECT date, ip, user_agent FROM organization_package_webhook_request WHERE package_id = :package ORDER BY date DESC LIMIT 10', ['package' => $packageId])); } /** @@ -338,15 +329,13 @@ public function findRecentWebhookRequests(string $packageId): array */ public function getScanResults(string $packageId, BaseFilter $filter): array { - return array_map(function (array $data): ScanResult { - return new ScanResult( - new \DateTimeImmutable($data['date']), - $data['status'], - $data['version'], - $data['content'], - ); - }, $this->connection->fetchAllAssociative( - 'SELECT + return array_map(fn (array $data): ScanResult => new ScanResult( + new DateTimeImmutable($data['date']), + $data['status'], + $data['version'], + $data['content'], + ), $this->connection->fetchAllAssociative( + 'SELECT date, status, version, @@ -355,10 +344,10 @@ public function getScanResults(string $packageId, BaseFilter $filter): array WHERE package_id = :package_id ORDER BY date DESC LIMIT :limit OFFSET :offset', [ - 'package_id' => $packageId, - 'limit' => $filter->getLimit(), - 'offset' => $filter->getOffset(), - ])); + 'package_id' => $packageId, + 'limit' => $filter->getLimit(), + 'offset' => $filter->getOffset(), + ])); } public function getScanResultsCount(string $packageId): int @@ -379,20 +368,18 @@ public function getScanResultsCount(string $packageId): int */ public function getAllSynchronized(int $limit = 20, int $offset = 0): array { - return array_map(function (array $data): PackageName { - return new PackageName($data['id'], $data['name'], $data['alias']); - }, $this->connection->fetchAllAssociative( - 'SELECT p.id, p.name, o.alias + return array_map(fn (array $data): PackageName => new PackageName($data['id'], $data['name'], $data['alias']), $this->connection->fetchAllAssociative( + 'SELECT p.id, p.name, o.alias FROM organization_package p JOIN organization o ON o.id = p.organization_id WHERE p.name IS NOT NULL AND p.last_sync_error IS NULL GROUP BY p.id, o.alias ORDER BY p.last_sync_at ASC LIMIT :limit OFFSET :offset', [ - 'limit' => $limit, - 'offset' => $offset, - ] - )); + 'limit' => $limit, + 'offset' => $offset, + ] + )); } public function getAllSynchronizedCount(): int @@ -410,7 +397,7 @@ private function hydratePackage(array $data): Package { $scanResult = isset($data['last_scan_status']) ? new ScanResult( - new \DateTimeImmutable($data['last_scan_date']), + new DateTimeImmutable($data['last_scan_date']), $data['last_scan_status'], $data['latest_released_version'], $data['last_scan_result'], @@ -423,11 +410,11 @@ private function hydratePackage(array $data): Package $data['repository_url'], $data['name'], $data['latest_released_version'], - $data['latest_release_date'] !== null ? new \DateTimeImmutable($data['latest_release_date']) : null, + $data['latest_release_date'] !== null ? new DateTimeImmutable($data['latest_release_date']) : null, $data['description'], - $data['last_sync_at'] !== null ? new \DateTimeImmutable($data['last_sync_at']) : null, + $data['last_sync_at'] !== null ? new DateTimeImmutable($data['last_sync_at']) : null, $data['last_sync_error'], - $data['webhook_created_at'] !== null ? new \DateTimeImmutable($data['webhook_created_at']) : null, + $data['webhook_created_at'] !== null ? new DateTimeImmutable($data['webhook_created_at']) : null, $data['webhook_created_error'], $scanResult, $data['keep_last_releases'] ?? 0, @@ -442,7 +429,7 @@ private function hydratePackageDetails(array $data): PackageDetails { $scanResult = isset($data['last_scan_status']) ? new ScanResult( - new \DateTimeImmutable($data['last_scan_date']), + new DateTimeImmutable($data['last_scan_date']), $data['last_scan_status'], $data['latest_released_version'], $data['last_scan_result'], @@ -454,7 +441,7 @@ private function hydratePackageDetails(array $data): PackageDetails $data['repository_url'], $data['name'], $data['latest_released_version'], - $data['latest_release_date'] !== null ? new \DateTimeImmutable($data['latest_release_date']) : null, + $data['latest_release_date'] !== null ? new DateTimeImmutable($data['latest_release_date']) : null, $data['description'], $data['last_sync_error'], $scanResult, @@ -470,25 +457,23 @@ private function hydratePackageDetails(array $data): PackageDetails */ public function findNonStableVersions(string $packageId): array { - return array_map(function (array $data): Version { - return new Version( - $data['version'], - $data['reference'], - 0, - new \DateTimeImmutable() - ); - }, $this->connection->fetchAllAssociative( - 'SELECT + return array_map(fn (array $data): Version => new Version( + $data['version'], + $data['reference'], + 0, + new DateTimeImmutable() + ), $this->connection->fetchAllAssociative( + 'SELECT id, version, reference FROM organization_package_version WHERE stability != :stability AND package_id = :package_id', - [ - 'package_id' => $packageId, - 'stability' => VersionEntity::STABILITY_STABLE, - ] - )); + [ + 'package_id' => $packageId, + 'stability' => VersionEntity::STABILITY_STABLE, + ] + )); } } diff --git a/src/Query/User/PackageQuery/Filter.php b/src/Query/User/PackageQuery/Filter.php index 26a20acd..abc6ef26 100644 --- a/src/Query/User/PackageQuery/Filter.php +++ b/src/Query/User/PackageQuery/Filter.php @@ -8,13 +8,9 @@ class Filter extends \Buddy\Repman\Query\Filter { - private ?string $searchTerm; - - public function __construct(int $offset = 0, int $limit = 20, ?string $sort = null, ?string $searchTerm = null) + public function __construct(int $offset = 0, int $limit = 20, ?string $sort = null, private readonly ?string $searchTerm = null) { parent::__construct($offset, $limit, $sort); - - $this->searchTerm = $searchTerm; } public function getSearchTerm(): ?string diff --git a/src/Query/User/UserQuery/DbalUserQuery.php b/src/Query/User/UserQuery/DbalUserQuery.php index 870f0055..b8e69c24 100644 --- a/src/Query/User/UserQuery/DbalUserQuery.php +++ b/src/Query/User/UserQuery/DbalUserQuery.php @@ -8,15 +8,13 @@ use Buddy\Repman\Query\User\Model\ApiToken; use Buddy\Repman\Query\User\Model\OAuthToken; use Buddy\Repman\Query\User\UserQuery; +use DateTimeImmutable; use Doctrine\DBAL\Connection; final class DbalUserQuery implements UserQuery { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** @@ -27,7 +25,7 @@ public function findAllOAuthTokens(string $userId): array return array_map( static fn (array $data): OAuthToken => new OAuthToken( $data['type'], - new \DateTimeImmutable($data['created_at']) + new DateTimeImmutable($data['created_at']) ), $this->connection->fetchAllAssociative(' SELECT type, created_at @@ -89,8 +87,8 @@ private function hydrateToken(array $data): ApiToken return new ApiToken( $data['name'], $data['value'], - new \DateTimeImmutable($data['created_at']), - $data['last_used_at'] !== null ? new \DateTimeImmutable($data['last_used_at']) : null + new DateTimeImmutable($data['created_at']), + $data['last_used_at'] !== null ? new DateTimeImmutable($data['last_used_at']) : null ); } } diff --git a/src/Repository/ConfigRepository.php b/src/Repository/ConfigRepository.php index cbf57063..19392b3a 100644 --- a/src/Repository/ConfigRepository.php +++ b/src/Repository/ConfigRepository.php @@ -13,6 +13,7 @@ * @method Config|null findOneBy(array $criteria, array $orderBy = null) * @method Config[] findAll() * @method Config[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * * @extends ServiceEntityRepository */ class ConfigRepository extends ServiceEntityRepository diff --git a/src/Repository/OrganizationRepository.php b/src/Repository/OrganizationRepository.php index c1a5c548..aa662e09 100644 --- a/src/Repository/OrganizationRepository.php +++ b/src/Repository/OrganizationRepository.php @@ -7,6 +7,7 @@ use Buddy\Repman\Entity\Organization; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; +use InvalidArgumentException; use Ramsey\Uuid\UuidInterface; /** @@ -14,6 +15,7 @@ * @method Organization|null findOneBy(array $criteria, array $orderBy = null) * @method Organization[] findAll() * @method Organization[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * * @extends ServiceEntityRepository */ class OrganizationRepository extends ServiceEntityRepository @@ -27,7 +29,7 @@ public function getById(UuidInterface $id): Organization { $organization = $this->find($id); if (!$organization instanceof Organization) { - throw new \InvalidArgumentException(sprintf('Organization with id %s not found.', $id->toString())); + throw new InvalidArgumentException(sprintf('Organization with id %s not found.', $id->toString())); } return $organization; @@ -44,7 +46,7 @@ public function getByInvitationToken(string $token): Organization ; if (!$organization instanceof Organization) { - throw new \InvalidArgumentException(sprintf('Organization with invitation token %s not found.', $token)); + throw new InvalidArgumentException(sprintf('Organization with invitation token %s not found.', $token)); } return $organization; diff --git a/src/Repository/PackageRepository.php b/src/Repository/PackageRepository.php index 1ffc0edb..169d0730 100644 --- a/src/Repository/PackageRepository.php +++ b/src/Repository/PackageRepository.php @@ -8,6 +8,7 @@ use Buddy\Repman\Entity\Organization\Package\Download; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; +use InvalidArgumentException; use Ramsey\Uuid\UuidInterface; /** @@ -15,6 +16,7 @@ * @method Package|null findOneBy(array $criteria, array $orderBy = null) * @method Package[] findAll() * @method Package[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * * @extends ServiceEntityRepository */ class PackageRepository extends ServiceEntityRepository @@ -28,7 +30,7 @@ public function getById(UuidInterface $id): Package { $package = $this->find($id); if (!$package instanceof Package) { - throw new \InvalidArgumentException(sprintf('Package %s not found.', $id->toString())); + throw new InvalidArgumentException(sprintf('Package %s not found.', $id->toString())); } return $package; diff --git a/src/Repository/ScanResultRepository.php b/src/Repository/ScanResultRepository.php index c7ab518c..3c29852e 100644 --- a/src/Repository/ScanResultRepository.php +++ b/src/Repository/ScanResultRepository.php @@ -13,6 +13,7 @@ * @method ScanResult|null findOneBy(array $criteria, array $orderBy = null) * @method ScanResult[] findAll() * @method ScanResult[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * * @extends ServiceEntityRepository */ class ScanResultRepository extends ServiceEntityRepository diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 09cea2e7..2a5cc4a6 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -8,16 +8,19 @@ use Buddy\Repman\Security\Model\User as SecurityUser; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; +use InvalidArgumentException; use Ramsey\Uuid\UuidInterface; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; +use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; -use Symfony\Component\Security\Core\User\UserInterface; +use function mb_strtolower; /** * @method User|null find($id, $lockMode = null, $lockVersion = null) * @method User|null findOneBy(array $criteria, array $orderBy = null) * @method User[] findAll() * @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * * @extends ServiceEntityRepository */ class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface @@ -30,15 +33,15 @@ public function __construct(ManagerRegistry $registry) public function emailExist(string $email): bool { return false !== $this->_em->getConnection()->fetchOne('SELECT id FROM "user" WHERE email = :email', [ - 'email' => \mb_strtolower($email), + 'email' => mb_strtolower($email), ]); } public function getByEmail(string $email): User { - $user = $this->findOneBy(['email' => \mb_strtolower($email)]); + $user = $this->findOneBy(['email' => mb_strtolower($email)]); if (!$user instanceof User) { - throw new \InvalidArgumentException(sprintf('User with email %s not found', \mb_strtolower($email))); + throw new InvalidArgumentException(sprintf('User with email %s not found', mb_strtolower($email))); } return $user; @@ -48,7 +51,7 @@ public function getByResetPasswordToken(string $token): User { $user = $this->findOneBy(['resetPasswordToken' => $token]); if (!$user instanceof User) { - throw new \InvalidArgumentException(sprintf('User with reset password token %s not found', $token)); + throw new InvalidArgumentException(sprintf('User with reset password token %s not found', $token)); } return $user; @@ -58,7 +61,7 @@ public function getByConfirmEmailToken(string $token): User { $user = $this->findOneBy(['emailConfirmToken' => $token]); if (!$user instanceof User) { - throw new \InvalidArgumentException(sprintf('User with email confirm token %s not found', $token)); + throw new InvalidArgumentException(sprintf('User with email confirm token %s not found', $token)); } return $user; @@ -68,7 +71,7 @@ public function getById(UuidInterface $id): User { $user = $this->find($id); if (!$user instanceof User) { - throw new \InvalidArgumentException(sprintf('User with id %s not found', $id->toString())); + throw new InvalidArgumentException(sprintf('User with id %s not found', $id->toString())); } return $user; @@ -82,14 +85,15 @@ public function add(User $user): void /** * Used to upgrade (rehash) the user's password automatically over time. */ - public function upgradePassword(UserInterface $user, string $newEncodedPassword): void + public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void { if (!$user instanceof SecurityUser) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); + throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class)); } $user = $this->getByEmail($user->getUserIdentifier()); - $user->setPassword($newEncodedPassword); + $user->setPassword($newHashedPassword); + $this->_em->persist($user); $this->_em->flush(); } @@ -103,6 +107,7 @@ public function setEmailScanResult(UuidInterface $id, bool $value): void { $user = $this->getById($id); $user->setEmailScanResult($value); + $this->_em->persist($user); $this->_em->flush(); } diff --git a/src/Security/AnonymousOrganizationUserAuthenticator.php b/src/Security/AnonymousOrganizationUserAuthenticator.php index 719d9763..c5fea1d5 100644 --- a/src/Security/AnonymousOrganizationUserAuthenticator.php +++ b/src/Security/AnonymousOrganizationUserAuthenticator.php @@ -13,42 +13,37 @@ use Symfony\Component\Security\Core\Exception\BadCredentialsException; use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; final class AnonymousOrganizationUserAuthenticator extends AbstractAuthenticator implements AuthenticationEntryPointInterface { - private OrganizationProvider $organizationProvider; - - public function __construct(OrganizationProvider $organizationProvider) + public function __construct(private readonly OrganizationProvider $organizationProvider) { - $this->organizationProvider = $organizationProvider; } /** * @codeCoverageIgnore */ - public function start(Request $request, AuthenticationException $authException = null): JsonResponse + public function start(Request $request, ?AuthenticationException $authException = null): JsonResponse { return new JsonResponse([ 'message' => 'Authentication Required', ], Response::HTTP_UNAUTHORIZED); } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { $organizationAlias = $request->get('organization'); if ($organizationAlias === null) { throw new BadCredentialsException(); } - return new SelfValidatingPassport(new UserBadge($organizationAlias, function (string $organizationAlias): Organization { - return $this->organizationProvider->loadUserByAlias($organizationAlias); - })); + return new SelfValidatingPassport(new UserBadge($organizationAlias, fn (string $organizationAlias): Organization => $this->organizationProvider->loadUserByAlias($organizationAlias))); } - public function supports(Request $request): ?bool + public function supports(Request $request): bool { return $request->get('_route') !== 'repo_package_downloads' && !$request->headers->has('PHP_AUTH_USER') diff --git a/src/Security/ApiTokenAuthenticator.php b/src/Security/ApiTokenAuthenticator.php index cc592cff..f8080005 100644 --- a/src/Security/ApiTokenAuthenticator.php +++ b/src/Security/ApiTokenAuthenticator.php @@ -17,16 +17,13 @@ use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; class ApiTokenAuthenticator extends AbstractAuthenticator { - private ApiUserProvider $provider; - - public function __construct(ApiUserProvider $provider) + public function __construct(private readonly ApiUserProvider $provider) { - $this->provider = $provider; } public function supports(Request $request): bool @@ -34,7 +31,7 @@ public function supports(Request $request): bool return true; } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { if (!$request->headers->has('X-API-TOKEN') || $request->headers->get('X-API-TOKEN') === '') { throw new CustomUserMessageAuthenticationException('Authentication required.'); @@ -43,10 +40,8 @@ public function authenticate(Request $request): PassportInterface try { $user = $this->provider->loadUserByIdentifier($request->headers->get('X-API-TOKEN', '')); - return new SelfValidatingPassport(new UserBadge($user->getUserIdentifier(), function () use ($user): UserInterface { - return $user; - })); - } catch (UserNotFoundException $exception) { + return new SelfValidatingPassport(new UserBadge($user->getUserIdentifier(), fn (): UserInterface => $user)); + } catch (UserNotFoundException) { throw new BadCredentialsException(); } } diff --git a/src/Security/ApiUserProvider.php b/src/Security/ApiUserProvider.php index bc75ab00..826983e9 100644 --- a/src/Security/ApiUserProvider.php +++ b/src/Security/ApiUserProvider.php @@ -5,6 +5,8 @@ namespace Buddy\Repman\Security; use Buddy\Repman\Security\Model\User; +use Buddy\Repman\Security\Model\User\Organization; +use DateTimeImmutable; use Doctrine\DBAL\Connection; use Symfony\Component\Security\Core\Exception\UserNotFoundException; use Symfony\Component\Security\Core\User\UserInterface; @@ -12,11 +14,8 @@ final class ApiUserProvider implements UserProviderInterface { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } public function loadUserByUsername(string $username): UserInterface @@ -86,8 +85,8 @@ private function hydrateUser(array $data): User $data['status'], $data['email_confirmed_at'] !== null, $data['email_confirm_token'], - json_decode($data['roles'], true), - array_map(fn (array $data) => new User\Organization($data['alias'], $data['name'], $data['role'], $data['has_anonymous_access']), $organizations), + json_decode((string) $data['roles'], true), + array_map(fn (array $data) => new Organization($data['alias'], $data['name'], $data['role'], $data['has_anonymous_access']), $organizations), $data['email_scan_result'], $data['timezone'], ); @@ -98,8 +97,8 @@ private function updateLastUsed(string $token): void $this->connection->executeQuery( 'UPDATE user_api_token SET last_used_at = :now WHERE value = :value', [ - 'now' => (new \DateTimeImmutable())->format('Y-m-d H:i:s'), - 'value' => $token, - ]); + 'now' => (new DateTimeImmutable())->format('Y-m-d H:i:s'), + 'value' => $token, + ]); } } diff --git a/src/Security/BitbucketAuthenticator.php b/src/Security/BitbucketAuthenticator.php index d516ddc8..99f720ea 100644 --- a/src/Security/BitbucketAuthenticator.php +++ b/src/Security/BitbucketAuthenticator.php @@ -12,17 +12,14 @@ use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; final class BitbucketAuthenticator extends OAuthAuthenticator { - private BitbucketApi $bitbucketApi; - - public function __construct(ClientRegistry $clientRegistry, BitbucketApi $bitbucketApi, RouterInterface $router, UserProvider $userProvider) + public function __construct(ClientRegistry $clientRegistry, private readonly BitbucketApi $bitbucketApi, RouterInterface $router, UserProvider $userProvider) { $this->clientRegistry = $clientRegistry; - $this->bitbucketApi = $bitbucketApi; $this->userProvider = $userProvider; $this->router = $router; } @@ -32,7 +29,7 @@ public function supports(Request $request): bool return $request->attributes->get('_route') === 'login_bitbucket_check'; } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { try { $email = $this->bitbucketApi->primaryEmail($this->fetchAccessToken( @@ -45,8 +42,6 @@ public function authenticate(Request $request): PassportInterface $user = $this->userProvider->loadUserByIdentifier($email); - return new SelfValidatingPassport(new UserBadge($email, function () use ($user): UserInterface { - return $user; - })); + return new SelfValidatingPassport(new UserBadge($email, fn (): UserInterface => $user)); } } diff --git a/src/Security/BuddyAuthenticator.php b/src/Security/BuddyAuthenticator.php index b0260f36..6387cd0e 100644 --- a/src/Security/BuddyAuthenticator.php +++ b/src/Security/BuddyAuthenticator.php @@ -12,17 +12,14 @@ use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; final class BuddyAuthenticator extends OAuthAuthenticator { - private BuddyApi $buddyApi; - - public function __construct(ClientRegistry $clientRegistry, BuddyApi $buddyApi, RouterInterface $router, UserProvider $userProvider) + public function __construct(ClientRegistry $clientRegistry, private readonly BuddyApi $buddyApi, RouterInterface $router, UserProvider $userProvider) { $this->clientRegistry = $clientRegistry; - $this->buddyApi = $buddyApi; $this->userProvider = $userProvider; $this->router = $router; } @@ -32,21 +29,19 @@ public function supports(Request $request): bool return $request->attributes->get('_route') === 'login_buddy_check'; } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { try { $email = $this->buddyApi->primaryEmail($this->fetchAccessToken( $this->clientRegistry->getClient('buddy'), $request->attributes->get('_route') )->getToken()); - } catch (BuddyApiException $exception) { - throw new CustomUserMessageAuthenticationException($exception->getMessage()); + } catch (BuddyApiException $buddyApiException) { + throw new CustomUserMessageAuthenticationException($buddyApiException->getMessage()); } $user = $this->userProvider->loadUserByIdentifier($email); - return new SelfValidatingPassport(new UserBadge($email, function () use ($user): UserInterface { - return $user; - })); + return new SelfValidatingPassport(new UserBadge($email, fn (): UserInterface => $user)); } } diff --git a/src/Security/GitHubAuthenticator.php b/src/Security/GitHubAuthenticator.php index a6eef0fa..18692b91 100644 --- a/src/Security/GitHubAuthenticator.php +++ b/src/Security/GitHubAuthenticator.php @@ -12,17 +12,14 @@ use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; final class GitHubAuthenticator extends OAuthAuthenticator { - private GitHubApi $gitHubApi; - - public function __construct(ClientRegistry $clientRegistry, GitHubApi $gitHubApi, RouterInterface $router, UserProvider $userProvider) + public function __construct(ClientRegistry $clientRegistry, private readonly GitHubApi $gitHubApi, RouterInterface $router, UserProvider $userProvider) { $this->clientRegistry = $clientRegistry; - $this->gitHubApi = $gitHubApi; $this->userProvider = $userProvider; $this->router = $router; } @@ -32,7 +29,7 @@ public function supports(Request $request): bool return $request->attributes->get('_route') === 'login_github_check'; } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { try { $email = $this->gitHubApi->primaryEmail($this->fetchAccessToken( @@ -45,8 +42,6 @@ public function authenticate(Request $request): PassportInterface $user = $this->userProvider->loadUserByIdentifier($email); - return new SelfValidatingPassport(new UserBadge($email, function () use ($user): UserInterface { - return $user; - })); + return new SelfValidatingPassport(new UserBadge($email, fn (): UserInterface => $user)); } } diff --git a/src/Security/GitLabAuthenticator.php b/src/Security/GitLabAuthenticator.php index 4115a906..22628e8c 100644 --- a/src/Security/GitLabAuthenticator.php +++ b/src/Security/GitLabAuthenticator.php @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; final class GitLabAuthenticator extends OAuthAuthenticator @@ -30,7 +30,7 @@ public function supports(Request $request): bool return $request->attributes->get('_route') === 'login_gitlab_check'; } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { try { /** @var GitlabResourceOwner $gitLabUser */ @@ -44,8 +44,6 @@ public function authenticate(Request $request): PassportInterface $user = $this->userProvider->loadUserByIdentifier($gitLabUser->getEmail()); - return new SelfValidatingPassport(new UserBadge($gitLabUser->getEmail(), function () use ($user): UserInterface { - return $user; - })); + return new SelfValidatingPassport(new UserBadge($gitLabUser->getEmail(), fn (): UserInterface => $user)); } } diff --git a/src/Security/LoginFormAuthenticator.php b/src/Security/LoginFormAuthenticator.php index 86bf5198..4bb9a6b3 100644 --- a/src/Security/LoginFormAuthenticator.php +++ b/src/Security/LoginFormAuthenticator.php @@ -11,7 +11,6 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\BadCredentialsException; -use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\PasswordUpgradeBadge; @@ -19,23 +18,17 @@ use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials; use Symfony\Component\Security\Http\Authenticator\Passport\Passport; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; +use Symfony\Component\Security\Http\SecurityRequestAttributes; use Symfony\Component\Security\Http\Util\TargetPathTrait; +use function strlen; class LoginFormAuthenticator extends AbstractLoginFormAuthenticator implements AuthenticationEntryPointInterface { use TargetPathTrait; - private UserProvider $userProvider; - private UrlGeneratorInterface $urlGenerator; - private Config $config; - - public function __construct(UserProvider $userProvider, UrlGeneratorInterface $urlGenerator, Config $config) + public function __construct(private readonly UserProvider $userProvider, private readonly UrlGeneratorInterface $urlGenerator, private readonly Config $config) { - $this->userProvider = $userProvider; - $this->urlGenerator = $urlGenerator; - $this->config = $config; } public function supports(Request $request): bool @@ -45,18 +38,18 @@ public function supports(Request $request): bool && $this->config->localLoginEnabled(); } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { $username = (string) $request->request->get('email', ''); $password = (string) $request->request->get('password', ''); - if (\strlen($username) > Security::MAX_USERNAME_LENGTH) { + if (strlen($username) > UserBadge::MAX_USERNAME_LENGTH) { throw new BadCredentialsException('Invalid username.'); } - $request->getSession()->set(Security::LAST_USERNAME, $username); + $request->getSession()->set(SecurityRequestAttributes::LAST_USERNAME, $username); return new Passport( - new UserBadge($username, [$this->userProvider, 'loadUserByIdentifier']), + new UserBadge($username, $this->userProvider->loadUserByIdentifier(...)), new PasswordCredentials($password), [ new RememberMeBadge(), diff --git a/src/Security/Model/Organization.php b/src/Security/Model/Organization.php index d4cae5fa..78cfb07c 100644 --- a/src/Security/Model/Organization.php +++ b/src/Security/Model/Organization.php @@ -8,17 +8,8 @@ final class Organization implements UserInterface { - private string $id; - private string $name; - private string $alias; - private string $token; - - public function __construct(string $id, string $name, string $alias, string $token) + public function __construct(private readonly string $id, private readonly string $name, private readonly string $alias, private readonly string $token) { - $this->id = $id; - $this->name = $name; - $this->alias = $alias; - $this->token = $token; } public function id(): string @@ -31,22 +22,22 @@ public function name(): string return $this->name; } - public function getRoles() + public function getRoles(): array { return ['ROLE_ORGANIZATION']; } - public function getPassword() + public function getPassword(): string { return $this->token; } - public function getSalt() + public function getSalt(): string { return ''; } - public function getUsername() + public function getUsername(): string { return $this->alias; } diff --git a/src/Security/Model/User.php b/src/Security/Model/User.php index 216a21e6..5beff96d 100644 --- a/src/Security/Model/User.php +++ b/src/Security/Model/User.php @@ -9,44 +9,16 @@ use Symfony\Component\Security\Core\User\EquatableInterface; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; +use function count; final class User implements UserInterface, EquatableInterface, PasswordAuthenticatedUserInterface { - private string $id; - private string $email; - private string $password; - private string $status; - private bool $emailConfirmed; - private string $emailConfirmToken; - private bool $emailScanResult; - private string $timezone; - - /** - * @var string[] - */ - private array $roles; - - /** - * @var Organization[] - */ - private array $organizations; - /** * @param string[] $roles * @param Organization[] $organizations */ - public function __construct(string $id, string $email, string $password, string $status, bool $emailConfirmed, string $emailConfirmToken, $roles, $organizations, bool $emailScanResult, string $timezone) + public function __construct(private readonly string $id, private readonly string $email, private readonly string $password, private readonly string $status, private readonly bool $emailConfirmed, private readonly string $emailConfirmToken, private readonly array $roles, private array $organizations, private readonly bool $emailScanResult, private readonly string $timezone) { - $this->id = $id; - $this->email = $email; - $this->password = $password; - $this->status = $status; - $this->emailConfirmed = $emailConfirmed; - $this->emailConfirmToken = $emailConfirmToken; - $this->roles = $roles; - $this->organizations = $organizations; - $this->emailScanResult = $emailScanResult; - $this->timezone = $timezone; } public function id(): string @@ -76,7 +48,7 @@ public function emailConfirmToken(): string public function belongsToAnyOrganization(): bool { - return count($this->organizations) > 0; + return $this->organizations !== []; } /** @@ -87,7 +59,7 @@ public function organizations(): array return $this->organizations; } - public function getRoles() + public function getRoles(): array { // deny all access if ($this->isDisabled()) { @@ -111,19 +83,13 @@ public function getPassword(): string */ public function firstOrganizationAlias(): Option { - if (count($this->organizations) === 0) { + if ($this->organizations === []) { return Option::none(); } return Option::some($this->organizations[0]->alias()); } - public function getSalt() - { - // not needed when using the "bcrypt" algorithm in security.yaml - return null; - } - public function getUsername(): string { return $this->email; @@ -140,17 +106,17 @@ public function eraseCredentials(): void // e.x. $this->plainPassword = null; } - public function isEqualTo(UserInterface $user) + public function isEqualTo(UserInterface $user): bool { if (!$user instanceof self) { return false; } - if ($this->getUserIdentifier() !== $user->getUserIdentifier()) { + if ($this->email !== $user->getUserIdentifier()) { return false; } - if (\count($user->getRoles()) !== \count($this->getRoles()) || \count($user->getRoles()) !== \count(array_intersect($user->getRoles(), $this->getRoles()))) { + if (count($user->getRoles()) !== count($this->getRoles()) || count($user->getRoles()) !== count(array_intersect($user->getRoles(), $this->getRoles()))) { return false; } diff --git a/src/Security/Model/User/Organization.php b/src/Security/Model/User/Organization.php index f3b802f2..6b22d4ed 100644 --- a/src/Security/Model/User/Organization.php +++ b/src/Security/Model/User/Organization.php @@ -6,17 +6,8 @@ final class Organization { - private string $alias; - private string $name; - private string $role; - private bool $hasAnonymousAccess; - - public function __construct(string $alias, string $name, string $role, bool $hasAnonymousAccess) + public function __construct(private readonly string $alias, private readonly string $name, private readonly string $role, private readonly bool $hasAnonymousAccess) { - $this->alias = $alias; - $this->name = $name; - $this->role = $role; - $this->hasAnonymousAccess = $hasAnonymousAccess; } public function alias(): string diff --git a/src/Security/OAuthAuthenticator.php b/src/Security/OAuthAuthenticator.php index 677cfca0..a443f9eb 100644 --- a/src/Security/OAuthAuthenticator.php +++ b/src/Security/OAuthAuthenticator.php @@ -29,7 +29,9 @@ abstract class OAuthAuthenticator extends AbstractAuthenticator use TargetPathTrait; protected ClientRegistry $clientRegistry; + protected UserProvider $userProvider; + protected RouterInterface $router; public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): Response @@ -60,7 +62,7 @@ protected function fetchAccessToken(OAuth2ClientInterface $client, string $route return $client->getAccessToken([ 'redirect_uri' => $this->router->generate($route, [], UrlGeneratorInterface::ABSOLUTE_URL), ]); - } catch (MissingAuthorizationCodeException $e) { + } catch (MissingAuthorizationCodeException) { throw new NoAuthCodeAuthenticationException(); } catch (IdentityProviderException $e) { throw new IdentityProviderAuthenticationException($e); diff --git a/src/Security/OrganizationProvider.php b/src/Security/OrganizationProvider.php index d9399a91..d72e91a4 100644 --- a/src/Security/OrganizationProvider.php +++ b/src/Security/OrganizationProvider.php @@ -5,6 +5,7 @@ namespace Buddy\Repman\Security; use Buddy\Repman\Security\Model\Organization; +use DateTimeImmutable; use Doctrine\DBAL\Connection; use Symfony\Component\Security\Core\Exception\BadCredentialsException; use Symfony\Component\Security\Core\Exception\UserNotFoundException; @@ -13,11 +14,8 @@ final class OrganizationProvider implements UserProviderInterface { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } public function loadUserByUsername(string $username) @@ -69,7 +67,7 @@ public function loadUserByAlias(string $alias): Organization private function updateLastUsed(string $token): void { $this->connection->executeQuery('UPDATE organization_token SET last_used_at = :now WHERE value = :value', [ - 'now' => (new \DateTimeImmutable())->format('Y-m-d H:i:s'), + 'now' => (new DateTimeImmutable())->format('Y-m-d H:i:s'), 'value' => $token, ]); } diff --git a/src/Security/TokenAuthenticator.php b/src/Security/TokenAuthenticator.php index 5df06e2b..6bf1c197 100644 --- a/src/Security/TokenAuthenticator.php +++ b/src/Security/TokenAuthenticator.php @@ -13,25 +13,20 @@ use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; +use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; final class TokenAuthenticator extends AbstractAuthenticator implements AuthenticationEntryPointInterface { - private OrganizationProvider $organizationProvider; - - public function __construct(OrganizationProvider $organizationProvider) + public function __construct(private readonly OrganizationProvider $organizationProvider) { - $this->organizationProvider = $organizationProvider; } /** * @codeCoverageIgnore - * - * @return Response */ - public function start(Request $request, AuthenticationException $authException = null) + public function start(Request $request, ?AuthenticationException $authException = null): JsonResponse|Response { $data = [ 'message' => 'Authentication Required', @@ -40,21 +35,19 @@ public function start(Request $request, AuthenticationException $authException = return new JsonResponse($data, Response::HTTP_UNAUTHORIZED); } - public function supports(Request $request): ?bool + public function supports(Request $request): bool { return $request->headers->has('PHP_AUTH_USER') && $request->headers->has('PHP_AUTH_PW'); } - public function authenticate(Request $request): PassportInterface + public function authenticate(Request $request): Passport { $organization = $this->organizationProvider->loadUserByIdentifier($request->headers->get('PHP_AUTH_PW', '')); if ($organization->getUserIdentifier() !== $request->get('organization')) { throw new BadCredentialsException(); } - return new SelfValidatingPassport(new UserBadge($organization->getUserIdentifier(), function () use ($organization): UserInterface { - return $organization; - })); + return new SelfValidatingPassport(new UserBadge($organization->getUserIdentifier(), fn (): UserInterface => $organization)); } public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response diff --git a/src/Security/UserGuardHelper.php b/src/Security/UserGuardHelper.php index 6ce5f448..57a27675 100644 --- a/src/Security/UserGuardHelper.php +++ b/src/Security/UserGuardHelper.php @@ -12,15 +12,8 @@ final class UserGuardHelper { - private UserProvider $userProvider; - private LoginFormAuthenticator $authenticator; - private TokenStorageInterface $tokenStorage; - - public function __construct(UserProvider $userProvider, LoginFormAuthenticator $authenticator, TokenStorageInterface $tokenStorage) + public function __construct(private readonly UserProvider $userProvider, private readonly LoginFormAuthenticator $authenticator, private readonly TokenStorageInterface $tokenStorage) { - $this->userProvider = $userProvider; - $this->authenticator = $authenticator; - $this->tokenStorage = $tokenStorage; } public function userExists(string $email): bool @@ -30,9 +23,7 @@ public function userExists(string $email): bool public function authenticateUser(string $email, Request $request): void { - $token = $this->authenticator->createToken(new SelfValidatingPassport(new UserBadge($email, function (string $email): UserInterface { - return $this->userProvider->loadUserByIdentifier($email); - })), 'main'); + $token = $this->authenticator->createToken(new SelfValidatingPassport(new UserBadge($email, fn (string $email): UserInterface => $this->userProvider->loadUserByIdentifier($email))), 'main'); $this->tokenStorage->setToken($token); $request->getSession()->set('_security_main', serialize($token)); } diff --git a/src/Security/UserProvider.php b/src/Security/UserProvider.php index a84aafc4..6140f811 100644 --- a/src/Security/UserProvider.php +++ b/src/Security/UserProvider.php @@ -6,21 +6,19 @@ use Buddy\Repman\Repository\UserRepository; use Buddy\Repman\Security\Model\User; +use Buddy\Repman\Security\Model\User\Organization; use Doctrine\DBAL\Connection; use Symfony\Component\Security\Core\Exception\UserNotFoundException; +use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; +use function mb_strtolower; final class UserProvider implements UserProviderInterface, PasswordUpgraderInterface { - private Connection $connection; - private UserRepository $userRepository; - - public function __construct(Connection $connection, UserRepository $userRepository) + public function __construct(private readonly Connection $connection, private readonly UserRepository $userRepository) { - $this->connection = $connection; - $this->userRepository = $userRepository; } public function loadUserByUsername(string $username): UserInterface @@ -49,15 +47,15 @@ public function supportsClass(string $class): bool return $class === User::class; } - public function upgradePassword(UserInterface $user, string $newEncodedPassword): void + public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void { - $this->userRepository->upgradePassword($user, $newEncodedPassword); + $this->userRepository->upgradePassword($user, $newHashedPassword); } public function emailExist(string $email): bool { return false !== $this->connection->fetchOne('SELECT id FROM "user" WHERE email = :email', [ - 'email' => \mb_strtolower($email), + 'email' => mb_strtolower($email), ]); } @@ -79,7 +77,7 @@ private function getUserDataByEmail(string $email) timezone FROM "user" WHERE email = :email', - ['email' => \mb_strtolower($email)] + ['email' => mb_strtolower($email)] ); } @@ -101,8 +99,8 @@ private function hydrateUser(array $data): User $data['status'], $data['email_confirmed_at'] !== null, $data['email_confirm_token'], - json_decode($data['roles'], true), - array_map(fn (array $data) => new User\Organization($data['alias'], $data['name'], $data['role'], $data['has_anonymous_access']), $organizations), + json_decode((string) $data['roles'], true), + array_map(fn (array $data) => new Organization($data['alias'], $data['name'], $data['role'], $data['has_anonymous_access']), $organizations), (bool) $data['email_scan_result'], $data['timezone'], ); diff --git a/src/Service/Api/PackageParamConverter.php b/src/Service/Api/PackageParamConverter.php index 47b486a5..73ce6638 100644 --- a/src/Service/Api/PackageParamConverter.php +++ b/src/Service/Api/PackageParamConverter.php @@ -13,11 +13,8 @@ final class PackageParamConverter implements ParamConverterInterface { - private PackageQuery $packageQuery; - - public function __construct(PackageQuery $packageQuery) + public function __construct(private readonly PackageQuery $packageQuery) { - $this->packageQuery = $packageQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Service/Api/TokenParamConverter.php b/src/Service/Api/TokenParamConverter.php index 088d60d0..890d8493 100644 --- a/src/Service/Api/TokenParamConverter.php +++ b/src/Service/Api/TokenParamConverter.php @@ -13,11 +13,8 @@ final class TokenParamConverter implements ParamConverterInterface { - private OrganizationQuery $organizationQuery; - - public function __construct(OrganizationQuery $organizationQuery) + public function __construct(private readonly OrganizationQuery $organizationQuery) { - $this->organizationQuery = $organizationQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Service/Config.php b/src/Service/Config.php index 00baab4e..cfdce5cb 100644 --- a/src/Service/Config.php +++ b/src/Service/Config.php @@ -12,23 +12,20 @@ final class Config public const CACHE_KEY = 'values'; public const TELEMETRY = 'telemetry'; + public const TELEMETRY_ENABLED = 'enabled'; + public const TELEMETRY_DISABLED = 'disabled'; public const TECHNICAL_EMAIL = 'technical_email'; - private ConfigQuery $configQuery; - private CacheInterface $cache; - /** * @var array */ private array $values = []; - public function __construct(ConfigQuery $configQuery, CacheInterface $configCache) + public function __construct(private readonly ConfigQuery $configQuery, private readonly CacheInterface $cache) { - $this->configQuery = $configQuery; - $this->cache = $configCache; } public function get(string $key): ?string @@ -55,7 +52,11 @@ public function oauthRegistrationEnabled(): bool public function userRegistrationEnabled(): bool { - return $this->localRegistrationEnabled() || $this->oauthRegistrationEnabled(); + if ($this->localRegistrationEnabled()) { + return true; + } + + return $this->oauthRegistrationEnabled(); } public function telemetryEnabled(): bool diff --git a/src/Service/Dist.php b/src/Service/Dist.php index cf9f2a6b..fd7f783c 100644 --- a/src/Service/Dist.php +++ b/src/Service/Dist.php @@ -6,19 +6,8 @@ final class Dist { - private string $repo; - private string $package; - private string $version; - private string $ref; - private string $format; - - public function __construct(string $repo, string $package, string $version, string $ref, string $format) + public function __construct(private readonly string $repo, private readonly string $package, private readonly string $version, private readonly string $ref, private readonly string $format) { - $this->repo = $repo; - $this->package = $package; - $this->version = $version; - $this->ref = $ref; - $this->format = $format; } public function repo(): string @@ -33,7 +22,7 @@ public function package(): string public function version(): string { - if (strpos($this->version, '/') !== false) { + if (str_contains($this->version, '/')) { return md5($this->version); } diff --git a/src/Service/Dist/FilePatternFilterIterator.php b/src/Service/Dist/FilePatternFilterIterator.php index 9dd195a1..5f6a51d6 100644 --- a/src/Service/Dist/FilePatternFilterIterator.php +++ b/src/Service/Dist/FilePatternFilterIterator.php @@ -4,25 +4,32 @@ namespace Buddy\Repman\Service\Dist; -final class FilePatternFilterIterator extends \FilterIterator +use FilterIterator; +use Iterator; +use function implode; +use function preg_match; +use function preg_quote; +use function rtrim; +use function str_replace; + +final class FilePatternFilterIterator extends FilterIterator { private ?string $excludedPattern = null; - private string $inclusionPattern; /** - * @param \Iterator> $iterator The Iterator to filter + * @param Iterator> $iterator The Iterator to filter * @param string[] $directories An array of directories to exclude */ - public function __construct(\Iterator $iterator, array $directories, string $inclusionPattern) + public function __construct(Iterator $iterator, array $directories, private readonly string $inclusionPattern) { - $this->inclusionPattern = $inclusionPattern; $patterns = []; foreach ($directories as $directory) { - $directory = \rtrim($directory, '/'); - $patterns[] = \preg_quote($directory, '#'); + $directory = rtrim($directory, '/'); + $patterns[] = preg_quote($directory, '#'); } - if (\count($patterns) > 0) { - $this->excludedPattern = '#(?:^|/)(?:'.\implode('|', $patterns).')(?:/|$)#'; + + if ($patterns !== []) { + $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; } parent::__construct($iterator); @@ -40,18 +47,18 @@ public function accept(): bool $path = $item['path']; if ($this->excludedPattern !== null) { - $normalizedPath = \str_replace('\\', '/', $path); + $normalizedPath = str_replace('\\', '/', $path); if ($this->pathMatchesExclusionPattern($normalizedPath)) { return false; } } - return 1 === \preg_match($this->inclusionPattern, $path); + return 1 === preg_match($this->inclusionPattern, $path); } private function pathMatchesExclusionPattern(string $path): bool { - return $this->excludedPattern !== null && \preg_match($this->excludedPattern, $path) === 1; + return $this->excludedPattern !== null && preg_match($this->excludedPattern, $path) === 1; } } diff --git a/src/Service/Dist/Storage.php b/src/Service/Dist/Storage.php index 76ab3836..6c6e8e5e 100644 --- a/src/Service/Dist/Storage.php +++ b/src/Service/Dist/Storage.php @@ -6,29 +6,36 @@ use Buddy\Repman\Service\Dist; use Buddy\Repman\Service\Downloader; -use League\Flysystem\FileNotFoundException; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; +use League\Flysystem\UnableToReadFile; use Munus\Control\Option; +use RuntimeException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Throwable; +use function fclose; +use function fopen; +use function sprintf; +use function stream_copy_to_stream; +use function sys_get_temp_dir; +use function uniqid; +use const DIRECTORY_SEPARATOR; class Storage { - private Downloader $downloader; - private FilesystemInterface $repoFilesystem; - - public function __construct(Downloader $downloader, FilesystemInterface $repoFilesystem) + public function __construct(private readonly Downloader $downloader, private readonly FilesystemOperator $repoFilesystem) { - $this->downloader = $downloader; - $this->repoFilesystem = $repoFilesystem; } public function has(Dist $dist): bool { - return $this->repoFilesystem->has($this->filename($dist)); + return $this->repoFilesystem->fileExists($this->filename($dist)); } /** * @param string[] $headers + * + * @throws FilesystemException|Throwable */ public function download(string $url, Dist $dist, array $headers = []): void { @@ -44,25 +51,28 @@ public function download(string $url, Dist $dist, array $headers = []): void $url, $headers, function () use ($url): void { - throw new NotFoundHttpException(\sprintf('File not found at %s', $url)); + throw new NotFoundHttpException(sprintf('File not found at %s', $url)); } )->getOrElseThrow( - new \RuntimeException(\sprintf('Failed to download %s from %s', $dist->package(), $url)) + new RuntimeException(sprintf('Failed to download %s from %s', $dist->package(), $url)) ) ); } + /** + * @throws FilesystemException + */ public function remove(Dist $dist): void { $filename = $this->filename($dist); - if ($this->repoFilesystem->has($filename)) { + if ($this->repoFilesystem->fileExists($filename)) { $this->repoFilesystem->delete($filename); } } public function filename(Dist $dist): string { - return \sprintf( + return sprintf( '%s/dist/%s/%s_%s.%s', $dist->repo(), $dist->package(), @@ -72,12 +82,15 @@ public function filename(Dist $dist): string ); } + /** + * @throws FilesystemException + */ public function size(Dist $dist): int { $filename = $this->filename($dist); - if ($this->repoFilesystem->has($filename)) { + if ($this->repoFilesystem->fileExists($filename)) { /* @phpstan-ignore-next-line - will always return int because file exists */ - return $this->repoFilesystem->getSize($filename); + return $this->repoFilesystem->fileSize($filename); } return 0; @@ -97,27 +110,28 @@ public function getLocalFileForDist(Dist $dist): Option public function getLocalFileForDistUrl(string $distFilename): Option { $tmpLocalFilename = $this->getTempFileName(); - $tmpLocalFileHandle = \fopen( + $tmpLocalFileHandle = fopen( $tmpLocalFilename, 'wb' ); if (false === $tmpLocalFileHandle) { - throw new \RuntimeException('Could not open temporary file for writing zip file for dist.'); + throw new RuntimeException('Could not open temporary file for writing zip file for dist.'); } $distReadStream = $this->readStream($distFilename)->getOrNull(); if (null === $distReadStream) { return Option::none(); } - \stream_copy_to_stream($distReadStream, $tmpLocalFileHandle); - \fclose($tmpLocalFileHandle); + + stream_copy_to_stream($distReadStream, $tmpLocalFileHandle); + fclose($tmpLocalFileHandle); return Option::of($tmpLocalFilename); } private function getTempFileName(): string { - return \sys_get_temp_dir().\DIRECTORY_SEPARATOR.\uniqid('repman-dist-', true); + return sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid('repman-dist-', true); } /** @@ -130,7 +144,7 @@ private function readStream(string $path): Option if (false === $resource) { return Option::none(); } - } catch (FileNotFoundException $e) { + } catch (UnableToReadFile|FilesystemException) { return Option::none(); } diff --git a/src/Service/Doctrine/FixPostgreSQLDefaultSchemaListener.php b/src/Service/Doctrine/FixPostgreSQLDefaultSchemaListener.php index 4bef3c30..301f3dcc 100644 --- a/src/Service/Doctrine/FixPostgreSQLDefaultSchemaListener.php +++ b/src/Service/Doctrine/FixPostgreSQLDefaultSchemaListener.php @@ -21,6 +21,7 @@ public function postGenerateSchema(GenerateSchemaEventArgs $args): void if (!$schemaManager instanceof PostgreSQLSchemaManager) { return; } + foreach ($schemaManager->getExistingSchemaSearchPaths() as $namespace) { if (!$args->getSchema()->hasNamespace($namespace)) { $args->getSchema()->createNamespace($namespace); diff --git a/src/Service/Downloader.php b/src/Service/Downloader.php index 7664f89e..901c6478 100644 --- a/src/Service/Downloader.php +++ b/src/Service/Downloader.php @@ -15,7 +15,7 @@ interface Downloader * * @return Option */ - public function getContents(string $url, array $headers = [], callable $notFoundHandler = null): Option; + public function getContents(string $url, array $headers = [], ?callable $notFoundHandler = null): Option; /** * @param string[] $headers diff --git a/src/Service/Downloader/ReactDownloader.php b/src/Service/Downloader/ReactDownloader.php index 5fc964e7..520e9ff2 100644 --- a/src/Service/Downloader/ReactDownloader.php +++ b/src/Service/Downloader/ReactDownloader.php @@ -17,17 +17,17 @@ final class ReactDownloader implements Downloader { - private LoopInterface $loop; - private Browser $browser; - private Queue $queue; + private readonly LoopInterface $loop; + + private readonly Browser $browser; + + private readonly Queue $queue; public function __construct() { $this->loop = Loop::get(); $this->browser = new Browser($this->loop, new Connector($this->loop, ['timeout' => 10])); - $this->queue = new Queue(100, null, function (string $type, string $url, array $headers = []): PromiseInterface { - return $this->browser->{$type}($url, array_merge($headers, ['User-Agent' => $this->userAgent()])); - }); + $this->queue = new Queue(100, null, fn (string $type, string $url, array $headers = []): PromiseInterface => $this->browser->{$type}($url, array_merge($headers, ['User-Agent' => $this->userAgent()]))); } /** @@ -35,7 +35,7 @@ public function __construct() * * @return Option */ - public function getContents(string $url, array $headers = [], callable $notFoundHandler = null): Option + public function getContents(string $url, array $headers = [], ?callable $notFoundHandler = null): Option { $retries = 3; do { @@ -47,6 +47,7 @@ public function getContents(string $url, array $headers = [], callable $notFound if (isset($http_response_header) && $this->getStatusCode($http_response_header) === 404 && $notFoundHandler !== null) { $notFoundHandler(); } + --$retries; } while ($retries > 0); @@ -61,6 +62,7 @@ public function getAsyncContents(string $url, array $headers, callable $onFulfil if (!is_resource($stream)) { return; } + $onFulfilled($stream); }); } @@ -111,11 +113,12 @@ private function userAgent(): string } /** - * @param mixed[] $headers + * @param array $headers + * @return int */ private function getStatusCode(array $headers): int { - preg_match('{HTTP\/\S*\s(\d{3})}', $headers[0], $match); + preg_match('{HTTP\/\S*\s(\d{3})}', (string) $headers[0], $match); return (int) $match[1]; } diff --git a/src/Service/Integration/Aws/S3AdapterFactory.php b/src/Service/Integration/Aws/S3AdapterFactory.php index 6c5470f9..08e19d58 100644 --- a/src/Service/Integration/Aws/S3AdapterFactory.php +++ b/src/Service/Integration/Aws/S3AdapterFactory.php @@ -5,40 +5,29 @@ namespace Buddy\Repman\Service\Integration\Aws; use Aws\S3\S3Client; +use InvalidArgumentException; final class S3AdapterFactory { - private string $region; - - private bool $isOpaqueAuth; - private string $key; private string $secret; - private ?string $endpoint; - - private ?bool $pathStyleEndpoint; - public function __construct( - string $region, - bool $isOpaqueAuth, + private readonly string $region, + private readonly bool $isOpaqueAuth, ?string $key = null, ?string $secret = null, - ?string $endpoint = null, - ?bool $pathStyleEndpoint = false + private readonly ?string $endpoint = null, + private readonly ?bool $pathStyleEndpoint = false, ) { - $this->region = $region; - $this->isOpaqueAuth = $isOpaqueAuth; - $this->endpoint = $endpoint; - $this->pathStyleEndpoint = $pathStyleEndpoint; - if ($this->isOpaqueAuth) { if ($key === null || $key === '') { - throw new \InvalidArgumentException('Must pass AWS key when authentication is opaque'); + throw new InvalidArgumentException('Must pass AWS key when authentication is opaque'); } + if ($secret === null || $secret === '') { - throw new \InvalidArgumentException('Must pass AWS secret when authentication is opaque'); + throw new InvalidArgumentException('Must pass AWS secret when authentication is opaque'); } $this->key = $key; diff --git a/src/Service/Integration/BitbucketApi/Repositories.php b/src/Service/Integration/BitbucketApi/Repositories.php index 0f015243..753b60bc 100644 --- a/src/Service/Integration/BitbucketApi/Repositories.php +++ b/src/Service/Integration/BitbucketApi/Repositories.php @@ -4,6 +4,8 @@ namespace Buddy\Repman\Service\Integration\BitbucketApi; +use RuntimeException; + final class Repositories { /** @@ -37,7 +39,7 @@ public function names(): array public function get(string $uuid): Repository { if (!isset($this->repos[$uuid])) { - throw new \RuntimeException(sprintf('Repository %s not found', $uuid)); + throw new RuntimeException(sprintf('Repository %s not found', $uuid)); } return $this->repos[$uuid]; diff --git a/src/Service/Integration/BitbucketApi/Repository.php b/src/Service/Integration/BitbucketApi/Repository.php index a353cf66..ca3f6b22 100644 --- a/src/Service/Integration/BitbucketApi/Repository.php +++ b/src/Service/Integration/BitbucketApi/Repository.php @@ -6,15 +6,8 @@ final class Repository { - private string $uuid; - private string $name; - private string $url; - - public function __construct(string $uuid, string $name, string $url) + public function __construct(private readonly string $uuid, private readonly string $name, private readonly string $url) { - $this->uuid = $uuid; - $this->name = $name; - $this->url = $url; } public function uuid(): string diff --git a/src/Service/Integration/BitbucketApi/RestBitbucketApi.php b/src/Service/Integration/BitbucketApi/RestBitbucketApi.php index f142bc7a..cc3b3582 100644 --- a/src/Service/Integration/BitbucketApi/RestBitbucketApi.php +++ b/src/Service/Integration/BitbucketApi/RestBitbucketApi.php @@ -7,16 +7,12 @@ use Bitbucket\Client; use Bitbucket\ResultPagerInterface; use Buddy\Repman\Service\Integration\BitbucketApi; +use RuntimeException; final class RestBitbucketApi implements BitbucketApi { - private Client $client; - private ResultPagerInterface $pager; - - public function __construct(Client $client, ResultPagerInterface $pager) + public function __construct(private readonly Client $client, private readonly ResultPagerInterface $pager) { - $this->client = $client; - $this->pager = $pager; } public function primaryEmail(string $accessToken): string @@ -28,20 +24,18 @@ public function primaryEmail(string $accessToken): string } } - throw new \RuntimeException('Primary e-mail not found.'); + throw new RuntimeException('Primary e-mail not found.'); } public function repositories(string $accessToken): Repositories { $this->client->authenticate(Client::AUTH_OAUTH_TOKEN, $accessToken); - return new Repositories(array_map(function (array $repo): Repository { - return new Repository( - $repo['uuid'], - $repo['full_name'], - $repo['links']['html']['href'].'.git' - ); - }, $this->pager->fetchAll($this->client->repositories(), 'list', [['role' => 'member']]))); + return new Repositories(array_map(fn (array $repo): Repository => new Repository( + $repo['uuid'], + $repo['full_name'], + $repo['links']['html']['href'].'.git' + ), $this->pager->fetchAll($this->client->repositories(), 'list', [['role' => 'member']]))); } public function addHook(string $accessToken, string $fullName, string $hookUrl): void diff --git a/src/Service/Integration/BuddyApi/BuddyApiException.php b/src/Service/Integration/BuddyApi/BuddyApiException.php index 3b85925a..189aa833 100644 --- a/src/Service/Integration/BuddyApi/BuddyApiException.php +++ b/src/Service/Integration/BuddyApi/BuddyApiException.php @@ -4,8 +4,9 @@ namespace Buddy\Repman\Service\Integration\BuddyApi; +use Exception; use Http\Client\Exception as HttpException; -final class BuddyApiException extends \Exception implements HttpException +final class BuddyApiException extends Exception implements HttpException { } diff --git a/src/Service/Integration/BuddyApi/RestBuddyApi.php b/src/Service/Integration/BuddyApi/RestBuddyApi.php index d2deefa4..96ba8251 100644 --- a/src/Service/Integration/BuddyApi/RestBuddyApi.php +++ b/src/Service/Integration/BuddyApi/RestBuddyApi.php @@ -9,11 +9,8 @@ final class RestBuddyApi implements BuddyApi { - private Buddy $client; - - public function __construct(Buddy $client) + public function __construct(private readonly Buddy $client) { - $this->client = $client; } public function primaryEmail(string $accessToken): string diff --git a/src/Service/Integration/GitHubApi/RestGitHubApi.php b/src/Service/Integration/GitHubApi/RestGitHubApi.php index 3447505a..6db52265 100644 --- a/src/Service/Integration/GitHubApi/RestGitHubApi.php +++ b/src/Service/Integration/GitHubApi/RestGitHubApi.php @@ -8,14 +8,12 @@ use Github\AuthMethod; use Github\Client; use Github\ResultPager; +use RuntimeException; final class RestGitHubApi implements GitHubApi { - private Client $client; - - public function __construct(Client $client) + public function __construct(private readonly Client $client) { - $this->client = $client; } public function primaryEmail(string $accessToken): string @@ -27,7 +25,7 @@ public function primaryEmail(string $accessToken): string } } - throw new \RuntimeException('Primary e-mail not found.'); + throw new RuntimeException('Primary e-mail not found.'); } /** diff --git a/src/Service/Integration/GitLabApi/Project.php b/src/Service/Integration/GitLabApi/Project.php index 9f817b6e..655651d1 100644 --- a/src/Service/Integration/GitLabApi/Project.php +++ b/src/Service/Integration/GitLabApi/Project.php @@ -6,15 +6,8 @@ final class Project { - private int $id; - private string $name; - private string $url; - - public function __construct(int $id, string $name, string $url) + public function __construct(private readonly int $id, private readonly string $name, private readonly string $url) { - $this->id = $id; - $this->name = $name; - $this->url = $url; } public function id(): int diff --git a/src/Service/Integration/GitLabApi/Projects.php b/src/Service/Integration/GitLabApi/Projects.php index c99dc6b7..ad1d164c 100644 --- a/src/Service/Integration/GitLabApi/Projects.php +++ b/src/Service/Integration/GitLabApi/Projects.php @@ -4,6 +4,8 @@ namespace Buddy\Repman\Service\Integration\GitLabApi; +use RuntimeException; + final class Projects { /** @@ -37,7 +39,7 @@ public function names(): array public function get(int $id): Project { if (!isset($this->projects[$id])) { - throw new \RuntimeException(sprintf('Project %s not found', $id)); + throw new RuntimeException(sprintf('Project %s not found', $id)); } return $this->projects[$id]; diff --git a/src/Service/Integration/GitLabApi/RestGitLabApi.php b/src/Service/Integration/GitLabApi/RestGitLabApi.php index 854a9dac..9164985d 100644 --- a/src/Service/Integration/GitLabApi/RestGitLabApi.php +++ b/src/Service/Integration/GitLabApi/RestGitLabApi.php @@ -10,13 +10,8 @@ final class RestGitLabApi implements GitLabApi { - private Client $client; - private ResultPager $pager; - - public function __construct(Client $client, ResultPager $pager, string $url) + public function __construct(private readonly Client $client, private readonly ResultPager $pager, string $url) { - $this->client = $client; - $this->pager = $pager; $this->client->setUrl($url); } @@ -69,12 +64,10 @@ private function fetchAllProjects(array $options = []): array 'order_by' => 'last_activity_at', ], $options); - return array_map(function (array $project): Project { - return new Project( - $project['id'], - $project['path_with_namespace'], - $project['web_url'] - ); - }, $this->pager->fetchAll($this->client->projects(), 'all', [$fetchOptions])); + return array_map(fn (array $project): Project => new Project( + $project['id'], + $project['path_with_namespace'], + $project['web_url'] + ), $this->pager->fetchAll($this->client->projects(), 'all', [$fetchOptions])); } } diff --git a/src/Service/IntegrationRegister.php b/src/Service/IntegrationRegister.php index 52dc6613..fbc0069b 100644 --- a/src/Service/IntegrationRegister.php +++ b/src/Service/IntegrationRegister.php @@ -10,15 +10,8 @@ class IntegrationRegister { - private GitHubApi $gitHubApi; - private GitLabApi $gitLabApi; - private BitbucketApi $bitbucketApi; - - public function __construct(GitHubApi $gitHubApi, GitLabApi $gitLabApi, BitbucketApi $bitbucketApi) + public function __construct(private readonly GitHubApi $gitHubApi, private readonly GitLabApi $gitLabApi, private readonly BitbucketApi $bitbucketApi) { - $this->gitHubApi = $gitHubApi; - $this->gitLabApi = $gitLabApi; - $this->bitbucketApi = $bitbucketApi; } public function gitHubApi(): GitHubApi diff --git a/src/Service/Json.php b/src/Service/Json.php index 92fca74c..2b86619b 100644 --- a/src/Service/Json.php +++ b/src/Service/Json.php @@ -13,7 +13,7 @@ public static function decode(string $json): array { $data = json_decode($json, true); if (json_last_error() !== JSON_ERROR_NONE || !is_array($data)) { - $data = []; + return []; } return $data; diff --git a/src/Service/Mailer/SymfonyMailer.php b/src/Service/Mailer/SymfonyMailer.php index a11b8c8d..0f9ff705 100644 --- a/src/Service/Mailer/SymfonyMailer.php +++ b/src/Service/Mailer/SymfonyMailer.php @@ -11,13 +11,8 @@ final class SymfonyMailer implements Mailer { - private MailerInterface $mailer; - private string $sender; - - public function __construct(MailerInterface $mailer, string $sender) + public function __construct(private readonly MailerInterface $mailer, private readonly string $sender) { - $this->mailer = $mailer; - $this->sender = $sender; } public function sendPasswordResetLink(string $email, string $token, string $operatingSystem, string $browser): void @@ -55,7 +50,7 @@ public function sendInvitationToOrganization(string $email, string $token, strin $this->mailer->send((new TemplatedEmail()) ->from(Address::create($this->sender)) ->to($email) - ->subject(sprintf('You\'ve been invited to %s organization', $organizationName)) + ->subject(sprintf("You've been invited to %s organization", $organizationName)) ->htmlTemplate('emails/organization-invitation.html.twig') ->context([ 'userEmail' => $email, @@ -75,7 +70,7 @@ public function sendScanResult(array $emails, string $packageName, string $packa $this->mailer->send((new TemplatedEmail()) ->from(Address::create($this->sender)) ->to($email) - ->subject("Vulnerabilities found in $packageName package") + ->subject(sprintf('Vulnerabilities found in %s package', $packageName)) ->htmlTemplate('emails/scan-result.html.twig') ->context([ 'packageName' => $packageName, diff --git a/src/Service/Organization/AliasGenerator.php b/src/Service/Organization/AliasGenerator.php index 3a0af686..3a0d962d 100644 --- a/src/Service/Organization/AliasGenerator.php +++ b/src/Service/Organization/AliasGenerator.php @@ -10,7 +10,7 @@ public function generate(string $name): string { $text = transliterator_transliterate('Any-Latin; Latin-ASCII; [^\u001F-\u007f] remove', $name); $text = strtolower((string) $text); - $text = preg_replace('~[^-\w]+~', ' ', $text); + $text = preg_replace('~[^\-\w]+~', ' ', $text); $text = preg_replace('~\s+~', '-', (string) $text); return trim((string) $text, '-'); diff --git a/src/Service/Organization/MemberParamConverter.php b/src/Service/Organization/MemberParamConverter.php index 04d6178c..0433a139 100644 --- a/src/Service/Organization/MemberParamConverter.php +++ b/src/Service/Organization/MemberParamConverter.php @@ -24,6 +24,7 @@ public function apply(Request $request, ParamConverter $configuration) if (null === $userId = $request->attributes->get($configuration->getName())) { throw new BadRequestHttpException('Missing member parameter in request'); } + $organization = $request->attributes->get('organization'); if (!$organization instanceof Organization) { throw new BadRequestHttpException('Missing organization parameter in request'); diff --git a/src/Service/Organization/OrganizationAnonymousUserVoter.php b/src/Service/Organization/OrganizationAnonymousUserVoter.php index 8d270fc1..d3cc2957 100644 --- a/src/Service/Organization/OrganizationAnonymousUserVoter.php +++ b/src/Service/Organization/OrganizationAnonymousUserVoter.php @@ -13,18 +13,13 @@ final class OrganizationAnonymousUserVoter extends Voter { - private OrganizationQuery $organizations; - - public function __construct(OrganizationQuery $organizations) + public function __construct(private readonly OrganizationQuery $organizations) { - $this->organizations = $organizations; } protected function supports(string $attribute, $subject): bool { - return in_array($attribute, [ - 'ROLE_ORGANIZATION_ANONYMOUS_USER', - ], true); + return $attribute === 'ROLE_ORGANIZATION_ANONYMOUS_USER'; } /** diff --git a/src/Service/Organization/OrganizationParamConverter.php b/src/Service/Organization/OrganizationParamConverter.php index 2db5ac4f..0d63ccef 100644 --- a/src/Service/Organization/OrganizationParamConverter.php +++ b/src/Service/Organization/OrganizationParamConverter.php @@ -14,11 +14,8 @@ final class OrganizationParamConverter implements ParamConverterInterface { - private OrganizationQuery $organizationQuery; - - public function __construct(OrganizationQuery $organizationQuery) + public function __construct(private readonly OrganizationQuery $organizationQuery) { - $this->organizationQuery = $organizationQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Service/Organization/OrganizationVoter.php b/src/Service/Organization/OrganizationVoter.php index 592e5676..188958cc 100644 --- a/src/Service/Organization/OrganizationVoter.php +++ b/src/Service/Organization/OrganizationVoter.php @@ -13,11 +13,8 @@ final class OrganizationVoter extends Voter { - private OrganizationQuery $organizations; - - public function __construct(OrganizationQuery $organizations) + public function __construct(private readonly OrganizationQuery $organizations) { - $this->organizations = $organizations; } protected function supports(string $attribute, $subject): bool diff --git a/src/Service/Organization/PackageDetailsParamConverter.php b/src/Service/Organization/PackageDetailsParamConverter.php index 9ddb4de5..dfa6c74a 100644 --- a/src/Service/Organization/PackageDetailsParamConverter.php +++ b/src/Service/Organization/PackageDetailsParamConverter.php @@ -15,11 +15,8 @@ final class PackageDetailsParamConverter implements ParamConverterInterface { - private PackageQuery $packageQuery; - - public function __construct(PackageQuery $packageQuery) + public function __construct(private readonly PackageQuery $packageQuery) { - $this->packageQuery = $packageQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Service/Organization/PackageManager.php b/src/Service/Organization/PackageManager.php index 55e5c17c..db94ccaf 100644 --- a/src/Service/Organization/PackageManager.php +++ b/src/Service/Organization/PackageManager.php @@ -8,27 +8,32 @@ use Buddy\Repman\Service\Dist; use Buddy\Repman\Service\Dist\Storage; use Composer\Semver\VersionParser; -use League\Flysystem\FileNotFoundException; -use League\Flysystem\FilesystemInterface; +use DateTimeImmutable; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; +use League\Flysystem\UnableToReadFile; use Munus\Control\Option; +use function array_filter; +use function array_merge; +use function glob; +use function serialize; +use function unserialize; class PackageManager { - private Storage $distStorage; - private FilesystemInterface $repoFilesystem; - private VersionParser $versionParser; + private readonly VersionParser $versionParser; - public function __construct(Storage $distStorage, FilesystemInterface $repoFilesystem) + public function __construct(private readonly Storage $distStorage, private readonly FilesystemOperator $repoFilesystem) { - $this->distStorage = $distStorage; - $this->repoFilesystem = $repoFilesystem; $this->versionParser = new VersionParser(); } /** * @param PackageName[] $packages * - * @return array{\DateTimeImmutable|null, mixed[]} + * @throws FilesystemException + * + * @return array{(DateTimeImmutable | null), mixed[]} */ public function findProviders(string $organizationAlias, array $packages): array { @@ -37,17 +42,17 @@ public function findProviders(string $organizationAlias, array $packages): array foreach ($packages as $package) { $filepath = $this->filepath($organizationAlias, $package->name()); - if (!$this->repoFilesystem->has($filepath)) { + if (!$this->repoFilesystem->fileExists($filepath)) { continue; } - $fileModifyDate = (new \DateTimeImmutable())->setTimestamp((int) $this->repoFilesystem->getTimestamp($filepath)); + $fileModifyDate = (new DateTimeImmutable())->setTimestamp((int) $this->repoFilesystem->lastModified($filepath)); if ($fileModifyDate > $lastModified) { $lastModified = $fileModifyDate; } - $json = \unserialize( + $json = unserialize( (string) $this->repoFilesystem->read($filepath), ['allowed_classes' => false] ); $data[] = $json['packages'] ?? []; @@ -55,16 +60,19 @@ public function findProviders(string $organizationAlias, array $packages): array return [ $lastModified, - \array_merge(...$data), + array_merge(...$data), ]; } /** - * @param mixed[] $json + * @param array $json + * @param string $organizationAlias + * @param string $packageName + * @throws FilesystemException */ public function saveProvider(array $json, string $organizationAlias, string $packageName): void { - $this->repoFilesystem->put($this->filepath($organizationAlias, $packageName), \serialize($json)); + $this->repoFilesystem->write($this->filepath($organizationAlias, $packageName), serialize($json)); } public function removeProvider(string $organizationAlias, string $packageName): self @@ -75,10 +83,13 @@ public function removeProvider(string $organizationAlias, string $packageName): return $this; } + /** + * @throws FilesystemException + */ public function removeDist(string $organizationAlias, string $packageName): self { $distDir = $organizationAlias.'/dist/'.$packageName; - $this->repoFilesystem->deleteDir($distDir); + $this->repoFilesystem->deleteDirectory($distDir); return $this; } @@ -87,8 +98,8 @@ public function removeVersionDists(string $organizationAlias, string $packageNam { $baseFilename = $organizationAlias.'/dist/'.$packageName.'/'.$this->versionParser->normalize($version).'_'; - $filesToDelete = \array_filter( - (array) \glob($baseFilename.'*.'.$format), + $filesToDelete = array_filter( + (array) glob($baseFilename.'*.'.$format), fn ($file) => $file !== $baseFilename.$excludeRef.'.'.$format ); @@ -96,15 +107,19 @@ public function removeVersionDists(string $organizationAlias, string $packageNam if (false === $fileName) { continue; } + $this->removeFile($fileName); } return $this; } + /** + * @throws FilesystemException + */ public function removeOrganizationDir(string $organizationAlias): self { - $this->repoFilesystem->deleteDir($organizationAlias); + $this->repoFilesystem->deleteDirectory($organizationAlias); return $this; } @@ -123,10 +138,12 @@ public function distFilename(string $organizationAlias, string $package, string } /** + * @throws FilesystemException + * * @return Option Handle for a file */ public function getDistFileReference( - string $fileName + string $fileName, ): Option { $fileResource = $this->repoFilesystem->readStream($fileName); if (false === $fileResource) { @@ -145,7 +162,7 @@ private function removeFile(string $fileName): void { try { $this->repoFilesystem->delete($fileName); - } catch (FileNotFoundException $ignored) { + } catch (UnableToReadFile) { } } } diff --git a/src/Service/Organization/PackageParamConverter.php b/src/Service/Organization/PackageParamConverter.php index 12d28d51..5cd350ed 100644 --- a/src/Service/Organization/PackageParamConverter.php +++ b/src/Service/Organization/PackageParamConverter.php @@ -15,11 +15,8 @@ final class PackageParamConverter implements ParamConverterInterface { - private PackageQuery $packageQuery; - - public function __construct(PackageQuery $packageQuery) + public function __construct(private readonly PackageQuery $packageQuery) { - $this->packageQuery = $packageQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Service/Organization/TokenParamConverter.php b/src/Service/Organization/TokenParamConverter.php index 33e975da..eaf7fe9a 100644 --- a/src/Service/Organization/TokenParamConverter.php +++ b/src/Service/Organization/TokenParamConverter.php @@ -13,11 +13,8 @@ final class TokenParamConverter implements ParamConverterInterface { - private OrganizationQuery $organizationQuery; - - public function __construct(OrganizationQuery $organizationQuery) + public function __construct(private readonly OrganizationQuery $organizationQuery) { - $this->organizationQuery = $organizationQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Service/Organization/WebhookRequests.php b/src/Service/Organization/WebhookRequests.php index 0063e959..244c9f3d 100644 --- a/src/Service/Organization/WebhookRequests.php +++ b/src/Service/Organization/WebhookRequests.php @@ -4,18 +4,16 @@ namespace Buddy\Repman\Service\Organization; +use DateTimeImmutable; use Doctrine\DBAL\Connection; final class WebhookRequests { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } - public function add(string $packageId, \DateTimeImmutable $date, ?string $ip, ?string $userAgent): void + public function add(string $packageId, DateTimeImmutable $date, ?string $ip, ?string $userAgent): void { $this->connection->insert('organization_package_webhook_request', [ 'package_id' => $packageId, diff --git a/src/Service/PackageNormalizer.php b/src/Service/PackageNormalizer.php index 26bbc3b3..b8f4eeb2 100644 --- a/src/Service/PackageNormalizer.php +++ b/src/Service/PackageNormalizer.php @@ -9,7 +9,7 @@ final class PackageNormalizer { - private ArrayDumper $dumper; + private readonly ArrayDumper $dumper; public function __construct() { diff --git a/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php b/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php index eda1d6bd..c2534c8d 100644 --- a/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php +++ b/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php @@ -5,7 +5,6 @@ namespace Buddy\Repman\Service\PackageSynchronizer; use Buddy\Repman\Entity\Organization\Package; -use Buddy\Repman\Entity\Organization\Package\Abandoned; use Buddy\Repman\Entity\Organization\Package\Link; use Buddy\Repman\Entity\Organization\Package\Version; use Buddy\Repman\Repository\PackageRepository; @@ -26,33 +25,28 @@ use Composer\Repository\RepositoryFactory; use Composer\Repository\RepositoryInterface; use Composer\Semver\Comparator; +use DateTime; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; +use RuntimeException; use Symfony\Component\Console\Output\OutputInterface; +use Throwable; +use function parse_url; +use const PHP_URL_HOST; +use const PHP_URL_PORT; final class ComposerPackageSynchronizer implements PackageSynchronizer { - private PackageManager $packageManager; - private PackageNormalizer $packageNormalizer; - private PackageRepository $packageRepository; - private Storage $distStorage; - private ReadmeExtractor $readmeExtractor; - private UserOAuthTokenRefresher $tokenRefresher; - private string $gitlabUrl; + private readonly ReadmeExtractor $readmeExtractor; public function __construct( - PackageManager $packageManager, - PackageNormalizer $packageNormalizer, - PackageRepository $packageRepository, - Storage $distStorage, - UserOAuthTokenRefresher $tokenRefresher, - string $gitlabUrl + private readonly PackageManager $packageManager, + private readonly PackageNormalizer $packageNormalizer, + private readonly PackageRepository $packageRepository, + private readonly Storage $distStorage, + private readonly UserOAuthTokenRefresher $tokenRefresher, + private readonly string $gitlabUrl, ) { - $this->packageManager = $packageManager; - $this->packageNormalizer = $packageNormalizer; - $this->packageRepository = $packageRepository; - $this->distStorage = $distStorage; - $this->tokenRefresher = $tokenRefresher; - $this->gitlabUrl = $gitlabUrl; $this->readmeExtractor = new ReadmeExtractor($this->distStorage); } @@ -82,7 +76,7 @@ public function synchronize(Package $package): void }); if ($packages === []) { - throw new \RuntimeException('Package not found'); + throw new RuntimeException('Package not found'); } $latest = current($packages); @@ -98,15 +92,15 @@ public function synchronize(Package $package): void $name = $latest->getPrettyName(); if ($name === null) { - throw new \RuntimeException('Missing package name in latest version. Revision: '.$latest->getDistReference()); + throw new RuntimeException('Missing package name in latest version. Revision: '.$latest->getDistReference()); } if (preg_match(Package::NAME_PATTERN, $name, $matches) !== 1) { - throw new \RuntimeException("Package name {$name} is invalid"); + throw new RuntimeException(sprintf('Package name %s is invalid', $name)); } if (!$package->isSynchronized() && $this->packageRepository->packageExist($name, $package->organizationId())) { - throw new \RuntimeException("Package {$name} already exists. Package name must be unique within organization."); + throw new RuntimeException(sprintf('Package %s already exists. Package name must be unique within organization.', $name)); } $versions = []; @@ -121,7 +115,7 @@ public function synchronize(Package $package): void 'distType' => $p->getDistType(), 'distUrl' => $p->getDistUrl(), 'authHeaders' => $this->getAuthHeaders($package), - 'releaseDate' => \DateTimeImmutable::createFromMutable($p->getReleaseDate() ?? new \DateTime()), + 'releaseDate' => DateTimeImmutable::createFromMutable($p->getReleaseDate() ?? new DateTime()), 'stability' => $p->getStability(), ]; } @@ -213,13 +207,13 @@ public function synchronize(Package $package): void $latest->getStability() === Version::STABILITY_STABLE ? $latest->getPrettyVersion() : 'no stable release', $encounteredVersions, $encounteredLinks, - \DateTimeImmutable::createFromMutable($latest->getReleaseDate() ?? new \DateTime()), + DateTimeImmutable::createFromMutable($latest->getReleaseDate() ?? new DateTime()), ); $this->packageManager->saveProvider($json, $package->organizationAlias(), $name); - } catch (\Throwable $exception) { + } catch (Throwable $throwable) { $package->syncFailure(sprintf('Error: %s%s', - $exception->getMessage(), + $throwable->getMessage(), isset($io) && strlen($io->getOutput()) > 1 ? "\nLogs:\n".$io->getOutput() : '' )); } @@ -239,12 +233,12 @@ private function getAuthHeaders(Package $package): array private function getGitlabUrl(): string { - $port = (string) \parse_url($this->gitlabUrl, \PHP_URL_PORT); + $port = (string) parse_url($this->gitlabUrl, PHP_URL_PORT); if ($port !== '') { $port = ':'.$port; } - return \parse_url($this->gitlabUrl, \PHP_URL_HOST).$port; + return parse_url($this->gitlabUrl, PHP_URL_HOST).$port; } private function createIO(Package $package): BufferIO @@ -278,7 +272,7 @@ private function createConfig(Package $package, IOInterface $io): Config $config->merge([ 'repositories' => [ [ - 'type' => strpos($package->type(), '-oauth') !== false ? 'vcs' : $package->type(), + 'type' => str_contains($package->type(), '-oauth') ? 'vcs' : $package->type(), 'url' => $package->repositoryUrl(), ], ], diff --git a/src/Service/Proxy.php b/src/Service/Proxy.php index d2749b3e..c572c78b 100644 --- a/src/Service/Proxy.php +++ b/src/Service/Proxy.php @@ -6,50 +6,76 @@ use Buddy\Repman\Service\Proxy\DistFile; use Buddy\Repman\Service\Proxy\Metadata; -use League\Flysystem\FileNotFoundException; -use League\Flysystem\FilesystemInterface; +use InvalidArgumentException; +use JsonException; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; +use League\Flysystem\UnableToReadFile; use Munus\Collection\GenericList; use Munus\Control\Option; +use RuntimeException; +use Throwable; +use function array_filter; +use function array_pop; +use function array_shift; +use function basename; +use function dirname; +use function hash; +use function in_array; +use function is_array; +use function json_decode; +use function json_encode; +use function krsort; +use function ksort; +use function ltrim; +use function parse_url; +use function pathinfo; +use function preg_match; +use function preg_replace; +use function rtrim; +use function sprintf; +use function stream_get_contents; +use const JSON_THROW_ON_ERROR; +use const JSON_UNESCAPED_SLASHES; +use const PHP_URL_HOST; +use const PHP_URL_PATH; +use const PHP_URL_SCHEME; final class Proxy { - private string $url; - private string $name; - private FilesystemInterface $filesystem; - private Downloader $downloader; + private readonly string $url; public function __construct( - string $name, + private readonly string $name, string $url, - FilesystemInterface $proxyFilesystem, - Downloader $downloader + private readonly FilesystemOperator $filesystem, + private readonly Downloader $downloader, ) { - $this->name = $name; - $this->url = \rtrim($url, '/'); - $this->filesystem = $proxyFilesystem; - $this->downloader = $downloader; + $this->url = rtrim($url, '/'); } /** - * @return Option + * @throws FilesystemException */ public function metadata(string $package): Option { - return $this->fetchMetadataLazy(\sprintf('%s/p2/%s.json', $this->url, $package)); + return $this->fetchMetadataLazy(sprintf('%s/p2/%s.json', $this->url, $package)); } /** + * @throws FilesystemException|Throwable + * * @return Option */ public function distribution(string $package, string $version, string $ref, string $format): Option { $path = $this->distPath($package, $ref, $format); - if (!$this->filesystem->has($path)) { + if (!$this->filesystem->fileExists($path)) { foreach ($this->decodeMetadata($package) as $packageData) { if (($packageData['dist']['reference'] ?? '') === $ref) { - $this->filesystem->putStream($path, $this->downloader->getContents($packageData['dist']['url']) - ->getOrElseThrow(new \RuntimeException( - \sprintf('Failed to download file from %s', $packageData['dist']['url']))) + $this->filesystem->writeStream($path, $this->downloader->getContents($packageData['dist']['url']) + ->getOrElseThrow(new RuntimeException( + sprintf('Failed to download file from %s', $packageData['dist']['url']))) ); break; } @@ -58,43 +84,52 @@ public function distribution(string $package, string $version, string $ref, stri try { $stream = $this->filesystem->readStream($path); - $fileSize = $this->filesystem->getSize($path); + $fileSize = $this->filesystem->fileSize($path); return $stream !== false && $fileSize !== false ? Option::some(new DistFile($stream, $fileSize)) : Option::none(); - } catch (FileNotFoundException $exception) { + } catch (UnableToReadFile) { return Option::none(); } } /** - * @return Option + * @throws FilesystemException */ public function legacyMetadata(string $package, ?string $hash = null): Option { return $hash === null ? - $this->fetchMetadataLazy(\sprintf('%s/p/%s.json', $this->url, $package)) : - $this->fetchMetadata(\sprintf('%s/p/%s$%s.json', $this->url, $package, $hash)); + $this->fetchMetadataLazy(sprintf('%s/p/%s.json', $this->url, $package)) : + $this->fetchMetadata(sprintf('%s/p/%s$%s.json', $this->url, $package, $hash)); } /** - * @return Option + * @throws FilesystemException */ public function providers(string $version, string $hash): Option { - return $this->fetchMetadata(\sprintf('%s/provider/provider-%s$%s.json', $this->url, $version, $hash)); + return $this->fetchMetadata(sprintf('%s/provider/provider-%s$%s.json', $this->url, $version, $hash)); } /** + * @throws FilesystemException + * * @return Option */ public function latestProvider(): Option { $providers = []; - foreach ($this->filesystem->listContents($this->name.'/provider') as $file) { - if ($file['type'] === 'file' && $file['extension'] === 'json' && \strpos($file['filename'], '$') !== false) { - $providers[$file['timestamp']] = $file; + foreach (iterator_to_array($this->filesystem->listContents($this->name.'/provider')) as $file) { + $path = $file->path(); + $filename = basename($path); + $extension = pathinfo($filename, PATHINFO_EXTENSION); + + if ($file->isFile() && $extension === 'json' && str_contains($filename, '$')) { + $providers[$file->lastModified()] = [ + 'path' => $path, + 'filename' => $filename, + ]; } } @@ -102,84 +137,137 @@ public function latestProvider(): Option return Option::none(); } - \ksort($providers); - $provider = \array_pop($providers); + ksort($providers); + $provider = array_pop($providers); - \preg_match('/\$(?.+)$/', $provider['filename'], $matches); + preg_match('/\$(?.+)$/', $provider['filename'], $matches); $hash = $matches['hash']; return $this->fetchMetadata( - \sprintf('%s/provider/provider-latest$%s.json', $this->url, $hash), + sprintf('%s/provider/provider-latest$%s.json', $this->url, $hash), $hash ); } /** + * @throws FilesystemException + * * @return GenericList */ public function syncedPackages(): GenericList { $packages = GenericList::empty(); - foreach ($this->filesystem->listContents(\sprintf('%s/dist', $this->name)) as $vendor) { - foreach ($this->filesystem->listContents($vendor['path']) as $package) { - $packages = $packages->append($vendor['basename'].'/'.$package['basename']); + foreach (iterator_to_array($this->filesystem->listContents(sprintf('%s/dist', $this->name))) as $vendor) { + $vendorPath = $vendor->path(); + $vendorBaseName = basename($vendorPath); + foreach (iterator_to_array($this->filesystem->listContents($vendorPath)) as $package) { + $packagePath = $package->path(); + $packageBaseName = basename($packagePath); + $packages = $packages->append($vendorBaseName.'/'.$packageBaseName); } } return $packages; } + /** + * @throws FilesystemException + * @throws Throwable + */ public function download(string $package, string $version): void { $lastDist = null; foreach ($this->decodeMetadata($package) as $packageData) { $lastDist = $packageData['dist'] ?? $lastDist; - if (!isset($lastDist['reference']) || !isset($lastDist['type']) || !isset($lastDist['url'])) { + if (!isset($lastDist['reference'])) { + continue; + } + + if (!isset($lastDist['type'])) { + continue; + } + + if (!isset($lastDist['url'])) { continue; } $path = $this->distPath($package, $lastDist['reference'], $lastDist['type']); - if ($version === $packageData['version'] && !$this->filesystem->has($path)) { + if ($version === $packageData['version'] && !$this->filesystem->fileExists($path)) { $this->filesystem->writeStream($path, $this->downloader->getContents($lastDist['url']) - ->getOrElseThrow(new \RuntimeException(\sprintf('Failed to download file from %s', $lastDist['url']))) + ->getOrElseThrow(new RuntimeException(sprintf('Failed to download file from %s', $lastDist['url']))) ); break; } } } + /** + * @throws FilesystemException + */ public function removeDist(string $package): void { if (mb_strlen($package) === 0) { - throw new \InvalidArgumentException('Empty package name'); + throw new InvalidArgumentException('Empty package name'); } - $this->filesystem->deleteDir(\sprintf('%s/dist/%s', $this->name, $package)); + $this->filesystem->deleteDirectory(sprintf('%s/dist/%s', $this->name, $package)); } + /** + * @throws FilesystemException + */ public function syncMetadata(): void { foreach ($this->filesystem->listContents($this->name) as $dir) { - if (!\in_array($dir['basename'], ['p', 'p2'], true)) { + $dirPath = $dir->path(); + $dirBaseName = basename($dirPath); + if (!in_array($dirBaseName, ['p', 'p2'], true)) { continue; } $this->syncPackagesMetadata( - \array_filter( - $this->filesystem->listContents($dir['path'], true), - fn (array $file) => $file['type'] === 'file' && $file['extension'] === 'json' && \strpos($file['filename'], '$') === false) + array_filter( + iterator_to_array($this->filesystem->listContents($dirPath, true)), + function ($file) { + if (!$file->isFile()) { + return false; + } + + $path = $file->path(); + $filename = basename($path); + $extension = pathinfo($filename, PATHINFO_EXTENSION); + + return $extension === 'json' && !str_contains($filename, '$'); + } + ) ); } + $this->downloader->run(); } + /** + * @throws FilesystemException + * @throws JsonException + */ public function updateLatestProviders(): void { $this->updateLatestProvider( - \array_filter( - $this->filesystem->listContents($this->name.'/p', true), - fn (array $file) => $file['type'] === 'file' && $file['extension'] === 'json' && \strpos($file['filename'], '$') !== false) + array_filter( + iterator_to_array($this->filesystem->listContents($this->name.'/p', true)), + function ($file) { + if (!$file->isFile()) { + return false; + } + + $path = $file->path(); + $filename = basename($path); + $extension = pathinfo($filename, PATHINFO_EXTENSION); + + return $extension === 'json' && str_contains($filename, '$'); + } + ) ); } @@ -188,24 +276,21 @@ public function url(): string return $this->url; } - /** - * @param mixed[] $files - */ private function syncPackagesMetadata(array $files): void { foreach ($files as $file) { - $url = \sprintf('%s://%s', \parse_url($this->url, \PHP_URL_SCHEME), $file['path']); - $this->downloader->getAsyncContents($url, [], function ($stream) use ($file): void { - $path = $file['path']; - $contents = (string) \stream_get_contents($stream); - - $this->filesystem->put($path, $contents); - if (strpos($path, $this->name.'/p2') === false) { - $this->filesystem->put( - (string) \preg_replace( + $path = $file->path(); + $url = sprintf('%s://%s', parse_url($this->url, PHP_URL_SCHEME), $path); + $this->downloader->getAsyncContents($url, [], function ($stream) use ($path): void { + $contents = (string) stream_get_contents($stream); + + $this->filesystem->write($path, $contents); + if (!str_contains((string) $path, $this->name.'/p2')) { + $this->filesystem->write( + (string) preg_replace( '/(.+?)(\$\w+|)(\.json)$/', - '${1}\$'.\hash('sha256', $contents).'.json', - $path, + '${1}\$'.hash('sha256', $contents).'.json', + (string) $path, 1 ), $contents @@ -216,83 +301,106 @@ private function syncPackagesMetadata(array $files): void } /** - * @param mixed[] $files + * @throws FilesystemException + * @throws JsonException */ private function updateLatestProvider(array $files): void { $latest = []; foreach ($files as $file) { - \preg_match('/(?.+)\$/', $file['filename'], $matches); - $key = $file['dirname'].'/'.$matches['name']; + $path = $file->path(); + $filename = basename((string) $path); + $dirname = dirname((string) $path); + + preg_match('/(?.+)\$/', $filename, $matches); + $key = $dirname.'/'.$matches['name']; if (!isset($latest[$key])) { - $latest[$key] = $file; + $latest[$key] = [ + 'path' => $path, + 'timestamp' => $file->lastModified(), + ]; continue; } - if ($file['timestamp'] >= $latest[$key]['timestamp']) { + if ($file->lastModified() >= $latest[$key]['timestamp']) { $this->filesystem->delete($latest[$key]['path']); - $latest[$key] = $file; + $latest[$key] = [ + 'path' => $path, + 'timestamp' => $file->lastModified(), + ]; continue; } - $this->filesystem->delete($file['path']); + $this->filesystem->delete($path); } $providers = []; - foreach ($latest as $file) { - $path = $file['path']; - \preg_match('/'.$this->name.'\/p\/(?.+)\$/', $path, $matches); + foreach ($latest as $fileData) { + $path = $fileData['path']; + preg_match('/'.$this->name.'\/p\/(?.+)\$/', (string) $path, $matches); $providers[$matches['name']] = [ - 'sha256' => \hash('sha256', (string) $this->filesystem->read($path)), + 'sha256' => hash('sha256', (string) $this->filesystem->read($path)), ]; } - $contents = \json_encode([ + $contents = json_encode([ 'providers' => $providers, - ], \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_SLASHES); - $basePath = \sprintf('%s/provider', $this->name); + ], JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES); + $basePath = sprintf('%s/provider', $this->name); $oldProviders = []; - foreach ($this->filesystem->listContents($basePath) as $file) { - if ($file['type'] !== 'file' || $file['extension'] !== 'json') { + foreach (iterator_to_array($this->filesystem->listContents($basePath)) as $file) { + $path = $file->path(); + $filename = basename($path); + $extension = pathinfo($filename, PATHINFO_EXTENSION); + + if (!$file->isFile()) { continue; } - $oldProviders[$file['timestamp']] = $file; + if ($extension !== 'json') { + continue; + } + + $oldProviders[$file->lastModified()] = [ + 'path' => $path, + ]; } - \krsort($oldProviders); - \array_shift($oldProviders); + krsort($oldProviders); + array_shift($oldProviders); foreach ($oldProviders as $file) { $this->filesystem->delete($file['path']); } - $this->filesystem->put( - \sprintf('%s/provider-latest$%s.json', $basePath, \hash('sha256', $contents)), + $this->filesystem->write( + sprintf('%s/provider-latest$%s.json', $basePath, hash('sha256', $contents)), $contents ); } /** - * @return mixed[] + * @throws FilesystemException */ private function decodeMetadata(string $package): array { /** @var Metadata $metadata */ $metadata = $this->metadata($package)->getOrElse(Metadata::fromString('[]')); - $metadata = \json_decode((string) \stream_get_contents($metadata->stream()), true); + $metadata = json_decode((string) stream_get_contents($metadata->stream()), true); - return \is_array($metadata) ? ($metadata['packages'][$package] ?? []) : []; + return is_array($metadata) ? ($metadata['packages'][$package] ?? []) : []; } /** + * @throws FilesystemException + * * @return Option */ private function fetchMetadata(string $url, ?string $hash = null): Option { $path = $this->metadataPath($url); - if (!$this->filesystem->has($path)) { + if (!$this->filesystem->fileExists($path)) { return Option::none(); } @@ -301,10 +409,10 @@ private function fetchMetadata(string $url, ?string $hash = null): Option return Option::none(); } - $fileSize = $this->filesystem->getSize($path); + $fileSize = $this->filesystem->fileSize($path); return Option::some(new Metadata( - (int) $this->filesystem->getTimestamp($path), + (int) $this->filesystem->lastModified($path), $stream, $fileSize === false ? 0 : $fileSize, $hash @@ -312,16 +420,19 @@ private function fetchMetadata(string $url, ?string $hash = null): Option } /** + * @throws FilesystemException + * * @return Option */ private function fetchMetadataLazy(string $url): Option { $path = $this->metadataPath($url); - if (!$this->filesystem->has($path)) { + if (!$this->filesystem->fileExists($path)) { $metadata = $this->downloader->getContents($url)->getOrNull(); if ($metadata === null) { return Option::none(); } + $this->filesystem->writeStream($path, $metadata); } @@ -330,10 +441,10 @@ private function fetchMetadataLazy(string $url): Option return Option::none(); } - $fileSize = $this->filesystem->getSize($path); + $fileSize = $this->filesystem->fileSize($path); return Option::some(new Metadata( - (int) $this->filesystem->getTimestamp($path), + (int) $this->filesystem->lastModified($path), $stream, $fileSize === false ? 0 : $fileSize )); @@ -341,9 +452,9 @@ private function fetchMetadataLazy(string $url): Option private function distPath(string $package, string $ref, string $format): string { - return \sprintf( + return sprintf( '%s/dist/%s/%s.%s', - (string) \parse_url($this->url, \PHP_URL_HOST), + (string) parse_url($this->url, PHP_URL_HOST), $package, $ref, $format @@ -352,6 +463,6 @@ private function distPath(string $package, string $ref, string $format): string private function metadataPath(string $url): string { - return \parse_url($url, \PHP_URL_HOST).'/'.\ltrim((string) \parse_url($url, \PHP_URL_PATH), '/'); + return parse_url($url, PHP_URL_HOST).'/'.ltrim((string) parse_url($url, PHP_URL_PATH), '/'); } } diff --git a/src/Service/Proxy/DistFile.php b/src/Service/Proxy/DistFile.php index db669815..50a597f0 100644 --- a/src/Service/Proxy/DistFile.php +++ b/src/Service/Proxy/DistFile.php @@ -6,20 +6,11 @@ class DistFile { - /** - * @var resource - */ - private $stream; - - private int $fileSize; - /** * @param resource $stream */ - public function __construct($stream, int $fileSize) + public function __construct(private $stream, private readonly int $fileSize) { - $this->stream = $stream; - $this->fileSize = $fileSize; } /** diff --git a/src/Service/Proxy/Downloads.php b/src/Service/Proxy/Downloads.php index 21acc77a..bb5c7bba 100644 --- a/src/Service/Proxy/Downloads.php +++ b/src/Service/Proxy/Downloads.php @@ -4,22 +4,20 @@ namespace Buddy\Repman\Service\Proxy; -use Buddy\Repman\Service\Proxy\Downloads\Package; +use DateTimeImmutable; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Exception; final class Downloads { - private Connection $connection; - - public function __construct(Connection $connection) + public function __construct(private readonly Connection $connection) { - $this->connection = $connection; } /** - * @param Package[] $packages + * @throws Exception */ - public function save(array $packages, \DateTimeImmutable $date, ?string $ip, ?string $userAgent): void + public function save(array $packages, DateTimeImmutable $date, ?string $ip, ?string $userAgent): void { foreach ($packages as $package) { $this->connection->insert('proxy_package_download', [ diff --git a/src/Service/Proxy/Downloads/Package.php b/src/Service/Proxy/Downloads/Package.php index f4cdd444..d263acf5 100644 --- a/src/Service/Proxy/Downloads/Package.php +++ b/src/Service/Proxy/Downloads/Package.php @@ -6,13 +6,8 @@ final class Package { - private string $name; - private string $version; - - public function __construct(string $name, string $version) + public function __construct(private readonly string $name, private readonly string $version) { - $this->name = $name; - $this->version = $version; } public function name(): string diff --git a/src/Service/Proxy/Metadata.php b/src/Service/Proxy/Metadata.php index 72dd57d2..76d1077b 100644 --- a/src/Service/Proxy/Metadata.php +++ b/src/Service/Proxy/Metadata.php @@ -5,34 +5,21 @@ namespace Buddy\Repman\Service\Proxy; use Buddy\Repman\Service\Stream; +use function strlen; +use function time; final class Metadata { - private int $timestamp; - - /** - * @var resource - */ - private $stream; - - private int $contentSize; - - private ?string $hash; - /** * @param resource $stream */ - public function __construct(int $timestamp, $stream, int $contentSize, ?string $hash = null) + public function __construct(private readonly int $timestamp, private $stream, private readonly int $contentSize, private readonly ?string $hash = null) { - $this->timestamp = $timestamp; - $this->stream = $stream; - $this->contentSize = $contentSize; - $this->hash = $hash; } public static function fromString(string $string): self { - return new self(\time(), Stream::fromString($string), \strlen($string)); + return new self(time(), Stream::fromString($string), strlen($string)); } public function timestamp(): int diff --git a/src/Service/Proxy/ProxyFactory.php b/src/Service/Proxy/ProxyFactory.php index 3131d0f4..afb5342a 100644 --- a/src/Service/Proxy/ProxyFactory.php +++ b/src/Service/Proxy/ProxyFactory.php @@ -6,17 +6,12 @@ use Buddy\Repman\Service\Downloader; use Buddy\Repman\Service\Proxy; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\FilesystemOperator; final class ProxyFactory { - private Downloader $downloader; - private FilesystemInterface $filesystem; - - public function __construct(Downloader $downloader, FilesystemInterface $proxyFilesystem) + public function __construct(private readonly Downloader $downloader, private readonly FilesystemOperator $filesystem) { - $this->downloader = $downloader; - $this->filesystem = $proxyFilesystem; } public function create(string $url): Proxy diff --git a/src/Service/Proxy/ProxyRegister.php b/src/Service/Proxy/ProxyRegister.php index 6ab8c968..ada19f38 100644 --- a/src/Service/Proxy/ProxyRegister.php +++ b/src/Service/Proxy/ProxyRegister.php @@ -7,22 +7,21 @@ use Buddy\Repman\Service\Proxy; use Munus\Collection\GenericList; use Munus\Collection\Set; +use RuntimeException; +use Throwable; final class ProxyRegister { - private ProxyFactory $factory; - /** * @var Set */ - private Set $urls; + private readonly Set $urls; /** * @param string[] $urls */ - public function __construct(ProxyFactory $factory, array $urls = []) + public function __construct(private readonly ProxyFactory $factory, array $urls = []) { - $this->factory = $factory; $this->urls = Set::ofAll($urls); } @@ -32,17 +31,21 @@ public function __construct(ProxyFactory $factory, array $urls = []) public function all(): GenericList { $proxies = $this->urls->map(fn ($url) => $this->factory->create($url))->iterator()->toArray(); - $proxies[] = $this->factory->create('https://packagist.org'); + $proxies[] = $this->factory->create('https://repo.packagist.org'); return GenericList::ofAll($proxies); } + /** + * @throws Throwable + */ public function getByHost(string $host): Proxy { return $this->factory->create($this->urls ->add('https://packagist.org') + ->add('https://repo.packagist.org') ->find(fn ($url) => (string) parse_url($url, PHP_URL_HOST) === $host) - ->getOrElseThrow(new \RuntimeException(sprintf('Proxy for %s not found', $host))) + ->getOrElseThrow(new RuntimeException(sprintf('Proxy for %s not found', $host))) ); } } diff --git a/src/Service/ReadmeExtractor.php b/src/Service/ReadmeExtractor.php index ddb97aaa..3c8b48e2 100644 --- a/src/Service/ReadmeExtractor.php +++ b/src/Service/ReadmeExtractor.php @@ -7,20 +7,19 @@ use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Service\Dist\Storage; use League\CommonMark\CommonMarkConverter; -use League\CommonMark\Environment; +use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\ExternalLink\ExternalLinkExtension; use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension; use League\CommonMark\MarkdownConverterInterface; +use League\CommonMark\Output\RenderedContentInterface; +use ZipArchive; final class ReadmeExtractor { - private Storage $distStorage; - private MarkdownConverterInterface $markdownConverter; + private readonly MarkdownConverterInterface $markdownConverter; - public function __construct(Storage $distStorage) + public function __construct(private readonly Storage $distStorage) { - $this->distStorage = $distStorage; - $environment = Environment::createGFMEnvironment(); $environment->addExtension(new ExternalLinkExtension()); $environment->addExtension(new HeadingPermalinkExtension()); @@ -49,14 +48,14 @@ public function extractReadme(Package $package, Dist $dist): void $package->setReadme($this->loadREADME($dist)); } - private function loadREADME(Dist $dist): ?string + private function loadREADME(Dist $dist): ?RenderedContentInterface { $tmpLocalFilename = $this->distStorage->getLocalFileForDist($dist); if (null === $tmpLocalFilename->getOrNull()) { return null; } - $zip = new \ZipArchive(); + $zip = new ZipArchive(); $result = $zip->open($tmpLocalFilename->get()); if ($result !== true) { return null; diff --git a/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php b/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php index 929f9025..862da508 100644 --- a/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php +++ b/src/Service/Security/PackageScanner/SensioLabsPackageScanner.php @@ -14,31 +14,30 @@ use Buddy\Repman\Service\Security\PackageScanner; use Buddy\Repman\Service\Security\SecurityChecker; use Composer\Semver\VersionParser; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; +use RuntimeException; use Symfony\Component\Messenger\MessageBusInterface; +use Throwable; +use ZipArchive; +use function array_shift; +use function explode; +use function implode; +use function preg_match; +use function unlink; final class SensioLabsPackageScanner implements PackageScanner { - private SecurityChecker $checker; - private VersionParser $versionParser; - private PackageManager $packageManager; - private ScanResultRepository $results; - private MessageBusInterface $messageBus; - private Storage $distStorage; + private readonly VersionParser $versionParser; public function __construct( - SecurityChecker $checker, - PackageManager $packageManager, - ScanResultRepository $results, - MessageBusInterface $messageBus, - Storage $distStorage + private readonly SecurityChecker $checker, + private readonly PackageManager $packageManager, + private readonly ScanResultRepository $results, + private readonly MessageBusInterface $messageBus, + private readonly Storage $distStorage, ) { - $this->checker = $checker; - $this->packageManager = $packageManager; - $this->results = $results; - $this->messageBus = $messageBus; $this->versionParser = new VersionParser(); - $this->distStorage = $distStorage; } public function scan(Package $package): void @@ -65,13 +64,13 @@ public function scan(Package $package): void $result[$lockFileName] = $scanResults; } - } catch (\Throwable $exception) { + } catch (Throwable $throwable) { $this->saveResult( $package, ScanResult::STATUS_ERROR, [ 'exception' => [ - \get_class($exception) => $exception->getMessage(), + $throwable::class => $throwable->getMessage(), ], ], ); @@ -87,7 +86,7 @@ public function scan(Package $package): void */ private function saveResult(Package $package, string $status, array $result): void { - $date = new \DateTimeImmutable(); + $date = new DateTimeImmutable(); $package->setScanResult($status, $date, $result); $this->results->add(new ScanResult(Uuid::uuid4(), $package, $date, $status, $result)); @@ -135,12 +134,12 @@ private function findDistribution(Package $package): string ); return $filename->getOrElseThrow( - new \RuntimeException("Distribution file for version $packageVersion not found") + new RuntimeException(sprintf('Distribution file for version %s not found', $packageVersion)) ); } } - throw new \RuntimeException("Version $normalizedVersion for package $packageName not found"); + throw new RuntimeException(sprintf('Version %s for package %s not found', $normalizedVersion, $packageName)); } /** @@ -149,26 +148,26 @@ private function findDistribution(Package $package): string private function extractLockFiles(string $distFilename): array { $tmpZipFile = $this->distStorage->getLocalFileForDistUrl($distFilename); - $zip = new \ZipArchive(); + $zip = new ZipArchive(); $result = $zip->open($tmpZipFile->get()); if ($result !== true) { - throw new \RuntimeException("Error while opening ZIP file '$distFilename', code: $result"); + throw new RuntimeException(sprintf("Error while opening ZIP file '%s', code: %s", $distFilename, $result)); } $lockFiles = []; for ($i = 0; $i < $zip->numFiles; ++$i) { $filename = (string) $zip->getNameIndex($i); - if (\preg_match('/\/composer.lock$/', $filename) === 1) { + if (preg_match('/\/composer.lock$/', $filename) === 1) { $lockFileContent = $zip->getFromIndex($i); - $trimmed = \explode('/', $filename); - \array_shift($trimmed); - $lockFiles['/'.\implode('/', $trimmed)] = (string) $lockFileContent; + $trimmed = explode('/', $filename); + array_shift($trimmed); + $lockFiles['/'.implode('/', $trimmed)] = (string) $lockFileContent; } } $zip->close(); - @\unlink($tmpZipFile->get()); + @unlink($tmpZipFile->get()); return $lockFiles; } diff --git a/src/Service/Security/SecurityChecker/Advisory.php b/src/Service/Security/SecurityChecker/Advisory.php index 2bf65255..37aaaa53 100644 --- a/src/Service/Security/SecurityChecker/Advisory.php +++ b/src/Service/Security/SecurityChecker/Advisory.php @@ -6,23 +6,11 @@ final class Advisory { - private string $title; - private string $cve; - private string $link; - /** - * @var Versions[] - */ - private array $branches; - /** * @param Versions[] $branches */ - public function __construct(string $title, string $cve, string $link, array $branches) + public function __construct(private readonly string $title, private readonly string $cve, private readonly string $link, private readonly array $branches) { - $this->title = $title; - $this->cve = $cve; - $this->link = $link; - $this->branches = $branches; } /** diff --git a/src/Service/Security/SecurityChecker/Package.php b/src/Service/Security/SecurityChecker/Package.php index dcf48ef8..c8cc0e98 100644 --- a/src/Service/Security/SecurityChecker/Package.php +++ b/src/Service/Security/SecurityChecker/Package.php @@ -6,13 +6,8 @@ final class Package { - private string $name; - private string $version; - - public function __construct(string $name, string $version) + public function __construct(private readonly string $name, private readonly string $version) { - $this->name = $name; - $this->version = $version; } public function name(): string diff --git a/src/Service/Security/SecurityChecker/Result.php b/src/Service/Security/SecurityChecker/Result.php index 7e5eeda4..d5b52833 100644 --- a/src/Service/Security/SecurityChecker/Result.php +++ b/src/Service/Security/SecurityChecker/Result.php @@ -6,19 +6,11 @@ final class Result { - private string $version; - /** - * @var Advisory[] - */ - private array $advisories; - /** * @param Advisory[] $advisories */ - public function __construct(string $version, array $advisories) + public function __construct(private readonly string $version, private readonly array $advisories) { - $this->version = $version; - $this->advisories = $advisories; } /** diff --git a/src/Service/Security/SecurityChecker/SensioLabsSecurityChecker.php b/src/Service/Security/SecurityChecker/SensioLabsSecurityChecker.php index 97fa79cf..a26510d0 100644 --- a/src/Service/Security/SecurityChecker/SensioLabsSecurityChecker.php +++ b/src/Service/Security/SecurityChecker/SensioLabsSecurityChecker.php @@ -5,32 +5,34 @@ namespace Buddy\Repman\Service\Security\SecurityChecker; use Buddy\Repman\Service\Security\SecurityChecker; +use RecursiveCallbackFilterIterator; +use RecursiveDirectoryIterator; +use RecursiveIteratorIterator; +use RuntimeException; +use SplFileInfo; use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\Process; use Symfony\Component\Yaml\Parser; +use UnexpectedValueException; final class SensioLabsSecurityChecker implements SecurityChecker { - private Parser $yamlParser; - private string $databaseDir; - private string $databaseRepo; + private readonly Parser $yamlParser; /** * @var array */ private array $advisories = []; - public function __construct(string $databaseDir, string $databaseRepo) + public function __construct(private readonly string $databaseDir, private readonly string $databaseRepo) { $this->yamlParser = new Parser(); - $this->databaseDir = $databaseDir; - $this->databaseRepo = $databaseRepo; } public function update(): bool { if (!is_dir($this->databaseDir.'/.git')) { - @mkdir($this->databaseDir, 0777, true); + @mkdir($this->databaseDir, 0o777, true); $this->cloneRepo(); return true; @@ -39,9 +41,6 @@ public function update(): bool return $this->updateRepo(); } - /** - * @return mixed[] - */ public function check(string $lockFile): array { $packages = $this->getPackages($lockFile); @@ -89,12 +88,16 @@ private function getPackages(string $lockFile): array { $contents = json_decode($lockFile, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new \UnexpectedValueException('Invalid composer.lock'); + throw new UnexpectedValueException('Invalid composer.lock'); } $packages = []; foreach (['packages', 'packages-dev'] as $key) { - if (!isset($contents[$key]) || !is_array($contents[$key])) { + if (!isset($contents[$key])) { + continue; + } + + if (!is_array($contents[$key])) { continue; } @@ -113,7 +116,11 @@ private function getAdvisories(): array { $advisories = []; foreach ($this->getDatabase() as $file) { - if (!$file->isFile() || $file->getExtension() !== 'yaml') { + if (!$file->isFile()) { + continue; + } + + if ($file->getExtension() !== 'yaml') { continue; } @@ -147,16 +154,13 @@ private function getAdvisories(): array return $advisories; } - /** - * @return \RecursiveIteratorIterator<\RecursiveCallbackFilterIterator> - */ - private function getDatabase(): \RecursiveIteratorIterator + private function getDatabase(): RecursiveIteratorIterator { if (!is_dir($this->databaseDir)) { - throw new \RuntimeException('Advisories database does not exist'); + throw new RuntimeException('Advisories database does not exist'); } - $advisoryFilter = function (\SplFileInfo $file): bool { + $advisoryFilter = function (SplFileInfo $file): bool { if ($file->isDir()) { $dirName = $file->getFilename(); if ($dirName[0] === '.') { @@ -167,9 +171,9 @@ private function getDatabase(): \RecursiveIteratorIterator return true; }; - return new \RecursiveIteratorIterator( - new \RecursiveCallbackFilterIterator( - new \RecursiveDirectoryIterator($this->databaseDir), + return new RecursiveIteratorIterator( + new RecursiveCallbackFilterIterator( + new RecursiveDirectoryIterator($this->databaseDir), $advisoryFilter ) ); diff --git a/src/Service/Security/SecurityChecker/Versions.php b/src/Service/Security/SecurityChecker/Versions.php index 3710bf19..2ce4cf37 100644 --- a/src/Service/Security/SecurityChecker/Versions.php +++ b/src/Service/Security/SecurityChecker/Versions.php @@ -8,13 +8,8 @@ final class Versions { - private string $from; - private ?string $to; - - public function __construct(string $from, ?string $to = null) + public function __construct(private readonly string $from, private readonly ?string $to = null) { - $this->from = $from; - $this->to = $to; } public function include(string $version): bool diff --git a/src/Service/Stream.php b/src/Service/Stream.php index 5dc76be6..4af78510 100644 --- a/src/Service/Stream.php +++ b/src/Service/Stream.php @@ -4,6 +4,8 @@ namespace Buddy\Repman\Service; +use RuntimeException; + final class Stream { /** @@ -13,8 +15,9 @@ public static function fromString(string $string, string $streamName = 'php://me { $stream = @fopen($streamName, 'r+'); if ($stream === false) { - throw new \RuntimeException(sprintf('Failed to open %s stream', $streamName)); + throw new RuntimeException(sprintf('Failed to open %s stream', $streamName)); } + fwrite($stream, $string); rewind($stream); diff --git a/src/Service/Symfony/ApiExceptionListener.php b/src/Service/Symfony/ApiExceptionListener.php index bcfc7f83..2978914e 100644 --- a/src/Service/Symfony/ApiExceptionListener.php +++ b/src/Service/Symfony/ApiExceptionListener.php @@ -19,7 +19,7 @@ final class ApiExceptionListener implements EventSubscriberInterface { public function onKernelException(ExceptionEvent $event): void { - if (strpos($event->getRequest()->getPathInfo(), '/api') !== 0) { + if (!str_starts_with($event->getRequest()->getPathInfo(), '/api')) { return; } @@ -33,7 +33,7 @@ public function onKernelException(ExceptionEvent $event): void $event->setResponse(new JsonResponse( new Errors([ new Error( - get_class($event->getThrowable()), + $event->getThrowable()::class, $event->getThrowable()->getMessage() ), ]), diff --git a/src/Service/Symfony/ConsumedMessageLoggerMiddleware.php b/src/Service/Symfony/ConsumedMessageLoggerMiddleware.php index 928f6623..643718f7 100644 --- a/src/Service/Symfony/ConsumedMessageLoggerMiddleware.php +++ b/src/Service/Symfony/ConsumedMessageLoggerMiddleware.php @@ -9,19 +9,17 @@ use Symfony\Component\Messenger\Middleware\MiddlewareInterface; use Symfony\Component\Messenger\Middleware\StackInterface; use Symfony\Component\Messenger\Stamp\ConsumedByWorkerStamp; +use Symfony\Component\Messenger\Stamp\StampInterface; final class ConsumedMessageLoggerMiddleware implements MiddlewareInterface { - private LoggerInterface $logger; - - public function __construct(LoggerInterface $consumerLogger) + public function __construct(private readonly LoggerInterface $logger) { - $this->logger = $consumerLogger; } public function handle(Envelope $envelope, StackInterface $stack): Envelope { - if ($envelope->last(ConsumedByWorkerStamp::class) === null) { + if (!$envelope->last(ConsumedByWorkerStamp::class) instanceof StampInterface) { return $stack->next()->handle($envelope, $stack); } @@ -34,7 +32,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope $memoryAfter = memory_get_usage(true); $this->logger->info('Message consumed', [ - 'messageClass' => get_class($envelope->getMessage()), + 'messageClass' => $envelope->getMessage()::class, 'memoryBefore' => $memoryBefore, 'memoryAfter' => $memoryAfter, 'memoryDelta' => $memoryAfter - $memoryBefore, diff --git a/src/Service/Symfony/SentryRequestListener.php b/src/Service/Symfony/SentryRequestListener.php index 62c35479..b00320ea 100644 --- a/src/Service/Symfony/SentryRequestListener.php +++ b/src/Service/Symfony/SentryRequestListener.php @@ -5,23 +5,23 @@ namespace Buddy\Repman\Service\Symfony; use Buddy\Repman\Entity\User; +use Sentry\ClientInterface; use Sentry\SentrySdk; use Sentry\State\Scope; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\User\UserInterface; /** * @codeCoverageIgnore */ final class SentryRequestListener implements EventSubscriberInterface { - private TokenStorageInterface $tokenStorage; - - public function __construct(TokenStorageInterface $tokenStorage) + public function __construct(private readonly TokenStorageInterface $tokenStorage) { - $this->tokenStorage = $tokenStorage; } public function onKernelRequest(RequestEvent $event): void @@ -30,15 +30,15 @@ public function onKernelRequest(RequestEvent $event): void return; } - if (null === SentrySdk::getCurrentHub()->getClient()) { + if (!SentrySdk::getCurrentHub()->getClient() instanceof ClientInterface) { return; } $token = $this->tokenStorage->getToken(); $userData = []; - if (null !== $token && $token->getUser() instanceof User) { - /** @var User $user */ + if ($token instanceof TokenInterface && $token->getUser() instanceof User) { + /** @var UserInterface $user */ $user = $token->getUser(); $userData['id'] = $user->id(); } @@ -47,14 +47,14 @@ public function onKernelRequest(RequestEvent $event): void SentrySdk::getCurrentHub() ->configureScope(function (Scope $scope) use ($userData): void { - $scope->setUser($userData, true); + $scope->setUser($userData); }); } /** * @return array> */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::REQUEST => ['onKernelRequest', 1]]; } diff --git a/src/Service/Telemetry.php b/src/Service/Telemetry.php index 247ef315..3ce52cc7 100644 --- a/src/Service/Telemetry.php +++ b/src/Service/Telemetry.php @@ -15,26 +15,17 @@ use Buddy\Repman\Service\Telemetry\Entry\Organization; use Buddy\Repman\Service\Telemetry\Entry\Proxy; use Buddy\Repman\Service\Telemetry\TechnicalEmail; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface; +use function file_exists; +use function file_get_contents; +use function file_put_contents; final class Telemetry { - private string $instanceIdFile; - private TelemetryQuery $query; - private Endpoint $endpoint; - private Config $config; - private MessageCountAwareInterface $failedTransport; - private ProxyRegister $proxies; - - public function __construct(string $instanceIdFile, TelemetryQuery $query, Endpoint $endpoint, Config $config, MessageCountAwareInterface $failedTransport, ProxyRegister $proxies) + public function __construct(private readonly string $instanceIdFile, private readonly TelemetryQuery $query, private readonly Endpoint $endpoint, private readonly Config $config, private readonly MessageCountAwareInterface $failedTransport, private readonly ProxyRegister $proxies) { - $this->instanceIdFile = $instanceIdFile; - $this->query = $query; - $this->endpoint = $endpoint; - $this->config = $config; - $this->failedTransport = $failedTransport; - $this->proxies = $proxies; } public function docsUrl(): string @@ -45,21 +36,21 @@ public function docsUrl(): string public function generateInstanceId(): void { if (!$this->isInstanceIdPresent()) { - \file_put_contents($this->instanceIdFile, Uuid::uuid4()); + file_put_contents($this->instanceIdFile, Uuid::uuid4()); } } public function isInstanceIdPresent(): bool { - return \file_exists($this->instanceIdFile); + return file_exists($this->instanceIdFile); } public function instanceId(): string { - return (string) \file_get_contents($this->instanceIdFile); + return (string) file_get_contents($this->instanceIdFile); } - public function collectAndSend(\DateTimeImmutable $date): void + public function collectAndSend(DateTimeImmutable $date): void { $this->endpoint->send( new Entry( @@ -104,7 +95,7 @@ public function removeTechnicalEmail(string $technicalEmail): void /** * @return Organization[] */ - private function getOrganizations(\DateTimeImmutable $date): array + private function getOrganizations(DateTimeImmutable $date): array { $count = $this->query->organizationsCount(); $limit = 100; @@ -121,7 +112,7 @@ private function getOrganizations(\DateTimeImmutable $date): array return $organizations; } - private function getPackages(Organization $organization, \DateTimeImmutable $date): void + private function getPackages(Organization $organization, DateTimeImmutable $date): void { $count = $this->query->packagesCount($organization->id()); $limit = 100; diff --git a/src/Service/Telemetry/Entry.php b/src/Service/Telemetry/Entry.php index f13ff781..b48914bb 100644 --- a/src/Service/Telemetry/Entry.php +++ b/src/Service/Telemetry/Entry.php @@ -8,34 +8,17 @@ use Buddy\Repman\Service\Telemetry\Entry\Instance; use Buddy\Repman\Service\Telemetry\Entry\Organization; use Buddy\Repman\Service\Telemetry\Entry\Proxy; +use DateTimeImmutable; +use JsonSerializable; +use function sprintf; -final class Entry implements \JsonSerializable +final class Entry implements JsonSerializable { - private \DateTimeImmutable $date; - private Instance $instance; - private Downloads $downloads; - private Proxy $proxy; - - /** - * @var Organization[] - */ - private array $organizations; - /** * @param Organization[] $organizations */ - public function __construct( - \DateTimeImmutable $date, - Instance $instance, - array $organizations, - Downloads $downloads, - Proxy $proxy - ) { - $this->date = $date; - $this->instance = $instance; - $this->organizations = $organizations; - $this->downloads = $downloads; - $this->proxy = $proxy; + public function __construct(private readonly DateTimeImmutable $date, private readonly Instance $instance, private readonly array $organizations, private readonly Downloads $downloads, private readonly Proxy $proxy) + { } public function instance(): Instance @@ -49,7 +32,7 @@ public function instance(): Instance public function jsonSerialize(): array { return [ - 'id' => \sprintf('%s_%s', $this->date->format('Ymd'), $this->instance->id()), + 'id' => sprintf('%s_%s', $this->date->format('Ymd'), $this->instance->id()), 'date' => $this->date->format('Y-m-d'), 'instance' => $this->instance, 'organizations' => $this->organizations, diff --git a/src/Service/Telemetry/Entry/Downloads.php b/src/Service/Telemetry/Entry/Downloads.php index 6f71e8fd..d8447650 100644 --- a/src/Service/Telemetry/Entry/Downloads.php +++ b/src/Service/Telemetry/Entry/Downloads.php @@ -4,15 +4,12 @@ namespace Buddy\Repman\Service\Telemetry\Entry; -final class Downloads implements \JsonSerializable -{ - private int $proxy; - private int $private; +use JsonSerializable; - public function __construct(int $proxy, int $private) +final class Downloads implements JsonSerializable +{ + public function __construct(private readonly int $proxy, private readonly int $private) { - $this->proxy = $proxy; - $this->private = $private; } /** diff --git a/src/Service/Telemetry/Entry/Instance.php b/src/Service/Telemetry/Entry/Instance.php index 01745152..993e36c8 100644 --- a/src/Service/Telemetry/Entry/Instance.php +++ b/src/Service/Telemetry/Entry/Instance.php @@ -4,39 +4,15 @@ namespace Buddy\Repman\Service\Telemetry\Entry; -final class Instance implements \JsonSerializable -{ - private string $id; - private string $version; - private string $osVersion; - private string $phpVersion; - private int $users; - private int $failedMessages; - - /** - * @var array - */ - private array $config; +use JsonSerializable; +final class Instance implements JsonSerializable +{ /** * @param array $config */ - public function __construct( - string $id, - string $version, - string $osVersion, - string $phpVersion, - int $users, - int $failedMessages, - array $config - ) { - $this->id = $id; - $this->version = $version; - $this->osVersion = $osVersion; - $this->phpVersion = $phpVersion; - $this->users = $users; - $this->failedMessages = $failedMessages; - $this->config = $config; + public function __construct(private readonly string $id, private readonly string $version, private readonly string $osVersion, private readonly string $phpVersion, private readonly int $users, private readonly int $failedMessages, private readonly array $config) + { } public function id(): string diff --git a/src/Service/Telemetry/Entry/Organization.php b/src/Service/Telemetry/Entry/Organization.php index 8715ccd9..7abc7a41 100644 --- a/src/Service/Telemetry/Entry/Organization.php +++ b/src/Service/Telemetry/Entry/Organization.php @@ -4,26 +4,17 @@ namespace Buddy\Repman\Service\Telemetry\Entry; -final class Organization implements \JsonSerializable -{ - private string $id; - private int $tokens; - private bool $public; - private int $members; - private int $owners; +use JsonSerializable; +final class Organization implements JsonSerializable +{ /** * @var Package[] */ private array $packages = []; - public function __construct(string $id, int $tokens, bool $public, int $members, int $owners) + public function __construct(private readonly string $id, private readonly int $tokens, private readonly bool $public, private readonly int $members, private readonly int $owners) { - $this->id = $id; - $this->tokens = $tokens; - $this->public = $public; - $this->members = $members; - $this->owners = $owners; } public function id(): string diff --git a/src/Service/Telemetry/Entry/Package.php b/src/Service/Telemetry/Entry/Package.php index 8b4316d2..9edab125 100644 --- a/src/Service/Telemetry/Entry/Package.php +++ b/src/Service/Telemetry/Entry/Package.php @@ -4,38 +4,14 @@ namespace Buddy\Repman\Service\Telemetry\Entry; -final class Package implements \JsonSerializable -{ - private string $type; - private ?\DateTimeImmutable $lastRelease; - private ?\DateTimeImmutable $lastSync; - private ?\DateTimeImmutable $lastScan; - private bool $hasError; - private bool $hasWebhook; - private string $scanStatus; - private int $downloads; - private int $webhookRequests; +use DateTime; +use DateTimeImmutable; +use JsonSerializable; - public function __construct( - string $type, - ?\DateTimeImmutable $lastRelease, - ?\DateTimeImmutable $lastSync, - ?\DateTimeImmutable $lastScan, - bool $hasError, - bool $hasWebhook, - string $scanStatus, - int $downloads, - int $webhookRequests - ) { - $this->type = $type; - $this->lastRelease = $lastRelease; - $this->lastSync = $lastSync; - $this->lastScan = $lastScan; - $this->hasError = $hasError; - $this->hasWebhook = $hasWebhook; - $this->scanStatus = $scanStatus; - $this->downloads = $downloads; - $this->webhookRequests = $webhookRequests; +final class Package implements JsonSerializable +{ + public function __construct(private readonly string $type, private readonly ?DateTimeImmutable $lastRelease, private readonly ?DateTimeImmutable $lastSync, private readonly ?DateTimeImmutable $lastScan, private readonly bool $hasError, private readonly bool $hasWebhook, private readonly string $scanStatus, private readonly int $downloads, private readonly int $webhookRequests) + { } /** @@ -45,9 +21,9 @@ public function jsonSerialize(): array { return [ 'type' => $this->type, - 'lastRelease' => $this->lastRelease === null ? null : $this->lastRelease->format(\DateTime::ATOM), - 'lastSync' => $this->lastSync === null ? null : $this->lastSync->format(\DateTime::ATOM), - 'lastScan' => $this->lastScan === null ? null : $this->lastScan->format(\DateTime::ATOM), + 'lastRelease' => $this->lastRelease instanceof DateTimeImmutable ? $this->lastRelease->format(DateTime::ATOM) : null, + 'lastSync' => $this->lastSync instanceof DateTimeImmutable ? $this->lastSync->format(DateTime::ATOM) : null, + 'lastScan' => $this->lastScan instanceof DateTimeImmutable ? $this->lastScan->format(DateTime::ATOM) : null, 'hasError' => $this->hasError, 'hasWebhook' => $this->hasWebhook, 'scanStatus' => $this->scanStatus, diff --git a/src/Service/Telemetry/Entry/Proxy.php b/src/Service/Telemetry/Entry/Proxy.php index f6c343e4..6c2c5e6a 100644 --- a/src/Service/Telemetry/Entry/Proxy.php +++ b/src/Service/Telemetry/Entry/Proxy.php @@ -4,13 +4,12 @@ namespace Buddy\Repman\Service\Telemetry\Entry; -final class Proxy implements \JsonSerializable -{ - private int $packages; +use JsonSerializable; - public function __construct(int $packages) +final class Proxy implements JsonSerializable +{ + public function __construct(private readonly int $packages) { - $this->packages = $packages; } /** diff --git a/src/Service/Telemetry/TechnicalEmail.php b/src/Service/Telemetry/TechnicalEmail.php index eefa10d1..ae7d30b7 100644 --- a/src/Service/Telemetry/TechnicalEmail.php +++ b/src/Service/Telemetry/TechnicalEmail.php @@ -4,15 +4,12 @@ namespace Buddy\Repman\Service\Telemetry; -final class TechnicalEmail implements \JsonSerializable -{ - private string $email; - private string $instanceId; +use JsonSerializable; - public function __construct(string $email, string $instanceId) +final class TechnicalEmail implements JsonSerializable +{ + public function __construct(private readonly string $email, private readonly string $instanceId) { - $this->email = $email; - $this->instanceId = $instanceId; } public function instanceId(): string diff --git a/src/Service/Telemetry/TelemetryEndpoint.php b/src/Service/Telemetry/TelemetryEndpoint.php index e1582975..964ef130 100644 --- a/src/Service/Telemetry/TelemetryEndpoint.php +++ b/src/Service/Telemetry/TelemetryEndpoint.php @@ -4,6 +4,7 @@ namespace Buddy\Repman\Service\Telemetry; +use RuntimeException; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; @@ -13,37 +14,34 @@ final class TelemetryEndpoint implements Endpoint public const HEADERS = ['Content-Type' => 'application/json']; - private HttpClientInterface $client; - - public function __construct(HttpClientInterface $client) + public function __construct(private readonly HttpClientInterface $client) { - $this->client = $client; } public function send(Entry $entry): void { $this->checkResponse($this->client->request('POST', $this->telemetryUrl(), [ - 'headers' => self::HEADERS, - 'body' => json_encode($entry), - ] + 'headers' => self::HEADERS, + 'body' => json_encode($entry), + ] )); } public function addTechnicalEmail(TechnicalEmail $email): void { $this->checkResponse($this->client->request('POST', $this->emailUrl(), [ - 'headers' => self::HEADERS, - 'body' => json_encode($email), - ] + 'headers' => self::HEADERS, + 'body' => json_encode($email), + ] )); } public function removeTechnicalEmail(TechnicalEmail $email): void { $this->checkResponse($this->client->request('DELETE', $this->emailUrl(), [ - 'headers' => self::HEADERS, - 'body' => json_encode($email), - ] + 'headers' => self::HEADERS, + 'body' => json_encode($email), + ] )); } @@ -60,7 +58,7 @@ private function emailUrl(): string private function checkResponse(ResponseInterface $response): void { if ($response->getStatusCode() >= 400) { - throw new \RuntimeException(sprintf('Error while sending telemetry data. HTTP error: %d', $response->getStatusCode())); + throw new RuntimeException(sprintf('Error while sending telemetry data. HTTP error: %d', $response->getStatusCode())); } } } diff --git a/src/Service/Twig/BytesExtension.php b/src/Service/Twig/BytesExtension.php index fbdb93a5..40d3ba92 100644 --- a/src/Service/Twig/BytesExtension.php +++ b/src/Service/Twig/BytesExtension.php @@ -15,7 +15,7 @@ final class BytesExtension extends AbstractExtension public function getFilters(): array { return [ - new TwigFilter('format_bytes', [$this, 'formatBytes']), + new TwigFilter('format_bytes', $this->formatBytes(...)), ]; } @@ -24,6 +24,6 @@ public function formatBytes(int $bytes, int $precision = 2): string $size = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; $factor = floor((strlen((string) $bytes) - 1) / 3); - return sprintf("%.{$precision}f", $bytes / (1024 ** $factor)).' '.$size[$factor]; + return sprintf(sprintf('%%.%df', $precision), $bytes / (1024 ** $factor)).' '.$size[$factor]; } } diff --git a/src/Service/Twig/DateExtension.php b/src/Service/Twig/DateExtension.php index ed915945..099c7845 100644 --- a/src/Service/Twig/DateExtension.php +++ b/src/Service/Twig/DateExtension.php @@ -14,10 +14,17 @@ namespace Buddy\Repman\Service\Twig; use Buddy\Repman\Security\Model\User; +use DateInvalidTimeZoneException; +use DateMalformedStringException; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; use Symfony\Component\Intl\Timezones; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Twig\Environment; use Twig\Extension\AbstractExtension; +use Twig\Extension\CoreExtension; use Twig\TwigFilter; use Twig\TwigFunction; @@ -45,7 +52,7 @@ public function __construct(TokenStorageInterface $tokenStorage) { $this->timezone = date_default_timezone_get(); - if (($token = $tokenStorage->getToken()) === null) { + if (!($token = $tokenStorage->getToken()) instanceof TokenInterface) { return; } @@ -60,9 +67,9 @@ public function __construct(TokenStorageInterface $tokenStorage) public function getFilters(): array { return [ - new TwigFilter('time_diff', [$this, 'diff'], ['needs_environment' => true]), - new TwigFilter('date_time', [$this, 'dateTime'], ['needs_environment' => true]), - new TwigFilter('date_time_utc', [$this, 'dateTimeUtc'], ['needs_environment' => true]), + new TwigFilter('time_diff', $this->diff(...), ['needs_environment' => true]), + new TwigFilter('date_time', $this->dateTime(...), ['needs_environment' => true]), + new TwigFilter('date_time_utc', $this->dateTimeUtc(...), ['needs_environment' => true]), ]; } @@ -72,27 +79,27 @@ public function getFilters(): array public function getFunctions() { return [ - new TwigFunction('gmt_offset', [$this, 'gmtOffset'], ['needs_environment' => true]), + new TwigFunction('gmt_offset', $this->gmtOffset(...), ['needs_environment' => true]), ]; } /** - * Filters for converting dates to a time ago string like Facebook and Twitter has. + * @param string|DateTimeInterface $date a string or DateTime object to convert + * @param string|DateTimeInterface $now A string or DateTime object to compare with. If none given, the current time will be used. * - * @param string|\DateTimeInterface $date a string or DateTime object to convert - * @param string|\DateTimeInterface $now A string or DateTime object to compare with. If none given, the current time will be used. + * @throws DateMalformedStringException * * @return string the converted time */ public function diff(Environment $env, $date, $now = null): string { - $date = twig_date_converter($env, $date); + $date = $env->getExtension(CoreExtension::class)->convertDate($date); $now = $now === null - ? new \DateTimeImmutable( - twig_date_converter($env, null, $this->timezone)->format('Y-m-d H:i:s') + ? new DateTimeImmutable( + $env->getExtension(CoreExtension::class)->convertDate(timezone: $this->timezone)->format('Y-m-d H:i:s') ) - : twig_date_converter($env, $now); + : $env->getExtension(CoreExtension::class)->convertDate($now); // Get the difference between the two DateTime objects. $diff = $date->diff($now); @@ -114,22 +121,26 @@ public function diff(Environment $env, $date, $now = null): string } /** - * @param string|\DateTimeInterface $date + * @param string|DateTimeInterface $date + * + * @throws DateInvalidTimeZoneException */ public function dateTime(Environment $env, $date, ?string $sourceTimezone = null): string { $date = $sourceTimezone === null - ? twig_date_converter($env, $date, $this->timezone) - : (new \DateTimeImmutable( - twig_date_converter($env, $date)->format('Y-m-d H:i:s'), - new \DateTimeZone($sourceTimezone) - ))->setTimezone(new \DateTimeZone($this->timezone)); + ? $env->getExtension(CoreExtension::class)->convertDate($date, $this->timezone) + : (new DateTimeImmutable( + $env->getExtension(CoreExtension::class)->convertDate($date)->format('Y-m-d H:i:s'), + new DateTimeZone($sourceTimezone) + ))->setTimezone(new DateTimeZone($this->timezone)); return $date->format('Y-m-d H:i:s'); } /** - * @param string|\DateTimeInterface $date + * @param string|DateTimeInterface $date + * + * @throws DateInvalidTimeZoneException */ public function dateTimeUtc(Environment $env, $date): string { @@ -137,15 +148,15 @@ public function dateTimeUtc(Environment $env, $date): string } /** - * @param string|\DateTimeInterface $now A string or DateTime object. If none given, the current time will be used. + * @param string|DateTimeInterface $now A string or DateTime object. If none given, the current time will be used. */ public function gmtOffset(Environment $env, $now = null): string { $now = $now === null - ? new \DateTimeImmutable( - twig_date_converter($env, null, $this->timezone)->format('Y-m-d H:i:s') + ? new DateTimeImmutable( + $env->getExtension(CoreExtension::class)->convertDate(timezone: $this->timezone)->format('Y-m-d H:i:s') ) - : twig_date_converter($env, $now); + : $env->getExtension(CoreExtension::class)->convertDate($now); return Timezones::getGmtOffset($this->timezone, $now->getTimestamp()); } @@ -156,6 +167,6 @@ private function getPluralizedInterval(int $count, int $invert, string $unit): s $unit .= 's'; } - return $invert === 1 ? "in $count $unit" : "$count $unit ago"; + return $invert === 1 ? sprintf('in %d %s', $count, $unit) : sprintf('%d %s ago', $count, $unit); } } diff --git a/src/Service/Twig/OAuthProviderExtension.php b/src/Service/Twig/OAuthProviderExtension.php index a25a72db..9a54fadc 100644 --- a/src/Service/Twig/OAuthProviderExtension.php +++ b/src/Service/Twig/OAuthProviderExtension.php @@ -9,17 +9,11 @@ final class OAuthProviderExtension extends AbstractExtension { - /** - * @var array - */ - private array $providers; - /** * @param array $providers */ - public function __construct(array $providers) + public function __construct(private array $providers) { - $this->providers = $providers; } /** @@ -28,7 +22,7 @@ public function __construct(array $providers) public function getFunctions(): array { return [ - new TwigFunction('oauth_enabled', [$this, 'oAuthEnabled']), + new TwigFunction('oauth_enabled', $this->oAuthEnabled(...)), ]; } @@ -38,6 +32,6 @@ public function oAuthEnabled(?string $provider = null): bool return isset($this->providers[$provider]) && strlen($this->providers[$provider]) > 0; } - return count(array_filter($this->providers, fn ($id) => strlen((string) $id) > 0)) > 0; + return array_filter($this->providers, fn ($id) => strlen((string) $id) > 0) !== []; } } diff --git a/src/Service/User/UserOAuthTokenProvider.php b/src/Service/User/UserOAuthTokenProvider.php index 7e54e032..26f86be0 100644 --- a/src/Service/User/UserOAuthTokenProvider.php +++ b/src/Service/User/UserOAuthTokenProvider.php @@ -4,27 +4,21 @@ namespace Buddy\Repman\Service\User; +use Buddy\Repman\Entity\User\OAuthToken; use Buddy\Repman\Repository\UserRepository; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; class UserOAuthTokenProvider { - private UserRepository $repository; - private EntityManagerInterface $em; - private UserOAuthTokenRefresher $tokenRefresher; - - public function __construct(UserRepository $repository, EntityManagerInterface $em, UserOAuthTokenRefresher $tokenRefresher) + public function __construct(private readonly UserRepository $repository, private readonly EntityManagerInterface $em, private readonly UserOAuthTokenRefresher $tokenRefresher) { - $this->repository = $repository; - $this->em = $em; - $this->tokenRefresher = $tokenRefresher; } public function findAccessToken(string $userId, string $type): ?string { $token = $this->repository->getById(Uuid::fromString($userId))->oauthToken($type); - if ($token === null) { + if (!$token instanceof OAuthToken) { return null; } diff --git a/src/Service/User/UserOAuthTokenRefresher.php b/src/Service/User/UserOAuthTokenRefresher.php index ea0277eb..626b881a 100644 --- a/src/Service/User/UserOAuthTokenRefresher.php +++ b/src/Service/User/UserOAuthTokenRefresher.php @@ -5,16 +5,14 @@ namespace Buddy\Repman\Service\User; use Buddy\Repman\Service\User\UserOAuthTokenRefresher\AccessToken; +use DateTimeImmutable; use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use League\OAuth2\Client\Grant\RefreshToken; class UserOAuthTokenRefresher { - private ClientRegistry $oauth; - - public function __construct(ClientRegistry $oauth) + public function __construct(private readonly ClientRegistry $oauth) { - $this->oauth = $oauth; } public function refresh(string $type, string $refreshToken): AccessToken @@ -24,7 +22,7 @@ public function refresh(string $type, string $refreshToken): AccessToken return new AccessToken( $accessToken->getToken(), - $accessToken->getExpires() !== null ? (new \DateTimeImmutable())->setTimestamp($accessToken->getExpires()) : null + $accessToken->getExpires() !== null ? (new DateTimeImmutable())->setTimestamp($accessToken->getExpires()) : null ); } } diff --git a/src/Service/User/UserOAuthTokenRefresher/AccessToken.php b/src/Service/User/UserOAuthTokenRefresher/AccessToken.php index 35e4114c..9c28f8b2 100644 --- a/src/Service/User/UserOAuthTokenRefresher/AccessToken.php +++ b/src/Service/User/UserOAuthTokenRefresher/AccessToken.php @@ -4,16 +4,12 @@ namespace Buddy\Repman\Service\User\UserOAuthTokenRefresher; +use DateTimeImmutable; + class AccessToken { - private string $token; - - private ?\DateTimeImmutable $expiresAt; - - public function __construct(string $token, ?\DateTimeImmutable $expiresAt = null) + public function __construct(private readonly string $token, private readonly ?DateTimeImmutable $expiresAt = null) { - $this->token = $token; - $this->expiresAt = $expiresAt; } public function token(): string @@ -21,7 +17,7 @@ public function token(): string return $this->token; } - public function expiresAt(): ?\DateTimeImmutable + public function expiresAt(): ?DateTimeImmutable { return $this->expiresAt; } diff --git a/src/Service/User/UserParamConverter.php b/src/Service/User/UserParamConverter.php index e997fccb..d18404f3 100644 --- a/src/Service/User/UserParamConverter.php +++ b/src/Service/User/UserParamConverter.php @@ -14,11 +14,8 @@ final class UserParamConverter implements ParamConverterInterface { - private UserQuery $userQuery; - - public function __construct(UserQuery $userQuery) + public function __construct(private readonly UserQuery $userQuery) { - $this->userQuery = $userQuery; } public function supports(ParamConverter $configuration) diff --git a/src/Validator/AliasNotBlankValidator.php b/src/Validator/AliasNotBlankValidator.php index 035f4190..fbaf6488 100644 --- a/src/Validator/AliasNotBlankValidator.php +++ b/src/Validator/AliasNotBlankValidator.php @@ -10,11 +10,8 @@ class AliasNotBlankValidator extends ConstraintValidator { - private AliasGenerator $aliasGenerator; - - public function __construct(AliasGenerator $aliasGenerator) + public function __construct(private readonly AliasGenerator $aliasGenerator) { - $this->aliasGenerator = $aliasGenerator; } /** diff --git a/src/Validator/NotOrganizationMember.php b/src/Validator/NotOrganizationMember.php index ecbea38c..2e4fca1b 100644 --- a/src/Validator/NotOrganizationMember.php +++ b/src/Validator/NotOrganizationMember.php @@ -9,7 +9,9 @@ final class NotOrganizationMember extends Constraint { public string $alreadyInvitedMessage = 'User "{{ value }}" is already invited to this organization'; + public string $alreadyMemberMessage = 'User "{{ value }}" is already a member of this organization'; + public string $organizationId = ''; public function getRequiredOptions() diff --git a/src/Validator/NotOrganizationMemberValidator.php b/src/Validator/NotOrganizationMemberValidator.php index f514d0f0..37678966 100644 --- a/src/Validator/NotOrganizationMemberValidator.php +++ b/src/Validator/NotOrganizationMemberValidator.php @@ -10,11 +10,8 @@ final class NotOrganizationMemberValidator extends ConstraintValidator { - private OrganizationQuery $organizationQuery; - - public function __construct(OrganizationQuery $organizationQuery) + public function __construct(private readonly OrganizationQuery $organizationQuery) { - $this->organizationQuery = $organizationQuery; } /** diff --git a/src/Validator/UniqueEmailValidator.php b/src/Validator/UniqueEmailValidator.php index d5fcac72..76c3bc41 100644 --- a/src/Validator/UniqueEmailValidator.php +++ b/src/Validator/UniqueEmailValidator.php @@ -7,14 +7,12 @@ use Buddy\Repman\Query\Admin\UserQuery; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use function mb_strtolower; class UniqueEmailValidator extends ConstraintValidator { - private UserQuery $usersQuery; - - public function __construct(UserQuery $usersQuery) + public function __construct(private readonly UserQuery $usersQuery) { - $this->usersQuery = $usersQuery; } /** @@ -27,7 +25,7 @@ public function validate($value, Constraint $constraint): void return; } - $value = \mb_strtolower($value); + $value = mb_strtolower((string) $value); if (!$this->usersQuery->getByEmail($value)->isEmpty()) { $this->context->buildViolation($constraint->message) diff --git a/src/Validator/UniqueOrganizationValidator.php b/src/Validator/UniqueOrganizationValidator.php index fe226da9..13ab2cbc 100644 --- a/src/Validator/UniqueOrganizationValidator.php +++ b/src/Validator/UniqueOrganizationValidator.php @@ -11,13 +11,8 @@ class UniqueOrganizationValidator extends ConstraintValidator { - private AliasGenerator $aliasGenerator; - private OrganizationQuery $organizationQuery; - - public function __construct(AliasGenerator $aliasGenerator, OrganizationQuery $organizationQuery) + public function __construct(private readonly AliasGenerator $aliasGenerator, private readonly OrganizationQuery $organizationQuery) { - $this->aliasGenerator = $aliasGenerator; - $this->organizationQuery = $organizationQuery; } /** diff --git a/symfony.lock b/symfony.lock index 57bfeb2c..cf3e5e08 100644 --- a/symfony.lock +++ b/symfony.lock @@ -269,9 +269,6 @@ "league/flysystem-cached-adapter": { "version": "1.1.0" }, - "league/flysystem-memory": { - "version": "1.0.2" - }, "league/mime-type-detection": { "version": "1.4.0" }, @@ -815,9 +812,6 @@ "symfony/polyfill-php81": { "version": "v1.23.0" }, - "symfony/polyfill-uuid": { - "version": "v1.14.0" - }, "symfony/process": { "version": "v5.0.2" }, diff --git a/tests/Doubles/FakeBitbucketApi.php b/tests/Doubles/FakeBitbucketApi.php index 99e8fbfa..88c94c97 100644 --- a/tests/Doubles/FakeBitbucketApi.php +++ b/tests/Doubles/FakeBitbucketApi.php @@ -6,11 +6,15 @@ use Buddy\Repman\Service\Integration\BitbucketApi; use Buddy\Repman\Service\Integration\BitbucketApi\Repositories; +use Buddy\Repman\Service\Integration\BitbucketApi\Repository; +use Throwable; final class FakeBitbucketApi implements BitbucketApi { private string $primaryEmail = ''; - private ?\Throwable $exception = null; + + private ?Throwable $exception = null; + /** * @var string[] */ @@ -28,7 +32,7 @@ public function setPrimaryEmail(string $primaryEmail): void $this->primaryEmail = $primaryEmail; } - public function setExceptionOnNextCall(?\Throwable $exception): void + public function setExceptionOnNextCall(?Throwable $exception): void { $this->exception = $exception; } @@ -38,7 +42,7 @@ public function repositories(string $accessToken): Repositories $this->throwExceptionIfSet(); return new Repositories([ - new BitbucketApi\Repository('{0f6dc6fe-f8ab-4a53-bb63-03042b80056f}', 'buddy-works/repman', 'https://bitbucket.org/buddy-works/repman.git'), + new Repository('{0f6dc6fe-f8ab-4a53-bb63-03042b80056f}', 'buddy-works/repman', 'https://bitbucket.org/buddy-works/repman.git'), ]); } @@ -63,7 +67,7 @@ public function removedWebhooks(): array private function throwExceptionIfSet(): void { - if ($this->exception !== null) { + if ($this->exception instanceof Throwable) { throw $this->exception; } } diff --git a/tests/Doubles/FakeBuddyApi.php b/tests/Doubles/FakeBuddyApi.php index 49d1425f..187ffe6a 100644 --- a/tests/Doubles/FakeBuddyApi.php +++ b/tests/Doubles/FakeBuddyApi.php @@ -5,15 +5,17 @@ namespace Buddy\Repman\Tests\Doubles; use Buddy\Repman\Service\Integration\BuddyApi; +use Throwable; final class FakeBuddyApi implements BuddyApi { private string $primaryEmail = ''; - private ?\Throwable $exception = null; + + private ?Throwable $exception = null; public function primaryEmail(string $accessToken): string { - if ($this->exception !== null) { + if ($this->exception instanceof Throwable) { throw $this->exception; } @@ -25,7 +27,7 @@ public function setPrimaryEmail(string $primaryEmail): void $this->primaryEmail = $primaryEmail; } - public function setExceptionOnNextCall(?\Throwable $exception): void + public function setExceptionOnNextCall(?Throwable $exception): void { $this->exception = $exception; } diff --git a/tests/Doubles/FakeDownloader.php b/tests/Doubles/FakeDownloader.php index 367f591f..ca12547d 100644 --- a/tests/Doubles/FakeDownloader.php +++ b/tests/Doubles/FakeDownloader.php @@ -10,17 +10,13 @@ final class FakeDownloader implements Downloader { - // todo: remove this and allow only for in-memory content to explicit control - private string $basePath; - /** * @var mixed[] */ private array $content = []; - public function __construct(string $basePath = __DIR__.'/../Resources') + public function __construct(private readonly string $basePath = __DIR__.'/../Resources') { - $this->basePath = $basePath; } /** @@ -28,7 +24,7 @@ public function __construct(string $basePath = __DIR__.'/../Resources') * * @return Option */ - public function getContents(string $url, array $headers = [], callable $notFoundHandler = null): Option + public function getContents(string $url, array $headers = [], ?callable $notFoundHandler = null): Option { if (isset($this->content[$url])) { return Option::some(Stream::fromString($this->content[$url]['content'])); @@ -44,7 +40,7 @@ public function getContents(string $url, array $headers = [], callable $notFound return Option::some(Stream::fromString((string) file_get_contents($url))); } - if (strstr($path, 'not-found') !== false && $notFoundHandler !== null) { + if (str_contains($path, 'not-found') && $notFoundHandler !== null) { $notFoundHandler(); } @@ -80,7 +76,7 @@ public function getLastModified(string $url, callable $onFulfilled): void } } - public function addContent(string $url, ?string $content, int $timestamp = null): void + public function addContent(string $url, ?string $content, ?int $timestamp = null): void { $this->content[$url] = [ 'timestamp' => $timestamp ?? time(), diff --git a/tests/Doubles/FakeGitHubApi.php b/tests/Doubles/FakeGitHubApi.php index 6dd5f5b4..98172ab3 100644 --- a/tests/Doubles/FakeGitHubApi.php +++ b/tests/Doubles/FakeGitHubApi.php @@ -5,11 +5,14 @@ namespace Buddy\Repman\Tests\Doubles; use Buddy\Repman\Service\Integration\GitHubApi; +use Throwable; final class FakeGitHubApi implements GitHubApi { private string $primaryEmail = ''; - private ?\Throwable $exception = null; + + private ?Throwable $exception = null; + /** * @var string[] */ @@ -27,7 +30,7 @@ public function setPrimaryEmail(string $primaryEmail): void $this->primaryEmail = $primaryEmail; } - public function setExceptionOnNextCall(?\Throwable $exception): void + public function setExceptionOnNextCall(?Throwable $exception): void { $this->exception = $exception; } @@ -65,7 +68,7 @@ public function removedWebhooks(): array private function throwExceptionIfSet(): void { - if ($this->exception !== null) { + if ($this->exception instanceof Throwable) { throw $this->exception; } } diff --git a/tests/Doubles/FakeGitLabApi.php b/tests/Doubles/FakeGitLabApi.php index 99f64df0..83383e64 100644 --- a/tests/Doubles/FakeGitLabApi.php +++ b/tests/Doubles/FakeGitLabApi.php @@ -5,13 +5,15 @@ namespace Buddy\Repman\Tests\Doubles; use Buddy\Repman\Service\Integration\GitLabApi; +use Buddy\Repman\Service\Integration\GitLabApi\Project; use Buddy\Repman\Service\Integration\GitLabApi\Projects; +use Throwable; final class FakeGitLabApi implements GitLabApi { - private ?\Throwable $exception = null; + private ?Throwable $exception = null; - public function setExceptionOnNextCall(?\Throwable $exception): void + public function setExceptionOnNextCall(?Throwable $exception): void { $this->exception = $exception; } @@ -21,7 +23,7 @@ public function projects(string $accessToken): Projects $this->throwExceptionIfSet(); return new Projects([ - new GitLabApi\Project(123456, 'buddy-works/repman', 'https://gitlab.com/buddy-works/repman'), + new Project(123456, 'buddy-works/repman', 'https://gitlab.com/buddy-works/repman'), ]); } @@ -37,7 +39,7 @@ public function removeHook(string $accessToken, int $projectId, string $hookUrl) private function throwExceptionIfSet(): void { - if ($this->exception !== null) { + if ($this->exception instanceof Throwable) { throw $this->exception; } } diff --git a/tests/Doubles/FakePackageSynchronizer.php b/tests/Doubles/FakePackageSynchronizer.php index 607ec230..9b95ae18 100644 --- a/tests/Doubles/FakePackageSynchronizer.php +++ b/tests/Doubles/FakePackageSynchronizer.php @@ -9,16 +9,23 @@ use Buddy\Repman\Entity\Organization\Package\Version; use Buddy\Repman\Query\User\Model\Package\Link as LinkModel; use Buddy\Repman\Service\PackageSynchronizer; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; final class FakePackageSynchronizer implements PackageSynchronizer { private string $name = 'default/default'; + private string $description = 'n/a'; + private string $latestReleasedVersion = '1.0.0'; - private \DateTimeImmutable $latestReleaseDate; + + private DateTimeImmutable $latestReleaseDate; + private ?string $error = null; + private ?string $readme = null; + private ?string $replacementPackage = null; /** @@ -33,14 +40,14 @@ final class FakePackageSynchronizer implements PackageSynchronizer public function __construct() { - $this->latestReleaseDate = new \DateTimeImmutable(); + $this->latestReleaseDate = new DateTimeImmutable(); } /** * @param Version[] $versions * @param LinkModel[] $links */ - public function setData(string $name, string $description, string $latestReleasedVersion, \DateTimeImmutable $latestReleaseDate, array $versions = [], array $links = [], ?string $readme = null, ?string $replacementPackage = null): void + public function setData(string $name, string $description, string $latestReleasedVersion, DateTimeImmutable $latestReleaseDate, array $versions = [], array $links = [], ?string $readme = null, ?string $replacementPackage = null): void { $this->name = $name; $this->description = $description; @@ -68,6 +75,7 @@ public function synchronize(Package $package): void $package->setReadme($this->readme); $package->setReplacementPackage($this->replacementPackage); + $encounteredVersions = []; foreach ($this->versions as $version) { $package->addOrUpdateVersion($version); diff --git a/tests/Doubles/FakeTelemetryEndpoint.php b/tests/Doubles/FakeTelemetryEndpoint.php index 083fc93a..b03d328f 100644 --- a/tests/Doubles/FakeTelemetryEndpoint.php +++ b/tests/Doubles/FakeTelemetryEndpoint.php @@ -11,7 +11,9 @@ final class FakeTelemetryEndpoint implements Endpoint { private string $sent = ''; + private string $emailAdded = ''; + private string $emailRemoved = ''; public function send(Entry $entry): void diff --git a/tests/Functional/Command/ClearMetadataCacheCommandTest.php b/tests/Functional/Command/ClearMetadataCacheCommandTest.php index ebcc440b..2c032458 100644 --- a/tests/Functional/Command/ClearMetadataCacheCommandTest.php +++ b/tests/Functional/Command/ClearMetadataCacheCommandTest.php @@ -10,12 +10,17 @@ use League\Flysystem\Filesystem; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem; +use function dirname; +use function file_put_contents; +use function is_dir; +use function mkdir; +use function sys_get_temp_dir; final class ClearMetadataCacheCommandTest extends FunctionalTestCase { public function testClearMetadataCache(): void { - $basePath = \sys_get_temp_dir().'/'.'repman/clear-metadata'; + $basePath = sys_get_temp_dir().'/repman/clear-metadata'; $ignoredFiles = [ $basePath.'/dist/.svn/foo/packages.json', @@ -28,21 +33,21 @@ public function testClearMetadataCache(): void $ignoredFiles, ); - self::assertFileExists($packagesFile); - self::assertFileExists($distFile); + $this->assertFileExists($packagesFile); + $this->assertFileExists($distFile); $command = new ClearMetadataCacheCommand(new Filesystem(new Local($basePath))); $commandTester = new CommandTester($command); $commandTester->execute([]); - self::assertFileDoesNotExist($packagesFile); - self::assertFileExists($distFile); + $this->assertFileDoesNotExist($packagesFile); + $this->assertFileExists($distFile); foreach ($ignoredFiles as $ignoredFile) { - self::assertFileExists($ignoredFile); + $this->assertFileExists($ignoredFile); } - self::assertEquals("Deleted 1 file(s).\n", $commandTester->getDisplay()); + $this->assertSame("Deleted 1 file(s).\n", $commandTester->getDisplay()); $filesystem = new SymfonyFilesystem(); $filesystem->remove($basePath); @@ -50,13 +55,13 @@ public function testClearMetadataCache(): void public function testNoMetadataFilesFound(): void { - $basePath = \sys_get_temp_dir().'/'.'repman/clear-metadata'; + $basePath = sys_get_temp_dir().'/repman/clear-metadata'; $command = new ClearMetadataCacheCommand(new Filesystem(new Local($basePath))); $commandTester = new CommandTester($command); $commandTester->execute([]); - self::assertEquals("No metadata files found.\n", $commandTester->getDisplay()); + $this->assertSame("No metadata files found.\n", $commandTester->getDisplay()); } /** @@ -65,24 +70,24 @@ public function testNoMetadataFilesFound(): void private function prepareTempFiles( string $packagesFile, string $distFile, - array $ignoredFiles + array $ignoredFiles, ): void { $this->ensureDirExist($packagesFile); $this->ensureDirExist($distFile); foreach ($ignoredFiles as $ignoredFile) { $this->ensureDirExist($ignoredFile); - \file_put_contents($ignoredFile, '{"packages":[]}'); + file_put_contents($ignoredFile, '{"packages":[]}'); } - \file_put_contents($packagesFile, '{"packages":[]}'); - \file_put_contents($distFile, 'zip content'); + file_put_contents($packagesFile, '{"packages":[]}'); + file_put_contents($distFile, 'zip content'); } private function ensureDirExist(string $path): void { - $path = \dirname($path); - if (!\is_dir($path)) { - \mkdir($path, 0777, true); + $path = dirname($path); + if (!is_dir($path)) { + mkdir($path, 0o777, true); } } } diff --git a/tests/Functional/Command/ClearOldPrivateDistsCommandTest.php b/tests/Functional/Command/ClearOldPrivateDistsCommandTest.php index 675fb962..7251a464 100644 --- a/tests/Functional/Command/ClearOldPrivateDistsCommandTest.php +++ b/tests/Functional/Command/ClearOldPrivateDistsCommandTest.php @@ -8,17 +8,22 @@ use Buddy\Repman\Entity\Organization\Package\Version; use Buddy\Repman\Tests\Functional\FunctionalTestCase; use Composer\Semver\VersionParser; -use League\Flysystem\FilesystemInterface; +use DateTime; +use DateTimeImmutable; +use League\Flysystem\FilesystemOperator; use Ramsey\Uuid\Uuid; use Symfony\Component\Console\Tester\CommandTester; +use function sprintf; final class ClearOldPrivateDistsCommandTest extends FunctionalTestCase { private string $ref = 'ac7dcaf888af2324cd14200769362129c8dd8550'; + private string $packageName = 'buddy-works/repman'; + private string $version = '1.2.3'; - private FilesystemInterface $filesystem; + private FilesystemOperator $filesystem; protected function setUp(): void { @@ -37,19 +42,20 @@ public function testWillNotRemoveStableVersion(): void $this->packageName, 'description', $this->version, - new \DateTimeImmutable(), + new DateTimeImmutable(), [ $this->createVersion($this->version, $this->ref, Version::STABILITY_STABLE), ] ); $this->fixtures->prepareRepoFiles(); + $commandTester = new CommandTester( $this->container()->get(ClearOldPrivateDistsCommand::class) ); $this->assertFileExistence($this->distFilePath($this->version, $this->ref)); - self::assertEquals(0, $commandTester->execute([])); + $this->assertSame(0, $commandTester->execute([])); $this->assertFileExistence($this->distFilePath($this->version, $this->ref)); @@ -67,7 +73,7 @@ public function testWillNotRemoveLastDevVersion(): void $this->packageName, 'description', $this->version, - new \DateTimeImmutable(), + new DateTimeImmutable(), [ $this->createVersion($this->version, $this->ref, Version::STABILITY_STABLE), $this->createVersion('dev-master', $devRef, 'dev'), @@ -83,7 +89,7 @@ public function testWillNotRemoveLastDevVersion(): void $this->assertFileExistence($this->distFilePath($this->version, $this->ref)); $this->assertFileExistence($this->distFilePath('dev-master', $devRef)); - self::assertEquals(0, $commandTester->execute([])); + $this->assertSame(0, $commandTester->execute([])); $this->assertFileExistence($this->distFilePath($this->version, $this->ref)); $this->assertFileExistence($this->distFilePath('dev-master', $devRef)); @@ -106,7 +112,7 @@ public function testWillRemoveAllDevVersionsExceptLast(): void $this->packageName, 'description', $this->version, - new \DateTimeImmutable(), + new DateTimeImmutable(), [ $this->createVersion($this->version, $this->ref, Version::STABILITY_STABLE), $this->createVersion('dev-master', $dev1Ref, 'dev', 1), @@ -134,13 +140,13 @@ public function testWillRemoveAllDevVersionsExceptLast(): void $this->assertFileExistence($this->distFilePath('dev-stage', $dev4Ref)); $this->assertFileExistence($this->distFilePath('dev-stage', $dev5Ref)); - self::assertEquals(0, $commandTester->execute([])); + $this->assertSame(0, $commandTester->execute([])); $this->assertFileExistence($this->distFilePath($this->version, $this->ref)); - self::assertFileDoesNotExist($this->distFilePath('dev-master', $dev1Ref)); + $this->assertFileDoesNotExist($this->distFilePath('dev-master', $dev1Ref)); $this->assertFileExistence($this->distFilePath('dev-master', $dev2Ref)); $this->assertFileExistence($this->distFilePath('dev-test', $dev3Ref)); - self::assertFileDoesNotExist($this->distFilePath('dev-stage', $dev4Ref)); + $this->assertFileDoesNotExist($this->distFilePath('dev-stage', $dev4Ref)); $this->assertFileExistence($this->distFilePath('dev-stage', $dev5Ref)); $this->fixtures->prepareRepoFiles(); @@ -166,17 +172,14 @@ private function createVersion(string $version, string $ref, string $stability, $version, $ref, 1234, - \DateTimeImmutable::createFromMutable((new \DateTime())->modify("+$dateOffset seconds")), + DateTimeImmutable::createFromMutable((new DateTime())->modify(sprintf('+%d seconds', $dateOffset))), $stability ); } private function assertFileExistence(string $filepath): void { - $message = \sprintf('Failed asserting that file "%s" exists.', $filepath); - self::assertTrue( - $this->filesystem->has($filepath), - $message - ); + $message = sprintf('Failed asserting that file "%s" exists.', $filepath); + $this->assertTrue($this->filesystem->has($filepath), $message); } } diff --git a/tests/Functional/Command/CreateAdminCommandTest.php b/tests/Functional/Command/CreateAdminCommandTest.php index 475b624d..706e453c 100644 --- a/tests/Functional/Command/CreateAdminCommandTest.php +++ b/tests/Functional/Command/CreateAdminCommandTest.php @@ -15,12 +15,13 @@ public function testCreateAdmin(): void { $command = $this->container()->get(CreateAdminCommand::class); $command->setApplication(new Application()); + $commandTester = new CommandTester($command); $commandTester->execute([ 'email' => 'test@buddy.works', 'password' => 'password', ]); - self::assertStringContainsString('Created admin user with id:', $commandTester->getDisplay()); + $this->assertStringContainsString('Created admin user with id:', $commandTester->getDisplay()); } } diff --git a/tests/Functional/Command/CreateUserCommandTest.php b/tests/Functional/Command/CreateUserCommandTest.php index e091e7e0..85cb5c70 100644 --- a/tests/Functional/Command/CreateUserCommandTest.php +++ b/tests/Functional/Command/CreateUserCommandTest.php @@ -18,6 +18,6 @@ public function testCreateAdmin(): void 'password' => 'password', ]); - self::assertStringContainsString('Created user with id:', $commandTester->getDisplay()); + $this->assertStringContainsString('Created user with id:', $commandTester->getDisplay()); } } diff --git a/tests/Functional/Command/ProxySyncMetadataCommandTest.php b/tests/Functional/Command/ProxySyncMetadataCommandTest.php index 46506e7f..38b4ea71 100644 --- a/tests/Functional/Command/ProxySyncMetadataCommandTest.php +++ b/tests/Functional/Command/ProxySyncMetadataCommandTest.php @@ -24,15 +24,15 @@ protected function setUp(): void public function testMetadataSynchronization(): void { $lock = $this->lockFactory->createLock(ProxySyncMetadataCommand::LOCK_NAME); - self::assertFalse($lock->isAcquired()); + $this->assertFalse($lock->isAcquired()); $commandTester = new CommandTester($this->prepareCommand()); $result = $commandTester->execute([]); - self::assertEquals($result, 0); + $this->assertSame(0, $result); // test if lock was released - self::assertTrue($lock->acquire()); + $this->assertTrue($lock->acquire()); $lock->release(); } @@ -40,13 +40,13 @@ public function testJobLocking(): void { $lock = $this->lockFactory->createLock(ProxySyncMetadataCommand::LOCK_NAME); $lock->acquire(); - self::assertTrue($lock->isAcquired()); + $this->assertTrue($lock->isAcquired()); $commandTester = new CommandTester($this->prepareCommand()); $result = $commandTester->execute([]); - self::assertEquals($result, 0); - self::assertTrue($lock->isAcquired()); + $this->assertSame(0, $result); + $this->assertTrue($lock->isAcquired()); $lock->release(); } diff --git a/tests/Functional/Command/ProxySyncReleasesCommandTest.php b/tests/Functional/Command/ProxySyncReleasesCommandTest.php index f8ac0576..8ff73b68 100644 --- a/tests/Functional/Command/ProxySyncReleasesCommandTest.php +++ b/tests/Functional/Command/ProxySyncReleasesCommandTest.php @@ -11,6 +11,7 @@ use Buddy\Repman\Tests\Functional\FunctionalTestCase; use Doctrine\DBAL\Connection; use Munus\Control\Option; +use RuntimeException; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Lock\LockFactory; @@ -20,8 +21,11 @@ final class ProxySyncReleasesCommandTest extends FunctionalTestCase { private string $basePath = __DIR__.'/../../Resources'; + private FilesystemAdapter $cache; + private string $newDistPath = '/packagist.org/dist/buddy-works/repman/61e39aa8197cf1bc7fcb16a6f727b0c291bc9b76.zip'; + private string $feedPath = '/packagist.org/feed/releases.rss'; public function testSyncReleases(): void @@ -35,8 +39,8 @@ public function testSyncReleases(): void $commandTester = new CommandTester($command); $result = $commandTester->execute([]); - self::assertFileExists($newDist); - self::assertEquals($result, 0); + $this->assertFileExists($newDist); + $this->assertSame(0, $result); @unlink($newDist); // cache hit (pubDate is set) @@ -44,13 +48,13 @@ public function testSyncReleases(): void $commandTester = new CommandTester($command); $result = $commandTester->execute([]); - self::assertFileDoesNotExist($newDist); - self::assertEquals($result, 0); + $this->assertFileDoesNotExist($newDist); + $this->assertSame(0, $result); } public function testParsingError(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Unable to parse RSS feed'); $command = $this->prepareCommand('invalid xml'); @@ -68,8 +72,8 @@ public function testJobLocking(): void $commandTester = new CommandTester($command); $result = $commandTester->execute([]); - self::assertFileDoesNotExist($newDist); - self::assertEquals($result, 0); + $this->assertFileDoesNotExist($newDist); + $this->assertSame(0, $result); } private function prepareCommand(string $feed, bool $fromCache = false, bool $lockCreated = false): ProxySyncReleasesCommand @@ -93,7 +97,7 @@ private function prepareCommand(string $feed, bool $fromCache = false, bool $loc private function cache(): FilesystemAdapter { - return $this->cache = $this->cache ?? new FilesystemAdapter('test', 0, self::$kernel->getCacheDir()); + return $this->cache ??= new FilesystemAdapter('test', 0, self::$kernel->getCacheDir()); } private function fakeLockFactory(): LockFactory diff --git a/tests/Functional/Command/ScanAllPackagesCommandTest.php b/tests/Functional/Command/ScanAllPackagesCommandTest.php index 1cd3e896..67b2ebc5 100644 --- a/tests/Functional/Command/ScanAllPackagesCommandTest.php +++ b/tests/Functional/Command/ScanAllPackagesCommandTest.php @@ -7,30 +7,30 @@ use Buddy\Repman\Command\ScanAllPackagesCommand; use Buddy\Repman\Service\Security\PackageScanner; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; use Symfony\Component\Console\Tester\CommandTester; final class ScanAllPackagesCommandTest extends FunctionalTestCase { - private string $userId; private string $buddyId; protected function setUp(): void { parent::setUp(); - $this->userId = $this->createAndLoginAdmin(); - $this->buddyId = $this->fixtures->createOrganization('buddy', $this->userId); + $userId = $this->createAndLoginAdmin(); + $this->buddyId = $this->fixtures->createOrganization('buddy', $userId); } public function testScanSuccess(): void { $packageId = $this->fixtures->addPackage($this->buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); $commandTester = new CommandTester($this->container()->get(ScanAllPackagesCommand::class)); $result = $commandTester->execute([]); - self::assertEquals($result, 0); - self::assertTrue($this->container()->get(PackageScanner::class)->wasScanned($packageId)); + $this->assertSame(0, $result); + $this->assertTrue($this->container()->get(PackageScanner::class)->wasScanned($packageId)); } } diff --git a/tests/Functional/Command/SendTelemetryCommandTest.php b/tests/Functional/Command/SendTelemetryCommandTest.php index 8d7773a2..1a1cc734 100644 --- a/tests/Functional/Command/SendTelemetryCommandTest.php +++ b/tests/Functional/Command/SendTelemetryCommandTest.php @@ -10,6 +10,7 @@ use Buddy\Repman\Tests\Functional\FunctionalTestCase; use Ramsey\Uuid\Uuid; use Symfony\Component\Console\Tester\CommandTester; +use function file_put_contents; final class SendTelemetryCommandTest extends FunctionalTestCase { @@ -21,8 +22,8 @@ public function testSendTelemetryWithoutInstanceIdFile(): void $this->container()->get(SendTelemetryCommand::class) ); - self::assertEquals(0, $commandTester->execute([])); - self::assertTrue($this->container()->get(TelemetryEndpoint::class)->entryWasNotSent()); + $this->assertSame(0, $commandTester->execute([])); + $this->assertTrue($this->container()->get(TelemetryEndpoint::class)->entryWasNotSent()); } public function testSendTelemetryWithTelemetryDisabled(): void @@ -34,8 +35,8 @@ public function testSendTelemetryWithTelemetryDisabled(): void $this->container()->get(SendTelemetryCommand::class) ); - self::assertEquals(0, $commandTester->execute([])); - self::assertTrue($this->container()->get(TelemetryEndpoint::class)->entryWasNotSent()); + $this->assertSame(0, $commandTester->execute([])); + $this->assertTrue($this->container()->get(TelemetryEndpoint::class)->entryWasNotSent()); } public function testSendTelemetry(): void @@ -49,14 +50,14 @@ public function testSendTelemetry(): void $this->container()->get(SendTelemetryCommand::class) ); - self::assertEquals(0, $commandTester->execute([])); - self::assertTrue($this->container()->get(TelemetryEndpoint::class)->wasEntrySent($instanceId)); + $this->assertSame(0, $commandTester->execute([])); + $this->assertTrue($this->container()->get(TelemetryEndpoint::class)->wasEntrySent($instanceId)); } private function generateInstanceIdFile(): string { $instanceId = Uuid::uuid4()->toString(); - \file_put_contents($this->instanceIdFile(), $instanceId); + file_put_contents($this->instanceIdFile(), $instanceId); return $instanceId; } diff --git a/tests/Functional/Command/SynchronizeAllPackagesCommandTest.php b/tests/Functional/Command/SynchronizeAllPackagesCommandTest.php index ce59a8c7..84a484f8 100644 --- a/tests/Functional/Command/SynchronizeAllPackagesCommandTest.php +++ b/tests/Functional/Command/SynchronizeAllPackagesCommandTest.php @@ -7,22 +7,22 @@ use Buddy\Repman\Command\SynchronizeAllPackagesCommand; use Buddy\Repman\Message\Security\ScanPackage; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; +use InvalidArgumentException; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Messenger\Transport\InMemoryTransport; final class SynchronizeAllPackagesCommandTest extends FunctionalTestCase { - private string $buddyId; - protected function setUp(): void { parent::setUp(); $userId = $this->createAndLoginAdmin(); - $this->buddyId = $this->fixtures->createOrganization('buddy', $userId); + $buddyId = $this->fixtures->createOrganization('buddy', $userId); - $packageId = $this->fixtures->addPackage($this->buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); } public function testSynchronizeAllSuccess(): void @@ -34,9 +34,9 @@ public function testSynchronizeAllSuccess(): void $commandTester = new CommandTester($this->container()->get(SynchronizeAllPackagesCommand::class)); $result = $commandTester->execute([]); - self::assertCount(1, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); - self::assertEquals($result, 0); + $this->assertCount(1, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertSame(0, $result); } public function testSynchronizeAllOrganizationSuccess(): void @@ -49,16 +49,16 @@ public function testSynchronizeAllOrganizationSuccess(): void $commandTester = new CommandTester($this->container()->get(SynchronizeAllPackagesCommand::class)); $result = $commandTester->execute(['organization' => $alias]); - self::assertCount(1, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); - self::assertEquals($result, 0); + $this->assertCount(1, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertSame(0, $result); } public function testSynchronizeAllOrganizationFailure(): void { $alias = 'non-existing-alias'; - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage(sprintf('Organization with alias %s not found.', $alias)); /** @var InMemoryTransport $transport */ diff --git a/tests/Functional/Command/SynchronizePackageCommandTest.php b/tests/Functional/Command/SynchronizePackageCommandTest.php index 3f356a58..470343d0 100644 --- a/tests/Functional/Command/SynchronizePackageCommandTest.php +++ b/tests/Functional/Command/SynchronizePackageCommandTest.php @@ -7,26 +7,26 @@ use Buddy\Repman\Command\SynchronizePackageCommand; use Buddy\Repman\Message\Security\ScanPackage; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Messenger\Transport\InMemoryTransport; final class SynchronizePackageCommandTest extends FunctionalTestCase { - private string $userId; private string $buddyId; protected function setUp(): void { parent::setUp(); - $this->userId = $this->createAndLoginAdmin(); - $this->buddyId = $this->fixtures->createOrganization('buddy', $this->userId); + $userId = $this->createAndLoginAdmin(); + $this->buddyId = $this->fixtures->createOrganization('buddy', $userId); } public function testSynchronizeSuccess(): void { $packageId = $this->fixtures->addPackage($this->buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); @@ -37,9 +37,9 @@ public function testSynchronizeSuccess(): void 'packageId' => $packageId, ]); - self::assertCount(1, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); - self::assertEquals($result, 0); + $this->assertCount(1, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertSame(0, $result); } public function testPackageNotFound(): void @@ -49,7 +49,7 @@ public function testPackageNotFound(): void 'packageId' => 'c0dbfca1-cf1b-4334-9081-41a2125fc443', ]); - self::assertStringContainsString('Package not found', $commandTester->getDisplay()); - self::assertEquals($result, 1); + $this->assertStringContainsString('Package not found', $commandTester->getDisplay()); + $this->assertSame(1, $result); } } diff --git a/tests/Functional/Command/UpdateAdvisoriesDbCommandTest.php b/tests/Functional/Command/UpdateAdvisoriesDbCommandTest.php index b2f7cc53..2ad88661 100644 --- a/tests/Functional/Command/UpdateAdvisoriesDbCommandTest.php +++ b/tests/Functional/Command/UpdateAdvisoriesDbCommandTest.php @@ -7,30 +7,30 @@ use Buddy\Repman\Command\UpdateAdvisoriesDbCommand; use Buddy\Repman\Service\Security\PackageScanner; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; use Symfony\Component\Console\Tester\CommandTester; final class UpdateAdvisoriesDbCommandTest extends FunctionalTestCase { - private string $userId; private string $buddyId; protected function setUp(): void { parent::setUp(); - $this->userId = $this->createAndLoginAdmin(); - $this->buddyId = $this->fixtures->createOrganization('buddy', $this->userId); + $userId = $this->createAndLoginAdmin(); + $this->buddyId = $this->fixtures->createOrganization('buddy', $userId); } public function testUpdate(): void { $packageId = $this->fixtures->addPackage($this->buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); $commandTester = new CommandTester($this->container()->get(UpdateAdvisoriesDbCommand::class)); $result = $commandTester->execute([]); - self::assertEquals($result, 0); - self::assertTrue($this->container()->get(PackageScanner::class)->wasScanned($packageId)); + $this->assertSame(0, $result); + $this->assertTrue($this->container()->get(PackageScanner::class)->wasScanned($packageId)); } } diff --git a/tests/Functional/Controller/Admin/ConfigControllerTest.php b/tests/Functional/Controller/Admin/ConfigControllerTest.php index 2c49429e..fec0aefa 100644 --- a/tests/Functional/Controller/Admin/ConfigControllerTest.php +++ b/tests/Functional/Controller/Admin/ConfigControllerTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Service\Telemetry\TelemetryEndpoint; use Buddy\Repman\Tests\Functional\FunctionalTestCase; use Ramsey\Uuid\Uuid; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; final class ConfigControllerTest extends FunctionalTestCase @@ -20,86 +21,77 @@ protected function setUp(): void public function testConfigForm(): void { - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Repman configuration', $this->lastResponseBody()); - self::assertStringContainsString('OAuth registration', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Repman configuration', $this->lastResponseBody()); + $this->assertStringContainsString('OAuth registration', $this->lastResponseBody()); } public function testToggleAuthenticationOptions(): void { - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'local_authentication' => 'login_and_registration', 'oauth_registration' => 'disabled', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'Configuration has been successfully changed', - $this->lastResponseBody() - ); + $this->assertStringContainsString('Configuration has been successfully changed', $this->lastResponseBody()); - $this->client->request('GET', $this->urlTo('app_register')); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register')); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_github_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_gitlab_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_bitbucket_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_buddy_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'local_authentication' => 'login_only', 'oauth_registration' => 'disabled', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'Configuration has been successfully changed', - $this->lastResponseBody() - ); + $this->assertStringContainsString('Configuration has been successfully changed', $this->lastResponseBody()); - $this->client->request('GET', $this->urlTo('app_register')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_github_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_gitlab_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_bitbucket_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('register_buddy_start')); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_start')); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('app_register_confirm', ['token' => '825f33c5-2311-41ec-ba18-e967027b3f6f'])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register_confirm', ['token' => '825f33c5-2311-41ec-ba18-e967027b3f6f'])); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'local_authentication' => 'login_and_registration', 'oauth_registration' => 'enabled', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'Configuration has been successfully changed', - $this->lastResponseBody() - ); + $this->assertStringContainsString('Configuration has been successfully changed', $this->lastResponseBody()); } public function testEnableTelemetry(): void @@ -107,16 +99,16 @@ public function testEnableTelemetry(): void $prompt = 'Help us improve Repman by enabling sending anonymous usage statistic'; $instanceIdFile = $this->instanceIdFile(); @unlink($instanceIdFile); - $this->client->request('GET', $this->urlTo('index')); - self::assertStringContainsString($prompt, $this->lastResponseBody()); + $this->client->request(Request::METHOD_GET, $this->urlTo('index')); + $this->assertStringContainsString($prompt, $this->lastResponseBody()); - $this->client->request('POST', $this->urlTo('admin_config_toggle_telemetry')); + $this->client->request(Request::METHOD_POST, $this->urlTo('admin_config_toggle_telemetry')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirect(); - self::assertStringNotContainsString($prompt, $this->lastResponseBody()); - self::assertFileExists($instanceIdFile); + $this->assertStringNotContainsString($prompt, $this->lastResponseBody()); + $this->assertFileExists($instanceIdFile); @unlink($instanceIdFile); } @@ -125,41 +117,38 @@ public function testDisableTelemetry(): void $prompt = 'Help us improve Repman by enabling sending anonymous usage statistic'; $instanceIdFile = $this->instanceIdFile(); @unlink($instanceIdFile); - $this->client->request('GET', $this->urlTo('index')); - self::assertStringContainsString($prompt, $this->lastResponseBody()); + $this->client->request(Request::METHOD_GET, $this->urlTo('index')); + $this->assertStringContainsString($prompt, $this->lastResponseBody()); - $this->client->request('DELETE', $this->urlTo('admin_config_toggle_telemetry')); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('admin_config_toggle_telemetry')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirect(); - self::assertStringNotContainsString($prompt, $this->lastResponseBody()); - self::assertFileExists($instanceIdFile); + $this->assertStringNotContainsString($prompt, $this->lastResponseBody()); + $this->assertFileExists($instanceIdFile); @unlink($instanceIdFile); } public function testAddTechnicalEmail(): void { - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'technical_email' => 'john.doe@example.com', ]); $instanceId = (string) file_get_contents($this->instanceIdFile()); - self::assertTrue($this->container()->get(TelemetryEndpoint::class)->wasEmailAdded($instanceId)); + $this->assertTrue($this->container()->get(TelemetryEndpoint::class)->wasEmailAdded($instanceId)); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'Configuration has been successfully changed', - $this->lastResponseBody() - ); + $this->assertStringContainsString('Configuration has been successfully changed', $this->lastResponseBody()); } public function testRemoveTechnicalEmail(): void { - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'technical_email' => 'john.doe@example.com', ]); @@ -167,36 +156,33 @@ public function testRemoveTechnicalEmail(): void $instanceId = Uuid::uuid4()->toString(); file_put_contents($this->instanceIdFile(), $instanceId); - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'technical_email' => null, ]); - self::assertTrue($this->container()->get(TelemetryEndpoint::class)->wasEmailRemoved($instanceId)); + $this->assertTrue($this->container()->get(TelemetryEndpoint::class)->wasEmailRemoved($instanceId)); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_config'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'Configuration has been successfully changed', - $this->lastResponseBody() - ); + $this->assertStringContainsString('Configuration has been successfully changed', $this->lastResponseBody()); } public function testRemoveTechnicalEmailWithoutInstanceId(): void { - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'technical_email' => 'john.doe@example.com', ]); @unlink($this->instanceIdFile()); - $this->client->request('GET', $this->urlTo('admin_config')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_config')); $this->client->submitForm('save', [ 'technical_email' => null, ]); - self::assertTrue($this->container()->get(TelemetryEndpoint::class)->emailWasNotRemoved()); + $this->assertTrue($this->container()->get(TelemetryEndpoint::class)->emailWasNotRemoved()); } private function instanceIdFile(): string diff --git a/tests/Functional/Controller/Admin/OrganizationControllerTest.php b/tests/Functional/Controller/Admin/OrganizationControllerTest.php index bd26c59e..8dceea78 100644 --- a/tests/Functional/Controller/Admin/OrganizationControllerTest.php +++ b/tests/Functional/Controller/Admin/OrganizationControllerTest.php @@ -5,6 +5,7 @@ namespace Buddy\Repman\Tests\Functional\Controller\Admin; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; final class OrganizationControllerTest extends FunctionalTestCase { @@ -20,35 +21,35 @@ protected function setUp(): void public function testList(): void { - $this->client->request('GET', $this->urlTo('admin_organization_list')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_organization_list')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Organizations', $this->lastResponseBody()); - self::assertStringContainsString('Acme', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Organizations', $this->lastResponseBody()); + $this->assertStringContainsString('Acme', $this->lastResponseBody()); } public function testRemoveOrganization(): void { - $this->client->request('DELETE', $this->urlTo('admin_organization_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('admin_organization_remove', [ 'organization' => 'acme', ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_organization_list'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_organization_list'))); $this->client->followRedirect(); - self::assertStringContainsString('Organization Acme has been successfully removed', $this->lastResponseBody()); + $this->assertStringContainsString('Organization Acme has been successfully removed', $this->lastResponseBody()); } public function testAddAdmin(): void { - $this->client->request('POST', $this->urlTo('admin_organization_add_admin', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('admin_organization_add_admin', [ 'organization' => 'acme', ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_organization_list'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_organization_list'))); $this->client->followRedirect(); - self::assertStringContainsString('The user test@buddy.works has been successfully invited for Acme', $this->lastResponseBody()); + $this->assertStringContainsString('The user test@buddy.works has been successfully invited for Acme', $this->lastResponseBody()); } public function testStats(): void @@ -56,9 +57,9 @@ public function testStats(): void $orgId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($orgId, 'https://some.url'); $this->fixtures->addPackageDownload(1, $packageId); - $crawler = $this->client->request('GET', $this->urlTo('admin_stats')); + $crawler = $this->client->request(Request::METHOD_GET, $this->urlTo('admin_stats')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Total installs: 1', $crawler->text(null, true)); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Total installs: 1', $crawler->text(null, true)); } } diff --git a/tests/Functional/Controller/Admin/ProxyControllerTest.php b/tests/Functional/Controller/Admin/ProxyControllerTest.php index bce05e9e..e04d5b1d 100644 --- a/tests/Functional/Controller/Admin/ProxyControllerTest.php +++ b/tests/Functional/Controller/Admin/ProxyControllerTest.php @@ -6,6 +6,8 @@ use Buddy\Repman\Message\Proxy\AddDownloads\Package; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; +use Symfony\Component\HttpFoundation\Request; final class ProxyControllerTest extends FunctionalTestCase { @@ -19,32 +21,32 @@ public function testDistList(): void { $this->fixtures->addProxyPackageDownload( [new Package('buddy-works/repman', '1.0.0.0')], - new \DateTimeImmutable($time = '2020-04-27 19:34:00') + new DateTimeImmutable($time = '2020-04-27 19:34:00') ); - $this->client->request('GET', $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); - self::assertStringContainsString('packagist.org', $this->lastResponseBody()); - self::assertStringContainsString($time, $this->lastResponseBody()); + $this->assertStringContainsString('packagist.org', $this->lastResponseBody()); + $this->assertStringContainsString($time, $this->lastResponseBody()); } public function testStats(): void { $this->fixtures->addProxyPackageDownload( [new Package('buddy-works/repman', '1.0.0.0')], - new \DateTimeImmutable('2020-04-27 19:34:00') + new DateTimeImmutable('2020-04-27 19:34:00') ); - $crawler = $this->client->request('GET', $this->urlTo('admin_proxy_stats')); + $crawler = $this->client->request(Request::METHOD_GET, $this->urlTo('admin_proxy_stats')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Total installs: 1', $crawler->text(null, true)); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Total installs: 1', $crawler->text(null, true)); } public function testRemoveDistPackage(): void { - $this->client->request('DELETE', $this->urlTo('admin_dist_remove', ['proxy' => 'packagist.org', 'packageName' => 'vendor/package'])); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('admin_dist_remove', ['proxy' => 'packagist.org', 'packageName' => 'vendor/package'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_dist_list', ['proxy' => 'packagist.org']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_dist_list', ['proxy' => 'packagist.org']))); $this->client->followRedirect(); - self::assertStringContainsString('Dist files for package vendor/package will be removed', $this->lastResponseBody()); + $this->assertStringContainsString('Dist files for package vendor/package will be removed', $this->lastResponseBody()); } } diff --git a/tests/Functional/Controller/Admin/UserControllerTest.php b/tests/Functional/Controller/Admin/UserControllerTest.php index 1901bfc9..99c15be3 100644 --- a/tests/Functional/Controller/Admin/UserControllerTest.php +++ b/tests/Functional/Controller/Admin/UserControllerTest.php @@ -7,6 +7,8 @@ use Buddy\Repman\Query\Admin\UserQuery\DbalUserQuery; use Buddy\Repman\Tests\Functional\FunctionalTestCase; use Ramsey\Uuid\Uuid; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; final class UserControllerTest extends FunctionalTestCase { @@ -18,75 +20,66 @@ protected function setUp(): void public function testListUsers(): void { - $this->client->request('GET', $this->urlTo('admin_user_list')); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_user_list')); - self::assertEquals(200, $this->client->getResponse()->getStatusCode()); - self::assertStringContainsString('test@buddy.works', $this->lastResponseBody()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertStringContainsString('test@buddy.works', $this->lastResponseBody()); } public function testDisableUser(): void { $userId = $this->fixtures->createUser('disabled@buddy.works'); - $this->client->request('POST', $this->urlTo('admin_user_disable', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('admin_user_disable', [ 'user' => $userId, ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_user_list'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_user_list'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'User disabled@buddy.works has been successfully disabled', - $this->lastResponseBody() - ); + $this->assertStringContainsString('User disabled@buddy.works has been successfully disabled', $this->lastResponseBody()); } public function testDisableUserWhenUserNotFound(): void { - $this->client->request('POST', $this->urlTo('admin_user_disable', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('admin_user_disable', [ 'user' => Uuid::uuid4()->toString(), // random ])); - self::assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testEnableUser(): void { $userId = $this->fixtures->createUser('enabled@buddy.works'); - $this->client->request('POST', $this->urlTo('admin_user_enable', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('admin_user_enable', [ 'user' => $userId, ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_user_list'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('admin_user_list'))); $this->client->followRedirect(); - self::assertStringContainsString( - 'User enabled@buddy.works has been successfully enabled', - $this->lastResponseBody() - ); + $this->assertStringContainsString('User enabled@buddy.works has been successfully enabled', $this->lastResponseBody()); } public function testEnableUserWhenUserNotFound(): void { - $this->client->request('POST', $this->urlTo('admin_user_enable', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('admin_user_enable', [ 'user' => Uuid::uuid4()->toString(), // random ])); - self::assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testChangeRoles(): void { $userId = $this->fixtures->createUser('typical@buddy.works'); $this->client->followRedirects(); - $this->client->request('GET', $this->urlTo('admin_user_roles', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_user_roles', [ 'user' => $userId, ])); $this->client->submitForm('Change roles', ['admin' => true]); - self::assertStringContainsString( - 'User typical@buddy.works roles has been successfully changed', - $this->lastResponseBody() - ); - self::assertContains('ROLE_ADMIN', $this->container()->get(DbalUserQuery::class)->getById($userId)->get()->roles()); + $this->assertStringContainsString('User typical@buddy.works roles has been successfully changed', $this->lastResponseBody()); + $this->assertContains('ROLE_ADMIN', $this->container()->get(DbalUserQuery::class)->getById($userId)->get()->roles()); } } diff --git a/tests/Functional/Controller/Api/OrganizationControllerTest.php b/tests/Functional/Controller/Api/OrganizationControllerTest.php index 0abdf5ac..ad9eba96 100644 --- a/tests/Functional/Controller/Api/OrganizationControllerTest.php +++ b/tests/Functional/Controller/Api/OrganizationControllerTest.php @@ -6,13 +6,16 @@ use Buddy\Repman\Query\User\OrganizationQuery\DbalOrganizationQuery; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; final class OrganizationControllerTest extends FunctionalTestCase { private string $apiToken; + private static string $organization = 'Buddy works'; + private string $userId; protected function setUp(): void @@ -30,76 +33,72 @@ protected function setUp(): void public function testOrganizationsList(): void { $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_organizations')); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_organizations')); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertCount(1, $json['data']); - self::assertEquals($json['data'][0]['name'], 'Buddy works'); - self::assertEquals($json['data'][0]['alias'], 'buddy-works'); - self::assertEquals($json['data'][0]['hasAnonymousAccess'], false); - self::assertEquals($json['total'], 1); - self::assertNotEmpty($json['links']); + $this->assertCount(1, $json['data']); + $this->assertSame('Buddy works', $json['data'][0]['name']); + $this->assertSame('buddy-works', $json['data'][0]['alias']); + $this->assertEquals($json['data'][0]['hasAnonymousAccess'], false); + $this->assertSame(1, $json['total']); + $this->assertNotEmpty($json['links']); } public function testOrganizationsListPagination(): void { for ($i = 1; $i <= 41; ++$i) { - $this->fixtures->createOrganization("test-list-name#$i", $this->userId); + $this->fixtures->createOrganization('test-list-name#'.$i, $this->userId); } $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_organizations', ['page' => 2])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_organizations', ['page' => 2])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertCount(20, $json['data']); - self::assertEquals($json['data'][0]['name'], 'test-list-name#27'); - self::assertEquals($json['data'][19]['name'], 'test-list-name#7'); + $this->assertCount(20, $json['data']); + $this->assertSame('test-list-name#27', $json['data'][0]['name']); + $this->assertSame('test-list-name#7', $json['data'][19]['name']); - self::assertEquals($json['total'], 42); + $this->assertSame(42, $json['total']); $baseUrl = $this->urlTo('api_organizations', [], UrlGeneratorInterface::ABSOLUTE_URL); - self::assertEquals($baseUrl.'?page=1', $json['links']['first']); - self::assertEquals($baseUrl.'?page=1', $json['links']['prev']); - self::assertEquals($baseUrl.'?page=3', $json['links']['next']); - self::assertEquals($baseUrl.'?page=3', $json['links']['last']); + $this->assertSame($baseUrl.'?page=1', $json['links']['first']); + $this->assertSame($baseUrl.'?page=1', $json['links']['prev']); + $this->assertSame($baseUrl.'?page=3', $json['links']['next']); + $this->assertSame($baseUrl.'?page=3', $json['links']['last']); } public function testCreateOrganization(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_organization_create'), [], [], [], (string) json_encode([ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_organization_create'), [], [], [], (string) json_encode([ 'name' => 'New organization', ])); $json = $this->jsonResponse(); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertEquals($json['name'], 'New organization'); - self::assertEquals($json['alias'], 'new-organization'); - self::assertEquals($json['hasAnonymousAccess'], false); - self::assertFalse( - $this->container() - ->get(DbalOrganizationQuery::class) - ->getByAlias($json['alias']) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertSame('New organization', $json['name']); + $this->assertSame('new-organization', $json['alias']); + $this->assertEquals($json['hasAnonymousAccess'], false); + $this->assertFalse($this->container() + ->get(DbalOrganizationQuery::class) + ->getByAlias($json['alias']) + ->isEmpty()); } public function testCreateOrganizationBadRequest(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_organization_create')); + $this->client->request(Request::METHOD_POST, $this->urlTo('api_organization_create')); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -108,21 +107,18 @@ public function testCreateOrganizationBadRequest(): void } ] } - ' - ); + '); } public function testCreateOrganizationAlreadyExists(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_organization_create'), [], [], [], (string) json_encode([ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_organization_create'), [], [], [], (string) json_encode([ 'name' => self::$organization, ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -131,8 +127,7 @@ public function testCreateOrganizationAlreadyExists(): void } ] } - ' - ); + '); } /** diff --git a/tests/Functional/Controller/Api/PackageControllerTest.php b/tests/Functional/Controller/Api/PackageControllerTest.php index bac0950a..9e7e3b2b 100644 --- a/tests/Functional/Controller/Api/PackageControllerTest.php +++ b/tests/Functional/Controller/Api/PackageControllerTest.php @@ -11,16 +11,24 @@ use Buddy\Repman\Service\Integration\GitHubApi; use Buddy\Repman\Service\Integration\GitLabApi; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTime; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; +use RuntimeException; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; final class PackageControllerTest extends FunctionalTestCase { private string $apiToken; + private string $organizationId; + private string $userId; + private static string $organization = 'buddy'; + private static string $fakeId = '23b7b63c-a2c3-43f9-a4e6-ab74ba60ef11'; protected function setUp(): void @@ -37,12 +45,10 @@ protected function setUp(): void public function testAuthorizationRequired(): void { - $this->client->request('GET', $this->urlTo('api_packages', ['organization' => self::$organization])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_packages', ['organization' => self::$organization])); - self::assertEquals(Response::HTTP_UNAUTHORIZED, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_UNAUTHORIZED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -51,19 +57,16 @@ public function testAuthorizationRequired(): void } ] } - ' - ); + '); } public function testInvalidCredentials(): void { $this->loginApiUser('fake-token'); - $this->client->request('GET', $this->urlTo('api_packages', ['organization' => self::$organization])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_packages', ['organization' => self::$organization])); - self::assertEquals(Response::HTTP_UNAUTHORIZED, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_UNAUTHORIZED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -72,16 +75,15 @@ public function testInvalidCredentials(): void } ] } - ' - ); + '); } public function testOrganizationAccessDenied(): void { $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_packages', ['organization' => self::$fakeId])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_packages', ['organization' => self::$fakeId])); - self::assertEquals(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testPackagesList(): void @@ -90,13 +92,11 @@ public function testPackagesList(): void $this->fixtures->createPackage($packageId, '', $this->organizationId); $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_packages', ['organization' => self::$organization])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_packages', ['organization' => self::$organization])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "data": [ { @@ -126,8 +126,7 @@ public function testPackagesList(): void "prev": null } } - ' - ); + '); } public function testPackagesListPagination(): void @@ -138,47 +137,47 @@ public function testPackagesListPagination(): void } $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_packages', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('api_packages', [ 'organization' => self::$organization, 'page' => 2, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertCount(20, $json['data']); - self::assertEquals($json['total'], 41); + $this->assertCount(20, $json['data']); + $this->assertSame(41, $json['total']); $baseUrl = $this->urlTo('api_packages', ['organization' => self::$organization], UrlGeneratorInterface::ABSOLUTE_URL); - self::assertEquals($baseUrl.'?page=1', $json['links']['first']); - self::assertEquals($baseUrl.'?page=1', $json['links']['prev']); - self::assertEquals($baseUrl.'?page=3', $json['links']['next']); - self::assertEquals($baseUrl.'?page=3', $json['links']['last']); + $this->assertSame($baseUrl.'?page=1', $json['links']['first']); + $this->assertSame($baseUrl.'?page=1', $json['links']['prev']); + $this->assertSame($baseUrl.'?page=3', $json['links']['next']); + $this->assertSame($baseUrl.'?page=3', $json['links']['last']); } public function testEmptyPackagesList(): void { $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_packages', ['organization' => self::$organization])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_packages', ['organization' => self::$organization])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertEquals($json['data'], []); - self::assertEquals($json['total'], 0); + $this->assertEquals($json['data'], []); + $this->assertSame(0, $json['total']); $baseUrl = $this->urlTo('api_packages', ['organization' => self::$organization], UrlGeneratorInterface::ABSOLUTE_URL); - self::assertEquals($baseUrl.'?page=1', $json['links']['first']); - self::assertEquals(null, $json['links']['prev']); - self::assertEquals(null, $json['links']['next']); - self::assertEquals($baseUrl.'?page=1', $json['links']['last']); + $this->assertSame($baseUrl.'?page=1', $json['links']['first']); + $this->assertEquals(null, $json['links']['prev']); + $this->assertEquals(null, $json['links']['next']); + $this->assertSame($baseUrl.'?page=1', $json['links']['last']); } public function testFindPackage(): void { $packageId = Uuid::uuid4()->toString(); - $release = new \DateTimeImmutable('2020-01-01 12:12:12'); + $release = new DateTimeImmutable('2020-01-01 12:12:12'); $this->fixtures->createPackage($packageId, '', $this->organizationId); $this->fixtures ->syncPackageWithData( @@ -191,24 +190,22 @@ public function testFindPackage(): void $this->fixtures->addScanResult($packageId, 'ok'); $this->loginApiUser($this->apiToken); - $now = (new \DateTimeImmutable())->format(\DateTime::ATOM); - $this->client->request('GET', $this->urlTo('api_package_get', [ + $now = (new DateTimeImmutable())->format(DateTime::ATOM); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_package_get', [ 'organization' => self::$organization, 'package' => $packageId, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "id": "'.$packageId.'", "type": "vcs", "url": "https://github.com/buddy-works/repman", "name": "buddy-works/repman", "latestReleasedVersion": "2.1.1", - "latestReleaseDate": "'.$release->format(\DateTime::ATOM).'", + "latestReleaseDate": "'.$release->format(DateTime::ATOM).'", "description": "Repository manager", "enableSecurityScan": true, "lastSyncAt": "'.$now.'", @@ -222,19 +219,18 @@ public function testFindPackage(): void "composer.lock": [] } } - ' - ); + '); } public function testFindPackageNonExisting(): void { $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_package_get', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('api_package_get', [ 'organization' => self::$organization, 'package' => self::$fakeId, ])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testRemovePackage(): void @@ -243,18 +239,16 @@ public function testRemovePackage(): void $this->fixtures->createPackage($packageId, '', $this->organizationId); $this->loginApiUser($this->apiToken); - $this->client->request('DELETE', $this->urlTo('api_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_package_remove', [ 'organization' => self::$organization, 'package' => $packageId, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertTrue( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($packageId) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertTrue($this->container() + ->get(DbalPackageQuery::class) + ->getById($packageId) + ->isEmpty()); } public function testRemovePackageWhenBitbucketWebhookRemovalFailed(): void @@ -265,25 +259,23 @@ public function testRemovePackageWhenBitbucketWebhookRemovalFailed(): void $this->loginApiUser($this->apiToken); - $this->container()->get(BitbucketApi::class)->setExceptionOnNextCall(new \RuntimeException('Webhook already removed')); - $this->client->request('DELETE', $this->urlTo('api_package_remove', [ + $this->container()->get(BitbucketApi::class)->setExceptionOnNextCall(new RuntimeException('Webhook already removed')); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_package_remove', [ 'organization' => self::$organization, 'package' => $packageId, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertMatchesPattern(' + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertMatchesPattern(' { "warning": "@string@.contains(\'Webhook already removed\')" } ', (string) $this->client->getResponse()->getContent()); - self::assertTrue( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($packageId) - ->isEmpty() - ); + $this->assertTrue($this->container() + ->get(DbalPackageQuery::class) + ->getById($packageId) + ->isEmpty()); } public function testRemovePackageWhenGithubWebhookRemovalFailed(): void @@ -294,20 +286,20 @@ public function testRemovePackageWhenGithubWebhookRemovalFailed(): void $this->loginApiUser($this->apiToken); - $this->container()->get(GitHubApi::class)->setExceptionOnNextCall(new \RuntimeException('Webhook already removed')); - $this->client->request('DELETE', $this->urlTo('api_package_remove', [ + $this->container()->get(GitHubApi::class)->setExceptionOnNextCall(new RuntimeException('Webhook already removed')); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_package_remove', [ 'organization' => self::$organization, 'package' => $packageId, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertMatchesPattern(' + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertMatchesPattern(' { "warning": "@string@.contains(\'Webhook already removed\')" } ', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->container()->get(DbalPackageQuery::class)->getById($packageId)->isEmpty()); + $this->assertTrue($this->container()->get(DbalPackageQuery::class)->getById($packageId)->isEmpty()); } public function testRemovePackageWhenGitlabWebhookRemovalFailed(): void @@ -318,31 +310,31 @@ public function testRemovePackageWhenGitlabWebhookRemovalFailed(): void $this->loginApiUser($this->apiToken); - $this->container()->get(GitLabApi::class)->setExceptionOnNextCall(new \RuntimeException('Webhook already removed')); - $this->client->request('DELETE', $this->urlTo('api_package_remove', [ + $this->container()->get(GitLabApi::class)->setExceptionOnNextCall(new RuntimeException('Webhook already removed')); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_package_remove', [ 'organization' => self::$organization, 'package' => $packageId, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertMatchesPattern(' + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertMatchesPattern(' { "warning": "@string@.contains(\'Webhook already removed\')" } ', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->container()->get(DbalPackageQuery::class)->getById($packageId)->isEmpty()); + $this->assertTrue($this->container()->get(DbalPackageQuery::class)->getById($packageId)->isEmpty()); } public function testRemovePackageNonExisting(): void { $this->loginApiUser($this->apiToken); - $this->client->request('DELETE', $this->urlTo('api_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_package_remove', [ 'organization' => self::$organization, 'package' => self::$fakeId, ])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testSynchronizePackage(): void @@ -351,23 +343,23 @@ public function testSynchronizePackage(): void $this->fixtures->createPackage($packageId, '', $this->organizationId); $this->loginApiUser($this->apiToken); - $this->client->request('PUT', $this->urlTo('api_package_update', [ + $this->client->request(Request::METHOD_PUT, $this->urlTo('api_package_update', [ 'organization' => self::$organization, 'package' => $packageId, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testSynchronizePackageNonExisting(): void { $this->loginApiUser($this->apiToken); - $this->client->request('PUT', $this->urlTo('api_package_update', [ + $this->client->request(Request::METHOD_PUT, $this->urlTo('api_package_update', [ 'organization' => self::$organization, 'package' => self::$fakeId, ])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testUpdatePackage(): void @@ -376,7 +368,7 @@ public function testUpdatePackage(): void $this->fixtures->createPackage($packageId, '', $this->organizationId); $this->loginApiUser($this->apiToken); - $this->client->request('PATCH', $this->urlTo('api_package_update', [ + $this->client->request(Request::METHOD_PATCH, $this->urlTo('api_package_update', [ 'organization' => self::$organization, 'package' => $packageId, ]), [], [], [], (string) json_encode([ @@ -387,9 +379,9 @@ public function testUpdatePackage(): void $package = $this->container()->get(DbalPackageQuery::class)->getById($packageId)->get(); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertEquals($package->url(), 'new-url'); - self::assertEquals($package->keepLastReleases(), 6); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertSame('new-url', $package->url()); + $this->assertSame(6, $package->keepLastReleases()); } public function testUpdatePackageBadRequest(): void @@ -398,7 +390,7 @@ public function testUpdatePackageBadRequest(): void $this->fixtures->createPackage($packageId, '', $this->organizationId); $this->loginApiUser($this->apiToken); - $this->client->request('PATCH', $this->urlTo('api_package_update', [ + $this->client->request(Request::METHOD_PATCH, $this->urlTo('api_package_update', [ 'organization' => self::$organization, 'package' => $packageId, ]), [], [], [], (string) json_encode([ @@ -407,10 +399,8 @@ public function testUpdatePackageBadRequest(): void $package = $this->container()->get(DbalPackageQuery::class)->getById($packageId)->get(); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -419,55 +409,51 @@ public function testUpdatePackageBadRequest(): void } ] } - ' - ); - self::assertEquals($package->keepLastReleases(), 0); + '); + $this->assertSame(0, $package->keepLastReleases()); } public function testUpdatePackageNonExisting(): void { $this->loginApiUser($this->apiToken); - $this->client->request('PATCH', $this->urlTo('api_package_update', [ + $this->client->request(Request::METHOD_PATCH, $this->urlTo('api_package_update', [ 'organization' => self::$organization, 'package' => self::$fakeId, ])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testAddPackageByUrl(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => 'git', 'repository' => 'https://github.com/buddy/test-composer-package', ])); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertFalse( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($this->jsonResponse()['id']) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertFalse($this->container() + ->get(DbalPackageQuery::class) + ->getById($this->jsonResponse()['id']) + ->isEmpty()); } public function testAddPackageByPath(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => 'path', 'repository' => '/path/to/package', ])); - $now = (new \DateTimeImmutable())->format(\DateTime::ATOM); + $now = (new DateTimeImmutable())->format(DateTime::ATOM); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString($this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "id": "'.$this->jsonResponse()['id'].'", "type": "path", @@ -486,14 +472,11 @@ public function testAddPackageByPath(): void "scanResultDate": null, "lastScanResultContent": [] } - ' - ); - self::assertFalse( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($this->jsonResponse()['id']) - ->isEmpty() - ); + '); + $this->assertFalse($this->container() + ->get(DbalPackageQuery::class) + ->getById($this->jsonResponse()['id']) + ->isEmpty()); } public function testAddPackageFromGitHub(): void @@ -501,20 +484,18 @@ public function testAddPackageFromGitHub(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITHUB); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITHUB, 'repository' => 'buddy-works/repman', ])); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertFalse( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($this->jsonResponse()['id']) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertFalse($this->container() + ->get(DbalPackageQuery::class) + ->getById($this->jsonResponse()['id']) + ->isEmpty()); } public function testAddPackageMissingGitHubRepoName(): void @@ -522,16 +503,14 @@ public function testAddPackageMissingGitHubRepoName(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITHUB); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITHUB, ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -540,24 +519,21 @@ public function testAddPackageMissingGitHubRepoName(): void } ] } - ' - ); + '); } public function testAddPackageMissingGitHubIntegration(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITHUB, 'repository' => 'buddy-works/repman', ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -566,8 +542,7 @@ public function testAddPackageMissingGitHubIntegration(): void } ] } - ' - ); + '); } public function testAddPackageFromGitLab(): void @@ -575,20 +550,18 @@ public function testAddPackageFromGitLab(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITLAB); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITLAB, 'repository' => 'buddy-works/repman', ])); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertFalse( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($this->jsonResponse()['id']) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertFalse($this->container() + ->get(DbalPackageQuery::class) + ->getById($this->jsonResponse()['id']) + ->isEmpty()); } public function testAddPackageFromGitLabRepoNotFound(): void @@ -596,17 +569,15 @@ public function testAddPackageFromGitLabRepoNotFound(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITLAB); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITLAB, 'repository' => 'buddy-works/missing', ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -615,8 +586,7 @@ public function testAddPackageFromGitLabRepoNotFound(): void } ] } - ' - ); + '); } public function testAddPackageMissingGitLabRepoName(): void @@ -624,16 +594,14 @@ public function testAddPackageMissingGitLabRepoName(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITLAB); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITLAB, ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -642,24 +610,21 @@ public function testAddPackageMissingGitLabRepoName(): void } ] } - ' - ); + '); } public function testAddPackageMissingGitLabIntegration(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_GITLAB, 'repository' => 'buddy-works/repman', ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -668,8 +633,7 @@ public function testAddPackageMissingGitLabIntegration(): void } ] } - ' - ); + '); } public function testAddPackageFromBitbucket(): void @@ -677,20 +641,18 @@ public function testAddPackageFromBitbucket(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_BITBUCKET); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_BITBUCKET, 'repository' => 'buddy-works/repman', ])); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertFalse( - $this->container() - ->get(DbalPackageQuery::class) - ->getById($this->jsonResponse()['id']) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertFalse($this->container() + ->get(DbalPackageQuery::class) + ->getById($this->jsonResponse()['id']) + ->isEmpty()); } public function testAddPackageFromBitbucketRepoNotFound(): void @@ -698,17 +660,15 @@ public function testAddPackageFromBitbucketRepoNotFound(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_BITBUCKET); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_BITBUCKET, 'repository' => 'buddy-works/missing', ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -717,8 +677,7 @@ public function testAddPackageFromBitbucketRepoNotFound(): void } ] } - ' - ); + '); } public function testAddPackageMissingBitbucketRepoName(): void @@ -726,16 +685,14 @@ public function testAddPackageMissingBitbucketRepoName(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_BITBUCKET); $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_BITBUCKET, ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -744,24 +701,21 @@ public function testAddPackageMissingBitbucketRepoName(): void } ] } - ' - ); + '); } public function testAddPackageMissingBitbucketIntegration(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => OAuthToken::TYPE_BITBUCKET, 'repository' => 'buddy-works/repman', ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -770,22 +724,19 @@ public function testAddPackageMissingBitbucketIntegration(): void } ] } - ' - ); + '); } public function testAddPackageMissingType(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'repository' => 'www.url.com', ])); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -794,25 +745,22 @@ public function testAddPackageMissingType(): void } ] } - ' - ); + '); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testAddPackageInvalidType(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => 'invalid', 'repository' => 'www.url.com', ])); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -821,24 +769,21 @@ public function testAddPackageInvalidType(): void } ] } - ' - ); + '); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testAddPackageMissingUrl(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_package_add', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_package_add', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'type' => 'git', ])); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -847,10 +792,9 @@ public function testAddPackageMissingUrl(): void } ] } - ' - ); + '); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } /** diff --git a/tests/Functional/Controller/Api/TokenControllerTest.php b/tests/Functional/Controller/Api/TokenControllerTest.php index d11571a4..42904601 100644 --- a/tests/Functional/Controller/Api/TokenControllerTest.php +++ b/tests/Functional/Controller/Api/TokenControllerTest.php @@ -6,13 +6,16 @@ use Buddy\Repman\Query\Api\OrganizationQuery\DbalOrganizationQuery; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; final class TokenControllerTest extends FunctionalTestCase { private string $apiToken; + private string $organizationId; + private static string $organization = 'buddy'; protected function setUp(): void @@ -32,72 +35,72 @@ public function testTokensList(): void $this->fixtures->createToken($this->organizationId, 'test-list-value', 'test-list-name'); $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_tokens', ['organization' => self::$organization])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_tokens', ['organization' => self::$organization])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertCount(1, $json['data']); - self::assertEquals($json['data'][0]['name'], 'test-list-name'); - self::assertEquals($json['data'][0]['value'], 'test-list-value'); - self::assertNotEmpty($json['data'][0]['createdAt']); - self::assertEquals($json['data'][0]['lastUsedAt'], null); - self::assertEquals($json['total'], 1); - self::assertNotEmpty($json['links']); + $this->assertCount(1, $json['data']); + $this->assertSame('test-list-name', $json['data'][0]['name']); + $this->assertSame('test-list-value', $json['data'][0]['value']); + $this->assertNotEmpty($json['data'][0]['createdAt']); + $this->assertEquals($json['data'][0]['lastUsedAt'], null); + $this->assertSame(1, $json['total']); + $this->assertNotEmpty($json['links']); } public function testTokensListPagination(): void { for ($i = 1; $i <= 41; ++$i) { - $this->fixtures->createToken($this->organizationId, "test-list-value#$i", "test-list-name#$i"); + $this->fixtures->createToken($this->organizationId, 'test-list-value#'.$i, 'test-list-name#'.$i); } $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_tokens', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('api_tokens', [ 'organization' => self::$organization, 'page' => 2, ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertCount(20, $json['data']); - self::assertEquals($json['data'][0]['name'], 'test-list-name#28'); - self::assertEquals($json['data'][19]['name'], 'test-list-name#8'); + $this->assertCount(20, $json['data']); + $this->assertSame('test-list-name#28', $json['data'][0]['name']); + $this->assertSame('test-list-name#8', $json['data'][19]['name']); - self::assertEquals($json['total'], 41); + $this->assertSame(41, $json['total']); $baseUrl = $this->urlTo('api_tokens', ['organization' => self::$organization], UrlGeneratorInterface::ABSOLUTE_URL); - self::assertEquals($baseUrl.'?page=1', $json['links']['first']); - self::assertEquals($baseUrl.'?page=1', $json['links']['prev']); - self::assertEquals($baseUrl.'?page=3', $json['links']['next']); - self::assertEquals($baseUrl.'?page=3', $json['links']['last']); + $this->assertSame($baseUrl.'?page=1', $json['links']['first']); + $this->assertSame($baseUrl.'?page=1', $json['links']['prev']); + $this->assertSame($baseUrl.'?page=3', $json['links']['next']); + $this->assertSame($baseUrl.'?page=3', $json['links']['last']); } public function testEmptyTokensList(): void { $this->loginApiUser($this->apiToken); - $this->client->request('GET', $this->urlTo('api_tokens', ['organization' => self::$organization])); + $this->client->request(Request::METHOD_GET, $this->urlTo('api_tokens', ['organization' => self::$organization])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); $json = $this->jsonResponse(); - self::assertEquals($json['data'], []); - self::assertEquals($json['total'], 0); + $this->assertEquals($json['data'], []); + $this->assertSame(0, $json['total']); $baseUrl = $this->urlTo('api_tokens', ['organization' => self::$organization], UrlGeneratorInterface::ABSOLUTE_URL); - self::assertEquals($baseUrl.'?page=1', $json['links']['first']); - self::assertEquals(null, $json['links']['prev']); - self::assertEquals(null, $json['links']['next']); - self::assertEquals($baseUrl.'?page=1', $json['links']['last']); + $this->assertSame($baseUrl.'?page=1', $json['links']['first']); + $this->assertEquals(null, $json['links']['prev']); + $this->assertEquals(null, $json['links']['next']); + $this->assertSame($baseUrl.'?page=1', $json['links']['last']); } public function testGenerateToken(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_token_generate', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_token_generate', [ 'organization' => self::$organization, ]), [], [], [], (string) json_encode([ 'name' => 'new-token', @@ -105,41 +108,37 @@ public function testGenerateToken(): void $json = $this->jsonResponse(); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); - self::assertEquals($json['name'], 'new-token'); - self::assertNotEmpty($json['createdAt']); - self::assertNotEmpty($json['value']); - self::assertEquals($json['lastUsedAt'], null); - self::assertFalse( - $this->container() - ->get(DbalOrganizationQuery::class) - ->findToken($this->organizationId, $json['value']) - ->isEmpty() - ); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertSame('new-token', $json['name']); + $this->assertNotEmpty($json['createdAt']); + $this->assertNotEmpty($json['value']); + $this->assertEquals($json['lastUsedAt'], null); + $this->assertFalse($this->container() + ->get(DbalOrganizationQuery::class) + ->findToken($this->organizationId, $json['value']) + ->isEmpty()); } public function testInvalidJson(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_token_generate', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_token_generate', [ 'organization' => self::$organization, ]), [], [], [], 'invalid'); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testGenerateTokenBadRequest(): void { $this->loginApiUser($this->apiToken); - $this->client->request('POST', $this->urlTo('api_token_generate', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('api_token_generate', [ 'organization' => self::$organization, ])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); - self::assertJsonStringEqualsJsonString( - $this->lastResponseBody(), - ' + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertJsonStringEqualsJsonString($this->lastResponseBody(), ' { "errors": [ { @@ -148,8 +147,7 @@ public function testGenerateTokenBadRequest(): void } ] } - ' - ); + '); } public function testRemoveToken(): void @@ -157,18 +155,16 @@ public function testRemoveToken(): void $this->fixtures->createToken($this->organizationId, 'test-remove-value', 'test-remove-name'); $this->loginApiUser($this->apiToken); - $this->client->request('DELETE', $this->urlTo('api_token_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_token_remove', [ 'organization' => self::$organization, 'token' => 'test-remove-value', ])); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertTrue( - $this->container() - ->get(DbalOrganizationQuery::class) - ->findToken($this->organizationId, 'test-remove-value') - ->isEmpty() - ); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertTrue($this->container() + ->get(DbalOrganizationQuery::class) + ->findToken($this->organizationId, 'test-remove-value') + ->isEmpty()); } public function testRemoveTokenNonExisting(): void @@ -176,12 +172,12 @@ public function testRemoveTokenNonExisting(): void $this->fixtures->createToken($this->organizationId, 'test-remove-value', 'test-remove-name'); $this->loginApiUser($this->apiToken); - $this->client->request('DELETE', $this->urlTo('api_token_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('api_token_remove', [ 'organization' => self::$organization, 'token' => 'not exists', ])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testRegenerateToken(): void @@ -189,25 +185,22 @@ public function testRegenerateToken(): void $this->fixtures->createToken($this->organizationId, 'test-regenerate-value', 'test-regenerate-name'); $this->loginApiUser($this->apiToken); - $this->client->request('PUT', $this->urlTo('api_token_regenerate', [ + $this->client->request(Request::METHOD_PUT, $this->urlTo('api_token_regenerate', [ 'organization' => self::$organization, 'token' => 'test-regenerate-value', ])); $json = $this->jsonResponse(); - self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); - self::assertNotEquals( - $this->container() - ->get(DbalOrganizationQuery::class) - ->findTokenByName($this->organizationId, 'test-regenerate-name') - ->get() - ->getValue(), - 'test-regenerate-value' - ); - self::assertEquals($json['name'], 'test-regenerate-name'); - self::assertNotEmpty($json['createdAt']); - self::assertNotEmpty($json['value']); - self::assertEquals($json['lastUsedAt'], null); + $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertNotEquals($this->container() + ->get(DbalOrganizationQuery::class) + ->findTokenByName($this->organizationId, 'test-regenerate-name') + ->get() + ->getValue(), 'test-regenerate-value'); + $this->assertSame('test-regenerate-name', $json['name']); + $this->assertNotEmpty($json['createdAt']); + $this->assertNotEmpty($json['value']); + $this->assertEquals($json['lastUsedAt'], null); } public function testRegenerateTokenNonExisting(): void @@ -215,12 +208,12 @@ public function testRegenerateTokenNonExisting(): void $this->fixtures->createToken($this->organizationId, 'test-regenerate-value', 'test-regenerate-name'); $this->loginApiUser($this->apiToken); - $this->client->request('PUT', $this->urlTo('api_token_regenerate', [ + $this->client->request(Request::METHOD_PUT, $this->urlTo('api_token_regenerate', [ 'organization' => self::$organization, 'token' => 'not exists', ])); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } /** diff --git a/tests/Functional/Controller/IndexControllerTest.php b/tests/Functional/Controller/IndexControllerTest.php index 6ebefef6..491c8b93 100644 --- a/tests/Functional/Controller/IndexControllerTest.php +++ b/tests/Functional/Controller/IndexControllerTest.php @@ -5,23 +5,24 @@ namespace Buddy\Repman\Tests\Functional\Controller; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; use function Ramsey\Uuid\v4; final class IndexControllerTest extends FunctionalTestCase { public function testHomePage(): void { - $this->client->request('GET', $this->urlTo('index')); + $this->client->request(Request::METHOD_GET, $this->urlTo('index')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); } public function testHomePageWhenLogged(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('index')); + $this->client->request(Request::METHOD_GET, $this->urlTo('index')); - self::assertStringContainsString('repman-io/composer-plugin', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('repman-io/composer-plugin', (string) $this->client->getResponse()->getContent()); } public function testRedirectToInvitationWhenTokenExist(): void @@ -31,11 +32,11 @@ public function testRedirectToInvitationWhenTokenExist(): void $this->client->disableReboot(); // start new session - $this->client->request('GET', $this->urlTo('index')); + $this->client->request(Request::METHOD_GET, $this->urlTo('index')); $this->client->getRequest()->getSession()->set('organization-token', $token); - $this->client->request('GET', $this->urlTo('index')); + $this->client->request(Request::METHOD_GET, $this->urlTo('index')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_accept_invitation', [ + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_accept_invitation', [ 'token' => $token, ]))); } diff --git a/tests/Functional/Controller/OAuth/BitbucketControllerTest.php b/tests/Functional/Controller/OAuth/BitbucketControllerTest.php index dc9f559b..c6a217da 100644 --- a/tests/Functional/Controller/OAuth/BitbucketControllerTest.php +++ b/tests/Functional/Controller/OAuth/BitbucketControllerTest.php @@ -10,160 +10,161 @@ use Buddy\Repman\Tests\Functional\FunctionalTestCase; use GuzzleHttp\Psr7\Response; use KnpU\OAuth2ClientBundle\Exception\MissingAuthorizationCodeException; +use Symfony\Component\HttpFoundation\Request; final class BitbucketControllerTest extends FunctionalTestCase { public function testStartRegisterWithBitbucket(): void { - $this->client->request('GET', $this->urlTo('register_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('bitbucket.org', (string) $response->headers->get('location')); + $this->assertStringContainsString('bitbucket.org', (string) $response->headers->get('location')); } public function testStartAuthWithBitbucket(): void { - $this->client->request('GET', $this->urlTo('auth_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_bitbucket_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('bitbucket.org', (string) $response->headers->get('location')); + $this->assertStringContainsString('bitbucket.org', (string) $response->headers->get('location')); } public function testRedirectToIndexWhenAlreadyLogged(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('register_bitbucket_check')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_check')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); } public function testLoginUserIfAlreadyExist(): void { $this->fixtures->createUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_bitbucket_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BitbucketOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); $this->client->followRedirect(); - self::assertStringContainsString('Your account already exists', $this->lastResponseBody()); + $this->assertStringContainsString('Your account already exists', $this->lastResponseBody()); } public function testCreateUserIfNotExists(): void { $email = 'test@buddy.works'; - $this->client->request('GET', $this->urlTo('auth_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_bitbucket_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BitbucketOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'bitbucket']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'bitbucket']))); $this->client->followRedirect(); - self::assertStringContainsString('Your account has been created', $this->lastResponseBody()); + $this->assertStringContainsString('Your account has been created', $this->lastResponseBody()); } public function testSuccessfulLoginWithBitbucket(): void { $this->fixtures->createOAuthUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_bitbucket_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BitbucketOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('login_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('login_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirect(); - self::assertStringContainsString('test@buddy.works', $this->lastResponseBody()); + $this->assertStringContainsString('test@buddy.works', $this->lastResponseBody()); } public function testDisplayErrorIfSomethingGoesWrongDuringRegister(): void { - $this->client->request('GET', $this->urlTo('register_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); $this->container()->get(HttpClientStub::class)->setNextResponses([new Response(200, [], '{"error_description":"invalid scope provided"}')]); - $this->client->request('GET', $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); $this->client->followRedirect(); - self::assertStringContainsString('invalid scope provided', $this->lastResponseBody()); + $this->assertStringContainsString('invalid scope provided', $this->lastResponseBody()); } public function testDisplayErrorIfMissingAuthorizationCodeExceptionIsThrow(): void { - $this->client->request('GET', $this->urlTo('register_bitbucket_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BitbucketOAuth::mockAccessTokenResponse('whatever@repman.io', $this->container()); $this->container()->get(BitbucketApi::class)->setExceptionOnNextCall(new MissingAuthorizationCodeException()); - $this->client->request('GET', $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); $this->client->followRedirect(); - self::assertStringContainsString('Authentication failed! Did you authorize our app?', $this->lastResponseBody()); + $this->assertStringContainsString('Authentication failed! Did you authorize our app?', $this->lastResponseBody()); } public function testAddOAuthTokenToUser(): void { $userId = $this->createAndLoginAdmin($email = 'test@buddy.works'); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BitbucketOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('package_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('package_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testHandleOAuthErrorDuringTokenFetching(): void { $userId = $this->createAndLoginAdmin($email = 'test@buddy.works'); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BitbucketOAuth::mockInvalidAccessTokenResponse($error = 'Bitbucket is down, we are sorry :(', $this->container()); - $this->client->request('GET', $this->urlTo('package_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('package_bitbucket_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy']))); $this->client->followRedirect(); - self::assertStringContainsString($error, $this->lastResponseBody()); + $this->assertStringContainsString($error, $this->lastResponseBody()); } public function testAddPackageFromBitbucketWithoutToken(): void { $userId = $this->createAndLoginAdmin(); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); - self::assertStringContainsString('bitbucket.org', (string) $this->client->getResponse()->headers->get('Location')); + $this->assertStringContainsString('bitbucket.org', (string) $this->client->getResponse()->headers->get('Location')); } public function testAddPackageFromBitbucketWithToken(): void @@ -172,13 +173,11 @@ public function testAddPackageFromBitbucketWithToken(): void $this->fixtures->createOrganization('buddy', $userId); $this->fixtures->createOauthToken($userId, 'bitbucket'); - $this->client->request('GET', $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket']))); } /** diff --git a/tests/Functional/Controller/OAuth/BuddyControllerTest.php b/tests/Functional/Controller/OAuth/BuddyControllerTest.php index 5073dbbc..24a885d5 100644 --- a/tests/Functional/Controller/OAuth/BuddyControllerTest.php +++ b/tests/Functional/Controller/OAuth/BuddyControllerTest.php @@ -8,98 +8,99 @@ use Buddy\Repman\Tests\Doubles\HttpClientStub; use Buddy\Repman\Tests\Functional\FunctionalTestCase; use GuzzleHttp\Psr7\Response; +use Symfony\Component\HttpFoundation\Request; final class BuddyControllerTest extends FunctionalTestCase { public function testStartRegisterWithBuddy(): void { - $this->client->request('GET', $this->urlTo('register_buddy_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('buddy.works', (string) $response->headers->get('location')); + $this->assertStringContainsString('buddy.works', (string) $response->headers->get('location')); } public function testStartAuthWithBuddy(): void { - $this->client->request('GET', $this->urlTo('auth_buddy_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_buddy_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('buddy.works', (string) $response->headers->get('location')); + $this->assertStringContainsString('buddy.works', (string) $response->headers->get('location')); } public function testRedirectToIndexWhenAlreadyLogged(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('register_buddy_check')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_check')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); } public function testLoginUserIfAlreadyExist(): void { $this->fixtures->createUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_buddy_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_buddy_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BuddyOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('register_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); $this->client->followRedirect(); - self::assertStringContainsString('Your account already exists', $this->lastResponseBody()); + $this->assertStringContainsString('Your account already exists', $this->lastResponseBody()); } public function testCreateUserIfNotExists(): void { $email = 'test@buddy.works'; - $this->client->request('GET', $this->urlTo('auth_buddy_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_buddy_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BuddyOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('register_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'buddy']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'buddy']))); $this->client->followRedirect(); - self::assertStringContainsString('Your account has been created', $this->lastResponseBody()); + $this->assertStringContainsString('Your account has been created', $this->lastResponseBody()); } public function testSuccessfulLoginWithBuddy(): void { $this->fixtures->createOAuthUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_buddy_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_buddy_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); BuddyOAuth::mockAccessTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('login_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('login_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirect(); - self::assertStringContainsString('test@buddy.works', $this->lastResponseBody()); + $this->assertStringContainsString('test@buddy.works', $this->lastResponseBody()); } public function testDisplayErrorIfSomethingGoesWrongDuringRegister(): void { - $this->client->request('GET', $this->urlTo('register_buddy_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); $this->container()->get(HttpClientStub::class)->setNextResponses([new Response(200, [], '{"errors":[{"message":"invalid scope provided"}]}')]); - $this->client->request('GET', $this->urlTo('register_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_buddy_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); $this->client->followRedirect(); - self::assertStringContainsString('invalid scope provided', $this->lastResponseBody()); + $this->assertStringContainsString('invalid scope provided', $this->lastResponseBody()); } /** diff --git a/tests/Functional/Controller/OAuth/GitHubControllerTest.php b/tests/Functional/Controller/OAuth/GitHubControllerTest.php index d8234da2..a657acb5 100644 --- a/tests/Functional/Controller/OAuth/GitHubControllerTest.php +++ b/tests/Functional/Controller/OAuth/GitHubControllerTest.php @@ -8,131 +8,132 @@ use Buddy\Repman\Tests\Doubles\HttpClientStub; use Buddy\Repman\Tests\Functional\FunctionalTestCase; use GuzzleHttp\Psr7\Response; +use Symfony\Component\HttpFoundation\Request; final class GitHubControllerTest extends FunctionalTestCase { public function testStartRegisterWithGitHub(): void { - $this->client->request('GET', $this->urlTo('register_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('github.com', (string) $response->headers->get('location')); + $this->assertStringContainsString('github.com', (string) $response->headers->get('location')); } public function testStartAuthWithGitHub(): void { - $this->client->request('GET', $this->urlTo('auth_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_github_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('github.com', (string) $response->headers->get('location')); + $this->assertStringContainsString('github.com', (string) $response->headers->get('location')); } public function testRedirectToIndexWhenAlreadyLogged(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('register_github_check')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_check')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); } public function testLoginUserIfAlreadyExist(): void { $this->fixtures->createUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_github_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); GitHubOAuth::mockTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('register_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); $this->client->followRedirect(); - self::assertStringContainsString('Your account already exists', $this->lastResponseBody()); + $this->assertStringContainsString('Your account already exists', $this->lastResponseBody()); } public function testCreateUserIfNotExistsExist(): void { $email = 'test@buddy.works'; - $this->client->request('GET', $this->urlTo('auth_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_github_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); GitHubOAuth::mockTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('register_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'github']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'github']))); $this->client->followRedirect(); - self::assertStringContainsString('Your account has been created', $this->lastResponseBody()); + $this->assertStringContainsString('Your account has been created', $this->lastResponseBody()); } public function testSuccessfulLoginWithGithub(): void { $this->fixtures->createOAuthUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_github_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); GitHubOAuth::mockTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('login_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('login_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirect(); - self::assertStringContainsString('test@buddy.works', $this->lastResponseBody()); + $this->assertStringContainsString('test@buddy.works', $this->lastResponseBody()); } public function testRedirectToRequestedPathOnSuccessfulLoginWithGitHub(): void { $this->fixtures->createOAuthUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_github_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); GitHubOAuth::mockTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('user_profile')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_profile')); - $this->client->request('GET', $this->urlTo('login_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('login_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); // authenticator user $targetPath, so in test env localhost will be added to url - self::assertTrue($this->client->getResponse()->isRedirect('http://localhost/user')); + $this->assertTrue($this->client->getResponse()->isRedirect('http://localhost/user')); } public function testDisplayErrorIfSomethingGoesWrongDuringRegister(): void { - $this->client->request('GET', $this->urlTo('register_github_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); $this->container()->get(HttpClientStub::class)->setNextResponses([new Response(200, [], '{"error":"invalid scope provided"}')]); - $this->client->request('GET', $this->urlTo('register_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); $this->client->followRedirect(); - self::assertStringContainsString('invalid scope provided', $this->lastResponseBody()); + $this->assertStringContainsString('invalid scope provided', $this->lastResponseBody()); } public function testAddOAuthTokenToUser(): void { $userId = $this->createAndLoginAdmin($email = 'test@buddy.works'); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); GitHubOAuth::mockTokenResponse($email, $this->container()); - $this->client->request('GET', $this->urlTo('package_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('package_github_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testAddPackageFromGithubWithoutToken(): void @@ -140,12 +141,9 @@ public function testAddPackageFromGithubWithoutToken(): void $userId = $this->createAndLoginAdmin(); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])); - self::assertStringContainsString( - 'https://github.com/login/oauth/authorize?redirect_uri', - (string) $this->client->getResponse()->headers->get('Location') - ); + $this->assertStringContainsString('https://github.com/login/oauth/authorize?redirect_uri', (string) $this->client->getResponse()->headers->get('Location')); } public function testAddPackageFromGithubWithToken(): void @@ -154,13 +152,11 @@ public function testAddPackageFromGithubWithToken(): void $this->fixtures->createOrganization('buddy', $userId); $this->fixtures->createOauthToken($userId, 'github'); - $this->client->request('GET', $this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github']))); } /** diff --git a/tests/Functional/Controller/OAuth/GitLabControllerTest.php b/tests/Functional/Controller/OAuth/GitLabControllerTest.php index 78226726..36de49b7 100644 --- a/tests/Functional/Controller/OAuth/GitLabControllerTest.php +++ b/tests/Functional/Controller/OAuth/GitLabControllerTest.php @@ -8,120 +8,121 @@ use Buddy\Repman\Tests\Doubles\HttpClientStub; use Buddy\Repman\Tests\Functional\FunctionalTestCase; use GuzzleHttp\Psr7\Response; +use Symfony\Component\HttpFoundation\Request; final class GitLabControllerTest extends FunctionalTestCase { public function testStartRegisterWithGitLab(): void { - $this->client->request('GET', $this->urlTo('register_gitlab_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('gitlab.com', (string) $response->headers->get('location')); + $this->assertStringContainsString('gitlab.com', (string) $response->headers->get('location')); } public function testStartAuthWithGitLab(): void { - $this->client->request('GET', $this->urlTo('auth_gitlab_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_gitlab_start')); $response = $this->client->getResponse(); - self::assertStringContainsString('gitlab.com', (string) $response->headers->get('location')); + $this->assertStringContainsString('gitlab.com', (string) $response->headers->get('location')); } public function testRedirectToIndexWhenAlreadyLogged(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('register_gitlab_check')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_check')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); } public function testLoginUserIfAlreadyExist(): void { $this->fixtures->createUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_gitlab_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_gitlab_start')); $params = $this->getQueryParamsFromLastResponse(); $this->mockTokenAndUserResponse($email); - $this->client->request('GET', $this->urlTo('register_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); $this->client->followRedirect(); - self::assertStringContainsString('Your account already exists', $this->lastResponseBody()); + $this->assertStringContainsString('Your account already exists', $this->lastResponseBody()); } public function testCreateUserIfNotExistsExist(): void { $email = 'test@buddy.works'; - $this->client->request('GET', $this->urlTo('auth_gitlab_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_gitlab_start')); $params = $this->getQueryParamsFromLastResponse(); $this->mockTokenAndUserResponse($email); - $this->client->request('GET', $this->urlTo('register_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'gitlab']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create', ['origin' => 'gitlab']))); $this->client->followRedirect(); - self::assertStringContainsString('Your account has been created', $this->lastResponseBody()); + $this->assertStringContainsString('Your account has been created', $this->lastResponseBody()); } public function testSuccessfulLoginWithGitLab(): void { $this->fixtures->createOAuthUser($email = 'test@buddy.works'); - $this->client->request('GET', $this->urlTo('auth_gitlab_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('auth_gitlab_start')); $params = $this->getQueryParamsFromLastResponse(); $this->mockTokenAndUserResponse($email); - $this->client->request('GET', $this->urlTo('login_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('login_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirect(); - self::assertStringContainsString('test@buddy.works', $this->lastResponseBody()); + $this->assertStringContainsString('test@buddy.works', $this->lastResponseBody()); } public function testDisplayErrorIfSomethingGoesWrongDuringRegister(): void { - $this->client->request('GET', $this->urlTo('register_gitlab_start')); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_start')); $params = $this->getQueryParamsFromLastResponse(); $this->client->disableReboot(); $this->container()->get(HttpClientStub::class)->setNextResponses([new Response(200, [], '{"error":"invalid scope provided"}')]); - $this->client->request('GET', $this->urlTo('register_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('register_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_register'))); $this->client->followRedirect(); - self::assertStringContainsString('invalid scope provided', $this->lastResponseBody()); + $this->assertStringContainsString('invalid scope provided', $this->lastResponseBody()); } public function testAddOAuthTokenToUser(): void { $userId = $this->createAndLoginAdmin($email = 'test@buddy.works'); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])); $params = $this->getQueryParamsFromLastResponse(); $this->mockTokenAndUserResponse($email); - $this->client->request('GET', $this->urlTo('package_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('package_gitlab_check', ['state' => $params['state'], 'code' => 'secret-token'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testAddPackageFromGitLabWithoutToken(): void { $userId = $this->createAndLoginAdmin(); $this->fixtures->createOrganization('buddy', $userId); - $this->client->request('GET', $this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])); - self::assertStringContainsString('gitlab.com', (string) $this->client->getResponse()->headers->get('Location')); + $this->assertStringContainsString('gitlab.com', (string) $this->client->getResponse()->headers->get('Location')); } public function testAddPackageFromGitLabWithToken(): void @@ -130,13 +131,11 @@ public function testAddPackageFromGitLabWithToken(): void $this->fixtures->createOrganization('buddy', $userId); $this->fixtures->createOauthToken($userId, 'gitlab'); - $this->client->request('GET', $this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab']))); } /** diff --git a/tests/Functional/Controller/Organization/MemberControllerTest.php b/tests/Functional/Controller/Organization/MemberControllerTest.php index ed75deea..07b11e15 100644 --- a/tests/Functional/Controller/Organization/MemberControllerTest.php +++ b/tests/Functional/Controller/Organization/MemberControllerTest.php @@ -6,10 +6,12 @@ use Buddy\Repman\Entity\Organization\Member; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; final class MemberControllerTest extends FunctionalTestCase { private string $userId; + private string $organizationId; protected function setUp(): void @@ -21,38 +23,34 @@ protected function setUp(): void public function testInviteMember(): void { - $this->client->request('GET', $this->urlTo('organization_invite_member', ['organization' => 'repman'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_invite_member', ['organization' => 'repman'])); + $this->assertTrue($this->client->getResponse()->isOk()); $this->client->submitForm('Invite', [ 'email' => 'some@buddy.works', 'role' => Member::ROLE_MEMBER, ]); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_invitations', ['organization' => 'repman'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_invitations', ['organization' => 'repman']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('User "some@buddy.works" has been successfully invited', (string) $this->client->getResponse()->getContent()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('User "some@buddy.works" has been successfully invited', (string) $this->client->getResponse()->getContent()); } public function testRemoveInvitation(): void { $this->fixtures->inviteUser($this->organizationId, 'some@buddy.works', $token = '04550fd6-47d1-491f-84d6-227d4a1a38e8'); - $this->client->request('DELETE', $this->urlTo('organization_remove_invitation', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_remove_invitation', [ 'organization' => 'repman', 'token' => $token, ])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_invitations', ['organization' => 'repman'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_invitations', ['organization' => 'repman']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('The invitation has been deleted', (string) $this->client->getResponse()->getContent()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('The invitation has been deleted', (string) $this->client->getResponse()->getContent()); } public function testAcceptInvitation(): void @@ -61,11 +59,9 @@ public function testAcceptInvitation(): void $this->fixtures->inviteUser($this->organizationId, 'some@buddy.works', $token = '04550fd6-47d1-491f-84d6-227d4a1a38e8'); $this->loginUser($email, $password); - $this->client->request('GET', $this->urlTo('organization_accept_invitation', ['token' => $token])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_accept_invitation', ['token' => $token])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_overview', ['organization' => 'repman'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_overview', ['organization' => 'repman']))); } public function testRedirectOnAcceptInvitationWhenNotLogged(): void @@ -74,81 +70,73 @@ public function testRedirectOnAcceptInvitationWhenNotLogged(): void $this->fixtures->inviteUser($this->organizationId, 'some@buddy.works', $token = '04550fd6-47d1-491f-84d6-227d4a1a38e8'); $this->logoutCurrentUser(); - $this->client->request('GET', $this->urlTo('organization_accept_invitation', ['token' => $token])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_accept_invitation', ['token' => $token])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); } public function testLogoutUserOnInvalidInvitation(): void { $this->fixtures->createUser($email = 'some@buddy.works', $password = 'secret123'); $this->loginUser($email, $password); - $this->client->request('GET', $this->urlTo('organization_accept_invitation', ['token' => '5d1dbd54-f231-48e6-9d24-9989362d812a'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_accept_invitation', ['token' => '5d1dbd54-f231-48e6-9d24-9989362d812a'])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('app_login')) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirects(); $this->client->followRedirect(); - self::assertStringContainsString('Invitation not found or belongs to different user', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Invitation not found or belongs to different user', (string) $this->client->getResponse()->getContent()); } public function testRemoveMember(): void { $userId = $this->fixtures->addAcceptedMember($this->organizationId, $email = 'some@buddy.works'); - $this->client->request('GET', $this->urlTo('organization_members', ['organization' => 'repman'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_members', ['organization' => 'repman'])); - self::assertStringContainsString($email, $this->lastResponseBody()); + $this->assertStringContainsString($email, $this->lastResponseBody()); - $this->client->request('DELETE', $this->urlTo('organization_remove_member', ['organization' => 'repman', 'member' => $userId])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_members', ['organization' => 'repman'])) - ); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_remove_member', ['organization' => 'repman', 'member' => $userId])); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_members', ['organization' => 'repman']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Member "some@buddy.works" has been removed from organization', (string) $this->client->getResponse()->getContent()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Member "some@buddy.works" has been removed from organization', (string) $this->client->getResponse()->getContent()); } public function testPreventRemoveLastOwner(): void { - $this->client->request('DELETE', $this->urlTo('organization_remove_member', ['organization' => 'repman', 'member' => $this->userId])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_members', ['organization' => 'repman'])) - ); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_remove_member', ['organization' => 'repman', 'member' => $this->userId])); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_members', ['organization' => 'repman']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Member "test@buddy.works" cannot be removed. Organisation must have at least one owner.', (string) $this->client->getResponse()->getContent()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Member "test@buddy.works" cannot be removed. Organisation must have at least one owner.', (string) $this->client->getResponse()->getContent()); } public function testChangeMemberRole(): void { $userId = $this->fixtures->addAcceptedMember($this->organizationId, $email = 'some@buddy.works', Member::ROLE_MEMBER); - $this->client->request('GET', $this->urlTo('organization_change_member_role', ['organization' => 'repman', 'member' => $userId])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_change_member_role', ['organization' => 'repman', 'member' => $userId])); $this->client->submitForm('Change role', [ 'role' => Member::ROLE_OWNER, ]); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_members', ['organization' => 'repman'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_members', ['organization' => 'repman']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Member "some@buddy.works" role has been successfully changed', (string) $this->client->getResponse()->getContent()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Member "some@buddy.works" role has been successfully changed', (string) $this->client->getResponse()->getContent()); } public function testPreventChangeLastOwnerRole(): void { - $this->client->request('GET', $this->urlTo('organization_change_member_role', ['organization' => 'repman', 'member' => $this->userId])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_change_member_role', ['organization' => 'repman', 'member' => $this->userId])); $this->client->submitForm('Change role', [ 'role' => Member::ROLE_MEMBER, ]); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('The role cannot be downgraded. Organisation must have at least one owner.', (string) $this->client->getResponse()->getContent()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('The role cannot be downgraded. Organisation must have at least one owner.', (string) $this->client->getResponse()->getContent()); } } diff --git a/tests/Functional/Controller/Organization/PackageControllerTest.php b/tests/Functional/Controller/Organization/PackageControllerTest.php index 05011b80..ac64c18d 100644 --- a/tests/Functional/Controller/Organization/PackageControllerTest.php +++ b/tests/Functional/Controller/Organization/PackageControllerTest.php @@ -10,7 +10,10 @@ use Buddy\Repman\Message\Security\ScanPackage; use Buddy\Repman\Service\Integration\GitHubApi; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; use Github\Exception\ApiLimitExceedException; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Messenger\Transport\InMemoryTransport; final class PackageControllerTest extends FunctionalTestCase @@ -26,53 +29,49 @@ protected function setUp(): void public function testAddPackage(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'git'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'git'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $this->client->submitForm('Add', [ 'url' => 'http://github.com/test/test', 'type' => 'git', ]); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy']))); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(1, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertCount(1, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); $this->client->followRedirect(); - self::assertStringContainsString('Packages has been added', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Packages has been added', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testAddPackageFromPath(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'path'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'path'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $this->client->submitForm('Add', [ 'url' => '/path/to/package', 'type' => 'path', ]); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy']))); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(1, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertCount(1, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); $this->client->followRedirect(); - self::assertStringContainsString('Packages has been added', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Packages has been added', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testHandleErrorWhenFetchingRepositories(): void @@ -80,9 +79,9 @@ public function testHandleErrorWhenFetchingRepositories(): void $this->fixtures->createOrganization('buddy', $this->userId); $this->fixtures->createOauthToken($this->userId, 'github'); $this->container()->get(GitHubApi::class)->setExceptionOnNextCall(new ApiLimitExceedException()); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])); - self::assertStringContainsString('Failed to fetch repositories (reason: You have reached GitHub hourly limit!', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Failed to fetch repositories (reason: You have reached GitHub hourly limit!', (string) $this->client->getResponse()->getContent()); } public function testNewPackageFromGithub(): void @@ -90,40 +89,36 @@ public function testNewPackageFromGithub(): void $this->fixtures->createOrganization('buddy', $this->userId); $this->fixtures->createOauthToken($this->userId, 'github'); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])); $this->client->submitForm('Add', [ 'repositories' => ['buddy/repman'], ]); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy']))); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(2, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); - self::assertInstanceOf(AddGitHubHook::class, $transport->getSent()[1]->getMessage()); + $this->assertCount(2, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertInstanceOf(AddGitHubHook::class, $transport->getSent()[1]->getMessage()); $this->client->followRedirect(); - self::assertStringContainsString('Packages has been added and will be synchronized in the background', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Packages has been added and will be synchronized in the background', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testNewPackageFromGitHubWithoutToken(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'github'])); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('fetch_github_package_token', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('fetch_github_package_token', ['organization' => 'buddy']))); } public function testNewPackageFromGitLab(): void @@ -131,39 +126,35 @@ public function testNewPackageFromGitLab(): void $this->fixtures->createOrganization('buddy', $this->userId); $this->fixtures->createOauthToken($this->userId, 'gitlab'); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab'])); $this->client->submitForm('Add', [ 'repositories' => [123456], ]); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy']))); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(2, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); - self::assertInstanceOf(AddGitLabHook::class, $transport->getSent()[1]->getMessage()); + $this->assertCount(2, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertInstanceOf(AddGitLabHook::class, $transport->getSent()[1]->getMessage()); $this->client->followRedirect(); - self::assertStringContainsString('Packages has been added and will be synchronized in the background', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Packages has been added and will be synchronized in the background', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testNewPackageFromGitLabWithoutToken(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'gitlab'])); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('fetch_gitlab_package_token', ['organization' => 'buddy']))); } public function testNewPackageFromBitbucket(): void @@ -171,47 +162,43 @@ public function testNewPackageFromBitbucket(): void $this->fixtures->createOrganization('buddy', $this->userId); $this->fixtures->createOauthToken($this->userId, 'bitbucket'); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket'])); $this->client->submitForm('Add', [ 'repositories' => ['{0f6dc6fe-f8ab-4a53-bb63-03042b80056f}'], ]); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy']))); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(2, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); - self::assertInstanceOf(AddBitbucketHook::class, $transport->getSent()[1]->getMessage()); + $this->assertCount(2, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertInstanceOf(AddBitbucketHook::class, $transport->getSent()[1]->getMessage()); $this->client->followRedirect(); - self::assertStringContainsString('Packages has been added and will be synchronized in the background', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Packages has been added and will be synchronized in the background', (string) $this->client->getResponse()->getContent()); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testNewPackageFromBitbucketWithoutToken(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bitbucket'])); - self::assertTrue( - $this->client - ->getResponse() - ->isRedirect($this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client + ->getResponse() + ->isRedirect($this->urlTo('fetch_bitbucket_package_token', ['organization' => 'buddy']))); } public function testNewPackageUnsupportedType(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bogus'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_new', ['organization' => 'buddy', 'type' => 'bogus'])); - self::assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testUpdatePackage(): void @@ -219,46 +206,44 @@ public function testUpdatePackage(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->client->request('POST', $this->urlTo('organization_package_update', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_package_update', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertTrue($this->client->getResponse()->isRedirect( + $this->assertTrue($this->client->getResponse()->isRedirect( $this->urlTo('organization_packages', ['organization' => 'buddy']) )); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/repman', 'Repository manager', '2.1.1', new \DateTimeImmutable('2020-01-01 12:12:12')); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/repman', 'Repository manager', '2.1.1', new DateTimeImmutable('2020-01-01 12:12:12')); $this->client->followRedirect(); - self::assertStringContainsString('Package will be synchronized in the background', $this->lastResponseBody()); - self::assertStringContainsString('buddy-works/repman', $this->lastResponseBody()); - self::assertStringContainsString('2.1.1', $this->lastResponseBody()); + $this->assertStringContainsString('Package will be synchronized in the background', $this->lastResponseBody()); + $this->assertStringContainsString('buddy-works/repman', $this->lastResponseBody()); + $this->assertStringContainsString('2.1.1', $this->lastResponseBody()); } public function testEditPackage(): void { $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); - $this->client->request('GET', $this->urlTo('organization_package_edit', ['organization' => 'buddy', 'package' => $packageId])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_edit', ['organization' => 'buddy', 'package' => $packageId])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $this->client->submitForm('Update', [ 'url' => 'http://github.com/test/test', 'keepLastReleases' => '6', ]); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_packages', ['organization' => 'buddy']))); $this->client->followRedirect(); - self::assertStringContainsString('Package will be synchronized in the background', $this->lastResponseBody()); - self::assertStringContainsString('http://github.com/test/test', $this->lastResponseBody()); + $this->assertStringContainsString('Package will be synchronized in the background', $this->lastResponseBody()); + $this->assertStringContainsString('http://github.com/test/test', $this->lastResponseBody()); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } } diff --git a/tests/Functional/Controller/OrganizationControllerTest.php b/tests/Functional/Controller/OrganizationControllerTest.php index 7d4ebc6a..fe476620 100644 --- a/tests/Functional/Controller/OrganizationControllerTest.php +++ b/tests/Functional/Controller/OrganizationControllerTest.php @@ -11,12 +11,19 @@ use Buddy\Repman\Query\User\Model\Package\Link; use Buddy\Repman\Query\User\OrganizationQuery\DbalOrganizationQuery; use Buddy\Repman\Query\User\PackageQuery; +use Buddy\Repman\Query\User\PackageQuery\Filter; use Buddy\Repman\Repository\OrganizationRepository; use Buddy\Repman\Service\Integration\BitbucketApi; use Buddy\Repman\Service\Integration\GitHubApi; use Buddy\Repman\Service\Organization\TokenGenerator; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateInterval; +use DateTimeImmutable; +use Generator; use Ramsey\Uuid\Uuid; +use RuntimeException; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Messenger\Transport\InMemoryTransport; use function Ramsey\Uuid\v4; @@ -32,71 +39,71 @@ protected function setUp(): void public function testSuccessfulCreate(): void { - $this->client->request('GET', $this->urlTo('organization_create')); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_create')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Create a new organization', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Create a new organization', $this->lastResponseBody()); $this->client->submitForm('Create a new organization', ['name' => 'Acme Inc.']); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_overview', ['organization' => 'acme-inc']))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_overview', ['organization' => 'acme-inc']))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Organization "Acme Inc." has been created', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Organization "Acme Inc." has been created', $this->lastResponseBody()); } public function testNameCantBeEmpty(): void { - $this->client->request('GET', $this->urlTo('organization_create')); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_create')); $this->client->followRedirects(); $this->client->submitForm('Create a new organization', ['name' => '']); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('This value should not be blank', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('This value should not be blank', $this->lastResponseBody()); } public function testInvalidName(): void { - $this->client->request('GET', $this->urlTo('organization_create')); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_create')); $this->client->followRedirects(); $this->client->submitForm('Create a new organization', ['name' => '!@#']); // only special chars - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Name cannot consist of special characters only.', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Name cannot consist of special characters only.', $this->lastResponseBody()); } public function testUniqueness(): void { - $this->client->request('GET', $this->urlTo('organization_create')); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_create')); $this->client->followRedirects(); $this->client->submitForm('Create a new organization', ['name' => 'same']); - $this->client->request('GET', $this->urlTo('organization_create')); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_create')); $this->client->submitForm('Create a new organization', ['name' => 'same']); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Organization "same" already exists', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Organization "same" already exists', $this->lastResponseBody()); } public function testOverview(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_overview', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_overview', ['organization' => 'buddy'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testOverviewNotAllowedForNotOwnedOrganization(): void { $otherId = $this->fixtures->createAdmin('cto@buddy.works', 'strong'); $this->fixtures->createOrganization('buddy', $otherId); - $this->client->request('GET', $this->urlTo('organization_overview', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_overview', ['organization' => 'buddy'])); - self::assertTrue($this->client->getResponse()->isForbidden()); + $this->assertTrue($this->client->getResponse()->isForbidden()); } public function testPackageList(): void @@ -109,14 +116,11 @@ public function testPackageList(): void $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $this->fixtures->addPackage($anotherOrgId, 'https://google.com'); - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString( - '1 entries', - (string) $this->client->getResponse()->getContent() - ); + $this->assertStringContainsString('1 entries', (string) $this->client->getResponse()->getContent()); } public function testPackageSearch(): void @@ -124,44 +128,41 @@ public function testPackageSearch(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/testing', '1', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/testing', '1', '1.1.1', new DateTimeImmutable()); $packageId2 = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId2, 'buddy-works/example', '2', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId2, 'buddy-works/example', '2', '1.1.1', new DateTimeImmutable()); // Check both packages are returned first - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy'])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString( - '2 entries', - (string) $this->client->getResponse()->getContent() - ); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('2 entries', (string) $this->client->getResponse()->getContent()); // Search for 'testing' (which is in name) - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => 'testing'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => 'testing'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $response = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('1 entries', $response); - self::assertStringContainsString($packageId, $response); - self::assertStringNotContainsString($packageId2, $response); + $this->assertStringContainsString('1 entries', $response); + $this->assertStringContainsString($packageId, $response); + $this->assertStringNotContainsString($packageId2, $response); // Search for '2' (which is in description) - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => '2'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => '2'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $response = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('1 entries', $response); - self::assertStringContainsString($packageId2, $response); - self::assertStringNotContainsString($packageId, $response); + $this->assertStringContainsString('1 entries', $response); + $this->assertStringContainsString($packageId2, $response); + $this->assertStringNotContainsString($packageId, $response); // Test serach query params passing - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => 'buddy', 'limit' => 1])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => 'buddy', 'limit' => 1])); + $this->assertTrue($this->client->getResponse()->isOk()); $response = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('2 entries', $response); - self::assertStringContainsString('search=buddy', $response); + $this->assertStringContainsString('2 entries', $response); + $this->assertStringContainsString('search=buddy', $response); } public function testDependantSearch(): void @@ -169,22 +170,22 @@ public function testDependantSearch(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/testing', '1', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/testing', '1', '1.1.1', new DateTimeImmutable()); $packageId2 = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $links = [ new Link('requires', 'buddy-works/testing', '^1.5'), ]; - $this->fixtures->syncPackageWithData($packageId2, 'buddy-works/example', '2', '1.1.1', new \DateTimeImmutable(), [], $links); + $this->fixtures->syncPackageWithData($packageId2, 'buddy-works/example', '2', '1.1.1', new DateTimeImmutable(), [], $links); // Search for 'testing' (which is in name) - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => 'depends:buddy-works/testing'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'search' => 'depends:buddy-works/testing'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $response = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('1 entries', $response); - self::assertStringNotContainsString($packageId, $response); - self::assertStringContainsString($packageId2, $response); + $this->assertStringContainsString('1 entries', $response); + $this->assertStringNotContainsString($packageId, $response); + $this->assertStringContainsString($packageId2, $response); } public function testPagination(): void @@ -195,36 +196,36 @@ public function testPagination(): void $this->fixtures->addPackage($buddyId, 'https://buddy.com'); } - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('Showing 1 to 1 of 111 entries', $content); - self::assertStringContainsString('offset=111&limit=1', $content); + $this->assertStringContainsString('Showing 1 to 1 of 111 entries', $content); + $this->assertStringContainsString('offset=111&limit=1', $content); // Invalid limit (too low) - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => -1])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => -1])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('Showing 1 to 20 of 111 entries', $content); - self::assertStringContainsString('offset=100&limit=20', $content); + $this->assertStringContainsString('Showing 1 to 20 of 111 entries', $content); + $this->assertStringContainsString('offset=100&limit=20', $content); // Invalid limit (too high) - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 101])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 101])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('Showing 1 to 100 of 111 entries', $content); - self::assertStringContainsString('offset=100&limit=100', $content); + $this->assertStringContainsString('Showing 1 to 100 of 111 entries', $content); + $this->assertStringContainsString('offset=100&limit=100', $content); // Negative offset - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'offset' => -1])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'offset' => -1])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('Showing 1 to 20 of 111 entries', $content); - self::assertStringContainsString('offset=0&limit=20', $content); + $this->assertStringContainsString('Showing 1 to 20 of 111 entries', $content); + $this->assertStringContainsString('offset=0&limit=20', $content); } public function testSorting(): void @@ -232,78 +233,75 @@ public function testSorting(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); for ($i = 1; $i < 6; ++$i) { - $submissionTime = (new \DateTimeImmutable())->add(new \DateInterval("P{$i}D")); + $submissionTime = (new DateTimeImmutable())->add(new DateInterval(sprintf('P%dD', $i))); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/package-'.$i, 'Test', "1.{$i}", $submissionTime); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/package-'.$i, 'Test', '1.'.$i, $submissionTime); } - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('buddy-works/package-1', $content); - self::assertStringContainsString('sort=name:desc', $content); - self::assertStringContainsString('sort=version:asc', $content); - self::assertStringContainsString('sort=date:asc', $content); + $this->assertStringContainsString('buddy-works/package-1', $content); + $this->assertStringContainsString('sort=name:desc', $content); + $this->assertStringContainsString('sort=version:asc', $content); + $this->assertStringContainsString('sort=date:asc', $content); // Sort by name desc - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'name:desc'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'name:desc'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('buddy-works/package-5', $content); - self::assertStringContainsString('sort=name:asc', $content); - self::assertStringContainsString('sort=version:asc', $content); - self::assertStringContainsString('sort=date:asc', $content); + $this->assertStringContainsString('buddy-works/package-5', $content); + $this->assertStringContainsString('sort=name:asc', $content); + $this->assertStringContainsString('sort=version:asc', $content); + $this->assertStringContainsString('sort=date:asc', $content); // Sort by version desc - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'version:desc'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'version:desc'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('buddy-works/package-5', $content); - self::assertStringContainsString('sort=name:asc', $content); - self::assertStringContainsString('sort=version:desc', $content); - self::assertStringContainsString('sort=date:asc', $content); + $this->assertStringContainsString('buddy-works/package-5', $content); + $this->assertStringContainsString('sort=name:asc', $content); + $this->assertStringContainsString('sort=version:desc', $content); + $this->assertStringContainsString('sort=date:asc', $content); // Sort by released date asc - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'date:asc'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'date:asc'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('buddy-works/package-1', $content); - self::assertStringContainsString('sort=name:asc', $content); - self::assertStringContainsString('sort=version:asc', $content); - self::assertStringContainsString('sort=date:desc', $content); + $this->assertStringContainsString('buddy-works/package-1', $content); + $this->assertStringContainsString('sort=name:asc', $content); + $this->assertStringContainsString('sort=version:asc', $content); + $this->assertStringContainsString('sort=date:desc', $content); // Sort by invalid column - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'invalid-column:asc'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy', 'limit' => 1, 'sort' => 'invalid-column:asc'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); $content = (string) $this->client->getResponse()->getContent(); - self::assertStringContainsString('buddy-works/package-1', $content); - self::assertStringContainsString('sort=name:asc', $content); - self::assertStringContainsString('sort=version:asc', $content); - self::assertStringContainsString('sort=date:asc', $content); + $this->assertStringContainsString('buddy-works/package-1', $content); + $this->assertStringContainsString('sort=name:asc', $content); + $this->assertStringContainsString('sort=version:asc', $content); + $this->assertStringContainsString('sort=date:asc', $content); } public function testRemovePackage(): void { $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); $this->client->followRedirects(true); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString( - 'Package has been successfully removed', - $this->lastResponseBody() - ); + $this->assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); $this->fixtures->prepareRepoFiles(); } @@ -316,12 +314,12 @@ public function testRemoveBitbucketPackage(): void $this->fixtures->setWebhookCreated($packageId); $this->client->followRedirects(); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); + $this->assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); } public function testRemoveGitHubPackage(): void @@ -333,13 +331,13 @@ public function testRemoveGitHubPackage(): void $this->client->disableReboot(); $this->client->followRedirects(); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); - self::assertEquals(['some/repo'], $this->container()->get(GitHubApi::class)->removedWebhooks()); + $this->assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); + $this->assertSame(['some/repo'], $this->container()->get(GitHubApi::class)->removedWebhooks()); } public function testRemoveGitHubPackageAndIgnoreWebhookError(): void @@ -348,16 +346,16 @@ public function testRemoveGitHubPackageAndIgnoreWebhookError(): void $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITHUB); $packageId = $this->fixtures->addPackage($organizationId, 'https://buddy.com', 'github-oauth', [Metadata::GITHUB_REPO_NAME => 'some/repo']); $this->fixtures->setWebhookCreated($packageId); - $this->container()->get(GitHubApi::class)->setExceptionOnNextCall(new \RuntimeException('Bad credentials')); + $this->container()->get(GitHubApi::class)->setExceptionOnNextCall(new RuntimeException('Bad credentials')); $this->client->followRedirects(); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); - self::assertStringContainsString('Webhook removal failed due to', $this->lastResponseBody()); + $this->assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); + $this->assertStringContainsString('Webhook removal failed due to', $this->lastResponseBody()); } public function testRemoveGitLabPackage(): void @@ -368,12 +366,12 @@ public function testRemoveGitLabPackage(): void $this->fixtures->setWebhookCreated($packageId); $this->client->followRedirects(); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); + $this->assertStringContainsString('Package has been successfully removed', $this->lastResponseBody()); } public function testSynchronizeWebhookFromGitHubPackage(): void @@ -383,12 +381,12 @@ public function testSynchronizeWebhookFromGitHubPackage(): void $packageId = $this->fixtures->addPackage($organizationId, 'https://buddy.com', 'github-oauth', [Metadata::GITHUB_REPO_NAME => 'some/repo']); $this->client->followRedirects(); - $this->client->request('POST', $this->urlTo('organization_package_webhook', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_package_webhook', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('will be synchronized in background', $this->lastResponseBody()); + $this->assertStringContainsString('will be synchronized in background', $this->lastResponseBody()); } public function testSynchronizeWebhookFromGitLabPackage(): void @@ -398,12 +396,12 @@ public function testSynchronizeWebhookFromGitLabPackage(): void $packageId = $this->fixtures->addPackage($organizationId, 'https://buddy.com', 'gitlab-oauth', [Metadata::GITLAB_PROJECT_ID => 123]); $this->client->followRedirects(); - $this->client->request('POST', $this->urlTo('organization_package_webhook', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_package_webhook', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('will be synchronized in background', $this->lastResponseBody()); + $this->assertStringContainsString('will be synchronized in background', $this->lastResponseBody()); } public function testSynchronizeWebhookFromBitbucketPackage(): void @@ -413,12 +411,12 @@ public function testSynchronizeWebhookFromBitbucketPackage(): void $packageId = $this->fixtures->addPackage($organizationId, 'https://buddy.com', 'bitbucket-oauth', [Metadata::BITBUCKET_REPO_NAME => 'some/repo']); $this->client->followRedirects(); - $this->client->request('POST', $this->urlTo('organization_package_webhook', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_package_webhook', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('will be synchronized in background', $this->lastResponseBody()); + $this->assertStringContainsString('will be synchronized in background', $this->lastResponseBody()); } public function testUpdateNonExistingPackage(): void @@ -426,12 +424,12 @@ public function testUpdateNonExistingPackage(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->client->request('POST', $this->urlTo('organization_package_update', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_package_update', [ 'organization' => 'buddy', 'package' => Uuid::uuid4()->toString(), // random ])); - self::assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testSynchronizationError(): void @@ -440,10 +438,10 @@ public function testSynchronizationError(): void $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $this->fixtures->syncPackageWithError($packageId, 'Connection error: 503 service unavailable'); - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'buddy'])); - self::assertStringContainsString('Synchronization error', $this->lastResponseBody()); - self::assertStringContainsString('Connection error: 503 service unavailable', $this->lastResponseBody()); + $this->assertStringContainsString('Synchronization error', $this->lastResponseBody()); + $this->assertStringContainsString('Connection error: 503 service unavailable', $this->lastResponseBody()); } public function testRemoveNonExistingPackage(): void @@ -451,12 +449,12 @@ public function testRemoveNonExistingPackage(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'buddy', 'package' => Uuid::uuid4()->toString(), // random ])); - self::assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testRemoveNotOwnedPackage(): void @@ -466,12 +464,12 @@ public function testRemoveNotOwnedPackage(): void $repmanId = $this->fixtures->createOrganization('repman', $this->userId); $repmanPackageId = $this->fixtures->addPackage($repmanId, 'https://repman.io'); - $this->client->request('DELETE', $this->urlTo('organization_package_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_package_remove', [ 'organization' => 'repman', 'package' => $buddyPackageId, // package from other organization ])); - self::assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testPackageDetails(): void @@ -479,50 +477,50 @@ public function testPackageDetails(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $versions = [ - new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new \DateTimeImmutable(), Version::STABILITY_STABLE), - new Version(Uuid::uuid4(), '1.0.1', 'ref2', 1048576, new \DateTimeImmutable(), Version::STABILITY_STABLE), - new Version(Uuid::uuid4(), '1.1.0', 'lastref', 1073741824, new \DateTimeImmutable(), Version::STABILITY_STABLE), + new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new DateTimeImmutable(), Version::STABILITY_STABLE), + new Version(Uuid::uuid4(), '1.0.1', 'ref2', 1048576, new DateTimeImmutable(), Version::STABILITY_STABLE), + new Version(Uuid::uuid4(), '1.1.0', 'lastref', 1073741824, new DateTimeImmutable(), Version::STABILITY_STABLE), ]; $links = [ new Link('requires', 'buddy-works/target', '^1.5'), new Link('suggests', 'buddy-works/buddy', '^2.0'), // Suggest self to test dependant link ]; - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable(), $versions, $links, 'This is a readme'); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable(), $versions, $links, 'This is a readme'); $this->fixtures->addScanResult($packageId, 'ok'); - $crawler = $this->client->request('GET', $this->urlTo('organization_package_details', [ + $crawler = $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_details', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('buddy-works/buddy details', $this->lastResponseBody()); - self::assertStringContainsString('Test', $this->lastResponseBody()); - self::assertStringContainsString('Available versions', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('buddy-works/buddy details', $this->lastResponseBody()); + $this->assertStringContainsString('Test', $this->lastResponseBody()); + $this->assertStringContainsString('Available versions', $this->lastResponseBody()); foreach ($versions as $version) { - self::assertStringContainsString($version->version(), $this->lastResponseBody()); - self::assertStringContainsString($version->reference(), $this->lastResponseBody()); + $this->assertStringContainsString($version->version(), $this->lastResponseBody()); + $this->assertStringContainsString($version->reference(), $this->lastResponseBody()); } $crawlerText = $crawler->text(null, true); - self::assertStringContainsString('Requirements', $this->lastResponseBody()); + $this->assertStringContainsString('Requirements', $this->lastResponseBody()); foreach ($links as $link) { - self::assertStringContainsString("{$link->target()}: {$link->constraint()}", $crawlerText); + $this->assertStringContainsString(sprintf('%s: %s', $link->target(), $link->constraint()), $crawlerText); } - self::assertStringContainsString('Dependant Packages 1', $crawlerText); - self::assertStringContainsString('depends:buddy-works/buddy', $this->lastResponseBody()); + $this->assertStringContainsString('Dependant Packages 1', $crawlerText); + $this->assertStringContainsString('depends:buddy-works/buddy', $this->lastResponseBody()); - self::assertStringContainsString('This is a readme', $this->lastResponseBody()); - self::assertStringNotContainsString('This package is abandoned', $this->lastResponseBody()); + $this->assertStringContainsString('This is a readme', $this->lastResponseBody()); + $this->assertStringNotContainsString('This package is abandoned', $this->lastResponseBody()); - $this->client->request('GET', $this->urlTo('organization_package_details', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_details', [ 'organization' => 'buddy', 'package' => v4(), ])); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } /** @@ -532,21 +530,21 @@ public function testPackageDetailsAbandoned(string $replacementPackage, string $ { $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable(), [], [], null, $replacementPackage); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable(), [], [], null, $replacementPackage); - $this->client->request('GET', $this->urlTo('organization_package_details', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_details', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString($expectedMessage, $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString($expectedMessage, $this->lastResponseBody()); } /** - * @return \Generator> + * @return Generator> */ - public function getAbandonedReplacements(): \Generator + public function getAbandonedReplacements(): Generator { yield 'Abandoned without replacement package' => [ '', @@ -565,22 +563,22 @@ public function testPackageStats(): void $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $this->fixtures->addPackageDownload(3, $packageId, $version = '1.2.3'); - $crawler = $this->client->request('GET', $this->urlTo('organization_package_stats', [ + $crawler = $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_stats', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Total installs: 3', $crawler->text(null, true)); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Total installs: 3', $crawler->text(null, true)); - $this->client->request('GET', $this->urlTo('organization_package_version_stats', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_version_stats', [ 'organization' => 'buddy', 'package' => $packageId, 'version' => $version, ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('{"x":"'.date('Y-m-d').'","y":3}', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('{"x":"'.date('Y-m-d').'","y":3}', $this->lastResponseBody()); } public function testPackageWebhookPage(): void @@ -588,24 +586,24 @@ public function testPackageWebhookPage(): void $buddyId = $this->fixtures->createOrganization('buddy', $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com', 'github-oauth', [Metadata::GITHUB_REPO_NAME => 'buddy/works']); - $this->client->request('POST', '/hook/'.$packageId); - $this->client->request('GET', $this->urlTo('organization_package_webhook', [ + $this->client->request(Request::METHOD_POST, '/hook/'.$packageId); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_webhook', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString($this->urlTo('package_webhook', ['package' => $packageId]), $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString($this->urlTo('package_webhook', ['package' => $packageId]), $this->lastResponseBody()); // last requests table is visible - self::assertStringContainsString('User agent', $this->lastResponseBody()); + $this->assertStringContainsString('User agent', $this->lastResponseBody()); $this->fixtures->setWebhookError($packageId, 'Repository was archived so is read-only.'); - $this->client->request('GET', $this->urlTo('organization_package_webhook', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_webhook', [ 'organization' => 'buddy', 'package' => $packageId, ])); - self::assertStringContainsString('Repository was archived so is read-only.', $this->lastResponseBody()); + $this->assertStringContainsString('Repository was archived so is read-only.', $this->lastResponseBody()); } public function testOrganizationStats(): void @@ -614,28 +612,26 @@ public function testOrganizationStats(): void $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $this->fixtures->addPackageDownload(3, $packageId); - $crawler = $this->client->request('GET', $this->urlTo('organizations_stats', [ + $crawler = $this->client->request(Request::METHOD_GET, $this->urlTo('organizations_stats', [ 'organization' => 'buddy', ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Total installs: 3', $crawler->text(null, true)); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Total installs: 3', $crawler->text(null, true)); } public function testGenerateNewToken(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('GET', $this->urlTo('organization_token_new', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_token_new', ['organization' => 'buddy'])); $this->client->submitForm('Generate', [ 'name' => 'Production Token', ]); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_tokens', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_tokens', ['organization' => 'buddy']))); $this->client->followRedirect(); - self::assertStringContainsString('Production Token', $this->lastResponseBody()); + $this->assertStringContainsString('Production Token', $this->lastResponseBody()); } public function testRegenerateToken(): void @@ -645,16 +641,14 @@ public function testRegenerateToken(): void 'secret-token' ); $this->container()->get(TokenGenerator::class)->setNextToken('regenerated-token'); - $this->client->request('POST', $this->urlTo('organization_token_regenerate', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_token_regenerate', [ 'organization' => 'buddy', 'token' => 'secret-token', ])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_tokens', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_tokens', ['organization' => 'buddy']))); $this->client->followRedirect(); - self::assertStringContainsString('regenerated-token', $this->lastResponseBody()); + $this->assertStringContainsString('regenerated-token', $this->lastResponseBody()); } public function testRemoveToken(): void @@ -663,37 +657,35 @@ public function testRemoveToken(): void $this->fixtures->createOrganization('buddy', $this->userId), 'secret-token' ); - $this->client->request('DELETE', $this->urlTo('organization_token_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_token_remove', [ 'organization' => 'buddy', 'token' => 'secret-token', ])); - self::assertTrue( - $this->client->getResponse()->isRedirect($this->urlTo('organization_tokens', ['organization' => 'buddy'])) - ); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_tokens', ['organization' => 'buddy']))); $this->client->followRedirect(); - self::assertStringNotContainsString('secret-token', $this->lastResponseBody()); + $this->assertStringNotContainsString('secret-token', $this->lastResponseBody()); } public function testChangeName(): void { $this->fixtures->createOrganization('buddy', $this->userId); $this->client->followRedirects(); - $this->client->request('GET', $this->urlTo('organization_settings', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_settings', ['organization' => 'buddy'])); $this->client->submitForm('Rename', [ 'name' => 'Meat', ]); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Meat', $this->lastResponseBody()); - self::assertStringContainsString('Organization name been successfully changed.', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Meat', $this->lastResponseBody()); + $this->assertStringContainsString('Organization name been successfully changed.', $this->lastResponseBody()); } public function testChangeAlias(): void { $organizationId = $this->fixtures->createOrganization('buddy', $this->userId); $this->client->followRedirects(); - $this->client->request('GET', $this->urlTo('organization_settings', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_settings', ['organization' => 'buddy'])); $this->client->submitForm('Change', [ 'alias' => 'repman', ]); @@ -703,22 +695,22 @@ public function testChangeAlias(): void ->get(OrganizationRepository::class) ->getById(Uuid::fromString($organizationId)); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Organization alias has been successfully changed.', $this->lastResponseBody()); - self::assertEquals('repman', $organization->alias()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Organization alias has been successfully changed.', $this->lastResponseBody()); + $this->assertSame('repman', $organization->alias()); } public function testChangeAliasWithInvalidChars(): void { $this->fixtures->createOrganization('buddy', $this->userId); $this->client->followRedirects(); - $this->client->request('GET', $this->urlTo('organization_settings', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_settings', ['organization' => 'buddy'])); $this->client->submitForm('Change', [ 'alias' => 'https://repman', ]); - self::assertStringContainsString('Alias can contain only alphanumeric characters and _ or - sign', $this->lastResponseBody()); - self::assertStringNotContainsString('Organization alias has been successfully changed.', $this->lastResponseBody()); + $this->assertStringContainsString('Alias can contain only alphanumeric characters and _ or - sign', $this->lastResponseBody()); + $this->assertStringNotContainsString('Organization alias has been successfully changed.', $this->lastResponseBody()); } public function testChangeAnonymousAccess(): void @@ -732,9 +724,9 @@ public function testChangeAnonymousAccess(): void ->getByAlias('buddy') ->get(); - self::assertFalse($organization->hasAnonymousAccess()); + $this->assertFalse($organization->hasAnonymousAccess()); - $this->client->request('GET', $this->urlTo('organization_settings', ['organization' => 'buddy'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_settings', ['organization' => 'buddy'])); $this->client->submitForm('changeAnonymousAccess', [ 'hasAnonymousAccess' => true, ]); @@ -745,9 +737,9 @@ public function testChangeAnonymousAccess(): void ->getByAlias('buddy') ->get(); - self::assertTrue($organization->hasAnonymousAccess()); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Anonymous access has been successfully changed.', $this->lastResponseBody()); + $this->assertTrue($organization->hasAnonymousAccess()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Anonymous access has been successfully changed.', $this->lastResponseBody()); } public function testRemoveOrganization(): void @@ -755,25 +747,26 @@ public function testRemoveOrganization(): void $organizationId = $this->fixtures->createOrganization('buddy inc', $this->userId); $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITHUB); $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_BITBUCKET); + $packageId = $this->fixtures->addPackage($organizationId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/buddy', 'Test', '1.1.1', new DateTimeImmutable()); $this->fixtures->setWebhookCreated($this->fixtures->addPackage($organizationId, 'https://buddy.com', 'github-oauth', [Metadata::GITHUB_REPO_NAME => 'org/repo'])); $this->fixtures->setWebhookCreated($this->fixtures->addPackage($organizationId, 'https://buddy.com', 'bitbucket-oauth', [Metadata::BITBUCKET_REPO_NAME => 'webhook/problem'])); - $this->container()->get(BitbucketApi::class)->setExceptionOnNextCall(new \RuntimeException('Repository was archived')); + $this->container()->get(BitbucketApi::class)->setExceptionOnNextCall(new RuntimeException('Repository was archived')); - $this->client->request('DELETE', $this->urlTo('organization_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_remove', [ 'organization' => 'buddy-inc', ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->disableReboot(); $this->client->followRedirect(); - self::assertStringContainsString('Organization buddy inc has been successfully removed', $this->lastResponseBody()); - self::assertStringContainsString('Repository was archived', $this->lastResponseBody()); - self::assertEquals(0, $this->container()->get(PackageQuery::class)->count($organizationId, new PackageQuery\Filter())); - self::assertEquals(['org/repo'], $this->container()->get(GitHubApi::class)->removedWebhooks()); - self::assertEquals([], $this->container()->get(BitbucketApi::class)->removedWebhooks()); + $this->assertStringContainsString('Organization buddy inc has been successfully removed', $this->lastResponseBody()); + $this->assertStringContainsString('Repository was archived', $this->lastResponseBody()); + $this->assertSame(0, $this->container()->get(PackageQuery::class)->count($organizationId, new Filter())); + $this->assertSame(['org/repo'], $this->container()->get(GitHubApi::class)->removedWebhooks()); + $this->assertSame([], $this->container()->get(BitbucketApi::class)->removedWebhooks()); } public function testRemoveForbiddenOrganization(): void @@ -781,11 +774,11 @@ public function testRemoveForbiddenOrganization(): void $otherId = $this->fixtures->createAdmin('cto@buddy.works', 'strong'); $this->fixtures->createOrganization('buddy', $otherId); - $this->client->request('DELETE', $this->urlTo('organization_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('organization_remove', [ 'organization' => 'buddy', ])); - self::assertTrue($this->client->getResponse()->isForbidden()); + $this->assertTrue($this->client->getResponse()->isForbidden()); } public function testPackageEmptyScanResults(): void @@ -794,12 +787,12 @@ public function testPackageEmptyScanResults(): void $buddyId = $this->fixtures->createOrganization($organization, $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->client->request('GET', $this->urlTo('organization_package_scan_results', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_scan_results', [ 'organization' => $organization, 'package' => $packageId, ])); - self::assertStringContainsString('package not scanned yet', $this->lastResponseBody()); + $this->assertStringContainsString('package not scanned yet', $this->lastResponseBody()); } public function testScanPackages(): void @@ -808,22 +801,22 @@ public function testScanPackages(): void $buddyId = $this->fixtures->createOrganization($organization, $this->userId); $packageId = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); $package2Id = $this->fixtures->addPackage($buddyId, 'https://buddy.com'); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/repman', 'Repository manager', '2.1.1', new \DateTimeImmutable('2020-01-01 12:12:12')); - $this->fixtures->syncPackageWithData($package2Id, 'buddy-works/repman2', 'Repository manager', '2.1.1', new \DateTimeImmutable('2020-01-01 12:12:12')); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/repman', 'Repository manager', '2.1.1', new DateTimeImmutable('2020-01-01 12:12:12')); + $this->fixtures->syncPackageWithData($package2Id, 'buddy-works/repman2', 'Repository manager', '2.1.1', new DateTimeImmutable('2020-01-01 12:12:12')); - $this->client->request('POST', $this->urlTo('organization_package_scan', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('organization_package_scan', [ 'organization' => $organization, 'package' => $packageId, ])); - self::assertTrue($this->client->getResponse()->isRedirect( + $this->assertTrue($this->client->getResponse()->isRedirect( $this->urlTo('organization_packages', ['organization' => $organization]) )); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(3, $transport->getSent()); - self::assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); + $this->assertCount(3, $transport->getSent()); + $this->assertInstanceOf(ScanPackage::class, $transport->getSent()[0]->getMessage()); $this->fixtures->addScanResult($packageId, 'ok'); $this->fixtures->addScanResult($package2Id, 'error', [ @@ -833,11 +826,11 @@ public function testScanPackages(): void ]); $this->client->followRedirect(); - self::assertStringContainsString('Package will be scanned in the background', $this->lastResponseBody()); - self::assertStringContainsString('ok', $this->lastResponseBody()); - self::assertStringContainsString('no advisories', $this->lastResponseBody()); - self::assertStringContainsString('error', $this->lastResponseBody()); - self::assertStringContainsString('<b>RuntimeException</b> - Some error', $this->lastResponseBody()); + $this->assertStringContainsString('Package will be scanned in the background', $this->lastResponseBody()); + $this->assertStringContainsString('ok', $this->lastResponseBody()); + $this->assertStringContainsString('no advisories', $this->lastResponseBody()); + $this->assertStringContainsString('error', $this->lastResponseBody()); + $this->assertStringContainsString('<b>RuntimeException</b> - Some error', $this->lastResponseBody()); } public function testPackageScanResultsWithOkStatus(): void @@ -852,19 +845,19 @@ public function testPackageScanResultsWithOkStatus(): void 'buddy-works/repman', 'Repository manager', $version, - new \DateTimeImmutable() + new DateTimeImmutable() ); $this->fixtures->addScanResult($packageId, 'ok'); - $this->client->request('GET', $this->urlTo('organization_package_scan_results', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_scan_results', [ 'organization' => $organization, 'package' => $packageId, ])); - self::assertStringContainsString($version, $this->lastResponseBody()); - self::assertStringContainsString('ok', $this->lastResponseBody()); - self::assertStringContainsString('no advisories', $this->lastResponseBody()); + $this->assertStringContainsString($version, $this->lastResponseBody()); + $this->assertStringContainsString('ok', $this->lastResponseBody()); + $this->assertStringContainsString('no advisories', $this->lastResponseBody()); } public function testPackageScanResultsWithWarningStatus(): void @@ -879,7 +872,7 @@ public function testPackageScanResultsWithWarningStatus(): void 'buddy-works/repman', 'Repository manager', $version, - new \DateTimeImmutable() + new DateTimeImmutable() ); $this->fixtures->addScanResult($packageId, 'warning', [ @@ -898,20 +891,20 @@ public function testPackageScanResultsWithWarningStatus(): void 'sub-dir/composer.lock' => [], ]); - $crawler = $this->client->request('GET', $this->urlTo('organization_package_scan_results', [ + $crawler = $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_scan_results', [ 'organization' => $organization, 'package' => $packageId, ])); - self::assertStringContainsString($version, $this->lastResponseBody()); - self::assertStringContainsString('buddy-works/repman security scan results', $crawler->text(null, true)); - self::assertStringContainsString('warning', $this->lastResponseBody()); - self::assertStringContainsString('vendor/some-dependency', $this->lastResponseBody()); - self::assertStringContainsString('6.6.6', $this->lastResponseBody()); - self::assertStringContainsString('Direct access of ESI URLs behind a trusted proxy', $this->lastResponseBody()); - self::assertStringContainsString('CVE-2014-5245', $this->lastResponseBody()); - self::assertStringContainsString('https://symfony.com/cve-2014-5245', $this->lastResponseBody()); - self::assertStringNotContainsString('sub-dir/composer.lock', $this->lastResponseBody()); + $this->assertStringContainsString($version, $this->lastResponseBody()); + $this->assertStringContainsString('buddy-works/repman security scan results', $crawler->text(null, true)); + $this->assertStringContainsString('warning', $this->lastResponseBody()); + $this->assertStringContainsString('vendor/some-dependency', $this->lastResponseBody()); + $this->assertStringContainsString('6.6.6', $this->lastResponseBody()); + $this->assertStringContainsString('Direct access of ESI URLs behind a trusted proxy', $this->lastResponseBody()); + $this->assertStringContainsString('CVE-2014-5245', $this->lastResponseBody()); + $this->assertStringContainsString('https://symfony.com/cve-2014-5245', $this->lastResponseBody()); + $this->assertStringNotContainsString('sub-dir/composer.lock', $this->lastResponseBody()); } public function testPackageScanResultsWithErrorStatus(): void @@ -926,7 +919,7 @@ public function testPackageScanResultsWithErrorStatus(): void 'buddy-works/repman', 'Repository manager', $version, - new \DateTimeImmutable() + new DateTimeImmutable() ); $this->fixtures->addScanResult($packageId, 'error', [ @@ -935,14 +928,14 @@ public function testPackageScanResultsWithErrorStatus(): void ], ]); - $this->client->request('GET', $this->urlTo('organization_package_scan_results', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_scan_results', [ 'organization' => $organization, 'package' => $packageId, ])); - self::assertStringContainsString($version, $this->lastResponseBody()); - self::assertStringContainsString('error', $this->lastResponseBody()); - self::assertStringContainsString('RuntimeException - Some error', $this->lastResponseBody()); + $this->assertStringContainsString($version, $this->lastResponseBody()); + $this->assertStringContainsString('error', $this->lastResponseBody()); + $this->assertStringContainsString('RuntimeException - Some error', $this->lastResponseBody()); } public function testPackageScanResultsWithNaStatus(): void @@ -957,19 +950,19 @@ public function testPackageScanResultsWithNaStatus(): void 'buddy-works/repman', 'Repository manager', $version, - new \DateTimeImmutable() + new DateTimeImmutable() ); $this->fixtures->addScanResult($packageId, 'n/a', []); - $this->client->request('GET', $this->urlTo('organization_package_scan_results', [ + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_package_scan_results', [ 'organization' => $organization, 'package' => $packageId, ])); - self::assertStringContainsString($version, $this->lastResponseBody()); - self::assertStringContainsString('n/a', $this->lastResponseBody()); - self::assertStringContainsString('composer.lock not present', $this->lastResponseBody()); + $this->assertStringContainsString($version, $this->lastResponseBody()); + $this->assertStringContainsString('n/a', $this->lastResponseBody()); + $this->assertStringContainsString('composer.lock not present', $this->lastResponseBody()); } public function testOverviewAllowedForAnonymousUser(): void @@ -982,11 +975,12 @@ public function testOverviewAllowedForAnonymousUser(): void if (static::$booted) { self::ensureKernelShutdown(); } + $this->client = static::createClient(); - $this->client->request('GET', $this->urlTo('organization_overview', ['organization' => 'public'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_overview', ['organization' => 'public'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testPackagesAllowedForAnonymousUser(): void @@ -999,11 +993,12 @@ public function testPackagesAllowedForAnonymousUser(): void if (static::$booted) { self::ensureKernelShutdown(); } + $this->client = static::createClient(); - $this->client->request('GET', $this->urlTo('organization_packages', ['organization' => 'public'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_packages', ['organization' => 'public'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testTokensNotAllowedForAnonymousUser(): void @@ -1016,10 +1011,11 @@ public function testTokensNotAllowedForAnonymousUser(): void if (static::$booted) { self::ensureKernelShutdown(); } + $this->client = static::createClient(); - $this->client->request('GET', $this->urlTo('organization_tokens', ['organization' => 'public'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_tokens', ['organization' => 'public'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); } public function testNonExistingOrganizationForAnonymousUser(): void @@ -1027,10 +1023,11 @@ public function testNonExistingOrganizationForAnonymousUser(): void if (static::$booted) { self::ensureKernelShutdown(); } + $this->client = static::createClient(); - $this->client->request('GET', $this->urlTo('organization_overview', ['organization' => 'non-existing'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_overview', ['organization' => 'non-existing'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); } public function testPublicOrganizationOverviewAllowedForAnotherUser(): void @@ -1039,8 +1036,8 @@ public function testPublicOrganizationOverviewAllowedForAnotherUser(): void $organizationId = $this->fixtures->createOrganization('public', $otherId); $this->fixtures->enableAnonymousUserAccess($organizationId); - $this->client->request('GET', $this->urlTo('organization_overview', ['organization' => 'public'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_overview', ['organization' => 'public'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } } diff --git a/tests/Functional/Controller/PackageControllerTest.php b/tests/Functional/Controller/PackageControllerTest.php index 3d677899..f993b04b 100644 --- a/tests/Functional/Controller/PackageControllerTest.php +++ b/tests/Functional/Controller/PackageControllerTest.php @@ -5,6 +5,7 @@ namespace Buddy\Repman\Tests\Functional\Controller; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; final class PackageControllerTest extends FunctionalTestCase @@ -13,15 +14,15 @@ public function testWebhook(): void { $this->fixtures->createPackage('c675c468-6c0f-46bf-a445-65430146c55e'); - $this->client->request('POST', '/hook/c675c468-6c0f-46bf-a445-65430146c55e'); + $this->client->request(Request::METHOD_POST, '/hook/c675c468-6c0f-46bf-a445-65430146c55e'); - self::assertEquals(Response::HTTP_ACCEPTED, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_ACCEPTED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testWebhookNotFound(): void { - $this->client->request('POST', '/hook/c675c468-6c0f-46bf-a445-65430146c55e'); + $this->client->request(Request::METHOD_POST, '/hook/c675c468-6c0f-46bf-a445-65430146c55e'); - self::assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } } diff --git a/tests/Functional/Controller/ProxyControllerTest.php b/tests/Functional/Controller/ProxyControllerTest.php index 86711c94..1b32e0f5 100644 --- a/tests/Functional/Controller/ProxyControllerTest.php +++ b/tests/Functional/Controller/ProxyControllerTest.php @@ -5,6 +5,7 @@ namespace Buddy\Repman\Tests\Functional\Controller; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Messenger\Transport\InMemoryTransport; @@ -12,11 +13,11 @@ final class ProxyControllerTest extends FunctionalTestCase { public function testPackagesAction(): void { - $this->client->request('GET', '/packages.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ]); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "notify-batch": "http://repo.repman.wip/downloads", "providers-url": "/p/%package%$%hash%.json", @@ -46,13 +47,13 @@ public function testPackagesActionMissingProvider(): void rename($oldProviderName, $newProviderName); - $this->client->request('GET', '/packages.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ]); rename($newProviderName, $oldProviderName); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "notify-batch": "http://repo.repman.wip/downloads", "providers-url": "/p/%package%$%hash%.json", @@ -72,11 +73,11 @@ public function testPackagesActionMissingProvider(): void public function testProviderLazyAction(): void { - $response = $this->contentFromStream(fn () => $this->client->request('GET', '/p/buddy-works/repman', [], [], [ + $response = $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/p/buddy-works/repman', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "packages": { @@ -84,16 +85,16 @@ public function testProviderLazyAction(): void } } ', $response); - self::assertTrue($this->client->getResponse()->isCacheable()); + $this->assertTrue($this->client->getResponse()->isCacheable()); } public function testProviderLazyActionEmptyPackagesWhenNotExist(): void { - $response = $this->contentFromStream(fn () => $this->client->request('GET', '/p/buddy-works/example-app', [], [], [ + $response = $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/p/buddy-works/example-app', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "packages": {} } @@ -102,11 +103,11 @@ public function testProviderLazyActionEmptyPackagesWhenNotExist(): void public function testProviderV2Action(): void { - $response = $this->contentFromStream(fn () => $this->client->request('GET', '/p2/buddy-works/repman.json', [], [], [ + $response = $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/p2/buddy-works/repman.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "packages": { @@ -114,24 +115,24 @@ public function testProviderV2Action(): void } } ', $response); - self::assertTrue($this->client->getResponse()->isCacheable()); + $this->assertTrue($this->client->getResponse()->isCacheable()); } public function testProviderV2ActionWhenPackageNotExist(): void { - $this->client->request('GET', '/p2/buddy-works/example-app.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/p2/buddy-works/example-app.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ]); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } public function testProviderAction(): void { - $response = $this->contentFromStream(fn () => $this->client->request('GET', '/p/buddy-works/repman$d5d2c9708c1240da3913ee9fba51759b14b8443826a93b84fa0fa95d70cd3703.json', [], [], [ + $response = $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/p/buddy-works/repman$d5d2c9708c1240da3913ee9fba51759b14b8443826a93b84fa0fa95d70cd3703.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "packages": { @@ -139,25 +140,25 @@ public function testProviderAction(): void } } ', $response); - self::assertTrue($this->client->getResponse()->isCacheable()); + $this->assertTrue($this->client->getResponse()->isCacheable()); } public function testProviderNotFoundWhenNotExist(): void { - $this->contentFromStream(fn () => $this->client->request('GET', '/p/buddy-works/repman$ee203d24e9722116c133153095cd65f7d94d8261bed4bd77da698dda07e8c98d.json', [], [], [ + $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/p/buddy-works/repman$ee203d24e9722116c133153095cd65f7d94d8261bed4bd77da698dda07e8c98d.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } public function testProvidersAction(): void { - $response = $this->contentFromStream(fn () => $this->client->request('GET', '/p/provider-latest$bf7274d469c9a2c4b4d0babeeb112b40a3afd19a9887adb342671818360ae326.json', [], [], [ + $response = $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/p/provider-latest$bf7274d469c9a2c4b4d0babeeb112b40a3afd19a9887adb342671818360ae326.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "providers": { "buddy-works/repman": { @@ -166,40 +167,40 @@ public function testProvidersAction(): void } } ', $response); - self::assertTrue($this->client->getResponse()->isCacheable()); + $this->assertTrue($this->client->getResponse()->isCacheable()); } public function testProvidersNotFoundWhenNotExist(): void { - $this->contentFromStream(fn () => $this->client->request('GET', 'provider-latest$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.json', [], [], [ + $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, 'provider-latest$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.json', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } public function testDistributionAction(): void { - $file = $this->contentFromStream(fn () => $this->client->request('GET', '/dists/buddy-works/repman/0.1.2.0/f0c896a759d4e2e1eff57978318e841911796305.zip', [], [], [ + $file = $this->contentFromStream(fn () => $this->client->request(Request::METHOD_GET, '/dists/buddy-works/repman/0.1.2.0/f0c896a759d4e2e1eff57978318e841911796305.zip', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ])); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertTrue($this->client->getResponse()->isCacheable()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isCacheable()); } public function testDistributionNotFoundAction(): void { - $this->client->request('GET', '/dists/buddy-works/repman/2.0.0.0/0f1a178ca9c0271bca6426dde8f5a2241578deae.zip', [], [], [ + $this->client->request(Request::METHOD_GET, '/dists/buddy-works/repman/2.0.0.0/0f1a178ca9c0271bca6426dde8f5a2241578deae.zip', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ]); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } public function testTrackDownloads(): void { - $this->client->request('POST', '/downloads', [], [], [ + $this->client->request(Request::METHOD_POST, '/downloads', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ], (string) json_encode([ 'downloads' => [ @@ -217,18 +218,18 @@ public function testTrackDownloads(): void ], ])); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); /** @var InMemoryTransport $transport */ $transport = $this->container()->get('messenger.transport.async'); - self::assertCount(1, $transport->getSent()); + $this->assertCount(1, $transport->getSent()); } public function testTrackDownloadsInvalidRequest(): void { - $this->client->request('POST', '/downloads', [], [], [ + $this->client->request(Request::METHOD_POST, '/downloads', [], [], [ 'HTTP_HOST' => 'repo.repman.wip', ], 'invalid'); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } } diff --git a/tests/Functional/Controller/RegistrationControllerTest.php b/tests/Functional/Controller/RegistrationControllerTest.php index 4aeb75ef..fd9cb05b 100644 --- a/tests/Functional/Controller/RegistrationControllerTest.php +++ b/tests/Functional/Controller/RegistrationControllerTest.php @@ -5,29 +5,30 @@ namespace Buddy\Repman\Tests\Functional\Controller; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; use function Ramsey\Uuid\v4; final class RegistrationControllerTest extends FunctionalTestCase { public function testSuccessfulRegistration(): void { - $this->client->request('GET', $this->urlTo('app_register')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register')); $this->client->submitForm('Sign up', [ 'email' => 'test@buddy.works', 'plainPassword[first]' => 'secret123', 'plainPassword[second]' => 'secret123', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_create'))); $this->client->followRedirect(); - self::assertStringContainsString('Your account has been created', $this->lastResponseBody()); + $this->assertStringContainsString('Your account has been created', $this->lastResponseBody()); } public function testSuccessfulRegistrationWithInvitationToken(): void { $this->client->disableReboot(); - $this->client->request('GET', $this->urlTo('app_register')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register')); $this->client->getRequest()->getSession()->set('organization-token', $token = v4()); $this->client->submitForm('Sign up', [ 'email' => 'test@buddy.works', @@ -35,7 +36,7 @@ public function testSuccessfulRegistrationWithInvitationToken(): void 'plainPassword[second]' => 'secret123', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_accept_invitation', [ + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('organization_accept_invitation', [ 'token' => $token, ]))); } @@ -44,23 +45,23 @@ public function testEmailConfirmed(): void { $this->fixtures->createUser('test@buddy.works', 'secret', ['ROLE_USER'], $confirmToken = 'f731109f-505a-4459-b51d-b142e1046664'); - $this->client->request('GET', $this->urlTo('app_register_confirm', ['token' => $confirmToken])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register_confirm', ['token' => $confirmToken])); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirects(); $this->client->followRedirect(); - self::assertStringContainsString('E-mail address was confirmed.', $this->lastResponseBody()); + $this->assertStringContainsString('E-mail address was confirmed.', $this->lastResponseBody()); } public function testInvalidToken(): void { $this->fixtures->createUser('test@buddy.works', 'secret', ['ROLE_USER'], $confirmToken = 'f731109f-505a-4459-b51d-b142e1046664'); - $this->client->request('GET', $this->urlTo('app_register_confirm', ['token' => 'ffffffff-505a-4459-b51d-b142e1046664'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_register_confirm', ['token' => 'ffffffff-505a-4459-b51d-b142e1046664'])); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); $this->client->followRedirects(); $this->client->followRedirect(); - self::assertStringContainsString('Invalid or expired e-mail confirm token', $this->lastResponseBody()); + $this->assertStringContainsString('Invalid or expired e-mail confirm token', $this->lastResponseBody()); } } diff --git a/tests/Functional/Controller/RepoControllerTest.php b/tests/Functional/Controller/RepoControllerTest.php index 0e361cc3..44126caa 100644 --- a/tests/Functional/Controller/RepoControllerTest.php +++ b/tests/Functional/Controller/RepoControllerTest.php @@ -5,35 +5,40 @@ namespace Buddy\Repman\Tests\Functional\Controller; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\StreamedResponse; +use function filemtime; +use function json_encode; +use const JSON_THROW_ON_ERROR; final class RepoControllerTest extends FunctionalTestCase { public function testAuthRequired(): void { - $this->client->request('GET', '/', [], [], ['HTTP_HOST' => 'buddy.repo.repman.wip']); + $this->client->request(Request::METHOD_GET, '/', [], [], ['HTTP_HOST' => 'buddy.repo.repman.wip']); - self::assertEquals(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testAuthRequiredForOrganizationRepo(): void { - $this->client->request('GET', '/packages.json', [], [], ['HTTP_HOST' => 'buddy.repo.repman.wip']); + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], ['HTTP_HOST' => 'buddy.repo.repman.wip']); - self::assertEquals(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testPackagesActionWithInvalidToken(): void { - $this->client->request('GET', '/packages.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); - self::assertEquals(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testNotAllowedToSeeOtherOrganizationPackages(): void @@ -51,13 +56,13 @@ public function testNotAllowedToSeeOtherOrganizationPackages(): void 'secret-org-token' ); - $this->client->request('GET', '/packages.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], [ 'HTTP_HOST' => 'evil.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); - self::assertEquals(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_FORBIDDEN, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testOrganizationPackagesAction(): void @@ -68,19 +73,19 @@ public function testOrganizationPackagesAction(): void $this->fixtures->createToken($organizationId, 'secret-org-token'); $packageId = Uuid::uuid4()->toString(); $this->fixtures->createPackage($packageId, 'buddy', $organizationId); - $this->fixtures->syncPackageWithData($packageId, 'buddy-works/repman', 'Test', '1.1.1', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy-works/repman', 'Test', '1.1.1', new DateTimeImmutable()); // check token was never used - $this->client->request('GET', $this->urlTo('organization_tokens', ['organization' => 'buddy'])); - self::assertStringContainsString('never', $this->lastResponseBody()); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_tokens', ['organization' => 'buddy'])); + $this->assertStringContainsString('never', $this->lastResponseBody()); - $this->client->request('GET', '/packages.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); - self::assertJsonStringEqualsJsonString(' + $this->assertJsonStringEqualsJsonString(' { "packages": { "buddy-works\/repman": { @@ -111,8 +116,8 @@ public function testOrganizationPackagesAction(): void ', $this->lastResponseBody()); // check if last update date is changed - $this->client->request('GET', $this->urlTo('organization_tokens', ['organization' => 'buddy'])); - self::assertStringNotContainsString('never', $this->lastResponseBody()); + $this->client->request(Request::METHOD_GET, $this->urlTo('organization_tokens', ['organization' => 'buddy'])); + $this->assertStringNotContainsString('never', $this->lastResponseBody()); } public function testOrganizationPackageDistDownload(): void @@ -124,7 +129,7 @@ public function testOrganizationPackageDistDownload(): void ); $this->contentFromStream(function (): void { - $this->client->request('GET', '/dists/buddy-works/repman/1.2.3.0/ac7dcaf888af2324cd14200769362129c8dd8550.zip', [], [], [ + $this->client->request(Request::METHOD_GET, '/dists/buddy-works/repman/1.2.3.0/ac7dcaf888af2324cd14200769362129c8dd8550.zip', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', @@ -132,28 +137,28 @@ public function testOrganizationPackageDistDownload(): void }); $response = $this->client->getResponse(); - self::assertTrue($response->isOk(), 'Response code was not 200, it was instead '.$response->getStatusCode()); - self::assertInstanceOf(StreamedResponse::class, $response); + $this->assertTrue($response->isOk(), 'Response code was not 200, it was instead '.$response->getStatusCode()); + $this->assertInstanceOf(StreamedResponse::class, $response); $this->contentFromStream(function (): void { - $this->client->request('GET', '/dists/vendor/package/9.9.9.9/ac7dcaf888af2324cd14200769362129c8dd8550.zip', [], [], [ + $this->client->request(Request::METHOD_GET, '/dists/vendor/package/9.9.9.9/ac7dcaf888af2324cd14200769362129c8dd8550.zip', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); }); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } public function testOrganizationTrackDownloads(): void { $this->fixtures->createPackage('c75b535f-5817-41a2-9424-e05476e7958f', 'buddy'); - $this->fixtures->syncPackageWithData('c75b535f-5817-41a2-9424-e05476e7958f', 'buddy-works/repman', 'desc', '1.2.0', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData('c75b535f-5817-41a2-9424-e05476e7958f', 'buddy-works/repman', 'desc', '1.2.0', new DateTimeImmutable()); - $this->client->request('POST', '/downloads', [], [], [ + $this->client->request(Request::METHOD_POST, '/downloads', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', - ], \json_encode( + ], json_encode( [ 'downloads' => [ [ @@ -169,17 +174,17 @@ public function testOrganizationTrackDownloads(): void ], ], ], - \JSON_THROW_ON_ERROR - ) + JSON_THROW_ON_ERROR + ) ); - self::assertEquals(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_CREATED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); - $this->client->request('POST', '/downloads', [], [], [ + $this->client->request(Request::METHOD_POST, '/downloads', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', - ], (string) \json_encode([])); + ], (string) json_encode([])); - self::assertEquals(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); } public function testAnonymousUserAccess(): void @@ -187,9 +192,9 @@ public function testAnonymousUserAccess(): void $organizationId = $this->fixtures->createOrganization('buddy', $this->fixtures->createUser()); $this->fixtures->enableAnonymousUserAccess($organizationId); - $this->client->request('GET', '/packages.json', [], [], ['HTTP_HOST' => 'buddy.repo.repman.wip']); + $this->client->request(Request::METHOD_GET, '/packages.json', [], [], ['HTTP_HOST' => 'buddy.repo.repman.wip']); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testProviderV2Action(): void @@ -197,15 +202,15 @@ public function testProviderV2Action(): void $adminId = $this->createAndLoginAdmin('test@buddy.works', 'secret'); $this->fixtures->createToken($this->fixtures->createOrganization('buddy', $adminId), 'secret-org-token'); - $this->client->request('GET', '/p2/buddy-works/repman.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/p2/buddy-works/repman.json', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "packages": { "buddy-works/repman": { @@ -229,18 +234,18 @@ public function testProviderV2ActionWithCache(): void $adminId = $this->createAndLoginAdmin('test@buddy.works', 'secret'); $this->fixtures->createToken($this->fixtures->createOrganization('buddy', $adminId), 'secret-org-token'); - $fileModifiedTime = (new \DateTimeImmutable()) - ->setTimestamp((int) \filemtime(__DIR__.'/../../Resources/p2/buddy-works/repman.json')); + $fileModifiedTime = (new DateTimeImmutable()) + ->setTimestamp((int) filemtime(__DIR__.'/../../Resources/p2/buddy-works/repman.json')); - $this->client->request('GET', '/p2/buddy-works/repman.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/p2/buddy-works/repman.json', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', 'HTTP_IF_MODIFIED_SINCE' => $fileModifiedTime->format('D, d M Y H:i:s \G\M\T'), ]); - self::assertEquals(304, $this->client->getResponse()->getStatusCode()); - self::assertEmpty($this->client->getResponse()->getContent()); + $this->assertSame(Response::HTTP_NOT_MODIFIED, $this->client->getResponse()->getStatusCode(), $this->client->getResponse()->getContent()); + $this->assertEmpty($this->client->getResponse()->getContent()); } public function testProviderV2ForMissingPackage(): void @@ -248,13 +253,13 @@ public function testProviderV2ForMissingPackage(): void $adminId = $this->createAndLoginAdmin('test@buddy.works', 'secret'); $this->fixtures->createToken($this->fixtures->createOrganization('buddy', $adminId), 'secret-org-token'); - $this->client->request('GET', '/p2/buddy-works/fake.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/p2/buddy-works/fake.json', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); - self::assertTrue($this->client->getResponse()->isNotFound()); + $this->assertTrue($this->client->getResponse()->isNotFound()); } public function testProviderV2DevAction(): void @@ -262,15 +267,15 @@ public function testProviderV2DevAction(): void $adminId = $this->createAndLoginAdmin('test@buddy.works', 'secret'); $this->fixtures->createToken($this->fixtures->createOrganization('buddy', $adminId), 'secret-org-token'); - $this->client->request('GET', '/p2/buddy-works/repman~dev.json', [], [], [ + $this->client->request(Request::METHOD_GET, '/p2/buddy-works/repman~dev.json', [], [], [ 'HTTP_HOST' => 'buddy.repo.repman.wip', 'PHP_AUTH_USER' => 'token', 'PHP_AUTH_PW' => 'secret-org-token', ]); - self::assertTrue($this->client->getResponse()->isOk()); + $this->assertTrue($this->client->getResponse()->isOk()); - self::assertMatchesPattern(' + $this->assertMatchesPattern(' { "packages": { "buddy-works/repman": { diff --git a/tests/Functional/Controller/SecurityControllerTest.php b/tests/Functional/Controller/SecurityControllerTest.php index 2a8e9ef8..42b5d579 100644 --- a/tests/Functional/Controller/SecurityControllerTest.php +++ b/tests/Functional/Controller/SecurityControllerTest.php @@ -7,56 +7,58 @@ use Buddy\Repman\Entity\User; use Buddy\Repman\Repository\UserRepository; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use ReflectionObject; +use Symfony\Component\HttpFoundation\Request; final class SecurityControllerTest extends FunctionalTestCase { public function testRestrictedPageIsRedirectedToLogin(): void { - $this->client->request('GET', $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); - self::assertTrue($this->client->getResponse()->isRedirect('/login')); + $this->assertTrue($this->client->getResponse()->isRedirect('/login')); } public function testLoginWithInvalidEmail(): void { - $this->client->request('GET', $this->urlTo('app_login')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_login')); $this->client->submitForm('Sign in', [ 'email' => 'not@exist.com', 'password' => 'secret', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirect(); - self::assertStringContainsString('Invalid credentials.', $this->lastResponseBody()); + $this->assertStringContainsString('Invalid credentials.', $this->lastResponseBody()); } public function testLoginWithInvalidPassword(): void { $this->fixtures->createAdmin($email = 'test@buddy.works', $password = 'password'); - $this->client->request('GET', $this->urlTo('app_login')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_login')); $this->client->submitForm('Sign in', [ 'email' => $email, 'password' => 'other', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirect(); - self::assertStringContainsString('Invalid credentials.', $this->lastResponseBody()); + $this->assertStringContainsString('Invalid credentials.', $this->lastResponseBody()); } public function testLoginCSRFProtection(): void { $this->fixtures->createAdmin($email = 'test@buddy.works', $password = 'password'); - $this->client->request('POST', $this->urlTo('app_login'), [ + $this->client->request(Request::METHOD_POST, $this->urlTo('app_login'), [ 'email' => $email, 'password' => $password, ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirect(); - self::assertStringContainsString('Invalid CSRF token.', $this->lastResponseBody()); + $this->assertStringContainsString('Invalid CSRF token.', $this->lastResponseBody()); } public function testDisabledUserLogin(): void @@ -64,56 +66,57 @@ public function testDisabledUserLogin(): void $id = $this->fixtures->createAdmin($email = 'test@buddy.works', $password = 'password'); $this->fixtures->disableUser($id); - $this->client->request('GET', $this->urlTo('app_login')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_login')); $this->client->submitForm('Sign in', [ 'email' => $email, 'password' => $password, ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirect(); - self::assertStringContainsString('Account is disabled.', $this->lastResponseBody()); + $this->assertStringContainsString('Account is disabled.', $this->lastResponseBody()); } public function testDisabledUserHasNoAccess(): void { $id = $this->fixtures->createAdmin($email = 'test@buddy.works', $password = 'password'); - $this->client->request('GET', $this->urlTo('app_login')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_login')); $this->client->submitForm('Sign in', [ 'email' => $email, 'password' => $password, ]); $this->client->followRedirect(); + $this->fixtures->disableUser($id); - $this->client->request('GET', $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); // redirected back to login screen - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); } public function testSuccessfulLogin(): void { $this->fixtures->createAdmin($email = 'test@buddy.works', $password = 'password'); - $this->client->request('GET', '/login'); + $this->client->request(Request::METHOD_GET, '/login'); $this->client->submitForm('Sign in', [ 'email' => $email, 'password' => $password, ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); - $this->client->request('GET', $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); + $this->assertTrue($this->client->getResponse()->isOk()); } public function testRedirectToRequestedPathOnSuccessfulLogin(): void { $this->fixtures->createAdmin($email = 'test@buddy.works', $password = 'password'); - $this->client->request('GET', $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('admin_dist_list', ['proxy' => 'packagist.org'])); $this->client->followRedirect(); $this->client->submitForm('Sign in', [ 'email' => $email, @@ -121,62 +124,62 @@ public function testRedirectToRequestedPathOnSuccessfulLogin(): void ]); // authenticator user $targetPath, so in test env localhost will be added to url - self::assertTrue($this->client->getResponse()->isRedirect('http://localhost/admin/dist/packagist.org')); + $this->assertTrue($this->client->getResponse()->isRedirect('http://localhost/admin/dist/packagist.org')); } public function testSuccessfulLogout(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('app_logout')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_logout')); - self::assertTrue($this->client->getResponse()->isRedirection()); + $this->assertTrue($this->client->getResponse()->isRedirection()); } public function testRedirectOnIndexWhenAlreadyLogged(): void { $this->createAndLoginAdmin(); - $this->client->request('GET', $this->urlTo('app_login')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_login')); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); } public function testPasswordResetForNonExistingUser(): void { - $this->client->request('GET', $this->urlTo('app_send_reset_password_link')); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_send_reset_password_link')); $this->client->submitForm('Email me a password reset link', [ 'email' => 'not@exist.com', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_send_reset_password_link'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_send_reset_password_link'))); $this->client->followRedirect(); - self::assertStringContainsString('email has been sent', $this->lastResponseBody()); + $this->assertStringContainsString('email has been sent', $this->lastResponseBody()); } public function testPasswordReset(): void { $this->fixtures->createAdmin($email = 'test@buddy.works', 'password'); - $this->client->request('GET', $this->urlTo('app_send_reset_password_link')); - self::assertTrue($this->client->getResponse()->isOk()); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_send_reset_password_link')); + $this->assertTrue($this->client->getResponse()->isOk()); $this->client->submitForm('Email me a password reset link', [ 'email' => $email, ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_send_reset_password_link'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_send_reset_password_link'))); $this->client->followRedirect(); - self::assertStringContainsString('email has been sent', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('email has been sent', (string) $this->client->getResponse()->getContent()); $token = $this->getUserPasswordResetToken($email); - $this->client->request('GET', $this->urlTo('app_reset_password', ['token' => $token])); - self::assertTrue($this->client->getResponse()->isOk()); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_reset_password', ['token' => $token])); + $this->assertTrue($this->client->getResponse()->isOk()); $this->client->submitForm('Change password', [ 'password' => 'secret123', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirect(); $this->client->submitForm('Sign in', [ @@ -184,27 +187,27 @@ public function testPasswordReset(): void 'password' => 'secret123', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); } public function testPasswordResetWithInvalidToken(): void { - $this->client->request('GET', $this->urlTo('app_reset_password', ['token' => 'not-exist'])); + $this->client->request(Request::METHOD_GET, $this->urlTo('app_reset_password', ['token' => 'not-exist'])); $this->client->submitForm('Change password', [ 'password' => 'secret123', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('app_login'))); $this->client->followRedirect(); - self::assertStringContainsString('Invalid or expired password reset token', (string) $this->client->getResponse()->getContent()); + $this->assertStringContainsString('Invalid or expired password reset token', (string) $this->client->getResponse()->getContent()); } private function getUserPasswordResetToken(string $email): string { /** @phpstan-var User $user */ $user = $this->container()->get(UserRepository::class)->findOneBy(['email' => $email]); - $reflection = new \ReflectionObject($user); + $reflection = new ReflectionObject($user); $property = $reflection->getProperty('resetPasswordToken'); $property->setAccessible(true); diff --git a/tests/Functional/Controller/UserControllerTest.php b/tests/Functional/Controller/UserControllerTest.php index cad828af..00572e8e 100644 --- a/tests/Functional/Controller/UserControllerTest.php +++ b/tests/Functional/Controller/UserControllerTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Entity\User\OAuthToken; use Buddy\Repman\Query\User\OrganizationQuery\DbalOrganizationQuery; use Buddy\Repman\Tests\Functional\FunctionalTestCase; +use Symfony\Component\HttpFoundation\Request; final class UserControllerTest extends FunctionalTestCase { @@ -22,23 +23,24 @@ public function testProfileFormRendering(): void { $this->fixtures->createOrganization('buddy', $this->userId); $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITHUB); - $this->client->request('GET', $this->urlTo('user_profile')); - - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Profile', $this->lastResponseBody()); - self::assertStringContainsString('OAuth', $this->lastResponseBody()); - self::assertStringContainsString('Linked to Github', $this->lastResponseBody()); - self::assertStringContainsString('Unlink Github', $this->lastResponseBody()); - self::assertStringContainsString('Change password', $this->lastResponseBody()); - self::assertStringContainsString('Current password', $this->lastResponseBody()); - self::assertStringContainsString('New password', $this->lastResponseBody()); - self::assertStringContainsString('Repeat new password', $this->lastResponseBody()); - self::assertStringContainsString('Delete Account', $this->lastResponseBody()); + + $this->client->request(Request::METHOD_GET, $this->urlTo('user_profile')); + + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Profile', $this->lastResponseBody()); + $this->assertStringContainsString('OAuth', $this->lastResponseBody()); + $this->assertStringContainsString('Linked to Github', $this->lastResponseBody()); + $this->assertStringContainsString('Unlink Github', $this->lastResponseBody()); + $this->assertStringContainsString('Change password', $this->lastResponseBody()); + $this->assertStringContainsString('Current password', $this->lastResponseBody()); + $this->assertStringContainsString('New password', $this->lastResponseBody()); + $this->assertStringContainsString('Repeat new password', $this->lastResponseBody()); + $this->assertStringContainsString('Delete Account', $this->lastResponseBody()); } public function testChangePassword(): void { - $this->client->request('GET', $this->urlTo('user_profile')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_profile')); $this->client->submitForm('changePassword', [ 'currentPassword' => 'password', @@ -46,53 +48,53 @@ public function testChangePassword(): void 'plainPassword[second]' => 'secret123', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); $this->client->setServerParameter('PHP_AUTH_PW', 'secret123'); - $this->client->request('GET', $this->urlTo('user_profile')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_profile')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Your password has been changed', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Your password has been changed', $this->lastResponseBody()); } public function testChangeTimezone(): void { - $this->client->request('GET', $this->urlTo('user_profile')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_profile')); - self::assertStringContainsString('UTC', $this->lastResponseBody()); + $this->assertStringContainsString('UTC', $this->lastResponseBody()); $this->client->submitForm('changeTimezone', [ 'timezone' => 'Europe/Warsaw', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Your timezone has been changed', $this->lastResponseBody()); - self::assertStringContainsString('Europe/Warsaw', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Your timezone has been changed', $this->lastResponseBody()); + $this->assertStringContainsString('Europe/Warsaw', $this->lastResponseBody()); } public function testRemoveAccount(): void { $this->fixtures->createOrganization('buddy', $this->userId); - $this->client->request('DELETE', $this->urlTo('user_remove')); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('user_remove')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('index'))); - self::assertFalse($this->container()->get(DbalOrganizationQuery::class)->getByAlias('buddy')->isEmpty()); + $this->assertFalse($this->container()->get(DbalOrganizationQuery::class)->getByAlias('buddy')->isEmpty()); } public function testResendEmailVerification(): void { - $this->client->request('POST', $this->urlTo('user_resend_verification')); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); + $this->client->request(Request::METHOD_POST, $this->urlTo('user_resend_verification')); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Email sent successfully', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Email sent successfully', $this->lastResponseBody()); } public function testRemoveOAuthToken(): void @@ -100,11 +102,11 @@ public function testRemoveOAuthToken(): void $this->fixtures->createOrganization('buddy', $this->userId); $this->fixtures->createOauthToken($this->userId, OAuthToken::TYPE_GITHUB); - $this->client->request('DELETE', $this->urlTo('user_remove_oauth_token', ['type' => 'github'])); + $this->client->request(Request::METHOD_DELETE, $this->urlTo('user_remove_oauth_token', ['type' => 'github'])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); $this->client->followRedirect(); - self::assertStringContainsString('Github has been successfully unlinked.', $this->lastResponseBody()); + $this->assertStringContainsString('Github has been successfully unlinked.', $this->lastResponseBody()); } public function testChangeEmailPreference(): void @@ -113,69 +115,69 @@ public function testChangeEmailPreference(): void $this->createAndLoginAdmin('email', 'pass', $token); $this->fixtures->confirmUserEmail($token); - $this->client->request('GET', $this->urlTo('user_profile')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_profile')); $this->client->submitForm('changeEmailPreferences', [ 'emailScanResult' => false, ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_profile'))); $this->client->followRedirect(); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Email preferences have been changed', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Email preferences have been changed', $this->lastResponseBody()); } public function testApiTokens(): void { $this->fixtures->createApiToken($this->userId); - $this->client->request('GET', $this->urlTo('user_api_tokens')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_api_tokens')); - self::assertTrue($this->client->getResponse()->isOk()); - self::assertStringContainsString('Showing 1 to 1 of 1 entries', $this->lastResponseBody()); + $this->assertTrue($this->client->getResponse()->isOk()); + $this->assertStringContainsString('Showing 1 to 1 of 1 entries', $this->lastResponseBody()); } public function testGenerateApiTokens(): void { - $this->client->request('GET', $this->urlTo('user_api_token_new')); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_api_token_new')); $this->client->submitForm('Generate', [ 'name' => 'to-generate', ]); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_api_tokens'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_api_tokens'))); $this->client->followRedirect(); - self::assertStringContainsString('to-generate', $this->lastResponseBody()); + $this->assertStringContainsString('to-generate', $this->lastResponseBody()); } public function testRemoveApiTokens(): void { $this->fixtures->createApiToken($this->userId, 'to-delete'); - $this->client->request('GET', $this->urlTo('user_api_tokens')); - self::assertStringContainsString('to-delete', $this->lastResponseBody()); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_api_tokens')); + $this->assertStringContainsString('to-delete', $this->lastResponseBody()); - $this->client->request('DELETE', $this->urlTo('user_api_token_remove', [ + $this->client->request(Request::METHOD_DELETE, $this->urlTo('user_api_token_remove', [ 'token' => 'to-delete', ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_api_tokens'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_api_tokens'))); $this->client->followRedirect(); - self::assertStringNotContainsString('to-delete', $this->lastResponseBody()); + $this->assertStringNotContainsString('to-delete', $this->lastResponseBody()); } public function testRegenerateApiTokens(): void { $this->fixtures->createApiToken($this->userId, 'to-regenerate'); - $this->client->request('GET', $this->urlTo('user_api_tokens')); - self::assertStringContainsString('to-regenerate', $this->lastResponseBody()); + $this->client->request(Request::METHOD_GET, $this->urlTo('user_api_tokens')); + $this->assertStringContainsString('to-regenerate', $this->lastResponseBody()); - $this->client->request('POST', $this->urlTo('user_api_token_regenerate', [ + $this->client->request(Request::METHOD_POST, $this->urlTo('user_api_token_regenerate', [ 'token' => 'to-regenerate', ])); - self::assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_api_tokens'))); + $this->assertTrue($this->client->getResponse()->isRedirect($this->urlTo('user_api_tokens'))); $this->client->followRedirect(); - self::assertStringNotContainsString('to-regenerate', $this->lastResponseBody()); + $this->assertStringNotContainsString('to-regenerate', $this->lastResponseBody()); } } diff --git a/tests/Functional/FunctionalTestCase.php b/tests/Functional/FunctionalTestCase.php index 9a9620d1..cf03a444 100644 --- a/tests/Functional/FunctionalTestCase.php +++ b/tests/Functional/FunctionalTestCase.php @@ -16,6 +16,7 @@ abstract class FunctionalTestCase extends WebTestCase use PHPMatcherAssertions; protected KernelBrowser $client; + protected FixturesManager $fixtures; protected function setUp(): void diff --git a/tests/Integration/FixturesManager.php b/tests/Integration/FixturesManager.php index c896780b..b0184ab9 100644 --- a/tests/Integration/FixturesManager.php +++ b/tests/Integration/FixturesManager.php @@ -29,19 +29,18 @@ use Buddy\Repman\Repository\ScanResultRepository; use Buddy\Repman\Service\Organization\TokenGenerator; use Buddy\Repman\Service\PackageSynchronizer; +use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use Munus\Collection\Stream; use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Test\TestContainer; +use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Messenger\MessageBusInterface; final class FixturesManager { - private TestContainer $container; - - public function __construct(TestContainer $container) + public function __construct(private readonly TestContainer $container) { - $this->container = $container; } /** @@ -116,9 +115,9 @@ public function addAcceptedMember(string $orgId, string $email, string $role = M return $userId; } - public function createPackage(string $id, string $organization = 'buddy', string $organizationId = null): void + public function createPackage(string $id, string $organization = 'buddy', ?string $organizationId = null): void { - $organization = $organizationId !== null ? $organizationId : $this->createOrganization($organization, $this->createUser()); + $organization = $organizationId ?? $this->createOrganization($organization, $this->createUser()); $this->dispatchMessage( new AddPackage( $id, @@ -161,13 +160,13 @@ public function setWebhookError(string $packageId, string $error): void $this->container->get('doctrine.orm.entity_manager')->flush($package); } - public function addPackageDownload(int $count, string $packageId, string $version = '1.0.0', ?\DateTimeImmutable $date = null): void + public function addPackageDownload(int $count, string $packageId, string $version = '1.0.0', ?DateTimeImmutable $date = null): void { Stream::range(1, $count)->forEach(function (int $index) use ($packageId, $version, $date): void { $this->dispatchMessage(new AddDownload( $packageId, $version, - $date ?? new \DateTimeImmutable(), + $date ?? new DateTimeImmutable(), '192.168.0.1', 'Composer 19.10' )); @@ -177,7 +176,7 @@ public function addPackageDownload(int $count, string $packageId, string $versio /** * @param AddDownloads\Package[] $packages */ - public function addProxyPackageDownload(array $packages, \DateTimeImmutable $date): void + public function addProxyPackageDownload(array $packages, DateTimeImmutable $date): void { $this->container->get(AddDownloadsHandler::class)->__invoke(new AddDownloads( $packages, @@ -203,7 +202,7 @@ public function syncPackageWithError(string $packageId, string $error): void * @param Version[] $versions * @param Link[] $links */ - public function syncPackageWithData(string $packageId, string $name, string $description, string $latestReleasedVersion, \DateTimeImmutable $latestReleaseDate, array $versions = [], array $links = [], ?string $readme = null, ?string $replacementPackage = null): void + public function syncPackageWithData(string $packageId, string $name, string $description, string $latestReleasedVersion, DateTimeImmutable $latestReleaseDate, array $versions = [], array $links = [], ?string $readme = null, ?string $replacementPackage = null): void { $this->container->get(PackageSynchronizer::class)->setData($name, $description, $latestReleasedVersion, $latestReleaseDate, $versions, $links, $readme, $replacementPackage); $this->dispatchMessage(new SynchronizePackage($packageId)); @@ -215,7 +214,7 @@ public function createOauthToken( string $type, string $accessToken = 'secret', ?string $refreshToken = null, - ?\DateTimeImmutable $expiresAt = null + ?DateTimeImmutable $expiresAt = null, ): string { $this->dispatchMessage( new AddOAuthToken( @@ -233,7 +232,7 @@ public function createOauthToken( public function prepareRepoFiles(): void { - $filesystem = new \Symfony\Component\Filesystem\Filesystem(); + $filesystem = new Filesystem(); $filesystem->mirror( __DIR__.'/../Resources/fixtures/buddy/dist/buddy-works/repman', __DIR__.'/../Resources/buddy/dist/buddy-works/repman', @@ -247,7 +246,7 @@ public function prepareRepoFiles(): void */ public function addScanResult(string $packageId, string $status, array $content = ['composer.lock' => []]): void { - $date = new \DateTimeImmutable(); + $date = new DateTimeImmutable(); $package = $this->container ->get(PackageRepository::class) ->getById(Uuid::fromString($packageId)); diff --git a/tests/Integration/MessageHandler/Organization/AcceptInvitationHandlerTest.php b/tests/Integration/MessageHandler/Organization/AcceptInvitationHandlerTest.php index 6e7302c0..81fa5812 100644 --- a/tests/Integration/MessageHandler/Organization/AcceptInvitationHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/AcceptInvitationHandlerTest.php @@ -24,16 +24,16 @@ public function testAcceptInvitation(): void /** @var DbalOrganizationQuery $query */ $query = $this->container()->get(DbalOrganizationQuery::class); - self::assertEquals(0, $query->invitationsCount($organizationId)); - self::assertEquals([], $query->findAllInvitations($organizationId, new Filter())); + $this->assertSame(0, $query->invitationsCount($organizationId)); + $this->assertSame([], $query->findAllInvitations($organizationId, new Filter())); /** @var Organization $organization */ $organization = $query->getByAlias('repman')->get(); - self::assertTrue($organization->isOwner($ownerId)); - self::assertFalse($organization->isOwner($invitedId)); + $this->assertTrue($organization->isOwner($ownerId)); + $this->assertFalse($organization->isOwner($invitedId)); - self::assertEquals(2, $query->membersCount($organizationId)); - self::assertEquals([ + $this->assertSame(2, $query->membersCount($organizationId)); + $this->assertEquals([ new Member($ownerId, $ownerEmail, DomainMember::ROLE_OWNER), new Member($invitedId, $invitedEmail, DomainMember::ROLE_MEMBER), ], $query->findAllMembers($organizationId, new Filter())); diff --git a/tests/Integration/MessageHandler/Organization/AddPackageHandlerTest.php b/tests/Integration/MessageHandler/Organization/AddPackageHandlerTest.php index 8616cb45..5ffd6505 100644 --- a/tests/Integration/MessageHandler/Organization/AddPackageHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/AddPackageHandlerTest.php @@ -8,6 +8,7 @@ use Buddy\Repman\Query\User\PackageQuery\DbalPackageQuery; use Buddy\Repman\Tests\Integration\IntegrationTestCase; use Ramsey\Uuid\Uuid; +use Symfony\Component\Messenger\Exception\HandlerFailedException; final class AddPackageHandlerTest extends IntegrationTestCase { @@ -21,7 +22,7 @@ public function testSuccess(): void $id = Uuid::uuid4()->toString(), $organizationId, $url - ) + ) ); $package = $this @@ -30,20 +31,20 @@ public function testSuccess(): void ->getById($id) ->get(); - self::assertEquals($id, $package->id()); - self::assertEquals($url, $package->url()); + $this->assertSame($id, $package->id()); + $this->assertSame($url, $package->url()); } public function testMissingOrganization(): void { - self::expectException('Symfony\Component\Messenger\Exception\HandlerFailedException'); + self::expectException(HandlerFailedException::class); self::expectExceptionMessage('Organization with id c5e33fc9-27b0-42e1-b8cc-49a7f79b49b2 not found.'); $this->dispatchMessage(new AddPackage( Uuid::uuid4()->toString(), 'c5e33fc9-27b0-42e1-b8cc-49a7f79b49b2', 'test.com' - ) + ) ); } } diff --git a/tests/Integration/MessageHandler/Organization/CreateOrganizationHandlerTest.php b/tests/Integration/MessageHandler/Organization/CreateOrganizationHandlerTest.php index 82d946b8..6e9de2a7 100644 --- a/tests/Integration/MessageHandler/Organization/CreateOrganizationHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/CreateOrganizationHandlerTest.php @@ -23,10 +23,10 @@ public function testSuccess(): void /** @var Organization $organization */ $organization = $this->container()->get(DbalOrganizationQuery::class)->getByAlias('acme-inc')->get(); - self::assertEquals('Acme Inc.', $organization->name()); - self::assertEquals('acme-inc', $organization->alias()); - self::assertEquals($id, $organization->id()); - self::assertTrue($organization->isOwner($ownerId)); - self::assertTrue($organization->isMember($ownerId)); + $this->assertSame('Acme Inc.', $organization->name()); + $this->assertSame('acme-inc', $organization->alias()); + $this->assertSame($id, $organization->id()); + $this->assertTrue($organization->isOwner($ownerId)); + $this->assertTrue($organization->isMember($ownerId)); } } diff --git a/tests/Integration/MessageHandler/Organization/GenerateTokenHandlerTest.php b/tests/Integration/MessageHandler/Organization/GenerateTokenHandlerTest.php index 1c41b7be..36304bd5 100644 --- a/tests/Integration/MessageHandler/Organization/GenerateTokenHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/GenerateTokenHandlerTest.php @@ -24,8 +24,8 @@ public function testAddToken(): void $this->dispatchMessage(new GenerateToken($orgId, 'prod')); // then $tokens = $this->container()->get(DbalOrganizationQuery::class)->findAllTokens($orgId, new Filter()); - self::assertCount(1, $tokens); - self::assertEquals('random-string', $tokens[0]->value()); - self::assertEquals('prod', $tokens[0]->name()); + $this->assertCount(1, $tokens); + $this->assertSame('random-string', $tokens[0]->value()); + $this->assertSame('prod', $tokens[0]->name()); } } diff --git a/tests/Integration/MessageHandler/Organization/InviteUserHandlerTest.php b/tests/Integration/MessageHandler/Organization/InviteUserHandlerTest.php index f8003bec..cec44553 100644 --- a/tests/Integration/MessageHandler/Organization/InviteUserHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/InviteUserHandlerTest.php @@ -21,7 +21,7 @@ public function testInviteUser(): void /** @var DbalOrganizationQuery $query */ $query = $this->container()->get(DbalOrganizationQuery::class); - self::assertEquals(1, $query->invitationsCount($organizationId)); - self::assertEquals([new Invitation('some@repman.io', Member::ROLE_MEMBER, $token)], $query->findAllInvitations($organizationId, new Filter())); + $this->assertSame(1, $query->invitationsCount($organizationId)); + $this->assertEquals([new Invitation('some@repman.io', Member::ROLE_MEMBER, $token)], $query->findAllInvitations($organizationId, new Filter())); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php index 4192eb85..7d2295ff 100644 --- a/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php @@ -10,6 +10,9 @@ use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Service\Integration\BitbucketApi; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use DateTimeImmutable; +use Exception; +use RuntimeException; final class AddBitbucketHookHandlerTest extends IntegrationTestCase { @@ -26,17 +29,17 @@ public function testAddHook(): void $package = $this->container()->get(PackageQuery::class)->getById($packageId); - self::assertInstanceOf(\DateTimeImmutable::class, $package->get()->webhookCreatedAt()); + $this->assertInstanceOf(DateTimeImmutable::class, $package->get()->webhookCreatedAt()); $this->container()->get(BitbucketApi::class)->setExceptionOnNextCall( - new \RuntimeException($error = 'Repository was archived so is read-only.') + new RuntimeException($error = 'Repository was archived so is read-only.') ); $handler->__invoke(new AddBitbucketHook($packageId)); $this->container()->get('doctrine.orm.entity_manager')->flush(); $package = $this->container()->get(PackageQuery::class)->getById($packageId); - self::assertStringContainsString($error, (string) $package->get()->webhookCreatedError()); + $this->assertStringContainsString($error, (string) $package->get()->webhookCreatedError()); } public function testHandlePackageNotFoundWithoutError(): void @@ -45,9 +48,9 @@ public function testHandlePackageNotFoundWithoutError(): void try { $handler = $this->container()->get(AddBitbucketHookHandler::class); $handler->__invoke(new AddBitbucketHook('e0ea4d32-4144-4a67-9310-6dae483a6377')); - } catch (\Exception $exception) { + } catch (Exception $exception) { } - self::assertNull($exception); + $this->assertNull($exception); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php index 15408222..6a56d2d8 100644 --- a/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php @@ -10,6 +10,9 @@ use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Service\Integration\GitHubApi; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use DateTimeImmutable; +use Exception; +use RuntimeException; final class AddGitHubHookHandlerTest extends IntegrationTestCase { @@ -26,17 +29,17 @@ public function testAddHook(): void $package = $this->container()->get(PackageQuery::class)->getById($packageId); - self::assertInstanceOf(\DateTimeImmutable::class, $package->get()->webhookCreatedAt()); + $this->assertInstanceOf(DateTimeImmutable::class, $package->get()->webhookCreatedAt()); $this->container()->get(GitHubApi::class)->setExceptionOnNextCall( - new \RuntimeException($error = 'Repository was archived so is read-only.') + new RuntimeException($error = 'Repository was archived so is read-only.') ); $handler->__invoke(new AddGitHubHook($packageId)); $this->container()->get('doctrine.orm.entity_manager')->flush(); $package = $this->container()->get(PackageQuery::class)->getById($packageId); - self::assertStringContainsString($error, (string) $package->get()->webhookCreatedError()); + $this->assertStringContainsString($error, (string) $package->get()->webhookCreatedError()); } public function testHandlePackageNotFoundWithoutError(): void @@ -45,9 +48,9 @@ public function testHandlePackageNotFoundWithoutError(): void try { $handler = $this->container()->get(AddGitHubHookHandler::class); $handler->__invoke(new AddGitHubHook('e0ea4d32-4144-4a67-9310-6dae483a6377')); - } catch (\Exception $exception) { + } catch (Exception $exception) { } - self::assertNull($exception); + $this->assertNull($exception); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php index 75a3c6d4..956449ab 100644 --- a/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php @@ -10,6 +10,9 @@ use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Service\Integration\GitLabApi; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use DateTimeImmutable; +use Exception; +use RuntimeException; final class AddGitLabHookHandlerTest extends IntegrationTestCase { @@ -26,17 +29,17 @@ public function testAddHook(): void $package = $this->container()->get(PackageQuery::class)->getById($packageId); - self::assertInstanceOf(\DateTimeImmutable::class, $package->get()->webhookCreatedAt()); + $this->assertInstanceOf(DateTimeImmutable::class, $package->get()->webhookCreatedAt()); $this->container()->get(GitLabApi::class)->setExceptionOnNextCall( - new \RuntimeException($error = 'Repository was archived so is read-only.') + new RuntimeException($error = 'Repository was archived so is read-only.') ); $handler->__invoke(new AddGitLabHook($packageId)); $this->container()->get('doctrine.orm.entity_manager')->flush(); $package = $this->container()->get(PackageQuery::class)->getById($packageId); - self::assertStringContainsString($error, (string) $package->get()->webhookCreatedError()); + $this->assertStringContainsString($error, (string) $package->get()->webhookCreatedError()); } public function testHandlePackageNotFoundWithoutError(): void @@ -45,9 +48,9 @@ public function testHandlePackageNotFoundWithoutError(): void try { $handler = $this->container()->get(AddGitLabHookHandler::class); $handler->__invoke(new AddGitLabHook('e0ea4d32-4144-4a67-9310-6dae483a6377')); - } catch (\Exception $exception) { + } catch (Exception $exception) { } - self::assertNull($exception); + $this->assertNull($exception); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/RemoveBitbucketHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/RemoveBitbucketHookHandlerTest.php index 3d4bc4c2..b22bcd32 100644 --- a/tests/Integration/MessageHandler/Organization/Package/RemoveBitbucketHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/RemoveBitbucketHookHandlerTest.php @@ -29,6 +29,6 @@ public function testRemoveHook(): void ->get(PackageQuery::class) ->getById($packageId); - self::assertEquals(null, $package->get()->webhookCreatedAt()); + $this->assertEquals(null, $package->get()->webhookCreatedAt()); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php index 82f0cb13..01b14f4c 100644 --- a/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php @@ -9,6 +9,7 @@ use Buddy\Repman\MessageHandler\Organization\Package\RemoveGitHubHookHandler; use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use InvalidArgumentException; final class RemoveGitHubHookHandlerTest extends IntegrationTestCase { @@ -29,12 +30,12 @@ public function testRemoveHook(): void ->get(PackageQuery::class) ->getById($packageId); - self::assertEquals(null, $package->get()->webhookCreatedAt()); + $this->assertEquals(null, $package->get()->webhookCreatedAt()); } public function testPackageNotFound(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Package 9691e73b-1738-42fe-9d5b-31d0dadf7407 not found.'); $handler = $this->container()->get(RemoveGitHubHookHandler::class); diff --git a/tests/Integration/MessageHandler/Organization/Package/RemoveGitLabHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/RemoveGitLabHookHandlerTest.php index 37c7cb91..6a40d9ae 100644 --- a/tests/Integration/MessageHandler/Organization/Package/RemoveGitLabHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/RemoveGitLabHookHandlerTest.php @@ -29,6 +29,6 @@ public function testAddHook(): void ->get(PackageQuery::class) ->getById($packageId); - self::assertEquals(null, $package->get()->webhookCreatedAt()); + $this->assertEquals(null, $package->get()->webhookCreatedAt()); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/UpdateHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/UpdateHandlerTest.php index 28bf97da..15564b8b 100644 --- a/tests/Integration/MessageHandler/Organization/Package/UpdateHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/UpdateHandlerTest.php @@ -6,6 +6,7 @@ use Buddy\Repman\Message\Organization\Package\Update; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use Exception; final class UpdateHandlerTest extends IntegrationTestCase { @@ -14,9 +15,9 @@ public function testHandlePackageNotFoundWithoutError(): void $exception = null; try { $this->dispatchMessage(new Update('e0ea4d32-4144-4a67-9310-6dae483a6377', 'test', 0, true)); - } catch (\Exception $exception) { + } catch (Exception $exception) { } - self::assertNull($exception); + $this->assertNull($exception); } } diff --git a/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php b/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php index 643f69cb..2feaa3b5 100644 --- a/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php @@ -10,6 +10,8 @@ use Buddy\Repman\Query\User\PackageQuery\DbalPackageQuery; use Buddy\Repman\Service\PackageSynchronizer; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use DateTimeImmutable; +use Exception; final class SynchronizePackageHandlerTest extends IntegrationTestCase { @@ -21,7 +23,7 @@ public function testSuccess(): void $name = 'buddy-works/repman', $description = 'Repman - PHP repository manager', $version = '2.0.0', - $date = new \DateTimeImmutable(), + $date = new DateTimeImmutable(), [], [$link = new Link('requires', 'buddy-works/target', '^1.5')], ); @@ -31,19 +33,19 @@ public function testSuccess(): void /** @var Package $package */ $package = $this->container()->get(DbalPackageQuery::class)->getById($packageId)->get(); - self::assertEquals($name, $package->name()); - self::assertEquals($description, $package->description()); - self::assertEquals($version, $package->latestReleasedVersion()); + $this->assertSame($name, $package->name()); + $this->assertSame($description, $package->description()); + $this->assertSame($version, $package->latestReleasedVersion()); - /** @var \DateTimeImmutable $releaseDate */ + /** @var DateTimeImmutable $releaseDate */ $releaseDate = $package->latestReleaseDate(); - self::assertEquals($date->format('Y-m-d H:i:s'), $releaseDate->format('Y-m-d H:i:s')); + $this->assertSame($date->format('Y-m-d H:i:s'), $releaseDate->format('Y-m-d H:i:s')); /** @var Link[] $packageLinks */ $packageLinks = $this->container()->get(DbalPackageQuery::class)->getLinks($packageId, $organizationId)['requires']; - self::assertCount(1, $packageLinks); - self::assertEquals($link->target(), $packageLinks[0]->target()); - self::assertEquals($link->constraint(), $packageLinks[0]->constraint()); + $this->assertCount(1, $packageLinks); + $this->assertSame($link->target(), $packageLinks[0]->target()); + $this->assertSame($link->constraint(), $packageLinks[0]->constraint()); } public function testHandlePackageNotFoundWithoutError(): void @@ -51,9 +53,9 @@ public function testHandlePackageNotFoundWithoutError(): void $exception = null; try { $this->dispatchMessage(new SynchronizePackage('e0ea4d32-4144-4a67-9310-6dae483a6377')); - } catch (\Exception $exception) { + } catch (Exception $exception) { } - self::assertNull($exception); + $this->assertNull($exception); } } diff --git a/tests/Integration/MessageHandler/Proxy/AddDownloadsHandlerTest.php b/tests/Integration/MessageHandler/Proxy/AddDownloadsHandlerTest.php index bc54bade..e4705264 100644 --- a/tests/Integration/MessageHandler/Proxy/AddDownloadsHandlerTest.php +++ b/tests/Integration/MessageHandler/Proxy/AddDownloadsHandlerTest.php @@ -10,6 +10,7 @@ use Buddy\Repman\Query\Admin\Proxy\DownloadsQuery\DbalDownloadsQuery; use Buddy\Repman\Query\Admin\Proxy\Model\Package as DownloadPackage; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use DateTimeImmutable; final class AddDownloadsHandlerTest extends IntegrationTestCase { @@ -23,7 +24,7 @@ public function testAddDownloads(): void new Package('buddy-works/oauth2-client', '0.1.2'), new Package('subctrine/dbal', '1.2.3'), ], - $date = new \DateTimeImmutable(), + $date = new DateTimeImmutable(), '156.101.44.101', 'Repman 1.0' )); @@ -35,9 +36,9 @@ public function testAddDownloads(): void ->get(DbalDownloadsQuery::class) ->findByNames(['buddy-works/oauth2-client', 'subctrine/dbal']); - self::assertEquals([ - 'buddy-works/oauth2-client' => new DownloadPackage(2, new \DateTimeImmutable($date->format('Y-m-d H:i:s'))), - 'subctrine/dbal' => new DownloadPackage(1, new \DateTimeImmutable($date->format('Y-m-d H:i:s'))), + $this->assertEquals([ + 'buddy-works/oauth2-client' => new DownloadPackage(2, new DateTimeImmutable($date->format('Y-m-d H:i:s'))), + 'subctrine/dbal' => new DownloadPackage(1, new DateTimeImmutable($date->format('Y-m-d H:i:s'))), ], $packages); } } diff --git a/tests/Integration/MessageHandler/Proxy/RemoveDistHandlerTest.php b/tests/Integration/MessageHandler/Proxy/RemoveDistHandlerTest.php index fa4473ac..6ea59fc2 100644 --- a/tests/Integration/MessageHandler/Proxy/RemoveDistHandlerTest.php +++ b/tests/Integration/MessageHandler/Proxy/RemoveDistHandlerTest.php @@ -18,7 +18,7 @@ public function testRemoveDistByPackageName(): void new RemoveDist('packagist.org', 'some-vendor/some-name') ); - self::assertTrue(GenericList::ofAll(['buddy-works/repman'])->equals( + $this->assertTrue(GenericList::ofAll(['buddy-works/repman'])->equals( $this->container()->get(ProxyRegister::class)->getByHost('packagist.org')->syncedPackages() )); } diff --git a/tests/Integration/MessageHandler/Security/ScanPackageHandlerTest.php b/tests/Integration/MessageHandler/Security/ScanPackageHandlerTest.php index 14bcb69d..de1d3a18 100644 --- a/tests/Integration/MessageHandler/Security/ScanPackageHandlerTest.php +++ b/tests/Integration/MessageHandler/Security/ScanPackageHandlerTest.php @@ -9,10 +9,12 @@ use Buddy\Repman\Query\User\PackageQuery; use Buddy\Repman\Query\User\PackageQuery\Filter; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use Exception; final class ScanPackageHandlerTest extends IntegrationTestCase { private string $organizationId; + private string $packageId; protected function setUp(): void @@ -34,7 +36,7 @@ public function testScan(): void ->get(PackageQuery::class) ->findAll($this->organizationId, new Filter())[0]; - self::assertEquals($package->scanResultStatus(), 'pending'); + $this->assertSame('pending', $package->scanResultStatus()); } public function testHandlePackageNotFoundWithoutError(): void @@ -43,9 +45,9 @@ public function testHandlePackageNotFoundWithoutError(): void try { $handler = $this->container()->get(ScanPackageHandler::class); $handler->__invoke(new ScanPackage('1a01fc33-5265-43b9-9482-84eddcf0216e')); - } catch (\Exception $exception) { + } catch (Exception $exception) { } - self::assertNull($exception); + $this->assertNull($exception); } } diff --git a/tests/Integration/MessageHandler/Security/SendScanResultHandlerTest.php b/tests/Integration/MessageHandler/Security/SendScanResultHandlerTest.php index 83d84716..c9f383fc 100644 --- a/tests/Integration/MessageHandler/Security/SendScanResultHandlerTest.php +++ b/tests/Integration/MessageHandler/Security/SendScanResultHandlerTest.php @@ -13,6 +13,7 @@ final class SendScanResultHandlerTest extends IntegrationTestCase { private string $organizationId; + private string $packageId; protected function setUp(): void @@ -40,6 +41,6 @@ public function testScan(): void ->get(PackageQuery::class) ->findAll($this->organizationId, new Filter())[0]; - self::assertEquals($package->scanResultStatus(), 'pending'); + $this->assertSame('pending', $package->scanResultStatus()); } } diff --git a/tests/Integration/MessageHandler/User/CreateUserHandlerTest.php b/tests/Integration/MessageHandler/User/CreateUserHandlerTest.php index 5ff0294a..a0272e82 100644 --- a/tests/Integration/MessageHandler/User/CreateUserHandlerTest.php +++ b/tests/Integration/MessageHandler/User/CreateUserHandlerTest.php @@ -21,6 +21,6 @@ public function testCreateUser(): void )); $user = $this->container()->get(DbalUserQuery::class)->getByEmail('test@buddy.works'); - self::assertFalse($user->isEmpty()); + $this->assertFalse($user->isEmpty()); } } diff --git a/tests/Integration/Repository/OrganizationRepositoryTest.php b/tests/Integration/Repository/OrganizationRepositoryTest.php index 2cf3a9d2..eb6e6834 100644 --- a/tests/Integration/Repository/OrganizationRepositoryTest.php +++ b/tests/Integration/Repository/OrganizationRepositoryTest.php @@ -6,6 +6,7 @@ use Buddy\Repman\Repository\OrganizationRepository; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use InvalidArgumentException; final class OrganizationRepositoryTest extends IntegrationTestCase { @@ -13,7 +14,7 @@ public function testMissingInvitationToken(): void { $repo = $this->container()->get(OrganizationRepository::class); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $repo->getByInvitationToken('not-exist'); } } diff --git a/tests/Integration/Repository/PackageRepositoryTest.php b/tests/Integration/Repository/PackageRepositoryTest.php index 7d6c3cb8..6b3638e1 100644 --- a/tests/Integration/Repository/PackageRepositoryTest.php +++ b/tests/Integration/Repository/PackageRepositoryTest.php @@ -6,6 +6,7 @@ use Buddy\Repman\Repository\PackageRepository; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; final class PackageRepositoryTest extends IntegrationTestCase @@ -14,10 +15,10 @@ public function testPackageExist(): void { $orgId = $this->fixtures->createOrganization('buddy', $this->fixtures->createUser()); $packageId = $this->fixtures->addPackage($orgId, 'http://new.package'); - $this->fixtures->syncPackageWithData($packageId, 'buddy/new-package', 'desc', '1.0.0', new \DateTimeImmutable()); + $this->fixtures->syncPackageWithData($packageId, 'buddy/new-package', 'desc', '1.0.0', new DateTimeImmutable()); $repo = $this->container()->get(PackageRepository::class); - self::assertTrue($repo->packageExist('buddy/new-package', Uuid::fromString($orgId))); + $this->assertTrue($repo->packageExist('buddy/new-package', Uuid::fromString($orgId))); } } diff --git a/tests/Integration/Repository/UserRepositoryTest.php b/tests/Integration/Repository/UserRepositoryTest.php index 2d209a1d..23255d7d 100644 --- a/tests/Integration/Repository/UserRepositoryTest.php +++ b/tests/Integration/Repository/UserRepositoryTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Repository\UserRepository; use Buddy\Repman\Security\Model\Organization; use Buddy\Repman\Tests\Integration\IntegrationTestCase; +use InvalidArgumentException; use Ramsey\Uuid\Uuid; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; @@ -29,14 +30,14 @@ public function testUpgradePasswordOnlyForUserClass(): void public function testThrowExceptionWhenNotFoundByEmail(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->users->getByEmail('not@exist.com'); } public function testThrowExceptionWhenNotFoundById(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->users->getById(Uuid::uuid4()); } diff --git a/tests/Integration/Security/BitbucketAuthenticatorTest.php b/tests/Integration/Security/BitbucketAuthenticatorTest.php index e023ef9b..c2a7c03a 100644 --- a/tests/Integration/Security/BitbucketAuthenticatorTest.php +++ b/tests/Integration/Security/BitbucketAuthenticatorTest.php @@ -23,11 +23,11 @@ public function testRedirectToLoginWithFlashOnFailure(): void new UserNotFoundException() ); - self::assertTrue($response->isRedirection()); + $this->assertTrue($response->isRedirection()); $session = $request->getSession(); - self::assertInstanceOf(Session::class, $session); - self::assertTrue($session->getFlashBag()->has('danger')); + $this->assertInstanceOf(Session::class, $session); + $this->assertTrue($session->getFlashBag()->has('danger')); } public function testThrowExceptionIfUserWasNotFound(): void diff --git a/tests/Integration/Security/BuddyAuthenticatorTest.php b/tests/Integration/Security/BuddyAuthenticatorTest.php index 27ee9e99..3071cb63 100644 --- a/tests/Integration/Security/BuddyAuthenticatorTest.php +++ b/tests/Integration/Security/BuddyAuthenticatorTest.php @@ -23,11 +23,11 @@ public function testRedirectToLoginWithFlashOnFailure(): void new UserNotFoundException() ); - self::assertTrue($response->isRedirection()); + $this->assertTrue($response->isRedirection()); $session = $request->getSession(); - self::assertInstanceOf(Session::class, $session); - self::assertTrue($session->getFlashBag()->has('danger')); + $this->assertInstanceOf(Session::class, $session); + $this->assertTrue($session->getFlashBag()->has('danger')); } public function testThrowExceptionIfUserWasNotFound(): void diff --git a/tests/Integration/Security/GitHubAuthenticatorTest.php b/tests/Integration/Security/GitHubAuthenticatorTest.php index ab0875bd..e5b5160a 100644 --- a/tests/Integration/Security/GitHubAuthenticatorTest.php +++ b/tests/Integration/Security/GitHubAuthenticatorTest.php @@ -23,11 +23,11 @@ public function testRedirectToLoginWithFlashOnFailure(): void new UserNotFoundException() ); - self::assertTrue($response->isRedirection()); + $this->assertTrue($response->isRedirection()); $session = $request->getSession(); - self::assertInstanceOf(Session::class, $session); - self::assertTrue($session->getFlashBag()->has('danger')); + $this->assertInstanceOf(Session::class, $session); + $this->assertTrue($session->getFlashBag()->has('danger')); } public function testThrowExceptionIfUserWasNotFound(): void diff --git a/tests/Integration/Security/GitLabAuthenticatorTest.php b/tests/Integration/Security/GitLabAuthenticatorTest.php index 71e619c8..da1b511b 100644 --- a/tests/Integration/Security/GitLabAuthenticatorTest.php +++ b/tests/Integration/Security/GitLabAuthenticatorTest.php @@ -23,11 +23,11 @@ public function testRedirectToLoginWithFlashOnFailure(): void new UserNotFoundException() ); - self::assertTrue($response->isRedirection()); + $this->assertTrue($response->isRedirection()); $session = $request->getSession(); - self::assertInstanceOf(Session::class, $session); - self::assertTrue($session->getFlashBag()->has('danger')); + $this->assertInstanceOf(Session::class, $session); + $this->assertTrue($session->getFlashBag()->has('danger')); } public function testThrowExceptionIfUserWasNotFound(): void diff --git a/tests/Integration/Security/OrganizationProviderTest.php b/tests/Integration/Security/OrganizationProviderTest.php index a6980396..0018193f 100644 --- a/tests/Integration/Security/OrganizationProviderTest.php +++ b/tests/Integration/Security/OrganizationProviderTest.php @@ -21,18 +21,18 @@ public function testLoadCorrectOrganizationByToken(): void $this->fixtures->createToken($org2Id, 'org2-token'); $provider = $this->container()->get(OrganizationProvider::class); - self::assertTrue($provider->supportsClass(Organization::class)); + $this->assertTrue($provider->supportsClass(Organization::class)); /** @var Organization $organization */ $organization = $this->container()->get(OrganizationProvider::class)->loadUserByIdentifier('org1-token'); - self::assertEquals('buddy', $organization->name()); - self::assertEquals($org1Id, $organization->id()); - self::assertEquals('org1-token', $organization->getPassword()); - self::assertEquals('', $organization->getSalt()); - self::assertEquals('buddy', $organization->getUserIdentifier()); + $this->assertSame('buddy', $organization->name()); + $this->assertSame($org1Id, $organization->id()); + $this->assertSame('org1-token', $organization->getPassword()); + $this->assertSame('', $organization->getSalt()); + $this->assertSame('buddy', $organization->getUserIdentifier()); - self::assertEquals($organization, $provider->refreshUser($organization)); + $this->assertEquals($organization, $provider->refreshUser($organization)); $this->expectException(UsernameNotFoundException::class); $provider->refreshUser(new Organization(Uuid::uuid4()->toString(), 'evil', 'evil', 'not-exist')); diff --git a/tests/Integration/Security/UserProviderTest.php b/tests/Integration/Security/UserProviderTest.php index 75332444..c321953b 100644 --- a/tests/Integration/Security/UserProviderTest.php +++ b/tests/Integration/Security/UserProviderTest.php @@ -19,6 +19,6 @@ public function testUpgradeUserPassword(): void $user = $provider->loadUserByIdentifier($email); - self::assertEquals('new-encoded', $user->getPassword()); + $this->assertSame('new-encoded', $user->getPassword()); } } diff --git a/tests/MotherObject/OAuthTokenMother.php b/tests/MotherObject/OAuthTokenMother.php index d113f17b..5725185d 100644 --- a/tests/MotherObject/OAuthTokenMother.php +++ b/tests/MotherObject/OAuthTokenMother.php @@ -6,16 +6,17 @@ use Buddy\Repman\Entity\User; use Buddy\Repman\Entity\User\OAuthToken; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; final class OAuthTokenMother { - public static function withoutRefreshToken(?\DateTimeImmutable $expireAt = null): OAuthToken + public static function withoutRefreshToken(?DateTimeImmutable $expireAt = null): OAuthToken { return new OAuthToken(Uuid::uuid4(), self::user(), OAuthToken::TYPE_GITHUB, 'token', null, $expireAt); } - public static function withExpireTime(\DateTimeImmutable $expireAt): OAuthToken + public static function withExpireTime(DateTimeImmutable $expireAt): OAuthToken { return new OAuthToken(Uuid::uuid4(), self::user(), OAuthToken::TYPE_GITHUB, 'token', 'refresh', $expireAt); } diff --git a/tests/MotherObject/PackageMother.php b/tests/MotherObject/PackageMother.php index 809fb6ea..8ed94d56 100644 --- a/tests/MotherObject/PackageMother.php +++ b/tests/MotherObject/PackageMother.php @@ -8,6 +8,7 @@ use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\User; use Buddy\Repman\Entity\User\OAuthToken; +use DateTimeImmutable; use Ramsey\Uuid\Uuid; final class PackageMother @@ -34,7 +35,7 @@ public static function withOrganizationAndToken(string $type, string $url, strin { $package = new Package( Uuid::uuid4(), - "$type-oauth", + $type.'-oauth', $url ); $package->setOrganization(new Organization( @@ -72,7 +73,7 @@ public static function synchronized(string $name, string $latestVersion, string $latestVersion, $unencounteredVersions, $unencounteredLinks, - new \DateTimeImmutable() + new DateTimeImmutable() ); return $package; diff --git a/tests/MotherObject/Query/OrganizationMother.php b/tests/MotherObject/Query/OrganizationMother.php index f9f222f2..380f9885 100644 --- a/tests/MotherObject/Query/OrganizationMother.php +++ b/tests/MotherObject/Query/OrganizationMother.php @@ -15,7 +15,7 @@ public static function some(): Organization '448e8c58-dd52-4db6-92bd-ab102d5273de', 'Repman', 'repman', - [new Organization\Member('5c1b8e35-fe7b-4418-b722-ec9cbbf2598a', 'test@repman.io', 'owner')], + [new Member('5c1b8e35-fe7b-4418-b722-ec9cbbf2598a', 'test@repman.io', 'owner')], false ); } diff --git a/tests/Unit/DistTest.php b/tests/Unit/DistTest.php index 6abfb5df..2871130b 100644 --- a/tests/Unit/DistTest.php +++ b/tests/Unit/DistTest.php @@ -13,13 +13,13 @@ public function testVersionWithSlash(): void { $dist = new Dist('repo', 'package', 'dev-master/feature', '123456', 'zip'); - self::assertEquals(md5('dev-master/feature'), $dist->version()); + $this->assertSame(md5('dev-master/feature'), $dist->version()); } public function testVersionDevMaster(): void { $dist = new Dist('repo', 'package', 'dev-master', '123456', 'zip'); - self::assertEquals('9999999-dev', $dist->version()); + $this->assertSame('9999999-dev', $dist->version()); } } diff --git a/tests/Unit/Entity/Organization/MemberTest.php b/tests/Unit/Entity/Organization/MemberTest.php index 180d69de..977cb33c 100644 --- a/tests/Unit/Entity/Organization/MemberTest.php +++ b/tests/Unit/Entity/Organization/MemberTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Entity\Organization; use Buddy\Repman\Entity\Organization\Member; use Buddy\Repman\Entity\User; +use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Ramsey\Uuid\Uuid; @@ -14,7 +15,7 @@ final class MemberTest extends TestCase { public function testTestRoleValidation(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); new Member( Uuid::uuid4(), @@ -33,7 +34,7 @@ public function testRoleValidationOnRoleChange(): void Member::ROLE_OWNER ); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $member->changeRole('invalid'); } diff --git a/tests/Unit/Entity/Organization/PackageTest.php b/tests/Unit/Entity/Organization/PackageTest.php index e4fbf02f..ab9fdf37 100644 --- a/tests/Unit/Entity/Organization/PackageTest.php +++ b/tests/Unit/Entity/Organization/PackageTest.php @@ -8,8 +8,10 @@ use Buddy\Repman\Entity\Organization\Package\Link; use Buddy\Repman\Entity\Organization\Package\Version; use Buddy\Repman\Tests\MotherObject\PackageMother; +use DateTimeImmutable; use PHPUnit\Framework\TestCase; use Ramsey\Uuid\Uuid; +use RuntimeException; final class PackageTest extends TestCase { @@ -22,23 +24,23 @@ protected function setUp(): void public function testCheckNameOnSuccessSync(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); - $this->package->syncSuccess('../invalid/name', 'desc', '1.2.0.0', [], [], new \DateTimeImmutable()); + $this->package->syncSuccess('../invalid/name', 'desc', '1.2.0.0', [], [], new DateTimeImmutable()); } public function testSyncSuccessRemovesUnencounteredVersions(): void { - $this->package->addOrUpdateVersion($version1 = new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new \DateTimeImmutable(), Version::STABILITY_STABLE)); - $this->package->addOrUpdateVersion($version2 = new Version(Uuid::uuid4(), '1.0.1', 'anotherref', 5678, new \DateTimeImmutable(), Version::STABILITY_STABLE)); - $this->package->addOrUpdateVersion($version3 = new Version(Uuid::uuid4(), '1.1.0', 'lastref', 6543, new \DateTimeImmutable(), Version::STABILITY_STABLE)); + $this->package->addOrUpdateVersion($version1 = new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new DateTimeImmutable(), Version::STABILITY_STABLE)); + $this->package->addOrUpdateVersion($version2 = new Version(Uuid::uuid4(), '1.0.1', 'anotherref', 5678, new DateTimeImmutable(), Version::STABILITY_STABLE)); + $this->package->addOrUpdateVersion($version3 = new Version(Uuid::uuid4(), '1.1.0', 'lastref', 6543, new DateTimeImmutable(), Version::STABILITY_STABLE)); - $this->package->syncSuccess('some/package', 'desc', '1.1.0', ['1.0.0' => true, '1.1.0' => true], [], new \DateTimeImmutable()); + $this->package->syncSuccess('some/package', 'desc', '1.1.0', ['1.0.0' => true, '1.1.0' => true], [], new DateTimeImmutable()); - self::assertCount(2, $this->package->versions()); - self::assertContains($version1, $this->package->versions()); - self::assertNotContains($version2, $this->package->versions()); - self::assertContains($version3, $this->package->versions()); + $this->assertCount(2, $this->package->versions()); + $this->assertContains($version1, $this->package->versions()); + $this->assertNotContains($version2, $this->package->versions()); + $this->assertContains($version3, $this->package->versions()); } public function testSyncSuccessRemovesUnencounteredLinks(): void @@ -53,84 +55,84 @@ public function testSyncSuccessRemovesUnencounteredLinks(): void '1.1.0', [], ['replaces-buddy-works/testone' => true, 'replaces-buddy-works/testthree' => true], - new \DateTimeImmutable() + new DateTimeImmutable() ); - self::assertCount(2, $this->package->links()); - self::assertContains($link1, $this->package->links()); - self::assertNotContains($link2, $this->package->links()); - self::assertContains($link3, $this->package->links()); + $this->assertCount(2, $this->package->links()); + $this->assertContains($link1, $this->package->links()); + $this->assertNotContains($link2, $this->package->links()); + $this->assertContains($link3, $this->package->links()); } public function testSyncSuccessRemovesDuplicatedLinks(): void { $this->package->addLink(new Link(Uuid::uuid4(), $this->package, 'requires', 'phpunit/phpunit', '^1.0')); $this->package->addLink(new Link(Uuid::uuid4(), $this->package, 'requires', 'phpunit/phpunit', '^1.0')); - $this->package->syncSuccess('some/package', 'desc', '1.1.0', [], ['requires-phpunit/phpunit' => true], new \DateTimeImmutable()); + $this->package->syncSuccess('some/package', 'desc', '1.1.0', [], ['requires-phpunit/phpunit' => true], new DateTimeImmutable()); - self::assertCount(1, $this->package->links()); + $this->assertCount(1, $this->package->links()); } public function testOuathTokenNotFound(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->package->oauthToken(); } public function testMetadataNotFound(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->package->metadata('not-exist'); } public function testPackageGetProperties(): void { - $date = new \DateTimeImmutable(); + $date = new DateTimeImmutable(); $version = new Version($id = Uuid::uuid4(), '1.0.0', 'someref', 1234, $date, Version::STABILITY_STABLE); $this->package->addOrUpdateVersion($version); - self::assertInstanceOf(Version::class, $returnedVersion = $this->package->getVersion('1.0.0')); - self::assertEquals($id, $returnedVersion->id()); - self::assertEquals('1.0.0', $returnedVersion->version()); - self::assertEquals('someref', $returnedVersion->reference()); - self::assertEquals(1234, $returnedVersion->size()); - self::assertEquals($date, $returnedVersion->date()); + $this->assertInstanceOf(Version::class, $returnedVersion = $this->package->getVersion('1.0.0')); + $this->assertEquals($id, $returnedVersion->id()); + $this->assertSame('1.0.0', $returnedVersion->version()); + $this->assertSame('someref', $returnedVersion->reference()); + $this->assertSame(1234, $returnedVersion->size()); + $this->assertEquals($date, $returnedVersion->date()); } public function testPackageNonExisting(): void { - $version = new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new \DateTimeImmutable(), Version::STABILITY_STABLE); + $version = new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new DateTimeImmutable(), Version::STABILITY_STABLE); $this->package->addOrUpdateVersion($version); - self::assertEquals(false, $this->package->getVersion('1.0.1')); + $this->assertEquals(false, $this->package->getVersion('1.0.1')); } public function testPackageUpdateVersion(): void { - $date = new \DateTimeImmutable('tomorrow'); + $date = new DateTimeImmutable('tomorrow'); // Make sure the dates do not match so we can test that it is updated - $version = new Version($id1 = Uuid::uuid4(), '1.0.0', 'someref', 1234, new \DateTimeImmutable('today'), Version::STABILITY_STABLE); + $version = new Version($id1 = Uuid::uuid4(), '1.0.0', 'someref', 1234, new DateTimeImmutable('today'), Version::STABILITY_STABLE); $versionUpdated = new Version($id2 = Uuid::uuid4(), '1.0.0', 'newref', 5678, $date, Version::STABILITY_STABLE); $this->package->addOrUpdateVersion($version); $this->package->addOrUpdateVersion($versionUpdated); - self::assertInstanceOf(Version::class, $returnedVersion = $this->package->getVersion('1.0.0')); - self::assertEquals($id1, $returnedVersion->id()); // We don't update the ID - self::assertEquals('1.0.0', $returnedVersion->version()); - self::assertEquals('newref', $returnedVersion->reference()); - self::assertEquals(5678, $returnedVersion->size()); - self::assertEquals($date, $returnedVersion->date()); + $this->assertInstanceOf(Version::class, $returnedVersion = $this->package->getVersion('1.0.0')); + $this->assertEquals($id1, $returnedVersion->id()); // We don't update the ID + $this->assertSame('1.0.0', $returnedVersion->version()); + $this->assertSame('newref', $returnedVersion->reference()); + $this->assertSame(5678, $returnedVersion->size()); + $this->assertEquals($date, $returnedVersion->date()); } public function testPackageAddSameVersion(): void { - $version = new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new \DateTimeImmutable(), Version::STABILITY_STABLE); + $version = new Version(Uuid::uuid4(), '1.0.0', 'someref', 1234, new DateTimeImmutable(), Version::STABILITY_STABLE); $this->package->addOrUpdateVersion($version); $this->package->addOrUpdateVersion($version); // this should not throw exception - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $version->setPackage($this->package); } } diff --git a/tests/Unit/Entity/OrganizationTest.php b/tests/Unit/Entity/OrganizationTest.php index 4ae2f1cd..de5ea4e5 100644 --- a/tests/Unit/Entity/OrganizationTest.php +++ b/tests/Unit/Entity/OrganizationTest.php @@ -9,12 +9,15 @@ use Buddy\Repman\Entity\Organization\Token; use Buddy\Repman\Entity\User; use Buddy\Repman\Tests\MotherObject\PackageMother; +use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Ramsey\Uuid\Uuid; +use RuntimeException; final class OrganizationTest extends TestCase { private Organization $org; + private User $owner; protected function setUp(): void @@ -29,7 +32,7 @@ public function testOrganizationAddSameToken(): void $this->org->addToken($token); $this->org->addToken($token); // this should not throw exception - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $token->setOrganization($this->org); } @@ -40,7 +43,7 @@ public function testOrganizationAddSamePackage(): void $this->org->addPackage($package); $this->org->addPackage($package); // this should not throw exception - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $package->setOrganization($this->org); } @@ -49,7 +52,7 @@ public function testPreventDoubleInvitation(): void $this->org->inviteUser('some@buddy.works', Member::ROLE_MEMBER, 'token'); $this->org->inviteUser('some@buddy.works', Member::ROLE_MEMBER, 'token'); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->org->inviteUser('other@buddy.works', 'invalid-role', 'token'); } @@ -57,7 +60,7 @@ public function testAcceptMissingInvitation(): void { $this->org->acceptInvitation('not-exist', new User(Uuid::uuid4(), 'user@buddy.works', Uuid::uuid4()->toString(), [])); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->org->inviteUser('user@buddy.works', 'invalid-role', 'token'); } @@ -67,7 +70,7 @@ public function testInviteMember(): void $this->org->acceptInvitation('token', new User(Uuid::uuid4(), 'some@buddy.works', Uuid::uuid4()->toString(), [])); $this->org->inviteUser('some@buddy.works', Member::ROLE_MEMBER, 'token'); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->org->inviteUser('other@buddy.works', 'invalid-role', 'token'); } @@ -77,7 +80,7 @@ public function testIgnoreWhenUserTriesToAcceptNotOwnInvitation(): void $this->org->acceptInvitation('token', new User(Uuid::uuid4(), 'bad@buddy.works', Uuid::uuid4()->toString(), [])); $this->org->removeInvitation('token'); - self::assertTrue($this->org->inviteUser('some@buddy.works', Member::ROLE_MEMBER, 'token')); + $this->assertTrue($this->org->inviteUser('some@buddy.works', Member::ROLE_MEMBER, 'token')); } public function testPreventToOrphanOrganizationByRemovingLastOwner(): void @@ -86,7 +89,7 @@ public function testPreventToOrphanOrganizationByRemovingLastOwner(): void $this->org->acceptInvitation('token', $member = new User(Uuid::uuid4(), 'some@buddy.works', Uuid::uuid4()->toString(), [])); $this->org->removeMember($this->owner); - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Organisation must have at least one owner.'); $this->org->removeMember($member); @@ -98,7 +101,7 @@ public function testPreventToOrphanOrganizationByChangeRoleOfLastOwner(): void $this->org->acceptInvitation('token', $member = new User(Uuid::uuid4(), 'some@buddy.works', Uuid::uuid4()->toString(), [])); $this->org->changeRole($this->owner, Member::ROLE_MEMBER); - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Organisation must have at least one owner.'); $this->org->changeRole($member, Member::ROLE_MEMBER); diff --git a/tests/Unit/Entity/User/OAuthTokenTest.php b/tests/Unit/Entity/User/OAuthTokenTest.php index 64eb6bda..ea068062 100644 --- a/tests/Unit/Entity/User/OAuthTokenTest.php +++ b/tests/Unit/Entity/User/OAuthTokenTest.php @@ -7,8 +7,12 @@ use Buddy\Repman\Service\User\UserOAuthTokenRefresher; use Buddy\Repman\Service\User\UserOAuthTokenRefresher\AccessToken; use Buddy\Repman\Tests\MotherObject\OAuthTokenMother; +use DateTimeImmutable; +use Iterator; +use LogicException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use RuntimeException; final class OAuthTokenTest extends TestCase { @@ -27,25 +31,25 @@ protected function setUp(): void */ public function testExpiredAccessToken(string $modifyTime): void { - $token = OAuthTokenMother::withExpireTime((new \DateTimeImmutable())->modify($modifyTime)); + $token = OAuthTokenMother::withExpireTime((new DateTimeImmutable())->modify($modifyTime)); $this->refresher->method('refresh')->willReturn(new AccessToken('new-token')); - self::assertEquals('new-token', $token->accessToken($this->refresher)); + $this->assertSame('new-token', $token->accessToken($this->refresher)); } public function testAccessTokenWithFutureExpirationDate(): void { - $token = OAuthTokenMother::withExpireTime((new \DateTimeImmutable())->modify('61 sec')); + $token = OAuthTokenMother::withExpireTime((new DateTimeImmutable())->modify('61 sec')); - self::assertEquals('token', $token->accessToken($this->refresher)); + $this->assertSame('token', $token->accessToken($this->refresher)); } public function testErrorDuringRefresh(): void { - $token = OAuthTokenMother::withExpireTime((new \DateTimeImmutable())->modify('-1 day')); - $this->refresher->method('refresh')->willThrowException(new \RuntimeException('invalid refresh_token')); + $token = OAuthTokenMother::withExpireTime((new DateTimeImmutable())->modify('-1 day')); + $this->refresher->method('refresh')->willThrowException(new RuntimeException('invalid refresh_token')); - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessageMatches('/invalid refresh_token/'); $token->accessToken($this->refresher); @@ -53,9 +57,9 @@ public function testErrorDuringRefresh(): void public function testErrorWhenMissingRefreshToken(): void { - $token = OAuthTokenMother::withoutRefreshToken((new \DateTimeImmutable())->modify('-1 day')); + $token = OAuthTokenMother::withoutRefreshToken((new DateTimeImmutable())->modify('-1 day')); - $this->expectException(\LogicException::class); + $this->expectException(LogicException::class); $token->accessToken($this->refresher); } @@ -63,13 +67,11 @@ public function testErrorWhenMissingRefreshToken(): void /** * @return mixed[] */ - public function expiredTimeProvider(): array + public function expiredTimeProvider(): Iterator { - return [ - ['-1 hour'], - ['0 sec'], - ['9 sec'], - ['1 min'], - ]; + yield ['-1 hour']; + yield ['0 sec']; + yield ['9 sec']; + yield ['1 min']; } } diff --git a/tests/Unit/Entity/UserTest.php b/tests/Unit/Entity/UserTest.php index b6043b39..66789e9c 100644 --- a/tests/Unit/Entity/UserTest.php +++ b/tests/Unit/Entity/UserTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Entity\Organization; use Buddy\Repman\Entity\Organization\Member; use Buddy\Repman\Entity\User; +use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Ramsey\Uuid\Uuid; @@ -24,14 +25,14 @@ public function testResetPassword(): void $this->user->setResetPasswordToken('token'); $this->user->resetPassword('token', 'secret', 3600); - self::assertEquals('secret', $this->user->getPassword()); + $this->assertSame('secret', $this->user->getPassword()); } public function testResetPasswordWithInvalidToken(): void { $this->user->setResetPasswordToken('token'); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->user->resetPassword('other', 'secret', 3600); } @@ -40,7 +41,7 @@ public function testResetPasswordWhenTokenExpired(): void { $this->user->setResetPasswordToken('token'); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->user->resetPassword('token', 'secret', -1); } @@ -49,7 +50,7 @@ public function testConfirmEmailAddress(): void { $this->user->confirmEmail('4f6a2491-244a-4aef-8ec9-8dc36f7a10ce'); - self::assertNotNull($this->user->emailConfirmedAt()); + $this->assertNotNull($this->user->emailConfirmedAt()); } public function testConfirmEmailAddressSetConfirmTimeOnlyOnce(): void @@ -58,12 +59,12 @@ public function testConfirmEmailAddressSetConfirmTimeOnlyOnce(): void $time = $this->user->emailConfirmedAt(); $this->user->confirmEmail('4f6a2491-244a-4aef-8ec9-8dc36f7a10ce'); - self::assertEquals($time, $this->user->emailConfirmedAt()); + $this->assertEquals($time, $this->user->emailConfirmedAt()); } public function testConfirmEmailAddressWithInvalidToken(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->user->confirmEmail('wrong'); } @@ -72,7 +73,7 @@ public function testEmailLowercase(): void { $user = new User(Uuid::uuid4(), 'tEsT@buDDy.woRKs', '4f6a2491-244a-4aef-8ec9-8dc36f7a10ce', ['ROLE_USER']); - self::assertEquals($user->getEmail(), 'test@buddy.works'); + $this->assertSame('test@buddy.works', $user->getEmail()); } public function testIgnoreIfIsAlreadyMember(): void @@ -80,6 +81,6 @@ public function testIgnoreIfIsAlreadyMember(): void $organization = new Organization(Uuid::uuid4(), $this->user, 'repman', 'repman'); $this->user->addMembership(new Member(Uuid::uuid4(), $this->user, $organization, Member::ROLE_MEMBER)); - self::assertEquals(1, $this->user->getOrganizations()->count()); + $this->assertCount(1, $this->user->getOrganizations()); } } diff --git a/tests/Unit/MessageHandler/Security/ScanPackageHandlerTest.php b/tests/Unit/MessageHandler/Security/ScanPackageHandlerTest.php index 6952dd25..f773a5dc 100644 --- a/tests/Unit/MessageHandler/Security/ScanPackageHandlerTest.php +++ b/tests/Unit/MessageHandler/Security/ScanPackageHandlerTest.php @@ -19,6 +19,7 @@ final class ScanPackageHandlerTest extends TestCase * @var MockObject&PackageScanner */ private PackageScanner $packageScanner; + /** * @var MockObject&PackageRepository */ diff --git a/tests/Unit/Security/Model/OrganizationTest.php b/tests/Unit/Security/Model/OrganizationTest.php index a4e441dd..c8c9b0b8 100644 --- a/tests/Unit/Security/Model/OrganizationTest.php +++ b/tests/Unit/Security/Model/OrganizationTest.php @@ -13,6 +13,6 @@ public function testGetUsername(): void { $organization = new Organization('foo', 'bar', 'baz', 'quz'); - self::assertSame('baz', $organization->getUsername()); + $this->assertSame('baz', $organization->getUsername()); } } diff --git a/tests/Unit/Security/Model/UserTest.php b/tests/Unit/Security/Model/UserTest.php index 6615bf95..9f407e7e 100644 --- a/tests/Unit/Security/Model/UserTest.php +++ b/tests/Unit/Security/Model/UserTest.php @@ -23,28 +23,28 @@ protected function setUp(): void public function testNoneWhenNoOrganizations(): void { - self::assertTrue(Option::none()->equals($this->user->firstOrganizationAlias())); + $this->assertTrue(Option::none()->equals($this->user->firstOrganizationAlias())); } public function testIsEqualTo(): void { - self::assertTrue($this->user->isEqualTo(UserMother::withoutOrganizations())); + $this->assertTrue($this->user->isEqualTo(UserMother::withoutOrganizations())); - self::assertFalse($this->user->isEqualTo(UserMother::withoutOrganizations('other@repman.io'))); - self::assertFalse($this->user->isEqualTo(UserMother::withRoles(['ROLE_ADMIN']))); - self::assertFalse($this->user->isEqualTo(new Organization('id', 'name', 'alias', 'token'))); + $this->assertFalse($this->user->isEqualTo(UserMother::withoutOrganizations('other@repman.io'))); + $this->assertFalse($this->user->isEqualTo(UserMother::withRoles(['ROLE_ADMIN']))); + $this->assertFalse($this->user->isEqualTo(new Organization('id', 'name', 'alias', 'token'))); } public function testIsMemberOfOrganization(): void { $organization = new User\Organization('buddy', 'Buddy', Member::ROLE_MEMBER, true); - self::assertFalse(UserMother::withOrganizations(Uuid::uuid4()->toString(), [$organization])->isMemberOfOrganization('test')); - self::assertFalse(UserMother::withOrganizations(Uuid::uuid4()->toString(), [$organization])->isMemberOfOrganization('Buddy')); - self::assertTrue(UserMother::withOrganizations(Uuid::uuid4()->toString(), [$organization])->isMemberOfOrganization('buddy')); + $this->assertFalse(UserMother::withOrganizations(Uuid::uuid4()->toString(), [$organization])->isMemberOfOrganization('test')); + $this->assertFalse(UserMother::withOrganizations(Uuid::uuid4()->toString(), [$organization])->isMemberOfOrganization('Buddy')); + $this->assertTrue(UserMother::withOrganizations(Uuid::uuid4()->toString(), [$organization])->isMemberOfOrganization('buddy')); } public function testGetUsername(): void { - self::assertSame('test@repman.io', $this->user->getUsername()); + $this->assertSame('test@repman.io', $this->user->getUsername()); } } diff --git a/tests/Unit/Security/UserCheckerTest.php b/tests/Unit/Security/UserCheckerTest.php index 51d68fec..67167741 100644 --- a/tests/Unit/Security/UserCheckerTest.php +++ b/tests/Unit/Security/UserCheckerTest.php @@ -18,6 +18,6 @@ public function testCheckerOnlyForUserInstance(): void $checker->checkPostAuth($organization); // exception was not thrown - self::assertEquals('buddy', $organization->name()); + $this->assertSame('buddy', $organization->name()); } } diff --git a/tests/Unit/Service/Downloader/ReactDownloaderTest.php b/tests/Unit/Service/Downloader/ReactDownloaderTest.php index 0e9b3f68..06df9ef4 100644 --- a/tests/Unit/Service/Downloader/ReactDownloaderTest.php +++ b/tests/Unit/Service/Downloader/ReactDownloaderTest.php @@ -5,6 +5,7 @@ namespace Buddy\Repman\Tests\Unit\Service\Downloader; use Buddy\Repman\Service\Downloader\ReactDownloader; +use LogicException; use Munus\Control\Option; use PHPUnit\Framework\TestCase; @@ -14,31 +15,31 @@ public function testSuccessDownload(): void { $packages = __DIR__.'/../../../Resources/packages.json'; - self::assertIsResource((new ReactDownloader())->getContents($packages)->getOrNull()); + $this->assertIsResource((new ReactDownloader())->getContents($packages)->getOrNull()); } public function testFailedDownload(): void { - self::assertTrue(Option::none()->equals( + $this->assertTrue(Option::none()->equals( (new ReactDownloader())->getContents('/tmp/not-exists') )); } public function testNotFoundHandler(): void { - $this->expectException(\LogicException::class); + $this->expectException(LogicException::class); - (new ReactDownloader())->getContents('https://repman.io/not-exist', [], function (): void {throw new \LogicException('Not found'); }); + (new ReactDownloader())->getContents('https://repman.io/not-exist', [], function (): void {throw new LogicException('Not found'); }); } public function testLastModified(): void { $downloader = new ReactDownloader(); $downloader->getLastModified('https://repman.io', function (int $timestamp): void { - self::assertTrue($timestamp > 0); + $this->assertGreaterThan(0, $timestamp); }); $downloader->getLastModified('/tmp/not-exists', function (int $timestamp): void { - throw new \LogicException('Should not happen'); + throw new LogicException('Should not happen'); }); $downloader->run(); } @@ -51,10 +52,10 @@ public function testAsyncContent(): void $downloader = new ReactDownloader(); $downloader->getAsyncContents('https://repman.io', [], function ($stream): void { $meta = stream_get_meta_data($stream); - self::assertTrue($meta['uri'] === 'https://repman.io'); + $this->assertSame('https://repman.io', $meta['uri']); }); $downloader->getAsyncContents('/tmp/not-exists', [], function ($stream): void { - throw new \LogicException('Should not happen'); + throw new LogicException('Should not happen'); }); $downloader->run(); } diff --git a/tests/Unit/Service/Integration/Aws/S3AdapterFactoryTest.php b/tests/Unit/Service/Integration/Aws/S3AdapterFactoryTest.php index ce3c23e0..fbf6f546 100644 --- a/tests/Unit/Service/Integration/Aws/S3AdapterFactoryTest.php +++ b/tests/Unit/Service/Integration/Aws/S3AdapterFactoryTest.php @@ -6,6 +6,8 @@ use Aws\Credentials\Credentials; use Buddy\Repman\Service\Integration\Aws\S3AdapterFactory; +use InvalidArgumentException; +use Iterator; use PHPUnit\Framework\TestCase; class S3AdapterFactoryTest extends TestCase @@ -17,8 +19,8 @@ public function testCreateWithMachineCredentials(): void $instance = $factory->create(); $cfg = $instance->getConfig(); - self::assertSame('eu-east-1', $cfg['signing_region']); - self::assertSame('s3v4', $cfg['signature_version']); + $this->assertSame('eu-east-1', $cfg['signing_region']); + $this->assertSame('s3v4', $cfg['signature_version']); } public function testCreateWithOpaqueCredentials(): void @@ -28,13 +30,13 @@ public function testCreateWithOpaqueCredentials(): void $instance = $factory->create(); $cfg = $instance->getConfig(); - self::assertSame('eu-east-1', $cfg['signing_region']); - self::assertSame('s3v4', $cfg['signature_version']); + $this->assertSame('eu-east-1', $cfg['signing_region']); + $this->assertSame('s3v4', $cfg['signature_version']); /** @var Credentials $creds */ $creds = $instance->getCredentials()->wait(); - self::assertSame('mykey', $creds->getAccessKeyId()); - self::assertSame('secret', $creds->getSecretKey()); + $this->assertSame('mykey', $creds->getAccessKeyId()); + $this->assertSame('secret', $creds->getSecretKey()); } public function testCreateWithoutEndpoint(): void @@ -44,7 +46,7 @@ public function testCreateWithoutEndpoint(): void $instance = $factory->create(); $endpoint = $instance->getEndpoint(); - self::assertSame($endpoint->getHost(), 's3.eu-east-1.amazonaws.com'); + $this->assertSame('s3.eu-east-1.amazonaws.com', $endpoint->getHost()); } public function testCreateWithEndpoint(): void @@ -60,7 +62,7 @@ public function testCreateWithEndpoint(): void $instance = $factory->create(); $endpoint = $instance->getEndpoint(); - self::assertSame('s3.example.com', $endpoint->getHost()); + $this->assertSame('s3.example.com', $endpoint->getHost()); } public function testCreateWithPathStyleEndpoints(): void @@ -75,7 +77,7 @@ public function testCreateWithPathStyleEndpoints(): void ); $instance = $factory->create(); - self::assertTrue($instance->getConfig('use_path_style_endpoint')); + $this->assertTrue($instance->getConfig('use_path_style_endpoint')); } public function testExpectDefaultPathStyleOptionToBeFalse(): void @@ -89,40 +91,38 @@ public function testExpectDefaultPathStyleOptionToBeFalse(): void ); $instance = $factory->create(); - self::assertFalse($instance->getConfig('use_path_style_endpoint')); + $this->assertFalse($instance->getConfig('use_path_style_endpoint')); } /** * @return array> */ - public function providesInvalidValueCombinationOfKeyAndSecret(): array + public function providesInvalidValueCombinationOfKeyAndSecret(): Iterator { - return [ - 'when key is empty' => [ - '$key' => '', - '$secret' => 'my_secret', - '$expectedMessage' => 'Must pass AWS key when authentication is opaque', - ], - 'when key is null' => [ - '$key' => null, - '$secret' => 'my_secret', - '$expectedMessage' => 'Must pass AWS key when authentication is opaque', - ], - 'when secret is empty' => [ - '$key' => 'mykey', - '$secret' => '', - '$expectedMessage' => 'Must pass AWS secret when authentication is opaque', - ], - 'when secret is null' => [ - '$key' => 'mykey', - '$secret' => null, - '$expectedMessage' => 'Must pass AWS secret when authentication is opaque', - ], - 'when both are invalid' => [ - '$key' => '', - '$secret' => '', - '$expectedMessage' => 'Must pass AWS key when authentication is opaque', - ], + yield 'when key is empty' => [ + '$key' => '', + '$secret' => 'my_secret', + '$expectedMessage' => 'Must pass AWS key when authentication is opaque', + ]; + yield 'when key is null' => [ + '$key' => null, + '$secret' => 'my_secret', + '$expectedMessage' => 'Must pass AWS key when authentication is opaque', + ]; + yield 'when secret is empty' => [ + '$key' => 'mykey', + '$secret' => '', + '$expectedMessage' => 'Must pass AWS secret when authentication is opaque', + ]; + yield 'when secret is null' => [ + '$key' => 'mykey', + '$secret' => null, + '$expectedMessage' => 'Must pass AWS secret when authentication is opaque', + ]; + yield 'when both are invalid' => [ + '$key' => '', + '$secret' => '', + '$expectedMessage' => 'Must pass AWS key when authentication is opaque', ]; } @@ -132,9 +132,9 @@ public function providesInvalidValueCombinationOfKeyAndSecret(): array public function testOpaqueWithoutCredentialsWillThrowError( ?string $key, ?string $secret, - string $expectedMessage + string $expectedMessage, ): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage($expectedMessage); new S3AdapterFactory('eu-east-1', true, $key, $secret); } diff --git a/tests/Unit/Service/Integration/BitbucketApi/RestBitbucketApiTest.php b/tests/Unit/Service/Integration/BitbucketApi/RestBitbucketApiTest.php index a32676a3..4949bf2e 100644 --- a/tests/Unit/Service/Integration/BitbucketApi/RestBitbucketApiTest.php +++ b/tests/Unit/Service/Integration/BitbucketApi/RestBitbucketApiTest.php @@ -13,6 +13,7 @@ use Buddy\Repman\Service\Integration\BitbucketApi\RestBitbucketApi; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use RuntimeException; final class RestBitbucketApiTest extends TestCase { @@ -41,29 +42,29 @@ public function testReturnPrimaryEmail(): void { $currentUser = $this->createMock(CurrentUser::class); $currentUser->method('listEmails')->willReturn([ - 'pagelen' => 10, - 'values' => [ - [ - 'is_primary' => false, - 'is_confirmed' => false, - 'type' => 'email', - 'email' => 'admin.of@the.world', - 'links' => [], - ], - [ - 'is_primary' => true, - 'is_confirmed' => true, - 'type' => 'email', - 'email' => 'test@buddy.works', - 'links' => [], + 'pagelen' => 10, + 'values' => [ + [ + 'is_primary' => false, + 'is_confirmed' => false, + 'type' => 'email', + 'email' => 'admin.of@the.world', + 'links' => [], + ], + [ + 'is_primary' => true, + 'is_confirmed' => true, + 'type' => 'email', + 'email' => 'test@buddy.works', + 'links' => [], + ], ], - ], - 'page' => 1, - 'size' => 2, + 'page' => 1, + 'size' => 2, ]); $this->clientMock->method('currentUser')->willReturn($currentUser); - self::assertEquals('test@buddy.works', $this->api->primaryEmail('token')); + $this->assertSame('test@buddy.works', $this->api->primaryEmail('token')); } public function testThrowExceptionWhenPrimaryEmailNotFound(): void @@ -72,7 +73,7 @@ public function testThrowExceptionWhenPrimaryEmailNotFound(): void $currentUser->method('listEmails')->willReturn([]); $this->clientMock->method('currentUser')->willReturn($currentUser); - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->api->primaryEmail('token'); } @@ -92,7 +93,7 @@ public function testFetchRepositories(): void ]); $this->clientMock->method('repositories')->willReturn($this->createMock(RepositoriesApi::class)); - self::assertEquals(new Repositories([ + $this->assertEquals(new Repositories([ new Repository('099acebd-5158-459e-b05c-30e51b49a1a8', 'repman/left-pad', 'https://gitlab.com/repman/left-pad.git'), new Repository('74fb57b9-0820-4165-bba0-892eef8f69b8', 'repman/right-pad', 'https://gitlab.com/repman/right-pad.git'), ]), $this->api->repositories('token')); diff --git a/tests/Unit/Service/Integration/BuddyApi/RestBuddyApiTest.php b/tests/Unit/Service/Integration/BuddyApi/RestBuddyApiTest.php index 91294bb1..0afa7445 100644 --- a/tests/Unit/Service/Integration/BuddyApi/RestBuddyApiTest.php +++ b/tests/Unit/Service/Integration/BuddyApi/RestBuddyApiTest.php @@ -56,6 +56,6 @@ public function testPrimaryEmail(): void ]))); $this->client->method('getApiEmails')->willReturn($emails); - self::assertEquals('admin@buddy.works', $this->api->primaryEmail('some-token')); + $this->assertSame('admin@buddy.works', $this->api->primaryEmail('some-token')); } } diff --git a/tests/Unit/Service/Integration/GitHubApi/RestGitHubApiTest.php b/tests/Unit/Service/Integration/GitHubApi/RestGitHubApiTest.php index e2fc6b67..d574a5b9 100644 --- a/tests/Unit/Service/Integration/GitHubApi/RestGitHubApiTest.php +++ b/tests/Unit/Service/Integration/GitHubApi/RestGitHubApiTest.php @@ -13,6 +13,7 @@ use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use RuntimeException; final class RestGitHubApiTest extends TestCase { @@ -58,7 +59,7 @@ public function testReturnPrimaryEmail(): void ]); $this->clientMock->method('currentUser')->willReturn($currentUser); - self::assertEquals('test@buddy.works', $this->api->primaryEmail('token')); + $this->assertSame('test@buddy.works', $this->api->primaryEmail('token')); } public function testThrowExceptionWhenPrimaryEmailNotFound(): void @@ -70,7 +71,7 @@ public function testThrowExceptionWhenPrimaryEmailNotFound(): void $emails->method('all')->willReturn([]); $this->clientMock->method('currentUser')->willReturn($currentUser); - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->api->primaryEmail('token'); } @@ -101,7 +102,7 @@ public function testReturnRepository(): void $this->clientMock->method('currentUser')->willReturn($currentUser); $this->clientMock->method('organization')->willReturn($organization); - self::assertEquals([ + $this->assertSame([ 'private/repman', 'buddy/repman', 'buddy/left-pad', diff --git a/tests/Unit/Service/Integration/GitLabApi/ProjectsTest.php b/tests/Unit/Service/Integration/GitLabApi/ProjectsTest.php index eab08717..6bb9f647 100644 --- a/tests/Unit/Service/Integration/GitLabApi/ProjectsTest.php +++ b/tests/Unit/Service/Integration/GitLabApi/ProjectsTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Service\Integration\GitLabApi\Project; use Buddy\Repman\Service\Integration\GitLabApi\Projects; use PHPUnit\Framework\TestCase; +use RuntimeException; final class ProjectsTest extends TestCase { @@ -17,10 +18,10 @@ public function testReturnProjectsNames(): void new Project(2, 'second', 'url'), ]); - self::assertEquals([1 => 'first', 2 => 'second'], $projects->names()); + $this->assertSame([1 => 'first', 2 => 'second'], $projects->names()); $projects = new Projects([]); - self::assertEquals([], $projects->names()); + $this->assertSame([], $projects->names()); } public function testThrowExceptionWhenProjectNotFound(): void @@ -29,7 +30,7 @@ public function testThrowExceptionWhenProjectNotFound(): void $first = new Project(1, 'first', 'url'), ]); - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $projects->get(666); } } diff --git a/tests/Unit/Service/Integration/GitLabApi/RestGitLabApiTest.php b/tests/Unit/Service/Integration/GitLabApi/RestGitLabApiTest.php index 70d07c0b..5fbb8148 100644 --- a/tests/Unit/Service/Integration/GitLabApi/RestGitLabApiTest.php +++ b/tests/Unit/Service/Integration/GitLabApi/RestGitLabApiTest.php @@ -57,7 +57,7 @@ public function testFetchUserProjects(): void ]); $this->clientMock->method('projects')->willReturn($projects); - self::assertEquals(new Projects([ + $this->assertEquals(new Projects([ new Project(17275574, 'repman/left-pad', 'https://gitlab.com/repman/left-pad'), new Project(17275573, 'repman/right-pad', 'https://gitlab.com/repman/right-pad'), ]), $this->api->projects('gitlab-token')); diff --git a/tests/Unit/Service/JsonTest.php b/tests/Unit/Service/JsonTest.php index 2ecf79cd..2b975809 100644 --- a/tests/Unit/Service/JsonTest.php +++ b/tests/Unit/Service/JsonTest.php @@ -5,28 +5,28 @@ namespace Buddy\Repman\Tests\Unit\Service; use Buddy\Repman\Service\Json; +use Iterator; use PHPUnit\Framework\TestCase; final class JsonTest extends TestCase { /** * @param array $data + * * @dataProvider decodeDataProvider */ public function testJsonDecode(array $data, string $json): void { - self::assertEquals($data, Json::decode($json)); + $this->assertEquals($data, Json::decode($json)); } /** * @return array */ - public function decodeDataProvider(): array + public function decodeDataProvider(): Iterator { - return [ - [[], ''], - [[], 'invalid'], - [['some' => 'data'], '{"some":"data"}'], - ]; + yield [[], '']; + yield [[], 'invalid']; + yield [['some' => 'data'], '{"some":"data"}']; } } diff --git a/tests/Unit/Service/Organization/AliasGeneratorTest.php b/tests/Unit/Service/Organization/AliasGeneratorTest.php index 6bea3e9f..8130f605 100644 --- a/tests/Unit/Service/Organization/AliasGeneratorTest.php +++ b/tests/Unit/Service/Organization/AliasGeneratorTest.php @@ -14,9 +14,6 @@ public function testGenerate(): void $generator = new AliasGenerator(); $name = " - _.1234567890Test ąęśźćńłó ĄĘŚŹĆŃŁÓ !@#$%^&*(){}[]:\";'\/`~|<>,.ÅåÄäÖöÆæØøÜü"; - self::assertEquals( - '_-1234567890test-aeszcnlo-aeszcnlo-aaaaooaeaeoouu', - $generator->generate($name) - ); + $this->assertSame('_-1234567890test-aeszcnlo-aeszcnlo-aaaaooaeaeoouu', $generator->generate($name)); } } diff --git a/tests/Unit/Service/Organization/MemberParamConverterTest.php b/tests/Unit/Service/Organization/MemberParamConverterTest.php index 93803bea..99cf55f7 100644 --- a/tests/Unit/Service/Organization/MemberParamConverterTest.php +++ b/tests/Unit/Service/Organization/MemberParamConverterTest.php @@ -43,7 +43,7 @@ public function testCheckIfMemberIsAlreadyConverted(): void 'member' => $member, ]), new ParamConverter(['name' => 'member'])); - self::assertEquals($member, $request->attributes->get('member')); + $this->assertEquals($member, $request->attributes->get('member')); } public function testConvertMember(): void @@ -55,7 +55,7 @@ public function testConvertMember(): void $converter = new MemberParamConverter(); $converter->apply($request = new Request([], [], ['organization' => $organization, 'member' => $memberId]), new ParamConverter(['name' => 'member'])); - self::assertEquals($member, $request->attributes->get('member')); + $this->assertEquals($member, $request->attributes->get('member')); } public function testThrowNotFoundExceptionWhenNoMember(): void diff --git a/tests/Unit/Service/Organization/OrganizationParamConverterTest.php b/tests/Unit/Service/Organization/OrganizationParamConverterTest.php index 34fe80fc..3c6c859c 100644 --- a/tests/Unit/Service/Organization/OrganizationParamConverterTest.php +++ b/tests/Unit/Service/Organization/OrganizationParamConverterTest.php @@ -45,6 +45,6 @@ public function testConvertOrganization(): void $converter->apply($request = new Request([], [], ['organization' => 'buddy']), new ParamConverter(['name' => 'organization'])); - self::assertEquals($organization, $request->attributes->get('organization')); + $this->assertEquals($organization, $request->attributes->get('organization')); } } diff --git a/tests/Unit/Service/Organization/OrganizationVoterTest.php b/tests/Unit/Service/Organization/OrganizationVoterTest.php index 6c044f05..b337eea5 100644 --- a/tests/Unit/Service/Organization/OrganizationVoterTest.php +++ b/tests/Unit/Service/Organization/OrganizationVoterTest.php @@ -6,7 +6,7 @@ use Buddy\Repman\Query\User\Model\Organization\Member; use Buddy\Repman\Query\User\OrganizationQuery; -use Buddy\Repman\Security\Model\User; +use Buddy\Repman\Security\Model\User\Organization; use Buddy\Repman\Service\Organization\OrganizationVoter; use Buddy\Repman\Tests\MotherObject\Query\OrganizationMother; use Buddy\Repman\Tests\MotherObject\Security\UserMother; @@ -19,15 +19,17 @@ final class OrganizationVoterTest extends TestCase { private OrganizationVoter $voter; + private UsernamePasswordToken $token; + private string $userId; protected function setUp(): void { $this->userId = 'some-id'; $this->token = new UsernamePasswordToken(UserMother::withOrganizations($this->userId, [ - new User\Organization('repman', 'name', 'owner', false), - new User\Organization('buddy', 'name', 'member', false), + new Organization('repman', 'name', 'owner', false), + new Organization('buddy', 'name', 'member', false), ]), 'password', ['key']); $queryMock = $this->getMockBuilder(OrganizationQuery::class)->getMock(); $this->voter = new OrganizationVoter($queryMock); @@ -35,7 +37,7 @@ protected function setUp(): void public function testAbstainForAnonymousUser(): void { - self::assertEquals(VoterInterface::ACCESS_ABSTAIN, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_ABSTAIN, $this->voter->vote( new NullToken(), 'any', ['ROLE_ORGANIZATION_MEMBER'] @@ -44,7 +46,7 @@ public function testAbstainForAnonymousUser(): void public function testDenyIfNoSubject(): void { - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, null, ['ROLE_ORGANIZATION_MEMBER'] @@ -53,26 +55,26 @@ public function testDenyIfNoSubject(): void public function testAccessForOwnerWithOrganizationReadModel(): void { - self::assertEquals(VoterInterface::ACCESS_GRANTED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_GRANTED, $this->voter->vote( $this->token, OrganizationMother::withMember(new Member($this->userId, 'email', 'owner')), ['ROLE_ORGANIZATION_OWNER'] )); - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, OrganizationMother::withMember(new Member($this->userId, 'email', 'member')), ['ROLE_ORGANIZATION_OWNER'] )); // other organization - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, OrganizationMother::withMember(new Member('other-id', 'email', 'member')), ['ROLE_ORGANIZATION_OWNER'] )); - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, OrganizationMother::withMember(new Member('other-id', 'email', 'member')), ['ROLE_ORGANIZATION_MEMBER'] @@ -82,45 +84,45 @@ public function testAccessForOwnerWithOrganizationReadModel(): void public function testAccessForOwnerWithRequest(): void { // owner organization - self::assertEquals(VoterInterface::ACCESS_GRANTED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_GRANTED, $this->voter->vote( $this->token, new Request([], ['organization' => 'repman']), ['ROLE_ORGANIZATION_OWNER'] )); - self::assertEquals(VoterInterface::ACCESS_GRANTED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_GRANTED, $this->voter->vote( $this->token, new Request([], ['organization' => 'repman']), ['ROLE_ORGANIZATION_MEMBER'] )); // member organization - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, new Request([], ['organization' => 'buddy']), ['ROLE_ORGANIZATION_OWNER'] )); - self::assertEquals(VoterInterface::ACCESS_GRANTED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_GRANTED, $this->voter->vote( $this->token, new Request([], ['organization' => 'buddy']), ['ROLE_ORGANIZATION_MEMBER'] )); // other organization - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, new Request([], ['organization' => 'other']), ['ROLE_ORGANIZATION_MEMBER'] )); - self::assertEquals(VoterInterface::ACCESS_DENIED, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_DENIED, $this->voter->vote( $this->token, new Request([], ['organization' => 'other']), ['ROLE_ORGANIZATION_OWNER'] )); - self::assertEquals(VoterInterface::ACCESS_ABSTAIN, $this->voter->vote( + $this->assertSame(VoterInterface::ACCESS_ABSTAIN, $this->voter->vote( new NullToken(), new Request([], ['organization' => 'buddy']), [] diff --git a/tests/Unit/Service/Organization/PackageDetailsParamConverterTest.php b/tests/Unit/Service/Organization/PackageDetailsParamConverterTest.php index 9871d5a8..ea4aee0b 100644 --- a/tests/Unit/Service/Organization/PackageDetailsParamConverterTest.php +++ b/tests/Unit/Service/Organization/PackageDetailsParamConverterTest.php @@ -34,7 +34,7 @@ public function testConvertPackage(): void $converter = new PackageDetailsParamConverter($queryMock); $converter->apply($request = new Request([], [], ['package' => $id]), new ParamConverter(['name' => 'package'])); - self::assertEquals($package, $request->attributes->get('package')); + $this->assertEquals($package, $request->attributes->get('package')); } public function testCheckIfPackageBelongsToOrganization(): void diff --git a/tests/Unit/Service/Organization/PackageManagerTest.php b/tests/Unit/Service/Organization/PackageManagerTest.php index aff3ced7..d6f11a24 100644 --- a/tests/Unit/Service/Organization/PackageManagerTest.php +++ b/tests/Unit/Service/Organization/PackageManagerTest.php @@ -16,18 +16,23 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; +use function dirname; +use function mkdir; +use function sys_get_temp_dir; final class PackageManagerTest extends TestCase { use ProphecyTrait; private PackageManager $manager; + private string $baseDir; + private FilesystemInterface $filesystem; protected function setUp(): void { - $basePath = \dirname(__DIR__, 3); + $basePath = dirname(__DIR__, 3); $this->filesystem = new Filesystem(new Local($basePath.'/Resources/fixtures/')); $this->manager = new PackageManager( new Storage( @@ -35,7 +40,7 @@ protected function setUp(): void ), $this->filesystem ); - $this->baseDir = \sys_get_temp_dir().'/repman'; + $this->baseDir = sys_get_temp_dir().'/repman'; } public function testFindProvidersForPackage(): void @@ -45,7 +50,7 @@ public function testFindProvidersForPackage(): void new PackageName('id', 'not-exist/missing'), ]); - self::assertEquals(['buddy-works/repman' => ['1.2.3' => [ + $this->assertSame(['buddy-works/repman' => ['1.2.3' => [ 'version' => '1.2.3', 'dist' => [ 'type' => 'zip', @@ -68,10 +73,7 @@ public function testReturnDistributionFilenameWhenExist(): void $manager = new PackageManager($storage->reveal(), $this->filesystem); - self::assertStringContainsString( - '1.2.3.0_ac7dcaf888af2324cd14200769362129c8dd8550.zip', - $manager->distFilename('buddy', 'buddy-works/repman', '1.2.3.0', 'ac7dcaf888af2324cd14200769362129c8dd8550', 'zip')->get() - ); + $this->assertStringContainsString('1.2.3.0_ac7dcaf888af2324cd14200769362129c8dd8550.zip', $manager->distFilename('buddy', 'buddy-works/repman', '1.2.3.0', 'ac7dcaf888af2324cd14200769362129c8dd8550', 'zip')->get()); } public function testRemoveProvider(): void @@ -85,15 +87,15 @@ public function testRemoveProvider(): void $manager->saveProvider([], $org, $package1); $manager->saveProvider([], $org, $package2); - self::assertFileExists($this->baseDir.'/buddy/p/'.$package1.'.json'); - self::assertFileExists($this->baseDir.'/buddy/p/'.$package2.'.json'); + $this->assertFileExists($this->baseDir.'/buddy/p/'.$package1.'.json'); + $this->assertFileExists($this->baseDir.'/buddy/p/'.$package2.'.json'); $manager->removeProvider($org, $package1); - self::assertDirectoryExists($this->baseDir.'/buddy'); - self::assertDirectoryExists(\dirname($this->baseDir.'/buddy/p/'.$package1)); - self::assertFileDoesNotExist($this->baseDir.'/buddy/p/'.$package1.'.json'); - self::assertFileExists($this->baseDir.'/buddy/p/'.$package2.'.json'); + $this->assertDirectoryExists($this->baseDir.'/buddy'); + $this->assertDirectoryExists(dirname($this->baseDir.'/buddy/p/'.$package1)); + $this->assertFileDoesNotExist($this->baseDir.'/buddy/p/'.$package1.'.json'); + $this->assertFileExists($this->baseDir.'/buddy/p/'.$package2.'.json'); } public function testRemoveDist(): void @@ -104,15 +106,15 @@ public function testRemoveDist(): void $package1 = 'vendor/package1'; $package2 = 'vendor/package2'; - @\mkdir($this->baseDir.'/buddy/dist/'.$package1, 0777, true); - @\mkdir($this->baseDir.'/buddy/dist/'.$package2, 0777, true); + @mkdir($this->baseDir.'/buddy/dist/'.$package1, 0o777, true); + @mkdir($this->baseDir.'/buddy/dist/'.$package2, 0o777, true); $manager->removeDist($org, $package1); - self::assertDirectoryExists($this->baseDir.'/buddy'); - self::assertDirectoryExists($this->baseDir.'/buddy/dist/vendor'); - self::assertDirectoryDoesNotExist($this->baseDir.'/buddy/dist/'.$package1); - self::assertDirectoryExists($this->baseDir.'/buddy/dist/'.$package2); + $this->assertDirectoryExists($this->baseDir.'/buddy'); + $this->assertDirectoryExists($this->baseDir.'/buddy/dist/vendor'); + $this->assertDirectoryDoesNotExist($this->baseDir.'/buddy/dist/'.$package1); + $this->assertDirectoryExists($this->baseDir.'/buddy/dist/'.$package2); } public function testRemoveOrganizationDir(): void @@ -124,12 +126,12 @@ public function testRemoveOrganizationDir(): void $manager->saveProvider([], $org, $package); - self::assertDirectoryExists($this->baseDir.'/buddy/p/hello'); + $this->assertDirectoryExists($this->baseDir.'/buddy/p/hello'); $manager->removeProvider($org, $package) ->removeOrganizationDir($org); - self::assertDirectoryDoesNotExist($this->baseDir.'/buddy'); + $this->assertDirectoryDoesNotExist($this->baseDir.'/buddy'); } private function getManagerWithLocalStorage(): PackageManager diff --git a/tests/Unit/Service/Organization/PackageParamConverterTest.php b/tests/Unit/Service/Organization/PackageParamConverterTest.php index 7498ed2a..60ce1cb9 100644 --- a/tests/Unit/Service/Organization/PackageParamConverterTest.php +++ b/tests/Unit/Service/Organization/PackageParamConverterTest.php @@ -34,7 +34,7 @@ public function testConvertPackage(): void $converter = new PackageParamConverter($queryMock); $converter->apply($request = new Request([], [], ['package' => $id]), new ParamConverter(['name' => 'package'])); - self::assertEquals($package, $request->attributes->get('package')); + $this->assertEquals($package, $request->attributes->get('package')); } public function testCheckIfPackageBelongsToOrganization(): void diff --git a/tests/Unit/Service/Organization/TokenGenerator/RandomTokenGeneratorTest.php b/tests/Unit/Service/Organization/TokenGenerator/RandomTokenGeneratorTest.php index 2ee10d10..4fe15354 100644 --- a/tests/Unit/Service/Organization/TokenGenerator/RandomTokenGeneratorTest.php +++ b/tests/Unit/Service/Organization/TokenGenerator/RandomTokenGeneratorTest.php @@ -13,6 +13,6 @@ public function testRandomTokenGenerator(): void { $generator = new RandomTokenGenerator(); - self::assertNotEquals($generator->generate(), $generator->generate()); + $this->assertNotSame($generator->generate(), $generator->generate()); } } diff --git a/tests/Unit/Service/PackageNormalizerTest.php b/tests/Unit/Service/PackageNormalizerTest.php index 49169cb6..64018013 100644 --- a/tests/Unit/Service/PackageNormalizerTest.php +++ b/tests/Unit/Service/PackageNormalizerTest.php @@ -17,6 +17,6 @@ public function testAddUidToPackageData(): void $data = $normalizer->normalize($package); - self::assertTrue(isset($data['uid'])); + $this->assertArrayHasKey('uid', $data); } } diff --git a/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php b/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php index b3b854d7..ee2e5e52 100644 --- a/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php +++ b/tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php @@ -18,14 +18,19 @@ use League\Flysystem\Filesystem; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use ReflectionObject; final class ComposerPackageSynchronizerTest extends TestCase { private ComposerPackageSynchronizer $synchronizer; + /** @var PackageRepository|MockObject */ private $repoMock; + private string $baseDir; + private string $resourcesDir; + private FakeDownloader $downloader; protected function setUp(): void @@ -56,20 +61,20 @@ public function testSynchronizePackageFromLocalPath(): void $package = PackageMother::withOrganization('path', $basePath, 'buddy'); $this->synchronizer->synchronize($package); - self::assertFileExists($path); + $this->assertFileExists($path); $json = unserialize((string) file_get_contents($path)); - self::assertTrue($json['packages']['repman-io/repman'] !== []); + $this->assertNotSame([], $json['packages']['repman-io/repman']); @unlink($path); - self::assertCount(1, $package->versions()); + $this->assertCount(1, $package->versions()); } public function testSynchronizeError(): void { $this->synchronizer->synchronize($package = PackageMother::withOrganization('artifact', '/non/exist/path', 'buddy')); - self::assertMatchesRegularExpression('/Error: RecursiveDirectoryIterator::__construct\(\/non\/exist\/path\): (F|f)ailed to open (dir|directory): No such file or directory/', $this->getProperty($package, 'lastSyncError')); + $this->assertMatchesRegularExpression('/Error: RecursiveDirectoryIterator::__construct\(\/non\/exist\/path\): (F|f)ailed to open (dir|directory): No such file or directory/', $this->getProperty($package, 'lastSyncError')); } public function testSynchronizePackageFromArtifacts(): void @@ -81,34 +86,32 @@ public function testSynchronizePackageFromArtifacts(): void $package = PackageMother::withOrganization('artifact', $this->resourcesDir.'artifacts', 'buddy'); $this->synchronizer->synchronize($package); - self::assertFileExists($path); + $this->assertFileExists($path); $json = unserialize((string) file_get_contents($path)); - self::assertCount(4, $json['packages']['buddy-works/alpha']); + $this->assertCount(4, $json['packages']['buddy-works/alpha']); @unlink($path); - self::assertCount(4, $package->versions()); - $versionStrings = array_map(function (Version $version): string { - return $version->version(); - }, $package->versions()->toArray()); + $this->assertCount(4, $package->versions()); + $versionStrings = array_map(fn (Version $version): string => $version->version(), $package->versions()->toArray()); sort($versionStrings, SORT_NATURAL); - self::assertEquals(['1.0.0', '1.1.0', '1.1.1', '1.2.0'], $versionStrings); + $this->assertSame(['1.0.0', '1.1.0', '1.1.1', '1.2.0'], $versionStrings); /** @var Link[] $links */ $links = $package->links()->toArray(); - self::assertCount(6, $links); + $this->assertCount(6, $links); $linkStrings = array_map( fn (Link $link): string => $link->type().'-'.$link->target().'-'.$link->constraint(), $links ); - self::assertContains('requires-php-^7.4.1', $linkStrings); - self::assertContains('devRequires-buddy-works/dev-^1.0', $linkStrings); - self::assertContains('provides-buddy-works/provide-^1.0', $linkStrings); - self::assertContains('replaces-buddy-works/replace-^1.0', $linkStrings); - self::assertContains('conflicts-buddy-works/conflict-^1.0', $linkStrings); - self::assertContains('suggests-buddy-works/suggests-You really should', $linkStrings); + $this->assertContains('requires-php-^7.4.1', $linkStrings); + $this->assertContains('devRequires-buddy-works/dev-^1.0', $linkStrings); + $this->assertContains('provides-buddy-works/provide-^1.0', $linkStrings); + $this->assertContains('replaces-buddy-works/replace-^1.0', $linkStrings); + $this->assertContains('conflicts-buddy-works/conflict-^1.0', $linkStrings); + $this->assertContains('suggests-buddy-works/suggests-You really should', $linkStrings); } public function testWithMostRecentUnstable(): void @@ -117,7 +120,7 @@ public function testWithMostRecentUnstable(): void $package = PackageMother::withOrganization('artifact', $this->resourcesDir.'artifacts-mixed-sorting', 'buddy'); $this->synchronizer->synchronize($package); - self::assertEquals('v1.0.0', $this->getProperty($package, 'latestReleasedVersion')); + $this->assertSame('v1.0.0', $this->getProperty($package, 'latestReleasedVersion')); } public function testSynchronizePackageThatAlreadyExists(): void @@ -128,7 +131,7 @@ public function testSynchronizePackageThatAlreadyExists(): void $this->synchronizer->synchronize(PackageMother::withOrganization('artifact', $this->resourcesDir.'artifacts', 'buddy')); - self::assertFileDoesNotExist($path); + $this->assertFileDoesNotExist($path); } public function testSynchronizePackageWithGitLabToken(): void @@ -139,11 +142,11 @@ public function testSynchronizePackageWithGitLabToken(): void $package = PackageMother::withOrganizationAndToken('gitlab', $this->resourcesDir.'artifacts', 'buddy'); $this->synchronizer->synchronize($package); - self::assertTrue($package->isSynchronizedSuccessfully(), (string) $this->getProperty($package, 'lastSyncError')); - self::assertFileExists($path); + $this->assertTrue($package->isSynchronizedSuccessfully(), (string) $this->getProperty($package, 'lastSyncError')); + $this->assertFileExists($path); $json = unserialize((string) file_get_contents($path)); - self::assertTrue($json['packages']['repman-io/repman'] !== []); + $this->assertNotSame([], $json['packages']['repman-io/repman']); @unlink($path); } @@ -155,11 +158,11 @@ public function testSynchronizePackageWithGitHubToken(): void $package = PackageMother::withOrganizationAndToken('github', $this->resourcesDir.'artifacts', 'buddy'); $this->synchronizer->synchronize($package); - self::assertTrue($package->isSynchronizedSuccessfully(), (string) $this->getProperty($package, 'lastSyncError')); - self::assertFileExists($path); + $this->assertTrue($package->isSynchronizedSuccessfully(), (string) $this->getProperty($package, 'lastSyncError')); + $this->assertFileExists($path); $json = unserialize((string) file_get_contents($path)); - self::assertTrue($json['packages']['repman-io/repman'] !== []); + $this->assertNotSame([], $json['packages']['repman-io/repman']); @unlink($path); } @@ -171,11 +174,11 @@ public function testSynchronizePackageWithBitbucketToken(): void $package = PackageMother::withOrganizationAndToken('bitbucket', $this->resourcesDir.'artifacts', 'buddy'); $this->synchronizer->synchronize($package); - self::assertTrue($package->isSynchronizedSuccessfully(), (string) $this->getProperty($package, 'lastSyncError')); - self::assertFileExists($path); + $this->assertTrue($package->isSynchronizedSuccessfully(), (string) $this->getProperty($package, 'lastSyncError')); + $this->assertFileExists($path); $json = unserialize((string) file_get_contents($path)); - self::assertTrue($json['packages']['repman-io/repman'] !== []); + $this->assertNotSame([], $json['packages']['repman-io/repman']); @unlink($path); } @@ -185,7 +188,7 @@ public function testSynchronizePackageWithInvalidName(): void $this->synchronizer->synchronize($package); - self::assertEquals('Error: Package name ../other/package is invalid', $this->getProperty($package, 'lastSyncError')); + $this->assertSame('Error: Package name ../other/package is invalid', $this->getProperty($package, 'lastSyncError')); } public function testSynchronizePackageWithInvalidPath(): void @@ -194,7 +197,7 @@ public function testSynchronizePackageWithInvalidPath(): void $this->synchronizer->synchronize($package); - self::assertEquals('Error: Package not found', $this->getProperty($package, 'lastSyncError')); + $this->assertSame('Error: Package not found', $this->getProperty($package, 'lastSyncError')); } public function testSynchronizePackageWithNoStableRelease(): void @@ -203,8 +206,9 @@ public function testSynchronizePackageWithNoStableRelease(): void $resPath = $this->resourcesDir.'path/unstable/composer.json'; $tmpPath = sys_get_temp_dir().'/repman/path/unstable/composer.json'; if (!is_dir(dirname($tmpPath))) { - mkdir(dirname($tmpPath), 0777, true); + mkdir(dirname($tmpPath), 0o777, true); } + copy($resPath, $tmpPath); $package = PackageMother::withOrganization('path', dirname($tmpPath), 'buddy'); @@ -213,7 +217,7 @@ public function testSynchronizePackageWithNoStableRelease(): void $this->downloader->addContent(dirname($tmpPath), file_get_contents($tmpPath)); $this->synchronizer->synchronize($package); - self::assertEquals('no stable release', $this->getProperty($package, 'latestReleasedVersion')); + $this->assertSame('no stable release', $this->getProperty($package, 'latestReleasedVersion')); @unlink($this->baseDir.'/buddy/p/some/package.json'); @unlink($tmpPath); } @@ -228,18 +232,16 @@ public function testSynchronizePackageWithLimitedNumberOfVersions(): void $package = PackageMother::withOrganization('artifact', $this->resourcesDir.'artifacts', 'buddy', $limit); $this->synchronizer->synchronize($package); - self::assertFileExists($path); + $this->assertFileExists($path); $json = unserialize((string) file_get_contents($path)); - self::assertCount(4, $json['packages']['buddy-works/alpha']); + $this->assertCount(4, $json['packages']['buddy-works/alpha']); @unlink($path); - self::assertCount($limit, $package->versions()); - $versionStrings = array_map(function (Version $version): string { - return $version->version(); - }, $package->versions()->toArray()); + $this->assertCount($limit, $package->versions()); + $versionStrings = array_map(fn (Version $version): string => $version->version(), $package->versions()->toArray()); sort($versionStrings, SORT_NATURAL); - self::assertEquals(['1.1.1', '1.2.0'], $versionStrings); + $this->assertSame(['1.1.1', '1.2.0'], $versionStrings); } public function testSynchronizePackageAbandonedWithReplacementPackage(): void @@ -248,8 +250,9 @@ public function testSynchronizePackageAbandonedWithReplacementPackage(): void $resPath = $this->resourcesDir.'path/abandoned-replacement-package/composer.json'; $tmpPath = sys_get_temp_dir().'/repman/path/abandoned-replacement-package/composer.json'; if (!is_dir(dirname($tmpPath))) { - mkdir(dirname($tmpPath), 0777, true); + mkdir(dirname($tmpPath), 0o777, true); } + copy($resPath, $tmpPath); $package = PackageMother::withOrganization('path', dirname($tmpPath), 'buddy'); @@ -258,7 +261,7 @@ public function testSynchronizePackageAbandonedWithReplacementPackage(): void $this->downloader->addContent(dirname($tmpPath), file_get_contents($tmpPath)); $this->synchronizer->synchronize($package); - self::assertEquals('foo/bar', $this->getProperty($package, 'replacementPackage')); + $this->assertSame('foo/bar', $this->getProperty($package, 'replacementPackage')); @unlink($this->baseDir.'/buddy/p/some/package.json'); @unlink($tmpPath); } @@ -269,8 +272,9 @@ public function testSynchronizePackageAbandonedWithoutReplacementPackage(): void $resPath = $this->resourcesDir.'path/abandoned-without-replacement-package/composer.json'; $tmpPath = sys_get_temp_dir().'/repman/path/abandoned-without-replacement-package/composer.json'; if (!is_dir(dirname($tmpPath))) { - mkdir(dirname($tmpPath), 0777, true); + mkdir(dirname($tmpPath), 0o777, true); } + copy($resPath, $tmpPath); $package = PackageMother::withOrganization('path', dirname($tmpPath), 'buddy'); @@ -279,7 +283,7 @@ public function testSynchronizePackageAbandonedWithoutReplacementPackage(): void $this->downloader->addContent(dirname($tmpPath), file_get_contents($tmpPath)); $this->synchronizer->synchronize($package); - self::assertEquals('', $this->getProperty($package, 'replacementPackage')); + $this->assertSame('', $this->getProperty($package, 'replacementPackage')); @unlink($this->baseDir.'/buddy/p/some/package.json'); @unlink($tmpPath); } @@ -289,7 +293,7 @@ public function testSynchronizePackageAbandonedWithoutReplacementPackage(): void */ private function getProperty(object $object, string $property) { - $reflection = new \ReflectionObject($object); + $reflection = new ReflectionObject($object); $property = $reflection->getProperty($property); $property->setAccessible(true); diff --git a/tests/Unit/Service/PackageSynchronizer/ReadmeComposerPackageSynchronizerTest.php b/tests/Unit/Service/PackageSynchronizer/ReadmeComposerPackageSynchronizerTest.php index 59326c5f..ef8a7af9 100644 --- a/tests/Unit/Service/PackageSynchronizer/ReadmeComposerPackageSynchronizerTest.php +++ b/tests/Unit/Service/PackageSynchronizer/ReadmeComposerPackageSynchronizerTest.php @@ -15,16 +15,22 @@ use League\Flysystem\Adapter\Local; use League\Flysystem\Filesystem; use PHPUnit\Framework\TestCase; +use function file_get_contents; +use function sys_get_temp_dir; +use function unlink; +use function unserialize; final class ReadmeComposerPackageSynchronizerTest extends TestCase { private ComposerPackageSynchronizer $synchronizer; + private string $resourcesDir; + private string $path; protected function setUp(): void { - $baseDir = \sys_get_temp_dir().'/repman'; + $baseDir = sys_get_temp_dir().'/repman'; $repoFilesystem = new Filesystem(new Local($baseDir)); $fileStorage = new Storage(new FakeDownloader(''), $repoFilesystem); $this->synchronizer = new ComposerPackageSynchronizer( @@ -41,12 +47,12 @@ protected function setUp(): void $this->resourcesDir = dirname(__DIR__, 3).'/Resources/'; $this->path = $baseDir.'/buddy/p/buddy-works/alpha.json'; - @\unlink($this->path); + @unlink($this->path); } protected function tearDown(): void { - @\unlink($this->path); + @unlink($this->path); } public function testNoReadme(): void @@ -58,14 +64,14 @@ public function testNoReadme(): void ); $this->synchronizer->synchronize($package); - self::assertFileExists($this->path); + $this->assertFileExists($this->path); - $json = \unserialize((string) \file_get_contents($this->path)); - self::assertCount(1, $json['packages']['buddy-works/alpha']); + $json = unserialize((string) file_get_contents($this->path)); + $this->assertCount(1, $json['packages']['buddy-works/alpha']); - self::assertCount(1, $package->versions()); - self::assertEquals('1.2.0', $package->latestReleasedVersion()); - self::assertNull($package->readme()); + $this->assertCount(1, $package->versions()); + $this->assertSame('1.2.0', $package->latestReleasedVersion()); + $this->assertNull($package->readme()); } public function testReadme(): void @@ -77,17 +83,14 @@ public function testReadme(): void ); $this->synchronizer->synchronize($package); - self::assertFileExists($this->path); + $this->assertFileExists($this->path); - $json = \unserialize((string) \file_get_contents($this->path)); - self::assertCount(3, $json['packages']['buddy-works/alpha']); + $json = unserialize((string) file_get_contents($this->path)); + $this->assertCount(3, $json['packages']['buddy-works/alpha']); - self::assertCount(3, $package->versions()); - self::assertEquals('1.3.0', $package->latestReleasedVersion()); - self::assertEquals( - "

Test

\n

Testing

\n", - $package->readme() - ); + $this->assertCount(3, $package->versions()); + $this->assertSame('1.3.0', $package->latestReleasedVersion()); + $this->assertSame("

Test

\n

Testing

\n", $package->readme()); } public function testCaseInsensitiveReadme(): void @@ -99,17 +102,14 @@ public function testCaseInsensitiveReadme(): void ); $this->synchronizer->synchronize($package); - self::assertFileExists($this->path); + $this->assertFileExists($this->path); - $json = \unserialize((string) \file_get_contents($this->path)); - self::assertCount(1, $json['packages']['buddy-works/alpha']); + $json = unserialize((string) file_get_contents($this->path)); + $this->assertCount(1, $json['packages']['buddy-works/alpha']); - self::assertCount(1, $package->versions()); - self::assertEquals('1.3.0', $package->latestReleasedVersion()); - self::assertEquals( - "

Test

\n

Testing

\n", - $package->readme() - ); + $this->assertCount(1, $package->versions()); + $this->assertSame('1.3.0', $package->latestReleasedVersion()); + $this->assertSame("

Test

\n

Testing

\n", $package->readme()); } /** @@ -127,17 +127,14 @@ public function testReadmeInSecondLevelDirectory(): void ); $this->synchronizer->synchronize($package); - self::assertFileExists($this->path); + $this->assertFileExists($this->path); - $json = \unserialize((string) \file_get_contents($this->path)); - self::assertCount(1, $json['packages']['buddy-works/alpha']); + $json = unserialize((string) file_get_contents($this->path)); + $this->assertCount(1, $json['packages']['buddy-works/alpha']); - self::assertCount(1, $package->versions()); - self::assertEquals('1.3.0', $package->latestReleasedVersion()); - self::assertEquals( - "

Test

\n

Testing

\n", - $package->readme() - ); + $this->assertCount(1, $package->versions()); + $this->assertSame('1.3.0', $package->latestReleasedVersion()); + $this->assertSame("

Test

\n

Testing

\n", $package->readme()); } public function testUnstableVersion(): void @@ -149,16 +146,13 @@ public function testUnstableVersion(): void ); $this->synchronizer->synchronize($package); - self::assertFileExists($this->path); + $this->assertFileExists($this->path); - $json = \unserialize((string) \file_get_contents($this->path)); - self::assertCount(1, $json['packages']['buddy-works/alpha']); + $json = unserialize((string) file_get_contents($this->path)); + $this->assertCount(1, $json['packages']['buddy-works/alpha']); - self::assertCount(1, $package->versions()); - self::assertEquals('no stable release', $package->latestReleasedVersion()); - self::assertEquals( - "

Test

\n

Testing

\n", - $package->readme() - ); + $this->assertCount(1, $package->versions()); + $this->assertSame('no stable release', $package->latestReleasedVersion()); + $this->assertSame("

Test

\n

Testing

\n", $package->readme()); } } diff --git a/tests/Unit/Service/ProxyTest.php b/tests/Unit/Service/ProxyTest.php index 3264d557..321387e5 100644 --- a/tests/Unit/Service/ProxyTest.php +++ b/tests/Unit/Service/ProxyTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Service\Proxy; use Buddy\Repman\Service\Proxy\Metadata; use Buddy\Repman\Tests\Doubles\FakeDownloader; +use InvalidArgumentException; use League\Flysystem\Filesystem; use League\Flysystem\Memory\MemoryAdapter; use PHPUnit\Framework\TestCase; @@ -14,7 +15,9 @@ final class ProxyTest extends TestCase { private Proxy $proxy; + private Filesystem $filesystem; + private FakeDownloader $downloader; protected function setUp(): void @@ -33,15 +36,15 @@ public function testPackageMetadataDownload(): void $metadata = $this->proxy->metadata('buddy-works/repman'); - self::assertTrue($metadata->isPresent()); + $this->assertTrue($metadata->isPresent()); } public function testDownloadDistWhenNotExists(): void { $this->filesystem->write('packagist.org/p2/buddy-works/repman.json', (string) file_get_contents(__DIR__.'/../../Resources/packagist.org/p2/buddy-works/repman.json')); - self::assertFalse($this->filesystem->has('packagist.org/dist/buddy-works/repman/61e39aa8197cf1bc7fcb16a6f727b0c291bc9b76.zip')); + $this->assertFalse($this->filesystem->has('packagist.org/dist/buddy-works/repman/61e39aa8197cf1bc7fcb16a6f727b0c291bc9b76.zip')); $distribution = $this->proxy->distribution('buddy-works/repman', '1.2.3', '61e39aa8197cf1bc7fcb16a6f727b0c291bc9b76', 'zip'); - self::assertTrue($distribution->isPresent()); + $this->assertTrue($distribution->isPresent()); } public function testDistRemove(): void @@ -50,7 +53,7 @@ public function testDistRemove(): void $this->proxy->removeDist('vendor/package'); - self::assertFalse($this->filesystem->has('packagist.org/dist/vendor/package')); + $this->assertFalse($this->filesystem->has('packagist.org/dist/vendor/package')); // test if remove package that not exist does not cause error $this->proxy->removeDist('vendor/package'); @@ -58,7 +61,7 @@ public function testDistRemove(): void public function testPreventRemoveDist(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->proxy->removeDist(''); } @@ -70,27 +73,28 @@ public function testSyncMetadata(): void $this->filesystem->write('packagist.org/p/buddy-works/repman.json', 'content'); $this->filesystem->write('packagist.org/p2/buddy-works/repman.json', 'content', ['timestamp' => $oldTimestamp]); $this->filesystem->write('packagist.org/p2/buddy-works/old.json', 'content', ['timestamp' => $oldTimestamp]); + $this->downloader->addContent('https://packagist.org/p/buddy-works/repman.json', 'legacy'); $this->downloader->addContent('https://packagist.org/p2/buddy-works/repman.json', 'new'); $this->downloader->addContent('https://packagist.org/p2/buddy-works/old.json', 'content', $oldTimestamp); /** @var Metadata $metadata */ $metadata = $this->proxy->metadata('buddy-works/repman')->get(); - self::assertEquals($oldTimestamp, $metadata->timestamp()); + $this->assertSame($oldTimestamp, $metadata->timestamp()); $this->proxy->syncMetadata(); /** @var Metadata $metadata */ $metadata = $this->proxy->metadata('buddy-works/repman')->get(); - self::assertTrue($metadata->timestamp() > $oldTimestamp); - self::assertEquals('new', stream_get_contents($metadata->stream())); + $this->assertGreaterThan($oldTimestamp, $metadata->timestamp()); + $this->assertSame('new', stream_get_contents($metadata->stream())); /** @var Metadata $metadata */ $metadata = $this->proxy->metadata('buddy-works/old')->get(); - self::assertTrue($metadata->timestamp() > $oldTimestamp); + $this->assertGreaterThan($oldTimestamp, $metadata->timestamp()); - self::assertTrue($this->filesystem->has('packagist.org/p/buddy-works/repman$c49fea7425fa7f8699897a97c159c6690267d9003bb78c53fafa8fc15c325d84.json')); - self::assertFalse($this->filesystem->has('packagist.org/p2/buddy-works/repman$c49fea7425fa7f8699897a97c159c6690267d9003bb78c53fafa8fc15c325d84.json')); + $this->assertTrue($this->filesystem->has('packagist.org/p/buddy-works/repman$c49fea7425fa7f8699897a97c159c6690267d9003bb78c53fafa8fc15c325d84.json')); + $this->assertFalse($this->filesystem->has('packagist.org/p2/buddy-works/repman$c49fea7425fa7f8699897a97c159c6690267d9003bb78c53fafa8fc15c325d84.json')); } public function testIgnoreSyncIfCannotDownload(): void @@ -103,7 +107,7 @@ public function testIgnoreSyncIfCannotDownload(): void /** @var Metadata $metadata */ $metadata = $this->proxy->metadata('buddy-works/repman')->get(); - self::assertEquals($oldTimestamp, $metadata->timestamp()); + $this->assertSame($oldTimestamp, $metadata->timestamp()); } public function testSyncLegacyMetadata(): void @@ -114,13 +118,13 @@ public function testSyncLegacyMetadata(): void /** @var Metadata $metadata */ $metadata = $this->proxy->legacyMetadata('buddy-works/repman')->get(); - self::assertEquals($oldTimestamp, $metadata->timestamp()); + $this->assertSame($oldTimestamp, $metadata->timestamp()); $this->proxy->syncMetadata(); /** @var Metadata $metadata */ $metadata = $this->proxy->legacyMetadata('buddy-works/repman')->get(); - self::assertTrue($metadata->timestamp() > $oldTimestamp); + $this->assertGreaterThan($oldTimestamp, $metadata->timestamp()); } public function testUpdateLatestProviders(): void @@ -132,11 +136,11 @@ public function testUpdateLatestProviders(): void $this->proxy->updateLatestProviders(); - self::assertFalse($this->filesystem->has('packagist.org/p/repman-io/example$33f034b1.json')); - self::assertFalse($this->filesystem->has('packagist.org/p/repman-io/example$7596c2e5.json')); - self::assertFalse($this->filesystem->has('packagist.org/p/repman-io/example$8596c2e5.json')); - self::assertTrue($this->filesystem->has('packagist.org/p/repman-io/example$90f50046.json')); - self::assertTrue($this->filesystem->has('packagist.org/provider/provider-latest$9574a5410c31b1839e902dca97a3e0f892363864838fc5b522627c81300a60d3.json')); + $this->assertFalse($this->filesystem->has('packagist.org/p/repman-io/example$33f034b1.json')); + $this->assertFalse($this->filesystem->has('packagist.org/p/repman-io/example$7596c2e5.json')); + $this->assertFalse($this->filesystem->has('packagist.org/p/repman-io/example$8596c2e5.json')); + $this->assertTrue($this->filesystem->has('packagist.org/p/repman-io/example$90f50046.json')); + $this->assertTrue($this->filesystem->has('packagist.org/provider/provider-latest$9574a5410c31b1839e902dca97a3e0f892363864838fc5b522627c81300a60d3.json')); } private function createMetadataFile(string $package, string $hash, string $time): void diff --git a/tests/Unit/Service/RemoteFilesystem/NativeRemoteFilesystemTest.php b/tests/Unit/Service/RemoteFilesystem/NativeRemoteFilesystemTest.php index 8887be84..7b12aacc 100644 --- a/tests/Unit/Service/RemoteFilesystem/NativeRemoteFilesystemTest.php +++ b/tests/Unit/Service/RemoteFilesystem/NativeRemoteFilesystemTest.php @@ -13,13 +13,13 @@ public function testCorrectDownload(): void { $rf = new ReactDownloader(); - self::assertFalse($rf->getContents(__FILE__)->isEmpty()); + $this->assertFalse($rf->getContents(__FILE__)->isEmpty()); } public function testInCorrectDownload(): void { $rf = new ReactDownloader(); - self::assertTrue($rf->getContents('/not/exits')->isEmpty()); + $this->assertTrue($rf->getContents('/not/exits')->isEmpty()); } } diff --git a/tests/Unit/Service/Security/SensioLabsPackageScannerTest.php b/tests/Unit/Service/Security/SensioLabsPackageScannerTest.php index d1d66ae7..ed59bfe4 100644 --- a/tests/Unit/Service/Security/SensioLabsPackageScannerTest.php +++ b/tests/Unit/Service/Security/SensioLabsPackageScannerTest.php @@ -12,11 +12,18 @@ use Buddy\Repman\Service\Security\PackageScanner\SensioLabsPackageScanner; use Buddy\Repman\Service\Security\SecurityChecker; use Buddy\Repman\Tests\MotherObject\PackageMother; +use DateTimeImmutable; use Munus\Control\Option; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use ReflectionObject; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\MessageBus; +use function file_get_contents; +use function file_put_contents; +use function realpath; +use function sys_get_temp_dir; +use function tempnam; final class SensioLabsPackageScannerTest extends TestCase { @@ -24,7 +31,9 @@ final class SensioLabsPackageScannerTest extends TestCase private const VERSION = '1.2.3'; private SensioLabsPackageScanner $scanner; + private SecurityChecker $checkerMock; + /** @var ScanResultRepository|MockObject */ private $repoMock; @@ -124,11 +133,11 @@ public function testBrokenZip(): void private function prepareScanner(string $fixtureType = 'repman'): SensioLabsPackageScanner { - $distFile = \realpath(__DIR__.'/../../../Resources/fixtures/buddy/dist/buddy-works/'.$fixtureType.'/1.2.3.0_ac7dcaf888af2324cd14200769362129c8dd8550.zip'); + $distFile = realpath(__DIR__.'/../../../Resources/fixtures/buddy/dist/buddy-works/'.$fixtureType.'/1.2.3.0_ac7dcaf888af2324cd14200769362129c8dd8550.zip'); $packageManager = $this->createMock(PackageManager::class); $packageManager->method('findProviders')->willReturn( [ - new \DateTimeImmutable(), + new DateTimeImmutable(), [ 'buddy-works/repman' => [ self::VERSION => [ @@ -153,10 +162,10 @@ private function prepareScanner(string $fixtureType = 'repman'): SensioLabsPacka ->willReturn(new Envelope(new SendScanResult(['test@example.com'], 'buddy', 'test/test', 'test', []))); $distStorage = $this->createMock(Storage::class); - $tempFilename = \tempnam(\sys_get_temp_dir(), 'repman-test'); - self::assertNotFalse($tempFilename, 'Error while creating temp file for testing'); - self::assertNotFalse($distFile, 'Could not determined the path to dist file.'); - \file_put_contents($tempFilename, \file_get_contents($distFile)); + $tempFilename = tempnam(sys_get_temp_dir(), 'repman-test'); + $this->assertNotFalse($tempFilename, 'Error while creating temp file for testing'); + $this->assertNotFalse($distFile, 'Could not determined the path to dist file.'); + file_put_contents($tempFilename, file_get_contents($distFile)); $distStorage->method('getLocalFileForDistUrl')->willReturn(Option::of($tempFilename)); return new SensioLabsPackageScanner( @@ -170,10 +179,10 @@ private function prepareScanner(string $fixtureType = 'repman'): SensioLabsPacka private function assertPackageSecurity(string $expected, Package $package): void { - $reflection = new \ReflectionObject($package); + $reflection = new ReflectionObject($package); $property = $reflection->getProperty('lastScanStatus'); $property->setAccessible(true); - self::assertEquals($expected, $property->getValue($package)); + $this->assertSame($expected, $property->getValue($package)); } } diff --git a/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php b/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php index d08a39ee..2c0bb025 100644 --- a/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php +++ b/tests/Unit/Service/Security/SensioLabsSecurityCheckerTest.php @@ -6,15 +6,20 @@ use Buddy\Repman\Service\Security\SecurityChecker\SensioLabsSecurityChecker; use PHPUnit\Framework\TestCase; +use RuntimeException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\Process; +use UnexpectedValueException; final class SensioLabsSecurityCheckerTest extends TestCase { private SensioLabsSecurityChecker $checker; + private string $dbDir; + private string $repoDir; + private Filesystem $filesystem; protected function setUp(): void @@ -34,7 +39,7 @@ protected function tearDown(): void public function testInvalidLockFile(): void { - $this->expectException(\UnexpectedValueException::class); + $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage('Invalid composer.lock'); $this->checker->check('invalid'); @@ -42,7 +47,7 @@ public function testInvalidLockFile(): void public function testMissingDatabase(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Advisories database does not exist'); $this->checker = new SensioLabsSecurityChecker(sys_get_temp_dir().'/bogus-security-advisories', ''); @@ -52,13 +57,13 @@ public function testMissingDatabase(): void public function testEmptyLockFile(): void { $this->synchronizeAdvisoriesDatabase(); - self::assertEquals($this->checker->check('{}'), []); + $this->assertEquals($this->checker->check('{}'), []); } public function testSuccessfulScanWithAlerts(): void { $this->synchronizeAdvisoriesDatabase(); - self::assertEqualsCanonicalizing($this->checker->check($this->insecureLock()), [ + $this->assertEqualsCanonicalizing($this->checker->check($this->insecureLock()), [ 'aws/aws-sdk-php' => [ 'version' => '3.2.0', 'advisories' => [ @@ -110,21 +115,21 @@ public function testSuccessfulScanWithAlerts(): void public function testSuccessfulScanWithoutAlerts(): void { $this->synchronizeAdvisoriesDatabase(); - self::assertEquals($this->checker->check($this->safeLock()), []); + $this->assertEquals($this->checker->check($this->safeLock()), []); } public function testUpdateWhenRepoDontExist(): void { $this->createAdvisoriesDatabaseRepo(); - self::assertTrue($this->checker->update()); + $this->assertTrue($this->checker->update()); // second update should return false because nothing has changed - self::assertFalse($this->checker->update()); + $this->assertFalse($this->checker->update()); } public function testThrowErrorWhenUpdateFails(): void { $this->expectException(ProcessFailedException::class); - $this->expectExceptionMessage("'{$this->repoDir}' does not appear to be a git repository"); + $this->expectExceptionMessage(sprintf("'%s' does not appear to be a git repository", $this->repoDir)); $this->checker->update(); } @@ -133,9 +138,9 @@ public function testUpdateWhenRepoExist(): void $this->createAdvisoriesDatabaseRepo(); $this->checker->update(); $this->updateAdvisoriesDatabaseRepo(); - self::assertTrue($this->checker->update()); + $this->assertTrue($this->checker->update()); // second update should return false because nothing has changed - self::assertFalse($this->checker->update()); + $this->assertFalse($this->checker->update()); } private function updateAdvisoriesDatabaseRepo(): void diff --git a/tests/Unit/Service/StreamTest.php b/tests/Unit/Service/StreamTest.php index e4f10015..595b3661 100644 --- a/tests/Unit/Service/StreamTest.php +++ b/tests/Unit/Service/StreamTest.php @@ -6,12 +6,13 @@ use Buddy\Repman\Service\Stream; use PHPUnit\Framework\TestCase; +use RuntimeException; final class StreamTest extends TestCase { public function testStreamCheck(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); Stream::fromString('string', 'php://invalid'); } diff --git a/tests/Unit/Service/Symfony/ConsumedMessageLoggerMiddlewareTest.php b/tests/Unit/Service/Symfony/ConsumedMessageLoggerMiddlewareTest.php index 73ba3979..ccf4a588 100644 --- a/tests/Unit/Service/Symfony/ConsumedMessageLoggerMiddlewareTest.php +++ b/tests/Unit/Service/Symfony/ConsumedMessageLoggerMiddlewareTest.php @@ -7,6 +7,7 @@ use Buddy\Repman\Service\Symfony\ConsumedMessageLoggerMiddleware; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use stdClass; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Middleware\MiddlewareInterface; use Symfony\Component\Messenger\Middleware\StackInterface; @@ -16,7 +17,7 @@ final class ConsumedMessageLoggerMiddlewareTest extends TestCase { public function testIgnoreSyncMessages(): void { - $envelope = new Envelope(new \stdClass()); + $envelope = new Envelope(new stdClass()); $middleware = $this->createMock(MiddlewareInterface::class); $middleware->method('handle')->willReturn($envelope); $stack = $this->createMock(StackInterface::class); @@ -31,7 +32,7 @@ public function testIgnoreSyncMessages(): void public function testCollectMetricsForMessage(): void { - $envelope = new Envelope(new \stdClass(), [new ConsumedByWorkerStamp()]); + $envelope = new Envelope(new stdClass(), [new ConsumedByWorkerStamp()]); $middleware = $this->createMock(MiddlewareInterface::class); $middleware->method('handle')->willReturn($envelope); $stack = $this->createMock(StackInterface::class); diff --git a/tests/Unit/Service/Telemetry/TelemetryEndpointTest.php b/tests/Unit/Service/Telemetry/TelemetryEndpointTest.php index 2a072e7f..6711f11b 100644 --- a/tests/Unit/Service/Telemetry/TelemetryEndpointTest.php +++ b/tests/Unit/Service/Telemetry/TelemetryEndpointTest.php @@ -12,7 +12,9 @@ use Buddy\Repman\Service\Telemetry\Entry\Proxy; use Buddy\Repman\Service\Telemetry\TechnicalEmail; use Buddy\Repman\Service\Telemetry\TelemetryEndpoint; +use DateTimeImmutable; use PHPUnit\Framework\TestCase; +use RuntimeException; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\MockResponse; @@ -31,10 +33,8 @@ public function testSuccessfulSend(): void $endpoint = new TelemetryEndpoint($client); $endpoint->send($this->entry()); - self::assertEquals(1, $called); - self::assertJsonStringEqualsJsonString( - $response, - ' + $this->assertSame(1, $called); + $this->assertJsonStringEqualsJsonString($response, ' { "id": "20200721_8f43446b-52a3-4bd9-9a8a-ecc955ac754d", "date": "2020-07-21", @@ -80,13 +80,12 @@ public function testSuccessfulSend(): void "packages": 1 } } - ' - ); + '); } public function testFailedSend(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Error while sending telemetry data. HTTP error: 500'); $endpoint = new TelemetryEndpoint( @@ -108,21 +107,18 @@ public function testSuccessfulAddTechnicalEmail(): void $endpoint = new TelemetryEndpoint($client); $endpoint->addTechnicalEmail($this->email()); - self::assertEquals(1, $called); - self::assertJsonStringEqualsJsonString( - $response, - ' + $this->assertSame(1, $called); + $this->assertJsonStringEqualsJsonString($response, ' { "instanceId": "8f43446b-52a3-4bd9-9a8a-ecc955ac754d", "email": "john.doe@example.com" } - ' - ); + '); } public function testFailedAddTechnicalEmailAddress(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Error while sending telemetry data. HTTP error: 403'); $endpoint = new TelemetryEndpoint( @@ -144,21 +140,18 @@ public function testSuccessfulRemoveTechnicalEmail(): void $endpoint = new TelemetryEndpoint($client); $endpoint->removeTechnicalEmail($this->email()); - self::assertEquals(1, $called); - self::assertJsonStringEqualsJsonString( - $response, - ' + $this->assertSame(1, $called); + $this->assertJsonStringEqualsJsonString($response, ' { "instanceId": "8f43446b-52a3-4bd9-9a8a-ecc955ac754d", "email": "john.doe@example.com" } - ' - ); + '); } public function testFailedRemoveTechnicalEmailAddress(): void { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->expectExceptionMessage('Error while sending telemetry data. HTTP error: 403'); $endpoint = new TelemetryEndpoint( @@ -179,9 +172,9 @@ private function entry(): Entry $organization->addPackages([ new Package( 'github-oauth', - new \DateTimeImmutable('2018-01-23 21:31:10'), - new \DateTimeImmutable('2020-07-22 13:37:56'), - new \DateTimeImmutable('2020-07-22 13:37:56'), + new DateTimeImmutable('2018-01-23 21:31:10'), + new DateTimeImmutable('2020-07-22 13:37:56'), + new DateTimeImmutable('2020-07-22 13:37:56'), false, true, 'ok', @@ -191,7 +184,7 @@ private function entry(): Entry ]); return new Entry( - new \DateTimeImmutable('2020-07-21 12:13:13'), + new DateTimeImmutable('2020-07-21 12:13:13'), new Instance( '8f43446b-52a3-4bd9-9a8a-ecc955ac754d', '0.5.0', diff --git a/tests/Unit/Service/Twig/BytesExtensionTest.php b/tests/Unit/Service/Twig/BytesExtensionTest.php index 1e39258d..cc623a93 100644 --- a/tests/Unit/Service/Twig/BytesExtensionTest.php +++ b/tests/Unit/Service/Twig/BytesExtensionTest.php @@ -5,6 +5,7 @@ namespace Buddy\Repman\Tests\Unit\Service\Twig; use Buddy\Repman\Service\Twig\BytesExtension; +use Iterator; use PHPUnit\Framework\TestCase; final class BytesExtensionTest extends TestCase @@ -18,7 +19,7 @@ protected function setUp(): void public function testGetFilters(): void { - self::assertEquals('format_bytes', $this->extension->getFilters()[0]->getName()); + $this->assertSame('format_bytes', $this->extension->getFilters()[0]->getName()); } /** @@ -26,21 +27,19 @@ public function testGetFilters(): void */ public function testFormatBytes(string $expected, int $bytes, int $precision): void { - self::assertEquals($expected, $this->extension->formatBytes($bytes, $precision)); + $this->assertSame($expected, $this->extension->formatBytes($bytes, $precision)); } /** * @return mixed[] */ - public function formatBytesProvider(): array + public function formatBytesProvider(): Iterator { - return [ - ['1 KB', 1024, 0], - ['1.0 KB', 1024, 1], - ['1.00 KB', 1024, 2], - ['1.23 KB', 1260, 2], - ['5.75 MB', 6029312, 2], - ['13.37 GB', 14355928186, 2], - ]; + yield ['1 KB', 1024, 0]; + yield ['1.0 KB', 1024, 1]; + yield ['1.00 KB', 1024, 2]; + yield ['1.23 KB', 1260, 2]; + yield ['5.75 MB', 6029312, 2]; + yield ['13.37 GB', 14355928186, 2]; } } diff --git a/tests/Unit/Service/Twig/DateExtensionTest.php b/tests/Unit/Service/Twig/DateExtensionTest.php index a4dc4cda..1a87b759 100644 --- a/tests/Unit/Service/Twig/DateExtensionTest.php +++ b/tests/Unit/Service/Twig/DateExtensionTest.php @@ -5,15 +5,21 @@ namespace Buddy\Repman\Tests\Unit\Service\Twig; use Buddy\Repman\Service\Twig\DateExtension; +use DateTimeImmutable; +use DateTimeZone; +use Iterator; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Twig\Environment; use Twig\Loader\ArrayLoader; +use function date_default_timezone_get; final class DateExtensionTest extends TestCase { private DateExtension $extension; + private Environment $env; + private string $oldTz; protected function setUp(): void @@ -21,7 +27,7 @@ protected function setUp(): void $this->extension = new DateExtension(new TokenStorage()); $this->env = new Environment(new ArrayLoader()); - $this->oldTz = \date_default_timezone_get(); + $this->oldTz = date_default_timezone_get(); date_default_timezone_set('Europe/Warsaw'); } @@ -32,98 +38,89 @@ protected function tearDown(): void public function testGetFilters(): void { - self::assertEquals('time_diff', $this->extension->getFilters()[0]->getName()); + $this->assertSame('time_diff', $this->extension->getFilters()[0]->getName()); } public function testGetFunctions(): void { - self::assertEquals('gmt_offset', $this->extension->getFunctions()[0]->getName()); + $this->assertSame('gmt_offset', $this->extension->getFunctions()[0]->getName()); } /** * @dataProvider timeDiffProvider */ - public function testTimeDiff(string $expected, \DateTimeImmutable $dateTime, \DateTimeImmutable $now): void + public function testTimeDiff(string $expected, DateTimeImmutable $dateTime, DateTimeImmutable $now): void { - self::assertEquals($expected, $this->extension->diff($this->env, $dateTime, $now)); + $this->assertSame($expected, $this->extension->diff($this->env, $dateTime, $now)); } /** * @dataProvider dateTimeProvider */ - public function testDateTime(string $expected, \DateTimeImmutable $dateTime): void + public function testDateTime(string $expected, DateTimeImmutable $dateTime): void { - self::assertEquals($expected, $this->extension->dateTime($this->env, $dateTime)); + $this->assertSame($expected, $this->extension->dateTime($this->env, $dateTime)); } /** * @dataProvider dateTimeUtcProvider */ - public function testDateTimeUtc(string $expected, \DateTimeImmutable $dateTime): void + public function testDateTimeUtc(string $expected, DateTimeImmutable $dateTime): void { - self::assertEquals($expected, $this->extension->dateTimeUtc($this->env, $dateTime)); + $this->assertSame($expected, $this->extension->dateTimeUtc($this->env, $dateTime)); } public function testGmtOffset(): void { - $dateTime = new \DateTimeImmutable('2020-07-10 12:34:56'); + $dateTime = new DateTimeImmutable('2020-07-10 12:34:56'); date_default_timezone_set('Europe/Warsaw'); $this->extension = new DateExtension(new TokenStorage()); - self::assertEquals('GMT+02:00', $this->extension->gmtOffset($this->env, $dateTime)); + $this->assertSame('GMT+02:00', $this->extension->gmtOffset($this->env, $dateTime)); date_default_timezone_set('UTC'); $this->extension = new DateExtension(new TokenStorage()); - self::assertEquals('GMT+00:00', $this->extension->gmtOffset($this->env, $dateTime)); + $this->assertSame('GMT+00:00', $this->extension->gmtOffset($this->env, $dateTime)); } /** * @return mixed[] */ - public function timeDiffProvider(): array + public function timeDiffProvider(): Iterator { - $dateTime = new \DateTimeImmutable(); - - return [ - ['1 day ago', $dateTime->modify('-1 day'), $dateTime], - ['in 6 hours', $dateTime->modify('+6 hours'), $dateTime], - ['10 minutes ago', $dateTime->modify('-10 minutes'), $dateTime], - ['5 seconds ago', $dateTime->modify('-5 seconds'), $dateTime], - ['2 seconds ago', $dateTime->modify('-2 seconds'), $dateTime], - ['just now', $dateTime, $dateTime], - ]; + $dateTime = new DateTimeImmutable(); + yield ['1 day ago', $dateTime->modify('-1 day'), $dateTime]; + yield ['in 6 hours', $dateTime->modify('+6 hours'), $dateTime]; + yield ['10 minutes ago', $dateTime->modify('-10 minutes'), $dateTime]; + yield ['5 seconds ago', $dateTime->modify('-5 seconds'), $dateTime]; + yield ['2 seconds ago', $dateTime->modify('-2 seconds'), $dateTime]; + yield ['just now', $dateTime, $dateTime]; } /** * @return mixed[] */ - public function dateTimeProvider(): array + public function dateTimeProvider(): Iterator { - $dateTime = new \DateTimeImmutable('2020-01-02 12:34:56'); - - return [ - ['2020-01-02 12:34:51', $dateTime->modify('-5 second')], - ['2020-01-02 12:34:55', $dateTime->modify('-1 second')], - ['2020-01-01 12:34:56', $dateTime->modify('-1 day')], - ]; + $dateTime = new DateTimeImmutable('2020-01-02 12:34:56'); + yield ['2020-01-02 12:34:51', $dateTime->modify('-5 second')]; + yield ['2020-01-02 12:34:55', $dateTime->modify('-1 second')]; + yield ['2020-01-01 12:34:56', $dateTime->modify('-1 day')]; } /** * @return mixed[] */ - public function dateTimeUtcProvider(): array + public function dateTimeUtcProvider(): Iterator { - $dateTime = new \DateTimeImmutable( + $dateTime = new DateTimeImmutable( '2020-10-10 12:34:56', - new \DateTimeZone('UTC') + new DateTimeZone('UTC') ); - // GMT+02:00 (with DST) - return [ - ['2020-10-10 14:34:51', $dateTime->modify('-5 second')], - ['2020-10-10 14:34:55', $dateTime->modify('-1 second')], - ['2020-10-09 14:34:56', $dateTime->modify('-1 day')], - ['2020-09-10 14:34:56', $dateTime->modify('-1 month')], - ]; + yield ['2020-10-10 14:34:51', $dateTime->modify('-5 second')]; + yield ['2020-10-10 14:34:55', $dateTime->modify('-1 second')]; + yield ['2020-10-09 14:34:56', $dateTime->modify('-1 day')]; + yield ['2020-09-10 14:34:56', $dateTime->modify('-1 month')]; } } diff --git a/tests/Unit/Service/Twig/OAuthProviderExtensionTest.php b/tests/Unit/Service/Twig/OAuthProviderExtensionTest.php index bb862c59..b1d7ea72 100644 --- a/tests/Unit/Service/Twig/OAuthProviderExtensionTest.php +++ b/tests/Unit/Service/Twig/OAuthProviderExtensionTest.php @@ -11,20 +11,20 @@ final class OAuthProviderExtensionTest extends TestCase { public function testGetFilters(): void { - self::assertEquals('oauth_enabled', (new OAuthProviderExtension([]))->getFunctions()[0]->getName()); + $this->assertSame('oauth_enabled', (new OAuthProviderExtension([]))->getFunctions()[0]->getName()); } public function testAnyOauthProviderEnabled(): void { - self::assertFalse((new OAuthProviderExtension([]))->oAuthEnabled()); - self::assertTrue((new OAuthProviderExtension(['github' => 'code']))->oAuthEnabled()); + $this->assertFalse((new OAuthProviderExtension([]))->oAuthEnabled()); + $this->assertTrue((new OAuthProviderExtension(['github' => 'code']))->oAuthEnabled()); } public function testGivenOauthProviderEnabled(): void { - self::assertFalse((new OAuthProviderExtension([]))->oAuthEnabled('github')); - self::assertFalse((new OAuthProviderExtension(['github' => '']))->oAuthEnabled('github')); - self::assertFalse((new OAuthProviderExtension(['github' => null]))->oAuthEnabled('github')); - self::assertTrue((new OAuthProviderExtension(['github' => 'code']))->oAuthEnabled('github')); + $this->assertFalse((new OAuthProviderExtension([]))->oAuthEnabled('github')); + $this->assertFalse((new OAuthProviderExtension(['github' => '']))->oAuthEnabled('github')); + $this->assertFalse((new OAuthProviderExtension(['github' => null]))->oAuthEnabled('github')); + $this->assertTrue((new OAuthProviderExtension(['github' => 'code']))->oAuthEnabled('github')); } } diff --git a/tests/Unit/Service/User/UserOAuthTokenRefresherTest.php b/tests/Unit/Service/User/UserOAuthTokenRefresherTest.php index eecfe9f0..5228daa1 100644 --- a/tests/Unit/Service/User/UserOAuthTokenRefresherTest.php +++ b/tests/Unit/Service/User/UserOAuthTokenRefresherTest.php @@ -6,6 +6,7 @@ use Buddy\Repman\Service\User\UserOAuthTokenRefresher; use Buddy\Repman\Service\User\UserOAuthTokenRefresher\AccessToken; +use DateTimeImmutable; use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use KnpU\OAuth2ClientBundle\Client\OAuth2ClientInterface; use League\OAuth2\Client\Provider\AbstractProvider; @@ -29,7 +30,7 @@ public function testRefreshToken(): void $refresher = new UserOAuthTokenRefresher($oauth); - self::assertEquals(new AccessToken('new-token'), $refresher->refresh('github', 'refresh-token')); - self::assertEquals(new AccessToken('new-token', (new \DateTimeImmutable())->setTimestamp(time() + 3600)), $refresher->refresh('github', 'refresh-token')); + $this->assertEquals(new AccessToken('new-token'), $refresher->refresh('github', 'refresh-token')); + $this->assertEquals(new AccessToken('new-token', (new DateTimeImmutable())->setTimestamp(time() + 3600)), $refresher->refresh('github', 'refresh-token')); } }