deployphp /
deployer
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Deployer; |
||||
| 4 | |||||
| 5 | localhost('prod'); |
||||
| 6 | localhost('beta') |
||||
| 7 | ->set('host_level_callback_config', function () { |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 8 | return 'from callback'; |
||||
| 9 | }); |
||||
| 10 | |||||
| 11 | // testServer: |
||||
| 12 | |||||
| 13 | task('ask', function () { |
||||
| 14 | $answer = ask('Question: What kind of bear is best?'); |
||||
| 15 | writeln($answer); |
||||
|
0 ignored issues
–
show
It seems like
$answer can also be of type null; however, parameter $message of Deployer\writeln() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 16 | }); |
||||
| 17 | |||||
| 18 | // testWorker, testOption: |
||||
| 19 | |||||
| 20 | set('greet', '_'); |
||||
| 21 | |||||
| 22 | task('echo', function () { |
||||
| 23 | $alias = currentHost()->getAlias(); |
||||
| 24 | run("echo {{greet}}, $alias!"); |
||||
| 25 | }); |
||||
| 26 | |||||
| 27 | // testCachedHostConfig: |
||||
| 28 | |||||
| 29 | set('upper_host', function () { |
||||
| 30 | writeln('running ' . (Deployer::isWorker() ? 'worker' : 'master') . ' on ' . currentHost()->getAlias()); |
||||
| 31 | return strtoupper(currentHost()->getAlias()); |
||||
|
0 ignored issues
–
show
It seems like
currentHost()->getAlias() can also be of type null; however, parameter $string of strtoupper() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 32 | }); |
||||
| 33 | |||||
| 34 | task('cache_config_test', function () { |
||||
| 35 | writeln('echo 1: {{upper_host}}'); |
||||
| 36 | }); |
||||
| 37 | |||||
| 38 | after('cache_config_test', function () { |
||||
| 39 | writeln('echo 2: {{upper_host}}'); |
||||
| 40 | }); |
||||
| 41 | |||||
| 42 | // testHostConfigFromCallback: |
||||
| 43 | |||||
| 44 | set('host_level_callback_config', 'from global'); |
||||
| 45 | |||||
| 46 | task('host_config_from_callback', function () { |
||||
| 47 | writeln('config value is {{host_level_callback_config}}'); |
||||
| 48 | }); |
||||
| 49 |