Skip to content

Commit

Permalink
Merge pull request #26 from basz/update-tooling
Browse files Browse the repository at this point in the history
Update tooling
  • Loading branch information
basz authored Aug 30, 2022
2 parents 205309b + f522e57 commit f017c3f
Show file tree
Hide file tree
Showing 37 changed files with 219 additions and 335 deletions.
16 changes: 10 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.idea
vendor
build
composer.lock
.php_cs.cache
.phpunit.result.cache
/.phpcs-cache
/.phpunit.result.cache
/clover.xml
/composer.lock
/coveralls-upload.json
/docs/html/
/laminas-mkdoc-theme.tgz
/laminas-mkdoc-theme/
/phpunit.xml
/vendor/
111 changes: 0 additions & 111 deletions .php_cs

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Doctrine 2 adapter for [ZfrOAuth2Server](http://github.com/zf-fr/zfr-oauth2-server)

[![Build Status](https://travis-ci.org/zf-fr/zfr-oauth2-server-doctrine.png)](https://travis-ci.org/zf-fr/zfr-oauth2-server-doctrine)
[![Continuous Integration](https://github.com/zf-fr/zfr-oauth2-server-doctrine/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/zf-fr/zfr-oauth2-server-doctrine/actions/workflows/continuous-integration.yml)
[![Latest Stable Version](https://poser.pugx.org/zfr/zfr-oauth2-server-doctrine/v/stable.png)](https://packagist.org/packages/zfr/zfr-oauth2-server-doctrine)
[![Coverage Status](https://coveralls.io/repos/github/zf-fr/zfr-oauth2-server-doctrine/badge.svg?branch=master)](https://coveralls.io/github/zf-fr/zfr-oauth2-server-doctrine?branch=master)
[![Total Downloads](https://poser.pugx.org/zfr/zfr-oauth2-server-doctrine/downloads.png)](https://packagist.org/packages/zfr/zfr-oauth2-server-doctrine)
Expand All @@ -11,15 +11,15 @@ Doctrine 2 adapter for [ZfrOAuth2Server](http://github.com/zf-fr/zfr-oauth2-serv

## Requirements

- PHP 7.2 or higher
- doctrine/orm ~2.5
- PHP 7.4 or higher
- doctrine/orm ^2.8

## Installation

Installation is only officially supported using Composer:

```sh
php composer.phar require zfr/zfr-oauth2-server-doctrine:^0.2
php composer.phar require zfr/zfr-oauth2-server-doctrine:^0.3
```

## Support
Expand Down
28 changes: 22 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require": {
"php": "^7.3",
"php": "^7.4 || ^8.0",
"zfr/zfr-oauth2-server": "^0.10",
"doctrine/orm": "^2.7",
"psr/container": "^1.0",
"doctrine/orm": "^2.8",
"psr/container": "^1.0 || ^2.0",
"roave/security-advisories": "dev-master"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.1",
"phpunit/phpunit": "^8.5",
"satooshi/php-coveralls": "~1.0"
"laminas/laminas-coding-standard": "^2.4",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
Expand All @@ -41,12 +47,22 @@
},
"autoload-dev": {
"psr-4": {
"ZfrOAuth2Test\\Server\\Doctrine\\": "tests/src/"
"ZfrOAuth2Test\\Server\\Doctrine\\": "test/src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
}
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
}
}
21 changes: 21 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">

<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>

<!-- Show progress -->
<arg value="p"/>

<!-- Paths to check -->
<file>src</file>
<file>test</file>

<!-- Include all rules from Laminas Coding Standard -->
<rule ref="LaminasCodingStandard"/>
</ruleset>
47 changes: 29 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
<?xml version="1.0"?>
<phpunit
bootstrap="./tests/Bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
stopOnFailure="false"
processIsolation="false"
backupGlobals="false">
<testsuite name="ZfrOAuth2ServerDoctrine tests">
<directory>./tests</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="./test/Bootstrap.php" colors="true">
<testsuites>
<testsuite name="zfr-oauth2-server-doctrine">
<directory>./test/</directory>
</testsuite>
</testsuites>

<groups>
<exclude>
<group>disable</group>
</exclude>
</groups>

<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</include>
</coverage>

<php>
<ini name="date.timezone" value="UTC"/>

<!-- OB_ENABLED should be enabled for some tests to check if all
functionality works as expected. Such tests include those for
Laminas\Soap and Laminas\Session, which require that headers not be sent
in order to work. -->
<env name="TESTS_LAMINAS_OB_ENABLED" value="false" />

</php>
</phpunit>
4 changes: 1 addition & 3 deletions src/Container/AccessTokenRepositoryFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

declare(strict_types=1);

/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -27,9 +28,6 @@
use ZfrOAuth2\Server\Doctrine\Repository;
use ZfrOAuth2\Server\Model\AccessToken;

/**
* Class AccessTokenRepositoryFactory
*/
class AccessTokenRepositoryFactory
{
public function __invoke(ContainerInterface $container): Repository\AccessTokenRepository
Expand Down
4 changes: 1 addition & 3 deletions src/Container/AuthorizationCodeRepositoryFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

declare(strict_types=1);

/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -27,9 +28,6 @@
use ZfrOAuth2\Server\Doctrine\Repository;
use ZfrOAuth2\Server\Model\AuthorizationCode;

/**
* Class AuthorizationCodeRepositoryFactory
*/
class AuthorizationCodeRepositoryFactory
{
public function __invoke(ContainerInterface $container): Repository\AuthorizationCodeRepository
Expand Down
4 changes: 1 addition & 3 deletions src/Container/ClientRepositoryFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

declare(strict_types=1);

/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -27,9 +28,6 @@
use ZfrOAuth2\Server\Doctrine\Repository;
use ZfrOAuth2\Server\Model\Client;

/**
* Class ClientRepositoryFactory
*/
class ClientRepositoryFactory
{
public function __invoke(ContainerInterface $container): Repository\ClientRepository
Expand Down
6 changes: 1 addition & 5 deletions src/Container/DoctrineOptionsFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

declare(strict_types=1);

/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -24,15 +25,10 @@
use ZfrOAuth2\Server\Doctrine\Options\DoctrineOptions;

/**
* @author Michaël Gallego <[email protected]>
* @licence MIT
*/
class DoctrineOptionsFactory
{
/**
* @param ContainerInterface $container
* @return DoctrineOptions
*/
public function __invoke(ContainerInterface $container): DoctrineOptions
{
$config = $container->get('config');
Expand Down
4 changes: 1 addition & 3 deletions src/Container/RefreshTokenRepositoryFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

declare(strict_types=1);

/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -27,9 +28,6 @@
use ZfrOAuth2\Server\Doctrine\Repository;
use ZfrOAuth2\Server\Model\RefreshToken;

/**
* Class RefreshTokenRepositoryFactory
*/
class RefreshTokenRepositoryFactory
{
public function __invoke(ContainerInterface $container): Repository\RefreshTokenRepository
Expand Down
4 changes: 1 addition & 3 deletions src/Container/ScopeRepositoryFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

declare(strict_types=1);

/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -27,9 +28,6 @@
use ZfrOAuth2\Server\Doctrine\Repository;
use ZfrOAuth2\Server\Model\Scope;

/**
* Class ScopeRepositoryFactory
*/
class ScopeRepositoryFactory
{
public function __invoke(ContainerInterface $container): Repository\ScopeRepository
Expand Down
Loading

0 comments on commit f017c3f

Please sign in to comment.