Skip to content

Commit c111420

Browse files
Johannes PichlerStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 749eb14 commit c111420

15 files changed

+80
-76
lines changed

src/Binding.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ interface Binding
77
/**
88
* executes the defined binding method on the class instance.
99
*
10-
* @param JsonDecoder $jsonDecoder
11-
* @param mixed $jsonData
10+
* @param JsonDecoder $jsonDecoder
11+
* @param mixed $jsonData
1212
* @param PropertyAccessor $propertyAccessor the class instance to bind to
1313
*
1414
* @return mixed

src/Bindings/AliasBinding.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function __construct($property, $jsonField)
3434
/**
3535
* executes the defined binding method on the class instance.
3636
*
37-
* @param JsonDecoder $jsonDecoder
38-
* @param mixed $jsonData
39-
* @param PropertyAccessor $propertyAccessor the class instance to bind to
37+
* @param JsonDecoder $jsonDecoder
38+
* @param mixed $jsonData
39+
* @param PropertyAccessor $propertyAccessor the class instance to bind to
4040
*
4141
* @throws JsonValueException if given json field is not available
4242
*

src/Bindings/ArrayBinding.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class ArrayBinding implements Binding
2727
/**
2828
* ArrayBinding constructor.
2929
*
30-
* @param string $property the property to bind to
30+
* @param string $property the property to bind to
3131
* @param string $jsonField the json field
32-
* @param string $type the desired type of the property
32+
* @param string $type the desired type of the property
3333
*/
3434
public function __construct($property, $jsonField, $type)
3535
{
@@ -41,8 +41,8 @@ public function __construct($property, $jsonField, $type)
4141
/**
4242
* executes the defined binding method on the class instance.
4343
*
44-
* @param JsonDecoder $jsonDecoder
45-
* @param array $jsonData
44+
* @param JsonDecoder $jsonDecoder
45+
* @param array $jsonData
4646
* @param PropertyAccessor $propertyAccessor the class instance to bind to
4747
*
4848
* @throws JsonValueException if given json field is not available

src/Bindings/CallbackBinding.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CallbackBinding implements Binding
2121
/**
2222
* CallbackBinding constructor.
2323
*
24-
* @param string $property
24+
* @param string $property
2525
* @param callable $callback
2626
*/
2727
public function __construct($property, $callback)
@@ -33,8 +33,8 @@ public function __construct($property, $callback)
3333
/**
3434
* executes the defined binding method on the class instance.
3535
*
36-
* @param JsonDecoder $jsonDecoder
37-
* @param mixed $jsonData
36+
* @param JsonDecoder $jsonDecoder
37+
* @param mixed $jsonData
3838
* @param PropertyAccessor $propertyAccessor the class instance to bind to
3939
*
4040
* @return mixed

src/Bindings/FieldBinding.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public function __construct($property, $jsonField, $type)
4141
/**
4242
* executes the defined binding method on the class instance.
4343
*
44-
* @param JsonDecoder $jsonDecoder
45-
* @param array $jsonData
46-
* @param PropertyAccessor $propertyAccessor the class instance to bind to
44+
* @param JsonDecoder $jsonDecoder
45+
* @param array $jsonData
46+
* @param PropertyAccessor $propertyAccessor the class instance to bind to
4747
*
4848
* @throws JsonValueException if given json field is not available
4949
*

src/Bindings/RawBinding.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($property)
2727
*
2828
* @param JsonDecoder $jsonDecoder
2929
* @param mixed $jsonData
30-
* @param mixed $propertyAccessor the class instance to bind to
30+
* @param mixed $propertyAccessor the class instance to bind to
3131
*
3232
* @return mixed
3333
*/

src/ClassBindings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function decode($data, $instance)
7777
public function register($binding)
7878
{
7979
if (!$binding instanceof Binding) {
80-
throw new InvalidBindingException("the given binding must implement the Binding interface");
80+
throw new InvalidBindingException('the given binding must implement the Binding interface');
8181
}
8282

8383
$this->bindings[$binding->property()] = $binding;

src/Exceptions/InvalidBindingException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class InvalidBindingException extends \Exception
66
{
7-
87
}

tests/specs/Bindings/AliasBindingSpec.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@
1010

1111
class AliasBindingSpec extends ObjectBehavior
1212
{
13-
function let()
13+
public function let()
1414
{
1515
$this->beConstructedWith('property', 'field');
1616
}
1717

18-
function it_is_initializable()
18+
public function it_is_initializable()
1919
{
2020
$this->shouldHaveType(AliasBinding::class);
2121
}
2222

23-
function it_should_return_bound_property()
23+
public function it_should_return_bound_property()
2424
{
2525
$this->property()->shouldReturn('property');
2626
}
2727

28-
function it_should_throw_an_exception_if_json_field_is_not_available(JsonDecoder $jsonDecoder)
28+
public function it_should_throw_an_exception_if_json_field_is_not_available(JsonDecoder $jsonDecoder)
2929
{
3030
$this->shouldThrow(JsonValueException::class)->duringBind($jsonDecoder, [], new \stdClass());
3131
}
3232

33-
function it_should_set_the_json_value_to_the_property(JsonDecoder $jsonDecoder, PropertyAccessor $propertyAccessor)
33+
public function it_should_set_the_json_value_to_the_property(JsonDecoder $jsonDecoder, PropertyAccessor $propertyAccessor)
3434
{
3535
$propertyAccessor->set('value')->shouldBeCalled();
3636

3737
$this->bind($jsonDecoder, ['field' => 'value'], $propertyAccessor);
3838
}
39-
}
39+
}

tests/specs/Bindings/ArrayBindingSpec.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,35 @@
1010

1111
class ArrayBindingSpec extends ObjectBehavior
1212
{
13-
function let()
13+
public function let()
1414
{
1515
$this->beConstructedWith('property', 'field', Sample::class);
1616
}
1717

18-
function it_is_initializable()
18+
public function it_is_initializable()
1919
{
2020
$this->shouldHaveType(ArrayBinding::class);
2121
}
2222

23-
function it_should_return_the_property_name()
23+
public function it_should_return_the_property_name()
2424
{
2525
$this->property()->shouldReturn('property');
2626
}
2727

28-
function it_should_throw_anc_exception_if_json_field_does_not_exist(JsonDecoder $jsonDecoder, PropertyAccessor $propertyAccessor)
28+
public function it_should_throw_anc_exception_if_json_field_does_not_exist(JsonDecoder $jsonDecoder, PropertyAccessor $propertyAccessor)
2929
{
3030
$this->shouldThrow(JsonValueException::class)->duringBind($jsonDecoder, [], $propertyAccessor);
3131
}
3232

33-
function it_should_decode_the_array(JsonDecoder $jsonDecoder, PropertyAccessor $propertyAccessor)
33+
public function it_should_decode_the_array(JsonDecoder $jsonDecoder, PropertyAccessor $propertyAccessor)
3434
{
3535
$jsonDecoder->decodeArray([], Sample::class)->shouldBeCalledTimes(2);
3636

3737
$this->bind($jsonDecoder, ['field' => [[], []]], $propertyAccessor);
3838
}
3939
}
4040

41-
class Sample {
41+
class Sample
42+
{
4243
public $property;
43-
}
44+
}

0 commit comments

Comments
 (0)