@param string $value
@param bool $is_negation

@return string[]|false
197828
protected static function parseLikeOperator($value, $is_negation)
    {
        if (preg_match('/(^%.+)|(.+%$)/', $value)) {
            return [$is_negation ? static::OPERATOR_NOT_LIKE : static::OPERATOR_LIKE, $value];
        }

        return false;
    }
607544
protected function booleanValue($value)
    {
        if (is_bool($value)) {
            return $value;
        }

        if (is_numeric($value)) {
            return (Boolean) $value;
        }

        return in_array(strtolower($value),  [ 'true', 't', 'y', 'yes' ], true);
    }
31693
public static function isBoolean($value, $message = null)
    {
        if (!is_bool($value)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected boolean, but got %s',
                Helper::typeToString($value)
            ));
        }
    }
306022
protected function inArray($value)
    {
        if ($this->strict) {
            $isIn = in_array($value, $this->range, true);
        } else {
            $isIn = false;
            foreach ($this->range as $r) {
                $isIn = (strcmp($r, $value) === 0);
                if ($isIn) break;
            }
        }
        return $isIn;
    }
458602
public function andx($value)
    {
        if(!is_array($value)) {
            // get arguments 
            $value = func_get_args();
        }

        // Convert all values to 
        $conds = array_map(function($v) {
                if(!$v instanceof Expr\ConditionalExpression) {
                    throw new \InvalidArgumentException(sprintf('arguments of andx has to be an array of ConditionalExpresion, but "%s" is given', is_object($v) ? get_class($v) : gettype($v)));
                    //return $this->buildPart($v);
                }
                return $v;
            }, $value);
        return new Expr\LogicalExpression($conds, Expr\LogicalExpression::TYPE_AND);
    }
406604
protected function convertValuesToBoolean($values)
    {
        return array_map(function ($value) {
            if ($value === 'true') {
                return true;
            } elseif ($value === 'false') {
                return false;
            }

            return $value;
        }, $values);
    }
128413
public function seeIsSelected($selector, $value, $negate = false)
    {
        return $this->assertInPage(new IsSelected($selector, $value), $negate);
    }
64537
protected function getBooleanValue($value)
    {
        if (is_string($value)) {
            return 'true' === $value ? true : false;
        } elseif (is_bool($value)) {
            return $value;
        } elseif (is_numeric($value)) {
            return 1 === $value ? true : false;
        }
    }
1134564
private List<Boolean> asBooleanList(Object value) {
        boolean[] values = (boolean[]) value;
        List<Boolean> list = new ArrayList<Boolean>(values.length);
        for (boolean booleanValue : values) {
            list.add(booleanValue);
        }
        return list;
    }
1271484
protected function castToBool($value, bool $nullable = true)
    {
        if (null === $value && $nullable) {
            return null;
        }

        return (bool) $value;
    }
702919
public function equivalentTo($value)
    {
        $message = ['%s is {{not|}} equivalent to %s', $this->value, $value];
        $this->assert(($this->value == $value), $message);

        return $this;
    }
297251
public function Check($value)
    {
        if (!\in_array($value, $this->values))
            $this->error = self::NotInArray;
        
        return $this->error == '';
    }
1343248
public static function boolval( $value )
    {
        if ( \is_bool( $value ) )
        {
            return $value;
        }

        $_value = \strtolower( (string)$value );

        //	FILTER_VALIDATE_BOOLEAN doesn't catch 'Y' or 'N', so convert to full words...
        if ( 'y' == $_value )
        {
            $_value = 'yes';
        }
        elseif ( 'n' == $_value )
        {
            $_value = 'no';
        }

        return \filter_var( $_value, FILTER_VALIDATE_BOOLEAN );
    }
1308385
public static function getInitializedConditionals($value)
    {
        $services = array();

        if (is_array($value)) {
            foreach ($value as $v) {
                $services = array_unique(array_merge($services, self::getInitializedConditionals($v)));
            }
        } elseif ($value instanceof Reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior()) {
            $services[] = (string) $value;
        }

        return $services;
    }
1163366
protected function getPossibleTypes($value): array
    {
        $type = $this->getTypeOf($value);

        switch ($type) {
            case 'boolean':
            case 'integer':
            case 'float':
            case 'string':
                return $this->getPossibleScalarTypes($value);
            case 'array':
                return $this->getPossibleArrayTypes($value);
            case 'assoc':
                return $this->getPossibleAssocTypes($value);
            case 'object':
                return $this->getPossibleObjectTypes($value);
            case 'resource':
            default:
                return array_intersect($this->types, [$type]);
        }
    }
856638
public static function boolean($value, $options = null)
    {
        if (!is_null($options)) {
            $options = explode('|', $options);
        }

        if (sizeof($options) != 2) {
            $options = array('No', 'Yes');
        }

        return $options[!!$value];
    }
1352445
public static function toBoolean($value)
    {
        if (is_string($value)) {
            if ($value === 'true') {
                $value = true;
            } else {
                $value = false;
            }
        } elseif (is_bool($value) === false) {
            $value = false;
        }

        return $value;
    }