Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
layout_builder_restrictions
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
layout_builder_restrictions
Commits
f4717bc1
Commit
f4717bc1
authored
5 months ago
by
Nick Dickinson-Wilde
Committed by
Eirik Morland
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3492427
by nickdickinsonwilde, akulsaxena: Nullable types must be explicit
parent
ef33c75f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!36
3492427 fix nullable types
Pipeline
#362899
passed
5 months ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Traits/PluginHelperTrait.php
+6
-6
6 additions, 6 deletions
src/Traits/PluginHelperTrait.php
with
6 additions
and
6 deletions
src/Traits/PluginHelperTrait.php
+
6
−
6
View file @
f4717bc1
...
...
@@ -116,15 +116,15 @@ trait PluginHelperTrait {
*
* This is based on CategorizingPluginManagerTrait::getGroupedDefinitions.
*
* @param array $definitions
* The definitions as provided by the Block Plugin Manager.
* @param array
|null
$definitions
*
(optional)
The definitions as provided by the Block Plugin Manager.
* @param string $label_key
* The key to use if a block does not have a category defined.
*
* @return array
* Definitions grouped by untranslated category.
*/
public
function
getGroupedDefinitions
(
array
$definitions
=
NULL
,
$label_key
=
'label'
)
{
public
function
getGroupedDefinitions
(
?
array
$definitions
=
NULL
,
$label_key
=
'label'
)
{
$definitions
=
$this
->
getSortedDefinitions
(
$definitions
,
$label_key
);
$grouped_definitions
=
[];
foreach
(
$definitions
as
$id
=>
$definition
)
{
...
...
@@ -203,15 +203,15 @@ trait PluginHelperTrait {
/**
* Sort block categories alphabetically.
*
* @param array $definitions
* The block definitions, with category values.
* @param array
|null
$definitions
*
(optional)
The block definitions, with category values.
* @param string $label_key
* The module name, if no category value is present on the block.
*
* @return array
* The alphabetically sorted categories with definitions.
*/
protected
function
getSortedDefinitions
(
array
$definitions
=
NULL
,
$label_key
=
'label'
)
{
protected
function
getSortedDefinitions
(
?
array
$definitions
=
NULL
,
$label_key
=
'label'
)
{
uasort
(
$definitions
,
function
(
$a
,
$b
)
use
(
$label_key
)
{
if
(
$a
[
'category'
]
!=
$b
[
'category'
])
{
$a
[
'category'
]
=
$a
[
'category'
]
??
''
;
...
...
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