1 | <?php |
||
12 | class Inflector implements InflectorInterface |
||
13 | { |
||
14 | /** |
||
15 | * @author Andrea Marco Sartori |
||
16 | * |
||
17 | * @var string $word Word to inflect. |
||
18 | */ |
||
19 | protected $word; |
||
20 | |||
21 | /** |
||
22 | * @author Andrea Marco Sartori |
||
23 | * |
||
24 | * @var string $namespace The application namespace. |
||
25 | */ |
||
26 | protected $namespace; |
||
27 | |||
28 | /** |
||
29 | * Set the application namespace. |
||
30 | * |
||
31 | * @author Andrea Marco Sartori |
||
32 | * |
||
33 | * @param Cerbero\Workflow\Wrappers\NamespaceDetectorInterface $detector Application namespace detector. |
||
34 | * |
||
35 | * @return void |
||
|
|||
36 | */ |
||
37 | 12 | public function __construct(NamespaceDetectorInterface $detector) |
|
41 | |||
42 | /** |
||
43 | * Set the word to inflect. |
||
44 | * |
||
45 | * @author Andrea Marco Sartori |
||
46 | * |
||
47 | * @param string $word |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | 9 | public function of($word) |
|
57 | |||
58 | /** |
||
59 | * Retrieve the inflected request. |
||
60 | * |
||
61 | * @author Andrea Marco Sartori |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 3 | public function getRequest() |
|
69 | |||
70 | /** |
||
71 | * Compose the word to inflect. |
||
72 | * |
||
73 | * @author Andrea Marco Sartori |
||
74 | * |
||
75 | * @param string $suffix |
||
76 | * @param string $path |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 6 | protected function compose($suffix, $path) |
|
86 | |||
87 | /** |
||
88 | * Retrieve the inflected job. |
||
89 | * |
||
90 | * @author Andrea Marco Sartori |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | 3 | public function getJob() |
|
98 | } |
||
99 |
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.