Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
typed_data
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
typed_data
Commits
b8d0636b
Commit
b8d0636b
authored
10 months ago
by
Tim Rohaly
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3477441
by tr: Parameter typing in PlaceholderResolver service
parent
725f280f
No related branches found
No related tags found
1 merge request
!35
Issue #3477441 by tr: Parameter typing in PlaceholderResolver service
Pipeline
#294887
passed
10 months ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/PlaceholderResolver.php
+4
-2
4 additions, 2 deletions
src/PlaceholderResolver.php
src/PlaceholderResolverInterface.php
+2
-2
2 additions, 2 deletions
src/PlaceholderResolverInterface.php
src/PlaceholderResolverTrait.php
+2
-0
2 additions, 0 deletions
src/PlaceholderResolverTrait.php
with
8 additions
and
4 deletions
src/PlaceholderResolver.php
+
4
−
2
View file @
b8d0636b
<?php
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\typed_data
;
namespace
Drupal\typed_data
;
use
Drupal\Component\Render\HtmlEscapedText
;
use
Drupal\Component\Render\HtmlEscapedText
;
...
@@ -45,7 +47,7 @@ class PlaceholderResolver implements PlaceholderResolverInterface {
...
@@ -45,7 +47,7 @@ class PlaceholderResolver implements PlaceholderResolverInterface {
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
resolvePlaceholders
(
string
$text
,
array
$data
=
[],
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
array
{
public
function
resolvePlaceholders
(
string
$text
,
array
$data
=
[],
?
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
array
{
$options
+=
[
$options
+=
[
'langcode'
=>
NULL
,
'langcode'
=>
NULL
,
'clear'
=>
FALSE
,
'clear'
=>
FALSE
,
...
@@ -163,7 +165,7 @@ class PlaceholderResolver implements PlaceholderResolverInterface {
...
@@ -163,7 +165,7 @@ class PlaceholderResolver implements PlaceholderResolverInterface {
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
replacePlaceHolders
(
string
$text
,
array
$data
=
[],
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
string
{
public
function
replacePlaceHolders
(
string
$text
,
array
$data
=
[],
?
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
string
{
$replacements
=
$this
->
resolvePlaceholders
(
$text
,
$data
,
$bubbleable_metadata
,
$options
);
$replacements
=
$this
->
resolvePlaceholders
(
$text
,
$data
,
$bubbleable_metadata
,
$options
);
$placeholders
=
array_keys
(
$replacements
);
$placeholders
=
array_keys
(
$replacements
);
...
...
This diff is collapsed.
Click to expand it.
src/PlaceholderResolverInterface.php
+
2
−
2
View file @
b8d0636b
...
@@ -45,7 +45,7 @@ interface PlaceholderResolverInterface {
...
@@ -45,7 +45,7 @@ interface PlaceholderResolverInterface {
* An array of replacement values for the placeholders contained in the
* An array of replacement values for the placeholders contained in the
* text, keyed by placeholder.
* text, keyed by placeholder.
*/
*/
public
function
resolvePlaceholders
(
string
$text
,
array
$data
=
[],
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
array
;
public
function
resolvePlaceholders
(
string
$text
,
array
$data
=
[],
?
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
array
;
/**
/**
* Replaces the placeholders in the given text.
* Replaces the placeholders in the given text.
...
@@ -87,7 +87,7 @@ interface PlaceholderResolverInterface {
...
@@ -87,7 +87,7 @@ interface PlaceholderResolverInterface {
* otherwise for example the result can be put into #markup, in which case
* otherwise for example the result can be put into #markup, in which case
* it would be sanitized by Xss::filterAdmin().
* it would be sanitized by Xss::filterAdmin().
*/
*/
public
function
replacePlaceHolders
(
string
$text
,
array
$data
=
[],
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
string
;
public
function
replacePlaceHolders
(
string
$text
,
array
$data
=
[],
?
BubbleableMetadata
$bubbleable_metadata
=
NULL
,
array
$options
=
[]):
string
;
/**
/**
* Builds a list of all placeholder tokens that appear in the text.
* Builds a list of all placeholder tokens that appear in the text.
...
...
This diff is collapsed.
Click to expand it.
src/PlaceholderResolverTrait.php
+
2
−
0
View file @
b8d0636b
<?php
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\typed_data
;
namespace
Drupal\typed_data
;
/**
/**
...
...
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