Skip to content

Commit 3ea9755

Browse files
committed
Fix files with PHP-CS-Fixer (native_function_invocation)
1 parent de389ff commit 3ea9755

File tree

19 files changed

+36
-36
lines changed

19 files changed

+36
-36
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ public function thereAreDummyObjectsWithDummyDateAndDummyBoolean(int $nb, string
386386
{
387387
$descriptions = ['Smart dummy.', 'Not so smart dummy.'];
388388

389-
if (in_array($bool, ['true', '1', 1], true)) {
389+
if (\in_array($bool, ['true', '1', 1], true)) {
390390
$bool = true;
391-
} elseif (in_array($bool, ['false', '0', 0], true)) {
391+
} elseif (\in_array($bool, ['false', '0', 0], true)) {
392392
$bool = false;
393393
} else {
394394
$expected = ['true', 'false', '1', '0'];
@@ -496,9 +496,9 @@ public function thereAreDummyObjectsWithDummyPrice(int $nb)
496496
*/
497497
public function thereAreDummyObjectsWithDummyBoolean(int $nb, string $bool)
498498
{
499-
if (in_array($bool, ['true', '1', 1], true)) {
499+
if (\in_array($bool, ['true', '1', 1], true)) {
500500
$bool = true;
501-
} elseif (in_array($bool, ['false', '0', 0], true)) {
501+
} elseif (\in_array($bool, ['false', '0', 0], true)) {
502502
$bool = false;
503503
} else {
504504
$expected = ['true', 'false', '1', '0'];
@@ -524,9 +524,9 @@ public function thereAreDummyObjectsWithDummyBoolean(int $nb, string $bool)
524524
*/
525525
public function thereAreDummyObjectsWithEmbeddedDummyBoolean(int $nb, string $bool)
526526
{
527-
if (in_array($bool, ['true', '1', 1], true)) {
527+
if (\in_array($bool, ['true', '1', 1], true)) {
528528
$bool = true;
529-
} elseif (in_array($bool, ['false', '0', 0], true)) {
529+
} elseif (\in_array($bool, ['false', '0', 0], true)) {
530530
$bool = false;
531531
} else {
532532
$expected = ['true', 'false', '1', '0'];
@@ -551,9 +551,9 @@ public function thereAreDummyObjectsWithEmbeddedDummyBoolean(int $nb, string $bo
551551
*/
552552
public function thereAreDummyObjectsWithRelationEmbeddedDummyBoolean(int $nb, string $bool)
553553
{
554-
if (in_array($bool, ['true', '1', 1], true)) {
554+
if (\in_array($bool, ['true', '1', 1], true)) {
555555
$bool = true;
556-
} elseif (in_array($bool, ['false', '0', 0], true)) {
556+
} elseif (\in_array($bool, ['false', '0', 0], true)) {
557557
$bool = false;
558558
} else {
559559
$expected = ['true', 'false', '1', '0'];

features/bootstrap/HydraContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ public function assertOperationNodeValueContains(string $nodeName, string $opera
118118
*/
119119
public function assertNbOperationsExist(int $nb, string $className)
120120
{
121-
Assert::assertEquals($nb, count($this->getOperations($className)));
121+
Assert::assertEquals($nb, \count($this->getOperations($className)));
122122
}
123123

124124
/**
125125
* @Then :nb properties are available for Hydra class :class
126126
*/
127127
public function assertNbPropertiesExist(int $nb, string $className)
128128
{
129-
Assert::assertEquals($nb, count($this->getProperties($className)));
129+
Assert::assertEquals($nb, \count($this->getProperties($className)));
130130
}
131131

132132
/**

features/bootstrap/JsonContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public function __construct(HttpCallResultPool $httpCallResultPool)
2626

2727
private function sortArrays($obj)
2828
{
29-
$isObject = is_object($obj);
29+
$isObject = \is_object($obj);
3030

3131
foreach ($obj as $key => $value) {
3232
if (null === $value || is_scalar($value)) {
3333
continue;
3434
}
3535

36-
if (is_array($value)) {
36+
if (\is_array($value)) {
3737
sort($value);
3838
}
3939

features/bootstrap/SwaggerContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function assertPropertyExist(string $propertyName, string $className)
9090
*/
9191
public function assertPropertyIsRequired(string $propertyName, string $className)
9292
{
93-
if (!in_array($propertyName, $this->getClassInfo($className)->required, true)) {
93+
if (!\in_array($propertyName, $this->getClassInfo($className)->required, true)) {
9494
throw new ExpectationFailedException(sprintf('Property "%s" of class "%s" should be required', $propertyName, $className));
9595
}
9696
}

src/Bridge/Doctrine/Common/DataPersister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ public function remove($data)
8181
*/
8282
private function getManager($data)
8383
{
84-
return is_object($data) ? $this->managerRegistry->getManagerForClass($this->getObjectClass($data)) : null;
84+
return \is_object($data) ? $this->managerRegistry->getManagerForClass($this->getObjectClass($data)) : null;
8585
}
8686
}

src/DataProvider/ChainItemDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getItem(string $resourceClass, $id, string $operationName = null
4646

4747
return $dataProvider->getItem($resourceClass, $id, $operationName, $context);
4848
} catch (ResourceClassNotSupportedException $e) {
49-
@trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', get_class($e), RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
49+
@trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', \get_class($e), RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
5050
continue;
5151
}
5252
}

src/JsonApi/Serializer/ConstraintViolationListNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private function getSourcePointerFromViolation(ConstraintViolationInterface $vio
7171
$propertyMetadata = $this->propertyMetadataFactory
7272
->create(
7373
// Im quite sure this requires some thought in case of validations over relationships
74-
get_class($violation->getRoot()),
74+
\get_class($violation->getRoot()),
7575
$fieldName
7676
);
7777

src/JsonApi/Serializer/ItemNormalizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function normalize($object, $format = null, array $context = [])
6767
// Get and populate attributes data
6868
$objectAttributesData = parent::normalize($object, $format, $context);
6969

70-
if (!is_array($objectAttributesData)) {
70+
if (!\is_array($objectAttributesData)) {
7171
return $objectAttributesData;
7272
}
7373

@@ -147,7 +147,7 @@ protected function getAttributes($object, $format = null, array $context)
147147
*/
148148
protected function setAttributeValue($object, $attribute, $value, $format = null, array $context = [])
149149
{
150-
parent::setAttributeValue($object, $attribute, is_array($value) && array_key_exists('data', $value) ? $value['data'] : $value, $format, $context);
150+
parent::setAttributeValue($object, $attribute, \is_array($value) && array_key_exists('data', $value) ? $value['data'] : $value, $format, $context);
151151
}
152152

153153
/**
@@ -164,7 +164,7 @@ protected function denormalizeRelation(string $attributeName, PropertyMetadata $
164164
return $this->serializer->denormalize($value, $className, $format, $context);
165165
}
166166

167-
if (!is_array($value) || !isset($value['id'], $value['type'])) {
167+
if (!\is_array($value) || !isset($value['id'], $value['type'])) {
168168
throw new InvalidArgumentException('Only resource linkage supported currently, see: http://jsonapi.org/format/#document-resource-object-linkage.');
169169
}
170170

src/JsonApi/Serializer/ReservedAttributeNameConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function normalize($propertyName)
5757
*/
5858
public function denormalize($propertyName)
5959
{
60-
if (in_array($propertyName, self::JSON_API_RESERVED_ATTRIBUTES, true)) {
60+
if (\in_array($propertyName, self::JSON_API_RESERVED_ATTRIBUTES, true)) {
6161
$propertyName = substr($propertyName, 1);
6262
}
6363

src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function normalize(bool $collection, ResourceMetadata $resourceMetadata,
107107
$newOperations = [];
108108
foreach ($operations as $operationName => $operation) {
109109
// e.g.: @ApiResource(itemOperations={"get"})
110-
if (is_int($operationName) && is_string($operation)) {
110+
if (\is_int($operationName) && \is_string($operation)) {
111111
$operationName = $operation;
112112
$operation = [];
113113
}
@@ -132,7 +132,7 @@ private function normalize(bool $collection, ResourceMetadata $resourceMetadata,
132132
private function normalizeGraphQl(ResourceMetadata $resourceMetadata, array $operations)
133133
{
134134
foreach ($operations as $operationName => $operation) {
135-
if (is_int($operationName) && is_string($operation)) {
135+
if (\is_int($operationName) && \is_string($operation)) {
136136
unset($operations[$operationName]);
137137
$operations[$operation] = [];
138138
}

0 commit comments

Comments
 (0)