mozart
mozart copied to clipboard
nesbot/carbon empty searchNamespace
nesbot/carbon 1.39.0 "prefixes" the end of lines because its autoload key has an empty key.
Output src/carbon/Carbon.php :
<?php
Mozart\
/*Mozart\
*Mozart\ This file is part of the Carbon package.Mozart\
*Mozart\
*Mozart\ (c)Mozart\ Brian Nesbitt <[email protected]>Mozart\
*Mozart\
*Mozart\ For the full copyright and license information,Mozart\ please view the LICENSE
Mozart\ *Mozart\ file that was distributed with this source code.Mozart\
*/Mozart\
namespace Carbon;Mozart\
use Carbon\Exceptions\InvalidDateException;Mozart\
use Closure;Mozart\
use DateInterval;Mozart\
use DatePeriod;Mozart\
use DateTime;Mozart\
use DateTimeInterface;Mozart\
use DateTimeZone;Mozart\
use InvalidArgumentException;Mozart\
"autoload": {
"psr-4": {
"": "src/"
}
},
Minimal reproducible composer.json:
{
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"nesbot/carbon":"1.39.0"
},
"require-dev": {
"coenjacobs/mozart": "dev-master",
"cweagans/composer-patches": "*"
},
"extra": {
"mozart": {
"dep_namespace": "Mozart\\",
"dep_directory": "/dep_directory/",
"classmap_prefix": "Mozart_",
"classmap_directory": "/classmap_directory/",
"delete_vendor_directories": false,
"override_autoload": {
"kylekatarnls/update-helper": {},
"symfony/polyfill-intl-idn": {},
"symfony/translation":{},
"symfony/polyfill-mbstring": {},
"symfony/translation-contracts": {}
}
}
}
}
The solution might be in the NamespaceReplacer's regex, which would properly match if $searchNamespace was not an empty string.
I tried all the open PRs but they don't help.
A working solution with failing tests, not even ready for a draft PR but good enough for me to use:
https://github.com/coenjacobs/mozart/compare/master...BrianHenryIE:empty-namespace-key?expand=1