Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Updated dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Jul 11, 2017
1 parent 14657e6 commit 5fe34d2
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
>
<arg value="analyse"/>
<arg value="-l"/>
<arg value="5"/>
<arg value="7"/>
<arg value="-c"/>
<arg path="${path.phpstan.configuration}"/>
<arg path="${path.src}"/>
Expand Down
2 changes: 1 addition & 1 deletion build/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ parameters:
- %rootDir%/../../../tests/SlevomatEET/Cryptography/OpenSslFunctionsMock.php
ignoreErrors:
- '#does not accept PHPUnit_Framework_MockObject_MockObject#'
- '#Cannot access property SlevomatEET\\Client::\$soapClient from current scope#'
- '#Access to private property \$soapClient of class SlevomatEET\\Client#'
- '#PHPUnit_Framework_MockObject_MockObject(?:\|(?:[\\a-zA-Z0-9_]+))* given#'
21 changes: 21 additions & 0 deletions build/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
<exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/>
</rule>
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml">
<exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility"/><!-- PHP >= 7.1 only -->
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
<exclude name="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/><!-- PHP >= 7.1 only -->
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
Expand All @@ -28,6 +30,25 @@
<property name="namespacesRequiredToUse" type="array" value="SlevomatEET" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" value="0"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<properties>
<property name="enableNullableTypeHints" value="false"/>
<property name="enableVoidTypeHint" value="false"/>
<property name="usefulAnnotations" type="array" value="
@dataProvider,
@runInSeparateProcess,
"/>
</properties>
<exclude-pattern>tests/SlevomatEET/Cryptography/OpenSslFunctionsMock.php</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification">
<exclude-pattern>tests/</exclude-pattern><!-- it's useless to add "@return mixed[]" to all data providers -->
</rule>
<rule ref="Squiz.Commenting.FunctionComment">
<exclude-pattern>tests/</exclude-pattern><!-- @dataProvider etc. annotations trigger comments check -->
</rule>
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
"ramsey/uuid": "^3.5"
},
"require-dev": {
"consistence/coding-standard": "^0.12.0",
"slevomat/coding-standard": "^1.1",
"phing/phing": "^2.15",
"phpunit/phpunit": "^6.0.6",
"phpstan/phpstan": "^0.6.3",
"consistence/coding-standard": "^2.0.0",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"slevomat/coding-standard": "^3.0",
"phing/phing": "^2.16",
"phpunit/phpunit": "^6.2.0",
"phpstan/phpstan": "^0.7.0",
"guzzlehttp/guzzle": "^6.2",
"composer/ca-bundle": "^1.0"
},
Expand Down
4 changes: 4 additions & 0 deletions src/Cryptography/CryptographyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public function __construct(string $privateKeyFile, string $publicKeyFile, strin
$this->privateKeyPassword = $privateKeyPassword;
}

/**
* @param mixed[] $body
* @return string
*/
public function getPkpCode(array $body): string
{
$values = [
Expand Down
6 changes: 6 additions & 0 deletions src/Cryptography/SigningFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ class SigningFailedException extends \Exception
*/
private $data;

/**
* @param mixed[] $data
*/
public function __construct(array $data)
{
parent::__construct('Signing failed');

$this->data = $data;
}

/**
* @return mixed[]
*/
public function getData(): array
{
return $this->data;
Expand Down
9 changes: 9 additions & 0 deletions src/EvidenceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public function __construct(Receipt $receipt, Configuration $configuration, Cryp
$this->bkpCode = $cryptographyService->getBkpCode($this->pkpCode);
}

/**
* @return mixed[]
*/
public function getRequestData(): array
{
return [
Expand All @@ -89,11 +92,17 @@ public function getSendDate(): \DateTimeImmutable
return $this->sendDate;
}

/**
* @return mixed[]
*/
public function getHeader(): array
{
return $this->header;
}

/**
* @return mixed[]
*/
public function getBody(): array
{
return $this->body;
Expand Down
2 changes: 1 addition & 1 deletion src/EvidenceResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(\stdClass $rawData, EvidenceRequest $evidenceRequest

public function getFik(): string
{
if (!$this->isValid()) {
if ($this->fik === null) {
throw new InvalidResponseWithoutFikException($this);
}

Expand Down
3 changes: 2 additions & 1 deletion src/SoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(string $wsdl, CryptographyService $cryptoService, So
}

/**
* @param array $parameters
* @param mixed[] $parameters
* @return mixed
*/
public function OdeslaniTrzby(array $parameters)
Expand All @@ -38,6 +38,7 @@ public function OdeslaniTrzby(array $parameters)
}

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @param string $request
* @param string $location
* @param string $action
Expand Down
5 changes: 4 additions & 1 deletion tests/SlevomatEET/FormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public function testFormatDateTime(\DateTimeImmutable $value, string $expected)
$this->assertSame($expected, Formatter::formatDateTime($value));
}

public function dataTestFormatDateTime()
/**
* @return mixed[][]
*/
public function dataTestFormatDateTime(): array
{
return [
[new \DateTimeImmutable('2016-03-11 11:05:00', new \DateTimeZone('Europe/Prague')), '2016-03-11T11:05:00+01:00'],
Expand Down

0 comments on commit 5fe34d2

Please sign in to comment.