Conditions | 3 |
Paths | 4 |
Total Lines | 28 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
22 | 18 | public function new() |
|
23 | { |
||
24 | 18 | $userDocsetsDirectory = app_path() . '/../../../../app/Docsets'; |
|
25 | |||
26 | /** |
||
27 | * Dirty shit to be able to run tests on this repo |
||
28 | */ |
||
29 | 18 | if (! Str::contains($userDocsetsDirectory, '/vendor/godbout/dash-docset-builder/')) { |
|
30 | 18 | $userDocsetsDirectory = Str::replaceFirst('/../../../../app', '', $userDocsetsDirectory); |
|
31 | } |
||
32 | |||
33 | 18 | File::makeDirectory($userDocsetsDirectory, 0755, true, true); |
|
34 | |||
35 | 18 | if (! $this->docsetName) { |
|
36 | 12 | File::copy( |
|
37 | 12 | app_path() . '/Services/stubs/RickAstley.stub', |
|
38 | 12 | $userDocsetsDirectory . '/RickAstley.php' |
|
39 | ); |
||
40 | |||
41 | 12 | return true; |
|
42 | } |
||
43 | |||
44 | 12 | File::put( |
|
45 | 12 | $userDocsetsDirectory . '/' . Str::studly($this->docsetName) . '.php', |
|
46 | 12 | '<?php' |
|
47 | ); |
||
48 | |||
49 | 12 | return true; |
|
50 | } |
||
52 |