@param null $current
@param null $last

@return bool
322129
public function needs_upgrade( $current = null, $last = null ) {

		if ( null === $current ) {
			$current = self::$version;
		}

		if ( null === $last ) {
			$last = self::$version_last;
		}

		$upgrade_needed = false;

		if ( ! empty( $current ) ) {
			foreach ( self::$upgrades as $old_version => $new_version ) {
				/*
				if ( '2.1.0' === $new_version && ( is_developer() ) )
					continue;*/

				if ( version_compare( $last, $old_version, '>=' ) && version_compare( $last, $new_version, '<' ) && version_compare( $current, $new_version, '>=' ) && 1 !== self::$upgraded ) {
					$upgrade_needed = true;

					break;
				}
			}
		}

		return $upgrade_needed;
	}
1202648
final public function current()
    {
        if (!$this->valid()) {

            return null;
        }

        /*
         * Multiple calls to current() should be idempotent
         */
        if ($this->_lastPositionExecuted !== $this->_position) {

            $this->runToNextYieldStatement();
        }

        return $this->valid() ? $this->getLastYieldedValue() : null;
    }
90101
public function get_lastQuery() {
		$retval = null;
		if(is_object($this->sth)) {
			$retval = $this->sth->queryString;
		}
		else {
			throw new \Exception(__METHOD__ .': statement handle not set');
		}
		return($retval);
	}
411689
public static function last($collection = null, $n = null)
    {
        if ($n === 0) {
            $result = array();
        } elseif ($n === 1 || is_null($n)) {
            $result = array_pop($collection);
        } else {
            $result = self::rest($collection, -$n);
        }
        return $result;
    }
1138006
public function getLastChild()
	{
		if ( ! $this->hasChildren()) {
			return null;
		}
		$right = $this->getRightValue() - 1;

		$searchCondition = $this->repository->createSearchCondition()
				->rightEqualsTo($right);

		$lastChild = $this->repository->search($searchCondition);
		if ( ! isset($lastChild[0])) {
			$dump = static::dump($this);
			throw new Exception\InvalidStructure("Could not find the last child of {$dump} but it must exist");
		}
		$lastChild = $lastChild[0];
		
		return $lastChild;
	}
605377
protected function overwrite($current, $new, $handler = null)
    {
        if ($handler === null)
        {
            $handler = $this->overwriteHandler;
        }

        return $handler($current, $new);
    }
222091
public function last()
    {
        return (null === $this->getDraft()) ? $this->getData($this->count() - 1) : $this->getDraft()->last();
    }
759793
public function delete($current)
	{
		if (is_string($current)) {
			return $this->deleteCurrentFiles($current);
		}

		$toDelete = $this->deleting()->keys()->all();

		$this->deleteCurrentFiles(
			$current->whereIn('id', $toDelete)
		);

		return $toDelete;
	}
1333698
protected function current()
    {
        if (count($this->stack)) {
            return $this->stack[count($this->stack) -1];
        }
        return null;
    }
115098
private function _checkNeedsP($current)
    {
        if ($current instanceof HTMLPurifier_Token_Start) {
            if (!$this->_isInline($current)) {
                // <div>PAR1<div>
                //      ----
                // Terminate early, since we hit a block element
                return false;
            }
        } elseif ($current instanceof HTMLPurifier_Token_Text) {
            if (strpos($current->data, "\n\n") !== false) {
                // <div>PAR1<b>PAR1\n\nPAR2
                //      ----
                return true;
            } else {
                // <div>PAR1<b>PAR1...
                //      ----
            }
        }
        return null;
    }
551014
private function extended(callable $previous = null, callable $current): callable
    {
        return is_null($previous) ? $current : new Extension($current, $previous);
    }
1905
protected function cron_has_fresh_fetch($now) {
        $recent = $this->get_last_timefetched();

        if (empty($recent)) {
            return false;
        }

        if ($now < $recent) {
            $this->cron_mtrace('The most recent fetch is reported to be in the future, this is weird!');
            return true;
        }

        if ($now - $recent > 24 * HOURSECS) {
            return false;
        }

        return true;
    }
1043604
public function last() {
        if ($this->count()) {
            $this->current = $this->count() - 1;
            return $this->get($this->count() - 1);
        }
    }
911550
public function close(bool $current = false): bool
    {
        if ($current) {
            if (isset(self::$caches[$this->__name])) {
                foreach (self::$caches[$this->__name] as $type => $f) {
                    fclose($f);
                }
                unset(self::$caches[$this->__name]);
            }
        } else {
            foreach (self::$caches as $name => $fPointers) {
                foreach ($fPointers as $type => $f) {
                    fclose($f);
                }
            }
            self::$caches = [];
        }
        return true;
    }
650576
public function last()
    {
        $this->executeBeforeCallback();

        return count($this->items) > 0 ? end($this->items) : null;
    }
925815
public function useCurrent($bool = null)
    {
        if (isset($bool)) {

            $this->option_use_current = is_bool($bool) ? $bool : false;
            $this->set_options['use_current'] = 'useCurrent';

            return $this;
        }
        else {

            return $this->option_show_today;
        }
    }
470198
public function current()
    {
        return isset($this->mappedEnums[$this->iteratorIndex])
            ? $this->valueMap[$this->mappedEnums[$this->iteratorIndex]->getConstName()]
            : null;
    }