Skip to content

Commit

Permalink
Merge pull request #8 from bhushan/refactor/php-cs-fixer-fixes
Browse files Browse the repository at this point in the history
refactor: php-cs-fixer changes with formatting and renaming data providers
  • Loading branch information
bhushan authored Aug 18, 2023
2 parents e5ee04c + 1f9b57b commit 31dcbf0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"thecodingmachine/safe": "^1.3.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.1",
"friendsofphp/php-cs-fixer": "^v3.23.0",
"justinrainbow/json-schema": "^5.2",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/phpstan": "^0.12.99",
Expand Down
4 changes: 2 additions & 2 deletions src/Treblle.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public function onException(\Throwable $exception): void
}

/**
* @throws \Throwable
*
* @return array<int|string, mixed>
*
* @throws \Throwable
*/
private function buildPayload(): array
{
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/InMemoryErrorDataProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* @internal
*
* @coversNothing
*
* @small
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/PayloadAnnonymizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* @internal
*
* @coversNothing
*
* @small
Expand All @@ -20,7 +21,8 @@ final class PayloadAnnonymizerTest extends TestCase
* @param list<string> $fields
* @param array<string, mixed> $data
* @param array<string, mixed> $expected
* @dataProvider provideMaskingTestData
*
* @dataProvider provideIt_masks_fields_passed_as_argumentCases
*/
public function test_it_masks_fields_passed_as_argument(array $fields, array $data, array $expected): void
{
Expand All @@ -32,7 +34,7 @@ public function test_it_masks_fields_passed_as_argument(array $fields, array $da
/**
* @return iterable<string, mixed>
*/
public function provideMaskingTestData(): iterable
public function provideIt_masks_fields_passed_as_argumentCases(): iterable
{
$fields = [
'password',
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/PhpHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @internal
*
* @coversNothing
*
* @small
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/TreblleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

/**
* @internal
*
* @coversNothing
*
* @small
Expand Down Expand Up @@ -89,7 +90,7 @@ protected function setUp(): void
);
}

public function provideTestData(): iterable
public function provideIt_correctly_serializes_request_data_on_shutdownCases(): iterable
{
yield 'request and response without errors' => [
'server' => new Server(
Expand Down Expand Up @@ -279,7 +280,7 @@ public function provideTestData(): iterable
}

/**
* @dataProvider provideTestData
* @dataProvider provideIt_correctly_serializes_request_data_on_shutdownCases
*/
public function test_it_correctly_serializes_request_data_on_shutdown(
Server $server,
Expand Down
1 change: 1 addition & 0 deletions tools/php-cs-fixer/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'not_operator_with_successor_space' => false,
'ordered_interfaces' => true,
'php_unit_size_class' => true,
'phpdoc_order' => ['order' => ['param', 'return', 'throws']],
'phpdoc_to_return_type' => true,
'static_lambda' => true,

Expand Down
4 changes: 2 additions & 2 deletions tools/rector/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$parameters->set(Option::PATHS, [
$basePath.'src',
]);
// $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
// $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_74);
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__.'/tools/phpstan/config.neon');
$parameters->set(Option::SKIP, [
Expand All @@ -24,6 +24,6 @@
]);
$containerConfigurator->import(SetList::CODE_QUALITY);
$containerConfigurator->import(SetList::PHP_74);
// $containerConfigurator->import(SetList::PHP_80);
// $containerConfigurator->import(SetList::PHP_80);
$containerConfigurator->import(SetList::TYPE_DECLARATION_STRICT);
};

0 comments on commit 31dcbf0

Please sign in to comment.