Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: managedAlias total is nullable #138

Merged
merged 2 commits into from
Nov 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 11 additions & 56 deletions EMS/core-bundle/src/Entity/ManagedAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,46 +64,29 @@ public function __construct()
$this->modified = DateTime::create('now');
}

/**
* @return string
*/
public function __toString()
public function __toString(): string
{
return $this->name;
}

/**
* @return int
*/
public function getId()
public function getId(): int
{
return $this->id;
}

/**
* @return string
*/
public function getName()
public function getName(): string
{
return $this->name;
}

/**
* @param string $name
*
* @return ManagedAlias
*/
public function setName($name)
public function setName(string $name): ManagedAlias
{
$this->name = $name;

return $this;
}

/**
* @return string
*/
public function getAlias()
public function getAlias(): string
{
if (null === $this->alias) {
throw new \RuntimeException('Unexpected null alias');
Expand Down Expand Up @@ -135,64 +118,36 @@ public function setIndexes(array $indexes): self
return $this;
}

/**
* @return int
*/
public function getTotal()
public function getTotal(): ?int
{
if (null === $this->total) {
throw new \RuntimeException('Unexpected null total');
}

return $this->total;
}

/**
* @param int $total
*
* @return ManagedAlias
*/
public function setTotal($total)
public function setTotal(?int $total): ManagedAlias
{
$this->total = $total;

return $this;
}

/**
* @return string
*/
public function getColor()
public function getColor(): string
{
return $this->color;
}

/**
* @param string $color
*
* @return ManagedAlias
*/
public function setColor($color)
public function setColor(string $color): ManagedAlias
{
$this->color = $color;

return $this;
}

/**
* @return string
*/
public function getExtra()
public function getExtra(): string
{
return $this->extra;
}

/**
* @param string $extra
*
* @return ManagedAlias
*/
public function setExtra($extra)
public function setExtra(string $extra): ManagedAlias
{
$this->extra = $extra;

Expand Down