CS and fixes

This commit is contained in:
Nyholm 2019-01-12 10:09:22 +01:00 committed by David Garcia
parent 2ec2c16227
commit 0f54332d0e
8 changed files with 20 additions and 28 deletions

View File

@ -30,7 +30,7 @@ matrix:
script: ./vendor/bin/roave-backward-compatibility-check || true
- name: PHPStan
php: 7.2
env: DEPENDENCIES="phpstan/phpstan phpstan/phpstan-webmozart-assert"
env: DEPENDENCIES="phpstan/phpstan"
script: ./vendor/bin/phpstan analyse src
before_install:

View File

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

View File

@ -70,7 +70,7 @@ class EmailValidation extends HttpApi
* This operation is only accessible with the private API key and not subject to the daily usage limits.
*
* @param string $addresses A delimiter separated list of addresses. Maximum: 8000 characters.
* @param bool| $syntaxOnly Perform only syntax checks or DNS and ESP specific validation as well.
* @param bool $syntaxOnly Perform only syntax checks or DNS and ESP specific validation as well.
* The default is True.
*
* @throws InvalidArgumentException Thrown when local validation returns an error

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
@ -29,17 +31,11 @@ final class Parts
*/
private $localPart;
/**
*
*/
private function __construct()
{
}
/**
* @param array $data
*
* @return Parts
*/
public static function create(array $data)
@ -52,25 +48,16 @@ final class Parts
return $model;
}
/**
* @return null|string
*/
public function getDisplayName(): ?string
{
return $this->displayName;
}
/**
* @return null|string
*/
public function getDomain(): ?string
{
return $this->domain;
}
/**
* @return null|string
*/
public function getLocalPart(): ?string
{
return $this->localPart;

View File

@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Mailgun\Model\EmailValidation;
use Mailgun\Model\ApiResponse;
use Mailgun\Model\EmailValidation\EmailValidation;
/**
* @author David Garcia <me@davidgarcia.cat>

View File

@ -2,10 +2,16 @@
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Mailgun\Tests\Model\EmailValidation;
use Mailgun\Model\EmailValidation\ParseResponse;
use Mailgun\Model\EmailValidation\ValidateResponse;
use Mailgun\Tests\Model\BaseModelTest;
class ParseResponseTest extends BaseModelTest
@ -31,7 +37,6 @@ JSON;
public function testParseConstructorWithValidData()
{
$data = [
'parsed' => ['parsed data'],
'unparseable' => ['unparseable data'],
@ -45,7 +50,6 @@ JSON;
public function testParseConstructorWithInvalidData()
{
$data = [
'parsed' => null,
'unparseable' => null,
@ -56,5 +60,4 @@ JSON;
$this->assertEquals([], $parts->getParsed());
$this->assertEquals([], $parts->getUnparseable());
}
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
@ -16,7 +18,6 @@ class PartsTest extends BaseModelTest
{
public function testPartsConstructor()
{
$data = [
'display_name' => ' Display name',
'domain' => 'Domain',

View File

@ -2,6 +2,13 @@
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Mailgun\Tests\Model\EmailValidation;
use Mailgun\Model\EmailValidation\Parts;
@ -30,7 +37,6 @@ class ValidateResponseTest extends BaseModelTest
JSON;
$model = ValidateResponse::create(json_decode($json, true));
$this->assertTrue($model->isMailboxVerification());
}
public function testCreateWithoutMailboxVerification()
@ -54,12 +60,10 @@ JSON;
JSON;
$model = ValidateResponse::create(json_decode($json, true));
$this->assertFalse($model->isMailboxVerification());
}
public function testEmailValidation()
{
$data = [
'address' => 'foo@mailgun.net',
'did_you_mean' => null,