From ebab722aa32696675dcd25f7d700c0b01d891348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=A4se?= Date: Sun, 6 Jul 2025 18:38:11 +0900 Subject: [PATCH 1/4] Update to PHPStan 2.1 with all dependencies --- composer-manifest.yaml | 14 +- composer.json | 13 +- composer.lock | 707 ++++++++---------- phpstan.neon | 1 + .../resource/QuestionSubmissionResource.php | 1 + .../Field/ComputedTextMarkupFieldItemList.php | 2 +- .../ComputedTextProcessedFieldItemList.php | 2 +- .../tests/src/Unit/ProjectLifecycleTest.php | 2 +- 8 files changed, 317 insertions(+), 425 deletions(-) diff --git a/composer-manifest.yaml b/composer-manifest.yaml index e730b15d..e315e764 100644 --- a/composer-manifest.yaml +++ b/composer-manifest.yaml @@ -25,7 +25,6 @@ packages: cweagans/composer-patches: 1.7.3 dealerdirect/phpcodesniffer-composer-installer: v0.7.2 defuse/php-encryption: v2.4.0 - dekor/php-array-table: '2.0' dflydev/dot-access-data: v3.0.3 doctrine/annotations: 2.0.2 doctrine/common: 3.5.0 @@ -42,7 +41,7 @@ packages: drupal/consumers: 1.19.0 drupal/core: 11.2.2 drupal/core-composer-scaffold: 11.2.2 - drupal/core-dev: 11.2.0-beta1 + drupal/core-dev: 11.2.2 drupal/core-project-message: 11.2.2 drupal/core-recommended: 11.2.2 drupal/core-vendor-hardening: 11.2.2 @@ -73,7 +72,6 @@ packages: drupal/simple_oauth: 6.0.0 drupal/sophron: 2.2.1 drupal/subrequests: 3.0.12 - drupal/upgrade_status: 4.3.8 drupal/user_bundle: 1.4.0 drupal/warmer: 2.0.14 drush/drush: 13.6.0 @@ -89,7 +87,7 @@ packages: guzzlehttp/guzzle: 7.9.3 guzzlehttp/promises: 2.2.0 guzzlehttp/psr7: 2.7.1 - jangregor/phpstan-prophecy: 1.0.2 + jangregor/phpstan-prophecy: 2.2.0 joachim-n/composer-manifest: 1.1.7 justinrainbow/json-schema: 6.4.2 laravel/prompts: v0.3.5 @@ -106,7 +104,7 @@ packages: masterminds/html5: 2.9.0 mck89/peast: v1.17.2 mglaman/composer-drupal-lenient: 1.0.7 - mglaman/phpstan-drupal: 1.3.9 + mglaman/phpstan-drupal: 2.0.7 micheh/phpcs-gitlab: 2.0.0 mikey179/vfsstream: v1.6.12 myclabs/deep-copy: 1.13.3 @@ -141,9 +139,9 @@ packages: phpspec/prophecy-phpunit: v2.4.0 phpstan/extension-installer: 1.4.3 phpstan/phpdoc-parser: 2.1.0 - phpstan/phpstan: 1.12.27 - phpstan/phpstan-deprecation-rules: 1.2.1 - phpstan/phpstan-phpunit: 1.4.2 + phpstan/phpstan: 2.1.17 + phpstan/phpstan-deprecation-rules: 2.0.3 + phpstan/phpstan-phpunit: 2.0.6 phpunit/php-code-coverage: 11.0.10 phpunit/php-file-iterator: 5.1.0 phpunit/php-invoker: 5.0.1 diff --git a/composer.json b/composer.json index 8a232657..79c28bfd 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,6 @@ "drupal/responsive_favicons": "^3.0", "drupal/simple_oauth": "^6.0@beta", "drupal/subrequests": "^3.0", - "drupal/upgrade_status": "^4.0", "drupal/user_bundle": "^1.2", "drush/drush": "^13.3", "joachim-n/composer-manifest": "^1.1", @@ -157,13 +156,13 @@ "drupal/openapi_ui_redoc": "^1.0@RC", "drupal/restui": "^1.21", "fakerphp/faker": "^1.21", - "jangregor/phpstan-prophecy": "^1.0", - "mglaman/phpstan-drupal": "^1.1", + "jangregor/phpstan-prophecy": "^2.2", + "mglaman/phpstan-drupal": "^2.0", "phpcompatibility/php-compatibility": "^9.3", - "phpspec/prophecy-phpunit": "^2", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-deprecation-rules": "^1.1", + "phpspec/prophecy-phpunit": "^2.4", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0", "roave/security-advisories": "dev-latest", "weitzman/drupal-test-traits": "^2.5" }, diff --git a/composer.lock b/composer.lock index eba2e031..c6ebf6eb 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": "54a3e73c6b8076d835dfebfeffbcf08a", + "content-hash": "9a70f0d8b4a1a2fc252e91d20b752c12", "packages": [ { "name": "asm89/stack-cors", @@ -931,55 +931,6 @@ }, "time": "2023-06-19T06:10:36+00:00" }, - { - "name": "dekor/php-array-table", - "version": "2.0", - "source": { - "type": "git", - "url": "https://github.com/deniskoronets/php-array-table.git", - "reference": "ca40b21ba84eee6a9658a33fc5f897d76baaf8e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/deniskoronets/php-array-table/zipball/ca40b21ba84eee6a9658a33fc5f897d76baaf8e5", - "reference": "ca40b21ba84eee6a9658a33fc5f897d76baaf8e5", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^10" - }, - "type": "library", - "autoload": { - "psr-4": { - "dekor\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Denis Koronets", - "email": "deniskoronets@woo.zp.ua", - "homepage": "https://woo.zp.ua/" - } - ], - "description": "PHP Library for printing associative arrays as text table (similar to mysql terminal console)", - "keywords": [ - "library", - "php" - ], - "support": { - "issues": "https://github.com/deniskoronets/php-array-table/issues", - "source": "https://github.com/deniskoronets/php-array-table/tree/2.0" - }, - "time": "2023-02-10T10:13:42+00:00" - }, { "name": "dflydev/dot-access-data", "version": "v3.0.3", @@ -3252,64 +3203,6 @@ "source": "https://git.drupalcode.org/project/subrequests" } }, - { - "name": "drupal/upgrade_status", - "version": "4.3.8", - "source": { - "type": "git", - "url": "https://git.drupalcode.org/project/upgrade_status.git", - "reference": "4.3.8" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/upgrade_status-4.3.8.zip", - "reference": "4.3.8", - "shasum": "4526741f6d0991f2165d4d79c8830602f5ac8bca" - }, - "require": { - "dekor/php-array-table": "^2.0", - "drupal/core": "^9 || ^10 || ^11", - "mglaman/phpstan-drupal": "^1.2.11|^2.0", - "nikic/php-parser": "^4.0.0|^5.0.0", - "phpstan/phpstan-deprecation-rules": "^1.0.0|^2.0", - "symfony/process": "^3.4|^4.0|^5.0|^6.0|^7.0", - "webflo/drupal-finder": "^1.2" - }, - "require-dev": { - "drush/drush": "^11|^12|^13" - }, - "type": "drupal-module", - "extra": { - "drupal": { - "version": "4.3.8", - "datestamp": "1751485112", - "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" - } - }, - "drush": { - "services": { - "drush.services.yml": "^9 || ^10" - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "gábor hojtsy", - "homepage": "https://www.drupal.org/user/4166" - } - ], - "description": "Review Drupal major upgrade readiness of the environment and components of the site.", - "homepage": "http://drupal.org/project/upgrade_status", - "support": { - "source": "https://git.drupalcode.org/project/upgrade_status" - } - }, { "name": "drupal/user_bundle", "version": "1.4.0", @@ -5258,110 +5151,6 @@ ], "time": "2024-11-21T15:59:26+00:00" }, - { - "name": "mglaman/phpstan-drupal", - "version": "1.3.9", - "source": { - "type": "git", - "url": "https://github.com/mglaman/phpstan-drupal.git", - "reference": "973a4e89e19ea7dbd60af0aa939b18a873cf7f2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mglaman/phpstan-drupal/zipball/973a4e89e19ea7dbd60af0aa939b18a873cf7f2f", - "reference": "973a4e89e19ea7dbd60af0aa939b18a873cf7f2f", - "shasum": "" - }, - "require": { - "php": "^8.1", - "phpstan/phpstan": "^1.12", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "symfony/finder": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "symfony/yaml": "^4.2|| ^5.0 || ^6.0 || ^7.0", - "webflo/drupal-finder": "^1.3.1" - }, - "require-dev": { - "behat/mink": "^1.8", - "composer/installers": "^1.9", - "drupal/core-recommended": "^10", - "drush/drush": "^10.0 || ^11 || ^12 || ^13@beta", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^8.5 || ^9 || ^10 || ^11", - "slevomat/coding-standard": "^7.1", - "squizlabs/php_codesniffer": "^3.3", - "symfony/phpunit-bridge": "^4.4 || ^5.4 || ^6.0 || ^7.0" - }, - "suggest": { - "jangregor/phpstan-prophecy": "Provides a prophecy/prophecy extension for phpstan/phpstan.", - "phpstan/phpstan-deprecation-rules": "For catching deprecations, especially in Drupal core.", - "phpstan/phpstan-phpunit": "PHPUnit extensions and rules for PHPStan." - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon", - "rules.neon" - ] - }, - "branch-alias": { - "dev-main": "1.0-dev" - }, - "installer-paths": { - "tests/fixtures/drupal/core": [ - "type:drupal-core" - ], - "tests/fixtures/drupal/libraries/{$name}": [ - "type:drupal-library" - ], - "tests/fixtures/drupal/themes/contrib/{$name}": [ - "type:drupal-theme" - ], - "tests/fixtures/drupal/modules/contrib/{$name}": [ - "type:drupal-module" - ], - "tests/fixtures/drupal/profiles/contrib/{$name}": [ - "type:drupal-profile" - ] - } - }, - "autoload": { - "psr-4": { - "mglaman\\PHPStanDrupal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matt Glaman", - "email": "nmd.matt@gmail.com" - } - ], - "description": "Drupal extension and rules for PHPStan", - "support": { - "issues": "https://github.com/mglaman/phpstan-drupal/issues", - "source": "https://github.com/mglaman/phpstan-drupal/tree/1.3.9" - }, - "funding": [ - { - "url": "https://github.com/mglaman", - "type": "github" - }, - { - "url": "https://opencollective.com/phpstan-drupal", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/mglaman/phpstan-drupal", - "type": "tidelift" - } - ], - "time": "2025-05-22T16:48:16+00:00" - }, { "name": "nikic/php-parser", "version": "v5.5.0", @@ -5928,111 +5717,6 @@ }, "time": "2021-09-22T16:57:06+00:00" }, - { - "name": "phpstan/phpstan", - "version": "1.12.27", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "3a6e423c076ab39dfedc307e2ac627ef579db162" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3a6e423c076ab39dfedc307e2ac627ef579db162", - "reference": "3a6e423c076ab39dfedc307e2ac627ef579db162", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], - "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", - "type": "github" - } - ], - "time": "2025-05-21T20:51:45+00:00" - }, - { - "name": "phpstan/phpstan-deprecation-rules", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "f94d246cc143ec5a23da868f8f7e1393b50eaa82" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/f94d246cc143ec5a23da868f8f7e1393b50eaa82", - "reference": "f94d246cc143ec5a23da868f8f7e1393b50eaa82", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", - "support": { - "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.2.1" - }, - "time": "2024-09-11T15:52:35+00:00" - }, { "name": "psr/cache", "version": "3.0.0", @@ -9582,55 +9266,9 @@ "source": "https://github.com/VIPnytt/SitemapParser/tree/v1.3.0" }, "time": "2023-11-27T15:24:01+00:00" - }, - { - "name": "webflo/drupal-finder", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/webflo/drupal-finder.git", - "reference": "73045060b0894c77962a10cff047f72872d8810c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/73045060b0894c77962a10cff047f72872d8810c", - "reference": "73045060b0894c77962a10cff047f72872d8810c", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2.2", - "php": ">=8.1" - }, - "require-dev": { - "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": "^10.4", - "symfony/process": "^6.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "DrupalFinder\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Florian Weber", - "email": "florian@webflo.org" - } - ], - "description": "Helper class to locate a Drupal installation.", - "support": { - "issues": "https://github.com/webflo/drupal-finder/issues", - "source": "https://github.com/webflo/drupal-finder/tree/1.3.1" - }, - "time": "2024-06-28T13:45:36+00:00" - } - ], - "packages-dev": [ + } + ], + "packages-dev": [ { "name": "behat/mink", "version": "v1.12.0", @@ -10748,16 +10386,16 @@ }, { "name": "drupal/core-dev", - "version": "11.2.0-beta1", + "version": "11.2.2", "source": { "type": "git", "url": "https://github.com/drupal/core-dev.git", - "reference": "0901f2aa226d44a74a3ffb020c1a5945e5267f68" + "reference": "4d4bd2439c9bc0da7129a653466b4bcd401549ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-dev/zipball/0901f2aa226d44a74a3ffb020c1a5945e5267f68", - "reference": "0901f2aa226d44a74a3ffb020c1a5945e5267f68", + "url": "https://api.github.com/repos/drupal/core-dev/zipball/4d4bd2439c9bc0da7129a653466b4bcd401549ff", + "reference": "4d4bd2439c9bc0da7129a653466b4bcd401549ff", "shasum": "" }, "require": { @@ -10765,11 +10403,11 @@ "behat/mink-browserkit-driver": "^2.2", "colinodell/psr-testlogger": "^1.2", "composer/composer": "^2.8.1", - "drupal/coder": "^8.3.10", + "drupal/coder": "^8.3.30", "justinrainbow/json-schema": "^5.2 || ^6.3", "lullabot/mink-selenium2-driver": "^1.7.3", "lullabot/php-webdriver": "^2.0.5", - "mglaman/phpstan-drupal": "^1.2.11 || ^2.0.4", + "mglaman/phpstan-drupal": "^2.0.7", "micheh/phpcs-gitlab": "^1.1 || ^2.0", "mikey179/vfsstream": "^1.6.11", "open-telemetry/exporter-otlp": "^1", @@ -10777,15 +10415,15 @@ "php-http/guzzle7-adapter": "^1.0", "phpspec/prophecy-phpunit": "^2", "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^1.12.4 || ^2.1.14", - "phpstan/phpstan-phpunit": "^1.3.16 || ^2.0.6", + "phpstan/phpstan": "^2.1.17", + "phpstan/phpstan-phpunit": "^2.0.6", "phpunit/phpunit": "^10.5.19 || ^11.5.3", - "symfony/browser-kit": "^7.3@beta", - "symfony/css-selector": "^7.3@beta", - "symfony/dom-crawler": "^7.3@beta", - "symfony/error-handler": "^7.3@beta", - "symfony/lock": "^7.3@beta", - "symfony/var-dumper": "^7.3@beta" + "symfony/browser-kit": "^7.3", + "symfony/css-selector": "^7.3", + "symfony/dom-crawler": "^7.3", + "symfony/error-handler": "^7.3", + "symfony/lock": "^7.3", + "symfony/var-dumper": "^7.3" }, "conflict": { "webflo/drupal-core-require-dev": "*" @@ -10797,9 +10435,9 @@ ], "description": "require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.", "support": { - "source": "https://github.com/drupal/core-dev/tree/11.2.0-beta1" + "source": "https://github.com/drupal/core-dev/tree/11.2.2" }, - "time": "2025-05-13T14:39:07+00:00" + "time": "2025-06-11T08:06:33+00:00" }, { "name": "drupal/mailsystem", @@ -11460,32 +11098,34 @@ }, { "name": "jangregor/phpstan-prophecy", - "version": "1.0.2", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/Jan0707/phpstan-prophecy.git", - "reference": "5ee56c7db1d58f0578c82a35e3c1befe840e85a9" + "reference": "aebda94b6b1c39055d8f2227e879c07bac651550" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jan0707/phpstan-prophecy/zipball/5ee56c7db1d58f0578c82a35e3c1befe840e85a9", - "reference": "5ee56c7db1d58f0578c82a35e3c1befe840e85a9", + "url": "https://api.github.com/repos/Jan0707/phpstan-prophecy/zipball/aebda94b6b1c39055d8f2227e879c07bac651550", + "reference": "aebda94b6b1c39055d8f2227e879c07bac651550", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0.0" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.5" }, "conflict": { - "phpspec/prophecy": "<1.7.0 || >=2.0.0", - "phpunit/phpunit": "<6.0.0 || >=12.0.0" + "phpspec/prophecy": "<1.17.0 || >=2.0.0", + "phpspec/prophecy-phpunit": "<2.3.0 || >=3.0.0", + "phpunit/phpunit": "<9.1.0 || >=13.0.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.1.1", - "ergebnis/license": "^1.0.0", - "ergebnis/php-cs-fixer-config": "~2.2.0", + "ergebnis/composer-normalize": "^2.47.0", + "ergebnis/license": "^2.6.0", + "ergebnis/php-cs-fixer-config": "^6.46.0", "phpspec/prophecy": "^1.7.0", - "phpunit/phpunit": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" + "phpspec/prophecy-phpunit": "^2.3", + "phpunit/phpunit": "^9.1.0" }, "type": "phpstan-extension", "extra": { @@ -11513,9 +11153,9 @@ "description": "Provides a phpstan/phpstan extension for phpspec/prophecy", "support": { "issues": "https://github.com/Jan0707/phpstan-prophecy/issues", - "source": "https://github.com/Jan0707/phpstan-prophecy/tree/1.0.2" + "source": "https://github.com/Jan0707/phpstan-prophecy/tree/2.2.0" }, - "time": "2024-04-03T08:15:54+00:00" + "time": "2025-05-22T08:21:52+00:00" }, { "name": "lullabot/mink-selenium2-driver", @@ -11637,6 +11277,107 @@ }, "time": "2024-08-05T13:00:46+00:00" }, + { + "name": "mglaman/phpstan-drupal", + "version": "2.0.7", + "source": { + "type": "git", + "url": "https://github.com/mglaman/phpstan-drupal.git", + "reference": "42cca54ee8bccec83a674ac45d1d17586777187e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mglaman/phpstan-drupal/zipball/42cca54ee8bccec83a674ac45d1d17586777187e", + "reference": "42cca54ee8bccec83a674ac45d1d17586777187e", + "shasum": "" + }, + "require": { + "php": "^8.1", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0", + "symfony/finder": "^6.2 || ^7.0", + "symfony/yaml": "^6.2 || ^7.0", + "webflo/drupal-finder": "^1.3.1" + }, + "require-dev": { + "behat/mink": "^1.10", + "composer/installers": "^1.9", + "drupal/core-recommended": "^10", + "drush/drush": "^11 || ^12 || ^13", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9 || ^10 || ^11", + "slevomat/coding-standard": "^8.6", + "squizlabs/php_codesniffer": "^3.7", + "symfony/phpunit-bridge": "^6.2 || ^7.0" + }, + "suggest": { + "jangregor/phpstan-prophecy": "Provides a prophecy/prophecy extension for phpstan/phpstan.", + "phpstan/phpstan-deprecation-rules": "For catching deprecations, especially in Drupal core.", + "phpstan/phpstan-phpunit": "PHPUnit extensions and rules for PHPStan." + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + }, + "installer-paths": { + "tests/fixtures/drupal/core": [ + "type:drupal-core" + ], + "tests/fixtures/drupal/libraries/{$name}": [ + "type:drupal-library" + ], + "tests/fixtures/drupal/themes/contrib/{$name}": [ + "type:drupal-theme" + ], + "tests/fixtures/drupal/modules/contrib/{$name}": [ + "type:drupal-module" + ], + "tests/fixtures/drupal/profiles/contrib/{$name}": [ + "type:drupal-profile" + ] + } + }, + "autoload": { + "psr-4": { + "mglaman\\PHPStanDrupal\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Glaman", + "email": "nmd.matt@gmail.com" + } + ], + "description": "Drupal extension and rules for PHPStan", + "support": { + "issues": "https://github.com/mglaman/phpstan-drupal/issues", + "source": "https://github.com/mglaman/phpstan-drupal/tree/2.0.7" + }, + "funding": [ + { + "url": "https://github.com/mglaman", + "type": "github" + }, + { + "url": "https://opencollective.com/phpstan-drupal", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/mglaman/phpstan-drupal", + "type": "tidelift" + } + ], + "time": "2025-05-22T18:06:14+00:00" + }, { "name": "micheh/phpcs-gitlab", "version": "2.0.0", @@ -13097,32 +12838,138 @@ }, "time": "2025-02-19T13:28:12+00:00" }, + { + "name": "phpstan/phpstan", + "version": "2.1.17", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053", + "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2025-05-21T20:55:28+00:00" + }, + { + "name": "phpstan/phpstan-deprecation-rules", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", + "reference": "468e02c9176891cc901143da118f09dc9505fc2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f", + "reference": "468e02c9176891cc901143da118f09dc9505fc2f", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.15" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", + "support": { + "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3" + }, + "time": "2025-05-14T10:56:57+00:00" + }, { "name": "phpstan/phpstan-phpunit", - "version": "1.4.2", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e" + "reference": "6b92469f8a7995e626da3aa487099617b8dfa260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/72a6721c9b64b3e4c9db55abbc38f790b318267e", - "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6b92469f8a7995e626da3aa487099617b8dfa260", + "reference": "6b92469f8a7995e626da3aa487099617b8dfa260", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0.4" }, "conflict": { "phpunit/phpunit": "<7.0" }, "require-dev": { - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^5", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^9.5" + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6" }, "type": "phpstan-extension", "extra": { @@ -13145,9 +12992,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.2" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.6" }, - "time": "2024-12-17T17:20:49+00:00" + "time": "2025-03-26T12:47:06+00:00" }, { "name": "phpunit/php-code-coverage", @@ -16689,6 +16536,52 @@ ], "time": "2024-03-03T12:36:25+00:00" }, + { + "name": "webflo/drupal-finder", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-finder.git", + "reference": "73045060b0894c77962a10cff047f72872d8810c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-finder/zipball/73045060b0894c77962a10cff047f72872d8810c", + "reference": "73045060b0894c77962a10cff047f72872d8810c", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "php": ">=8.1" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^10.4", + "symfony/process": "^6.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "DrupalFinder\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Florian Weber", + "email": "florian@webflo.org" + } + ], + "description": "Helper class to locate a Drupal installation.", + "support": { + "issues": "https://github.com/webflo/drupal-finder/issues", + "source": "https://github.com/webflo/drupal-finder/tree/1.3.1" + }, + "time": "2024-06-28T13:45:36+00:00" + }, { "name": "webmozart/assert", "version": "1.11.0", diff --git a/phpstan.neon b/phpstan.neon index 058c373a..f133c296 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,7 @@ parameters: level: 6 reportUnmatchedIgnoredErrors: false + treatPhpDocTypesAsCertain: false paths: - web/modules/custom ignoreErrors: diff --git a/web/modules/custom/academy/questionnaire/src/Plugin/rest/resource/QuestionSubmissionResource.php b/web/modules/custom/academy/questionnaire/src/Plugin/rest/resource/QuestionSubmissionResource.php index 151c10b8..61454808 100644 --- a/web/modules/custom/academy/questionnaire/src/Plugin/rest/resource/QuestionSubmissionResource.php +++ b/web/modules/custom/academy/questionnaire/src/Plugin/rest/resource/QuestionSubmissionResource.php @@ -139,6 +139,7 @@ public function post(Question $question, Request $request): ResourceResponseInte $valid_value = match($question->bundle()) { 'radios' => array_key_exists($v, $question->get('options')->getValue()), 'checkboxes' => !array_diff($v, array_keys($question->get('options')->getValue())), + // @phpstan-ignore-next-line 'task' => empty($v) || (int) $v[0] == 0, // @phpstan-ignore-next-line default => FALSE, diff --git a/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextMarkupFieldItemList.php b/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextMarkupFieldItemList.php index a582de04..c9e7d9cc 100644 --- a/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextMarkupFieldItemList.php +++ b/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextMarkupFieldItemList.php @@ -45,7 +45,7 @@ protected function getReplacements(): array { $names[] = $this->generateLink($creative->getName(), $creative); } $replacements['%Creatives'] = $this->concatCreativeNames($names); - $replacements['%Creative'] = $names[0] ?? 'Anonymous'; + $replacements['%Creative'] = $names[0]; } return $replacements; diff --git a/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextProcessedFieldItemList.php b/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextProcessedFieldItemList.php index 3c97c1c6..75c5e08f 100644 --- a/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextProcessedFieldItemList.php +++ b/web/modules/custom/monitoring/logbook/src/Plugin/Field/ComputedTextProcessedFieldItemList.php @@ -41,7 +41,7 @@ protected function getReplacements(): array { $names[] = '' . $creative->getName() . ''; } $replacements['%Creatives'] = $this->concatCreativeNames($names); - $replacements['%Creative'] = $names[0] ?? 'Anonymous'; + $replacements['%Creative'] = $names[0]; } return $replacements; diff --git a/web/modules/custom/projects/projects/tests/src/Unit/ProjectLifecycleTest.php b/web/modules/custom/projects/projects/tests/src/Unit/ProjectLifecycleTest.php index 26b797ca..2bc12d7b 100644 --- a/web/modules/custom/projects/projects/tests/src/Unit/ProjectLifecycleTest.php +++ b/web/modules/custom/projects/projects/tests/src/Unit/ProjectLifecycleTest.php @@ -51,7 +51,7 @@ protected function setUp(): void { /** * Tests the project methods. * - * @covers ::__construct() + * @covers ::__construct * @covers ::setProject * @covers ::project */ From ce1e3a8721214519570418f0c00c8074b9cfeb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=A4se?= Date: Sun, 6 Jul 2025 18:46:31 +0900 Subject: [PATCH 2/4] Fix applicants count in random default content --- .../custom/projects/projects/dummy/projects_dummy.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/modules/custom/projects/projects/dummy/projects_dummy.install b/web/modules/custom/projects/projects/dummy/projects_dummy.install index 47e02626..bb021728 100644 --- a/web/modules/custom/projects/projects/dummy/projects_dummy.install +++ b/web/modules/custom/projects/projects/dummy/projects_dummy.install @@ -147,7 +147,7 @@ function projects_dummy_site_install_finished(): void { // Set applicants and participants for ongoing or completed projects. if ($state === 'ongoing' || $state === 'completed') { shuffle($creative_ids); - $applicants = array_slice($creative_ids, 0, random_int(1, min(5, count($creative_ids)))); + $applicants = array_slice($creative_ids, 0, random_int(2, min(5, count($creative_ids)))); $applicants = array_diff($applicants, [$manager]); $project->setApplicants(array_map('intval', $applicants)); $participants = array_slice($applicants, 0, random_int(1, count($applicants))); From 0a7a42c009772d03990b77eb48da5b1b30c07575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=A4se?= Date: Sun, 6 Jul 2025 18:47:05 +0900 Subject: [PATCH 3/4] Adjust Drupal version in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c222767..5da5fd55 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## :wave:  Introduction -Backend repository for youvo based on Drupal 10. +Backend repository for youvo based on Drupal 11. ### What is happening here? From 869adc19eaf8c6fc7eff641b84560ac9afba56d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=A4se?= Date: Sun, 6 Jul 2025 18:48:07 +0900 Subject: [PATCH 4/4] Adjust Drupal version in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5da5fd55..57a8cdc1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Backend repository for youvo based on Drupal 11. ### What is happening here? -We are building the new backend for [youvo.org](https://www.youvo.org) - a platform that connects social organizations with creatives for skill-based volunteering projects. The backend of the main platform runs on Drupal 7. We are migrating to a decoupled stack with Drupal 10 and Remix. The current development phase is until the end of June. Most of the features are still in early development and highly unstable. The Academy is running as a beta on [beta.youvo.org](https://beta.youvo.org/academy) (after registration). +We are building the new backend for [youvo.org](https://www.youvo.org) - a platform that connects social organizations with creatives for skill-based volunteering projects. The backend of the main platform runs on Drupal 7. We are migrating to a decoupled stack with Drupal 11 and Remix. The current development phase is until the end of June. Most of the features are still in early development and highly unstable. The Academy is running as a beta on [beta.youvo.org](https://beta.youvo.org/academy) (after registration). ### How to contact us?