Passed
Pull Request — master (#166)
by
unknown
10:28 queued 47s
created
Classes/Domain/Repository/DocumentRepository.php 3 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             case Security::ROLE_RESEARCHER:
45 45
                 $query->matching(
46 46
                     $query->logicalAnd(
47
-                        array(
47
+                        array (
48 48
                             $query->equals('suggestion', true),
49 49
                             $query->equals('creator', $creatorUid)
50 50
                         )
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $query = $this->createQuery();
65 65
 
66
-        $constraints = array(
66
+        $constraints = array (
67 67
             $query->logicalNot($query->equals('object_identifier', '')),
68 68
             $query->logicalNot($query->equals('object_identifier', NULL)));
69 69
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         $result = $query->execute();
83 83
 
84
-        $objectIdentifiers = array();
84
+        $objectIdentifiers = array ();
85 85
 
86 86
         foreach ($result as $document) {
87 87
             $objectIdentifiers[$document->getObjectIdentifier()] = $document->getObjectIdentifier();
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
         $query = $this->createQuery();
102 102
         $query->getQuerySettings()->setRespectStoragePage(FALSE);
103 103
 
104
-        $constraints = array();
105
-        $constraints[] =  $query->equals('process_number', '');
106
-        $constraints[] =  $query->equals('process_number', NULL);
104
+        $constraints = array ();
105
+        $constraints[] = $query->equals('process_number', '');
106
+        $constraints[] = $query->equals('process_number', NULL);
107 107
 
108 108
         if (count($constraints)) {
109 109
             $query->matching(
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $query = $this->createQuery();
129 129
 
130
-        $dateTimeObj= new \DateTime();
131
-        $dateTimeObj->sub(new \DateInterval("PT".$timeout."S"));
130
+        $dateTimeObj = new \DateTime();
131
+        $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S"));
132 132
 
133
-        $constraints = array();
133
+        $constraints = array ();
134 134
         $constraints[] = $query->lessThan('tstamp', $dateTimeObj->getTimestamp());
135 135
 
136 136
         $query->matching(
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $query = $this->createQuery();
155 155
 
156
-        $dateTimeObj= new \DateTime();
157
-        $dateTimeObj->sub(new \DateInterval("PT".$timeout."S"));
156
+        $dateTimeObj = new \DateTime();
157
+        $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S"));
158 158
 
159
-        $constraints = array();
159
+        $constraints = array ();
160 160
         $constraints[] = $query->lessThan('tstamp', $dateTimeObj->getTimestamp());
161 161
 
162 162
         $query->matching(
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     {
179 179
         $query = $this->createQuery();
180 180
 
181
-        $constraints = array(
181
+        $constraints = array (
182 182
             $query->equals('object_identifier', $objectIdentifier),
183 183
             $query->logicalNot($query->equals('temporary', TRUE)),
184 184
             $query->logicalNot($query->equals('suggestion', TRUE))
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     {
277 277
 
278 278
         $query = $this->createQuery();
279
-        $query->statement( "update tx_dpf_domain_model_document set creator = owner");
279
+        $query->statement("update tx_dpf_domain_model_document set creator = owner");
280 280
         $query->execute();
281 281
 
282 282
     }
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * The repository for Documents
23 23
  */
24
-class DocumentRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository
25
-{
24
+class DocumentRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository {
26 25
     /**
27 26
      * Finds all suggestion documents of the given user role filtered by creator feuser uid
28 27
      *
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
      * @param boolean $temporary
60 59
      * @return array
61 60
      */
62
-    public function getObjectIdentifiers($temporary = FALSE)
63
-    {
61
+    public function getObjectIdentifiers($temporary = FALSE) {
64 62
         $query = $this->createQuery();
65 63
 
66 64
         $constraints = array(
@@ -96,8 +94,7 @@  discard block
 block discarded – undo
96 94
      *
97 95
      * @return array The found Document Objects
98 96
      */
99
-    public function findDocumentsWithoutProcessNumber()
100
-    {
97
+    public function findDocumentsWithoutProcessNumber() {
101 98
         $query = $this->createQuery();
102 99
         $query->getQuerySettings()->setRespectStoragePage(FALSE);
103 100
 
@@ -123,8 +120,7 @@  discard block
 block discarded – undo
123 120
      * @param integer $timeout : Time interval (in seconds) in which documents are not outdated.
124 121
      * @return array The found Document Objects
125 122
      */
126
-    public function findOutdatedTemporaryDocuments($timeout = 3600)
127
-    {
123
+    public function findOutdatedTemporaryDocuments($timeout = 3600) {
128 124
         $query = $this->createQuery();
129 125
 
130 126
         $dateTimeObj= new \DateTime();
@@ -149,8 +145,7 @@  discard block
 block discarded – undo
149 145
      * @param integer $timeout : Time interval (in seconds) in which documents are not outdated.
150 146
      * @return array The found Document Objects
151 147
      */
152
-    public function findOutdatedLockedDocuments($timeout = 3600)
153
-    {
148
+    public function findOutdatedLockedDocuments($timeout = 3600) {
154 149
         $query = $this->createQuery();
155 150
 
156 151
         $dateTimeObj= new \DateTime();
@@ -174,8 +169,7 @@  discard block
 block discarded – undo
174 169
      * @param string $objectIdentifier
175 170
      * @return array
176 171
      */
177
-    public function findWorkingCopyByObjectIdentifier($objectIdentifier)
178
-    {
172
+    public function findWorkingCopyByObjectIdentifier($objectIdentifier) {
179 173
         $query = $this->createQuery();
180 174
 
181 175
         $constraints = array(
@@ -193,8 +187,7 @@  discard block
 block discarded – undo
193 187
      * @param string $identifier
194 188
      * @return Document
195 189
      */
196
-    public function findByIdentifier($identifier)
197
-    {
190
+    public function findByIdentifier($identifier) {
198 191
         $query = $this->createQuery();
199 192
 
200 193
         if (is_numeric($identifier)) {
@@ -218,8 +211,7 @@  discard block
 block discarded – undo
218 211
      * @param bool $includeSuggestion
219 212
      * @return Document
220 213
      */
221
-    public function findWorkingCopy($identifier, $includeTemporary = false, $includeSuggestion = false)
222
-    {
214
+    public function findWorkingCopy($identifier, $includeTemporary = false, $includeSuggestion = false) {
223 215
         $query = $this->createQuery();
224 216
 
225 217
         if (is_numeric($identifier)) {
@@ -245,8 +237,7 @@  discard block
 block discarded – undo
245 237
      * @param object $modifiedObject The modified object
246 238
      * @throws \Exception
247 239
      */
248
-    public function update($modifiedObject)
249
-    {
240
+    public function update($modifiedObject) {
250 241
         /** @var Document $document */
251 242
         $document = $modifiedObject;
252 243
 
@@ -272,8 +263,7 @@  discard block
 block discarded – undo
272 263
 
273 264
 
274 265
 
275
-    public function updateCreator()
276
-    {
266
+    public function updateCreator() {
277 267
 
278 268
         $query = $this->createQuery();
279 269
         $query->statement( "update tx_dpf_domain_model_document set creator = owner");
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
             case Security::ROLE_LIBRARIAN:
39 39
                 $query->matching(
40
-                    $query->equals('suggestion', true)
40
+                    $query->equals('suggestion', TRUE)
41 41
                 );
42 42
                 break;
43 43
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 $query->matching(
46 46
                     $query->logicalAnd(
47 47
                         array(
48
-                            $query->equals('suggestion', true),
48
+                            $query->equals('suggestion', TRUE),
49 49
                             $query->equals('creator', $creatorUid)
50 50
                         )
51 51
                     )
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
      * @param bool $includeSuggestion
219 219
      * @return Document
220 220
      */
221
-    public function findWorkingCopy($identifier, $includeTemporary = false, $includeSuggestion = false)
221
+    public function findWorkingCopy($identifier, $includeTemporary = FALSE, $includeSuggestion = FALSE)
222 222
     {
223 223
         $query = $this->createQuery();
224 224
 
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
         if (trim($document->getObjectIdentifier()) && !$document->isTemporary() && !$document->isSuggestion()) {
254 254
             $query = $this->createQuery();
255 255
             $constraints[] = $query->equals('object_identifier', trim($document->getObjectIdentifier()));
256
-            $constraints[] = $query->equals('temporary', false);
257
-            $constraints[] = $query->equals('suggestion', false);
256
+            $constraints[] = $query->equals('temporary', FALSE);
257
+            $constraints[] = $query->equals('suggestion', FALSE);
258 258
             $query->matching($query->logicalAnd($constraints));
259 259
 
260 260
             /** @var Document $workingCopy */
Please login to merge, or discard this patch.
Classes/Domain/Repository/EditingLockRepository.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
     {
30 30
         $query = $this->createQuery();
31 31
 
32
-        $dateTimeObj= new \DateTime();
33
-        $dateTimeObj->sub(new \DateInterval("PT".$timeout."S"));
32
+        $dateTimeObj = new \DateTime();
33
+        $dateTimeObj->sub(new \DateInterval("PT" . $timeout . "S"));
34 34
 
35 35
         $query->matching(
36 36
             $query->lessThan('tstamp', $dateTimeObj->getTimestamp())
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,16 +17,14 @@
 block discarded – undo
17 17
 /**
18 18
  * The repository for editing lock objects
19 19
  */
20
-class EditingLockRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository
21
-{
20
+class EditingLockRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository {
22 21
     /**
23 22
      * Finds all outdated locks,
24 23
      *
25 24
      * @param integer $timeout : Time interval (in seconds) in which locks are not outdated.
26 25
      * @return array The found Document Objects
27 26
      */
28
-    public function findOutdatedLocks($timeout)
29
-    {
27
+    public function findOutdatedLocks($timeout) {
30 28
         $query = $this->createQuery();
31 29
 
32 30
         $dateTimeObj= new \DateTime();
Please login to merge, or discard this patch.
Classes/Domain/Model/EditingLock.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @package EWW\Dpf\Domain\Model
23 23
  */
24
-class EditingLock extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
25
-{
24
+class EditingLock extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
26 25
     /**
27 26
      * documentIdentifier : A document uid or a qucosa object identifier.
28 27
      *
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      *
43 42
      * @return int
44 43
      */
45
-    public function getDocumentIdentifier()
46
-    {
44
+    public function getDocumentIdentifier() {
47 45
         return $this->documentIdentifier;
48 46
     }
49 47
 
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
      *
53 51
      * @param int $documentIdentifier
54 52
      */
55
-    public function setDocumentIdentifier($documentIdentifier)
56
-    {
53
+    public function setDocumentIdentifier($documentIdentifier) {
57 54
         $this->documentIdentifier = $documentIdentifier;
58 55
     }
59 56
 
@@ -62,8 +59,7 @@  discard block
 block discarded – undo
62 59
      *
63 60
      * @return int
64 61
      */
65
-    public function getEditorUid()
66
-    {
62
+    public function getEditorUid() {
67 63
         return $this->editorUid;
68 64
     }
69 65
 
@@ -72,8 +68,7 @@  discard block
 block discarded – undo
72 68
      *
73 69
      * @param int $editorUid
74 70
      */
75
-    public function setEditorUid($editorUid)
76
-    {
71
+    public function setEditorUid($editorUid) {
77 72
         $this->editorUid = $editorUid;
78 73
     }
79 74
 
Please login to merge, or discard this patch.
Classes/Domain/Model/Bookmark.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
  *
21 21
  * @package EWW\Dpf\Domain\Model
22 22
  */
23
-class Bookmark extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
24
-{
23
+class Bookmark extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
25 24
     /**
26 25
      * documentIdentifier : A document uid or a qucosa object identifier.
27 26
      *
@@ -41,8 +40,7 @@  discard block
 block discarded – undo
41 40
      *
42 41
      * @return int
43 42
      */
44
-    public function getDocumentIdentifier()
45
-    {
43
+    public function getDocumentIdentifier() {
46 44
         return $this->documentIdentifier;
47 45
     }
48 46
 
@@ -51,8 +49,7 @@  discard block
 block discarded – undo
51 49
      *
52 50
      * @param int $documentIdentifier
53 51
      */
54
-    public function setDocumentIdentifier($documentIdentifier)
55
-    {
52
+    public function setDocumentIdentifier($documentIdentifier) {
56 53
         $this->documentIdentifier = $documentIdentifier;
57 54
     }
58 55
 
@@ -61,8 +58,7 @@  discard block
 block discarded – undo
61 58
      *
62 59
      * @return int
63 60
      */
64
-    public function getFeUserUid()
65
-    {
61
+    public function getFeUserUid() {
66 62
         return $this->feUserUid;
67 63
     }
68 64
 
@@ -71,8 +67,7 @@  discard block
 block discarded – undo
71 67
      *
72 68
      * @param int $feUserUid
73 69
      */
74
-    public function setFeUserUid($feUserUid)
75
-    {
70
+    public function setFeUserUid($feUserUid) {
76 71
         $this->feUserUid = $feUserUid;
77 72
     }
78 73
 
Please login to merge, or discard this patch.
Classes/Domain/Workflow/DocumentWorkflow.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,30 +34,30 @@
 block discarded – undo
34 34
     const REMOTE_STATE_INACTIVE     = "INACTIVE";
35 35
     const REMOTE_STATE_DELETED      = "DELETED";
36 36
 
37
-    const STATE_NONE_NONE            = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_NONE;
37
+    const STATE_NONE_NONE            = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_NONE;
38 38
 
39 39
     // New
40
-    const STATE_NEW_NONE             = self::LOCAL_STATE_NEW.':'.self::REMOTE_STATE_NONE;
40
+    const STATE_NEW_NONE             = self::LOCAL_STATE_NEW . ':' . self::REMOTE_STATE_NONE;
41 41
 
42 42
     // Registered
43
-    const STATE_REGISTERED_NONE      = self::LOCAL_STATE_REGISTERED.':'.self::REMOTE_STATE_NONE;
43
+    const STATE_REGISTERED_NONE      = self::LOCAL_STATE_REGISTERED . ':' . self::REMOTE_STATE_NONE;
44 44
 
45 45
     // In progress
46
-    const STATE_IN_PROGRESS_NONE     = self::LOCAL_STATE_IN_PROGRESS.':'.self::REMOTE_STATE_NONE;
47
-    const STATE_IN_PROGRESS_ACTIVE   = self::LOCAL_STATE_IN_PROGRESS.":".self::REMOTE_STATE_ACTIVE;
48
-    const STATE_IN_PROGRESS_INACTIVE = self::LOCAL_STATE_IN_PROGRESS.":".self::REMOTE_STATE_INACTIVE;
49
-    const STATE_IN_PROGRESS_DELETED  = self::LOCAL_STATE_IN_PROGRESS.":".self::REMOTE_STATE_DELETED;
46
+    const STATE_IN_PROGRESS_NONE     = self::LOCAL_STATE_IN_PROGRESS . ':' . self::REMOTE_STATE_NONE;
47
+    const STATE_IN_PROGRESS_ACTIVE   = self::LOCAL_STATE_IN_PROGRESS . ":" . self::REMOTE_STATE_ACTIVE;
48
+    const STATE_IN_PROGRESS_INACTIVE = self::LOCAL_STATE_IN_PROGRESS . ":" . self::REMOTE_STATE_INACTIVE;
49
+    const STATE_IN_PROGRESS_DELETED  = self::LOCAL_STATE_IN_PROGRESS . ":" . self::REMOTE_STATE_DELETED;
50 50
 
51 51
     // Active
52
-    const STATE_NONE_ACTIVE          = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_ACTIVE;
52
+    const STATE_NONE_ACTIVE          = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_ACTIVE;
53 53
 
54 54
     // Postponed
55
-    const STATE_POSTPONED_NONE       = self::LOCAL_STATE_POSTPONED.':'.self::REMOTE_STATE_NONE;
56
-    const STATE_NONE_INACTIVE        = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_INACTIVE;
55
+    const STATE_POSTPONED_NONE       = self::LOCAL_STATE_POSTPONED . ':' . self::REMOTE_STATE_NONE;
56
+    const STATE_NONE_INACTIVE        = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_INACTIVE;
57 57
 
58 58
     // Discarded
59
-    const STATE_DISCARDED_NONE       = self::LOCAL_STATE_DISCARDED.':'.self::REMOTE_STATE_NONE;
60
-    const STATE_NONE_DELETED         = self::LOCAL_STATE_NONE.':'.self::REMOTE_STATE_DELETED;
59
+    const STATE_DISCARDED_NONE       = self::LOCAL_STATE_DISCARDED . ':' . self::REMOTE_STATE_NONE;
60
+    const STATE_NONE_DELETED         = self::LOCAL_STATE_NONE . ':' . self::REMOTE_STATE_DELETED;
61 61
 
62 62
     const TRANSITION_CREATE              = "CREATE_TRANSITION";
63 63
     const TRANSITION_CREATE_REGISTER     = "CREATE_REGISTER_TRANSITION";
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
 use Symfony\Component\Workflow\Workflow;
21 21
 use Symfony\Component\Workflow\Registry;
22 22
 
23
-class DocumentWorkflow
24
-{
23
+class DocumentWorkflow {
25 24
     const LOCAL_STATE_NONE          = 'NONE';
26 25
     const LOCAL_STATE_NEW           = 'NEW';
27 26
     const LOCAL_STATE_REGISTERED    = 'REGISTERED';
@@ -264,8 +263,7 @@  discard block
 block discarded – undo
264 263
         ]
265 264
     ];
266 265
     
267
-    public static function getWorkflow()
268
-    {
266
+    public static function getWorkflow() {
269 267
         $definitionBuilder = new DefinitionBuilder();
270 268
 
271 269
         $definitionBuilder->addPlaces(self::PLACES);
Please login to merge, or discard this patch.
Classes/Services/Document/DocumentCleaner.php 2 patches
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
  * The TYPO3 project - inspiring people to share!
15 15
  */
16 16
 
17
-class DocumentCleaner
18
-{
17
+class DocumentCleaner {
19 18
 
20 19
     /**
21 20
      * clientRepository
@@ -55,8 +54,7 @@  discard block
 block discarded – undo
55 54
      * @param \EWW\Dpf\Domain\Model\Document $openedDocument
56 55
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
57 56
      */
58
-    public function cleanUpDocuments($actionMethodName, $controllerClass)
59
-    {
57
+    public function cleanUpDocuments($actionMethodName, $controllerClass) {
60 58
         $excludeActions = [
61 59
             \EWW\Dpf\Controller\DocumentController::class => [
62 60
                 'showDetailsAction',
@@ -103,8 +101,7 @@  discard block
 block discarded – undo
103 101
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
104 102
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
105 103
      */
106
-    protected function cleanUpOutdatedTemporaryDocuments()
107
-    {
104
+    protected function cleanUpOutdatedTemporaryDocuments() {
108 105
         // Remove outdated temporary documents from the document table.
109 106
         $outdatedTemporaryDocuments = $this->documentRepository->findOutdatedTemporaryDocuments(3600);
110 107
         foreach ($outdatedTemporaryDocuments as $outdatedTemporaryDocument) {
@@ -117,8 +114,7 @@  discard block
 block discarded – undo
117 114
     /**
118 115
      * Unlocks all editing locks of the current user.
119 116
      */
120
-    protected function cleanUpEditingLocks($controllerClass, $actionMethodName)
121
-    {
117
+    protected function cleanUpEditingLocks($controllerClass, $actionMethodName) {
122 118
         $excludeActions = [
123 119
             \EWW\Dpf\Controller\DocumentController::class => [
124 120
             ],
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @var \EWW\Dpf\Domain\Repository\DocumentRepository
24 24
      * @inject
25 25
      */
26
-    protected $documentRepository = null;
26
+    protected $documentRepository = NULL;
27 27
 
28 28
     /**
29 29
      * editingLockService
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @var \EWW\Dpf\Services\Document\EditingLockService
32 32
      * @inject
33 33
      */
34
-    protected $editingLockService = null;
34
+    protected $editingLockService = NULL;
35 35
 
36 36
     /**
37 37
      * persistence manager
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @var \EWW\Dpf\Security\Security
48 48
      * @inject
49 49
      */
50
-    protected $security = null;
50
+    protected $security = NULL;
51 51
 
52 52
     /**
53 53
      * @param string $actionMethodName
Please login to merge, or discard this patch.
Classes/Services/Document/EditingLockService.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 
124 124
     public function getLockedDocumentIdentifiersByUserUid($userUid)
125 125
     {
126
-        $identifiers = array();
126
+        $identifiers = array ();
127 127
 
128 128
         $locks = $this->editingLockRepository->findByEditorUid($userUid);
129 129
         /** @var  \EWW\Dpf\Domain\Model\EditingLock $lock */
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 use EWW\Dpf\Domain\Model\EditingLock;
18 18
 
19
-class EditingLockService
20
-{
19
+class EditingLockService {
21 20
     /**
22 21
      * editingLockRepository
23 22
      *
@@ -41,8 +40,7 @@  discard block
 block discarded – undo
41 40
      * @param int $userUid
42 41
      * @return bool
43 42
      */
44
-    public function lock($documentIdentifier, $userUid)
45
-    {
43
+    public function lock($documentIdentifier, $userUid) {
46 44
         if ($this->editingLockRepository->findOneByDocumentIdentifier($documentIdentifier)) {
47 45
             return FALSE;
48 46
         }
@@ -63,8 +61,7 @@  discard block
 block discarded – undo
63 61
      * @param string $documentIdentifier
64 62
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
65 63
      */
66
-    public function unlock($documentIdentifier)
67
-    {
64
+    public function unlock($documentIdentifier) {
68 65
         /** @var \EWW\Dpf\Domain\Model\EditingLock $editingLock */
69 66
         $editingLock = $this->editingLockRepository->findOneByDocumentIdentifyer($documentIdentifier);
70 67
         $this->editingLockRepository->remove($editingLock);
@@ -78,8 +75,7 @@  discard block
 block discarded – undo
78 75
      * @param int $userUid
79 76
      * @return bool
80 77
      */
81
-    public function isLocked($documentIdentifier, $userUid)
82
-    {
78
+    public function isLocked($documentIdentifier, $userUid) {
83 79
         $locks = $this->editingLockRepository->findByDocumentIdentifier($documentIdentifier);
84 80
 
85 81
         /** @var  \EWW\Dpf\Domain\Model\EditingLock $lock */
@@ -96,8 +92,7 @@  discard block
 block discarded – undo
96 92
      *
97 93
      * @param int $timeout : Time interval (in seconds) in which locks are not outdated, default is 1 hour.
98 94
      */
99
-    public function unlockOutdatedLocks($timeout = 3600)
100
-    {
95
+    public function unlockOutdatedLocks($timeout = 3600) {
101 96
         // Unlock outdated editing locks.
102 97
         $outdatedLocks = $this->editingLockRepository->findOutdatedLocks($timeout);
103 98
         foreach ($outdatedLocks as $outdatedLock) {
@@ -111,8 +106,7 @@  discard block
 block discarded – undo
111 106
      *
112 107
      * @param int $editorUid
113 108
      */
114
-    public function unlockAllByEditor($editorUid)
115
-    {
109
+    public function unlockAllByEditor($editorUid) {
116 110
         $locks = $this->editingLockRepository->findByEditorUid($editorUid);
117 111
         foreach ($locks as $lock) {
118 112
             $this->editingLockRepository->remove($lock);
@@ -121,8 +115,7 @@  discard block
 block discarded – undo
121 115
         $this->persistenceManager->persistAll();
122 116
     }
123 117
 
124
-    public function getLockedDocumentIdentifiersByUserUid($userUid)
125
-    {
118
+    public function getLockedDocumentIdentifiersByUserUid($userUid) {
126 119
         $identifiers = array();
127 120
 
128 121
         $locks = $this->editingLockRepository->findByEditorUid($userUid);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      * @var \EWW\Dpf\Domain\Repository\EditingLockRepository
25 25
      * @inject
26 26
      */
27
-    protected $editingLockRepository = null;
27
+    protected $editingLockRepository = NULL;
28 28
 
29 29
     /**
30 30
      * persistence manager
Please login to merge, or discard this patch.
Classes/Services/Document/DocumentManager.php 2 patches
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
9 9
 use EWW\Dpf\Domain\Workflow\DocumentWorkflow;
10 10
 use EWW\Dpf\Controller\AbstractController;
11 11
 
12
-class DocumentManager
13
-{
12
+class DocumentManager {
14 13
     /**
15 14
      * objectManager
16 15
      *
@@ -75,8 +74,7 @@  discard block
 block discarded – undo
75 74
      * @return Document|null
76 75
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
77 76
      */
78
-    public function read($identifier)
79
-    {
77
+    public function read($identifier) {
80 78
         if (!$identifier) {
81 79
             return null;
82 80
         }
@@ -121,8 +119,7 @@  discard block
 block discarded – undo
121 119
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
122 120
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
123 121
      */
124
-    public function update(Document $document, $workflowTransition = null, $deletedFiles = [], $newFiles = [])
125
-    {
122
+    public function update(Document $document, $workflowTransition = null, $deletedFiles = [], $newFiles = []) {
126 123
         // xml data fields are limited to 64 KB
127 124
         if (strlen($document->getXmlData()) >= 64 * 1024 || strlen($document->getSlubInfoData() >= 64 * 1024)) {
128 125
             throw new \EWW\Dpf\Exceptions\DocumentMaxSizeErrorException("Maximum document size exceeded.");
@@ -214,8 +211,7 @@  discard block
 block discarded – undo
214 211
     /**
215 212
      * @return DocumentTransferManager
216 213
      */
217
-    protected function getDocumentTransferManager()
218
-    {
214
+    protected function getDocumentTransferManager() {
219 215
         /** @var DocumentTransferManager $documentTransferManager */
220 216
         $documentTransferManager = $this->objectManager->get(DocumentTransferManager::class);
221 217
 
@@ -237,8 +233,7 @@  discard block
 block discarded – undo
237 233
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
238 234
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
239 235
      */
240
-    protected function updateFiles(Document $document, $deletedFiles, $newFiles)
241
-    {
236
+    protected function updateFiles(Document $document, $deletedFiles, $newFiles) {
242 237
         // Delete files
243 238
         /** @var File $deleteFile */
244 239
         foreach ($deletedFiles as $deleteFile) {
@@ -265,8 +260,7 @@  discard block
 block discarded – undo
265 260
      * @param $document
266 261
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
267 262
      */
268
-    protected function removeDocument($document)
269
-    {
263
+    protected function removeDocument($document) {
270 264
         $files = $this->fileRepository->findByDocument($document->getUid());
271 265
         foreach ($files as $file) {
272 266
             $this->fileRepository->remove($file);
@@ -285,8 +279,7 @@  discard block
 block discarded – undo
285 279
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
286 280
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
287 281
      */
288
-    protected function updateRemotely($document, $workflowTransition = null, $deletedFiles = [], $newFiles = [])
289
-    {
282
+    protected function updateRemotely($document, $workflowTransition = null, $deletedFiles = [], $newFiles = []) {
290 283
         $lastModDate = $this->getDocumentTransferManager()->getLastModDate($document->getObjectIdentifier());
291 284
         if ($lastModDate !== $document->getRemoteLastModDate()) {
292 285
             // There is a newer version in the fedora repository.
Please login to merge, or discard this patch.
Upper-Lower-Casing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      * @var \TYPO3\CMS\Extbase\Object\ObjectManager
18 18
      * @inject
19 19
      */
20
-    protected $objectManager = null;
20
+    protected $objectManager = NULL;
21 21
 
22 22
     /**
23 23
      * documentRepository
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @var \EWW\Dpf\Domain\Repository\DocumentRepository
26 26
      * @inject
27 27
      */
28
-    protected $documentRepository = null;
28
+    protected $documentRepository = NULL;
29 29
 
30 30
     /**
31 31
      * fileRepository
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @var \EWW\Dpf\Domain\Repository\FileRepository
34 34
      * @inject
35 35
      */
36
-    protected $fileRepository = null;
36
+    protected $fileRepository = NULL;
37 37
 
38 38
     /**
39 39
      * bookmarkRepository
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @var \EWW\Dpf\Domain\Repository\BookmarkRepository
42 42
      * @inject
43 43
      */
44
-    protected $bookmarkRepository = null;
44
+    protected $bookmarkRepository = NULL;
45 45
 
46 46
     /**
47 47
      * persistence manager
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
58 58
      * @inject
59 59
      */
60
-    protected $signalSlotDispatcher = null;
60
+    protected $signalSlotDispatcher = NULL;
61 61
 
62 62
     /**
63 63
      * security
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @var \EWW\Dpf\Security\Security
66 66
      * @inject
67 67
      */
68
-    protected $security = null;
68
+    protected $security = NULL;
69 69
 
70 70
     /**
71 71
      * Returns a document specified by repository object identifier or dataset uid.
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     public function read($identifier)
79 79
     {
80 80
         if (!$identifier) {
81
-            return null;
81
+            return NULL;
82 82
         }
83 83
 
84 84
         $document = $this->documentRepository->findByIdentifier($identifier);
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
             );
100 100
 
101 101
         } catch (\EWW\Dpf\Exceptions\RetrieveDocumentErrorException $exception) {
102
-            return null;
102
+            return NULL;
103 103
         }
104 104
 
105 105
         if ($document instanceof Document) {
106 106
             return $document;
107 107
         }
108 108
 
109
-        return null;
109
+        return NULL;
110 110
     }
111 111
 
112 112
     /**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
122 122
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
123 123
      */
124
-    public function update(Document $document, $workflowTransition = null, $deletedFiles = [], $newFiles = [])
124
+    public function update(Document $document, $workflowTransition = NULL, $deletedFiles = [], $newFiles = [])
125 125
     {
126 126
         // xml data fields are limited to 64 KB
127 127
         if (strlen($document->getXmlData()) >= 64 * 1024 || strlen($document->getSlubInfoData() >= 64 * 1024)) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         if ($workflowTransition) {
135 135
             if (!$workflow->can($document, $workflowTransition)) {
136
-                return false;
136
+                return FALSE;
137 137
             }
138 138
             $workflow->apply($document, $workflowTransition);
139 139
         }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         if ($document->isSuggestion()) {
142 142
 
143 143
             // if local suggestion copy
144
-            $updateResult = false;
144
+            $updateResult = FALSE;
145 145
 
146 146
         } elseif ($document->isTemporaryCopy()) {
147 147
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 $this->removeDocument($document);
186 186
                 $updateResult = $document->getDocumentIdentifier();
187 187
             } else {
188
-                $updateResult = false;
188
+                $updateResult = FALSE;
189 189
             }
190 190
         } else {
191 191
 
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
286 286
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
287 287
      */
288
-    protected function updateRemotely($document, $workflowTransition = null, $deletedFiles = [], $newFiles = [])
288
+    protected function updateRemotely($document, $workflowTransition = NULL, $deletedFiles = [], $newFiles = [])
289 289
     {
290 290
         $lastModDate = $this->getDocumentTransferManager()->getLastModDate($document->getObjectIdentifier());
291 291
         if ($lastModDate !== $document->getRemoteLastModDate()) {
292 292
             // There is a newer version in the fedora repository.
293
-            return false;
293
+            return FALSE;
294 294
         }
295 295
 
296 296
         $this->updateFiles($document, $deletedFiles, $newFiles);
@@ -310,13 +310,13 @@  discard block
 block discarded – undo
310 310
                 break;
311 311
 
312 312
             default:
313
-                $transferState = null;
313
+                $transferState = NULL;
314 314
                 break;
315 315
         }
316 316
 
317 317
         if ($transferState) {
318 318
             if (!$this->getDocumentTransferManager()->delete($document, $transferState)) {
319
-                return false;
319
+                return FALSE;
320 320
             }
321 321
         }
322 322
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
             return $document->getDocumentIdentifier();
326 326
         }
327 327
 
328
-        return false;
328
+        return FALSE;
329 329
     }
330 330
 
331 331
 }
Please login to merge, or discard this patch.
Classes/Services/ElasticSearch/ElasticSearch.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->server = $clientConfigurationManager->getElasticSearchHost();
65 65
         $this->port = $clientConfigurationManager->getElasticSearchPort();
66 66
 
67
-        $hosts = array(
67
+        $hosts = array (
68 68
             $this->server . ':' . $this->port,
69 69
         );
70 70
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             if ($notes && is_array($notes)) {
190 190
                 $data->notes = $notes;
191 191
             } else {
192
-                $data->notes = array();
192
+                $data->notes = array ();
193 193
             }
194 194
 
195 195
             $files = $document->getFile();
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             $this->results = $results;
287 287
 
288 288
             return $this->results;
289
-        } catch ( \Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost $exception) {
289
+        } catch (\Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost $exception) {
290 290
             throw new \EWW\Dpf\Exceptions\ElasticSearchConnectionErrorException("Could not connect to repository server.");
291 291
         } catch (\Elasticsearch\Common\Exceptions\Curl\CouldNotResolveHostException $exception) {
292 292
             throw new \EWW\Dpf\Exceptions\ElasticSearchConnectionErrorException("Could not connect to repository server.");
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
 use TYPO3\CMS\Core\Utility\GeneralUtility;
25 25
 use TYPO3\CMS\Core\Log\LogManager;
26 26
 
27
-class ElasticSearch
28
-{
27
+class ElasticSearch {
29 28
     /**
30 29
      * frontendUserRepository
31 30
      *
@@ -54,8 +53,7 @@  discard block
 block discarded – undo
54 53
     /**
55 54
      * elasticsearch client constructor
56 55
      */
57
-    public function __construct()
58
-    {
56
+    public function __construct() {
59 57
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
60 58
 
61 59
         $this->elasticsearchMapper = $objectManager->get(ElasticsearchMapper::class);
@@ -82,8 +80,7 @@  discard block
 block discarded – undo
82 80
      *
83 81
      * @param $indexName
84 82
      */
85
-    protected function initializeIndex($indexName)
86
-    {
83
+    protected function initializeIndex($indexName) {
87 84
         $paramsIndex = [
88 85
             'index' => $indexName,
89 86
             'body' => [
@@ -169,8 +166,7 @@  discard block
 block discarded – undo
169 166
      *
170 167
      * @param Document $document
171 168
      */
172
-    public function index($document)
173
-    {
169
+    public function index($document) {
174 170
         $data = json_decode($this->elasticsearchMapper->getElasticsearchJson($document));
175 171
 
176 172
         if ($data) {
@@ -234,8 +230,7 @@  discard block
 block discarded – undo
234 230
      *
235 231
      * @param string $identifier
236 232
      */
237
-    public function delete($identifier)
238
-    {
233
+    public function delete($identifier) {
239 234
         try {
240 235
 
241 236
             $params = [
@@ -261,8 +256,7 @@  discard block
 block discarded – undo
261 256
     /**
262 257
      * @param $identifier
263 258
      */
264
-    public function getDocument($identifier)
265
-    {
259
+    public function getDocument($identifier) {
266 260
         $params = [
267 261
             'index' => $this->indexName,
268 262
             'id'    => $identifier
@@ -277,8 +271,7 @@  discard block
 block discarded – undo
277 271
      * @param  array $query search query
278 272
      * @return array        result list
279 273
      */
280
-    public function search($query, $type = null)
281
-    {
274
+    public function search($query, $type = null) {
282 275
         try {
283 276
             // define type and index
284 277
             if (empty($query['index'])) {
@@ -310,8 +303,7 @@  discard block
 block discarded – undo
310 303
      * Get the results
311 304
      * @return mixed
312 305
      */
313
-    public function getResults()
314
-    {
306
+    public function getResults() {
315 307
         // return results from the last search request
316 308
         return $this->results;
317 309
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository
33 33
      * @inject
34 34
      */
35
-    protected $frontendUserRepository = null;
35
+    protected $frontendUserRepository = NULL;
36 36
 
37 37
     protected $client;
38 38
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 ],
112 112
                 'mappings' => [
113 113
                     '_source' => [
114
-                        'enabled' => true
114
+                        'enabled' => TRUE
115 115
                     ],
116 116
                     //'dynamic' => 'strict',
117 117
                     'properties' => [
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                                 'keyword' => [
122 122
                                     'type' => 'text',
123 123
                                     'analyzer' => 'keyword_lowercase',
124
-                                    'fielddata' => true
124
+                                    'fielddata' => TRUE
125 125
                                 ]
126 126
                             ]
127 127
                         ],
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
 
202 202
             $files = $document->getFile();
203 203
             if ($files->count() > 0) {
204
-                $data->hasFiles = true;
204
+                $data->hasFiles = TRUE;
205 205
             } else {
206
-                $data->hasFiles = false;
206
+                $data->hasFiles = FALSE;
207 207
             }
208 208
 
209 209
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      * @param  array $query search query
278 278
      * @return array        result list
279 279
      */
280
-    public function search($query, $type = null)
280
+    public function search($query, $type = NULL)
281 281
     {
282 282
         try {
283 283
             // define type and index
Please login to merge, or discard this patch.