Skip to content

Commit

Permalink
Merge pull request #199 from ciungulete/master
Browse files Browse the repository at this point in the history
  • Loading branch information
sandervanhooft authored Aug 31, 2022
2 parents 605d1f6 + f25f6b7 commit a0e10d8
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 81 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/php-cs-fixer.yml → .github/workflows/pint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ name: Check & fix styling
on: [push]

jobs:
php-cs-fixer:
pint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
- name: Setup PHP
uses: shivammathur/setup-php@v2

- name: Install Pint
run: composer global require laravel/pint

- name: Run Pint
run: pint

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
37 changes: 0 additions & 37 deletions .php-cs-fixer.dist.php

This file was deleted.

7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@
"php": "^7.3|^8.0",
"illuminate/support": "^8.0|^9.0",
"mollie/mollie-api-php": "^2.40",
"ext-json": "*"
"ext-json": "*",
"symfony/finder": "^5.0|6.0"
},
"require-dev": {
"graham-campbell/testbench": "^5.0",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^9.0",
"laravel/socialite": "^5.0",
"friendsofphp/php-cs-fixer": "^3.0"
"laravel/pint": "^1.1"
},
"suggest": {
"laravel/socialite": "Use Mollie Connect (OAuth) to authenticate via Laravel Socialite with the Mollie API. This is needed for some endpoints."
Expand Down Expand Up @@ -81,7 +82,7 @@
},
"scripts": {
"test": "./vendor/bin/phpunit tests",
"format": "./vendor/bin/php-cs-fixer fix --allow-risky=yes"
"format": "./vendor/bin/pint"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
1 change: 1 addition & 0 deletions config/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
*
* @link https://www.mollie.com
*/
return [
Expand Down
2 changes: 2 additions & 0 deletions src/Facades/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
*
* @link https://www.mollie.com
*/

namespace Mollie\Laravel\Facades;

use Illuminate\Support\Facades\Facade;
Expand Down
23 changes: 9 additions & 14 deletions src/MollieConnectProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
*
* @link https://www.mollie.com
*/

namespace Mollie\Laravel;

use Illuminate\Support\Arr;
Expand Down Expand Up @@ -72,8 +74,7 @@ class MollieConnectProvider extends AbstractProvider implements ProviderInterfac
/**
* Get the authentication URL for the provider.
*
* @param string $state
*
* @param string $state
* @return string
*/
protected function getAuthUrl($state)
Expand All @@ -94,8 +95,7 @@ protected function getTokenUrl()
/**
* Get the access token for the given code.
*
* @param string $code
*
* @param string $code
* @return string
*/
public function getAccessToken($code)
Expand All @@ -111,8 +111,7 @@ public function getAccessToken($code)
/**
* Get the access token with a refresh token.
*
* @param string $refresh_token
*
* @param string $refresh_token
* @return array
*/
public function getRefreshTokenResponse($refresh_token)
Expand All @@ -128,8 +127,7 @@ public function getRefreshTokenResponse($refresh_token)
/**
* Get the refresh tokenfields with a refresh token.
*
* @param string $refresh_token
*
* @param string $refresh_token
* @return array
*/
protected function getRefreshTokenFields($refresh_token)
Expand All @@ -145,8 +143,7 @@ protected function getRefreshTokenFields($refresh_token)
/**
* Get the POST fields for the token request.
*
* @param string $code
*
* @param string $code
* @return array
*/
public function getTokenFields($code)
Expand All @@ -157,8 +154,7 @@ public function getTokenFields($code)
/**
* Get the raw user for the given access token.
*
* @param string $token
*
* @param string $token
* @return array
*/
protected function getUserByToken($token)
Expand All @@ -173,8 +169,7 @@ protected function getUserByToken($token)
/**
* Map the raw user array to a Socialite User instance.
*
* @param array $user
*
* @param array $user
* @return \Laravel\Socialite\AbstractUser
*/
protected function mapUserToObject(array $user)
Expand Down
5 changes: 3 additions & 2 deletions src/MollieManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
*
* @link https://www.mollie.com
*/

namespace Mollie\Laravel;

use Illuminate\Contracts\Container\Container;
Expand All @@ -46,8 +48,7 @@ class MollieManager
/**
* MollieManager constructor.
*
* @param Container $app
*
* @param Container $app
* @return void
*/
public function __construct(Container $app)
Expand Down
6 changes: 4 additions & 2 deletions src/MollieServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
*
* @link https://www.mollie.com
*/

namespace Mollie\Laravel;

use Illuminate\Contracts\Container\Container;
Expand Down Expand Up @@ -63,7 +65,7 @@ public function boot()
*/
protected function setupConfig()
{
$source = realpath(__DIR__ . '/../config/mollie.php');
$source = realpath(__DIR__.'/../config/mollie.php');

// Check if the application is a Laravel OR Lumen instance to properly merge the configuration file.
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
Expand Down Expand Up @@ -129,7 +131,7 @@ protected function registerApiAdapter()
protected function registerApiClient()
{
$this->app->singleton('mollie.api.client', function () {
return (new MollieApiClient())->addVersionString('MollieLaravel/' . self::PACKAGE_VERSION);
return (new MollieApiClient())->addVersionString('MollieLaravel/'.self::PACKAGE_VERSION);
});

$this->app->alias('mollie.api.client', MollieApiClient::class);
Expand Down
20 changes: 13 additions & 7 deletions src/Wrappers/MollieApiWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
*
* @link https://www.mollie.com
*/

namespace Mollie\Laravel\Wrappers;

use Illuminate\Contracts\Config\Repository;
Expand All @@ -53,11 +55,11 @@ class MollieApiWrapper
/**
* MollieApiWrapper constructor.
*
* @param Repository $config
* @param MollieApiClient $client
* @param Repository $config
* @param MollieApiClient $client
* @return void
*
* @throws \Mollie\Api\Exceptions\ApiException
* @return void
*/
public function __construct(Repository $config, MollieApiClient $client)
{
Expand All @@ -68,7 +70,7 @@ public function __construct(Repository $config, MollieApiClient $client)
}

/**
* @param string $url
* @param string $url
*/
public function setApiEndpoint($url)
{
Expand All @@ -84,7 +86,8 @@ public function getApiEndpoint()
}

/**
* @param string $api_key The Mollie API key, starting with 'test_' or 'live_'
* @param string $api_key The Mollie API key, starting with 'test_' or 'live_'
*
* @throws ApiException
*/
public function setApiKey($api_key)
Expand All @@ -93,7 +96,8 @@ public function setApiKey($api_key)
}

/**
* @param string $access_token OAuth access token, starting with 'access_'
* @param string $access_token OAuth access token, starting with 'access_'
*
* @throws ApiException
*/
public function setAccessToken($access_token)
Expand Down Expand Up @@ -290,6 +294,7 @@ public function organizationPartners()

/**
* @return void
*
* @throws \Mollie\Api\Exceptions\HttpAdapterDoesNotSupportDebuggingException
*/
public function enableDebugging()
Expand All @@ -299,6 +304,7 @@ public function enableDebugging()

/**
* @return void
*
* @throws \Mollie\Api\Exceptions\HttpAdapterDoesNotSupportDebuggingException
*/
public function disableDebugging()
Expand All @@ -309,7 +315,7 @@ public function disableDebugging()
/**
* Handle dynamic property calls.
*
* @param string $property
* @param string $property
* @return mixed
*/
public function __get($property)
Expand Down
3 changes: 1 addition & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ protected function getServiceProviderClass()
/**
* Get package providers.
*
* @param \Illuminate\Foundation\Application $app
*
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageProviders($app)
Expand Down
16 changes: 8 additions & 8 deletions tests/Wrappers/MollieApiWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

/**
* Class MollieApiWrapper
*
* @package Mollie\Laravel\Tests\Wrappers
*/
class MollieApiWrapperTest extends TestCase
{
Expand Down Expand Up @@ -178,10 +176,11 @@ public function testUnknownWrappedPropertyEndpoint()
* Asserts that the referenced wrapper method matches the client attribute
* I.e. $wrapper->payments() returns the same as $client->payments.
*
* @param MollieApiClient $client
* @param MollieApiWrapper $wrapper
* @param string $reference
* @param MollieApiClient $client
* @param MollieApiWrapper $wrapper
* @param string $reference
* @return null
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
Expand All @@ -194,10 +193,11 @@ protected function assertWrappedEndpoint($client, $wrapper, $reference)
* Asserts that the referenced wrapper property matches the client attribute
* I.e. $wrapper->payments returns the same as $client->payments.
*
* @param MollieApiClient $client
* @param MollieApiWrapper $wrapper
* @param string $reference
* @param MollieApiClient $client
* @param MollieApiWrapper $wrapper
* @param string $reference
* @return null
*
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
Expand Down

0 comments on commit a0e10d8

Please sign in to comment.