prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
fony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum|null
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures... | formers, $instantiator, &$providers) {
$data = \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $offset, $length);
if (\is_int($data)) {
return $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\En | er\Read\Decoder::decodeStream($stream, $offset, $length));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum|null'] = static function ($stream, $offset, $length) use ($options, $trans | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_backed_enum.stream.php",
"language": "php",
"file_size": 1515,
"cut_index": 537,
"middle_length": 229
} |
fony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy|null
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\F... | $v;
}));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy|null'] = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
if (\is_array($data)) {
return | ests\Fixtures\Model\ClassicDummy::class, \array_filter(['id' => $data['id'] ?? '_symfony_missing_value', 'name' => $data['name'] ?? '_symfony_missing_value'], static function ($v) {
return '_symfony_missing_value' !== | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object.php",
"language": "php",
"file_size": 1614,
"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\Console\Terminal\Image;
/**
* Handles the iTerm2 Inline Images Protocol (OSC 1337).
*
* The iTerm2 pr... | ocolInterface
{
public const OSC_START = "\x1b]1337;File=";
public const BEL = "\x07";
public const ST = "\x1b\\";
public function detectPastedImage(string $data): bool
{
return str_contains($data, self::OSC_START);
}
| * Format: ESC]1337;File=[arguments]:[base64 data]BEL
*
* @see https://iterm2.com/documentation-images.html
*
* @author Robin Chalas <robin.chalas@gmail.com>
*
* @internal
*/
final class ITerm2Protocol implements ImageProt | {
"filepath": "src/Symfony/Component/Console/Terminal/Image/ITerm2Protocol.php",
"language": "php",
"file_size": 2988,
"cut_index": 563,
"middle_length": 229
} |
r\Tests\Fixtures\Model\ClassicDummy|null
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = st... | foreach ($data as $k => $v) {
match ($k) {
'id' => $object->id = \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $v[0], $v[1]),
'name' => $object->name = \Symfony\Compo | $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy::class, static function ($object) use ($stream, $data, $options, $transformers, $instantiator, &$providers) {
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object.stream.php",
"language": "php",
"file_size": 2112,
"cut_index": 563,
"middle_length": 229
} |
nt\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>|null
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['array<string, Symfony\\Component\\JsonStreamer\\Tests... | urn \iterator_to_array($iterable($data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
return $instantiator->in | s, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($v);
}
};
ret | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_dict.php",
"language": "php",
"file_size": 2228,
"cut_index": 563,
"middle_length": 229
} |
nt\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>|null
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['array<string, Symfony\\Component\\JsonStreamer\\Tests\\Fixture... | iders['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($stream, $v[0], $v[1]);
}
};
return \iterator_to_array($iterable($stream, $data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\F | r::splitDict($stream, $offset, $length);
$iterable = static function ($stream, $data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $prov | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_dict.stream.php",
"language": "php",
"file_size": 2884,
"cut_index": 563,
"middle_length": 229
} |
reamer\Tests\Fixtures\Model\ClassicDummy>|null
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['list<Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\... | rray($iterable($data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
return $instantiator->instantiate(\Symfony | &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($v);
}
};
return \iterator_to_a | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_list.php",
"language": "php",
"file_size": 2199,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Console\ArgumentResolver\ValueResolver;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Attribute\MapInput;
use Symfony\Component\Console\Attribute\Option;
use Symfony\Component\Console\Attribute\Reflection\ReflectionMember;
... | implements ValueResolverInterface
{
public function __construct(
private readonly ValueResolverInterface $builtinTypeResolver,
private readonly ValueResolverInterface $backedEnumResolver,
private readonly ValueResolverInterface | * Resolves the value of a input argument/option to an object holding the #[MapInput] attribute.
*
* @author Yonel Ceruto <open@yceruto.dev>
* @author Robin Chalas <robin.chalas@gmail.com>
*/
final class MapInputValueResolver | {
"filepath": "src/Symfony/Component/Console/ArgumentResolver/ValueResolver/MapInputValueResolver.php",
"language": "php",
"file_size": 5222,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Completion\Suggestion;
use Symfony\Componen... | is used (e.g. --iterations=5 or -i5).
*/
public const VALUE_REQUIRED = 2;
/**
* The option may or may not have a value (e.g. --yell or --yell=loud).
*/
public const VALUE_OPTIONAL = 4;
/**
* The option accepts multipl | om>
*/
class InputOption
{
/**
* Do not accept input for the option (e.g. --yell). This is the default behavior of options.
*/
public const VALUE_NONE = 1;
/**
* A value must be passed when the option | {
"filepath": "src/Symfony/Component/Console/Input/InputOption.php",
"language": "php",
"file_size": 9103,
"cut_index": 716,
"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\Console\Input;
/**
* StreamableInputInterface is the interface implemented by all input classes
* ... | is mainly useful for testing purpose.
*
* @param resource $stream The input stream
*/
public function setStream($stream): void;
/**
* Returns the input stream.
*
* @return resource|null
*/
public function get | when interacting with the user.
*
* This | {
"filepath": "src/Symfony/Component/Console/Input/StreamableInputInterface.php",
"language": "php",
"file_size": 879,
"cut_index": 559,
"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\Console\Debug;
use Symfony\Component\Console\Command\TraceableCommand;
use Sym... | // Methods below allow to populate a profile, thus enable search and filtering
public function getUri(): string
{
if ($this->server->has('SYMFONY_CLI_BINARY_NAME')) {
$binary = $this->server->get('SYMFONY_CLI_BINARY_NAME').' con | blic readonly TraceableCommand $command,
) {
parent::__construct(
attributes: ['_controller' => $command->command::class, '_virtual_type' => 'command'],
server: $_SERVER,
);
}
| {
"filepath": "src/Symfony/Component/Console/Debug/CliRequest.php",
"language": "php",
"file_size": 1872,
"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\Console\Completion\Output;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Ou... | $values = $suggestions->getValueSuggestions();
foreach ($suggestions->getOptionSuggestions() as $option) {
$values[] = '--'.$option->getName();
if ($option->isNegatable()) {
$values[] = '--no-'.$option- | suggestions, OutputInterface $output): void
{
| {
"filepath": "src/Symfony/Component/Console/Completion/Output/BashCompletionOutput.php",
"language": "php",
"file_size": 984,
"cut_index": 582,
"middle_length": 52
} |
ception;
/**
* Retrieves lexical tokens from a given stream.
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class Lexer
{
private const MAX_CHUNK_LENGTH = 8192;
private const MAX_DEPTH = 512;
private const WHITESPACE_CHARS = [' ' => true, "\r" => true, "\t" => true, "\n... | R = 128;
private const TOKEN_END = 256;
private const TOKEN_VALUE = self::TOKEN_DICT_START | self::TOKEN_LIST_START | self::TOKEN_SCALAR;
private const KEY_REGEX = '/^(?:(?>"(?>\\\\(?>["\\\\\/bfnrt]|u[a-fA-F0-9]{4})|[^\0-\x1F\\\\"]+)*"))$/u';
| _DICT_END = 2;
private const TOKEN_LIST_START = 4;
private const TOKEN_LIST_END = 8;
private const TOKEN_KEY = 16;
private const TOKEN_COLUMN = 32;
private const TOKEN_COMMA = 64;
private const TOKEN_SCALA | {
"filepath": "src/Symfony/Component/JsonStreamer/Read/Lexer.php",
"language": "php",
"file_size": 10503,
"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\JsonStreamer\Read;
use Symfony\Component\JsonStreamer\Exception\UnexpectedValueException;
/**
* Splits collections to retrieve the offset and length of e... | e $stream
*/
public static function splitList($stream, int $offset = 0, ?int $length = null): ?\Iterator
{
$lexer = self::$lexer ??= new Lexer();
$tokens = $lexer->getTokens($stream, $offset, $length);
if ('null' === $ | = ['}' => true, ']' => true];
private static ?Lexer $lexer = null;
/**
* @var array{key: array<string, string>}
*/
private static array $cache = [
'key' => [],
];
/**
* @param resourc | {
"filepath": "src/Symfony/Component/JsonStreamer/Read/Splitter.php",
"language": "php",
"file_size": 4663,
"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\JsonStreamer\Attribute;
use Symfony\Component\JsonStreamer\Exception\LogicExce... | eamToNative;
private \Closure|string|null $nativeToStream;
/**
* @param (callable(mixed, array<string, mixed>=): mixed)|string|null $streamToNative
* @param (callable(mixed, array<string, mixed>=): mixed)|string|null $nativeToStream
| d to transform the property data during stream reading/writing.
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class ValueTransformer
{
private \Closure|string|null $str | {
"filepath": "src/Symfony/Component/JsonStreamer/Attribute/ValueTransformer.php",
"language": "php",
"file_size": 1911,
"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\JsonStreamer\Transformer;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use Symfony\Component\TypeInfo\Type;
use Symfony\Component... | nsformer implements ValueObjectTransformerInterface
{
public const FORMAT_KEY = 'date_interval_format';
private const DEFAULT_FORMAT = '%rP%yY%mM%dDT%hH%iM%sS';
/**
* @param Options $options
*/
public function transform(object $ | ail.com>
*
* @psalm-type Options = array{
* date_interval_format?: string,
* ...<string, mixed>,
* }
*
* @implements ValueObjectTransformerInterface<\DateInterval, string>
*/
final class DateIntervalValueObjectTra | {
"filepath": "src/Symfony/Component/JsonStreamer/Transformer/DateIntervalValueObjectTransformer.php",
"language": "php",
"file_size": 3398,
"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\JsonStreamer\Transformer;
use Symfony\Component\TypeInfo\Type... | ect?: object, // When writing stream: the object holding the current property
* ...<string, mixed>,
* } $options
*/
public function transform(mixed $value, array $options = []): mixed;
public static function getStreamValueType() | /**
* @param array{
* _current_obj | {
"filepath": "src/Symfony/Component/JsonStreamer/Transformer/PropertyValueTransformerInterface.php",
"language": "php",
"file_size": 838,
"cut_index": 520,
"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\JsonStreamer\Transformer;
use Symfony\Component\TypeInfo\Type\Bui... | * @return U
*/
public function transform(object $object, array $options = []): int|float|string|bool|null;
/**
* Reverses the transformation from a scalar value back into a value object.
*
* @param U $scala | ring|bool|null
*/
interface ValueObjectTransformerInterface
{
/**
* Transforms a value object into a scalar value.
*
* @param T $object
* @param array<string, mixed> $options
*
| {
"filepath": "src/Symfony/Component/JsonStreamer/Transformer/ValueObjectTransformerInterface.php",
"language": "php",
"file_size": 1365,
"cut_index": 524,
"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\JsonStreamer\Mapping;
use Symfony\Component\JsonStreamer\Exception\RuntimeExce... | public function load(string $className, array $options = [], array $context = []): array
{
$result = [];
try {
$classReflection = new \ReflectionClass($className);
} catch (\ReflectionException $e) {
th | athias.arlaud@gmail.com>
*
* @internal
*/
final class PropertyMetadataLoader implements PropertyMetadataLoaderInterface
{
public function __construct(
private TypeResolverInterface $typeResolver,
) {
}
| {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/PropertyMetadataLoader.php",
"language": "php",
"file_size": 1522,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\JsonStreamer\Mapping\Read;
use Psr\Container\ContainerInterface;
use Symfony\Component\JsonStreamer\Attribute\StreamedName;
use Symfony\Component\JsonStreamer\Attribute\ValueTransformer;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;... | based on properties' attributes.
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class AttributePropertyMetadataLoader implements PropertyMetadataLoaderInterface
{
public function __construct(
private PropertyM | rtyValueTransformerInterface;
use Symfony\Component\JsonStreamer\Transformer\ValueObjectTransformerInterface;
use Symfony\Component\TypeInfo\TypeResolver\TypeResolverInterface;
/**
* Enhances properties stream reading metadata | {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/Read/AttributePropertyMetadataLoader.php",
"language": "php",
"file_size": 5409,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\JsonStreamer\Mapping\Write;
use Psr\Container\ContainerInterface;
use Symfony\Component\JsonStreamer\Attribute\StreamedName;
use Symfony\Component\JsonStreamer\Attribute\ValueTransformer;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException... | based on properties' attributes.
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class AttributePropertyMetadataLoader implements PropertyMetadataLoaderInterface
{
public function __construct(
private Property | ertyValueTransformerInterface;
use Symfony\Component\JsonStreamer\Transformer\ValueObjectTransformerInterface;
use Symfony\Component\TypeInfo\TypeResolver\TypeResolverInterface;
/**
* Enhances properties stream writing metadata | {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/Write/AttributePropertyMetadataLoader.php",
"language": "php",
"file_size": 5147,
"cut_index": 716,
"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\Console\Messenger;
use Symfony\Component\Console\Application;
use Symfony\Comp... | ndMessageHandler
{
public function __construct(
private readonly Application $application,
) {
}
public function __invoke(RunCommandMessage $message): RunCommandContext
{
$input = new StringInput($message->input);
| Output;
use Symfony\Component\Messenger\Exception\RecoverableExceptionInterface;
use Symfony\Component\Messenger\Exception\UnrecoverableExceptionInterface;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*/
final class RunComma | {
"filepath": "src/Symfony/Component/Console/Messenger/RunCommandMessageHandler.php",
"language": "php",
"file_size": 1846,
"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\Console\ArgumentResolver\ValueResolver;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Co... | Jérôme Tamarelle <jerome@tamarelle.net>
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
final class BackedEnumValueResolver implements ValueResolverInterface
{
public function resolve(string $argumentName, InputInterface $input, Ref | onsole\Exception\InvalidOptionException;
use Symfony\Component\Console\Input\InputInterface;
/**
* Resolves a BackedEnum instance from a Command argument or option.
*
* @author Robin Chalas <robin.chalas@gmail.com>
* @author | {
"filepath": "src/Symfony/Component/Console/ArgumentResolver/ValueResolver/BackedEnumValueResolver.php",
"language": "php",
"file_size": 2964,
"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\Console\ArgumentResolver\ValueResolver;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Co... | halas <robin.chalas@gmail.com>
*/
final class UidValueResolver implements ValueResolverInterface
{
public function resolve(string $argumentName, InputInterface $input, ReflectionMember $member): iterable
{
if ($argument = Argument::tryFrom | onsole\Exception\InvalidOptionException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Uid\AbstractUid;
/**
* Resolves an AbstractUid instance from a Command argument or option.
*
* @author Robin C | {
"filepath": "src/Symfony/Component/Console/ArgumentResolver/ValueResolver/UidValueResolver.php",
"language": "php",
"file_size": 2692,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Console\Completion;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
/**
* An input specialized f... | 'none';
private array $tokens;
private int $currentIndex;
private string $completionType;
private ?string $completionName = null;
private string $completionValue = '';
/**
* Converts a terminal string into tokens.
*
| ass CompletionInput extends ArgvInput
{
public const TYPE_ARGUMENT_VALUE = 'argument_value';
public const TYPE_OPTION_VALUE = 'option_value';
public const TYPE_OPTION_NAME = 'option_name';
public const TYPE_NONE = | {
"filepath": "src/Symfony/Component/Console/Completion/CompletionInput.php",
"language": "php",
"file_size": 8098,
"cut_index": 716,
"middle_length": 229
} |
nt\JsonStreamer\DataModel\Read\CollectionNode;
use Symfony\Component\JsonStreamer\DataModel\Read\CompositeNode;
use Symfony\Component\JsonStreamer\DataModel\Read\DataModelNodeInterface;
use Symfony\Component\JsonStreamer\DataModel\Read\ObjectNode;
use Symfony\Component\JsonStreamer\DataModel\Read\ScalarNode;
use Symfon... | TypeInterface;
use Symfony\Component\TypeInfo\TypeIdentifier;
/**
* Generates PHP code that reads JSON stream.
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class PhpGenerator
{
use PhpGeneratorTrait;
public f | onent\TypeInfo\Type\BackedEnumType;
use Symfony\Component\TypeInfo\Type\BuiltinType;
use Symfony\Component\TypeInfo\Type\CollectionType;
use Symfony\Component\TypeInfo\Type\ObjectType;
use Symfony\Component\TypeInfo\Type\Wrapping | {
"filepath": "src/Symfony/Component/JsonStreamer/Read/PhpGenerator.php",
"language": "php",
"file_size": 17281,
"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\JsonStreamer\Transformer;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use Symfony\Component\TypeInfo\Type;
use Symfony\Component... | face, string>
*/
final class DateTimeValueObjectTransformer implements ValueObjectTransformerInterface
{
public const FORMAT_KEY = 'date_time_format';
public const TIMEZONE_KEY = 'date_time_timezone';
/**
* @param Options $options
* | ud@gmail.com>
*
* @psalm-type Options = array{
* date_time_format?: string,
* date_time_timezone?: string|\DateTimeZone,
* ...<string, mixed>,
* }
*
* @implements ValueObjectTransformerInterface<\DateTimeInter | {
"filepath": "src/Symfony/Component/JsonStreamer/Transformer/DateTimeValueObjectTransformer.php",
"language": "php",
"file_size": 4163,
"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\JsonStreamer\Mapping;
use Symfony\Component\TypeInfo\Exception\InvalidArgumentException;
use Symfony\Component\TypeInfo\Type;
use Symfony\Component\TypeInf... | @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @internal
*/
final class GenericTypePropertyMetadataLoader implements PropertyMetadataLoaderInterface
{
public function __construct(
private PropertyMetadataLoaderInterface $decorated,
| ent\TypeInfo\Type\UnionType;
use Symfony\Component\TypeInfo\Type\WrappingTypeInterface;
use Symfony\Component\TypeInfo\TypeContext\TypeContextFactory;
/**
* Enhances properties metadata based on properties' generic type.
*
* | {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/GenericTypePropertyMetadataLoader.php",
"language": "php",
"file_size": 4996,
"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\JsonStreamer\Mapping;
use Symfony\Component\TypeInfo\Type;
/**
* Holds stream reading/writing metadata... | c static function createSynthetic(Type $type, array $valueTransformers = []): self
{
return new self(null, $type, $valueTransformers);
}
public function getName(): ?string
{
return $this->name;
}
public function wi | ublic function __construct(
private ?string $name,
private Type $type,
private array $valueTransformers = [],
) {
}
/**
* @param list<string|\Closure> $valueTransformers
*/
publi | {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/PropertyMetadata.php",
"language": "php",
"file_size": 2109,
"cut_index": 563,
"middle_length": 229
} |
he 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\Console\ArgumentResolver\Exception;
final class ResolverNotFoundException extends \Runti... | ternatives) {
if (1 === \count($alternatives)) {
$msg .= ' Did you mean this: "';
} else {
$msg .= ' Did you mean one of these: "';
}
$msg .= implode('", "', $alternatives).'"? | on-existent resolver "%s".', $name);
if ($al | {
"filepath": "src/Symfony/Component/Console/ArgumentResolver/Exception/ResolverNotFoundException.php",
"language": "php",
"file_size": 912,
"cut_index": 547,
"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\Console\ArgumentResolver\ValueResolver;
use Symfony\Compone... | ction resolve(string $argumentName, InputInterface $input, ReflectionMember $member): iterable
{
$method = $this->inner::class.'::'.__FUNCTION__;
$this->stopwatch->start($method, 'command.argument_value_resolver');
try {
| l.com>
*/
final class TraceableValueResolver implements ValueResolverInterface
{
public function __construct(
private ValueResolverInterface $inner,
private Stopwatch $stopwatch,
) {
}
public fun | {
"filepath": "src/Symfony/Component/Console/ArgumentResolver/ValueResolver/TraceableValueResolver.php",
"language": "php",
"file_size": 1158,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\JsonStreamer\Read;
use Psr\Container\ContainerInterface;
use Symfony\Component\Config\ConfigCacheFactoryInterface;
use Symfony\Component\JsonStreamer\DataModel\Read\BackedEnumNode;
use Symfony\Component\JsonStreamer\DataModel\Read\CollectionNode;
use Symfon... | ping\PropertyMetadataLoaderInterface;
use Symfony\Component\JsonStreamer\StreamerDumper;
use Symfony\Component\TypeInfo\Type;
use Symfony\Component\TypeInfo\Type\BackedEnumType;
use Symfony\Component\TypeInfo\Type\BuiltinType;
use Symfony\Component\TypeInf | se Symfony\Component\JsonStreamer\DataModel\Read\ScalarNode;
use Symfony\Component\JsonStreamer\Exception\RuntimeException;
use Symfony\Component\JsonStreamer\Exception\UnsupportedException;
use Symfony\Component\JsonStreamer\Map | {
"filepath": "src/Symfony/Component/JsonStreamer/Read/StreamReaderGenerator.php",
"language": "php",
"file_size": 6788,
"cut_index": 716,
"middle_length": 229
} |
he 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\Mapping;
/**
* Loads properties stream reading/writing metadata for a give... | tring $className
* @param array<string, mixed> $options Implementation-specific options
* @param array<string, mixed> $context
*
* @return array<string, PropertyMetadata>
*/
public function load(string $className, arr | adataLoaderInterface
{
/**
* @param class-s | {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/PropertyMetadataLoaderInterface.php",
"language": "php",
"file_size": 904,
"cut_index": 547,
"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\Console\Completion\Output;
use Symfony\Component\Console\Completi... | $value->getValue().($value->getDescription() ? "\t".$value->getDescription() : '');
}
foreach ($suggestions->getOptionSuggestions() as $option) {
$values[] = '--'.$option->getName().($option->getDescription() ? "\t".$option->get | OutputInterface
{
public function write(CompletionSuggestions $suggestions, OutputInterface $output): void
{
$values = [];
foreach ($suggestions->getValueSuggestions() as $value) {
$values[] = | {
"filepath": "src/Symfony/Component/Console/Completion/Output/FishCompletionOutput.php",
"language": "php",
"file_size": 1274,
"cut_index": 524,
"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\Mapping\Read;
use Symfony\Component\JsonStr... | mplements PropertyMetadataLoaderInterface
{
public function __construct(
private PropertyMetadataLoaderInterface $decorated,
) {
}
public function load(string $className, array $options = [], array $context = []): array
{
| tyMetadataLoader::class);
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @deprecated since Symfony 8.1, Date times are handled as value objects
*
* @internal
*/
final class DateTimeTypePropertyMetadataLoader i | {
"filepath": "src/Symfony/Component/JsonStreamer/Mapping/Read/DateTimeTypePropertyMetadataLoader.php",
"language": "php",
"file_size": 1074,
"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\JsonStreamer\Transformer;
use Symfony\Component\JsonStreamer\Exception\Invalid... | ValueObjectTransformerInterface
{
public function transform(object $object, array $options = []): string
{
if (!$object instanceof \DateTimeZone) {
throw new InvalidArgumentException('The native value must be an instance of "\D | } to a timezone string and vice versa.
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
*
* @implements ValueObjectTransformerInterface<\DateTimeZone, string>
*/
final class DateTimeZoneValueObjectTransformer implements | {
"filepath": "src/Symfony/Component/JsonStreamer/Transformer/DateTimeZoneValueObjectTransformer.php",
"language": "php",
"file_size": 1866,
"cut_index": 537,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithNullableProperties
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\... | \\Enum\\DummyBackedEnum|null']($data['enum']) : '_symfony_missing_value'], static function ($v) {
return '_symfony_missing_value' !== $v;
}));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEn | sts\Fixtures\Model\DummyWithNullableProperties::class, \array_filter(['name' => $data['name'] ?? '_symfony_missing_value', 'enum' => \array_key_exists('enum', $data) ? $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_nullable_properties.php",
"language": "php",
"file_size": 2022,
"cut_index": 563,
"middle_length": 229
} |
hp
/**
* @param array<string, Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "{";
$prefix1 = '';
foreach ($data as $key1... | = ',';
}
yield "}";
} catch (\JsonException $e) {
throw new \Symfony\Component\JsonStreamer\Exception\NotEncodableValueException("Cannot encode \"array<string, Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithN | ($value1->id, \JSON_THROW_ON_ERROR, 510);
$prefix2 = ',';
yield "{$prefix2}\"name\":";
yield \json_encode($value1->name, \JSON_THROW_ON_ERROR, 510);
yield "}";
$prefix1 | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_dict.php",
"language": "php",
"file_size": 1065,
"cut_index": 515,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
$prefix1 = '';
yield "{{$prefix1}\"name\":";
yield \json_encode($data->name... | myTwo\":";
$prefix2 = '';
yield "{{$prefix2}\"id\":";
yield \json_encode($data->otherDummyTwo->id, \JSON_THROW_ON_ERROR, 510);
$prefix2 = ',';
yield "{$prefix2}\"name\":";
yield \json_encode($data->otherDummy | ->otherDummyOne->id, \JSON_THROW_ON_ERROR, 510);
$prefix2 = ',';
yield "{$prefix2}\"name\":";
yield \json_encode($data->otherDummyOne->name, \JSON_THROW_ON_ERROR, 510);
yield "}{$prefix1}\"otherDum | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_in_object.php",
"language": "php",
"file_size": 1336,
"cut_index": 524,
"middle_length": 229
} |
hp
/**
* @param iterable<int|string, Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "{";
$prefix1 = '';
foreach ($data as $key1 => ... | $prefix1 = ',';
}
yield "}";
} catch (\JsonException $e) {
throw new \Symfony\Component\JsonStreamer\Exception\NotEncodableValueException("Cannot encode \"iterable<int|string, Symfony\\Component\\JsonStreamer\\Tests\\F | yield \json_encode($value1->id, \JSON_THROW_ON_ERROR, 510);
$prefix2 = ',';
yield "{$prefix2}\"name\":";
yield \json_encode($value1->name, \JSON_THROW_ON_ERROR, 510);
yield "}";
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_iterable.php",
"language": "php",
"file_size": 1080,
"cut_index": 515,
"middle_length": 229
} |
s\Model\DummyWithNameAttributes> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "[";
$prefix1 = '';
foreach ($data as $value1) {
$prefix2 = '';
yield "{$prefix1}{{$prefix2}\"@... | ;
$prefix1 = ',';
}
yield "]";
} catch (\JsonException $e) {
throw new \Symfony\Component\JsonStreamer\Exception\NotEncodableValueException("Cannot encode \"list<Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Mod | e, \JSON_THROW_ON_ERROR, 510);
yield "}" | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_list.php",
"language": "php",
"file_size": 969,
"cut_index": 582,
"middle_length": 52
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNestedDictDummies $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
$generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithNestedDictDummies'] ... | = \substr(\json_encode($key1), 1, -1);
yield "{$prefix2}\"{$key1}\":";
yield from $generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithNestedDictDummies']($value1, $depth + 1);
$prefix2 = ','; | ception('Maximum stack depth exceeded');
}
$prefix1 = '';
yield "{{$prefix1}\"dummies\":";
yield "{";
$prefix2 = '';
foreach ($data->dummies as $key1 => $value1) {
$key1 | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_with_nested_dict_self.php",
"language": "php",
"file_size": 1460,
"cut_index": 524,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNestedListDummies $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
$generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithNestedListDummies'] ... | = is_int($key1) ? $key1 : \substr(\json_encode($key1), 1, -1);
yield "{$prefix2}\"{$key1}\":";
yield from $generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithNestedListDummies']($value1, $depth + 1);
| ception('Maximum stack depth exceeded');
}
$prefix1 = '';
yield "{{$prefix1}\"dummies\":";
yield "{";
$prefix2 = '';
foreach ($data->dummies as $key1 => $value1) {
$key1 | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_with_nested_list_self.php",
"language": "php",
"file_size": 1484,
"cut_index": 524,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithSyntheticProperties $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
$prefix1 = '';
yield "{{$prefix1}\"synthetic\":";
yield \json_encode... | Exception $e) {
throw new \Symfony\Component\JsonStreamer\Exception\NotEncodableValueException("Cannot encode \"Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithSyntheticProperties\" to JSON: {$e->getMessage()}.", 0, $e);
}
}; | } catch (\Json | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_with_synthetic_properties.php",
"language": "php",
"file_size": 795,
"cut_index": 524,
"middle_length": 14
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithUnionProperties $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
$prefix1 = '';
yield "{";
if (null === $data->value && ($options['includ... | yield \json_encode($data->value, \JSON_THROW_ON_ERROR, 511);
} else {
throw new \Symfony\Component\JsonStreamer\Exception\UnexpectedValueException(\sprintf('Unexpected "%s" value.', \get_debug_type($data->value)));
| alue instanceof \Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum) {
yield \json_encode($data->value->value, \JSON_THROW_ON_ERROR, 511);
} elseif (\is_string($data->value)) {
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_with_union.php",
"language": "php",
"file_size": 1318,
"cut_index": 524,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithDateTimes $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
$prefix1 = '';
yield "{{$prefix1}\"interface\":";
yield \json_encode($transfor... | ncode($transformers->get('DateTimeInterface')->transform($data->union, $options), \JSON_THROW_ON_ERROR, 511);
} elseif (\is_int($data->union)) {
yield \json_encode($data->union, \JSON_THROW_ON_ERROR, 511);
} else {
t | $transformers->get('DateTimeInterface')->transform($data->immutable, $options), \JSON_THROW_ON_ERROR, 511);
yield "{$prefix1}\"union\":";
if ($data->union instanceof \DateTimeImmutable) {
yield \json_e | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_with_value_object.php",
"language": "php",
"file_size": 1447,
"cut_index": 524,
"middle_length": 229
} |
ony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithValueTransformerAttributes $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
$prefix1 = '';
yield "{{$prefix1}\"id\":";
yield \json_encode($transformer... | form($data->active, ['_current_object' => $data] + $options), \JSON_THROW_ON_ERROR, 511);
yield "{$prefix1}\"name\":";
yield \json_encode(strtolower($data->name), \JSON_THROW_ON_ERROR, 511);
yield "{$prefix1}\"range\":";
yie | N_ERROR, 511);
$prefix1 = ',';
yield "{$prefix1}\"active\":";
yield \json_encode($transformers->get('Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Transformer\\BooleanToStringValueTransformer')->trans | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/object_with_value_transformer.php",
"language": "php",
"file_size": 1524,
"cut_index": 537,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\SelfReferencingDummy $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
$generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\SelfReferencingDummy'] = static fun... | if (null !== $data->self) {
yield "{$prefix1}\"@self\":";
yield from $generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\SelfReferencingDummy']($data->self, $depth + 1);
}
yield "}";
};
t | imum stack depth exceeded');
}
$prefix1 = '';
yield "{";
if (null === $data->self && ($options['include_null_properties'] ?? false)) {
yield "{$prefix1}\"@self\":null";
}
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/self_referencing_object.php",
"language": "php",
"file_size": 1405,
"cut_index": 524,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\SelfReferencingDummyDict $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
$generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\SelfReferencingDummyDict'] = st... | tr(\json_encode($key1), 1, -1);
yield "{$prefix2}\"{$key1}\":";
yield from $generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\SelfReferencingDummyDict']($value1, $depth + 1);
$prefix2 = ',';
} | ion('Maximum stack depth exceeded');
}
$prefix1 = '';
yield "{{$prefix1}\"items\":";
yield "{";
$prefix2 = '';
foreach ($data->items as $key1 => $value1) {
$key1 = \subs | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/self_referencing_object_dict.php",
"language": "php",
"file_size": 1446,
"cut_index": 524,
"middle_length": 229
} |
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\SelfReferencingDummyList $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
$generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\SelfReferencingDummyList'] = st... | t($key1) ? $key1 : \substr(\json_encode($key1), 1, -1);
yield "{$prefix2}\"{$key1}\":";
yield from $generators['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\SelfReferencingDummyList']($value1, $depth + 1);
$ | ion('Maximum stack depth exceeded');
}
$prefix1 = '';
yield "{{$prefix1}\"items\":";
yield "{";
$prefix2 = '';
foreach ($data->items as $key1 => $value1) {
$key1 = is_in | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/self_referencing_object_list.php",
"language": "php",
"file_size": 1470,
"cut_index": 524,
"middle_length": 229
} |
ony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes|int|list<Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
if (\is_array($data)) {
... | yield "{{$prefix1}\"@id\":";
yield \json_encode($data->id, \JSON_THROW_ON_ERROR, 511);
$prefix1 = ',';
yield "{$prefix1}\"name\":";
yield \json_encode($data->name, \JSON_THROW_ON_ERROR, 511);
| ERROR, 511);
$prefix1 = ',';
}
yield "]";
} elseif ($data instanceof \Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes) {
$prefix1 = '';
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/union.php",
"language": "php",
"file_size": 1668,
"cut_index": 537,
"middle_length": 229
} |
pace Symfony\Component\JsonStreamer\Tests\Fixtures\Model;
use Symfony\Component\JsonStreamer\Attribute\ValueTransformer;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Attribute\BooleanStringValueTransformer;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Transformer\DivideStringAndCastToIntValueTransformer;
use... | #[ValueTransformer(nativeToStream: 'strtolower', streamToNative: 'strtoupper')]
public string $name = 'DUMMY';
#[ValueTransformer(
nativeToStream: [self::class, 'concatRange'],
streamToNative: [self::class, 'explodeRange'],
) | : DoubleIntAndCastToStringValueTransformer::class,
streamToNative: DivideStringAndCastToIntValueTransformer::class,
)]
public int $id = 1;
#[BooleanStringValueTransformer]
public bool $active = false;
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/Model/DummyWithValueTransformerAttributes.php",
"language": "php",
"file_size": 1440,
"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\JsonStreamer\Tests\Mapping;
use PHPUnit\Framework\TestCase;
use Symfony\Component\JsonStreamer\Mapping\GenericTypePropertyMetadataLoader;
use Symfony\Compo... | {
public function testReplaceGenerics()
{
$loader = new GenericTypePropertyMetadataLoader(self::propertyMetadataLoader([
'foo' => new PropertyMetadata('foo', Type::template('T')),
]), new TypeContextFactory(new StringTyp | s;
use Symfony\Component\TypeInfo\Type;
use Symfony\Component\TypeInfo\TypeContext\TypeContextFactory;
use Symfony\Component\TypeInfo\TypeResolver\StringTypeResolver;
class GenericTypePropertyMetadataLoaderTest extends TestCase
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Mapping/GenericTypePropertyMetadataLoaderTest.php",
"language": "php",
"file_size": 3123,
"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\JsonStreamer\Tests\Mapping;
use PHPUnit\Framework\Tes... | ew PropertyMetadataLoader(TypeResolver::create());
$this->assertEquals([
'id' => new PropertyMetadata('id', Type::int()),
'name' => new PropertyMetadata('name', Type::string()),
], $loader->load(ClassicDummy::class) | lassicDummy;
use Symfony\Component\TypeInfo\Type;
use Symfony\Component\TypeInfo\TypeResolver\TypeResolver;
class PropertyMetadataLoaderTest extends TestCase
{
public function testReadPropertyType()
{
$loader = n | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Mapping/PropertyMetadataLoaderTest.php",
"language": "php",
"file_size": 1008,
"cut_index": 512,
"middle_length": 229
} |
* @param list<Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes>|null $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
if (\is_array($data)) {
yield "[";
$prefix1 = '';
... | }
yield "]";
} elseif (null === $data) {
yield "null";
} else {
throw new \Symfony\Component\JsonStreamer\Exception\UnexpectedValueException(\sprintf('Unexpected "%s" value.', \get_debug_type($data))) | 510);
$prefix2 = ',';
yield "{$prefix2}\"name\":";
yield \json_encode($value1->name, \JSON_THROW_ON_ERROR, 510);
yield "}";
$prefix1 = ',';
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/nullable_object_list.php",
"language": "php",
"file_size": 1302,
"cut_index": 524,
"middle_length": 229
} |
del\ClassicDummy
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = static function (... | ', 'name' => $data['name'] ?? '_symfony_missing_value'], static function ($v) {
return '_symfony_missing_value' !== $v;
}));
};
return $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'](\Symfony | lter(['id' => $data['id'] ?? '_symfony_missing_value | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object.php",
"language": "php",
"file_size": 964,
"cut_index": 582,
"middle_length": 52
} |
ay<string, Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['array<string, Symfony\\Component... | };
return \iterator_to_array($iterable($data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
ret | options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($v);
}
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_dict.php",
"language": "php",
"file_size": 1533,
"cut_index": 537,
"middle_length": 229
} |
nt\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['array<string, Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Mo... | ['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($stream, $v[0], $v[1]);
}
};
return \iterator_to_array($iterable($stream, $data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtur | litDict($stream, $offset, $length);
$iterable = static function ($stream, $data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_dict.stream.php",
"language": "php",
"file_size": 2046,
"cut_index": 563,
"middle_length": 229
} |
rable<int|string, Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['iterable<int|string, Symf... | }
};
return $iterable($data);
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
return $i | ($data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($v);
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_iterable.php",
"language": "php",
"file_size": 1534,
"cut_index": 537,
"middle_length": 229
} |
* @return list<Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['list<Symfony\\Component\\Jso... | };
return \iterator_to_array($iterable($data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy'] = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
return $ | ns, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($v);
}
| {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_list.php",
"language": "php",
"file_size": 1506,
"cut_index": 524,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithNullableProperties
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWith... | sformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
match ($k) {
'name' => $object->name = \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $v[0], $v[1]),
| litDict($stream, $offset, $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNullableProperties::class, static function ($object) use ($stream, $data, $options, $tran | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_nullable_properties.stream.php",
"language": "php",
"file_size": 2526,
"cut_index": 563,
"middle_length": 229
} |
/**
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithSyntheticProperties
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\J... | n ($object) use ($stream, $data, $options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
match ($k) {
default => null,
};
}
});
};
retu | ymfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithSyntheticProperties::class, static functio | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_synthetic_properties.stream.php",
"language": "php",
"file_size": 1129,
"cut_index": 518,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithUnionProperties
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithUni... | $instantiator, &$providers) {
foreach ($data as $k => $v) {
match ($k) {
'value' => $object->value = $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum|null|string']($stream | t($stream, $offset, $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithUnionProperties::class, static function ($object) use ($stream, $data, $options, $transformers, | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_union.stream.php",
"language": "php",
"file_size": 2477,
"cut_index": 563,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithDateTimes
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWith... | ) ? $providers['DateTimeImmutable']($data['immutable']) : '_symfony_missing_value', 'union' => \array_key_exists('union', $data) ? $providers['DateTimeImmutable|int']($data['union']) : '_symfony_missing_value'], static function ($v) {
return '_ | \DummyWithDateTimes::class, \array_filter(['interface' => \array_key_exists('interface', $data) ? $providers['DateTimeInterface']($data['interface']) : '_symfony_missing_value', 'immutable' => \array_key_exists('immutable', $data | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_value_object.php",
"language": "php",
"file_size": 2204,
"cut_index": 563,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithValueTransformerAttributes
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\D... | , $data, $options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
match ($k) {
'id' => $object->id = $transformers->get('Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Transfor | ead\Splitter::splitDict($stream, $offset, $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithValueTransformerAttributes::class, static function ($object) use ($stream | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_value_transformer.stream.php",
"language": "php",
"file_size": 2089,
"cut_index": 563,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithNameAttributes|int|list<Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum>
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
... | um\\DummyBackedEnum']($v);
}
};
return \iterator_to_array($iterable($data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum'] = static function ($data) {
return \Symfony\C | terable = static function ($data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\En | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/union.php",
"language": "php",
"file_size": 2943,
"cut_index": 563,
"middle_length": 229
} |
he 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\Tests\Fixtures\Mapping;
use Symfony\Component\JsonStreamer\Mapping\Property... | $className, array $options = [], array $context = []): array
{
return [
'synthetic' => PropertyMetadata::createSynthetic(Type::true(), [
self::true(...),
]),
];
}
public static function | ataLoaderInterface
{
public function load(string | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/Mapping/SyntheticPropertyMetadataLoader.php",
"language": "php",
"file_size": 903,
"cut_index": 547,
"middle_length": 52
} |
<Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNestedList> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "[";
$prefix1 = '';
foreach ($data as $value1) {
$prefix2 = '';
... | {$prefix5}{{$prefix6}\"id\":";
yield \json_encode($value3->id, \JSON_THROW_ON_ERROR, 506);
$prefix6 = ',';
yield "{$prefix6}\"name\":";
yield \json_encode($value3->name, \JSON_ | yield "{$prefix3}{{$prefix4}\"dummies\":";
yield "[";
$prefix5 = '';
foreach ($value2->dummies as $value3) {
$prefix6 = '';
yield " | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/double_nested_list.php",
"language": "php",
"file_size": 1894,
"cut_index": 537,
"middle_length": 229
} |
ent\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum|null $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
if ($data instanceof \Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum) {
yield \json_... | alue.', \get_debug_type($data)));
}
} catch (\JsonException $e) {
throw new \Symfony\Component\JsonStreamer\Exception\NotEncodableValueException("Cannot encode \"Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum|n | UnexpectedValueException(\sprintf('Unexpected "%s" v | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/nullable_backed_enum.php",
"language": "php",
"file_size": 909,
"cut_index": 547,
"middle_length": 52
} |
* @param array<string, Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes>|null $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
if (\is_array($data)) {
yield "{";
$prefix1 =... | N_THROW_ON_ERROR, 510);
yield "}";
$prefix1 = ',';
}
yield "}";
} elseif (null === $data) {
yield "null";
} else {
throw new \Symfony\Component\JsonStreamer\Exc | {{$prefix2}\"@id\":";
yield \json_encode($value1->id, \JSON_THROW_ON_ERROR, 510);
$prefix2 = ',';
yield "{$prefix2}\"name\":";
yield \json_encode($value1->name, \JSO | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/nullable_object_dict.php",
"language": "php",
"file_size": 1402,
"cut_index": 524,
"middle_length": 229
} |
reamer\Tests\Fixtures\Model\ClassicDummy>|null
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['list<Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicD... | mponent\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($stream, $v[0], $v[1]);
}
};
return \iterator_to_array($iterable($stream, $data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\Cl | am, $offset, $length);
$iterable = static function ($stream, $data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $providers['Symfony\\Co | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_list.stream.php",
"language": "php",
"file_size": 2855,
"cut_index": 563,
"middle_length": 229
} |
turn static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithOtherDummies'] = static function ($stream, $offset, $leng... | $k => $v) {
match ($k) {
'name' => $object->name = \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $v[0], $v[1]),
'otherDummyOne' => $object->otherDummyOne = $providers['Symfony\\ | r->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies::class, static function ($object) use ($stream, $data, $options, $transformers, $instantiator, &$providers) {
foreach ($data as | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_in_object.stream.php",
"language": "php",
"file_size": 3466,
"cut_index": 614,
"middle_length": 229
} |
t<Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['list<Symfony\\Component\\JsonStreamer\\Tests\\Fixt... | roviders['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($stream, $v[0], $v[1]);
}
};
return \iterator_to_array($iterable($stream, $data));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests | tter::splitList($stream, $offset, $length);
$iterable = static function ($stream, $data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k => $p | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_list.stream.php",
"language": "php",
"file_size": 2019,
"cut_index": 537,
"middle_length": 229
} |
operties
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithSyntheticProperties'] = static fu... | ) {
return '_symfony_missing_value' !== $v;
}));
};
return $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithSyntheticProperties'](\Symfony\Component\JsonStreamer\Read\Decoder::decodeString((string) | erties::class, \array_filter([], static function ($v | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_synthetic_properties.php",
"language": "php",
"file_size": 928,
"cut_index": 606,
"middle_length": 52
} |
r\Tests\Fixtures\Model\DummyWithUnionProperties
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\Dum... | mfony_missing_value'], static function ($v) {
return '_symfony_missing_value' !== $v;
}));
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum'] = static function ($data) {
return \Sym | xtures\Model\DummyWithUnionProperties::class, \array_filter(['value' => \array_key_exists('value', $data) ? $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum|null|string']($data['value']) : '_sy | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_union.php",
"language": "php",
"file_size": 2050,
"cut_index": 563,
"middle_length": 229
} |
fony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithValueTransformerAttributes
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\Json... | stToIntValueTransformer')->transform($data['id'] ?? '_symfony_missing_value', $options), 'active' => $transformers->get('Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Transformer\\StringToBooleanValueTransformer')->transform($data['active'] ?? '_symfo | antiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithValueTransformerAttributes::class, \array_filter(['id' => $transformers->get('Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Transformer\\DivideStringAndCa | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_value_transformer.php",
"language": "php",
"file_size": 1582,
"cut_index": 537,
"middle_length": 229
} |
eamer\Tests\Fixtures\Model\DummyWithNestedArray> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "[";
$prefix1 = '';
foreach ($data as $value1) {
$prefix2 = '';
yield "{$prefix... | mies as $key3 => $value3) {
$key3 = is_int($key3) ? $key3 : \substr(\json_encode($key3), 1, -1);
$prefix6 = '';
yield "{$prefix5}\"{$key3}\":{{$prefix6}\"id\":";
yield \json_en | tr(\json_encode($key2), 1, -1);
$prefix4 = '';
yield "{$prefix3}\"{$key2}\":{{$prefix4}\"dummies\":";
yield "{";
$prefix5 = '';
foreach ($value2->dum | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/double_nested_array.php",
"language": "php",
"file_size": 2112,
"cut_index": 563,
"middle_length": 229
} |
* @param list<Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithList> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "[";
$prefix1 = '';
foreach ($data as $value1) {
$prefix2 =... | \json_encode($value2->name, \JSON_THROW_ON_ERROR, 508);
yield "}";
$prefix3 = ',';
}
$prefix2 = ',';
yield "]{$prefix2}\"customProperty\":";
yield \json_encode($value1->custom |
yield "{$prefix3}{{$prefix4}\"id\":";
yield \json_encode($value2->id, \JSON_THROW_ON_ERROR, 508);
$prefix4 = ',';
yield "{$prefix4}\"name\":";
yield | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/nested_list.php",
"language": "php",
"file_size": 1393,
"cut_index": 524,
"middle_length": 229
} |
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fi... | rs, $instantiator, &$providers) {
foreach ($data as $k => $v) {
match ($k) {
'id' => $object->id = \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $v[0], $v[1]),
'name' | itter::splitDict($stream, $offset, $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy::class, static function ($object) use ($stream, $data, $options, $transforme | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object.stream.php",
"language": "php",
"file_size": 1319,
"cut_index": 524,
"middle_length": 229
} |
Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['iterable<int|string, Symfony\\Component\\JsonStreamer\\Tests... | => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($stream, $v[0], $v[1]);
}
};
return $iterable($stream, $data);
};
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Mo | d\Splitter::splitDict($stream, $offset, $length);
$iterable = static function ($stream, $data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $k | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_iterable.stream.php",
"language": "php",
"file_size": 2047,
"cut_index": 563,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithDateTimes
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyWithDateTimes... | providers) {
foreach ($data as $k => $v) {
match ($k) {
'interface' => $object->interface = $providers['DateTimeInterface']($stream, $v[0], $v[1]),
'immutable' => $object->immutable = $pro | offset, $length);
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithDateTimes::class, static function ($object) use ($stream, $data, $options, $transformers, $instantiator, &$ | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_value_object.stream.php",
"language": "php",
"file_size": 2685,
"cut_index": 563,
"middle_length": 229
} |
* @param list<Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithArray> $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
yield "[";
$prefix1 = '';
foreach ($data as $value1) {
$prefix2 ... | R, 508);
$prefix4 = ',';
yield "{$prefix4}\"name\":";
yield \json_encode($value2->name, \JSON_THROW_ON_ERROR, 508);
yield "}";
$prefix3 = ',';
}
$prefix | 2 = is_int($key2) ? $key2 : \substr(\json_encode($key2), 1, -1);
$prefix4 = '';
yield "{$prefix3}\"{$key2}\":{{$prefix4}\"id\":";
yield \json_encode($value2->id, \JSON_THROW_ON_ERRO | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/nested_array.php",
"language": "php",
"file_size": 1501,
"cut_index": 524,
"middle_length": 229
} |
r\Tests\Fixtures\Model\DummyWithOtherDummies
*/
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
$providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\DummyW... | \\Model\\DummyWithNameAttributes']($data['otherDummyOne']) : '_symfony_missing_value', 'otherDummyTwo' => \array_key_exists('otherDummyTwo', $data) ? $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Model\\ClassicDummy']($data['otherDummyTwo' | \Model\DummyWithOtherDummies::class, \array_filter(['name' => $data['name'] ?? '_symfony_missing_value', 'otherDummyOne' => \array_key_exists('otherDummyOne', $data) ? $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_in_object.php",
"language": "php",
"file_size": 2393,
"cut_index": 563,
"middle_length": 229
} |
/**
* @param Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes|null $data
*/
return static function (mixed $data, \Psr\Container\ContainerInterface $transformers, array $options): \Traversable {
try {
if ($data instanceof \Symfony\Component\JsonStreamer\Tests\Fixtures\Model\Dumm... | new \Symfony\Component\JsonStreamer\Exception\UnexpectedValueException(\sprintf('Unexpected "%s" value.', \get_debug_type($data)));
}
} catch (\JsonException $e) {
throw new \Symfony\Component\JsonStreamer\Exception\NotEncodableValueEx | yield "{$prefix1}\"name\":";
yield \json_encode($data->name, \JSON_THROW_ON_ERROR, 511);
yield "}";
} elseif (null === $data) {
yield "null";
} else {
throw | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_writer/nullable_object.php",
"language": "php",
"file_size": 1165,
"cut_index": 518,
"middle_length": 229
} |
list<Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum>
*/
return static function (mixed $stream, \Psr\Container\ContainerInterface $transformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
$providers['list<Symfony\\Component\\JsonStreamer\\Tests\... | k => $providers['Symfony\\Component\\JsonStreamer\\Tests\\Fixtures\\Enum\\DummyBackedEnum']($stream, $v[0], $v[1]);
}
};
return \iterator_to_array($iterable($stream, $data));
};
$providers['Symfony\\Component\\JsonStream | ad\Splitter::splitList($stream, $offset, $length);
$iterable = static function ($stream, $data) use ($options, $transformers, $instantiator, &$providers) {
foreach ($data as $k => $v) {
yield $ | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/union.stream.php",
"language": "php",
"file_size": 3719,
"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\JsonStreamer\Tests\Mapping\Read;
use PHPUnit\Framework\TestCase;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use Symfony\Compone... | odel\DummyWithValueTransformerAttributes;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Transformer\DivideStringAndCastToIntValueTransformer;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Transformer\StringToBooleanValueTransformer;
use Symfony\Com | e Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithValueObjectTransformerAttributes;
use Symfony\Component\JsonStreamer\Tests\Fixtures\M | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Mapping/Read/AttributePropertyMetadataLoaderTest.php",
"language": "php",
"file_size": 4915,
"cut_index": 614,
"middle_length": 229
} |
ception\RuntimeException;
use Symfony\Component\JsonStreamer\Exception\UnsupportedException;
use Symfony\Component\JsonStreamer\Mapping\GenericTypePropertyMetadataLoader;
use Symfony\Component\JsonStreamer\Mapping\PropertyMetadata;
use Symfony\Component\JsonStreamer\Mapping\PropertyMetadataLoader;
use Symfony\Component... | \ClassicDummy;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithArray;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithDateTimes;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithDollarNamedProperties;
use S | DummyBackedEnum;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyEnum;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Mapping\SyntheticPropertyMetadataLoader;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Model | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Write/StreamWriterGeneratorTest.php",
"language": "php",
"file_size": 11343,
"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\JsonStreamer\Tests\ValueTransformer;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attri... | rmer();
$this->assertEquals(
new \DateTimeImmutable('2023-07-26'),
$valueTransformer->transform('2023-07-26', []),
);
$this->assertEquals(
(new \DateTimeImmutable('2023-07-26'))->setTime(0, 0),
| eTimeValueTransformer;
#[Group('legacy')]
#[IgnoreDeprecations]
class StringToDateTimeValueTransformerTest extends TestCase
{
public function testTransform()
{
$valueTransformer = new StringToDateTimeValueTransfo | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/ValueTransformer/StringToDateTimeValueTransformerTest.php",
"language": "php",
"file_size": 2620,
"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\JsonStreamer\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Sy... | register('.json_streamer.cache_warmer.streamer')->setArguments([null]);
$container->register('streamable')->setClass('Foo')->addResourceTag('json_streamer.streamable', ['object' => true, 'list' => true]);
$container->register('notStreamabl | mablePass;
class StreamablePassTest extends TestCase
{
public function testSetStreamable()
{
$container = new ContainerBuilder();
$container->register('json_streamer.stream_writer');
$container-> | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/DependencyInjection/StreamablePassTest.php",
"language": "php",
"file_size": 1631,
"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\JsonStreamer\Tests\DataModel\Write;
use PHPUnit\Framework\TestCase;
use Symfony\Component\JsonStreamer\D... | eType()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(\sprintf('"%s" expects at least 2 nodes.', CompositeNode::class));
new CompositeNode('$data', [new ScalarNode('$data', Type::int() | er\DataModel\Write\ScalarNode;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use Symfony\Component\TypeInfo\Type;
class CompositeNodeTest extends TestCase
{
public function testCannotCreateWithOnlyOn | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/DataModel/Write/CompositeNodeTest.php",
"language": "php",
"file_size": 2475,
"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\Tests\DataModel\Write;
use PHPUnit\Framework\TestCas... | ()', Type::int()),
new ScalarNode('function()', Type::int()),
new ScalarNode('$bar', Type::int()),
]);
$object = $object->withAccessor('$baz');
$this->assertSame('$baz', $object->getAccessor());
$thi | nds TestCase
{
public function testWithAccessor()
{
$object = new ObjectNode('$foo', Type::object(self::class), [
new ScalarNode('$foo->property', Type::int()),
new ScalarNode('$foo->method | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/DataModel/Write/ObjectNodeTest.php",
"language": "php",
"file_size": 1347,
"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\JsonStreamer\Tests\Mapping\Write;
use PHPUnit\Framework\TestCase;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use Symfony\Compon... | \Model\DummyWithValueTransformerAttributes;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Transformer\BooleanToStringValueTransformer;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Transformer\DoubleIntAndCastToStringValueTransformer;
use Symfony\C | use Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes;
use Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithValueObjectTransformerAttributes;
use Symfony\Component\JsonStreamer\Tests\Fixtures | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/Mapping/Write/AttributePropertyMetadataLoaderTest.php",
"language": "php",
"file_size": 4916,
"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\JsonStreamer\Tests\CacheWarmer;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\JsonStreamer\CacheWarmer\StreamerCacheWarmer;... | r;
private string $streamReadersDir;
protected function setUp(): void
{
parent::setUp();
$this->streamWritersDir = \sprintf('%s/symfony_json_streamer_test/stream_writer', sys_get_temp_dir());
$this->streamReadersDir = | l\DummyWithNameAttributes;
use Symfony\Component\JsonStreamer\Tests\ServiceContainer;
use Symfony\Component\TypeInfo\TypeResolver\TypeResolver;
class StreamerCacheWarmerTest extends TestCase
{
private string $streamWritersDi | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/CacheWarmer/StreamerCacheWarmerTest.php",
"language": "php",
"file_size": 3395,
"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\JsonStreamer\Tests\DataModel\Read;
use PHPUnit\Framework\TestCase;
use Symfony... | annotCreateWithOnlyOneType()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(\sprintf('"%s" expects at least 2 nodes.', CompositeNode::class));
new CompositeNode([new ScalarNode(Type::in | y\Component\JsonStreamer\DataModel\Read\ScalarNode;
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
use Symfony\Component\TypeInfo\Type;
class CompositeNodeTest extends TestCase
{
public function testC | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/DataModel/Read/CompositeNodeTest.php",
"language": "php",
"file_size": 1938,
"cut_index": 537,
"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\JsonStreamer\Tests\ValueTransformer;
use PHPUnit\Framework\Attributes\Group;
u... | teTimeToStringValueTransformer();
$this->assertSame(
'2023-07-26T00:00:00+00:00',
$valueTransformer->transform(new \DateTimeImmutable('2023-07-26', new \DateTimeZone('UTC')), []),
);
$this->assertSame(
| lueTransformer\DateTimeToStringValueTransformer;
#[Group('legacy')]
#[IgnoreDeprecations]
class DateTimeToStringValueTransformerTest extends TestCase
{
public function testTransform()
{
$valueTransformer = new Da | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/ValueTransformer/DateTimeToStringValueTransformerTest.php",
"language": "php",
"file_size": 1573,
"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\JsonStreamer\DependencyInjection;
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgum... | Interface;
/**
* Collects and merges services tagged with "json_streamer.property_value_transformer"
* or "json_streamer.value_object_transformer" and sets them as arguments for the
* services that need transformers.
*
* @author Mathias Arlaud <mathi | nvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\JsonStreamer\Transformer\PropertyValueTransformerInterface;
use Symfony\Component\JsonStreamer\Transformer\ValueObjectTransformer | {
"filepath": "src/Symfony/Component/JsonStreamer/DependencyInjection/TransformerPass.php",
"language": "php",
"file_size": 2993,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\JsonStreamer\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exceptio... | Component\JsonStreamer\Transformer\ValueObjectTransformerInterface;
class TransformerPassTest extends TestCase
{
public function testDoNothingIfStreamWriterNotDefined()
{
$container = new ContainerBuilder();
$container->register('j | s\Fixtures\Transformer\BooleanToStringValueTransformer;
use Symfony\Component\JsonStreamer\Transformer\DateTimeValueObjectTransformer;
use Symfony\Component\JsonStreamer\Transformer\PropertyValueTransformerInterface;
use Symfony\ | {
"filepath": "src/Symfony/Component/JsonStreamer/Tests/DependencyInjection/TransformerPassTest.php",
"language": "php",
"file_size": 5179,
"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\JsonStreamer\DataModel\Read;
use Symfony\Component\TypeInfo\Type\... | ction __construct(
private ObjectType $type,
private array $properties,
private bool $mock = false,
) {
}
public static function createMock(ObjectType|UnionType $type): self
{
return new self($type, [], true | nternal
*/
final class ObjectNode implements DataModelNodeInterface
{
/**
* @param array<string, array{name: string, value: DataModelNodeInterface, accessor: callable(string): string}> $properties
*/
public fun | {
"filepath": "src/Symfony/Component/JsonStreamer/DataModel/Read/ObjectNode.php",
"language": "php",
"file_size": 1496,
"cut_index": 524,
"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\Metadata;
use Symfony\Component\ObjectMapper\Attribute\Map;
use S... | try {
$key = $object::class.($property ?? '');
if (isset($this->attributesCache[$key])) {
return $this->attributesCache[$key];
}
$refl = $this->reflectionClassCache[$object::class] ?? | jectMapperMetadataFactoryInterface
{
private array $reflectionClassCache = [];
private array $attributesCache = [];
public function create(object $object, ?string $property = null, array $context = []): array
{
| {
"filepath": "src/Symfony/Component/ObjectMapper/Metadata/ReflectionObjectMapperMetadataFactory.php",
"language": "php",
"file_size": 1639,
"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\ObjectMapper\Metadata;
use Symfony\Component\ObjectMapper\Attribute\Map;
/**
* Maps classes based on a... | private readonly ObjectMapperMetadataFactoryInterface $objectMapperMetadataFactory,
private readonly array $classMap,
) {
}
public function create(object $object, ?string $property = null, array $context = []): array
{
$cl | toryInterface
{
/**
* @var array<string, list<Mapping>>
*/
private array $attributesCache = [];
/**
* @param array<class-string, class-string> $classMap
*/
public function __construct(
| {
"filepath": "src/Symfony/Component/ObjectMapper/Metadata/ReverseClassObjectMapperMetadataFactory.php",
"language": "php",
"file_size": 2415,
"cut_index": 563,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.