Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
teohhanhui committed Feb 18, 2016
1 parent d8b5a54 commit 52b3369
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions Nelmio/Extractor/ApiDocExtractor.php
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the DunglasApiBundle package.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Dunglas\ApiBundle\Nelmio\Extractor;

use Doctrine\Common\Util\ClassUtils;
Expand Down
14 changes: 7 additions & 7 deletions Nelmio/Parser/ApiParser.php
Expand Up @@ -30,12 +30,12 @@ class ApiParser implements ParserInterface
const OUT_PREFIX = 'dunglas_api_out';
const IRI = 'IRI';

private static $typeMap = array(
private static $typeMap = [
'int' => DataTypes::INTEGER,
'bool' => DataTypes::BOOLEAN,
'string' => DataTypes::STRING,
'float' => DataTypes::FLOAT,
);
];

/**
* @var ResourceCollectionInterface
Expand Down Expand Up @@ -88,7 +88,7 @@ public function parse(array $item)
*
* @return array
*/
private function parseClass(ResourceInterface $resource, $entityClass, $io, array $visited = array())
private function parseClass(ResourceInterface $resource, $entityClass, $io, array $visited = [])
{
$visited[] = $entityClass;

Expand All @@ -99,7 +99,7 @@ private function parseClass(ResourceInterface $resource, $entityClass, $io, arra
$resource->getValidationGroups()
);

$data = array();
$data = [];
/** @var AttributeMetadataInterface $attributeMetadata */
foreach ($classMetadata->getAttributesMetadata() as $name => $attributeMetadata) {
if (
Expand All @@ -124,14 +124,14 @@ private function parseClass(ResourceInterface $resource, $entityClass, $io, arra
*
* @return array
*/
private function parseAttribute(ResourceInterface $resource, AttributeMetadataInterface $attributeMetadata, $io, Type $type = null, array $visited = array())
private function parseAttribute(ResourceInterface $resource, AttributeMetadataInterface $attributeMetadata, $io, Type $type = null, array $visited = [])
{
$data = array(
$data = [
'dataType' => null,
'required' => $attributeMetadata->isRequired(),
'description' => $attributeMetadata->getDescription(),
'readonly' => !$attributeMetadata->isWritable(),
);
];

if (null == $type) {
if (null === $attributeMetadata->getType()) {
Expand Down

0 comments on commit 52b3369

Please sign in to comment.