File tree Expand file tree Collapse file tree 6 files changed +44
-5
lines changed
dist/src/Context/Channel/RequestBased Expand file tree Collapse file tree 6 files changed +44
-5
lines changed Original file line number Diff line number Diff line change 1515 fail-fast : false
1616 matrix :
1717 php : ['8.2', '8.3']
18- sylius : [" ~2.0.0" ]
18+ sylius : [ ' ~2.0.0', '~2.0.1' ]
1919
2020 steps :
2121 - name : Setup PHP
Original file line number Diff line number Diff line change 1111
1212declare (strict_types=1 );
1313
14+ use PhpCsFixer \UnsupportedPhpVersionAllowedConfigInterface ;
15+
1416$ header = <<<'HEADER'
1517This file is part of Monsieur Biz' Alert Message plugin for Sylius.
1618
267269 ->setFinder ($ finder )
268270;
269271
272+ if ($ config instanceof UnsupportedPhpVersionAllowedConfigInterface) {
273+ $ config ->setUnsupportedPhpVersionAllowed (true );
274+ }
275+
270276return $ config ;
Original file line number Diff line number Diff line change 11.DEFAULT_GOAL := help
22SHELL =/bin/bash
33APP_DIR =tests/Application
4- SYLIUS_VERSION =2.0 .0
4+ SYLIUS_VERSION =2.1 .0
55SYMFONY =cd ${APP_DIR} && symfony
66COMPOSER =symfony composer
77CONSOLE =${SYMFONY} console
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ By default it'll use the Semantic UI classes.
2020
2121| Sylius Version | PHP Version |
2222| ----------------| -----------------|
23- | 2.0 | 8.2 - 8.3 |
23+ | 2.0, 2.1 | 8.2 - 8.3 |
2424
2525ℹ️ For Sylius 1.x, see our [ 1.x branch] ( https://github.com/monsieurbiz/SyliusAlertMessagePlugin/tree/1.x ) and all 1.x releases.
2626
Original file line number Diff line number Diff line change 66 "license" : " MIT" ,
77 "require" : {
88 "php" : " ^8.2" ,
9- "sylius/sylius" : " ~2.0.0 "
9+ "sylius/sylius" : " ~2.0"
1010 },
1111 "require-dev" : {
1212 "friendsofphp/php-cs-fixer" : " ^3.16" ,
2828 "cache:clear" : " symfony-cmd" ,
2929 "assets:install %PUBLIC_DIR%" : " symfony-cmd"
3030 },
31- "phpcs" : " PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --using-cache=no" ,
31+ "phpcs" : " php-cs-fixer fix --using-cache=no" ,
3232 "phpstan" : " phpstan analyse -c phpstan.neon src/" ,
3333 "phpmd" : " phpmd --exclude Migrations/* src/ ansi phpmd.xml" ,
3434 "phpunit" : " phpunit" ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of Monsieur Biz' Alert Message plugin for Sylius.
5+ *
6+ * (c) Monsieur Biz <[email protected] > 7+ *
8+ * For the full copyright and license information, please view the LICENSE.txt
9+ * file that was distributed with this source code.
10+ */
11+
12+ declare (strict_types=1 );
13+
14+ namespace App \Context \Channel \RequestBased ;
15+
16+ use Sylius \Component \Channel \Context \RequestBased \RequestResolverInterface ;
17+ use Sylius \Component \Channel \Model \ChannelInterface ;
18+ use Sylius \Component \Channel \Repository \ChannelRepositoryInterface ;
19+ use Symfony \Component \DependencyInjection \Attribute \AutoconfigureTag ;
20+ use Symfony \Component \HttpFoundation \Request ;
21+
22+ #[AutoconfigureTag('sylius.context.channel.request_based.resolver ' )]
23+ final class HostnameAndPortBasedRequestResolver implements RequestResolverInterface
24+ {
25+ public function __construct (private ChannelRepositoryInterface $ channelRepository )
26+ {
27+ }
28+
29+ public function findChannel (Request $ request ): ?ChannelInterface
30+ {
31+ return $ this ->channelRepository ->findOneEnabledByHostname ($ request ->getHost () . ': ' . $ request ->getPort ());
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments