Reduces the number of events to the defined minimum and maximum range

@return void
15223
protected function reduceEventsToMinMaxRange()
    {
        $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array();

        if (!empty($events)) {
            foreach ($events as $key => $anEvent) {
                if ($this->doesEventStartOutsideWindow($anEvent)) {
                    $this->eventCount--;

                    unset($events[$key]);

                    continue;
                }
            }

            $this->cal['VEVENT'] = $events;
        }
    }
298911
public function reset() : void
    {
        $this->buffer = [];
        $this->bufferSize = 0;
        $this->affectedRows = 0;
        $this->totalOperations = 0;
    }
1028846
private function cleanup()
    {
        if (isset($this->collection[$this->id_info])) {
            foreach ($this->collection[$this->id_info] as $key => $val) {
                $expire = $this->getSessionInfo($key, 'expire');
                if ($expire === true) {
                    $this->setSessionInfo($key, 'expire', -1);
                } elseif ($expire == -1) {
                    $this->delete($key);
                }
            }
        }
    }
751260
protected function cutStats()
	{
		if ( count($this->stats) > 100 )
		{
			reset($this->stats);
			$first = key($this->stats);
			unset($this->stats[$first]);
		}
	}
811603
public static function coming_events_limited($from=false, $limit=30)
    {
        $events = self::coming_events($from)->limit($limit);
        return $events;
    }
102512
public function onFinish()
    {
        foreach ($this->cursors as $curId => $cur) {
            if ($cur instanceof Cursor) {
                $cur->destroy(true);
            }
        }
        $this->cursors = null;
        $this->requests = null;
        parent::onFinish();
    }
1214991
public function clearListeners()
    {
        foreach ($this->listeners as $listener) {
            $listener->detach($this->getEventManager());
        }

        $this->listeners = [];
    }
912517
public function stop()
  {
    if(!$this->isRunning()) return;

    $this->data["runtime"] += microtime(TRUE) - $this->started;
    $this->data["realmem"] += memory_get_usage(TRUE) - $this->data["realmem_start"];
    $this->data["emalloc"] += memory_get_usage() - $this->data["emalloc_start"];

    $this->started = 0;
    $this->running = FALSE;
  }
829414
public function end()
    {
        if ($this->_discardActiveBufferOnEnd) {
            $this->_discardActiveBufferOnEnd = false;
            ob_end_clean();

            return;
        }
        if ($this->_active) {
            $mode = end($this->_active);
            $active = key($this->_active);
            $content = ob_get_clean();
            if ($mode === ViewBlock::OVERRIDE) {
                $this->_blocks[$active] = $content;
            } else {
                $this->concat($active, $content, $mode);
            }
            array_pop($this->_active);
        }
    }
716950
public function endSlot()
    {
        last($this->componentStack);

        $currentSlot = array_pop(
            $this->slotStack[$this->currentComponent()]
        );

        $this->slots[$this->currentComponent()]
                    [$currentSlot] = new HtmlString(trim(ob_get_clean()));
    }
367688
private void applyVerticalLimit()
    {
        if (mover.getY() < limitBottom && limitBottom != Integer.MIN_VALUE)
        {
            mover.teleportY(limitBottom);
        }
        else if (mover.getY() > limitTop && limitTop != Integer.MAX_VALUE)
        {
            mover.teleportY(limitTop);
        }
    }
319637
protected function min() {
		if (0 == strncmp($this->peek(), "\xef", 1)) {
			$this->get();
			$this->get();
			$this->get();
		} 

		$this->a = "\n";
		$this->action(self::ACTION_DELETE_A_B);

		while ($this->a !== NULL) {
			switch ($this->a) {
				case ' ':
					if ($this->isAlphaNum($this->b)) {
						$this->action(self::ACTION_KEEP_A);
					}
					else {
						$this->action(self::ACTION_DELETE_A);
					}
					break;

				case "\n":
					switch ($this->b) {
						case '{':
						case '[':
						case '(':
						case '+':
						case '-':
						case '!':
						case '~':
							$this->action(self::ACTION_KEEP_A);
							break;

						case ' ':
							$this->action(self::ACTION_DELETE_A_B);
							break;
						default:
							if ($this->isAlphaNum($this->b)) {
								$this->action(self::ACTION_KEEP_A);
							}
							else {
								$this->action(self::ACTION_DELETE_A);
							}
					}
					break;

				default:
					switch ($this->b) {
						case ' ':
							if ($this->isAlphaNum($this->a)) {
								$this->action(self::ACTION_KEEP_A);
								break;
							}
							$this->action(self::ACTION_DELETE_A_B);
							break;

						case "\n":
							switch ($this->a) {
								case '}':
								case ']':
								case ')':
								case '+':
								case '-':
								case '"':
								case "'":
									$this->action(self::ACTION_KEEP_A);
									break;

								default:
									if ($this->isAlphaNum($this->a)) {
										$this->action(self::ACTION_KEEP_A);
									}
									else {
										$this->action(self::ACTION_DELETE_A_B);
									}
							}
							break;

						default:
							$this->action(self::ACTION_KEEP_A);
							break;
					}
			}
		}

		return $this->output;
	}
850659
public function disable()
    {
        $this->app['events']->fire('module.disabling', [$this]);

        $this->setActive(0);

        $this->app['events']->fire('module.disabled', [$this]);
    }
723270
public function clearEventHandlers($event = null)
    {
        if (!empty($event)) {
            $this->events[$event] = [];
        } else {
            $this->events = [];
        }
    }
816618
public void reset()
   {
      min.set(Long.MAX_VALUE);
      max.set(0);
      total.set(0);
      times.set(0);
   }
132804
static function CleanUp()
	{
		$limit = new \DateTime('-30 minutes');
		foreach(self::$instances as $login => $player)
			if($player->awaySince && $player->awaySince < $limit) unset(self::$instances[$login]);
	}
674006
private function pruneNodeCache(): void
    {
        if ($this->maxItems > 0 && count($this->nodes) > $this->maxItems) {
            $this->nodes = array_slice($this->nodes, (int)($this->maxItems * 0.2), null, true);
        }
    }