for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GeekLab\GLPDO2\Bindings\MySQL;
use \PDO;
use \TypeError;
use GeekLab\GLPDO2\Bindings\LogicBindingInterface;
class MySQLLogicBindings implements LogicBindingInterface
{
/**
* Bind a boolean value as bool or null.
*
* @param int|bool|null $value
* @return array
* @throws TypeError
*/
public function bBoolNullable($value = null): array
// use NULL
if ($value === null) {
return [null, PDO::PARAM_NULL];
}
return $this->bBool($value);
* Bind a boolean value as bool.
public function bBool($value = null): array
throw new TypeError('Can not bind ' . gettype($value) . ':(' . $value . ') in boolean spot.');
return [$value, PDO::PARAM_BOOL];
* Bind a boolean value as int or null.
public function bBoolIntNullable($value = null): array
return $this->bBoolInt($value);
* Bind a boolean value as int.
public function bBoolInt($value = null): array
throw new TypeError('Can not bind ' . gettype($value) . ':(' . $value . ') in boolean / integer spot.');
return [(int) $value, PDO::PARAM_INT];