diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /lib/private/Hooks | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Hooks')
-rw-r--r-- | lib/private/Hooks/EmitterTrait.php | 10 | ||||
-rw-r--r-- | lib/private/Hooks/ForwardingEmitter.php | 2 | ||||
-rw-r--r-- | lib/private/Hooks/LegacyEmitter.php | 2 | ||||
-rw-r--r-- | lib/private/Hooks/PublicEmitter.php | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/Hooks/EmitterTrait.php b/lib/private/Hooks/EmitterTrait.php index a3c7e2df5da..58b8242ec54 100644 --- a/lib/private/Hooks/EmitterTrait.php +++ b/lib/private/Hooks/EmitterTrait.php @@ -28,7 +28,7 @@ trait EmitterTrait { /** * @var callable[][] $listeners */ - protected $listeners = array(); + protected $listeners = []; /** * @param string $scope @@ -38,7 +38,7 @@ trait EmitterTrait { public function listen($scope, $method, callable $callback) { $eventName = $scope . '::' . $method; if (!isset($this->listeners[$eventName])) { - $this->listeners[$eventName] = array(); + $this->listeners[$eventName] = []; } if (array_search($callback, $this->listeners[$eventName], true) === false) { $this->listeners[$eventName][] = $callback; @@ -51,7 +51,7 @@ trait EmitterTrait { * @param callable $callback optional */ public function removeListener($scope = null, $method = null, callable $callback = null) { - $names = array(); + $names = []; $allNames = array_keys($this->listeners); if ($scope and $method) { $name = $scope . '::' . $method; @@ -83,7 +83,7 @@ trait EmitterTrait { unset($this->listeners[$name][$index]); } } else { - $this->listeners[$name] = array(); + $this->listeners[$name] = []; } } } @@ -93,7 +93,7 @@ trait EmitterTrait { * @param string $method * @param array $arguments optional */ - protected function emit($scope, $method, array $arguments = array()) { + protected function emit($scope, $method, array $arguments = []) { $eventName = $scope . '::' . $method; if (isset($this->listeners[$eventName])) { foreach ($this->listeners[$eventName] as $callback) { diff --git a/lib/private/Hooks/ForwardingEmitter.php b/lib/private/Hooks/ForwardingEmitter.php index d7dc6bfe9b5..431c0333c72 100644 --- a/lib/private/Hooks/ForwardingEmitter.php +++ b/lib/private/Hooks/ForwardingEmitter.php @@ -34,7 +34,7 @@ abstract class ForwardingEmitter extends BasicEmitter { /** * @var \OC\Hooks\Emitter[] array */ - private $forwardEmitters = array(); + private $forwardEmitters = []; /** * @param string $scope diff --git a/lib/private/Hooks/LegacyEmitter.php b/lib/private/Hooks/LegacyEmitter.php index 9d4051e5899..84f8b7b413e 100644 --- a/lib/private/Hooks/LegacyEmitter.php +++ b/lib/private/Hooks/LegacyEmitter.php @@ -32,7 +32,7 @@ abstract class LegacyEmitter extends BasicEmitter { * * @suppress PhanAccessMethodProtected */ - protected function emit($scope, $method, array $arguments = array()) { + protected function emit($scope, $method, array $arguments = []) { \OC_Hook::emit($scope, $method, $arguments); parent::emit($scope, $method, $arguments); } diff --git a/lib/private/Hooks/PublicEmitter.php b/lib/private/Hooks/PublicEmitter.php index 88c3d7ff327..dbccc34f2e9 100644 --- a/lib/private/Hooks/PublicEmitter.php +++ b/lib/private/Hooks/PublicEmitter.php @@ -36,7 +36,7 @@ class PublicEmitter extends BasicEmitter { * * @suppress PhanAccessMethodProtected */ - public function emit($scope, $method, array $arguments = array()) { + public function emit($scope, $method, array $arguments = []) { parent::emit($scope, $method, $arguments); } } |