Skip to content

Commit

Permalink
Update abstract Response:
Browse files Browse the repository at this point in the history
- use integer total trait
  • Loading branch information
webeweb committed Jun 29, 2021
1 parent ac5b978 commit e190346
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
29 changes: 2 additions & 27 deletions src/Response/AbstractRechercheResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace WBW\Library\Pappers\Response;

use WBW\Library\Traits\Integers\IntegerPageTrait;
use WBW\Library\Traits\Integers\IntegerTotalTrait;

/**
* Abstract recherche response.
Expand All @@ -23,38 +24,12 @@
abstract class AbstractRechercheResponse extends AbstractResponse {

use IntegerPageTrait;

/**
* Total.
*
* @var int|null
*/
private $total;
use IntegerTotalTrait;

/**
* Constructor.
*/
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;
}
}
13 changes: 0 additions & 13 deletions tests/Response/AbstractRechercheResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit e190346

Please sign in to comment.