Code Duplication    Length = 12-16 lines in 2 locations

src/Cli/HubphCommands.php 2 locations

@@ 42-53 (lines=12) @@
39
    /**
40
     * @command pr:close
41
     */
42
    public function prClose($projectWithOrg = '', $number = '', $options = ['as' => 'default'])
43
    {
44
        if (empty($number) && preg_match('#^[0-9]*$#', $projectWithOrg)) {
45
            $number = $projectWithOrg;
46
            $projectWithOrg = '';
47
        }
48
        $projectWithOrg = $this->projectWithOrg($projectWithOrg);
49
        list($org, $project) = explode('/', $projectWithOrg, 2);
50
51
        $api = $this->api($options['as']);
52
        $api->prClose($org, $project, $number);
53
    }
54
55
    /*
56
     * hubph pr:check --vid=php-7.0./31 --vid=php-7.1./20
@@ 403-418 (lines=16) @@
400
     * @default-string-field description
401
     * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields
402
     */
403
    public function prStatuses($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'yaml'])
404
    {
405
        if (empty($number) && preg_match('#^[0-9]*$#', $projectWithOrg)) {
406
            $number = $projectWithOrg;
407
            $projectWithOrg = '';
408
        }
409
        $api = $this->api($options['as']);
410
        $projectWithOrg = $this->projectWithOrg($projectWithOrg);
411
412
        $pullRequestStatus = $api->prStatuses($projectWithOrg, $number);
413
414
        $result = new RowsOfFields($pullRequestStatus);
415
        $this->addTableRenderFunction($result);
416
417
        return $result;
418
    }
419
420
    /**
421
     * @command pr:list