Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace jlourenco\support\Commands; |
||
40 | public function fire() |
||
41 | { |
||
42 | if (!$this->confirm('Running this command will deleted the sentinel users table and add some default data to the jlourenco tables. Are you sure? ')) |
||
43 | { |
||
44 | $this->info('Command was aborted by the user.'); |
||
45 | return; |
||
46 | } |
||
47 | |||
48 | Schema::dropIfExists('users'); |
||
49 | $this->addData(); |
||
|
|||
50 | |||
51 | $this->info('Command ran successfully'); |
||
52 | } |
||
53 | |||
60 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: