@param AbstractFile|null $file
@param null $filter

@return string
344288
public function getImageWebPath(AbstractFile $file = null, $filter = null)
    {
        if (!$file) {
            return '';
        }

        $webPath = $this->getFileWebPath($file);

        return $filter ? $this->imagine->getBrowserPath($webPath, $filter) : $webPath;
    }
977456
public function getFileEditLink($file)
    {
        if (!$file || !$file->isInDB()) {
            return null;
        }

        return Controller::join_links(
            $this->Link('show'),
            $file->ParentID,
            'edit',
            $file->ID
        );
    }
782081
private function search(AbstractFilter $filter)
    {
        if ($this->ldapSearchOptions) {
            $ldapResource = $this->ldap->getResource();
            foreach ($this->ldapSearchOptions as $name => $options) {
                ldap_set_option($ldapResource, $name, $options);
            }
        }

        return $this->ldap->searchEntries($filter, null, Ldap::SEARCH_SCOPE_SUB, $this->entryAttributesToFetch);
    }
88180
public static function for_file($file)
    {
        if (!$file || (is_string($file) && !file_exists($file))) {
            return null;
        }

        // Ensure we have a File instance to work with
        if (is_string($file)) {
            /** @var File $fileObject */
            $fileObject = File::create();
            $fileObject->setFromLocalFile($file);
            $file = $fileObject;
        }

        $extension = $file->getExtension();
        $mime = $file->getMimeType();

        foreach (self::get_extractor_classes() as $className) {
            $extractor = self::get_extractor($className);

            // Skip unavailable extractors
            if (!$extractor->isAvailable()) {
                continue;
            }

            // Check extension
            if ($extension && $extractor->supportsExtension($extension)) {
                return $extractor;
            }

            // Check mime
            if ($mime && $extractor->supportsMime($mime)) {
                return $extractor;
            }
        }
    }
115316
public function export($file = null)
    {
        if ($file) {
            return isset($this->_coverage[$file]) ? $this->_coverage($file, $this->_coverage[$file]) : [];
        }
        $result = [];
        $base = preg_quote($this->base(), '~');
        foreach ($this->_coverage as $file => $rawCoverage) {
            if ($coverage = $this->_coverage($file, $rawCoverage)) {
                $result[preg_replace("~^{$base}~", '', $file)] = $coverage;
            }
        }
        return $result;
    }
720871
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->error) && ($filter === null || isset($filter['error']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->error));
			$output .= $object->error;
		}

		if (isset($object->file) && ($filter === null || isset($filter['file']))) {
			foreach ($object->file instanceof \Traversable ? $object->file : (array)$object->file as $k => $v) {
				$output .= "\x7a";
				$buffer = FileMeta::toProtobuf($v, $filter === null ? null : $filter['file']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		return $output;
	}
970373
public function addWeightFunction(float $weight, AbstractQuery $filter = null): self
    {
        return $this->addFunction('weight', $weight, $filter);
    }
217807
public function getFilePath($file): string
    {
        if (null === ($fileObj = $this->container->get('huh.utils.file')->getFileFromUuid($file))) {
            return '';
        }

        return $fileObj->path;
    }
644719
public function file( $file = null )
	{
		if ( !is_null( $file ) )
		{
			return $this->_file = $file;
		}
		
		return $this->_file;
	}
410497
protected function filterValue($value, ?string $filter = null)
    {
        $resolver = $this->getFilterResolver($filter);

        if (\method_exists($resolver[0], $resolver[1])) {
            return $this->callFilterResolver($resolver, $value);
        }

        return $value;
    }
732805
public function provideFilter($filter = null)
    {
        if ($filter === null) {
            $filter = config('eloquentfilter.namespace', 'App\\ModelFilters\\').class_basename($this).'Filter';
        }

        return $filter;
    }
622256
protected function filtertextToArray(string $filter = null)
    {
        $resultArray = [];

        if (!empty($filter)) {
            $filterArray = explode(self::SEPARATOR_ENTRY, $filter);

            foreach ($filterArray as $key => $value) {
                $entryArray = explode(self::SEPARATOR_KEY_VALUE, $value);
                $resultArray[$entryArray[0]] = $entryArray[1];
            }
        }

        return $resultArray;
    }
380527
public function render(string $file = null): string
    {
        if ($file) {
            $this->setFile($file);
        }

        if (empty($this->file)) {
            throw new \Exception('You must set the file to use within your view before rendering');
        }

        return $this->capture($this->file, $this->data, static::$globalData);
    }
872648
public function filter(string $name, AbstractQuery $filter = null): Filter
    {
        return new Filter($name, $filter);
    }
137566
public function getStreams($filter = null)
	{
		if ($filter !== null)
		{
			if ( ! is_callable($filter))
			{
				$filter = function (StreamInterface $stream) use ($filter) {
					return (bool) ($filter & $stream->getType());
				};
			}
			
			$streams = clone $this->streams;
			
			foreach ($streams as $index => $stream)
			{
				if ($filter($stream) === false)
				{
					$streams->offsetUnset($index);
				}
			}
			
			return $streams;
		}
		
		return $this->streams;
	}
567633
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->name) && ($filter === null || isset($filter['name']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->name));
			$output .= $object->name;
		}

		if (isset($object->method) && ($filter === null || isset($filter['method']))) {
			foreach ($object->method instanceof \Traversable ? $object->method : (array)$object->method as $k => $v) {
				$output .= "\x12";
				$buffer = MethodDescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['method']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		if (isset($object->options) && ($filter === null || isset($filter['options']))) {
			$output .= "\x1a";
			$buffer = ServiceOptionsMeta::toProtobuf($object->options, $filter === null ? null : $filter['options']);
			$output .= Binary::encodeVarint(strlen($buffer));
			$output .= $buffer;
		}

		return $output;
	}
331539
public function extract(
        FileIteratorInterface $files,
        SymbolFilterInterface $filter
    ): SymbolIteratorInterface {
        $symbols = [];

        foreach ($files as $file) {
            $parser = clone $this->parser;

            try {
                $size     = $file->getSize();
                $handle   = $file->openFile('rb');
                $contents = $size  > 0 ? $handle->fread($size) : '';

                if (empty($contents)) {
                    continue;
                }

                $statements = $parser->parse($contents);
            } catch (Error $e) {
                // Either not a file, file is not readable, not a PHP file or
                // the broken file should be detected by other tooling entirely.
                continue;
            }

            $tracker   = new SymbolTracker($filter);
            $traverser = new NodeTraverser();
            $traverser->addVisitor($tracker);
            $traverser->traverse($statements);

            foreach ($tracker->getSymbols() as $node) {
                $symbols[] = new Symbol($file, $node);
            }
        }

        return new SymbolIterator(...$symbols);
    }