Code Duplication    Length = 19-19 lines in 2 locations

src/Commands/App/Renamer.php 2 locations

@@ 93-111 (lines=19) @@
90
    {
91
        $this->task(
92
            'Updating config/app.php "name" property',
93
            function () use ($name) {
94
                $neededLine = "'name' => '".Str::ucfirst($this->getCurrentBinaryName())."'";
95
96
                if (Str::contains($contents = $this->getConfig(), $neededLine)) {
97
                    File::put(
98
                        config_path('app.php'),
99
                        Str::replaceFirst(
100
                            $neededLine,
101
                            "'name' => '".Str::ucfirst($name)."'",
102
                            $contents
103
                        )
104
                    );
105
106
                    return true;
107
                }
108
109
                return false;
110
            }
111
        );
112
113
        $this->task(
114
            'Updating composer "bin"',
@@ 115-133 (lines=19) @@
112
113
        $this->task(
114
            'Updating composer "bin"',
115
            function () use ($name) {
116
                $neededLine = '"bin": ["'.$this->getCurrentBinaryName().'"]';
117
118
                if (Str::contains($contents = $this->getComposer(), $neededLine)) {
119
                    File::put(
120
                        base_path('composer.json'),
121
                        Str::replaceFirst(
122
                            $neededLine,
123
                            '"bin": ["'.$name.'"]',
124
                            $contents
125
                        )
126
                    );
127
128
                    return true;
129
                }
130
131
                return false;
132
            }
133
        );
134
135
        return $this;
136
    }