Conditions | 4 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | 2 | public function fire() |
|
27 | { |
||
28 | 2 | $path = base_path('.env'); |
|
29 | $message = 'You need to run `php artisan deploy:init` first.'; |
||
30 | 2 | if (file_exists($path)) { |
|
31 | // get the contents of the .env file |
||
32 | 1 | $env_content = file_get_contents($path); |
|
|
|||
33 | |||
34 | // get the values of the two keys, and inform the user of the necessary information |
||
35 | 1 | if (preg_match('/AUTODEPLOY_SECRET=(\S+)/', $env_content, $secret) && |
|
36 | 1 | preg_match('/AUTODEPLOY_ROUTE=(\S+)/', $env_content, $route)) { |
|
37 | $url = parse_url(config('app.url'), PHP_URL_HOST); |
||
38 | 1 | $message = "Here is the information you'll need to set up your webhook:\n\n". |
|
39 | 1 | "Payload URL: <comment>https://$url/{$route[1]}</comment>\n". |
|
40 | "Secret: <comment>{$secret[1]}</comment>\n\n". |
||
41 | 1 | "You can display this information again by running `php artisan deploy:info`\n"; |
|
42 | } |
||
43 | 1 | } |
|
44 | 1 | $this->info($message); |
|
45 | 1 | } |
|
46 | } |
||
47 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.