Skip to content

Commit fec9c14

Browse files
committed
Merge pull request #14 from bravo-kernel/cleanup
Cleanup
2 parents 9770400 + e19c06b commit fec9c14

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/Auth/TinyAuthorize.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
use Cake\Controller\ComponentRegistry;
77
use Cake\Core\Configure;
88
use Cake\Core\Exception\Exception;
9-
use Cake\Database\Schema\Collection;
109
use Cake\Datasource\ConnectionManager;
1110
use Cake\Network\Request;
1211
use Cake\ORM\TableRegistry;
13-
use Cake\Utility\Hash;
1412
use Cake\Utility\Inflector;
1513

1614
if (!defined('CLASS_USERS')) {
@@ -65,7 +63,7 @@ class TinyAuthorize extends BaseAuthorize {
6563
*
6664
* @param ComponentRegistry $registry
6765
* @param array $config
68-
* @throws Cake\Core\Exception\Exception
66+
* @throws \Cake\Core\Exception\Exception
6967
*/
7068
public function __construct(ComponentRegistry $registry, array $config = []) {
7169
$config += (array)Configure::read('TinyAuth');
@@ -90,7 +88,7 @@ public function __construct(ComponentRegistry $registry, array $config = []) {
9088
* - User belongsTo Roles (role_id in User array)
9189
*
9290
* @param array $user The user to authorize
93-
* @param Cake\Network\Request $request The request needing authorization.
91+
* @param \Cake\Network\Request $request The request needing authorization.
9492
* @return bool Success
9593
*/
9694
public function authorize($user, Request $request) {
@@ -102,9 +100,7 @@ public function authorize($user, Request $request) {
102100
* allows single or multi role based authorization
103101
*
104102
* @param array $userRoles
105-
* @param string $plugin
106-
* @param string $controller
107-
* @param string $action
103+
* @param \Cake\Network\Request $request Request instance
108104
* @return bool Success
109105
*/
110106
public function validate($userRoles, Request $request) {
@@ -248,8 +244,9 @@ protected function _getAcl($path = null) {
248244
/**
249245
* Returns the acl.ini file as an array.
250246
*
247+
* * @param string $ini Full path to the acl.ini file
251248
* @return array List with all available roles
252-
* @throws Cake\Core\Exception\Exception
249+
* @throws \Cake\Core\Exception\Exception
253250
*/
254251
protected function _parseAclIni($ini) {
255252
if (!file_exists($ini)) {
@@ -270,7 +267,7 @@ protected function _parseAclIni($ini) {
270267
/**
271268
* Deconstructs an ACL ini section key into a named array with ACL parts
272269
*
273-
* @param string INI section key as found in acl.ini
270+
* @param string $key INI section key as found in acl.ini
274271
* @return array Hash with named keys for controller, plugin and prefix
275272
*/
276273
protected function _deconstructIniKey($key) {
@@ -292,7 +289,7 @@ protected function _deconstructIniKey($key) {
292289
/**
293290
* Constructs an ACL ini section key from a given CakeRequest
294291
*
295-
* @param Cake\Network\Request $request The request needing authorization.
292+
* @param \Cake\Network\Request $request The request needing authorization.
296293
* @return array Hash with named keys for controller, plugin and prefix
297294
*/
298295
protected function _constructIniKey(Request $request) {
@@ -311,7 +308,7 @@ protected function _constructIniKey(Request $request) {
311308
* Configure first, tries database roles table next.
312309
*
313310
* @return array List with all available roles
314-
* @throws Cake\Core\Exception\Exception
311+
* @throws \Cake\Core\Exception\Exception
315312
*/
316313
protected function _getAvailableRoles() {
317314
$roles = Configure::read($this->_config['rolesTable']);
@@ -347,7 +344,7 @@ protected function _getAvailableRoles() {
347344
*
348345
* @param array $user The user to get the roles for
349346
* @return array List with all role ids belonging to the user
350-
* @throws Cake\Core\Exception\Exception
347+
* @throws \Cake\Core\Exception\Exception
351348
*/
352349
protected function _getUserRoles($user) {
353350
// single-role

0 commit comments

Comments
 (0)