Skip to content

Commit 5c590ff

Browse files
committed
Add missing doc blocks
1 parent 2dcdd29 commit 5c590ff

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

src/ClassBindings.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ private function handleRaw(Property $property, $data)
119119
(new RawBinding($property->getName()))->bind($this->jsonDecoder, $data, $property);
120120
}
121121

122+
/**
123+
* creates the property variants and checks if one of them is an actual property of the instance
124+
*
125+
* @param string $jsonField the json field name used for creating the variants
126+
* @param mixed $instance the class instance
127+
*
128+
* @return null|Property
129+
*/
122130
private function autoCase(string $jsonField, $instance): ?Property
123131
{
124132
$variants = array_filter(
@@ -142,6 +150,13 @@ function ($variant) use ($jsonField) {
142150
return null;
143151
}
144152

153+
/**
154+
* converts the given snake case input to camel case
155+
*
156+
* @param string $input snake case input
157+
*
158+
* @return string
159+
*/
145160
private function snakeToCamelCase(string $input)
146161
{
147162
$fn = function ($c) {
@@ -151,6 +166,13 @@ private function snakeToCamelCase(string $input)
151166
return preg_replace_callback('/_([a-z])/', $fn, strtolower($input));
152167
}
153168

169+
/**
170+
* converts the given kebap case input to camel case
171+
*
172+
* @param string $input kebap case input
173+
*
174+
* @return string
175+
*/
154176
private function kebapToCamelCase(string $input)
155177
{
156178
$output = str_replace('-', '', ucwords($input, '-'));

src/JsonDecoder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ private function parseJson(string $json, string $root = null)
206206
* scans the given class and creates bindings for annotated properties
207207
*
208208
* @param string $class the class to scan
209+
*
209210
* @return array the list of generated bindings
211+
*
212+
* @throws ReflectionException
210213
*/
211214
private function scan(string $class)
212215
{

src/Property.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ private function __construct($instance, string $propertyName, ReflectionProperty
4949
$this->property = $property;
5050
}
5151

52+
/**
53+
* sets the value to the property
54+
*
55+
* @param mixed $value
56+
*
57+
* @return void
58+
*/
5259
public function set($value)
5360
{
5461
if (is_null($this->property)) {
@@ -60,6 +67,11 @@ public function set($value)
6067
}
6168
}
6269

70+
/**
71+
* gets the name ot the property
72+
*
73+
* @return string
74+
*/
6375
public function getName()
6476
{
6577
return $this->propertyName;

0 commit comments

Comments
 (0)