Browse Source

Code formatting

main
Cédric Belin 5 months ago
parent
commit
51716d45a0
17 changed files with 28 additions and 28 deletions
  1. +2
    -2
      doc/advanced/events.md
  2. +3
    -3
      doc/advanced/testing.md
  3. +1
    -1
      doc/features/comment_check.md
  4. +1
    -1
      doc/features/key_verification.md
  5. +1
    -1
      doc/features/submit_ham.md
  6. +1
    -1
      doc/features/submit_spam.md
  7. +1
    -1
      example/main.php
  8. +2
    -2
      src/Author.php
  9. +2
    -2
      src/Blog.php
  10. +2
    -2
      src/Client.php
  11. +1
    -1
      src/ClientException.php
  12. +2
    -2
      src/Comment.php
  13. +2
    -2
      src/RequestEvent.php
  14. +2
    -2
      test/AuthorTest.php
  15. +2
    -2
      test/BlogTest.php
  16. +1
    -1
      test/ClientTest.php
  17. +2
    -2
      test/CommentTest.php

+ 2
- 2
doc/advanced/events.md View File

@@ -12,7 +12,7 @@ Emitted every time a request is made to the remote service:
``` php
<?php
use Akismet\{Blog, Client, RequestEvent};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
$client = new Client("123YourAPIKey", new Blog(new Uri("https://www.yourblog.com")));
@@ -28,7 +28,7 @@ Emitted every time a response is received from the remote service:
``` php
<?php
use Akismet\{Blog, Client, ResponseEvent};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
$client = new Client("123YourAPIKey", new Blog(new Uri("https://www.yourblog.com")));


+ 3
- 3
doc/advanced/testing.md View File

@@ -9,7 +9,7 @@ The Akismet API will always return a `CheckResult::isSpam` response to a valid r
``` php
<?php
use Akismet\{Author, Blog, Client, Comment};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
$author = (new Author("127.0.0.1", "Mozilla/5.0"))->setName("viagra-test-123");
@@ -31,7 +31,7 @@ The Akismet API will always return a `CheckResult::isHam` response. Any other re
``` php
<?php
use Akismet\{Author, Blog, Client, Comment};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
$author = (new Author("127.0.0.1", "Mozilla/5.0"))->setRole("administrator");
@@ -53,7 +53,7 @@ That will tell Akismet not to change its behaviour based on those API calls: the
``` php
<?php
use Akismet\{Author, Blog, Client, Comment};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
$author = new Author("127.0.0.1", "Mozilla/5.0");


+ 1
- 1
doc/features/comment_check.md View File

@@ -37,7 +37,7 @@ The exception `getMessage()` usually includes some debug information, provided b
``` php
<?php
use Akismet\{Author, Blog, CheckResult, Client, ClientException, Comment, CommentType};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
try {


+ 1
- 1
doc/features/key_verification.md View File

@@ -30,7 +30,7 @@ The exception `getMessage()` usually includes some debug information, provided b
``` php
<?php
use Akismet\{Blog, Client, ClientException};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
try {


+ 1
- 1
doc/features/submit_ham.md View File

@@ -30,7 +30,7 @@ The exception `getMessage()` usually includes some debug information, provided b
``` php
<?php
use Akismet\{Author, Blog, Client, ClientException, Comment};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
try {


+ 1
- 1
doc/features/submit_spam.md View File

@@ -32,7 +32,7 @@ The exception `getMessage()` usually includes some debug information, provided b
``` php
<?php
use Akismet\{Author, Blog, Client, ClientException, Comment};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

function main(): void {
try {


+ 1
- 1
example/main.php View File

@@ -1,7 +1,7 @@
<?php declare(strict_types=1);

use Akismet\{Author, Blog, CheckResult, Client, ClientException, Comment, CommentType};
use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;

/** Queries the Akismet service. */
function main(): void {


+ 2
- 2
src/Author.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use Psr\Http\Message\{UriInterface};
use Nyholm\Psr7\Uri;
use Psr\Http\Message\UriInterface;

/** Represents the author of a comment. */
class Author implements \JsonSerializable {


+ 2
- 2
src/Blog.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use Psr\Http\Message\{UriInterface};
use Nyholm\Psr7\Uri;
use Psr\Http\Message\UriInterface;

/** Represents the front page or home URL transmitted when making requests. */
class Blog implements \JsonSerializable {


+ 2
- 2
src/Client.php View File

@@ -2,8 +2,8 @@
namespace Akismet;

use Psr\Http\Message\{ResponseInterface, UriInterface};
use Symfony\Component\EventDispatcher\{EventDispatcher};
use Symfony\Component\HttpClient\{Psr18Client};
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpClient\Psr18Client;

/** Submits comments to the [Akismet](https://akismet.com) service. */
class Client extends EventDispatcher {


+ 1
- 1
src/ClientException.php View File

@@ -1,7 +1,7 @@
<?php declare(strict_types=1);
namespace Akismet;

use Psr\Http\Message\{UriInterface};
use Psr\Http\Message\UriInterface;

/** An exception caused by an error in a `Client` request. */
class ClientException extends \RuntimeException {


+ 2
- 2
src/Comment.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use Psr\Http\Message\{UriInterface};
use Nyholm\Psr7\Uri;
use Psr\Http\Message\UriInterface;

/** Represents a comment submitted by an author. */
class Comment implements \JsonSerializable {


+ 2
- 2
src/RequestEvent.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Psr\Http\Message\{RequestInterface};
use Symfony\Contracts\EventDispatcher\{Event};
use Psr\Http\Message\RequestInterface;
use Symfony\Contracts\EventDispatcher\Event;

/** Represents the event parameter used for request events. */
class RequestEvent extends Event {


+ 2
- 2
test/AuthorTest.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use PHPUnit\Framework\{TestCase};
use Nyholm\Psr7\Uri;
use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\{assertThat, countOf, equalTo, isEmpty};

/** @testdox Akismet\Author */


+ 2
- 2
test/BlogTest.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use PHPUnit\Framework\{TestCase};
use Nyholm\Psr7\Uri;
use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\{assertThat, countOf, equalTo, isEmpty, isNull};

/** @testdox Akismet\Blog */


+ 1
- 1
test/ClientTest.php View File

@@ -1,7 +1,7 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use Nyholm\Psr7\Uri;
use PHPUnit\Framework\{Assert, TestCase};
use function PHPUnit\Framework\{assertThat, equalTo, isFalse, isTrue, logicalOr};



+ 2
- 2
test/CommentTest.php View File

@@ -1,8 +1,8 @@
<?php declare(strict_types=1);
namespace Akismet;

use Nyholm\Psr7\{Uri};
use PHPUnit\Framework\{TestCase};
use Nyholm\Psr7\Uri;
use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\{assertThat, countOf, equalTo, isEmpty, isNull, logicalNot};

/** @testdox Akismet\Comment */


Loading…
Cancel
Save