Skip to content

Commit

Permalink
[TASK] Have composer/composer:^2.2 as dev dependency
Browse files Browse the repository at this point in the history
The index.php entry point handling and package
handling core scripts are composer plugins. As
such, they rely on composer. To resolve dependencies
in IDE's and phpstan, composer should be a core
monorepo dev dependency. This resolves about 50
issues from phpstan baseline.

> composer req --dev composer/composer:^2.2
> Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Change-Id: Iaaa4d327b7e82ca1e377d66cb1846a1699a20254
Resolves: #96676
Releases: main, 11.5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73199
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Jan 29, 2022
1 parent bd68ba8 commit a46103e
Show file tree
Hide file tree
Showing 3 changed files with 628 additions and 166 deletions.
165 changes: 0 additions & 165 deletions Build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ parameters:
count: 1
path: ../../typo3/sysext/backend/Classes/Clipboard/Clipboard.php

-
message: "#^Parameter \\$event of method TYPO3\\\\CMS\\\\Backend\\\\Composer\\\\InstallerScripts\\:\\:register\\(\\) has invalid type Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/backend/Classes/Composer/InstallerScripts.php

-
message: "#^Method TYPO3Fluid\\\\Fluid\\\\View\\\\ViewInterface\\:\\:render\\(\\) invoked with 1 parameter, 0 required\\.$#"
count: 1
Expand Down Expand Up @@ -1800,126 +1795,11 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Classes/Collection/AbstractRecordCollection.php

-
message: "#^Call to method ensureDirectoryExists\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/CliEntryPoint.php

-
message: "#^Call to method findShortestPathCode\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/CliEntryPoint.php

-
message: "#^Call to method getComposer\\(\\) on an unknown class Composer\\\\Script\\\\Event\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/CliEntryPoint.php

-
message: "#^Instantiated class Composer\\\\Util\\\\Filesystem not found\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/CliEntryPoint.php

-
message: "#^Parameter \\$event of method TYPO3\\\\CMS\\\\Core\\\\Composer\\\\CliEntryPoint\\:\\:run\\(\\) has invalid type Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/CliEntryPoint.php

-
message: "#^Call to method getComposer\\(\\) on an unknown class Composer\\\\Script\\\\Event\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/InstallerScripts.php

-
message: "#^Parameter \\$event of method TYPO3\\\\CMS\\\\Core\\\\Composer\\\\InstallerScripts\\:\\:register\\(\\) has invalid type Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/InstallerScripts.php

-
message: "#^Call to method ensureDirectoryExists\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method getComposer\\(\\) on an unknown class Composer\\\\Script\\\\Event\\.$#"
count: 4
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method getExtra\\(\\) on an unknown class Composer\\\\Package\\\\PackageInterface\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method getIO\\(\\) on an unknown class Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method getName\\(\\) on an unknown class Composer\\\\Package\\\\PackageInterface\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method getReplaces\\(\\) on an unknown class Composer\\\\Package\\\\PackageInterface\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method getType\\(\\) on an unknown class Composer\\\\Package\\\\PackageInterface\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method isSymlinkedDirectory\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method normalizePath\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to method relativeSymlink\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Call to static method isPlatformPackage\\(\\) on an unknown class Composer\\\\Repository\\\\PlatformRepository\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Instantiated class Composer\\\\Util\\\\Filesystem not found\\.$#"
count: 4
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Offset string on null in empty\\(\\) does not exist\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^PHPDoc tag @var for variable \\$composerPackage contains unknown class Composer\\\\Package\\\\PackageInterface\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Parameter \\$event of method TYPO3\\\\CMS\\\\Core\\\\Composer\\\\PackageArtifactBuilder\\:\\:run\\(\\) has invalid type Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Parameter \\$rootPackage of method TYPO3\\\\CMS\\\\Core\\\\Composer\\\\PackageArtifactBuilder\\:\\:handleRootPackage\\(\\) has invalid type Composer\\\\Package\\\\PackageInterface\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^Property TYPO3\\\\CMS\\\\Core\\\\Composer\\\\PackageArtifactBuilder\\:\\:\\$event has unknown class Composer\\\\Script\\\\Event as its type\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php

