mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-10 01:48:41 +00:00
phpcs fix
This commit is contained in:
parent
40258fc10b
commit
2697fe3d90
|
|
@ -14,18 +14,17 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\HumanResourceManagement\Controller;
|
namespace Modules\HumanResourceManagement\Controller;
|
||||||
|
|
||||||
|
use Modules\Admin\Models\Account;
|
||||||
use Modules\HumanResourceManagement\Models\Employee;
|
use Modules\HumanResourceManagement\Models\Employee;
|
||||||
use Modules\HumanResourceManagement\Models\EmployeeMapper;
|
|
||||||
use Modules\HumanResourceManagement\Models\EmployeeHistory;
|
use Modules\HumanResourceManagement\Models\EmployeeHistory;
|
||||||
use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper;
|
use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper;
|
||||||
|
|
||||||
|
use Modules\HumanResourceManagement\Models\EmployeeMapper;
|
||||||
|
use Modules\Profile\Models\Profile;
|
||||||
use phpOMS\Message\NotificationLevel;
|
use phpOMS\Message\NotificationLevel;
|
||||||
use phpOMS\Message\RequestAbstract;
|
use phpOMS\Message\RequestAbstract;
|
||||||
use phpOMS\Message\ResponseAbstract;
|
use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Model\Message\FormValidation;
|
use phpOMS\Model\Message\FormValidation;
|
||||||
use phpOMS\Utils\Parser\Markdown\Markdown;
|
|
||||||
use Modules\Admin\Models\Account;
|
|
||||||
use Modules\Profile\Models\Profile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HumanResourceManagement controller class.
|
* HumanResourceManagement controller class.
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
/**
|
/**
|
||||||
* Module path.
|
* Module path.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const MODULE_PATH = __DIR__ . '/../';
|
public const MODULE_PATH = __DIR__ . '/../';
|
||||||
|
|
@ -39,7 +39,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
/**
|
/**
|
||||||
* Module version.
|
* Module version.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const MODULE_VERSION = '1.0.0';
|
public const MODULE_VERSION = '1.0.0';
|
||||||
|
|
@ -47,7 +47,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
/**
|
/**
|
||||||
* Module name.
|
* Module name.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const MODULE_NAME = 'HumanResourceManagement';
|
public const MODULE_NAME = 'HumanResourceManagement';
|
||||||
|
|
@ -55,7 +55,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
/**
|
/**
|
||||||
* Module id.
|
* Module id.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const MODULE_ID = 1002400000;
|
public const MODULE_ID = 1002400000;
|
||||||
|
|
@ -63,7 +63,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
/**
|
/**
|
||||||
* Providing.
|
* Providing.
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var string[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $providing = [];
|
protected static array $providing = [];
|
||||||
|
|
@ -71,7 +71,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
/**
|
/**
|
||||||
* Dependencies.
|
* Dependencies.
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var string[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $dependencies = [];
|
protected static array $dependencies = [];
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Employee ID.
|
* Employee ID.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private int $id = 0;
|
private int $id = 0;
|
||||||
|
|
@ -38,7 +38,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Account profile.
|
* Account profile.
|
||||||
*
|
*
|
||||||
* @var null|int|Profile
|
* @var null|int|Profile
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $profile = null;
|
private $profile = null;
|
||||||
|
|
@ -46,7 +46,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Employee image.
|
* Employee image.
|
||||||
*
|
*
|
||||||
* @var null|int|Media
|
* @var null|int|Media
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $image = null;
|
private $image = null;
|
||||||
|
|
@ -54,7 +54,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Employee department/position history.
|
* Employee department/position history.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $companyHistory = [];
|
private array $companyHistory = [];
|
||||||
|
|
@ -65,7 +65,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
* @todo Orange-Management/Modules#187
|
* @todo Orange-Management/Modules#187
|
||||||
* Implement the education history for an employee. This can be done similarly to the company history.
|
* Implement the education history for an employee. This can be done similarly to the company history.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $educationHistory = [];
|
private array $educationHistory = [];
|
||||||
|
|
@ -76,7 +76,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
* @todo Orange-Management/Modules#188
|
* @todo Orange-Management/Modules#188
|
||||||
* Implement the work history (at other companies) for an employee. This can be done similarly to the company history.
|
* Implement the work history (at other companies) for an employee. This can be done similarly to the company history.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $workHistory = [];
|
private array $workHistory = [];
|
||||||
|
|
@ -84,7 +84,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Employee hash used for time tracking / employee card
|
* Employee hash used for time tracking / employee card
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private string $semiPrivateHash = '';
|
private string $semiPrivateHash = '';
|
||||||
|
|
@ -92,7 +92,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Employee hash length used for time tracking / employee card
|
* Employee hash length used for time tracking / employee card
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private const SEMI_PRIVATE_HASH_LENGTH = 64;
|
private const SEMI_PRIVATE_HASH_LENGTH = 64;
|
||||||
|
|
@ -231,7 +231,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function getNewestHistory() : EmployeeHistory
|
public function getNewestHistory() : EmployeeHistory
|
||||||
{
|
{
|
||||||
return empty($this->companyHistory) ? new NullEmployeeHistory : end($this->companyHistory);
|
return empty($this->companyHistory) ? new NullEmployeeHistory() : \end($this->companyHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -255,7 +255,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function getNewestEducationHistory() : EmployeeEducationHistory
|
public function getNewestEducationHistory() : EmployeeEducationHistory
|
||||||
{
|
{
|
||||||
return empty($this->educationHistory) ? new NullEmployeeEducationHistory : end($this->educationHistory);
|
return empty($this->educationHistory) ? new NullEmployeeEducationHistory() : \end($this->educationHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -279,7 +279,7 @@ class Employee implements ArrayableInterface, \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function getNewestWorkHistory() : EmployeeWorkHistory
|
public function getNewestWorkHistory() : EmployeeWorkHistory
|
||||||
{
|
{
|
||||||
return empty($this->workHistory) ? new NullEmployeeWorkHistory : end($this->workHistory);
|
return empty($this->workHistory) ? new NullEmployeeWorkHistory() : \end($this->workHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\HumanResourceManagement\Models;
|
namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use Modules\Organization\Models\Position;
|
|
||||||
use Modules\Organization\Models\NullPosition;
|
|
||||||
use Modules\Organization\Models\Unit;
|
|
||||||
use Modules\Organization\Models\NullUnit;
|
|
||||||
use Modules\Organization\Models\Department;
|
use Modules\Organization\Models\Department;
|
||||||
use Modules\Organization\Models\NullDepartment;
|
use Modules\Organization\Models\NullDepartment;
|
||||||
|
use Modules\Organization\Models\NullPosition;
|
||||||
|
use Modules\Organization\Models\NullUnit;
|
||||||
|
use Modules\Organization\Models\Position;
|
||||||
|
use Modules\Organization\Models\Unit;
|
||||||
|
|
||||||
use phpOMS\Contract\ArrayableInterface;
|
use phpOMS\Contract\ArrayableInterface;
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* ID.
|
* ID.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected int $id = 0;
|
protected int $id = 0;
|
||||||
|
|
@ -44,7 +44,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Employee
|
* Employee
|
||||||
*
|
*
|
||||||
* @var int|Employee
|
* @var int|Employee
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $employee = 0;
|
private $employee = 0;
|
||||||
|
|
@ -52,7 +52,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Unit
|
* Unit
|
||||||
*
|
*
|
||||||
* @var null|int|Unit
|
* @var null|int|Unit
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $unit = null;
|
private $unit = null;
|
||||||
|
|
@ -60,7 +60,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Department
|
* Department
|
||||||
*
|
*
|
||||||
* @var null|int|Department
|
* @var null|int|Department
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $department = null;
|
private $department = null;
|
||||||
|
|
@ -68,7 +68,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Position
|
* Position
|
||||||
*
|
*
|
||||||
* @var null|int|Position
|
* @var null|int|Position
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $position = null;
|
private $position = null;
|
||||||
|
|
@ -76,7 +76,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Start date
|
* Start date
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
* @var \DateTime
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private \DateTime $start;
|
private \DateTime $start;
|
||||||
|
|
@ -84,7 +84,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* End date
|
* End date
|
||||||
*
|
*
|
||||||
* @var null|\DateTime
|
* @var null|\DateTime
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private ?\DateTime $end = null;
|
private ?\DateTime $end = null;
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\HumanResourceManagement\Models;
|
namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|
||||||
use Modules\Organization\Models\DepartmentMapper;
|
use Modules\Organization\Models\DepartmentMapper;
|
||||||
use Modules\Organization\Models\PositionMapper;
|
use Modules\Organization\Models\PositionMapper;
|
||||||
use Modules\Organization\Models\UnitMapper;
|
use Modules\Organization\Models\UnitMapper;
|
||||||
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EmployeHistory mapper class.
|
* EmployeHistory mapper class.
|
||||||
|
|
@ -32,7 +32,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Columns.
|
* Columns.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, bool|string>>
|
* @var array<string, array<string, bool|string>>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $columns = [
|
protected static array $columns = [
|
||||||
|
|
@ -48,7 +48,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Belongs to.
|
* Belongs to.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, string>>
|
* @var array<string, array<string, string>>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $belongsTo = [
|
protected static array $belongsTo = [
|
||||||
|
|
@ -73,7 +73,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Primary field name.
|
* Primary field name.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static string $primaryField = 'hr_staff_history_id';
|
protected static string $primaryField = 'hr_staff_history_id';
|
||||||
|
|
@ -81,7 +81,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Primary table.
|
* Primary table.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static string $table = 'hr_staff_history';
|
protected static string $table = 'hr_staff_history';
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ declare(strict_types=1);
|
||||||
namespace Modules\HumanResourceManagement\Models;
|
namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use Modules\Admin\Models\AccountMapper;
|
use Modules\Admin\Models\AccountMapper;
|
||||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|
||||||
use Modules\Profile\Models\ProfileMapper;
|
use Modules\Profile\Models\ProfileMapper;
|
||||||
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
use phpOMS\DataStorage\Database\Query\Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -32,7 +32,7 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Columns.
|
* Columns.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, bool|string>>
|
* @var array<string, array<string, bool|string>>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $columns = [
|
protected static array $columns = [
|
||||||
|
|
@ -45,7 +45,7 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Belongs to.
|
* Belongs to.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, string>>
|
* @var array<string, array<string, string>>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $belongsTo = [
|
protected static array $belongsTo = [
|
||||||
|
|
@ -58,7 +58,7 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Has many relation.
|
* Has many relation.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, null|string>>
|
* @var array<string, array<string, null|string>>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $hasMany = [
|
protected static array $hasMany = [
|
||||||
|
|
@ -73,7 +73,7 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Primary table.
|
* Primary table.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static string $table = 'hr_staff';
|
protected static string $table = 'hr_staff';
|
||||||
|
|
@ -81,7 +81,7 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Primary field name.
|
* Primary field name.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static string $primaryField = 'hr_staff_id';
|
protected static string $primaryField = 'hr_staff_id';
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class StaffList
|
||||||
/**
|
/**
|
||||||
* Database instance.
|
* Database instance.
|
||||||
*
|
*
|
||||||
* @var \phpOMS\DataStorage\Database\Pool
|
* @var \phpOMS\DataStorage\Database\Pool
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $dbPool = null;
|
private $dbPool = null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user