Skip to content

Commit

Permalink
CS and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm authored and DavidGarciaCat committed Jan 12, 2019
1 parent 2ec2c16 commit 0f54332
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon
@@ -1,5 +1,3 @@
parameters:
level: 5

includes:
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
2 changes: 1 addition & 1 deletion src/Api/EmailValidation.php
Expand Up @@ -70,7 +70,7 @@ public function validate(string $address, bool $mailboxVerification = false)
* 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
Expand Down
17 changes: 2 additions & 15 deletions src/Model/EmailValidation/Parts.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* Copyright (C) 2013 Mailgun
*
Expand Down Expand Up @@ -29,17 +31,11 @@ final class Parts
*/
private $localPart;

/**
*
*/
private function __construct()
{
}


/**
* @param array $data
*
* @return Parts
*/
public static function create(array $data)
Expand All @@ -52,25 +48,16 @@ public static function create(array $data)
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;
Expand Down
1 change: 0 additions & 1 deletion src/Model/EmailValidation/ValidateResponse.php
Expand Up @@ -12,7 +12,6 @@
namespace Mailgun\Model\EmailValidation;

use Mailgun\Model\ApiResponse;
use Mailgun\Model\EmailValidation\EmailValidation;

/**
* @author David Garcia <me@davidgarcia.cat>
Expand Down
11 changes: 7 additions & 4 deletions tests/Model/EmailValidation/ParseResponseTest.php
Expand Up @@ -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
Expand All @@ -31,7 +37,6 @@ public function testCreate()

public function testParseConstructorWithValidData()
{

$data = [
'parsed' => ['parsed data'],
'unparseable' => ['unparseable data'],
Expand All @@ -45,7 +50,6 @@ public function testParseConstructorWithValidData()

public function testParseConstructorWithInvalidData()
{

$data = [
'parsed' => null,
'unparseable' => null,
Expand All @@ -56,5 +60,4 @@ public function testParseConstructorWithInvalidData()
$this->assertEquals([], $parts->getParsed());
$this->assertEquals([], $parts->getUnparseable());
}

}
3 changes: 2 additions & 1 deletion tests/Model/EmailValidation/PartsTest.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* Copyright (C) 2013 Mailgun
*
Expand All @@ -16,7 +18,6 @@ class PartsTest extends BaseModelTest
{
public function testPartsConstructor()
{

$data = [
'display_name' => ' Display name',
'domain' => 'Domain',
Expand Down
10 changes: 7 additions & 3 deletions tests/Model/EmailValidation/ValidateResponseTest.php
Expand Up @@ -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;
Expand Down Expand Up @@ -30,7 +37,6 @@ public function testCreate()
JSON;
$model = ValidateResponse::create(json_decode($json, true));
$this->assertTrue($model->isMailboxVerification());

}

public function testCreateWithoutMailboxVerification()
Expand All @@ -54,12 +60,10 @@ public function testCreateWithoutMailboxVerification()
JSON;
$model = ValidateResponse::create(json_decode($json, true));
$this->assertFalse($model->isMailboxVerification());

}

public function testEmailValidation()
{

$data = [
'address' => 'foo@mailgun.net',
'did_you_mean' => null,
Expand Down

0 comments on commit 0f54332

Please sign in to comment.