-
message: "#^PHPDoc tag @param has invalid value \\(\\$value\\)\\: Unexpected token \"\\$value\", expected type at offset 153$#"
count: 1
Expand Down Expand Up @@ -2145,36 +2025,11 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Classes/Messaging/FlashMessage.php

-
message: "#^Call to method ensureDirectoryExists\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Package/Cache/ComposerPackageArtifact.php

-
message: "#^Parameter \\$filesystem of method TYPO3\\\\CMS\\\\Core\\\\Package\\\\Cache\\\\ComposerPackageArtifact\\:\\:__construct\\(\\) has invalid type Composer\\\\Util\\\\Filesystem\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Package/Cache/ComposerPackageArtifact.php

-
message: "#^Property TYPO3\\\\CMS\\\\Core\\\\Package\\\\Cache\\\\ComposerPackageArtifact\\:\\:\\$filesystem has unknown class Composer\\\\Util\\\\Filesystem as its type\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Package/Cache/ComposerPackageArtifact.php

-
message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\FrontendInterface\\:\\:require\\(\\)\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Package/Cache/PackageStatesPackageCache.php

-
message: "#^Call to method findShortestPath\\(\\) on an unknown class Composer\\\\Util\\\\Filesystem\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Package/Package.php

-
message: "#^Parameter \\$filesystem of method TYPO3\\\\CMS\\\\Core\\\\Package\\\\Package\\:\\:makePathRelative\\(\\) has invalid type Composer\\\\Util\\\\Filesystem\\.$#"
count: 2
path: ../../typo3/sysext/core/Classes/Package/Package.php

-
message: "#^Offset string does not exist on null\\.$#"
count: 2
Expand Down Expand Up @@ -2570,16 +2425,6 @@ parameters:
count: 2
path: ../../typo3/sysext/core/Classes/Utility/MathUtility.php

-
message: "#^Call to method writeError\\(\\) on an unknown class Composer\\\\IO\\\\IOInterface\\.$#"
count: 1
path: ../../typo3/sysext/core/Resources/PHP/ClassMapGenerator.php

-
message: "#^Parameter \\$io of method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:createMap\\(\\) has invalid type Composer\\\\IO\\\\IOInterface\\.$#"
count: 2
path: ../../typo3/sysext/core/Resources/PHP/ClassMapGenerator.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$GLOBALS\\['BE_USER'\\] BackendUserAuthentication\\)\\: Unexpected token \"\\$GLOBALS\", expected type at offset 9$#"
count: 1
Expand Down Expand Up @@ -7430,11 +7275,6 @@ parameters:
count: 5
path: ../../typo3/sysext/form/Tests/Unit/Service/TranslationServiceTest.php

-
message: "#^Parameter \\$event of method TYPO3\\\\CMS\\\\Frontend\\\\Composer\\\\InstallerScripts\\:\\:register\\(\\) has invalid type Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/frontend/Classes/Composer/InstallerScripts.php

-
message: "#^Variable \\$conf on left side of \\?\\? always exists and is not nullable\\.$#"
count: 1
Expand Down Expand Up @@ -9295,11 +9135,6 @@ parameters:
count: 1
path: ../../typo3/sysext/indexed_search/Classes/Indexer.php

-
message: "#^Parameter \\$event of method TYPO3\\\\CMS\\\\Install\\\\Composer\\\\InstallerScripts\\:\\:register\\(\\) has invalid type Composer\\\\Script\\\\Event\\.$#"
count: 2
path: ../../typo3/sysext/install/Classes/Composer/InstallerScripts.php

-
message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\AbstractAuthenticationService\\:\\:authUser\\(\\)\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"codeception/module-cli": "^1.1",
"codeception/module-filesystem": "^1.0.3",
"codeception/module-webdriver": "^1.4.0",
"composer/composer": "^2.2",
"composer/package-versions-deprecated": "^1.11.99.4",
"friendsofphp/php-cs-fixer": "^3.4",
"friendsoftypo3/phpstan-typo3": "^0.9.0",
Expand Down
Loading

0 comments on commit a46103e

Please sign in to comment.