Skip to content

Commit

Permalink
Merge branch '2.15' into 2.16
Browse files Browse the repository at this point in the history
* 2.15:
  DX: move report schemas to dedicated dir
  rename doc -> doc.php
  fix false-positive
  CICD - temporarily disable problematic test
  DX: cleanup php-cs-fixer entry file
  Add © for logo
  DX: cleanup NullableTypeTransformerTest
  • Loading branch information
SpacePossum committed Oct 27, 2020
2 parents 72b3ac1 + 7996eea commit ad3cb59
Show file tree
Hide file tree
Showing 19 changed files with 18 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $finder = PhpCsFixer\Finder::create()
->exclude('tests/Fixtures')
->in(__DIR__)
->append([
__DIR__.'/dev-tools/doc',
__DIR__.'/dev-tools/doc.php',
__DIR__.'/php-cs-fixer',
])
;
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Symfony projects for instance).
* If you are adding functionality or fixing a bug - add a test! Prefer adding new test cases over modifying existing ones.
* Make sure there is no wrong file permissions in the repository: `./dev-tools/check_file_permissions.sh`.
* Make sure there is no trailing spaces in the code: `./dev-tools/check_trailing_spaces.sh`.
* Update documentation: `php dev-tools/doc`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker run -it --rm --user="$(id -u):$(id -g)" -w="/app" --volume="$(pwd):/app" php:7.4-cli php dev-tools/doc`.
* Update documentation: `php dev-tools/doc.php`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker run -it --rm --user="$(id -u):$(id -g)" -w="/app" --volume="$(pwd):/app" php:7.4-cli php dev-tools/doc.php`.
* Install dev tools: `dev-tools/install.sh`
* Run static analysis using PHPStan: `php -d memory_limit=256M dev-tools/vendor/bin/phpstan analyse`
* Check if tests pass: `vendor/bin/phpunit`.
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/check_file_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ files_with_wrong_permissions=$(
git ls-files --stage . \
':!*.sh' \
':!php-cs-fixer' \
| grep -P "100\d\d(1|3|5|7) " \
| grep -P "^100\d\d(1|3|5|7) " \
| sort -fh
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/cookbook_fixers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Execute the following command in your command shell:

.. code-block:: console
$ php dev-tools/doc
$ php dev-tools/doc.php
Next, we must filter what type of tokens we want to fix. Here, we are interested in code that contains ``T_COMMENT`` tokens:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ The ``--format`` option for the output format. Supported formats are ``txt`` (de

NOTE: the output for the following formats are generated in accordance with XML schemas

* ``junit`` follows the `JUnit xml schema from Jenkins </doc/junit-10.xsd>`_
* ``checkstyle`` follows the common `"checkstyle" xml schema </doc/checkstyle.xsd>`_
* ``checkstyle`` follows the common `"checkstyle" xml schema </doc/report-schema/checkstyle.xsd>`_
* ``junit`` follows the `JUnit xml schema from Jenkins </doc/report-schema/junit-10.xsd>`_

The ``--quiet`` Do not output any message.

Expand Down
3 changes: 3 additions & 0 deletions logo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The logo is © 2010-2014 Sensio Labs.

Original resolution can be found at https://github.com/PHP-CS-Fixer/logo .
5 changes: 1 addition & 4 deletions php-cs-fixer
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ if (defined('HHVM_VERSION_ID')) {
} else {
exit(1);
}
} elseif (
(!defined('PHP_VERSION_ID') || \PHP_VERSION_ID < 50600 || \PHP_VERSION_ID >= 70500)
&& (!isset($_SERVER['argv'][1]) || 'documentation' !== $_SERVER['argv'][1])
) {
} elseif (!defined('PHP_VERSION_ID') || \PHP_VERSION_ID < 50600 || \PHP_VERSION_ID >= 70500) {
fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.6.0 and maximum version of PHP 7.4.*.\n");

if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Command/HelpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public static function getHelpCopy()
NOTE: the output for the following formats are generated in accordance with XML schemas
* `junit` follows the `JUnit xml schema from Jenkins </doc/junit-10.xsd>`_
* `checkstyle` follows the common `"checkstyle" xml schema </doc/checkstyle.xsd>`_
* `checkstyle` follows the common `"checkstyle" xml schema </doc/report-schema/checkstyle.xsd>`_
* `junit` follows the `JUnit xml schema from Jenkins </doc/report-schema/junit-10.xsd>`_
The <comment>--quiet</comment> Do not output any message.
Expand Down
2 changes: 2 additions & 0 deletions tests/AutoReview/DocumentationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ final class DocumentationTest extends TestCase
*/
public function testFixerDocumentationFileIsUpToDate(FixerInterface $fixer)
{
static::markTestIncomplete('Define whether this test brings value and drop it or fix it - https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5209 .');

$generator = new DocumentationGenerator();

$path = $generator->getFixerDocumentationFilePath($fixer);
Expand Down
2 changes: 1 addition & 1 deletion tests/Report/CheckstyleReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class CheckstyleReporterTest extends AbstractReporterTestCase

public static function setUpBeforeClass()
{
self::$xsd = file_get_contents(__DIR__.'/../../doc/checkstyle.xsd');
self::$xsd = file_get_contents(__DIR__.'/../../doc/report-schema/checkstyle.xsd');
}

public static function tearDownAfterClass()
Expand Down
2 changes: 1 addition & 1 deletion tests/Report/JsonReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function assertFormat($expected, $input)
*/
private static function assertJsonSchema($json)
{
$jsonPath = __DIR__.'/../../doc/schema.json';
$jsonPath = __DIR__.'/../../doc/report-schema/schema.json';

$data = json_decode($json);

Expand Down
2 changes: 1 addition & 1 deletion tests/Report/JunitReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function setUpBeforeClass()
{
parent::setUpBeforeClass();

self::$xsd = file_get_contents(__DIR__.'/../../doc/junit-10.xsd');
self::$xsd = file_get_contents(__DIR__.'/../../doc/report-schema/junit-10.xsd');
}

public static function tearDownAfterClass()
Expand Down
2 changes: 1 addition & 1 deletion tests/Report/XmlReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function setUpBeforeClass()
{
parent::setUpBeforeClass();

self::$xsd = file_get_contents(__DIR__.'/../../doc/xml.xsd');
self::$xsd = file_get_contents(__DIR__.'/../../doc/report-schema/xml.xsd');
}

public static function tearDownAfterClass()
Expand Down
23 changes: 0 additions & 23 deletions tests/Tokenizer/Transformer/NullableTypeTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,6 @@ public function provideProcess74Cases()
9 => CT::T_NULLABLE_TYPE,
],
],
];
}

/**
* @param string $source
*
* @dataProvider provideProcessPhp74Cases
* @requires PHP 7.4
*/
public function testProcessPhp74($source, array $expectedTokens = [])
{
$this->doTest(
$source,
$expectedTokens,
[
CT::T_NULLABLE_TYPE,
]
);
}

public function provideProcessPhp74Cases()
{
return [
[
'<?php fn(?Barable $barA, ?Barable $barB): ?Fooable => null;',
[
Expand Down

0 comments on commit ad3cb59

Please sign in to comment.