public function equals()
    {
        foreach ($this->comparisonList as $valuePair) {
            $a = $valuePair[0];
            $b = $valuePair[1];
            $callback = $valuePair[2];

            if (! is_null($callback)) {

                if (! is_callable($callback)) {
                    throw new \InvalidArgumentException(
                        sprintf(
                            'Provided callback of type %s is not callable!',
                            is_object($callback)? get_class($callback) : gettype($callback)
                        )
                    );
                }

                if (is_array($a) && is_array($b) && $this->isList($a) && $this->isList($b)) {
                    $result = $this->compareListsWithCallback($a, $b, $callback);
                } else {
                    $result = call_user_func($callback, $a, $b);
                }

                if (! is_bool($result)) {
                    throw new \RuntimeException(
                        sprintf(
                            'Provided callback of type %s does not return a boolean value!',
                            is_object($callback)? get_class($callback) : gettype($callback)
                        )
                    );
                }

                return $result;
            }
            
            if (! (($this->strict)? $a === $b : $a == $b) ) {
                return false;
            }
        }
        
        return true;
    }
public function equals()
    {
        foreach ($this->comparisonList as $valuePair) {
            $a = $valuePair[0];
            $b = $valuePair[1];
            $callback = $valuePair[2];

            if (! is_null($callback)) {

                if (! is_callable($callback)) {
                    throw new \InvalidArgumentException(
                        sprintf(
                            'Provided callback of type %s is not callable!',
                            is_object($callback)? get_class($callback) : gettype($callback)
                        )
                    );
                }

                if (is_array($a) && is_array($b) && $this->isList($a) && $this->isList($b)) {
                    $result = $this->compareListsWithCallback($a, $b, $callback);
                } else {
                    $result = call_user_func($callback, $a, $b);
                }

                if (! is_bool($result)) {
                    throw new \RuntimeException(
                        sprintf(
                            'Provided callback of type %s does not return a boolean value!',
                            is_object($callback)? get_class($callback) : gettype($callback)
                        )
                    );
                }

                return $result;
            }
            
            if (! (($this->strict)? $a === $b : $a == $b) ) {
                return false;
            }
        }
        
        return true;
    }
public function equals ( ) { foreach ( $ this -> comparisonList as $ valuePair ) { $ a = $ valuePair [ 0 ] ; $ b = $ valuePair [ 1 ] ; $ callback = $ valuePair [ 2 ] ; if ( ! is_null ( $ callback ) ) { if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Provided callback of type %s is not callable!' , is_object ( $ callback ) ? get_class ( $ callback ) : gettype ( $ callback ) ) ) ; } if ( is_array ( $ a ) && is_array ( $ b ) && $ this -> isList ( $ a ) && $ this -> isList ( $ b ) ) { $ result = $ this -> compareListsWithCallback ( $ a , $ b , $ callback ) ; } else { $ result = call_user_func ( $ callback , $ a , $ b ) ; } if ( ! is_bool ( $ result ) ) { throw new \ RuntimeException ( sprintf ( 'Provided callback of type %s does not return a boolean value!' , is_object ( $ callback ) ? get_class ( $ callback ) : gettype ( $ callback ) ) ) ; } return $ result ; } if ( ! ( ( $ this -> strict ) ? $ a === $ b : $ a == $ b ) ) { return false ; } } return true ; }
Compare all previous set value pairs

@return boolean
Compare all previous set value pairs