Skip to content

Commit 5a564dd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix/no-db
2 parents 9b81fc7 + d6a3173 commit 5a564dd

13 files changed

+50
-72
lines changed

.gitattributes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/tests export-ignore
22
/dev export-ignore
3+
/.github export-ignore
34
/.editorconfig export-ignore
45
/.gitattributes export-ignore
56
/.gitignore export-ignore
6-
/.php_cs.dist export-ignore
7-
/.travis.yml export-ignore
7+
/.php-cs-fixer.dist export-ignore
88
/docker-compose.yml export-ignore
99
/phpunit.xml.dist export-ignore
10+
/.psalm.baseline.xml export-ignore
11+
/psalm.xml export-ignore

.github/workflows/coding-standards.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: "coding standards"
22

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

510
jobs:
611
coding-standards:
712
name: "coding standards"
813
runs-on: "ubuntu-latest"
914
steps:
1015
- name: "checkout"
11-
uses: "actions/checkout@v2"
16+
uses: "actions/checkout@v4"
1217

1318
- name: "build the environment"
1419
run: "dev/bin/docker-compose build"

.github/workflows/static-analysis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: "static analysis"
22

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

510
jobs:
611
static-analysis:
712
name: "static analysis"
813
runs-on: "ubuntu-latest"
914
steps:
1015
- name: "checkout"
11-
uses: "actions/checkout@v2"
16+
uses: "actions/checkout@v4"
1217

1318
- name: "build the environment"
1419
run: "dev/bin/docker-compose build"

.github/workflows/unit-tests.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: "unit tests"
22

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

510
jobs:
611
tests:
@@ -10,32 +15,21 @@ jobs:
1015
fail-fast: false
1116
matrix:
1217
#Stable supported versions
13-
php: ['7.4', '8.0', '8.1', '8.2']
18+
php: ['8.1', '8.2']
1419
symfony: ['5.4.*', '6.2.*']
1520
composer-flags: ['--prefer-stable']
1621
can-fail: [false]
1722
exclude:
18-
- php: '7.4'
19-
symfony: '6.2.*'
20-
- php: '8.0'
23+
- php: '8.1'
2124
symfony: '6.2.*'
2225
include:
2326
# Lowest supported versions
24-
- php: '7.2'
27+
- php: '8.1'
2528
symfony: '5.4.*'
2629
composer-flags: '--prefer-stable --prefer-lowest'
2730
can-fail: false
28-
# EOL PHP versions
29-
- php: '7.2'
30-
symfony: '5.4.*'
31-
composer-flags: '--prefer-stable'
32-
can-fail: false
33-
- php: '7.3'
34-
symfony: '5.4.*'
35-
composer-flags: '--prefer-stable'
36-
can-fail: false
3731
# Development versions
38-
- php: '8.2'
32+
- php: '8.3'
3933
symfony: '6.3.x-dev'
4034
composer-flags: ''
4135
can-fail: true
@@ -47,11 +41,7 @@ jobs:
4741

4842
steps:
4943
- name: "checkout"
50-
uses: "actions/checkout@v2"
51-
52-
- name: "build the PHP7 environment"
53-
run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} php"
54-
if: startsWith(matrix.php, '7')
44+
uses: "actions/checkout@v4"
5545

5646
- name: "build the PHP8 environment"
5747
run: "dev/bin/docker-compose build --build-arg PHP_VERSION=${{ matrix.php }} --build-arg XDEBUG_VERSION='3.2.0' php"

