Browse Source

Minor CS corrections

euromark 12 years ago
parent
commit
b51ab9fb03

+ 1 - 1
src/Collection/CollectionTrait.php

@@ -84,7 +84,7 @@ trait CollectionTrait {
 	public function filter(callable $c = null) {
 		if ($c === null) {
 			$c = function ($v) {
-				return !!$v;
+				return (bool)$v;
 			};
 		}
 		return new FilterIterator($this, $c);

+ 1 - 1
src/Database/Driver.php

@@ -183,7 +183,7 @@ abstract class Driver {
  * @return string String for use in schema definitions.
  */
 	public function schemaValue($value) {
-		if (is_null($value)) {
+		if ($value === null) {
 			return 'NULL';
 		}
 		if ($value === false) {

+ 1 - 1
src/Database/Log/QueryLogger.php

@@ -58,7 +58,7 @@ class QueryLogger {
  */
 	protected function _interpolate($query) {
 		$params = array_map(function($p) {
-			if (is_null($p)) {
+			if ($p === null) {
 				return 'NULL';
 			}
 			return is_string($p) ? "'$p'" : $p;

+ 2 - 2
src/Database/Type.php

@@ -175,7 +175,7 @@ class Type {
  * @return mixed
  */
 	protected function _basicTypeCast($value, Driver $driver) {
-		if (is_null($value)) {
+		if ($value === null) {
 			return null;
 		}
 
@@ -196,7 +196,7 @@ class Type {
  * @return mixed
  */
 	public function toStatement($value, Driver $driver) {
-		if (is_null($value)) {
+		if ($value === null) {
 			return PDO::PARAM_NULL;
 		}
 

+ 1 - 1
src/Database/Type/UuidType.php

@@ -32,7 +32,7 @@ class UuidType extends \Cake\Database\Type {
  * @return mixed
  */
 	public function toStatement($value, Driver $driver) {
-		if (is_null($value)) {
+		if ($value === null) {
 			return PDO::PARAM_NULL;
 		}
 		return PDO::PARAM_STR;