Code Duplication    Length = 8-8 lines in 2 locations

src/Cli/HubphCommands.php 1 location

@@ 188-195 (lines=8) @@
185
        return $this->getProjectWithOrfFromUrl($remote);
186
    }
187
188
    protected function getProjectWithOrfFromUrl($remote)
189
    {
190
        $remote = preg_replace('#^git@[^:]*:#', '', $remote);
191
        $remote = preg_replace('#^[^:]*://[^/]/#', '', $remote);
192
        $remote = preg_replace('#\.git$#', '', $remote);
193
194
        return $remote;
195
    }
196
197
    protected function getRemote($remote = 'origin', $cwd = '')
198
    {

src/HubphAPI.php 1 location

@@ 79-86 (lines=8) @@
76
        return "https://{$token}:[email protected]/{$projectAndOrg}.git";
77
    }
78
79
    protected function projectAndOrgFromUrl($remote)
80
    {
81
        $remote = preg_replace('#^git@[^:]*:#', '', $remote);
82
        $remote = preg_replace('#^[^:]*://[^/]/#', '', $remote);
83
        $remote = preg_replace('#\.git$#', '', $remote);
84
85
        return $remote;
86
    }
87
88
    protected function existingPRs($gitHubAPI, $projectWithOrg, $vids)
89
    {