mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-30 04:38:41 +00:00
phpstan, phpcs, phpunit fixes
This commit is contained in:
parent
7d4c9acf17
commit
064fef7d82
|
|
@ -178,16 +178,16 @@ class Employee implements \JsonSerializable
|
|||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param int $type Media type
|
||||
*
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFileByType(int $type = null) : Media
|
||||
public function getFileByType(int $type) : Media
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
if ($file->hasMediaTypeId($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
|
@ -196,26 +196,24 @@ class Employee implements \JsonSerializable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all media files by type
|
||||
* Get all media files by type name
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param string $type Media type
|
||||
*
|
||||
* @return Media[]
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFilesByType(int $type = null) : array
|
||||
public function getFileByTypeName(string $type) : Media
|
||||
{
|
||||
$files = [];
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
$files[] = $file;
|
||||
if ($file->hasMediaTypeName($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
return new NullMedia();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get employee company history.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -117,16 +117,16 @@ class EmployeeEducationHistory implements \JsonSerializable
|
|||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param int $type Media type
|
||||
*
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFileByType(int $type = null) : Media
|
||||
public function getFileByType(int $type) : Media
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
if ($file->hasMediaTypeId($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
|
@ -135,24 +135,23 @@ class EmployeeEducationHistory implements \JsonSerializable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all media files by type
|
||||
* Get all media files by type name
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param string $type Media type
|
||||
*
|
||||
* @return Media[]
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFilesByType(int $type = null) : array
|
||||
public function getFileByTypeName(string $type) : Media
|
||||
{
|
||||
$files = [];
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
$files[] = $file;
|
||||
if ($file->hasMediaTypeName($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
return new NullMedia();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ final class EmployeeEducationHistoryMapper extends DataMapperFactory
|
|||
/**
|
||||
* Belongs to.
|
||||
*
|
||||
* @var array<string, array{mapper:string, external:string, column?:string, by?:string}>
|
||||
* @var array<string, array{mapper:class-string, external:string, column?:string, by?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const BELONGS_TO = [
|
||||
|
|
@ -60,7 +60,7 @@ final class EmployeeEducationHistoryMapper extends DataMapperFactory
|
|||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
|
|
|
|||
|
|
@ -140,16 +140,16 @@ class EmployeeHistory implements \JsonSerializable
|
|||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param int $type Media type
|
||||
*
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFileByType(int $type = null) : Media
|
||||
public function getFileByType(int $type) : Media
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
if ($file->hasMediaTypeId($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
|
@ -158,24 +158,23 @@ class EmployeeHistory implements \JsonSerializable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all media files by type
|
||||
* Get all media files by type name
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param string $type Media type
|
||||
*
|
||||
* @return Media[]
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFilesByType(int $type = null) : array
|
||||
public function getFileByTypeName(string $type) : Media
|
||||
{
|
||||
$files = [];
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
$files[] = $file;
|
||||
if ($file->hasMediaTypeName($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
return new NullMedia();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ final class EmployeeHistoryMapper extends DataMapperFactory
|
|||
/**
|
||||
* Belongs to.
|
||||
*
|
||||
* @var array<string, array{mapper:string, external:string, column?:string, by?:string}>
|
||||
* @var array<string, array{mapper:class-string, external:string, column?:string, by?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const BELONGS_TO = [
|
||||
|
|
@ -74,7 +74,7 @@ final class EmployeeHistoryMapper extends DataMapperFactory
|
|||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ final class EmployeeMapper extends DataMapperFactory
|
|||
/**
|
||||
* Belongs to.
|
||||
*
|
||||
* @var array<string, array{mapper:string, external:string, column?:string, by?:string}>
|
||||
* @var array<string, array{mapper:class-string, external:string, column?:string, by?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const BELONGS_TO = [
|
||||
|
|
@ -57,7 +57,7 @@ final class EmployeeMapper extends DataMapperFactory
|
|||
/**
|
||||
* Has one relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||
* @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const OWNS_ONE = [
|
||||
|
|
@ -70,7 +70,7 @@ final class EmployeeMapper extends DataMapperFactory
|
|||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
|
|
|
|||
|
|
@ -113,16 +113,16 @@ class EmployeeWorkHistory implements \JsonSerializable
|
|||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param int $type Media type
|
||||
*
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFileByType(int $type = null) : Media
|
||||
public function getFileByType(int $type) : Media
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
if ($file->hasMediaTypeId($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
|
@ -131,24 +131,23 @@ class EmployeeWorkHistory implements \JsonSerializable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all media files by type
|
||||
* Get all media files by type name
|
||||
*
|
||||
* @param null|int $type Media type
|
||||
* @param string $type Media type
|
||||
*
|
||||
* @return Media[]
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFilesByType(int $type = null) : array
|
||||
public function getFileByTypeName(string $type) : Media
|
||||
{
|
||||
$files = [];
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
$files[] = $file;
|
||||
if ($file->hasMediaTypeName($type)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
return new NullMedia();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ final class EmployeeWorkHistoryMapper extends DataMapperFactory
|
|||
/**
|
||||
* Belongs to.
|
||||
*
|
||||
* @var array<string, array{mapper:string, external:string, column?:string, by?:string}>
|
||||
* @var array<string, array{mapper:class-string, external:string, column?:string, by?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const BELONGS_TO = [
|
||||
|
|
@ -58,7 +58,7 @@ final class EmployeeWorkHistoryMapper extends DataMapperFactory
|
|||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user