fix phpstan/phpcs

This commit is contained in:
Dennis Eichhorn 2021-06-26 14:38:08 +02:00
parent 3cc6b94a94
commit 2045b9b0bd
10 changed files with 121 additions and 60 deletions

View File

@ -41,10 +41,17 @@ final class Installer extends InstallerAbstract
{ {
parent::install($dbPool, $info, $cfgHandler); parent::install($dbPool, $info, $cfgHandler);
self::createStock(); self::createDefaultStock();
} }
private static function createStock() : void /**
* Creates a default stock
*
* @return void
*
* @since 1.0.0
*/
private static function createDefaultStock() : void
{ {
$stock = new Stock('Default'); $stock = new Stock('Default');
$stock->type = 0; $stock->type = 0;

View File

@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum abstract class PermissionState extends Enum
{ {
public const STOCK = 1; public const STOCK = 1;
public const STOCK_LOCATION = 2; public const STOCK_LOCATION = 2;
} }

View File

@ -32,15 +32,35 @@ class Stock
*/ */
private int $id = 0; private int $id = 0;
/**
* NAme.
*
* @var string
* @since 1.0.0
*/
public string $name = ''; public string $name = '';
public int $type = 0; public int $type = 0;
/**
* Constructor.
*
* @param string $name Stock name
*
* @since 1.0.0
*/
public function __construct(string $name = '') public function __construct(string $name = '')
{ {
$this->name = $name; $this->name = $name;
} }
/**
* Get id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int public function getId() : int
{ {
return $this->id; return $this->id;

View File

@ -42,11 +42,25 @@ class StockLocation
public int $z = 0; public int $z = 0;
/**
* Constructor.
*
* @param string $name Stock name
*
* @since 1.0.0
*/
public function __construct(string $name = '') public function __construct(string $name = '')
{ {
$this->name = $name; $this->name = $name;
} }
/**
* Get id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int public function getId() : int
{ {
return $this->id; return $this->id;

View File

@ -67,6 +67,11 @@ class StockMovement
*/ */
public \DateTimeImmutable $createdAt; public \DateTimeImmutable $createdAt;
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct() public function __construct()
{ {
$this->createdBy = new NullAccount(); $this->createdBy = new NullAccount();

View File

@ -42,11 +42,25 @@ class StockShelf
public int $z = 0; public int $z = 0;
/**
* Constructor.
*
* @param string $name Shelf name
*
* @since 1.0.0
*/
public function __construct(string $name = '') public function __construct(string $name = '')
{ {
$this->name = $name; $this->name = $name;
} }
/**
* Get id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int public function getId() : int
{ {
return $this->id; return $this->id;