Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Mar 6, 2016
1 parent 4020133 commit 895aee5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
filter:
excluded_paths:
- "src/Mapping/Guess/DoctrineGuesser.php"
2 changes: 1 addition & 1 deletion src/Mapping/Context/FieldContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FieldContext extends ContainerContext
*/
public function __construct(Field $field, FieldContainer $container, SchemaContainer $schema)
{
$this->field = $field;
$this->field = $field;
parent::__construct($container, $schema);
}

Expand Down
5 changes: 5 additions & 0 deletions src/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ private function loadFile($path, SchemaContainer $schemaContainer)
{
$config = Yaml::parse($this->getFileContent($path));

if (!is_array($config)) {
return;
}

/** @var array $config */
foreach ($config as $type => $mapping) {
switch ($type) {
case 'query':
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Field extends AbstractType
/**
* @var array
*/
private $resolveConfig = array();
private $resolveConfig = [];

/**
* @var Field[]
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Guess/DoctrineGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DoctrineGuesser implements TypeGuesserInterface, FieldGuesserInterface
private $metadataFactory;

/**
* @param ClassMetadataFactory $metadataFactory
* @param ObjectManager $objectManager
*/
public function __construct(ObjectManager $objectManager)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Guess/PropertyGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function guessFieldResolveConfig(FieldContext $fieldContext)

/**
* @param string $className
* @param FieldContext $field
* @param FieldContext $fieldContext
* @return string|null
*/
private function getAccessor($className, FieldContext $fieldContext)
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function toMapping()
$mapping = parent::toMapping();

$mapping['extends'] = $this->extends;
$mapping['values'] = $this->values;
$mapping['values'] = $this->values;

return $mapping;
}
Expand Down
12 changes: 7 additions & 5 deletions src/Schema/SchemaFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,18 @@ private function createType(FieldContainer $type)
$this->prepareFields($type->getFields());
}

switch ($type->getInternalType()) {
$internalType = $type->getInternalType();

switch ($internalType) {
case 'ObjectType':
$type = new GQLDefinition\ObjectType($type->toMapping());
return new GQLDefinition\ObjectType($type->toMapping());
break;
case 'EnumType':
$type = new GQLDefinition\EnumType($type->toMapping());
return new GQLDefinition\EnumType($type->toMapping());
break;
default:
throw new \InvalidArgumentException(sprintf('Undefined internal type "%s"', $internalType));
}

return $type;
}

/**
Expand Down

0 comments on commit 895aee5

Please sign in to comment.