RebuildDocumentation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 14 2
1
<?php
2
3
namespace Mpociot\ApiDoc\Commands;
4
5
use Illuminate\Console\Command;
6
use Mpociot\ApiDoc\Tools\DocumentationConfig;
7
use Mpociot\ApiDoc\Writing\Writer;
8
9
class RebuildDocumentation extends Command
10
{
11
    protected $signature = 'apidoc:rebuild';
12
13
    protected $description = 'Rebuild your API documentation from your markdown file.';
14
15
    public function handle()
16
    {
17
        $sourceOutputPath = 'resources/docs/source';
18
        if (! is_dir($sourceOutputPath)) {
19
            $this->error('There is no existing documentation available at ' . $sourceOutputPath . '.');
20
21
            return false;
22
        }
23
24
        $this->info('Rebuilding API documentation from ' . $sourceOutputPath . '/index.md');
25
26
        $writer = new Writer($this, new DocumentationConfig(config('apidoc')));
27
        $writer->writeHtmlDocs();
28
    }
29
}
30