From e190346aea16de101405f264fb62a944669bac3c Mon Sep 17 00:00:00 2001 From: webeweb Date: Tue, 29 Jun 2021 12:22:33 +0200 Subject: [PATCH] Update abstract Response: - use integer total trait --- src/Response/AbstractRechercheResponse.php | 29 ++----------------- .../AbstractRechercheResponseTest.php | 13 --------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/Response/AbstractRechercheResponse.php b/src/Response/AbstractRechercheResponse.php index 53e5b78..1054b8b 100644 --- a/src/Response/AbstractRechercheResponse.php +++ b/src/Response/AbstractRechercheResponse.php @@ -12,6 +12,7 @@ namespace WBW\Library\Pappers\Response; use WBW\Library\Traits\Integers\IntegerPageTrait; +use WBW\Library\Traits\Integers\IntegerTotalTrait; /** * Abstract recherche response. @@ -23,13 +24,7 @@ abstract class AbstractRechercheResponse extends AbstractResponse { use IntegerPageTrait; - - /** - * Total. - * - * @var int|null - */ - private $total; + use IntegerTotalTrait; /** * Constructor. @@ -37,24 +32,4 @@ abstract class AbstractRechercheResponse extends AbstractResponse { protected function __construct() { parent::__construct(); } - - /** - * Get the total. - * - * @return int|null Returns the total. - */ - public function getTotal(): ?int { - return $this->total; - } - - /** - * Set the total. - * - * @param int|null $total The total. - * @return AbstractRechercheResponse Returns this recherche response. - */ - public function setTotal(?int $total): AbstractRechercheResponse { - $this->total = $total; - return $this; - } } \ No newline at end of file diff --git a/tests/Response/AbstractRechercheResponseTest.php b/tests/Response/AbstractRechercheResponseTest.php index d947871..fb493a8 100644 --- a/tests/Response/AbstractRechercheResponseTest.php +++ b/tests/Response/AbstractRechercheResponseTest.php @@ -22,19 +22,6 @@ */ class AbstractRechercheResponseTest extends AbstractTestCase { - /** - * Tests the setTotal() method. - * - * @return void - */ - public function testSetTotal(): void { - - $obj = new TestRechercheResponse(); - - $obj->setTotal(1); - $this->assertEquals(1, $obj->getTotal()); - } - /** * Tests the __construct() method. *