b26f11ca0b
This PR was merged into the 5.2-dev branch.
Discussion
----------
[DependencyInjection] Add the Required attribute
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | TODO
This PR proposes a new attribute `#[Required]` that can be used instead of the `@required` annotation.
Commits
-------
ea262441e7
[DependencyInjection] Add the Required attribute.
46 lines
3.0 KiB
PHP
46 lines
3.0 KiB
PHP
<?php
|
|
|
|
if (false === getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
|
|
echo "Please define the SYMFONY_PATCH_TYPE_DECLARATIONS env var when running this script.\n";
|
|
exit(1);
|
|
}
|
|
|
|
require __DIR__.'/../.phpunit/phpunit-8.3-0/vendor/autoload.php';
|
|
|
|
$loader = require __DIR__.'/../vendor/autoload.php';
|
|
|
|
Symfony\Component\ErrorHandler\DebugClassLoader::enable();
|
|
|
|
foreach ($loader->getClassMap() as $class => $file) {
|
|
switch (true) {
|
|
case false !== strpos(realpath($file), '/vendor/'):
|
|
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
|
|
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadParent.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/ParseError.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/Debug/Tests/Fixtures/'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes_80.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/uniontype_classes.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ParentNotExists.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/WitherStaticReturnType.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/'):
|
|
case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
|
|
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php80Dummy.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/Routing/Tests/Fixtures/AttributeFixtures'):
|
|
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
|
|
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php') && \PHP_VERSION_ID < 70400:
|
|
continue 2;
|
|
}
|
|
|
|
class_exists($class);
|
|
}
|
|
|
|
Symfony\Component\ErrorHandler\DebugClassLoader::checkClasses();
|