mirror of
https://github.com/flextype/flextype.git
synced 2025-08-06 13:16:45 +02:00
refactor(expressions): updates and small fixes
This commit is contained in:
@@ -26,8 +26,8 @@ class MathExpression implements ExpressionFunctionProviderInterface
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new ExpressionFunction('ceil', static fn (int|float $num): float => '\ceil($num)', static fn (array $arguments, int|float $num): float => \ceil($num)),
|
||||
new ExpressionFunction('floor', static fn (int|float $num): float => '\floor($num)', static fn (array $arguments, int|float $num): float => \floor($num)),
|
||||
new ExpressionFunction('ceil', static fn (int|float $num): mixed => '\ceil($num)', static fn (array $arguments, int|float $num): mixed => \ceil($num)),
|
||||
new ExpressionFunction('floor', static fn (int|float $num): mixed => '\floor($num)', static fn (array $arguments, int|float $num): mixed => \floor($num)),
|
||||
new ExpressionFunction('min', static fn (mixed ...$values): mixed => '\min($values)', static fn (array $arguments, mixed ...$values): mixed => \min($values)),
|
||||
new ExpressionFunction('max', static fn (mixed ...$values): mixed => '\max($values)', static fn (array $arguments, mixed ...$values): mixed => \max($values)),
|
||||
];
|
||||
|
@@ -37,7 +37,7 @@ class UrlExpression implements ExpressionFunctionProviderInterface
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new ExpressionFunction('url', static fn (string $string = '', string $prefix = 'base') => '\Flextype\url($string, $prefix)', static fn ($arguments, string $string = '', string $prefix = 'base') => urlFor($string, $prefix)),
|
||||
new ExpressionFunction('url', static fn (string $string = '', string $prefix = 'base') => '\Flextype\url($string, $prefix)', static fn ($arguments, string $string = '', string $prefix = 'base') => url($string, $prefix)),
|
||||
new ExpressionFunction('urlFor', static fn (string $routeName, array $data = [], array $queryParams = []) => '\Flextype\urlFor($routeName, $data, $queryParams)', static fn ($arguments, string $routeName, array $data = [], array $queryParams = []) => urlFor($routeName, $data, $queryParams)),
|
||||
new ExpressionFunction('fullUrlFor', static fn (ServerRequestInterface $request, string $routeName, array $data = [], array $queryParams = []) => '\Flextype\fullUrlFor($request, $routeName, $data, $queryParams)', static fn ($arguments, ServerRequestInterface $request, string $routeName, array $data = [], array $queryParams = []) => fullUrlFor($request, $routeName, $data = [], $queryParams = [])),
|
||||
new ExpressionFunction('isCurrentUrl', static fn (ServerRequestInterface $request, string $routeName, array $data = []) => '\Flextype\isCurrentUrl($request, $routeName, $data)', static fn ($arguments, ServerRequestInterface $request, string $routeName, array $data = []) => isCurrentUrl($request, $routeName, $data = [])),
|
||||
|
Reference in New Issue
Block a user