diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 00000000..f3f3a384
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1 @@
+((emacs-lisp-mode (package-lint-main-file . "php-mode.el")))
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index bd240b6b..de843d4a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -20,6 +20,7 @@ jobs:
- "26.1"
- "26.2"
- "26.3"
+ - "27.1"
- snapshot
include:
- emacs_version: snapshot
diff --git a/.gitignore b/.gitignore
index 8d42011c..f9278324 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/.cask/
+/.mailmap
/php-mode-autoloads.el
*~
*.elc
diff --git a/AUTHORS.md b/AUTHORS.md
index 6a9e4335..aa263198 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -30,6 +30,7 @@ Names Sorted Alphabetically:
- Carl Groner
- Charlie McMackin
- Christian Albrecht
+- Christian Weiske
- Daniel Hackney
- David Arroyo Menéndez
- David Maus
diff --git a/Cask b/Cask
index 49af2fb6..a37bc60b 100644
--- a/Cask
+++ b/Cask
@@ -1,11 +1,13 @@
(package "php-mode" "1.23.0" "Major mode for editing PHP code")
(source melpa)
-(package-file "php.el")
-(package-file "php-face.el")
(package-file "php-mode.el")
-(package-file "php-project.el")
-(package-file "php-mode-debug.el")
+
+(files
+ "php.el"
+ "php-face.el"
+ "php-project.el"
+ "php-mode-debug.el")
(development
(depends-on "pkg-info")
diff --git a/Makefile b/Makefile
index 682675df..dc40c85b 100644
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,15 @@ all: autoloads $(ELCS) authors
authors: AUTHORS.md
+.mailmap:
+ ln -s etc/git/.mailmap
+
.PHONY: AUTHORS.md
-AUTHORS.md: AUTHORS.md.in
+AUTHORS.md: etc/git/AUTHORS.md.in .mailmap
@printf "Generating AUTHORS.md file..."
@test -d .git \
&& (cat $< > $@ \
- && git log --pretty=format:'- %aN' | sort -u >> $@ \
+ && git log --pretty=format:'- %aN' | LANG=C sort -u >> $@ \
&& printf "FINISHED\n" ; ) \
|| printf "FAILED (non-fatal)\n"
diff --git a/README.ja.md b/README.ja.md
index efe7880b..ddf75472 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -1,12 +1,12 @@
+**お知らせ**: これはGNU Emacs 24.3, 24.4, 24.5, 25.1のためのメンテナンスブランチです。もしこれらのバージョンの保守を継続したければ気軽にこのブランチ(`v1`)にプルリクエストを送ってください。
+
Emacs PHP Mode
-[](https://www.gnu.org/software/emacs/)
+[](https://www.gnu.org/software/emacs/)
[](http://php.net/manual/migration70.php)
[](http://php.net/downloads.php)
[](https://github.com/emacs-php/php-mode/actions)
-[![melpa badge][melpa-badge]][melpa-link]
-[![melpa stable badge][melpa-stable-badge]][melpa-stable-link]
[](http://www.gnu.org/licenses/gpl-3.0.txt)
A powerful and flexible Emacs major mode for editing PHP scripts
@@ -20,20 +20,6 @@ A powerful and flexible Emacs major mode for editing PHP scripts
**PHP ModeはEmacs 24.3以降で動作します**。古いバージョンのEmacsでも動作するかもしれませんが、保証外です。 古いバージョンのEmacsのPHPモードを使用することによる問題のバグ報告は積極的に対応しません。現在のサポートポリシーは[Supported Version]のページをご覧ください。
-### **(推奨)** MELPAからのインストール
-
-[![melpa badge][melpa-badge]][melpa-link] [![melpa stable badge][melpa-stable-badge]][melpa-stable-link]
-
-GNU Emacs 24以降では、[package][]機能(または[Cask][])を使って[MELPA][]/[MELPA Stable][]からPHP Modeをインストールできます。
-
-### OSのパッケージマネージャからのインストール
-
-PHP Modeは[いくつかのOSが提供するパッケージシステム][php-mode-packages]からインストール可能です。DebianおよびUbuntuのようなDebian派生のOSではEmacsにPHPを追加する最も簡単な方法で、`sudo apt install elpa-php-mode` で導入できます。これらの "Stable" リリースは最新のPHP Modeよりも古いものの、十分にテストされた固定バージョンが提供されます。オートロードとバイトコンパイルは自動で行われます。
-
-最新のPHP Modeの機能とパフォーマンス改善を活用するために**sid** ("unstable"としても知られるローリングリリース)で提供されるバージョンのインストールを検討してください。最新バージョンは[`elpa-php-mode`][elpa-php-mode]にあります。"apt-pinning"を使ってアップデートを自動化することもできます。
-
-また、[Debian 9 (stretch)][php-elisp-stretch]や[Ubuntu 18.10][php-elisp-ubuntu1810]以前で提供されていた `php-elisp` パッケージは[あまりにも古い][issue-430]ので、 **くれぐれもインストールしないでください**。
-
### 手動でインストール
もしパッケージマネージャに依存したくなければ、伝統的な方法によってLispファイルを直接インストールすることもできます。詳細なセットアップ方法は[手動でのインストール][wiki-manual-installation-ja]ページをご覧ください。
@@ -329,24 +315,12 @@ PHP Modeは[GNU General Public License Version 3][gpl-v3] (GPLv3) でライセ
[Authors]: https://github.com/emacs-php/php-mode/wiki/Authors
[Cask]: https://github.com/cask/cask
[Contributors]: https://github.com/emacs-php/php-mode/graphs/contributors
-[MELPA Stable]: https://stable.melpa.org/
-[MELPA]: https://melpa.org/
[Subword Mode]: https://www.gnu.org/software/emacs/manual/html_node/ccmode/Subword-Movement.html
[Supported Version]: https://github.com/emacs-php/php-mode/wiki/Supported-Version
[Web Mode]: http://web-mode.org/
[camelCase]: https://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%83%A1%E3%83%AB%E3%82%B1%E3%83%BC%E3%82%B9
[cc mode]: https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html
-[elpa-php-mode]: https://packages.debian.org/sid/elpa-php-mode
[gpl-v3]: https://www.gnu.org/licenses/quick-guide-gplv3.html
-[issue-430]: https://github.com/emacs-php/php-mode/issues/430
-[melpa-badge]: http://melpa.org/packages/php-mode-badge.svg
-[melpa-link]: http://melpa.org/#/php-mode
-[melpa-stable-badge]: http://stable.melpa.org/packages/php-mode-badge.svg
-[melpa-stable-link]: http://stable.melpa.org/#/php-mode
-[package]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html
-[php-elisp-stretch]: https://packages.debian.org/stretch/php-elisp
-[php-elisp-ubuntu1810]: https://packages.ubuntu.com/cosmic/php-elisp
-[php-mode-packages]: https://repology.org/project/emacs:php-mode/versions
[php-mode]: https://github.com/emacs-php/php-mode
[php-suite]: https://github.com/emacs-php/php-suite
[wiki]: https://github.com/emacs-php/php-mode/wiki
diff --git a/README.md b/README.md
index f3302a19..2de8b0c5 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,13 @@
+**NOTE**: This is maintenance branch for GNU Emacs 24.3, 24.4, 24.5, 25.1. If you want to continue supporting these versions, feel free to send a Pull Request to this branch (`v1`).
+
+
Emacs PHP Mode
-[](https://www.gnu.org/software/emacs/)
+[](https://www.gnu.org/software/emacs/)
[](http://php.net/manual/migration70.php)
[](http://php.net/downloads.php)
[](https://github.com/emacs-php/php-mode/actions)
-[![melpa badge][melpa-badge]][melpa-link]
-[![melpa stable badge][melpa-stable-badge]][melpa-stable-link]
[](http://www.gnu.org/licenses/gpl-3.0.txt)
A powerful and flexible Emacs major mode for editing PHP scripts
@@ -22,20 +23,6 @@ Installation
The current support policy can be found on the [Supported Version] page.
-### **(RECOMMENDED)** Install from MELPA
-
-[![melpa badge][melpa-badge]][melpa-link] [![melpa stable badge][melpa-stable-badge]][melpa-stable-link]
-
-With GNU Emacs 24 or later then you can use its [package][] feature (or [Cask][]) to install PHP Mode from [MELPA][] or [MELPA Stable][].
-
-### Install using OS package system
-
-PHP Mode is available from [package systems provided by several OSs][php-mode-packages]. On Debian, and operating systems derived from it, such as Ubuntu, the easiest way to add PHP support to Emacs is `sudo apt install elpa-php-mode`. "Stable" releases of these operating systems include a well-tested frozen version of this package that is always older than the latest upstream version of PHP Mode. Autoloads and byte-compilation are automatic.
-
-Please consider installing the package provided in `sid` (aka: "unstable", a rolling release) in order to benefit from the latest PHP Mode features and performance improvements. The latest version can be found here: [`elpa-php-mode`][elpa-php-mode]. Investigate "apt-pinning" to make tracking this update stream automatic.
-
-Also, the `php-elisp` package provided by [Debian 9 (stretch)][php-elisp-stretch] and [Ubuntu 18.10][php-elisp-ubuntu1810] and earlier is [extremely old][issue-430], so **PLEASE DO NOT INSTALL IT**.
-
### Manual installation
If you don't want to depend on a package manager, you can install Lisp files directly in the traditional way. See [Manual installation][wiki-manual-installation] for our recommended setup method.
@@ -97,7 +84,7 @@ $object->foo()
->baz();
```
-This behaviour is off by default, but you can customize the variable `php-lineup-cascaded-calls` to enable this.
+This behaviour is off by default, but you can customize the variable `php-mode-lineup-cascaded-calls` to enable this.
**Note:** Alignment will only work if you use one of the php-mode coding styles or inherit one of the styles.
@@ -309,24 +296,12 @@ This project was maintained by [Eric James Michael Ritz][@ejmr] until 2017. Curr
[Authors]: https://github.com/emacs-php/php-mode/wiki/Authors
[Cask]: https://github.com/cask/cask
[Contributors]: https://github.com/emacs-php/php-mode/graphs/contributors
-[MELPA Stable]: https://stable.melpa.org/
-[MELPA]: https://melpa.org/
[Subword Mode]: https://www.gnu.org/software/emacs/manual/html_node/ccmode/Subword-Movement.html
[Supported Version]: https://github.com/emacs-php/php-mode/wiki/Supported-Version
[Web Mode]: http://web-mode.org/
[camelCase]: https://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%83%A1%E3%83%AB%E3%82%B1%E3%83%BC%E3%82%B9
[cc mode]: https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html
-[elpa-php-mode]: https://packages.debian.org/sid/elpa-php-mode
[gpl-v3]: https://www.gnu.org/licenses/quick-guide-gplv3.html
-[issue-430]: https://github.com/emacs-php/php-mode/issues/430
-[melpa-badge]: http://melpa.org/packages/php-mode-badge.svg
-[melpa-link]: http://melpa.org/#/php-mode
-[melpa-stable-badge]: http://stable.melpa.org/packages/php-mode-badge.svg
-[melpa-stable-link]: http://stable.melpa.org/#/php-mode
-[package]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html
-[php-elisp-stretch]: https://packages.debian.org/stretch/php-elisp
-[php-elisp-ubuntu1810]: https://packages.ubuntu.com/cosmic/php-elisp
-[php-mode-packages]: https://repology.org/project/emacs:php-mode/versions
[php-mode]: https://github.com/emacs-php/php-mode
[php-suite]: https://github.com/emacs-php/php-suite
[wiki]: https://github.com/emacs-php/php-mode/wiki
diff --git a/.mailmap b/etc/git/.mailmap
similarity index 100%
rename from .mailmap
rename to etc/git/.mailmap
diff --git a/AUTHORS.md.in b/etc/git/AUTHORS.md.in
similarity index 100%
rename from AUTHORS.md.in
rename to etc/git/AUTHORS.md.in
diff --git a/php-align.el b/php-align.el
index 084f8857..648ceac0 100644
--- a/php-align.el
+++ b/php-align.el
@@ -8,7 +8,6 @@
;; Keywords: php languages convenience align
;; Homepage: https://github.com/emacs-php/php-mode
;; Version: 1.23.0
-;; Package-Requires: ((emacs "24.3"))
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify
diff --git a/php-face.el b/php-face.el
index cb6a95f9..ac6f48da 100644
--- a/php-face.el
+++ b/php-face.el
@@ -7,7 +7,6 @@
;; Version: 1.23.0
;; Keywords: faces, php
;; Homepage: https://github.com/emacs-php/php-mode
-;; Package-Requires: ((emacs "24.3"))
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify
diff --git a/php-mode-debug.el b/php-mode-debug.el
index 1e75aa15..01f02a04 100644
--- a/php-mode-debug.el
+++ b/php-mode-debug.el
@@ -6,7 +6,6 @@
;; URL: https://github.com/emacs-php/php-mode
;; Keywords: maint
;; Version: 1.23.0
-;; Package-Requires: ((emacs "24.3"))
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify
diff --git a/php-mode-pkg.el b/php-mode-pkg.el
new file mode 100644
index 00000000..5ca80ccf
--- /dev/null
+++ b/php-mode-pkg.el
@@ -0,0 +1,12 @@
+(define-package "php-mode" "1.23.0" "Major mode for editing PHP code"
+ '((emacs "24.3"))
+ :keywords
+ '("languages" "php")
+ :authors
+ '(("Eric James Michael Ritz"))
+ :maintainer
+ '("USAMI Kenta" . "tadsan@zonu.me")
+ :url "https://github.com/emacs-php/php-mode")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/php-mode.el b/php-mode.el
index 71eca1a7..d58faa00 100644
--- a/php-mode.el
+++ b/php-mode.el
@@ -472,7 +472,7 @@ In that case set to `NIL'."
(c-lang-defconst c-primitive-type-kwds
php '("int" "integer" "bool" "boolean" "float" "double" "real"
- "string" "object" "void"))
+ "string" "object" "void" "mixed"))
(c-lang-defconst c-class-decl-kwds
"Keywords introducing declarations where the following block (if any)
@@ -519,6 +519,9 @@ PHP does not have an \"enum\"-like keyword."
(c-lang-defconst c-lambda-kwds
php '("function" "use"))
+(c-lang-defconst c-inexpr-block-kwds
+ php '("match"))
+
(c-lang-defconst c-other-block-decl-kwds
php '("namespace"))
@@ -643,6 +646,23 @@ but only if the setting is enabled"
(beginning-of-line)
(if (looking-at-p "\\s-*->") '+ nil))))
+(defun php-c-looking-at-or-maybe-in-bracelist (&optional containing-sexp lim)
+ "Replace `c-looking-at-or-maybe-in-bracelist'.
+
+CONTAINING-SEXP is the position of the brace/paren/bracket enclosing
+POINT, or nil if there is no such position, or we do not know it. LIM is
+a backward search limit."
+ (cond
+ ((looking-at-p "{")
+ (save-excursion
+ (c-backward-token-2 2 t lim)
+ ;; PHP 8.0 match expression
+ ;; echo match ($var) |{
+ ;; ↑ matches ↑ initial position
+ (when (looking-at-p (eval-when-compile (rx symbol-start "match" symbol-end)))
+ (cons (point) t))))
+ (t nil)))
+
(c-add-style
"php"
`((c-basic-offset . 4)
@@ -1186,6 +1206,10 @@ After setting the stylevars run hooks according to STYLENAME
(setq-local add-log-current-defun-function nil)
(setq-local add-log-current-defun-header-regexp php-beginning-of-defun-regexp)
+ (when (fboundp 'c-looking-at-or-maybe-in-bracelist)
+ (advice-add #'c-looking-at-or-maybe-in-bracelist
+ :override 'php-c-looking-at-or-maybe-in-bracelist))
+
(when (>= emacs-major-version 25)
(with-silent-modifications
(save-excursion
@@ -1518,7 +1542,7 @@ a completion list."
("\\<\\(const\\)\\s-+\\(\\_<.+?\\_>\\)" (1 'php-keyword) (2 'php-constant-assign))
;; Logical operator (!)
- ("\\(![^=]\\)" 1 'php-logical-op)
+ ("\\(!\\)[^=]" 1 'php-logical-op)
;; Highlight special variables
("\\(\\$\\)\\(this\\)\\>" (1 'php-$this-sigil) (2 'php-$this))
diff --git a/php-project.el b/php-project.el
index 6e305a7b..5f4236d1 100644
--- a/php-project.el
+++ b/php-project.el
@@ -6,7 +6,6 @@
;; Keywords: tools, files
;; URL: https://github.com/emacs-php/php-mode
;; Version: 1.23.0
-;; Package-Requires: ((emacs "24.3"))
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify
diff --git a/php-util-buffer.el b/php-util-buffer.el
deleted file mode 100644
index e287983f..00000000
--- a/php-util-buffer.el
+++ /dev/null
@@ -1,135 +0,0 @@
-;;; php-util-buffer.el --- Utility function for buffer manipulation -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020 Friends of Emacs-PHP development
-;; Copyright 2013 The go-mode Authors. All rights reserved.
-
-;; Author: Dominik Honnef
-;; Maintainer: USAMI Kenta
-;; URL: https://github.com/emacs-php/php-mode
-;; Keywords: lisp
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see .
-
-;;; Commentary:
-
-;; Functions for patching buffer.
-
-;;; Original License:
-
-;; Copyright (c) 2014 The go-mode Authors. All rights reserved.
-
-;; Redistribution and use in source and binary forms, with or without
-;; modification, are permitted provided that the following conditions are
-;; met:
-
-;; * Redistributions of source code must retain the above copyright
-;; notice, this list of conditions and the following disclaimer.
-;; * Redistributions in binary form must reproduce the above
-;; copyright notice, this list of conditions and the following disclaimer
-;; in the documentation and/or other materials provided with the
-;; distribution.
-;; * Neither the name of the copyright holder nor the names of its
-;; contributors may be used to endorse or promote products derived from
-;; this software without specific prior written permission.
-
-;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-;;; Code:
-
-;; gofmt apply-rcs-patch Function
-;; These functions are copied by go-mode(gofmt).
-(defun php-util-buffer--delete-whole-line (&optional arg)
- "Delete the current line without putting it in the `kill-ring'.
-Derived from function `kill-whole-line'. ARG is defined as for that
-function."
- (setq arg (or arg 1))
- (if (and (> arg 0)
- (eobp)
- (save-excursion (forward-visible-line 0) (eobp)))
- (signal 'end-of-buffer nil))
- (if (and (< arg 0)
- (bobp)
- (save-excursion (end-of-visible-line) (bobp)))
- (signal 'beginning-of-buffer nil))
- (cond ((zerop arg)
- (delete-region (progn (forward-visible-line 0) (point))
- (progn (end-of-visible-line) (point))))
- ((< arg 0)
- (delete-region (progn (end-of-visible-line) (point))
- (progn (forward-visible-line (1+ arg))
- (unless (bobp)
- (backward-char))
- (point))))
- (t
- (delete-region (progn (forward-visible-line 0) (point))
- (progn (forward-visible-line arg) (point))))))
-
-(defun php-util-buffer-apply-rcs-patch (target-buffer patch-buffer)
- "Apply an RCS-formatted diff from `PATCH-BUFFER' to the `TARGET-BUFFER'."
- (let (
- ;; Relative offset between buffer line numbers and line numbers
- ;; in patch.
- ;;
- ;; Line numbers in the patch are based on the source file, so
- ;; we have to keep an offset when making changes to the
- ;; buffer.
- ;;
- ;; Appending lines decrements the offset (possibly making it
- ;; negative), deleting lines increments it. This order
- ;; simplifies the forward-line invocations.
- (line-offset 0)
- (column (current-column)))
- (save-excursion
- (with-current-buffer patch-buffer
- (goto-char (point-min))
- (while (not (eobp))
- (unless (looking-at "^\\([ad]\\)\\([0-9]+\\) \\([0-9]+\\)")
- (error "Invalid rcs patch or internal error in php-util-buffer-apply-rcs-patch"))
- (forward-line)
- (let ((action (match-string 1))
- (from (string-to-number (match-string 2)))
- (len (string-to-number (match-string 3))))
- (cond
- ((equal action "a")
- (let ((start (point)))
- (forward-line len)
- (let ((text (buffer-substring start (point))))
- (with-current-buffer target-buffer
- (cl-decf line-offset len)
- (goto-char (point-min))
- (forward-line (- from len line-offset))
- (insert text)))))
- ((equal action "d")
- (with-current-buffer target-buffer
- (goto-char (point-min))
- (forward-line (1- (- from line-offset)))
- (cl-incf line-offset len)
- (php-util-buffer--delete-whole-line len)))
- (t
- (error "Invalid rcs patch or internal error in php-util-buffer--apply-rcs-patch")))))))
- (move-to-column column)))
-;; Copy of go-mode.el ends here
-
-(provide 'php-util-buffer)
-;;; php-util-buffer.el ends here
diff --git a/php.el b/php.el
index ce532c17..e417fa18 100644
--- a/php.el
+++ b/php.el
@@ -7,7 +7,6 @@
;; Version: 1.23.0
;; Keywords: languages, php
;; Homepage: https://github.com/emacs-php/php-mode
-;; Package-Requires: ((emacs "24.3"))
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify
diff --git a/tests/.dir-locals.el b/tests/.dir-locals.el
new file mode 100644
index 00000000..d18ca3ff
--- /dev/null
+++ b/tests/.dir-locals.el
@@ -0,0 +1 @@
+((emacs-lisp-mode (package-lint-main-file . "../php-mode.el")))
diff --git a/tests/lang/types/keywords.php b/tests/lang/types/keywords.php
index fc1b4f66..e9ba7785 100644
--- a/tests/lang/types/keywords.php
+++ b/tests/lang/types/keywords.php
@@ -12,3 +12,4 @@
string;
object;
resource;
+mixed;
diff --git a/tests/lang/types/keywords.php.faces b/tests/lang/types/keywords.php.faces
index 465e035f..32d205a9 100644
--- a/tests/lang/types/keywords.php.faces
+++ b/tests/lang/types/keywords.php.faces
@@ -20,4 +20,6 @@
("string" . font-lock-type-face)
(";\n")
("object" . font-lock-type-face)
- (";\nresource;\n"))
+ (";\nresource;\n")
+ ("mixed" . font-lock-type-face)
+ (";\n"))