mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-29 08:26:06 +03:00
build: fix style and phpstan
This commit is contained in:
parent
5975310f0e
commit
3fc2f8e227
1
.php_cs
1
.php_cs
@ -21,6 +21,7 @@ return PhpCsFixer\Config::create()
|
||||
'declare_strict_types' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
'no_superfluous_phpdoc_tags' => true,
|
||||
'no_unneeded_final_method' => false, # prevent phpstan divergence
|
||||
'header_comment' => [
|
||||
'commentType' => 'comment',
|
||||
'header' => $header,
|
||||
|
@ -35,7 +35,6 @@ class Domain extends HttpApi
|
||||
/**
|
||||
* Returns a list of domains on the account.
|
||||
*
|
||||
*
|
||||
* @return IndexResponse
|
||||
*/
|
||||
public function index(int $limit = 100, int $skip = 0)
|
||||
|
@ -11,12 +11,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mailgun\Api;
|
||||
|
||||
use Mailgun\Exception\UnknownErrorException;
|
||||
use Mailgun\Hydrator\Hydrator;
|
||||
use Mailgun\Hydrator\NoopHydrator;
|
||||
use Mailgun\Exception\HttpClientException;
|
||||
use Mailgun\Exception\HttpServerException;
|
||||
use Mailgun\Exception\UnknownErrorException;
|
||||
use Mailgun\HttpClient\RequestBuilder;
|
||||
use Mailgun\Hydrator\Hydrator;
|
||||
use Mailgun\Hydrator\NoopHydrator;
|
||||
use Psr\Http\Client as Psr18;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -27,7 +27,6 @@ class Ip extends HttpApi
|
||||
/**
|
||||
* Returns a list of IPs.
|
||||
*
|
||||
*
|
||||
* @return IndexResponse|ResponseInterface
|
||||
*/
|
||||
public function index(bool $dedicated = false)
|
||||
@ -46,7 +45,6 @@ class Ip extends HttpApi
|
||||
/**
|
||||
* Returns a list of IPs assigned to a domain.
|
||||
*
|
||||
*
|
||||
* @return IndexResponse|ResponseInterface
|
||||
*/
|
||||
public function domainIndex(string $domain)
|
||||
@ -61,7 +59,6 @@ class Ip extends HttpApi
|
||||
/**
|
||||
* Returns a single ip.
|
||||
*
|
||||
*
|
||||
* @return ShowResponse|ResponseInterface
|
||||
*/
|
||||
public function show(string $ip)
|
||||
@ -76,7 +73,6 @@ class Ip extends HttpApi
|
||||
/**
|
||||
* Assign a dedicated IP to the domain specified.
|
||||
*
|
||||
*
|
||||
* @return UpdateResponse|ResponseInterface
|
||||
*/
|
||||
public function assign(string $domain, string $ip)
|
||||
@ -95,8 +91,6 @@ class Ip extends HttpApi
|
||||
|
||||
/**
|
||||
* Unassign an IP from the domain specified.
|
||||
*
|
||||
|
||||
*
|
||||
* @return UpdateResponse|ResponseInterface
|
||||
*/
|
||||
|
@ -128,11 +128,7 @@ class Member extends HttpApi
|
||||
|
||||
// workaround for webmozart/asserts <= 1.2
|
||||
if (count($members) > 1000) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Expected an Array to contain at most %2$d elements. Got: %d',
|
||||
1000,
|
||||
count($members)
|
||||
));
|
||||
throw new InvalidArgumentException(sprintf('Expected an Array to contain at most %2$d elements. Got: %d', 1000, count($members)));
|
||||
}
|
||||
|
||||
foreach ($members as $data) {
|
||||
|
@ -71,7 +71,7 @@ class Message extends HttpApi
|
||||
*
|
||||
* @return SendResponse|ResponseInterface
|
||||
*/
|
||||
public function sendMime(string $domain, array $recipients, string $message, array $params)
|
||||
public function sendMime(string $domain, array $recipients, string $message, array $params)
|
||||
{
|
||||
Assert::string($domain);
|
||||
Assert::notEmpty($domain);
|
||||
|
@ -14,9 +14,9 @@ namespace Mailgun\Api;
|
||||
use Mailgun\Api\Suppression\Bounce;
|
||||
use Mailgun\Api\Suppression\Complaint;
|
||||
use Mailgun\Api\Suppression\Unsubscribe;
|
||||
use Mailgun\HttpClient\RequestBuilder;
|
||||
use Mailgun\Hydrator\Hydrator;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Mailgun\HttpClient\RequestBuilder;
|
||||
|
||||
/**
|
||||
* @see https://documentation.mailgun.com/api-suppressions.html
|
||||
|
@ -67,7 +67,6 @@ class Tag extends HttpApi
|
||||
/**
|
||||
* Update a tag.
|
||||
*
|
||||
*
|
||||
* @return UpdateResponse|ResponseInterface
|
||||
*/
|
||||
public function update(string $domain, string $tag, string $description)
|
||||
@ -87,7 +86,6 @@ class Tag extends HttpApi
|
||||
/**
|
||||
* Returns statistics for a single tag.
|
||||
*
|
||||
*
|
||||
* @return StatisticsResponse|ResponseInterface
|
||||
*/
|
||||
public function stats(string $domain, string $tag, array $params)
|
||||
@ -103,7 +101,6 @@ class Tag extends HttpApi
|
||||
/**
|
||||
* Removes a tag from the account.
|
||||
*
|
||||
*
|
||||
* @return DeleteResponse|ResponseInterface
|
||||
*/
|
||||
public function delete(string $domain, string $tag)
|
||||
|
@ -12,15 +12,15 @@ declare(strict_types=1);
|
||||
namespace Mailgun\Api;
|
||||
|
||||
use Mailgun\Assert;
|
||||
use Mailgun\HttpClient\RequestBuilder;
|
||||
use Mailgun\Hydrator\Hydrator;
|
||||
use Mailgun\Model\Webhook\CreateResponse;
|
||||
use Mailgun\Model\Webhook\DeleteResponse;
|
||||
use Mailgun\Model\Webhook\IndexResponse;
|
||||
use Mailgun\Model\Webhook\ShowResponse;
|
||||
use Mailgun\Model\Webhook\UpdateResponse;
|
||||
use Mailgun\HttpClient\RequestBuilder;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @see https://documentation.mailgun.com/en/latest/api-webhooks.html
|
||||
|
@ -15,10 +15,10 @@ use Http\Client\Common\PluginClient;
|
||||
use Mailgun\HttpClient\HttpClientConfigurator;
|
||||
use Mailgun\HttpClient\Plugin\History;
|
||||
use Mailgun\HttpClient\RequestBuilder;
|
||||
use Mailgun\Hydrator\ModelHydrator;
|
||||
use Mailgun\Hydrator\Hydrator;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Mailgun\Hydrator\ModelHydrator;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* This class is the base class for the Mailgun SDK.
|
||||
|
@ -54,7 +54,7 @@ abstract class AbstractDomainResponse implements ApiResponse
|
||||
return $model;
|
||||
}
|
||||
|
||||
private function __construct()
|
||||
final private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -11,9 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mailgun\Model\Event;
|
||||
|
||||
use Mailgun\Model\PagingProvider;
|
||||
use Mailgun\Model\PaginationResponse;
|
||||
use Mailgun\Model\ApiResponse;
|
||||
use Mailgun\Model\PaginationResponse;
|
||||
use Mailgun\Model\PagingProvider;
|
||||
|
||||
/**
|
||||
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
|
||||
|
@ -11,9 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mailgun\Model\MailingList\Member;
|
||||
|
||||
use Mailgun\Model\PagingProvider;
|
||||
use Mailgun\Model\PaginationResponse;
|
||||
use Mailgun\Model\ApiResponse;
|
||||
use Mailgun\Model\PaginationResponse;
|
||||
use Mailgun\Model\PagingProvider;
|
||||
|
||||
final class IndexResponse implements ApiResponse, PagingProvider
|
||||
{
|
||||
|
@ -11,9 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mailgun\Model\MailingList;
|
||||
|
||||
use Mailgun\Model\PagingProvider;
|
||||
use Mailgun\Model\PaginationResponse;
|
||||
use Mailgun\Model\ApiResponse;
|
||||
use Mailgun\Model\PaginationResponse;
|
||||
use Mailgun\Model\PagingProvider;
|
||||
|
||||
final class PagesResponse implements ApiResponse, PagingProvider
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ abstract class BaseResponse implements ApiResponse
|
||||
private $address;
|
||||
private $message;
|
||||
|
||||
private function __construct()
|
||||
final private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ abstract class BaseResponse implements ApiResponse
|
||||
private $webhook = [];
|
||||
private $message;
|
||||
|
||||
private function __construct()
|
||||
final private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ namespace Mailgun\Tests\Api;
|
||||
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Mailgun\Api\Tag;
|
||||
use Mailgun\Mailgun;
|
||||
|
||||
/**
|
||||
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
|
||||
|
@ -12,10 +12,10 @@ declare(strict_types=1);
|
||||
namespace Mailgun\Tests\Api;
|
||||
|
||||
use Mailgun\Api\Webhook;
|
||||
use Mailgun\Model\Webhook\IndexResponse;
|
||||
use Mailgun\Model\Webhook\ShowResponse;
|
||||
use Mailgun\Model\Webhook\CreateResponse;
|
||||
use Mailgun\Model\Webhook\DeleteResponse;
|
||||
use Mailgun\Model\Webhook\IndexResponse;
|
||||
use Mailgun\Model\Webhook\ShowResponse;
|
||||
use Mailgun\Model\Webhook\UpdateResponse;
|
||||
|
||||
class WebhookTest extends TestCase
|
||||
|
Loading…
Reference in New Issue
Block a user