| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2.032 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\LaravelMetrics\Expressions; |
||
| 48 | 4 | public static function make(string $driver, string $name, $value, array $params = []): Expression |
|
| 49 | { |
||
| 50 | 4 | $expression = Arr::get(static::$expressions, "{$name}.{$driver}"); |
|
| 51 | |||
| 52 | 4 | if (is_null($expression)) |
|
| 53 | throw new InvalidArgumentException("Expression `{$name}` not found for `{$driver}` driver"); |
||
| 54 | |||
| 55 | 4 | return new $expression($value, ...$params); |
|
| 56 | } |
||
| 57 | } |
||
| 58 |