Skip to content

Commit

Permalink
Merge pull request #212 from EJTJ3/develop
Browse files Browse the repository at this point in the history
Enhancement: Add support for PHP 8.0  and updated minimal php version to 7.3
  • Loading branch information
bunq-bot authored Oct 12, 2021
2 parents 26a8f23 + 01de34f commit 071183f
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 68 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ tmp/

# PhpCs
.php_cs*

# PHPUnit
.phpunit.result.cache
19 changes: 9 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
}
],
"require": {
"php": "^7.0.13",
"php": "^7.3 || ^8.0",
"composer-plugin-api": "~1.0 || ~2.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "~6"
"guzzlehttp/guzzle": "~7"
},
"autoload": {
"psr-4": {
Expand All @@ -37,22 +38,20 @@
}
},
"require-dev": {
"brianium/paratest": "^1.1",
"composer/composer": "^1.10.11 || ^2.0.1",
"friendsofphp/php-cs-fixer": "^2.4",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phpro/grumphp": "^0.11.6",
"phpstan/phpstan": "^0.8",
"phpunit/phpunit": "^6.0.13",
"sebastian/phpcpd": "^3.0",
"sensiolabs/security-checker": "^5.0"
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpro/grumphp": "^v1.3.0",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^9.5"
},
"bin": [
"bin/bunq-install"
],
"config": {
"sort-packages": true,
"platform": {
"php": "7.0.13"
"php": "7.3"
}
},
"scripts": {
Expand Down
57 changes: 22 additions & 35 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
parameters:
bin_dir: "./vendor/bin"
git_dir: "."
hide_circumvention_tip: false
grumphp:
hooks_dir: ~
hooks_preset: local
git_hook_variables:
VAGRANT_HOST_DIR: .
VAGRANT_PROJECT_DIR: /var/www
EXEC_GRUMPHP_COMMAND: exec
stop_on_failure: false
ignore_unstaged_changes: false
process_async_limit: 10
process_async_wait: 1000
hide_circumvention_tip: false
process_timeout: 300
stop_on_failure: true
parallel:
enabled: false
fixer:
enabled: true
fix_by_default: false
extensions: [ ]
ascii:
failed: ~
succeeded: ~
tasks:
composer:
file: ./composer.json
no_check_all: false
no_check_lock: false
no_check_publish: false
with_dependencies: false
strict: true
composer: ~
git_blacklist:
keywords:
- "die("
- "dump("
- "exit;"
- "print_r("
- "print_rr("
- "var_dump("
triggered_by: ['php']
phpcpd:
directory: '.'
exclude: ['vendor', 'src/Model/Generated']
names_exclude: []
fuzzy: false
min_lines: 5
min_tokens: 70
triggered_by: ['php']
- "exit;"
phpcsfixer2:
allow_risky: false
cache_file: ~
config: ~
rules: []
using_cache: true
path_mode: ~
config: .php_cs
rules: [ ]
using_cache: ~
config_contains_finder: false
verbose: true
diff: false
triggered_by: [ 'php' ]
phplint:
exclude: ['vendor']
jobs: ~
Expand All @@ -55,13 +48,7 @@ parameters:
group: []
always_execute: false
phpversion:
project: '5.6'
securitychecker:
lockfile: ./composer.lock
format: ~
end_point: ~
timeout: ~
run_always: true
project: '7.3'
xmllint:
ignore_patterns: []
load_from_net: false
Expand Down
17 changes: 7 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<phpunit
bootstrap="./vendor/autoload.php"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
cacheTokens="false">
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="ParaTest Fixtures">
<directory>./tests/</directory>
Expand All @@ -11,9 +13,4 @@
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
4 changes: 2 additions & 2 deletions tests/BunqSdkTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class BunqSdkTestBase extends TestCase

/**
*/
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
static::createApiContext();
BunqContext::loadApiContext(
Expand All @@ -111,7 +111,7 @@ protected static function createApiContext()

/**
*/
protected function setUp()
protected function setUp(): void
{
$this->setSecondMonetaryAccountBank();
$this->requestSpendingMoney();
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/PaginationScenarioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testApiScenarioPaymentListingWithPagination()

$paymentsActual = array_merge($responsePreviousNext->getValue(), $responsePrevious->getValue());

$this->assertEquals($paymentsExpected, $paymentsActual);
static::assertEquals($paymentsExpected, $paymentsActual);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/Http/PaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ public function testGetUrlParamsNextPageFutureNoCount()
}

/**
* @expectedException \bunq\Exception\BunqException
*/
public function testGetUrlParamsPreviousPageFromPaginationWithNoPreviousPage()
{
$this->expectException('\bunq\Exception\BunqException');

$pagination = $this->createPaginationWithAllPropertiesSet();
$pagination->setOlderId(null);

Expand All @@ -143,10 +144,11 @@ public function testGetUrlParamsPreviousPageFromPaginationWithNoPreviousPage()
}

/**
* @expectedException \bunq\Exception\BunqException
*/
public function testGetUrlParamsNextPageFromPaginationWithNoNextPage()
{
$this->expectException('\bunq\Exception\BunqException');

$pagination = $this->createPaginationWithAllPropertiesSet();
$pagination->setNewerId(null);
$pagination->setFutureId(null);
Expand Down
6 changes: 3 additions & 3 deletions tests/Model/Core/NotificationFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public function testNotificationFilterClear()
static::assertEmpty($allCreatedNotificationFilterUrlUser);
static::assertEmpty($allCreatedNotificationFilterUrlMonetaryAccount);

static::assertEquals(0, count(NotificationFilterPushUserInternal::listing()->getValue()));
static::assertEquals(0, count(NotificationFilterUrlUserInternal::listing()->getValue()));
static::assertEquals(0, count(NotificationFilterUrlMonetaryAccountInternal::listing()->getValue()));
static::assertCount(0, NotificationFilterPushUserInternal::listing()->getValue());
static::assertCount(0, NotificationFilterUrlUserInternal::listing()->getValue());
static::assertCount(0, NotificationFilterUrlMonetaryAccountInternal::listing()->getValue());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Model/Generated/Endpoint/CardDebitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CardDebitTest extends BunqSdkTestBase

/**
*/
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
$cardNamesAllowed = CardName::listing()->getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DraftShareInviteBankQrCodeContentTest extends BunqSdkTestBase

/**
*/
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
static::$expirationDate = date(self::FORMAT_MICROTIME, strtotime(self::EXPIRATION_ADDED_TIME));
Expand Down
2 changes: 1 addition & 1 deletion tests/Model/Generated/Endpoint/MonetaryAccountBankTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MonetaryAccountBankTest extends BunqSdkTestBase
/**
* Deletes the new created monetary account.
*/
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
if (!is_null(static::$monetaryAccountBankToCloseId)) {
MonetaryAccountBank::update(
Expand Down
2 changes: 1 addition & 1 deletion tests/Model/Generated/Endpoint/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SessionTest extends BunqSdkTestBase
/**
* Resets the session context after this test has ran.
*/
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
sleep(self::SECONDS_TO_SLEEP);
BunqContext::getApiContext()->resetSession();
Expand Down
2 changes: 1 addition & 1 deletion tests/Model/Generated/Object/NotificationUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private function getNotificationUrlFromJson(string $jsonString): NotificationUrl
/**
* @param string[] $json
*
* @return string
* @return string|false
*/
private function getNotificationObjectJsonString(array $json)
{
Expand Down

0 comments on commit 071183f

Please sign in to comment.