diff --git a/.circleci/config.yml b/.circleci/config.yml index 195f62ba28b..4e70760d9cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,7 @@ jobs: name: Run PHPStan command: |- export PATH="$PATH:$HOME/.composer/vendor/bin" - phpstan analyse -c phpstan.neon -l5 --ansi src tests + phpstan analyse -c phpstan.neon -l6 --ansi src tests phpunit-coverage: docker: diff --git a/phpstan.neon b/phpstan.neon index cdbf7f29c4d..dc4e45a29a8 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -14,9 +14,12 @@ parameters: - '#Access to an undefined property object::\$isIdentifierComposite.#' - '#Call to an undefined method Doctrine\\Common\\Persistence\\ObjectManager::getConnection\(\)#' - '#Call to an undefined method PHPUnit\\Framework\\MockObject\\MockObject::[a-zA-Z0-9_]+\(\)#' - - '#Call to an undefined method Prophecy\\Prophecy\\ObjectProphecy::[a-zA-Z0-9_]+\(\)#' + - '#Call to an undefined method Prophecy\\Prophecy\\ObjectProphecy(|.*)?::[a-zA-Z0-9_]+\(\)#' - '#Method ApiPlatform\\Core\\Tests\\Bridge\\Doctrine\\Orm\\ItemDataProviderTest::getManagerRegistry\(\) should return Doctrine\\Common\\Persistence\\ManagerRegistry but returns object\.#' - '#Method ApiPlatform\\Core\\Tests\\Bridge\\Doctrine\\Orm\\Util\\IdentifierManagerTraitTest::getObjectManager\(\) should return Doctrine\\Common\\Persistence\\ObjectManager but returns object\.#' + - '#Parameter \#1 \$function of function call_user_func expects callable, .+ given\.#' + - '#Parameter \#1 \$classes of class ApiPlatform\\Core\\Metadata\\Resource\\ResourceNameCollection constructor expects array, array given\.#' + - '#Method ApiPlatform\\Core\\Util\\RequestParser::parseRequestParams\(\) should return array but returns array\|false\.#' # Temporary fix while the PHPStan extension for Prophecy isn't compatible with 0.10 - '#Parameter .* expects .*, .*object.* given\.#' - '#Parameter \#[0-9] \$filterLocator of class ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\FilterExtension constructor expects ApiPlatform\\Core\\Api\\FilterCollection|Psr\\Container\\ContainerInterface(\|null)?, ArrayObject given\.#' @@ -25,6 +28,7 @@ parameters: # https://github.com/doctrine/doctrine2/pull/7298/files - '#Strict comparison using === between null and int will always evaluate to false\.#' - '#Strict comparison using !== between null and null will always evaluate to false\.#' + - '#Method ApiPlatform\\Core\\(Serializer\\Abstract|JsonApi\\Serializer\\)ItemNormalizer::normalizeRelation\(\) should return array\|string but returns array\|bool\|float\|int\|string\.#' # Expected, due to deprecations - '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::getResult\(\) invoked with 4 parameters, 1 required\.#' diff --git a/src/Annotation/ApiFilter.php b/src/Annotation/ApiFilter.php index a4b24b7a4ed..b50aae034f6 100644 --- a/src/Annotation/ApiFilter.php +++ b/src/Annotation/ApiFilter.php @@ -37,7 +37,7 @@ final class ApiFilter public $strategy; /** - * @var string + * @var string|FilterInterface */ public $filterClass; diff --git a/src/Annotation/AttributesHydratorTrait.php b/src/Annotation/AttributesHydratorTrait.php index f46021de6a4..2a5870f1d2f 100644 --- a/src/Annotation/AttributesHydratorTrait.php +++ b/src/Annotation/AttributesHydratorTrait.php @@ -50,6 +50,7 @@ private function hydrateAttributes(array $values) } foreach ($values as $key => $value) { + $key = (string) $key; if (!property_exists($this, $key)) { throw new InvalidArgumentException(sprintf('Unknown property "%s" on annotation "%s".', $key, self::class)); } diff --git a/src/Bridge/Doctrine/Orm/Filter/DateFilter.php b/src/Bridge/Doctrine/Orm/Filter/DateFilter.php index ed645075489..f5904be2546 100644 --- a/src/Bridge/Doctrine/Orm/Filter/DateFilter.php +++ b/src/Bridge/Doctrine/Orm/Filter/DateFilter.php @@ -94,7 +94,7 @@ protected function filterProperty(string $property, $values, QueryBuilder $query } $nullManagement = $this->properties[$property] ?? null; - $type = $this->getDoctrineFieldType($property, $resourceClass); + $type = (string) $this->getDoctrineFieldType($property, $resourceClass); if (self::EXCLUDE_NULL === $nullManagement) { $queryBuilder->andWhere($queryBuilder->expr()->isNotNull(sprintf('%s.%s', $alias, $field))); @@ -160,6 +160,7 @@ protected function filterProperty(string $property, $values, QueryBuilder $query */ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, string $operator, string $value, string $nullManagement = null, $type = null) { + $type = (string) $type; try { $value = false === strpos($type, '_immutable') ? new \DateTime($value) : new \DateTimeImmutable($value); } catch (\Exception $e) { @@ -206,7 +207,7 @@ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterf */ protected function isDateField(string $property, string $resourceClass): bool { - return isset(self::DOCTRINE_DATE_TYPES[$this->getDoctrineFieldType($property, $resourceClass)]); + return isset(self::DOCTRINE_DATE_TYPES[(string) $this->getDoctrineFieldType($property, $resourceClass)]); } /** diff --git a/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php b/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php index 67518cdc4a0..f1e0a8cc982 100644 --- a/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php +++ b/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php @@ -63,7 +63,7 @@ public function getDescription(string $resourceClass): array $description[$property] = [ 'property' => $property, - 'type' => $this->getType($this->getDoctrineFieldType($property, $resourceClass)), + 'type' => $this->getType((string) $this->getDoctrineFieldType($property, $resourceClass)), 'required' => false, ]; } @@ -114,7 +114,7 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB list($alias, $field) = $this->addJoinsForNestedProperty($property, $alias, $queryBuilder, $queryNameGenerator, $resourceClass); } - if (!isset(self::DOCTRINE_NUMERIC_TYPES[$this->getDoctrineFieldType($property, $resourceClass)])) { + if (!isset(self::DOCTRINE_NUMERIC_TYPES[(string) $this->getDoctrineFieldType($property, $resourceClass)])) { $this->logger->notice('Invalid filter ignored', [ 'exception' => new InvalidArgumentException(sprintf('The field "%s" of class "%s" is not a doctrine numeric type.', $field, $resourceClass)), ]); @@ -126,7 +126,7 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB $queryBuilder ->andWhere(sprintf('%s.%s = :%s', $alias, $field, $valueParameter)) - ->setParameter($valueParameter, $value, $this->getDoctrineFieldType($property, $resourceClass)); + ->setParameter($valueParameter, $value, (string) $this->getDoctrineFieldType($property, $resourceClass)); } /** @@ -137,6 +137,6 @@ protected function isNumericField(string $property, string $resourceClass): bool $propertyParts = $this->splitPropertyParts($property, $resourceClass); $metadata = $this->getNestedMetadata($resourceClass, $propertyParts['associations']); - return isset(self::DOCTRINE_NUMERIC_TYPES[$metadata->getTypeOfField($propertyParts['field'])]); + return isset(self::DOCTRINE_NUMERIC_TYPES[(string) $metadata->getTypeOfField($propertyParts['field'])]); } } diff --git a/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php b/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php index 264bd6943eb..d8524110fa7 100644 --- a/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php +++ b/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php @@ -98,7 +98,7 @@ public function getDescription(string $resourceClass): array } if ($metadata->hasField($field)) { - $typeOfField = $this->getType($metadata->getTypeOfField($field)); + $typeOfField = $this->getType((string) $metadata->getTypeOfField($field)); $strategy = $this->properties[$property] ?? self::STRATEGY_EXACT; $filterParameterNames = [$property]; diff --git a/src/Bridge/Doctrine/Orm/ItemDataProvider.php b/src/Bridge/Doctrine/Orm/ItemDataProvider.php index f1718eece62..0a9d547c27d 100644 --- a/src/Bridge/Doctrine/Orm/ItemDataProvider.php +++ b/src/Bridge/Doctrine/Orm/ItemDataProvider.php @@ -69,7 +69,7 @@ public function getItem(string $resourceClass, $id, string $operationName = null { $manager = $this->managerRegistry->getManagerForClass($resourceClass); - if (!($context[IdentifierConverterInterface::HAS_IDENTIFIER_CONVERTER] ?? false)) { + if (!\is_array($id) && !($context[IdentifierConverterInterface::HAS_IDENTIFIER_CONVERTER] ?? false)) { $id = $this->normalizeIdentifiers($id, $manager, $resourceClass); } @@ -87,7 +87,7 @@ public function getItem(string $resourceClass, $id, string $operationName = null $queryNameGenerator = new QueryNameGenerator(); $doctrineClassMetadata = $manager->getClassMetadata($resourceClass); - $this->addWhereForIdentifiers($id, $queryBuilder, $doctrineClassMetadata); + $this->addWhereForIdentifiers((array) $id, $queryBuilder, $doctrineClassMetadata); foreach ($this->itemExtensions as $extension) { $extension->applyToItem($queryBuilder, $queryNameGenerator, $resourceClass, $id, $operationName, $context); diff --git a/src/Bridge/Doctrine/Orm/SubresourceDataProvider.php b/src/Bridge/Doctrine/Orm/SubresourceDataProvider.php index 2144abef53f..3f242621721 100644 --- a/src/Bridge/Doctrine/Orm/SubresourceDataProvider.php +++ b/src/Bridge/Doctrine/Orm/SubresourceDataProvider.php @@ -191,7 +191,7 @@ private function buildQuery(array $identifiers, array $context, QueryNameGenerat foreach ($normalizedIdentifiers as $key => $value) { $placeholder = $queryNameGenerator->generateParameterName($key); $qb->andWhere("$alias.$key = :$placeholder"); - $topQueryBuilder->setParameter($placeholder, $value, $classMetadata->getTypeOfField($key)); + $topQueryBuilder->setParameter($placeholder, $value, (string) $classMetadata->getTypeOfField($key)); } // Recurse queries diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php index cd1118ab90a..a6986870906 100644 --- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php @@ -67,11 +67,11 @@ protected function execute(InputInterface $input, OutputInterface $output) { $documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->apiTitle, $this->apiDescription, $this->apiVersion, $this->apiFormats); $data = $this->documentationNormalizer->normalize($documentation); - $content = $input->getOption('yaml') ? Yaml::dump($data, 6, 4, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE) : json_encode($data, JSON_PRETTY_PRINT); - if (!empty($input->getOption('output'))) { - file_put_contents($input->getOption('output'), $content); + $content = $input->getOption('yaml') ? Yaml::dump($data, 6, 4, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE) : (json_encode($data, JSON_PRETTY_PRINT) ?: ''); + if (!empty($filename = $input->getOption('output')) && \is_string($filename)) { + file_put_contents($filename, $content); $output->writeln( - sprintf('Data written to %s', $input->getOption('output')) + sprintf('Data written to %s', $filename) ); } else { $output->writeln($content); diff --git a/src/Bridge/Symfony/Routing/ApiLoader.php b/src/Bridge/Symfony/Routing/ApiLoader.php index 11193791c61..6af14127068 100644 --- a/src/Bridge/Symfony/Routing/ApiLoader.php +++ b/src/Bridge/Symfony/Routing/ApiLoader.php @@ -57,7 +57,9 @@ final class ApiLoader extends Loader public function __construct(KernelInterface $kernel, ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, ResourceMetadataFactoryInterface $resourceMetadataFactory, OperationPathResolverInterface $operationPathResolver, ContainerInterface $container, array $formats, array $resourceClassDirectories = [], SubresourceOperationFactoryInterface $subresourceOperationFactory = null, bool $graphqlEnabled = false, bool $entrypointEnabled = true, bool $docsEnabled = true) { - $this->fileLoader = new XmlFileLoader(new FileLocator($kernel->locateResource('@ApiPlatformBundle/Resources/config/routing'))); + /** @var string[]|string $paths */ + $paths = $kernel->locateResource('@ApiPlatformBundle/Resources/config/routing'); + $this->fileLoader = new XmlFileLoader(new FileLocator($paths)); $this->resourceNameCollectionFactory = $resourceNameCollectionFactory; $this->resourceMetadataFactory = $resourceMetadataFactory; $this->operationPathResolver = $operationPathResolver; diff --git a/src/Bridge/Symfony/Routing/IriConverter.php b/src/Bridge/Symfony/Routing/IriConverter.php index 4852ce49045..4f9e36ac8f4 100644 --- a/src/Bridge/Symfony/Routing/IriConverter.php +++ b/src/Bridge/Symfony/Routing/IriConverter.php @@ -96,7 +96,7 @@ public function getItemFromIri(string $iri, array $context = []) } if (isset($attributes['subresource_operation_name'])) { - if ($item = $this->getSubresourceData($identifiers, $attributes, $context)) { + if (($item = $this->getSubresourceData($identifiers, $attributes, $context)) && !\is_array($item)) { return $item; } diff --git a/src/DataProvider/OperationDataProviderTrait.php b/src/DataProvider/OperationDataProviderTrait.php index e5456ce06e3..d5a656fbfaf 100644 --- a/src/DataProvider/OperationDataProviderTrait.php +++ b/src/DataProvider/OperationDataProviderTrait.php @@ -67,7 +67,7 @@ private function getItemData($identifiers, array $attributes, array $context) * * @throws RuntimeException * - * @return object|null + * @return array|object|null */ private function getSubresourceData($identifiers, array $attributes, array $context) { diff --git a/src/EventListener/AddFormatListener.php b/src/EventListener/AddFormatListener.php index 3e0974402d0..47d9a6a1354 100644 --- a/src/EventListener/AddFormatListener.php +++ b/src/EventListener/AddFormatListener.php @@ -84,6 +84,7 @@ public function onKernelRequest(GetResponseEvent $event) } // First, try to guess the format from the Accept header + /** @var string|null $accept */ $accept = $request->headers->get('Accept'); if (null !== $accept) { if (null === $acceptHeader = $this->negotiator->getBest($accept, $mimeTypes)) { diff --git a/src/Filter/QueryParameterValidateListener.php b/src/Filter/QueryParameterValidateListener.php index 488d55ddf30..ffb919a69fd 100644 --- a/src/Filter/QueryParameterValidateListener.php +++ b/src/Filter/QueryParameterValidateListener.php @@ -86,7 +86,7 @@ private function isRequiredFilterValid(string $name, Request $request): bool return false; } - $rootName = array_keys($matches)[0] ?? ''; + $rootName = (string) (array_keys($matches)[0] ?? null); if (!$rootName) { return false; } diff --git a/src/GraphQl/Action/EntrypointAction.php b/src/GraphQl/Action/EntrypointAction.php index 3cf3e78abe5..e92ddac8bf6 100644 --- a/src/GraphQl/Action/EntrypointAction.php +++ b/src/GraphQl/Action/EntrypointAction.php @@ -83,7 +83,7 @@ private function parseRequest(Request $request): array } if ('json' === $request->getContentType()) { - $input = \json_decode($request->getContent(), true); + $input = \json_decode((string) $request->getContent(), true); if (isset($input['query'])) { $query = $input['query']; diff --git a/src/GraphQl/Serializer/ItemNormalizer.php b/src/GraphQl/Serializer/ItemNormalizer.php index 13124284977..8702210928c 100644 --- a/src/GraphQl/Serializer/ItemNormalizer.php +++ b/src/GraphQl/Serializer/ItemNormalizer.php @@ -79,7 +79,7 @@ protected function getAllowedAttributes($classOrObject, array $context, $attribu if (($context['api_denormalize'] ?? false) && false !== ($indexId = array_search('id', $allowedAttributes, true))) { $allowedAttributes[] = '_id'; - array_splice($allowedAttributes, $indexId, 1); + array_splice($allowedAttributes, (int) $indexId, 1); } return $allowedAttributes; diff --git a/src/GraphQl/Type/SchemaBuilder.php b/src/GraphQl/Type/SchemaBuilder.php index 63de7b4c9ba..d142bd9378a 100644 --- a/src/GraphQl/Type/SchemaBuilder.php +++ b/src/GraphQl/Type/SchemaBuilder.php @@ -288,7 +288,7 @@ private function mergeFilterArgs(array $args, array $parsed, ResourceMetadata $r if (\is_array($value)) { $value = $this->mergeFilterArgs($args[$key] ?? [], $value); if (!isset($value['#name'])) { - $name = (false === $pos = strrpos($original, '[')) ? $original : substr($original, 0, $pos); + $name = (false === $pos = strrpos($original, '[')) ? $original : substr($original, 0, (int) $pos); $value['#name'] = ($resourceMetadata ? $resourceMetadata->getShortName() : '').'Filter_'.strtr($name, ['[' => '_', ']' => '', '.' => '__']); } } diff --git a/src/Metadata/Extractor/XmlExtractor.php b/src/Metadata/Extractor/XmlExtractor.php index 4f64b95acff..a3e041e0d8d 100644 --- a/src/Metadata/Extractor/XmlExtractor.php +++ b/src/Metadata/Extractor/XmlExtractor.php @@ -33,6 +33,7 @@ final class XmlExtractor extends AbstractExtractor protected function extractPath(string $path) { try { + /** @var \SimpleXMLElement $xml */ $xml = simplexml_import_dom(XmlUtils::loadFile($path, self::RESOURCE_SCHEMA)); } catch (\InvalidArgumentException $e) { throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); diff --git a/src/Metadata/Extractor/YamlExtractor.php b/src/Metadata/Extractor/YamlExtractor.php index c76fbc5450e..f965bf34244 100644 --- a/src/Metadata/Extractor/YamlExtractor.php +++ b/src/Metadata/Extractor/YamlExtractor.php @@ -32,7 +32,7 @@ final class YamlExtractor extends AbstractExtractor protected function extractPath(string $path) { try { - $resourcesYaml = Yaml::parse(file_get_contents($path), Yaml::PARSE_CONSTANT); + $resourcesYaml = Yaml::parse((string) file_get_contents($path), Yaml::PARSE_CONSTANT); } catch (ParseException $e) { $e->setParsedFile($path); diff --git a/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php b/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php index 50145a37c5b..f11556bc09a 100644 --- a/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php +++ b/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php @@ -112,7 +112,7 @@ private function normalize(bool $collection, ResourceMetadata $resourceMetadata, $operation = []; } - $upperOperationName = strtoupper($operationName); + $upperOperationName = strtoupper((string) $operationName); if ($collection) { $supported = isset(self::SUPPORTED_COLLECTION_OPERATION_METHODS[$upperOperationName]); } else { diff --git a/src/Operation/Factory/SubresourceOperationFactory.php b/src/Operation/Factory/SubresourceOperationFactory.php index 412d36e7bed..d930ad8eae0 100644 --- a/src/Operation/Factory/SubresourceOperationFactory.php +++ b/src/Operation/Factory/SubresourceOperationFactory.php @@ -157,10 +157,10 @@ private function computeSubresourceOperations(string $resourceClass, array &$tre if (isset($subresourceOperation['path'])) { $operation['path'] = $subresourceOperation['path']; } else { - $operation['path'] = str_replace(self::FORMAT_SUFFIX, '', $parentOperation['path']); + $operation['path'] = str_replace(self::FORMAT_SUFFIX, '', (string) $parentOperation['path']); if ($parentOperation['collection']) { - list($key) = end($operation['identifiers']); + [$key] = end($operation['identifiers']); $operation['path'] .= sprintf('/{%s}', $key); } diff --git a/src/Swagger/Serializer/ApiGatewayNormalizer.php b/src/Swagger/Serializer/ApiGatewayNormalizer.php index f9937f0a5e1..babd97f6097 100644 --- a/src/Swagger/Serializer/ApiGatewayNormalizer.php +++ b/src/Swagger/Serializer/ApiGatewayNormalizer.php @@ -93,8 +93,8 @@ public function normalize($object, $format = null, array $context = []) // $data['definitions'] is an instance of \ArrayObject foreach (array_keys($data['definitions']->getArrayCopy()) as $definition) { - if (!preg_match('/^[A-z]+$/', $definition)) { - $data['definitions'][str_replace(['-', '_'], '', $definition)] = $data['definitions'][$definition]; + if (!preg_match('/^[A-z]+$/', (string) $definition)) { + $data['definitions'][str_replace(['-', '_'], '', (string) $definition)] = $data['definitions'][$definition]; unset($data['definitions'][$definition]); } } diff --git a/src/Util/RequestParser.php b/src/Util/RequestParser.php index 4adb2a47c19..2247e8e2c39 100644 --- a/src/Util/RequestParser.php +++ b/src/Util/RequestParser.php @@ -35,7 +35,7 @@ private function __construct() public static function parseAndDuplicateRequest(Request $request): Request { $query = self::parseRequestParams(self::getQueryString($request) ?? ''); - $body = self::parseRequestParams($request->getContent()); + $body = self::parseRequestParams((string) $request->getContent()); return $request->duplicate($query, $body); } diff --git a/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php b/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php index eb532c2ada5..2e2769b7181 100644 --- a/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php +++ b/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php @@ -67,11 +67,12 @@ public function testExecuteWithYaml() public function testWriteToFile() { + /** @var string $tmpFile */ $tmpFile = tempnam(sys_get_temp_dir(), 'test_write_to_file'); $this->tester->run(['command' => 'api:swagger:export', '--output' => $tmpFile]); - $this->assertJson(file_get_contents($tmpFile)); + $this->assertJson((string) @file_get_contents($tmpFile)); @unlink($tmpFile); } diff --git a/tests/GraphQl/Type/SchemaBuilderTest.php b/tests/GraphQl/Type/SchemaBuilderTest.php index b725b7db84d..baf97ad07b6 100644 --- a/tests/GraphQl/Type/SchemaBuilderTest.php +++ b/tests/GraphQl/Type/SchemaBuilderTest.php @@ -183,6 +183,7 @@ public function testGetSchema(bool $paginationEnabled) $this->assertEquals(GraphQLType::nonNull(GraphQLType::int()), $objectPropertyFieldType->getField('totalCount')->getType()); /** @var ListOfType $edgesType */ $edgesType = $objectPropertyFieldType->getFields()['edges']->getType(); + /** @var ObjectType $edgeType */ $edgeType = $edgesType->getWrappedType(); $this->assertSame('ShortName1Edge', $edgeType->name); $this->assertEquals(GraphQLType::nonNull(GraphQLType::string()), $edgeType->getField('cursor')->getType()); diff --git a/tests/Swagger/Serializer/ApiGatewayNormalizerTest.php b/tests/Swagger/Serializer/ApiGatewayNormalizerTest.php index b6ef51b7f8e..d8f76b83e26 100644 --- a/tests/Swagger/Serializer/ApiGatewayNormalizerTest.php +++ b/tests/Swagger/Serializer/ApiGatewayNormalizerTest.php @@ -30,7 +30,7 @@ final class ApiGatewayNormalizerTest extends TestCase private $documentationNormalizerMock; /** - * @var ObjectProphecy|\stdClass + * @var ObjectProphecy */ private $objectMock;