diff --git a/.github/workflows/code_quality.yaml b/.github/workflows/code_quality.yaml index 0712dbfbb0..fda85ed5dc 100644 --- a/.github/workflows/code_quality.yaml +++ b/.github/workflows/code_quality.yaml @@ -164,7 +164,7 @@ jobs: - name: PHP Copy Paste Detector uses: StephaneBour/actions-php-cpd@8.2 with: - args: src tests + args: src # # phpdd (Php Code Fixer): diff --git a/composer.json b/composer.json index cde6c6b281..1e7587ae9d 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "hwi/oauth-bundle": "dev-master", "incenteev/composer-parameter-handler": "^2.1", "lexik/jwt-authentication-bundle": "^2.19", - "php-http/guzzle6-adapter": "^2.0", + "php-http/guzzle7-adapter": "^1.0", "php-http/httplug-bundle": "^1.29", "php-http/message": "^1.16", "ramsey/uuid": "^4.7", @@ -70,7 +70,6 @@ "behat/behat": "^3.13", "behat/mink": "^1.10", "deployer/deployer": "^v7.3", - "dg/bypass-finals": "^1.4", "dmore/behat-chrome-extension": "^1.4", "dmore/chrome-mink-driver": "2.9.*", "doctrine/doctrine-fixtures-bundle": "^3.4", @@ -82,7 +81,7 @@ "phpstan/phpstan-doctrine": "^1.3", "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-symfony": "^1.3", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.3", "rector/rector": "^0.18.0", "symfony/browser-kit": "6.3.*", "symfony/http-client": "6.3.*", @@ -90,7 +89,7 @@ "symfony/phpunit-bridge": "6.3.*", "symfony/stopwatch": "6.3.*", "symfony/web-profiler-bundle": "6.3.*", - "vimeo/psalm": "^5.12.0", + "vimeo/psalm": "^5.14.0", "wapmorgan/php-deprecation-detector": "^2.0", "textalk/websocket": "1.5.8" }, diff --git a/composer.lock b/composer.lock index 49fa0461d5..175eeaecd8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0bd7753a404bee566209c9e9079320c1", + "content-hash": "9ae7da352f8d4f1f5b8ee7c9dec70309", "packages": [ { "name": "beberlei/doctrineextensions", @@ -2233,38 +2233,37 @@ }, { "name": "google/apiclient", - "version": "v2.14.0", + "version": "v2.15.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client.git", - "reference": "789c8b07cad97f420ac0467c782036f955a2ad89" + "reference": "49787fa30b8d8313146a61efbf77ed1fede723c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/789c8b07cad97f420ac0467c782036f955a2ad89", - "reference": "789c8b07cad97f420ac0467c782036f955a2ad89", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/49787fa30b8d8313146a61efbf77ed1fede723c2", + "reference": "49787fa30b8d8313146a61efbf77ed1fede723c2", "shasum": "" }, "require": { - "firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0||~6.0", + "firebase/php-jwt": "~6.0", "google/apiclient-services": "~0.200", - "google/auth": "^1.10", - "guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0", + "google/auth": "^1.28", + "guzzlehttp/guzzle": "~6.5||~7.0", "guzzlehttp/psr7": "^1.8.4||^2.2.1", - "monolog/monolog": "^1.17||^2.0||^3.0", - "php": "^5.6|^7.0|^8.0", - "phpseclib/phpseclib": "~2.0||^3.0.2" + "monolog/monolog": "^2.9||^3.0", + "php": "^7.4|^8.0", + "phpseclib/phpseclib": "^3.0.2" }, "require-dev": { - "cache/filesystem-adapter": "^0.3.2|^1.1", + "cache/filesystem-adapter": "^1.1", "composer/composer": "^1.10.22", "phpcompatibility/php-compatibility": "^9.2", - "phpspec/prophecy-phpunit": "^1.1||^2.0", - "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.0", "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1", - "yoast/phpunit-polyfills": "^1.0" + "symfony/dom-crawler": "~2.1" }, "suggest": { "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" @@ -2297,26 +2296,26 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client/issues", - "source": "https://github.com/googleapis/google-api-php-client/tree/v2.14.0" + "source": "https://github.com/googleapis/google-api-php-client/tree/v2.15.0" }, - "time": "2023-05-11T21:54:55+00:00" + "time": "2023-05-18T13:51:33+00:00" }, { "name": "google/apiclient-services", - "version": "v0.302.0", + "version": "v0.314.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "ac872f59a7b4631b12628fe990c167d18a71c783" + "reference": "fe2f7513dc5a4a6cf82715fd0edf7589423d6535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ac872f59a7b4631b12628fe990c167d18a71c783", - "reference": "ac872f59a7b4631b12628fe990c167d18a71c783", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/fe2f7513dc5a4a6cf82715fd0edf7589423d6535", + "reference": "fe2f7513dc5a4a6cf82715fd0edf7589423d6535", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^7.4||^8.0" }, "require-dev": { "phpunit/phpunit": "^5.7||^8.5.13" @@ -2341,38 +2340,38 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.302.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.314.0" }, - "time": "2023-05-16T01:08:12+00:00" + "time": "2023-09-03T01:04:12+00:00" }, { "name": "google/auth", - "version": "v1.26.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7" + "reference": "6028b072aa444d7edecbed603431322026704627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", - "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/6028b072aa444d7edecbed603431322026704627", + "reference": "6028b072aa444d7edecbed603431322026704627", "shasum": "" }, "require": { - "firebase/php-jwt": "^5.5||^6.0", + "firebase/php-jwt": "^6.0", "guzzlehttp/guzzle": "^6.2.1|^7.0", - "guzzlehttp/psr7": "^1.7|^2.0", - "php": "^7.1||^8.0", - "psr/cache": "^1.0|^2.0|^3.0", - "psr/http-message": "^1.0" + "guzzlehttp/psr7": "^2.4.5", + "php": "^7.4||^8.0", + "psr/cache": "^1.0||^2.0||^3.0", + "psr/http-message": "^1.1||^2.0" }, "require-dev": { - "guzzlehttp/promises": "0.1.1|^1.3", - "kelvinmo/simplejwt": "0.7.0", - "phpseclib/phpseclib": "^2.0.31||^3.0", - "phpspec/prophecy-phpunit": "^1.1||^2.0", - "phpunit/phpunit": "^7.5||^9.0.0", + "guzzlehttp/promises": "^2.0", + "kelvinmo/simplejwt": "0.7.1", + "phpseclib/phpseclib": "^3.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.0.0", "sebastian/comparator": ">=1.2.3", "squizlabs/php_codesniffer": "^3.5" }, @@ -2399,27 +2398,27 @@ "support": { "docs": "https://googleapis.github.io/google-auth-library-php/main/", "issues": "https://github.com/googleapis/google-auth-library-php/issues", - "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.26.0" + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.30.0" }, - "time": "2023-04-05T15:11:57+00:00" + "time": "2023-09-07T19:13:44+00:00" }, { "name": "google/cloud-core", - "version": "v1.52.2", + "version": "v1.52.3", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "37817d3e7d8f3a38db7d75810e3dfbcf0eb6b1de" + "reference": "2ae714abfbf979cb52de26227a87e42bfdfb6347" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/37817d3e7d8f3a38db7d75810e3dfbcf0eb6b1de", - "reference": "37817d3e7d8f3a38db7d75810e3dfbcf0eb6b1de", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/2ae714abfbf979cb52de26227a87e42bfdfb6347", + "reference": "2ae714abfbf979cb52de26227a87e42bfdfb6347", "shasum": "" }, "require": { "google/auth": "^1.18", - "guzzlehttp/guzzle": "^5.3|^6.5.7|^7.4.4", + "guzzlehttp/guzzle": "^6.5.8|^7.4.4", "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^1.7|^2.0", "monolog/monolog": "^1.1|^2.0|^3.0", @@ -2464,9 +2463,9 @@ ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", "support": { - "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.52.2" + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.52.3" }, - "time": "2023-08-17T19:37:27+00:00" + "time": "2023-08-25T20:04:15+00:00" }, { "name": "google/cloud-translate", @@ -2525,24 +2524,24 @@ }, { "name": "google/common-protos", - "version": "v3.2.0", + "version": "v4.3.0", "source": { "type": "git", "url": "https://github.com/googleapis/common-protos-php.git", - "reference": "57d4ad36cc48cc0369123042908013ef2a86bb98" + "reference": "4ab56787c4f7c34277055ea7bd9982ad758b2c67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/57d4ad36cc48cc0369123042908013ef2a86bb98", - "reference": "57d4ad36cc48cc0369123042908013ef2a86bb98", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/4ab56787c4f7c34277055ea7bd9982ad758b2c67", + "reference": "4ab56787c4f7c34277055ea7bd9982ad758b2c67", "shasum": "" }, "require": { - "google/protobuf": "^3.6.1" + "google/protobuf": "^3.6.1", + "php": ">=7.4" }, "require-dev": { - "phpunit/phpunit": "^4.8.36||^8.5", - "sami/sami": "*" + "phpunit/phpunit": "^9.0" }, "type": "library", "autoload": { @@ -2571,43 +2570,42 @@ ], "support": { "issues": "https://github.com/googleapis/common-protos-php/issues", - "source": "https://github.com/googleapis/common-protos-php/tree/v3.2.0" + "source": "https://github.com/googleapis/common-protos-php/tree/v4.3.0" }, - "time": "2023-01-12T16:51:46+00:00" + "time": "2023-08-22T18:10:13+00:00" }, { "name": "google/gax", - "version": "v1.19.1", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "30f6b307faa9858bf58d967664467098dbbc354f" + "reference": "2566bce7081f17e4f4c35a215864c6d4a62f010f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/30f6b307faa9858bf58d967664467098dbbc354f", - "reference": "30f6b307faa9858bf58d967664467098dbbc354f", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/2566bce7081f17e4f4c35a215864c6d4a62f010f", + "reference": "2566bce7081f17e4f4c35a215864c6d4a62f010f", "shasum": "" }, "require": { - "google/auth": "1.19.1||^1.25.0", - "google/common-protos": "^1.3.1||^2.0||^3.0", - "google/grpc-gcp": "^0.2", + "google/auth": "^1.25.0", + "google/common-protos": "^3.0||^4.0", + "google/grpc-gcp": "^0.2||^0.3", "google/longrunning": "^0.2", "google/protobuf": "^3.21.4", "grpc/grpc": "^1.13", - "guzzlehttp/promises": "^1.3", - "guzzlehttp/psr7": "^1.7.0||^2", - "php": ">=7.0" + "guzzlehttp/promises": "^1.4||^2.0", + "guzzlehttp/psr7": "^2.0", + "php": ">=7.4" }, "conflict": { "ext-protobuf": "<3.7.0" }, "require-dev": { - "phpspec/prophecy": "^1.10", - "phpunit/phpunit": "^5.5||^8.5", - "squizlabs/php_codesniffer": "3.*", - "yoast/phpunit-polyfills": "^1.0" + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "3.*" }, "type": "library", "autoload": { @@ -2627,34 +2625,34 @@ ], "support": { "issues": "https://github.com/googleapis/gax-php/issues", - "source": "https://github.com/googleapis/gax-php/tree/v1.19.1" + "source": "https://github.com/googleapis/gax-php/tree/v1.22.1" }, - "time": "2023-03-16T19:58:19+00:00" + "time": "2023-08-04T14:32:15+00:00" }, { "name": "google/grpc-gcp", - "version": "v0.2.1", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/GoogleCloudPlatform/grpc-gcp-php.git", - "reference": "899d0112812a812df7692617a59f4076f0d01719" + "reference": "4d8b455a45a89f57e1552cadc41a43bc34c40456" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/899d0112812a812df7692617a59f4076f0d01719", - "reference": "899d0112812a812df7692617a59f4076f0d01719", + "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/4d8b455a45a89f57e1552cadc41a43bc34c40456", + "reference": "4d8b455a45a89f57e1552cadc41a43bc34c40456", "shasum": "" }, "require": { "google/auth": "^1.3", "google/protobuf": "^v3.3.0", "grpc/grpc": "^v1.13.0", - "php": ">=5.5.0", + "php": "^7.4||^8.0", "psr/cache": "^1.0.1||^2.0.0||^3.0.0" }, "require-dev": { "google/cloud-spanner": "^1.7", - "phpunit/phpunit": "4.8.36" + "phpunit/phpunit": "^9.0" }, "type": "library", "autoload": { @@ -2672,9 +2670,9 @@ "description": "gRPC GCP library for channel management", "support": { "issues": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/issues", - "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.2.1" + "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.3.0" }, - "time": "2022-10-11T15:54:47+00:00" + "time": "2023-04-24T14:37:29+00:00" }, { "name": "google/longrunning", @@ -2722,16 +2720,16 @@ }, { "name": "google/protobuf", - "version": "v3.24.0", + "version": "v3.24.3", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "bfa8d627de8464634e6e3b5943f6354baa9cedd2" + "reference": "2fc191fc5e137829081b8700086ac6ed7003b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/bfa8d627de8464634e6e3b5943f6354baa9cedd2", - "reference": "bfa8d627de8464634e6e3b5943f6354baa9cedd2", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/2fc191fc5e137829081b8700086ac6ed7003b925", + "reference": "2fc191fc5e137829081b8700086ac6ed7003b925", "shasum": "" }, "require": { @@ -2760,9 +2758,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.24.0" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.24.3" }, - "time": "2023-08-08T21:14:02+00:00" + "time": "2023-09-07T15:39:13+00:00" }, { "name": "grpc/grpc", @@ -2810,37 +2808,47 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.8", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.9", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17" + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "6.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -2893,19 +2901,20 @@ } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", "framework", "http", "http client", + "psr-18", + "psr-7", "rest", "web service" ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -2921,33 +2930,37 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:07+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -2984,7 +2997,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.3" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -3000,42 +3013,48 @@ "type": "tidelift" } ], - "time": "2023-05-21T12:31:43+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.9.1", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Psr7\\": "src/" } @@ -3074,6 +3093,11 @@ "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -3089,7 +3113,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.1" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -3105,7 +3129,7 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:00:37+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -3171,46 +3195,46 @@ "source": { "type": "git", "url": "https://github.com/hwi/HWIOAuthBundle.git", - "reference": "f11be31d2d551d690669cd5a7b6452ae68a5675a" + "reference": "277625af9a7b372d8eac0a81d8e4e6646f29dd86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hwi/HWIOAuthBundle/zipball/f11be31d2d551d690669cd5a7b6452ae68a5675a", - "reference": "f11be31d2d551d690669cd5a7b6452ae68a5675a", + "url": "https://api.github.com/repos/hwi/HWIOAuthBundle/zipball/277625af9a7b372d8eac0a81d8e4e6646f29dd86", + "reference": "277625af9a7b372d8eac0a81d8e4e6646f29dd86", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", - "symfony/form": "^4.4 || ^5.4 || ^6.1", - "symfony/framework-bundle": "^4.4.20 || ^5.4 || ^6.1", - "symfony/http-client": "^4.4 || ^5.4 || ^6.1", - "symfony/options-resolver": "^4.4 || ^5.4 || ^6.1", - "symfony/security-bundle": "^4.4 || ^5.4 || ^6.1", - "symfony/templating": "^4.4 || ^5.4 || ^6.1" + "symfony/form": "^5.4 || ^6.1", + "symfony/framework-bundle": "^5.4 || ^6.1", + "symfony/http-client": "^5.4 || ^6.1", + "symfony/options-resolver": "^5.4 || ^6.1", + "symfony/security-bundle": "^5.4 || ^6.1" }, "conflict": { + "symfony/security-bundle": ">=6.0,<6.3.4", "twig/twig": "<1.43|>=2.0,<2.13" }, "require-dev": { "doctrine/doctrine-bundle": "^2.4", "doctrine/orm": "^2.9", - "firebase/php-jwt": "^5.5", - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.2", - "phpstan/phpstan-symfony": "^1.0", - "phpunit/phpunit": "^9.5.12", - "symfony/browser-kit": "^4.4.20 || ^5.4 || ^6.1", - "symfony/css-selector": "^4.4 || ^5.4 || ^6.1", + "firebase/php-jwt": "^6.8", + "friendsofphp/php-cs-fixer": "^3.23", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-symfony": "^1.3", + "phpunit/phpunit": "^9.6.11", + "symfony/browser-kit": "^5.4 || ^6.1", + "symfony/css-selector": "^5.4 || ^6.1", "symfony/monolog-bundle": "^3.4", "symfony/phpunit-bridge": "^5.4 || ^6.1", - "symfony/property-access": "^4.4 || ^5.4 || ^6.1", + "symfony/property-access": "^5.4 || ^6.1", "symfony/stopwatch": "^5.4 || ^6.1", - "symfony/translation": "^4.4 || ^5.4 || ^6.1", - "symfony/twig-bundle": "^4.4 || ^5.4 || ^6.1", - "symfony/validator": "^4.4 || ^5.4 || ^6.1", - "symfony/yaml": "^4.4 || ^5.4 || ^6.1" + "symfony/translation": "^5.4 || ^6.1", + "symfony/twig-bundle": "^5.4 || ^6.1", + "symfony/validator": "^5.4 || ^6.1", + "symfony/yaml": "^5.4 || ^6.1" }, "suggest": { "doctrine/doctrine-bundle": "to use Doctrine user provider", @@ -3331,7 +3355,7 @@ "type": "github" } ], - "time": "2023-03-26T18:46:09+00:00" + "time": "2023-08-29T13:08:03+00:00" }, { "name": "incenteev/composer-parameter-handler", @@ -4628,22 +4652,22 @@ "time": "2023-07-11T07:02:26+00:00" }, { - "name": "php-http/guzzle6-adapter", - "version": "v2.0.2", + "name": "php-http/guzzle7-adapter", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-http/guzzle6-adapter.git", - "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56" + "url": "https://github.com/php-http/guzzle7-adapter.git", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/9d1a45eb1c59f12574552e81fb295e9e53430a56", - "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56", + "url": "https://api.github.com/repos/php-http/guzzle7-adapter/zipball/fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", - "php": "^7.1 || ^8.0", + "guzzlehttp/guzzle": "^7.0", + "php": "^7.2 | ^8.0", "php-http/httplug": "^2.0", "psr/http-client": "^1.0" }, @@ -4653,19 +4677,18 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "ext-curl": "*", - "php-http/client-integration-tests": "^2.0 || ^3.0", - "phpunit/phpunit": "^7.4 || ^8.4" + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.0|^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "0.2.x-dev" } }, "autoload": { "psr-4": { - "Http\\Adapter\\Guzzle6\\": "src/" + "Http\\Adapter\\Guzzle7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4674,25 +4697,21 @@ ], "authors": [ { - "name": "David de Boer", - "email": "david@ddeboer.nl" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" } ], - "description": "Guzzle 6 HTTP Adapter", + "description": "Guzzle 7 HTTP Adapter", "homepage": "http://httplug.io", "keywords": [ "Guzzle", "http" ], "support": { - "issues": "https://github.com/php-http/guzzle6-adapter/issues", - "source": "https://github.com/php-http/guzzle6-adapter/tree/v2.0.2" + "issues": "https://github.com/php-http/guzzle7-adapter/issues", + "source": "https://github.com/php-http/guzzle7-adapter/tree/1.0.0" }, - "time": "2021-03-02T10:52:33+00:00" + "time": "2021-03-09T07:35:15+00:00" }, { "name": "php-http/httplug", @@ -5152,16 +5171,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.19", + "version": "3.0.21", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "cc181005cf548bfd8a4896383bb825d859259f95" + "reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95", - "reference": "cc181005cf548bfd8a4896383bb825d859259f95", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4580645d3fc05c189024eb3b834c6c1e4f0f30a1", + "reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1", "shasum": "" }, "require": { @@ -5242,7 +5261,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.19" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.21" }, "funding": [ { @@ -5258,7 +5277,7 @@ "type": "tidelift" } ], - "time": "2023-03-05T17:13:09+00:00" + "time": "2023-07-09T15:24:48+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -5616,16 +5635,16 @@ }, { "name": "psr/http-message", - "version": "1.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { @@ -5634,7 +5653,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -5649,7 +5668,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -5663,9 +5682,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/log", @@ -9245,16 +9264,16 @@ }, { "name": "symfony/http-client", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "b2f892c91e4e02a939edddeb7ef452522d10a424" + "reference": "15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/b2f892c91e4e02a939edddeb7ef452522d10a424", - "reference": "b2f892c91e4e02a939edddeb7ef452522d10a424", + "url": "https://api.github.com/repos/symfony/http-client/zipball/15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00", + "reference": "15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00", "shasum": "" }, "require": { @@ -9317,7 +9336,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.0" + "source": "https://github.com/symfony/http-client/tree/v6.3.2" }, "funding": [ { @@ -9333,7 +9352,7 @@ "type": "tidelift" } ], - "time": "2023-05-12T08:49:48+00:00" + "time": "2023-07-05T08:41:27+00:00" }, { "name": "symfony/http-client-contracts", @@ -9851,16 +9870,16 @@ }, { "name": "symfony/monolog-bridge", - "version": "v6.3.0", + "version": "v6.3.1", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "d45a22a6cca0a0a2a60171bdf137d9001ac5531b" + "reference": "04b04b8e465e0fa84940e5609b6796a8b4e51bf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/d45a22a6cca0a0a2a60171bdf137d9001ac5531b", - "reference": "d45a22a6cca0a0a2a60171bdf137d9001ac5531b", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/04b04b8e465e0fa84940e5609b6796a8b4e51bf1", + "reference": "04b04b8e465e0fa84940e5609b6796a8b4e51bf1", "shasum": "" }, "require": { @@ -9909,7 +9928,7 @@ "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.0" + "source": "https://github.com/symfony/monolog-bridge/tree/v6.3.1" }, "funding": [ { @@ -9925,7 +9944,7 @@ "type": "tidelift" } ], - "time": "2023-04-24T14:22:26+00:00" + "time": "2023-06-08T11:13:32+00:00" }, { "name": "symfony/monolog-bundle", @@ -12316,71 +12335,6 @@ ], "time": "2023-07-05T08:41:27+00:00" }, - { - "name": "symfony/templating", - "version": "v6.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/templating.git", - "reference": "27d79475d8bcba894235b5472df158e78c6419a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/templating/zipball/27d79475d8bcba894235b5472df158e78c6419a3", - "reference": "27d79475d8bcba894235b5472df158e78c6419a3", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8" - }, - "require-dev": { - "psr/log": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Templating\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides all the tools needed to build any kind of template system", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/templating/tree/v6.3.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-22T08:23:52+00:00" - }, { "name": "symfony/translation", "version": "v6.3.3", @@ -14145,59 +14099,6 @@ ], "time": "2023-04-05T09:24:30+00:00" }, - { - "name": "dg/bypass-finals", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/dg/bypass-finals.git", - "reference": "7df37b7342d7d25ab906e53eb4e92d83542f46c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dg/bypass-finals/zipball/7df37b7342d7d25ab906e53eb4e92d83542f46c1", - "reference": "7df37b7342d7d25ab906e53eb4e92d83542f46c1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.3", - "phpstan/phpstan": "^0.12" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - } - ], - "description": "Removes final keyword from source code on-the-fly and allows mocking of final methods and classes", - "keywords": [ - "finals", - "mocking", - "phpunit", - "testing", - "unit" - ], - "support": { - "issues": "https://github.com/dg/bypass-finals/issues", - "source": "https://github.com/dg/bypass-finals/tree/v1.5.0" - }, - "time": "2023-08-23T11:20:33+00:00" - }, { "name": "dmore/behat-chrome-extension", "version": "1.4.0", @@ -14339,16 +14240,16 @@ }, { "name": "doctrine/data-fixtures", - "version": "1.6.6", + "version": "1.6.7", "source": { "type": "git", "url": "https://github.com/doctrine/data-fixtures.git", - "reference": "4af35dadbfcf4b00abb2a217c4c8c8800cf5fcf4" + "reference": "ae4e845decbe177348fdbecd04331f4fb96aa301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/4af35dadbfcf4b00abb2a217c4c8c8800cf5fcf4", - "reference": "4af35dadbfcf4b00abb2a217c4c8c8800cf5fcf4", + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/ae4e845decbe177348fdbecd04331f4fb96aa301", + "reference": "ae4e845decbe177348fdbecd04331f4fb96aa301", "shasum": "" }, "require": { @@ -14358,14 +14259,14 @@ }, "conflict": { "doctrine/dbal": "<2.13", - "doctrine/orm": "<2.12", + "doctrine/orm": "<2.14", "doctrine/phpcr-odm": "<1.3.0" }, "require-dev": { "doctrine/coding-standard": "^11.0", "doctrine/dbal": "^2.13 || ^3.0", "doctrine/mongodb-odm": "^1.3.0 || ^2.0.0", - "doctrine/orm": "^2.12", + "doctrine/orm": "^2.14", "ext-sqlite3": "*", "phpstan/phpstan": "^1.5", "phpunit/phpunit": "^8.5 || ^9.5 || ^10.0", @@ -14401,7 +14302,7 @@ ], "support": { "issues": "https://github.com/doctrine/data-fixtures/issues", - "source": "https://github.com/doctrine/data-fixtures/tree/1.6.6" + "source": "https://github.com/doctrine/data-fixtures/tree/1.6.7" }, "funding": [ { @@ -14417,7 +14318,7 @@ "type": "tidelift" } ], - "time": "2023-04-20T13:08:54+00:00" + "time": "2023-08-17T21:15:33+00:00" }, { "name": "doctrine/doctrine-fixtures-bundle", @@ -14878,16 +14779,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.25.1", + "version": "v3.26.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b" + "reference": "5fcf0c699d8f053bb6b5bfe62b4b5c6c2a88bc55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8e21d69801de6b5ecb0dbe0bcdf967b335b1260b", - "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/5fcf0c699d8f053bb6b5bfe62b4b5c6c2a88bc55", + "reference": "5fcf0c699d8f053bb6b5bfe62b4b5c6c2a88bc55", "shasum": "" }, "require": { @@ -14961,7 +14862,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.26.0" }, "funding": [ { @@ -14969,7 +14870,7 @@ "type": "github" } ], - "time": "2023-09-04T01:22:52+00:00" + "time": "2023-09-08T09:26:05+00:00" }, { "name": "friendsofphp/proxy-manager-lts", @@ -15055,16 +14956,16 @@ }, { "name": "laminas/laminas-code", - "version": "4.11.0", + "version": "4.12.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-code.git", - "reference": "169123b3ede20a9193480c53de2a8194f8c073ec" + "reference": "36cbee228b427446419dd51944bdfb6bb8ddbcd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/169123b3ede20a9193480c53de2a8194f8c073ec", - "reference": "169123b3ede20a9193480c53de2a8194f8c073ec", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/36cbee228b427446419dd51944bdfb6bb8ddbcd0", + "reference": "36cbee228b427446419dd51944bdfb6bb8ddbcd0", "shasum": "" }, "require": { @@ -15114,7 +15015,7 @@ "type": "community_bridge" } ], - "time": "2023-05-14T12:05:38+00:00" + "time": "2023-09-06T14:56:25+00:00" }, { "name": "masterminds/html5", @@ -15295,16 +15196,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -15345,9 +15246,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -15572,16 +15473,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", "shasum": "" }, "require": { @@ -15624,9 +15525,9 @@ "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.7.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" }, - "time": "2023-05-30T18:13:47+00:00" + "time": "2023-08-12T11:01:26+00:00" }, { "name": "phpstan/phpstan", @@ -15885,16 +15786,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "10.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "cd59bb34756a16ca8253ce9b2909039c227fff71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cd59bb34756a16ca8253ce9b2909039c227fff71", + "reference": "cd59bb34756a16ca8253ce9b2909039c227fff71", "shasum": "" }, "require": { @@ -15902,18 +15803,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -15922,7 +15823,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -15950,7 +15851,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.4" }, "funding": [ { @@ -15958,32 +15860,32 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-08-31T14:04:38+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -16010,7 +15912,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -16018,28 +15921,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -16047,7 +15950,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -16073,7 +15976,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -16081,32 +15984,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -16132,7 +16035,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -16140,32 +16044,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -16191,7 +16095,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -16199,24 +16103,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.8", + "version": "10.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" + "reference": "241ed4dd0db1c096984e62d414c4e1ac8d5dbff4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/241ed4dd0db1c096984e62d414c4e1ac8d5dbff4", + "reference": "241ed4dd0db1c096984e62d414c4e1ac8d5dbff4", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -16226,27 +16129,26 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0.1", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -16254,7 +16156,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.3-dev" } }, "autoload": { @@ -16286,7 +16188,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.3" }, "funding": [ { @@ -16302,7 +16204,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T05:14:45+00:00" + "time": "2023-09-05T04:34:51+00:00" }, { "name": "rector/rector", @@ -16362,28 +16264,28 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -16406,7 +16308,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/2.0.0" }, "funding": [ { @@ -16414,32 +16316,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -16462,7 +16364,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -16470,32 +16372,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -16517,7 +16419,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -16525,34 +16427,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -16591,7 +16495,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -16599,33 +16504,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "c70b73893e10757af9c6a48929fa6a333b56a97a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c70b73893e10757af9c6a48929fa6a333b56a97a", + "reference": "c70b73893e10757af9c6a48929fa6a333b56a97a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -16648,7 +16553,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.1" }, "funding": [ { @@ -16656,33 +16562,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-08-31T09:55:53+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -16714,7 +16620,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -16722,27 +16629,27 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -16750,7 +16657,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -16769,7 +16676,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -16777,7 +16684,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -16785,34 +16693,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "32ff03d078fed1279c4ec9a407d08c5e9febb480" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/32ff03d078fed1279c4ec9a407d08c5e9febb480", + "reference": "32ff03d078fed1279c4ec9a407d08c5e9febb480", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -16854,7 +16762,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.1" }, "funding": [ { @@ -16862,38 +16771,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2023-09-08T04:46:58+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -16918,7 +16824,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -16926,33 +16833,33 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -16975,7 +16882,8 @@ "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" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" }, "funding": [ { @@ -16983,34 +16891,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-08-31T09:25:50+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17032,7 +16940,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -17040,32 +16948,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -17087,7 +16995,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -17095,32 +17003,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -17150,7 +17058,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -17158,87 +17066,32 @@ "type": "github" } ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -17261,7 +17114,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -17269,29 +17122,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -17314,7 +17167,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -17322,7 +17175,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "spatie/array-to-xml", @@ -17457,16 +17310,16 @@ }, { "name": "symfony/css-selector", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf" + "reference": "883d961421ab1709877c10ac99451632a3d6fa57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/883d961421ab1709877c10ac99451632a3d6fa57", + "reference": "883d961421ab1709877c10ac99451632a3d6fa57", "shasum": "" }, "require": { @@ -17502,7 +17355,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.3.0" + "source": "https://github.com/symfony/css-selector/tree/v6.3.2" }, "funding": [ { @@ -17518,20 +17371,20 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:43:42+00:00" + "time": "2023-07-12T16:00:22+00:00" }, { "name": "symfony/dom-crawler", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "8aa333f41f05afc7fc285a976b58272fd90fc212" + "reference": "3fdd2a3d5fdc363b2e8dbf817f9726a4d013cbd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/8aa333f41f05afc7fc285a976b58272fd90fc212", - "reference": "8aa333f41f05afc7fc285a976b58272fd90fc212", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/3fdd2a3d5fdc363b2e8dbf817f9726a4d013cbd1", + "reference": "3fdd2a3d5fdc363b2e8dbf817f9726a4d013cbd1", "shasum": "" }, "require": { @@ -17569,7 +17422,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.3.1" + "source": "https://github.com/symfony/dom-crawler/tree/v6.3.4" }, "funding": [ { @@ -17585,7 +17438,7 @@ "type": "tidelift" } ], - "time": "2023-06-05T15:30:22+00:00" + "time": "2023-08-01T07:43:40+00:00" }, { "name": "symfony/maker-bundle", @@ -18090,16 +17943,16 @@ }, { "name": "vimeo/psalm", - "version": "5.14.1", + "version": "5.15.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d" + "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/b9d355e0829c397b9b3b47d0c0ed042a8a70284d", - "reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/5c774aca4746caf3d239d9c8cadb9f882ca29352", + "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352", "shasum": "" }, "require": { @@ -18127,6 +17980,9 @@ "symfony/console": "^4.1.6 || ^5.0 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0" }, + "conflict": { + "nikic/php-parser": "4.17.0" + }, "provide": { "psalm/psalm": "self.version" }, @@ -18190,9 +18046,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.14.1" + "source": "https://github.com/vimeo/psalm/tree/5.15.0" }, - "time": "2023-08-01T05:16:55+00:00" + "time": "2023-08-20T23:07:30+00:00" }, { "name": "wapmorgan/php-deprecation-detector", @@ -18348,5 +18204,5 @@ "ext-posix": "8.2", "ext-zip": "8.2" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/config/bootstrap_test.php b/config/bootstrap_test.php index eff04c06d3..f7aec524a3 100644 --- a/config/bootstrap_test.php +++ b/config/bootstrap_test.php @@ -2,7 +2,3 @@ $_SERVER['APP_ENV'] = 'test'; require dirname(__DIR__).'/config/bootstrap.php'; - -use DG\BypassFinals; - -BypassFinals::enable(); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 32a2a7fd3f..e369150e8d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,40 +1,27 @@ - - - - - - - - - - - - - - - tests/PhpUnit - - - - - - ./src - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + tests/PhpUnit + + + + + + + + + ./src + + + diff --git a/src/Admin/ApkGeneration/ApkController.php b/src/Admin/ApkGeneration/ApkController.php index 9d8baa1fa3..52ed4812b8 100644 --- a/src/Admin/ApkGeneration/ApkController.php +++ b/src/Admin/ApkGeneration/ApkController.php @@ -19,8 +19,7 @@ public function __construct( protected ProgramManager $program_manager, protected JenkinsDispatcher $jenkins_dispatcher, protected EntityManagerInterface $entity_manager - ) { - } + ) {} public function resetApkBuildStatusAction(): RedirectResponse { diff --git a/src/Admin/ApkGeneration/ApkPendingAdmin.php b/src/Admin/ApkGeneration/ApkPendingAdmin.php index e81d27fc6a..a7fd76f0a8 100644 --- a/src/Admin/ApkGeneration/ApkPendingAdmin.php +++ b/src/Admin/ApkGeneration/ApkPendingAdmin.php @@ -32,8 +32,7 @@ protected function configureDefaultSortValues(array &$sortValues): void public function __construct( private readonly ScreenshotRepository $screenshot_repository - ) { - } + ) {} /** * @param Program $object diff --git a/src/Admin/ApkGeneration/ApkReadyAdmin.php b/src/Admin/ApkGeneration/ApkReadyAdmin.php index f35b086c1c..dcaff90f1e 100644 --- a/src/Admin/ApkGeneration/ApkReadyAdmin.php +++ b/src/Admin/ApkGeneration/ApkReadyAdmin.php @@ -32,8 +32,7 @@ protected function configureDefaultSortValues(array &$sortValues): void public function __construct( private readonly ScreenshotRepository $screenshot_repository - ) { - } + ) {} public function getThumbnailImageUrl(Program $object): string { diff --git a/src/Admin/Comments/ReportedComments/ReportedCommentsController.php b/src/Admin/Comments/ReportedComments/ReportedCommentsController.php index 6244435098..319b709122 100644 --- a/src/Admin/Comments/ReportedComments/ReportedCommentsController.php +++ b/src/Admin/Comments/ReportedComments/ReportedCommentsController.php @@ -16,8 +16,7 @@ class ReportedCommentsController extends CRUDController { public function __construct( private readonly EntityManagerInterface $entity_manager - ) { - } + ) {} public function unreportProgramAction(): RedirectResponse { diff --git a/src/Admin/DB_Updater/AchievementsAdmin.php b/src/Admin/DB_Updater/AchievementsAdmin.php index 3dd5128aa2..50ee33f3b6 100644 --- a/src/Admin/DB_Updater/AchievementsAdmin.php +++ b/src/Admin/DB_Updater/AchievementsAdmin.php @@ -19,8 +19,7 @@ class AchievementsAdmin extends AbstractAdmin public function __construct( protected AchievementManager $achievement_manager - ) { - } + ) {} protected function configureRoutes(RouteCollectionInterface $collection): void { diff --git a/src/Admin/DB_Updater/Controller/AchievementsAdminController.php b/src/Admin/DB_Updater/Controller/AchievementsAdminController.php index b6fa9ff0ee..016b225414 100644 --- a/src/Admin/DB_Updater/Controller/AchievementsAdminController.php +++ b/src/Admin/DB_Updater/Controller/AchievementsAdminController.php @@ -21,8 +21,7 @@ class AchievementsAdminController extends CRUDController public function __construct( protected AchievementManager $achievement_manager, protected KernelInterface $kernel - ) { - } + ) {} public function listAction(Request $request = null): Response { diff --git a/src/Admin/DB_Updater/Controller/CronJobsAdminController.php b/src/Admin/DB_Updater/Controller/CronJobsAdminController.php index b852b46640..b72306b139 100644 --- a/src/Admin/DB_Updater/Controller/CronJobsAdminController.php +++ b/src/Admin/DB_Updater/Controller/CronJobsAdminController.php @@ -23,8 +23,7 @@ public function __construct( protected CronJobRepository $cron_job_repository, protected EntityManagerInterface $entity_manager, protected KernelInterface $kernel - ) { - } + ) {} public function listAction(Request $request = null): Response { diff --git a/src/Admin/DB_Updater/Controller/ExtensionsAdminController.php b/src/Admin/DB_Updater/Controller/ExtensionsAdminController.php index baf4a1d570..eaf5dd46f0 100644 --- a/src/Admin/DB_Updater/Controller/ExtensionsAdminController.php +++ b/src/Admin/DB_Updater/Controller/ExtensionsAdminController.php @@ -19,8 +19,7 @@ class ExtensionsAdminController extends CRUDController { public function __construct( protected KernelInterface $kernel - ) { - } + ) {} public function listAction(Request $request = null): Response { diff --git a/src/Admin/DB_Updater/Controller/SpecialUpdaterAdminController.php b/src/Admin/DB_Updater/Controller/SpecialUpdaterAdminController.php index 43641b3e89..1edcef01c9 100644 --- a/src/Admin/DB_Updater/Controller/SpecialUpdaterAdminController.php +++ b/src/Admin/DB_Updater/Controller/SpecialUpdaterAdminController.php @@ -18,8 +18,7 @@ class SpecialUpdaterAdminController extends CRUDController { public function __construct( protected KernelInterface $kernel - ) { - } + ) {} public function listAction(Request $request = null): Response { diff --git a/src/Admin/DB_Updater/Controller/TagsAdminController.php b/src/Admin/DB_Updater/Controller/TagsAdminController.php index 944bc643f0..2f0abf4c92 100644 --- a/src/Admin/DB_Updater/Controller/TagsAdminController.php +++ b/src/Admin/DB_Updater/Controller/TagsAdminController.php @@ -19,8 +19,7 @@ class TagsAdminController extends CRUDController { public function __construct( protected KernelInterface $kernel - ) { - } + ) {} public function listAction(Request $request = null): Response { diff --git a/src/Admin/MediaPackage/MediaPackageAdmin.php b/src/Admin/MediaPackage/MediaPackageAdmin.php index 146439a528..ea44d2e384 100644 --- a/src/Admin/MediaPackage/MediaPackageAdmin.php +++ b/src/Admin/MediaPackage/MediaPackageAdmin.php @@ -36,9 +36,7 @@ protected function configureFormFields(FormMapper $form): void * * Fields to be shown on filter forms */ - protected function configureDatagridFilters(DatagridMapper $filter): void - { - } + protected function configureDatagridFilters(DatagridMapper $filter): void {} /** * {@inheritdoc} diff --git a/src/Admin/MediaPackage/MediaPackageFileAdmin.php b/src/Admin/MediaPackage/MediaPackageFileAdmin.php index b479885b2c..0f65c9cc4f 100644 --- a/src/Admin/MediaPackage/MediaPackageFileAdmin.php +++ b/src/Admin/MediaPackage/MediaPackageFileAdmin.php @@ -25,8 +25,7 @@ class MediaPackageFileAdmin extends AbstractAdmin public function __construct( private readonly MediaPackageFileRepository $media_package_file_repository - ) { - } + ) {} public function prePersist($object): void { diff --git a/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php b/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php index 3e2560a638..012aeddc93 100644 --- a/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php +++ b/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php @@ -43,8 +43,7 @@ public function __construct( private readonly ExtractedFileRepository $extracted_file_repository, protected TokenStorageInterface $security_token_storage, protected ParameterBagInterface $parameter_bag - ) { - } + ) {} /** * @param mixed|Program $object @@ -181,7 +180,7 @@ protected function configureShowFields(ShowMapper $show): void 'template' => 'Admin/program_containing_code_objects.html.twig', ]) ->add('Actions', null, [ - 'accessor' => function ($subject): void { }, // Just some buttons, nothing to "access"! + 'accessor' => function ($subject): void {}, // Just some buttons, nothing to "access"! 'template' => 'Admin/program_approve_action.html.twig', ]) ; diff --git a/src/Admin/Projects/ProjectsAdmin.php b/src/Admin/Projects/ProjectsAdmin.php index bb7afca836..3aa2392cea 100644 --- a/src/Admin/Projects/ProjectsAdmin.php +++ b/src/Admin/Projects/ProjectsAdmin.php @@ -42,8 +42,7 @@ public function __construct( private readonly ScreenshotRepository $screenshot_repository, protected TokenStorageInterface $security_token_storage, private readonly ParameterBagInterface $parameter_bag - ) { - } + ) {} public function getObjectMetadata($object): MetadataInterface { diff --git a/src/Admin/SpecialProjects/ExampleProgramAdmin.php b/src/Admin/SpecialProjects/ExampleProgramAdmin.php index 6e1cba8892..6310918bb7 100644 --- a/src/Admin/SpecialProjects/ExampleProgramAdmin.php +++ b/src/Admin/SpecialProjects/ExampleProgramAdmin.php @@ -34,8 +34,7 @@ public function __construct( private readonly ImageRepository $example_image_repository, private readonly ProgramManager $program_manager, private readonly FlavorRepository $flavor_repository - ) { - } + ) {} /** * @param ExampleProgram $object diff --git a/src/Admin/SpecialProjects/FeaturedProgramAdmin.php b/src/Admin/SpecialProjects/FeaturedProgramAdmin.php index b259d2d23f..d3f9b2058c 100644 --- a/src/Admin/SpecialProjects/FeaturedProgramAdmin.php +++ b/src/Admin/SpecialProjects/FeaturedProgramAdmin.php @@ -34,8 +34,7 @@ class FeaturedProgramAdmin extends AbstractAdmin public function __construct( private readonly ImageRepository $featured_image_repository, private readonly ProgramManager $program_manager - ) { - } + ) {} /** * @param FeaturedProgram $object diff --git a/src/Admin/Statistics/Translation/Controller/AbstractMachineTranslationAdminController.php b/src/Admin/Statistics/Translation/Controller/AbstractMachineTranslationAdminController.php index 584c157102..488f170fb0 100644 --- a/src/Admin/Statistics/Translation/Controller/AbstractMachineTranslationAdminController.php +++ b/src/Admin/Statistics/Translation/Controller/AbstractMachineTranslationAdminController.php @@ -26,8 +26,7 @@ abstract class AbstractMachineTranslationAdminController extends CRUDController public function __construct( private readonly EntityManagerInterface $entity_manager, private readonly KernelInterface $kernel - ) { - } + ) {} public function listAction(Request $request): Response { diff --git a/src/Admin/Survey/AllSurveysAdmin.php b/src/Admin/Survey/AllSurveysAdmin.php index 2597606e01..f545ea68f3 100644 --- a/src/Admin/Survey/AllSurveysAdmin.php +++ b/src/Admin/Survey/AllSurveysAdmin.php @@ -26,8 +26,7 @@ class AllSurveysAdmin extends AbstractAdmin public function __construct( protected EntityManagerInterface $entity_manager - ) { - } + ) {} /** * {@inheritdoc} diff --git a/src/Admin/Tools/BroadcastNotification/BroadcastNotificationController.php b/src/Admin/Tools/BroadcastNotification/BroadcastNotificationController.php index 397ffbd631..f376448cc3 100644 --- a/src/Admin/Tools/BroadcastNotification/BroadcastNotificationController.php +++ b/src/Admin/Tools/BroadcastNotification/BroadcastNotificationController.php @@ -18,8 +18,7 @@ class BroadcastNotificationController extends CRUDController public function __construct( protected NotificationManager $notification_manager, protected UserManager $user_manager - ) { - } + ) {} public function listAction(Request $request): Response { diff --git a/src/Admin/Tools/FeatureFlag/FeatureFlagAdmin.php b/src/Admin/Tools/FeatureFlag/FeatureFlagAdmin.php index 1a0bb4b14d..ec0ed5d652 100644 --- a/src/Admin/Tools/FeatureFlag/FeatureFlagAdmin.php +++ b/src/Admin/Tools/FeatureFlag/FeatureFlagAdmin.php @@ -22,9 +22,7 @@ class FeatureFlagAdmin extends AbstractAdmin * * Fields to be shown on filter forms */ - protected function configureDatagridFilters(DatagridMapper $filter): void - { - } + protected function configureDatagridFilters(DatagridMapper $filter): void {} /** * {@inheritdoc} diff --git a/src/Admin/Tools/FeatureFlag/FeatureFlagController.php b/src/Admin/Tools/FeatureFlag/FeatureFlagController.php index 3c8e823a40..1900d232fc 100644 --- a/src/Admin/Tools/FeatureFlag/FeatureFlagController.php +++ b/src/Admin/Tools/FeatureFlag/FeatureFlagController.php @@ -11,9 +11,7 @@ */ class FeatureFlagController extends CRUDController { - public function __construct(protected FeatureFlagManager $manager) - { - } + public function __construct(protected FeatureFlagManager $manager) {} public function setFlagAction(): RedirectResponse { diff --git a/src/Admin/Tools/Maintenance/MaintainController.php b/src/Admin/Tools/Maintenance/MaintainController.php index ad44a4556c..6ad5267ec7 100644 --- a/src/Admin/Tools/Maintenance/MaintainController.php +++ b/src/Admin/Tools/Maintenance/MaintainController.php @@ -23,8 +23,7 @@ public function __construct( private readonly string $file_storage_dir, private readonly string $apk_dir, private readonly string $log_dir - ) { - } + ) {} /** * @throws \Exception diff --git a/src/Admin/Tools/Maintenance/RemovableMemory.php b/src/Admin/Tools/Maintenance/RemovableMemory.php index b5d3b1e2e8..30fd9fc3ff 100644 --- a/src/Admin/Tools/Maintenance/RemovableMemory.php +++ b/src/Admin/Tools/Maintenance/RemovableMemory.php @@ -20,9 +20,7 @@ class RemovableMemory public ?string $archive_command_name = null; - public function __construct(public string $name = '', public string $description = '') - { - } + public function __construct(public string $name = '', public string $description = '') {} public function setSize(string $size): void { diff --git a/src/Admin/Tools/SendMailToUser/SendMailToUserController.php b/src/Admin/Tools/SendMailToUser/SendMailToUserController.php index f0f8b0029f..a71f286c37 100644 --- a/src/Admin/Tools/SendMailToUser/SendMailToUserController.php +++ b/src/Admin/Tools/SendMailToUser/SendMailToUserController.php @@ -21,8 +21,7 @@ public function __construct( protected UserManager $user_manager, protected LoggerInterface $logger, private readonly ResetPasswordHelperInterface $resetPasswordHelper - ) { - } + ) {} public function listAction(Request $request = null): Response { diff --git a/src/Admin/Users/UserAdmin.php b/src/Admin/Users/UserAdmin.php index 0cdd7902bd..748cd4cfa9 100644 --- a/src/Admin/Users/UserAdmin.php +++ b/src/Admin/Users/UserAdmin.php @@ -4,6 +4,4 @@ use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin; -class UserAdmin extends BaseUserAdmin -{ -} +class UserAdmin extends BaseUserAdmin {} diff --git a/src/Admin/Users/UserDataReport/UserDataReportController.php b/src/Admin/Users/UserDataReport/UserDataReportController.php index 3387e923fd..c0c821ab08 100644 --- a/src/Admin/Users/UserDataReport/UserDataReportController.php +++ b/src/Admin/Users/UserDataReport/UserDataReportController.php @@ -18,8 +18,7 @@ public function __construct( protected UserManager $user_manager, protected NotificationRepository $notification_repository, protected EntityManagerInterface $entity_manager - ) { - } + ) {} /** * @param string $id The id of the user which data should be shown diff --git a/src/Api/AuthenticationApi.php b/src/Api/AuthenticationApi.php index 72a91934cf..d1e8b670f3 100644 --- a/src/Api/AuthenticationApi.php +++ b/src/Api/AuthenticationApi.php @@ -12,11 +12,9 @@ use OpenAPI\Server\Model\UpgradeTokenRequest; use Symfony\Component\HttpFoundation\Response; -final class AuthenticationApi extends AbstractApiController implements AuthenticationApiInterface +class AuthenticationApi extends AbstractApiController implements AuthenticationApiInterface { - public function __construct(private readonly AuthenticationApiFacade $facade) - { - } + public function __construct(private readonly AuthenticationApiFacade $facade) {} public function authenticationGet(int &$responseCode, array &$responseHeaders): void { diff --git a/src/Api/Exceptions/ApiException.php b/src/Api/Exceptions/ApiException.php index 6fd6663be3..e7106b89d9 100644 --- a/src/Api/Exceptions/ApiException.php +++ b/src/Api/Exceptions/ApiException.php @@ -2,6 +2,4 @@ namespace App\Api\Exceptions; -class ApiException extends \Exception -{ -} +class ApiException extends \Exception {} diff --git a/src/Api/Exceptions/ApiVersionNotSupportedException.php b/src/Api/Exceptions/ApiVersionNotSupportedException.php index eaeaee00d8..8c67011f3f 100644 --- a/src/Api/Exceptions/ApiVersionNotSupportedException.php +++ b/src/Api/Exceptions/ApiVersionNotSupportedException.php @@ -4,7 +4,7 @@ use Exception; -final class ApiVersionNotSupportedException extends ApiException +class ApiVersionNotSupportedException extends ApiException { /** * ApiVersionNotSupportedException constructor. diff --git a/src/Api/MediaLibraryApi.php b/src/Api/MediaLibraryApi.php index 789bd4fc8f..4cd9de4197 100644 --- a/src/Api/MediaLibraryApi.php +++ b/src/Api/MediaLibraryApi.php @@ -8,11 +8,9 @@ use OpenAPI\Server\Model\MediaFileResponse; use Symfony\Component\HttpFoundation\Response; -final class MediaLibraryApi extends AbstractApiController implements MediaLibraryApiInterface +class MediaLibraryApi extends AbstractApiController implements MediaLibraryApiInterface { - public function __construct(private readonly MediaLibraryApiFacade $facade) - { - } + public function __construct(private readonly MediaLibraryApiFacade $facade) {} public function mediaFilesSearchGet(string $query, int $limit, int $offset, string $attributes, string $flavor, string $package_name, int &$responseCode, array &$responseHeaders): array { diff --git a/src/Api/NotificationsApi.php b/src/Api/NotificationsApi.php index 025bf9ed29..c9f1289e55 100644 --- a/src/Api/NotificationsApi.php +++ b/src/Api/NotificationsApi.php @@ -8,11 +8,9 @@ use OpenAPI\Server\Model\NotificationsCountResponse; use Symfony\Component\HttpFoundation\Response; -final class NotificationsApi extends AbstractApiController implements NotificationsApiInterface +class NotificationsApi extends AbstractApiController implements NotificationsApiInterface { - public function __construct(private readonly NotificationsApiFacade $facade) - { - } + public function __construct(private readonly NotificationsApiFacade $facade) {} public function notificationIdReadPut(int $id, string $accept_language, int &$responseCode, array &$responseHeaders): void { diff --git a/src/Api/ProjectsApi.php b/src/Api/ProjectsApi.php index dfaadab1d2..1c710f2a63 100644 --- a/src/Api/ProjectsApi.php +++ b/src/Api/ProjectsApi.php @@ -18,11 +18,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Response; -final class ProjectsApi extends AbstractApiController implements ProjectsApiInterface +class ProjectsApi extends AbstractApiController implements ProjectsApiInterface { - public function __construct(private readonly ProjectsApiFacade $facade) - { - } + public function __construct(private readonly ProjectsApiFacade $facade) {} public function projectIdGet(string $id, int &$responseCode, array &$responseHeaders): ?ProjectResponse { diff --git a/src/Api/SearchApi.php b/src/Api/SearchApi.php index 95ac0960db..9b7b08d33a 100644 --- a/src/Api/SearchApi.php +++ b/src/Api/SearchApi.php @@ -8,11 +8,9 @@ use OpenAPI\Server\Model\SearchResponse; use Symfony\Component\HttpFoundation\Response; -final class SearchApi extends AbstractApiController implements SearchApiInterface +class SearchApi extends AbstractApiController implements SearchApiInterface { - public function __construct(private readonly SearchApiFacade $facade) - { - } + public function __construct(private readonly SearchApiFacade $facade) {} /** * @throws \JsonException diff --git a/src/Api/Services/Authentication/AuthenticationApiFacade.php b/src/Api/Services/Authentication/AuthenticationApiFacade.php index ba16f42fbc..e891543729 100644 --- a/src/Api/Services/Authentication/AuthenticationApiFacade.php +++ b/src/Api/Services/Authentication/AuthenticationApiFacade.php @@ -5,7 +5,7 @@ use App\Api\Services\AuthenticationManager; use App\Api\Services\Base\AbstractApiFacade; -final class AuthenticationApiFacade extends AbstractApiFacade +class AuthenticationApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/Authentication/AuthenticationApiLoader.php b/src/Api/Services/Authentication/AuthenticationApiLoader.php index 1621c45c98..5209231344 100644 --- a/src/Api/Services/Authentication/AuthenticationApiLoader.php +++ b/src/Api/Services/Authentication/AuthenticationApiLoader.php @@ -6,11 +6,9 @@ use App\DB\Entity\User\User; use App\User\UserManager; -final class AuthenticationApiLoader extends AbstractApiLoader +class AuthenticationApiLoader extends AbstractApiLoader { - public function __construct(protected UserManager $user_manager) - { - } + public function __construct(protected UserManager $user_manager) {} public function findUserByUploadToken(string $upload_token): ?User { diff --git a/src/Api/Services/Authentication/AuthenticationApiProcessor.php b/src/Api/Services/Authentication/AuthenticationApiProcessor.php index debacd9525..acf660348b 100644 --- a/src/Api/Services/Authentication/AuthenticationApiProcessor.php +++ b/src/Api/Services/Authentication/AuthenticationApiProcessor.php @@ -12,11 +12,9 @@ use Firebase\JWT\Key; use GuzzleHttp\Client; -final class AuthenticationApiProcessor extends AbstractApiProcessor +class AuthenticationApiProcessor extends AbstractApiProcessor { - public function __construct(private readonly UserManager $user_manager, private readonly AuthenticationManager $authentication_manager) - { - } + public function __construct(private readonly UserManager $user_manager, private readonly AuthenticationManager $authentication_manager) {} public function createJWTByUser(User $user): string { diff --git a/src/Api/Services/Authentication/AuthenticationRequestValidator.php b/src/Api/Services/Authentication/AuthenticationRequestValidator.php index c17324d3b4..9659d83789 100644 --- a/src/Api/Services/Authentication/AuthenticationRequestValidator.php +++ b/src/Api/Services/Authentication/AuthenticationRequestValidator.php @@ -8,7 +8,7 @@ use Firebase\JWT\Key; use GuzzleHttp\Client; -final class AuthenticationRequestValidator extends AbstractRequestValidator +class AuthenticationRequestValidator extends AbstractRequestValidator { public function validateGoogleIdToken(string $id_token): bool { diff --git a/src/Api/Services/Authentication/AuthenticationResponseManager.php b/src/Api/Services/Authentication/AuthenticationResponseManager.php index d9720a0d8c..2573784fd0 100644 --- a/src/Api/Services/Authentication/AuthenticationResponseManager.php +++ b/src/Api/Services/Authentication/AuthenticationResponseManager.php @@ -5,7 +5,7 @@ use App\Api\Services\Base\AbstractResponseManager; use OpenAPI\Server\Model\JWTResponse; -final class AuthenticationResponseManager extends AbstractResponseManager +class AuthenticationResponseManager extends AbstractResponseManager { public function createOAuthPostResponse(string $token, string $refresh_token): JWTResponse { diff --git a/src/Api/Services/Authentication/JWTTokenRefreshService.php b/src/Api/Services/Authentication/JWTTokenRefreshService.php index 51db4bf74b..16a936d243 100644 --- a/src/Api/Services/Authentication/JWTTokenRefreshService.php +++ b/src/Api/Services/Authentication/JWTTokenRefreshService.php @@ -8,9 +8,7 @@ class JWTTokenRefreshService { - public function __construct(private readonly RefreshToken $refreshToken) - { - } + public function __construct(private readonly RefreshToken $refreshToken) {} public function refresh(Request $request): Response { diff --git a/src/Api/Services/AuthenticationManager.php b/src/Api/Services/AuthenticationManager.php index 3ba1e594f9..46015010cc 100644 --- a/src/Api/Services/AuthenticationManager.php +++ b/src/Api/Services/AuthenticationManager.php @@ -12,9 +12,7 @@ class AuthenticationManager { - public function __construct(private readonly TokenStorageInterface $token_storage, private readonly JWTTokenManagerInterface $jwt_manager, private readonly UserManager $user_manager, private readonly RefreshTokenGeneratorInterface $refresh_token_generator, private readonly RefreshTokenManagerInterface $refresh_manager, protected RequestHelper $request_helper, protected int $refresh_token_ttl) - { - } + public function __construct(private readonly TokenStorageInterface $token_storage, private readonly JWTTokenManagerInterface $jwt_manager, private readonly UserManager $user_manager, private readonly RefreshTokenGeneratorInterface $refresh_token_generator, private readonly RefreshTokenManagerInterface $refresh_manager, protected RequestHelper $request_helper, protected int $refresh_token_ttl) {} public function getAuthenticatedUser(): ?User { diff --git a/src/Api/Services/Base/AbstractApiFacade.php b/src/Api/Services/Base/AbstractApiFacade.php index 51fdcaa1c2..c513dfe908 100644 --- a/src/Api/Services/Base/AbstractApiFacade.php +++ b/src/Api/Services/Base/AbstractApiFacade.php @@ -9,9 +9,7 @@ */ abstract class AbstractApiFacade implements ApiFacadeInterface { - public function __construct(protected AuthenticationManager $authentication_manager) - { - } + public function __construct(protected AuthenticationManager $authentication_manager) {} public function getAuthenticationManager(): AuthenticationManager { diff --git a/src/Api/Services/Base/AbstractApiLoader.php b/src/Api/Services/Base/AbstractApiLoader.php index c4f34c9022..c9f4854c2c 100644 --- a/src/Api/Services/Base/AbstractApiLoader.php +++ b/src/Api/Services/Base/AbstractApiLoader.php @@ -5,6 +5,4 @@ /** * Class AbstractApiLoader. */ -abstract class AbstractApiLoader -{ -} +abstract class AbstractApiLoader {} diff --git a/src/Api/Services/Base/AbstractApiProcessor.php b/src/Api/Services/Base/AbstractApiProcessor.php index 690d9f77e3..f5ed89dd2e 100644 --- a/src/Api/Services/Base/AbstractApiProcessor.php +++ b/src/Api/Services/Base/AbstractApiProcessor.php @@ -5,6 +5,4 @@ /** * Class AbstractApiProcessor. */ -abstract class AbstractApiProcessor -{ -} +abstract class AbstractApiProcessor {} diff --git a/src/Api/Services/MediaLibrary/MediaLibraryApiFacade.php b/src/Api/Services/MediaLibrary/MediaLibraryApiFacade.php index 21354a6e1b..2e6791cda5 100644 --- a/src/Api/Services/MediaLibrary/MediaLibraryApiFacade.php +++ b/src/Api/Services/MediaLibrary/MediaLibraryApiFacade.php @@ -5,7 +5,7 @@ use App\Api\Services\AuthenticationManager; use App\Api\Services\Base\AbstractApiFacade; -final class MediaLibraryApiFacade extends AbstractApiFacade +class MediaLibraryApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/MediaLibrary/MediaLibraryApiLoader.php b/src/Api/Services/MediaLibrary/MediaLibraryApiLoader.php index ac84b58969..00a14807fe 100644 --- a/src/Api/Services/MediaLibrary/MediaLibraryApiLoader.php +++ b/src/Api/Services/MediaLibrary/MediaLibraryApiLoader.php @@ -9,11 +9,9 @@ use App\DB\EntityRepository\MediaLibrary\MediaPackageRepository; use Doctrine\ORM\EntityManagerInterface; -final class MediaLibraryApiLoader extends AbstractApiLoader +class MediaLibraryApiLoader extends AbstractApiLoader { - public function __construct(private readonly MediaPackageFileRepository $media_package_file_repository, private readonly MediaPackageRepository $media_package_repository, private readonly EntityManagerInterface $entity_manager) - { - } + public function __construct(private readonly MediaPackageFileRepository $media_package_file_repository, private readonly MediaPackageRepository $media_package_repository, private readonly EntityManagerInterface $entity_manager) {} public function searchMediaLibraryFiles(string $query, string $flavor, string $package_name, int $limit, int $offset): ?array { diff --git a/src/Api/Services/MediaLibrary/MediaLibraryApiProcessor.php b/src/Api/Services/MediaLibrary/MediaLibraryApiProcessor.php index b26d2e3df9..7baaeff049 100644 --- a/src/Api/Services/MediaLibrary/MediaLibraryApiProcessor.php +++ b/src/Api/Services/MediaLibrary/MediaLibraryApiProcessor.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractApiProcessor; -final class MediaLibraryApiProcessor extends AbstractApiProcessor -{ -} +class MediaLibraryApiProcessor extends AbstractApiProcessor {} diff --git a/src/Api/Services/MediaLibrary/MediaLibraryRequestValidator.php b/src/Api/Services/MediaLibrary/MediaLibraryRequestValidator.php index 297baa7aeb..1af7a91b22 100644 --- a/src/Api/Services/MediaLibrary/MediaLibraryRequestValidator.php +++ b/src/Api/Services/MediaLibrary/MediaLibraryRequestValidator.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractRequestValidator; -final class MediaLibraryRequestValidator extends AbstractRequestValidator -{ -} +class MediaLibraryRequestValidator extends AbstractRequestValidator {} diff --git a/src/Api/Services/MediaLibrary/MediaLibraryResponseManager.php b/src/Api/Services/MediaLibrary/MediaLibraryResponseManager.php index 66a00050b4..a28f358efb 100644 --- a/src/Api/Services/MediaLibrary/MediaLibraryResponseManager.php +++ b/src/Api/Services/MediaLibrary/MediaLibraryResponseManager.php @@ -13,7 +13,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class MediaLibraryResponseManager extends AbstractResponseManager +class MediaLibraryResponseManager extends AbstractResponseManager { public function __construct( TranslatorInterface $translator, diff --git a/src/Api/Services/Notifications/NotificationsApiFacade.php b/src/Api/Services/Notifications/NotificationsApiFacade.php index f3e221bf7d..50159b7a76 100644 --- a/src/Api/Services/Notifications/NotificationsApiFacade.php +++ b/src/Api/Services/Notifications/NotificationsApiFacade.php @@ -6,7 +6,7 @@ use App\Api\Services\Base\AbstractApiFacade; use App\DB\EntityRepository\User\Notification\NotificationRepository; -final class NotificationsApiFacade extends AbstractApiFacade +class NotificationsApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/Notifications/NotificationsApiLoader.php b/src/Api/Services/Notifications/NotificationsApiLoader.php index 56a6e74816..fdfec8af6d 100644 --- a/src/Api/Services/Notifications/NotificationsApiLoader.php +++ b/src/Api/Services/Notifications/NotificationsApiLoader.php @@ -5,11 +5,9 @@ use App\Api\Services\Base\AbstractApiLoader; use App\DB\EntityRepository\User\Notification\NotificationRepository; -final class NotificationsApiLoader extends AbstractApiLoader +class NotificationsApiLoader extends AbstractApiLoader { - public function __construct(private readonly NotificationRepository $notification_repository) - { - } + public function __construct(private readonly NotificationRepository $notification_repository) {} public function findNotificationByID(int $id): ?object { diff --git a/src/Api/Services/Notifications/NotificationsApiProcessor.php b/src/Api/Services/Notifications/NotificationsApiProcessor.php index a29955a0e8..eb9932060a 100644 --- a/src/Api/Services/Notifications/NotificationsApiProcessor.php +++ b/src/Api/Services/Notifications/NotificationsApiProcessor.php @@ -7,11 +7,9 @@ use App\DB\EntityRepository\User\Notification\NotificationRepository; use App\User\Notification\NotificationManager; -final class NotificationsApiProcessor extends AbstractApiProcessor +class NotificationsApiProcessor extends AbstractApiProcessor { - public function __construct(private readonly NotificationRepository $notification_repository, private readonly NotificationManager $notification_manager) - { - } + public function __construct(private readonly NotificationRepository $notification_repository, private readonly NotificationManager $notification_manager) {} public function markNotificationAsSeen(int $notification_id, User $user): bool { diff --git a/src/Api/Services/Notifications/NotificationsRequestValidator.php b/src/Api/Services/Notifications/NotificationsRequestValidator.php index 6dc4d34f9b..a4a59b4e42 100644 --- a/src/Api/Services/Notifications/NotificationsRequestValidator.php +++ b/src/Api/Services/Notifications/NotificationsRequestValidator.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractRequestValidator; -final class NotificationsRequestValidator extends AbstractRequestValidator -{ -} +class NotificationsRequestValidator extends AbstractRequestValidator {} diff --git a/src/Api/Services/Notifications/NotificationsResponseManager.php b/src/Api/Services/Notifications/NotificationsResponseManager.php index e7e3f2fbcd..905d2710b9 100644 --- a/src/Api/Services/Notifications/NotificationsResponseManager.php +++ b/src/Api/Services/Notifications/NotificationsResponseManager.php @@ -16,7 +16,7 @@ use OpenAPI\Server\Service\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class NotificationsResponseManager extends AbstractResponseManager +class NotificationsResponseManager extends AbstractResponseManager { public function __construct(TranslatorInterface $translator, SerializerInterface $serializer, diff --git a/src/Api/Services/OverwriteController.php b/src/Api/Services/OverwriteController.php index 0059df764b..e8818bed47 100644 --- a/src/Api/Services/OverwriteController.php +++ b/src/Api/Services/OverwriteController.php @@ -8,9 +8,7 @@ class OverwriteController extends AbstractController { - public function __construct(protected ProjectsApi $projectsApi) - { - } + public function __construct(protected ProjectsApi $projectsApi) {} public function projectIdCatrobatGetAction(string $id): ?Response { diff --git a/src/Api/Services/Projects/ProjectsApiFacade.php b/src/Api/Services/Projects/ProjectsApiFacade.php index 203cbdbc1b..9745534079 100644 --- a/src/Api/Services/Projects/ProjectsApiFacade.php +++ b/src/Api/Services/Projects/ProjectsApiFacade.php @@ -6,7 +6,7 @@ use App\Api\Services\Base\AbstractApiFacade; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -final class ProjectsApiFacade extends AbstractApiFacade +class ProjectsApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/Projects/ProjectsApiLoader.php b/src/Api/Services/Projects/ProjectsApiLoader.php index 3867e660b3..75c1af7566 100644 --- a/src/Api/Services/Projects/ProjectsApiLoader.php +++ b/src/Api/Services/Projects/ProjectsApiLoader.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\RequestStack; -final class ProjectsApiLoader extends AbstractApiLoader +class ProjectsApiLoader extends AbstractApiLoader { public function __construct( private readonly ProgramManager $project_manager, @@ -27,8 +27,7 @@ public function __construct( protected ProgramFileRepository $file_repository, protected ExtractedFileRepository $extracted_file_repository, protected LoggerInterface $logger - ) { - } + ) {} public function findProjectsByID(string $id, bool $include_private = false): array { diff --git a/src/Api/Services/Projects/ProjectsApiProcessor.php b/src/Api/Services/Projects/ProjectsApiProcessor.php index 50d153188c..ba2dfbfd08 100644 --- a/src/Api/Services/Projects/ProjectsApiProcessor.php +++ b/src/Api/Services/Projects/ProjectsApiProcessor.php @@ -13,7 +13,7 @@ use Doctrine\ORM\EntityManagerInterface; use OpenAPI\Server\Model\UpdateProjectRequest; -final class ProjectsApiProcessor extends AbstractApiProcessor +class ProjectsApiProcessor extends AbstractApiProcessor { final public const SERVER_ERROR_SAVE_XML = 1; final public const SERVER_ERROR_SCREENSHOT = 2; @@ -22,9 +22,7 @@ public function __construct(private readonly ProgramManager $project_manager, private readonly EntityManagerInterface $entity_manager, private readonly ExtractedFileRepository $extracted_file_repository, private readonly ProgramFileRepository $file_repository, - private readonly ScreenshotRepository $screenshot_repository) - { - } + private readonly ScreenshotRepository $screenshot_repository) {} /** * @throws \Exception diff --git a/src/Api/Services/Projects/ProjectsRequestValidator.php b/src/Api/Services/Projects/ProjectsRequestValidator.php index 08b8e58e68..752a94447f 100644 --- a/src/Api/Services/Projects/ProjectsRequestValidator.php +++ b/src/Api/Services/Projects/ProjectsRequestValidator.php @@ -11,7 +11,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class ProjectsRequestValidator extends AbstractRequestValidator +class ProjectsRequestValidator extends AbstractRequestValidator { final public const MIN_NAME_LENGTH = 1; final public const MAX_NAME_LENGTH = 255; diff --git a/src/Api/Services/Projects/ProjectsResponseManager.php b/src/Api/Services/Projects/ProjectsResponseManager.php index 8eedb34914..29ba9826e6 100644 --- a/src/Api/Services/Projects/ProjectsResponseManager.php +++ b/src/Api/Services/Projects/ProjectsResponseManager.php @@ -25,7 +25,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class ProjectsResponseManager extends AbstractResponseManager +class ProjectsResponseManager extends AbstractResponseManager { use TranslatorAwareTrait; diff --git a/src/Api/Services/ResponseCache/ResponseCacheManager.php b/src/Api/Services/ResponseCache/ResponseCacheManager.php index 32e18a1623..cd42a7538b 100644 --- a/src/Api/Services/ResponseCache/ResponseCacheManager.php +++ b/src/Api/Services/ResponseCache/ResponseCacheManager.php @@ -7,9 +7,7 @@ class ResponseCacheManager { - public function __construct(protected EntityManagerInterface $entity_manager, protected ResponseCacheRepository $response_cache_repository) - { - } + public function __construct(protected EntityManagerInterface $entity_manager, protected ResponseCacheRepository $response_cache_repository) {} /** * @throws \JsonException diff --git a/src/Api/Services/Search/SearchApiFacade.php b/src/Api/Services/Search/SearchApiFacade.php index e5c9c2ee3d..b3c5138a4d 100644 --- a/src/Api/Services/Search/SearchApiFacade.php +++ b/src/Api/Services/Search/SearchApiFacade.php @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class SearchApiFacade extends AbstractApiFacade +class SearchApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/Search/SearchApiLoader.php b/src/Api/Services/Search/SearchApiLoader.php index 89a0d3bcc2..b51f068f2c 100644 --- a/src/Api/Services/Search/SearchApiLoader.php +++ b/src/Api/Services/Search/SearchApiLoader.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractApiLoader; -final class SearchApiLoader extends AbstractApiLoader -{ -} +class SearchApiLoader extends AbstractApiLoader {} diff --git a/src/Api/Services/Search/SearchApiProcessor.php b/src/Api/Services/Search/SearchApiProcessor.php index c54b8e2886..2792fa1d0d 100644 --- a/src/Api/Services/Search/SearchApiProcessor.php +++ b/src/Api/Services/Search/SearchApiProcessor.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractApiProcessor; -final class SearchApiProcessor extends AbstractApiProcessor -{ -} +class SearchApiProcessor extends AbstractApiProcessor {} diff --git a/src/Api/Services/Search/SearchRequestValidator.php b/src/Api/Services/Search/SearchRequestValidator.php index 78e77ff473..b0165dcaff 100644 --- a/src/Api/Services/Search/SearchRequestValidator.php +++ b/src/Api/Services/Search/SearchRequestValidator.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractRequestValidator; -final class SearchRequestValidator extends AbstractRequestValidator -{ -} +class SearchRequestValidator extends AbstractRequestValidator {} diff --git a/src/Api/Services/Search/SearchResponseManager.php b/src/Api/Services/Search/SearchResponseManager.php index 4be52ca8ac..fb90cdc8db 100644 --- a/src/Api/Services/Search/SearchResponseManager.php +++ b/src/Api/Services/Search/SearchResponseManager.php @@ -13,7 +13,7 @@ use OpenAPI\Server\Service\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class SearchResponseManager extends AbstractResponseManager +class SearchResponseManager extends AbstractResponseManager { public function __construct( TranslatorInterface $translator, diff --git a/src/Api/Services/User/UserApiFacade.php b/src/Api/Services/User/UserApiFacade.php index 7db648fb95..d8cbd36edd 100644 --- a/src/Api/Services/User/UserApiFacade.php +++ b/src/Api/Services/User/UserApiFacade.php @@ -6,7 +6,7 @@ use App\Api\Services\Base\AbstractApiFacade; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -final class UserApiFacade extends AbstractApiFacade +class UserApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/User/UserApiLoader.php b/src/Api/Services/User/UserApiLoader.php index 0dad0b72a0..43dc2ea6a3 100644 --- a/src/Api/Services/User/UserApiLoader.php +++ b/src/Api/Services/User/UserApiLoader.php @@ -6,11 +6,9 @@ use App\DB\Entity\User\User; use App\User\UserManager; -final class UserApiLoader extends AbstractApiLoader +class UserApiLoader extends AbstractApiLoader { - public function __construct(private readonly UserManager $user_manager) - { - } + public function __construct(private readonly UserManager $user_manager) {} public function findUserByID(string $id): ?User { diff --git a/src/Api/Services/User/UserApiProcessor.php b/src/Api/Services/User/UserApiProcessor.php index d34892943d..dbc0d57b9c 100644 --- a/src/Api/Services/User/UserApiProcessor.php +++ b/src/Api/Services/User/UserApiProcessor.php @@ -9,11 +9,9 @@ use OpenAPI\Server\Model\RegisterRequest; use OpenAPI\Server\Model\UpdateUserRequest; -final class UserApiProcessor extends AbstractApiProcessor +class UserApiProcessor extends AbstractApiProcessor { - public function __construct(private readonly UserManager $user_manager, private readonly TokenGenerator $token_generator) - { - } + public function __construct(private readonly UserManager $user_manager, private readonly TokenGenerator $token_generator) {} /** * @throws \Exception diff --git a/src/Api/Services/User/UserRequestValidator.php b/src/Api/Services/User/UserRequestValidator.php index 1273395dd0..4f9a553f67 100644 --- a/src/Api/Services/User/UserRequestValidator.php +++ b/src/Api/Services/User/UserRequestValidator.php @@ -15,7 +15,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class UserRequestValidator extends AbstractRequestValidator +class UserRequestValidator extends AbstractRequestValidator { public const MIN_PASSWORD_LENGTH = 6; public const MAX_PASSWORD_LENGTH = 4096; diff --git a/src/Api/Services/User/UserResponseManager.php b/src/Api/Services/User/UserResponseManager.php index dee2366429..b2c8114aef 100644 --- a/src/Api/Services/User/UserResponseManager.php +++ b/src/Api/Services/User/UserResponseManager.php @@ -12,7 +12,7 @@ use OpenAPI\Server\Service\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class UserResponseManager extends AbstractResponseManager +class UserResponseManager extends AbstractResponseManager { public function __construct( TranslatorInterface $translator, diff --git a/src/Api/Services/Utility/UtilityApiFacade.php b/src/Api/Services/Utility/UtilityApiFacade.php index b33b7b1a9b..6d74004c3f 100644 --- a/src/Api/Services/Utility/UtilityApiFacade.php +++ b/src/Api/Services/Utility/UtilityApiFacade.php @@ -5,7 +5,7 @@ use App\Api\Services\AuthenticationManager; use App\Api\Services\Base\AbstractApiFacade; -final class UtilityApiFacade extends AbstractApiFacade +class UtilityApiFacade extends AbstractApiFacade { public function __construct( AuthenticationManager $authentication_manager, diff --git a/src/Api/Services/Utility/UtilityApiLoader.php b/src/Api/Services/Utility/UtilityApiLoader.php index 23c1c3c1d1..4cf8003883 100644 --- a/src/Api/Services/Utility/UtilityApiLoader.php +++ b/src/Api/Services/Utility/UtilityApiLoader.php @@ -7,11 +7,9 @@ use App\DB\Entity\Survey; use Doctrine\ORM\EntityManagerInterface; -final class UtilityApiLoader extends AbstractApiLoader +class UtilityApiLoader extends AbstractApiLoader { - public function __construct(private readonly EntityManagerInterface $entity_manager) - { - } + public function __construct(private readonly EntityManagerInterface $entity_manager) {} public function getSurvey(array $criteria): ?Survey { diff --git a/src/Api/Services/Utility/UtilityApiProcessor.php b/src/Api/Services/Utility/UtilityApiProcessor.php index 7e9adf5ce3..fec9b29a21 100644 --- a/src/Api/Services/Utility/UtilityApiProcessor.php +++ b/src/Api/Services/Utility/UtilityApiProcessor.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractApiProcessor; -final class UtilityApiProcessor extends AbstractApiProcessor -{ -} +class UtilityApiProcessor extends AbstractApiProcessor {} diff --git a/src/Api/Services/Utility/UtilityRequestValidator.php b/src/Api/Services/Utility/UtilityRequestValidator.php index 45834cb02b..344210c799 100644 --- a/src/Api/Services/Utility/UtilityRequestValidator.php +++ b/src/Api/Services/Utility/UtilityRequestValidator.php @@ -4,6 +4,4 @@ use App\Api\Services\Base\AbstractRequestValidator; -final class UtilityRequestValidator extends AbstractRequestValidator -{ -} +class UtilityRequestValidator extends AbstractRequestValidator {} diff --git a/src/Api/Services/Utility/UtilityResponseManager.php b/src/Api/Services/Utility/UtilityResponseManager.php index c75563102a..26a2310664 100644 --- a/src/Api/Services/Utility/UtilityResponseManager.php +++ b/src/Api/Services/Utility/UtilityResponseManager.php @@ -6,7 +6,7 @@ use App\DB\Entity\Survey; use OpenAPI\Server\Model\SurveyResponse; -final class UtilityResponseManager extends AbstractResponseManager +class UtilityResponseManager extends AbstractResponseManager { public function createSurveyResponse(Survey $survey): SurveyResponse { diff --git a/src/Api/Services/ValidationWrapper.php b/src/Api/Services/ValidationWrapper.php index 818fba8696..f24edc4ceb 100644 --- a/src/Api/Services/ValidationWrapper.php +++ b/src/Api/Services/ValidationWrapper.php @@ -5,7 +5,7 @@ /** * Class ValidationWrapper. */ -final class ValidationWrapper +class ValidationWrapper { private array $errors = []; diff --git a/src/Api/UserApi.php b/src/Api/UserApi.php index 4661ec371f..8e7ff9fa5b 100644 --- a/src/Api/UserApi.php +++ b/src/Api/UserApi.php @@ -16,11 +16,9 @@ use OpenAPI\Server\Model\UpdateUserRequest; use Symfony\Component\HttpFoundation\Response; -final class UserApi extends AbstractApiController implements UserApiInterface +class UserApi extends AbstractApiController implements UserApiInterface { - public function __construct(private readonly UserApiFacade $facade) - { - } + public function __construct(private readonly UserApiFacade $facade) {} /** * @throws \Exception diff --git a/src/Api/UtilityApi.php b/src/Api/UtilityApi.php index 7878f2bc70..68b8e2b0ee 100644 --- a/src/Api/UtilityApi.php +++ b/src/Api/UtilityApi.php @@ -8,11 +8,9 @@ use OpenAPI\Server\Model\SurveyResponse; use Symfony\Component\HttpFoundation\Response; -final class UtilityApi extends AbstractApiController implements UtilityApiInterface +class UtilityApi extends AbstractApiController implements UtilityApiInterface { - public function __construct(private readonly UtilityApiFacade $facade) - { - } + public function __construct(private readonly UtilityApiFacade $facade) {} public function healthGet(int &$responseCode, array &$responseHeaders): void { diff --git a/src/Api_deprecated/Controller/DownloadMediaPackageController.php b/src/Api_deprecated/Controller/DownloadMediaPackageController.php index 1a42ff7fef..eb14c492a5 100644 --- a/src/Api_deprecated/Controller/DownloadMediaPackageController.php +++ b/src/Api_deprecated/Controller/DownloadMediaPackageController.php @@ -16,9 +16,7 @@ */ class DownloadMediaPackageController extends AbstractController { - public function __construct(private readonly EntityManagerInterface $entity_manager) - { - } + public function __construct(private readonly EntityManagerInterface $entity_manager) {} #[Route(path: '/download-media/{id}', name: 'download_media', defaults: ['_format' => 'json'], methods: ['GET'])] public function downloadMediaPackageAction(int $id, MediaPackageFileRepository $file_repository): BinaryFileResponse diff --git a/src/Api_deprecated/Controller/DownloadProgramController.php b/src/Api_deprecated/Controller/DownloadProgramController.php index 6273099916..84dabf5b02 100644 --- a/src/Api_deprecated/Controller/DownloadProgramController.php +++ b/src/Api_deprecated/Controller/DownloadProgramController.php @@ -13,9 +13,7 @@ */ class DownloadProgramController extends AbstractController { - public function __construct(protected ProjectsApi $projectsApi, protected LoggerInterface $logger) - { - } + public function __construct(protected ProjectsApi $projectsApi, protected LoggerInterface $logger) {} /** * @deprecated diff --git a/src/Api_deprecated/Controller/ListProgramsController.php b/src/Api_deprecated/Controller/ListProgramsController.php index 6f9f3b3e78..3b21e43cc2 100644 --- a/src/Api_deprecated/Controller/ListProgramsController.php +++ b/src/Api_deprecated/Controller/ListProgramsController.php @@ -14,9 +14,7 @@ */ class ListProgramsController extends AbstractController { - public function __construct(private readonly ProgramManager $program_manager) - { - } + public function __construct(private readonly ProgramManager $program_manager) {} /** * @deprecated diff --git a/src/Api_deprecated/Controller/ReportController.php b/src/Api_deprecated/Controller/ReportController.php index 4fc2ed756c..6a512cf7e3 100644 --- a/src/Api_deprecated/Controller/ReportController.php +++ b/src/Api_deprecated/Controller/ReportController.php @@ -32,8 +32,7 @@ public function __construct( private readonly AuthorizationCheckerInterface $authorization_checker, private readonly TokenStorageInterface $usage_tracking_token_storage, private readonly EntityManagerInterface $entity_manager, - ) { - } + ) {} /** * @deprecated diff --git a/src/Api_deprecated/Controller/SearchController.php b/src/Api_deprecated/Controller/SearchController.php index 814d95c595..34dcd7c888 100644 --- a/src/Api_deprecated/Controller/SearchController.php +++ b/src/Api_deprecated/Controller/SearchController.php @@ -19,9 +19,7 @@ class SearchController extends AbstractController private int $DEFAULT_OFFSET = 0; - public function __construct(protected RequestHelper $app_request) - { - } + public function __construct(protected RequestHelper $app_request) {} /** * @deprecated diff --git a/src/Api_deprecated/Controller/SecurityController.php b/src/Api_deprecated/Controller/SecurityController.php index 7e6b8343f2..a4db37a578 100644 --- a/src/Api_deprecated/Controller/SecurityController.php +++ b/src/Api_deprecated/Controller/SecurityController.php @@ -21,9 +21,7 @@ */ class SecurityController extends AbstractController { - public function __construct(private readonly OAuthService $oauth_service) - { - } + public function __construct(private readonly OAuthService $oauth_service) {} /** * @deprecated diff --git a/src/Api_deprecated/Controller/UploadController.php b/src/Api_deprecated/Controller/UploadController.php index 0ef246e90a..605490055a 100644 --- a/src/Api_deprecated/Controller/UploadController.php +++ b/src/Api_deprecated/Controller/UploadController.php @@ -24,9 +24,7 @@ */ class UploadController { - public function __construct(private readonly UserManager $user_manager, private readonly TokenStorageInterface $token_storage, private readonly ProgramManager $program_manager, private readonly TranslatorInterface $translator, private readonly LoggerInterface $logger, private readonly EntityManagerInterface $em) - { - } + public function __construct(private readonly UserManager $user_manager, private readonly TokenStorageInterface $token_storage, private readonly ProgramManager $program_manager, private readonly TranslatorInterface $translator, private readonly LoggerInterface $logger, private readonly EntityManagerInterface $em) {} /** * @deprecated diff --git a/src/Api_deprecated/Listeners/ProgramListSerializerEventSubscriber.php b/src/Api_deprecated/Listeners/ProgramListSerializerEventSubscriber.php index dbb1634205..fd8cd83bd5 100644 --- a/src/Api_deprecated/Listeners/ProgramListSerializerEventSubscriber.php +++ b/src/Api_deprecated/Listeners/ProgramListSerializerEventSubscriber.php @@ -20,9 +20,7 @@ */ class ProgramListSerializerEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly ScreenshotRepository $screenshot_repository, private readonly RequestStack $request_stack, private readonly RouterInterface $router, private readonly ElapsedTimeStringFormatter $time_formatter, private readonly ImageRepository $example_image_repository, private readonly ParameterBagInterface $parameter_bag) - { - } + public function __construct(private readonly ScreenshotRepository $screenshot_repository, private readonly RequestStack $request_stack, private readonly RouterInterface $router, private readonly ElapsedTimeStringFormatter $time_formatter, private readonly ImageRepository $example_image_repository, private readonly ParameterBagInterface $parameter_bag) {} public function onKernelView(ViewEvent $event): void { diff --git a/src/Api_deprecated/Listeners/UploadExceptionEventSubscriber.php b/src/Api_deprecated/Listeners/UploadExceptionEventSubscriber.php index 902fbe80d3..c738f310ef 100644 --- a/src/Api_deprecated/Listeners/UploadExceptionEventSubscriber.php +++ b/src/Api_deprecated/Listeners/UploadExceptionEventSubscriber.php @@ -15,9 +15,7 @@ */ class UploadExceptionEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly TranslatorInterface $translator) - { - } + public function __construct(private readonly TranslatorInterface $translator) {} public function onKernelException(ExceptionEvent $event): void { diff --git a/src/Api_deprecated/OAuth/OAuthService.php b/src/Api_deprecated/OAuth/OAuthService.php index 91c2d4fe10..cd1fe11708 100644 --- a/src/Api_deprecated/OAuth/OAuthService.php +++ b/src/Api_deprecated/OAuth/OAuthService.php @@ -16,9 +16,7 @@ class OAuthService { - public function __construct(private readonly UserManager $user_manager, private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator, private readonly TokenGenerator $token_generator) - { - } + public function __construct(private readonly UserManager $user_manager, private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator, private readonly TokenGenerator $token_generator) {} /** * @throws \Exception diff --git a/src/Api_deprecated/Responses/ProgramListResponse.php b/src/Api_deprecated/Responses/ProgramListResponse.php index 7c97b3bd54..b4b5997628 100644 --- a/src/Api_deprecated/Responses/ProgramListResponse.php +++ b/src/Api_deprecated/Responses/ProgramListResponse.php @@ -10,8 +10,7 @@ class ProgramListResponse public function __construct( private readonly array $programs, private readonly int $total_programs - ) { - } + ) {} public function getPrograms(): array { diff --git a/src/Api_deprecated/Security/ApiTokenAuthenticator.php b/src/Api_deprecated/Security/ApiTokenAuthenticator.php index 64ffda4339..71211ccf53 100644 --- a/src/Api_deprecated/Security/ApiTokenAuthenticator.php +++ b/src/Api_deprecated/Security/ApiTokenAuthenticator.php @@ -33,8 +33,7 @@ class ApiTokenAuthenticator extends AbstractAuthenticator public function __construct( private readonly EntityManagerInterface $em, protected TranslatorInterface $translator - ) { - } + ) {} /** * Called on every request to decide if this authenticator should be diff --git a/src/Application/Controller/Base/IndexController.php b/src/Application/Controller/Base/IndexController.php index 6b0cc55f0e..a82f6abc1c 100644 --- a/src/Application/Controller/Base/IndexController.php +++ b/src/Application/Controller/Base/IndexController.php @@ -13,9 +13,7 @@ class IndexController extends AbstractController { - public function __construct(protected ImageRepository $image_repository, protected FeaturedRepository $featured_repository) - { - } + public function __construct(protected ImageRepository $image_repository, protected FeaturedRepository $featured_repository) {} #[Route(path: '/', name: 'index', methods: ['GET'])] public function indexAction(Request $request): Response diff --git a/src/Application/Controller/Ci/ApkStatusController.php b/src/Application/Controller/Ci/ApkStatusController.php index ead7328a5c..287ba83724 100644 --- a/src/Application/Controller/Ci/ApkStatusController.php +++ b/src/Application/Controller/Ci/ApkStatusController.php @@ -18,9 +18,7 @@ */ class ApkStatusController extends AbstractController { - public function __construct(private readonly ProgramManager $program_manager, private readonly TranslatorInterface $translator) - { - } + public function __construct(private readonly ProgramManager $program_manager, private readonly TranslatorInterface $translator) {} #[Route(path: '/ci/status/{id}', name: 'ci_status', defaults: ['_format' => 'json'], methods: ['GET'])] public function getApkStatusAction(string $id): JsonResponse diff --git a/src/Application/Controller/Ci/BuildApkController.php b/src/Application/Controller/Ci/BuildApkController.php index 48eec66270..4062a6f52b 100644 --- a/src/Application/Controller/Ci/BuildApkController.php +++ b/src/Application/Controller/Ci/BuildApkController.php @@ -25,9 +25,7 @@ public function __construct( private readonly ProgramManager $program_manager, private readonly JenkinsDispatcher $dispatcher, private readonly ApkRepository $apk_repository, - private readonly array $arr_jenkins_config) - { - } + private readonly array $arr_jenkins_config) {} /** * @throws \Exception diff --git a/src/Application/Controller/Comments/CommentsController.php b/src/Application/Controller/Comments/CommentsController.php index 6e51420915..26ccb9344e 100644 --- a/src/Application/Controller/Comments/CommentsController.php +++ b/src/Application/Controller/Comments/CommentsController.php @@ -19,8 +19,7 @@ class CommentsController extends AbstractController { public function __construct( private readonly EntityManagerInterface $entity_manager - ) { - } + ) {} /** * @throws \Exception diff --git a/src/Application/Controller/MediaLibrary/MediaPackageController.php b/src/Application/Controller/MediaLibrary/MediaPackageController.php index 41a9023d79..f64410c3b9 100644 --- a/src/Application/Controller/MediaLibrary/MediaPackageController.php +++ b/src/Application/Controller/MediaLibrary/MediaPackageController.php @@ -20,8 +20,7 @@ class MediaPackageController extends AbstractController public function __construct( private readonly string $catrobat_mediapackage_path, private readonly EntityManagerInterface $entity_manager - ) { - } + ) {} /** * Legacy route:. diff --git a/src/Application/Controller/Project/CodeStatisticsController.php b/src/Application/Controller/Project/CodeStatisticsController.php index d12db0c209..95da8b9f43 100644 --- a/src/Application/Controller/Project/CodeStatisticsController.php +++ b/src/Application/Controller/Project/CodeStatisticsController.php @@ -13,9 +13,7 @@ class CodeStatisticsController extends AbstractController { - public function __construct(private readonly ProgramManager $program_manager, private readonly ExtractedFileRepository $extracted_file_repository, private readonly CatrobatCodeParser $code_parser, private readonly TranslatorInterface $translator) - { - } + public function __construct(private readonly ProgramManager $program_manager, private readonly ExtractedFileRepository $extracted_file_repository, private readonly CatrobatCodeParser $code_parser, private readonly TranslatorInterface $translator) {} #[Route(path: '/project/{id}/code_statistics', name: 'code_statistics', methods: ['GET'])] public function view(string $id): Response diff --git a/src/Application/Controller/Project/CodeViewController.php b/src/Application/Controller/Project/CodeViewController.php index 0a2c78b073..5066948578 100644 --- a/src/Application/Controller/Project/CodeViewController.php +++ b/src/Application/Controller/Project/CodeViewController.php @@ -14,9 +14,7 @@ class CodeViewController extends AbstractController { - public function __construct(private readonly ProgramManager $program_manager, private readonly ExtractedFileRepository $extracted_file_repository, private readonly CatrobatCodeParser $code_parser, private readonly ParameterBagInterface $parameter_bag, private readonly TranslatorInterface $translator) - { - } + public function __construct(private readonly ProgramManager $program_manager, private readonly ExtractedFileRepository $extracted_file_repository, private readonly CatrobatCodeParser $code_parser, private readonly ParameterBagInterface $parameter_bag, private readonly TranslatorInterface $translator) {} #[Route(path: '/project/{id}/code_view', name: 'code_view', methods: ['GET'])] public function view(string $id): Response diff --git a/src/Application/Controller/Project/ProgramController.php b/src/Application/Controller/Project/ProgramController.php index 0496a7ffde..83cb6fa68a 100644 --- a/src/Application/Controller/Project/ProgramController.php +++ b/src/Application/Controller/Project/ProgramController.php @@ -49,8 +49,7 @@ public function __construct( private readonly TranslationDelegate $translation_delegate, private readonly EntityManagerInterface $entity_manager, private readonly UserCommentRepository $comment_repository - ) { - } + ) {} /** * Legacy routes:. diff --git a/src/Application/Controller/Project/RemixController.php b/src/Application/Controller/Project/RemixController.php index dfe92eb19c..418f18a3dd 100644 --- a/src/Application/Controller/Project/RemixController.php +++ b/src/Application/Controller/Project/RemixController.php @@ -13,9 +13,7 @@ class RemixController extends AbstractController { - public function __construct(private readonly RouterInterface $router, private readonly ScreenshotRepository $screenshot_repository, private readonly RemixManager $remix_manager) - { - } + public function __construct(private readonly RouterInterface $router, private readonly ScreenshotRepository $screenshot_repository, private readonly RemixManager $remix_manager) {} #[Route(path: '/project/{id}/remix_graph', name: 'remix_graph', methods: ['GET'])] public function view(string $id): Response diff --git a/src/Application/Controller/Security/LogoutController.php b/src/Application/Controller/Security/LogoutController.php index 5cc610c0e4..980292c0c5 100644 --- a/src/Application/Controller/Security/LogoutController.php +++ b/src/Application/Controller/Security/LogoutController.php @@ -14,8 +14,7 @@ class LogoutController extends AbstractController public function __construct( protected TokenStorageInterface $token_storage, protected CookieService $cookie_service - ) { - } + ) {} #[Route(path: '/logout', name: 'logout')] public function logoutAction(Request $request): RedirectResponse diff --git a/src/Application/Controller/Security/RegistrationController.php b/src/Application/Controller/Security/RegistrationController.php index a296d13e5a..e7f6ef9b2c 100644 --- a/src/Application/Controller/Security/RegistrationController.php +++ b/src/Application/Controller/Security/RegistrationController.php @@ -14,9 +14,7 @@ class RegistrationController extends AbstractController { - public function __construct(protected VerifyEmailHelperInterface $verify_email_helper, protected EntityManagerInterface $entity_manager, protected LoggerInterface $logger) - { - } + public function __construct(protected VerifyEmailHelperInterface $verify_email_helper, protected EntityManagerInterface $entity_manager, protected LoggerInterface $logger) {} #[Route(path: '/register', name: 'register', methods: ['GET'])] public function registerAction(): Response diff --git a/src/Application/Controller/Security/ResetPasswordController.php b/src/Application/Controller/Security/ResetPasswordController.php index 32706eb339..701371c541 100644 --- a/src/Application/Controller/Security/ResetPasswordController.php +++ b/src/Application/Controller/Security/ResetPasswordController.php @@ -24,8 +24,7 @@ public function __construct( private readonly ResetPasswordHelperInterface $resetPasswordHelper, private readonly EntityManagerInterface $entityManager, private readonly ParameterBagInterface $parameter_bag, - ) { - } + ) {} /** * Display the request for a password reset. diff --git a/src/Application/Controller/Studio/StudioController.php b/src/Application/Controller/Studio/StudioController.php index d6df5f743a..e182fcdff6 100644 --- a/src/Application/Controller/Studio/StudioController.php +++ b/src/Application/Controller/Studio/StudioController.php @@ -20,9 +20,7 @@ class StudioController extends AbstractController { - public function __construct(protected StudioManager $studio_manager, protected UserManager $user_manager, protected ProgramManager $program_manager, protected ScreenshotRepository $screenshot_repository, protected TranslatorInterface $translator, protected ParameterBagInterface $parameter_bag) - { - } + public function __construct(protected StudioManager $studio_manager, protected UserManager $user_manager, protected ProgramManager $program_manager, protected ScreenshotRepository $screenshot_repository, protected TranslatorInterface $translator, protected ParameterBagInterface $parameter_bag) {} #[Route(path: '/studios', name: 'studios_overview', methods: ['GET'])] public function studiosOverview(Request $request): Response diff --git a/src/Application/Controller/Test/TestFeatureFlagController.php b/src/Application/Controller/Test/TestFeatureFlagController.php index 505abd0dac..a7ae714861 100644 --- a/src/Application/Controller/Test/TestFeatureFlagController.php +++ b/src/Application/Controller/Test/TestFeatureFlagController.php @@ -9,9 +9,7 @@ class TestFeatureFlagController extends AbstractController { - public function __construct(protected FeatureFlagManager $manager) - { - } + public function __construct(protected FeatureFlagManager $manager) {} #[Route(path: '/featureflag/test', name: 'test_flag', methods: ['GET'])] public function testFlagAction(): Response diff --git a/src/Application/Controller/User/AchievementsController.php b/src/Application/Controller/User/AchievementsController.php index 5d289af930..e7c3955d27 100644 --- a/src/Application/Controller/User/AchievementsController.php +++ b/src/Application/Controller/User/AchievementsController.php @@ -11,9 +11,7 @@ class AchievementsController extends AbstractController { - public function __construct(protected AchievementManager $achievement_manager) - { - } + public function __construct(protected AchievementManager $achievement_manager) {} #[Route(path: '/achievements', name: 'achievements_overview', methods: ['GET'])] public function AchievementsOverview(): Response diff --git a/src/Application/Controller/User/FollowerController.php b/src/Application/Controller/User/FollowerController.php index 4f833f2e65..93908dafc4 100644 --- a/src/Application/Controller/User/FollowerController.php +++ b/src/Application/Controller/User/FollowerController.php @@ -17,9 +17,7 @@ class FollowerController extends AbstractController { - public function __construct(private readonly UserManager $user_manager, private readonly NotificationManager $notification_service, private readonly NotificationRepository $notification_repo) - { - } + public function __construct(private readonly UserManager $user_manager, private readonly NotificationManager $notification_service, private readonly NotificationRepository $notification_repo) {} #[Route(path: '/follower', name: 'catrobat_follower', methods: ['GET'])] public function followerAction(Request $request, string $id = '0'): Response diff --git a/src/Application/Controller/User/ProfileController.php b/src/Application/Controller/User/ProfileController.php index 546cf52b2d..f18702ac29 100644 --- a/src/Application/Controller/User/ProfileController.php +++ b/src/Application/Controller/User/ProfileController.php @@ -26,8 +26,7 @@ public function __construct( protected ProgramManager $program_manager, protected UserManager $user_manager, protected AchievementManager $achievement_manager, - ) { - } + ) {} /** * Overwrite for FosUser Profile Route (We don't use it!). diff --git a/src/Application/Framework/ExceptionEventSubscriber.php b/src/Application/Framework/ExceptionEventSubscriber.php index 7f568e3689..b332ebe913 100644 --- a/src/Application/Framework/ExceptionEventSubscriber.php +++ b/src/Application/Framework/ExceptionEventSubscriber.php @@ -24,8 +24,7 @@ public function __construct( protected ParameterBagInterface $parameter_bag, protected UrlGeneratorInterface $url_generator, protected CookieService $cookie_service - ) { - } + ) {} public function onKernelException(ExceptionEvent $event): ?Response { diff --git a/src/Application/Framework/VersionStrategy.php b/src/Application/Framework/VersionStrategy.php index f4b60f0bc6..0e1d730eda 100644 --- a/src/Application/Framework/VersionStrategy.php +++ b/src/Application/Framework/VersionStrategy.php @@ -8,8 +8,7 @@ class VersionStrategy implements VersionStrategyInterface { public function __construct( protected string $app_version - ) { - } + ) {} /** * @throws \Exception diff --git a/src/Application/Twig/TwigExtension.php b/src/Application/Twig/TwigExtension.php index 455ffa99cd..bcacb74965 100644 --- a/src/Application/Twig/TwigExtension.php +++ b/src/Application/Twig/TwigExtension.php @@ -23,8 +23,7 @@ public function __construct( private readonly ParameterBagInterface $parameter_bag, private readonly string $catrobat_translation_dir, private readonly TranslatorInterface $translator - ) { - } + ) {} public function getFilters(): array { diff --git a/src/DB/Entity/RefreshToken.php b/src/DB/Entity/RefreshToken.php index 6f0603b1f5..7e6b2b751c 100644 --- a/src/DB/Entity/RefreshToken.php +++ b/src/DB/Entity/RefreshToken.php @@ -10,6 +10,4 @@ * * @ORM\Table("refresh_tokens") */ -class RefreshToken extends BaseRefreshToken -{ -} +class RefreshToken extends BaseRefreshToken {} diff --git a/src/DB/Entity/Translation/ProjectCustomTranslation.php b/src/DB/Entity/Translation/ProjectCustomTranslation.php index e4a7a08646..15baf9bef9 100644 --- a/src/DB/Entity/Translation/ProjectCustomTranslation.php +++ b/src/DB/Entity/Translation/ProjectCustomTranslation.php @@ -51,8 +51,7 @@ public function __construct( * @ORM\Column(type="string", length=5) */ private string $language - ) { - } + ) {} public function getId(): ?int { diff --git a/src/DB/Entity/User/Notifications/CatroNotification.php b/src/DB/Entity/User/Notifications/CatroNotification.php index 442396db9c..94c12ea799 100644 --- a/src/DB/Entity/User/Notifications/CatroNotification.php +++ b/src/DB/Entity/User/Notifications/CatroNotification.php @@ -71,8 +71,7 @@ public function __construct( * @ORM\Column(name="type", type="string") */ private string $type = '' - ) { - } + ) {} public function getId(): ?int { diff --git a/src/DB/Generator/MyUuidGenerator.php b/src/DB/Generator/MyUuidGenerator.php index 052f356551..c42ba5ec42 100644 --- a/src/DB/Generator/MyUuidGenerator.php +++ b/src/DB/Generator/MyUuidGenerator.php @@ -14,9 +14,7 @@ */ class MyUuidGenerator extends AbstractIdGenerator { - public function __construct(protected UuidGenerator $uuid_generator) - { - } + public function __construct(protected UuidGenerator $uuid_generator) {} private static string $next_value = ''; diff --git a/src/Project/AddProgramRequest.php b/src/Project/AddProgramRequest.php index 9fb9f7a295..58701bb218 100644 --- a/src/Project/AddProgramRequest.php +++ b/src/Project/AddProgramRequest.php @@ -7,9 +7,7 @@ class AddProgramRequest { - public function __construct(private User $user, private File $program_file, private readonly ?string $ip = '127.0.0.1', private ?string $language = null, private readonly ?string $flavor = 'pocketcode') - { - } + public function __construct(private User $user, private File $program_file, private readonly ?string $ip = '127.0.0.1', private ?string $language = null, private readonly ?string $flavor = 'pocketcode') {} public function getUser(): User { diff --git a/src/Project/Apk/ApkCleanupEventSubscriber.php b/src/Project/Apk/ApkCleanupEventSubscriber.php index be190c30db..66b1e581f4 100644 --- a/src/Project/Apk/ApkCleanupEventSubscriber.php +++ b/src/Project/Apk/ApkCleanupEventSubscriber.php @@ -8,9 +8,7 @@ class ApkCleanupEventSubscriber implements EventSubscriberInterface { - public function __construct(protected ApkRepository $repository) - { - } + public function __construct(protected ApkRepository $repository) {} public function handleEvent(ProgramBeforePersistEvent $event): void { diff --git a/src/Project/CatrobatCode/Parser/CatrobatCodeParser.php b/src/Project/CatrobatCode/Parser/CatrobatCodeParser.php index 3222dc9a86..4ea6d594df 100644 --- a/src/Project/CatrobatCode/Parser/CatrobatCodeParser.php +++ b/src/Project/CatrobatCode/Parser/CatrobatCodeParser.php @@ -13,7 +13,7 @@ public function parse(ExtractedCatrobatFile $extracted_catrobat_program) { try { $parsed_program = $this->parseProgram($extracted_catrobat_program); - } catch (\Exception) { + } catch (\Throwable) { $parsed_program = null; } diff --git a/src/Project/CatrobatCode/Parser/ParsedObjectsContainer.php b/src/Project/CatrobatCode/Parser/ParsedObjectsContainer.php index 5c865ebba9..a702116e1e 100644 --- a/src/Project/CatrobatCode/Parser/ParsedObjectsContainer.php +++ b/src/Project/CatrobatCode/Parser/ParsedObjectsContainer.php @@ -91,8 +91,12 @@ private function getPointedObjectXMLProperties(\SimpleXMLElement $object_xml): a private function dereference(\SimpleXMLElement $object_xml_properties): \SimpleXMLElement { if (null != $object_xml_properties[Constants::REFERENCE_ATTRIBUTE]) { - return $this->dereference($object_xml_properties - ->xpath($object_xml_properties[Constants::REFERENCE_ATTRIBUTE])[0]); + $attribute = $object_xml_properties->xpath($object_xml_properties[Constants::REFERENCE_ATTRIBUTE]); + if (!isset($attribute[0])) { + throw new \Exception('Invalid reference: '.$object_xml_properties[Constants::REFERENCE_ATTRIBUTE]); + } + + return $this->dereference($attribute[0]); } return $object_xml_properties; diff --git a/src/Project/CatrobatFile/CatrobatFileSanitizer.php b/src/Project/CatrobatFile/CatrobatFileSanitizer.php index cd6082d52c..8a44249608 100644 --- a/src/Project/CatrobatFile/CatrobatFileSanitizer.php +++ b/src/Project/CatrobatFile/CatrobatFileSanitizer.php @@ -19,9 +19,7 @@ class CatrobatFileSanitizer private ?string $extracted_file_root_path = null; - public function __construct(private readonly CatrobatCodeParser $catrobat_code_parser) - { - } + public function __construct(private readonly CatrobatCodeParser $catrobat_code_parser) {} public function sanitize(ExtractedCatrobatFile $extracted_file): void { diff --git a/src/Project/CatrobatFile/ExtractedCatrobatFile.php b/src/Project/CatrobatFile/ExtractedCatrobatFile.php index 3137921104..69e234b8dc 100644 --- a/src/Project/CatrobatFile/ExtractedCatrobatFile.php +++ b/src/Project/CatrobatFile/ExtractedCatrobatFile.php @@ -46,6 +46,9 @@ public function getName(): string return (string) $this->program_xml_properties->header->programName; } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function setName(string $name): void { $this->program_xml_properties->header->programName = $name; @@ -70,6 +73,9 @@ public function getDescription(): string return (string) $this->program_xml_properties->header->description; } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function setDescription(string $description): void { $this->program_xml_properties->header->description = $description; @@ -80,6 +86,9 @@ public function getNotesAndCredits(): string return (string) $this->program_xml_properties->header->notesAndCredits; } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function setNotesAndCredits(string $notesAndCredits): void { $this->program_xml_properties->header->notesAndCredits = $notesAndCredits; diff --git a/src/Project/CatrobatFile/LicenseUpdaterEventSubscriber.php b/src/Project/CatrobatFile/LicenseUpdaterEventSubscriber.php index 02c175d83d..159243cee8 100644 --- a/src/Project/CatrobatFile/LicenseUpdaterEventSubscriber.php +++ b/src/Project/CatrobatFile/LicenseUpdaterEventSubscriber.php @@ -21,6 +21,9 @@ public function onProgramBeforeInsert(ProgramBeforeInsertEvent $event): void $this->update($event->getExtractedFile()); } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function update(ExtractedCatrobatFile $file): void { $program_xml_properties = $file->getProgramXmlProperties(); diff --git a/src/Project/CatrobatFile/ProgramFlavorEventSubscriber.php b/src/Project/CatrobatFile/ProgramFlavorEventSubscriber.php index da4752630e..90b926fbb7 100644 --- a/src/Project/CatrobatFile/ProgramFlavorEventSubscriber.php +++ b/src/Project/CatrobatFile/ProgramFlavorEventSubscriber.php @@ -9,9 +9,7 @@ class ProgramFlavorEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly RequestStack $request_stack) - { - } + public function __construct(private readonly RequestStack $request_stack) {} public function onEvent(ProgramBeforePersistEvent $event): void { diff --git a/src/Project/CatrobatFile/VersionValidatorEventSubscriber.php b/src/Project/CatrobatFile/VersionValidatorEventSubscriber.php index 5b0582d0f5..a6374cc07c 100644 --- a/src/Project/CatrobatFile/VersionValidatorEventSubscriber.php +++ b/src/Project/CatrobatFile/VersionValidatorEventSubscriber.php @@ -32,13 +32,14 @@ public function onProgramBeforeInsert(ProgramBeforeInsertEvent $event): void public function validate(\SimpleXMLElement $xml): void { - if (version_compare($xml->header->catrobatLanguageVersion, self::MIN_LANGUAGE_VERSION, '<')) { + /* @psalm-suppress InvalidPropertyFetch */ + if (version_compare((string) $xml->header->catrobatLanguageVersion, self::MIN_LANGUAGE_VERSION, '<')) { throw new InvalidCatrobatFileException('errors.languageversion.tooold', 518); } $version = ltrim((string) $xml->header->applicationVersion, 'v'); - switch ($xml->header->platform) { + switch ((string) $xml->header->platform) { case 'Android': if (version_compare($version, self::MIN_ANDROID_PROGRAM_VERSION, '<')) { throw new InvalidCatrobatFileException('errors.programversion.tooold', 519, 'android catrobat version too old'); @@ -46,13 +47,13 @@ public function validate(\SimpleXMLElement $xml): void break; case 'Windows': - if (version_compare($xml->header->applicationVersion, self::MIN_WINDOWS_PROGRAM_VERSION, '<')) { + if (version_compare((string) $xml->header->applicationVersion, self::MIN_WINDOWS_PROGRAM_VERSION, '<')) { throw new InvalidCatrobatFileException('errors.programversion.tooold', 519, 'windows catrobat version too old'); } break; case 'iOS': - if (version_compare($xml->header->applicationVersion, self::MIN_IOS_PROGRAM_VERSION, '<')) { + if (version_compare((string) $xml->header->applicationVersion, self::MIN_IOS_PROGRAM_VERSION, '<')) { throw new InvalidCatrobatFileException('errors.programversion.tooold', 519, 'ios catrobat version too old'); } break; diff --git a/src/Project/Event/CheckScratchProgramEvent.php b/src/Project/Event/CheckScratchProgramEvent.php index 4983bb816a..f501c33551 100644 --- a/src/Project/Event/CheckScratchProgramEvent.php +++ b/src/Project/Event/CheckScratchProgramEvent.php @@ -6,9 +6,7 @@ class CheckScratchProgramEvent extends Event { - public function __construct(protected int $scratch_id) - { - } + public function __construct(protected int $scratch_id) {} public function getScratchId(): int { diff --git a/src/Project/Event/ProgramAfterInsertEvent.php b/src/Project/Event/ProgramAfterInsertEvent.php index f171aef68d..9a16b5019c 100644 --- a/src/Project/Event/ProgramAfterInsertEvent.php +++ b/src/Project/Event/ProgramAfterInsertEvent.php @@ -8,9 +8,7 @@ class ProgramAfterInsertEvent extends Event { - public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Program $program) - { - } + public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Program $program) {} public function getExtractedFile(): ExtractedCatrobatFile { diff --git a/src/Project/Event/ProgramBeforeInsertEvent.php b/src/Project/Event/ProgramBeforeInsertEvent.php index e939494e4b..0e2613360b 100644 --- a/src/Project/Event/ProgramBeforeInsertEvent.php +++ b/src/Project/Event/ProgramBeforeInsertEvent.php @@ -7,9 +7,7 @@ class ProgramBeforeInsertEvent extends Event { - public function __construct(protected ExtractedCatrobatFile $extracted_file) - { - } + public function __construct(protected ExtractedCatrobatFile $extracted_file) {} public function getExtractedFile(): ExtractedCatrobatFile { diff --git a/src/Project/Event/ProgramBeforePersistEvent.php b/src/Project/Event/ProgramBeforePersistEvent.php index e0229f98a6..a2c95fdd13 100644 --- a/src/Project/Event/ProgramBeforePersistEvent.php +++ b/src/Project/Event/ProgramBeforePersistEvent.php @@ -8,9 +8,7 @@ class ProgramBeforePersistEvent extends Event { - public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Program $program) - { - } + public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Program $program) {} public function getExtractedFile(): ExtractedCatrobatFile { diff --git a/src/Project/Event/ProjectDownloadEvent.php b/src/Project/Event/ProjectDownloadEvent.php index b5a20171f1..2192a6caa1 100644 --- a/src/Project/Event/ProjectDownloadEvent.php +++ b/src/Project/Event/ProjectDownloadEvent.php @@ -11,9 +11,7 @@ class ProjectDownloadEvent extends Event { protected Request $request; - public function __construct(protected ?User $user, protected Program $project, protected string $download_type) - { - } + public function __construct(protected ?User $user, protected Program $project, protected string $download_type) {} public function getUser(): ?User { diff --git a/src/Project/Event/ReportInsertEvent.php b/src/Project/Event/ReportInsertEvent.php index c602834b64..4623c44e4f 100644 --- a/src/Project/Event/ReportInsertEvent.php +++ b/src/Project/Event/ReportInsertEvent.php @@ -7,9 +7,7 @@ class ReportInsertEvent extends Event { - public function __construct(protected ?string $category, protected ?string $note, protected ProgramInappropriateReport $program) - { - } + public function __construct(protected ?string $category, protected ?string $note, protected ProgramInappropriateReport $program) {} public function getCategory(): ?string { diff --git a/src/Project/EventListener/ExampleProgramImageListener.php b/src/Project/EventListener/ExampleProgramImageListener.php index 661fa39dac..e9b90fb67f 100644 --- a/src/Project/EventListener/ExampleProgramImageListener.php +++ b/src/Project/EventListener/ExampleProgramImageListener.php @@ -8,9 +8,7 @@ class ExampleProgramImageListener { - public function __construct(private readonly ImageRepository $repository) - { - } + public function __construct(private readonly ImageRepository $repository) {} public function prePersist(ExampleProgram $example, LifecycleEventArgs $event): void { diff --git a/src/Project/EventListener/FeaturedProgramImageListener.php b/src/Project/EventListener/FeaturedProgramImageListener.php index 6684a30ca1..c8b5f0d27c 100644 --- a/src/Project/EventListener/FeaturedProgramImageListener.php +++ b/src/Project/EventListener/FeaturedProgramImageListener.php @@ -8,9 +8,7 @@ class FeaturedProgramImageListener { - public function __construct(private readonly ImageRepository $repository) - { - } + public function __construct(private readonly ImageRepository $repository) {} public function prePersist(FeaturedProgram $featured, LifecycleEventArgs $event): void { diff --git a/src/Project/EventListener/ProjectPostUpdateNotifier.php b/src/Project/EventListener/ProjectPostUpdateNotifier.php index 1347ee5f5a..5a97d6d1f3 100644 --- a/src/Project/EventListener/ProjectPostUpdateNotifier.php +++ b/src/Project/EventListener/ProjectPostUpdateNotifier.php @@ -12,9 +12,7 @@ class ProjectPostUpdateNotifier { - public function __construct(protected AchievementManager $achievement_manager, protected TagRepository $tag_repository, private readonly ProjectMachineTranslationRepository $machine_translation_repository) - { - } + public function __construct(protected AchievementManager $achievement_manager, protected TagRepository $tag_repository, private readonly ProjectMachineTranslationRepository $machine_translation_repository) {} public function postUpdate(Program $project, LifecycleEventArgs $event): void { diff --git a/src/Project/EventSubscriber/ProjectDownloadEventSubscriber.php b/src/Project/EventSubscriber/ProjectDownloadEventSubscriber.php index 94ff1823fd..62074ff33a 100644 --- a/src/Project/EventSubscriber/ProjectDownloadEventSubscriber.php +++ b/src/Project/EventSubscriber/ProjectDownloadEventSubscriber.php @@ -8,9 +8,7 @@ class ProjectDownloadEventSubscriber implements EventSubscriberInterface { - public function __construct(protected ProgramManager $program_manager) - { - } + public function __construct(protected ProgramManager $program_manager) {} public function onProjectDownload(ProjectDownloadEvent $event): void { diff --git a/src/Project/Extension/ProjectExtensionEventSubscriber.php b/src/Project/Extension/ProjectExtensionEventSubscriber.php index 3edd72508f..ac0202bc56 100644 --- a/src/Project/Extension/ProjectExtensionEventSubscriber.php +++ b/src/Project/Extension/ProjectExtensionEventSubscriber.php @@ -9,8 +9,7 @@ class ProjectExtensionEventSubscriber implements EventSubscriberInterface { public function __construct( protected ProjectExtensionManager $extension_manager, - ) { - } + ) {} public function onEvent(ProgramBeforePersistEvent $event): void { diff --git a/src/Project/Extension/ProjectExtensionManager.php b/src/Project/Extension/ProjectExtensionManager.php index 43a6a4aaa9..3bab5c7d8f 100644 --- a/src/Project/Extension/ProjectExtensionManager.php +++ b/src/Project/Extension/ProjectExtensionManager.php @@ -15,8 +15,7 @@ public function __construct( protected ExtensionRepository $extension_repository, protected LoggerInterface $logger, protected EntityManagerInterface $entity_manager - ) { - } + ) {} public function addExtensions(ExtractedCatrobatFile $extracted_file, Program $program, bool $flush = true): void { diff --git a/src/Project/ProgramManager.php b/src/Project/ProgramManager.php index 1cace270ba..e6dbd73fc4 100644 --- a/src/Project/ProgramManager.php +++ b/src/Project/ProgramManager.php @@ -46,9 +46,7 @@ class ProgramManager { - public function __construct(protected CatrobatFileExtractor $file_extractor, protected ProgramFileRepository $file_repository, protected ScreenshotRepository $screenshot_repository, protected EntityManagerInterface $entity_manager, protected ProgramRepository $program_repository, protected TagRepository $tag_repository, protected ProgramLikeRepository $program_like_repository, protected FeaturedRepository $featured_repository, protected ExampleRepository $example_repository, protected EventDispatcherInterface $event_dispatcher, private readonly LoggerInterface $logger, protected RequestHelper $request_helper, protected ExtensionRepository $extension_repository, protected CatrobatFileSanitizer $file_sanitizer, protected NotificationManager $notification_service, private readonly TransformedFinder $program_finder, private readonly ?UrlHelper $urlHelper, protected Security $security) - { - } + public function __construct(protected CatrobatFileExtractor $file_extractor, protected ProgramFileRepository $file_repository, protected ScreenshotRepository $screenshot_repository, protected EntityManagerInterface $entity_manager, protected ProgramRepository $program_repository, protected TagRepository $tag_repository, protected ProgramLikeRepository $program_like_repository, protected FeaturedRepository $featured_repository, protected ExampleRepository $example_repository, protected EventDispatcherInterface $event_dispatcher, private readonly LoggerInterface $logger, protected RequestHelper $request_helper, protected ExtensionRepository $extension_repository, protected CatrobatFileSanitizer $file_sanitizer, protected NotificationManager $notification_service, private readonly TransformedFinder $program_finder, private readonly ?UrlHelper $urlHelper, protected Security $security) {} public function getFeaturedRepository(): FeaturedRepository { diff --git a/src/Project/Remix/RemixGraphManipulator.php b/src/Project/Remix/RemixGraphManipulator.php index 221b0a1588..93e41044fa 100644 --- a/src/Project/Remix/RemixGraphManipulator.php +++ b/src/Project/Remix/RemixGraphManipulator.php @@ -11,9 +11,7 @@ class RemixGraphManipulator { - public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly RemixSubgraphManipulator $remix_subgraph_manipulator, private readonly ProgramRemixRepository $program_remix_repository, private readonly ProgramRemixBackwardRepository $program_remix_backward_repository, private readonly ScratchProgramRemixRepository $scratch_program_remix_repository) - { - } + public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly RemixSubgraphManipulator $remix_subgraph_manipulator, private readonly ProgramRemixRepository $program_remix_repository, private readonly ProgramRemixBackwardRepository $program_remix_backward_repository, private readonly ScratchProgramRemixRepository $scratch_program_remix_repository) {} public function convertBackwardParentsHavingNoForwardAncestor(Program $program, array $removed_forward_parent_ids): void { diff --git a/src/Project/Remix/RemixManager.php b/src/Project/Remix/RemixManager.php index f6f347f0db..55b26be31c 100644 --- a/src/Project/Remix/RemixManager.php +++ b/src/Project/Remix/RemixManager.php @@ -22,9 +22,7 @@ class RemixManager { - public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProgramRepository $program_repository, private readonly ScratchProgramRepository $scratch_program_repository, private readonly ProgramRemixRepository $program_remix_repository, private readonly ProgramRemixBackwardRepository $program_remix_backward_repository, private readonly ScratchProgramRemixRepository $scratch_program_remix_repository, private readonly RemixGraphManipulator $remix_graph_manipulator, private readonly NotificationManager $catro_notification_service) - { - } + public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProgramRepository $program_repository, private readonly ScratchProgramRepository $scratch_program_repository, private readonly ProgramRemixRepository $program_remix_repository, private readonly ProgramRemixBackwardRepository $program_remix_backward_repository, private readonly ScratchProgramRemixRepository $scratch_program_remix_repository, private readonly RemixGraphManipulator $remix_graph_manipulator, private readonly NotificationManager $catro_notification_service) {} public function filterExistingScratchProgramIds(array $scratch_ids): array { diff --git a/src/Project/Remix/RemixSubgraphManipulator.php b/src/Project/Remix/RemixSubgraphManipulator.php index 8f0f90d5b4..0c5646ef65 100644 --- a/src/Project/Remix/RemixSubgraphManipulator.php +++ b/src/Project/Remix/RemixSubgraphManipulator.php @@ -17,9 +17,7 @@ class RemixSubgraphManipulator */ final public const COMMON_TIMESTAMP = 'common_timestamp'; - public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProgramRepository $program_repository, private readonly ProgramRemixRepository $program_remix_repository, private readonly ProgramRemixBackwardRepository $program_remix_backward_repository) - { - } + public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProgramRepository $program_repository, private readonly ProgramRemixRepository $program_remix_repository, private readonly ProgramRemixBackwardRepository $program_remix_backward_repository) {} public function appendRemixSubgraphToCatrobatParents(Program $program, array $ids_of_new_parents, array $preserved_creation_date_mapping, diff --git a/src/Project/Remix/RemixUpdaterEventSubscriber.php b/src/Project/Remix/RemixUpdaterEventSubscriber.php index 53e7a88f2d..bece64ce0e 100644 --- a/src/Project/Remix/RemixUpdaterEventSubscriber.php +++ b/src/Project/Remix/RemixUpdaterEventSubscriber.php @@ -35,6 +35,8 @@ public function onProgramAfterInsert(ProgramAfterInsertEvent $event): void /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function update(ExtractedCatrobatFile $file, Program $program): void { @@ -67,7 +69,6 @@ public function update(ExtractedCatrobatFile $file, Program $program): void $this->remix_manager->addScratchPrograms($scratch_info_data); $this->remix_manager->addRemixes($program, $remixes_data); } - $program_xml_properties->header->remixOf = $remix_url_string; $program_xml_properties->header->url = $this->router->generate('program', ['id' => $program->getId(), 'theme' => 'pocketcode']); $program_xml_properties->header->userHandle = $program->getUser()->getUsername(); diff --git a/src/Project/Scratch/ScratchProjectUpdaterEventSubscriber.php b/src/Project/Scratch/ScratchProjectUpdaterEventSubscriber.php index 342f72549d..f16a7180e6 100644 --- a/src/Project/Scratch/ScratchProjectUpdaterEventSubscriber.php +++ b/src/Project/Scratch/ScratchProjectUpdaterEventSubscriber.php @@ -7,9 +7,7 @@ class ScratchProjectUpdaterEventSubscriber implements EventSubscriberInterface { - public function __construct(protected ScratchManager $scratch_manager) - { - } + public function __construct(protected ScratchManager $scratch_manager) {} public function onCheckScratchProgram(CheckScratchProgramEvent $event): void { diff --git a/src/Security/Authentication/CookieService.php b/src/Security/Authentication/CookieService.php index 1f7cb019ee..639927eedb 100644 --- a/src/Security/Authentication/CookieService.php +++ b/src/Security/Authentication/CookieService.php @@ -7,9 +7,7 @@ class CookieService { - public function __construct(private readonly int $jwtTokenLifetime, private readonly int $refreshTokenLifetime, private readonly RouterInterface $router) - { - } + public function __construct(private readonly int $jwtTokenLifetime, private readonly int $refreshTokenLifetime, private readonly RouterInterface $router) {} /** * Create bearer token cookie. diff --git a/src/Security/Authentication/JwtRefresh/RefreshBearerCookieOnKernelResponseEventSubscriber.php b/src/Security/Authentication/JwtRefresh/RefreshBearerCookieOnKernelResponseEventSubscriber.php index 679bf7a03e..42dffe3bd9 100644 --- a/src/Security/Authentication/JwtRefresh/RefreshBearerCookieOnKernelResponseEventSubscriber.php +++ b/src/Security/Authentication/JwtRefresh/RefreshBearerCookieOnKernelResponseEventSubscriber.php @@ -8,9 +8,7 @@ class RefreshBearerCookieOnKernelResponseEventSubscriber implements EventSubscriberInterface { - public function __construct(protected RefreshTokenService $refresh_token_service) - { - } + public function __construct(protected RefreshTokenService $refresh_token_service) {} public function onKernelResponse(ResponseEvent $event): void { diff --git a/src/Security/Authentication/JwtRefresh/RefreshTokenService.php b/src/Security/Authentication/JwtRefresh/RefreshTokenService.php index f97d38ab5c..16345d9864 100644 --- a/src/Security/Authentication/JwtRefresh/RefreshTokenService.php +++ b/src/Security/Authentication/JwtRefresh/RefreshTokenService.php @@ -19,8 +19,7 @@ public function __construct( protected UserManager $user_manager, protected JWTTokenManagerInterface $jwt_manager, protected CookieService $cookie_service, - ) { - } + ) {} public function createRefreshTokenForUsername(string $username): RefreshTokenInterface { diff --git a/src/Security/Authentication/WebView/WebviewAuthenticator.php b/src/Security/Authentication/WebView/WebviewAuthenticator.php index 321558a1b9..95a1467984 100644 --- a/src/Security/Authentication/WebView/WebviewAuthenticator.php +++ b/src/Security/Authentication/WebView/WebviewAuthenticator.php @@ -43,8 +43,7 @@ public function __construct( protected RequestStack $request_stack, protected LoggerInterface $logger, protected UrlGeneratorInterface $url_generator - ) { - } + ) {} /** * Called on every request to decide if this authenticator should be diff --git a/src/Security/OAuth/HwiOauthRegistrationFormType.php b/src/Security/OAuth/HwiOauthRegistrationFormType.php index bcdedb207c..c9986bbd03 100644 --- a/src/Security/OAuth/HwiOauthRegistrationFormType.php +++ b/src/Security/OAuth/HwiOauthRegistrationFormType.php @@ -6,6 +6,4 @@ use Symfony\Component\Form\AbstractType; -final class HwiOauthRegistrationFormType extends AbstractType -{ -} +class HwiOauthRegistrationFormType extends AbstractType {} diff --git a/src/Security/OAuth/OAuthSuccessHandler.php b/src/Security/OAuth/OAuthSuccessHandler.php index d83dde19fd..f55209da8f 100644 --- a/src/Security/OAuth/OAuthSuccessHandler.php +++ b/src/Security/OAuth/OAuthSuccessHandler.php @@ -16,8 +16,7 @@ public function __construct( private readonly CookieService $cookie_service, private readonly JWTTokenManagerInterface $jwt_manager, private readonly RefreshTokenService $refresh_token_service - ) { - } + ) {} public function onAuthenticationSuccess(Request $request, TokenInterface $token): RedirectResponse { diff --git a/src/Studio/StudioManager.php b/src/Studio/StudioManager.php index f1458b4cbe..40bdb2ff1f 100644 --- a/src/Studio/StudioManager.php +++ b/src/Studio/StudioManager.php @@ -18,9 +18,7 @@ class StudioManager { - public function __construct(protected EntityManagerInterface $entity_manager, protected StudioRepository $studio_repository, protected StudioActivityRepository $studio_activity_repository, protected StudioProgramRepository $studio_project_repository, protected StudioUserRepository $studio_user_repository, protected UserCommentRepository $user_comment_repository) - { - } + public function __construct(protected EntityManagerInterface $entity_manager, protected StudioRepository $studio_repository, protected StudioActivityRepository $studio_activity_repository, protected StudioProgramRepository $studio_project_repository, protected StudioUserRepository $studio_user_repository, protected UserCommentRepository $user_comment_repository) {} public function createStudio(User $user, string $name, string $description, bool $is_public = true, bool $is_enabled = true, bool $allow_comments = true, string $cover_path = null): Studio { diff --git a/src/System/Commands/GenerateTestDataCommand.php b/src/System/Commands/GenerateTestDataCommand.php index 8d5bf4ace3..bbec2c18a1 100644 --- a/src/System/Commands/GenerateTestDataCommand.php +++ b/src/System/Commands/GenerateTestDataCommand.php @@ -164,6 +164,9 @@ protected function generateProgramWithScreenshot(string $directory): void /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment + * @psalm-suppress InvalidPropertyFetch */ protected function generateProgramWithTags(string $directory): void { diff --git a/src/System/Commands/Helpers/RemixManipulationCatrobatFileExtractor.php b/src/System/Commands/Helpers/RemixManipulationCatrobatFileExtractor.php index c015a15e42..728dcb9d6f 100644 --- a/src/System/Commands/Helpers/RemixManipulationCatrobatFileExtractor.php +++ b/src/System/Commands/Helpers/RemixManipulationCatrobatFileExtractor.php @@ -16,6 +16,11 @@ public function __construct(private mixed $remix_graph_mapping, mixed $extract_d parent::__construct($extract_dir, $extract_path); } + /** + * @psalm-suppress UndefinedPropertyAssignment + * + * @throws \Exception + */ public function extract(File $file): ExtractedCatrobatFile { $extracted_catrobat_file = parent::extract($file); diff --git a/src/System/Log/LoggerProcessor.php b/src/System/Log/LoggerProcessor.php index 59b4e710ee..03b8df36c9 100644 --- a/src/System/Log/LoggerProcessor.php +++ b/src/System/Log/LoggerProcessor.php @@ -12,9 +12,7 @@ class LoggerProcessor { private const ANON_USER = 'anonymous'; - public function __construct(private readonly RequestStack $request_stack, private readonly TokenStorageInterface $security_token_storage) - { - } + public function __construct(private readonly RequestStack $request_stack, private readonly TokenStorageInterface $security_token_storage) {} public function __invoke(LogRecord $record): LogRecord { diff --git a/src/System/Mail/MailerAdapter.php b/src/System/Mail/MailerAdapter.php index ad9c730d31..7ddcd078f9 100644 --- a/src/System/Mail/MailerAdapter.php +++ b/src/System/Mail/MailerAdapter.php @@ -14,9 +14,7 @@ class MailerAdapter { - public function __construct(protected MailerInterface $mailer, protected LoggerInterface $logger, protected Environment $templateWrapper, protected string $dkim_private_key_path) - { - } + public function __construct(protected MailerInterface $mailer, protected LoggerInterface $logger, protected Environment $templateWrapper, protected string $dkim_private_key_path) {} public function send(string $to, string $subject, string $template, array $context = []): void { diff --git a/src/System/Testing/Behat/Context/ApiContext.php b/src/System/Testing/Behat/Context/ApiContext.php index bc6e4906ba..b0843f1535 100644 --- a/src/System/Testing/Behat/Context/ApiContext.php +++ b/src/System/Testing/Behat/Context/ApiContext.php @@ -97,28 +97,47 @@ class ApiContext implements Context private array $checked_catrobat_remix_backward_relations; + /** + * @var string[] + */ private array $default_project_structure = ['id', 'name', 'author', 'views', 'downloads', 'flavor', 'uploaded_string', 'screenshot_large', 'screenshot_small', 'project_url', // TODO: hotfix for Catty + Catroid . Remove 'tags' after Catty uses attributes-parameter. 'tags', 'download', 'description', 'version', 'uploaded', 'download_url', 'filesize', ]; - + /** + * @var string[] + */ private array $full_project_structure = ['id', 'name', 'author', 'description', 'credits', 'version', 'views', 'downloads', 'reactions', 'comments', 'private', 'flavor', 'tags', 'uploaded', 'uploaded_string', 'screenshot_large', 'screenshot_small', 'project_url', 'download_url', 'filesize', 'download', ]; - + /** + * @var string[] + */ private array $default_user_structure = ['id', 'username']; - + /** + * @var string[] + */ private array $full_user_structure = ['id', 'username', 'picture', 'about', 'currentlyWorkingOn', 'projects', 'followers', 'following', ]; + /** + * @var string[] + */ private array $default_user_structure_extended = ['id', 'username', 'email']; - + /** + * @var string[] + */ private array $default_featured_project_structure = ['id', 'project_id', 'project_url', 'url', 'name', 'author', 'featured_image']; + /** + * @var string[] + */ private array $default_media_file_structure = ['id', 'name']; - + /** + * @var string[] + */ private array $survey_structure = ['url']; private array $new_uploaded_projects = []; @@ -925,16 +944,12 @@ public function theUploadedProgramShouldHaveRemixOfInTheXml(mixed $value, string /** * @Given /^I want to upload a program$/ */ - public function iWantToUploadAProgram(): void - { - } + public function iWantToUploadAProgram(): void {} /** * @Given /^I have no parameters$/ */ - public function iHaveNoParameters(): void - { - } + public function iHaveNoParameters(): void {} /** * @Then /^I should get no programs$/ diff --git a/src/System/Testing/Behat/Context/CatrowebBrowserContext.php b/src/System/Testing/Behat/Context/CatrowebBrowserContext.php index 20f5de665f..648788299b 100644 --- a/src/System/Testing/Behat/Context/CatrowebBrowserContext.php +++ b/src/System/Testing/Behat/Context/CatrowebBrowserContext.php @@ -1196,9 +1196,7 @@ public function theProgramApkStatusWillBeFlagged(mixed $arg1): void /** * @Given /^I requested jenkins to build it$/ */ - public function iRequestedJenkinsToBuildIt(): void - { - } + public function iRequestedJenkinsToBuildIt(): void {} /** * @Then /^it will be stored on the server$/ diff --git a/src/System/Testing/Behat/ContextTrait.php b/src/System/Testing/Behat/ContextTrait.php index 59d84a8ce7..943bcc17cf 100644 --- a/src/System/Testing/Behat/ContextTrait.php +++ b/src/System/Testing/Behat/ContextTrait.php @@ -542,6 +542,8 @@ public function insertProjectReport(array $config, bool $andFlush = true): Progr /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function generateProgramFileWith(mixed $parameters, mixed $is_embroidery = false): string { @@ -555,6 +557,9 @@ public function generateProgramFileWith(mixed $parameters, mixed $is_embroidery $filesystem->mirror($this->FIXTURES_DIR.'/GeneratedFixtures/base', $new_program_dir); } $properties = simplexml_load_file($new_program_dir.'/code.xml'); + if (!$properties) { + throw new \Exception("Can't load code.xml file"); + } foreach ($parameters as $name => $value) { switch ($name) { diff --git a/src/System/Testing/DataFixtures/UserDataFixtures.php b/src/System/Testing/DataFixtures/UserDataFixtures.php index e771e9cec8..8f85c5fb4d 100644 --- a/src/System/Testing/DataFixtures/UserDataFixtures.php +++ b/src/System/Testing/DataFixtures/UserDataFixtures.php @@ -25,8 +25,7 @@ class UserDataFixtures public function __construct( private readonly UserManager $user_manager, private readonly PasswordHasherFactoryInterface $password_hasher_factory - ) { - } + ) {} public function insertUser(array $config = [], bool $andFlush = true): User { diff --git a/src/System/Testing/FixedTokenGenerator.php b/src/System/Testing/FixedTokenGenerator.php index 742c8a2e5b..5f46c15788 100644 --- a/src/System/Testing/FixedTokenGenerator.php +++ b/src/System/Testing/FixedTokenGenerator.php @@ -6,9 +6,7 @@ class FixedTokenGenerator extends TokenGenerator { - public function __construct(private readonly mixed $token) - { - } + public function __construct(private readonly mixed $token) {} public function generateToken(): string { diff --git a/src/System/Testing/PhpUnit/Extension/BootstrapExtension.php b/src/System/Testing/PhpUnit/Extension/BootstrapExtension.php new file mode 100644 index 0000000000..c372e2e75d --- /dev/null +++ b/src/System/Testing/PhpUnit/Extension/BootstrapExtension.php @@ -0,0 +1,33 @@ +registerSubscriber(new class() implements StartedSubscriber { + public function notify(Started $event): void + { + DataBaseUtils::recreateTestEnvironment(); + + CommandHelper::executeShellCommand( + ['bin/console', 'fos:elastic:populate'], [], 'Populate elastic' + ); + } + }); + } +} diff --git a/src/System/Testing/PhpUnit/Hook/RefreshTestEnvHook.php b/src/System/Testing/PhpUnit/Hook/RefreshTestEnvHook.php deleted file mode 100644 index f7d42e5910..0000000000 --- a/src/System/Testing/PhpUnit/Hook/RefreshTestEnvHook.php +++ /dev/null @@ -1,46 +0,0 @@ -object = $this->getMockForAbstractClass(LogLine::class); } - protected function tearDown(): void - { - parent::tearDown(); - } - - public function getDebugLevelDataProvider(): \Generator + public static function provideDebugLevelDataProvider(): \Generator { yield 'case 1' => ['php.INFO', LogsController::FILTER_LEVEL_INFO]; yield 'case 2' => ['console.WARNING', LogsController::FILTER_LEVEL_WARNING]; @@ -40,10 +36,9 @@ public function getDebugLevelDataProvider(): \Generator } /** - * @dataProvider getDebugLevelDataProvider - * * @throws \ReflectionException */ + #[DataProvider('provideDebugLevelDataProvider')] public function testGetDebugLevelByLine(string $string, int $output): void { $this->assertEquals($this->invokeMethod($this->object, 'getDebugLevelByString', [$string]), $output); diff --git a/tests/PhpUnit/Admin/Tools/Log/LogsControllerTest.php b/tests/PhpUnit/Admin/Tools/Log/LogsControllerTest.php index 7cdb8edcf7..0c3d50fde1 100644 --- a/tests/PhpUnit/Admin/Tools/Log/LogsControllerTest.php +++ b/tests/PhpUnit/Admin/Tools/Log/LogsControllerTest.php @@ -6,6 +6,7 @@ use App\Admin\Tools\Logs\LogLine; use App\Storage\FileHelper; use App\System\Testing\PhpUnit\DefaultTestCase; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Filesystem\Filesystem; @@ -23,12 +24,7 @@ protected function setUp(): void $this->object = $this->getMockForAbstractClass(LogsController::class); } - protected function tearDown(): void - { - parent::tearDown(); - } - - public function getLogFileContentDataProvider(): \Generator + public static function provideLogFileContentData(): \Generator { yield 'case 1' => [ ['[2020-10-20T19:20:55.523679+02:00] php.INFO: User Deprecated'], @@ -86,9 +82,8 @@ public function getLogFileContentDataProvider(): \Generator /** * @throws \ReflectionException - * - * @dataProvider getLogFileContentDataProvider */ + #[DataProvider('provideLogFileContentData')] public function testGetLogFileContent(array $actualFileLines, array $searchFilters, array $expectedLines): void { $logDir = 'var/log/LogFilesTest/'; diff --git a/tests/PhpUnit/Api/Services/Base/PandaAuthenticationTraitTest.php b/tests/PhpUnit/Api/Services/Base/PandaAuthenticationTraitTest.php index 62e6018b1d..669ed72cb4 100644 --- a/tests/PhpUnit/Api/Services/Base/PandaAuthenticationTraitTest.php +++ b/tests/PhpUnit/Api/Services/Base/PandaAuthenticationTraitTest.php @@ -5,6 +5,7 @@ use App\Api\Exceptions\ApiException; use App\Api\Services\Base\PandaAuthenticationTrait; use App\System\Testing\PhpUnit\DefaultTestCase; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; /** @@ -38,10 +39,9 @@ public function testTestTraitExists(): void * * @covers \App\Api\Services\Base\PandaAuthenticationTrait::setPandaAuth * - * @dataProvider dataProviderPandaAuth - * * @throws \Exception */ + #[DataProvider('providePandaAuthData')] public function testSetPandaAuth(?string $value, bool $expect_exception, string $expected = ''): void { if ($expect_exception) { @@ -53,7 +53,7 @@ public function testSetPandaAuth(?string $value, bool $expect_exception, string $this->assertEquals($expected, $this->object->getAuthenticationToken()); } - public function dataProviderPandaAuth(): array + public static function providePandaAuthData(): array { return [ 'Empty' => [ diff --git a/tests/PhpUnit/Api/Services/Base/TranslatorAwareTraitTest.php b/tests/PhpUnit/Api/Services/Base/TranslatorAwareTraitTest.php index bbadbcfb72..a23d71258c 100644 --- a/tests/PhpUnit/Api/Services/Base/TranslatorAwareTraitTest.php +++ b/tests/PhpUnit/Api/Services/Base/TranslatorAwareTraitTest.php @@ -5,6 +5,7 @@ use App\Api\Services\Base\TranslatorAwareTrait; use App\System\Testing\PhpUnit\DefaultTestCase; use Behat\Behat\Definition\Translator\Translator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; /** @@ -104,9 +105,8 @@ public function testTransFailureHandling(): void * @small * * @covers \App\Api\Services\Base\TranslatorAwareTrait::sanitizeLocale - * - * @dataProvider dataProviderSanitizeLocale */ + #[DataProvider('provideSanitizeLocaleData')] public function testSanitizeLocale(?string $input, string $expected): void { $this->assertSame( @@ -115,7 +115,7 @@ public function testSanitizeLocale(?string $input, string $expected): void ); } - public function dataProviderSanitizeLocale(): array + public static function provideSanitizeLocaleData(): array { return [ [null, 'en'], @@ -138,9 +138,8 @@ public function dataProviderSanitizeLocale(): array * @small * * @covers \App\Api\Services\Base\TranslatorAwareTrait::isLocaleAValidLocaleWithUnderscore - * - * @dataProvider dataProviderIsLocaleAValidLocaleWithUnderscore */ + #[DataProvider('provideIsLocaleAValidLocaleWithUnderscoreData')] public function testIsLocaleAValidLocaleWithUnderscore(string $input, bool $expected): void { $this->assertSame( @@ -149,7 +148,7 @@ public function testIsLocaleAValidLocaleWithUnderscore(string $input, bool $expe ); } - public function dataProviderIsLocaleAValidLocaleWithUnderscore(): array + public static function provideIsLocaleAValidLocaleWithUnderscoreData(): array { return [ ['de_DE', true], @@ -169,9 +168,8 @@ public function dataProviderIsLocaleAValidLocaleWithUnderscore(): array * @small * * @covers \App\Api\Services\Base\TranslatorAwareTrait::isLocaleAValidTwoLetterLocale - * - * @dataProvider dataProviderIsLocaleAValidTwoLetterLocale */ + #[DataProvider('provideIsLocaleAValidTwoLetterLocaleData')] public function testIsLocaleAValidTwoLetterLocale(string $input, bool $expected): void { $this->assertSame( @@ -180,7 +178,7 @@ public function testIsLocaleAValidTwoLetterLocale(string $input, bool $expected) ); } - public function dataProviderIsLocaleAValidTwoLetterLocale(): array + public static function provideIsLocaleAValidTwoLetterLocaleData(): array { return [ ['en-UK', false], @@ -199,9 +197,8 @@ public function dataProviderIsLocaleAValidTwoLetterLocale(): array * @small * * @covers \App\Api\Services\Base\TranslatorAwareTrait::normalizeLocaleFormatToLocaleWithUnderscore - * - * @dataProvider dataProviderMapLocaleToLocaleWithUnderscore */ + #[DataProvider('provideMapLocaleToLocaleWithUnderscoreData')] public function testMapLocaleToLocaleWithUnderscore(string $input, string $expected): void { $this->assertSame( @@ -210,7 +207,7 @@ public function testMapLocaleToLocaleWithUnderscore(string $input, string $expec ); } - public function dataProviderMapLocaleToLocaleWithUnderscore(): array + public static function provideMapLocaleToLocaleWithUnderscoreData(): array { return [ 'simple' => ['en-UK', 'en_UK'], @@ -224,9 +221,8 @@ public function dataProviderMapLocaleToLocaleWithUnderscore(): array * @small * * @covers \App\Api\Services\Base\TranslatorAwareTrait::mapLocaleWithUnderscoreToTwoLetterCode - * - * @dataProvider dataProviderMapLocaleWithUnderscoreToTwoLetterCode */ + #[DataProvider('provideMapLocaleWithUnderscoreToTwoLetterCodeData')] public function testMapLocaleWithUnderscoreToTwoLetterCode(string $input, string $expected): void { $this->assertSame( @@ -235,7 +231,7 @@ public function testMapLocaleWithUnderscoreToTwoLetterCode(string $input, string ); } - public function dataProviderMapLocaleWithUnderscoreToTwoLetterCode(): array + public static function provideMapLocaleWithUnderscoreToTwoLetterCodeData(): array { return [ 'simple' => ['en_UK', 'en'], @@ -249,9 +245,8 @@ public function dataProviderMapLocaleWithUnderscoreToTwoLetterCode(): array * @small * * @covers \App\Api\Services\Base\TranslatorAwareTrait::mapTwoLetterCodeToLocaleWithUnderscore - * - * @dataProvider dataProviderMapTwoLetterCodeToLocaleWithUnderscore */ + #[DataProvider('provideMapTwoLetterCodeToLocaleWithUnderscoreData')] public function testMapTwoLetterCodeToLocaleWithUnderscore(string $input, string $expected): void { $this->assertSame( @@ -260,7 +255,7 @@ public function testMapTwoLetterCodeToLocaleWithUnderscore(string $input, string ); } - public function dataProviderMapTwoLetterCodeToLocaleWithUnderscore(): array + public static function provideMapTwoLetterCodeToLocaleWithUnderscoreData(): array { return [ 'empty' => ['', 'en'], diff --git a/tests/PhpUnit/Api/Services/ValidationWrapperTest.php b/tests/PhpUnit/Api/Services/ValidationWrapperTest.php index e1e46504b2..a4bf2cedc0 100644 --- a/tests/PhpUnit/Api/Services/ValidationWrapperTest.php +++ b/tests/PhpUnit/Api/Services/ValidationWrapperTest.php @@ -86,8 +86,6 @@ public function testHasError(): void * @small * * @covers \App\Api\Services\ValidationWrapper::clear - * - * @dataProvider */ public function testClear(): void { diff --git a/tests/PhpUnit/Application/Framework/VersionStrategyTest.php b/tests/PhpUnit/Application/Framework/VersionStrategyTest.php index 5befed5861..330918e298 100644 --- a/tests/PhpUnit/Application/Framework/VersionStrategyTest.php +++ b/tests/PhpUnit/Application/Framework/VersionStrategyTest.php @@ -4,6 +4,7 @@ use App\Application\Framework\VersionStrategy; use App\System\Testing\PhpUnit\DefaultTestCase; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface; @@ -63,17 +64,16 @@ public function testCtor(): void * * @covers \App\Application\Framework\VersionStrategy::getVersion * - * @dataProvider dataProviderGetVersion - * * @throws \ReflectionException */ + #[DataProvider('provideVersionData')] public function testGetVersion(string $path, string $expected): void { $this->mockProperty(VersionStrategy::class, $this->object, 'app_version', '1.2.3'); $this->assertEquals($expected, $this->object->getVersion($path)); } - public function dataProviderGetVersion(): array + public static function provideVersionData(): array { return [ 'no parameters in path' => [ diff --git a/tests/PhpUnit/Application/Locale/TransChoiceTest.php b/tests/PhpUnit/Application/Locale/TransChoiceTest.php index a761e40399..06da959e4f 100644 --- a/tests/PhpUnit/Application/Locale/TransChoiceTest.php +++ b/tests/PhpUnit/Application/Locale/TransChoiceTest.php @@ -2,6 +2,7 @@ namespace Tests\PhpUnit\Application\Locale; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\HttpFoundation\File\File; @@ -22,12 +23,8 @@ class TransChoiceTest extends TestCase */ public const LANGUAGE_DIR = 'tests/TestData/DataFixtures/translations/'; - /** - * @test - * - * @dataProvider language_provider - */ - public function allTransChoiceEntriesShouldHaveACorrectSyntax(TranslatorInterface $translator, string $language_code, array $message_ids): void + #[DataProvider('provideLanguageData')] + public function testAllTransChoiceEntriesShouldHaveACorrectSyntax(TranslatorInterface $translator, string $language_code, array $message_ids): void { foreach ($message_ids as $message_id) { $translator->trans($message_id, ['%count%' => 1], 'catroweb', $language_code); @@ -37,7 +34,7 @@ public function allTransChoiceEntriesShouldHaveACorrectSyntax(TranslatorInterfac $this->assertTrue(true); } - public function language_provider(): array + public static function provideLanguageData(): array { $directory = self::LANGUAGE_DIR; diff --git a/tests/PhpUnit/Application/Theme/ThemeRequestEventSubscriberTest.php b/tests/PhpUnit/Application/Theme/ThemeRequestEventSubscriberTest.php index 5d30f19144..46274f0c5b 100644 --- a/tests/PhpUnit/Application/Theme/ThemeRequestEventSubscriberTest.php +++ b/tests/PhpUnit/Application/Theme/ThemeRequestEventSubscriberTest.php @@ -5,6 +5,7 @@ use App\Application\Theme\ThemeRequestEventSubscriber; use App\System\Testing\PhpUnit\DefaultTestCase; use App\Utils\RequestHelper; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\HttpFoundation\ParameterBag; @@ -45,10 +46,9 @@ public function testTestClassExists(): void /** * @group integration * - * @dataProvider kernelRequestDataProvider - * * @throws \ReflectionException */ + #[DataProvider('provideKernelRequestData')] public function testOnKernelRequestThemeInRequest( string $request_theme, string $request_uri, string $expected_routing_theme, string $expected_flavor ): void { @@ -67,7 +67,7 @@ public function testOnKernelRequestThemeInRequest( $this->object->onKernelRequest($event); } - public function kernelRequestDataProvider(): array + public static function provideKernelRequestData(): array { return [ 'Using a valid request theme' => [ @@ -181,9 +181,17 @@ private function expectAttributesToEqual($request_attributes, string $theme, str { $request_attributes->expects($this->exactly(2)) ->method('set') - ->withConsecutive( - ['theme', $theme], - ['flavor', $flavor] + ->willReturnCallback( + function ($key, $value) use ($theme, $flavor) { + switch ($key) { + case 'theme': + $this->assertEquals($theme, $value); + break; + case 'flavor': + $this->assertEquals($flavor, $value); + break; + } + } ) ; } diff --git a/tests/PhpUnit/Application/Twig/TwigExtensionTest.php b/tests/PhpUnit/Application/Twig/TwigExtensionTest.php index 494f971c61..c2c2b8305f 100644 --- a/tests/PhpUnit/Application/Twig/TwigExtensionTest.php +++ b/tests/PhpUnit/Application/Twig/TwigExtensionTest.php @@ -46,10 +46,7 @@ public function testLanguageOptions(): void $this->assertTrue($this->isSelected($short, $language_options)); } - /** - * @test - */ - public function englishMustBeSelected(): void + public function testEnglishMustBeSelected(): void { $short = 'en_GB'; $notShort = 'de'; @@ -61,10 +58,7 @@ public function englishMustBeSelected(): void $this->assertFalse($this->isSelected($notShort, $list)); } - /** - * @test - */ - public function germanMustBeSelected(): void + public function testGermanMustBeSelected(): void { $short = 'de_DE'; $notShort = 'en_GB'; diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/BricksTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/BricksTest.php index 7280258f62..bdb7feccf6 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/BricksTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/BricksTest.php @@ -5,7 +5,8 @@ use App\Project\CatrobatCode\Parser\Bricks\Brick; use App\Project\CatrobatCode\Parser\Bricks\BrickFactory; use App\Project\CatrobatCode\Parser\Constants; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -35,16 +36,12 @@ class BricksTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); $this->brick_xml_properties_list = $xml_properties->xpath('//brick'); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { foreach ($this->brick_xml_properties_list as $brick_xml_properties) { $script = BrickFactory::generate($brick_xml_properties); @@ -55,7 +52,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getType'], @@ -65,13 +62,10 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod - * - * @dataProvider provideBrickXMLProperties + * @depends testMustHaveMethod */ - public function factoryMustGenerateValidBrick(mixed $brick_xml_properties, mixed $expected): void + #[DataProvider('provideBrickXMLProperties')] + public function testFactoryMustGenerateValidBrick(mixed $brick_xml_properties, mixed $expected): void { $actual = BrickFactory::generate($brick_xml_properties); @@ -85,15 +79,15 @@ public function factoryMustGenerateValidBrick(mixed $brick_xml_properties, mixed /** * @return mixed[][] */ - public function provideBrickXMLProperties(): array + public static function provideBrickXMLProperties(): array { $data = []; $reference_output = - file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/brick_reference.output', FILE_IGNORE_NEW_LINES); + file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/brick_reference.output', FILE_IGNORE_NEW_LINES); $reference_output_index = 0; - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); foreach ($xml_properties->xpath('//brick') as $brick_xml_properties) { $expected = [ self::TYPE => $reference_output[$reference_output_index++], @@ -113,11 +107,9 @@ public function provideBrickXMLProperties(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function factoryMustGenerateUnknownBrickOtherwise(): ?Brick + public function testFactoryMustGenerateUnknownBrickOtherwise(): ?Brick { $brick_xml_properties = $this->brick_xml_properties_list[0]; // @phpstan-ignore-next-line diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/CategoriesTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/CategoriesTest.php index bbbf19d05b..d33f426ecd 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/CategoriesTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/CategoriesTest.php @@ -4,7 +4,7 @@ use App\Project\CatrobatCode\Parser\CodeStatistic; use App\Project\CatrobatCode\Parser\ParsedScene; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\TestCase; /** @@ -14,14 +14,9 @@ */ class CategoriesTest extends TestCase { - protected function setUp(): void - { - } + protected function setUp(): void {} - /** - * @test - */ - public function mustDetectAllControlBricks(): void + public function testMustDetectAllControlBricks(): void { $category = 'control'; $stats = $this->loadStatistics($category); @@ -29,10 +24,7 @@ public function mustDetectAllControlBricks(): void $this->assertBrickCount($category, 19, 15, $stats); } - /** - * @test - */ - public function mustDetectAllDataBricks(): void + public function testMustDetectAllDataBricks(): void { $category = 'data'; $stats = $this->loadStatistics($category); @@ -40,10 +32,7 @@ public function mustDetectAllDataBricks(): void $this->assertBrickCount($category, 16, 16, $stats); } - /** - * @test - */ - public function mustDetectAllLookBricks(): void + public function testMustDetectAllLookBricks(): void { $category = 'looks'; $stats = $this->loadStatistics($category); @@ -53,8 +42,8 @@ public function mustDetectAllLookBricks(): void private function loadStatistics(string $category): CodeStatistic { - $xml = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/CategoryPrograms/'.$category.'.xml'); - self::assertNotFalse($xml); + $xml = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/CategoryPrograms/'.$category.'.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $code_statistic = new CodeStatistic(); $code_statistic->update(new ParsedScene($xml->xpath('//scene')[0])); diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php index ff58b7bef0..e4a7f81d4b 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php @@ -6,7 +6,9 @@ use App\Project\CatrobatCode\Parser\ParsedSceneProgram; use App\Project\CatrobatCode\Parser\ParsedSimpleProgram; use App\Project\CatrobatFile\ExtractedCatrobatFile; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\Storage\FileHelper; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -23,12 +25,13 @@ protected function setUp(): void $this->parser = new CatrobatCodeParser(); } - /** - * @test - * - * @dataProvider validProgramProvider - */ - public function mustReturnParsedProgram(mixed $extracted_catrobat_program): void + public function tearDown(): void + { + FileHelper::emptyDirectory(BootstrapExtension::$CACHE_DIR); + } + + #[DataProvider('provideValidProgramData')] + public function testMustReturnParsedProgram(mixed $extracted_catrobat_program): void { $actual = $this->parser->parse($extracted_catrobat_program); $expected = [ @@ -42,36 +45,26 @@ public function mustReturnParsedProgram(mixed $extracted_catrobat_program): void )); } - /** - * @test - */ - public function mustReturnParsedSimpleProgramIfNoScenes(): void + public function testMustReturnParsedSimpleProgramIfNoScenes(): void { - $extracted_catrobat_program = new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', ''); + $extracted_catrobat_program = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', ''); $actual = $this->parser->parse($extracted_catrobat_program); $expected = ParsedSimpleProgram::class; $this->assertInstanceOf($expected, $actual); } - /** - * @test - */ - public function mustReturnParsedSceneProgramIfScenes(): void + public function testMustReturnParsedSceneProgramIfScenes(): void { - $extracted_catrobat_program = new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', ''); + $extracted_catrobat_program = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', ''); $actual = $this->parser->parse($extracted_catrobat_program); $expected = ParsedSceneProgram::class; $this->assertInstanceOf($expected, $actual); } - /** - * @test - * - * @dataProvider faultyProgramProvider - */ - public function mustReturnNullOnError(mixed $faulty_program): void + #[DataProvider('provideFaultyProgramData')] + public function testMustReturnNullOnError(ExtractedCatrobatFile $faulty_program): void { $this->assertNull($this->parser->parse($faulty_program)); } @@ -79,29 +72,25 @@ public function mustReturnNullOnError(mixed $faulty_program): void /** * @return \App\Project\CatrobatFile\ExtractedCatrobatFile[][] */ - public function validProgramProvider(): array + public static function provideValidProgramData(): array { $programs = []; - $programs[] = [new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', '')]; - $programs[] = [new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', '')]; - $programs[] = [new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/', '', '')]; + $programs[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', '')]; + $programs[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', '')]; + $programs[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/', '', '')]; return $programs; } - /** - * @return \App\Project\CatrobatFile\ExtractedCatrobatFile[][] - */ - public function faultyProgramProvider(): array + public static function provideFaultyProgramData(): \Generator { - $programs = []; - $programs[] = [new ExtractedCatrobatFile( - RefreshTestEnvHook::$FIXTURES_DIR.'FaultyPrograms/CorruptedGroupFaultyProgram/', '', ''), + yield [ + new ExtractedCatrobatFile( + BootstrapExtension::$FIXTURES_DIR.'FaultyPrograms/CorruptedGroupFaultyProgram/', '', ''), ]; - $programs[] = [new ExtractedCatrobatFile( - RefreshTestEnvHook::$FIXTURES_DIR.'FaultyPrograms/ScenesWithoutNamesFaultyProgram/', '', ''), + yield [ + new ExtractedCatrobatFile( + BootstrapExtension::$FIXTURES_DIR.'FaultyPrograms/ScenesWithoutNamesFaultyProgram/', '', ''), ]; - - return $programs; } } diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/CodeStatisticTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/CodeStatisticTest.php index 566751e561..9cffb6017a 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/CodeStatisticTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/CodeStatisticTest.php @@ -4,7 +4,8 @@ use App\Project\CatrobatCode\Parser\CodeStatistic; use App\Project\CatrobatCode\Parser\ParsedScene; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -18,17 +19,13 @@ class CodeStatisticTest extends TestCase protected function setUp(): void { - $xml = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); - self::assertNotFalse($xml); + $xml = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $this->xml_properties = $xml; } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $code_statistic = new CodeStatistic(); $this->assertTrue(method_exists($code_statistic, $method_name)); @@ -37,7 +34,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['update'], @@ -54,11 +51,9 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function mustComputeCorrectScriptStatistic(): CodeStatistic + public function testMustComputeCorrectScriptStatistic(): CodeStatistic { $code_statistic = new CodeStatistic(); $code_statistic->update(new ParsedScene($this->xml_properties->xpath('//scene')[0])); @@ -72,11 +67,9 @@ public function mustComputeCorrectScriptStatistic(): CodeStatistic } /** - * @test - * - * @depends mustComputeCorrectScriptStatistic + * @depends testMustComputeCorrectScriptStatistic */ - public function mustComputeCorrectBrickStatistic(mixed $code_statistic): void + public function testMustComputeCorrectBrickStatistic(mixed $code_statistic): void { $expected = 170; $actual = $code_statistic->getBrickStatistic(); @@ -85,11 +78,9 @@ public function mustComputeCorrectBrickStatistic(mixed $code_statistic): void } /** - * @test - * - * @depends mustComputeCorrectScriptStatistic + * @depends testMustComputeCorrectScriptStatistic */ - public function mustComputeCorrectObjectStatistic(mixed $code_statistic): void + public function testMustComputeCorrectObjectStatistic(mixed $code_statistic): void { $expected = 16; $actual = $code_statistic->getObjectStatistic(); @@ -98,11 +89,9 @@ public function mustComputeCorrectObjectStatistic(mixed $code_statistic): void } /** - * @test - * - * @depends mustComputeCorrectScriptStatistic + * @depends testMustComputeCorrectScriptStatistic */ - public function mustComputeCorrectLookStatistic(mixed $code_statistic): void + public function testMustComputeCorrectLookStatistic(mixed $code_statistic): void { $expected = 19; $actual = $code_statistic->getLookStatistic(); @@ -111,11 +100,9 @@ public function mustComputeCorrectLookStatistic(mixed $code_statistic): void } /** - * @test - * - * @depends mustComputeCorrectScriptStatistic + * @depends testMustComputeCorrectScriptStatistic */ - public function mustComputeCorrectSoundStatistic(mixed $code_statistic): void + public function testMustComputeCorrectSoundStatistic(mixed $code_statistic): void { $expected = 4; $actual = $code_statistic->getSoundStatistic(); @@ -124,11 +111,9 @@ public function mustComputeCorrectSoundStatistic(mixed $code_statistic): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function mustComputeCorrectGlobalVariableStatistic(): CodeStatistic + public function testMustComputeCorrectGlobalVariableStatistic(): CodeStatistic { $code_statistic = new CodeStatistic(); $code_statistic->computeVariableStatistic($this->xml_properties); @@ -142,11 +127,9 @@ public function mustComputeCorrectGlobalVariableStatistic(): CodeStatistic } /** - * @test - * - * @depends mustComputeCorrectGlobalVariableStatistic + * @depends testMustComputeCorrectGlobalVariableStatistic */ - public function mustComputeCorrectLocalVariableStatistic(mixed $code_statistic): void + public function testMustComputeCorrectLocalVariableStatistic(mixed $code_statistic): void { $expected = 0; $actual = $code_statistic->getLocalVarStatistic(); diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/FormulaResolverTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/FormulaResolverTest.php index 54651dd392..8b316d7a87 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/FormulaResolverTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/FormulaResolverTest.php @@ -4,7 +4,8 @@ use App\Project\CatrobatCode\Parser\Constants; use App\Project\CatrobatCode\Parser\FormulaResolver; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -14,12 +15,8 @@ */ class FormulaResolverTest extends TestCase { - /** - * @test - * - * @dataProvider formulaDataProvider - */ - public function mustResolveAllFormulas(mixed $formula_list_xml_properties, mixed $categories, mixed $expected): void + #[DataProvider('provideFormulaData')] + public function testMustResolveAllFormulas(mixed $formula_list_xml_properties, mixed $categories, mixed $expected): void { $actual = FormulaResolver::resolve($formula_list_xml_properties); foreach ($categories as $category) { @@ -30,13 +27,13 @@ public function mustResolveAllFormulas(mixed $formula_list_xml_properties, mixed /** * @return mixed[][] */ - public function formulaDataProvider(): array + public static function provideFormulaData(): array { $data = []; - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllFormulaProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllFormulaProgram/code.xml'); $reference_output = - file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllFormulaProgram/reference.output', FILE_IGNORE_NEW_LINES); + file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllFormulaProgram/reference.output', FILE_IGNORE_NEW_LINES); $reference_output_index = 0; foreach ($xml_properties->xpath('//formulaList') as $formula_list_xml_properties) { diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectAssetTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectAssetTest.php index c4a4a19283..14d0491011 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectAssetTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectAssetTest.php @@ -3,7 +3,8 @@ namespace Tests\PhpUnit\Project\CatrobatCode\Parser; use App\Project\CatrobatCode\Parser\ParsedObjectAsset; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -20,17 +21,13 @@ class ParsedObjectAssetTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); $this->assets[] = new ParsedObjectAsset($xml_properties->xpath('//look')[0]); $this->assets[] = new ParsedObjectAsset($xml_properties->xpath('//sound')[0]); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->assets[0], $method_name)); $this->assertTrue(method_exists($this->assets[1], $method_name)); @@ -39,7 +36,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getFileName'], @@ -48,11 +45,9 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getFileNameMustReturnCertainString(): void + public function testGetFileNameMustReturnCertainString(): void { $expected = [ 'e3b880f6b5eb89981ddb0cf18c545e4d_Mars%20%28Landscape%29.png', @@ -68,11 +63,9 @@ public function getFileNameMustReturnCertainString(): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getNameMustReturnCertainString(): void + public function testGetNameMustReturnCertainString(): void { $expected = [ 'Mars (Landscape)', diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectGroupTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectGroupTest.php index 87a947e7ba..058fdf5752 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectGroupTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectGroupTest.php @@ -4,8 +4,9 @@ use App\Project\CatrobatCode\Parser\ParsedObject; use App\Project\CatrobatCode\Parser\ParsedObjectGroup; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -19,24 +20,20 @@ class ParsedObjectGroupTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_object = $xml_properties->xpath('//object[@type="GroupSprite"]'); Assert::assertNotFalse($xml_object); $this->group = new ParsedObjectGroup($xml_object[0]); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->group, $method_name)); } - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getName'], @@ -47,33 +44,27 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function isGroupMustReturnTrue(): void + public function testIsGroupMustReturnTrue(): void { $this->assertTrue($this->group->isGroup()); } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getObjectsMustReturnEmptyArrayOfParsedObject(): void + public function testGetObjectsMustReturnEmptyArrayOfParsedObject(): void { $this->assertTrue([] === $this->group->getObjects()); } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function addObjectMustAddObjectToObjects(): void + public function testAddObjectMustAddObjectToObjects(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_object = $xml_properties->xpath('//object'); Assert::assertNotFalse($xml_object); @@ -82,11 +73,9 @@ public function addObjectMustAddObjectToObjects(): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getNameMustReturnCertainString(): void + public function testGetNameMustReturnCertainString(): void { $expected = 'TestGroup'; $actual = $this->group->getName(); diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectTest.php index 6c118ddef3..d5bea19ada 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectTest.php @@ -5,8 +5,9 @@ use App\Project\CatrobatCode\Parser\ParsedObject; use App\Project\CatrobatCode\Parser\ParsedObjectAsset; use App\Project\CatrobatCode\Parser\Scripts\Script; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -20,24 +21,20 @@ class ParsedObjectTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_object = $xml_properties->xpath('//object'); Assert::assertNotFalse($xml_object); $this->object = new ParsedObject($xml_object[0]); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->object, $method_name)); } - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getName'], @@ -49,21 +46,17 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function isGroupMustReturnFalse(): void + public function testIsGroupMustReturnFalse(): void { $this->assertFalse($this->object->isGroup()); } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getLooksMustReturnArrayOfParsedObjectAsset(): void + public function testGetLooksMustReturnArrayOfParsedObjectAsset(): void { $expected = ParsedObjectAsset::class; @@ -73,21 +66,17 @@ public function getLooksMustReturnArrayOfParsedObjectAsset(): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getSoundsMustReturnEmptyArrayOfParsedObjectAsset(): void + public function testGetSoundsMustReturnEmptyArrayOfParsedObjectAsset(): void { $this->assertTrue([] === $this->object->getSounds()); } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getScriptsMustReturnArrayOfScript(): void + public function testGetScriptsMustReturnArrayOfScript(): void { $expected = Script::class; @@ -97,11 +86,9 @@ public function getScriptsMustReturnArrayOfScript(): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getNameMustReturnCertainString(): void + public function testGetNameMustReturnCertainString(): void { $expected = 'Background'; $actual = $this->object->getName(); diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectsContainerTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectsContainerTest.php index 9da55a93a6..ff40a65c15 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectsContainerTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedObjectsContainerTest.php @@ -5,8 +5,9 @@ use App\Project\CatrobatCode\Parser\ParsedObject; use App\Project\CatrobatCode\Parser\ParsedObjectGroup; use App\Project\CatrobatCode\Parser\ParsedScene; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -20,19 +21,15 @@ class ParsedObjectsContainerTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_scene = $xml_properties->xpath('//scene'); Assert::assertNotFalse($xml_scene); $this->container = new ParsedScene($xml_scene[0]); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->container, $method_name)); } @@ -40,7 +37,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getObjects'], @@ -49,11 +46,9 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getBackgroundMustReturnParsedObject(): void + public function testGetBackgroundMustReturnParsedObject(): void { $actual = $this->container->getBackground(); $expected = ParsedObject::class; @@ -62,11 +57,9 @@ public function getBackgroundMustReturnParsedObject(): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getObjectsMustReturnArrayOfParsedObjectOrParsedObjectGroup(): void + public function testGetObjectsMustReturnArrayOfParsedObjectOrParsedObjectGroup(): void { $expected = [ ParsedObject::class, @@ -82,16 +75,14 @@ public function getObjectsMustReturnArrayOfParsedObjectOrParsedObjectGroup(): vo } /** - * @test - * * @throws \Exception */ - public function mustThrowExceptionIfCorruptedGroup(): void + public function testMustThrowExceptionIfCorruptedGroup(): void { $this->expectExceptionMessage(\Exception::class); $xml_properties = simplexml_load_file( - RefreshTestEnvHook::$FIXTURES_DIR.'FaultyPrograms/CorruptedGroupFaultyProgram/code.xml' + BootstrapExtension::$FIXTURES_DIR.'FaultyPrograms/CorruptedGroupFaultyProgram/code.xml' ); Assert::assertNotFalse($xml_properties); diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php index 7fef6b2cc7..4c88427a29 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php @@ -5,8 +5,9 @@ use App\Project\CatrobatCode\Parser\CodeStatistic; use App\Project\CatrobatCode\Parser\ParsedScene; use App\Project\CatrobatCode\Parser\ParsedSceneProgram; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -20,17 +21,13 @@ class ParsedSceneProgramTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SceneProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/code.xml'); Assert::assertNotFalse($xml_properties); $this->program = new ParsedSceneProgram($xml_properties); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->program, $method_name)); } @@ -38,7 +35,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['hasScenes'], @@ -48,21 +45,17 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function hasScenesMustReturnTrue(): void + public function testHasScenesMustReturnTrue(): void { $this->assertTrue($this->program->hasScenes()); } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getCodeStatisticMustReturnCodeStatistic(): void + public function testGetCodeStatisticMustReturnCodeStatistic(): void { $actual = $this->program->getCodeStatistic(); $expected = CodeStatistic::class; @@ -71,11 +64,9 @@ public function getCodeStatisticMustReturnCodeStatistic(): void } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getScenesMustReturnArrayOfScenes(): void + public function testGetScenesMustReturnArrayOfScenes(): void { $expected = ParsedScene::class; diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneTest.php index 31b00ae07a..545a5b24af 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneTest.php @@ -3,8 +3,9 @@ namespace Tests\PhpUnit\Project\CatrobatCode\Parser; use App\Project\CatrobatCode\Parser\ParsedScene; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -18,19 +19,15 @@ class ParsedSceneTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SceneProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_scene = $xml_properties->xpath('//scene'); Assert::assertNotFalse($xml_scene); $this->scene = new ParsedScene($xml_scene[0]); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->scene, $method_name)); } @@ -38,7 +35,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getName'], @@ -46,11 +43,9 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getNameMustReturnCertainString(): void + public function testGetNameMustReturnCertainString(): void { $expected = 'Scene 1'; $actual = $this->scene->getName(); diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php index d84ee32c33..8f3125261b 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php @@ -4,8 +4,9 @@ use App\Project\CatrobatCode\Parser\CodeStatistic; use App\Project\CatrobatCode\Parser\ParsedSimpleProgram; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -19,17 +20,13 @@ class ParsedSimpleProgramTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/code.xml'); Assert::assertNotFalse($xml_properties); $this->program = new ParsedSimpleProgram($xml_properties); } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { $this->assertTrue(method_exists($this->program, $method_name)); } @@ -37,7 +34,7 @@ public function mustHaveMethod(mixed $method_name): void /** * @return string[][] */ - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['hasScenes'], @@ -46,21 +43,17 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function hasScenesMustReturnFalse(): void + public function testHasScenesMustReturnFalse(): void { $this->assertFalse($this->program->hasScenes()); } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function getCodeStatisticMustReturnCodeStatistic(): void + public function testGetCodeStatisticMustReturnCodeStatistic(): void { $actual = $this->program->getCodeStatistic(); $expected = CodeStatistic::class; diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ScriptsTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ScriptsTest.php index 8c66abf0d4..faea437219 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ScriptsTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ScriptsTest.php @@ -5,8 +5,9 @@ use App\Project\CatrobatCode\Parser\Constants; use App\Project\CatrobatCode\Parser\Scripts\Script; use App\Project\CatrobatCode\Parser\Scripts\ScriptFactory; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -36,19 +37,15 @@ class ScriptsTest extends TestCase protected function setUp(): void { - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_script = $xml_properties->xpath('//script'); Assert::assertNotFalse($xml_script); $this->script_xml_properties_list = $xml_script; } - /** - * @test - * - * @dataProvider provideMethodNames - */ - public function mustHaveMethod(mixed $method_name): void + #[DataProvider('provideMethodNames')] + public function testMustHaveMethod(mixed $method_name): void { foreach ($this->script_xml_properties_list as $script_xml_properties) { $script = ScriptFactory::generate($script_xml_properties); @@ -56,7 +53,7 @@ public function mustHaveMethod(mixed $method_name): void } } - public function provideMethodNames(): array + public static function provideMethodNames(): array { return [ ['getType'], @@ -67,13 +64,10 @@ public function provideMethodNames(): array } /** - * @test - * - * @depends mustHaveMethod - * - * @dataProvider provideScriptXMLProperties + * @depends testMustHaveMethod */ - public function factoryMustGenerateValidScript(mixed $script_xml_properties, mixed $expected): void + #[DataProvider('provideScriptXMLProperties')] + public function testFactoryMustGenerateValidScript(mixed $script_xml_properties, mixed $expected): void { $actual = ScriptFactory::generate($script_xml_properties); @@ -87,17 +81,17 @@ public function factoryMustGenerateValidScript(mixed $script_xml_properties, mix /** * @return mixed[][] */ - public function provideScriptXMLProperties(): array + public static function provideScriptXMLProperties(): array { $data = []; $reference_output = - file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/script_reference.output', FILE_IGNORE_NEW_LINES); + file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/script_reference.output', FILE_IGNORE_NEW_LINES); Assert::assertNotFalse($reference_output); $reference_output_index = 0; - $xml_properties = simplexml_load_file(RefreshTestEnvHook::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); + $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/code.xml'); Assert::assertNotFalse($xml_properties); $xml_script = $xml_properties->xpath('//script'); @@ -122,11 +116,9 @@ public function provideScriptXMLProperties(): array } /** - * @test - * - * @depends mustHaveMethod + * @depends testMustHaveMethod */ - public function factoryMustGenerateUnknownScriptOtherwise(): ?Script + public function testFactoryMustGenerateUnknownScriptOtherwise(): ?Script { $script_xml_properties = $this->script_xml_properties_list[0]; // @phpstan-ignore-next-line @@ -147,11 +139,11 @@ public function factoryMustGenerateUnknownScriptOtherwise(): ?Script } /** - * @test + * @depends testMustHaveMethod * - * @depends mustHaveMethod + * @psalm-suppress UndefinedPropertyAssignment */ - public function outCommentedScriptsMustContainOnlyGrayBricks(): void + public function testOutCommentedScriptsMustContainOnlyGrayBricks(): void { $script_xml_properties = $this->script_xml_properties_list[0]; $script_xml_properties->commentedOut = 'true'; // Fake out-commented script diff --git a/tests/PhpUnit/Project/CatrobatFile/CatrobatFileCompressorTest.php b/tests/PhpUnit/Project/CatrobatFile/CatrobatFileCompressorTest.php index c6132579e9..536c4e74b3 100644 --- a/tests/PhpUnit/Project/CatrobatFile/CatrobatFileCompressorTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/CatrobatFileCompressorTest.php @@ -3,7 +3,7 @@ namespace Tests\PhpUnit\Project\CatrobatFile; use App\Project\CatrobatFile\CatrobatFileCompressor; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; @@ -30,15 +30,15 @@ public function testInitialization(): void public function testThrowsAnExceptionIfGivenAnInvalidCompressDirectory(): void { $this->expectException(\Exception::class); - $this->catrobat_file_compressor->compress(__DIR__.'/invalid_directory/', RefreshTestEnvHook::$CACHE_DIR.'base/', 'archivename'); + $this->catrobat_file_compressor->compress(__DIR__.'/invalid_directory/', BootstrapExtension::$CACHE_DIR.'base/', 'archivename'); } public function testCompressAValidDirectory(): void { $filesystem = new Filesystem(); - $path_to_file = RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base'; - $filesystem->mirror($path_to_file, RefreshTestEnvHook::$CACHE_DIR.'base/'); - $this->catrobat_file_compressor->compress(RefreshTestEnvHook::$CACHE_DIR.'base/', RefreshTestEnvHook::$CACHE_DIR, 'base'); - Assert::assertTrue(is_file(RefreshTestEnvHook::$CACHE_DIR.'base.catrobat')); + $path_to_file = BootstrapExtension::$GENERATED_FIXTURES_DIR.'base'; + $filesystem->mirror($path_to_file, BootstrapExtension::$CACHE_DIR.'base/'); + $this->catrobat_file_compressor->compress(BootstrapExtension::$CACHE_DIR.'base/', BootstrapExtension::$CACHE_DIR, 'base'); + Assert::assertTrue(is_file(BootstrapExtension::$CACHE_DIR.'base.catrobat')); } } diff --git a/tests/PhpUnit/Project/CatrobatFile/CatrobatFileExtractorTest.php b/tests/PhpUnit/Project/CatrobatFile/CatrobatFileExtractorTest.php index 1b5c393615..bf75f6d55c 100644 --- a/tests/PhpUnit/Project/CatrobatFile/CatrobatFileExtractorTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/CatrobatFileExtractorTest.php @@ -5,7 +5,7 @@ use App\Project\CatrobatFile\CatrobatFileExtractor; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\InvalidCatrobatFileException; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\File\File; @@ -20,7 +20,7 @@ class CatrobatFileExtractorTest extends TestCase protected function setUp(): void { - $this->catrobat_file_extractor = new CatrobatFileExtractor(RefreshTestEnvHook::$CACHE_DIR, '/webpath'); + $this->catrobat_file_extractor = new CatrobatFileExtractor(BootstrapExtension::$CACHE_DIR, '/webpath'); } public function testInitialization(): void @@ -39,7 +39,7 @@ public function testThrowsAnExceptionIfGivenAnValidExtractionDirectory(): void */ public function testExtractsAValidFile(): void { - $valid_catrobat_file = new File(RefreshTestEnvHook::$FIXTURES_DIR.'/test.catrobat'); + $valid_catrobat_file = new File(BootstrapExtension::$FIXTURES_DIR.'/test.catrobat'); $extracted_file = $this->catrobat_file_extractor->extract($valid_catrobat_file); $this->assertInstanceOf(ExtractedCatrobatFile::class, $extracted_file); } @@ -49,7 +49,7 @@ public function testExtractsAValidFile(): void */ public function testThrowsAnExceptionWhileExtractingAnInvalidFile(): void { - $invalid_catrobat_file = new File(RefreshTestEnvHook::$FIXTURES_DIR.'/invalid_archive.catrobat'); + $invalid_catrobat_file = new File(BootstrapExtension::$FIXTURES_DIR.'/invalid_archive.catrobat'); $this->expectException(InvalidCatrobatFileException::class); $this->catrobat_file_extractor->extract($invalid_catrobat_file); } diff --git a/tests/PhpUnit/Project/CatrobatFile/CodeExtractorTest.php b/tests/PhpUnit/Project/CatrobatFile/CodeExtractorTest.php index a184926cf7..1bf5da92ee 100644 --- a/tests/PhpUnit/Project/CatrobatFile/CodeExtractorTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/CodeExtractorTest.php @@ -14,58 +14,37 @@ */ class CodeExtractorTest extends TestCase { - /** - * @test - */ - public function xmlWithIfAndCondition(): void + public function testXmlWithIfAndCondition(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/ifWithCondition/'); } - /** - * @test - */ - public function xmlWithFormula(): void + public function testXmlWithFormula(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/formula/'); } - /** - * @test - */ - public function xmlWithIf(): void + public function testXmlWithIf(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/if/'); } - /** - * @test - */ - public function xmlWithLoop(): void + public function testXmlWithLoop(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/loop/'); } - /** - * @test - */ - public function xmlWithAllBricks(): void + public function testXmlWithAllBricks(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/allBricks/'); } - /** - * @test - */ - public function xmlWithNestedFormula(): void + public function testXmlWithNestedFormula(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/nestedFormula/'); } - /** - * @test - */ - public function xmlWithNestedObjects(): void + public function testXmlWithNestedObjects(): void { $this->checkFiles('tests/TestData/DataFixtures/CodeXmls/nestedObjects/'); } diff --git a/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php b/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php index c0ebca9465..30e9e87195 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php @@ -6,7 +6,7 @@ use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\InvalidCatrobatFileException; use App\Project\Remix\RemixData; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; @@ -22,7 +22,7 @@ class ExtractedCatrobatFileTest extends TestCase protected function setUp(): void { - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', '/webpath', 'hash'); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', '/webpath', 'hash'); } public function testInitialization(): void @@ -47,12 +47,14 @@ public function testGetsTheProgramCreditsFromXml(): void /** * @throws \Exception + * + * @psalm-suppress InvalidPropertyFetch */ public function testSetsTheProgramName(): void { - $target_dir = RefreshTestEnvHook::$CACHE_DIR.'base/'; + $target_dir = BootstrapExtension::$CACHE_DIR.'base/'; $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', $target_dir); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', $target_dir); $new_name = 'new_name'; @@ -60,19 +62,21 @@ public function testSetsTheProgramName(): void $this->extracted_catrobat_file->setName($new_name); $this->extracted_catrobat_file->saveProgramXmlProperties(); - $content = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $content = file_get_contents(BootstrapExtension::$CACHE_DIR.'base/code.xml'); $xml = @simplexml_load_string($content); $this->assertSame($new_name, (string) $xml->header->programName); } /** * @throws \Exception + * + * @psalm-suppress InvalidPropertyFetch */ public function testSetsTheProgramDescription(): void { - $target_dir = RefreshTestEnvHook::$CACHE_DIR.'base/'; + $target_dir = BootstrapExtension::$CACHE_DIR.'base/'; $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', $target_dir); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', $target_dir); $new_description = 'new_description'; @@ -80,19 +84,21 @@ public function testSetsTheProgramDescription(): void $this->extracted_catrobat_file->setDescription($new_description); $this->extracted_catrobat_file->saveProgramXmlProperties(); - $content = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $content = file_get_contents(BootstrapExtension::$CACHE_DIR.'base/code.xml'); $xml = @simplexml_load_string($content); $this->assertSame($new_description, (string) $xml->header->description); } /** * @throws \Exception + * + * @psalm-suppress InvalidPropertyFetch */ public function testSetsTheProgramCredits(): void { - $target_dir = RefreshTestEnvHook::$CACHE_DIR.'base/'; + $target_dir = BootstrapExtension::$CACHE_DIR.'base/'; $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', $target_dir); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', $target_dir); $new_credits = 'new_credits'; @@ -100,7 +106,7 @@ public function testSetsTheProgramCredits(): void $this->extracted_catrobat_file->setNotesAndCredits($new_credits); $this->extracted_catrobat_file->saveProgramXmlProperties(); - $content = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $content = file_get_contents(BootstrapExtension::$CACHE_DIR.'base/code.xml'); $xml = @simplexml_load_string($content); $this->assertSame($new_credits, (string) $xml->header->notesAndCredits); } @@ -150,6 +156,9 @@ public function testGetsRelativeAndAbsoluteRemixUrls(): void */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testCanExtractSimpleCatrobatAbsoluteRemixUrl(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -159,17 +168,11 @@ public function testCanExtractSimpleCatrobatAbsoluteRemixUrl(): void $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(1, $urls, [$first_expected_url], ['1234'], [false], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('1234', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testNotExtractNumberFromNormalText(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -180,6 +183,9 @@ public function testNotExtractNumberFromNormalText(): void $this->assertCount(0, $urls); } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testCanExtractSimpleScratchAbsoluteRemixUrl(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -189,17 +195,11 @@ public function testCanExtractSimpleScratchAbsoluteRemixUrl(): void $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(1, $urls, [$first_expected_url], ['117697631'], [true], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('117697631', $urls[0]->getProgramId()); - $this->assertTrue($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testCanExtractSimpleRelativeCatrobatRemixUrl(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -209,17 +209,11 @@ public function testCanExtractSimpleRelativeCatrobatRemixUrl(): void $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(1, $urls, [$first_expected_url], ['3570'], [false], [false]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('3570', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertFalse($urls[0]->isAbsoluteUrl()); - */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testCanExtractMergedProgramRemixUrls(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -227,27 +221,16 @@ public function testCanExtractMergedProgramRemixUrls(): void $second_expected_url = 'http://pocketcode.org/details/3570/'; $new_program_id = '3571'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url.'], The Periodic Table 2 ['.$second_expected_url.']]'; + /* @psalm-suppress UndefinedPropertyAssignment */ $this->extracted_catrobat_file->getProgramXmlProperties()->header->url = $remixes_string; $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(2, $urls, [$first_expected_url, $second_expected_url], ['1234', '3570'], [false, false], [true, true]); - - /* - $this->assertCount(2, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('1234', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - * - $this->assertInstanceOf(RemixData::class, $urls[1]); - $this->assertSame($second_expected_url, $urls[1]->getUrl()); - $this->assertSame('3570', $urls[1]->getProgramId()); - $this->assertFalse($urls[1]->isScratchProgram()); - $this->assertTrue($urls[1]->isAbsoluteUrl()); - */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testExtractUniqueProgramRemixUrls(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -259,17 +242,11 @@ public function testExtractUniqueProgramRemixUrls(): void $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(1, $urls, [$first_expected_url, $second_expected_url], ['1234'], [false], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('1234', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testDontExtractProgramRemixUrlsReferencingToCurrentProgram(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -281,17 +258,11 @@ public function testDontExtractProgramRemixUrlsReferencingToCurrentProgram(): vo $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(1, $urls, [$second_expected_url], ['790'], [false], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($second_expected_url, $urls[0]->getUrl()); - $this->assertSame('790', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testExtractOnlyOlderProgramRemixUrls(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -303,17 +274,11 @@ public function testExtractOnlyOlderProgramRemixUrls(): void $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); $this->assertions(1, $urls, [$second_expected_url], ['790'], [false], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($second_expected_url, $urls[0]->getUrl()); - $this->assertSame('790', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testCanExtractDoubleMergedProgramRemixUrls(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -329,29 +294,11 @@ public function testCanExtractDoubleMergedProgramRemixUrls(): void $this->assertions(3, $urls, [$first_expected_url, $second_expected_url, $third_expected_url], ['1234', '3570', '121648946'], [false, false, true], [true, true, true]); - - /* - $this->assertCount(3, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('1234', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[1]); - $this->assertSame($second_expected_url, $urls[1]->getUrl()); - $this->assertSame('3570', $urls[1]->getProgramId()); - $this->assertFalse($urls[1]->isScratchProgram()); - $this->assertTrue($urls[1]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[2]); - $this->assertSame($third_expected_url, $urls[2]->getUrl()); - $this->assertSame('121648946', $urls[2]->getProgramId()); - $this->assertTrue($urls[2]->isScratchProgram()); - $this->assertTrue($urls[2]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testExtractUniqueProgramRemixUrlsOfDoubleMergedProgram(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -367,23 +314,11 @@ public function testExtractUniqueProgramRemixUrlsOfDoubleMergedProgram(): void $this->assertions(2, $urls, [$first_expected_url, $second_expected_url], ['1234', '121648946'], [false, true], [true, true]); - - /* - $this->assertCount(2, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('1234', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[1]); - $this->assertSame($second_expected_url, $urls[1]->getUrl()); - $this->assertSame('121648946', $urls[1]->getProgramId()); - $this->assertTrue($urls[1]->isScratchProgram()); - $this->assertTrue($urls[1]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testDontExtractProgramRemixUrlsReferencingToCurrentDoubleMergedProgram(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -399,17 +334,11 @@ public function testDontExtractProgramRemixUrlsReferencingToCurrentDoubleMergedP $this->assertions(1, $urls, [$first_expected_url], ['1234'], [false], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('1234', $urls[0]->getProgramId()); - $this->assertFalse($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testCanExtractMultipleMergedRemixUrls(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -426,35 +355,11 @@ public function testCanExtractMultipleMergedRemixUrls(): void $this->assertions(4, $urls, [$first_expected_url, $second_expected_url, $third_expected_url, $fourth_expected_url], ['117697631', '3570', '121648946', '16267'], [true, false, true, false], [true, false, true, true]); - - /* - $this->assertCount(4, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('117697631', $urls[0]->getProgramId()); - $this->assertTrue($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[1]); - $this->assertSame($second_expected_url, $urls[1]->getUrl()); - $this->assertSame('3570', $urls[1]->getProgramId()); - $this->assertFalse($urls[1]->isScratchProgram()); - $this->assertFalse($urls[1]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[2]); - $this->assertSame($third_expected_url, $urls[2]->getUrl()); - $this->assertSame('121648946', $urls[2]->getProgramId()); - $this->assertTrue($urls[2]->isScratchProgram()); - $this->assertTrue($urls[2]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[3]); - $this->assertSame($fourth_expected_url, $urls[3]->getUrl()); - $this->assertSame('16267', $urls[3]->getProgramId()); - $this->assertFalse($urls[3]->isScratchProgram()); - $this->assertTrue($urls[3]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testExtractUniqueProgramRemixUrlsOfMultipleMergedProgram(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -471,23 +376,11 @@ public function testExtractUniqueProgramRemixUrlsOfMultipleMergedProgram(): void $this->assertions(2, $urls, [$first_expected_url, $second_expected_url], ['117697631', '16267'], [true, false], [true, false]); - - /* - $this->assertCount(2, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('117697631', $urls[0]->getProgramId()); - $this->assertTrue($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[1]); - $this->assertSame($second_expected_url, $urls[1]->getUrl()); - $this->assertSame('16267', $urls[1]->getProgramId()); - $this->assertFalse($urls[1]->isScratchProgram()); - $this->assertFalse($urls[1]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testExtractOnlyOlderProgramRemixUrlsOfMultipleMergedProgramIfItIsAnInitialVersion(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -504,17 +397,11 @@ public function testExtractOnlyOlderProgramRemixUrlsOfMultipleMergedProgramIfItI $this->assertions(1, $urls, [$first_expected_url], ['117697631'], [true], [true]); - - /* - $this->assertCount(1, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('117697631', $urls[0]->getProgramId()); - $this->assertTrue($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - * */ } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testExtractOlderProgramRemixUrlsOfMultipleMergedProgramIfItIsNotAnInitialVersion(): void { $program_repository = $this->createMock(ProgramRepository::class); @@ -531,26 +418,11 @@ public function testExtractOlderProgramRemixUrlsOfMultipleMergedProgramIfItIsNot $this->assertions(2, $urls, [$first_expected_url, $fourth_expected_url], ['117697631', '16268'], [true, false], [true, true]); - - /* - $this->assertCount(2, $urls); - $this->assertInstanceOf(RemixData::class, $urls[0]); - $this->assertSame($first_expected_url, $urls[0]->getUrl()); - $this->assertSame('117697631', $urls[0]->getProgramId()); - $this->assertTrue($urls[0]->isScratchProgram()); - $this->assertTrue($urls[0]->isAbsoluteUrl()); - - $this->assertInstanceOf(RemixData::class, $urls[1]); - $this->assertSame($fourth_expected_url, $urls[1]->getUrl()); - $this->assertSame('16268', $urls[1]->getProgramId()); - $this->assertFalse($urls[1]->isScratchProgram()); - $this->assertTrue($urls[1]->isAbsoluteUrl()); - */ } public function testReturnsThePathOfTheBaseDirectory(): void { - $this->assertSame(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', $this->extracted_catrobat_file->getPath()); + $this->assertSame(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', $this->extracted_catrobat_file->getPath()); } public function testReturnsTheXmlProperties(): void @@ -560,53 +432,53 @@ public function testReturnsTheXmlProperties(): void public function testReturnsThePathOfTheAutomaticScreenshot(): void { - $this->assertSame(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png', $this->extracted_catrobat_file->getScreenshotPath()); + $this->assertSame(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png', $this->extracted_catrobat_file->getScreenshotPath()); } public function testReturnsThePathOfTheManualScreenshot(): void { - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_manual_screenshot/', '/webpath', 'hash'); - $this->assertSame(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_manual_screenshot/manual_screenshot.png', $this->extracted_catrobat_file->getScreenshotPath()); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_manual_screenshot/', '/webpath', 'hash'); + $this->assertSame(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_manual_screenshot/manual_screenshot.png', $this->extracted_catrobat_file->getScreenshotPath()); } public function testReturnsThePathOfTheScreenshot(): void { - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_screenshot/', '/webpath', 'hash'); - $this->assertSame(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_screenshot/screenshot.png', $this->extracted_catrobat_file->getScreenshotPath()); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_screenshot/', '/webpath', 'hash'); + $this->assertSame(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_screenshot/screenshot.png', $this->extracted_catrobat_file->getScreenshotPath()); } public function testThrowsAnExceptionWhenCodeXmlIsMissing(): void { $this->expectException(InvalidCatrobatFileException::class); - $this->extracted_catrobat_file->__construct(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_missing_code_xml/', '', ''); + $this->extracted_catrobat_file->__construct(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_missing_code_xml/', '', ''); } public function testThrowsAnExceptionWhenCodeXmlIsInvalid(): void { $this->expectException(InvalidCatrobatFileException::class); - $this->extracted_catrobat_file->__construct(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_invalid_code_xml/', '', ''); + $this->extracted_catrobat_file->__construct(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_invalid_code_xml/', '', ''); } public function testIgnoresAnInvalid0XmlChar(): void { - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'program_with_0_xmlchar/', '/webpath', 'hash'); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'program_with_0_xmlchar/', '/webpath', 'hash'); $this->assertInstanceOf(\SimpleXMLElement::class, $this->extracted_catrobat_file->getProgramXmlProperties()); } public function testPreservesInvalid0XmlCharFromCollisionsWithOtherActors(): void { $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$FIXTURES_DIR.'program_with_0_xmlchar/', RefreshTestEnvHook::$CACHE_DIR.'program_with_0_xmlchar/'); + $filesystem->mirror(BootstrapExtension::$FIXTURES_DIR.'program_with_0_xmlchar/', BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/'); - $base_xml_string = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'program_with_0_xmlchar/code.xml'); + $base_xml_string = file_get_contents(BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/code.xml'); $count = substr_count($base_xml_string, 'cupcake2<�-�>cupcake4'); Assert::assertEquals($count, 1); - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'/program_with_0_xmlchar/', '/webpath', 'hash'); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/', '/webpath', 'hash'); $this->assertInstanceOf(\SimpleXMLElement::class, $this->extracted_catrobat_file->getProgramXmlProperties()); $this->extracted_catrobat_file->saveProgramXmlProperties(); - $base_xml_string = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'/program_with_0_xmlchar/code.xml'); + $base_xml_string = file_get_contents(BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/code.xml'); $count = substr_count($base_xml_string, 'cupcake2<�-�>cupcake4'); Assert::assertEquals($count, 1); } @@ -614,30 +486,33 @@ public function testPreservesInvalid0XmlCharFromCollisionsWithOtherActors(): voi public function testPreservesInvalid0XmlCharFromCollisionsWithAnything(): void { $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$FIXTURES_DIR.'/program_with_0_xmlchar/', RefreshTestEnvHook::$CACHE_DIR.'/program_with_0_xmlchar/'); + $filesystem->mirror(BootstrapExtension::$FIXTURES_DIR.'/program_with_0_xmlchar/', BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/'); - $base_xml_string = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'/program_with_0_xmlchar/code.xml'); + $base_xml_string = file_get_contents(BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/code.xml'); $count = substr_count($base_xml_string, 'cupcake4<�-�>�ANYTHING�'); Assert::assertEquals($count, 1); - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'/program_with_0_xmlchar/', '/webpath', 'hash'); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/', '/webpath', 'hash'); $this->assertInstanceOf(\SimpleXMLElement::class, $this->extracted_catrobat_file->getProgramXmlProperties()); $this->extracted_catrobat_file->saveProgramXmlProperties(); - $base_xml_string = file_get_contents(RefreshTestEnvHook::$CACHE_DIR.'/program_with_0_xmlchar/code.xml'); + $base_xml_string = file_get_contents(BootstrapExtension::$CACHE_DIR.'program_with_0_xmlchar/code.xml'); $count = substr_count($base_xml_string, 'cupcake4<�-�>�ANYTHING�'); Assert::assertEquals($count, 1); } public function testIOSXMLVersionWorksWithCurrentRegex(): void { - $this->extracted_catrobat_file = new ExtractedCatrobatFile(RefreshTestEnvHook::$FIXTURES_DIR.'program_with_old_XML/', '/webpath', 'hash'); + $this->extracted_catrobat_file = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'program_with_old_XML/', '/webpath', 'hash'); Assert::assertTrue($this->extracted_catrobat_file->isFileMentionedInXml('1f363a1435a9497852285dbfa82b74e4_Background.png')); Assert::assertTrue($this->extracted_catrobat_file->isFileMentionedInXml('4728a2ce6b682ac056b8f8185353108d_Moving Mole.png')); Assert::assertTrue($this->extracted_catrobat_file->isFileMentionedInXml('1fb4ecf442b988ad20279d95acaf608e_Whacked Mole.png')); Assert::assertTrue($this->extracted_catrobat_file->isFileMentionedInXml('0370b09e8cd2cd025397a47e24b129d5_Hit2.m4a')); } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ private function assertions(int $expectedCount, array $urls, array $expectedURLs, array $expectedProgramIds, array $scratch, array $absolutePaths): void { $this->assertCount($expectedCount, $urls); diff --git a/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php index 966a9536f4..4338ee640e 100644 --- a/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php @@ -4,7 +4,8 @@ use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\LicenseUpdaterEventSubscriber; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\Storage\FileHelper; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; @@ -23,6 +24,11 @@ protected function setUp(): void $this->license_updater = new LicenseUpdaterEventSubscriber(); } + public function tearDown(): void + { + FileHelper::emptyDirectory(BootstrapExtension::$CACHE_DIR); + } + public function testInitialization(): void { $this->assertInstanceOf(LicenseUpdaterEventSubscriber::class, $this->license_updater); @@ -31,29 +37,32 @@ public function testInitialization(): void public function testSetsMediaLicense(): void { $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base', RefreshTestEnvHook::$CACHE_DIR.'base'); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base', BootstrapExtension::$CACHE_DIR.'base'); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->mediaLicense, ''); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->license_updater->update($file); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'/base/code.xml'); - + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->mediaLicense, 'https://developer.catrobat.org/ccbysa_v4'); } public function testSetsProgramLicense(): void { $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base', RefreshTestEnvHook::$CACHE_DIR.'base'); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base', BootstrapExtension::$CACHE_DIR.'base'); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->programLicense, ''); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'/base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->license_updater->update($file); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->programLicense, 'https://developer.catrobat.org/agpl_v3'); } } diff --git a/tests/PhpUnit/Project/CatrobatFile/ProgramFileRepositoryTest.php b/tests/PhpUnit/Project/CatrobatFile/ProgramFileRepositoryTest.php index 9d3011074c..882d06b3ac 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ProgramFileRepositoryTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ProgramFileRepositoryTest.php @@ -6,7 +6,7 @@ use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\ProgramFileRepository; use App\Storage\FileHelper; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; @@ -28,8 +28,8 @@ class ProgramFileRepositoryTest extends TestCase protected function setUp(): void { - $this->storage_dir = RefreshTestEnvHook::$CACHE_DIR.'zip/'; - $this->extract_dir = RefreshTestEnvHook::$CACHE_DIR.'extract/'; + $this->storage_dir = BootstrapExtension::$CACHE_DIR.'zip/'; + $this->extract_dir = BootstrapExtension::$CACHE_DIR.'extract/'; $filesystem = new Filesystem(); $filesystem->mkdir($this->storage_dir); $filesystem->mkdir($this->extract_dir); @@ -63,7 +63,7 @@ public function testThrowsAnExceptionIfDirectoryIsNotFound2(): void public function testStoresAFileToTheGivenDirectory(): void { - $file_name = RefreshTestEnvHook::$FIXTURES_DIR.'test.catrobat'; + $file_name = BootstrapExtension::$FIXTURES_DIR.'test.catrobat'; $id = 'test'; $file = new File($file_name); @@ -75,7 +75,7 @@ public function testStoresAFileToTheGivenDirectory(): void public function testSavesAGivenProgramDirectory(): void { - $extracted_program = new ExtractedCatrobatFile(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', '/webpath', 'hash'); + $extracted_program = new ExtractedCatrobatFile(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', '/webpath', 'hash'); $id = 'test'; $this->program_file_repository->zipProject($extracted_program->getPath(), $id); @@ -86,7 +86,7 @@ public function testSavesAGivenProgramDirectory(): void public function testReturnsTheFile(): void { - $file_name = RefreshTestEnvHook::$FIXTURES_DIR.'test.catrobat'; + $file_name = BootstrapExtension::$FIXTURES_DIR.'test.catrobat'; $id = 'test'; $file = new File($file_name); diff --git a/tests/PhpUnit/Project/CatrobatFile/ProgramXmlHeaderValidatorEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/ProgramXmlHeaderValidatorEventSubscriberTest.php index 519091af8e..3f8c8f7844 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ProgramXmlHeaderValidatorEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ProgramXmlHeaderValidatorEventSubscriberTest.php @@ -5,7 +5,7 @@ use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\InvalidCatrobatFileException; use App\Project\CatrobatFile\ProgramXmlHeaderValidatorEventSubscriber; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\TestCase; /** @@ -30,7 +30,8 @@ public function testInitialization(): void public function testChecksIfTheProgramXmlHeaderIsValid(): void { $file = $this->createMock(ExtractedCatrobatFile::class); - $xml = simplexml_load_file(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $file->expects($this->atLeastOnce())->method('getProgramXmlProperties')->willReturn($xml); $this->program_xml_header_validator->validate($file); } @@ -38,7 +39,8 @@ public function testChecksIfTheProgramXmlHeaderIsValid(): void public function testThrowsAnExceptionIfHeaderIsMissing(): void { $file = $this->createMock(ExtractedCatrobatFile::class); - $xml = simplexml_load_file(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); unset($xml->header); $file->expects($this->atLeastOnce())->method('getProgramXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); @@ -48,7 +50,8 @@ public function testThrowsAnExceptionIfHeaderIsMissing(): void public function testThrowsAnExceptionIfHeaderInformationIsMissing(): void { $file = $this->createMock(ExtractedCatrobatFile::class); - $xml = simplexml_load_file(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); unset($xml->header->applicationName); $file->expects($this->atLeastOnce())->method('getProgramXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); @@ -58,7 +61,8 @@ public function testThrowsAnExceptionIfHeaderInformationIsMissing(): void public function testChecksIfProgramNameIsSet(): void { $file = $this->createMock(ExtractedCatrobatFile::class); - $xml = simplexml_load_file(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'/base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'/base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); unset($xml->header->programName); $file->expects($this->atLeastOnce())->method('getProgramXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); @@ -68,7 +72,8 @@ public function testChecksIfProgramNameIsSet(): void public function testChecksIfDescriptionIsSet(): void { $file = $this->createMock(ExtractedCatrobatFile::class); - $xml = simplexml_load_file(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'/base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'/base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); unset($xml->header->description); $file->expects($this->atLeastOnce())->method('getProgramXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); diff --git a/tests/PhpUnit/Project/CatrobatFile/VersionValidatorEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/VersionValidatorEventSubscriberTest.php index 84e0a7eeb5..8f6c93647e 100644 --- a/tests/PhpUnit/Project/CatrobatFile/VersionValidatorEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/VersionValidatorEventSubscriberTest.php @@ -4,8 +4,7 @@ use App\Project\CatrobatFile\InvalidCatrobatFileException; use App\Project\CatrobatFile\VersionValidatorEventSubscriber; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; -use PHPUnit\Framework\Assert; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; @@ -21,7 +20,7 @@ class VersionValidatorEventSubscriberTest extends TestCase protected function setUp(): void { $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', RefreshTestEnvHook::$CACHE_DIR.'/base/'); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', BootstrapExtension::$CACHE_DIR.'base/'); $this->version_validator = new VersionValidatorEventSubscriber(); } @@ -30,17 +29,24 @@ public function testInitialization(): void $this->assertInstanceOf(VersionValidatorEventSubscriber::class, $this->version_validator); } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testChecksIfTheLanguageVersionIsUpToDate(): void { - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); - Assert::assertNotFalse($xml); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.92'; $this->version_validator->validate($xml); } + /** + * @psalm-suppress UndefinedPropertyAssignment + */ public function testThrowsAnExceptionIfLanguageVersionIsTooOld(): void { - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.90'; $this->expectException(InvalidCatrobatFileException::class); $this->version_validator->validate($xml); diff --git a/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php b/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php index 226736e80c..92e7c6d721 100644 --- a/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php +++ b/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php @@ -6,7 +6,8 @@ use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\Extension\ProjectExtensionManager; use App\System\Testing\PhpUnit\DefaultTestCase; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Filesystem\Filesystem; @@ -78,9 +79,8 @@ public function testAddExtensions(): void * @small * * @covers ::isAnEmbroideryProject - * - * @dataProvider dataProviderIsAnEmbroideryProject */ + #[DataProvider('provideIsAnEmbroideryProjectData')] public function testIsAnEmbroideryProject(string $code_xml, bool $expected): void { $this->assertEquals( @@ -89,7 +89,7 @@ public function testIsAnEmbroideryProject(string $code_xml, bool $expected): voi ); } - public function dataProviderIsAnEmbroideryProject(): array + public static function provideIsAnEmbroideryProjectData(): array { return [ 'invalid' => ['bla bla assertEquals( @@ -114,7 +113,7 @@ public function testIsAMindstormsProject(string $code_xml, bool $expected): void ); } - public function dataProviderIsAMindstormsProject(): array + public static function provideIsAMindstormsProjectData(): array { return [ 'invalid' => ['bla bla bla bla', false], @@ -129,9 +128,8 @@ public function dataProviderIsAMindstormsProject(): array * @small * * @covers ::isAPhiroProject - * - * @dataProvider dataProviderIsAPhiroProject */ + #[DataProvider('provideIsAPhiroProjectData')] public function testIsAPhiroProject(string $code_xml, bool $expected): void { $this->assertEquals( @@ -140,7 +138,7 @@ public function testIsAPhiroProject(string $code_xml, bool $expected): void ); } - public function dataProviderIsAPhiroProject(): array + public static function provideIsAPhiroProjectData(): array { return [ 'invalid' => ['bla bla Phiro im titel bla bla', false], @@ -151,9 +149,9 @@ public function dataProviderIsAPhiroProject(): array protected function setUpCatrobatTestFiles(): void { $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'program_with_extensions/', RefreshTestEnvHook::$CACHE_DIR.'program_with_extensions/'); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', RefreshTestEnvHook::$CACHE_DIR.'base/'); - $this->extracted_catrobat_file_without_extensions = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '', ''); - $this->extracted_catrobat_file_with_extensions = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'program_with_extensions/', '', ''); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'program_with_extensions/', BootstrapExtension::$CACHE_DIR.'program_with_extensions/'); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', BootstrapExtension::$CACHE_DIR.'base/'); + $this->extracted_catrobat_file_without_extensions = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '', ''); + $this->extracted_catrobat_file_with_extensions = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'program_with_extensions/', '', ''); } } diff --git a/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php b/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php index 86c9c06933..d4339aff1a 100644 --- a/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php +++ b/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php @@ -9,7 +9,8 @@ use App\Project\Remix\RemixManager; use App\Project\Remix\RemixUpdaterEventSubscriber; use App\Project\Scratch\AsyncHttpClient; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\Storage\FileHelper; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -56,7 +57,7 @@ protected function setUp(): void $this->remix_updater = new RemixUpdaterEventSubscriber($this->remix_manager, $this->async_http_client, $router, '.'); $filesystem = new Filesystem(); - $filesystem->mirror(RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/', RefreshTestEnvHook::$CACHE_DIR.'base/'); + $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', BootstrapExtension::$CACHE_DIR.'base/'); $user = $this->createMock(User::class); @@ -73,6 +74,11 @@ protected function setUp(): void ; } + public function tearDown(): void + { + FileHelper::removeDirectory(BootstrapExtension::$CACHE_DIR.'base/'); + } + public function testInitialization(): void { $this->assertInstanceOf(RemixUpdaterEventSubscriber::class, $this->remix_updater); @@ -84,8 +90,9 @@ public function testInitialization(): void public function testSavesTheNewUrlToXml(): void { $expected_url = 'http://share.catrob.at/details/3571'; - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity ->expects($this->atLeastOnce()) @@ -127,12 +134,15 @@ public function testSavesTheNewUrlToXml(): void $this->remix_updater->update($file, $this->program_entity); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url->__toString(), $expected_url); } /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIfCatrobatLanguageVersionIs0993(): void { @@ -142,17 +152,18 @@ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIf $expected_scratch_ids = [$first_expected_scratch_id, $second_expected_scratch_id]; $current_url = 'Scratch 1 [https://scratch.mit.edu/projects/'.$first_expected_scratch_id .'], Scratch 2 [https://scratch.mit.edu/projects/'.$second_expected_scratch_id.']'; - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.993'; $xml->header->url = $current_url; $xml->header->remixOf = ''; - $file_overwritten = $xml->asXML(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $file_overwritten = $xml->asXML(BootstrapExtension::$CACHE_DIR.'base/code.xml'); if (!$file_overwritten) { throw new \Exception("Can't overwrite code.xml file"); } - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_program_id); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $expected_scratch_info = [ @@ -193,6 +204,8 @@ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIf /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992OrLower(): void { @@ -201,17 +214,18 @@ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992Or $second_expected_scratch_id = '70058680'; $current_url = 'Scratch 1 [https://scratch.mit.edu/projects/'.$first_expected_scratch_id .'], Scratch 2 [https://scratch.mit.edu/projects/'.$second_expected_scratch_id.']'; - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.992'; $xml->header->url = $current_url; $xml->header->remixOf = ''; - $file_overwritten = $xml->asXML(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $file_overwritten = $xml->asXML(BootstrapExtension::$CACHE_DIR.'base/code.xml'); if (!$file_overwritten) { throw new \Exception("Can't overwrite code.xml file"); } - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_program_id); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->async_http_client @@ -234,6 +248,8 @@ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992Or /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function testCallFetchesOnlyDetailsOfNotYetExistingScratchPrograms(): void { @@ -244,17 +260,18 @@ public function testCallFetchesOnlyDetailsOfNotYetExistingScratchPrograms(): voi $expected_already_existing_scratch_programs = [$first_expected_scratch_id]; $current_url = 'Scratch 1 [https://scratch.mit.edu/projects/'.$first_expected_scratch_id .'], Scratch 2 [https://scratch.mit.edu/projects/'.$second_expected_scratch_id.']'; - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.993'; $xml->header->url = $current_url; $xml->header->remixOf = ''; - $file_overwritten = $xml->asXML(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $file_overwritten = $xml->asXML(BootstrapExtension::$CACHE_DIR.'base/code.xml'); if (!$file_overwritten) { throw new \Exception("Can't overwrite code.xml file"); } - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'/base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_program_id); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $expected_scratch_info = [['id' => $second_expected_scratch_id, 'creator' => ['username' => 'bubble103']]]; @@ -286,6 +303,8 @@ public function testCallFetchesOnlyDetailsOfNotYetExistingScratchPrograms(): voi /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function testCallAddRemixesMethodOfRemixManagerWithCorrectRemixesData(): void { @@ -300,15 +319,16 @@ public function testCallAddRemixesMethodOfRemixManagerWithCorrectRemixesData(): .'マックスとリンゴがあるぞ!◆自由にリミックス(改造)して、遊んでください!面白い作品ができたら、' .'こちらまで投稿を!http://www.nhk.or.jp/xxx※リミックス作品を投稿する時は”共有”を忘れないでね。', ]]; - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.993'; - $file_overwritten = $xml->asXML(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $file_overwritten = $xml->asXML(BootstrapExtension::$CACHE_DIR.'base/code.xml'); if (!$file_overwritten) { throw new \Exception("Can't overwrite code.xml file"); } - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'/base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->async_http_client @@ -367,11 +387,12 @@ public function testSavesTheOldUrlToRemixOf(): void $this->getBaseXmlWithUrl($current_url); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->remix_updater->update($file, $this->program_entity); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url, $new_url); Assert::assertEquals($xml->header->remixOf, $current_url); } @@ -387,7 +408,7 @@ public function testSavesTheScratchUrlToRemixOf(): void $this->getBaseXmlWithUrl($current_url); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->async_http_client->expects($this->atLeastOnce())->method('fetchScratchProgramDetails')->with([])->willReturn([]); @@ -400,13 +421,16 @@ public function testSavesTheScratchUrlToRemixOf(): void $this->remix_manager->expects($this->atLeastOnce())->method('addRemixes')->with($this->isInstanceOf(Program::class)); $this->remix_manager->expects($this->atLeastOnce())->method('getProgramRepository'); $this->remix_updater->update($file, $this->program_entity); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url, $new_url); Assert::assertEquals($xml->header->remixOf, $current_url); } /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ public function testSavesRemixOfMultipleScratchUrlsToRemixOf(): void { @@ -415,12 +439,13 @@ public function testSavesRemixOfMultipleScratchUrlsToRemixOf(): void $current_url = 'Scratch 1 [https://scratch.mit.edu/projects/'.$first_expected_scratch_id .'], Scratch 2 [https://scratch.mit.edu/projects/'.$second_expected_scratch_id.']'; $new_url = 'http://share.catrob.at/details/3571'; - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->catrobatLanguageVersion = '0.993'; $xml->header->url = $current_url; $xml->header->remixOf = ''; - $file_overwritten = $xml->asXML(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $file_overwritten = $xml->asXML(BootstrapExtension::$CACHE_DIR.'base/code.xml'); if (!$file_overwritten) { throw new \Exception("Can't overwrite code.xml file"); } @@ -438,12 +463,13 @@ public function testSavesRemixOfMultipleScratchUrlsToRemixOf(): void $this->remix_manager->expects($this->atLeastOnce())->method('addScratchPrograms')->with([]); $this->remix_manager->expects($this->atLeastOnce())->method('addRemixes')->with($this->isInstanceOf(Program::class)); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->remix_manager->expects($this->atLeastOnce())->method('getProgramRepository'); $this->remix_updater->update($file, $this->program_entity); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url, $new_url); Assert::assertEquals($xml->header->remixOf, $current_url); } @@ -456,24 +482,28 @@ public function testUpdateTheRemixOfOfTheEntity(): void $current_url = 'http://share.catrob.at/details/3570'; $this->getBaseXmlWithUrl($current_url); - $file = new ExtractedCatrobatFile(RefreshTestEnvHook::$CACHE_DIR.'base/', '/webpath', 'hash'); + $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->remix_updater->update($file, $this->program_entity); - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); + /* @psalm-suppress UndefinedPropertyAssignment */ Assert::assertEquals($xml->header->userHandle, 'catroweb'); } /** * @throws \Exception + * + * @psalm-suppress UndefinedPropertyAssignment */ - private function getBaseXmlWithUrl(string $url): \SimpleXMLElement|false + private function getBaseXmlWithUrl(string $url): \SimpleXMLElement { - $xml = simplexml_load_file(RefreshTestEnvHook::$CACHE_DIR.'/base/code.xml'); + $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $xml->header->url = $url; $xml->header->remixOf = ''; - - $file_overwritten = $xml->asXML(RefreshTestEnvHook::$CACHE_DIR.'base/code.xml'); + $file_overwritten = $xml->asXML(BootstrapExtension::$CACHE_DIR.'base/code.xml'); if (!$file_overwritten) { throw new \Exception("Can't overwrite code.xml file"); } diff --git a/tests/PhpUnit/Storage/ScreenshotRepositoryTest.php b/tests/PhpUnit/Storage/ScreenshotRepositoryTest.php index a03ec2cc04..be9a631bf5 100644 --- a/tests/PhpUnit/Storage/ScreenshotRepositoryTest.php +++ b/tests/PhpUnit/Storage/ScreenshotRepositoryTest.php @@ -4,7 +4,7 @@ use App\Storage\FileHelper; use App\Storage\ScreenshotRepository; -use App\System\Testing\PhpUnit\Hook\RefreshTestEnvHook; +use App\System\Testing\PhpUnit\Extension\BootstrapExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; @@ -40,11 +40,11 @@ class ScreenshotRepositoryTest extends TestCase protected function setUp(): void { - $this->screenshot_dir = RefreshTestEnvHook::$CACHE_DIR.'screenshot_repository/'; - $this->thumbnail_dir = RefreshTestEnvHook::$CACHE_DIR.'thumbnail_repository/'; - $this->tmp_dir = RefreshTestEnvHook::$CACHE_DIR.'tmp/'; - $this->tmp_extract_dir = RefreshTestEnvHook::$CACHE_DIR.'extract/'; - $this->tmp_zip_dir = RefreshTestEnvHook::$CACHE_DIR.'zips/'; + $this->screenshot_dir = BootstrapExtension::$CACHE_DIR.'screenshot_repository/'; + $this->thumbnail_dir = BootstrapExtension::$CACHE_DIR.'thumbnail_repository/'; + $this->tmp_dir = BootstrapExtension::$CACHE_DIR.'tmp/'; + $this->tmp_extract_dir = BootstrapExtension::$CACHE_DIR.'extract/'; + $this->tmp_zip_dir = BootstrapExtension::$CACHE_DIR.'zips/'; $this->screenshot_base_url = 'screenshots/'; $this->thumbnail_base_url = 'thumbnails/'; $this->filesystem = new Filesystem(); @@ -55,7 +55,11 @@ protected function setUp(): void $this->filesystem->mkdir($this->tmp_zip_dir); $this->project_id = 'test_id'; + $this->filesystem->mkdir($this->screenshot_dir.$this->project_id); + $this->filesystem->mkdir($this->thumbnail_dir.$this->project_id); + $this->filesystem->mkdir($this->tmp_dir.$this->project_id); $this->filesystem->mkdir($this->tmp_extract_dir.$this->project_id); + $this->filesystem->mkdir($this->tmp_zip_dir.$this->project_id); $this->screenshot_repository = new ScreenshotRepository(new ParameterBag([ 'catrobat.screenshot.dir' => $this->screenshot_dir, @@ -72,6 +76,9 @@ protected function tearDown(): void { FileHelper::removeDirectory($this->screenshot_dir); FileHelper::removeDirectory($this->thumbnail_dir); + FileHelper::removeDirectory($this->tmp_dir); + FileHelper::removeDirectory($this->tmp_extract_dir); + FileHelper::removeDirectory($this->tmp_zip_dir); } public function testInitialization(): void @@ -116,7 +123,7 @@ public function testThrowsAnExceptionIfGivenAnInvalidThumbnailDirectory(): void */ public function testStoresAScreenshot(): void { - $filepath = RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; + $filepath = BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; Assert::assertFileDoesNotExist($this->screenshot_dir.'screen_'.$this->project_id.'.png'); $this->screenshot_repository->saveProgramAssets($filepath, $this->project_id); Assert::assertFileExists($this->screenshot_dir.'screen_'.$this->project_id.'.png'); @@ -127,7 +134,7 @@ public function testStoresAScreenshot(): void */ public function testOverwriteScreenshot(): void { - $filepath = RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; + $filepath = BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; Assert::assertFileDoesNotExist($this->tmp_extract_dir.'/'.$this->project_id.'/manual_screenshot.png'); $this->screenshot_repository->saveProgramAssets($filepath, $this->project_id); Assert::assertFileExists($this->tmp_extract_dir.'/'.$this->project_id.'/manual_screenshot.png'); @@ -138,7 +145,7 @@ public function testOverwriteScreenshot(): void */ public function testGeneratesAThumbnail(): void { - $filepath = RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; + $filepath = BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; Assert::assertFileDoesNotExist($this->thumbnail_dir.'screen_'.$this->project_id.'.png'); $this->screenshot_repository->saveProgramAssets($filepath, $this->project_id); Assert::assertFileExists($this->thumbnail_dir.'screen_'.$this->project_id.'.png'); @@ -149,7 +156,7 @@ public function testGeneratesAThumbnail(): void */ public function testReturnsTheUrlOfAScreenshot(): void { - $filepath = RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; + $filepath = BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; $this->screenshot_repository->saveProgramAssets($filepath, $this->project_id); $web_path = $this->screenshot_repository->getScreenshotWebPath($this->project_id); $this->assertStringStartsWith($this->screenshot_base_url.'screen_'.$this->project_id.'.png', $web_path); @@ -161,7 +168,7 @@ public function testReturnsTheUrlOfAScreenshot(): void */ public function testReturnsTheUrlOfAThumbnail(): void { - $filepath = RefreshTestEnvHook::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; + $filepath = BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/automatic_screenshot.png'; $this->screenshot_repository->saveProgramAssets($filepath, $this->project_id); $web_path = $this->screenshot_repository->getThumbnailWebPath($this->project_id); $this->assertStringStartsWith($this->thumbnail_base_url.'screen_'.$this->project_id.'.png', $web_path); diff --git a/tests/PhpUnit/System/Commands/ArchiveLogsTest.php b/tests/PhpUnit/System/Commands/ArchiveLogsTest.php index 86b945725f..b8a2a23a01 100644 --- a/tests/PhpUnit/System/Commands/ArchiveLogsTest.php +++ b/tests/PhpUnit/System/Commands/ArchiveLogsTest.php @@ -15,10 +15,7 @@ */ class ArchiveLogsTest extends KernelTestCase { - /** - * @test - */ - public function archiveLogs(): void + public function testArchiveLogs(): void { // setup app $kernel = static::createKernel(); diff --git a/tests/PhpUnit/System/Commands/CleanApkTest.php b/tests/PhpUnit/System/Commands/CleanApkTest.php index c30aafdd3f..3ebca3ee13 100644 --- a/tests/PhpUnit/System/Commands/CleanApkTest.php +++ b/tests/PhpUnit/System/Commands/CleanApkTest.php @@ -32,10 +32,7 @@ protected function setUp(): void $file->move($this->apk_dir, 'test'); } - /** - * @test - */ - public function clearApkData(): void + public function testClearApkData(): void { $this->assertNotEmpty(array_diff(scandir($this->apk_dir), ['.', '..', '.gitignore']), 'Apk directory empty.'); diff --git a/tests/PhpUnit/System/Commands/CleanLogsTest.php b/tests/PhpUnit/System/Commands/CleanLogsTest.php index 9c97124a6a..a46dfbe66a 100644 --- a/tests/PhpUnit/System/Commands/CleanLogsTest.php +++ b/tests/PhpUnit/System/Commands/CleanLogsTest.php @@ -15,10 +15,7 @@ */ class CleanLogsTest extends KernelTestCase { - /** - * @test - */ - public function cleanLogs(): void + public function testCleanLogs(): void { // setup app $kernel = static::createKernel(); diff --git a/tests/PhpUnit/System/Commands/ClearCompressedProjectsTest.php b/tests/PhpUnit/System/Commands/ClearCompressedProjectsTest.php index eb633cf52b..0180c090a5 100644 --- a/tests/PhpUnit/System/Commands/ClearCompressedProjectsTest.php +++ b/tests/PhpUnit/System/Commands/ClearCompressedProjectsTest.php @@ -38,10 +38,7 @@ protected function setUp(): void $this->clearCompressedProjectsDir(); } - /** - * @test - */ - public function clearExtractedProjectsShouldRemoveAllUnusedData(): void + public function testClearExtractedProjectsShouldRemoveAllUnusedData(): void { $this->generateUnusedData(); @@ -53,10 +50,7 @@ public function clearExtractedProjectsShouldRemoveAllUnusedData(): void 'Not all files in log directory got deleted.'); } - /** - * @test - */ - public function clearExtractedProjectsShouldRemoveAllData(): void + public function testClearExtractedProjectsShouldRemoveAllData(): void { $this->generateUnusedData(); diff --git a/tests/PhpUnit/Translation/TranslationDelegateTest.php b/tests/PhpUnit/Translation/TranslationDelegateTest.php index 4dec59b667..cc01cb330f 100644 --- a/tests/PhpUnit/Translation/TranslationDelegateTest.php +++ b/tests/PhpUnit/Translation/TranslationDelegateTest.php @@ -8,6 +8,7 @@ use App\Translation\TranslationApiInterface; use App\Translation\TranslationDelegate; use App\Translation\TranslationResult; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -113,9 +114,7 @@ public function testAllApiFails(): void $this->assertNull($result); } - /** - * @dataProvider provideInvalidLanguageCode - */ + #[DataProvider('provideInvalidLanguageCode')] public function testInvalidLanguageCode(string $invalid_code): void { $this->expectException(\InvalidArgumentException::class); @@ -230,7 +229,7 @@ public function testCachedProjectTranslation(): void $this->assertEquals($cached_translation, $actual_result); } - public function provideInvalidLanguageCode(): array + public static function provideInvalidLanguageCode(): array { return [ [''], diff --git a/tests/PhpUnit/Utils/ElapsedTimeStringFormatterTest.php b/tests/PhpUnit/Utils/ElapsedTimeStringFormatterTest.php index cbb200a69c..9907253678 100644 --- a/tests/PhpUnit/Utils/ElapsedTimeStringFormatterTest.php +++ b/tests/PhpUnit/Utils/ElapsedTimeStringFormatterTest.php @@ -4,6 +4,7 @@ use App\Utils\ElapsedTimeStringFormatter; use App\Utils\TimeUtils; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -14,8 +15,6 @@ */ class ElapsedTimeStringFormatterTest extends TestCase { - protected int $test_time; - private ElapsedTimeStringFormatter|MockObject $object; /** @@ -48,10 +47,9 @@ public function testInitialization(): void * * @covers \App\Utils\ElapsedTimeStringFormatter::format * - * @dataProvider dataProviderElapsedTimeStringFormatter - * * @throws \Exception */ + #[DataProvider('provideElapsedTimeStringFormatterData')] public function testElapsedTimeStringFormatter(string $expected, int $timestamp): void { $this->object->expects(self::once())->method($this->getExpectedFormatterMethod($expected)); @@ -73,33 +71,33 @@ protected function getExpectedFormatterMethod(string $expected): string /** * @throws \Exception */ - public function dataProviderElapsedTimeStringFormatter(): \Generator + public static function provideElapsedTimeStringFormatterData(): \Generator { TimeUtils::freezeTime(new \DateTime('2015-10-26 13:33:37')); - $this->test_time = TimeUtils::getTimestamp(); - yield ['minutes', $this->test_time + 1]; - yield ['minutes', $this->test_time]; - yield ['minutes', $this->test_time - 1]; - yield ['minutes', $this->test_time - 1000]; - yield ['minutes', $this->test_time - 3_540]; - yield ['hours', $this->test_time - 3_541]; - yield ['hours', $this->test_time - 3_600 * 5]; - yield ['hours', $this->test_time - 3_600 * 5 - 10]; - yield ['hours', $this->test_time - 3_600 * 23]; - yield ['days', $this->test_time - 3_600 * 24]; - yield ['days', $this->test_time - 82_801]; - yield ['days', $this->test_time - 86_400 * 5]; - yield ['days', $this->test_time - 86_400 * 5 - 10]; - yield ['days', $this->test_time - 86_400 * 6]; - yield ['months', $this->test_time - 86_400 * 31]; - yield ['months', $this->test_time - 2_505_601]; - yield ['months', $this->test_time - 2_629_800 * 6]; - yield ['months', $this->test_time - 2_629_800 * 6 - 10]; - yield ['months', $this->test_time - 2_629_800 * 11]; - yield ['years', $this->test_time - 2_629_800 * 12]; - yield ['years', $this->test_time - 31_557_600]; - yield ['years', $this->test_time - 31_557_600 * 3]; - yield ['years', $this->test_time - 31_557_600 * 3 - 10]; - yield ['years', $this->test_time - 31_557_600 * 100]; + $test_time = TimeUtils::getTimestamp(); + yield ['minutes', $test_time + 1]; + yield ['minutes', $test_time]; + yield ['minutes', $test_time - 1]; + yield ['minutes', $test_time - 1000]; + yield ['minutes', $test_time - 3_540]; + yield ['hours', $test_time - 3_541]; + yield ['hours', $test_time - 3_600 * 5]; + yield ['hours', $test_time - 3_600 * 5 - 10]; + yield ['hours', $test_time - 3_600 * 23]; + yield ['days', $test_time - 3_600 * 24]; + yield ['days', $test_time - 82_801]; + yield ['days', $test_time - 86_400 * 5]; + yield ['days', $test_time - 86_400 * 5 - 10]; + yield ['days', $test_time - 86_400 * 6]; + yield ['months', $test_time - 86_400 * 31]; + yield ['months', $test_time - 2_505_601]; + yield ['months', $test_time - 2_629_800 * 6]; + yield ['months', $test_time - 2_629_800 * 6 - 10]; + yield ['months', $test_time - 2_629_800 * 11]; + yield ['years', $test_time - 2_629_800 * 12]; + yield ['years', $test_time - 31_557_600]; + yield ['years', $test_time - 31_557_600 * 3]; + yield ['years', $test_time - 31_557_600 * 3 - 10]; + yield ['years', $test_time - 31_557_600 * 100]; } } diff --git a/tests/PhpUnit/Utils/TimeUtilsTest.php b/tests/PhpUnit/Utils/TimeUtilsTest.php index 0a798b3daa..f022b67b1b 100644 --- a/tests/PhpUnit/Utils/TimeUtilsTest.php +++ b/tests/PhpUnit/Utils/TimeUtilsTest.php @@ -3,7 +3,6 @@ namespace Tests\PhpUnit\Utils; use App\Utils\TimeUtils; -use DateTime; use PHPUnit\Framework\TestCase; /** @@ -16,11 +15,9 @@ class TimeUtilsTest extends TestCase /** * Test whether the TimeUtils returns the current timestamp. * - * @test - * * @throws \Exception */ - public function theCurrentTimestampShouldBeReturned(): void + public function testTheCurrentTimestampShouldBeReturned(): void { $current_timestamp = (new \DateTime())->getTimestamp(); @@ -34,11 +31,9 @@ public function theCurrentTimestampShouldBeReturned(): void /** * Test wheter the TimeUtils returns the current DateTime. * - * @test - * * @throws \Exception */ - public function theCurrentDatetimeShouldBeReturned(): void + public function testTheCurrentDatetimeShouldBeReturned(): void { $current_datetime = new \DateTime(); @@ -50,11 +45,9 @@ public function theCurrentDatetimeShouldBeReturned(): void /** * Freezing the time to a specific value should work. * - * @test - * * @throws \Exception */ - public function freezingTimeShouldWork(): void + public function testFreezingTimeShouldWork(): void { $freeze_time_to = new \DateTime('2012-03-24 17:45:1'); @@ -67,15 +60,13 @@ public function freezingTimeShouldWork(): void /** * Unfreezing the time should work. * - * @test - * * @throws \Exception */ - public function unfreezingTimeShouldWork(): void + public function testUnfreezingTimeShouldWork(): void { TimeUtils::unfreezeTime(); - $this->theCurrentTimestampShouldBeReturned(); - $this->theCurrentDatetimeShouldBeReturned(); + $this->testTheCurrentDatetimeShouldBeReturned(); + $this->testTheCurrentDatetimeShouldBeReturned(); } }