default services conflit ?
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?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\Serializer\Annotation;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Annotation class for @DiscriminatorMap().
|
||||
*
|
||||
* @Annotation
|
||||
* @Target({"CLASS"})
|
||||
*
|
||||
* @author Samuel Roze <samuel.roze@gmail.com>
|
||||
*/
|
||||
class DiscriminatorMap
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $typeProperty;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $mapping;
|
||||
|
||||
/**
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (empty($data['typeProperty'])) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter "typeProperty" of annotation "%s" cannot be empty.', static::class));
|
||||
}
|
||||
|
||||
if (empty($data['mapping'])) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter "mapping" of annotation "%s" cannot be empty.', static::class));
|
||||
}
|
||||
|
||||
$this->typeProperty = $data['typeProperty'];
|
||||
$this->mapping = $data['mapping'];
|
||||
}
|
||||
|
||||
public function getTypeProperty(): string
|
||||
{
|
||||
return $this->typeProperty;
|
||||
}
|
||||
|
||||
public function getMapping(): array
|
||||
{
|
||||
return $this->mapping;
|
||||
}
|
||||
}
|
57
old.vendor/symfony/serializer/Annotation/Groups.php
Normal file
57
old.vendor/symfony/serializer/Annotation/Groups.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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\Serializer\Annotation;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Annotation class for @Groups().
|
||||
*
|
||||
* @Annotation
|
||||
* @Target({"PROPERTY", "METHOD"})
|
||||
*
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class Groups
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $groups;
|
||||
|
||||
/**
|
||||
* @param string[] $groups
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (!isset($data['value']) || !$data['value']) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" cannot be empty.', static::class));
|
||||
}
|
||||
|
||||
$value = (array) $data['value'];
|
||||
foreach ($value as $group) {
|
||||
if (!\is_string($group)) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be a string or an array of strings.', static::class));
|
||||
}
|
||||
}
|
||||
|
||||
$this->groups = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getGroups()
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
}
|
48
old.vendor/symfony/serializer/Annotation/MaxDepth.php
Normal file
48
old.vendor/symfony/serializer/Annotation/MaxDepth.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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\Serializer\Annotation;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Annotation class for @MaxDepth().
|
||||
*
|
||||
* @Annotation
|
||||
* @Target({"PROPERTY", "METHOD"})
|
||||
*
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class MaxDepth
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $maxDepth;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (!isset($data['value'])) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" should be set.', static::class));
|
||||
}
|
||||
|
||||
if (!\is_int($data['value']) || $data['value'] <= 0) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be a positive integer.', static::class));
|
||||
}
|
||||
|
||||
$this->maxDepth = $data['value'];
|
||||
}
|
||||
|
||||
public function getMaxDepth()
|
||||
{
|
||||
return $this->maxDepth;
|
||||
}
|
||||
}
|
48
old.vendor/symfony/serializer/Annotation/SerializedName.php
Normal file
48
old.vendor/symfony/serializer/Annotation/SerializedName.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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\Serializer\Annotation;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Annotation class for @SerializedName().
|
||||
*
|
||||
* @Annotation
|
||||
* @Target({"PROPERTY", "METHOD"})
|
||||
*
|
||||
* @author Fabien Bourigault <bourigaultfabien@gmail.com>
|
||||
*/
|
||||
final class SerializedName
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $serializedName;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (!isset($data['value'])) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" should be set.', static::class));
|
||||
}
|
||||
|
||||
if (!\is_string($data['value']) || empty($data['value'])) {
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be a non-empty string.', static::class));
|
||||
}
|
||||
|
||||
$this->serializedName = $data['value'];
|
||||
}
|
||||
|
||||
public function getSerializedName(): string
|
||||
{
|
||||
return $this->serializedName;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user