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.
4 years ago
Jordi Boggiano
07b8c23f02
Merge branch '1.10'
4 years ago
Jordi Boggiano
92313447d6
Filter out exclude-from-classmap rules to avoid generating very long regexes, fixes #9487
4 years ago
Nicolas Grekas
ba94445bb9
Ensure InstalledVersions reports info about all currently registered class loaders
4 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
Lars Strojny
dafd225a35
Allow to pass a string for apcu-autoloader to set the APCu prefix
4 years ago
Jordi Boggiano
d942c65e0c
Fix more warnings
4 years ago
Jordi Boggiano
1593b67230
Fix warnings on higher phpunit versions
4 years ago
Jordi Boggiano
67a88880ec
Get rid of EmptyConstraint
4 years ago
Yanick Witschi
bde9502473
Made the constraint argument in Link mandatory
4 years ago
Jordi Boggiano
537402f814
Add tests for #8861
4 years ago
Jordi Boggiano
21e708f2c4
Remove upper bound PHP version checks from platform-check as there is not enough value added and it risks causing issues
4 years ago
Jordi Boggiano
45d3e133a4
Avoid checking for unbounded constraints in platform checks
4 years ago
Jordi Boggiano
6a6ea6057f
Handle provider/replacer packages and avoid checking extensions which are provided by packages, refs #8546
4 years ago
Jordi Boggiano
d494df61ff
Make sure platform-check returns a non-0 exit code if it fails
4 years ago
Jordi Boggiano
7049bbb714
Switch require_once to require for autoload_static as the once variant seems unnecessary
4 years ago
Jordi Boggiano
0d1922dc27
Add a Composer\Versions class which is available in all projects at runtime to query installed packages/versions
4 years ago
Jordi Boggiano
2c8a4a1b93
Add platform-check config option to disable platform_check.php generation, and disable it for Composer
5 years ago
Nicolas Grekas
6463ab9e49
Optimize extension checks
5 years ago
Yanick Witschi
e23710f92d
Implemented php version check in autoload.php ( #8546 )
5 years ago