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(
51
            $searchResults, [
52
            'id'    => 'ID',
53
            'name'  => 'Name',
54
            'image' => 'Image URL',
55
            'type'  => 'Type',
56
            'dataSource' => 'Source',
57
            'uri'   => 'URL'
58
            ], new Table($output)
59
        );
60
61
        $resultsTable->render();
62
    }
63

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(
45
            $searchResults, [
46
            'id'    => 'ID',
47
            'name'  => 'Name',
48
            'image' => 'Image URL',
49
            'length'=> 'Duration',
50
            'type'  => 'Type',
51
            'dataSource' => 'Source',
52
            'uri'   => 'URL'
53
            ], new Table($output)
54
        );
55
56
        $resultsTable->render();
57
    }
58
}

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(
45
            $searchResult, [
46
            'id' => 'ID',
47
            'name' => 'Name',
48
            'type' => 'Type',
49
            'image' => 'Image',
50
            'dataSource' => 'Source'
51
            ], new Table($output)
52
        );
53
54
        $resultsTable->render();
55
56
    }
57
}