Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 7 additions & 5 deletions app/HMS/Entities/Banking/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace HMS\Entities\Banking;

use Doctrine\Common\Collections\ArrayCollection;

class Account
{
/**
Expand All @@ -15,7 +17,7 @@ class Account
protected $paymentRef;

/**
* @var string
* @var ?string
*/
protected $natwestRef;

Expand All @@ -38,7 +40,7 @@ public function __construct($paymentRef)
*
* @return mixed
*/
public function getId()
public function getId(): int
{
return $this->id;
}
Expand All @@ -48,7 +50,7 @@ public function getId()
*
* @return mixed
*/
public function getPaymentRef()
public function getPaymentRef(): string
{
return $this->paymentRef;
}
Expand All @@ -60,7 +62,7 @@ public function getPaymentRef()
*
* @return self
*/
protected function setPaymentRef($paymentRef)
protected function setPaymentRef(string $paymentRef): Account
{
$this->paymentRef = $paymentRef;

Expand All @@ -72,7 +74,7 @@ protected function setPaymentRef($paymentRef)
*
* @return mixed
*/
public function getNatwestRef()
public function getNatwestRef(): ?string
{
return $this->natwestRef;
}
Expand Down
8 changes: 4 additions & 4 deletions app/HMS/Entities/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Invite
protected $email;

/**
* @var string invite token
* @var ?string invite token
*/
protected $inviteToken;

Expand Down Expand Up @@ -57,16 +57,16 @@ public function getId()
/**
* @return string
*/
public function getEmail()
public function getEmail(): string
{
return $this->email;
}

/**
* Get the token value.
* @return string
* @return ?string
*/
public function getInviteToken()
public function getInviteToken(): ?string
{
return $this->inviteToken;
}
Expand Down
2 changes: 1 addition & 1 deletion app/HMS/Entities/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Link implements ArrayableContract
protected $link;

/**
* @var string
* @var ?string
*/
protected $description;

Expand Down
6 changes: 3 additions & 3 deletions app/HMS/Entities/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function create($key)
*
* @return string
*/
public function getKey()
public function getKey(): string
{
return $this->key;
}
Expand All @@ -48,7 +48,7 @@ public function getKey()
*
* @return string
*/
public function getValue()
public function getValue(): string
{
return $this->value;
}
Expand All @@ -60,7 +60,7 @@ public function getValue()
*
* @return self
*/
public function setValue($value)
public function setValue($value): Meta
{
$this->value = $value;

Expand Down
12 changes: 6 additions & 6 deletions app/HMS/Entities/PasswordReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PasswordReset
*
* @return string
*/
public function getEmail()
public function getEmail(): string
{
return $this->email;
}
Expand All @@ -38,7 +38,7 @@ public function getEmail()
*
* @return self
*/
public function setEmail($email)
public function setEmail($email): PasswordReset
{
$this->email = $email;

Expand All @@ -50,7 +50,7 @@ public function setEmail($email)
*
* @return string
*/
public function getToken()
public function getToken(): string
{
return $this->token;
}
Expand All @@ -62,7 +62,7 @@ public function getToken()
*
* @return self
*/
public function setToken($token)
public function setToken($token): PasswordReset
{
$this->token = $token;

Expand All @@ -74,7 +74,7 @@ public function setToken($token)
*
* @return Carbon
*/
public function getCreated()
public function getCreated(): Carbon
{
return $this->created;
}
Expand All @@ -86,7 +86,7 @@ public function getCreated()
*
* @return self
*/
public function setCreated(Carbon $created)
public function setCreated(Carbon $created): PasswordReset
{
$this->created = $created;

Expand Down
6 changes: 5 additions & 1 deletion app/HMS/Entities/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ public function setContactNumber(?string $contactNumber): Profile
*/
public function getDateOfBirth(): ?Carbon
{
return Carbon::instance($this->dateOfBirth);
if ($this->dateOfBirth) {
return Carbon::instance($this->dateOfBirth);
}

return null;
}

/**
Expand Down
56 changes: 39 additions & 17 deletions app/HMS/Entities/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ class Role implements RoleContract
protected $users;

/**
* @var string Team email address
* @var ?string Team email address
*/
protected $email;

/**
* @var string Team slack channel
* @var ?string Team slack channel
*/
protected $slackChannel;

Expand Down Expand Up @@ -93,15 +93,15 @@ public function getId()
/**
* @return string
*/
public function getName()
public function getName(): string
{
return $this->name;
}

/**
* @return string
*/
public function getDisplayName()
public function getDisplayName(): string
{
return $this->displayName;
}
Expand All @@ -110,7 +110,7 @@ public function getDisplayName()
* @param string $displayName
* @return self
*/
public function setDisplayName($displayName)
public function setDisplayName($displayName): Role
{
$this->displayName = $displayName;

Expand All @@ -120,7 +120,7 @@ public function setDisplayName($displayName)
/**
* @return string
*/
public function getDescription()
public function getDescription(): string
{
return $this->description;
}
Expand All @@ -129,7 +129,7 @@ public function getDescription()
* @param string $description
* @return self
*/
public function setDescription($description)
public function setDescription($description): Role
{
$this->description = $description;

Expand All @@ -144,21 +144,43 @@ public function getPermissions()
return $this->permissions;
}

public function addPermission(Permission $permission)
/**
* Add a Permission to the Role.
*
* @param Permission $permission
* @return self
*/
public function addPermission(Permission $permission): Role
{
if ( ! $this->permissions->contains($permission)) {
$this->permissions->add($permission);
}

return $this;
}

public function removePermission(Permission $permission)
/**
* Remove a single permission from the Role.
* @param Permission $permission
* @return self
*/
public function removePermission(Permission $permission): Role
{
$this->permissions->removeElement($permission);

return $this;
}

public function stripPermissions()
/**
* Remove all permissions from the Role.
*
* @return self
*/
public function stripPermissions(): Role
{
$this->permissions->clear();

return $this;
}

/**
Expand All @@ -174,7 +196,7 @@ public function getUsers()
*
* @return string Team email address
*/
public function getEmail()
public function getEmail(): ?string
{
return $this->email;
}
Expand All @@ -186,7 +208,7 @@ public function getEmail()
*
* @return self
*/
public function setEmail($email)
public function setEmail($email): Role
{
$this->email = $email;

Expand All @@ -198,7 +220,7 @@ public function setEmail($email)
*
* @return string team slack channel
*/
public function getSlackChannel()
public function getSlackChannel(): ?string
{
return $this->slackChannel;
}
Expand All @@ -210,7 +232,7 @@ public function getSlackChannel()
*
* @return self
*/
public function setSlackChannel($slackChannel)
public function setSlackChannel($slackChannel): Role
{
$this->slackChannel = $slackChannel;

Expand All @@ -222,7 +244,7 @@ public function setSlackChannel($slackChannel)
*
* @return bool Should this role be retained by ex members
*/
public function getRetained()
public function getRetained(): bool
{
return $this->retained;
}
Expand All @@ -234,7 +256,7 @@ public function getRetained()
*
* @return self
*/
public function setRetained($retained)
public function setRetained($retained): Role
{
$this->retained = $retained;

Expand All @@ -246,7 +268,7 @@ public function setRetained($retained)
*
* @return string
*/
public function routeNotificationForSlack()
public function routeNotificationForSlack(): string
{
if ($this->name = 'team.Trustees') {
return Meta::get('trustee_slack_webhook');
Expand Down
Loading