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