Skip to content

Commit

Permalink
Merge pull request #12 from answear/support-symfony6
Browse files Browse the repository at this point in the history
Support Symfony6
  • Loading branch information
lukasz-falda authored Aug 18, 2022
2 parents 8913fb3 + 7733721 commit 38fda42
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 56 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
deps:
- "normal"
include:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

steps:
- name: "Checkout"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/vendor/
\.php_cs\.cache
*.cache
.phpunit.result.cache
composer.lock
/.idea
22 changes: 18 additions & 4 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<?php

$finder = PhpCsFixer\Finder::create()
declare(strict_types=1);

$config = new PhpCsFixer\Config();

$finder = $config->getFinder()
->exclude(
[
'vendor',
]
)
->in(__DIR__);

return PhpCsFixer\Config::create()
return $config
->registerCustomFixers([])
->setRules(
[
'@Symfony' => true,
Expand All @@ -21,6 +26,15 @@
'phpdoc_var_without_name' => false,
'phpdoc_to_comment' => false,
'single_line_throw' => false,
'modernize_types_casting' => true,
'function_declaration' => false,
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha',
],
]
)
->setFinder($finder);
);
93 changes: 48 additions & 45 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
{
"name": "answear/wide-eyes-bundle",
"description": "API Client for WideEyes.",
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": ">=7.4",
"ext-json": "*",
"webmozart/assert": "^1.3",
"guzzlehttp/guzzle": "^6.0",
"symfony/http-kernel": "^4.4|^5.0"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"phpunit/phpunit": "^8.4",
"symfony/phpunit-bridge": "^5.0",
"phpro/grumphp": "^0.20",
"friendsofphp/php-cs-fixer": "^2.16",
"phpstan/phpstan": "^0.12.32",
"phpstan/phpstan-webmozart-assert": "^0.12.2"
},
"autoload": {
"psr-4": {
"Answear\\WideEyesBundle\\": "src/"
"name": "answear/wide-eyes-bundle",
"description": "API Client for WideEyes.",
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": ">=7.4|^8.0",
"ext-json": "*",
"webmozart/assert": "^1.3",
"guzzlehttp/guzzle": "^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"phpunit/phpunit": "^9.5",
"symfony/phpunit-bridge": "6.1.*",
"phpro/grumphp": "^1.5.0",
"friendsofphp/php-cs-fixer": "^3.4",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-webmozart-assert": "^1.0"
},
"autoload": {
"psr-4": {
"Answear\\WideEyesBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Answear\\WideEyesBundle\\Tests\\": "tests/"
}
},
"scripts": {
"post-install-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
],
"post-update-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
]
},
"extra": {
"grumphp": {
"config-default-path": "grumphp.yaml"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"phpro/grumphp": true
}
}
},
"autoload-dev": {
"psr-4": {
"Answear\\WideEyesBundle\\Tests\\": "tests/"
}
},
"scripts": {
"post-install-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
],
"post-update-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
]
},
"extra": {
"grumphp": {
"config-default-path": "grumphp.yaml"
}
},
"config": {
"sort-packages": true
}
}
2 changes: 1 addition & 1 deletion grumphp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ grumphp:
phpcsfixer:
allow_risky: true
cache_file: ~
config: './.php_cs'
config: './.php-cs-fixer.php'
using_cache: true
verbose: true
phpstan:
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Response/DetectAndFeaturesResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function malformedResponseWithNotCompleteDetections(): void
];

$this->expectException(MalformedResponse::class);
$this->expectExceptionMessage('Undefined index: y1');
$this->expectErrorMessageMatches('#^Undefined#');
DetectAndFeaturesResponse::fromArray($responseData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function responseWithWrongPropertiesInDetections(): void
$this->guzzleHandler->append(new Response(200, [], $this->prepareNotProperResponse()));

$this->expectException(MalformedResponse::class);
$this->expectExceptionMessage('Undefined index: featureId');
$this->expectErrorMessageMatches('#^Undefined#');

$this->client->detectAndFeatures(self::IMAGE_PATH);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ValueObject/BoundingBoxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function throwsErrorWhenCreatingFromArrayNotFindProperties(): void
];

$this->expectError();
$this->expectErrorMessageMatches('#^Undefined index#');
$this->expectErrorMessageMatches('#^Undefined#');

BoundingBox::fromArray($bbox);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ValueObject/DetectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function throwsErrorWhenCreatingFromArrayNotFindProperties(): void
];

$this->expectError();
$this->expectErrorMessageMatches('#^Undefined index#');
$this->expectErrorMessageMatches('#^Undefined#');

Detection::fromArray($detection);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ValueObject/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function throwsErrorWhenCreatingFromArrayNotFindProperties(): void
];

$this->expectError();
$this->expectErrorMessageMatches('#^Undefined index#');
$this->expectErrorMessageMatches('#^Undefined#');

Point::fromArray($point);
}
Expand Down

0 comments on commit 38fda42

Please sign in to comment.