Jordi Boggiano
5122bd42fb
Merge branch '2.2' into main
3 years ago
Jordi Boggiano
f31700bf19
Sort packages with the same weight alphabetically to have a completely stable sort not dependent on input order, fixes #10614
3 years ago
Jordi Boggiano
45218092b4
Merge branch '2.2' into main
3 years ago
Jordi Boggiano
f808e4907c
Fix handling for non-lowercased enum keyword, fixes #10521
3 years ago
Jordi Boggiano
3446091027
Merge branch '2.2' into main
3 years ago
Jordi Boggiano
db8ea45295
Fix enum parsing when the syntax is "enum foo:string {}" without space between name and type, fixes #10498
3 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
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
6aa8a466b7
Fix tests
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
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
Nicolas Grekas
ba94445bb9
Ensure InstalledVersions reports info about all currently registered class loaders
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
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
Simon Berger
80a75e9959
Minor code improvements
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
Nicolas Grekas
6463ab9e49
Optimize extension checks
4 years ago
Yanick Witschi
e23710f92d
Implemented php version check in autoload.php ( #8546 )
4 years ago
remorhaz
8df263a756
Test added for issue #8622 fix
5 years ago
Markus Staab
e47aa38ad4
Added phpdoc for ComposerAutoloaderInit$SHA1::getLoader() ( #8393 )
5 years ago
zakonnic
f159eb724a
Add test for double gap in php-file
5 years ago
ShiraNai7
a2b647a99e
Handle absolute phar:// paths in autoload_static.php
6 years ago
Rob Bast
25e3f6d4b9
expand regex and testcases
6 years ago
Rob Bast
971528916b
fix regex for heredoc/nowdoc
...
* take into account relaxed changes introduced in php 7.3
* see: 4887357269
* allow " as well as ', which was introduced in php 5.3
closes #8080
6 years ago
Jordi Boggiano
3b9d6769bf
Fix class names in comments being parsed in short_open_tags files, fixes #7289
6 years ago
Vladimir Reznichenko
c8615358cb
SCA with PHP Inspections (EA Extended)
7 years ago
Jordi Boggiano
e9d04f2b2d
Merge branch '1.2'
8 years ago
Hans-Joachim Michl
817b2747c7
Fix #5672
...
This fixes the issue reported in #5672 .
It just makes sure the ZendGuard encoded files can be autoloaded correctly.
8 years ago
Konstantin.Myakshin
dc70b40d34
Use implode instead of join
8 years ago
Rob Bast
181b172e77
test cases for #5701
8 years ago
SpacePossum
2ae0800cd3
Remove useless concat.
8 years ago
Jordi Boggiano
05fab170a7
Merge branch '1.0'
9 years ago
Jordi Boggiano
f0d67923a5
Fix classmap generator over anonymous classes extending/implementing something, fixes #5239
9 years ago