From 2697fe3d90cfcdcc8cdca0d424683133ce64989b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 26 Jan 2020 12:27:56 +0100 Subject: [PATCH] phpcs fix --- Admin/Routes/Web/Api.php | 2 +- Controller/ApiController.php | 7 +++---- Controller/Controller.php | 12 ++++++------ Models/Employee.php | 22 +++++++++++----------- Models/EmployeeHistory.php | 22 +++++++++++----------- Models/EmployeeHistoryMapper.php | 10 +++++----- Models/EmployeeMapper.php | 12 ++++++------ Models/StaffList.php | 2 +- 8 files changed, 44 insertions(+), 45 deletions(-) diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 2c3d3f6..2698cc1 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -17,4 +17,4 @@ return [ ], ], ], -]; \ No newline at end of file +]; diff --git a/Controller/ApiController.php b/Controller/ApiController.php index c0e4279..40995c9 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -14,18 +14,17 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Controller; +use Modules\Admin\Models\Account; use Modules\HumanResourceManagement\Models\Employee; -use Modules\HumanResourceManagement\Models\EmployeeMapper; use Modules\HumanResourceManagement\Models\EmployeeHistory; use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper; +use Modules\HumanResourceManagement\Models\EmployeeMapper; +use Modules\Profile\Models\Profile; use phpOMS\Message\NotificationLevel; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Model\Message\FormValidation; -use phpOMS\Utils\Parser\Markdown\Markdown; -use Modules\Admin\Models\Account; -use Modules\Profile\Models\Profile; /** * HumanResourceManagement controller class. diff --git a/Controller/Controller.php b/Controller/Controller.php index abe42ca..a2d70ad 100644 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -31,7 +31,7 @@ class Controller extends ModuleAbstract implements WebInterface /** * Module path. * - * @var string + * @var string * @since 1.0.0 */ public const MODULE_PATH = __DIR__ . '/../'; @@ -39,7 +39,7 @@ class Controller extends ModuleAbstract implements WebInterface /** * Module version. * - * @var string + * @var string * @since 1.0.0 */ public const MODULE_VERSION = '1.0.0'; @@ -47,7 +47,7 @@ class Controller extends ModuleAbstract implements WebInterface /** * Module name. * - * @var string + * @var string * @since 1.0.0 */ public const MODULE_NAME = 'HumanResourceManagement'; @@ -55,7 +55,7 @@ class Controller extends ModuleAbstract implements WebInterface /** * Module id. * - * @var int + * @var int * @since 1.0.0 */ public const MODULE_ID = 1002400000; @@ -63,7 +63,7 @@ class Controller extends ModuleAbstract implements WebInterface /** * Providing. * - * @var string[] + * @var string[] * @since 1.0.0 */ protected static array $providing = []; @@ -71,7 +71,7 @@ class Controller extends ModuleAbstract implements WebInterface /** * Dependencies. * - * @var string[] + * @var string[] * @since 1.0.0 */ protected static array $dependencies = []; diff --git a/Models/Employee.php b/Models/Employee.php index d8a70c0..c79fab9 100644 --- a/Models/Employee.php +++ b/Models/Employee.php @@ -30,7 +30,7 @@ class Employee implements ArrayableInterface, \JsonSerializable /** * Employee ID. * - * @var int + * @var int * @since 1.0.0 */ private int $id = 0; @@ -38,7 +38,7 @@ class Employee implements ArrayableInterface, \JsonSerializable /** * Account profile. * - * @var null|int|Profile + * @var null|int|Profile * @since 1.0.0 */ private $profile = null; @@ -46,7 +46,7 @@ class Employee implements ArrayableInterface, \JsonSerializable /** * Employee image. * - * @var null|int|Media + * @var null|int|Media * @since 1.0.0 */ private $image = null; @@ -54,7 +54,7 @@ class Employee implements ArrayableInterface, \JsonSerializable /** * Employee department/position history. * - * @var array + * @var array * @since 1.0.0 */ private array $companyHistory = []; @@ -65,7 +65,7 @@ class Employee implements ArrayableInterface, \JsonSerializable * @todo Orange-Management/Modules#187 * Implement the education history for an employee. This can be done similarly to the company history. * - * @var array + * @var array * @since 1.0.0 */ private array $educationHistory = []; @@ -76,7 +76,7 @@ class Employee implements ArrayableInterface, \JsonSerializable * @todo Orange-Management/Modules#188 * 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 */ private array $workHistory = []; @@ -84,7 +84,7 @@ class Employee implements ArrayableInterface, \JsonSerializable /** * Employee hash used for time tracking / employee card * - * @var string + * @var string * @since 1.0.0 */ private string $semiPrivateHash = ''; @@ -92,7 +92,7 @@ class Employee implements ArrayableInterface, \JsonSerializable /** * Employee hash length used for time tracking / employee card * - * @var int + * @var int * @since 1.0.0 */ private const SEMI_PRIVATE_HASH_LENGTH = 64; @@ -231,7 +231,7 @@ class Employee implements ArrayableInterface, \JsonSerializable */ 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 { - 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 { - return empty($this->workHistory) ? new NullEmployeeWorkHistory : end($this->workHistory); + return empty($this->workHistory) ? new NullEmployeeWorkHistory() : \end($this->workHistory); } /** diff --git a/Models/EmployeeHistory.php b/Models/EmployeeHistory.php index 2118e70..7507b95 100644 --- a/Models/EmployeeHistory.php +++ b/Models/EmployeeHistory.php @@ -14,12 +14,12 @@ declare(strict_types=1); 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\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; @@ -36,7 +36,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * ID. * - * @var int + * @var int * @since 1.0.0 */ protected int $id = 0; @@ -44,7 +44,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * Employee * - * @var int|Employee + * @var int|Employee * @since 1.0.0 */ private $employee = 0; @@ -52,7 +52,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * Unit * - * @var null|int|Unit + * @var null|int|Unit * @since 1.0.0 */ private $unit = null; @@ -60,7 +60,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * Department * - * @var null|int|Department + * @var null|int|Department * @since 1.0.0 */ private $department = null; @@ -68,7 +68,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * Position * - * @var null|int|Position + * @var null|int|Position * @since 1.0.0 */ private $position = null; @@ -76,7 +76,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * Start date * - * @var \DateTime + * @var \DateTime * @since 1.0.0 */ private \DateTime $start; @@ -84,7 +84,7 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable /** * End date * - * @var null|\DateTime + * @var null|\DateTime * @since 1.0.0 */ private ?\DateTime $end = null; diff --git a/Models/EmployeeHistoryMapper.php b/Models/EmployeeHistoryMapper.php index f0e66c0..6c50b62 100644 --- a/Models/EmployeeHistoryMapper.php +++ b/Models/EmployeeHistoryMapper.php @@ -14,10 +14,10 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; -use phpOMS\DataStorage\Database\DataMapperAbstract; use Modules\Organization\Models\DepartmentMapper; use Modules\Organization\Models\PositionMapper; use Modules\Organization\Models\UnitMapper; +use phpOMS\DataStorage\Database\DataMapperAbstract; /** * EmployeHistory mapper class. @@ -32,7 +32,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract /** * Columns. * - * @var array> + * @var array> * @since 1.0.0 */ protected static array $columns = [ @@ -48,7 +48,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract /** * Belongs to. * - * @var array> + * @var array> * @since 1.0.0 */ protected static array $belongsTo = [ @@ -73,7 +73,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract /** * Primary field name. * - * @var string + * @var string * @since 1.0.0 */ protected static string $primaryField = 'hr_staff_history_id'; @@ -81,7 +81,7 @@ final class EmployeeHistoryMapper extends DataMapperAbstract /** * Primary table. * - * @var string + * @var string * @since 1.0.0 */ protected static string $table = 'hr_staff_history'; diff --git a/Models/EmployeeMapper.php b/Models/EmployeeMapper.php index c75a0dd..ae754a8 100644 --- a/Models/EmployeeMapper.php +++ b/Models/EmployeeMapper.php @@ -15,8 +15,8 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; use Modules\Admin\Models\AccountMapper; -use phpOMS\DataStorage\Database\DataMapperAbstract; use Modules\Profile\Models\ProfileMapper; +use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\Query\Builder; /** @@ -32,7 +32,7 @@ final class EmployeeMapper extends DataMapperAbstract /** * Columns. * - * @var array> + * @var array> * @since 1.0.0 */ protected static array $columns = [ @@ -45,7 +45,7 @@ final class EmployeeMapper extends DataMapperAbstract /** * Belongs to. * - * @var array> + * @var array> * @since 1.0.0 */ protected static array $belongsTo = [ @@ -58,7 +58,7 @@ final class EmployeeMapper extends DataMapperAbstract /** * Has many relation. * - * @var array> + * @var array> * @since 1.0.0 */ protected static array $hasMany = [ @@ -73,7 +73,7 @@ final class EmployeeMapper extends DataMapperAbstract /** * Primary table. * - * @var string + * @var string * @since 1.0.0 */ protected static string $table = 'hr_staff'; @@ -81,7 +81,7 @@ final class EmployeeMapper extends DataMapperAbstract /** * Primary field name. * - * @var string + * @var string * @since 1.0.0 */ protected static string $primaryField = 'hr_staff_id'; diff --git a/Models/StaffList.php b/Models/StaffList.php index ad739dd..8ccdc29 100644 --- a/Models/StaffList.php +++ b/Models/StaffList.php @@ -29,7 +29,7 @@ class StaffList /** * Database instance. * - * @var \phpOMS\DataStorage\Database\Pool + * @var \phpOMS\DataStorage\Database\Pool * @since 1.0.0 */ private $dbPool = null;