Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump friendsofphp/php-cs-fixer from 3.34.0 to 3.35.1 #134

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.5",
"friendsofphp/php-cs-fixer": "3.34.0",
"friendsofphp/php-cs-fixer": "3.35.1",
"redaxo/php-cs-fixer-config": "^1.0"
},
"config": {
Expand Down
19 changes: 7 additions & 12 deletions composer.lock

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

2 changes: 2 additions & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
'PhpCsFixer\\FixerConfiguration\\FixerOption' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php',
'PhpCsFixer\\FixerConfiguration\\FixerOptionBuilder' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php',
'PhpCsFixer\\FixerConfiguration\\FixerOptionInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php',
'PhpCsFixer\\FixerConfiguration\\FixerOptionSorter' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php',
'PhpCsFixer\\FixerConfiguration\\InvalidOptionsForEnvException' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php',
'PhpCsFixer\\FixerDefinition\\CodeSample' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php',
'PhpCsFixer\\FixerDefinition\\CodeSampleInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSampleInterface.php',
Expand Down Expand Up @@ -213,6 +214,7 @@
'PhpCsFixer\\Fixer\\ClassNotation\\OrderedInterfacesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\OrderedTraitsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\OrderedTypesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\PhpdocReadonlyClassCommentToKeywordFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\ProtectedToPrivateFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\SelfAccessorFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\SelfStaticAccessorFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php',
Expand Down
2 changes: 2 additions & 0 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\FixerConfiguration\\FixerOption' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOption.php',
'PhpCsFixer\\FixerConfiguration\\FixerOptionBuilder' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionBuilder.php',
'PhpCsFixer\\FixerConfiguration\\FixerOptionInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionInterface.php',
'PhpCsFixer\\FixerConfiguration\\FixerOptionSorter' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/FixerOptionSorter.php',
'PhpCsFixer\\FixerConfiguration\\InvalidOptionsForEnvException' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerConfiguration/InvalidOptionsForEnvException.php',
'PhpCsFixer\\FixerDefinition\\CodeSample' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSample.php',
'PhpCsFixer\\FixerDefinition\\CodeSampleInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FixerDefinition/CodeSampleInterface.php',
Expand Down Expand Up @@ -371,6 +372,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\ClassNotation\\OrderedInterfacesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\OrderedTraitsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\OrderedTypesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\PhpdocReadonlyClassCommentToKeywordFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/PhpdocReadonlyClassCommentToKeywordFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\ProtectedToPrivateFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\SelfAccessorFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php',
'PhpCsFixer\\Fixer\\ClassNotation\\SelfStaticAccessorFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfStaticAccessorFixer.php',
Expand Down
19 changes: 7 additions & 12 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.34.0",
"version_normalized": "3.34.0.0",
"version": "v3.35.1",
"version_normalized": "3.35.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "7c7a4ad2ed8fe50df3e25528218b13d383608f23"
"reference": "ec1ccc264994b6764882669973ca435cf05bab08"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7c7a4ad2ed8fe50df3e25528218b13d383608f23",
"reference": "7c7a4ad2ed8fe50df3e25528218b13d383608f23",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ec1ccc264994b6764882669973ca435cf05bab08",
"reference": "ec1ccc264994b6764882669973ca435cf05bab08",
"shasum": ""
},
"require": {
Expand All @@ -260,9 +260,6 @@
"symfony/process": "^5.4 || ^6.0",
"symfony/stopwatch": "^5.4 || ^6.0"
},
"conflict": {
"stevebauman/unfinalize": "*"
},
"require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0",
"justinrainbow/json-schema": "^5.2",
Expand All @@ -275,16 +272,14 @@
"phpspec/prophecy": "^1.16",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"phpunitgoodpractices/polyfill": "^1.6",
"phpunitgoodpractices/traits": "^1.9.2",
"symfony/phpunit-bridge": "^6.2.3",
"symfony/yaml": "^5.4 || ^6.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters."
},
"time": "2023-09-29T15:34:26+00:00",
"time": "2023-10-12T13:47:26+00:00",
"bin": [
"php-cs-fixer"
],
Expand Down Expand Up @@ -318,7 +313,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.34.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.35.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' => '1693b1913160c64c632da1e9384b6a005898bc5e',
'reference' => '751cecfb121f04bc07ddec2e227c0cc1bba81278',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '1693b1913160c64c632da1e9384b6a005898bc5e',
'reference' => '751cecfb121f04bc07ddec2e227c0cc1bba81278',
'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.34.0',
'version' => '3.34.0.0',
'reference' => '7c7a4ad2ed8fe50df3e25528218b13d383608f23',
'pretty_version' => 'v3.35.1',
'version' => '3.35.1.0',
'reference' => 'ec1ccc264994b6764882669973ca435cf05bab08',
'type' => 'application',
'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer',
'aliases' => array(),
Expand Down
25 changes: 25 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,31 @@ CHANGELOG for PHP CS Fixer

