Needs work
Project:
Coder
Version:
9.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Jan 2026 at 21:05 UTC
Updated:
23 Mar 2026 at 18:28 UTC
Jump to comment: Most recent
It looks like property hooks (a PHP 8.4 feature) are not supported by coder.
An error occurred during processing; checking has been aborted. The error message was: $stackPtr is not a class member var
The error originated in the Drupal.NamingConventions.ValidVariableName sniff on line 41.
Note that property hooks are also not supported upstream by squizlabs/php_codesniffer, see https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/734
You can reproduce this on the example code at https://www.php.net/manual/en/language.oop5.property-hooks.php
class Example
{
private bool $modified = false;
public string $foo = 'default value' {
get {
if ($this->modified) {
return $this->foo . ' (modified)';
}
return $this->foo;
}
set(string $value) {
$this->foo = strtolower($value);
$this->modified = true;
}
}
}
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mfbAdded link to https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/734
Comment #4
nickolajCatch RuntimeException thrown by getMemberProperties() when processing PHP 8.4 property hook variables that are not actual class member declarations.
Comment #6
mondrakeI think this is at least major given that D12 will require PHP 8.5 and therefore use of property hooks as a language feature will be unlocked.
Comment #7
mondrakeSome progress upstream: Syntax/RemovedCurlyBraceArrayAccess: prevent false positive on PHP 8.4 property hook declarations
Comment #8
klausiThanks, approach makes sense!
Please add a test case so that we cover this exception handling with tests.
Comment #9
claudiu.cristeaHooks might contain a return statement. I'm getting also
See https://git.drupalcode.org/issue/drupal-3581014/-/jobs/9054715