src/Filter.php
public function filter(array $contents)
	{
		$filtered = array();
		$this->typeCache = array();

		foreach ($contents as $item)
		{
			$passed = true;

			foreach ($this->filters as $filter)
			{
				$correctType = $this->isCorrectType($filter['type'], $item);

				if ($correctType and preg_match($filter['pattern'], $item) !== $expected)
				{
					$passed = false;
				}
			}

			if ($passed)
			{
				$filtered[] = $item;
			}
		}

		return $contents;
	}
public function filter(array $contents)
	{
		$filtered = array();
		$this->typeCache = array();

		foreach ($contents as $item)
		{
			$passed = true;

			foreach ($this->filters as $filter)
			{
				$correctType = $this->isCorrectType($filter['type'], $item);

				if ($correctType and preg_match($filter['pattern'], $item) !== $expected)
				{
					$passed = false;
				}
			}

			if ($passed)
			{
				$filtered[] = $item;
			}
		}

		return $contents;
	}
public function filter ( array $ contents ) { $ filtered = array ( ) ; $ this -> typeCache = array ( ) ; foreach ( $ contents as $ item ) { $ passed = true ; foreach ( $ this -> filters as $ filter ) { $ correctType = $ this -> isCorrectType ( $ filter [ 'type' ] , $ item ) ; if ( $ correctType and preg_match ( $ filter [ 'pattern' ] , $ item ) !== $ expected ) { $ passed = false ; } } if ( $ passed ) { $ filtered [ ] = $ item ; } } return $ contents ; }
Filters a batch of filesystem entries

@param array $contents

@return array
Filters a batch of filesystem entries