Code Duplication    Length = 10-10 lines in 2 locations

src/Hook.php 2 locations

@@ 260-269 (lines=10) @@
257
   * @param array &$data A data array for callback communication.
258
   */
259
  public static function runCallbacks($name, &$arguments = array(), $type = 'all', &$object = null, &$function = null, &$data = array()) {
260
    if (isset(Hook::$hooks['all'])) {
261
      foreach (Hook::$hooks['all'] as $curCallback) {
262
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
263
          call_user_func_array($curCallback[1], array(&$arguments, $name, &$object, &$function, &$data));
264
          if ($arguments === false) {
265
            return;
266
          }
267
        }
268
      }
269
    }
270
    if (isset(Hook::$hooks[$name])) {
271
      foreach (Hook::$hooks[$name] as $curCallback) {
272
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
@@ 270-279 (lines=10) @@
267
        }
268
      }
269
    }
270
    if (isset(Hook::$hooks[$name])) {
271
      foreach (Hook::$hooks[$name] as $curCallback) {
272
        if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[0] < 0) || ($type == 'after' && $curCallback[0] > 0)) {
273
          call_user_func_array($curCallback[1], array(&$arguments, $name, &$object, &$function, &$data));
274
          if ($arguments === false) {
275
            return;
276
          }
277
        }
278
      }
279
    }
280
  }
281
282
  /**