Skip to content

Commit

Permalink
#45 - references in method signatures (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak authored Jan 4, 2022
1 parent 9d8bda5 commit c1e06d9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "library",
"require": {
"php": "^8.0",
"symplify/easy-coding-standard": "10.0.2"
"symplify/easy-coding-standard": "10.0.8"
},
"require-dev": {
"composer/composer": "2.*",
Expand Down
2 changes: 2 additions & 0 deletions tests/codestyle/CodestyleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function testPhp80Fixtures(): void
"strictTypes",
"trailingCommas",
"unionTypes",
"references",
];

foreach ($fixtures as $fixture) {
Expand All @@ -46,6 +47,7 @@ public function testPhp81Fixtures(): void
{
$fixtures = [
"enums",
"readonlies",
];

foreach ($fixtures as $fixture) {
Expand Down
10 changes: 10 additions & 0 deletions tests/codestyle/fixtures/readonlies/actual.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

class ReadonlyThing
{
protected readonly bool $true;

public function __construct(protected readonly string $string)
{
}
}
13 changes: 13 additions & 0 deletions tests/codestyle/fixtures/readonlies/expected.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

class ReadonlyThing
{
protected readonly bool $true;

public function __construct(
protected readonly string $string,
) {
}
}
8 changes: 8 additions & 0 deletions tests/codestyle/fixtures/references/actual.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

class ReferencedMethodParameter
{
protected function test(array & $param): void
{
}
}
10 changes: 10 additions & 0 deletions tests/codestyle/fixtures/references/expected.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

class ReferencedMethodParameter
{
protected function test(array &$param): void
{
}
}

0 comments on commit c1e06d9

Please sign in to comment.