Hooks: remove some unnecessary code
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 27 May 2018 06:39:07 +0000 (23:39 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sun, 27 May 2018 06:39:07 +0000 (23:39 -0700)
PHP automatically creates the array when you try to append an item to
it. Really.

Change-Id: I73b1efe749a9311feeb0d14e1c76b5bbbc0265bd

includes/Hooks.php

index 3a33c2d..d434120 100644 (file)
@@ -47,10 +47,6 @@ class Hooks {
         * @since 1.18
         */
        public static function register( $name, $callback ) {
-               if ( !isset( self::$handlers[$name] ) ) {
-                       self::$handlers[$name] = [];
-               }
-
                self::$handlers[$name][] = $callback;
        }