Skip to content

Commit

Permalink
Deprecate field type range values as they add a lot of complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 21, 2022
1 parent 4eca4e3 commit 092ebba
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Hyde\Support\Contracts\SerializableContract;
use Illuminate\Support\Str;
use InvalidArgumentException;
use JetBrains\PhpStorm\Deprecated;
use Rgasch\Collection\Collection;
use function strtolower;

Expand All @@ -24,7 +25,9 @@ class PublicationField implements SerializableContract
use Serializable;

public readonly PublicationFieldTypes $type;
/** @deprecated https://github.com/hydephp/develop/pull/685#issuecomment-1361565809 */
public readonly string $max;
/** @deprecated https://github.com/hydephp/develop/pull/685#issuecomment-1361565809 */
public readonly string $min;
public readonly string $name;
public readonly ?string $tagGroup;
Expand All @@ -35,7 +38,7 @@ public static function fromArray(array $array): static
return new static(...$array);
}

public function __construct(PublicationFieldTypes|string $type, string $name, int|string|null $min = '0', int|string|null $max = '0', ?string $tagGroup = null, PublicationType $publicationType = null)
public function __construct(PublicationFieldTypes|string $type, string $name, #[Deprecated] int|string|null $min = '0', #[Deprecated] int|string|null $max = '0', ?string $tagGroup = null, PublicationType $publicationType = null)
{
$this->type = $type instanceof PublicationFieldTypes ? $type : PublicationFieldTypes::from(strtolower($type));
$this->name = Str::kebab($name);
Expand Down

0 comments on commit 092ebba

Please sign in to comment.