Permalink
Browse files

Fixed documentation to methods that use func_get_args().

  • Loading branch information...
1 parent e939098 commit f7f3515135745b86911b227347d7adb6c350fe49 @jrbasso jrbasso committed Aug 22, 2011
@@ -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

ceeram Aug 30, 2011

Member

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

jrbasso Aug 31, 2011

Member

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

@ADmad

ADmad Aug 31, 2011

Member

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

@ADmad

ADmad Aug 31, 2011

Member

nvm it already does mention that

$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
@@ -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);
@@ -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) {
@@ -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);

0 comments on commit f7f3515

Please sign in to comment.