1 | <?php namespace Arcanedev\LaravelMetrics\Expressions\TrendDateFormat; |
||
15 | abstract class Expression extends BaseExpression |
||
16 | { |
||
17 | /* ----------------------------------------------------------------- |
||
18 | | Properties |
||
19 | | ----------------------------------------------------------------- |
||
20 | */ |
||
21 | |||
22 | /** |
||
23 | * The query builder being used to build the trend. |
||
24 | * |
||
25 | * @var \Illuminate\Database\Query\Builder |
||
26 | */ |
||
27 | public $query; |
||
28 | |||
29 | /** |
||
30 | * The unit being measured. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | public $unit; |
||
35 | |||
36 | /** |
||
37 | * The users's local timezone. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | public $timezone; |
||
42 | |||
43 | /* ----------------------------------------------------------------- |
||
44 | | Constructor |
||
45 | | ----------------------------------------------------------------- |
||
46 | */ |
||
47 | |||
48 | /** |
||
49 | * Create a new raw query expression. |
||
50 | * |
||
51 | * @param mixed $value |
||
52 | * @param string $unit |
||
53 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
54 | * @param string $timezone |
||
55 | * |
||
56 | * @return void |
||
|
|||
57 | */ |
||
58 | 168 | public function __construct($value, string $unit, Builder $query, $timezone) |
|
66 | |||
67 | /* ----------------------------------------------------------------- |
||
68 | | Other Methods |
||
69 | | ----------------------------------------------------------------- |
||
70 | */ |
||
71 | |||
72 | /** |
||
73 | * Get the timezone offset for the user's timezone. |
||
74 | * |
||
75 | * @return int |
||
76 | */ |
||
77 | 168 | public function offset() |
|
84 | |||
85 | /** |
||
86 | * Wrap the given value using the query's grammar. |
||
87 | * |
||
88 | * @param string $value |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | 168 | protected function wrap($value) |
|
96 | } |
||
97 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.