Checks whether string has been modified

@param string $target Input string
@param \Closure $callback Comparison function
@return boolean
426690
public static function strModified($target, Closure $callback)
    {
        $modified = $callback($target);

        return md5($target) !== md5($modified);
    }
1034859
public function isChildOf($head, $target)
    {
        if (!is_array($head)) {
            $head = $this->getNode($head);
        }
        if (!is_array($target)) {
            $target = $this->getNode($target);
        }
        $config = $this->config;
        $headLft = $head[$config['lft']];
        $headRgt = $head[$config['rgt']];
        $targetLft = $target[$config['lft']];
        $targetRgt = $target[$config['rgt']];
        if ($headLft > $targetLft && $headRgt < $targetRgt) {
            return TRUE;
        } else {
            return FALSE;
        }
    }
204950
public function equals( $target ) {
		if ( $target === $this ) {
			return true;
		}

		if ( !( $target instanceof self ) ) {
			return false;
		}

		return $this->isAssociative === $target->isAssociative
			&& $this->getArrayCopy() == $target->getArrayCopy();
	}
1307106
public function remember(\Closure $callback, $key)
    {
        if (! config('larecipe.cache.enabled')) {
            return $callback();
        }

        $cachePeriod = $this->checkTtlNeedsChanged(config('larecipe.cache.period'));

        return $this->cache->remember($key, $cachePeriod, $callback);
    }
1028573
public function exists(callable $callback): bool
    {
        $index = 0;
        foreach ($this->items as $key => $item) {
            if (true === $callback($item, $key, $index++)) {
                return true;
            }
        }

        return false;
    }
514228
protected function afterResolvingCallback(Closure $callback)
    {
        $abstract = $this->getFunctionHint($callback);

        if ($abstract) {
            $this->afterResolvingCallbacks[$abstract][] = $callback;
        } else {
            $this->globalAfterResolvingCallbacks[] = $callback;
        }
    }
446605
public function first( Closure $callback = NULL, $default = NULL )
    {
        if ( is_null( $callback ) )
        {
            return count( $this->items ) > 0 ? reset( $this->items ) : NULL;
        }

        return array_filter( $this->items, $callback, $default );
    }
883638
function contains($item, callable $callback = null) {
        if ($callback === null) {
            $callback = __NAMESPACE__ . '\\compare';
        }
        foreach ($this->avl as $pair) {
            /**
             * @var Pair $pair
             */
            if (call_user_func($callback, $pair->second, $item) === 0) {
                return true;
            }
        }

        return false;
    }
677821
public static function isGravInstance($target)
    {
        self::$error = 0;
        self::$target = $target;

        if (
            !file_exists($target . DS . 'index.php') ||
            !file_exists($target . DS . 'bin') ||
            !file_exists($target . DS . 'user') ||
            !file_exists($target . DS . 'system' . DS . 'config' . DS . 'system.yaml')
        ) {
            self::$error = self::NOT_GRAV_ROOT;
        }

        return !self::$error;
    }
860733
protected function hasTargetedBinding(string $interface, string $target = null) : bool
    {
        return isset($this->bindings[$target][$interface]);
    }
470025
private function trackIfEnabled($key, \Closure $callback, $default = null)
    {
        return $this->isEnabled()
            ? ($this->getConfig("tracking.$key", false) ? $callback() : $default)
            : $default;
    }
1167721
private function isMatched(\ReflectionClass $class, $target)
    {
        if ($class->getName() === $target) {
            return true;
        } elseif ($parentClass = $class->getParentClass()) {
            return $this->isMatched($parentClass, $target);
        }

        return false;
    }
695120
private function isCallbackBlacklisted($callback, $listener)
    {
        return ((ContainerOnLoadCallbackListener::class === $listener)
                && \is_array($callback)
                && ('checkPermission' === $callback[1])
                && (0 === strpos($callback[0], 'tl_')));
    }
443560
public function isFresh(AssetTarget $target)
    {
        $buildName = $this->buildFileName($target);
        $buildFile = $this->outputDir($target) . DIRECTORY_SEPARATOR . $buildName;

        if (!file_exists($buildFile)) {
            return false;
        }
        $buildTime = filemtime($buildFile);

        if ($this->configTime && $this->configTime >= $buildTime) {
            return false;
        }

        foreach ($target->files() as $file) {
            $time = $file->modifiedTime();
            if ($time === false || $time >= $buildTime) {
                return false;
            }
        }

        $filters = $this->filterRegistry->collection($target);
        foreach ($filters->filters() as $filter) {
            foreach ($filter->getDependencies($target) as $child) {
                $time = $child->modifiedTime();
                if ($time >= $buildTime) {
                    return false;
                }
            }
        }
        return true;
    }
945756
public function copy($target) {
        if (!parent::copy($target))
            return false;
        return file_put_contents($target, $this->content) !== false;
    }
311153
public static function filter($string, callable $callback, $encoding = null)
    {
        return static::map(
            $string,
            function ($char, &$key) use ($callback) {
                if ($callback instanceof \Closure) {
                    $result = $callback($char, $key);
                } else {
                    $result = $callback($char);
                }

                return $result ? $char : '';
            },
            $encoding
        );
    }
990707
public function listen($callback) {
		if ($this->listening) {
			$this->connection->read(function ($line) use ($callback) {
				$this->checkForError($line);
				$change = $this->parseChangeLine($line);
				if ($change) {
					return $callback($change);
				}
			});
		}
	}