@@ -22,35 +22,35 @@ |
||
22 | 22 | */ |
23 | 23 | trait EventManagerDispatcherTrait |
24 | 24 | { |
25 | - /** |
|
26 | - * @var EventManagerInterface |
|
27 | - */ |
|
28 | - protected $eventManager; |
|
25 | + /** |
|
26 | + * @var EventManagerInterface |
|
27 | + */ |
|
28 | + protected $eventManager; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return EventManagerInterface |
|
32 | - */ |
|
33 | - public function getEventManager(): EventManagerInterface |
|
34 | - { |
|
35 | - return $this->eventManager; |
|
36 | - } |
|
30 | + /** |
|
31 | + * @return EventManagerInterface |
|
32 | + */ |
|
33 | + public function getEventManager(): EventManagerInterface |
|
34 | + { |
|
35 | + return $this->eventManager; |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param EventManagerInterface $em |
|
40 | - * @return EventManagerDispatcherInterface |
|
41 | - */ |
|
42 | - public function setEventManager(EventManagerInterface $em): EventManagerDispatcherInterface |
|
43 | - { |
|
44 | - $this->eventManager = $em; |
|
38 | + /** |
|
39 | + * @param EventManagerInterface $em |
|
40 | + * @return EventManagerDispatcherInterface |
|
41 | + */ |
|
42 | + public function setEventManager(EventManagerInterface $em): EventManagerDispatcherInterface |
|
43 | + { |
|
44 | + $this->eventManager = $em; |
|
45 | 45 | |
46 | - return $this; |
|
47 | - } |
|
46 | + return $this; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @return bool |
|
51 | - */ |
|
52 | - public function hasEventManager(): bool |
|
53 | - { |
|
54 | - return isset($this->eventManager); |
|
55 | - } |
|
49 | + /** |
|
50 | + * @return bool |
|
51 | + */ |
|
52 | + public function hasEventManager(): bool |
|
53 | + { |
|
54 | + return isset($this->eventManager); |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | \ No newline at end of file |
@@ -25,35 +25,35 @@ |
||
25 | 25 | */ |
26 | 26 | interface EventManagerInterface |
27 | 27 | { |
28 | - /** |
|
29 | - * @return self |
|
30 | - */ |
|
31 | - public static function getInstance(): self; |
|
32 | - |
|
33 | - /** |
|
34 | - * @param string $eventName |
|
35 | - * @param array ...$args |
|
36 | - */ |
|
37 | - public function dispatch(string $eventName, ...$args): void; |
|
38 | - |
|
39 | - /** |
|
40 | - * @param string $name |
|
41 | - * @param array $arguments |
|
42 | - * @throws PhpfastcacheInvalidArgumentException |
|
43 | - * @throws BadMethodCallException |
|
44 | - */ |
|
45 | - public function __call(string $name, array $arguments): void; |
|
46 | - |
|
47 | - /** |
|
48 | - * @param callable $callback |
|
49 | - * @param string $callbackName |
|
50 | - */ |
|
51 | - public function onEveryEvents(callable $callback, string $callbackName): void; |
|
52 | - |
|
53 | - /** |
|
54 | - * @param string $eventName |
|
55 | - * @param string $callbackName |
|
56 | - * @return bool |
|
57 | - */ |
|
58 | - public function unbindEventCallback(string $eventName, string $callbackName): bool; |
|
28 | + /** |
|
29 | + * @return self |
|
30 | + */ |
|
31 | + public static function getInstance(): self; |
|
32 | + |
|
33 | + /** |
|
34 | + * @param string $eventName |
|
35 | + * @param array ...$args |
|
36 | + */ |
|
37 | + public function dispatch(string $eventName, ...$args): void; |
|
38 | + |
|
39 | + /** |
|
40 | + * @param string $name |
|
41 | + * @param array $arguments |
|
42 | + * @throws PhpfastcacheInvalidArgumentException |
|
43 | + * @throws BadMethodCallException |
|
44 | + */ |
|
45 | + public function __call(string $name, array $arguments): void; |
|
46 | + |
|
47 | + /** |
|
48 | + * @param callable $callback |
|
49 | + * @param string $callbackName |
|
50 | + */ |
|
51 | + public function onEveryEvents(callable $callback, string $callbackName): void; |
|
52 | + |
|
53 | + /** |
|
54 | + * @param string $eventName |
|
55 | + * @param string $callbackName |
|
56 | + * @return bool |
|
57 | + */ |
|
58 | + public function unbindEventCallback(string $eventName, string $callbackName): bool; |
|
59 | 59 | } |
60 | 60 | \ No newline at end of file |
@@ -22,19 +22,19 @@ |
||
22 | 22 | */ |
23 | 23 | interface EventManagerDispatcherInterface |
24 | 24 | { |
25 | - /** |
|
26 | - * @return EventManagerInterface |
|
27 | - */ |
|
28 | - public function getEventManager(): EventManagerInterface; |
|
25 | + /** |
|
26 | + * @return EventManagerInterface |
|
27 | + */ |
|
28 | + public function getEventManager(): EventManagerInterface; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @param EventManagerInterface $eventManager |
|
32 | - * @return mixed |
|
33 | - */ |
|
34 | - public function setEventManager(EventManagerInterface $eventManager): self; |
|
30 | + /** |
|
31 | + * @param EventManagerInterface $eventManager |
|
32 | + * @return mixed |
|
33 | + */ |
|
34 | + public function setEventManager(EventManagerInterface $eventManager): self; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return bool |
|
38 | - */ |
|
39 | - public function hasEventManager(): bool; |
|
36 | + /** |
|
37 | + * @return bool |
|
38 | + */ |
|
39 | + public function hasEventManager(): bool; |
|
40 | 40 | } |
41 | 41 | \ No newline at end of file |
@@ -56,40 +56,40 @@ |
||
56 | 56 | */ |
57 | 57 | abstract class PhpfastcacheAbstractProxy |
58 | 58 | { |
59 | - /** |
|
60 | - * @var ExtendedCacheItemPoolInterface |
|
61 | - */ |
|
62 | - protected $instance; |
|
59 | + /** |
|
60 | + * @var ExtendedCacheItemPoolInterface |
|
61 | + */ |
|
62 | + protected $instance; |
|
63 | 63 | |
64 | - /** |
|
65 | - * PhpfastcacheAbstractProxy constructor. |
|
66 | - * @param string $driver |
|
67 | - * @param null $config |
|
68 | - * @throws \Phpfastcache\Exceptions\PhpfastcacheDriverCheckException |
|
69 | - * @throws \Phpfastcache\Exceptions\PhpfastcacheDriverException |
|
70 | - * @throws \Phpfastcache\Exceptions\PhpfastcacheDriverNotFoundException |
|
71 | - * @throws \Phpfastcache\Exceptions\PhpfastcacheInvalidArgumentException |
|
72 | - * @throws \Phpfastcache\Exceptions\PhpfastcacheInvalidConfigurationException |
|
73 | - * @throws \Phpfastcache\Exceptions\PhpfastcacheLogicException |
|
74 | - * @throws \ReflectionException |
|
75 | - */ |
|
76 | - public function __construct(string $driver, $config = null) |
|
77 | - { |
|
78 | - $this->instance = CacheManager::getInstance($driver, $config); |
|
79 | - } |
|
64 | + /** |
|
65 | + * PhpfastcacheAbstractProxy constructor. |
|
66 | + * @param string $driver |
|
67 | + * @param null $config |
|
68 | + * @throws \Phpfastcache\Exceptions\PhpfastcacheDriverCheckException |
|
69 | + * @throws \Phpfastcache\Exceptions\PhpfastcacheDriverException |
|
70 | + * @throws \Phpfastcache\Exceptions\PhpfastcacheDriverNotFoundException |
|
71 | + * @throws \Phpfastcache\Exceptions\PhpfastcacheInvalidArgumentException |
|
72 | + * @throws \Phpfastcache\Exceptions\PhpfastcacheInvalidConfigurationException |
|
73 | + * @throws \Phpfastcache\Exceptions\PhpfastcacheLogicException |
|
74 | + * @throws \ReflectionException |
|
75 | + */ |
|
76 | + public function __construct(string $driver, $config = null) |
|
77 | + { |
|
78 | + $this->instance = CacheManager::getInstance($driver, $config); |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * @param string $name |
|
83 | - * @param array $args |
|
84 | - * @return mixed |
|
85 | - * @throws BadMethodCallException |
|
86 | - */ |
|
87 | - public function __call(string $name, array $args) |
|
88 | - { |
|
89 | - if (\method_exists($this->instance, $name)) { |
|
90 | - return $this->instance->$name(...$args); |
|
91 | - } |
|
81 | + /** |
|
82 | + * @param string $name |
|
83 | + * @param array $args |
|
84 | + * @return mixed |
|
85 | + * @throws BadMethodCallException |
|
86 | + */ |
|
87 | + public function __call(string $name, array $args) |
|
88 | + { |
|
89 | + if (\method_exists($this->instance, $name)) { |
|
90 | + return $this->instance->$name(...$args); |
|
91 | + } |
|
92 | 92 | |
93 | - throw new BadMethodCallException(\sprintf('Method %s does not exists', $name)); |
|
94 | - } |
|
93 | + throw new BadMethodCallException(\sprintf('Method %s does not exists', $name)); |
|
94 | + } |
|
95 | 95 | } |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | * @throws \Phpfastcache\Exceptions\PhpfastcacheLogicException |
74 | 74 | * @throws \ReflectionException |
75 | 75 | */ |
76 | - public function __construct(string $driver, $config = null) |
|
77 | - { |
|
76 | + public function __construct(string $driver, $config = null) { |
|
78 | 77 | $this->instance = CacheManager::getInstance($driver, $config); |
79 | 78 | } |
80 | 79 | |
@@ -84,8 +83,7 @@ discard block |
||
84 | 83 | * @return mixed |
85 | 84 | * @throws BadMethodCallException |
86 | 85 | */ |
87 | - public function __call(string $name, array $args) |
|
88 | - { |
|
86 | + public function __call(string $name, array $args) { |
|
89 | 87 | if (\method_exists($this->instance, $name)) { |
90 | 88 | return $this->instance->$name(...$args); |
91 | 89 | } |
@@ -23,17 +23,17 @@ |
||
23 | 23 | */ |
24 | 24 | class PhpfastcacheIOException extends PhpfastcacheCoreException |
25 | 25 | { |
26 | - /** |
|
27 | - * @inheritdoc |
|
28 | - */ |
|
29 | - public function __construct($message = "", $code = 0, $previous = null) |
|
30 | - { |
|
31 | - $lastError = error_get_last(); |
|
32 | - if ($lastError) { |
|
33 | - $message .= "\n"; |
|
34 | - $message .= "Additional information provided by error_get_last():\n"; |
|
35 | - $message .= "{$lastError['message']} in {$lastError['file']} line {$lastError['line']}"; |
|
36 | - } |
|
37 | - parent::__construct($message, $code, $previous); |
|
38 | - } |
|
26 | + /** |
|
27 | + * @inheritdoc |
|
28 | + */ |
|
29 | + public function __construct($message = "", $code = 0, $previous = null) |
|
30 | + { |
|
31 | + $lastError = error_get_last(); |
|
32 | + if ($lastError) { |
|
33 | + $message .= "\n"; |
|
34 | + $message .= "Additional information provided by error_get_last():\n"; |
|
35 | + $message .= "{$lastError['message']} in {$lastError['file']} line {$lastError['line']}"; |
|
36 | + } |
|
37 | + parent::__construct($message, $code, $previous); |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | \ No newline at end of file |
@@ -26,8 +26,7 @@ |
||
26 | 26 | /** |
27 | 27 | * @inheritdoc |
28 | 28 | */ |
29 | - public function __construct($message = "", $code = 0, $previous = null) |
|
30 | - { |
|
29 | + public function __construct($message = "", $code = 0, $previous = null) { |
|
31 | 30 | $lastError = error_get_last(); |
32 | 31 | if ($lastError) { |
33 | 32 | $message .= "\n"; |
@@ -23,14 +23,14 @@ |
||
23 | 23 | */ |
24 | 24 | class PhpfastcacheInvalidArgumentTypeException extends PhpfastcacheInvalidArgumentException |
25 | 25 | { |
26 | - /** |
|
27 | - * @link https://php.net/manual/en/exception.construct.php |
|
28 | - * @param string $expectedType |
|
29 | - * @param mixed $unexpectedData |
|
30 | - */ |
|
31 | - public function __construct($expectedType, $unexpectedData) |
|
32 | - { |
|
33 | - $type = gettype($unexpectedData); |
|
34 | - parent::__construct("Expecting '{$expectedType}', got '" . ($type === 'object' ? $type . '(' . get_class($type) . ')' : $type) . "'"); |
|
35 | - } |
|
26 | + /** |
|
27 | + * @link https://php.net/manual/en/exception.construct.php |
|
28 | + * @param string $expectedType |
|
29 | + * @param mixed $unexpectedData |
|
30 | + */ |
|
31 | + public function __construct($expectedType, $unexpectedData) |
|
32 | + { |
|
33 | + $type = gettype($unexpectedData); |
|
34 | + parent::__construct("Expecting '{$expectedType}', got '" . ($type === 'object' ? $type . '(' . get_class($type) . ')' : $type) . "'"); |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -28,8 +28,7 @@ |
||
28 | 28 | * @param string $expectedType |
29 | 29 | * @param mixed $unexpectedData |
30 | 30 | */ |
31 | - public function __construct($expectedType, $unexpectedData) |
|
32 | - { |
|
31 | + public function __construct($expectedType, $unexpectedData) { |
|
33 | 32 | $type = gettype($unexpectedData); |
34 | 33 | parent::__construct("Expecting '{$expectedType}', got '" . ($type === 'object' ? $type . '(' . get_class($type) . ')' : $type) . "'"); |
35 | 34 | } |
@@ -28,34 +28,34 @@ |
||
28 | 28 | */ |
29 | 29 | class Item implements ExtendedCacheItemInterface |
30 | 30 | { |
31 | - use ItemBaseTrait { |
|
32 | - ItemBaseTrait::__construct as __BaseConstruct; |
|
33 | - } |
|
34 | - |
|
35 | - /** |
|
36 | - * Item constructor. |
|
37 | - * @param Driver $driver |
|
38 | - * @param $key |
|
39 | - * @throws PhpfastcacheInvalidArgumentException |
|
40 | - */ |
|
41 | - public function __construct(CouchdbDriver $driver, $key) |
|
42 | - { |
|
43 | - $this->__BaseConstruct($driver, $key); |
|
44 | - } |
|
45 | - |
|
46 | - /** |
|
47 | - * @param ExtendedCacheItemPoolInterface $driver |
|
48 | - * @return static |
|
49 | - * @throws PhpfastcacheInvalidArgumentException |
|
50 | - */ |
|
51 | - public function setDriver(ExtendedCacheItemPoolInterface $driver) |
|
52 | - { |
|
53 | - if ($driver instanceof CouchdbDriver) { |
|
54 | - $this->driver = $driver; |
|
55 | - |
|
56 | - return $this; |
|
57 | - } |
|
58 | - |
|
59 | - throw new PhpfastcacheInvalidArgumentException('Invalid driver instance'); |
|
60 | - } |
|
31 | + use ItemBaseTrait { |
|
32 | + ItemBaseTrait::__construct as __BaseConstruct; |
|
33 | + } |
|
34 | + |
|
35 | + /** |
|
36 | + * Item constructor. |
|
37 | + * @param Driver $driver |
|
38 | + * @param $key |
|
39 | + * @throws PhpfastcacheInvalidArgumentException |
|
40 | + */ |
|
41 | + public function __construct(CouchdbDriver $driver, $key) |
|
42 | + { |
|
43 | + $this->__BaseConstruct($driver, $key); |
|
44 | + } |
|
45 | + |
|
46 | + /** |
|
47 | + * @param ExtendedCacheItemPoolInterface $driver |
|
48 | + * @return static |
|
49 | + * @throws PhpfastcacheInvalidArgumentException |
|
50 | + */ |
|
51 | + public function setDriver(ExtendedCacheItemPoolInterface $driver) |
|
52 | + { |
|
53 | + if ($driver instanceof CouchdbDriver) { |
|
54 | + $this->driver = $driver; |
|
55 | + |
|
56 | + return $this; |
|
57 | + } |
|
58 | + |
|
59 | + throw new PhpfastcacheInvalidArgumentException('Invalid driver instance'); |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | \ No newline at end of file |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | * @param $key |
39 | 39 | * @throws PhpfastcacheInvalidArgumentException |
40 | 40 | */ |
41 | - public function __construct(CouchdbDriver $driver, $key) |
|
42 | - { |
|
41 | + public function __construct(CouchdbDriver $driver, $key) { |
|
43 | 42 | $this->__BaseConstruct($driver, $key); |
44 | 43 | } |
45 | 44 | |
@@ -48,8 +47,7 @@ discard block |
||
48 | 47 | * @return static |
49 | 48 | * @throws PhpfastcacheInvalidArgumentException |
50 | 49 | */ |
51 | - public function setDriver(ExtendedCacheItemPoolInterface $driver) |
|
52 | - { |
|
50 | + public function setDriver(ExtendedCacheItemPoolInterface $driver) { |
|
53 | 51 | if ($driver instanceof CouchdbDriver) { |
54 | 52 | $this->driver = $driver; |
55 | 53 |
@@ -20,5 +20,5 @@ |
||
20 | 20 | |
21 | 21 | class Config extends ConfigurationOption |
22 | 22 | { |
23 | - use IOConfigurationOptionTrait; |
|
23 | + use IOConfigurationOptionTrait; |
|
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -27,34 +27,34 @@ |
||
27 | 27 | */ |
28 | 28 | class Item implements ExtendedCacheItemInterface |
29 | 29 | { |
30 | - use ItemBaseTrait { |
|
31 | - ItemBaseTrait::__construct as __BaseConstruct; |
|
32 | - } |
|
33 | - |
|
34 | - /** |
|
35 | - * Item constructor. |
|
36 | - * @param Driver $driver |
|
37 | - * @param $key |
|
38 | - * @throws PhpfastcacheInvalidArgumentException |
|
39 | - */ |
|
40 | - public function __construct(FilesDriver $driver, $key) |
|
41 | - { |
|
42 | - $this->__BaseConstruct($driver, $key); |
|
43 | - } |
|
44 | - |
|
45 | - /** |
|
46 | - * @param ExtendedCacheItemPoolInterface $driver |
|
47 | - * @return static |
|
48 | - * @throws PhpfastcacheInvalidArgumentException |
|
49 | - */ |
|
50 | - public function setDriver(ExtendedCacheItemPoolInterface $driver) |
|
51 | - { |
|
52 | - if ($driver instanceof FilesDriver) { |
|
53 | - $this->driver = $driver; |
|
54 | - |
|
55 | - return $this; |
|
56 | - } |
|
57 | - |
|
58 | - throw new PhpfastcacheInvalidArgumentException('Invalid driver instance'); |
|
59 | - } |
|
30 | + use ItemBaseTrait { |
|
31 | + ItemBaseTrait::__construct as __BaseConstruct; |
|
32 | + } |
|
33 | + |
|
34 | + /** |
|
35 | + * Item constructor. |
|
36 | + * @param Driver $driver |
|
37 | + * @param $key |
|
38 | + * @throws PhpfastcacheInvalidArgumentException |
|
39 | + */ |
|
40 | + public function __construct(FilesDriver $driver, $key) |
|
41 | + { |
|
42 | + $this->__BaseConstruct($driver, $key); |
|
43 | + } |
|
44 | + |
|
45 | + /** |
|
46 | + * @param ExtendedCacheItemPoolInterface $driver |
|
47 | + * @return static |
|
48 | + * @throws PhpfastcacheInvalidArgumentException |
|
49 | + */ |
|
50 | + public function setDriver(ExtendedCacheItemPoolInterface $driver) |
|
51 | + { |
|
52 | + if ($driver instanceof FilesDriver) { |
|
53 | + $this->driver = $driver; |
|
54 | + |
|
55 | + return $this; |
|
56 | + } |
|
57 | + |
|
58 | + throw new PhpfastcacheInvalidArgumentException('Invalid driver instance'); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | \ No newline at end of file |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | * @param $key |
38 | 38 | * @throws PhpfastcacheInvalidArgumentException |
39 | 39 | */ |
40 | - public function __construct(FilesDriver $driver, $key) |
|
41 | - { |
|
40 | + public function __construct(FilesDriver $driver, $key) { |
|
42 | 41 | $this->__BaseConstruct($driver, $key); |
43 | 42 | } |
44 | 43 | |
@@ -47,8 +46,7 @@ discard block |
||
47 | 46 | * @return static |
48 | 47 | * @throws PhpfastcacheInvalidArgumentException |
49 | 48 | */ |
50 | - public function setDriver(ExtendedCacheItemPoolInterface $driver) |
|
51 | - { |
|
49 | + public function setDriver(ExtendedCacheItemPoolInterface $driver) { |
|
52 | 50 | if ($driver instanceof FilesDriver) { |
53 | 51 | $this->driver = $driver; |
54 | 52 |