Skip to content

Commit

Permalink
#15343 - Fix level 6 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed May 2, 2021
1 parent c2e3d4d commit fd5a614
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 41 deletions.
4 changes: 2 additions & 2 deletions phalcon/Acl/Adapter/AdapterInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface AdapterInterface
/**
* Do a role inherit from another existing role
*/
public function addInherit(string roleName, roleToInherit) -> bool;
public function addInherit(string roleName, roleToInherits) -> bool;

/**
* Adds a role to the ACL list. Second parameter lets to inherit access data
Expand All @@ -35,7 +35,7 @@ interface AdapterInterface
* Access names can be a particular action, by example
* search, update, delete, etc or a list of them
*/
public function addComponent(componentObject, accessList) -> bool;
public function addComponent(componentValue, accessList) -> bool;

/**
* Adds access to components
Expand Down
5 changes: 4 additions & 1 deletion phalcon/Cli/Router/Route.zep
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,10 @@ class Route implements RouteInterface
/**
* Reconfigure the route adding a new pattern and a set of paths
*
* @param array|string paths
* @param string pattern
* @param array|string|null paths
*
* @return void
*/
public function reConfigure(string! pattern, paths = null) -> void
{
Expand Down
5 changes: 5 additions & 0 deletions phalcon/Cli/Router/RouteInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ interface RouteInterface

/**
* Reconfigure the route adding a new pattern and a set of paths
*
* @param string pattern
* @param array|string|null paths
*
* @return void
*/
public function reConfigure(string! pattern, var paths = null) -> void;

Expand Down
74 changes: 73 additions & 1 deletion phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,83 @@ class MemoryLogger extends AbstractLogger
*
* @return array
*/
public function getMessages()
public function getMessages() -> array
{
return this->messages;
}

/**
* @param string message
* @param mixed[] context
*/
public function emergency(var message, array context = [])
{
parent::emergency(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function alert(var message, array context = [])
{
parent::alert(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function critical(var message, array context = [])
{
parent::critical(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function error(var message, array context = [])
{
parent::error(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function warning(var message, array context = [])
{
parent::warning(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function notice(var message, array context = [])
{
parent::notice(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function info(var message, array context = [])
{
parent::info(message, context);
}

/**
* @param string message
* @param mixed[] context
*/
public function debug(var message, array context = [])
{
parent::debug(message, context);
}

/**
* Logs a message.
*
Expand Down
5 changes: 4 additions & 1 deletion phalcon/Forms/Element/ElementInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ interface ElementInterface
/**
* Adds a group of validators
*
* @param \Phalcon\Validation\ValidatorInterface[]
* @param \Phalcon\Validation\ValidatorInterface[] validators
* @param bool merge
*
* @return ElementInterface
*/
public function addValidators(array! validators, bool merge = true) -> <ElementInterface>;

Expand Down
6 changes: 3 additions & 3 deletions phalcon/Html/Helper/Script.zep
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ class Script extends Style
/**
* Returns the necessary attributes
*
* @param string $src
* @param string $href
* @param array $attributes
*
* @return array
*/
protected function getAttributes(string src, array attributes) -> array
protected function getAttributes(string href, array attributes) -> array
{
array required;

let required = [
"src" : src,
"src" : href,
"type" : "text/javascript"
];

Expand Down
107 changes: 85 additions & 22 deletions phalcon/Mvc/Micro/Collection.zep
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,36 @@ namespace Phalcon\Mvc\Micro;
*/
class Collection implements CollectionInterface
{
/**
* @var callable
*/
protected handler;

/**
* @var array
*/
protected handlers = [];

protected lazy;
/**
* @var bool
*/
protected lazy = false;

protected prefix;
/**
* @var string
*/
protected prefix = "";

/**
* Maps a route to a handler that only matches if the HTTP method is DELETE.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function delete(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function delete(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("DELETE", routePattern, handler, name);

Expand All @@ -54,9 +70,13 @@ class Collection implements CollectionInterface
/**
* Maps a route to a handler that only matches if the HTTP method is GET.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function get(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function get(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("GET", routePattern, handler, name);

Expand All @@ -65,6 +85,8 @@ class Collection implements CollectionInterface

/**
* Returns the main handler
*
* @return mixed
*/
public function getHandler() -> var
{
Expand All @@ -90,9 +112,13 @@ class Collection implements CollectionInterface
/**
* Maps a route to a handler that only matches if the HTTP method is HEAD.
*
* @param string routePattern
* @param callable|string handler
* @param string|null name
*
* @return CollectionInterface
*/
public function head(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function head(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("HEAD", routePattern, handler, name);

Expand All @@ -110,9 +136,13 @@ class Collection implements CollectionInterface
/**
* Maps a route to a handler.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function map(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function map(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap(null, routePattern, handler, name);

Expand All @@ -131,10 +161,14 @@ class Collection implements CollectionInterface
* );
* ```
*
* @param string routePattern
* @param callable handler
* @param string|array method
* @param string|null name
*
* @return CollectionInterface
*/
public function mapVia(string! routePattern, var handler, var method, string name = null) -> <CollectionInterface>
public function mapVia(string! routePattern, callable handler, var method, string name = null) -> <CollectionInterface>
{
this->addMap(method, routePattern, handler, name);

Expand All @@ -145,9 +179,13 @@ class Collection implements CollectionInterface
* Maps a route to a handler that only matches if the HTTP method is
* OPTIONS.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function options(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function options(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("OPTIONS", routePattern, handler, name);

Expand All @@ -157,9 +195,13 @@ class Collection implements CollectionInterface
/**
* Maps a route to a handler that only matches if the HTTP method is PATCH.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function patch(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function patch(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("PATCH", routePattern, handler, name);

Expand All @@ -169,9 +211,13 @@ class Collection implements CollectionInterface
/**
* Maps a route to a handler that only matches if the HTTP method is POST.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function post(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function post(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("POST", routePattern, handler, name);

Expand All @@ -181,9 +227,13 @@ class Collection implements CollectionInterface
/**
* Maps a route to a handler that only matches if the HTTP method is PUT.
*
* @param callable|string handler
* @param string routePattern
* @param callable handler
* @param string|null name
*
* @return CollectionInterface
*/
public function put(string! routePattern, var handler, string name = null) -> <CollectionInterface>
public function put(string! routePattern, callable handler, string name = null) -> <CollectionInterface>
{
this->addMap("PUT", routePattern, handler, name);

Expand All @@ -193,7 +243,10 @@ class Collection implements CollectionInterface
/**
* Sets the main handler.
*
* @param callable|string handler
* @param mixed handler
* @param bool lazy
*
* @return CollectionInterface
*/
public function setHandler(var handler, bool lazy = false) -> <CollectionInterface>
{
Expand All @@ -205,6 +258,10 @@ class Collection implements CollectionInterface

/**
* Sets if the main handler must be lazy loaded
*
* @param bool lazy
*
* @return CollectionInterface
*/
public function setLazy(bool! lazy) -> <CollectionInterface>
{
Expand All @@ -215,6 +272,10 @@ class Collection implements CollectionInterface

/**
* Sets a prefix for all routes added to the collection
*
* @param string prefix
*
* @return CollectionInterface
*/
public function setPrefix(string! prefix) -> <CollectionInterface>
{
Expand All @@ -226,10 +287,12 @@ class Collection implements CollectionInterface
/**
* Internal function to add a handler to the group.
*
* @param string|array method
* @param callable|string handler
* @param string|array method
* @param string routePattern
* @param callable handler
* @param string name
*/
protected function addMap(var method, string! routePattern, var handler, string name)
protected function addMap(var method, string! routePattern, callable handler, string name) -> void
{
let this->handlers[] = [method, routePattern, handler, name];
}
Expand Down
5 changes: 5 additions & 0 deletions phalcon/Mvc/Micro/CollectionInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ interface CollectionInterface

/**
* Sets the main handler
*
* @param mixed handler
* @param bool lazy
*
* @return CollectionInterface
*/
public function setHandler(var handler, bool lazy = false) -> <CollectionInterface>;

Expand Down
Loading

0 comments on commit fd5a614

Please sign in to comment.