Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed documentation to methods that use func_get_args().

  • Loading branch information...
commit f7f3515135745b86911b227347d7adb6c350fe49 1 parent e939098
@jrbasso jrbasso authored
View
12 lib/Cake/Controller/Component/AuthComponent.php
@@ -427,13 +427,11 @@ public function constructAuthorize() {
*
* `$this->Auth->allow('*');`
*
- * @param mixed $action Controller action name or array of actions
- * @param string $action Controller action name
- * @param string ... etc.
+ * @param mixed $action,... Controller action name or array of actions
* @return void
* @link http://book.cakephp.org/view/1257/allow
*/
- public function allow() {
+ public function allow($action) {
@ceeram Collaborator
ceeram added a note

defining $action as param, makes it required, while you should be abe to call just allow() without arguments:

if (empty($args) || $args == array('*')) {

it will allow all methods, i dont know why the test passes for this, will check why it doesnt fail here

@jrbasso Collaborator
jrbasso added a note

Ow! It is true. I will fix it right now. Sorry by my fault.

@ADmad Collaborator
ADmad added a note

The doc block should also be updated that the function can take a string '*' as param.

@ADmad Collaborator
ADmad added a note

nvm it already does mention that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
$args = func_get_args();
if (empty($args) || $args == array('*')) {
$this->allowedActions = $this->_methods;
@@ -453,14 +451,12 @@ public function allow() {
* `$this->Auth->deny(array('edit', 'add'));` or
* `$this->Auth->deny('edit', 'add');`
*
- * @param mixed $action Controller action name or array of actions
- * @param string $action Controller action name
- * @param string ... etc.
+ * @param mixed $action,... Controller action name or array of actions
* @return void
* @see AuthComponent::allow()
* @link http://book.cakephp.org/view/1258/deny
*/
- public function deny() {
+ public function deny($action) {
$args = func_get_args();
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
View
4 lib/Cake/Model/Model.php
@@ -2831,11 +2831,11 @@ public function isUnique($fields, $or = true) {
/**
* Returns a resultset for a given SQL statement. Custom SQL queries should be performed with this method.
*
- * @param string $sql SQL statement
+ * @param string $sql,... SQL statement
* @return array Resultset
* @link http://book.cakephp.org/view/1027/query
*/
- public function query() {
+ public function query($sql) {
$params = func_get_args();
$db = $this->getDataSource();
return call_user_func_array(array(&$db, 'query'), $params);
View
3  lib/Cake/Network/CakeRequest.php
@@ -667,8 +667,7 @@ public static function acceptLanguage($language = null) {
* You can write to any value, even paths/keys that do not exist, and the arrays
* will be created for you.
*
- * @param string $name Dot separated name of the value to read/write
- * @param mixed $value Value to write to the data array.
+ * @param string $name,... Dot separated name of the value to read/write
* @return mixed Either the value being read, or this so you can chain consecutive writes.
*/
public function data($name) {
View
6 lib/Cake/Utility/Sanitize.php
@@ -169,13 +169,11 @@ public static function stripAll($str) {
*
* Will remove all `<b>`, `<p>`, and `<div>` tags from the $dirty string.
*
- * @param string $str String to sanitize
- * @param string $tag Tag to remove (add more parameters as needed)
+ * @param string $str,... String to sanitize
* @return string sanitized String
*/
- public static function stripTags() {
+ public static function stripTags($str) {
$params = func_get_args();
- $str = $params[0];
for ($i = 1, $count = count($params); $i < $count; $i++) {
$str = preg_replace('/<' . $params[$i] . '\b[^>]*>/i', '', $str);
Please sign in to comment.
Something went wrong with that request. Please try again.