This file contains changelogs for stable releases only.

Changelog for v3.35.1
---------------------

* fix: Mark `PhpdocReadonlyClassCommentToKeywordFixer` as risky (#7372)

Changelog for v3.35.0
---------------------

* chore: Autoreview: test all formats are listed in `usage.rst` (#7357)
* chore: no need for `phpunitgoodpractices/traits` anymore (#7362)
* chore: Rename `indexes` to `indices` (#7368)
* chore: stop using `phpunitgoodpractices/traits` (#7363)
* chore: typo (#7367)
* docs: Sort options in documentation (#7345)
* feat(PhpdocReadonlyClassCommentToKeywordFixer): Introduction (#7353)
* feat: Ability to keep/enforce leading `\` when in global namespace (#7186)
* feat: Update `@PER-CS2.0` to match short closure space (#6970)
* feat: use `ordered_types` in `@PhpCsFixer` (#7361)
* fix(SingleLineThrowFixer): fixer goes out of range on close tag (#7369)

Changelog for v3.34.1
---------------------

* deps: revert "prevent using PHPCSFixer along with unfinalize package (#7343)" (#7348)

Changelog for v3.34.0
---------------------

Expand Down
5 changes: 0 additions & 5 deletions vendor/friendsofphp/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,9 @@
"phpspec/prophecy": "^1.16",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"phpunitgoodpractices/polyfill": "^1.6",
"phpunitgoodpractices/traits": "^1.9.2",
"symfony/phpunit-bridge": "^6.2.3",
"symfony/yaml": "^5.4 || ^6.0"
},
"conflict": {
"stevebauman/unfinalize": "*"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters."
Expand Down
4 changes: 2 additions & 2 deletions vendor/friendsofphp/php-cs-fixer/src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
*/
final class Application extends BaseApplication
{
public const VERSION = '3.34.0';
public const VERSION_CODENAME = 'BerSzcz Saturnalia';
public const VERSION = '3.35.1';
public const VERSION_CODENAME = 'Freezy Vrooom';

private ToolInfo $toolInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ public function getListingFilePath(): string
{
return $this->path.'/list.rst';
}

public function getUsageFilePath(): string
{
return $this->path.'/usage.rst';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php

declare(strict_types=1);

/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiński <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Fixer\ClassNotation;

use PhpCsFixer\AbstractFixer;
use PhpCsFixer\DocBlock\DocBlock;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
use PhpCsFixer\FixerDefinition\VersionSpecification;
use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;

/**
* @author Marcel Behrmann <[email protected]>
*/
final class PhpdocReadonlyClassCommentToKeywordFixer extends AbstractFixer
{
/**
* {@inheritdoc}
*
* Must run before NoEmptyPhpdocFixer, NoExtraBlankLinesFixer, PhpdocAlignFixer.
* Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer.
*/
public function getPriority(): int
{
return 4;
}

public function isCandidate(Tokens $tokens): bool
{
return \PHP_VERSION_ID >= 8_02_00 && $tokens->isTokenKindFound(T_DOC_COMMENT);
}

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

public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
'Converts readonly comment on classes to the readonly keyword.',
[
new VersionSpecificCodeSample(
<<<EOT
<?php
/** @readonly */
class C {
}\n
EOT,
new VersionSpecification(8_02_00)
),
],
null,
'If classes marked with `@readonly` annotation were extended anyway, applying this fixer may break the inheritance for their child classes.'
);
}

protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
{
foreach ($tokens as $index => $token) {
if (!$token->isGivenKind(T_DOC_COMMENT)) {
continue;
}

$doc = new DocBlock($token->getContent());

$annotations = $doc->getAnnotationsOfType('readonly');

if (0 === \count($annotations)) {
continue;
}

foreach ($annotations as $annotation) {
$annotation->remove();
}

$mainIndex = $index;
$index = $tokens->getNextMeaningfulToken($index);
$addReadonly = true;

while ($tokens[$index]->isGivenKind([
T_ABSTRACT,
T_FINAL,
T_PRIVATE,
T_PUBLIC,
T_PROTECTED,
T_READONLY,
])) {
if ($tokens[$index]->isGivenKind([T_READONLY])) {
$addReadonly = false;
}

$index = $tokens->getNextMeaningfulToken($index);
}

if (!$tokens[$index]->isGivenKind(T_CLASS)) {
continue;
}

if ($addReadonly) {
$tokens->insertAt($index, [new Token([T_READONLY, 'readonly']), new Token([T_WHITESPACE, ' '])]);
}

$newContent = $doc->getContent();

if ('' === $newContent) {
$tokens->clearTokenAndMergeSurroundingWhitespace($mainIndex);

continue;
}

$tokens[$mainIndex] = new Token([T_DOC_COMMENT, $doc->getContent()]);
}
}
}
Loading
Loading