prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
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\ObjectMapper\DependencyInjection;
use Symfony\Component\Dependenc... |
$reverseClassObjectMapperMetadataFactory = $container->getDefinition('object_mapper.metadata_factory.reverse_class');
$classes = [];
foreach ($container->findTaggedResourceIds('object_mapper.map') as $tags) {
foreach | gPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('object_mapper.metadata_factory.reverse_class')) {
return;
} | {
"filepath": "src/Symfony/Component/ObjectMapper/DependencyInjection/ReverseMappingPass.php",
"language": "php",
"file_size": 1282,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
/**
* @author Bernhard... | provided by this extension.
*/
private ?FormTypeGuesserInterface $typeGuesser = null;
/**
* Whether the type guesser has been loaded.
*/
private bool $typeGuesserLoaded = false;
public function getType(string $name): FormTy | ce[]
*/
private array $types;
/**
* The type extensions provided by this extension.
*
* @var FormTypeExtensionInterface[][]
*/
private array $typeExtensions;
/**
* The type guesser | {
"filepath": "src/Symfony/Component/Form/AbstractExtension.php",
"language": "php",
"file_size": 4552,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Contracts\Service\ResetInterface;
/**
* Default implementation of {@link FormRendererEngineInterface}.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class AbstractRendererEngine implements FormRendererEngineInterface... | private array $resourceHierarchyLevels = [];
/**
* @var array<string, array<string, bool>>
*/
private array $resourceInheritability = [];
/**
* Creates a new renderer engine.
*
* @param array $defaultThemes The defau | rray $themes = [];
/**
* @var bool[]
*/
protected array $useDefaultThemes = [];
/**
* @var array[]
*/
protected array $resources = [];
/**
* @var array<array<int|false>>
*/
| {
"filepath": "src/Symfony/Component/Form/AbstractRendererEngine.php",
"language": "php",
"file_size": 7848,
"cut_index": 716,
"middle_length": 229
} |
/*
* 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\Form;
use Symfony\Component\Form\Extension\Core\Type\FormTy... | FormBuilderInterface $builder, array $options): void
{
}
public function buildView(FormView $view, FormInterface $form, array $options): void
{
}
public function finishView(FormView $view, FormInterface $form, array $options): voi | mplements FormTypeInterface
{
public function getParent(): ?string
{
return FormType::class;
}
public function configureOptions(OptionsResolver $resolver): void
{
}
public function buildForm( | {
"filepath": "src/Symfony/Component/Form/AbstractType.php",
"language": "php",
"file_size": 1144,
"cut_index": 518,
"middle_length": 229
} |
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\Form;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author... | erInterface $builder, array $options): void
{
}
public function buildView(FormView $view, FormInterface $form, array $options): void
{
}
public function finishView(FormView $view, FormInterface $form, array $options): void
{
| {
}
public function buildForm(FormBuild | {
"filepath": "src/Symfony/Component/Form/AbstractTypeExtension.php",
"language": "php",
"file_size": 850,
"cut_index": 535,
"middle_length": 52
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\AlreadySubmittedException;
use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\PropertyAccess\PropertyPathInterface... | ce $config,
) {
}
/**
* Unsupported method.
*/
public function offsetExists(mixed $offset): bool
{
return false;
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* | nterface
{
private ?FormInterface $parent = null;
private bool $submitted = false;
/**
* Creates a new button from a form configuration.
*/
public function __construct(
private FormConfigInterfa | {
"filepath": "src/Symfony/Component/Form/Button.php",
"language": "php",
"file_size": 7863,
"cut_index": 716,
"middle_length": 229
} |
\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
/**
* A builder for {@link Button} instances.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @implements \IteratorAggregate<string, FormBuilderInterface>
*/
class ButtonBuilder implements \Ite... | e || null === $name) {
throw new InvalidArgumentException('Buttons cannot have empty names.');
}
$this->name = $name;
FormConfigBuilder::validateName($name);
}
/**
* Unsupported method.
*
* @thr | te array $attributes = [];
/**
* @throws InvalidArgumentException if the name is empty
*/
public function __construct(
?string $name,
private array $options = [],
) {
if ('' === $nam | {
"filepath": "src/Symfony/Component/Form/ButtonBuilder.php",
"language": "php",
"file_size": 14784,
"cut_index": 921,
"middle_length": 229
} |
* 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\Form;
class CallbackTransformer implements DataTransformerInterf... | $reverseTransform(...);
}
public function transform(mixed $data): mixed
{
return ($this->transform)($data);
}
public function reverseTransform(mixed $data): mixed
{
return ($this->reverseTransform)($data);
}
} | = $transform(...);
$this->reverseTransform = | {
"filepath": "src/Symfony/Component/Form/CallbackTransformer.php",
"language": "php",
"file_size": 832,
"cut_index": 523,
"middle_length": 52
} |
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\Form;
/**
* Writes and reads values to/from an object or array bound to a for... | ject graph.
*
* @throws Exception\AccessException If unable to write the given value
*/
public function setValue(object|array &$viewData, mixed $value, FormInterface $form): void;
/**
* Returns whether a value can be read from | ws Exception\AccessException If unable to read from the given form data
*/
public function getValue(object|array $viewData, FormInterface $form): mixed;
/**
* Sets the value at the end of the property of the ob | {
"filepath": "src/Symfony/Component/Form/DataAccessorInterface.php",
"language": "php",
"file_size": 1607,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (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\Form;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface DataMapperInterface
{
/**... | rmInterface} instances
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported
*/
public function mapDataToForms(mixed $viewData, \Traversable $forms): void;
/**
* Maps the model data of | fining their underlying model data.
*
* @param mixed $viewData View data of the compound form being initialized
* @param \Traversable<mixed, FormInterface> $forms A list of {@link Fo | {
"filepath": "src/Symfony/Component/Form/DataMapperInterface.php",
"language": "php",
"file_size": 2483,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\TransformationFailedException;
/**
* Transforms a value between different representations.
*
* @author Bernh... | normalize the model data.
* This is mainly useful when the same form type (the same configuration)
* has to handle different kind of underlying data, e.g The DateType can
* deal with strings or \DateTime objects as input.
*
| tion to a transformed representation.
*
* This method is called when the form field is initialized with its default data, on
* two occasions for two types of transformers:
*
* 1. Model transformers which | {
"filepath": "src/Symfony/Component/Form/DataTransformerInterface.php",
"language": "php",
"file_size": 3926,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Form;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\Guess\Guess;
u... | return null;
}
return new TypeGuess(EnumType::class, ['class' => ltrim($enum, '?')], Guess::HIGH_CONFIDENCE);
}
public function guessRequired(string $class, string $property): ?ValueGuess
{
if (!($enum = $this->getPr | array<string, string|false>>
*/
private array $cache = [];
public function guessType(string $class, string $property): ?TypeGuess
{
if (!($enum = $this->getPropertyType($class, $property))) {
| {
"filepath": "src/Symfony/Component/Form/EnumFormTypeGuesser.php",
"language": "php",
"file_size": 2218,
"cut_index": 563,
"middle_length": 229
} |
y simple fields
* or map children model data for compound fields
*
* A date field, for example, may store a date as "Y-m-d" string (1) in the
* object. To facilitate processing in the field, this value is normalized
* to a DateTime object (2). In the HTML representation of your form, a
* localized string (3... | ViewTransformer().
*
* In some cases though it makes sense to make format (1) configurable. To
* demonstrate this, let's extend our above date field to store the value
* either as "Y-m-d" string or as timestamp. Internally we still want to
* use a Dat | e,
* a checkbox field uses a Boolean value for both internal processing and
* storage in the object. In these cases you need to set a view transformer
* to convert between formats (2) and (3). You can do this by calling
* add | {
"filepath": "src/Symfony/Component/Form/Form.php",
"language": "php",
"file_size": 36585,
"cut_index": 2151,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Extension\Core\Type\TextType;
/**
... | The data of children who haven't been converted to form builders yet.
*/
private array $unresolvedChildren = [];
public function __construct(?string $name, ?string $dataClass, EventDispatcherInterface $dispatcher, FormFactoryInterface $factor | extends FormConfigBuilder implements \IteratorAggregate, FormBuilderInterface
{
/**
* The children of the form builder.
*
* @var FormBuilderInterface[]
*/
private array $children = [];
/**
* | {
"filepath": "src/Symfony/Component/Form/FormBuilder.php",
"language": "php",
"file_size": 6777,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (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\Form;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @extends \Traversable<string, FormBui... | ace>|null $type
* @param array<string, mixed> $options
*/
public function add(string|self $child, ?string $type = null, array $options = []): static;
/**
* Creates a form builder.
*
* @param string | within
* the group. Otherwise the existing field is overwritten.
*
* If you add a nested group, this group should also be represented in the
* object hierarchy.
*
* @param class-string<FormTypeInterf | {
"filepath": "src/Symfony/Component/Form/FormBuilderInterface.php",
"language": "php",
"file_size": 2029,
"cut_index": 563,
"middle_length": 229
} |
mplements FormConfigBuilderInterface
{
protected bool $locked = false;
/**
* Caches a globally unique {@link NativeRequestHandler} instance.
*/
private static NativeRequestHandler $nativeRequestHandler;
private string $name;
private ?PropertyPathInterface $propertyPath = null;
privat... | = false;
private mixed $emptyData = null;
private array $attributes = [];
private mixed $data = null;
private ?string $dataClass;
private bool $dataLocked = false;
private FormFactoryInterface $formFactory;
private string $acti | array $viewTransformers = [];
private array $modelTransformers = [];
private ?DataMapperInterface $dataMapper = null;
private bool $required = true;
private bool $disabled = false;
private bool $errorBubbling | {
"filepath": "src/Symfony/Component/Form/FormConfigBuilder.php",
"language": "php",
"file_size": 18280,
"cut_index": 1331,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface FormConfigBuilderInterface extends FormConfigInterface
{
... | * Adds an event subscriber for events on this form.
*
* @return $this
*/
public function addEventSubscriber(EventSubscriberInterface $subscriber): static;
/**
* Appends / prepends a transformer to the view transformer chain.
| e called before
* listeners with a lower priority.
*
* @return $this
*/
public function addEventListener(string $eventName, callable $listener, int $priority = 0): static;
/**
| {
"filepath": "src/Symfony/Component/Form/FormConfigBuilderInterface.php",
"language": "php",
"file_size": 7327,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
/**
* The configuration of a {@link Form} object.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface FormCon... | erface;
/**
* Returns whether the form should be mapped to an element of its
* parent's data.
*/
public function getMapped(): bool;
/**
* Returns whether the form's data should be modified by reference.
*/
public | name of the form used as HTTP parameter.
*/
public function getName(): string;
/**
* Returns the property path that the form should be mapped to.
*/
public function getPropertyPath(): ?PropertyPathInt | {
"filepath": "src/Symfony/Component/Form/FormConfigInterface.php",
"language": "php",
"file_size": 5249,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (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\Form;
use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Translation\Tra... | The translated error message
* @param string|null $messageTemplate The template for the error message
* @param array $messageParameters The parameters that should be
* substituted in the | this error.
*/
private ?FormInterface $origin = null;
/**
* Any array key in $messageParameters will be used as a placeholder in
* $messageTemplate.
*
* @param string $message | {
"filepath": "src/Symfony/Component/Form/FormError.php",
"language": "php",
"file_size": 2987,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\LogicException;
use Symfony\Component\Form\Exception\OutOfBoundsException;
use Symfony\Com... | ors.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @template T of FormError|FormErrorIterator
*
* @implements \ArrayAccess<int, T>
* @implements \RecursiveIterator<int, T>
* @implements \SeekableIterator<int, T>
*/
class FormErrorIterato | FormError} and {@link FormErrorIterator} objects
* to the $errors constructor argument.
*
* You can also wrap the iterator into a {@link \RecursiveIteratorIterator} to
* flatten the recursive structure into a flat list of err | {
"filepath": "src/Symfony/Component/Form/FormErrorIterator.php",
"language": "php",
"file_size": 7531,
"cut_index": 716,
"middle_length": 229
} |
n 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\Form;
use Symfony\Contracts\EventDispatcher\Event;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormEv... | face
{
return $this->form;
}
/**
* Returns the data associated with this event.
*/
public function getData(): mixed
{
return $this->data;
}
/**
* Allows updating with some filtered data.
*/
| nt.
*/
public function getForm(): FormInter | {
"filepath": "src/Symfony/Component/Form/FormEvent.php",
"language": "php",
"file_size": 980,
"cut_index": 582,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Event\PostSetDataEvent;
use Symfony\Component\Form\Event\PostSubmitEvent;
use Symfony\Component\Form\Event\PreSetDataEvent... | l}.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
final class FormEvents
{
/**
* The PRE_SUBMIT event is dispatched at the beginning of the Form::submit() method.
*
* It can be used to:
* - Change data from the request, | ps://symfony.com/doc/any/components/form/form_events.html}.
*
* To learn how to dynamically modify forms using events check the cookbook
* entry at {@link https://symfony.com/doc/any/cookbook/form/dynamic_form_modification.htm | {
"filepath": "src/Symfony/Component/Form/FormEvents.php",
"language": "php",
"file_size": 4121,
"cut_index": 614,
"middle_length": 229
} |
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\Form;
/**
* Interface for extensions which provide types, type e... | tring $name The name of the type
*/
public function hasType(string $name): bool;
/**
* Returns the extensions for the given type.
*
* @param string $name The name of the type
*
* @return FormTypeExtensionInterface[]
| validArgumentException if the given type is not supported by this extension
*/
public function getType(string $name): FormTypeInterface;
/**
* Returns whether the given type is supported.
*
* @param s | {
"filepath": "src/Symfony/Component/Form/FormExtensionInterface.php",
"language": "php",
"file_size": 1434,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Flow\For... | tring $type = FormType::class, mixed $data = null, array $options = []): FormInterface
{
return $this->createBuilder($type, $data, $options)->getForm();
}
/**
* @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInter | function __construct(
private FormRegistryInterface $registry,
) {
}
/**
* @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface)
*/
public function create(s | {
"filepath": "src/Symfony/Component/Form/FormFactory.php",
"language": "php",
"file_size": 4552,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Extension\Core\CoreExtension;
/**
* The default implementation of FormFactoryBuilderInterface.
*
* @author Bernhard Sc... | tensions = [];
/**
* @var FormTypeGuesserInterface[]
*/
private array $typeGuessers = [];
public function __construct(
private bool $forceCoreExtension = false,
) {
}
public function setResolvedTypeFactory(Resol | xtensionInterface[]
*/
private array $extensions = [];
/**
* @var FormTypeInterface[]
*/
private array $types = [];
/**
* @var FormTypeExtensionInterface[][]
*/
private array $typeEx | {
"filepath": "src/Symfony/Component/Form/FormFactoryBuilder.php",
"language": "php",
"file_size": 3864,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Form;
/**
* A builder for FormFactoryInterface objects.
*
* @author Bernhard Schussek <bschussek@gmai... | Interface $extension): static;
/**
* Adds a list of extensions to be loaded by the factory.
*
* @param FormExtensionInterface[] $extensions The extensions
*
* @return $this
*/
public function addExtensions(array $exte | ResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolvedTypeFactory): static;
/**
* Adds an extension to be loaded by the factory.
*
* @return $this
*/
public function addExtension(FormExtension | {
"filepath": "src/Symfony/Component/Form/FormFactoryBuilderInterface.php",
"language": "php",
"file_size": 2402,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Flow\FormFlowBuilderInterface;
use Symfony\Component\Form\Flow\Fo... | a
*
* @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface)
*
* @throws InvalidOptionsException if any given option is not applicable to the given type
*/
public function create(string $type | a class or a property.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface FormFactoryInterface
{
/**
* Returns a form.
*
* @see createBuilder()
*
* @param mixed $data The initial dat | {
"filepath": "src/Symfony/Component/Form/FormFactoryInterface.php",
"language": "php",
"file_size": 3749,
"cut_index": 614,
"middle_length": 229
} |
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @extends \ArrayAccess<string, FormInterface>
* @extends \Traversable<string, FormInterface>
*/
interface FormInterface extends \ArrayAccess, \Traversable, \Countable
{
/**
* Sets the parent form.
*
* @param FormInterface|null $parent The par... |
*/
public function getParent(): ?self;
/**
* Adds or replaces a child to the form.
*
* @param FormInterface|string $child The FormInterface instance or the name of the child
* @param string|null $type The ch | eption when trying to set a parent for a form with
* an empty name
*/
public function setParent(?self $parent): static;
/**
* Returns the parent form. | {
"filepath": "src/Symfony/Component/Form/FormInterface.php",
"language": "php",
"file_size": 9486,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\ExceptionInterface;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Ex... | = [];
private FormTypeGuesserInterface|false|null $guesser = false;
private array $checkedTypes = [];
/**
* @param FormExtensionInterface[] $extensions
*
* @throws UnexpectedTypeException if any extension does not implement For | */
class FormRegistry implements FormRegistryInterface
{
/**
* @var FormExtensionInterface[]
*/
private array $extensions = [];
/**
* @var ResolvedFormTypeInterface[]
*/
private array $types | {
"filepath": "src/Symfony/Component/Form/FormRegistry.php",
"language": "php",
"file_size": 4576,
"cut_index": 614,
"middle_length": 229
} |
/*
* 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\Form;
/**
* The central registry of the Form component.
*... | urns whether the given form type is supported.
*/
public function hasType(string $name): bool;
/**
* Returns the guesser responsible for guessing types.
*/
public function getTypeGuesser(): ?FormTypeGuesserInterface;
/**
| om the form extensions.
*
* @throws Exception\InvalidArgumentException if the type cannot be retrieved from any extension
*/
public function getType(string $name): ResolvedFormTypeInterface;
/**
* Ret | {
"filepath": "src/Symfony/Component/Form/FormRegistryInterface.php",
"language": "php",
"file_size": 1157,
"cut_index": 518,
"middle_length": 229
} |
/*
* 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\JsonStreamer\DataModel\Write;
use Symfony\Component\TypeInf... | unction withAccessor(string $accessor): self
{
return new self($accessor, $this->type);
}
public function getIdentifier(): string
{
return (string) $this->getType();
}
public function getAccessor(): string
{
| ud@gmail.com>
*
* @internal
*/
final class BackedEnumNode implements DataModelNodeInterface
{
public function __construct(
private string $accessor,
private BackedEnumType $type,
) {
}
public f | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Write/BackedEnumNode.php",
"language": "php",
"file_size": 1128,
"cut_index": 518,
"middle_length": 229
} |
ge.
*
* (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\JsonStreamer\DataModel\Write;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use... | onNode::class => 3,
ObjectNode::class => 2,
BackedEnumNode::class => 1,
ScalarNode::class => 0,
];
/**
* @var list<DataModelNodeInterface>
*/
private array $nodes;
/**
* @param list<DataModelNodeInte | rted by their precision (descending).
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class CompositeNode implements DataModelNodeInterface
{
private const NODE_PRECISION = [
Collecti | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Write/CompositeNode.php",
"language": "php",
"file_size": 2521,
"cut_index": 563,
"middle_length": 229
} |
hp
/*
* 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\JsonStreamer\DataModel\Write;
use Symfony\Component\Type... | sor(string $accessor): self
{
return new self($accessor, $this->type);
}
public function getIdentifier(): string
{
return (string) $this->getType();
}
public function getAccessor(): string
{
return $thi | om>
*
* @internal
*/
final class ScalarNode implements DataModelNodeInterface
{
public function __construct(
private string $accessor,
private BuiltinType $type,
) {
}
public function withAcces | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Write/ScalarNode.php",
"language": "php",
"file_size": 1105,
"cut_index": 515,
"middle_length": 229
} |
/*
* 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\ObjectMapper;
use Symfony\Component\ObjectMapper\Exception\... | T>|null $target The object or class to map to
*
* @return T
*
* @throws MappingException When the mapping configuration is wrong
* @throws MappingTransformException When a transformation on an object does not return an obj |
*
* @author Antoine Bluchet <soyuka@gmail.com>
*/
interface ObjectMapperInterface
{
/**
* @template T of object
*
* @param object $source The object to map from
* @param T|class-string< | {
"filepath": "src/Symfony/Component/ObjectMapper/ObjectMapperInterface.php",
"language": "php",
"file_size": 1173,
"cut_index": 518,
"middle_length": 229
} |
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\ObjectMapper\Transform;
use Symfony\Component\ObjectMapper\Exception\MappingEx... | public function __construct(
private ?ObjectMapperInterface $objectMapper = null,
public readonly ?string $targetClass = null,
) {
}
public function withObjectMapper(ObjectMapperInterface $objectMapper): static
{
| omponent\ObjectMapper\TransformCallableInterface;
/**
* @template T of object
*
* @implements TransformCallableInterface<object, T>
*/
class MapCollection implements TransformCallableInterface, ObjectMapperAwareInterface
{
| {
"filepath": "src/Symfony/Component/ObjectMapper/Transform/MapCollection.php",
"language": "php",
"file_size": 1638,
"cut_index": 537,
"middle_length": 229
} |
/*
* 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\ObjectMapper\Condition;
use Symfony\Component\ObjectMapper... | owing early skip of mapping rules based on
* source/target class checks.
*
* @template T of object
* @template T2 of object
*
* @extends ConditionCallableInterface<T, T2>
*/
interface ClassRuleConditionCallableInterface extends ConditionCallableInte | rty value, all | {
"filepath": "src/Symfony/Component/ObjectMapper/Condition/ClassRuleConditionCallableInterface.php",
"language": "php",
"file_size": 797,
"cut_index": 517,
"middle_length": 14
} |
?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\ObjectMapper\Condition;
/**
* @template T of object
... | Name) ? $className : [$className];
}
public function __invoke(mixed $value, object $source, ?object $target): bool
{
foreach ($this->sources as $validSource) {
if ($source instanceof $validSource) {
return t | */
private readonly array $sources;
/**
* @param class-string<T>|array<class-string<T>> $className
*/
public function __construct(string|array $className)
{
$this->sources = \is_array($class | {
"filepath": "src/Symfony/Component/ObjectMapper/Condition/SourceClass.php",
"language": "php",
"file_size": 1058,
"cut_index": 513,
"middle_length": 229
} |
RequestWithSourceAndAutoMappedView;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ClassMap\CostRequestWithSourceView;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ClassMap\Quote;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ClassMap\QuoteRequestView;
use Symfony\Component\ObjectMapper\Tests\Fixtures\Class... | ConditionalSourceMapAddress;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ConditionalSourceMap\User as ConditionalSourceMapUser;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ConditionalSourceMap\UserDto as ConditionalSourceMapUserDto;
use Symfon | onent\ObjectMapper\Tests\Fixtures\ClassWithoutTarget;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ConditionalConstructorArgument\InputSource;
use Symfony\Component\ObjectMapper\Tests\Fixtures\ConditionalSourceMap\Address as | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/ObjectMapperTest.php",
"language": "php",
"file_size": 45513,
"cut_index": 2151,
"middle_length": 229
} |
* 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\ObjectMapper\Tests\Fixtures;
use Symfony\Component\VarExporter\... | return $this->initialized;
}
public function initializeLazyObject(): object
{
$this->initialized = true;
return $this;
}
public function resetLazyObject(): bool
{
$this->initialized = false;
| ): bool
{
| {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/LazyFoo.php",
"language": "php",
"file_size": 816,
"cut_index": 522,
"middle_length": 14
} |
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\ObjectMapper\Tests\Fixtures\ClassRule;
use Symfony\Component\Obje... | strtolower',
if: new ClassRuleList([
new SourceClass(B::class),
]),
)]
#[Map(
source: 'bar',
if: new ClassRuleList([
new ClassRule(sources: [C::class]),
]),
)]
public string $s | lass;
use Symfony\Component\ObjectMapper\Condition\TargetClass;
#[Map(source: B::class)]
#[Map(source: C::class)]
#[Map(target: B::class)]
#[Map(target: C::class)]
class A
{
#[Map(
source: 'foo',
transform: ' | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/ClassRule/A.php",
"language": "php",
"file_size": 1374,
"cut_index": 524,
"middle_length": 229
} |
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\ObjectMapper\Tests\Fixtures\MultipleTargets;
use Symfon... | adonly string $foo = 'bar')
{
}
public static function shouldMapToB(mixed $value, object $object): bool
{
return false;
}
public static function shouldMapToC(mixed $value, object $object): bool
{
return true;
| ruct(public re | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/MultipleTargets/A.php",
"language": "php",
"file_size": 791,
"cut_index": 514,
"middle_length": 14
} |
hp
namespace Symfony\Component\ObjectMapper\Tests\Fixtures\NestedMappingWithClassTransformer;
class ParentTarget
{
public string $name;
public ChildWithClassTransformTarget $childWithClassTransformer;
public ChildWithoutClassTransformerTarget $childWithoutClassTransformer;
public ChildWithClassTransfo... | ithoutClassTransformerTarget();
$target->name = 'child';
$target->propertyTransformed = true;
return $target;
}
public static function childBothTransformer(ChildWithClassTransformSource $value, ParentSource $source): Chil | ed = true;
return $value;
}
public static function childPropertyTransformer(ChildWithoutClassTransformerSource $value, ParentSource $source): ChildWithoutClassTransformerTarget
{
$target = new ChildW | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/NestedMappingWithClassTransformer/ParentTarget.php",
"language": "php",
"file_size": 1095,
"cut_index": 515,
"middle_length": 229
} |
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\ObjectMapper\Tests\Fixtures\MapStruct;
use Symfony\Component\ObjectMapper\Meta... | ate readonly string $mapper)
{
if (!is_a($mapper, ObjectMapperInterface::class, true)) {
throw new \RuntimeException(\sprintf('Mapper should implement "%s".', ObjectMapperInterface::class));
}
}
public function crea | ents the basics behind https://mapstruct.org/.
*
* @author Antoine Bluchet <soyuka@gmail.com>
*/
final class MapStructMapperMetadataFactory implements ObjectMapperMetadataFactoryInterface
{
public function __construct(priv | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/MapStruct/MapStructMapperMetadataFactory.php",
"language": "php",
"file_size": 1834,
"cut_index": 537,
"middle_length": 229
} |
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\JsonStreamer\DependencyInjection;
use Symfony\Component\Dependenc... | ter')) {
return;
}
$streamable = [];
foreach ($container->findTaggedResourceIds('json_streamer.streamable') as $id => $tag) {
$class = $container->getDefinition($id)->getClass();
$streamable[$cl | s Arlaud <mathias.arlaud@gmail.com>
*/
class StreamablePass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('json_streamer.stream_wri | {
"filepath": "src/Symfony/Component/JsonStreamer/DependencyInjection/StreamablePass.php",
"language": "php",
"file_size": 1311,
"cut_index": 524,
"middle_length": 229
} |
ackage.
*
* (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\JsonStreamer\DataModel\Read;
use Symfony\Component\TypeInfo\Type\BackedEnumType;
/**
* Represents ... |
{
public function __construct(
public BackedEnumType $type,
) {
}
public function getIdentifier(): string
{
return (string) $this->type;
}
public function getType(): BackedEnumType
{
return $this-> | ass BackedEnumNode implements DataModelNodeInterface | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Read/BackedEnumNode.php",
"language": "php",
"file_size": 881,
"cut_index": 559,
"middle_length": 52
} |
ge.
*
* (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\JsonStreamer\DataModel\Read;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use ... | nNode::class => 3,
ObjectNode::class => 2,
BackedEnumNode::class => 1,
ScalarNode::class => 0,
];
/**
* @var list<DataModelNodeInterface>
*/
private array $nodes;
/**
* @param list<DataModelNodeInter | ted by their precision (descending).
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class CompositeNode implements DataModelNodeInterface
{
private const NODE_PRECISION = [
Collectio | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Read/CompositeNode.php",
"language": "php",
"file_size": 2163,
"cut_index": 563,
"middle_length": 229
} |
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\JsonStreamer\DataModel\Write;
use Symfony\Component\TypeInfo\Type... | y,
) {
}
public function withAccessor(string $accessor): self
{
return new self($accessor, $this->type, $this->item, $this->key);
}
public function getIdentifier(): string
{
return (string) $this->getType();
| implements DataModelNodeInterface
{
public function __construct(
private string $accessor,
private CollectionType $type,
private DataModelNodeInterface $item,
private DataModelNodeInterface $ke | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Write/CollectionNode.php",
"language": "php",
"file_size": 1385,
"cut_index": 524,
"middle_length": 229
} |
ony\Component\ObjectMapper\Metadata\ReflectionObjectMapperMetadataFactory;
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException as PropertyAccessorNoSuchPropertyException;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\VarExporter\LazyObjectInterface;
/**
* Obj... | private readonly ?PropertyAccessorInterface $propertyAccessor = null,
private readonly ?ContainerInterface $transformCallableLocator = null,
private readonly ?ContainerInterface $conditionCallableLocator = null,
private ?ObjectMa | ve references.
*/
private ?\WeakMap $objectMap = null;
public function __construct(
private readonly ObjectMapperMetadataFactoryInterface $metadataFactory = new ReflectionObjectMapperMetadataFactory(),
| {
"filepath": "src/Symfony/Component/ObjectMapper/ObjectMapper.php",
"language": "php",
"file_size": 17449,
"cut_index": 1331,
"middle_length": 229
} |
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\ObjectMapper\Condition;
use Symfony\Component\ObjectMapper\Exception\InvalidAr... | ts = [],
) {
if (!$this->sources && !$this->targets) {
throw new InvalidArgumentException('A ClassRule needs a sources list and/or a targets list.');
}
}
public function __invoke(mixed $value, object $source, ?objec | allableInterface
{
/**
* @param array<class-string>|null $sources
* @param array<class-string>|null $targets
*/
public function __construct(
private array $sources = [],
private array $targe | {
"filepath": "src/Symfony/Component/ObjectMapper/Condition/ClassRule.php",
"language": "php",
"file_size": 1553,
"cut_index": 537,
"middle_length": 229
} |
n 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\ObjectMapper\Condition;
use Symfony\Component\ObjectMapper\Exception\InvalidArgumentException;
/**
* @implements ClassRul... | rivate array $rules)
{
if (!$this->rules) {
throw new InvalidArgumentException('A ClassRuleList needs at least one rule.');
}
}
public function __invoke(mixed $value, object $source, ?object $target): bool
{
| ss> $rules
*/
public function __construct(p | {
"filepath": "src/Symfony/Component/ObjectMapper/Condition/ClassRuleList.php",
"language": "php",
"file_size": 989,
"cut_index": 582,
"middle_length": 52
} |
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\ObjectMapper\Tests\Fixtures\ServiceLoadedValue;
use Symfony\Compo... | a)
{
}
public function __invoke(mixed $value, object $source, ?object $target): mixed
{
$metadata = $this->metadata->create($value);
if (1 !== \count($metadata)) {
throw new \LogicException('Exactly one metadat | /
class ServiceLoadedValueTransformer implements TransformCallableInterface
{
public function __construct(private readonly LoadedValueService $serviceLoadedValue, private readonly ObjectMapperMetadataFactoryInterface $metadat | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/ServiceLoadedValue/ServiceLoadedValueTransformer.php",
"language": "php",
"file_size": 1258,
"cut_index": 524,
"middle_length": 229
} |
*
* 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\ObjectMapper\Tests\Fixtures\MultipleTargetProperty;
use Symfo... | #[Map(target: 'bar')]
public string $something = 'test';
#[Map(target: 'otherFoo', transform: 'strtolower', if: new TargetClass([B::class, C::class]))]
public string $somethingOther = 'TESTOTHER';
public string $doesNotExistInTargetB = | rm: 'strtoupper', if: new TargetClass(B::class))]
| {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/MultipleTargetProperty/A.php",
"language": "php",
"file_size": 837,
"cut_index": 520,
"middle_length": 52
} |
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\ObjectMapper\Tests\Fixtures\MapStruct;
use Symfony\Component\ObjectMap... | $objectMapper)
{
}
#[Map(source: 'propertyA', target: 'propertyD')]
#[Map(source: 'propertyB', if: false)]
public function map(object $source, object|string|null $target = null): object
{
return $this->objectMapper->map($so | function __construct(private readonly ObjectMapper | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/MapStruct/AToBMapper.php",
"language": "php",
"file_size": 861,
"cut_index": 529,
"middle_length": 52
} |
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\JsonStreamer\DataModel\Read;
use Symfony\Component\TypeInfo\Type\Built... | NodeInterface
{
public function __construct(
public BuiltinType $type,
) {
}
public function getIdentifier(): string
{
return (string) $this->type;
}
public function getType(): BuiltinType
{
return | rnal
*/
final class ScalarNode implements DataModel | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Read/ScalarNode.php",
"language": "php",
"file_size": 858,
"cut_index": 529,
"middle_length": 52
} |
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\JsonStreamer\DataModel\Write;
use Symfony\Component\TypeInfo\Type\ObjectType;
... | private bool $mock = false,
) {
}
public static function createMock(string $accessor, ObjectType $type): self
{
return new self($accessor, $type, [], true);
}
public function withAccessor(string $accessor): self
| Interface
{
/**
* @param array<string, DataModelNodeInterface> $properties
*/
public function __construct(
private string $accessor,
private ObjectType $type,
private array $properties,
| {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Write/ObjectNode.php",
"language": "php",
"file_size": 1832,
"cut_index": 537,
"middle_length": 229
} |
hp
/*
* 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\ObjectMapper\Condition;
/**
* @template T of object
*
... | assName) ? $className : [$className];
}
public function __invoke(mixed $value, object $source, ?object $target): bool
{
foreach ($this->targets as $validTarget) {
if ($target instanceof $validTarget) {
retur | >
*/
private readonly array $targets;
/**
* @param class-string<T>|array<class-string<T>> $className
*/
public function __construct(string|array $className)
{
$this->targets = \is_array($cl | {
"filepath": "src/Symfony/Component/ObjectMapper/Condition/TargetClass.php",
"language": "php",
"file_size": 1063,
"cut_index": 515,
"middle_length": 229
} |
appingWithClassTransformer;
use Symfony\Component\ObjectMapper\Attribute\Map;
#[Map(target: ParentTarget::class, transform: [ParentTarget::class, 'createFromSource'])]
class ParentSource
{
public string $name = 'parent';
public ChildWithClassTransformSource $childWithClassTransformer;
#[Map(transform: [... | dWithBothTransformers;
public function __construct()
{
$this->childWithClassTransformer = new ChildWithClassTransformSource();
$this->childWithoutClassTransformer = new ChildWithoutClassTransformerSource();
$this->childWith | r'])]
public ChildWithClassTransformSource $chil | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/NestedMappingWithClassTransformer/ParentSource.php",
"language": "php",
"file_size": 954,
"cut_index": 582,
"middle_length": 52
} |
* 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\ObjectMapper\Tests\Fixtures\MultipleSourceProperty;
use Symfony\... | [Map(source: 'bar', if: new SourceClass(C::class))]
public string $something;
#[Map(source: 'foo', transform: 'strtoupper', if: new SourceClass([B::class, C::class]))]
public string $somethingOther;
public string $doesNotExistInSourceB;
} | 'strtolower', if: new SourceClass(B::class))]
# | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/MultipleSourceProperty/A.php",
"language": "php",
"file_size": 832,
"cut_index": 523,
"middle_length": 52
} |
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\ObjectMapper\Attribute;
/**
* Configures a class or a property t... | $target The property or the class to map to
* @param string|bool|callable(mixed, object, ?object): bool|null $if A boolean, a service id or a cal | am string|class-string|null $source The property or the class to map from
* @param string|class-string|null | {
"filepath": "src/Symfony/Component/ObjectMapper/Attribute/Map.php",
"language": "php",
"file_size": 1487,
"cut_index": 524,
"middle_length": 229
} |
n 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\JsonStreamer\DataModel\Read;
use Symfony\Component\TypeInfo\Type\CollectionType;
/**
* Represents a collection in the dat... | private DataModelNodeInterface $item,
) {
}
public function getIdentifier(): string
{
return (string) $this->type;
}
public function getType(): CollectionType
{
return $this->type;
}
public functio | onstruct(
private CollectionType $type,
| {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Read/CollectionNode.php",
"language": "php",
"file_size": 972,
"cut_index": 582,
"middle_length": 52
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ObjectMapper\Tests\Fixtures;
use Symfony\Component\ObjectMapper\Attribute\Map;
#[Map(B::class)]
class A
{
#[Map('bar')]
public string $foo... | bool $nomap = false;
public C $relation;
public D $relationNotMapped;
public function getConcat()
{
return 'should';
}
public static function concatFn($v, $object): string
{
return $v.$object->foo.$object->b | concat = null;
#[Map(if: 'boolval')]
public | {
"filepath": "src/Symfony/Component/ObjectMapper/Tests/Fixtures/A.php",
"language": "php",
"file_size": 926,
"cut_index": 606,
"middle_length": 52
} |
Security\Csrf\CsrfTokenManagerInterface;
use Twig\Environment;
/**
* Renders a form into HTML using a rendering engine.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormRenderer implements FormRendererInterface
{
public const CACHE_KEY_VAR = 'unique_block_prefix';
private array $blockNameH... | ixed $themes, bool $useDefaultThemes = true): void
{
$this->engine->setTheme($view, $themes, $useDefaultThemes);
}
public function renderCsrfToken(string $tokenId): string
{
if (null === $this->csrfTokenManager) {
| private ?CsrfTokenManagerInterface $csrfTokenManager = null,
) {
}
public function getEngine(): FormRendererEngineInterface
{
return $this->engine;
}
public function setTheme(FormView $view, m | {
"filepath": "src/Symfony/Component/Form/FormRenderer.php",
"language": "php",
"file_size": 11939,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Flow\Type;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Flow\AbstractFlowType;
use Symfony\Component\Form\Flow\... | m\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsRe | derInterface;
use Symfony\Component\Form\Flow\FormFlowInterface;
use Symfony\Component\Form\Flow\StepAccessor\PropertyPathStepAccessor;
use Symfony\Component\Form\Flow\StepAccessor\StepAccessorInterface;
use Symfony\Component\For | {
"filepath": "src/Symfony/Component/Form/Flow/Type/FormFlowType.php",
"language": "php",
"file_size": 4662,
"cut_index": 614,
"middle_length": 229
} |
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\Form\Flow\Type;
use Symfony\Component\Form\AbstractType;
use Symf... | ss);
$builder->add('next', NextFlowType::class);
$builder->add('finish', FinishFlowType::class);
if ($options['with_reset']) {
$builder->add('reset', ResetFlowType::class);
}
}
public function configure | r Yonel Ceruto <open@yceruto.dev>
*/
class NavigatorFlowType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->add('previous', PreviousFlowType::cla | {
"filepath": "src/Symfony/Component/Form/Flow/Type/NavigatorFlowType.php",
"language": "php",
"file_size": 1400,
"cut_index": 524,
"middle_length": 229
} |
/*
* 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\Form\Flow\Type;
use Symfony\Component\Form\Flow\AbstractBut... | uilder->setAttribute('action', 'next');
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'handler' => static fn (mixed $data, ButtonFlowInterface $button, FormFlowInterface $flo | FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class NextFlowType extends AbstractButtonFlowType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$b | {
"filepath": "src/Symfony/Component/Form/Flow/Type/NextFlowType.php",
"language": "php",
"file_size": 1144,
"cut_index": 518,
"middle_length": 229
} |
/*
* 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\Form\Flow\Type;
use Symfony\Component\Form\Flow\AbstractBut... | $builder->setAttribute('action', 'previous');
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'handler' => static fn (mixed $data, ButtonFlowInterface $button, FormFlowInterf | FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PreviousFlowType extends AbstractButtonFlowType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
| {
"filepath": "src/Symfony/Component/Form/Flow/Type/PreviousFlowType.php",
"language": "php",
"file_size": 1218,
"cut_index": 518,
"middle_length": 229
} |
?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\Form\Flow\Type;
use Symfony\Component\Form\Flow\Abstra... | }
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'handler' => static fn (mixed $data, ButtonFlowInterface $button, FormFlowInterface $flow) => $flow->reset(),
'clear_ | \OptionsResolver\OptionsResolver;
class ResetFlowType extends AbstractButtonFlowType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->setAttribute('action', 'reset');
| {
"filepath": "src/Symfony/Component/Form/Flow/Type/ResetFlowType.php",
"language": "php",
"file_size": 1039,
"cut_index": 513,
"middle_length": 229
} |
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\Form\Flow\DataStorage;
/**
* @author Yonel Ceruto <open@yceruto.dev>
... | $this->memory[$this->key] = $data;
}
public function load(object|array|null $default = null): object|array|null
{
return $this->memory[$this->key] ?? $default;
}
public function clear(): void
{
unset($this->mem | c function save(object|array $data): void
{
| {
"filepath": "src/Symfony/Component/Form/Flow/DataStorage/InMemoryDataStorage.php",
"language": "php",
"file_size": 863,
"cut_index": 529,
"middle_length": 52
} |
/*
* 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\Form\Flow\DataStorage;
use Symfony\Component\HttpFoundation... | >requestStack->getSession()->set($this->key, $data->isStaticValue() ? $data->clone() : $data);
}
public function load(object|array|null $default = null): object|array|null
{
if (null === $data = $this->requestStack->getSession()->get($ | __construct(
private readonly string $key,
private readonly RequestStack $requestStack,
) {
}
public function save(object|array $data): void
{
$data = new DeepCloner($data);
$this- | {
"filepath": "src/Symfony/Component/Form/Flow/DataStorage/SessionDataStorage.php",
"language": "php",
"file_size": 1244,
"cut_index": 518,
"middle_length": 229
} |
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\Form\Extension\DataCollector;
use Symfony\Component\Form\AbstractExtension;
... | c function __construct(
private FormDataCollectorInterface $dataCollector,
) {
}
protected function loadTypeExtensions(): array
{
return [
new Type\DataCollectorTypeExtension($this->dataCollector),
];
| ectorExtension extends AbstractExtension
{
publi | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/DataCollectorExtension.php",
"language": "php",
"file_size": 850,
"cut_index": 535,
"middle_length": 52
} |
ion\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\Validator\ConstraintViolationInterface;
use Symfony\Component\VarDumper\Caster\Caster;
use Symfony\Component\VarDumper\Caster\ClassStub;
use Symfony\Component\VarDumper\Caster\... | {@link FormInterface} instance.
*
* Uses the hashes of the forms as keys. This is preferable over using
* {@link \SplObjectStorage}, because in this way no references are kept
* to the {@link FormInterface} instances.
*/
priva | <robert.schoenthal@gmail.com>
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @final
*/
class FormDataCollector extends DataCollector implements FormDataCollectorInterface
{
/**
* Stores the collected data per | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php",
"language": "php",
"file_size": 9658,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (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\Form\Extension\DataCollector;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormV... | figuration(FormInterface $form): void;
/**
* Stores the default data of the given form and its children.
*/
public function collectDefaultData(FormInterface $form): void;
/**
* Stores the submitted data of the given form and it | Bernhard Schussek <bschussek@gmail.com>
*/
interface FormDataCollectorInterface extends DataCollectorInterface
{
/**
* Stores configuration data of the given form and its children.
*/
public function collectCon | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/FormDataCollectorInterface.php",
"language": "php",
"file_size": 2820,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\DataCollector;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\Validator\ConstraintViol... | tConfig()->getType()->getInnerType()::class,
'synchronized' => $form->isSynchronized(),
'passed_options' => [],
'resolved_options' => [],
];
foreach ($form->getConfig()->getAttribute('data_collector/pass | ctorInterface
{
public function extractConfiguration(FormInterface $form): array
{
$data = [
'id' => $this->buildId($form),
'name' => $form->getName(),
'type_class' => $form->ge | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php",
"language": "php",
"file_size": 4215,
"cut_index": 614,
"middle_length": 229
} |
?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\Form\Extension\DataCollector;
use Symfony\Component\Fo... | extractDefaultData(FormInterface $form): array;
/**
* Extracts the submitted data of a form.
*/
public function extractSubmittedData(FormInterface $form): array;
/**
* Extracts the view variables of a form.
*/
public | rInterface
{
/**
* Extracts the configuration data of a form.
*/
public function extractConfiguration(FormInterface $form): array;
/**
* Extracts the default data of a form.
*/
public function | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractorInterface.php",
"language": "php",
"file_size": 1054,
"cut_index": 513,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\DataCollector\Proxy;
use Symfony\Component\Form\Extension\DataCollector\FormDataCollectorInterface;
use Symfony\Component\Form\FormBuilderIn... | om>
*/
class ResolvedTypeDataCollectorProxy implements ResolvedFormTypeInterface
{
public function __construct(
private ResolvedFormTypeInterface $proxiedType,
private FormDataCollectorInterface $dataCollector,
) {
}
publi | ny\Component\Form\ResolvedFormTypeInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Proxy that invokes a data collector when creating a form and its view.
*
* @author Bernhard Schussek <bschussek@gmail.c | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php",
"language": "php",
"file_size": 3675,
"cut_index": 614,
"middle_length": 229
} |
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\Form\Extension\DataCollector\Proxy;
use Symfony\Component\Form\Ex... | ResolvedFormTypeFactoryInterface
{
public function __construct(
private ResolvedFormTypeFactoryInterface $proxiedFactory,
private FormDataCollectorInterface $dataCollector,
) {
}
public function createResolvedType(FormType | FormTypeInterface;
/**
* Proxy that wraps resolved types into {@link ResolvedTypeDataCollectorProxy}
* instances.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ResolvedTypeFactoryDataCollectorProxy implements | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeFactoryDataCollectorProxy.php",
"language": "php",
"file_size": 1316,
"cut_index": 524,
"middle_length": 229
} |
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\Form\Extension\DataCollector\Type;
use Symfony\Component\Form\Abs... | >
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class DataCollectorTypeExtension extends AbstractTypeExtension
{
private DataCollectorListener $listener;
public function __construct(FormDataCollectorInterface $dataCollector)
{
| Extension\DataCollector\FormDataCollectorInterface;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Type extension for collecting data of a form with this type.
*
* @author Robert Schönthal <robert.schoenthal@gmail.com | {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/Type/DataCollectorTypeExtension.php",
"language": "php",
"file_size": 1334,
"cut_index": 524,
"middle_length": 229
} |
ge.
*
* (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\Form\Extension\DataCollector\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterfa... | public function __construct(
private FormDataCollectorInterface $dataCollector,
) {
}
public static function getSubscribedEvents(): array
{
return [
// Low priority in order to be called as late as possible
| data collector for the {@link FormEvents::POST_SET_DATA}
* and {@link FormEvents::POST_SUBMIT} events.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class DataCollectorListener implements EventSubscriberInterface
{
| {
"filepath": "src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php",
"language": "php",
"file_size": 2270,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\HttpFoundation;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\FormError;
use Symfony\Component\Fo... | HttpFoundation
* component.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class HttpFoundationRequestHandler implements RequestHandlerInterface
{
private ServerParams $serverParams;
private MissingDataHandler $missingDataHandler;
| erverParams;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
/**
* A request processor using the {@link Request} class of the | {
"filepath": "src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php",
"language": "php",
"file_size": 4825,
"cut_index": 614,
"middle_length": 229
} |
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\Form\Extension\HttpFoundation\Type;
use Symfony\Component\Form\AbstractTypeExt... | questStack $requestStack = null,
) {
}
public function buildForm(FormBuilderInterface $builder, array $options): void
{
if (!$builder instanceof FormFlowBuilderInterface) {
throw new \InvalidArgumentException(\sprintf(' | \Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
class FormFlowTypeSessionDataStorageExtension extends AbstractTypeExtension
{
public function __construct(
private readonly ?Re | {
"filepath": "src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormFlowTypeSessionDataStorageExtension.php",
"language": "php",
"file_size": 1555,
"cut_index": 537,
"middle_length": 229
} |
/*
* 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\Form\Extension\HttpFoundation\Type;
use Symfony\Component\F... | erInterface $requestHandler;
public function __construct(?RequestHandlerInterface $requestHandler = null)
{
$this->requestHandler = $requestHandler ?? new HttpFoundationRequestHandler();
}
public function buildForm(FormBuilderInte | \FormBuilderInterface;
use Symfony\Component\Form\RequestHandlerInterface;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormTypeHttpFoundationExtension extends AbstractTypeExtension
{
private RequestHandl | {
"filepath": "src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php",
"language": "php",
"file_size": 1218,
"cut_index": 518,
"middle_length": 229
} |
?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\Form\Extension\Csrf;
use Symfony\Component\Form\Abstra... | ace $translator = null,
private ?string $translationDomain = null,
) {
}
protected function loadTypeExtensions(): array
{
return [
new Type\FormTypeCsrfExtension($this->tokenManager, true, '_token', $this->trans | *
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class CsrfExtension extends AbstractExtension
{
public function __construct(
private CsrfTokenManagerInterface $tokenManager,
private ?TranslatorInterf | {
"filepath": "src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php",
"language": "php",
"file_size": 1051,
"cut_index": 513,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form\Flow;
use Symfony\Component\Form\Exception\BadMethodCallException;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\LogicException;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\... | Builder implements FormFlowBuilderInterface
{
/**
* @var array<string, StepFlowBuilderConfigInterface>
*/
private array $steps = [];
private array $initialOptions = [];
private DataStorageInterface $dataStorage;
private StepAc | mBuilderInterface;
/**
* A builder for creating {@link FormFlow} instances.
*
* @author Yonel Ceruto <open@yceruto.dev>
*
* @implements \IteratorAggregate<string, FormBuilderInterface>
*/
class FormFlowBuilder extends Form | {
"filepath": "src/Symfony/Component/Form/Flow/FormFlowBuilder.php",
"language": "php",
"file_size": 8001,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\Csrf\Type;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\... | ty\Csrf\CsrfTokenManagerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormTypeCsrfExtension extends AbstractTypeExtension
{
public function __construct(
priva | \FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\Util\ServerParams;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Securi | {
"filepath": "src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php",
"language": "php",
"file_size": 4529,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Form\Extension\Csrf\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use S... | EventSubscriberInterface
{
private ServerParams $serverParams;
public static function getSubscribedEvents(): array
{
return [
FormEvents::PRE_SUBMIT => 'preSubmit',
];
}
public function __construct(
| CsrfToken;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class CsrfValidationListener implements | {
"filepath": "src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php",
"language": "php",
"file_size": 2573,
"cut_index": 563,
"middle_length": 229
} |
<?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\Form\Extension\PasswordHasher;
use Symfony\Component\... | rotected function loadTypeExtensions(): array
{
return [
new Type\FormTypePasswordHasherExtension($this->passwordHasherListener),
new Type\PasswordTypePasswordHasherExtension($this->passwordHasherListener),
];
| author Sébastien Alfaiate <s.alfaiate@webarea.fr>
*/
class PasswordHasherExtension extends AbstractExtension
{
public function __construct(
private PasswordHasherListener $passwordHasherListener,
) {
}
p | {
"filepath": "src/Symfony/Component/Form/Extension/PasswordHasher/PasswordHasherExtension.php",
"language": "php",
"file_size": 1004,
"cut_index": 512,
"middle_length": 229
} |
/*
* 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\Form\Extension\PasswordHasher\Type;
use Symfony\Component\F... | truct(
private PasswordHasherListener $passwordHasherListener,
) {
}
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->addEventListener(FormEvents::POST_SUBMIT, [$this->passwordHashe | ent\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvents;
/**
* @author Sébastien Alfaiate <s.alfaiate@webarea.fr>
*/
class FormTypePasswordHasherExtension extends AbstractTypeExtension
{
public function __cons | {
"filepath": "src/Symfony/Component/Form/Extension/PasswordHasher/Type/FormTypePasswordHasherExtension.php",
"language": "php",
"file_size": 1145,
"cut_index": 518,
"middle_length": 229
} |
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\Form\Extension\PasswordHasher\Type;
use Symfony\Component\Form\AbstractTypeExt... | PasswordTypePasswordHasherExtension extends AbstractTypeExtension
{
public function __construct(
private PasswordHasherListener $passwordHasherListener,
) {
}
public function buildForm(FormBuilderInterface $builder, array $options | ilderInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\PropertyAccess\PropertyPath;
/**
* @author Sébastien Alfaiate <s.alfaiate@webarea.fr>
*/
class | {
"filepath": "src/Symfony/Component/Form/Extension/PasswordHasher/Type/PasswordTypePasswordHasherExtension.php",
"language": "php",
"file_size": 1719,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\PasswordHasher\EventListener;
use Symfony\Component\Form\Exception\InvalidConfigurationException;
use Symfony\Component\Form\Extension\Core\... | fr>
* @author Gábor Egyed <gabor.egyed@gmail.com>
*/
class PasswordHasherListener
{
private array $passwords = [];
public function __construct(
private UserPasswordHasherInterface $passwordHasher,
private ?PropertyAccessorInterfa | t\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
/**
* @author Sébastien Alfaiate <s.alfaiate@webarea. | {
"filepath": "src/Symfony/Component/Form/Extension/PasswordHasher/EventListener/PasswordHasherListener.php",
"language": "php",
"file_size": 3498,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (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\Form\Extension\Validator;
use Symfony\Component\Form\AbstractExtension;
use Symfony\Component\Form\Exten... | nslation\TranslatorInterface;
/**
* Extension supporting the Symfony Validator component in forms.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ValidatorExtension extends AbstractExtension
{
private readonly ?ViolationMapperInterfa | t\Form\FormTypeGuesserInterface;
use Symfony\Component\Validator\Constraints\Traverse;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Tra | {
"filepath": "src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php",
"language": "php",
"file_size": 2866,
"cut_index": 563,
"middle_length": 229
} |
onType;
use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Com... | \Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormTypeGuesserInterface;
use Symfony\Component\Form\Guess\Guess;
use Symfony\Component\Form\Guess\TypeGuess;
use Symfony\Component\Form\Guess\ValueGuess;
use Symfony\Component\Validator\Constraint;
| tension\Core\Type\LocaleType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TimeType;
use Symfony\Component\Form | {
"filepath": "src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php",
"language": "php",
"file_size": 11377,
"cut_index": 921,
"middle_length": 229
} |
/*
* 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\Form\Extension\Validator\Constraints;
use Symfony\Component... | self::NOT_SYNCHRONIZED_ERROR => 'NOT_SYNCHRONIZED_ERROR',
self::NO_SUCH_FIELD_ERROR => 'NO_SUCH_FIELD_ERROR',
];
#[HasNamedArguments]
public function __construct(mixed $options = null, ?array $groups = null, mixed $payload = null)
| rm extends Constraint
{
public const NOT_SYNCHRONIZED_ERROR = '1dafa156-89e1-4736-b832-419c2e501fca';
public const NO_SUCH_FIELD_ERROR = '6e5212ed-a197-4339-99aa-5654798a4854';
protected const ERROR_NAMES = [
| {
"filepath": "src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php",
"language": "php",
"file_size": 1171,
"cut_index": 518,
"middle_length": 229
} |
ent\Validator\Constraints\Composite;
use Symfony\Component\Validator\Constraints\GroupSequence;
use Symfony\Component\Validator\Constraints\Valid;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
/**
* @author Bernhard Schussek <bschussek@gmail.co... | xpectedTypeException($formConstraint, Form::class);
}
if (!$form instanceof FormInterface) {
return;
}
/** @var FormInterface $form */
$config = $form->getConfig();
$validator = $this->context- | resolvedGroups;
/**
* @psalm-suppress ParamNameMismatch
*/
public function validate(mixed $form, Constraint $formConstraint): void
{
if (!$formConstraint instanceof Form) {
throw new Une | {
"filepath": "src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php",
"language": "php",
"file_size": 11262,
"cut_index": 921,
"middle_length": 229
} |
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\Form\Extension\Validator\Type;
use Symfony\Component\Form\AbstractTypeExtensio... | unction configureOptions(OptionsResolver $resolver): void
{
// Make sure that validation groups end up as null, closure or array
$validationGroupsNormalizer = static function (Options $options, $groups) {
if (false === $grou | logic of {@link FormTypeValidatorExtension} and
* {@link SubmitTypeValidatorExtension}.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class BaseValidatorExtension extends AbstractTypeExtension
{
public f | {
"filepath": "src/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php",
"language": "php",
"file_size": 1556,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (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\Form\Extension\Validator\Type;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Comp... | ionsResolver;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormTypeValidat | ViolationMapper\ViolationMapperInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormRendererInterface;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\Opt | {
"filepath": "src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php",
"language": "php",
"file_size": 2985,
"cut_index": 563,
"middle_length": 229
} |
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\Form;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author B... | odify it.
*
* @param array<string, mixed> $options
*
* @see FormTypeInterface::buildForm()
*/
public function buildForm(FormBuilderInterface $builder, array $options): void;
/**
* Builds the view.
*
* This m | xtendedTypes(): iterable;
public function configureOptions(OptionsResolver $resolver): void;
/**
* Builds the form.
*
* This method is called after the extended type has built the form to
* further m | {
"filepath": "src/Symfony/Component/Form/FormTypeExtensionInterface.php",
"language": "php",
"file_size": 1658,
"cut_index": 537,
"middle_length": 229
} |
<?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\Form;
/**
* @author Bernhard Schussek <bschussek@gma... | ield's maximum length.
*/
public function guessMaxLength(string $class, string $property): ?Guess\ValueGuess;
/**
* Returns a guess about the field's pattern.
*/
public function guessPattern(string $class, string $property): ?Gu | uess\TypeGuess;
/**
* Returns a guess whether a property of a class is required.
*/
public function guessRequired(string $class, string $property): ?Guess\ValueGuess;
/**
* Returns a guess about the f | {
"filepath": "src/Symfony/Component/Form/FormTypeGuesserInterface.php",
"language": "php",
"file_size": 1015,
"cut_index": 512,
"middle_length": 229
} |
ge.
*
* (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\Form;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author Bernhard Schussek <bschusse... | d;
/**
* Builds the form.
*
* This method is called for each type in the hierarchy starting from the
* top most type. Type extensions can further modify the form.
*
* @param array<string, mixed> $options
*
* @se | owing methods before the current implementation.
*/
public function getParent(): ?string;
/**
* Configures the options for this type.
*/
public function configureOptions(OptionsResolver $resolver): voi | {
"filepath": "src/Symfony/Component/Form/FormTypeInterface.php",
"language": "php",
"file_size": 2829,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (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\Form;
/**
* Entry point of the Form component.
*
* Use this class to conveniently create new form fac... | 'color', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', [
* 'choices' => ['Red' => 'r', 'Blue' => 'b'],
* ])
* ->getForm();
*
* You can also add custom extensions to the form factory:
*
* $formFactory = Form | Component\Form\Extension\Core\Type\TextType')
* ->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType')
* ->add('age', 'Symfony\Component\Form\Extension\Core\Type\IntegerType')
* ->add( | {
"filepath": "src/Symfony/Component/Form/Forms.php",
"language": "php",
"file_size": 2792,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Util\FormUtil;
use Symfony\Component\Form\Util\ServerParams;
/**
* A request handler using PHP super globals $_GET, $_POST and $_SERVER.
*
* @author Bernhard ... | _construct(?ServerParams $params = null)
{
$this->serverParams = $params ?? new ServerParams();
$this->missingDataHandler = new MissingDataHandler();
}
/**
* @throws UnexpectedTypeException If the $request is not null
| /**
* The allowed keys of the $_FILES array.
*/
private const FILE_KEYS = [
'error',
'full_path',
'name',
'size',
'tmp_name',
'type',
];
public function _ | {
"filepath": "src/Symfony/Component/Form/NativeRequestHandler.php",
"language": "php",
"file_size": 8140,
"cut_index": 716,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.