Passed
Push — master ( e51dd6...1991ec )
by Ralf
12:21
created
Classes/Domain/Model/DocumentForm.php 1 patch
Braces   +29 added lines, -58 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
  * The TYPO3 project - inspiring people to share!
21 21
  */
22 22
 
23
-class DocumentForm extends AbstractFormElement
24
-{
23
+class DocumentForm extends AbstractFormElement {
25 24
 
26 25
     /**
27 26
      * @var string CSRF token for this form
@@ -103,8 +102,7 @@  discard block
 block discarded – undo
103 102
      *
104 103
      * @param string $csrfToken
105 104
      */
106
-    public function generateCsrfToken()
107
-    {
105
+    public function generateCsrfToken() {
108 106
         $formProtection = FormProtectionFactory::get();
109 107
         $this->csrfToken = $formProtection->generateToken('DocumentForm', 'construct', 'DocumentForm');
110 108
         $formProtection->persistSessionToken();
@@ -119,10 +117,8 @@  discard block
 block discarded – undo
119 117
      * @throws Exception if the given string is empty.
120 118
      * @throws TypeError if the given string is null
121 119
      */
122
-    public function setCsrfToken(string $csrfToken)
123
-    {
124
-        if ($csrfToken === "")
125
-        {
120
+    public function setCsrfToken(string $csrfToken) {
121
+        if ($csrfToken === "") {
126 122
             throw new Exception("A forms CSRF token cannot be empty");
127 123
         }
128 124
         $this->csrfToken = $csrfToken;
@@ -134,8 +130,7 @@  discard block
 block discarded – undo
134 130
      *
135 131
      * @return string CSRF token for this form
136 132
      */
137
-    public function getCsrfToken()
138
-    {
133
+    public function getCsrfToken() {
139 134
         return $this->csrfToken;
140 135
     }
141 136
 
@@ -145,8 +140,7 @@  discard block
 block discarded – undo
145 140
      *
146 141
      * @return bool True, is CSRF token is considered valid. False if the token is invalid or missing.
147 142
      */
148
-    public function hasValidCsrfToken()
149
-    {
143
+    public function hasValidCsrfToken() {
150 144
         $formProtection = FormProtectionFactory::get();
151 145
         return $formProtection->validateToken($this->csrfToken, 'DocumentForm', 'construct', 'DocumentForm');
152 146
     }
@@ -155,8 +149,7 @@  discard block
 block discarded – undo
155 149
      *
156 150
      * @return integer
157 151
      */
158
-    public function getDocumentUid()
159
-    {
152
+    public function getDocumentUid() {
160 153
         return $this->documentUid;
161 154
     }
162 155
 
@@ -164,8 +157,7 @@  discard block
 block discarded – undo
164 157
      *
165 158
      * @param integer $documentUid
166 159
      */
167
-    public function setDocumentUid($documentUid)
168
-    {
160
+    public function setDocumentUid($documentUid) {
169 161
         $this->documentUid = $documentUid;
170 162
     }
171 163
 
@@ -173,8 +165,7 @@  discard block
 block discarded – undo
173 165
      *
174 166
      * @return boolean
175 167
      */
176
-    public function getPrimaryFileMandatory()
177
-    {
168
+    public function getPrimaryFileMandatory() {
178 169
         return $this->primaryFileMandatory;
179 170
     }
180 171
 
@@ -182,8 +173,7 @@  discard block
 block discarded – undo
182 173
      *
183 174
      * @param boolean $primaryFileMandatory
184 175
      */
185
-    public function setPrimaryFileMandatory($primaryFileMandatory)
186
-    {
176
+    public function setPrimaryFileMandatory($primaryFileMandatory) {
187 177
         $this->primaryFileMandatory = boolval($primaryFileMandatory);
188 178
     }
189 179
 
@@ -191,8 +181,7 @@  discard block
 block discarded – undo
191 181
      *
192 182
      * @return string
193 183
      */
194
-    public function getFedoraPid()
195
-    {
184
+    public function getFedoraPid() {
196 185
         return $this->fedoraPid;
197 186
     }
198 187
 
@@ -200,8 +189,7 @@  discard block
 block discarded – undo
200 189
      *
201 190
      * @param string $fedoraPid
202 191
      */
203
-    public function setFedoraPid($fedoraPid)
204
-    {
192
+    public function setFedoraPid($fedoraPid) {
205 193
         $this->fedoraPid = $fedoraPid;
206 194
     }
207 195
 
@@ -209,8 +197,7 @@  discard block
 block discarded – undo
209 197
      *
210 198
      * @param type \EWW\Dpf\Domain\Model\File $primaryFile
211 199
      */
212
-    public function setPrimaryFile($primaryFile)
213
-    {
200
+    public function setPrimaryFile($primaryFile) {
214 201
         $this->primaryFile = $primaryFile;
215 202
     }
216 203
 
@@ -218,59 +205,49 @@  discard block
 block discarded – undo
218 205
      *
219 206
      * @return \EWW\Dpf\Domain\Model\File
220 207
      */
221
-    public function getPrimaryFile()
222
-    {
208
+    public function getPrimaryFile() {
223 209
         return $this->primaryFile;
224 210
     }
225 211
 
226
-    public function setSecondaryFiles($secondaryFiles)
227
-    {
212
+    public function setSecondaryFiles($secondaryFiles) {
228 213
         $this->secondaryFiles = $secondaryFiles;
229 214
     }
230 215
 
231
-    public function getSecondaryFiles()
232
-    {
216
+    public function getSecondaryFiles() {
233 217
         return $this->secondaryFiles;
234 218
     }
235 219
 
236
-    public function getDeletedFiles()
237
-    {
220
+    public function getDeletedFiles() {
238 221
         return $this->deletedFiles;
239 222
     }
240 223
 
241
-    public function setDeletedFiles($deletedFiles)
242
-    {
224
+    public function setDeletedFiles($deletedFiles) {
243 225
         $this->deletedFiles = $deletedFiles;
244 226
     }
245 227
 
246
-    public function getNewFiles()
247
-    {
228
+    public function getNewFiles() {
248 229
         return $this->newFiles;
249 230
     }
250 231
 
251
-    public function setNewFiles($newFiles)
252
-    {
232
+    public function setNewFiles($newFiles) {
253 233
         $this->newFiles = $newFiles;
254 234
     }
255 235
 
256 236
     /**
257 237
      * @return bool
258 238
      */
259
-    public function getValid()
260
-    {
239
+    public function getValid() {
261 240
         return $this->valid;
262 241
     }
263 242
 
264 243
     /**
265 244
      * @param bool $valid
266 245
      */
267
-    public function setValid($valid)
268
-    {
246
+    public function setValid($valid) {
269 247
         $this->valid = boolval($valid);
270 248
     }
271 249
 
272
-    public function getNewFileNames()
273
-    {
250
+    public function getNewFileNames() {
274 251
         $fileNames = array();
275 252
         foreach ($this->getNewFiles() as $file) {
276 253
             $fileNames[] = $file->getTitle();
@@ -283,8 +260,7 @@  discard block
 block discarded – undo
283 260
      *
284 261
      * @return string
285 262
      */
286
-    public function getProcessNumber()
287
-    {
263
+    public function getProcessNumber() {
288 264
         return $this->processNumber;
289 265
     }
290 266
 
@@ -293,8 +269,7 @@  discard block
 block discarded – undo
293 269
      *
294 270
      * @param string $processNumber
295 271
      */
296
-    public function setProcessNumber($processNumber)
297
-    {
272
+    public function setProcessNumber($processNumber) {
298 273
         $this->processNumber = $processNumber;
299 274
     }
300 275
 
@@ -303,8 +278,7 @@  discard block
 block discarded – undo
303 278
      *
304 279
      * @return bool
305 280
      */
306
-    public function isTemporary()
307
-    {
281
+    public function isTemporary() {
308 282
         return $this->temporary;
309 283
     }
310 284
 
@@ -312,24 +286,21 @@  discard block
 block discarded – undo
312 286
      * Sets if a document is a temporary document or not.
313 287
      * @param bool $temporary
314 288
      */
315
-    public function setTemporary($temporary)
316
-    {
289
+    public function setTemporary($temporary) {
317 290
         $this->temporary = boolval($temporary);
318 291
     }
319 292
 
320 293
     /**
321 294
      * @return string
322 295
      */
323
-    public function getComment()
324
-    {
296
+    public function getComment() {
325 297
         return $this->comment;
326 298
     }
327 299
 
328 300
     /**
329 301
      * @param string $comment
330 302
      */
331
-    public function setComment($comment)
332
-    {
303
+    public function setComment($comment) {
333 304
         $this->comment = $comment;
334 305
     }
335 306
 }
Please login to merge, or discard this patch.
Classes/Helper/DocumentMapper.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
 use EWW\Dpf\Domain\Workflow\DocumentWorkflow;
21 21
 use EWW\Dpf\Services\ProcessNumber\ProcessNumberGenerator;
22 22
 
23
-class DocumentMapper
24
-{
23
+class DocumentMapper {
25 24
 
26 25
     /**
27 26
      * objectManager
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
91 90
      *
92 91
      * @return mixed
93 92
      */
94
-    public function getSettings()
95
-    {
93
+    public function getSettings() {
96 94
         $frameworkConfiguration = $this->configurationManager->getConfiguration(
97 95
             \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
98 96
         );
@@ -106,8 +104,7 @@  discard block
 block discarded – undo
106 104
      * @param bool $generateEmptyFields
107 105
      * @return \EWW\Dpf\Domain\Model\DocumentForm
108 106
      */
109
-    public function getDocumentForm(Document $document, $generateEmptyFields = true)
110
-    {
107
+    public function getDocumentForm(Document $document, $generateEmptyFields = true) {
111 108
         $documentForm = new \EWW\Dpf\Domain\Model\DocumentForm();
112 109
         $documentForm->generateCsrfToken();
113 110
         $documentForm->setUid($document->getDocumentType()->getUid());
@@ -344,8 +341,7 @@  discard block
 block discarded – undo
344 341
         return $documentForm;
345 342
     }
346 343
 
347
-    public function getDocument($documentForm)
348
-    {
344
+    public function getDocument($documentForm) {
349 345
         /** @var Document $document */
350 346
 
351 347
         if ($documentForm->getDocumentUid()) {
@@ -407,8 +403,7 @@  discard block
 block discarded – undo
407 403
         return $document;
408 404
     }
409 405
 
410
-    public function getMetadata($documentForm)
411
-    {
406
+    public function getMetadata($documentForm) {
412 407
 
413 408
         foreach ($documentForm->getItems() as $page) {
414 409
 
Please login to merge, or discard this patch.