| 1 | <?php namespace jlourenco\support\Commands; |
||
| 11 | class MigrateCommand extends Command { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * The console command name. |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $name = 'jlourenco:migrate'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * The console command description. |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $description = 'Command to setup all the migrations for the jlourenco packages'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Create a new command instance. |
||
| 29 | */ |
||
| 30 | public function __construct() |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Execute the console command. |
||
| 37 | * |
||
| 38 | * @return mixed |
||
| 39 | */ |
||
| 40 | public function fire() |
||
| 53 | |||
| 54 | private function addData() |
||
| 58 | |||
| 59 | } |
||
| 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: