Skip to content

Commit

Permalink
Fixing the remaining namespaces and attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mamazu committed Apr 16, 2024
1 parent 8983bd2 commit e9463a7
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 38 deletions.
15 changes: 7 additions & 8 deletions src/Traits/OrderItemCustomerOptionCapableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
trait OrderItemCustomerOptionCapableTrait
{
/**
* @var Collection|OrderItemOptionInterface[]
*
* @ORM\OneToMany(
* targetEntity="Brille24\SyliusCustomerOptionsPlugin\Entity\OrderItemOptionInterface",
* mappedBy="orderItem",
* cascade={"persist", "remove"}
* )
* @var Collection<OrderItemOptionInterface>
*/
protected $configuration;
#[ORM\OneToMany(
targetEntity:OrderItemOptionInterface::class,
mappedBy:'orderItem',
cascade:['persist', 'remove']
)]
protected Collection $configuration;

public function __construct()
{
Expand Down
31 changes: 11 additions & 20 deletions src/Traits/ProductCustomerOptionCapableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,20 @@

trait ProductCustomerOptionCapableTrait
{
/**
* @var CustomerOptionGroupInterface|null
*
* @ORM\ManyToOne(
* targetEntity="Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionGroupInterface",
* inversedBy="products"
* )
*
* @ORM\JoinColumn(onDelete="SET NULL")
*/
protected $customerOptionGroup;
#[ORM\ManyToOne(targetEntity: CustomerOptionGroupInterface::class, inversedBy: "products")]
#[ORM\JoinColumn(onDelete: "SET NULL")]
protected ?CustomerOptionGroupInterface $customerOptionGroup;

/**
* @var Collection|CustomerOptionValuePriceInterface[]
*
* @ORM\OneToMany(
* targetEntity="Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionValuePriceInterface",
* mappedBy="product",
* orphanRemoval=true,
* cascade={"persist", "remove"}
* )
* @var Collection<CustomerOptionValuePriceInterface>
*/
protected $customerOptionValuePrices;
#[ORM\OneToMany(
targetEntity: CustomerOptionValuePriceInterface::class,
mappedBy: "product",
orphanRemoval: true,
cascade: ["persist", "remove"]
)]
protected Collection $customerOptionValuePrices;

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/Entity/ConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Entity\Tools;
namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Entity;

use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionInterface;
use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\Validator\Condition;
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/Factory/OrderItemOptionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Brille24\SyliusCustomerOptionsPlugin\Factory;
namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Factory;

use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionInterface;
use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionValueInterface;
Expand Down
4 changes: 2 additions & 2 deletions tests/PHPUnit/Service/CustomerOptionValueRefresherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Brille24\SyliusCustomerOptionsPlugin\Service;
namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Service;

use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOption;
use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionInterface;
Expand All @@ -22,7 +22,7 @@

class CustomerOptionValueRefresherTest extends TestCase
{
private \Brille24\SyliusCustomerOptionsPlugin\Services\CustomerOptionValueRefresher $customerOptionValueRefresher;
private CustomerOptionValueRefresher $customerOptionValueRefresher;

private int $updateCount = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Brille24\SyliusCustomerOptionsPlugin\Validator;
namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Validator;

use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionAssociationInterface;
use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionInterface;
Expand All @@ -14,7 +14,7 @@

class CustomerOptionAssociationConstraintValidatorTest extends TestCase
{
private \Brille24\SyliusCustomerOptionsPlugin\Validator\CustomerOptionAssociationConstraintValidator $customerOptionAssociationConstraintValidator;
private CustomerOptionAssociationConstraintValidator $customerOptionAssociationConstraintValidator;

private array $violations = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Brille24\SyliusCustomerOptionsPlugin\Validator;
namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Validator;

use Brille24\SyliusCustomerOptionsPlugin\Validator\Constraints\CustomerOptionConfigurationConstraint;
use Brille24\SyliusCustomerOptionsPlugin\Validator\CustomerOptionConfigurationConstraintValidator;
Expand All @@ -14,7 +14,7 @@

class CustomerOptionConfigurationConstraintValidatorTest extends TestCase
{
private \Brille24\SyliusCustomerOptionsPlugin\Validator\CustomerOptionConfigurationConstraintValidator $customerOptionConfigurationValidator;
private CustomerOptionConfigurationConstraintValidator $customerOptionConfigurationValidator;

private array $violations = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Brille24\SyliusCustomerOptionsPlugin\Validator;
namespace Tests\Brille24\SyliusCustomerOptionsPlugin\PHPUnit\Validator;

use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionInterface;
use Brille24\SyliusCustomerOptionsPlugin\Entity\CustomerOptions\CustomerOptionValueInterface;
Expand All @@ -21,7 +21,7 @@

class CustomerOptionValuePriceDateOverlapConstraintValidatorTest extends TestCase
{
private \Brille24\SyliusCustomerOptionsPlugin\Validator\CustomerOptionValuePriceDateOverlapConstraintValidator $productCustomerOptionPriceValidator;
private CustomerOptionValuePriceDateOverlapConstraintValidator $productCustomerOptionPriceValidator;

private array $violations = [];

Expand Down

0 comments on commit e9463a7

Please sign in to comment.