Skip to content

Commit

Permalink
After review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Aug 31, 2021
1 parent 79fbdf6 commit b3776ba
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 55 deletions.
3 changes: 1 addition & 2 deletions src/Sylius/Component/Attribute/Model/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class Attribute implements AttributeInterface

protected ?string $type = TextAttributeType::TYPE;

/** @var array */
protected $configuration = [];
protected array $configuration = [];

protected ?string $storageType = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ final class CachedPerRequestChannelContext implements ChannelContextInterface

private RequestStack $requestStack;

/** @var \SplObjectStorage<Request, ChannelInterface> */
private $requestToChannelMap;
private \SplObjectStorage $requestToChannelMap;

/** @var \SplObjectStorage<Request, ChannelNotFoundException> */
private $requestToExceptionMap;
private \SplObjectStorage $requestToExceptionMap;

public function __construct(ChannelContextInterface $decoratedChannelContext, RequestStack $requestStack)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Channel/Model/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Channel implements ChannelInterface
{
use TimestampableTrait, ToggleableTrait;

/** @var mixed|null */
/** @var mixed */
protected $id;

protected ?string $code = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function it_does_not_cache_channel_not_found_exceptions_for_null_master_requests
->will(new class($channel->getWrappedObject()) {
private int $counter = 0;

private ?ChannelInterface $channel;
private ChannelInterface $channel;

public function __construct(ChannelInterface $channel)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class ShopBasedCartContext implements CartContextInterface

private ShopperContextInterface $shopperContext;

private ?\Sylius\Component\Core\Model\OrderInterface $cart = null;
private ?OrderInterface $cart = null;

public function __construct(CartContextInterface $cartContext, ShopperContextInterface $shopperContext)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Sylius/Component/Core/Model/ChannelPricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

class ChannelPricing implements ChannelPricingInterface
{
protected ?int $id = null;
/** @var mixed */
protected $id = null;

protected ?string $channelCode = null;

Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Core/Model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class Customer extends BaseCustomer implements CustomerInterface
*/
protected Collection $addresses;

/** @var ShopUserInterface|null */
protected $user;
protected ?ShopUserInterface $user = null;

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Core/Model/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

abstract class Image implements ImageInterface
{
/** @var mixed|null */
/** @var mixed */
protected $id = null;

protected ?string $type = null;
Expand Down
9 changes: 3 additions & 6 deletions src/Sylius/Component/Core/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@

class Order extends BaseOrder implements OrderInterface
{
/** @var CustomerInterface|null */
protected $customer;
protected ?CustomerInterface $customer = null;

/** @var ChannelInterface|null */
protected $channel;
protected ?ChannelInterface $channel = null;

protected ?AddressInterface $shippingAddress = null;

Expand All @@ -57,8 +55,7 @@ class Order extends BaseOrder implements OrderInterface

protected ?string $localeCode = null;

/** @var BaseCouponInterface|null */
protected $promotionCoupon;
protected ?BaseCouponInterface $promotionCoupon = null;

protected ?string $checkoutState = OrderCheckoutStates::STATE_CART;

Expand Down
5 changes: 2 additions & 3 deletions src/Sylius/Component/Core/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProduct
*/
protected Collection $channels;

protected ?\Sylius\Component\Core\Model\TaxonInterface $mainTaxon = null;
protected ?TaxonInterface $mainTaxon = null;

/**
* @var Collection|ReviewInterface[]
Expand All @@ -50,8 +50,7 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProduct
*/
protected Collection $reviews;

/** @var float */
protected $averageRating = 0;
protected float $averageRating = 0.0;

/**
* @var Collection|ImageInterface[]
Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Core/Model/ProductVariant.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class ProductVariant extends BaseVariant implements ProductVariantInterface, Com

protected ?int $onHold = 0;

/** @var int */
protected $onHand = 0;
protected ?int $onHand = 0;

protected bool $tracked = false;

Expand Down
3 changes: 2 additions & 1 deletion src/Sylius/Component/Core/Model/ShopBillingData.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

class ShopBillingData implements ShopBillingDataInterface
{
protected ?int $id = null;
/** @var mixed */
protected $id = null;

protected ?string $company = null;

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

interface ProductRepositoryInterface extends BaseProductRepositoryInterface
{
/**
* @param mixed|null $taxonId
*/
/** @param mixed|null $taxonId */
public function createListQueryBuilder(string $locale, $taxonId = null): QueryBuilder;

public function createShopListQueryBuilder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ final class UnpaidOrdersStateUpdater implements UnpaidOrdersStateUpdaterInterfac

private ?LoggerInterface $logger;

/**
* @param string $expirationPeriod
*/
public function __construct(
OrderRepositoryInterface $orderRepository,
Factory $stateMachineFactory,
$expirationPeriod,
string $expirationPeriod,
LoggerInterface $logger = null
) {
$this->orderRepository = $orderRepository;
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Core/spec/Model/OrderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\AdjustmentInterface;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Core\Model\PaymentInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Locale/Model/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Locale implements LocaleInterface
{
use TimestampableTrait;

/** @var mixed|null */
/** @var mixed */
protected $id = null;

protected ?string $code = null;
Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Order/Model/Adjustment.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class Adjustment implements AdjustmentInterface

protected ?string $originCode = null;

/** @var array */
protected $details = [];
protected array $details = [];

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Order/Model/OrderItemUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class OrderItemUnit implements OrderItemUnitInterface
{
/** @var mixed|null */
/** @var mixed */
protected $id = null;

protected OrderItemInterface $orderItem;
Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Payment/Model/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class Payment implements PaymentInterface

protected ?string $state = PaymentInterface::STATE_CART;

/** @var array */
protected $details = [];
protected array $details = [];

public function __construct()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Sylius/Component/Product/Model/ProductAssociationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class ProductAssociationType implements ProductAssociationTypeInterface
getTranslation as private doGetTranslation;
}

/** @var mixed|null */
/** @var mixed */
protected $id = null;

protected ?string $code = null;

protected string $name;
protected ?string $name = null;

public function __construct()
{
Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Promotion/Model/PromotionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class PromotionAction implements PromotionActionInterface

protected ?string $type = null;

/** @var array */
protected $configuration = [];
protected array $configuration = [];

protected ?PromotionInterface $promotion = null;

Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Promotion/Model/PromotionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class PromotionRule implements PromotionRuleInterface

protected ?string $type = null;

/** @var array */
protected $configuration = [];
protected array $configuration = [];

protected ?PromotionInterface $promotion = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Review/Model/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Review implements ReviewInterface
{
use TimestampableTrait;

/** @var mixed|null */
/** @var mixed */
protected $id = null;

protected ?string $title = null;
Expand Down
5 changes: 3 additions & 2 deletions src/Sylius/Component/Review/Model/Reviewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

class Reviewer implements ReviewerInterface
{
protected ?int $id = null;
/** @var mixed */
protected $id = null;

protected ?string $email = null;

Expand All @@ -24,7 +25,7 @@ class Reviewer implements ReviewerInterface
protected ?string $lastName = null;

/**
* @return int|null
* @return mixed
*/
public function getId()
{
Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Shipping/Model/ShippingMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class ShippingMethod implements ShippingMethodInterface

protected ?string $calculator = null;

/** @var array */
protected $configuration = [];
protected array $configuration = [];

/**
* @var Collection|ShippingMethodRuleInterface[]
Expand Down
3 changes: 1 addition & 2 deletions src/Sylius/Component/Shipping/Model/ShippingMethodRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class ShippingMethodRule implements ShippingMethodRuleInterface

protected ?string $type = null;

/** @var array */
protected $configuration = [];
protected array $configuration = [];

protected ?ShippingMethodInterface $shippingMethod = null;

Expand Down
4 changes: 1 addition & 3 deletions src/Sylius/Component/User/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ class User implements UserInterface

/**
* We need at least one role to be able to authenticate
*
* @var array
*/
protected $roles = [UserInterface::DEFAULT_ROLE];
protected array $roles = [UserInterface::DEFAULT_ROLE];

/**
* @var Collection|UserOAuthInterface[]
Expand Down

0 comments on commit b3776ba

Please sign in to comment.