diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index 820cf43ab..2f673c2b4 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -355,7 +355,7 @@ class SecurityComponent extends Component { * Check if HTTP methods are required * * @param Controller $controller Instantiating controller - * @return bool|null True if $method is required + * @return bool True if $method is required */ protected function _methodsRequired(Controller $controller) { foreach (array('Post', 'Get', 'Put', 'Delete') as $method) { @@ -365,7 +365,7 @@ class SecurityComponent extends Component { if (in_array($this->_action, $require) || $this->$property === array('*')) { if (!$this->request->is($method)) { if (!$this->blackHole($controller, $method)) { - return null; + return false; } } } @@ -378,7 +378,7 @@ class SecurityComponent extends Component { * Check if access requires secure connection * * @param Controller $controller Instantiating controller - * @return bool|null True if secure connection required + * @return bool True if secure connection required */ protected function _secureRequired(Controller $controller) { if (is_array($this->requireSecure) && !empty($this->requireSecure)) { @@ -387,7 +387,7 @@ class SecurityComponent extends Component { if (in_array($this->_action, $requireSecure) || $this->requireSecure === array('*')) { if (!$this->request->is('ssl')) { if (!$this->blackHole($controller, 'secure')) { - return null; + return false; } } } diff --git a/lib/Cake/I18n/Multibyte.php b/lib/Cake/I18n/Multibyte.php index 61c5175a1..9568065b5 100644 --- a/lib/Cake/I18n/Multibyte.php +++ b/lib/Cake/I18n/Multibyte.php @@ -824,14 +824,14 @@ class Multibyte { * * @param int $char decimal value of character * @param string $type Type 'lower' or 'upper'. Defaults to 'lower'. - * @return array|null + * @return array */ protected static function _find($char, $type = 'lower') { $found = array(); if (!isset(self::$_codeRange[$char])) { $range = self::_codepoint($char); if ($range === false) { - return null; + return array(); } if (!Configure::configured('_cake_core_')) { App::uses('PhpReader', 'Configure'); @@ -843,7 +843,7 @@ class Multibyte { } if (!self::$_codeRange[$char]) { - return null; + return array(); } self::$_table = self::$_codeRange[$char]; $count = count(self::$_caseFold[self::$_table]); diff --git a/lib/Cake/Model/Behavior/AclBehavior.php b/lib/Cake/Model/Behavior/AclBehavior.php index 381e6ae8a..2971979c1 100644 --- a/lib/Cake/Model/Behavior/AclBehavior.php +++ b/lib/Cake/Model/Behavior/AclBehavior.php @@ -73,7 +73,7 @@ class AclBehavior extends ModelBehavior { * @param Model $model Model using this behavior. * @param string|array|Model $ref Array with 'model' and 'foreign_key', model object, or string value * @param string $type Only needed when Acl is set up as 'both', specify 'Aro' or 'Aco' to get the correct node - * @return array|null + * @return array * @link http://book.cakephp.org/2.0/en/core-libraries/behaviors/acl.html#node */ public function node(Model $model, $ref = null, $type = null) { @@ -81,7 +81,7 @@ class AclBehavior extends ModelBehavior { $type = $this->_typeMaps[$this->settings[$model->name]['type']]; if (is_array($type)) { trigger_error(__d('cake_dev', 'AclBehavior is setup with more then one type, please specify type parameter for node()'), E_USER_WARNING); - return null; + return array(); } } if (empty($ref)) { diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index 3bd0991ea..ed53875c8 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -443,7 +443,7 @@ class TreeBehavior extends ModelBehavior { * @param int|string $id The ID of the record to read * @param string|array $fields Either a single string of a field name, or an array of field names * @param int $recursive The number of levels deep to fetch associated records - * @return array|null Array of nodes from top most parent to current node + * @return array Array of nodes from top most parent to current node * @link http://book.cakephp.org/2.0/en/core-libraries/behaviors/tree.html#TreeBehavior::getPath */ public function getPath(Model $Model, $id = null, $fields = null, $recursive = null) { @@ -462,7 +462,7 @@ class TreeBehavior extends ModelBehavior { if ($result) { $result = array_values($result); } else { - return null; + return array(); } $item = $result[0]; $results = $Model->find('all', array( diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index 55a07ee77..2602c0639 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -731,7 +731,7 @@ class Router { * * @param string $name Parameter name * @param bool $current Current parameter, useful when using requestAction - * @return string Parameter value + * @return string|null Parameter value */ public static function getParam($name = 'controller', $current = false) { $params = Router::getParams($current); diff --git a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php index eb574b63e..4e244b45b 100644 --- a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php @@ -2731,9 +2731,9 @@ class PaginatorHelperTest extends CakeTestCase { 'paramType' => 'named', ) ); - $this->assertFalse($this->Paginator->numbers()); - $this->assertFalse($this->Paginator->first()); - $this->assertFalse($this->Paginator->last()); + $this->assertSame('', $this->Paginator->numbers()); + $this->assertSame('', $this->Paginator->first()); + $this->assertSame('', $this->Paginator->last()); } /** diff --git a/lib/Cake/Utility/Folder.php b/lib/Cake/Utility/Folder.php index 3d2558fbc..088723cb2 100644 --- a/lib/Cake/Utility/Folder.php +++ b/lib/Cake/Utility/Folder.php @@ -604,7 +604,7 @@ class Folder { $path = $this->pwd(); } if (!$path) { - return null; + return false; } $path = Folder::slashTerm($path); if (is_dir($path)) { diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 3db36d361..fc07c582d 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -696,7 +696,7 @@ class FormHelper extends AppHelper { * @param string|array $text Error message as string or array of messages. * If array contains `attributes` key it will be used as options for error container * @param array $options Rendering options for
wrapper tag - * @return string If there are errors this method returns an error message, otherwise null. + * @return string|null If there are errors this method returns an error message, otherwise null. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::error */ public function error($field, $text = null, $options = array()) { diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php index b1c36a0ee..cd808f73a 100644 --- a/lib/Cake/View/Helper/PaginatorHelper.php +++ b/lib/Cake/View/Helper/PaginatorHelper.php @@ -481,7 +481,7 @@ class PaginatorHelper extends AppHelper { * @param array $options Options list. * @param string $disabledTitle Disabled link title. * @param array $disabledOptions Disabled link options. - * @return string|null + * @return string */ protected function _pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) { $check = 'has' . $which; @@ -501,7 +501,7 @@ class PaginatorHelper extends AppHelper { } $options = (array)$disabledOptions + $_defaults; } elseif (!$this->{$check}($options['model'])) { - return null; + return ''; } foreach (array_keys($_defaults) as $key) { @@ -707,7 +707,7 @@ class PaginatorHelper extends AppHelper { * - `currentTag` Tag to use for current page number, defaults to null * * @param array $options Options for the numbers, (before, after, model, modulus, separator) - * @return string|bool numbers string. + * @return string Numbers string. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::numbers */ public function numbers($options = array()) { @@ -728,7 +728,7 @@ class PaginatorHelper extends AppHelper { unset($options['model']); if ($params['pageCount'] <= 1) { - return false; + return ''; } extract($options); @@ -849,7 +849,7 @@ class PaginatorHelper extends AppHelper { * @param string|int $first if string use as label for the link. If numeric, the number of page links * you want at the beginning of the range. * @param array $options An array of options. - * @return string|bool numbers string. + * @return string Numbers string. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::first */ public function first($first = '<< first', $options = array()) { @@ -866,7 +866,7 @@ class PaginatorHelper extends AppHelper { unset($options['model']); if ($params['pageCount'] <= 1) { - return false; + return ''; } extract($options); unset($options['tag'], $options['after'], $options['model'], $options['separator'], $options['ellipsis'], $options['class']); @@ -912,7 +912,7 @@ class PaginatorHelper extends AppHelper { * * @param string|int $last if string use as label for the link, if numeric print page numbers * @param array $options Array of options - * @return string|bool numbers string. + * @return string Numbers string. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::last */ public function last($last = 'last >>', $options = array()) { @@ -929,7 +929,7 @@ class PaginatorHelper extends AppHelper { unset($options['model']); if ($params['pageCount'] <= 1) { - return false; + return ''; } extract($options); @@ -976,7 +976,7 @@ class PaginatorHelper extends AppHelper { * - `block` The block name to append the output to, or false/absenst to return as a string * * @param array $options Array of options - * @return string|null Meta links + * @return string|void Meta links */ public function meta($options = array()) { $model = isset($options['model']) ? $options['model'] : null;