Skip to content

Commit

Permalink
phpstan add deprecated and disallow calls rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Votava authored and ondraondra81 committed Feb 7, 2021
1 parent 420beac commit fe3574b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
10 changes: 6 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# GPWebPay Core library
[![Build Status](https://travis-ci.org/Pixidos/gpwebpay-core.svg?branch=master)](https://travis-ci.org/Pixidos/gpwebpay-core)
[![Donwloads](https://poser.pugx.org/pixidos/gpwebpay-core/downloads)](https://packagist.org/packages/pixidos/gpwebpay-core)
[![Latest stable](https://img.shields.io/packagist/v/pixidos/gpwebpay-core.svg)](https://packagist.org/packages/pixidos/gpwebpay-core)
![](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)
[![Code Analyse Actions Status](https://github.com/Pixidos/gpwebpay-core/workflows/Code%20Analyse/badge.svg?branch=master)](https://github.com/Pixidos/gpwebpay-core/actions)
[![UnitTests Actions Status](https://github.com/Pixidos/gpwebpay-core/workflows/Unit%20Tests/badge.svg?branch=master)](https://github.com/Pixidos/gpwebpay-core/actions)
[![Code coverage](https://codecov.io/gh/Pixidos/gpwebpay-core/branch/master/graph/badge.svg)](https://codecov.io/gh/Pixidos/gpwebpay-core)
[![Documentation Status](https://readthedocs.org/projects/gpwebpay-core/badge/?version=latest)](https://gpwebpay-core.readthedocs.io/en/latest/?badge=latest)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Pixidos/gpwebpay-core/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Pixidos/gpwebpay-core/?branch=master)
[![Documentation Status](https://readthedocs.org/projects/gpwebpay-core/badge/?version=latest)](https://gpwebpay-core.readthedocs.io/en/latest/?badge=latest)

[![Donwloads](https://poser.pugx.org/pixidos/gpwebpay-core/downloads)](https://packagist.org/packages/pixidos/gpwebpay-core)
[![Latest stable](https://img.shields.io/packagist/v/pixidos/gpwebpay-core.svg)](https://packagist.org/packages/pixidos/gpwebpay-core)
![](https://img.shields.io/badge/php-7.2%20to%208.0-777bb3.svg?logo=php&logoColor=white&labelColor=555555%22)

GPWebPay Core is library for [GPWebPay service](http://www.gpwebpay.cz/ ) HTTP API

Expand Down
2 changes: 1 addition & 1 deletion src/Factory/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private function getStringValue(string $name, array &$params, string $defaultVal
unset($params[$name]);
}

return (string)$value;
return $value;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Param/OrderNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($value)
}

/**
* @return mixed
* @return int|float|string
*/
public function getValue()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/ResponseProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testOnError(): void

$called = false;
$provider->addOnError(
static function (GPWebPayException $exception, ResponseInterface $response) use (&$called) {
static function (GPWebPayException $exception, ResponseInterface $response) use (&$called): void {
$called = true;
}
);
Expand All @@ -93,7 +93,7 @@ public function testOnSuccess(): void

$called = false;
$provider->addOnSuccess(
static function (ResponseInterface $response) use (&$called) {
static function (ResponseInterface $response) use (&$called): void {
$called = true;
}
);
Expand Down
4 changes: 1 addition & 3 deletions tests/Signer/Key/AbstractKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ public function testNotExistFileThrowException(): void

new class ('misssing_file') extends AbstractKey {

/**
* @return resource|void
*/
protected function createKey()
{
//@phpstan-ignore-next-line
return;
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/Signer/Key/PublicKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testReadFileThrowException(): void

$publicKey = $this->getMockBuilder(PublicKey::class)
->setConstructorArgs([$file])
->setMethods(['getContent'])
->onlyMethods(['getContent'])
->getMock();
$publicKey->expects(self::once())->method('getContent')->willReturn('');

Expand Down

0 comments on commit fe3574b

Please sign in to comment.