Code Duplication    Length = 3-3 lines in 2 locations

lib/Jms/PathGenerator/Psr4PathGenerator.php 1 location

@@ 19-21 (lines=3) @@
16
            $pos = strpos($ns, $namespace);
17
18
            if ($pos === 0) {
19
                if (!is_dir($dir) && !mkdir($dir, 0777, true)) {
20
                    throw new PathGeneratorException("Can't create the folder '$dir'");
21
                }
22
                $f = strtr(substr($ns, strlen($namespace)), "\\/", "..");
23
                return $dir . "/" . $f . ".yml";
24
            }

lib/Php/PathGenerator/Psr4PathGenerator.php 1 location

@@ 17-19 (lines=3) @@
14
            if (strpos(trim($php->getNamespace()) . "\\", $namespace) === 0) {
15
                $d = strtr(substr($php->getNamespace(), strlen($namespace)), "\\", "/");
16
                $dir = rtrim($dir, "/") . "/" . $d;
17
                if (!is_dir($dir) && !mkdir($dir, 0777, true)) {
18
                    throw new PathGeneratorException("Can't create the '$dir' directory");
19
                }
20
21
                return rtrim($dir, "/") . "/" . $php->getName() . ".php";
22
            }