fix phpstan/phpcs

This commit is contained in:
Dennis Eichhorn 2021-06-26 14:38:08 +02:00
parent ebf32e9cc1
commit 40043f26ac
7 changed files with 125 additions and 95 deletions

View File

@ -0,0 +1,28 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Purchase\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Purchase\Models;
/**
* Order suggestion interface.
*
* @package Modules\Purchase\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
interface OrderSuggestionInterface
{
}

View File

@ -14,107 +14,109 @@ declare(strict_types=1);
namespace Modules\Purchase\OrderSuggestion;
use Modules\Purchase\Models\OrderSuggestionInterface;
/**
* OMS order suggestion class
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class DefaultOrderSuggestion implements OrderSuggestionInterface
{
/**
* Which data should be used to create the order suggestion?
*
* @var int
* @since 1.0.0
*/
public int $suggestionType = OrderSuggestionType::HISTORIC;
/**
* Which data should be used to create the order suggestion?
*
* @var int
* @since 1.0.0
*/
public int $suggestionType = OrderSuggestionType::HISTORIC;
/**
* Comparison duration type.
*
* @var int
* @since 1.0.0
*/
public int $historicComparisonDurationType = OrderSuggestionComparisonDurationType::ANNUAL;
/**
* Comparison duration type.
*
* @var int
* @since 1.0.0
*/
public int $historicComparisonDurationType = OrderSuggestionComparisonDurationType::ANNUALY;
/**
* How many years should used for the analysis.
*
* @var int
* @since 1.0.0
*/
public int $historicComparisonDuration = 1;
/**
* How many years should used for the analysis.
*
* @var int
* @since 1.0.0
*/
public int $historicComparisonDuration = 1;
/**
* Which averaging method should be used?
*
* @var int
* @since 1.0.0
*/
public int $historicAveragingMethod = OrderSuggestionAveragingMethod::MEAN;
/**
* Which averaging method should be used?
*
* @var int
* @since 1.0.0
*/
public int $historicAveragingMethod = OrderSuggestionAveragingMethod::MEAN;
/**
* What should the focus of the order suggestion be?
*
* @var int
* @since 1.0.0
*/
public int $optimizationType = OrderSuggestionOptimizationType::PRICE;
/**
* What should the focus of the order suggestion be?
*
* @var int
* @since 1.0.0
*/
public int $optimizationType = OrderSuggestionOptimizationType::PRICE;
/**
* How greedy should the algorithm be?
*
* The number represents how many items in % can be bought in additon to the optimal stock quantity.
*
* Higher means more room for adjustments.
*
* @var int
* @since 1.0.0
*/
public int $optimizationGreediness = 10;
/**
* How greedy should the algorithm be?
*
* The number represents how many items in % can be bought in additon to the optimal stock quantity.
*
* Higher means more room for adjustments.
*
* @var int
* @since 1.0.0
*/
public int $optimizationGreediness = 10;
/**
* For how many days would you like to have stock?
*
* Or in other words, higher means you need to order less often per year.
*
* Only relevant if OptimizationType::AVAILABILITY
*
* @var int
* @since 1.0.0
*/
public int $optimizationDays = 0;
/**
* For how many days would you like to have stock?
*
* Or in other words, higher means you need to order less often per year.
*
* Only relevant if OptimizationType::AVAILABILITY
*
* @var int
* @since 1.0.0
*/
public int $optimizationDays = 0;
/**
* Maximum available budget.
*
* 0 = infinite budget
*
* If a budget is defined and the optimal order is > than the available budget,
* the algorithm will try to order as many different items as possible.
*
* If not all items can be ordered will try to order the items with the highest profit.
*
* @var int
* @since 1.0.0
*/
public int $maxAvailableBudget = 0;
/**
* Maximum available budget.
*
* 0 = infinite budget
*
* If a budget is defined and the optimal order is > than the available budget,
* the algorithm will try to order as many different items as possible.
*
* If not all items can be ordered will try to order the items with the highest profit.
*
* @var int
* @since 1.0.0
*/
public int $maxAvailableBudget = 0;
/**
* item data for algorithm:
* number
* name
* purchase price per volume
* minimum quantity per volume
* delivery time / lead time
* in-house processing time (e.g. qs time, labelling, packaging)
* ordered (order confirmations)
* stock available
* offers
* avg. profit
* demand in period N
*/
/**
* item data for algorithm:
* number
* name
* purchase price per volume
* minimum quantity per volume
* delivery time / lead time
* in-house processing time (e.g. qs time, labelling, packaging)
* ordered (order confirmations)
* stock available
* offers
* avg. profit
* demand in period N
*/
}

View File

@ -4,7 +4,7 @@
*
* PHP Version 8.0
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -19,7 +19,7 @@ use phpOMS\Stdlib\Base\Enum;
/**
* Suggestion type enum.
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0

View File

@ -4,7 +4,7 @@
*
* PHP Version 8.0
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -19,7 +19,7 @@ use phpOMS\Stdlib\Base\Enum;
/**
* Suggestion type enum.
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0

View File

@ -4,7 +4,7 @@
*
* PHP Version 8.0
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -19,7 +19,7 @@ use phpOMS\Stdlib\Base\Enum;
/**
* Suggestion type enum.
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0

View File

@ -4,7 +4,7 @@
*
* PHP Version 8.0
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -19,7 +19,7 @@ use phpOMS\Stdlib\Base\Enum;
/**
* Suggestion type enum.
*
* @package Modules\Purchase\Models\OrderSuggestion
* @package Modules\Purchase\OrderSuggestion
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0

View File

@ -9,7 +9,7 @@
],
"require-dev": {
"phpunit/phpunit": ">=9.4",
"friendsofphp/php-cs-fixer": ">=2.18",
"friendsofphp/php-cs-fixer": ">=3.0",
"squizlabs/php_codesniffer": ">=3.5",
"phpmd/phpmd": ">=2.9",
"phpstan/phpstan": ">=0.12.58",