Code Duplication    Length = 3-3 lines in 3 locations

lib/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

lib/Php/PhpConverter.php 2 locations

@@ 150-152 (lines=3) @@
147
            $class->setName($this->getNamingStrategy()->getItemName($element));
148
            $class->setDoc($element->getDoc());
149
150
            if (!isset($this->namespaces[$schema->getTargetNamespace()])) {
151
                throw new Exception(sprintf("Can't find a PHP namespace to '%s' namespace", $schema->getTargetNamespace()));
152
            }
153
            $class->setNamespace($this->namespaces[$schema->getTargetNamespace()]);
154
155
            $this->classes[spl_object_hash($element)]["class"] = $class;
@@ 187-189 (lines=3) @@
184
185
        $name = $this->getNamingStrategy()->getTypeName($type);
186
187
        if (!isset($this->namespaces[$schema->getTargetNamespace()])) {
188
            throw new Exception(sprintf("Can't find a PHP namespace to '%s' namespace", $schema->getTargetNamespace()));
189
        }
190
        $ns = $this->namespaces[$schema->getTargetNamespace()];
191
        return [
192
            $name,