Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hux
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
hux
Merge requests
!15
Issue
#3363197
: Combined refactoring and attributes interface
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
Issue
#3363197
: Combined refactoring and attributes interface
issue/hux-3363197:3363197-combined-refactoring-and
into
1.2.x
Overview
0
Commits
41
Pipelines
0
Changes
21
Open
Issue #3363197: Combined refactoring and attributes interface
Andreas Hennings
requested to merge
issue/hux-3363197:3363197-combined-refactoring-and
into
1.2.x
May 28, 2023
Overview
0
Commits
41
Pipelines
0
Changes
21
0
0
Merge request reports
Compare
1.2.x
version 6
02ab9632
Jun 1, 2023
version 5
0b9b5f7c
Jun 1, 2023
version 4
8a0b3ed2
Jun 1, 2023
version 3
85a44b14
May 31, 2023
version 2
5a78dfcc
May 28, 2023
version 1
d2a0ce83
May 28, 2023
1.2.x (base)
and
latest version
latest version
5432b1eb
41 commits,
Jun 16, 2023
version 6
02ab9632
38 commits,
Jun 1, 2023
version 5
0b9b5f7c
38 commits,
Jun 1, 2023
version 4
8a0b3ed2
36 commits,
Jun 1, 2023
version 3
85a44b14
17 commits,
May 31, 2023
version 2
5a78dfcc
17 commits,
May 28, 2023
version 1
d2a0ce83
16 commits,
May 28, 2023
21 files
+
595
−
284
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
21
src/Attribute/Alter.php
+
11
−
4
View file @ 5432b1eb
Edit in single-file editor
Open in Web IDE
Show full file
@@ -9,7 +9,7 @@ namespace Drupal\hux\Attribute;
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
// @codingStandardsIgnoreLine
class
Alter
{
class
Alter
extends
HookAttributeBase
{
/**
* Constructs a new Alter.
@@ -18,10 +18,10 @@ class Alter {
* The alter name, without the 'hook_' or '_alter' components.
*/
public
function
__construct
(
p
ublic
string
$alter
,
p
rivate
readonly
string
$alter
,
)
{
assert
(
!
str_starts_with
(
$alter
,
'hook_'
));
assert
(
!
str_ends_with
(
$alter
,
'_alter'
));
assert
(
!
str_starts_with
(
$alter
,
'hook_'
)
,
"Expected alter name without 'hook_', found
$alter
."
);
assert
(
!
str_ends_with
(
$alter
,
'_alter'
)
,
"Expected alter name without '_alter', found
$alter
."
);
if
(
in_array
(
$alter
,
[
// This hook is invoked by \Drupal\Core\Extension\ModuleHandler::alter.
'module_implements_alter'
,
@@ -33,4 +33,11 @@ class Alter {
}
}
/**
* {@inheritdoc}
*/
public
function
getHookNames
():
array
{
return
[
$this
->
alter
.
'_alter'
];
}
}
Loading