Skip to content

Commit

Permalink
Schema > loadType should load from standard types
Browse files Browse the repository at this point in the history
Why do this in getType?
  • Loading branch information
ruudk committed May 24, 2022
1 parent 0fafc7b commit 6906c1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Type/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ public function getConfig(): SchemaConfig
public function getType(string $name): ?Type
{
if (! isset($this->resolvedTypes[$name])) {
$type = Type::getStandardTypes()[$name]
?? $this->loadType($name);
$type = $this->loadType($name);

if ($type === null) {
return null;
Expand All @@ -326,6 +325,10 @@ public function hasType(string $name): bool
*/
private function loadType(string $typeName): ?Type
{
if (isset(Type::getStandardTypes()[$typeName])) {
return Type::getStandardTypes()[$typeName];
}

$typeLoader = $this->config->typeLoader;
if ($typeLoader === null) {
return $this->defaultTypeLoader($typeName);
Expand Down

0 comments on commit 6906c1d

Please sign in to comment.