src/FileSleuth.php
public function check($file, $verify = null)
	{
		if (is_string($verify))
		{
			$verify = "lead" . strtoupper($verify);
		}

		$detectives = [];
		foreach ($this->detectives as $detectiveClass)
		{
			if ($detectiveClass::on())
			{
				$detectives[] = $detectiveClass;
			}
		}

		$case = null;

		foreach ($detectives as $detectiveClass)
		{
			$detective = new $detectiveClass();
			$case      = $detective->check($file, $verify);

			if ($case)
			{
				return $detective;
			}
		}

		return false;
	}
public function check($file, $verify = null)
	{
		if (is_string($verify))
		{
			$verify = "lead" . strtoupper($verify);
		}

		$detectives = [];
		foreach ($this->detectives as $detectiveClass)
		{
			if ($detectiveClass::on())
			{
				$detectives[] = $detectiveClass;
			}
		}

		$case = null;

		foreach ($detectives as $detectiveClass)
		{
			$detective = new $detectiveClass();
			$case      = $detective->check($file, $verify);

			if ($case)
			{
				return $detective;
			}
		}

		return false;
	}
public function check ( $ file , $ verify = null ) { if ( is_string ( $ verify ) ) { $ verify = "lead" . strtoupper ( $ verify ) ; } $ detectives = [ ] ; foreach ( $ this -> detectives as $ detectiveClass ) { if ( $ detectiveClass :: on ( ) ) { $ detectives [ ] = $ detectiveClass ; } } $ case = null ; foreach ( $ detectives as $ detectiveClass ) { $ detective = new $ detectiveClass ( ) ; $ case = $ detective -> check ( $ file , $ verify ) ; if ( $ case ) { return $ detective ; } } return false ; }
Runs the file against all dectives.

@param  string  $file  Optional parameter to automatically run a check.
@param  string|null  $verify  Extension to verify against. Checks all possible if unset.
@return null|boolean
Runs the file against all dectives .