Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let phpstan-executable be absolute path to phpstan #7

Merged
merged 1 commit into from
May 3, 2018

Conversation

kermorgant
Copy link
Contributor

I'll let you see if this is a good way to handle this use case, but adding this line let me link phpstan-executable to the absolute path of phpstan.

Otherwise, it was ignored : #6

I'll let you see if this is a good way to handle this use case, but adding this line let me link phpstan-executable to the absolute path of phpstan.

Otherwise, it was ignored : emacs-php#6
@@ -218,6 +218,7 @@ it returns the value of `SOURCE' as it is."
(defun phpstan-get-executable ()
"Return PHPStan excutable file and arguments."
(cond
((file-exists-p phpstan-executable) (list phpstan-executable))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to fix this fix as follows.

diff --git a/phpstan.el b/phpstan.el
index 5c9e9d9..e332012 100644
--- a/phpstan.el
+++ b/phpstan.el
@@ -218,7 +218,6 @@ it returns the value of `SOURCE' as it is."
 (defun phpstan-get-executable ()
   "Return PHPStan excutable file and arguments."
   (cond
-   ((file-exists-p phpstan-executable) (list phpstan-executable))
    ((eq 'docker phpstan-executable)
     (list "run" "--rm" "-v"
           (concat (expand-file-name (php-project-get-root-dir)) ":/app")
@@ -226,6 +225,8 @@ it returns the value of `SOURCE' as it is."
    ((and (consp phpstan-executable)
          (eq 'root (car phpstan-executable)))
     (expand-file-name (cdr phpstan-executable) (php-project-get-root-dir)))
+   ((and (stringp phpstan-executable) (file-exists-p phpstan-executable))
+    (list phpstan-executable))
    ((and phpstan-flycheck-auto-set-executable
          (listp phpstan-executable)
          (stringp (car phpstan-executable))

Do not worry about this as you commit as your contribution after merging.

@zonuexe zonuexe merged commit d4271b2 into emacs-php:master May 3, 2018
zonuexe pushed a commit that referenced this pull request May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants