Code Duplication    Length = 21-23 lines in 8 locations

src/Core/Request/CartDiscounts/Command/CartDiscountSetValidFromAction.php 1 location

@@ 21-43 (lines=23) @@
18
 * @method DateTimeDecorator getValidFrom()
19
 * @method CartDiscountSetValidFromAction setValidFrom(DateTime $validFrom = null)
20
 */
21
class CartDiscountSetValidFromAction extends AbstractAction
22
{
23
    public function fieldDefinitions()
24
    {
25
        return [
26
            'action' => [static::TYPE => 'string'],
27
            'validFrom' => [
28
                static::TYPE => DateTime::class,
29
                static::DECORATOR => DateTimeDecorator::class
30
            ],
31
        ];
32
    }
33
34
    /**
35
     * @param array $data
36
     * @param Context|callable $context
37
     */
38
    public function __construct(array $data = [], $context = null)
39
    {
40
        parent::__construct($data, $context);
41
        $this->setAction('setValidFrom');
42
    }
43
}
44

src/Core/Request/CartDiscounts/Command/CartDiscountSetValidUntilAction.php 1 location

@@ 21-43 (lines=23) @@
18
 * @method DateTimeDecorator getValidUntil()
19
 * @method CartDiscountSetValidUntilAction setValidUntil(DateTime $validUntil = null)
20
 */
21
class CartDiscountSetValidUntilAction extends AbstractAction
22
{
23
    public function fieldDefinitions()
24
    {
25
        return [
26
            'action' => [static::TYPE => 'string'],
27
            'validUntil' => [
28
                static::TYPE => DateTime::class,
29
                static::DECORATOR => DateTimeDecorator::class
30
            ],
31
        ];
32
    }
33
34
    /**
35
     * @param array $data
36
     * @param Context|callable $context
37
     */
38
    public function __construct(array $data = [], $context = null)
39
    {
40
        parent::__construct($data, $context);
41
        $this->setAction('setValidUntil');
42
    }
43
}
44

src/Core/Request/Customers/Command/CustomerSetDateOfBirthAction.php 1 location

@@ 21-43 (lines=23) @@
18
 * @method string getAction()
19
 * @method CustomerSetDateOfBirthAction setAction(string $action = null)
20
 */
21
class CustomerSetDateOfBirthAction extends AbstractAction
22
{
23
    public function fieldDefinitions()
24
    {
25
        return [
26
            'action' => [static::TYPE => 'string'],
27
            'dateOfBirth' => [
28
                static::TYPE => DateTime::class,
29
                static::DECORATOR => DateDecorator::class
30
            ],
31
        ];
32
    }
33
34
    /**
35
     * @param array $data
36
     * @param Context|callable $context
37
     */
38
    public function __construct(array $data = [], $context = null)
39
    {
40
        parent::__construct($data, $context);
41
        $this->setAction('setDateOfBirth');
42
    }
43
}
44

src/Core/Request/Inventory/Command/InventorySetExpectedDeliveryAction.php 1 location

@@ 21-43 (lines=23) @@
18
 * @method DateTimeDecorator getExpectedDelivery()
19
 * @method InventorySetExpectedDeliveryAction setExpectedDelivery(DateTime $expectedDelivery = null)
20
 */
21
class InventorySetExpectedDeliveryAction extends AbstractAction
22
{
23
    public function fieldDefinitions()
24
    {
25
        return [
26
            'action' => [static::TYPE => 'string'],
27
            'expectedDelivery' => [
28
                static::TYPE => DateTime::class,
29
                static::DECORATOR => DateTimeDecorator::class
30
            ],
31
        ];
32
    }
33
34
    /**
35
     * @param array $data
36
     * @param Context|callable $context
37
     */
38
    public function __construct(array $data = [], $context = null)
39
    {
40
        parent::__construct($data, $context);
41
        $this->setAction('setExpectedDelivery');
42
    }
43
}
44

src/Core/Request/Products/Command/ProductSetTaxCategoryAction.php 1 location

