        (if other-opts other-opts "")))
     ))
 
+(defvar php-cs-fixer-command-not-found-msg "Command php-cs-fixer not found.
+Fix this issue removing the Emacs package php-cs-fixer or installing the program php-cs-fixer")
+
+(defvar php-cs-fixer-command-bad-version-msg "Command php-cs-fixer version not supported.
+Fix this issue removing the Emacs package php-cs-fixer or updating the program php-cs-fixer to version 2.*")
+
+(defvar php-cs-fixer-is-command-ok-var nil)
+
+(defun php-cs-fixer--is-command-ok ()
+  "Private Method.
+Return t if the command `php-cs-fixer-command`
+is available and supported by this package,  return nil otherwise.
+The test is done at first call and the same result will returns
+for the next calls."
+  (if php-cs-fixer-is-command-ok-var
+      (= 1 php-cs-fixer-is-command-ok-var)
+    (progn
+      (message "Testing php-cs-fixer existence and version...")
+      (setq php-cs-fixer-is-command-ok-var 0)
+
+      (if (executable-find "php-cs-fixer")
+          (if (string-match ".+ 2.[0-9]+.*"
+                            (shell-command-to-string
+                             (concat php-cs-fixer-command " --version")))
+              (progn (setq php-cs-fixer-is-command-ok-var 1) t)
+            (progn
+              (warn php-cs-fixer-command-bad-version-msg)
+              nil))
+        (progn (warn php-cs-fixer-command-not-found-msg) nil)
+        ))))
+
 ;;;###autoload
-(defun php-cs-fix ()
+(defun php-cs-fixer-fix ()
   "Formats the current PHP buffer according to the PHP-CS-Fixer tool."
   (interactive)
-  (let ((tmpfile (make-temp-file "PHP-CS-Fixer" nil ".php"))
-        (patchbuf (get-buffer-create "*PHP-CS-Fixer patch*"))
-        (errbuf (get-buffer-create "*PHP-CS-Fixer Errors*"))
-        (coding-system-for-read 'utf-8)
-        (coding-system-for-write 'utf-8))
-
-    (save-restriction
-      (widen)
-      (if errbuf
-          (with-current-buffer errbuf
-            (setq buffer-read-only nil)
-            (erase-buffer)))
-      (with-current-buffer patchbuf
-        (erase-buffer))
-
-      (write-region nil nil tmpfile)
-
-      ;; We're using errbuf for the mixed stdout and stderr output. This
-      ;; is not an issue because  php-cs-fixer -q does not produce any stdout
-      ;; output in case of success.
-      (if (zerop (call-process "php" nil errbuf nil "-l" tmpfile))
-          (progn
-            (call-process php-cs-fixer-command
-                          nil errbuf nil
-                          "fix"
-                          (php-cs-fixer-build-rules-options)
-                          (if php-cs-config-option
-                              (concat "--config=" (shell-quote-argument php-cs-config-option)) "")
-                          "--using-cache=no"
-                          "--quiet"
-                          tmpfile)
-            (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
-                (message "Buffer is already php-cs-fixed")
-              (php-cs-fixer--apply-rcs-patch patchbuf)
-              (message "Applied php-cs-fixer")))
-        (warn (with-current-buffer errbuf (buffer-string)))))
-
-    (php-cs-fixer--kill-error-buffer errbuf)
-    (kill-buffer patchbuf)
-    (delete-file tmpfile)))
-
-(defvar php-cs-fixer-command-not-found-msg "Package php-cs-fixer loaded but command line php-cs-fixer not found.
-Fix this issue removing the Emacs package php-cs-fixer or installing the program php-cs-fixer")
+
+  (when (php-cs-fixer--is-command-ok)
+    (let ((tmpfile (make-temp-file "PHP-CS-Fixer" nil ".php"))
+          (patchbuf (get-buffer-create "*PHP-CS-Fixer patch*"))
+          (errbuf (get-buffer-create "*PHP-CS-Fixer Errors*"))
+          (coding-system-for-read 'utf-8)
+          (coding-system-for-write 'utf-8))
+
+      (save-restriction
+        (widen)
+        (if errbuf
+            (with-current-buffer errbuf
+              (setq buffer-read-only nil)
+              (erase-buffer)))
+        (with-current-buffer patchbuf
+          (erase-buffer))
+
+        (write-region nil nil tmpfile)
+
+        ;; We're using errbuf for the mixed stdout and stderr output. This
+        ;; is not an issue because  php-cs-fixer -q does not produce any stdout
+        ;; output in case of success.
+        (if (zerop (call-process "php" nil errbuf nil "-l" tmpfile))
+            (progn
+              (call-process php-cs-fixer-command
+                            nil errbuf nil
+                            "fix"
+                            (if php-cs-config-option
+                                (concat "--config=" (shell-quote-argument php-cs-config-option))
+                              (php-cs-fixer--build-rules-options))
+                            "--using-cache=no"
+                            "--quiet"
+                            tmpfile)
+              (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
+                  (message "Buffer is already php-cs-fixed")
+                (php-cs-fixer--apply-rcs-patch patchbuf)
+                (message "Applied php-cs-fixer")))
+          (warn (with-current-buffer errbuf (buffer-string)))))
+
+      (php-cs-fixer--kill-error-buffer errbuf)
+      (kill-buffer patchbuf)
+      (delete-file tmpfile))))
 
 ;;;###autoload
 (defun php-cs-fixer-before-save ()

;;; php-cs-fixer.el --- php-cs-fixer <https://github.com/FriendsOfPHP/PHP-CS-Fixer> wrapper for the Emacs editor.

;;; License:
;; Copyright 2015 OVYA (Renée Costes Viager Group). All rights reserved.
;; Use of this source code is governed by a BSD-style
;; license that can be found in the LICENSE file.


        (quit-window t win)
      (kill-buffer errbuf))))

(defun php-cs-fixer--build-rules-options ()
  "Private method to build the --rules options."
  (if php-cs-config-option ""
    (let ((base-opts
