-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
docs: Add supported PHP versions section to the README #6768
Merged
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b69c30a
Add supported PHP versions section to the README
bocharsky-bw a8cebca
Add a note about supporting the project
bocharsky-bw 7910bf5
Test supported PHP versions change
bocharsky-bw bf3eeee
Supported versions -> supported PHP versions
bocharsky-bw 40891b5
Apply PHP CS Fixer suggestions
bocharsky-bw 36a80fa
Use fancy GitHub note feature
bocharsky-bw 632ff0a
Mention PHP_CS_FIXER_IGNORE_ENV in the supported versions section
bocharsky-bw c8805d2
Move the PHP_CS_FIXER_IGNORE_ENV part to the note
bocharsky-bw cc14799
Use relative link to the docs instead of external
bocharsky-bw ba73f33
Fix link to the usage.rst doc page
bocharsky-bw 121f749
RPs -> PRs
bocharsky-bw 33bcb22
Improve error message
bocharsky-bw File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of PHP CS Fixer. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* Dariusz Rumiński <dariusz.ruminski@gmail.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace PhpCsFixer\Tests\AutoReview; | ||
|
||
use PhpCsFixer\Tests\TestCase; | ||
|
||
/** | ||
* @author Victor Bocharsky <bocharsky.bw@gmail.com> | ||
* | ||
* @internal | ||
* | ||
* @coversNothing | ||
* | ||
* @group auto-review | ||
* @group covers-nothing | ||
*/ | ||
final class ReadmeTest extends TestCase | ||
{ | ||
public function testSupportedPhpVersions(): void | ||
{ | ||
$phpVersionIdLines = []; | ||
|
||
$file = new \SplFileObject(__DIR__.'/../../php-cs-fixer'); | ||
while (!$file->eof()) { | ||
$line = $file->fgets(); | ||
if (str_contains($line, 'PHP_VERSION_ID')) { | ||
$phpVersionIdLines[] = $line; | ||
} | ||
} | ||
// Unset the file to call __destruct(), closing the file handle. | ||
$file = null; | ||
|
||
static::assertEqualsCanonicalizing([ | ||
' if (\PHP_VERSION_ID === 80000) {'."\n", | ||
' if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80200) {'."\n", | ||
], $phpVersionIdLines, 'Seems supported PHP versions changed in "./php-cs-fixer" - edit the README.md to match them!'); | ||
bocharsky-bw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can put some guard (eg in
tests/AutoReview/
) to make sure that this list is up to date ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, it would be cool, I'll try to look at it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 7910bf5 should be enough to notice any change in supported PHP versions