| 1 | <?php |
||
| 11 | final class ClientFactory |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var HttpClient |
||
| 15 | */ |
||
| 16 | private $client; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var HttpClient |
||
| 20 | */ |
||
| 21 | private $originalClient; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var Plugin[] |
||
| 25 | */ |
||
| 26 | private $plugins; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var bool |
||
| 30 | */ |
||
| 31 | private $clientChanged; |
||
| 32 | |||
| 33 | public function __construct(HttpClient $client = null) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Drop all registered plugins |
||
| 42 | */ |
||
| 43 | public function resetPlugins() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Adds a new httplug plugin |
||
| 51 | * |
||
| 52 | * @param Plugin $plugin |
||
| 53 | * @return ClientFactory |
||
| 54 | */ |
||
| 55 | public function addPlugin(Plugin $plugin) |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return HttpClient |
||
| 65 | */ |
||
| 66 | public function getClient() |
||
| 74 | } |
||
| 75 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.