Code Duplication    Length = 17-18 lines in 3 locations

src/Command/SearchArtistCommand.php 1 location

@@ 44-60 (lines=17) @@
41
     *
42
     * @return void
43
     */
44
    protected function execute(InputInterface $input, OutputInterface $output)
45
    {
46
        $service = ($input->getArgument('service') != '') ? $input->getArgument('service') : null;
47
48
        $searchResults = $this->musicInfo->doSearch($input->getArgument('artist'), 'artist', $service);
49
50
        $resultsTable = $this->generateTableForSearchResult($searchResults, [
51
            'id'    => 'ID',
52
            'name'  => 'Name',
53
            'image' => 'Image URL',
54
            'type'  => 'Type',
55
            'dataSource' => 'Source',
56
            'uri'   => 'URL'
57
        ], new Table($output));
58
59
        $resultsTable->render();
60
    }
61
62
    /**
63
     * Set Music info property

src/Command/SearchTrackCommand.php 1 location

@@ 38-55 (lines=18) @@
35
        parent::configure(); // TODO: Change the autogenerated stub
36
    }
37
38
    public function execute(InputInterface $input, OutputInterface $output)
39
    {
40
        $service = ($input->getArgument('service') != '') ? $input->getArgument('service') : null;
41
42
        $searchResults = $this->musicInfo->doSearch($input->getArgument('track'), 'track', $service);
43
44
        $resultsTable = $this->generateTableForSearchResult($searchResults, [
45
            'id'    => 'ID',
46
            'name'  => 'Name',
47
            'image' => 'Image URL',
48
            'length'=> 'Duration',
49
            'type'  => 'Type',
50
            'dataSource' => 'Source',
51
            'uri'   => 'URL'
52
        ], new Table($output));
53
54
        $resultsTable->render();
55
    }
56
}

src/Command/SearchAlbumCommand.php 1 location

@@ 38-54 (lines=17) @@
35
        parent::configure();
36
    }
37
38
    protected function execute(InputInterface $input, OutputInterface $output)
39
    {
40
        $service = ($input->getArgument('service') != '') ? $input->getArgument('service') : null;
41
42
        $searchResult = $this->musicInfo->doSearch($input->getArgument('album'), 'album', $service);
43
44
        $resultsTable = $this->generateTableForSearchResult($searchResult, [
45
            'id' => 'ID',
46
            'name' => 'Name',
47
            'type' => 'Type',
48
            'image' => 'Image',
49
            'dataSource' => 'Source'
50
        ], new Table($output));
51
52
        $resultsTable->render();
53
54
    }
55
}