Fix styling issues

This commit is contained in:
David Arendsen 2023-02-10 11:46:54 +01:00
commit 2e349f4dec
3 changed files with 31 additions and 31 deletions

View file

@ -105,11 +105,11 @@ trait Universe
return $this; return $this;
} }
public function addLast(string $column = '_value'): QueryBuilderInterface public function addLast(string $column = '_value'): QueryBuilderInterface
{ {
$this->addToQuery( $this->addToQuery(
new Last($column) new Last($column)
); );
return $this; return $this;
} }
} }

View file

@ -4,18 +4,18 @@ namespace Arendsen\FluxQueryBuilder\Functions;
class Last extends Base class Last extends Base
{ {
/** /**
* @var int $column * @var int $column
*/ */
private $column; private $column;
public function __construct(string $column = '_value') public function __construct(string $column = '_value')
{ {
$this->column = $column; $this->column = $column;
} }
public function __toString() public function __toString()
{ {
return '|> last(column: "' . (string)$this->column . '") '; return '|> last(column: "' . (string)$this->column . '") ';
} }
} }

View file

@ -9,21 +9,21 @@ use PHPUnit\Framework\TestCase;
final class LastFunctionTest extends TestCase final class LastFunctionTest extends TestCase
{ {
public function testSimpleLast() public function testSimpleLast()
{ {
$expression = new Last(); $expression = new Last();
$query = '|> last(column: "_value") '; $query = '|> last(column: "_value") ';
$this->assertEquals($query, $expression->__toString()); $this->assertEquals($query, $expression->__toString());
} }
public function testLastWithValue() public function testLastWithValue()
{ {
$expression = new Last('something'); $expression = new Last('something');
$query = '|> last(column: "something") '; $query = '|> last(column: "something") ';
$this->assertEquals($query, $expression->__toString()); $this->assertEquals($query, $expression->__toString());
} }
} }