Skip to content

Commit 2cd2d31

Browse files
committed
Optimizing PHP performance by using
fully-qualified function calls
1 parent ca38e4b commit 2cd2d31

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Registry/Registry.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Registry {
4040
*/
4141
public function set(string $name, callable $callback):Registry
4242
{
43-
if(array_key_exists($name, $this->callbacks)) {
43+
if(\array_key_exists($name, $this->callbacks)) {
4444
throw new Exception('Callback with the name "' . $name . '" already exists');
4545
}
4646

@@ -62,8 +62,8 @@ public function set(string $name, callable $callback):Registry
6262
*/
6363
public function get(string $name, $fresh = false)
6464
{
65-
if(!array_key_exists($name, $this->registry) || $fresh) {
66-
if(!array_key_exists($name, $this->callbacks)) {
65+
if(!\array_key_exists($name, $this->registry) || $fresh) {
66+
if(!\array_key_exists($name, $this->callbacks)) {
6767
throw new Exception('No callback named "' . $name . '" found when trying to create connection');
6868
}
6969

0 commit comments

Comments
 (0)