1 | <?php |
||
25 | class Connection extends Component implements ConnectionInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var AMQPStreamConnection |
||
29 | */ |
||
30 | public $connection; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | public $host = 'localhost'; |
||
35 | /** |
||
36 | * @var integer |
||
37 | */ |
||
38 | public $port = 5672; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | public $username = 'guest'; |
||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | public $password = ''; |
||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | public $vhost = '/'; |
||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | public $options = []; |
||
55 | /** |
||
56 | * @var AMQPChannel[] |
||
57 | */ |
||
58 | protected $channels = []; |
||
59 | |||
60 | /** |
||
61 | * @var AMQPStreamConnection |
||
62 | */ |
||
63 | protected $amqpConnection; |
||
64 | /** |
||
65 | * @inheritdoc |
||
66 | */ |
||
67 | public function init() |
||
73 | |||
74 | public function open() |
||
95 | |||
96 | public function close() |
||
100 | |||
101 | public function reconnect() |
||
105 | |||
106 | public function isConnected() |
||
110 | |||
111 | /** |
||
112 | * Returns low-level AMQP connection instance |
||
113 | * |
||
114 | * @return AMQPStreamConnection|AMQPSSLConnection |
||
115 | */ |
||
116 | public function getAmqpInstance() |
||
120 | |||
121 | |||
122 | private function _parseOptions() |
||
126 | } |
||
127 |
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: