Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix/no-db
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Nov 28, 2023
2 parents 9b81fc7 + d6a3173 commit 5a564dd
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 72 deletions.
6 changes: 4 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/tests export-ignore
/dev export-ignore
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.travis.yml export-ignore
/.php-cs-fixer.dist export-ignore
/docker-compose.yml export-ignore
/phpunit.xml.dist export-ignore
/.psalm.baseline.xml export-ignore
/psalm.xml export-ignore
9 changes: 7 additions & 2 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: "coding standards"

on: ["pull_request", "push"]
on:
pull_request: ~
push: ~
schedule:
# Do not make it the first of the month and/or midnight since it is a very busy time
- cron: "* 10 5 * *"

jobs:
coding-standards:
name: "coding standards"
runs-on: "ubuntu-latest"
steps:
- name: "checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "build the environment"
run: "dev/bin/docker-compose build"
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: "static analysis"

on: ["pull_request", "push"]
on:
pull_request: ~
push: ~
schedule:
# Do not make it the first of the month and/or midnight since it is a very busy time
- cron: "* 10 5 * *"

jobs:
static-analysis:
name: "static analysis"
runs-on: "ubuntu-latest"
steps:
- name: "checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "build the environment"
run: "dev/bin/docker-compose build"
Expand Down
32 changes: 11 additions & 21 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: "unit tests"

on: [ "pull_request", "push" ]
on:
pull_request: ~
push: ~
schedule:
# Do not make it the first of the month and/or midnight since it is a very busy time
- cron: "* 10 5 * *"

jobs:
tests:
Expand All @@ -10,32 +15,21 @@ jobs:
fail-fast: false
matrix:
#Stable supported versions
php: ['7.4', '8.0', '8.1', '8.2']
php: ['8.1', '8.2']
symfony: ['5.4.*', '6.2.*']
composer-flags: ['--prefer-stable']
can-fail: [false]
exclude:
- php: '7.4'
symfony: '6.2.*'
- php: '8.0'
- php: '8.1'
symfony: '6.2.*'
include:
# Lowest supported versions
- php: '7.2'
- php: '8.1'
symfony: '5.4.*'
composer-flags: '--prefer-stable --prefer-lowest'
can-fail: false
# EOL PHP versions
- php: '7.2'
symfony: '5.4.*'
composer-flags: '--prefer-stable'
can-fail: false
- php: '7.3'
symfony: '5.4.*'
composer-flags: '--prefer-stable'
can-fail: false
# Development versions
- php: '8.2'
- php: '8.3'
symfony: '6.3.x-dev'
composer-flags: ''
can-fail: true
Expand All @@ -47,11 +41,7 @@ jobs:

steps:
- name: "checkout"
uses: "actions/checkout@v2"

- name: "build the PHP7 environment"
run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} php"
if: startsWith(matrix.php, '7')
uses: "actions/checkout@v4"

- name: "build the PHP8 environment"
run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} --build-arg XDEBUG_VERSION='3.2.0' php"
Expand Down
8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
}
],
"require": {
"php": ">=7.2",
"php": "^8.1",
"doctrine/doctrine-bundle": "^2.0.8",
"doctrine/orm": "^2.7.1",
"league/oauth2-server": "^8.3",
"nyholm/psr7": "^1.4",
"psr/http-factory": "^1.0",
"symfony/event-dispatcher": "^5.4|^6.2",
"symfony/framework-bundle": "^5.4|^6.2",
"symfony/polyfill-php81": "^1.22",
"symfony/psr-http-message-bridge": "^2.0",
"symfony/security-bundle": "^5.4|^6.2"
},
Expand All @@ -41,10 +40,7 @@
"psr-4": { "League\\Bundle\\OAuth2ServerBundle\\Tests\\": "tests/" }
},
"config": {
"sort-packages": true,
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
"sort-packages": true
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PHP_VERSION=7.4
ARG PHP_VERSION=8.1

FROM php:${PHP_VERSION}-cli-alpine
LABEL maintainer="Petar Obradović <[email protected]>"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace League\Bundle\OAuth2ServerBundle\EventListener;

use League\Bundle\OAuth2ServerBundle\Event\AuthorizationRequestResolveEvent;
Expand Down
13 changes: 11 additions & 2 deletions src/LeagueOAuth2ServerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

namespace League\Bundle\OAuth2ServerBundle;

use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\CompilerPass\EncryptionKeyPass;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\CompilerPass\RegisterDoctrineOrmMappingPass;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\LeagueOAuth2ServerExtension;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\Security\OAuth2Factory;
use League\Bundle\OAuth2ServerBundle\Persistence\Mapping\Driver;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class LeagueOAuth2ServerBundle extends Bundle
Expand Down Expand Up @@ -56,7 +58,14 @@ private function configureSecurityExtension(ContainerBuilder $container): void

private function configureDoctrineExtension(ContainerBuilder $container): void
{
$container->addCompilerPass(new RegisterDoctrineOrmMappingPass());
$container->addCompilerPass(
new DoctrineOrmMappingsPass(
new Reference(Driver::class),
['League\Bundle\OAuth2ServerBundle\Model'],
['league.oauth2_server.persistence.doctrine.manager'],
'league.oauth2_server.persistence.doctrine.enabled'
)
);
$container->addCompilerPass(new EncryptionKeyPass());
}
}
4 changes: 1 addition & 3 deletions src/Model/AccessTokenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

namespace League\Bundle\OAuth2ServerBundle\Model;

use DateTimeInterface;

interface AccessTokenInterface
{
public function __toString(): string;

public function getIdentifier(): string;

public function getExpiry(): DateTimeInterface;
public function getExpiry(): \DateTimeInterface;

public function getUserIdentifier(): ?string;

Expand Down
4 changes: 1 addition & 3 deletions src/Model/AuthorizationCodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

namespace League\Bundle\OAuth2ServerBundle\Model;

use DateTimeInterface;

interface AuthorizationCodeInterface
{
public function __toString(): string;

public function getIdentifier(): string;

public function getExpiryDateTime(): DateTimeInterface;
public function getExpiryDateTime(): \DateTimeInterface;

public function getUserIdentifier(): ?string;

Expand Down
4 changes: 2 additions & 2 deletions src/Model/RefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RefreshToken implements RefreshTokenInterface
private $expiry;

/**
* @var AccessToken|null
* @var AccessTokenInterface|null
*/
private $accessToken;

Expand All @@ -29,7 +29,7 @@ class RefreshToken implements RefreshTokenInterface
/**
* @psalm-mutation-free
*/
public function __construct(string $identifier, \DateTimeInterface $expiry, ?AccessToken $accessToken = null)
public function __construct(string $identifier, \DateTimeInterface $expiry, ?AccessTokenInterface $accessToken = null)
{
$this->identifier = $identifier;
$this->expiry = $expiry;
Expand Down
4 changes: 1 addition & 3 deletions src/Model/RefreshTokenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

namespace League\Bundle\OAuth2ServerBundle\Model;

use DateTimeInterface;

interface RefreshTokenInterface
{
public function __toString(): string;

public function getIdentifier(): string;

public function getExpiry(): DateTimeInterface;
public function getExpiry(): \DateTimeInterface;

public function getAccessToken(): ?AccessTokenInterface;

Expand Down

0 comments on commit 5a564dd

Please sign in to comment.