Skip to content

Commit

Permalink
cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Feb 9, 2024
1 parent a9250af commit d255d87
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 43 deletions.
68 changes: 31 additions & 37 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,33 @@
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PER-CS2.0' => true,
'@PER-CS2.0:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP81Migration' => true,
'@PHP80Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,

'blank_line_before_statement' => ['statements' => [
'break',
'continue',
'declare',
'return',
'throw',
]],
'braces' => ['allow_single_line_closure' => false],
'comment_to_phpdoc' => false,
'explicit_string_variable' => false,
'array_indentation' => true,
'declare_strict_types' => true,
'final_class' => true,
'global_namespace_import' => [
'import_constants' => true,
'import_functions' => true,
'import_classes' => false,
],
'list_syntax' => ['syntax' => 'short'],
'no_extra_blank_lines' => [
'tokens' => [
'break',
// 'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
'heredoc_to_nowdoc' => true,
'method_argument_space' => ['on_multiline' => 'ignore'],
'multiline_comment_opening_closing' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'remove_inheritdoc' => true,
],
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_useless_else' => true,
'no_useless_return' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_class_elements' => ['order' => [
'use_trait',
'case',
Expand All @@ -67,22 +54,29 @@
]],
'ordered_imports' => ['imports_order' => [
'class',
'const',
'function',
'const',
]],
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_add_missing_param_annotation' => false,
'phpdoc_align' => false,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_order' => true,
'phpdoc_separation' => false,
'phpdoc_to_comment' => false,
'phpdoc_types_order' => [
'sort_algorithm' => 'none',
'null_adjustment' => 'always_last',
'single_line_empty_body' => true,
'single_line_throw' => false,
'strict_comparison' => true,
'strict_param' => true,
'string_implicit_backslashes' => ['single_quoted' => 'ignore'],
'trailing_comma_in_multiline' => [
'after_heredoc' => true,
'elements' => ['arrays', 'parameters', 'match', 'arguments'],
],
'use_arrow_functions' => false,
'void_return' => false,
])
->setFinder(
(new PhpCsFixer\Finder())
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
->append([__FILE__])
->append([__FILE__]),
)
;
1 change: 1 addition & 0 deletions src/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use HillValley\Fluxcap\Exception\InvalidPartException;
use HillValley\Fluxcap\Exception\InvalidStringException;
use HillValley\Fluxcap\Exception\MissingIntlExtensionException;

use function is_int;

/**
Expand Down
1 change: 1 addition & 0 deletions src/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use HillValley\Fluxcap\Exception\InvalidPartException;
use HillValley\Fluxcap\Exception\InvalidStringException;
use HillValley\Fluxcap\Exception\MissingIntlExtensionException;

use function is_int;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Duration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace HillValley\Fluxcap;

use HillValley\Fluxcap\Exception\InvalidStringException;

use function is_int;

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

namespace HillValley\Fluxcap\Exception;

interface Exception
{
}
interface Exception {}
1 change: 1 addition & 0 deletions src/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use HillValley\Fluxcap\Exception\InvalidPartException;
use HillValley\Fluxcap\Exception\InvalidStringException;
use HillValley\Fluxcap\Exception\MissingIntlExtensionException;

use function is_int;

/**
Expand Down
3 changes: 1 addition & 2 deletions tests/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use HillValley\Fluxcap\TimeZone;
use HillValley\Fluxcap\Weekday;
use PHPUnit\Framework\TestCase;
use const PHP_VERSION_ID;

/**
* @internal
Expand Down Expand Up @@ -1221,7 +1220,7 @@ private static function assertDateTimeNow($dateTime, string $expectedTimeZone =

self::assertThat($dateTime->format('Y-m-d H:i:s'), self::logicalOr(
self::identicalTo($now->modify('-1sec')->format('Y-m-d H:i:s')),
self::identicalTo($now->format('Y-m-d H:i:s'))
self::identicalTo($now->format('Y-m-d H:i:s')),
));

self::assertSame($expectedTimeZone, $dateTime->getTimeZone()->getName());
Expand Down
2 changes: 1 addition & 1 deletion tests/TimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ private static function assertTimeNow($time): void

self::assertThat($time->format('H:i:s'), self::logicalOr(
self::identicalTo(date('H:i:s', $now - 1)),
self::identicalTo(date('H:i:s', $now))
self::identicalTo(date('H:i:s', $now)),
));
}
}
1 change: 1 addition & 0 deletions tests/TimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use HillValley\Fluxcap\Exception\InvalidStringException;
use HillValley\Fluxcap\TimeZone;
use PHPUnit\Framework\TestCase;

use function ini_get;

/**
Expand Down

0 comments on commit d255d87

Please sign in to comment.