Code Duplication    Length = 11-13 lines in 2 locations

src/Writer/JMSWriter.php 1 location

@@ 25-35 (lines=11) @@
22
        $this->logger = $logger ?: new NullLogger();
23
    }
24
25
    public function write(array $items)
26
    {
27
        $dumper = new Dumper();
28
        foreach ($items as $item) {
29
            $source = $dumper->dump($item, 10000);
30
            $path = $this->pathGenerator->getPath($item);
31
            file_put_contents($path, $source);
32
            $this->logger->debug(sprintf("Written JMS metadata file %s", $path));
33
        }
34
        $this->logger->info(sprintf("Written %s JMS metadata files ", count($items)));
35
    }
36
}
37

src/Writer/PHPClassWriter.php 1 location

@@ 23-35 (lines=13) @@
20
        $this->logger = $logger ?: new NullLogger();
21
    }
22
23
    public function write(array $items)
24
    {
25
        foreach ($items as $item) {
26
            $path = $this->pathGenerator->getPath($item);
27
28
            $fileGen = new FileGenerator();
29
            $fileGen->setFilename($path);
30
            $fileGen->setClass($item);
31
            $fileGen->write();
32
            $this->logger->debug(sprintf("Written PHP class file %s", $path));
33
        }
34
        $this->logger->info(sprintf("Written %s STUB classes", count($items)));
35
    }
36
}
37