Skip to content

Commit

Permalink
SDK-2452 updated php-fixer lint errors to match standarts (#64)
Browse files Browse the repository at this point in the history
* SDK-2452 updated php-fixer lint errors to match standarts
* SDK-2452 updated yoti-sdk and php versions
  • Loading branch information
mehmet-yoti authored Apr 26, 2024
1 parent 296ed39 commit d493a4e
Show file tree
Hide file tree
Showing 32 changed files with 43 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ 7.4, 7.3, 7.2, 7.1 ]
php-version: [ 7.4, 8.0 ]

steps:
- uses: actions/checkout@v2
Expand Down
28 changes: 28 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('Protobuf')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
;

$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'ordered_imports' => [
'imports_order' => [
'const',
'class',
'function',
],
],
'php_unit_fqcn_annotation' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
])
->setFinder($finder)
;

return $config;
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ composer coverage-clover
We follow the [PSR-12 Style Guide](https://www.php-fig.org/psr/psr-12/), which
is configured in [.phpcs.xml.dist](.phpcs.xml.dist).

Additional checks are configured in [.php_cs.dist](.php_cs.dist) - See
Additional checks are configured in [.php-cs-fixer.dist](.php-cs-fixer.dist.php) - See
<https://cs.symfony.com/> for further information.

Coding style can be verified by running:
Expand Down
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "yoti/yoti-php-sdk-sandbox",
"description": "Yoti PHP SDK Sandbox",
"version": "1.6.0",
"version": "1.6.1",
"keywords": [
"yoti",
"sdk"
],
"homepage": "https://yoti.com",
"license": "MIT",
"require": {
"php": "^7.1 || ^8.0",
"yoti/yoti-php-sdk": "^3.1"
"php": "^7.4 || ^8.0 || ^8.1",
"yoti/yoti-php-sdk": "^4.2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
"squizlabs/php_codesniffer": "^3.4",
"friendsofphp/php-cs-fixer": "^2.15",
"brainmaestro/composer-git-hooks": "^2.8",
"phpstan/phpstan-strict-rules": "^0.12.1",
"phpstan/extension-installer": "^1.0",
"symfony/phpunit-bridge": "^5.1"
"symfony/phpunit-bridge": "^5.1",
"friendsofphp/php-cs-fixer": "^3.54"
},
"autoload": {
"psr-4": {
Expand All @@ -38,7 +38,7 @@
"coverage-html": "phpunit --coverage-html ./coverage/report",
"lint": [
"phpcs",
"php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no --diff-format=udiff --ansi",
"php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --dry-run --using-cache=no",
"phpstan analyse"
],
"post-install-cmd": "cghooks add --ignore-lock",
Expand All @@ -48,5 +48,10 @@
"hooks": {
"pre-commit": "composer test && composer lint"
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sonar.host.url = https://sonarcloud.io
sonar.organization = getyoti

sonar.projectKey = getyoti:php-sandbox
sonar.projectKey = getyoti_yoti-php-sdk-sandbox
sonar.projectName = PHP SDK Sandbox
sonar.projectVersion = 1.6.0
sonar.projectVersion = 1.6.1

sonar.language = php
sonar.sources=src
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/Report/SandboxBreakdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class SandboxBreakdown implements \JsonSerializable
{

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/Report/SandboxCheckReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxCheckReport implements \JsonSerializable
{

/**
* @var SandboxRecommendation
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/Report/SandboxDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxDetail implements \JsonSerializable
{

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/Report/SandboxRecommendation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SandboxRecommendation implements \JsonSerializable
{

/**
* @var string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxRecommendationBuilder
{

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/SandboxCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxCheck implements \JsonSerializable
{

/**
* @var SandboxCheckResult
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/SandboxCheckBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

abstract class SandboxCheckBuilder
{

/**
* @var SandboxRecommendation
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/Check/SandboxCheckResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SandboxCheckResult implements \JsonSerializable
{

/**
* @var SandboxCheckReport
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class SandboxDocumentAuthenticityCheck extends SandboxDocumentCheck
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxDocumentAuthenticityCheckBuilder extends SandboxDocumentCheckBuilder
{

/**
* @return SandboxDocumentAuthenticityCheck
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class SandboxDocumentFaceMatchCheck extends SandboxDocumentCheck
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxDocumentFaceMatchCheckBuilder extends SandboxDocumentCheckBuilder
{

/**
* @return SandboxDocumentFaceMatchCheck
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxDocumentTextDataCheckBuilder extends SandboxDocumentCheckBuilder
{

/**
* @var array<string, mixed>|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SandboxDocumentTextDataCheckResult extends SandboxCheckResult
{

/**
* @var array<string, mixed>|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SandboxSupplementaryDocumentTextDataCheckResult extends SandboxCheckResult
{

/**
* @var array<string, mixed>|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class SandboxThirdPartyIdentityCheck extends SandboxDocumentCheck
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxThirdPartyIdentityCheckBuilder extends SandboxDocumentCheckBuilder
{

/**
* @return SandboxThirdPartyIdentityCheck
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/SandboxResponseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SandboxResponseConfig implements \JsonSerializable
{

/**
* @var SandboxTaskResults|null
*/
Expand Down
1 change: 0 additions & 1 deletion src/DocScan/Request/SandboxResponseConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SandboxResponseConfigBuilder
{

/**
* @var SandboxTaskResults
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
class SandboxBreakdownTest extends TestCase
{

private const SOME_SUB_CHECK = 'someSubCheck';
private const SOME_RESULT = 'someResult';

Expand Down
1 change: 0 additions & 1 deletion tests/DocScan/Request/Check/Report/SandboxDetailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
class SandboxDetailTest extends TestCase
{

private const SOME_NAME = 'someName';
private const SOME_VALUE = 'someValue';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
class SandboxRecommendationTest extends TestCase
{

private const SOME_VALUE = 'someValue';
private const SOME_REASON = 'someReason';
private const SOME_RECOVERY_SUGGESTION = 'someRecoverySuggestion';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class SandboxDocumentAuthenticityCheckBuilderTest extends TestCase
{

/**
* @var MockObject|SandboxRecommendation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class SandboxDocumentFaceMatchCheckBuilderTest extends TestCase
{

/**
* @var MockObject|SandboxRecommendation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class SandboxIdDocumentComparisonCheckBuilderTest extends TestCase
{

/**
* @var MockObject|SandboxRecommendation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class SandboxZoomLivenessCheckBuilderTest extends TestCase
{

/**
* @var MockObject|SandboxRecommendation
*/
Expand Down
1 change: 0 additions & 1 deletion tests/DocScan/Request/SandboxTaskResultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class SandboxTaskResultsTest extends TestCase
{

/**
* @test
* @covers ::__construct
Expand Down

0 comments on commit d493a4e

Please sign in to comment.