@@ -39,22 +39,22 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | public function md5($input) { |
42 | - return new QueryFunction('MD5(' . $this->helper->quoteColumnName($input) . ')'); |
|
42 | + return new QueryFunction('MD5('.$this->helper->quoteColumnName($input).')'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public function concat($x, $y) { |
46 | - return new QueryFunction('CONCAT(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); |
|
46 | + return new QueryFunction('CONCAT('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function substring($input, $start, $length = null) { |
50 | 50 | if ($length) { |
51 | - return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ', ' . $this->helper->quoteColumnName($length) . ')'); |
|
51 | + return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).', '.$this->helper->quoteColumnName($length).')'); |
|
52 | 52 | } else { |
53 | - return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ')'); |
|
53 | + return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).')'); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | 57 | public function sum($field) { |
58 | - return new QueryFunction('SUM(' . $this->helper->quoteColumnName($field) . ')'); |
|
58 | + return new QueryFunction('SUM('.$this->helper->quoteColumnName($field).')'); |
|
59 | 59 | } |
60 | 60 | } |
@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | * @param object $object an object or classname |
41 | 41 | * @param string $method the method which we want to inspect |
42 | 42 | */ |
43 | - public function reflect($object, $method){ |
|
43 | + public function reflect($object, $method) { |
|
44 | 44 | $reflection = new \ReflectionMethod($object, $method); |
45 | 45 | $docs = $reflection->getDocComment(); |
46 | 46 | |
47 | 47 | // extract everything prefixed by @ and first letter uppercase |
48 | 48 | preg_match_all('/^\h+\*\h+@(?P<annotation>[A-Z]\w+)((?P<parameter>.*))?$/m', $docs, $matches); |
49 | - foreach($matches['annotation'] as $key => $annontation) { |
|
49 | + foreach ($matches['annotation'] as $key => $annontation) { |
|
50 | 50 | $annotationValue = $matches['parameter'][$key]; |
51 | - if(isset($annotationValue[0]) && $annotationValue[0] === '(' && $annotationValue[strlen($annotationValue) - 1] === ')') { |
|
51 | + if (isset($annotationValue[0]) && $annotationValue[0] === '(' && $annotationValue[strlen($annotationValue) - 1] === ')') { |
|
52 | 52 | $cutString = substr($annotationValue, 1, -1); |
53 | 53 | $cutString = str_replace(' ', '', $cutString); |
54 | 54 | $splittedArray = explode(',', $cutString); |
55 | - foreach($splittedArray as $annotationValues) { |
|
55 | + foreach ($splittedArray as $annotationValues) { |
|
56 | 56 | list($key, $value) = explode('=', $annotationValues); |
57 | 57 | $this->annotations[$annontation][$key] = $value; |
58 | 58 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | - if($param->isOptional()) { |
|
79 | + if ($param->isOptional()) { |
|
80 | 80 | $default = $param->getDefaultValue(); |
81 | 81 | } else { |
82 | 82 | $default = null; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * would return int or null if not existing |
94 | 94 | */ |
95 | 95 | public function getType($parameter) { |
96 | - if(array_key_exists($parameter, $this->types)) { |
|
96 | + if (array_key_exists($parameter, $this->types)) { |
|
97 | 97 | return $this->types[$parameter]; |
98 | 98 | } else { |
99 | 99 | return null; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @return string |
125 | 125 | */ |
126 | 126 | public function getAnnotationParameter($name, $key) { |
127 | - if(isset($this->annotations[$name][$key])) { |
|
127 | + if (isset($this->annotations[$name][$key])) { |
|
128 | 128 | return $this->annotations[$name][$key]; |
129 | 129 | } |
130 | 130 |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $anonPeriod = $this->reflector->getAnnotationParameter('AnonRateThrottle', 'period'); |
85 | 85 | $userLimit = $this->reflector->getAnnotationParameter('UserRateThrottle', 'limit'); |
86 | 86 | $userPeriod = $this->reflector->getAnnotationParameter('UserRateThrottle', 'period'); |
87 | - $rateLimitIdentifier = get_class($controller) . '::' . $methodName; |
|
88 | - if($userLimit !== '' && $userPeriod !== '' && $this->userSession->isLoggedIn()) { |
|
87 | + $rateLimitIdentifier = get_class($controller).'::'.$methodName; |
|
88 | + if ($userLimit !== '' && $userPeriod !== '' && $this->userSession->isLoggedIn()) { |
|
89 | 89 | $this->limiter->registerUserRequest( |
90 | 90 | $rateLimitIdentifier, |
91 | 91 | $userLimit, |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | * {@inheritDoc} |
107 | 107 | */ |
108 | 108 | public function afterException($controller, $methodName, \Exception $exception) { |
109 | - if($exception instanceof RateLimitExceededException) { |
|
110 | - if (stripos($this->request->getHeader('Accept'),'html') === false) { |
|
109 | + if ($exception instanceof RateLimitExceededException) { |
|
110 | + if (stripos($this->request->getHeader('Accept'), 'html') === false) { |
|
111 | 111 | $response = new JSONResponse( |
112 | 112 | [ |
113 | 113 | 'message' => $exception->getMessage(), |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function beforeController($controller, $methodName) { |
62 | 62 | parent::beforeController($controller, $methodName); |
63 | 63 | |
64 | - if($this->reflector->hasAnnotation('BruteForceProtection')) { |
|
64 | + if ($this->reflector->hasAnnotation('BruteForceProtection')) { |
|
65 | 65 | $action = $this->reflector->getAnnotationParameter('BruteForceProtection', 'action'); |
66 | 66 | $this->throttler->sleepDelay($this->request->getRemoteAddress(), $action); |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * {@inheritDoc} |
72 | 72 | */ |
73 | 73 | public function afterController($controller, $methodName, Response $response) { |
74 | - if($this->reflector->hasAnnotation('BruteForceProtection') && $response->isThrottled()) { |
|
74 | + if ($this->reflector->hasAnnotation('BruteForceProtection') && $response->isThrottled()) { |
|
75 | 75 | $action = $this->reflector->getAnnotationParameter('BruteForceProtection', 'action'); |
76 | 76 | $ip = $this->request->getRemoteAddress(); |
77 | 77 | $this->throttler->sleepDelay($ip, $action); |
@@ -198,7 +198,7 @@ |
||
198 | 198 | } catch (NotFoundException $e) { |
199 | 199 | return new DataResponse( |
200 | 200 | [ |
201 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
201 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
202 | 202 | ], |
203 | 203 | Http::STATUS_NOT_FOUND |
204 | 204 | ); |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <fieldset id="ldapWizard4"> |
2 | 2 | <div> |
3 | 3 | <p> |
4 | - <?php p($l->t('Groups meeting these criteria are available in %s:', $theme->getName()));?> |
|
4 | + <?php p($l->t('Groups meeting these criteria are available in %s:', $theme->getName())); ?> |
|
5 | 5 | </p> |
6 | 6 | <p> |
7 | 7 | <label for="ldap_groupfilter_objectclass"> |
8 | - <?php p($l->t('Only these object classes:'));?> |
|
8 | + <?php p($l->t('Only these object classes:')); ?> |
|
9 | 9 | </label> |
10 | 10 | |
11 | 11 | <select id="ldap_groupfilter_objectclass" multiple="multiple" |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | </p> |
15 | 15 | <p> |
16 | 16 | <label for="ldap_groupfilter_groups"> |
17 | - <?php p($l->t('Only from these groups:'));?> |
|
17 | + <?php p($l->t('Only from these groups:')); ?> |
|
18 | 18 | </label> |
19 | 19 | |
20 | - <input type="text" class="ldapManyGroupsSupport ldapManyGroupsSearch hidden" placeholder="<?php p($l->t('Search groups'));?>" /> |
|
20 | + <input type="text" class="ldapManyGroupsSupport ldapManyGroupsSearch hidden" placeholder="<?php p($l->t('Search groups')); ?>" /> |
|
21 | 21 | |
22 | 22 | <select id="ldap_groupfilter_groups" multiple="multiple" |
23 | 23 | name="ldap_groupfilter_groups" class="multiSelectPlugin"> |
@@ -27,25 +27,25 @@ discard block |
||
27 | 27 | <p class="ldapManyGroupsSupport hidden"> |
28 | 28 | <label></label> |
29 | 29 | <select class="ldapGroupList ldapGroupListAvailable" multiple="multiple" |
30 | - title="<?php p($l->t('Available groups'));?>"></select> |
|
30 | + title="<?php p($l->t('Available groups')); ?>"></select> |
|
31 | 31 | <span class="buttonSpan"> |
32 | 32 | <button class="ldapGroupListSelect" type="button">></button><br/> |
33 | 33 | <button class="ldapGroupListDeselect" type="button"><</button> |
34 | 34 | </span> |
35 | 35 | <select class="ldapGroupList ldapGroupListSelected" multiple="multiple" |
36 | - title="<?php p($l->t('Selected groups'));?>"></select> |
|
36 | + title="<?php p($l->t('Selected groups')); ?>"></select> |
|
37 | 37 | </p> |
38 | 38 | <p> |
39 | - <label><a id='toggleRawGroupFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query'));?></a></label> |
|
39 | + <label><a id='toggleRawGroupFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query')); ?></a></label> |
|
40 | 40 | </p> |
41 | 41 | <p id="ldapReadOnlyGroupFilterContainer" class="hidden ldapReadOnlyFilterContainer"> |
42 | - <label><?php p($l->t('LDAP Filter:'));?></label> |
|
42 | + <label><?php p($l->t('LDAP Filter:')); ?></label> |
|
43 | 43 | <span class="ldapFilterReadOnlyElement ldapInputColElement"></span> |
44 | 44 | </p> |
45 | 45 | <p id="rawGroupFilterContainer" class="invisible"> |
46 | 46 | <textarea type="text" id="ldap_group_filter" name="ldap_group_filter" |
47 | - placeholder="<?php p($l->t('Edit LDAP Query'));?>" |
|
48 | - title="<?php p($l->t('The filter specifies which LDAP groups shall have access to the %s instance.', $theme->getName()));?>"> |
|
47 | + placeholder="<?php p($l->t('Edit LDAP Query')); ?>" |
|
48 | + title="<?php p($l->t('The filter specifies which LDAP groups shall have access to the %s instance.', $theme->getName())); ?>"> |
|
49 | 49 | </textarea> |
50 | 50 | </p> |
51 | 51 | <p> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | </p> |
54 | 54 | <p class="ldap_count"> |
55 | 55 | <button class="ldapGetEntryCount ldapGetGroupCount" name="ldapGetEntryCount" type="button"> |
56 | - <?php p($l->t('Verify settings and count the groups'));?> |
|
56 | + <?php p($l->t('Verify settings and count the groups')); ?> |
|
57 | 57 | </button> |
58 | 58 | <span id="ldap_group_count"></span> |
59 | 59 | </p> |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } catch (NotFoundException $e) { |
123 | 123 | return new DataResponse( |
124 | 124 | [ |
125 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
125 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
126 | 126 | ], |
127 | 127 | Http::STATUS_NOT_FOUND |
128 | 128 | ); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } else { |
163 | 163 | return new DataResponse( |
164 | 164 | [ |
165 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', array($id)) |
|
165 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" is not user editable', array($id)) |
|
166 | 166 | ], |
167 | 167 | Http::STATUS_FORBIDDEN |
168 | 168 | ); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } catch (NotFoundException $e) { |
171 | 171 | return new DataResponse( |
172 | 172 | [ |
173 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
173 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
174 | 174 | ], |
175 | 175 | Http::STATUS_NOT_FOUND |
176 | 176 | ); |
@@ -198,7 +198,7 @@ |
||
198 | 198 | } catch (NotFoundException $e) { |
199 | 199 | return new DataResponse( |
200 | 200 | [ |
201 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
201 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
202 | 202 | ], |
203 | 203 | Http::STATUS_NOT_FOUND |
204 | 204 | ); |
@@ -150,7 +150,7 @@ |
||
150 | 150 | */ |
151 | 151 | public function mapperEvent(MapperEvent $event) { |
152 | 152 | $tagIds = $event->getTags(); |
153 | - if ($event->getObjectType() !== 'files' ||empty($tagIds) |
|
153 | + if ($event->getObjectType() !== 'files' || empty($tagIds) |
|
154 | 154 | || !in_array($event->getEvent(), [MapperEvent::EVENT_ASSIGN, MapperEvent::EVENT_UNASSIGN]) |
155 | 155 | || !$this->appManager->isInstalled('activity')) { |
156 | 156 | // System tags not for files, no tags, not (un-)assigning or no activity-app enabled (save the energy) |