Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  Fix CS
  Fix CS
  • Loading branch information
fabpot committed Feb 4, 2020
2 parents a76fc03 + 6d9a233 commit b9faf0f
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Annotation/DiscriminatorMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class DiscriminatorMap
public function __construct(array $data)
{
if (empty($data['typeProperty'])) {
throw new InvalidArgumentException(sprintf('Parameter "typeProperty" of annotation "%s" cannot be empty.', \get_class($this)));
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.', \get_class($this)));
throw new InvalidArgumentException(sprintf('Parameter "mapping" of annotation "%s" cannot be empty.', static::class));
}

$this->typeProperty = $data['typeProperty'];
Expand Down
4 changes: 2 additions & 2 deletions Annotation/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class Groups
public function __construct(array $data)
{
if (!isset($data['value']) || !$data['value']) {
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" cannot be empty.', \get_class($this)));
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.', \get_class($this)));
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be a string or an array of strings.', static::class));
}
}

Expand Down
4 changes: 2 additions & 2 deletions Annotation/MaxDepth.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class MaxDepth
public function __construct(array $data)
{
if (!isset($data['value'])) {
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" should be set.', \get_class($this)));
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.', \get_class($this)));
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be a positive integer.', static::class));
}

$this->maxDepth = $data['value'];
Expand Down
4 changes: 2 additions & 2 deletions Annotation/SerializedName.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ final class SerializedName
public function __construct(array $data)
{
if (!isset($data['value'])) {
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" should be set.', \get_class($this)));
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.', \get_class($this)));
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be a non-empty string.', static::class));
}

$this->serializedName = $data['value'];
Expand Down
10 changes: 10 additions & 0 deletions Normalizer/AbstractNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,17 @@ protected function isCircularReference(object $object, array &$context)
*/
protected function handleCircularReference(object $object, string $format = null, array $context = [])
{
<<<<<<< HEAD
$circularReferenceHandler = $context[self::CIRCULAR_REFERENCE_HANDLER] ?? $this->defaultContext[self::CIRCULAR_REFERENCE_HANDLER];
=======
if (\func_num_args() < 2 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
@trigger_error(sprintf('The "%s()" method will have two new "string $format = null" and "array $context = []" arguments in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
}
$format = \func_num_args() > 1 ? func_get_arg(1) : null;
$context = \func_num_args() > 2 ? func_get_arg(2) : [];

$circularReferenceHandler = $context[self::CIRCULAR_REFERENCE_HANDLER] ?? $this->defaultContext[self::CIRCULAR_REFERENCE_HANDLER] ?? $this->circularReferenceHandler;
>>>>>>> 4.4
if ($circularReferenceHandler) {
return $circularReferenceHandler($object, $format, $context);
}
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/ConstraintViolationListNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ public function supportsNormalization($data, string $format = null)
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}
}
2 changes: 1 addition & 1 deletion Normalizer/CustomNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ public function supportsDenormalization($data, string $type, string $format = nu
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}
}
2 changes: 1 addition & 1 deletion Normalizer/DataUriNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function supportsDenormalization($data, string $type, string $format = nu
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/DateIntervalNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function supportsNormalization($data, string $format = null)
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/DateTimeNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function supportsDenormalization($data, string $type, string $format = nu
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/DateTimeZoneNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ public function supportsDenormalization($data, string $type, string $format = nu
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}
}
2 changes: 1 addition & 1 deletion Normalizer/GetSetMethodNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function supportsDenormalization($data, string $type, string $format = nu
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/JsonSerializableNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ public function denormalize($data, string $type, string $format = null, array $c
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}
}
2 changes: 1 addition & 1 deletion Normalizer/ObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(ClassMetadataFactoryInterface $classMetadataFactory
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/PropertyNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function supportsDenormalization($data, string $type, string $format = nu
*/
public function hasCacheableSupportsMethod(): bool
{
return __CLASS__ === \get_class($this);
return __CLASS__ === static::class;
}

/**
Expand Down

0 comments on commit b9faf0f

Please sign in to comment.