We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 66 |
| Total Lines | 704 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Complex classes like Document often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Document, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 15 | class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var \DateTime |
||
| 19 | */ |
||
| 20 | protected $crdate; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var \DateTime |
||
| 24 | */ |
||
| 25 | protected $tstamp; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected $title; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var string |
||
| 34 | */ |
||
| 35 | protected $prodId; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var string |
||
| 39 | */ |
||
| 40 | protected $location; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var string |
||
| 44 | */ |
||
| 45 | protected $recordId; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @var string |
||
| 49 | */ |
||
| 50 | protected $opacId; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | */ |
||
| 55 | protected $unionId; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @var string |
||
| 59 | */ |
||
| 60 | protected $urn; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @var string |
||
| 64 | */ |
||
| 65 | protected $purl; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @var string |
||
| 69 | */ |
||
| 70 | protected $titleSorting; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @var string |
||
| 74 | */ |
||
| 75 | protected $author; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @var string |
||
| 79 | */ |
||
| 80 | protected $year; |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @var string |
||
| 84 | */ |
||
| 85 | protected $place; |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @var string |
||
| 89 | */ |
||
| 90 | protected $thumbnail; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @var string |
||
| 94 | */ |
||
| 95 | protected $metadata; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * @var string |
||
| 99 | */ |
||
| 100 | protected $metadataSorting; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @var int |
||
| 104 | */ |
||
| 105 | protected $structure; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * @var int |
||
| 109 | */ |
||
| 110 | protected $partof; |
||
| 111 | |||
| 112 | /** |
||
| 113 | * @var string |
||
| 114 | */ |
||
| 115 | protected $volume; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * @var string |
||
| 119 | */ |
||
| 120 | protected $volumeSorting; |
||
| 121 | |||
| 122 | /** |
||
| 123 | * @var string |
||
| 124 | */ |
||
| 125 | protected $license; |
||
| 126 | |||
| 127 | /** |
||
| 128 | * @var string |
||
| 129 | */ |
||
| 130 | protected $terms; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * @var string |
||
| 134 | */ |
||
| 135 | protected $restrictions; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * @var string |
||
| 139 | */ |
||
| 140 | protected $outOfPrint; |
||
| 141 | |||
| 142 | /** |
||
| 143 | * @var string |
||
| 144 | */ |
||
| 145 | protected $rightsInfo; |
||
| 146 | |||
| 147 | /** |
||
| 148 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\Collection> |
||
| 149 | */ |
||
| 150 | protected $collections = null; |
||
| 151 | |||
| 152 | /** |
||
| 153 | * @var string |
||
| 154 | */ |
||
| 155 | protected $metsLabel; |
||
| 156 | |||
| 157 | /** |
||
| 158 | * @var string |
||
| 159 | */ |
||
| 160 | protected $metsOrderlabel; |
||
| 161 | |||
| 162 | /** |
||
| 163 | * @var int |
||
| 164 | */ |
||
| 165 | protected $owner; |
||
| 166 | |||
| 167 | /** |
||
| 168 | * @var int |
||
| 169 | */ |
||
| 170 | protected $solrcore; |
||
| 171 | |||
| 172 | /** |
||
| 173 | * @var int |
||
| 174 | */ |
||
| 175 | protected $status; |
||
| 176 | |||
| 177 | /** |
||
| 178 | * @var string |
||
| 179 | */ |
||
| 180 | protected $documentFormat; |
||
| 181 | |||
| 182 | /** |
||
| 183 | * @return string |
||
| 184 | */ |
||
| 185 | public function getTitle(): string |
||
| 186 | { |
||
| 187 | return $this->title; |
||
| 188 | } |
||
| 189 | |||
| 190 | /** |
||
| 191 | * @param string $title |
||
| 192 | */ |
||
| 193 | public function setTitle(string $title): void |
||
| 194 | { |
||
| 195 | $this->title = $title; |
||
| 196 | } |
||
| 197 | |||
| 198 | /** |
||
| 199 | * @return string |
||
| 200 | */ |
||
| 201 | public function getProdId(): string |
||
| 202 | { |
||
| 203 | return $this->prodId; |
||
| 204 | } |
||
| 205 | |||
| 206 | /** |
||
| 207 | * @param string $prodId |
||
| 208 | */ |
||
| 209 | public function setProdId(string $prodId): void |
||
| 210 | { |
||
| 211 | $this->prodId = $prodId; |
||
| 212 | } |
||
| 213 | |||
| 214 | /** |
||
| 215 | * @return string |
||
| 216 | */ |
||
| 217 | public function getLocation(): string |
||
| 218 | { |
||
| 219 | return $this->location; |
||
| 220 | } |
||
| 221 | |||
| 222 | /** |
||
| 223 | * @param string $location |
||
| 224 | */ |
||
| 225 | public function setLocation(string $location): void |
||
| 226 | { |
||
| 227 | $this->location = $location; |
||
| 228 | } |
||
| 229 | |||
| 230 | /** |
||
| 231 | * @return string |
||
| 232 | */ |
||
| 233 | public function getRecordId(): string |
||
| 234 | { |
||
| 235 | return $this->recordId; |
||
| 236 | } |
||
| 237 | |||
| 238 | /** |
||
| 239 | * @param string $recordId |
||
| 240 | */ |
||
| 241 | public function setRecordId(string $recordId): void |
||
| 242 | { |
||
| 243 | $this->recordId = $recordId; |
||
| 244 | } |
||
| 245 | |||
| 246 | /** |
||
| 247 | * @return string |
||
| 248 | */ |
||
| 249 | public function getOpacId(): string |
||
| 250 | { |
||
| 251 | return $this->opacId; |
||
| 252 | } |
||
| 253 | |||
| 254 | /** |
||
| 255 | * @param string $opacId |
||
| 256 | */ |
||
| 257 | public function setOpacId(string $opacId): void |
||
| 258 | { |
||
| 259 | $this->opacId = $opacId; |
||
| 260 | } |
||
| 261 | |||
| 262 | /** |
||
| 263 | * @return string |
||
| 264 | */ |
||
| 265 | public function getUnionId(): string |
||
| 266 | { |
||
| 267 | return $this->unionId; |
||
| 268 | } |
||
| 269 | |||
| 270 | /** |
||
| 271 | * @param string $unionId |
||
| 272 | */ |
||
| 273 | public function setUnionId(string $unionId): void |
||
| 274 | { |
||
| 275 | $this->unionId = $unionId; |
||
| 276 | } |
||
| 277 | |||
| 278 | /** |
||
| 279 | * @return string |
||
| 280 | */ |
||
| 281 | public function getUrn(): string |
||
| 282 | { |
||
| 283 | return $this->urn; |
||
| 284 | } |
||
| 285 | |||
| 286 | /** |
||
| 287 | * @param string $urn |
||
| 288 | */ |
||
| 289 | public function setUrn(string $urn): void |
||
| 290 | { |
||
| 291 | $this->urn = $urn; |
||
| 292 | } |
||
| 293 | |||
| 294 | /** |
||
| 295 | * @return string |
||
| 296 | */ |
||
| 297 | public function getPurl(): string |
||
| 298 | { |
||
| 299 | return $this->purl; |
||
| 300 | } |
||
| 301 | |||
| 302 | /** |
||
| 303 | * @param string $purl |
||
| 304 | */ |
||
| 305 | public function setPurl(string $purl): void |
||
| 306 | { |
||
| 307 | $this->purl = $purl; |
||
| 308 | } |
||
| 309 | |||
| 310 | /** |
||
| 311 | * @return string |
||
| 312 | */ |
||
| 313 | public function getTitleSorting(): string |
||
| 314 | { |
||
| 315 | return $this->titleSorting; |
||
| 316 | } |
||
| 317 | |||
| 318 | /** |
||
| 319 | * @param string $titleSorting |
||
| 320 | */ |
||
| 321 | public function setTitleSorting(string $titleSorting): void |
||
| 322 | { |
||
| 323 | $this->titleSorting = $titleSorting; |
||
| 324 | } |
||
| 325 | |||
| 326 | /** |
||
| 327 | * @return string |
||
| 328 | */ |
||
| 329 | public function getAuthor(): string |
||
| 330 | { |
||
| 331 | return $this->author; |
||
| 332 | } |
||
| 333 | |||
| 334 | /** |
||
| 335 | * @param string $author |
||
| 336 | */ |
||
| 337 | public function setAuthor(string $author): void |
||
| 338 | { |
||
| 339 | $this->author = $author; |
||
| 340 | } |
||
| 341 | |||
| 342 | /** |
||
| 343 | * @return string |
||
| 344 | */ |
||
| 345 | public function getYear(): string |
||
| 346 | { |
||
| 347 | return $this->year; |
||
| 348 | } |
||
| 349 | |||
| 350 | /** |
||
| 351 | * @param string $year |
||
| 352 | */ |
||
| 353 | public function setYear(string $year): void |
||
| 354 | { |
||
| 355 | $this->year = $year; |
||
| 356 | } |
||
| 357 | |||
| 358 | /** |
||
| 359 | * @return string |
||
| 360 | */ |
||
| 361 | public function getPlace(): string |
||
| 362 | { |
||
| 363 | return $this->place; |
||
| 364 | } |
||
| 365 | |||
| 366 | /** |
||
| 367 | * @param string $place |
||
| 368 | */ |
||
| 369 | public function setPlace(string $place): void |
||
| 370 | { |
||
| 371 | $this->place = $place; |
||
| 372 | } |
||
| 373 | |||
| 374 | /** |
||
| 375 | * @return string |
||
| 376 | */ |
||
| 377 | public function getThumbnail(): string |
||
| 378 | { |
||
| 379 | return $this->thumbnail; |
||
| 380 | } |
||
| 381 | |||
| 382 | /** |
||
| 383 | * @param string $thumbnail |
||
| 384 | */ |
||
| 385 | public function setThumbnail(string $thumbnail): void |
||
| 386 | { |
||
| 387 | $this->thumbnail = $thumbnail; |
||
| 388 | } |
||
| 389 | |||
| 390 | /** |
||
| 391 | * @return string |
||
| 392 | */ |
||
| 393 | public function getMetadata(): string |
||
| 394 | { |
||
| 395 | return $this->metadata; |
||
| 396 | } |
||
| 397 | |||
| 398 | /** |
||
| 399 | * @param string $metadata |
||
| 400 | */ |
||
| 401 | public function setMetadata(string $metadata): void |
||
| 402 | { |
||
| 403 | $this->metadata = $metadata; |
||
| 404 | } |
||
| 405 | |||
| 406 | /** |
||
| 407 | * @return string |
||
| 408 | */ |
||
| 409 | public function getMetadataSorting(): string |
||
| 410 | { |
||
| 411 | return $this->metadataSorting; |
||
| 412 | } |
||
| 413 | |||
| 414 | /** |
||
| 415 | * @param string $metadataSorting |
||
| 416 | */ |
||
| 417 | public function setMetadataSorting(string $metadataSorting): void |
||
| 418 | { |
||
| 419 | $this->metadataSorting = $metadataSorting; |
||
| 420 | } |
||
| 421 | |||
| 422 | /** |
||
| 423 | * @return int |
||
| 424 | */ |
||
| 425 | public function getStructure(): int |
||
| 426 | { |
||
| 427 | return $this->structure; |
||
| 428 | } |
||
| 429 | |||
| 430 | /** |
||
| 431 | * @param int $structure |
||
| 432 | */ |
||
| 433 | public function setStructure(int $structure): void |
||
| 434 | { |
||
| 435 | $this->structure = $structure; |
||
| 436 | } |
||
| 437 | |||
| 438 | /** |
||
| 439 | * @return int |
||
| 440 | */ |
||
| 441 | public function getPartof(): int |
||
| 442 | { |
||
| 443 | return $this->partof; |
||
| 444 | } |
||
| 445 | |||
| 446 | /** |
||
| 447 | * @param int $partof |
||
| 448 | */ |
||
| 449 | public function setPartof(int $partof): void |
||
| 450 | { |
||
| 451 | $this->partof = $partof; |
||
| 452 | } |
||
| 453 | |||
| 454 | /** |
||
| 455 | * @return string |
||
| 456 | */ |
||
| 457 | public function getVolume(): string |
||
| 458 | { |
||
| 459 | return $this->volume; |
||
| 460 | } |
||
| 461 | |||
| 462 | /** |
||
| 463 | * @param string $volume |
||
| 464 | */ |
||
| 465 | public function setVolume(string $volume): void |
||
| 466 | { |
||
| 467 | $this->volume = $volume; |
||
| 468 | } |
||
| 469 | |||
| 470 | /** |
||
| 471 | * @return string |
||
| 472 | */ |
||
| 473 | public function getVolumeSorting(): string |
||
| 474 | { |
||
| 475 | return $this->volumeSorting; |
||
| 476 | } |
||
| 477 | |||
| 478 | /** |
||
| 479 | * @param string $volumeSorting |
||
| 480 | */ |
||
| 481 | public function setVolumeSorting(string $volumeSorting): void |
||
| 482 | { |
||
| 483 | $this->volumeSorting = $volumeSorting; |
||
| 484 | } |
||
| 485 | |||
| 486 | /** |
||
| 487 | * @return string |
||
| 488 | */ |
||
| 489 | public function getLicense(): string |
||
| 490 | { |
||
| 491 | return $this->license; |
||
| 492 | } |
||
| 493 | |||
| 494 | /** |
||
| 495 | * @param string $license |
||
| 496 | */ |
||
| 497 | public function setLicense(string $license): void |
||
| 498 | { |
||
| 499 | $this->license = $license; |
||
| 500 | } |
||
| 501 | |||
| 502 | /** |
||
| 503 | * @return string |
||
| 504 | */ |
||
| 505 | public function getTerms(): string |
||
| 506 | { |
||
| 507 | return $this->terms; |
||
| 508 | } |
||
| 509 | |||
| 510 | /** |
||
| 511 | * @param string $terms |
||
| 512 | */ |
||
| 513 | public function setTerms(string $terms): void |
||
| 514 | { |
||
| 515 | $this->terms = $terms; |
||
| 516 | } |
||
| 517 | |||
| 518 | /** |
||
| 519 | * @return string |
||
| 520 | */ |
||
| 521 | public function getRestrictions(): string |
||
| 522 | { |
||
| 523 | return $this->restrictions; |
||
| 524 | } |
||
| 525 | |||
| 526 | /** |
||
| 527 | * @param string $restrictions |
||
| 528 | */ |
||
| 529 | public function setRestrictions(string $restrictions): void |
||
| 530 | { |
||
| 531 | $this->restrictions = $restrictions; |
||
| 532 | } |
||
| 533 | |||
| 534 | /** |
||
| 535 | * @return string |
||
| 536 | */ |
||
| 537 | public function getOutOfPrint(): string |
||
| 538 | { |
||
| 539 | return $this->outOfPrint; |
||
| 540 | } |
||
| 541 | |||
| 542 | /** |
||
| 543 | * @param string $outOfPrint |
||
| 544 | */ |
||
| 545 | public function setOutOfPrint(string $outOfPrint): void |
||
| 546 | { |
||
| 547 | $this->outOfPrint = $outOfPrint; |
||
| 548 | } |
||
| 549 | |||
| 550 | /** |
||
| 551 | * @return string |
||
| 552 | */ |
||
| 553 | public function getRightsInfo(): string |
||
| 554 | { |
||
| 555 | return $this->rightsInfo; |
||
| 556 | } |
||
| 557 | |||
| 558 | /** |
||
| 559 | * @param string $rightsInfo |
||
| 560 | */ |
||
| 561 | public function setRightsInfo(string $rightsInfo): void |
||
| 562 | { |
||
| 563 | $this->rightsInfo = $rightsInfo; |
||
| 564 | } |
||
| 565 | |||
| 566 | |||
| 567 | /** |
||
| 568 | * Returns the collections |
||
| 569 | * |
||
| 570 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\Collection> $collections |
||
| 571 | */ |
||
| 572 | public function getCollections() |
||
| 573 | { |
||
| 574 | return $this->collections; |
||
| 575 | } |
||
| 576 | |||
| 577 | /** |
||
| 578 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\Collection> $collections |
||
| 579 | */ |
||
| 580 | public function setCollections(?\TYPO3\CMS\Extbase\Persistence\ObjectStorage $collections): void |
||
| 581 | { |
||
| 582 | $this->collections = $collections; |
||
| 583 | } |
||
| 584 | |||
| 585 | /** |
||
| 586 | * @return string |
||
| 587 | */ |
||
| 588 | public function getMetsLabel(): string |
||
| 589 | { |
||
| 590 | return $this->metsLabel; |
||
| 591 | } |
||
| 592 | |||
| 593 | /** |
||
| 594 | * @param string $metsLabel |
||
| 595 | */ |
||
| 596 | public function setMetsLabel(string $metsLabel): void |
||
| 597 | { |
||
| 598 | $this->metsLabel = $metsLabel; |
||
| 599 | } |
||
| 600 | |||
| 601 | /** |
||
| 602 | * @return string |
||
| 603 | */ |
||
| 604 | public function getMetsOrderlabel(): string |
||
| 605 | { |
||
| 606 | return $this->metsOrderlabel; |
||
| 607 | } |
||
| 608 | |||
| 609 | /** |
||
| 610 | * @param string $metsOrderlabel |
||
| 611 | */ |
||
| 612 | public function setMetsOrderlabel(string $metsOrderlabel): void |
||
| 613 | { |
||
| 614 | $this->metsOrderlabel = $metsOrderlabel; |
||
| 615 | } |
||
| 616 | |||
| 617 | /** |
||
| 618 | * @return int |
||
| 619 | */ |
||
| 620 | public function getOwner(): int |
||
| 621 | { |
||
| 622 | return $this->owner; |
||
| 623 | } |
||
| 624 | |||
| 625 | /** |
||
| 626 | * @param int $owner |
||
| 627 | */ |
||
| 628 | public function setOwner(int $owner): void |
||
| 629 | { |
||
| 630 | $this->owner = $owner; |
||
| 631 | } |
||
| 632 | |||
| 633 | /** |
||
| 634 | * @return int |
||
| 635 | */ |
||
| 636 | public function getSolrcore(): int |
||
| 637 | { |
||
| 638 | return $this->solrcore; |
||
| 639 | } |
||
| 640 | |||
| 641 | /** |
||
| 642 | * @param int $solrcore |
||
| 643 | */ |
||
| 644 | public function setSolrcore(int $solrcore): void |
||
| 645 | { |
||
| 646 | $this->solrcore = $solrcore; |
||
| 647 | } |
||
| 648 | |||
| 649 | /** |
||
| 650 | * @return int |
||
| 651 | */ |
||
| 652 | public function getStatus(): int |
||
| 653 | { |
||
| 654 | return $this->status; |
||
| 655 | } |
||
| 656 | |||
| 657 | /** |
||
| 658 | * @param int $status |
||
| 659 | */ |
||
| 660 | public function setStatus(int $status): void |
||
| 661 | { |
||
| 662 | $this->status = $status; |
||
| 663 | } |
||
| 664 | |||
| 665 | /** |
||
| 666 | * @return string |
||
| 667 | */ |
||
| 668 | public function getDocumentFormat(): string |
||
| 669 | { |
||
| 670 | return $this->documentFormat; |
||
| 671 | } |
||
| 672 | |||
| 673 | /** |
||
| 674 | * @param string $documentFormat |
||
| 675 | */ |
||
| 676 | public function setDocumentFormat(string $documentFormat): void |
||
| 677 | { |
||
| 678 | $this->documentFormat = $documentFormat; |
||
| 679 | } |
||
| 680 | |||
| 681 | /** |
||
| 682 | * Returns the timestamp |
||
| 683 | * |
||
| 684 | * @return \DateTime |
||
| 685 | */ |
||
| 686 | public function getTstamp(): \DateTime |
||
| 687 | { |
||
| 688 | return $this->tstamp; |
||
| 689 | } |
||
| 690 | |||
| 691 | /** |
||
| 692 | * Sets the timestamp |
||
| 693 | * |
||
| 694 | * @param \DateTime $tstamp |
||
| 695 | */ |
||
| 696 | public function setTstamp($tstamp): void |
||
| 699 | } |
||
| 700 | |||
| 701 | /** |
||
| 702 | * Returns the creation date |
||
| 703 | * |
||
| 704 | * @return \DateTime |
||
| 705 | */ |
||
| 706 | public function getCrdate(): \DateTime |
||
| 707 | { |
||
| 708 | return $this->crdate; |
||
| 709 | } |
||
| 710 | |||
| 711 | /** |
||
| 712 | * Sets the creation date |
||
| 713 | * |
||
| 714 | * @param \DateTime $crdate |
||
| 715 | */ |
||
| 716 | public function setCrdate($crdate): void |
||
| 717 | { |
||
| 718 | $this->crdate = $crdate; |
||
| 719 | } |
||
| 720 | |||
| 721 | } |
||
| 722 |