Skip to content

Commit

Permalink
Merge branch '2.12' into is-constant-invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Jul 4, 2018
2 parents 8015721 + a008ddb commit 6f59526
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -44,7 +44,7 @@
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1",
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
"phpunitgoodpractices/traits": "^1.5",
"phpunitgoodpractices/traits": "^1.5.1",
"symfony/phpunit-bridge": "^4.0"
},
"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php
Expand Up @@ -128,8 +128,8 @@ public function isCandidate(Tokens $tokens)
public function getPriority()
{
// should be run after PhpdocScalarFixer.
// should be run before ReturnTypeDeclarationFixer, FullyQualifiedStrictTypesFixer.
return 1;
// should be run before ReturnTypeDeclarationFixer, FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer.
return 8;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Tokenizer/Token.php
Expand Up @@ -318,7 +318,7 @@ public static function getKeywords()
'T_INTERFACE', 'T_ISSET', 'T_LIST', 'T_LOGICAL_AND', 'T_LOGICAL_OR', 'T_LOGICAL_XOR',
'T_NAMESPACE', 'T_NEW', 'T_PRINT', 'T_PRIVATE', 'T_PROTECTED', 'T_PUBLIC', 'T_REQUIRE',
'T_REQUIRE_ONCE', 'T_RETURN', 'T_STATIC', 'T_SWITCH', 'T_THROW', 'T_TRAIT', 'T_TRY',
'T_UNSET', 'T_USE', 'T_VAR', 'T_WHILE', 'T_YIELD',
'T_UNSET', 'T_USE', 'T_VAR', 'T_WHILE', 'T_YIELD', 'T_YIELD_FROM',
]) + [
CT::T_ARRAY_TYPEHINT => CT::T_ARRAY_TYPEHINT,
CT::T_CLASS_CONSTANT => CT::T_CLASS_CONSTANT,
Expand Down
4 changes: 1 addition & 3 deletions tests/AutoReview/FixerFactoryTest.php
Expand Up @@ -183,8 +183,8 @@ public function provideFixersPriorityCases()
[$fixers['phpdoc_to_comment'], $fixers['no_empty_comment']],
[$fixers['phpdoc_to_comment'], $fixers['phpdoc_no_useless_inheritdoc']],
[$fixers['phpdoc_to_return_type'], $fixers['fully_qualified_strict_types']],
[$fixers['phpdoc_to_return_type'], $fixers['no_superfluous_phpdoc_tags']],
[$fixers['phpdoc_to_return_type'], $fixers['return_type_declaration']],
[$fixers['phpdoc_var_without_name'], $fixers['phpdoc_trim']],
[$fixers['pow_to_exponentiation'], $fixers['binary_operator_spaces']],
[$fixers['pow_to_exponentiation'], $fixers['method_argument_space']],
[$fixers['pow_to_exponentiation'], $fixers['native_function_casing']],
Expand Down Expand Up @@ -276,15 +276,13 @@ public function testFixersPriorityPairsHaveIntegrationTest(FixerInterface $first
'method_separation,indentation_type.test',
'no_empty_statement,multiline_whitespace_before_semicolons.test',
'no_empty_statement,no_multiline_whitespace_before_semicolons.test',
'no_empty_statement,no_singleline_whitespace_before_semicolons.test',
'phpdoc_no_access,phpdoc_order.test',
'phpdoc_no_access,phpdoc_separation.test',
'phpdoc_no_package,phpdoc_order.test',
'phpdoc_order,phpdoc_separation.test',
'phpdoc_order,phpdoc_trim.test',
'phpdoc_separation,phpdoc_trim.test',
'phpdoc_summary,phpdoc_trim.test',
'phpdoc_var_without_name,phpdoc_trim.test',
];

$integrationTestExists = $this->doesIntegrationTestExist($first, $second);
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Integration/misc/PHP7.test
Expand Up @@ -205,7 +205,7 @@ class Foo implements FooInterface
yield 1;

// generator delegation
yield from $this->gen2();
yield FROM $this->gen2();
}

public function gen2()
Expand Down
@@ -0,0 +1,9 @@
--TEST--
Integration of fixers: no_empty_statement,no_singleline_whitespace_before_semicolons.
--RULESET--
{"no_empty_statement": true, "no_singleline_whitespace_before_semicolons": true}
--EXPECT--
<?php /**/ //

--INPUT--
<?php ; /**/ ;//
@@ -0,0 +1,28 @@
--TEST--
Integration of fixers: phpdoc_to_return_type,no_superfluous_phpdoc_tags.
--RULESET--
{"phpdoc_to_return_type": true, "no_superfluous_phpdoc_tags": true}
--REQUIREMENTS--
{"php": 70000}
--EXPECT--
<?php

class Test {
/**
*/
public function foo(): int {
return 1;
}
}

--INPUT--
<?php

class Test {
/**
* @return int
*/
public function foo() {
return 1;
}
}

0 comments on commit 6f59526

Please sign in to comment.