src/Connection.php
protected function bindValue(\PDOStatement $statement, $name, $value)
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException(sprintf(
                'Bound value %s expected to be scalar or null, a %s given',
                is_int($name) ? '#'.$name : '`'.$name.'`',
                gettype($value)
            ));
        }

        if ($value === null) {
            $type = \PDO::PARAM_NULL;
        } elseif (is_bool($value)) {
            $type = \PDO::PARAM_BOOL;
        } elseif (is_integer($value)) {
            $type = \PDO::PARAM_INT;
        } else {
            $type = \PDO::PARAM_STR;
        }

        $statement->bindValue($name, $value, $type);
    }
protected function bindValue(\PDOStatement $statement, $name, $value)
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException(sprintf(
                'Bound value %s expected to be scalar or null, a %s given',
                is_int($name) ? '#'.$name : '`'.$name.'`',
                gettype($value)
            ));
        }

        if ($value === null) {
            $type = \PDO::PARAM_NULL;
        } elseif (is_bool($value)) {
            $type = \PDO::PARAM_BOOL;
        } elseif (is_integer($value)) {
            $type = \PDO::PARAM_INT;
        } else {
            $type = \PDO::PARAM_STR;
        }

        $statement->bindValue($name, $value, $type);
    }
protected function bindValue ( \ PDOStatement $ statement , $ name , $ value ) { if ( $ value !== null && ! is_scalar ( $ value ) ) { throw new InvalidArgumentException ( sprintf ( 'Bound value %s expected to be scalar or null, a %s given' , is_int ( $ name ) ? '#' . $ name : '`' . $ name . '`' , gettype ( $ value ) ) ) ; } if ( $ value === null ) { $ type = \ PDO :: PARAM_NULL ; } elseif ( is_bool ( $ value ) ) { $ type = \ PDO :: PARAM_BOOL ; } elseif ( is_integer ( $ value ) ) { $ type = \ PDO :: PARAM_INT ; } else { $ type = \ PDO :: PARAM_STR ; } $ statement -> bindValue ( $ name , $ value , $ type ) ; }
Binds a value to a PDO statement.

@param \PDOStatement $statement PDO statement
@param string|int $name Value placeholder name or index (if the placeholder is not named)
@param string|int|float|boolean|null $value Value to bind
@throws InvalidArgumentException
@throws BasePDOException
Binds a value to a PDO statement .