Skip to content

PHP 8.4 | Squiz/MemberVarSpacing: add support for abstract properties #1187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
$validPrefixes[] = T_FINAL;
$validPrefixes[] = T_VAR;
$validPrefixes[] = T_READONLY;
$validPrefixes[] = T_ABSTRACT;

$startOfStatement = $phpcsFile->findNext($validPrefixes, ($endOfPreviousStatement + 1), $stackPtr, false, null, true);
if ($startOfStatement === false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,16 @@ class AsymVisibility {

private(set) private bool $asymPrivate;
}

abstract class PHP84AbstractProperties {
abstract int $abstractA {get;}

/**
* Docblock
*/
public abstract string $publicAbstract { set; }
#[AnAttribute]
abstract bool $abstractB {get;}

abstract protected bool $abstractProtected { set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,18 @@ class AsymVisibility {

private(set) private bool $asymPrivate;
}

abstract class PHP84AbstractProperties {

abstract int $abstractA {get;}

/**
* Docblock
*/
public abstract string $publicAbstract { set; }

#[AnAttribute]
abstract bool $abstractB {get;}

abstract protected bool $abstractProtected { set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public function getErrorList($testFile='')
456 => 1,
457 => 1,
460 => 1,
464 => 1,
471 => 1,
];

default:
Expand Down
Loading