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

@@ 135-142 (lines=8) @@
132
        return "https://{$token}:[email protected]/{$projectAndOrg}.git";
133
    }
134
135
    protected function projectAndOrgFromUrl($remote)
136
    {
137
        $remote = preg_replace('#^git@[^:]*:#', '', $remote);
138
        $remote = preg_replace('#^[^:]*://[^/]*/#', '', $remote);
139
        $remote = preg_replace('#\.git$#', '', $remote);
140
141
        return $remote;
142
    }
143
144
    protected function existingPRs($projectWithOrg, VersionIdentifiers $vids)
145
    {