@@ -128,8 +128,10 @@ |
||
128 | 128 | public function clear() { |
129 | 129 | $items = glob("{$this->cacheFolder}/*.txt"); // get all file names |
130 | 130 | foreach($items as $item){ // iterate files |
131 | - if(is_file($item)) |
|
132 | - unlink($item); // delete file |
|
131 | + if(is_file($item)) { |
|
132 | + unlink($item); |
|
133 | + } |
|
134 | + // delete file |
|
133 | 135 | } |
134 | 136 | $this->deferredItems = []; |
135 | 137 | return true; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
85 | - * @return bool |
|
85 | + * @return string |
|
86 | 86 | */ |
87 | 87 | public function getParentNationality() { |
88 | 88 | return $this->parentNationality; |
@@ -119,7 +119,6 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * Return a specific visa |
121 | 121 | * |
122 | - * @param Visa $visa |
|
123 | 122 | * |
124 | 123 | * @return mixed|null |
125 | 124 | */ |
@@ -127,8 +127,9 @@ |
||
127 | 127 | /** @var Visa $visa */ |
128 | 128 | $visas = []; |
129 | 129 | foreach($this->visas as $visa) { |
130 | - if ($visa->getCountry()->getCode() == $country_code) |
|
131 | - $visas[] = $visa; |
|
130 | + if ($visa->getCountry()->getCode() == $country_code) { |
|
131 | + $visas[] = $visa; |
|
132 | + } |
|
132 | 133 | } |
133 | 134 | return $visas; |
134 | 135 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * Method to check if a resource is supported by the loader |
50 | 50 | * This method check only extension file |
51 | 51 | * |
52 | - * @param $resource |
|
52 | + * @param string $resource |
|
53 | 53 | * |
54 | 54 | * @return boolean Return true if the extension of the ressource is supported by the loader |
55 | 55 | */ |
@@ -44,6 +44,9 @@ |
||
44 | 44 | |
45 | 45 | } |
46 | 46 | |
47 | + /** |
|
48 | + * @param string $configPaths_root |
|
49 | + */ |
|
47 | 50 | public function setConfigPathRoot($configPaths_root = null) { |
48 | 51 | // $this->config_path_route = $configPaths_root; |
49 | 52 | foreach($this->loaders as $loader) { |
@@ -130,14 +130,15 @@ |
||
130 | 130 | * @return array |
131 | 131 | */ |
132 | 132 | private function prepareGetterParams($getter_params, $user, $resource) { |
133 | - if (empty($getter_params)) return []; |
|
133 | + if (empty($getter_params)) { |
|
134 | + return []; |
|
135 | + } |
|
134 | 136 | $values = []; |
135 | 137 | foreach($getter_params as $getter_name=>$params) { |
136 | 138 | foreach($params as $param) { |
137 | 139 | if ( '@' !== $param[ 'param_name' ][ 0 ] ) { |
138 | 140 | $values[$getter_name][] = $param[ 'param_value' ]; |
139 | - } |
|
140 | - else { |
|
141 | + } else { |
|
141 | 142 | $values[$getter_name][] = $this->attributeManager->retrieveAttribute( $this->attributeManager->getAttribute( $param[ 'param_value' ] ) , $user, $resource ); |
142 | 143 | } |
143 | 144 | } |
@@ -88,7 +88,6 @@ discard block |
||
88 | 88 | |
89 | 89 | /** |
90 | 90 | * @param AbstractAttribute $attribute |
91 | - * @param string $attributeType |
|
92 | 91 | * @param object $user |
93 | 92 | * @param object $object |
94 | 93 | * @return mixed |
@@ -136,7 +135,7 @@ discard block |
||
136 | 135 | /** |
137 | 136 | * |
138 | 137 | * @param \PhpAbac\Model\EnvironmentAttribute $attribute |
139 | - * @return mixed |
|
138 | + * @return string |
|
140 | 139 | */ |
141 | 140 | private function retrieveEnvironmentAttribute(EnvironmentAttribute $attribute) { |
142 | 141 | return getenv($attribute->getVariableName()); |