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
@@ 457-472 (lines=16) @@
454
     * @default-string-field description
455
     * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields
456
     */
457
    public function prStatuses($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'yaml'])
458
    {
459
        if (empty($number) && preg_match('#^[0-9]*$#', $projectWithOrg)) {
460
            $number = $projectWithOrg;
461
            $projectWithOrg = '';
462
        }
463
        $api = $this->api($options['as']);
464
        $projectWithOrg = $this->projectWithOrg($projectWithOrg);
465
466
        $pullRequestStatus = $api->prStatuses($projectWithOrg, $number);
467
468
        $result = new RowsOfFields($pullRequestStatus);
469
        $this->addTableRenderFunction($result);
470
471
        return $result;
472
    }
473
474
    /**
475
     * @command pr:list