Skip to content

Commit

Permalink
Fix ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Apr 29, 2024
1 parent b9ba9ae commit 488077f
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/Checker/ChannelEligibilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

final class ChannelEligibilityChecker implements VatRateEligibilityCheckerInterface
{

public function __construct(
private ZoneMatcherInterface $zoneMatcher,
) {
Expand Down
3 changes: 1 addition & 2 deletions src/Checker/DefaultEligibilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ public function __construct(

public function check(
VATNumberAwareInterface&AddressInterface $taxationAddress,

Check failure on line 23 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

ParseError

src/Checker/DefaultEligibilityChecker.php:23:9: ParseError: Intersection types are not supported in PHP < 8.1 (see https://psalm.dev/173)

Check failure on line 23 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

ParseError

src/Checker/DefaultEligibilityChecker.php:23:9: ParseError: Intersection types are not supported in PHP < 8.1 (see https://psalm.dev/173)
ChannelInterface&EuropeanChannelAwareInterface $channel
ChannelInterface&EuropeanChannelAwareInterface $channel,

Check failure on line 24 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

ParseError

src/Checker/DefaultEligibilityChecker.php:24:9: ParseError: Intersection types are not supported in PHP < 8.1 (see https://psalm.dev/173)

Check failure on line 24 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

ParseError

src/Checker/DefaultEligibilityChecker.php:24:9: ParseError: Intersection types are not supported in PHP < 8.1 (see https://psalm.dev/173)
): bool {

foreach ($this->checkers as $checker) {

Check failure on line 26 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^6.4)

MixedAssignment

src/Checker/DefaultEligibilityChecker.php:26:37: MixedAssignment: Unable to determine the type that $checker is being assigned to (see https://psalm.dev/032)

Check failure on line 26 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^5.4)

MixedAssignment

src/Checker/DefaultEligibilityChecker.php:26:37: MixedAssignment: Unable to determine the type that $checker is being assigned to (see https://psalm.dev/032)

Check failure on line 26 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^5.4)

MixedAssignment

src/Checker/DefaultEligibilityChecker.php:26:37: MixedAssignment: Unable to determine the type that $checker is being assigned to (see https://psalm.dev/032)

Check failure on line 26 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^6.4)

MixedAssignment

src/Checker/DefaultEligibilityChecker.php:26:37: MixedAssignment: Unable to determine the type that $checker is being assigned to (see https://psalm.dev/032)

Check failure on line 26 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

MixedAssignment

src/Checker/DefaultEligibilityChecker.php:26:37: MixedAssignment: Unable to determine the type that $checker is being assigned to (see https://psalm.dev/032)

Check failure on line 26 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

MixedAssignment

src/Checker/DefaultEligibilityChecker.php:26:37: MixedAssignment: Unable to determine the type that $checker is being assigned to (see https://psalm.dev/032)
if (false === $checker->check($taxationAddress, $channel)) {

Check failure on line 27 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^6.4)

MixedMethodCall

src/Checker/DefaultEligibilityChecker.php:27:37: MixedMethodCall: Cannot determine the type of $checker when calling method check (see https://psalm.dev/015)

Check failure on line 27 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^5.4)

MixedMethodCall

src/Checker/DefaultEligibilityChecker.php:27:37: MixedMethodCall: Cannot determine the type of $checker when calling method check (see https://psalm.dev/015)

Check failure on line 27 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^5.4)

MixedMethodCall

src/Checker/DefaultEligibilityChecker.php:27:37: MixedMethodCall: Cannot determine the type of $checker when calling method check (see https://psalm.dev/015)

Check failure on line 27 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8.3, Symfony ^6.4)

MixedMethodCall

src/Checker/DefaultEligibilityChecker.php:27:37: MixedMethodCall: Cannot determine the type of $checker when calling method check (see https://psalm.dev/015)

Check failure on line 27 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

MixedMethodCall

src/Checker/DefaultEligibilityChecker.php:27:37: MixedMethodCall: Cannot determine the type of $checker when calling method check (see https://psalm.dev/015)

Check failure on line 27 in src/Checker/DefaultEligibilityChecker.php

View workflow job for this annotation

GitHub Actions / Static checks (PHP 8, Symfony ^5.4)

MixedMethodCall

src/Checker/DefaultEligibilityChecker.php:27:37: MixedMethodCall: Cannot determine the type of $checker when calling method check (see https://psalm.dev/015)
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Checker/VatRateEligibilityCheckerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
interface VatRateEligibilityCheckerInterface
{
public function check(
AddressInterface&VATNumberAwareInterface $taxationAddress,
AddressInterface&VATNumberAwareInterface $taxationAddress,
ChannelInterface&EuropeanChannelAwareInterface $channel,
): bool;
}
4 changes: 0 additions & 4 deletions src/Entity/EuropeanChannelAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ trait EuropeanChannelAwareTrait
* @ORM\ManyToOne(targetEntity="Sylius\Component\Addressing\Model\CountryInterface", fetch="EAGER")
*
* @ORM\JoinColumn(name="base_country_id", onDelete="SET NULL")
*
* @var CountryInterface|null
*/
#[ORM\JoinColumn(name: 'base_country_id', onDelete: 'SET NULL')]
#[ORM\ManyToOne(targetEntity: CountryInterface::class, fetch: 'EAGER')]
Expand All @@ -25,8 +23,6 @@ trait EuropeanChannelAwareTrait
* @ORM\ManyToOne(targetEntity="Sylius\Component\Addressing\Model\ZoneInterface", fetch="EAGER")
*
* @ORM\JoinColumn(name="european_zone_id", onDelete="SET NULL")
*
* @var ZoneInterface|null
*/
#[ORM\JoinColumn(name: 'european_zone_id', onDelete: 'SET NULL')]
#[ORM\ManyToOne(targetEntity: ZoneInterface::class, fetch: 'EAGER')]
Expand Down
2 changes: 0 additions & 2 deletions src/Entity/VATNumberAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ trait VATNumberAwareTrait
* @ORM\Column(name="vat_number", type="string", nullable=true)
*
* @Gedmo\Versioned()
*
* @var string|null
*/
#[ORM\Column(name: 'vat_number', type: 'string', nullable: true)]
#[Gedmo\Versioned]
Expand Down
1 change: 0 additions & 1 deletion src/Extractor/ChannelExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

final class ChannelExtractor implements ChannelExtractorInterface
{

public function extract(OrderInterface $order): ?EuropeanChannelAwareInterface
{
$channel = $order->getChannel();
Expand Down
1 change: 0 additions & 1 deletion src/Extractor/TaxationAddressExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace FluxSE\SyliusEUVatPlugin\Extractor;

use FluxSE\SyliusEUVatPlugin\Applicator\OrderEuropeanVATNumberApplicator;
use FluxSE\SyliusEUVatPlugin\Entity\VATNumberAwareInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Resolver\TaxationAddressResolverInterface;
Expand Down
6 changes: 3 additions & 3 deletions src/Fixture/Factory/AddressExampleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
use FluxSE\SyliusEUVatPlugin\Entity\VATNumberAwareInterface;
use LogicException;
use Prometee\VIESClient\Helper\ViesHelperInterface;
use Psr\Container\ContainerInterface as PsrContainerInterface;
use Sylius\Bundle\CoreBundle\Fixture\Factory\AddressExampleFactory as BaseAddressExampleFactory;
use Sylius\Component\Addressing\Model\CountryInterface;
use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class AddressExampleFactory extends BaseAddressExampleFactory
Expand Down Expand Up @@ -61,11 +59,13 @@ public function create(array $options = []): AddressInterface&VATNumberAwareInte
if (false === $address instanceof VATNumberAwareInterface) {
throw new LogicException(sprintf(
'The $address must be an instance of %s (%s given).',
VATNumberAwareInterface::class, get_class($address)
VATNumberAwareInterface::class,
get_class($address),
));
}

$address->setVatNumber($vatNumber);

return $address;
}
}
1 change: 1 addition & 0 deletions tests/Application/src/Entity/Addressing/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* @ORM\Entity()
*
* @ORM\Table(name="sylius_address")
*/
#[ORM\Table(name: 'sylius_address')]
Expand Down
1 change: 1 addition & 0 deletions tests/Application/src/Entity/Channel/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* @ORM\Entity()
*
* @ORM\Table(name="sylius_channel")
*/
#[ORM\Table(name: 'sylius_channel')]
Expand Down

0 comments on commit 488077f

Please sign in to comment.