File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 26
26
namespace doganoo \PHPUtil \Storage ;
27
27
28
28
use doganoo \PHPUtil \Exception \InvalidCredentialsException ;
29
+ use doganoo \PHPUtil \Exception \PHPUtilException ;
29
30
use PDO ;
30
31
use PDOStatement ;
31
32
@@ -154,12 +155,13 @@ private function hasMinimumCredentials(): bool {
154
155
*
155
156
* @param string $sql
156
157
*
157
- * @return null|PDOStatement
158
+ * @return PDOStatement
159
+ * @throws PHPUtilException
158
160
*/
159
- public function prepare (string $ sql ): ? PDOStatement {
161
+ public function prepare (string $ sql ): PDOStatement {
160
162
$ statement = $ this ->getConnection ()->prepare ($ sql );
161
163
if ($ statement === false ) {
162
- return null ;
164
+ throw new PHPUtilException ( ' cout not prepare ' ) ;
163
165
}
164
166
$ this ->statement = $ statement ;
165
167
return $ statement ;
You can’t perform that action at this time.
0 commit comments