|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace FactorioItemBrowser\Api\Client\Entity; |
| 6 | + |
| 7 | +use FactorioItemBrowser\Api\Client\Constant\ValidatedModIssueType; |
| 8 | + |
| 9 | +/** |
| 10 | + * The entity representing a validated mod. |
| 11 | + * |
| 12 | + * @author BluePsyduck <[email protected]> |
| 13 | + * @license http://opensource.org/licenses/GPL-3.0 GPL v3 |
| 14 | + */ |
| 15 | +class ValidatedMod |
| 16 | +{ |
| 17 | + /** |
| 18 | + * The name of the mod. |
| 19 | + * @var string |
| 20 | + */ |
| 21 | + protected $name = ''; |
| 22 | + |
| 23 | + /** |
| 24 | + * The version of the mod used for validation. |
| 25 | + * @var string |
| 26 | + */ |
| 27 | + protected $version = ''; |
| 28 | + |
| 29 | + /** |
| 30 | + * The type of issue the mod has. |
| 31 | + * @var string |
| 32 | + */ |
| 33 | + protected $issueType = ValidatedModIssueType::NONE; |
| 34 | + |
| 35 | + /** |
| 36 | + * The dependency which triggered the "missing-dependency" or "conflict" issue. |
| 37 | + * @var string |
| 38 | + */ |
| 39 | + protected $issueDependency = ''; |
| 40 | + |
| 41 | + /** |
| 42 | + * Sets the name of the mod. |
| 43 | + * @param string $name |
| 44 | + * @return $this |
| 45 | + */ |
| 46 | + public function setName(string $name): self |
| 47 | + { |
| 48 | + $this->name = $name; |
| 49 | + return $this; |
| 50 | + } |
| 51 | + |
| 52 | + /** |
| 53 | + * Returns the name of the mod. |
| 54 | + * @return string |
| 55 | + */ |
| 56 | + public function getName(): string |
| 57 | + { |
| 58 | + return $this->name; |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * Sets the version of the mod used for validation. |
| 63 | + * @param string $version |
| 64 | + * @return $this |
| 65 | + */ |
| 66 | + public function setVersion(string $version): self |
| 67 | + { |
| 68 | + $this->version = $version; |
| 69 | + return $this; |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * Returns the version of the mod used for validation. |
| 74 | + * @return string |
| 75 | + */ |
| 76 | + public function getVersion(): string |
| 77 | + { |
| 78 | + return $this->version; |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Sets the type of issue the mod has. |
| 83 | + * @param string $issueType |
| 84 | + * @return $this |
| 85 | + */ |
| 86 | + public function setIssueType(string $issueType): self |
| 87 | + { |
| 88 | + $this->issueType = $issueType; |
| 89 | + return $this; |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + * Returns the type of issue the mod has. |
| 94 | + * @return string |
| 95 | + */ |
| 96 | + public function getIssueType(): string |
| 97 | + { |
| 98 | + return $this->issueType; |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Sets the dependency which triggered the "missing-dependency" or "conflict" issue. |
| 103 | + * @param string $issueDependency |
| 104 | + * @return $this |
| 105 | + */ |
| 106 | + public function setIssueDependency(string $issueDependency): self |
| 107 | + { |
| 108 | + $this->issueDependency = $issueDependency; |
| 109 | + return $this; |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * Returns the dependency which triggered the "missing-dependency" or "conflict" issue. |
| 114 | + * @return string |
| 115 | + */ |
| 116 | + public function getIssueDependency(): string |
| 117 | + { |
| 118 | + return $this->issueDependency; |
| 119 | + } |
| 120 | +} |
0 commit comments