| Total Complexity | 67 |
| Total Lines | 647 |
| Duplicated Lines | 0 % |
| Changes | 7 | ||
| Bugs | 0 | Features | 0 |
Complex classes like People 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 People, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 32 | #[ApiResource( |
||
| 33 | operations: [ |
||
| 34 | |||
| 35 | new Get(security: 'is_granted(\'ROLE_CLIENT\')'), |
||
| 36 | new Post( |
||
| 37 | uriTemplate: '/people/{id}/add-user', |
||
| 38 | controller: CreateUserAction::class, |
||
| 39 | securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')', |
||
| 40 | ), |
||
| 41 | new GetCollection( |
||
| 42 | securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')', |
||
| 43 | ), |
||
| 44 | new GetCollection( |
||
| 45 | security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')', |
||
| 46 | uriTemplate: '/people/company/default', |
||
| 47 | controller: GetDefaultCompanyAction::class |
||
| 48 | ), |
||
| 49 | new GetCollection( |
||
| 50 | uriTemplate: '/people/companies/my', |
||
| 51 | controller: GetMyCompaniesAction::class |
||
| 52 | ), |
||
| 53 | |||
| 54 | new GetCollection( |
||
| 55 | uriTemplate: '/people/professionals/close/{lat}/{lng}', |
||
| 56 | openapiContext: [], |
||
| 57 | controller: GetCloseProfessionalsAction::class |
||
| 58 | ) |
||
| 59 | ], |
||
| 60 | formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
||
| 61 | security: 'is_granted(\'ROLE_CLIENT\')', |
||
| 62 | normalizationContext: ['groups' => ['people_read']], |
||
| 63 | denormalizationContext: ['groups' => ['people_write']] |
||
| 64 | )] |
||
| 65 | class People |
||
| 66 | { |
||
| 67 | /** |
||
| 68 | * @ORM\Column(type="integer", nullable=false) |
||
| 69 | * @ORM\Id |
||
| 70 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
| 71 | * @Groups({ |
||
| 72 | * "category_read","order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 73 | * "order_detail_status_read", "mycontract_read", |
||
| 74 | * "my_contract_item_read", "mycontractpeople_read", |
||
| 75 | * "task_read", "task_interaction_read","coupon_read","logistic_read", |
||
| 76 | * "pruduct_read","queue_read","display_read","notifications_read","people_provider_read" |
||
| 77 | * }) |
||
| 78 | */ |
||
| 79 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
||
| 80 | |||
| 81 | private $id; |
||
| 82 | /** |
||
| 83 | * @ORM\Column(type="boolean", nullable=false) |
||
| 84 | * @Groups({ |
||
| 85 | * "category_read","order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 86 | * "order_detail_status_read", "mycontract_read", |
||
| 87 | * "my_contract_item_read", "mycontractpeople_read", |
||
| 88 | * "task_read", "task_interaction_read","coupon_read","logistic_read", |
||
| 89 | * "pruduct_read","queue_read","display_read","notifications_read","people_provider_read" |
||
| 90 | * }) |
||
| 91 | */ |
||
| 92 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['enable' => 'exact'])] |
||
| 93 | |||
| 94 | private $enable = 0; |
||
| 95 | /** |
||
| 96 | * @ORM\Column(type="boolean", nullable=false) |
||
| 97 | * @Groups({ |
||
| 98 | * "category_read","order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 99 | * "order_detail_status_read", "mycontract_read", |
||
| 100 | * "my_contract_item_read", "mycontractpeople_read", |
||
| 101 | * "task_read", "task_interaction_read","coupon_read","logistic_read", |
||
| 102 | * "pruduct_read","queue_read","display_read","notifications_read","people_provider_read" |
||
| 103 | * }) |
||
| 104 | */ |
||
| 105 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['icms' => 'exact'])] |
||
| 106 | |||
| 107 | private $icms = 1; |
||
| 108 | /** |
||
| 109 | * @ORM\Column(type="string", length=50, nullable=false) |
||
| 110 | * @Groups({ |
||
| 111 | * "category_read","order_read", "document_read", "email_read", "people_read", |
||
| 112 | * "invoice_read", "order_detail_status_read", "mycontract_read", |
||
| 113 | * "my_contract_item_read", "mycontractpeople_read", |
||
| 114 | * "task_read", "task_interaction_read","coupon_read", "logistic_read", |
||
| 115 | * "queue_read","display_read","notifications_read","people_provider_read" |
||
| 116 | * }) |
||
| 117 | */ |
||
| 118 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['name' => 'partial'])] |
||
| 119 | |||
| 120 | private $name; |
||
| 121 | /** |
||
| 122 | * @ORM\Column(type="datetime", nullable=false, columnDefinition="DATETIME") |
||
| 123 | */ |
||
| 124 | private $registerDate; |
||
| 125 | /** |
||
| 126 | * @ORM\Column(type="string", length=50, nullable=false) |
||
| 127 | * @Groups({ |
||
| 128 | * "category_read","order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 129 | * "order_detail_status_read", "mycontract_read", |
||
| 130 | * "my_contract_item_read", "mycontractpeople_read", |
||
| 131 | * "task_read", "task_interaction_read","coupon_read","logistic_read", |
||
| 132 | * "pruduct_read","queue_read","display_read","notifications_read","people_provider_read" |
||
| 133 | * }) |
||
| 134 | */ |
||
| 135 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['alias' => 'partial'])] |
||
| 136 | |||
| 137 | private $alias; |
||
| 138 | /** |
||
| 139 | * @var string |
||
| 140 | * |
||
| 141 | * @ORM\Column(name="other_informations", type="json", nullable=true) |
||
| 142 | * @Groups({ |
||
| 143 | * "order_read", "document_read", "email_read", "people_read", "invoice_read", |
||
| 144 | * "order_detail_status_read", "mycontract_read", |
||
| 145 | * "my_contract_item_read", "mycontractpeople_read", |
||
| 146 | * "task_read", "task_interaction_read","coupon_read" |
||
| 147 | * }) |
||
| 148 | */ |
||
| 149 | private $otherInformations; |
||
| 150 | /** |
||
| 151 | * @ORM\Column(type="string", length=1, nullable=false) |
||
| 152 | * @Groups({"pruduct_read","display_read","people_read", "my_contract_item_read", "mycontractpeople_read", "task_read", "task_interaction_read"}) |
||
| 153 | */ |
||
| 154 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['peopleType' => 'exact'])] |
||
| 155 | |||
| 156 | private $peopleType = 'F'; |
||
| 157 | /** |
||
| 158 | * @ORM\Column(type="float", nullable=false) |
||
| 159 | * @Groups({"people_read"}) |
||
| 160 | */ |
||
| 161 | private $billing = 0; |
||
| 162 | /** |
||
| 163 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File", inversedBy="people") |
||
| 164 | * @ORM\JoinColumns({ |
||
| 165 | * @ORM\JoinColumn(name="image_id", referencedColumnName="id") |
||
| 166 | * }) |
||
| 167 | * @Groups({"people_read","display_read"}) |
||
| 168 | */ |
||
| 169 | private $file; |
||
| 170 | /** |
||
| 171 | * @var Collection |
||
| 172 | * |
||
| 173 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Config", mappedBy="people") |
||
| 174 | * @ORM\OrderBy({"config_key" = "ASC"}) |
||
| 175 | */ |
||
| 176 | private $config; |
||
| 177 | /** |
||
| 178 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File") |
||
| 179 | * @ORM\JoinColumns({ |
||
| 180 | * @ORM\JoinColumn(name="alternative_image", referencedColumnName="id") |
||
| 181 | * }) |
||
| 182 | */ |
||
| 183 | private $alternativeFile; |
||
| 184 | /** |
||
| 185 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File") |
||
| 186 | * @ORM\JoinColumns({ |
||
| 187 | * @ORM\JoinColumn(name="background_image", referencedColumnName="id") |
||
| 188 | * }) |
||
| 189 | */ |
||
| 190 | private $backgroundFile; |
||
| 191 | /** |
||
| 192 | * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Language", inversedBy="people") |
||
| 193 | * @ORM\JoinColumns({ |
||
| 194 | * @ORM\JoinColumn(name="language_id", referencedColumnName="id") |
||
| 195 | * }) |
||
| 196 | */ |
||
| 197 | private $language; |
||
| 198 | /** |
||
| 199 | * @var Collection |
||
| 200 | * |
||
| 201 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\PeopleLink", mappedBy="company") |
||
| 202 | */ |
||
| 203 | private $company; |
||
| 204 | |||
| 205 | /** |
||
| 206 | * @var Collection |
||
| 207 | * |
||
| 208 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\PeopleLink", mappedBy="people") |
||
| 209 | * |
||
| 210 | */ |
||
| 211 | private $link; |
||
| 212 | |||
| 213 | /** |
||
| 214 | * @var Collection |
||
| 215 | * |
||
| 216 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\User", mappedBy="people") |
||
| 217 | * @ORM\OrderBy({"username" = "ASC"}) |
||
| 218 | * @Groups({"people_read"}) |
||
| 219 | */ |
||
| 220 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['user' => 'exact'])] |
||
| 221 | |||
| 222 | private $user; |
||
| 223 | /** |
||
| 224 | * @var Collection |
||
| 225 | * |
||
| 226 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Document", mappedBy="people") |
||
| 227 | * @Groups({"people_read", "task_interaction_read"}) |
||
| 228 | */ |
||
| 229 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['document' => 'exact'])] |
||
| 230 | |||
| 231 | private $document; |
||
| 232 | /** |
||
| 233 | * @var Collection |
||
| 234 | * |
||
| 235 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Address", mappedBy="people") |
||
| 236 | * @ORM\OrderBy({"nickname" = "ASC"}) |
||
| 237 | * @Groups({"people_read", "logistic_read"}) |
||
| 238 | */ |
||
| 239 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['address' => 'exact'])] |
||
| 240 | |||
| 241 | private $address; |
||
| 242 | /** |
||
| 243 | * @var Collection |
||
| 244 | * |
||
| 245 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Phone", mappedBy="people") |
||
| 246 | * @Groups({"people_read", "task_interaction_read"}) |
||
| 247 | */ |
||
| 248 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['phone' => 'exact'])] |
||
| 249 | |||
| 250 | private $phone; |
||
| 251 | /** |
||
| 252 | * @var Collection |
||
| 253 | * |
||
| 254 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Email", mappedBy="people") |
||
| 255 | * @Groups({"people_read", "get_contracts", "task_interaction_read"}) |
||
| 256 | */ |
||
| 257 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['email' => 'exact'])] |
||
| 258 | |||
| 259 | private $email; |
||
| 260 | /** |
||
| 261 | * Many Peoples have Many Contracts. |
||
| 262 | * |
||
| 263 | * @ORM\OneToMany (targetEntity="ControleOnline\Entity\ContractPeople", mappedBy="people") |
||
| 264 | */ |
||
| 265 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['contractsPeople' => 'exact'])] |
||
| 266 | |||
| 267 | private $contractsPeople; |
||
| 268 | |||
| 269 | /** |
||
| 270 | * @ORM\Column(type="string", length=255, nullable=false) |
||
| 271 | * @Groups({"people_read"}) |
||
| 272 | */ |
||
| 273 | private $billingDays; |
||
| 274 | /** |
||
| 275 | * @ORM\Column(type="integer", nullable=false) |
||
| 276 | * @Groups({"people_read", "my_contract_item_read", "mycontractpeople_read"}) |
||
| 277 | */ |
||
| 278 | private $paymentTerm; |
||
| 279 | |||
| 280 | |||
| 281 | /** |
||
| 282 | * @ORM\Column(type="datetime", nullable=false, columnDefinition="DATETIME") |
||
| 283 | * @Groups({"people_read", "my_contract_item_read", "mycontractpeople_read"}) |
||
| 284 | */ |
||
| 285 | private $foundationDate = null; |
||
| 286 | /** |
||
| 287 | * @Groups({"people_read", "my_contract_item_read", "mycontractpeople_read"}) |
||
| 288 | */ |
||
| 289 | private $averageRating = 4; |
||
| 290 | public function __construct() |
||
| 291 | { |
||
| 292 | $this->enable = 0; |
||
| 293 | $this->icms = 1; |
||
| 294 | $this->billing = 0; |
||
| 295 | $this->registerDate = new \DateTime('now'); |
||
| 296 | $this->people = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 297 | $this->config = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 298 | $this->link = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 299 | $this->user = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 300 | $this->document = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 301 | $this->address = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 302 | $this->email = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 303 | $this->phone = new \Doctrine\Common\Collections\ArrayCollection(); |
||
| 304 | $this->billingDays = 'daily'; |
||
| 305 | $this->paymentTerm = 1; |
||
| 306 | |||
| 307 | $this->otherInformations = json_encode( |
||
| 308 | new stdClass() |
||
| 309 | ); |
||
| 310 | } |
||
| 311 | public function getId() |
||
| 312 | { |
||
| 313 | return $this->id; |
||
| 314 | } |
||
| 315 | public function getAverageRating() |
||
| 316 | { |
||
| 317 | return $this->averageRating; |
||
| 318 | } |
||
| 319 | public function setAverageRating($averageRating) |
||
| 320 | { |
||
| 321 | $this->averageRating = $averageRating; |
||
| 322 | return $this; |
||
| 323 | } |
||
| 324 | public function getIcms() |
||
| 325 | { |
||
| 326 | return $this->icms; |
||
| 327 | } |
||
| 328 | public function setIcms($icms) |
||
| 329 | { |
||
| 330 | $this->icms = $icms ?: 0; |
||
| 331 | return $this; |
||
| 332 | } |
||
| 333 | public function getEnabled() |
||
| 334 | { |
||
| 335 | return $this->enable; |
||
| 336 | } |
||
| 337 | public function setEnabled($enable) |
||
| 338 | { |
||
| 339 | $this->enable = $enable ?: 0; |
||
| 340 | return $this; |
||
| 341 | } |
||
| 342 | public function setPeopleType($people_type) |
||
| 343 | { |
||
| 344 | $this->peopleType = $people_type; |
||
| 345 | return $this; |
||
| 346 | } |
||
| 347 | public function getPeopleType() |
||
| 348 | { |
||
| 349 | return $this->peopleType; |
||
| 350 | } |
||
| 351 | /** |
||
| 352 | * Set name. |
||
| 353 | */ |
||
| 354 | public function setName(string $name): self |
||
| 355 | { |
||
| 356 | $this->name = $name; |
||
| 357 | return $this; |
||
| 358 | } |
||
| 359 | /** |
||
| 360 | * Get name. |
||
| 361 | */ |
||
| 362 | public function getName(): string |
||
| 363 | { |
||
| 364 | return strtoupper($this->name); |
||
| 365 | } |
||
| 366 | public function setAlias($alias) |
||
| 367 | { |
||
| 368 | $this->alias = $alias; |
||
| 369 | return $this; |
||
| 370 | } |
||
| 371 | public function getAlias() |
||
| 372 | { |
||
| 373 | return strtoupper($this->alias); |
||
| 374 | } |
||
| 375 | public function setFile(File $file = null) |
||
| 376 | { |
||
| 377 | $this->file = $file; |
||
| 378 | return $this; |
||
| 379 | } |
||
| 380 | public function getFile() |
||
| 381 | { |
||
| 382 | return $this->file; |
||
| 383 | } |
||
| 384 | public function setAlternativeFile(File $alternative_file = null) |
||
| 385 | { |
||
| 386 | $this->alternativeFile = $alternative_file; |
||
| 387 | return $this; |
||
| 388 | } |
||
| 389 | public function getAlternativeFile() |
||
| 390 | { |
||
| 391 | return $this->alternativeFile; |
||
| 392 | } |
||
| 393 | public function getBackgroundFile() |
||
| 394 | { |
||
| 395 | return $this->backgroundFile; |
||
| 396 | } |
||
| 397 | public function setBackgroundFile(File $backgroundFile = null) |
||
| 398 | { |
||
| 399 | $this->backgroundFile = $backgroundFile; |
||
| 400 | return $this; |
||
| 401 | } |
||
| 402 | public function setLanguage(Language $language = null) |
||
| 403 | { |
||
| 404 | $this->language = $language; |
||
| 405 | return $this; |
||
| 406 | } |
||
| 407 | public function getLanguage() |
||
| 408 | { |
||
| 409 | return $this->language; |
||
| 410 | } |
||
| 411 | public function setBilling($billing) |
||
| 412 | { |
||
| 413 | $this->billing = $billing; |
||
| 414 | return $this; |
||
| 415 | } |
||
| 416 | public function getBilling() |
||
| 417 | { |
||
| 418 | return $this->billing; |
||
| 419 | } |
||
| 420 | public function getRegisterDate(): \DateTimeInterface |
||
| 421 | { |
||
| 422 | return $this->registerDate; |
||
| 423 | } |
||
| 424 | public function setRegisterDate(\DateTimeInterface $registerDate): self |
||
| 425 | { |
||
| 426 | $this->registerDate = $registerDate; |
||
| 427 | return $this; |
||
| 428 | } |
||
| 429 | /** |
||
| 430 | * Add document. |
||
| 431 | * |
||
| 432 | * @return Document |
||
| 433 | */ |
||
| 434 | public function addDocument(Document $document) |
||
| 435 | { |
||
| 436 | $this->document[] = $document; |
||
| 437 | return $this; |
||
| 438 | } |
||
| 439 | /** |
||
| 440 | * Add company. |
||
| 441 | * |
||
| 442 | * @return Company |
||
| 443 | */ |
||
| 444 | public function addCompany(People $company) |
||
| 445 | { |
||
| 446 | $this->company[] = $company; |
||
| 447 | return $this; |
||
| 448 | } |
||
| 449 | /** |
||
| 450 | * Remove company. |
||
| 451 | */ |
||
| 452 | public function removeCompany(People $company) |
||
| 453 | { |
||
| 454 | $this->company->removeElement($company); |
||
| 455 | } |
||
| 456 | /** |
||
| 457 | * Get company. |
||
| 458 | * |
||
| 459 | * @return Collection |
||
| 460 | */ |
||
| 461 | public function getCompany() |
||
| 462 | { |
||
| 463 | return $this->company; |
||
| 464 | } |
||
| 465 | /** |
||
| 466 | * Add link. |
||
| 467 | * |
||
| 468 | * @return People |
||
| 469 | */ |
||
| 470 | public function addLink(People $link) |
||
| 471 | { |
||
| 472 | $this->link[] = $link; |
||
| 473 | return $this; |
||
| 474 | } |
||
| 475 | /** |
||
| 476 | * Remove link. |
||
| 477 | * |
||
| 478 | * @param \Core\Entity\Link $link |
||
| 479 | */ |
||
| 480 | public function removeLink(People $link) |
||
| 481 | { |
||
| 482 | $this->link->removeElement($link); |
||
| 483 | } |
||
| 484 | /** |
||
| 485 | * Get link. |
||
| 486 | * |
||
| 487 | * @return Collection |
||
| 488 | */ |
||
| 489 | public function getLink() |
||
| 490 | { |
||
| 491 | return $this->link; |
||
| 492 | } |
||
| 493 | /** |
||
| 494 | * Add user. |
||
| 495 | * |
||
| 496 | * @return People |
||
| 497 | */ |
||
| 498 | public function addUser(\ControleOnline\Entity\User $user) |
||
| 499 | { |
||
| 500 | $this->user[] = $user; |
||
| 501 | return $this; |
||
| 502 | } |
||
| 503 | /** |
||
| 504 | * Remove user. |
||
| 505 | */ |
||
| 506 | public function removeUser(\ControleOnline\Entity\User $user) |
||
| 507 | { |
||
| 508 | $this->user->removeElement($user); |
||
| 509 | } |
||
| 510 | /** |
||
| 511 | * Get user. |
||
| 512 | * |
||
| 513 | * @return Collection |
||
| 514 | */ |
||
| 515 | public function getUser() |
||
| 516 | { |
||
| 517 | return $this->user; |
||
| 518 | } |
||
| 519 | /** |
||
| 520 | * Get document. |
||
| 521 | * |
||
| 522 | * @return Collection |
||
| 523 | */ |
||
| 524 | public function getDocument() |
||
| 525 | { |
||
| 526 | return $this->document; |
||
| 527 | } |
||
| 528 | /** |
||
| 529 | * Get address. |
||
| 530 | * |
||
| 531 | * @return Collection |
||
| 532 | */ |
||
| 533 | public function getAddress() |
||
| 534 | { |
||
| 535 | return $this->address; |
||
| 536 | } |
||
| 537 | /** |
||
| 538 | * Get document. |
||
| 539 | * |
||
| 540 | * @return Collection |
||
| 541 | */ |
||
| 542 | public function getPhone() |
||
| 543 | { |
||
| 544 | return $this->phone; |
||
| 545 | } |
||
| 546 | /** |
||
| 547 | * Get email. |
||
| 548 | * |
||
| 549 | * @return Collection |
||
| 550 | */ |
||
| 551 | public function getEmail() |
||
| 552 | { |
||
| 553 | return $this->email; |
||
| 554 | } |
||
| 555 | public function getContractsPeople(): Collection |
||
| 556 | { |
||
| 557 | return $this->contractsPeople; |
||
| 558 | } |
||
| 559 | public function setBillingDays(string $billingDays): self |
||
| 560 | { |
||
| 561 | $this->billingDays = $billingDays; |
||
| 562 | return $this; |
||
| 563 | } |
||
| 564 | public function getBillingDays(): string |
||
| 565 | { |
||
| 566 | return $this->billingDays; |
||
| 567 | } |
||
| 568 | public function setPaymentTerm(int $paymentTerm): self |
||
| 569 | { |
||
| 570 | $this->paymentTerm = $paymentTerm; |
||
| 571 | return $this; |
||
| 572 | } |
||
| 573 | public function getPaymentTerm(): int |
||
| 574 | { |
||
| 575 | return $this->paymentTerm; |
||
| 576 | } |
||
| 577 | public function getFoundationDate(): ?\DateTime |
||
| 578 | { |
||
| 579 | return $this->foundationDate; |
||
| 580 | } |
||
| 581 | public function setFoundationDate(\DateTimeInterface $date): self |
||
| 582 | { |
||
| 583 | $this->foundationDate = $date; |
||
| 584 | return $this; |
||
| 585 | } |
||
| 586 | public function getFullName(): string |
||
| 587 | { |
||
| 588 | if ($this->getPeopleType() == 'F') { |
||
| 589 | return trim(preg_replace('/[^A-Za-z\s]/', '', sprintf('%s %s', $this->getName(), $this->getAlias()))); |
||
| 590 | } |
||
| 591 | return trim(preg_replace('/[^A-Za-z\s]/', '', $this->getName())); |
||
| 592 | } |
||
| 593 | public function isPerson(): bool |
||
| 594 | { |
||
| 595 | return $this->getPeopleType() == 'F'; |
||
| 596 | } |
||
| 597 | public function getOneEmail(): ?Email |
||
| 598 | { |
||
| 599 | if (($email = $this->getEmail()->first()) === false) { |
||
| 600 | return null; |
||
| 601 | } |
||
| 602 | return $email; |
||
| 603 | } |
||
| 604 | public function getOneDocument(): ?Document |
||
| 605 | { |
||
| 606 | $documents = $this->getDocument()->filter(function ($peopleDocument) { |
||
| 607 | if ($peopleDocument->getPeople()->getPeopleType() == 'F') { |
||
| 608 | return $peopleDocument->getDocumentType()->getDocumentType() == 'CPF'; |
||
| 609 | } |
||
| 610 | return $peopleDocument->getDocumentType()->getDocumentType() == 'CNPJ'; |
||
| 611 | }); |
||
| 612 | return ($document = $documents->first()) === false ? null : $document; |
||
| 613 | } |
||
| 614 | public function getBirthdayAsString(): ?string |
||
| 615 | { |
||
| 616 | if ($this->getFoundationDate() instanceof \DateTimeInterface) { |
||
| 617 | return $this->getFoundationDate()->format('Y-m-d'); |
||
| 618 | } |
||
| 619 | return null; |
||
| 620 | } |
||
| 621 | /** |
||
| 622 | * Get otherInformations |
||
| 623 | * |
||
| 624 | * @return stdClass |
||
| 625 | */ |
||
| 626 | public function getOtherInformations($decode = false) |
||
| 629 | } |
||
| 630 | /** |
||
| 631 | * Set comments |
||
| 632 | * |
||
| 633 | * @param string $otherInformations |
||
| 634 | * @return Order |
||
| 635 | */ |
||
| 636 | public function addOtherInformations($key, $value) |
||
| 642 | } |
||
| 643 | /** |
||
| 644 | * Set comments |
||
| 645 | * |
||
| 646 | * @param string $otherInformations |
||
| 647 | * @return Order |
||
| 648 | */ |
||
| 649 | public function setOtherInformations(stdClass $otherInformations) |
||
| 650 | { |
||
| 651 | $this->otherInformations = json_encode($otherInformations); |
||
| 652 | return $this; |
||
| 653 | } |
||
| 654 | /** |
||
| 655 | * Add Config. |
||
| 656 | * |
||
| 657 | * @return People |
||
| 658 | */ |
||
| 659 | public function addConfig(\ControleOnline\Entity\Config $config) |
||
| 660 | { |
||
| 661 | $this->config[] = $config; |
||
| 662 | return $this; |
||
| 663 | } |
||
| 664 | /** |
||
| 665 | * Remove Config. |
||
| 666 | */ |
||
| 667 | public function removeConfig(\ControleOnline\Entity\Config $config) |
||
| 670 | } |
||
| 671 | /** |
||
| 672 | * Get config. |
||
| 673 | * |
||
| 674 | * @return Collection |
||
| 675 | */ |
||
| 676 | public function getConfig() |
||
| 679 | } |
||
| 680 | } |
||
| 681 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths