|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* Copyright (c) Ouzo contributors, http://ouzoframework.org |
|
4
|
|
|
* This file is made available under the MIT License (view the LICENSE file for more information). |
|
5
|
|
|
*/ |
|
6
|
|
|
namespace Ouzo\Utilities; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class FluentFunctions |
|
10
|
|
|
* @package Ouzo\Utilities |
|
11
|
|
|
* |
|
12
|
|
|
* @method static FluentFunction extractField($expression) |
|
13
|
|
|
* @method static FluentFunction extractFieldRecursively($expression) |
|
14
|
|
|
* @method static FluentFunction extractExpression($expression) |
|
15
|
|
|
* @method static FluentFunction trim() |
|
16
|
|
|
* @method static FluentFunction isArray() |
|
17
|
|
|
* @method static FluentFunction prepend($string) |
|
18
|
|
|
* @method static FluentFunction append($string) |
|
19
|
|
|
* @method static FluentFunction notEmpty() |
|
20
|
|
|
* @method static FluentFunction notBlank() |
|
21
|
|
|
* @method static FluentFunction removePrefix($string) |
|
22
|
|
|
* @method static FluentFunction startsWith($string) |
|
23
|
|
|
* @method static FluentFunction formatDateTime($format) |
|
24
|
|
|
* @method static FluentFunction toString() |
|
25
|
|
|
* @method static FluentFunction surroundWith($string) |
|
26
|
|
|
* @method static FluentFunction equals($value) |
|
27
|
|
|
* @method static FluentFunction negate() |
|
28
|
|
|
* @method static FluentFunction notEquals($value) |
|
29
|
|
|
* @method static FluentFunction isInstanceOf($value) |
|
30
|
|
|
*/ |
|
31
|
|
|
class FluentFunctions |
|
32
|
|
|
{ |
|
33
|
|
|
public static function __callStatic($name, $arguments) |
|
34
|
|
|
{ |
|
35
|
|
|
$fluentFunction = new FluentFunction(); |
|
36
|
|
|
return call_user_func_array(array($fluentFunction, $name), $arguments); |
|
37
|
|
|
} |
|
38
|
|
|
} |
|
39
|
|
|
|