1 | <?php |
||
22 | final class DefaultPropertyNamingStrategy implements PropertyNamingStrategy |
||
23 | { |
||
24 | /** |
||
25 | * Property naming policy |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $policy; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param string $policy |
||
35 | */ |
||
36 | 22 | public function __construct(string $policy) |
|
40 | /** |
||
41 | * Accepts the PHP class property name and returns the name that should |
||
42 | * appear in json |
||
43 | * |
||
44 | * @param string $propertyName |
||
45 | * @return string |
||
46 | */ |
||
47 | 21 | public function translateName(string $propertyName): string |
|
69 | |||
70 | /** |
||
71 | * Prepend upper case letters |
||
72 | * |
||
73 | * @param string $string |
||
74 | * @param string $replacement |
||
75 | * @return string |
||
76 | */ |
||
77 | 15 | private function prependUpperCaseWith(string $string, string $replacement): string |
|
81 | |||
82 | } |
||
83 |