Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed the signature of methods to avoid strict messages.

  • Loading branch information...
commit e4a18165576273f5912a1fdad3df0a65044b8dab 1 parent 39b4032
Juan Basso jrbasso authored
2  lib/Cake/Cache/Engine/XcacheEngine.php
View
@@ -45,7 +45,7 @@ class XcacheEngine extends CacheEngine {
* @param array $settings array of setting for the engine
* @return boolean True if the engine has been successfully initialized, false if not
*/
- public function init($settings) {
+ public function init($settings = array()) {
parent::init(array_merge(array(
'engine' => 'Xcache',
'prefix' => Inflector::slug(APP_DIR) . '_',
2  lib/Cake/Core/App.php
View
@@ -682,7 +682,7 @@ public static function import($type = null, $name = null, $parent = true, $searc
* @param boolean $parent whether to load the class parent or not
* @return boolean true indicating the successful load and existence of the class
*/
- private function _loadClass($name, $plugin, $type, $originalType, $parent) {
+ private static function _loadClass($name, $plugin, $type, $originalType, $parent) {
if ($type == 'Console/Command' && $name == 'Shell') {
$type = 'Console';
} else if (isset(self::$types[$originalType]['suffix'])) {
6 lib/Cake/Model/Datasource/Database/Mysql.php
View
@@ -292,7 +292,7 @@ public function getCharsetName($name) {
* @param Model $model Name of database table to inspect or model instance
* @return array Fields in table. Keys are name and type
*/
- public function describe($model) {
+ public function describe(Model $model) {
$cache = parent::describe($model);
if ($cache != null) {
return $cache;
@@ -339,7 +339,7 @@ public function describe($model) {
* @param mixed $conditions
* @return array
*/
- public function update($model, $fields = array(), $values = null, $conditions = null) {
+ public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
if (!$this->_useAlias) {
return parent::update($model, $fields, $values, $conditions);
}
@@ -381,7 +381,7 @@ public function update($model, $fields = array(), $values = null, $conditions =
* @param mixed $conditions
* @return boolean Success
*/
- public function delete($model, $conditions = null) {
+ public function delete(Model $model, $conditions = null) {
if (!$this->_useAlias) {
return parent::delete($model, $conditions);
}
24 lib/Cake/Model/Datasource/Database/Oracle.php
View
@@ -319,9 +319,10 @@ public function limit($limit = -1, $offset = 0) {
* Returns number of rows in previous resultset. If no previous resultset exists,
* this returns false.
*
+ * @param mixed $source
* @return integer Number of rows in resultset
*/
- public function lastNumRows() {
+ public function lastNumRows($source = null) {
return $this->_numRows;
}
@@ -329,9 +330,11 @@ public function lastNumRows() {
* Executes given SQL statement. This is an overloaded method.
*
* @param string $sql SQL statement
+ * @param array $params list of params to be bound to query
+ * @param array $prepareOptions Options to be used in the prepare statement
* @return resource Result resource identifier or null
*/
- protected function _execute($sql) {
+ protected function _execute($sql, $params = array(), $prepareOptions = array()) {
$this->_statementId = @ociparse($this->connection, $sql);
if (!$this->_statementId) {
$this->_setError($this->connection);
@@ -375,10 +378,10 @@ protected function _execute($sql) {
/**
* Fetch result row
*
+ * @param string $sql
* @return array
- * @access public
*/
- public function fetchRow() {
+ public function fetchRow($sql = null) {
if ($this->_currentRow >= $this->_numRows) {
ocifreestatement($this->_statementId);
$this->_map = null;
@@ -452,9 +455,10 @@ public function createTrigger($table) {
* Returns an array of tables in the database. If there are no tables, an error is
* raised and the application exits.
*
+ * @param mixed $source
* @return array tablenames in the database
*/
- public function listSources() {
+ public function listSources($source = null) {
$cache = parent::listSources();
if ($cache != null) {
return $cache;
@@ -479,7 +483,7 @@ public function listSources() {
* @param Model $model instance of a model to inspect
* @return array Fields in table. Keys are name and type
*/
- public function describe($model) {
+ public function describe(Model $model) {
$table = $this->fullTableName($model, false);
if (!empty($model->sequence)) {
@@ -885,7 +889,7 @@ public function value($data, $column = null) {
* @param string $source
* @return integer|boolean
*/
- public function lastInsertId($source) {
+ public function lastInsertId($source = null) {
$sequence = $this->_sequenceMap[$source];
$sql = "SELECT $sequence.currval FROM dual";
@@ -902,18 +906,20 @@ public function lastInsertId($source) {
/**
* Returns a formatted error message from previous database operation.
*
+ * @param PDOStatement $query the query to extract the error from if any
* @return string Error message with error number
*/
- public function lastError() {
+ public function lastError(PDOStatement $query = null) {
return $this->_error;
}
/**
* Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.
*
+ * @param mixed $source
* @return int Number of affected rows
*/
- public function lastAffected() {
+ public function lastAffected($source = null) {
return $this->_statementId ? ocirowcount($this->_statementId): false;
}
4 lib/Cake/Model/Datasource/Database/Postgres.php
View
@@ -185,7 +185,7 @@ public function listSources($data = null) {
* @param Model $model Name of database table to inspect
* @return array Fields in table. Keys are name and type
*/
- public function describe($model) {
+ public function describe(Model $model) {
$fields = parent::describe($model);
$table = $this->fullTableName($model, false);
$this->_sequenceMap[$table] = array();
@@ -267,7 +267,7 @@ public function describe($model) {
* @param string $field Name of the ID database field. Defaults to "id"
* @return integer
*/
- public function lastInsertId($source, $field = 'id') {
+ public function lastInsertId($source = null, $field = 'id') {
$seq = $this->getSequence($source, $field);
return $this->_connection->lastInsertId($seq);
}
4 lib/Cake/Model/Datasource/Database/Sqlite.php
View
@@ -162,7 +162,7 @@ public function listSources($data = null) {
* @param Model $model
* @return array Fields in table. Keys are name and type
*/
- public function describe($model) {
+ public function describe(Model $model) {
$cache = parent::describe($model);
if ($cache != null) {
return $cache;
@@ -204,7 +204,7 @@ public function describe($model) {
* @return array
* @access public
*/
- public function update($model, $fields = array(), $values = null, $conditions = null) {
+ public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
if (empty($values) && !empty($fields)) {
foreach ($fields as $field => $value) {
if (strpos($field, $model->alias . '.') !== false) {
14 lib/Cake/Model/Datasource/Database/Sqlserver.php
View
@@ -169,9 +169,10 @@ public function enabled() {
/**
* Returns an array of sources (tables) in the database.
*
+ * @param mixed $data
* @return array Array of tablenames in the database
*/
- public function listSources() {
+ public function listSources($data = null) {
$cache = parent::listSources();
if ($cache !== null) {
return $cache;
@@ -200,7 +201,7 @@ public function listSources() {
* @param Model $model Model object to describe
* @return array Fields in table. Keys are name and type
*/
- public function describe($model) {
+ public function describe(Model $model) {
$cache = parent::describe($model);
if ($cache != null) {
return $cache;
@@ -330,7 +331,7 @@ public function fields($model, $alias = null, $fields = array(), $quote = true)
* @param array $values
* @return array
*/
- public function create($model, $fields = null, $values = null) {
+ public function create(Model $model, $fields = null, $values = null) {
if (!empty($values)) {
$fields = array_combine($fields, $values);
}
@@ -360,7 +361,7 @@ public function create($model, $fields = null, $values = null) {
* @param mixed $conditions
* @return array
*/
- public function update($model, $fields = array(), $values = null, $conditions = null) {
+ public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
if (!empty($values)) {
$fields = array_combine($fields, $values);
}
@@ -595,7 +596,7 @@ public function value($data, $column = null) {
* @param integer $recursive
* @return array Array of resultset rows, or false if no rows matched
*/
- public function read($model, $queryData = array(), $recursive = null) {
+ public function read(Model $model, $queryData = array(), $recursive = null) {
$results = parent::read($model, $queryData, $recursive);
$this->_fieldMappings = array();
return $results;
@@ -733,9 +734,10 @@ protected function _getPrimaryKey($model) {
* Returns number of affected rows in previous database operation. If no previous operation exists,
* this returns false.
*
+ * @param mixed $source
* @return integer Number of affected rows
*/
- public function lastAffected() {
+ public function lastAffected($source = null) {
$affected = parent::lastAffected();
if ($affected === null && $this->_lastAffected !== false) {
return $this->_lastAffected;
16 lib/Cake/Model/Datasource/DboSource.php
View
@@ -503,9 +503,10 @@ public function lastError(PDOStatement $query = null) {
* Returns number of affected rows in previous database operation. If no previous operation exists,
* this returns false.
*
+ * @param mixed $source
* @return integer Number of affected rows
*/
- public function lastAffected() {
+ public function lastAffected($source = null) {
if ($this->hasResult()) {
return $this->_result->rowCount();
}
@@ -516,9 +517,10 @@ public function lastAffected() {
* Returns number of rows in previous resultset. If no previous resultset exists,
* this returns false.
*
+ * @param mixed $source Not used
* @return integer Number of rows in resultset
*/
- public function lastNumRows() {
+ public function lastNumRows($source = null) {
return $this->lastAffected();
}
@@ -990,7 +992,7 @@ public function fullTableName($model, $quote = true) {
* be used to generate values.
* @return boolean Success
*/
- public function create($model, $fields = null, $values = null) {
+ public function create(Model $model, $fields = null, $values = null) {
$id = null;
if ($fields == null) {
@@ -1037,7 +1039,7 @@ public function create($model, $fields = null, $values = null) {
* @param integer $recursive Number of levels of association
* @return mixed boolean false on error/failure. An array of results on success.
*/
- public function read($model, $queryData = array(), $recursive = null) {
+ public function read(Model $model, $queryData = array(), $recursive = null) {
$queryData = $this->__scrubQueryData($queryData);
$null = null;
@@ -1809,7 +1811,7 @@ private function __mergeConditions($query, $assoc) {
* @param mixed $conditions
* @return boolean Success
*/
- public function update($model, $fields = array(), $values = null, $conditions = null) {
+ public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
if ($values == null) {
$combined = $fields;
} else {
@@ -1886,7 +1888,7 @@ protected function _prepareUpdateFields($model, $fields, $quoteValues = true, $a
* @param mixed $conditions
* @return boolean Success
*/
- public function delete($model, $conditions = null) {
+ public function delete(Model $model, $conditions = null) {
$alias = $joins = null;
$table = $this->fullTableName($model);
$conditions = $this->_matchRecords($model, $conditions);
@@ -2131,7 +2133,7 @@ public function defaultConditions($model, $conditions, $useAlias = true) {
* @param string $assoc
* @return string
*/
- public function resolveKey($model, $key, $assoc = null) {
+ public function resolveKey(Model $model, $key, $assoc = null) {
if (empty($assoc)) {
$assoc = $model->alias;
}
4 lib/Cake/View/MediaView.php
View
@@ -86,9 +86,11 @@ public function __construct($controller = null) {
/**
* Display or download the given file
*
+ * @param string $view Not used
+ * @param string $layout Not used
* @return mixed
*/
- public function render() {
+ public function render($view = null, $layout = null) {
$name = $download = $extension = $id = $modified = $path = $cache = $mimeType = $compress = null;
extract($this->viewVars, EXTR_OVERWRITE);
Please sign in to comment.
Something went wrong with that request. Please try again.