Skip to content

Commit

Permalink
Bump friendsofphp/php-cs-fixer from 3.25.1 to 3.26.1 (#122)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
  • Loading branch information
dependabot[bot] and staabm authored Sep 13, 2023
1 parent 107f333 commit 6bb9786
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 75 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"require": {
"php": ">=7.4",
"rector/rector": "0.18.3",
"friendsofphp/php-cs-fixer": "3.25.1",
"friendsofphp/php-cs-fixer": "3.26.1",
"redaxo/php-cs-fixer-config": "^1.0"
},
"config": {
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions vendor/bin/php-cs-fixer
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,4 @@ if (PHP_VERSION_ID < 80000) {
}
}


if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
$_SERVER['SCRIPT_NAME'] = realpath(__DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer');
}

return include __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer';
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.25.1",
"version_normalized": "3.25.1.0",
"version": "v3.26.1",
"version_normalized": "3.26.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b"
"reference": "d023ba6684055f6ea1da1352d8a02baca0426983"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8e21d69801de6b5ecb0dbe0bcdf967b335b1260b",
"reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d023ba6684055f6ea1da1352d8a02baca0426983",
"reference": "d023ba6684055f6ea1da1352d8a02baca0426983",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -281,7 +281,7 @@
"ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters."
},
"time": "2023-09-04T01:22:52+00:00",
"time": "2023-09-08T19:09:07+00:00",
"bin": [
"php-cs-fixer"
],
Expand Down Expand Up @@ -315,7 +315,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.1"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.26.1"
},
"funding": [
{
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '5dec7f48cf12d32ce180d424d635a27095d3971f',
'reference' => 'e63d5ed6c91f466c57afbb48801bf1b6139e2a88',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '5dec7f48cf12d32ce180d424d635a27095d3971f',
'reference' => 'e63d5ed6c91f466c57afbb48801bf1b6139e2a88',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -47,9 +47,9 @@
'dev_requirement' => false,
),
'friendsofphp/php-cs-fixer' => array(
'pretty_version' => 'v3.25.1',
'version' => '3.25.1.0',
'reference' => '8e21d69801de6b5ecb0dbe0bcdf967b335b1260b',
'pretty_version' => 'v3.26.1',
'version' => '3.26.1.0',
'reference' => 'd023ba6684055f6ea1da1352d8a02baca0426983',
'type' => 'application',
'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer',
'aliases' => array(),
Expand Down
15 changes: 15 additions & 0 deletions vendor/friendsofphp/php-cs-fixer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ CHANGELOG for PHP CS Fixer

This file contains changelogs for stable releases only.

Changelog for v3.26.1
---------------------

* fix: Handle superfluous asterisk in `no_superfluous_phpdoc_tags` (#7279)

Changelog for v3.26.0
---------------------

* chore(checkbashisms): update to 2.23.6 (#7276)
* chore(phpstan): reduce baseline (#7275)
* feat: Add `single_line_empty_body` to `@PhpCsFixer` (#7266)
* fix(YieldFromArrayToYieldsFixer): mark as Risky (#7272)
* fix(YieldFromArrayToYieldsFixer): skip touching empty array (#7273)
* test: Introduce common way of creating fake Composer project in `InstallViaComposerTest` (#7265)

Changelog for v3.25.1
---------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ public function needFixing(string $file, string $fileContent): bool
return true;
}

public function setFile(string $file, string $fileContent): void
{
}
public function setFile(string $file, string $fileContent): void {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@
*
* @internal
*/
final class InvalidForEnvFixerConfigurationException extends InvalidFixerConfigurationException
{
}
final class InvalidForEnvFixerConfigurationException extends InvalidFixerConfigurationException {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@
*
* @internal
*/
final class RequiredFixerConfigurationException extends InvalidFixerConfigurationException
{
}
final class RequiredFixerConfigurationException extends InvalidFixerConfigurationException {}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
final class Application extends BaseApplication
{
public const VERSION = '3.25.1';
public const VERSION = '3.26.1';
public const VERSION_CODENAME = 'Crank Cake';

private ToolInfo $toolInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
*/
final class NullOutput implements ProgressOutputInterface
{
public function printLegend(): void
{
}
public function printLegend(): void {}

public function onFixerFileProcessed(FixerFileProcessedEvent $event): void
{
}
public function onFixerFileProcessed(FixerFileProcessedEvent $event): void {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private function getTypesContent(): ?string
}

$matchingResult = Preg::match(
'{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is',
'{^(?:\s*\*|/\*\*)[\s\*]*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is',
$this->lines[0]->getContent(),
$matches
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,26 @@ public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
'Yield from array must be unpacked to series of yields.',
[new CodeSample('<?php function generate() {
[
new CodeSample('<?php function generate() {
yield from [
1,
2,
3,
];
}
')],
'The conversion will make the array in `yield from` changed in arrays of 1 less dimension.'
'),
],
'The conversion will make the array in `yield from` changed in arrays of 1 less dimension.',
'The rule is risky in case of `yield from` being used multiple times within single function scope, while using list-alike data sources (e.g. `function foo() { yield from ["a"]; yield from ["b"]; }`). It only matters when consuming such iterator with key-value context, because set of yielded keys may be changed after applying this rule.'
);
}

public function isRisky(): bool
{
return true;
}

public function isCandidate(Tokens $tokens): bool
{
return $tokens->isTokenKindFound(T_YIELD_FROM);
Expand Down Expand Up @@ -140,6 +148,11 @@ private function getYieldsFromToUnpack(Tokens $tokens): iterable
$endIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_ARRAY_SQUARE_BRACE, $startIndex);
}

// is there empty "yield from []" ?
if ($endIndex === $tokens->getNextMeaningfulToken($startIndex)) {
continue;
}

// is there any nested "yield from"?
if ([] !== $tokens->findGivenKind(T_YIELD_FROM, $startIndex, $endIndex)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private function sortAlphabetically(array $first, array $second): int
$firstNamespace = str_replace('\\', ' ', $this->prepareNamespace($first['namespace']));
$secondNamespace = str_replace('\\', ' ', $this->prepareNamespace($second['namespace']));

return $this->configuration['case_sensitive']
return true === $this->configuration['case_sensitive']
? strcmp($firstNamespace, $secondNamespace)
: strcasecmp($firstNamespace, $secondNamespace);
}
Expand All @@ -310,7 +310,7 @@ private function sortByLength(array $first, array $second): int
$secondNamespaceLength = \strlen($secondNamespace);

if ($firstNamespaceLength === $secondNamespaceLength) {
$sortResult = $this->configuration['case_sensitive']
$sortResult = true === $this->configuration['case_sensitive']
? strcmp($firstNamespace, $secondNamespace)
: strcasecmp($firstNamespace, $secondNamespace);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ final class PhpUnitTargetVersion
public const VERSION_8_4 = '8.4';
public const VERSION_NEWEST = 'newest';

private function __construct()
{
}
private function __construct() {}

public static function fulfills(string $candidate, string $target): bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@
*
* @internal
*/
final class InvalidOptionsForEnvException extends InvalidOptionsException
{
}
final class InvalidOptionsForEnvException extends InvalidOptionsException {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@
*
* @TODO 4.0 make class "final"
*/
class LintingException extends \RuntimeException
{
}
class LintingException extends \RuntimeException {}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@
*
* @TODO 4.0 make class "final"
*/
class UnavailableLinterException extends \RuntimeException
{
}
class UnavailableLinterException extends \RuntimeException {}
4 changes: 1 addition & 3 deletions vendor/friendsofphp/php-cs-fixer/src/PregException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@
*
* @internal
*/
final class PregException extends \RuntimeException
{
}
final class PregException extends \RuntimeException {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
*/
abstract class AbstractRuleSetDescription implements RuleSetDescriptionInterface
{
public function __construct()
{
}
public function __construct() {}

public function getName(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function getRules(): array
'static_lambda' => true,
'strict_comparison' => true,
'strict_param' => true,
'yield_from_array_to_yields' => true,
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ public function getRules(): array
'return_assignment' => true,
'self_static_accessor' => true,
'single_line_comment_style' => true,
'single_line_empty_body' => true,
'single_line_throw' => false,
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'yield_from_array_to_yields' => true,
];
}

Expand Down
8 changes: 2 additions & 6 deletions vendor/friendsofphp/php-cs-fixer/src/StdinFileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ public function openFile($openMode = 'r', $useIncludePath = false, $context = nu
throw new \BadMethodCallException(sprintf('Method "%s" is not implemented.', __METHOD__));
}

public function setFileClass($className = null): void
{
}
public function setFileClass($className = null): void {}

public function setInfoClass($className = null): void
{
}
public function setInfoClass($className = null): void {}
}
4 changes: 1 addition & 3 deletions vendor/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ final class CT
public const T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_OPEN = 10038;
public const T_DYNAMIC_CLASS_CONSTANT_FETCH_CURLY_BRACE_CLOSE = 10039;

private function __construct()
{
}
private function __construct() {}

/**
* Get name for custom token.
Expand Down

0 comments on commit 6bb9786

Please sign in to comment.