Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
danse
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
danse
Commits
d6235b51
Commit
d6235b51
authored
10 months ago
by
Jürgen Haas
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3459183
by jurgenhaas: Fix PHPStan tests for Drupal 11
parent
edc2ab0b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#230507
passed
9 months ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
danse.info.yml
+1
-1
1 addition, 1 deletion
danse.info.yml
modules/eca/src/Event/RecipientSelection.php
+8
-3
8 additions, 3 deletions
modules/eca/src/Event/RecipientSelection.php
src/Form/Settings.php
+6
-2
6 additions, 2 deletions
src/Form/Settings.php
with
15 additions
and
6 deletions
danse.info.yml
+
1
−
1
View file @
d6235b51
name
:
Drupal Audit Notification Subscription Event
type
:
module
description
:
Event driven framework to audit system activity, create notifications from them and allow users to subscribe to them.
core_version_requirement
:
^10 || ^11
core_version_requirement
:
^10
.3
|| ^11
package
:
DANSE
configure
:
danse.settings
...
...
This diff is collapsed.
Click to expand it.
modules/eca/src/Event/RecipientSelection.php
+
8
−
3
View file @
d6235b51
...
...
@@ -4,6 +4,7 @@ namespace Drupal\eca_danse\Event;
use
Drupal\Core\Entity\ContentEntityInterface
;
use
Drupal\Core\Entity\Plugin\DataType\EntityAdapter
;
use
Drupal\Core\TypedData\Exception\MissingDataException
;
use
Drupal\eca\Plugin\DataType\DataTransferObject
;
/**
...
...
@@ -54,9 +55,13 @@ class RecipientSelection extends BaseEvent {
public
function
getRecipientsAsList
():
array
{
$this
->
init
();
$result
=
[];
foreach
(
$this
->
recipients
as
$item
)
{
// @todo For D10 the next one always evaluates to false, but in D11 it is
// a reasonable condition. How do we fix that?
try
{
$items
=
$this
->
recipients
->
toArray
();
}
catch
(
MissingDataException
)
{
$items
=
[];
}
foreach
(
$items
as
$item
)
{
if
(
is_scalar
(
$item
))
{
$result
[]
=
$item
;
}
...
...
This diff is collapsed.
Click to expand it.
src/Form/Settings.php
+
6
−
2
View file @
d6235b51
...
...
@@ -3,6 +3,7 @@
namespace
Drupal\danse\Form
;
use
Drupal\Core\Config\ConfigFactoryInterface
;
use
Drupal\Core\Config\TypedConfigManagerInterface
;
use
Drupal\Core\Form\ConfigFormBase
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\danse\RecipientSelectionManager
;
...
...
@@ -33,13 +34,15 @@ final class Settings extends ConfigFormBase {
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typedConfigManager
* The typed config manager.
* @param \Drupal\danse\Service $danse
* The DANSE services.
* @param \Drupal\danse\RecipientSelectionManager $recipient_selection_manager
* The recipient selection plugin manager.
*/
public
function
__construct
(
ConfigFactoryInterface
$config_factory
,
Service
$danse
,
RecipientSelectionManager
$recipient_selection_manager
)
{
parent
::
__construct
(
$config_factory
);
public
function
__construct
(
ConfigFactoryInterface
$config_factory
,
TypedConfigManagerInterface
$typedConfigManager
,
Service
$danse
,
RecipientSelectionManager
$recipient_selection_manager
)
{
parent
::
__construct
(
$config_factory
,
$typedConfigManager
);
$this
->
danse
=
$danse
;
$this
->
recipientSelectionManager
=
$recipient_selection_manager
;
}
...
...
@@ -50,6 +53,7 @@ final class Settings extends ConfigFormBase {
public
static
function
create
(
ContainerInterface
$container
):
Settings
{
return
new
Settings
(
$container
->
get
(
'config.factory'
),
$container
->
get
(
'config.typed'
),
$container
->
get
(
'danse.service'
),
$container
->
get
(
'plugin.manager.danse.recipient.selection'
)
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment