Added PHPStan test (#537)

* Added PHPStan test

This will fix #536

* Somce code style updates
This commit is contained in:
Tobias Nyholm 2019-01-10 20:29:58 +01:00 committed by GitHub
parent 3b3e977995
commit a1ca1a3b2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 20 deletions

View File

@ -28,6 +28,10 @@ matrix:
php: 7.3 php: 7.3
env: DEPENDENCIES="roave/backward-compatibility-check" env: DEPENDENCIES="roave/backward-compatibility-check"
script: ./vendor/bin/roave-backward-compatibility-check || true script: ./vendor/bin/roave-backward-compatibility-check || true
- name: PHPStan
php: 7.2
env: DEPENDENCIES="phpstan/phpstan phpstan/phpstan-webmozart-assert"
script: ./vendor/bin/phpstan analyse src
before_install: before_install:
- if [[ "$PREFER_COVERAGE" = true ]] && [[ "$TRAVIS_PULL_REQUEST" = false ]]; then TEST_COMMAND="composer test-coverage" COVERAGE=true; fi - if [[ "$PREFER_COVERAGE" = true ]] && [[ "$TRAVIS_PULL_REQUEST" = false ]]; then TEST_COMMAND="composer test-coverage" COVERAGE=true; fi

5
phpstan.neon Normal file
View File

@ -0,0 +1,5 @@
parameters:
level: 5
includes:
- vendor/phpstan/phpstan-webmozart-assert/extension.neon

View File

@ -34,7 +34,7 @@ abstract class HttpApi
protected $httpClient; protected $httpClient;
/** /**
* @var null|Hydrator * @var Hydrator|null
*/ */
protected $hydrator; protected $hydrator;

View File

@ -25,7 +25,7 @@ use Psr\Http\Message\ResponseInterface;
final class Mailgun final class Mailgun
{ {
/** /**
* @var null|string * @var string|null
*/ */
private $apiKey; private $apiKey;

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* Copyright (C) 2013 Mailgun * Copyright (C) 2013 Mailgun
* *
@ -26,16 +28,10 @@ final class CountryResponse implements ApiResponse
*/ */
private $tag; private $tag;
/**
* @param string $message
*/
private function __construct() private function __construct()
{ {
} }
/**
* @param array $data
*/
public static function create(array $data): self public static function create(array $data): self
{ {
$model = new self(); $model = new self();

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* Copyright (C) 2013 Mailgun * Copyright (C) 2013 Mailgun
* *
@ -26,16 +28,10 @@ final class DeviceResponse implements ApiResponse
*/ */
private $tag; private $tag;
/**
* @param string $message
*/
private function __construct() private function __construct()
{ {
} }
/**
* @param array $data
*/
public static function create(array $data): self public static function create(array $data): self
{ {
$model = new self(); $model = new self();

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* Copyright (C) 2013 Mailgun * Copyright (C) 2013 Mailgun
* *
@ -26,16 +28,10 @@ final class ProviderResponse implements ApiResponse
*/ */
private $tag; private $tag;
/**
* @param string $message
*/
private function __construct() private function __construct()
{ {
} }
/**
* @param array $data
*/
public static function create(array $data): self public static function create(array $data): self
{ {
$model = new self(); $model = new self();