@@ -20,12 +20,18 @@ |
||
| 20 | 20 | $this->path = $path; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $file |
|
| 25 | + */ |
|
| 23 | 26 | public function saveToFile($file, $value) |
| 24 | 27 | { |
| 25 | 28 | file_put_contents($this->path . $file, serialize($value)); |
| 26 | 29 | return true; |
| 27 | 30 | } |
| 28 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $file |
|
| 34 | + */ |
|
| 29 | 35 | public function loadFromFile($file) |
| 30 | 36 | { |
| 31 | 37 | return unserialize(file_get_contents($this->path . $file)); |
@@ -33,6 +33,10 @@ discard block |
||
| 33 | 33 | "type" => "value" |
| 34 | 34 | )); |
| 35 | 35 | } |
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @param string $value |
|
| 39 | + */ |
|
| 36 | 40 | public function mapClass($key, $value, $arguments = null) |
| 37 | 41 | { |
| 38 | 42 | $this->addToMap($key, (object) array( |
@@ -41,6 +45,10 @@ discard block |
||
| 41 | 45 | "arguments" => $arguments |
| 42 | 46 | )); |
| 43 | 47 | } |
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * @param string $value |
|
| 51 | + */ |
|
| 44 | 52 | public function mapClassAsSingleton($key, $value, $arguments = null) |
| 45 | 53 | { |
| 46 | 54 | $this->addToMap($key, (object) array( |
@@ -219,7 +227,7 @@ discard block |
||
| 219 | 227 | } |
| 220 | 228 | |
| 221 | 229 | /** |
| 222 | - * @param $reflectionClass |
|
| 230 | + * @param \ReflectionClass $reflectionClass |
|
| 223 | 231 | * @param $className |
| 224 | 232 | * @param $arguments |
| 225 | 233 | * @return mixed |
@@ -240,13 +248,16 @@ discard block |
||
| 240 | 248 | return $reflectionClass->newInstanceArgs($diArguments); |
| 241 | 249 | } |
| 242 | 250 | |
| 251 | + /** |
|
| 252 | + * @param string $id |
|
| 253 | + */ |
|
| 243 | 254 | private function checkIfIsSingleton($id) |
| 244 | 255 | { |
| 245 | 256 | return self::SINGLETON_CLASS === $this->map->$id->type; |
| 246 | 257 | } |
| 247 | 258 | |
| 248 | 259 | /** |
| 249 | - * @param $id |
|
| 260 | + * @param string $id |
|
| 250 | 261 | * @return mixed |
| 251 | 262 | */ |
| 252 | 263 | private function getItemInstance($id) |
@@ -255,7 +266,7 @@ discard block |
||
| 255 | 266 | } |
| 256 | 267 | |
| 257 | 268 | /** |
| 258 | - * @param $reflection |
|
| 269 | + * @param \ReflectionClass $reflection |
|
| 259 | 270 | * @param $instance |
| 260 | 271 | */ |
| 261 | 272 | private function checkInjection($reflection, $instance) |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * @param $controllerName |
|
| 25 | - * @param $controllerMethod |
|
| 26 | - * @param null $path |
|
| 24 | + * @param string $controllerName |
|
| 25 | + * @param string $controllerMethod |
|
| 26 | + * @param string $path |
|
| 27 | 27 | * @return bool |
| 28 | 28 | */ |
| 29 | 29 | public function needsTwig($controllerName, $controllerMethod, $path = null): bool |
@@ -35,6 +35,9 @@ |
||
| 35 | 35 | return self::$instance; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | + /** |
|
| 39 | + * @param integer $expirationTime |
|
| 40 | + */ |
|
| 38 | 41 | public function save($key, $value, $expirationTime = null) |
| 39 | 42 | { |
| 40 | 43 | self::$client->saveToFile(self::FILES_CACHE_PREFIX . $key, $value); |
@@ -96,7 +96,6 @@ |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * @param Session $session |
|
| 100 | 99 | * @throws \Exception |
| 101 | 100 | */ |
| 102 | 101 | private function validateThrottling() |
@@ -12,6 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class NameValidationStrategy implements ValidationStrategyInterface |
| 14 | 14 | { |
| 15 | + /** |
|
| 16 | + * @param string $field |
|
| 17 | + */ |
|
| 15 | 18 | public function isValid($field) |
| 16 | 19 | { |
| 17 | 20 | return boolval(preg_match("/^[a-zA-Z]*$/", $field)); |
@@ -51,6 +51,9 @@ |
||
| 51 | 51 | $this->ip = $ip; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | + /** |
|
| 55 | + * @param integer $rps |
|
| 56 | + */ |
|
| 54 | 57 | public function setAllowedRequestsPerSecond($rps) |
| 55 | 58 | { |
| 56 | 59 | $this->allowedRequestsPerSecond = $rps; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | class ValidationService |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * @param $field |
|
| 16 | + * @param string $field |
|
| 17 | 17 | * @param array $validationStrategies |
| 18 | 18 | * @return bool |
| 19 | 19 | * @throws \Exception |
@@ -42,6 +42,10 @@ |
||
| 42 | 42 | return boolval($this->devMode); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string $username |
|
| 47 | + * @param string $email |
|
| 48 | + */ |
|
| 45 | 49 | public function __construct($username, $email, $devMode = false) |
| 46 | 50 | { |
| 47 | 51 | $this->username = $username; |