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
@@ 497-512 (lines=16) @@
494
     * @default-string-field description
495
     * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields
496
     */
497
    public function prStatuses($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'yaml'])
498
    {
499
        if (empty($number) && preg_match('#^[0-9]*$#', $projectWithOrg)) {
500
            $number = $projectWithOrg;
501
            $projectWithOrg = '';
502
        }
503
        $api = $this->api($options['as']);
504
        $projectWithOrg = $this->projectWithOrg($projectWithOrg);
505
506
        $pullRequestStatus = $api->prStatuses($projectWithOrg, $number);
507
508
        $result = new RowsOfFields($pullRequestStatus);
509
        $this->addTableRenderFunction($result);
510
511
        return $result;
512
    }
513
514
    /**
515
     * @command pr:list