mirror of
https://github.com/ivuorinen/business-data-fetcher.git
synced 2026-03-17 23:00:49 +00:00
updated docs, example, extensive use of Traits with better handling. valid level 9 phpstan codebase.
26 lines
581 B
PHP
26 lines
581 B
PHP
<?php
|
|
|
|
namespace Ivuorinen\BusinessDataFetcher\Traits;
|
|
|
|
trait HasAuthority
|
|
{
|
|
/**
|
|
* @see getChangeString()
|
|
* @var int $authority What authority the change is related to.
|
|
*/
|
|
public int $authority;
|
|
|
|
/**
|
|
* Get the name of the authority.
|
|
*/
|
|
public function getAuthorityString(): string
|
|
{
|
|
return match ($this->authority) {
|
|
1 => 'Tax Administration',
|
|
2 => 'Finnish Patent and Registration Office',
|
|
3 => 'Population Register',
|
|
default => 'unknown:' . $this->authority,
|
|
};
|
|
}
|
|
}
|