Skip to content

Commit 72e9465

Browse files
authored
Merge pull request #96 from trikoder/remove-psr7-implementation-check
Remove PSR-7/17 implementation check
2 parents b5efaec + 21313fc commit 72e9465

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [2.0.1] - 2019-08-13
8+
### Removed
9+
- PSR-7/17 alias check during the container compile process ([0847ea3](https://github.com/trikoder/oauth2-bundle/commit/0847ea3034cc433c9c8f92ec46fedbdace259e3d))
10+
711
## [2.0.0] - 2019-08-08
812
### Added
913
- Ability to specify a [Defuse](https://github.com/defuse/php-encryption/blob/master/docs/classes/Key.md) key as the encryption key ([d83fefe](https://github.com/trikoder/oauth2-bundle/commit/d83fefe149c1add841d4225ebc2a32aa9333308d))

DependencyInjection/TrikoderOAuth2Extension.php

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
use League\OAuth2\Server\Grant\RefreshTokenGrant;
1717
use League\OAuth2\Server\ResourceServer;
1818
use LogicException;
19-
use Psr\Http\Message\ResponseFactoryInterface;
20-
use Psr\Http\Message\ServerRequestFactoryInterface;
21-
use Psr\Http\Message\StreamFactoryInterface;
22-
use Psr\Http\Message\UploadedFileFactoryInterface;
2319
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
2420
use Symfony\Bundle\SecurityBundle\SecurityBundle;
2521
use Symfony\Component\Config\FileLocator;
@@ -99,7 +95,6 @@ public function prepend(ContainerBuilder $container)
9995
public function process(ContainerBuilder $container)
10096
{
10197
$this->assertRequiredBundlesAreEnabled($container);
102-
$this->assertPsrHttpAliasesExist($container);
10398
}
10499

105100
private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): void
@@ -122,36 +117,6 @@ private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): v
122117
}
123118
}
124119

125-
private function assertPsrHttpAliasesExist(ContainerBuilder $container): void
126-
{
127-
$requiredAliases = [
128-
ServerRequestFactoryInterface::class,
129-
StreamFactoryInterface::class,
130-
UploadedFileFactoryInterface::class,
131-
ResponseFactoryInterface::class,
132-
];
133-
134-
foreach ($requiredAliases as $requiredAlias) {
135-
$definition = $container
136-
->getDefinition(
137-
$container->getAlias($requiredAlias)
138-
)
139-
;
140-
141-
$aliasedClass = $definition->getClass();
142-
143-
if (!class_exists($aliasedClass)) {
144-
throw new LogicException(
145-
sprintf(
146-
'Alias \'%s\' points to a non-existing class \'%s\'. Did you configure a PSR-7/17 compatible library?',
147-
$requiredAlias,
148-
$aliasedClass
149-
)
150-
);
151-
}
152-
}
153-
}
154-
155120
private function configureAuthorizationServer(ContainerBuilder $container, array $config): void
156121
{
157122
$authorizationServer = $container

0 commit comments

Comments
 (0)