Fix codestyle

This commit is contained in:
Filip Benčo 2019-12-13 22:45:32 +01:00
parent 2de03859c0
commit 5d8765db04
9 changed files with 260 additions and 262 deletions

View File

@ -93,11 +93,11 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar
} }
$type = $types[0]; $type = $types[0];
$this->describeProperty($type, $model, $property); $this->describeProperty($type, $model, $property, $propertyName);
} }
} }
private function describeProperty(Type $type, Model $model, Schema $property) private function describeProperty(Type $type, Model $model, Schema $property, string $propertyName)
{ {
foreach ($this->propertyDescribers as $propertyDescriber) { foreach ($this->propertyDescribers as $propertyDescriber) {
if ($propertyDescriber instanceof ModelRegistryAwareInterface) { if ($propertyDescriber instanceof ModelRegistryAwareInterface) {
@ -110,11 +110,9 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar
} }
} }
throw new \Exception(sprintf('Type "%s" is not supported in %s::$%s. You may use the `@SWG\Property(type="")` annotation to specify it manually.', $type->getBuiltinType(), $class, $propertyName)); throw new \Exception(sprintf('Type "%s" is not supported in %s::$%s. You may use the `@SWG\Property(type="")` annotation to specify it manually.', $type->getBuiltinType(), $model->getType()->getClassName(), $propertyName));
} }
public function supports(Model $model): bool public function supports(Model $model): bool
{ {
return Type::BUILTIN_TYPE_OBJECT === $model->getType()->getBuiltinType() && class_exists($model->getType()->getClassName()); return Type::BUILTIN_TYPE_OBJECT === $model->getType()->getBuiltinType() && class_exists($model->getType()->getClassName());