308 Commits (32852304d0c8823fe535dfc5b19e68952d4a6f41)

Author SHA1 Message Date
Jordi Boggiano 45218092b4
Merge branch '2.2' into main 2 years ago
Jordi Boggiano f808e4907c
Fix handling for non-lowercased enum keyword, fixes #10521 2 years ago
Jordi Boggiano 3446091027
Merge branch '2.2' into main 2 years ago
Jordi Boggiano db8ea45295
Fix enum parsing when the syntax is "enum foo:string {}" without space between name and type, fixes #10498 2 years ago
Jordi Boggiano 06e445ce02
Drop PHP <7.2 and HHVM support from autoload_real, individual autoload files are kept as is for BC 3 years ago
Michael Voříšek 4fdc8b8ee1
dirname(__FILE__) no longer needed 3 years ago
Jordi Boggiano 7e50f37b87
Remove some dead code and deprecate JsonFormatter, JsonFile::JSON_* constants, and TlsHelper 3 years ago
Niels Vanpachtenbeke 1c928466a9
Remove code blocks for php <7.2 compatibility (#10417) 3 years ago
Jordi Boggiano 4e6d54b731
Fix all 5.3 $this-in-closure usages 3 years ago
Jordi Boggiano ccd87c479c
Test fixes 3 years ago
Jordi Boggiano 6ed3aeb343
Remove setExpectedException wrapper 3 years ago
Jordi Boggiano ffd62795bc
Get rid of all the ->at() mock invocations 3 years ago
Jordi Boggiano 2a771dfb2d
Update PHPUnit to 8.5 3 years ago
Jordi Boggiano e1bf45aa80
Fix issue parsing php files with unterminated comments found inside backticks, fixes #10385 3 years ago
Helmut Hummel 0b9e1da4fc
Allow recursively call composerRequire (#10312)
Fixes: #10311
Related: #10065
3 years ago
Jordi Boggiano 65765a148a
Explicitly deprecate misuse of the link setters to enforce the fact they expect maps (#10281) 3 years ago
Martin Herndl 7eca450d9b
Add wildcard support to ignore-platform-req, fixes #10045 (#10083) 3 years ago
Martin Herndl 3013674c92
Refactor ignore platform reqs checks (#10079)
Introduces a `PlatformRequirementFilter` with methods that help to decide if a requirement is ignored or not as discussed in #10045 but without changing behaviour.
3 years ago
Jordi Boggiano 6aa8a466b7
Fix tests 3 years ago
Jordi Boggiano cb0293cf30
Finalize phpstan level 6 for tests dir, closes #10159 3 years ago
Jordi Boggiano 44b69ba77f
Upgrade php-cs-fixer to 3.x and fix CS 3 years ago
megubyte 135f806f6f
phpstan: update tests/Composer/Test/Autoload/* to level 6 standard (#10223) 3 years ago
Martin Herndl bd8b39fe01
Add types to `Package` (#10210) 3 years ago
Jordi Boggiano 9599eb613b
Type annotations 3 years ago
Jordi Boggiano d64d1adf61
Rewrite php file cleaning step to be less regex intensive and support extreme cases better, fixes #10106 (#10107) 3 years ago
Jordi Boggiano 8cd2d0e541
Fix scanning of classmaps in files containing invalid Unicode, fixes #10102 3 years ago
Jordi Boggiano d8054d1d2f
Add more possessive quantifiers, unicode flag and support for more post-heredoc syntax, fix test file syntax being invalid 3 years ago
Jordi Boggiano 3f79e59f69
Add test assertions for heredoc marker inside the text 3 years ago
jrfnl b66b23a03f
ClassMapGeneratorTest: add test with consecutive duplicate heredoc markers
... as well as a test with heredoc markers with only a newline character between the start and end marker.
3 years ago
Jordi Boggiano d3c176ec69
PHPStan Level 5 (#10070)
* Bump PHPStan to level 5

* Update seld/phar-utils to latest

* Add phpstan-setup / phpstan scripts
3 years ago
jrfnl e729c418dd ClassMapGenerator: add test for "marker in text" bug
In PHP < 7.3, the heredoc/nowdoc marker was allowed to occur in the text, as long as it did not occur at the very start of the line.

This was also not handled correctly.

Ref: https://www.php.net/manual/en/migration73.incompatible.php#migration73.incompatible.core.heredoc-nowdoc
3 years ago
jrfnl 9588654ae3 ClassMapGenerator: add tests for "long heredoc" bug
... to proof the existence of the bug and demonstrate the effect.

Note: in the test the backtrack limit is being lowered (and restored back to the default afterwards) to prevent the tests needing ridiculously huge test fixture files.
3 years ago
Ayesh Karunaratne 228428747a
Add support for autoloading Enums
PHP 8.1 supports Enums, and [Enums follow class-semantics](https://php.watch/versions/8.1/enums#class-semantics-autoload).

Composer's class-map generator currently looks for `class`, `interface`, and `trait` keywords. If Composer is run in PHP 8.1 or later, Composer now additionally looks for `enum` keyword as well. This is similar to how Hack's `enum` support is added.

This PR also adds tests for basic enums, backed enums, namespaced enums, and an enum that implements an interface and extends a class.
3 years ago
Jordi Boggiano 07b8c23f02
Merge branch '1.10' 3 years ago
Jordi Boggiano 92313447d6
Filter out exclude-from-classmap rules to avoid generating very long regexes, fixes #9487 3 years ago
Nicolas Grekas ba94445bb9 Ensure InstalledVersions reports info about all currently registered class loaders 3 years ago
Jordi Boggiano b7d770659b
CS fixes 4 years ago
Jordi Boggiano b574f10d9d
Rename mainPackage to rootPackage in AutoloadGenerator and ensure we use RootPackageInterface 4 years ago
Jakub Bouček 8dc5effee7
AutoloadGenerator: Send error HTTP status on error 4 years ago
Jordi Boggiano 56c65a58e2
Make platform-check only check non-dev requires, refs #9412 4 years ago
Jordi Boggiano 8c1355f448
Improve output of platform check further in case errors are hidden 4 years ago
Jakub Bouček 2595de07ce
AutoloadGenerator: Trigger native PHP error on platform checks fails - tests 4 years ago
Jakub Bouček 6f1761fe18
AutoloadGenerator: Send error HTTP status on error - update tests 4 years ago
zorn 5aa90baab1 Add new lines to platform reqs issues 4 years ago
Jordi Boggiano 24abd233ec
Merge branch 'master' into code-improvements 4 years ago
Jordi Boggiano 0775e261c5
Merge remote-tracking branch 'lstrojny/apcu-prefix' 4 years ago
Michael Telgmann a4509d28e7
Introduce constants for Composer\Package\Link types 4 years ago
Simon Berger 80a75e9959 Minor code improvements 4 years ago
Lars Strojny 0b6abf3b96
APCu prefix as a separate option 4 years ago
Lars Strojny de0085767c
Sanitize prefix 4 years ago