| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | protected function key() |
||
| 28 | { |
||
| 29 | if (isset($this->key)) { |
||
| 30 | return $this->key; |
||
| 31 | } |
||
| 32 | |||
| 33 | $class = (new \ReflectionClass($this))->getShortName(); |
||
| 34 | |||
| 35 | if (Str::endsWith($class, 'FrontendDataProvider')) { |
||
| 36 | $name = Str::before($class, 'FrontendDataProvider'); |
||
| 37 | } elseif (Str::endsWith($class, 'DataProvider')) { |
||
| 38 | $name = Str::before($class, 'DataProvider'); |
||
| 39 | } |
||
| 40 | |||
| 41 | return Str::snake($name ?? $class); |
||
| 42 | } |
||
| 43 | |||
| 49 |