Просмотр исходного кода

Add PHP version check and some feedback to the user, list requirements in readme

Seb Koelen 10 лет назад
Родитель
Сommit
b18d612ee0
2 измененных файлов с 11 добавлено и 1 удалено
  1. 6 1
      README.rst
  2. 5 0
      php-cs-fixer

+ 6 - 1
README.rst

@@ -9,10 +9,15 @@ If you are already using ``PHP_CodeSniffer`` to identify coding standards
 problems in your code, you know that fixing them by hand is tedious, especially
 on large projects. This tool does the job for you.
 
+Requirements
+------------
+
+PHP needs to be a minimum version of PHP 5.3.6
+
 Installation
 ------------
 
-Locally
+Locally 
 ~~~~~~~
 
 Download the `php-cs-fixer.phar`_ file and store it somewhere on your computer.

+ 5 - 0
php-cs-fixer

@@ -14,6 +14,11 @@
  * @author Fabien Potencier <fabien@symfony.com>
  */
 
+if (version_compare(phpversion(), '5.3.6', '<')) {
+    echo "PHP needs to be a minimum version of PHP 5.3.6\n";
+    exit(1);
+}
+
 // installed via composer?
 if (file_exists($a = __DIR__.'/../../autoload.php')) {
     require_once $a;