Skip to content

Commit

Permalink
Merge pull request #96 from trikoder/remove-psr7-implementation-check
Browse files Browse the repository at this point in the history
Remove PSR-7/17 implementation check
  • Loading branch information
X-Coder264 authored Aug 13, 2019
2 parents b5efaec + 21313fc commit 72e9465
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.0.1] - 2019-08-13
### Removed
- PSR-7/17 alias check during the container compile process ([0847ea3](https://github.com/trikoder/oauth2-bundle/commit/0847ea3034cc433c9c8f92ec46fedbdace259e3d))

## [2.0.0] - 2019-08-08
### Added
- 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))
Expand Down
35 changes: 0 additions & 35 deletions DependencyInjection/TrikoderOAuth2Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
use League\OAuth2\Server\Grant\RefreshTokenGrant;
use League\OAuth2\Server\ResourceServer;
use LogicException;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Component\Config\FileLocator;
Expand Down Expand Up @@ -99,7 +95,6 @@ public function prepend(ContainerBuilder $container)
public function process(ContainerBuilder $container)
{
$this->assertRequiredBundlesAreEnabled($container);
$this->assertPsrHttpAliasesExist($container);
}

private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): void
Expand All @@ -122,36 +117,6 @@ private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): v
}
}

private function assertPsrHttpAliasesExist(ContainerBuilder $container): void
{
$requiredAliases = [
ServerRequestFactoryInterface::class,
StreamFactoryInterface::class,
UploadedFileFactoryInterface::class,
ResponseFactoryInterface::class,
];

foreach ($requiredAliases as $requiredAlias) {
$definition = $container
->getDefinition(
$container->getAlias($requiredAlias)
)
;

$aliasedClass = $definition->getClass();

if (!class_exists($aliasedClass)) {
throw new LogicException(
sprintf(
'Alias \'%s\' points to a non-existing class \'%s\'. Did you configure a PSR-7/17 compatible library?',
$requiredAlias,
$aliasedClass
)
);
}
}
}

private function configureAuthorizationServer(ContainerBuilder $container, array $config): void
{
$authorizationServer = $container
Expand Down

0 comments on commit 72e9465

Please sign in to comment.