@@ 94-99 (lines=6) @@ | ||
91 | )); |
|
92 | } |
|
93 | ||
94 | if ($this->hasProviderMapping($type) === true) { |
|
95 | throw new InvalidArgumentException(T::t( |
|
96 | 'Type should not be used more than once to register a schema (\'%s\').', |
|
97 | [$type] |
|
98 | )); |
|
99 | } |
|
100 | ||
101 | if ($schema instanceof SchemaProviderInterface) { |
|
102 | $this->setProviderMapping($type, $jsonType = get_class($schema)); |
|
@@ 145-147 (lines=3) @@ | ||
142 | return $this->getCreatedProvider($type); |
|
143 | } |
|
144 | ||
145 | if ($this->hasProviderMapping($type) === false) { |
|
146 | throw new InvalidArgumentException(T::t('Schema is not registered for type \'%s\'.', [$type])); |
|
147 | } |
|
148 | ||
149 | $classNameOrCallable = $this->getProviderMapping($type); |
|
150 | if (is_string($classNameOrCallable) === true) { |