Code Duplication    Length = 3-3 lines in 2 locations

src/Command/CommandNewPage.php 1 location

@@ 70-72 (lines=3) @@
67
68
            // create new file
69
            $title = $this->name;
70
            if (false !== strrchr($this->name, '/')) {
71
                $title = substr(strrchr($this->name, '/'), 1);
72
            }
73
            $date = date('Y-m-d');
74
            $fileContent = str_replace(['%title%', '%date%'], [$title, $date], $this->findModel($this->name));
75
            $this->fs->dumpFile($filePath, $fileContent);

src/Command/NewPage.php 1 location

@@ 58-60 (lines=3) @@
55
56
            // create new file
57
            $title = $this->name;
58
            if (false !== strrchr($this->name, '/')) {
59
                $title = substr(strrchr($this->name, '/'), 1);
60
            }
61
            $date = date('Y-m-d');
62
            $fileContent = str_replace(['%title%', '%date%'], [$title, $date], $this->findModel($this->name));
63
            $this->fs->dumpFile($filePath, $fileContent);