@@ -51,7 +51,7 @@ public function __construct(array $options)
5151 /**
5252 * @inheritDoc
5353 */
54- public function destroy ($ id )
54+ public function destroy (string $ id ): bool
5555 {
5656 try {
5757 $ arguments = [
@@ -64,7 +64,7 @@ public function destroy($id)
6464 }
6565
6666 $ stmt = $ this ->query ($ sql , $ arguments );
67- return $ stmt !== FALSE && $ stmt ->rowCount () > 0 ;
67+ return $ stmt !== false && $ stmt ->rowCount () > 0 ;
6868 } catch (\Exception $ e ) {
6969 return false ;
7070 }
@@ -73,7 +73,7 @@ public function destroy($id)
7373 /**
7474 * @inheritDoc
7575 */
76- public function read ($ id )
76+ public function read (string $ id ): string | false
7777 {
7878 try {
7979 $ arguments = [
@@ -86,7 +86,7 @@ public function read($id)
8686 }
8787 $ sql .= " LIMIT 0, 1 " ;
8888 $ stmt = $ this ->query ($ sql , $ arguments );
89- if ($ stmt === FALSE ) {
89+ if ($ stmt === false ) {
9090 return false ;
9191 }
9292 if ($ stmt ->rowCount () < 1 ) {
@@ -102,7 +102,7 @@ public function read($id)
102102 /**
103103 * @inheritDoc
104104 */
105- public function write ($ id , $ data )
105+ public function write (string $ id , string $ data ): bool
106106 {
107107 try {
108108 $ stmt = $ this ->query ("REPLACE INTO " . $ this ->table . " (id, sess_timestamp, sess_ip_address, sess_data) VALUES (:sess_id, :sess_data, :sess_timestamp, :ip_address); " , [
@@ -112,13 +112,13 @@ public function write($id, $data)
112112 ':ip_address ' => $ this ->getIP (),
113113 ]);
114114
115- return $ stmt !== FALSE && $ stmt ->rowCount () > 0 ;
115+ return $ stmt !== false && $ stmt ->rowCount () > 0 ;
116116 } catch (\Exception $ e ) {
117117 return false ;
118118 }
119119 }
120120
121- private function query (string $ query , ?array $ arguments = null )
121+ private function query (string $ query , ?array $ arguments = null ): bool | \ PDOStatement
122122 {
123123 $ stmt = $ this ->pdo ->prepare ($ query );
124124 if ($ stmt === FALSE ) {
0 commit comments