Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made `flymake-phpcs-standard' more safe.
`flymake-phpcs-standard' is only safe as a local variable if the specified standard is not pointing to a file/path to a standard. So the safe-local-variable property is adjusted to only be safe when the value is string-or-null-p AND it is not file-exists-p. This might fail in the case where you specify i.e. PEAR as standard and also have a file or folder named PEAR relative to the buffer. PHPCS will choose the installed standard but `flymake-phpcs-standard' will consider the setting unsafe. At least it only fails to the safe side - it won't allow unsafe values but can mark a few safe values as unsafe. Another approach would be to only accept all installed standards (phpcs -i) as safe values but we'll spare the overhead of running external commands.
- Loading branch information