# Changes for PHP Mode by Version

All notable changes of the PHP Mode 1.19.1 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## Unreleased

### Added

 * `php-project-get-root-dir` falls back to `project-current` when no PHP-specific marker is found, so `project.el` backends (Projectile 3, `project-vc-extra-root-markers`, etc.) can contribute project detection

### Changed

 * Add `readonly` class modifier to [Imenu] ([#802])
 * Add `enum` support to `php-current-class` ([#802])
 * Remove hardcoding of implicit paths in `php` that are not guaranteed to exist ([#803])

### Fixed

 * `php-project-project-find-function` now returns a `project.el` value valid on Emacs 28+; it previously built a `(vc . ROOT)` cons that broke the 3-element `(vc BACKEND ROOT)` representation and made `project-root` signal an error
 * Fix the `:safe` predicate of `php-complete-function-modules`, which accepted any list and never actually applied
   * It looped over the standard Emacs variable `values` instead of its own argument, so `cl-loop ... always` succeeded vacuously and unknown module names passed as safe
   * Emacs also checks directory-local values *before* php-complete.el is loaded, so the predicate ran as copied into the autoloads file and hit `void-function cl-loop`.  `safe-local-variable-p` demotes such errors to nil, so every project setting this variable was prompted for confirmation regardless
   * That half of the fix applies on Emacs 28 and later; Emacs 27 does not copy `:safe` predicates into the autoloads file at all, so it keeps prompting until php-complete.el is loaded
 * Fix function name completion sorting the user's `php-complete-function-modules` in place
   * The first completion reordered the value the user had set, e.g. `(pcntl bcmath core)` became `(bcmath core pcntl)`
 * Fix function name completion offering module names as if they were PHP functions
   * Entries of `php-defs-functions-alist` are `(MODULE . FUNCTION-NAMES)` and the whole entry was appended, so every enabled module leaked its own name into the candidates

### Deprecated

 * `php-project-use-projectile-to-detect-root` is obsolete; Projectile 3 registers itself on `project-find-functions`, which `php-project-get-root-dir` now consults automatically

[Imenu]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html
[#802]: https://github.com/emacs-php/php-mode/pull/802
[#803]: https://github.com/emacs-php/php-mode/pull/803

## [1.27.0] - 2024-12-20

### Added

 * Support PHP 8.4 property-hooks ([#797])

### Changed

 * Improve `php-syntax-propertize-extend-region` efficiency ([#789], thanks [@phil-s]!)
 * Update `php-phpdoc-type-names` to support [PHPStan 2.0.4] ([#795])

### Fixed

 * Fix Emacs 30 byte-compile errors ([#792])
 * Use `when-let*` instead of `when-let` to enhance Emacs 30 compatibility ([#796])

### Removed

 * Drop support for Emacs 26 ([#788])

[@phil-s]: https://github.com/phil-s
[PHPStan 2.0.4]: https://github.com/phpstan/phpstan/releases/tag/2.0.4
[#788]: https://github.com/emacs-php/php-mode/pull/788
[#789]: https://github.com/emacs-php/php-mode/pull/789
[#792]: https://github.com/emacs-php/php-mode/pull/792
[#795]: https://github.com/emacs-php/php-mode/pull/795
[#796]: https://github.com/emacs-php/php-mode/pull/796
[#797]: https://github.com/emacs-php/php-mode/pull/797

## [1.26.1] - 2024-09-13

### Added

 * Add `php-base-mode` which is the base of php related modes ([#772])
   * `php-base-mode` is designed as a common parent mode for `php-mode` ~~and [`php-ts-mode`](https://github.com/emacs-php/php-ts-mode)~~.

### Changed

 * Make `php-mode` inherit from `php-base-mode` instead of `c-mode` ([#772])
 * Modify indentation of [PEAR Coding Standards] ([#774], [#777])
   * No longer overindent it by default, since we don't see any mention in the coding style that it should hang `.`. (refs [#227] and [#229])
   * **If you have any feedback on PEAR style, please let us know in [the discussion #776][#776].**
...
...
