Check whether the given file should be included in the final Filelist

@param \SplFileInfo $file

@throws LogicException
@return boolean
779719
public function filter(\SplFileInfo $file)
    {
        if (! $this->filter) {
            throw new \LogicException('No Filter has been set');
        }
        return ! $this->filter->filter($file);
    }
197779
public function filter(SplFileInfo $file)
    {
        try {
            $class = $this->getClassName($file->getPathname());
        } catch (Exception $e){
            return false;
        }

        $usedtraits = class_uses($class, $this->useautoload);

        foreach ($this->instances as $instance) {
            if (in_array($instance, $usedtraits)) {
                return true;
            }
        }

        return false;
    }
836371
public static function createFromSplFileInfo(\SplFileInfo $file)
    {
        $asset = new Asset();
        $guesser = MimeTypeGuesser::getInstance();
        return $asset
            ->setFilename($file->getFilename())
            ->setExtension($file->getExtension())
            ->setPathname($file->getPathname())
            ->setMimeType($guesser->guess($file->getPathname()))
            ->setClientOriginalName($file->getFilename())
            ->setClientOriginalExtension($file->getExtension())
        ;
    }
143311
public function lint($file)
    {
        $template = $this->app['twig.loader.viewfinder']->getSourceContext($file);

        if (!$template) {
            throw new InvalidArgumentException('Unable to find file: '.$file);
        }

        try {
            $this->parse($this->tokenize($template, $file));
        } catch (Error $e) {
            return false;
        }

        return true;
    }
524825
protected function _include( $file )
	{
		if( !isset( $this->_includeCache[$file] ) ) {
			$this->_includeCache[$file] = include $file;
		}

		return $this->_includeCache[$file];
	}
1335399
protected function setTarget(SplFileInfo $file)
    {
        // Page extension
        $ext = $file->getExtension();

        // Twig templates are HTML
        if (!$this->has('template') || $this->get('template') === 'none') {
            $targetExt = $ext;
        }
        else {
            $targetExt = 'html';
        }

        // Get clean source path
        $sourcePath = $this->getCleanPath($file->getRelativePathName());

        // Replace source extension with that of the template
        $this->target = substr($sourcePath, 0, -strlen($ext));
        $this->target .= $targetExt;
    }
476593
protected function getItemFromFile(Storage $storage, SplFileInfo $file)
    {
        /* @var $item Item */
        foreach ($storage->getItems() as $item) {
            if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilename()) {
                return $item;
            }
        }

        return false;
    }
647888
public function fileMime($file, $rule)
    {
        if (!($file instanceof SplFileObject)) {
            return false;
        }

        return $this->checkMime($file, $rule);
    }
351646
protected function checkFileReadable($file)
    {
        if (!file_exists($file)) {
            throw new \RuntimeException("File [$file] does not exist");
        }
        if (!is_file($file)) {
            throw new \RuntimeException("File [$file] is not a file");
        }
        if (!is_readable($file)) {
            throw new \RuntimeException("File [$file] is not readable");
        }
    }
810472
public function isFile($file)
	{
		$file = Util::normalizePath($file);

		return (bool) $this->adapter->isFile($file);
	}
933208
public final function loadFile($file) {
        $f = $this->getPath($file);
        if (is_file($f) && is_readable($f)) {
            return @file_get_contents($f);
        }

        return false;
    }
1035214
public function removeFromLibrary(File $file)
    {
        if(!$this->containsFile($file)){
            return false;
        }
        if($this->whitelistContainsFile($file)){
            $this->removeFromWhitelist($file);
        }
        $file->delete();
        return !$this->containsFile($file);
    }
552909
private function isCovered($file)
    {
        return in_array($file, $this->includedFiles)
            && !in_array($file, $this->excludedFiles)
            && isset($this->covered[$file]);
    }
885194
private function checkFile(SplFileInfo $file)
    {
        $tokens = token_get_all($file->getContents());
        $licenseTokenIndex = $this->getLicenseTokenIndex($tokens);

        if ($licenseTokenIndex === null) {
            $this->log(sprintf('Missing license header in "%s"', $file->getRealPath()));
        } elseif ($tokens[$licenseTokenIndex][1] != $this->getLicenseAsComment()) {
            $this->log(sprintf('Different license header in "%s"', $file->getRealPath()));
        }
    }
677628
protected function processFile(SplFileInfo $file): array
    {
        $realPath = $file->getRealPath();
        if ($this->output->isDebug()) {
            $this->output->writeln('Process file: ' . $realPath);
        }

        if ($realPath === false) {
            throw new RuntimeException(sprintf('File not found: %s', $file));
        }

        $processor = new FileProcessor($realPath);
        $check = new FileCheck();

        if (!$this->skipClasses) {
            $check->processFileClasses($processor->getClasses(), $realPath);
        }

        if (!$this->skipMethods) {
            $check->processFileMethods($processor->getMethods(), $realPath);
        }

        if (!$this->skipSignatures) {
            $check->processFileSignatues($processor->getMethods(), $realPath);
        }

        foreach ($check->getErrors() as $errorItem) {
            if ($this->output->isDebug()) {
                $this->output->writeln('Error in line: ' . var_export($errorItem, true));
            }
            $this->errors[] = $errorItem;
        }

        foreach ($check->getWarnings() as $warningEntry) {
            if ($this->output->isDebug()) {
                $this->output->writeln('Warning in line: ' . var_export($warningEntry, true));
            }
            $this->warnings[] = $warningEntry;
        }

        $hasErrors = !empty($errorItem);
        $hasWarnings = !empty($warningEntry);

        if (!$hasErrors) {
            $this->passed++;
        }

        return [$hasErrors, $hasWarnings];
    }
702699
private function isExcludedFromVerbatim($file)
    {
        foreach ($this->copyVerbatimExcludePatterns as $pattern) {
            if (Str::is($pattern, $file)) {
                return true;
            }
        }

        return false;
    }
604618
protected function instanceOf(SplFileInfo $file): bool
    {
        $reflecter = new ReflectionClass($this->getClassName($file));

        if (! $this->isSkip($reflecter)) {
            if ($this->interface === null) {
                return true;
            }
            return (bool) $reflecter->implementsInterface($this->interface);
        }

        unset($reflecter);

        return false;
    }