Skip to content

Commit d2ae337

Browse files
committed
Update README
1 parent b12a44a commit d2ae337

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

README.org

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,125 @@
1-
* phpstan.el
1+
* psalm.el
22
#+BEGIN_HTML
3-
<a href="http://melpa.org/#/phpstan"><img alt="MELPA: phpstan" src="http://melpa.org/packages/phpstan-badge.svg"></a>
4-
<a href="http://stable.melpa.org/#/phpstan"><img alt="MELPA stable: phpstan" src="http://stable.melpa.org/packages/phpstan-badge.svg"></a>
3+
<a href="http://melpa.org/#/psalm"><img alt="MELPA: psalm" src="http://melpa.org/packages/psalm-badge.svg"></a>
4+
<a href="http://stable.melpa.org/#/psalm"><img alt="MELPA stable: psalm" src="http://stable.melpa.org/packages/psalm-badge.svg"></a>
55
#+END_HTML
6-
Emacs interface to [[https://github.com/phpstan/phpstan][PHPStan]], includes checker for [[http://www.flycheck.org/en/latest/][Flycheck]].
6+
Emacs interface to [[https://psalm.dev/][Psalm]], includes checker for [[http://www.flycheck.org/en/latest/][Flycheck]].
77
** Support version
88
- Emacs 24+
9-
- PHPStan latest/dev-master (NOT support 0.9 seriese)
9+
- Psalm latest/dev-master (NOT support 0.9 seriese)
1010
- PHP 7.1+ or Docker runtime
1111
** How to install
1212
*** Install from MELPA
1313
1. If you have not set up MELPA, see [[https://melpa.org/#/getting-started][Getting Started - MELPA]].
14-
2. ~M-x package-install flycheck-phpstan~
14+
2. ~M-x package-install flycheck-psalm~
1515
** How to use
1616
*** For Flycheck user
1717
#+BEGIN_SRC emacs-lisp
1818
(defun my-php-mode-setup ()
1919
"My PHP-mode hook."
20-
(require 'flycheck-phpstan)
20+
(require 'flycheck-psalm)
2121
(flycheck-mode t))
2222

2323
(add-hook 'php-mode-hook 'my-php-mode-setup)
2424
#+END_SRC
2525

2626
*** For Flymake user
2727
#+BEGIN_SRC emacs-lisp
28-
(add-hook 'php-mode-hook #'flymake-phpstan-turn-on)
28+
(add-hook 'php-mode-hook #'flymake-psalm-turn-on)
2929
#+END_SRC
3030

31-
*** Using Docker (phpstan/docker-image)
32-
Install [[https://www.docker.com/get-started][Docker]] and [[https://hub.docker.com/r/phpstan/phpstan][phpstan/phpstan image]].
31+
*** Using Docker
32+
Install [[https://www.docker.com/get-started][Docker]]. There is currently no official Docker image we can trust, so if you want to use it, you are at your own risk.
3333

34-
If you always use Docker for PHPStan, add the following into your ~.emacs~ file (~~/.emacs.d/init.el~)
34+
If you always use Docker for Psalm, add the following into your ~.emacs~ file (~~/.emacs.d/init.el~)
3535
#+BEGIN_SRC emacs-lisp
36-
(setq-default phpstan-executable 'docker)
36+
;; Be sure to replace it with a Docker image you trust
37+
(setq-default psalm-docker-image "your/dockerhub-image")
38+
(setq-default psalm-executable 'docker)
3739
#+END_SRC
3840

3941
Put the following into ~.dir-locals.el~ files on the root directory of project.
4042
#+BEGIN_SRC emacs-lisp
4143
((nil . ((php-project-root . git)
42-
(phpstan-executable . docker)
43-
(phpstan-working-dir . (root . "path/to/dir"))
44-
(phpstan-config-file . (root . "path/to/dir/phpstan-docker.neon"))
45-
(phpstan-level . 7))))
44+
(psalm-executable . docker)
45+
(psalm-working-dir . (root . "path/to/dir"))
46+
(psalm-config-file . (root . "path/to/dir/psalm-docker.neon"))
47+
(psalm-level . 7))))
4648
#+END_SRC
4749

4850
*** Using composer (project specific)
49-
If your project Composer relies on phpstan, you do not need to set anything.
51+
If your project Composer relies on psalm, you do not need to set anything.
5052
#+BEGIN_SRC emacs-lisp
5153
((nil . ((php-project-root . git)
52-
(phpstan-executable . docker)
53-
(phpstan-working-dir . (root . "path/to/dir"))
54-
(phpstan-config-file . (root . "path/to/dir/phpstan-docker.neon"))
55-
(phpstan-level . 7))))
54+
(psalm-executable . docker)
55+
(psalm-working-dir . (root . "path/to/dir"))
56+
(psalm-config-file . (root . "path/to/dir/psalm-docker.neon"))
57+
(psalm-level . 7))))
5658
#+END_SRC
5759

5860
*** Using Composer
59-
Please install [[https://packagist.org/packages/phpstan/phpstan][phpstan/phpstan]] package for each user environment or project by using [[https://getcomposer.org/download/][Composer]].
61+
Please install [[https://packagist.org/packages/vimeo/psalm][vimeo/psalm]] package for each user environment or project by using [[https://getcomposer.org/download/][Composer]].
6062

6163
If you are unfamiliar with resolving dependencies, the following shell commands are recommended.
6264
#+BEGIN_SRC shell
63-
$ composer global require phpstan/phpstan
65+
$ composer global require vimeo/psalm
6466
#+END_SRC
6567

66-
*NOTICE*: [[https://packagist.org/packages/phpstan/phpstan-shim][phpstan/phpstan-shim]] is deprecated. Please read [[https://medium.com/@ondrejmirtes/phpstan-0-12-released-f1a88036535d][PHPStan 0.12 Released!]].
67-
6868
*** Using PHAR archive
69-
*NOTICE*: ~phpstan.el~ requires PHPStan **0.10+**. We *strongly* recommend using the latest PHPStan.
69+
*NOTICE*: We *strongly* recommend using the latest Psalm.
7070

71-
Please download ~phpstan.phar~ from [[https://github.com/phpstan/phpstan/releases][Releases · phpstan/phpstan]].
71+
Please download ~psalm.phar~ from [[https://github.com/vimeo/psalm/releases][Releases · vimeo/psalm]].
7272
** Settings
73-
Variables for phpstan are mainly controlled by [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html][directory variables]] (~.dir-locals.el~).
73+
Variables for psalm are mainly controlled by [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html][directory variables]] (~.dir-locals.el~).
7474

7575
Frequently ~(root. "path/to/file")~ notation appears in these variables. It is relative to the top level directory of the project. In general, the directory containing one of ~.projectile~, ~composer.json~, ~.git~ file (or directory) is at the top level.
7676

77-
Please be aware that the root directory of the PHP project may *NOT* match either of PHPStan's ~%rootDir%~ and/or ~%currentWorkingDirectory%~.
77+
Please be aware that the root directory of the PHP project may *NOT* match either of Psalm's ~%rootDir%~ and/or ~%currentWorkingDirectory%~.
7878

7979
Typically, you would set the following ~.dir-locals.el~.
8080

8181
#+BEGIN_SRC emacs-lisp
8282
((nil . ((php-project-root . auto)
83-
(phpstan-executable . docker)
84-
(phpstan-working-dir . (root . "path/to/dir/"))
85-
(phpstan-config-file . (root . "path/to/dir/phpstan-custom.neon"))
86-
(phpstan-level . max))))
83+
(psalm-executable . docker)
84+
(psalm-working-dir . (root . "path/to/dir/"))
85+
(psalm-config-file . (root . "path/to/dir/psalm-custom.neon"))
86+
(psalm-level . max))))
8787
#+END_SRC
8888

89-
If there is a ~phpstan.neon~ file in the root directory of the project, you do not need to set both ~phpstan-working-dir~ and ~phpstan-config-file~.
89+
If there is a ~psalm.neon~ file in the root directory of the project, you do not need to set both ~psalm-working-dir~ and ~psalm-config-file~.
9090

9191
** API
9292
Most variables defined in this package are buffer local. If you want to set it for multiple projects, use [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Default-Value.html][setq-default]].
9393

94-
*** Local variable ~phpstan-working-dir~
95-
Path to working directory of PHPStan.
94+
*** Local variable ~psalm-working-dir~
95+
Path to working directory of Psalm.
9696

97-
- STRING :: Absolute path to `phpstan' working directory.
98-
- ex) ~"/path/to/phpstan.phar"~
99-
- ~(root . STRING)~ :: Relative path to `phpstan' working directory from project root directory.
97+
- STRING :: Absolute path to `psalm' working directory.
98+
- ex) ~"/path/to/psalm.phar"~
99+
- ~(root . STRING)~ :: Relative path to `psalm' working directory from project root directory.
100100
- ex) ~(root . "path/to/dir")~
101101
- ~nil~ :: Use ~(php-project-get-root-dir)~ as working directory.
102102

103-
*** Local variable ~phpstan-config-file~
104-
Path to project specific configuration file of PHPStan.
103+
*** Local variable ~psalm-config-file~
104+
Path to project specific configuration file of Psalm.
105105

106-
- STRING :: Absolute path to ~phpstan~ configuration file.
107-
- ~(root . STRING)~ :: Relative path to ~phpstan~ configuration file from project root directory.
108-
- NIL :: Search ~phpstan.neon(.dist)~ in ~(phpstan-get-working-dir)~.
106+
- STRING :: Absolute path to ~psalm~ configuration file.
107+
- ~(root . STRING)~ :: Relative path to ~psalm~ configuration file from project root directory.
108+
- NIL :: Search ~psalm.neon(.dist)~ in ~(psalm-get-working-dir)~.
109109

110-
*** Local variable ~phpstan-level~
111-
Rule level of PHPStan analysis. Please see [[https://github.com/phpstan/phpstan/blob/master/README.md#rule-levels][README #Rule levels of PHPStan]].
110+
*** Local variable ~psalm-level~
111+
Rule level of Psalm analysis. Please see [[https://github.com/vimeo/psalm/blob/master/README.md#rule-levels][README #Rule levels of Psalm]].
112112
~0~ is the loosest and you can also use ~max~ as an alias for the highest level. Default level is ~0~.
113113

114-
*** Local variable ~phpstan-executable~
115-
- STRING :: Absolute path to `phpstan' executable file.
116-
- ex) ~"/path/to/phpstan.phar"~
117-
- SYMBOL ~docker~ :: Use Docker using phpstan/docker-image.
118-
- ~(root . STRING)~ :: Relative path to `phpstan' executable file from project root directory.
119-
- ex) ~(root . "script/phpstan")~
114+
*** Local variable ~psalm-executable~
115+
- STRING :: Absolute path to `psalm' executable file.
116+
- ex) ~"/path/to/psalm.phar"~
117+
- SYMBOL ~docker~ :: Use Docker using psalm/docker-image.
118+
- ~(root . STRING)~ :: Relative path to `psalm' executable file from project root directory.
119+
- ex) ~(root . "script/psalm")~
120120
- ~(STRING . (ARGUMENTS ...))~ :: Command name and arguments.
121121
- ex) ~("docker" "run" "--rm" "-v" "/path/to/project-dir/:/app" "your/docker-image")~
122-
- ~nil~ :: Auto detect ~phpstan~ executable file by composer dependencies of the project or executable command in ~PATH~ environment variable.
122+
- ~nil~ :: Auto detect ~psalm~ executable file by composer dependencies of the project or executable command in ~PATH~ environment variable.
123123

124-
*** Custom variable ~phpstan-flycheck-auto-set-executable~
125-
Set flycheck phpstan-executable automatically when non-NIL.
124+
*** Custom variable ~psalm-flycheck-auto-set-executable~
125+
Set flycheck psalm-executable automatically when non-NIL.

0 commit comments

Comments
 (0)