@@ 22-42 (lines=21) @@
19
 * @method bool getStaged()
20
 * @method ProductSetTaxCategoryAction setStaged(bool $staged = null)
21
 */
22
class ProductSetTaxCategoryAction extends AbstractAction
23
{
24
    public function fieldDefinitions()
25
    {
26
        return [
27
            'action' => [static::TYPE => 'string'],
28
            'taxCategory' => [static::TYPE => TaxCategoryReference::class],
29
            'staged' => [static::TYPE => 'bool']
30
        ];
31
    }
32
33
    /**
34
     * @param array $data
35
     * @param Context|callable $context
36
     */
37
    public function __construct(array $data = [], $context = null)
38
    {
39
        parent::__construct($data, $context);
40
        $this->setAction('setTaxCategory');
41
    }
42
}
43

src/Core/Request/Carts/Command/CartSetCartTotalTaxAction.php 1 location

@@ 23-43 (lines=21) @@
20
 * @method TaxPortionCollection getExternalTaxPortions()
21
 * @method CartSetCartTotalTaxAction setExternalTaxPortions(TaxPortionCollection $externalTaxPortions = null)
22
 */
23
class CartSetCartTotalTaxAction extends AbstractAction
24
{
25
    public function fieldDefinitions()
26
    {
27
        return [
28
            'action' => [static::TYPE => 'string'],
29
            'externalTotalGross' => [static::TYPE => Money::class],
30
            'externalTaxPortions' => [static::TYPE => TaxPortionCollection::class],
31
        ];
32
    }
33
34
    /**
35
     * @param array $data
36
     * @param Context|callable $context
37
     */
38
    public function __construct(array $data = [], $context = null)
39
    {
40
        parent::__construct($data, $context);
41
        $this->setAction('setCartTotalTax');
42
    }
43
}
44

src/Core/Request/Carts/Command/CartSetCustomLineItemTaxAmountAction.php 1 location

@@ 22-42 (lines=21) @@
19
 * @method ExternalTaxAmountDraft getExternalTaxAmount()
20
 * @method CartSetCustomLineItemTaxAmountAction setExternalTaxAmount(ExternalTaxAmountDraft $externalTaxAmount = null)
21
 */
22
class CartSetCustomLineItemTaxAmountAction extends AbstractAction
23
{
24
    public function fieldDefinitions()
25
    {
26
        return [
27
            'action' => [static::TYPE => 'string'],
28
            'customLineItemId' => [static::TYPE => 'string'],
29
            'externalTaxAmount' => [static::TYPE => ExternalTaxAmountDraft::class],
30
        ];
31
    }
32
33
    /**
34
     * @param array $data
35
     * @param Context|callable $context
36
     */
37
    public function __construct(array $data = [], $context = null)
38
    {
39
        parent::__construct($data, $context);
40
        $this->setAction('setCustomLineItemTaxAmount');
41
    }
42
}
43

src/Core/Request/Carts/Command/CartSetLineItemTaxAmountAction.php 1 location

@@ 22-42 (lines=21) @@
19
 * @method ExternalTaxAmountDraft getExternalTaxAmount()
20
 * @method CartSetLineItemTaxAmountAction setExternalTaxAmount(ExternalTaxAmountDraft $externalTaxAmount = null)
21
 */
22
class CartSetLineItemTaxAmountAction extends AbstractAction
23
{
24
    public function fieldDefinitions()
25
    {
26
        return [
27
            'action' => [static::TYPE => 'string'],
28
            'lineItemId' => [static::TYPE => 'string'],
29
            'externalTaxAmount' => [static::TYPE => ExternalTaxAmountDraft::class],
30
        ];
31
    }
32
33
    /**
34
     * @param array $data
35
     * @param Context|callable $context
36
     */
37
    public function __construct(array $data = [], $context = null)
38
    {
39
        parent::__construct($data, $context);
40
        $this->setAction('setLineItemTaxAmount');
41
    }
42
}
43