Fix styling issues
This commit is contained in:
parent
2b4e56fa22
commit
2e349f4dec
3 changed files with 31 additions and 31 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 . '") ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue