Skip to content

Commit 921fb02

Browse files
minor #418 CS fix (nicolas-grekas)
This PR was merged into the 1.26-dev branch. Discussion ---------- CS fix Commits ------- 585f208 CS fix
2 parents ae1b1b2 + 585f208 commit 921fb02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+240
-255
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.php_cs
2-
.php_cs.cache
1+
.php-cs-fixer.php
2+
.php-cs-fixer.cache
33
.phpunit.result.cache
44
composer.lock
55
phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
if (!file_exists(__DIR__.'/src')) {
13+
exit(0);
14+
}
15+
16+
$fileHeaderComment = <<<'EOF'
17+
This file is part of the Symfony package.
18+
19+
(c) Fabien Potencier <[email protected]>
20+
21+
For the full copyright and license information, please view the LICENSE
22+
file that was distributed with this source code.
23+
EOF;
24+
25+
return (new PhpCsFixer\Config())
26+
->setRules([
27+
'@PHP71Migration' => true,
28+
'@PHPUnit75Migration:risky' => true,
29+
'@Symfony' => true,
30+
'@Symfony:risky' => true,
31+
'protected_to_private' => false,
32+
'native_constant_invocation' => ['strict' => false],
33+
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
34+
'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => true],
35+
'header_comment' => ['header' => $fileHeaderComment],
36+
])
37+
->setRiskyAllowed(true)
38+
->setFinder(
39+
(new PhpCsFixer\Finder())
40+
->in(__DIR__)
41+
->append([__FILE__])
42+
->exclude([
43+
'src/Iconv/Resources',
44+
'src/Intl/Icu/Resources',
45+
'src/Intl/Idn/Resources',
46+
'src/Mbstring/Resources',
47+
'src/Intl/Normalizer/Resources',
48+
])
49+
)
50+
->setCacheFile('.php-cs-fixer.cache')
51+
;

.php_cs.dist

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Intl/Grapheme/Grapheme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT,
4848
$start = \strlen($s) + $start;
4949
}
5050

51-
if (!is_scalar($s)) {
51+
if (!\is_scalar($s)) {
5252
$hasError = false;
5353
set_error_handler(function () use (&$hasError) { $hasError = true; });
5454
$next = substr($s, $start);

src/Intl/Icu/DateFormat/AmPmTransformer.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,16 @@
2020
*/
2121
class AmPmTransformer extends Transformer
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
2623
public function format(\DateTime $dateTime, int $length): string
2724
{
2825
return $dateTime->format('A');
2926
}
3027

31-
/**
32-
* {@inheritdoc}
33-
*/
3428
public function getReverseMatchingRegExp(int $length): string
3529
{
3630
return 'AM|PM';
3731
}
3832

39-
/**
40-
* {@inheritdoc}
41-
*/
4233
public function extractDateOptions(string $matched, int $length): array
4334
{
4435
return [

src/Intl/Icu/DateFormat/DayOfWeekTransformer.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
*/
2121
class DayOfWeekTransformer extends Transformer
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
2623
public function format(\DateTime $dateTime, int $length): string
2724
{
2825
$dayOfWeek = $dateTime->format('l');
@@ -38,9 +35,6 @@ public function format(\DateTime $dateTime, int $length): string
3835
}
3936
}
4037

41-
/**
42-
* {@inheritdoc}
43-
*/
4438
public function getReverseMatchingRegExp(int $length): string
4539
{
4640
switch ($length) {
@@ -55,9 +49,6 @@ public function getReverseMatchingRegExp(int $length): string
5549
}
5650
}
5751

58-
/**
59-
* {@inheritdoc}
60-
*/
6152
public function extractDateOptions(string $matched, int $length): array
6253
{
6354
return [];

src/Intl/Icu/DateFormat/DayOfYearTransformer.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,18 @@
2020
*/
2121
class DayOfYearTransformer extends Transformer
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
2623
public function format(\DateTime $dateTime, int $length): string
2724
{
2825
$dayOfYear = (int) $dateTime->format('z') + 1;
2926

3027
return $this->padLeft($dayOfYear, $length);
3128
}
3229

33-
/**
34-
* {@inheritdoc}
35-
*/
3630
public function getReverseMatchingRegExp(int $length): string
3731
{
3832
return '\d{'.$length.'}';
3933
}
4034

41-
/**
42-
* {@inheritdoc}
43-
*/
4435
public function extractDateOptions(string $matched, int $length): array
4536
{
4637
return [];

src/Intl/Icu/DateFormat/DayTransformer.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,16 @@
2020
*/
2121
class DayTransformer extends Transformer
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
2623
public function format(\DateTime $dateTime, int $length): string
2724
{
2825
return $this->padLeft($dateTime->format('j'), $length);
2926
}
3027

31-
/**
32-
* {@inheritdoc}
33-
*/
3428
public function getReverseMatchingRegExp(int $length): string
3529
{
3630
return 1 === $length ? '\d{1,2}' : '\d{1,'.$length.'}';
3731
}
3832

39-
/**
40-
* {@inheritdoc}
41-
*/
4233
public function extractDateOptions(string $matched, int $length): array
4334
{
4435
return [

src/Intl/Icu/DateFormat/Hour1200Transformer.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
*/
2121
class Hour1200Transformer extends HourTransformer
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
2623
public function format(\DateTime $dateTime, int $length): string
2724
{
2825
$hourOfDay = $dateTime->format('g');
@@ -31,9 +28,6 @@ public function format(\DateTime $dateTime, int $length): string
3128
return $this->padLeft($hourOfDay, $length);
3229
}
3330

34-
/**
35-
* {@inheritdoc}
36-
*/
3731
public function normalizeHour(int $hour, string $marker = null): int
3832
{
3933
if ('PM' === $marker) {
@@ -43,17 +37,11 @@ public function normalizeHour(int $hour, string $marker = null): int
4337
return $hour;
4438
}
4539

46-
/**
47-
* {@inheritdoc}
48-
*/
4940
public function getReverseMatchingRegExp(int $length): string
5041
{
5142
return '\d{1,2}';
5243
}
5344

54-
/**
55-
* {@inheritdoc}
56-
*/
5745
public function extractDateOptions(string $matched, int $length): array
5846
{
5947
return [

src/Intl/Icu/DateFormat/Hour1201Transformer.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,11 @@
2020
*/
2121
class Hour1201Transformer extends HourTransformer
2222
{
23-
/**
24-
* {@inheritdoc}
25-
*/
2623
public function format(\DateTime $dateTime, int $length): string
2724
{
2825
return $this->padLeft($dateTime->format('g'), $length);
2926
}
3027

31-
/**
32-
* {@inheritdoc}
33-
*/
3428
public function normalizeHour(int $hour, string $marker = null): int
3529
{
3630
if ('PM' !== $marker && 12 === $hour) {
@@ -43,17 +37,11 @@ public function normalizeHour(int $hour, string $marker = null): int
4337
return $hour;
4438
}
4539

46-
/**
47-
* {@inheritdoc}
48-
*/
4940
public function getReverseMatchingRegExp(int $length): string
5041
{
5142
return '\d{1,2}';
5243
}
5344

54-
/**
55-
* {@inheritdoc}
56-
*/
5745
public function extractDateOptions(string $matched, int $length): array
5846
{
5947
return [

0 commit comments

Comments
 (0)