Skip to content

Commit 1119c41

Browse files
GinoPaneAndrey Semikov
andauthored
Bump code style to PSR12 (#2)
* Bump code style to PSR12 * Add missing PSR12 reference * Fix bcmul usage * Remove docker certificates promotion * Fix round usage * Add more spaces * Fix test float mapping --------- Co-authored-by: Andrey Semikov <[email protected]>
1 parent 9354caf commit 1119c41

File tree

113 files changed

+259
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+259
-27
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
uses: php-actions/phpcs@v1
2828
with:
2929
php_version: 8.1
30-
path: src/
31-
standard: PSR2
30+
standard: phpcs.xml
3231

3332
tests:
3433
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ docker-compose run dynamodb-odm vendor/bin/behat -c behat.yml --stop-on-failure
5252

5353
You need to check if the code style is OK by running:
5454
```bash
55-
docker-compose run --no-deps dynamodb-odm vendor/bin/phpcs --basepath=/application/src --standard=PSR2 src
55+
docker-compose run --no-deps dynamodb-odm vendor/bin/phpcs --standard=/application/phpcs.xml
5656
```

phpcs.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0"?>
2+
<!-- @see https://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
3+
<ruleset name= "PHPCS Rules">
4+
<description>PHPCS ruleset for the DynamoDB ODM</description>
5+
6+
<file>src</file>
7+
8+
<!-- Show progress of the run -->
9+
<arg value= "p"/>
10+
11+
<!-- Show sniff codes in all reports -->
12+
<arg value= "s"/>
13+
14+
<!-- Ignore warnings -->
15+
<arg value= "n"/>
16+
17+
<!-- Our base rule: set to PSR12 -->
18+
<rule ref="PSR12" />
19+
20+
<rule ref= "Generic.Files.LineLength">
21+
<properties>
22+
<property name="lineLimit" value="80"/>
23+
<property name="absoluteLineLimit" value="120"/>
24+
</properties>
25+
</rule>
26+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
27+
<exclude-pattern>spec/</exclude-pattern>
28+
<exclude-pattern>features/</exclude-pattern>
29+
</rule>
30+
31+
<!-- All files MUST declare strict types. -->
32+
<rule ref="Generic.PHP.RequireStrictTypes"/>
33+
34+
<rule ref="Generic.Files.LineEndings">
35+
<exclude name="Generic.Files.LineEndings.InvalidEOLChar"/>
36+
</rule>
37+
</ruleset>

spec/Repository/fixtures/NewModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final class NewModel extends Model
4747
/**
4848
* @var float
4949
*
50-
* @Types\NumberType
50+
* @Types\FloatType
5151
*/
5252
protected float $percent;
5353

src/Annotation/AnnotationManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Autoprotect\DynamodbODM\Annotation;
46

57
use Autoprotect\DynamodbODM\Annotation\Exception\NoPropertyFoundException;

src/Annotation/AnnotationManagerInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Autoprotect\DynamodbODM\Annotation;
46

57
use Autoprotect\DynamodbODM\Annotation\Property\PropertyInterface;

src/Annotation/Exception/AnnotationLogicException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
class AnnotationLogicException extends DynamoDbAdapterException
1010
{
11-
1211
}

src/Annotation/Exception/DuplicatePrivatePropertyException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Autoprotect\DynamodbODM\Annotation\Exception;
46

57
use Autoprotect\DynamodbODM\Exception\DynamoDbAdapterException;

src/Annotation/Exception/EncryptionTypeNotSupportedException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
class EncryptionTypeNotSupportedException extends DynamoDbAdapterException
1010
{
11-
1211
}

src/Annotation/Exception/NoEncryptionOptionsDefinedForProperty.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
declare(strict_types=1);
44

5-
65
namespace Autoprotect\DynamodbODM\Annotation\Exception;
76

87
use Autoprotect\DynamodbODM\Exception\DynamoDbAdapterException;

0 commit comments

Comments
 (0)