Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ui_patterns
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
ui_patterns
Commits
56e86dc6
Commit
56e86dc6
authored
7 months ago
by
Sviatoslav Smovdyr
Committed by
Pierre Dureau
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3481051
by smovs, pdureau: Use Drupal YAML dumper instead of Symfony?
parent
695e2c1b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!245
#3481051 - Used Drupal YAML dumper instead of Symfony.
Pipeline
#311951
passed
7 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/ui_patterns_devel/src/Controller/ComponentValidatorOverview.php
+2
-2
2 additions, 2 deletions
...terns_devel/src/Controller/ComponentValidatorOverview.php
modules/ui_patterns_legacy/src/ComponentWriter.php
+2
-2
2 additions, 2 deletions
modules/ui_patterns_legacy/src/ComponentWriter.php
with
4 additions
and
4 deletions
modules/ui_patterns_devel/src/Controller/ComponentValidatorOverview.php
+
2
−
2
View file @
56e86dc6
...
...
@@ -6,6 +6,7 @@ namespace Drupal\ui_patterns_devel\Controller;
use
Drupal\Component\Render\FormattableMarkup
;
use
Drupal\Component\Render\MarkupInterface
;
use
Drupal\Component\Serialization\Yaml
;
use
Drupal\Core\Controller\ControllerBase
;
use
Drupal\Core\DependencyInjection\AutowireTrait
;
use
Drupal\Core\Link
;
...
...
@@ -16,7 +17,6 @@ use Drupal\ui_patterns\ComponentPluginManager;
use
Drupal\ui_patterns_devel
\Validator
;
use
Symfony\Component\DependencyInjection\Attribute\Autowire
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\Yaml\Yaml
;
/**
* Returns responses for UI Patterns Devel routes.
...
...
@@ -465,7 +465,7 @@ final class ComponentValidatorOverview extends ControllerBase {
'#description'
=>
$this
->
t
(
'Definition processed by the code before rendering.'
),
'#open'
=>
FALSE
,
'#weight'
=>
3
,
[
'#markup'
=>
'<pre><code>'
.
\htmlentities
((
string
)
Yaml
::
dump
(
$component
->
getPluginDefinition
()
,
10
,
2
))
.
'</code></pre>'
],
[
'#markup'
=>
'<pre><code>'
.
\htmlentities
((
string
)
Yaml
::
encode
(
$component
->
getPluginDefinition
()))
.
'</code></pre>'
],
];
$build
[
'source'
]
=
[
...
...
This diff is collapsed.
Click to expand it.
modules/ui_patterns_legacy/src/ComponentWriter.php
+
2
−
2
View file @
56e86dc6
...
...
@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace
Drupal\ui_patterns_legacy
;
use
Drupal\Component\Serialization\Yaml
;
use
Symfony\Component\Finder\Finder
;
use
Symfony\Component\Yaml\Yaml
;
/**
* Component writer.
...
...
@@ -28,7 +28,7 @@ class ComponentWriter {
// - empty objects: Symfony does "{ }", Prettier does "{}"
// - arrays of objects: Symfony adds a line break after dash, Prettier
// doesn't.
$yaml
=
Yaml
::
dump
(
$definition
,
10
,
2
);
$yaml
=
Yaml
::
encode
(
$definition
);
file_put_contents
(
$path
.
$filename
,
$yaml
);
}
...
...
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