Skip to content

Commit 72570ce

Browse files
authored
Merge pull request #49 from Kiwikoti/feature/sylius-version
2 parents f8ee559 + 79b2acf commit 72570ce

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

.github/workflows/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
php: ['8.2', '8.3']
18-
sylius: ['~2.0.0']
18+
sylius: ['~2.0.0', '~2.1.0']
1919

2020
steps:
2121
- name: Setup PHP

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DEFAULT_GOAL := help
22
SHELL=/bin/bash
33
APP_DIR=tests/Application
4-
SYLIUS_VERSION=2.0.0
4+
SYLIUS_VERSION=2.1.0
55
SYMFONY=cd ${APP_DIR} && symfony
66
COMPOSER=symfony composer
77
CONSOLE=${SYMFONY} console

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ If you want to know more about our editor, see the [Rich Editor Repository](http
1414

1515
## Compatibility
1616

17-
| Sylius Version | PHP Version |
18-
|----------------|-----------------|
19-
| 2.0 | 8.2 - 8.3 |
17+
| Sylius Version | PHP Version |
18+
|----------------|-------------|
19+
| 2.0, 2.1 | 8.2 - 8.3 |
2020

2121
ℹ️ For Sylius 1.x, see our [1.x branch](https://github.com/monsieurbiz/SyliusHomepagePlugin/tree/1.x) and all 1.x releases.
2222

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"monsieurbiz/sylius-media-manager-plugin": "^2.0",
99
"monsieurbiz/sylius-rich-editor-plugin": "^3.0",
1010
"php": "^8.2",
11-
"sylius/sylius": "~2.0.0"
11+
"sylius/sylius": "~2.0"
1212
},
1313
"require-dev": {
1414
"friendsofphp/php-cs-fixer": "^3.16",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Monsieur Biz' Homepage 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+
}

0 commit comments

Comments
 (0)