Browse Source

minor #6060 DX: Add upgrade guide link when next Major is available (keradus)

This PR was squashed before being merged into the 2.19 branch.

Discussion
----------

DX: Add upgrade guide link when next Major is available

inspired by https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5696#issuecomment-938523856

just asking for opinions about this idea.

if you like it, I will adjust the tests

Commits
-------

b607104e8 DX: Add upgrade guide link when next Major is available
Dariusz Ruminski 3 years ago
parent
commit
29691a1625
2 changed files with 2 additions and 0 deletions
  1. 1 0
      src/Console/WarningsDetector.php
  2. 1 0
      tests/Smoke/CiIntegrationTest.php

+ 1 - 0
src/Console/WarningsDetector.php

@@ -42,6 +42,7 @@ final class WarningsDetector
         $currentMajorVersion = \intval(explode('.', Application::VERSION)[0], 10);
         $nextMajorVersion = $currentMajorVersion + 1;
         $this->warnings[] = "You are running PHP CS Fixer v{$currentMajorVersion}, which is not maintained anymore. Please update to v{$nextMajorVersion}.";
+        $this->warnings[] = "You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v{$nextMajorVersion}.3.0/UPGRADE-v{$nextMajorVersion}.md .";
     }
 
     public function detectOldVendor()

+ 1 - 0
tests/Smoke/CiIntegrationTest.php

@@ -141,6 +141,7 @@ final class CiIntegrationTest extends AbstractSmokeTest
         ]);
 
         $optionalDeprecatedVersionWarning = 'You are running PHP CS Fixer v2, which is not maintained anymore. Please update to v3.
+You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.3.0/UPGRADE-v3.md .
 ';
 
         $optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 5.6.0 and maximum version of PHP 7.4.*.