33class MySQLCommand
44{
55
6- private MySQLConnection $ fMySQLConnection ; // MySQLConnection of this command
7- private String $ fQuery ; // Query to execute
8- private $ fPreparedStatement = NULL ; // The prepared statement of this command
9- public MySQLCommandParameters $ Parameters ; // Command parameters
6+ private MySQLConnection $ fMySQLConnection ; // MySQLConnection of this command
7+ private String $ fQuery ; // Query to execute
8+ private $ fPreparedStatement = NULL ; // The prepared statement of this command
9+ public MySQLCommandParameters $ Parameters ; // Command parameters
1010
1111 /**
1212 * Constructs a new MySQLCommand
@@ -24,7 +24,7 @@ public function __construct(MySQLConnection $mySQLConnection, String $query = ""
2424 * Execute query and return the number of affected rows.
2525 * @return the number of affected rows.
2626 */
27- public function ExecuteQuery ()
27+ public function ExecuteQuery (): int
2828 {
2929 if (sizeof ($ this ->Parameters ->getParameters ()) > 0 ) // Query with parameters (Prepared Statement)
3030 {
@@ -67,7 +67,7 @@ public function ExecuteQuery()
6767 * Returns MySQLDataReader
6868 * @return MySQLDataReader
6969 */
70- public function ExecuteReader ()
70+ public function ExecuteReader (): MySQLDataReader
7171 {
7272 $ this ->fPreparedStatement = NULL ;
7373
@@ -110,7 +110,7 @@ public function ExecuteReader()
110110 * $query: is the query to set
111111 * @param type $query
112112 */
113- public function setQuery ($ query )
113+ public function setQuery ($ query ): void
114114 {
115115 $ this ->fQuery = $ query ;
116116 }
@@ -119,7 +119,7 @@ public function setQuery($query)
119119 * Return's the query been given to this command
120120 * @return string the command's query
121121 */
122- public function getQuery ()
122+ public function getQuery (): string
123123 {
124124 return $ this ->fQuery ;
125125 }
@@ -128,7 +128,7 @@ public function getQuery()
128128 * Returns the MySQLConnection of this MySQLCommand
129129 * @return type MySQLConnection
130130 */
131- public function getMySQLConnection ()
131+ public function getMySQLConnection (): MySQLConnection
132132 {
133133 return $ this ->fMySQLConnection ;
134134 }
@@ -137,7 +137,7 @@ public function getMySQLConnection()
137137 * Return's the last inserted ID
138138 * @return type
139139 */
140- public function getLastInsertID ()
140+ public function getLastInsertID (): int
141141 {
142142 return $ this ->fMySQLConnection ->getLink ()->insert_id ;
143143 }
@@ -147,7 +147,7 @@ public function getLastInsertID()
147147 * This method should be called every time before query execution.
148148 * @return type
149149 */
150- private function BindParametersToQuery ()
150+ private function BindParametersToQuery (): void
151151 {
152152 $ parameterTypes = "" ;
153153 $ ar = array ();
@@ -168,4 +168,4 @@ private function BindParametersToQuery()
168168
169169}
170170
171- ?>
171+ ?>
0 commit comments