src/Operand/ArgumentToOperandConverter.php
public static function convert(array $arguments)
    {
        if (!$arguments) {
            return [];
        }

        // always try convert the first argument to the field operand
        $field = self::toField(array_shift($arguments));

        if (!$arguments) {
            return [$field];
        }

        // always try convert the last argument to the value operand
        $value = self::toValue(array_pop($arguments));

        if (!$arguments) {
            return [$field, $value];
        }

        if (!self::isAllOperands($arguments)) {
            throw new NotConvertibleException('You passed arguments not all of which are operands.');
        }

        array_unshift($arguments, $field);
        array_push($arguments, $value);

        return $arguments;
    }
public static function convert(array $arguments)
    {
        if (!$arguments) {
            return [];
        }

        // always try convert the first argument to the field operand
        $field = self::toField(array_shift($arguments));

        if (!$arguments) {
            return [$field];
        }

        // always try convert the last argument to the value operand
        $value = self::toValue(array_pop($arguments));

        if (!$arguments) {
            return [$field, $value];
        }

        if (!self::isAllOperands($arguments)) {
            throw new NotConvertibleException('You passed arguments not all of which are operands.');
        }

        array_unshift($arguments, $field);
        array_push($arguments, $value);

        return $arguments;
    }
public static function convert ( array $ arguments ) { if ( ! $ arguments ) { return [ ] ; } // always try convert the first argument to the field operand $ field = self :: toField ( array_shift ( $ arguments ) ) ; if ( ! $ arguments ) { return [ $ field ] ; } // always try convert the last argument to the value operand $ value = self :: toValue ( array_pop ( $ arguments ) ) ; if ( ! $ arguments ) { return [ $ field , $ value ] ; } if ( ! self :: isAllOperands ( $ arguments ) ) { throw new NotConvertibleException ( 'You passed arguments not all of which are operands.' ) ; } array_unshift ( $ arguments , $ field ) ; array_push ( $ arguments , $ value ) ; return $ arguments ; }
Convert all possible arguments to operands.

@param Operand[]|string[] $arguments

@throws NotConvertibleException

@return Operand[]
Convert all possible arguments to operands .