Skip to content

Commit

Permalink
Merge branch '1.4'
Browse files Browse the repository at this point in the history
* 1.4:
  [Resource] [Grid] deprecation warning fixed in service declaration
  Updated config file location
  Make PR template great again
  Update src/Sylius/Bundle/ChannelBundle/spec/Context/FakeChannel/FakeChannelPersisterSpec.php
  [cs] remove unnecesary variables and if conditions
  [Docs] Roadmap in the Book
  [Docs] Roadmap
  • Loading branch information
pamil committed Mar 17, 2019
2 parents 3be96ab + 2072abb commit 3ca756b
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -9,7 +9,7 @@
| License | MIT

<!--
- Bug fixes must be submitted against the 1.2 or 1.3 branch (the lowest possible)
- Bug fixes must be submitted against the 1.3 or 1.4 branch (the lowest possible)
- Features and deprecations must be submitted against the master branch
- Make sure that the correct base branch is set
-->
1 change: 1 addition & 0 deletions docs/_themes/sylius_rtd_theme/layout.html
Expand Up @@ -96,6 +96,7 @@
<!-- Local TOC -->
<div class="local-toc">{{ toc }}</div>
{% endif %}
<a href="https://sylius.com/roadmap"><div class="local-toc">🔔 Roadmap</div></a>
</div>
&nbsp;
</nav>
Expand Down
6 changes: 6 additions & 0 deletions docs/book/introduction/introduction.rst
Expand Up @@ -45,6 +45,12 @@ E-Commerce Components for PHP
If you use a different framework than Symfony, you are welcome to use Sylius components, which will make it much easier to implement a webshop with any PHP application and project.
They provide you with default models, services and logic for all aspects of e-commerce, completely separated and ready to use.

Roadmap
-------

Are you wondering about Sylius plans for the next releases? If so then you should follow our `Roadmap <https://sylius.com/roadmap>`_ on Github.
There you can contribute by conversation and votes on the most desired features and improvements.

Final Thoughts
--------------

Expand Down
Expand Up @@ -9,7 +9,7 @@ This guide will instruct you how to disable this check & notification.
How to disable notifications?
-----------------------------

Add the following configuration to ``app/config/config.yml``.
Add the following configuration to ``app/config/packages/_sylius.yaml``.

.. code-block:: yaml
Expand Down
Expand Up @@ -87,11 +87,6 @@ protected function isProvinceValid(AddressInterface $address): bool
if (null === $province) {
return false;
}

if ($country->hasProvince($province)) {
return true;
}

return false;
return $country->hasProvince($province);
}
}
Expand Up @@ -72,15 +72,7 @@ function it_persists_fake_channel_codes_in_a_cookie(
$response->headers = $responseHeaderBag;
$responseHeaderBag
->setCookie(Argument::that(function (Cookie $cookie) {
if ($cookie->getName() !== '_channel_code') {
return false;
}

if ($cookie->getValue() !== 'fake_channel_code') {
return false;
}

return true;
return $cookie->getName() === '_channel_code' && $cookie->getValue() === 'fake_channel_code';
}))
->shouldBeCalled()
;
Expand Down
Expand Up @@ -18,7 +18,7 @@
<service id="sylius.grid_driver.doctrine.phpcrodm" class="Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\Driver">
<argument type="service" id="doctrine_phpcr.odm.document_manager" />
<tag name="sylius.grid_driver" alias="doctrine/phpcr-odm" />
<deprecated>The "sylius.grid_driver.doctrine.phpcrodm" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
<deprecated>The "%service_id%" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
</service>
</services>
</container>
Expand Up @@ -22,13 +22,13 @@
<service id="sylius.event_subscriber.odm_mapped_super_class" class="Sylius\Bundle\ResourceBundle\EventListener\ODMMappedSuperClassSubscriber">
<argument type="service" id="sylius.resource_registry" />
<tag name="doctrine_mongodb.odm.event_subscriber" priority="8192" />
<deprecated>The "sylius.event_subscriber.odm_mapped_super_class" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
<deprecated>The "%service_id%" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
</service>

<service id="sylius.event_subscriber.odm_repository_class" class="Sylius\Bundle\ResourceBundle\EventListener\ODMRepositoryClassSubscriber">
<argument type="service" id="sylius.resource_registry" />
<tag name="doctrine_mongodb.odm.event_subscriber" priority="8192" />
<deprecated>The "sylius.event_subscriber.odm_repository_class" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
<deprecated>The "%service_id%" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
</service>
</services>
</container>
Expand Down
Expand Up @@ -76,22 +76,15 @@ private function getLastPayment(OrderInterface $order): ?PaymentInterface
if (null !== $lastCancelledPayment) {
return $lastCancelledPayment;
}

$lastFailedPayment = $order->getLastPayment(PaymentInterface::STATE_FAILED);
if (null !== $lastFailedPayment) {
return $lastFailedPayment;
}

return null;
return $order->getLastPayment(PaymentInterface::STATE_FAILED);
}

private function getDefaultPaymentMethod(PaymentInterface $payment, OrderInterface $order): ?PaymentMethodInterface
{
try {
$payment->setOrder($order);
$paymentMethod = $this->defaultPaymentMethodResolver->getDefaultPaymentMethod($payment);

return $paymentMethod;
return $this->defaultPaymentMethodResolver->getDefaultPaymentMethod($payment);
} catch (UnresolvedDefaultPaymentMethodException $exception) {
return null;
}
Expand Down
14 changes: 1 addition & 13 deletions src/Sylius/Component/Order/Model/Adjustment.php
Expand Up @@ -67,19 +67,7 @@ public function getId()
*/
public function getAdjustable(): ?AdjustableInterface
{
if (null !== $this->order) {
return $this->order;
}

if (null !== $this->orderItem) {
return $this->orderItem;
}

if (null !== $this->orderItemUnit) {
return $this->orderItemUnit;
}

return null;
return $this->order ?? $this->orderItem ?? $this->orderItemUnit;
}

/**
Expand Down
Expand Up @@ -26,11 +26,6 @@ public function isEligible(PromotionSubjectInterface $promotionSubject, Promotio
if (null === $usageLimit = $promotion->getUsageLimit()) {
return true;
}

if ($promotion->getUsed() < $usageLimit) {
return true;
}

return false;
return $promotion->getUsed() < $usageLimit;
}
}
Expand Up @@ -115,9 +115,7 @@ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $
$results = $this->applyOrder($results, $orderBy);
}

$results = array_slice($results, $offset ?? 0, $limit);

return $results;
return array_slice($results, $offset ?? 0, $limit);
}

/**
Expand Down

0 comments on commit 3ca756b

Please sign in to comment.