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
DX: Tokens::insertSlices - groom code and fix tests #6172
Closed
Closed
Changes from all commits
Commits
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
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 |
---|---|---|
|
@@ -1387,8 +1387,7 @@ public function testInsertSlicesAtMultiplePlaces(string $expected, array $slices | |
16 => $slices, | ||
6 => $slices, | ||
]); | ||
|
||
static::assertSame($expected, $tokens->generateCode()); | ||
static::assertTokens(Tokens::fromCode($expected), $tokens); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
public function provideInsertSlicesAtMultiplePlacesCases(): \Generator | ||
|
@@ -1397,11 +1396,11 @@ public function provideInsertSlicesAtMultiplePlacesCases(): \Generator | |
<<<'EOF' | ||
<?php | ||
|
||
$after = get_class($after); | ||
$before = get_class($before); | ||
$after = /*foo*/get_class($after); | ||
$before = /*foo*/get_class($before); | ||
EOF | ||
, | ||
[new Token([T_WHITESPACE, ' '])], | ||
[new Token([T_COMMENT, '/*foo*/'])], | ||
]; | ||
|
||
yield 'two slice count' => [ | ||
|
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.
this is very much of value as test pass locally but not on gitlab, knowing the PHP version including patch
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 don't think we should add
php -v
before each PHP command. and if so, putting it in one place is enough.And we have it https://github.com/FriendsOfPHP/PHP-CS-Fixer/runs/4521649824?check_suite_focus=true#step:4:15
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.
It is not for each PHP command is it? only for unique phpunit runs.
If you see no value in having the build details than sure remove it.
It will likely be part of each draft PR in the future that want to do fixes for upcoming PHP version so the author knows the build details of nightly builds etc.
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.
@SpacePossum , all commands within single build are using the same PHP installation. so yes, you can scroll to top of log of given build to see exact PHP version
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 don't understand;
https://github.com/FriendsOfPHP/PHP-CS-Fixer/runs/4516979071?check_suite_focus=true
shows the PHP version PHPUnit is going to use one time,
than here;
https://github.com/FriendsOfPHP/PHP-CS-Fixer/runs/4516979363?check_suite_focus=true
shows the PHP version PHPUnit is going to use one time,
how is this
before each PHP command
?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.
vs.
it is not the same, the second shows more, which is especially handy when running on nightly build.
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.
each job starts with
Setup PHP
, then each command within this job is using it.For example you showed, I don't see anything different. For nightly build, I would love to see example.
If adding
php -v
at all, I believe we should not put it inside PHPUnit step, but make a dedicated step likePHP info
afterSetup PHP
step.