File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ parameters:
3636 count : 1
3737 path : src/DatabaseDriver.php
3838
39+ -
40+ message : ' #^Call to function is_string\(\) with string will always evaluate to true\.$#'
41+ identifier : function.alreadyNarrowedType
42+ count : 1
43+ path : src/DatabaseDriver.php
44+
3945 -
4046 message : ' #^If condition is always true\.$#'
4147 identifier : if.alwaysTrue
@@ -72,6 +78,12 @@ parameters:
7278 count : 1
7379 path : src/DatabaseDriver.php
7480
81+ -
82+ message : ' #^Result of \|\| is always false\.$#'
83+ identifier : booleanOr.alwaysFalse
84+ count : 1
85+ path : src/DatabaseDriver.php
86+
7587 -
7688 message : ' #^Strict comparison using \=\=\= between ' ' resource' ' \|' ' resource \(closed\)' ' and ' ' object' ' will always evaluate to false\.$#'
7789 identifier : identical.alwaysFalse
@@ -84,6 +96,12 @@ parameters:
8496 count : 1
8597 path : src/DatabaseDriver.php
8698
99+ -
100+ message : ' #^Strict comparison using \=\=\= between string and null will always evaluate to false\.$#'
101+ identifier : identical.alwaysFalse
102+ count : 1
103+ path : src/DatabaseDriver.php
104+
87105 -
88106 message : ' #^Unreachable statement \- code above always terminates\.$#'
89107 identifier : deadCode.unreachable
Original file line number Diff line number Diff line change @@ -504,8 +504,12 @@ public function __destruct()
504504 *
505505 * @since 2.0.0
506506 */
507- public function alterDbCharacterSet (string $ dbName )
507+ public function alterDbCharacterSet ($ dbName )
508508 {
509+ if ($ dbName === null || !is_string ($ dbName ) || $ dbName === '' ) {
510+ throw new \RuntimeException ('Database name must not be null and a non empty string. ' );
511+ }
512+
509513 $ this ->setQuery ($ this ->getAlterDbCharacterSet ($ dbName ));
510514
511515 return $ this ->execute ();
You can’t perform that action at this time.
0 commit comments