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 |
||
17 | 18 | public function new() |
|
18 | { |
||
19 | 18 | $userDocsetsDirectory = app_path() . '/../../../../app/Docsets'; |
|
20 | |||
21 | /** |
||
22 | * Dirty shit to be able to run tests on this repo |
||
23 | */ |
||
24 | 18 | if (! Str::contains($userDocsetsDirectory, '/vendor/godbout/dash-docset-builder/')) { |
|
25 | 18 | $userDocsetsDirectory = Str::replaceFirst('/../../../../app', '', $userDocsetsDirectory); |
|
26 | } |
||
27 | |||
28 | 18 | File::makeDirectory($userDocsetsDirectory, 0755, true, true); |
|
29 | |||
30 | 18 | if (! $this->docsetName) { |
|
31 | 12 | File::copy( |
|
32 | 12 | app_path() . '/Services/stubs/RickAstley.stub', |
|
33 | 12 | $userDocsetsDirectory . '/RickAstley.php' |
|
34 | ); |
||
35 | |||
36 | 12 | return true; |
|
37 | } |
||
38 | |||
39 | 12 | File::put( |
|
40 | 12 | $userDocsetsDirectory . '/' . Str::studly($this->docsetName) . '.php', |
|
41 | 12 | '<?php' |
|
42 | ); |
||
43 | |||
44 | 12 | return true; |
|
45 | } |
||
47 |