Conditions | 3 |
Paths | 2 |
Total Lines | 24 |
Lines | 7 |
Ratio | 29.17 % |
Changes | 0 |
1 | <?php |
||
35 | public function handle(): void |
||
36 | { |
||
37 | $productName = $this->argument('product'); |
||
38 | $productSource = $this->argument('source'); |
||
39 | $skipConfirmation = $this->option('y'); |
||
40 | $confirmationMessage = sprintf( |
||
41 | "This command will attempt to pull documentation for product (%s) from %s}. \n" |
||
42 | . 'Please ensure your internet connection is stable. Ready?', |
||
43 | $productName, |
||
44 | $productSource |
||
45 | ); |
||
46 | |||
47 | $this->comment(PHP_EOL |
||
48 | . "<info>♣♣♣</info> Docweaver DocumentationPublisher \n" |
||
49 | . 'Help is here, try: php artisan docweaver:publish --help'); |
||
50 | |||
51 | View Code Duplication | if ($skipConfirmation || $this->confirm($confirmationMessage)) { |
|
|
|||
52 | $this->info("Publishing {$productName}.\nT: " . Carbon::now()->toCookieString() . '----------'); |
||
53 | |||
54 | $result = $this->publisher->publish($productName, $productSource, $this); |
||
55 | |||
56 | $this->displayResult($result); |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.