composer.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=7.2",
19+
"php": "^8.1",
2020
"doctrine/doctrine-bundle": "^2.0.8",
2121
"doctrine/orm": "^2.7.1",
2222
"league/oauth2-server": "^8.3",
2323
"nyholm/psr7": "^1.4",
2424
"psr/http-factory": "^1.0",
2525
"symfony/event-dispatcher": "^5.4|^6.2",
2626
"symfony/framework-bundle": "^5.4|^6.2",
27-
"symfony/polyfill-php81": "^1.22",
2827
"symfony/psr-http-message-bridge": "^2.0",
2928
"symfony/security-bundle": "^5.4|^6.2"
3029
},
@@ -41,10 +40,7 @@
4140
"psr-4": { "League\\Bundle\\OAuth2ServerBundle\\Tests\\": "tests/" }
4241
},
4342
"config": {
44-
"sort-packages": true,
45-
"allow-plugins": {
46-
"bamarni/composer-bin-plugin": true
47-
}
43+
"sort-packages": true
4844
},
4945
"extra": {
5046
"branch-alias": {

dev/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PHP_VERSION=7.4
1+
ARG PHP_VERSION=8.1
22

33
FROM php:${PHP_VERSION}-cli-alpine
44
LABEL maintainer="Petar Obradović <petar.obradovic@trikoder.net>"

src/DependencyInjection/CompilerPass/RegisterDoctrineOrmMappingPass.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/EventListener/AuthorizationRequestUserResolvingListenerTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace League\Bundle\OAuth2ServerBundle\EventListener;
46

57
use League\Bundle\OAuth2ServerBundle\Event\AuthorizationRequestResolveEvent;

src/LeagueOAuth2ServerBundle.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
namespace League\Bundle\OAuth2ServerBundle;
66

7+
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
78
use League\Bundle\OAuth2ServerBundle\DependencyInjection\CompilerPass\EncryptionKeyPass;
8-
use League\Bundle\OAuth2ServerBundle\DependencyInjection\CompilerPass\RegisterDoctrineOrmMappingPass;
99
use League\Bundle\OAuth2ServerBundle\DependencyInjection\LeagueOAuth2ServerExtension;
1010
use League\Bundle\OAuth2ServerBundle\DependencyInjection\Security\OAuth2Factory;
11+
use League\Bundle\OAuth2ServerBundle\Persistence\Mapping\Driver;
1112
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
1213
use Symfony\Component\DependencyInjection\ContainerBuilder;
1314
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
15+
use Symfony\Component\DependencyInjection\Reference;
1416
use Symfony\Component\HttpKernel\Bundle\Bundle;
1517

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

5759
private function configureDoctrineExtension(ContainerBuilder $container): void
5860
{
59-
$container->addCompilerPass(new RegisterDoctrineOrmMappingPass());
61+
$container->addCompilerPass(
62+
new DoctrineOrmMappingsPass(
63+
new Reference(Driver::class),
64+
['League\Bundle\OAuth2ServerBundle\Model'],
65+
['league.oauth2_server.persistence.doctrine.manager'],
66+
'league.oauth2_server.persistence.doctrine.enabled'
67+
)
68+
);
6069
$container->addCompilerPass(new EncryptionKeyPass());
6170
}
6271
}

src/Model/AccessTokenInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
namespace League\Bundle\OAuth2ServerBundle\Model;
66

7-
use DateTimeInterface;
8-
97
interface AccessTokenInterface
108
{
119
public function __toString(): string;
1210

1311
public function getIdentifier(): string;
1412

15-
public function getExpiry(): DateTimeInterface;
13+
public function getExpiry(): \DateTimeInterface;
1614

1715
public function getUserIdentifier(): ?string;
1816

src/Model/AuthorizationCodeInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
namespace League\Bundle\OAuth2ServerBundle\Model;
66

7-
use DateTimeInterface;
8-
97
interface AuthorizationCodeInterface
108
{
119
public function __toString(): string;
1210

1311
public function getIdentifier(): string;
1412

15-
public function getExpiryDateTime(): DateTimeInterface;
13+
public function getExpiryDateTime(): \DateTimeInterface;
1614

1715
public function getUserIdentifier(): ?string;
1816

src/Model/RefreshToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class RefreshToken implements RefreshTokenInterface
1717
private $expiry;
1818

1919
/**
20-
* @var AccessToken|null
20+
* @var AccessTokenInterface|null
2121
*/
2222
private $accessToken;
2323

@@ -29,7 +29,7 @@ class RefreshToken implements RefreshTokenInterface
2929
/**
3030
* @psalm-mutation-free
3131
*/
32-
public function __construct(string $identifier, \DateTimeInterface $expiry, ?AccessToken $accessToken = null)
32+
public function __construct(string $identifier, \DateTimeInterface $expiry, ?AccessTokenInterface $accessToken = null)
3333
{
3434
$this->identifier = $identifier;
3535
$this->expiry = $expiry;

src/Model/RefreshTokenInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
namespace League\Bundle\OAuth2ServerBundle\Model;
66

7-
use DateTimeInterface;
8-
97
interface RefreshTokenInterface
108
{
119
public function __toString(): string;
1210

1311
public function getIdentifier(): string;
1412

15-
public function getExpiry(): DateTimeInterface;
13+
public function getExpiry(): \DateTimeInterface;
1614

1715
public function getAccessToken(): ?AccessTokenInterface;
1816

0 commit comments

Comments
 (0)