for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File was created 07.05.2015 12:05
*
* @author Karsten J. Gerber <[email protected]>
*/
namespace PeekAndPoke\Component\Psi\Operation\Intermediate\Predicate;
use PeekAndPoke\Component\Psi\Interfaces\BinaryFunction;
use PeekAndPoke\Component\Psi\Interfaces\IntermediateOperation;
use PeekAndPoke\Component\Psi\Interfaces\UnaryFunction;
abstract class AbstractPredicateOperation implements IntermediateOperation
{
/** @var callable|\Closure|UnaryFunction|BinaryFunction */
protected $function;
* @param callable|\Closure|UnaryFunction|BinaryFunction $binaryFunction
public function __construct($binaryFunction)
$this->function = $binaryFunction;
}
* @param $input1
* @param $input2
* @return bool
protected function test($input1, $input2 = null)
$func = $this->function;
return (bool) $func($input1, $input2);