Major refactoring cleanup: - Add new controller architecture (class-controller-*.php) - Add new settings-v2 UI (views/settings-v2/) - Add new CSS architecture (agentic-sidebar.css, tokens) - Add esbuild build pipeline (scripts/build.js, package.json) - Add composer dependencies (vendor/) - Add frontend src directory (assets/js/src/index.jsx) - Add documentation files - Remove old/obsolete files (class-settings.php, old CSS) This commits all pending changes from previous refactoring efforts.
60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\Component\PropertyInfo\Extractor;
|
|
|
|
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
|
|
use Symfony\Component\TypeInfo\Type;
|
|
|
|
/**
|
|
* Extracts the constructor argument type using ConstructorArgumentTypeExtractorInterface implementations.
|
|
*
|
|
* @author Dmitrii Poddubnyi <dpoddubny@gmail.com>
|
|
*/
|
|
final class ConstructorExtractor implements PropertyTypeExtractorInterface
|
|
{
|
|
/**
|
|
* @param iterable<int, ConstructorArgumentTypeExtractorInterface> $extractors
|
|
*/
|
|
public function __construct(
|
|
private readonly iterable $extractors = [],
|
|
) {
|
|
}
|
|
|
|
public function getType(string $class, string $property, array $context = []): ?Type
|
|
{
|
|
foreach ($this->extractors as $extractor) {
|
|
if (null !== $value = $extractor->getTypeFromConstructor($class, $property)) {
|
|
return $value;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @deprecated since Symfony 7.3, use "getType" instead
|
|
*/
|
|
public function getTypes(string $class, string $property, array $context = []): ?array
|
|
{
|
|
trigger_deprecation('symfony/property-info', '7.3', 'The "%s()" method is deprecated, use "%s::getType()" instead.', __METHOD__, self::class);
|
|
|
|
foreach ($this->extractors as $extractor) {
|
|
$value = $extractor->getTypesFromConstructor($class, $property);
|
|
if (null !== $value) {
|
|
return $value;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|