Skip to content

Commit

Permalink
Fix more Psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Sep 23, 2024
1 parent 9fbf135 commit 2fedb71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ jobs:
tools: "flex"

- name: "Remove sylius/sylius from composer.json"
run: "composer remove --dev --no-update --no-plugins --no-scripts sylius/sylius"

run: "composer remove --dev --no-update --no-install --no-plugins --no-scripts sylius/sylius"
- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
env:
Expand Down
9 changes: 9 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@
<function name="var_dump"/>
<function name="print_r"/>
</forbiddenFunctions>
<issueHandlers>
<UndefinedClass>
<errorLevel type="suppress">
<!-- The reason we do this is that the Symfony Mailer is an optional dependency -->
<referencedClass name="Symfony\Component\Mailer\Event\MessageEvent"/>
<referencedClass name="Symfony\Component\Mailer\Event\SentMessageEvent"/>
</errorLevel>
</UndefinedClass>
</issueHandlers>
</psalm>
5 changes: 2 additions & 3 deletions src/DependencyInjection/SetonoSyliusMailerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Mailer\MailerInterface;

final class SetonoSyliusMailerExtension extends AbstractResourceExtension
{
Expand All @@ -32,11 +31,11 @@ public function load(array $configs, ContainerBuilder $container): void

$loader->load('services.xml');

if (ContainerBuilder::willBeAvailable('symfony/mailer', MailerInterface::class, ['symfony/framework-bundle'])) {
if (ContainerBuilder::willBeAvailable('symfony/mailer', 'Symfony\Component\Mailer\MailerInterface', ['symfony/framework-bundle'])) {
$loader->load('services/conditional/symfony_mailer.xml');
}

if (ContainerBuilder::willBeAvailable('swiftmailer/swiftmailer', \Swift_Mailer::class, ['symfony/swiftmailer-bundle'])) {
if (ContainerBuilder::willBeAvailable('swiftmailer/swiftmailer', '\Swift_Mailer', ['symfony/swiftmailer-bundle'])) {
$loader->load('services/conditional/swiftmailer.xml');
}
}
Expand Down

0 comments on commit 2fedb71

Please sign in to comment.