@@ -53,10 +53,10 @@ |
||
| 53 | 53 | public function __construct($status = self::ACTIVE) |
| 54 | 54 | { |
| 55 | 55 | if (!isset(static::$orderMap[$status])) { |
| 56 | - throw new \DomainException('Unknown status: ' . $status); |
|
| 56 | + throw new \DomainException('Unknown status: '.$status); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $constant = 'self::' . strtoupper($status); |
|
| 59 | + $constant = 'self::'.strtoupper($status); |
|
| 60 | 60 | $this->name = constant($constant); |
| 61 | 61 | $this->order = $this->getOrder(); |
| 62 | 62 | } |
@@ -84,9 +84,9 @@ |
||
| 84 | 84 | $imageStrategy = $infoContainer->getForm('info.image') |
| 85 | 85 | ->getHydrator() |
| 86 | 86 | ->getStrategy('image'); |
| 87 | - $fileEntity = $imageStrategy->getFileEntity(); |
|
| 88 | - $fileEntity->setUser($user); |
|
| 89 | - $imageStrategy->setFileEntity($fileEntity); |
|
| 87 | + $fileEntity = $imageStrategy->getFileEntity(); |
|
| 88 | + $fileEntity->setUser($user); |
|
| 89 | + $imageStrategy->setFileEntity($fileEntity); |
|
| 90 | 90 | |
| 91 | 91 | if ($this->request->isPost()) { |
| 92 | 92 | $formName = $params->fromQuery('form'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * @param UserRepository $userRepository |
| 42 | 42 | */ |
| 43 | - public function __construct(UserRepository $userRepository,$formManager,$viewHelper) |
|
| 43 | + public function __construct(UserRepository $userRepository, $formManager, $viewHelper) |
|
| 44 | 44 | { |
| 45 | 45 | $this->userRepository = $userRepository; |
| 46 | 46 | $this->formManager = $formManager; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | $switcher = $this->plugin('Auth/User/Switcher'); |
| 189 | - $success = $switcher($this->params()->fromQuery('id'), [ 'ref' => urldecode($this->params()->fromQuery('ref')) ]); |
|
| 189 | + $success = $switcher($this->params()->fromQuery('id'), ['ref' => urldecode($this->params()->fromQuery('ref'))]); |
|
| 190 | 190 | |
| 191 | 191 | return new JsonModel(['success' => true]); |
| 192 | 192 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct(LoginFilterService $loginFilter) |
| 33 | 33 | { |
| 34 | - $this->loginFilter = $loginFilter;; |
|
| 34 | + $this->loginFilter = $loginFilter; ; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -44,11 +44,11 @@ |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @param ContainerInterface $container |
|
| 49 | - * |
|
| 50 | - * @return static |
|
| 51 | - */ |
|
| 47 | + /** |
|
| 48 | + * @param ContainerInterface $container |
|
| 49 | + * |
|
| 50 | + * @return static |
|
| 51 | + */ |
|
| 52 | 52 | public static function factory(ContainerInterface $container) |
| 53 | 53 | { |
| 54 | 54 | return new static($container->get('Auth/LoginFilter')); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * @param $resource |
| 132 | - * @param null $privilege |
|
| 132 | + * @param null|string $privilege |
|
| 133 | 133 | * @throws \Auth\Exception\UnauthorizedImageAccessException |
| 134 | 134 | * @throws \Auth\Exception\UnauthorizedAccessException |
| 135 | 135 | */ |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | - * @param null $resource |
|
| 159 | - * @param null $privilege |
|
| 158 | + * @param null|string $resource |
|
| 159 | + * @param null|string $privilege |
|
| 160 | 160 | * @param string $mode |
| 161 | 161 | * @return $this|bool |
| 162 | 162 | */ |
@@ -138,14 +138,14 @@ |
||
| 138 | 138 | if (!$this->test($resource, $privilege)) { |
| 139 | 139 | $msg = null === $privilege |
| 140 | 140 | ? sprintf( |
| 141 | - 'You are not allowed to access resource "%s"', |
|
| 142 | - is_object($resource) ? $resource->getResourceId() : $resource |
|
| 143 | - ) |
|
| 141 | + 'You are not allowed to access resource "%s"', |
|
| 142 | + is_object($resource) ? $resource->getResourceId() : $resource |
|
| 143 | + ) |
|
| 144 | 144 | : sprintf( |
| 145 | - 'You are not allowed to execute operation "%s" on resource "%s"', |
|
| 146 | - $privilege, |
|
| 147 | - is_object($resource) ? $resource->getResourceId() : $resource |
|
| 148 | - ); |
|
| 145 | + 'You are not allowed to execute operation "%s" on resource "%s"', |
|
| 146 | + $privilege, |
|
| 147 | + is_object($resource) ? $resource->getResourceId() : $resource |
|
| 148 | + ); |
|
| 149 | 149 | |
| 150 | 150 | if ($resource instanceof FileInterface && 0 == strpos($resource->getType(), 'image/')) { |
| 151 | 151 | throw new UnauthorizedImageAccessException(str_replace('resource', 'image', $msg)); |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | if ($exception instanceof UnauthorizedImageAccessException) { |
| 58 | 58 | $image = __DIR__ . '/../../../../../public/images/unauthorized-access.png'; |
| 59 | 59 | $response->setStatusCode(Response::STATUS_CODE_403) |
| 60 | - ->setContent(file_get_contents($image)) |
|
| 61 | - ->getHeaders() |
|
| 62 | - ->addHeaderLine('Content-Type', 'image/png'); |
|
| 60 | + ->setContent(file_get_contents($image)) |
|
| 61 | + ->getHeaders() |
|
| 62 | + ->addHeaderLine('Content-Type', 'image/png'); |
|
| 63 | 63 | $e->stopPropagation(); |
| 64 | 64 | $response->sendHeaders(); |
| 65 | 65 | //echo file_get_contents($image); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $application = $e->getApplication(); |
| 73 | - $auth = $application->getServiceManager()->get('AuthenticationService'); |
|
| 73 | + $auth = $application->getServiceManager()->get('AuthenticationService'); |
|
| 74 | 74 | |
| 75 | 75 | if (!$auth->hasIdentity()) { |
| 76 | 76 | $routeMatch = $e->getRouteMatch(); |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | $model->setTemplate($this->getExceptionTemplate()); |
| 103 | 103 | $e->setResult($model); |
| 104 | 104 | |
| 105 | - // $statusCode = $response->getStatusCode(); |
|
| 106 | - // if ($statusCode === 200) { |
|
| 105 | + // $statusCode = $response->getStatusCode(); |
|
| 106 | + // if ($statusCode === 200) { |
|
| 107 | 107 | $response->setStatusCode(Response::STATUS_CODE_403); |
| 108 | - // } |
|
| 108 | + // } |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * Return an image, if an image was requested. |
| 56 | 56 | */ |
| 57 | 57 | if ($exception instanceof UnauthorizedImageAccessException) { |
| 58 | - $image = __DIR__ . '/../../../../../public/images/unauthorized-access.png'; |
|
| 58 | + $image = __DIR__.'/../../../../../public/images/unauthorized-access.png'; |
|
| 59 | 59 | $response->setStatusCode(Response::STATUS_CODE_403) |
| 60 | 60 | ->setContent(file_get_contents($image)) |
| 61 | 61 | ->getHeaders() |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $routeMatch->setParam('action', 'index'); |
| 79 | 79 | $query = $e->getRequest()->getQuery(); |
| 80 | 80 | $ref = $e->getRequest()->getRequestUri(); |
| 81 | - $ref = preg_replace('~^' . preg_quote($e->getRouter()->getBaseUrl()) . '~', '', $ref); |
|
| 81 | + $ref = preg_replace('~^'.preg_quote($e->getRouter()->getBaseUrl()).'~', '', $ref); |
|
| 82 | 82 | $query->set('ref', $ref); |
| 83 | 83 | $query->set('req', 1); |
| 84 | 84 | $response->setStatusCode(Response::STATUS_CODE_401); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | protected function attachDefaultListeners() |
| 58 | 58 | { |
| 59 | - $this->getEventManager()->attach(static::EVENT_REMOVE_ITEMS, function (EventInterface $event) { |
|
| 59 | + $this->getEventManager()->attach(static::EVENT_REMOVE_ITEMS, function(EventInterface $event) { |
|
| 60 | 60 | $user = $event->getParam('user'); |
| 61 | 61 | foreach ($this->getLists() as $list) { |
| 62 | 62 | foreach ($list->getEntities($user) as $entity) { |
@@ -41,8 +41,6 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | - * @param User $user |
|
| 45 | - * @param Router $router |
|
| 46 | 44 | * @return ListInterface[] |
| 47 | 45 | */ |
| 48 | 46 | public function getLists() |
@@ -52,8 +50,7 @@ discard block |
||
| 52 | 50 | |
| 53 | 51 | /** |
| 54 | 52 | * @param User $user |
| 55 | - * @param Router $router |
|
| 56 | - * @return \Zend\EventManager\ResponseCollection |
|
| 53 | + * @return boolean |
|
| 57 | 54 | */ |
| 58 | 55 | public function removeItems(User $user) |
| 59 | 56 | { |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | return array( |
| 136 | 136 | 'year' => strval($xml->year), |
| 137 | 137 | 'month'=> isset($xml->month) ? strval($xml->month) : '01', |
| 138 | - 'day' => isset($xml->day) ? strval($xml->day) : '01', |
|
| 138 | + 'day' => isset($xml->day) ? strval($xml->day) : '01', |
|
| 139 | 139 | ); |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -98,9 +98,9 @@ |
||
| 98 | 98 | ); |
| 99 | 99 | |
| 100 | 100 | $this->setCount(0) |
| 101 | - ->setAllowRemove(true) |
|
| 102 | - ->setAllowAdd(true) |
|
| 103 | - ->setShouldCreateTemplate(true); |
|
| 101 | + ->setAllowRemove(true) |
|
| 102 | + ->setAllowAdd(true) |
|
| 103 | + ->setShouldCreateTemplate(true); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | 'attributes' => [ |
| 88 | 88 | 'data-placeholder' => /*@translate*/ 'please select', |
| 89 | 89 | 'data-allowclear' => 'false', |
| 90 | - 'data-searchbox' => -1, // hide the search box |
|
| 90 | + 'data-searchbox' => -1, // hide the search box |
|
| 91 | 91 | 'required' => true, // mark label as required |
| 92 | 92 | ], |
| 93 | 93 | ] |