Code Duplication    Length = 8-8 lines in 2 locations

src/Cli/HubphCommands.php 1 location

@@ 196-203 (lines=8) @@
193
        return $this->getProjectWithOrfFromUrl($remote);
194
    }
195
196
    protected function getProjectWithOrfFromUrl($remote)
197
    {
198
        $remote = preg_replace('#^git@[^:]*:#', '', $remote);
199
        $remote = preg_replace('#^[^:]*://[^/]/#', '', $remote);
200
        $remote = preg_replace('#\.git$#', '', $remote);
201
202
        return $remote;
203
    }
204
205
    protected function getRemote($remote = 'origin', $cwd = '')
206
    {

src/HubphAPI.php 1 location

@@ 165-172 (lines=8) @@
162
        return "https://{$token}:[email protected]/{$projectAndOrg}.git";
163
    }
164
165
    protected function projectAndOrgFromUrl($remote)
166
    {
167
        $remote = preg_replace('#^git@[^:]*:#', '', $remote);
168
        $remote = preg_replace('#^[^:]*://[^/]*/#', '', $remote);
169
        $remote = preg_replace('#\.git$#', '', $remote);
170
171
        return $remote;
172
    }
173
174
    protected function existingPRs($projectWithOrg, VersionIdentifiers $vids)
175
    {