1 | <?php |
||
15 | class Redis |
||
16 | { |
||
17 | use LoopAwareTrait; |
||
18 | use Command\Compose\ApiChannelTrait; |
||
19 | use Command\Compose\ApiClusterTrait; |
||
20 | use Command\Compose\ApiConnTrait; |
||
21 | use Command\Compose\ApiCoreTrait; |
||
22 | use Command\Compose\ApiGeospatialTrait; |
||
23 | use Command\Compose\ApiHyperLogTrait; |
||
24 | use Command\Compose\ApiKeyValTrait; |
||
25 | use Command\Compose\ApiListTrait; |
||
26 | use Command\Compose\ApiSetTrait; |
||
27 | use Command\Compose\ApiSetHashTrait; |
||
28 | use Command\Compose\ApiSetSortedTrait; |
||
29 | use Command\Compose\ApiTransactionTrait; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $endpoint; |
||
35 | |||
36 | /** |
||
37 | * @param string $endpoint |
||
38 | * @param LoopInterface $loop |
||
39 | */ |
||
40 | public function __construct($endpoint, LoopInterface $loop) |
||
47 | |||
48 | /** |
||
49 | * |
||
50 | */ |
||
51 | public function __destruct() |
||
55 | |||
56 | /** |
||
57 | * Pipe Redis request. |
||
58 | * |
||
59 | * @param Request $command |
||
60 | * @return PromiseInterface |
||
61 | */ |
||
62 | private function pipe(Request $command) |
||
83 | |||
84 | public function connect($config = []) |
||
88 | }; |
||
89 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.