Skip to content

Commit

Permalink
Merge pull request #12084 from sergeyklay/3.0.x
Browse files Browse the repository at this point in the history
Resource implements ResourceInterface
  • Loading branch information
sergeyklay authored Aug 3, 2016
2 parents ff5c4bb + 347277a commit b51084e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [3.0.1](https://github.com/phalcon/cphalcon/releases/tag/v3.0.1) (2016-XX-XX)
- Fixed `Phalcon\Cache\Backend\Redis::flush` in order to flush cache correctly
- Fixed `Phalcon\Mvc\Model\Manager::getRelationRecords` to correct using multi relation column [#12035](https://github.com/phalcon/cphalcon/issues/12035)
- Fixed `Phalcon\Acl\Resource`. Now it implements `Phalcon\Acl\ResourceInterface` [#11959](https://github.com/phalcon/cphalcon/issues/11959)

# [3.0.0](https://github.com/phalcon/cphalcon/releases/tag/v3.0.0) (2016-07-29)
- PHP 5.3 and 5.4 are now fully deprecated
Expand Down
2 changes: 1 addition & 1 deletion phalcon/acl/adapter.zep
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (https://phalconphp.com) |
| Copyright (c) 2011-2016 Phalcon Team (https://phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
Expand Down
12 changes: 7 additions & 5 deletions phalcon/acl/adapter/memory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (https://phalconphp.com) |
| Copyright (c) 2011-2016 Phalcon Team (https://phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
Expand All @@ -28,6 +28,8 @@ use Phalcon\Acl\Exception;
use Phalcon\Events\Manager as EventsManager;
use Phalcon\Acl\RoleAware;
use Phalcon\Acl\ResourceAware;
use Phalcon\Acl\RoleInterface;
use Phalcon\Acl\ResourceInterface;

/**
* Phalcon\Acl\Adapter\Memory
Expand Down Expand Up @@ -700,7 +702,7 @@ class Memory extends Adapter
// We dont have any parameters so check default action
if count(parametersForFunction) == 0 {
if numberOfRequiredParameters > 0 {
trigger_error("You didnt provide any parameters when check ".roleName." can ".access." " .resourceName.". We will use default action when no arguments.");
trigger_error("You didn't provide any parameters when check ".roleName." can ".access." " .resourceName.". We will use default action when no arguments.");
return (haveAccess == Acl::ALLOW) && (this->_noArgumentsDefaultAction == Acl::ALLOW);
}
// Number of required parameters == 0 so call funcAccess without any arguments
Expand All @@ -712,7 +714,7 @@ class Memory extends Adapter
}
// We dont have enough parameters
else {
throw new Exception("You didnt provide all necessary parameters for defined function when check ".roleName." can ".access." ".resourceName);
throw new Exception("You didn't provide all necessary parameters for defined function when check ".roleName." can ".access." ".resourceName);
}
}
}
Expand All @@ -738,15 +740,15 @@ class Memory extends Adapter
/**
* Return an array with every role registered in the list
*/
public function getRoles() -> <Role[]>
public function getRoles() -> <RoleInterface[]>
{
return this->_roles;
}

/**
* Return an array with every resource registered in the list
*/
public function getResources() -> <$Resource[]>
public function getResources() -> <ResourceInterface[]>
{
return this->_resources;
}
Expand Down
4 changes: 2 additions & 2 deletions phalcon/acl/resource.zep
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (https://phalconphp.com) |
| Copyright (c) 2011-2016 Phalcon Team (https://phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
Expand All @@ -26,7 +26,7 @@ use Phalcon\Acl\Exception;
*
* This class defines resource entity and its description
*/
class $Resource
class $Resource implements ResourceInterface
{

/**
Expand Down

0 comments on commit b51084e

Please sign in to comment.