1 | <?php |
||||
2 | |||||
3 | namespace Nip\Inflector\Traits; |
||||
4 | |||||
5 | use Nip\Inflector\Inflector; |
||||
6 | |||||
7 | /** |
||||
8 | * Trait MagicMethodsTrait |
||||
9 | * @package Nip\Inflector\Traits |
||||
10 | */ |
||||
11 | trait MagicMethodsTrait |
||||
12 | { |
||||
13 | |||||
14 | /** |
||||
15 | * @param $name |
||||
16 | * @param $arguments |
||||
17 | * @return string |
||||
18 | */ |
||||
19 | 21 | public function __call($name, $arguments) |
|||
20 | { |
||||
21 | 21 | if ($this->hasInflection($name)) { |
|||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
22 | 21 | return $this->doInflection($name, $arguments[0]); |
|||
0 ignored issues
–
show
The method
doInflection() does not exist on Nip\Inflector\Traits\MagicMethodsTrait . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
23 | } |
||||
24 | throw new \BadFunctionCallException("invalid inflection {$name}"); |
||||
25 | } |
||||
26 | |||||
27 | /** |
||||
28 | * @param $name |
||||
29 | * @param $arguments |
||||
30 | * @return mixed |
||||
31 | */ |
||||
32 | public static function __callStatic($name, $arguments) |
||||
33 | { |
||||
34 | return (new Inflector())->doInflection($name, $arguments[0]); |
||||
35 | } |
||||
36 | } |
||||
37 |