Skip to content

Commit 93b5ed6

Browse files
authored
Merge pull request #46 from karriereat/feature/php8
Add support for PHP 8
2 parents 3ee234c + a763151 commit 93b5ed6

13 files changed

+49
-45
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
php: [7.4]
15+
php: [7.4, 8.0]
1616

1717
runs-on: ubuntu-latest
1818
name: PHP@${{ matrix.php }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [7.3, 7.4]
16+
php: [7.3, 7.4, 8.0]
1717

1818
runs-on: ubuntu-latest
1919
name: PHP@${{ matrix.php }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [4.1.0] - 2021-10-20
8+
### Added
9+
- Support for PHP 8
10+
711
## [4.0.3] - 2020-11-30
812
### Fixed
913
- To strict param type in `transform` method

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
},
2323
"require": {
24-
"php": ">=7.3",
24+
"php": "^7.3 | ^8.0",
2525
"php-di/phpdoc-reader": "^2.1"
2626
},
2727
"require-dev": {

tests/Bindings/AliasBindingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class AliasBindingTest extends TestCase
1212
{
1313
/** @test */
14-
public function it_aliases_a_field()
14+
public function itAliasesAField()
1515
{
1616
$binding = new AliasBinding('firstname', 'first-name');
1717
$person = new Person();
@@ -23,7 +23,7 @@ public function it_aliases_a_field()
2323
}
2424

2525
/** @test */
26-
public function it_skips_a_not_available_field()
26+
public function itSkipsANotAvailableField()
2727
{
2828
$binding = new AliasBinding('lastname', 'lastname');
2929
$person = new Person();

tests/Bindings/ArrayBindingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class ArrayBindingTest extends TestCase
1313
{
1414
/** @test */
15-
public function it_binds_an_array()
15+
public function itBindsAnArray()
1616
{
1717
$binding = new ArrayBinding('address', 'addresses', Address::class);
1818
$person = new Person();
@@ -42,7 +42,7 @@ public function it_binds_an_array()
4242
}
4343

4444
/** @test */
45-
public function it_skips_a_not_available_field()
45+
public function itSkipsANotAvailableField()
4646
{
4747
$binding = new ArrayBinding('address', 'addresses', Address::class);
4848
$person = new Person();

tests/Bindings/CallbackBindingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class CallbackBindingTest extends TestCase
1212
{
1313
/** @test */
14-
public function it_binds_with_a_callback()
14+
public function itBindsWithACallback()
1515
{
1616
$binding = new CallbackBinding('firstname', function () {
1717
return 'Jane';
@@ -25,7 +25,7 @@ public function it_binds_with_a_callback()
2525
}
2626

2727
/** @test */
28-
public function it_always_validates_to_true()
28+
public function itAlwaysValidatesToTrue()
2929
{
3030
$binding = new CallbackBinding('firstname', function () {
3131
return 'Jane';

tests/Bindings/DateTimeBindingTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,52 @@
1212
class DateTimeBindingTest extends TestCase
1313
{
1414
/** @test */
15-
public function it_validates_successfully()
15+
public function itValidatesSuccessfully()
1616
{
1717
$binding = new DateTimeBinding('date', 'date');
1818

1919
$this->assertTrue($binding->validate(['date' => '2020-01-01T12:00:00+00:00']));
2020
}
2121

2222
/** @test */
23-
public function it_fails_on_validation_of_a_required_property_with_an_invalid_date_format()
23+
public function itFailsOnValidationOfARequiredPropertyWithAnInvalidDateFormat()
2424
{
2525
$binding = new DateTimeBinding('date', 'date', true);
2626

2727
$this->assertFalse($binding->validate(['date' => 'invalid']));
2828
}
2929

3030
/** @test */
31-
public function it_fails_on_validation_of_a_not_required_property_with_an_invalid_date_format()
31+
public function itFailsOnValidationOfANotRequiredPropertyWithAnInvalidDateFormat()
3232
{
3333
$binding = new DateTimeBinding('date', 'date', false);
3434

3535
$this->assertFalse($binding->validate(['date' => 'invalid']));
3636
}
3737

3838
/** @test */
39-
public function it_fails_on_validation_for_a_not_set_field_that_is_required()
39+
public function itFailsOnValidationForANotSetFieldThatIsRequired()
4040
{
4141
$binding = new DateTimeBinding('date', 'date', true);
4242
$this->assertFalse($binding->validate([]));
4343
}
4444

4545
/** @test */
46-
public function it_succeeds_on_validation_for_a_not_set_field_that_is_not_required()
46+
public function itSucceedsOnValidationForANotSetFieldThatIsNotRequired()
4747
{
4848
$binding = new DateTimeBinding('date', 'date', false);
4949
$this->assertTrue($binding->validate([]));
5050
}
5151

5252
/** @test */
53-
public function it_succeeds_on_validation_for_an_empty_field_that_is_not_required()
53+
public function itSucceedsOnValidationForAnEmptyFieldThatIsNotRequired()
5454
{
5555
$binding = new DateTimeBinding('date', 'date', false);
5656
$this->assertTrue($binding->validate(['date' => '']));
5757
}
5858

5959
/** @test */
60-
public function it_binds_an_atom_datetime()
60+
public function itBindsAnAtomDatetime()
6161
{
6262
$binding = new DateTimeBinding('date', 'date');
6363
$person = new Person();
@@ -71,7 +71,7 @@ public function it_binds_an_atom_datetime()
7171
}
7272

7373
/** @test */
74-
public function it_ignores_an_empty_datetime_value()
74+
public function itIgnoresAnEmptyDatetimeValue()
7575
{
7676
$binding = new DateTimeBinding('date', 'date');
7777
$person = new Person();
@@ -83,7 +83,7 @@ public function it_ignores_an_empty_datetime_value()
8383
}
8484

8585
/** @test */
86-
public function it_ignores_an_invalid_datetime_value()
86+
public function itIgnoresAnInvalidDatetimeValue()
8787
{
8888
$binding = new DateTimeBinding('date', 'date');
8989
$person = new Person();

tests/Bindings/FieldBindingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class FieldBindingTest extends TestCase
1313
{
1414
/** @test */
15-
public function it_binds_a_field_to_a_class_instance()
15+
public function itBindsAFieldToAClassInstance()
1616
{
1717
$binding = new FieldBinding('address', 'address', Address::class);
1818
$person = new Person();
@@ -27,7 +27,7 @@ public function it_binds_a_field_to_a_class_instance()
2727
}
2828

2929
/** @test */
30-
public function it_ignores_a_not_defined_field()
30+
public function itIgnoresANotDefinedField()
3131
{
3232
$binding = new FieldBinding('address', 'address', Address::class);
3333
$person = new Person();

tests/Bindings/RawBindingTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class RawBindingTest extends TestCase
1212
{
1313
/** @test */
14-
public function it_sets_a_raw_value()
14+
public function itSetsARawValue()
1515
{
1616
$binding = new RawBinding('firstname');
1717
$person = new Person();
@@ -23,7 +23,7 @@ public function it_sets_a_raw_value()
2323
}
2424

2525
/** @test */
26-
public function it_ignores_a_not_existing_property()
26+
public function itIgnoresANotExistingProperty()
2727
{
2828
$binding = new RawBinding('firstname');
2929
$person = new Person();
@@ -35,7 +35,7 @@ public function it_ignores_a_not_existing_property()
3535
}
3636

3737
/** @test */
38-
public function it_always_validates_to_true()
38+
public function itAlwaysValidatesToTrue()
3939
{
4040
$binding = new RawBinding('firstname');
4141

0 commit comments

Comments
 (0)