Code Duplication    Length = 3-3 lines in 3 locations

src/Jms/YamlConverter.php 1 location

@@ 164-166 (lines=3) @@
161
    {
162
        $schema = $item->getSchema();
163
164
        if (!isset($this->namespaces[$schema->getTargetNamespace()])) {
165
            throw new Exception(sprintf("Can't find a PHP namespace to '%s' namespace", $schema->getTargetNamespace()));
166
        }
167
        return $this->namespaces[$schema->getTargetNamespace()];
168
    }
169

src/Php/PhpConverter.php 2 locations

@@ 158-160 (lines=3) @@
155
            $class->setName($this->getNamingStrategy()->getItemName($element));
156
            $class->setDoc($element->getDoc());
157
158
            if (!isset($this->namespaces[$schema->getTargetNamespace()])) {
159
                throw new Exception(sprintf("Can't find a PHP namespace to '%s' namespace", $schema->getTargetNamespace()));
160
            }
161
            $class->setNamespace($this->namespaces[$schema->getTargetNamespace()]);
162
163
            $this->classes[spl_object_hash($element)]["class"] = $class;
@@ 202-204 (lines=3) @@
199
200
        $name = $this->getNamingStrategy()->getTypeName($type);
201
202
        if (!isset($this->namespaces[$schema->getTargetNamespace()])) {
203
            throw new Exception(sprintf("Can't find a PHP namespace to '%s' namespace", $schema->getTargetNamespace()));
204
        }
205
        $ns = $this->namespaces[$schema->getTargetNamespace()];
206
        return [
207
            $name,