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