Add \PDOStatement methods as PHPDoc methods to PreparedStatement
authorMatthias Schmidt <gravatronics@live.com>
Sat, 7 May 2016 15:48:53 +0000 (17:48 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 7 May 2016 15:48:53 +0000 (17:48 +0200)
wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php

index c60e9422e31bea8eda479116b15970546245eea0..9be0d7ce3e863117121c966892edbdb337c31927 100644 (file)
@@ -12,16 +12,20 @@ use wcf\system\WCF;
  * Represents a prepared statements based upon pdo statements.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.database.statement
  * @category   Community Framework
+ * 
+ * @method     boolean         closeCursor()
+ * @method     mixed           fetch($fetch_style, $cursor_orientation = \PDO::FETCH_ORI_NEXT, $cursor_offset = 0)
+ * @method     mixed           fetchColumn($column_number = 0)
  */
 class PreparedStatement {
        /**
         * database object
-        * @var \wcf\system\database\Database
+        * @var Database
         */
        protected $database = null;
        
@@ -29,7 +33,7 @@ class PreparedStatement {
         * SQL query parameters
         * @var array
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * pdo statement object
@@ -46,9 +50,9 @@ class PreparedStatement {
        /**
         * Creates a new PreparedStatement object.
         * 
-        * @param       \wcf\system\database\Database   $database
-        * @param       \PDOStatement                   $pdoStatement
-        * @param       string                          $query          SQL query
+        * @param       Database        $database
+        * @param       \PDOStatement   $pdoStatement
+        * @param       string          $query          SQL query
         */
        public function __construct(Database $database, \PDOStatement $pdoStatement, $query = '') {
                $this->database = $database;
@@ -70,7 +74,7 @@ class PreparedStatement {
                }
                
                try {
-                       return call_user_func_array(array($this->pdoStatement, $name), $arguments);
+                       return call_user_func_array([$this->pdoStatement, $name], $arguments);
                }
                catch (\PDOException $e) {
                        throw new DatabaseQueryException("Could call '".$name."' on '".$this->query."'", $e);
@@ -83,7 +87,7 @@ class PreparedStatement {
         * @param       array           $parameters
         * @throws      DatabaseQueryExecutionException
         */
-       public function execute(array $parameters = array()) {
+       public function execute(array $parameters = []) {
                $this->parameters = $parameters;
                $this->database->incrementQueryCount();
                
@@ -177,7 +181,7 @@ class PreparedStatement {
         * @return      DatabaseObject[]
         */
        public function fetchObjects($className) {
-               $objects = array();
+               $objects = [];
                while ($object = $this->fetchObject($className)) {
                        $objects[] = $object;
                }