Skip to content

Commit

Permalink
Xml::attr(): remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Nov 20, 2024
1 parent 6adc851 commit 06dc8f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
8 changes: 1 addition & 7 deletions src/Cms/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ class Helpers
// Some of them can be replaced by using `Version` class methods instead
// (see method comments). `Content\Translation::contentFile` should be avoided
// entirely and has no recommended replacement.
'translation-methods' => true,

// Passing a single space as value to `Xml::attr()` has been
// deprecated. In a future version, passing a single space won't
// render an empty value anymore but a single space.
// To render an empty value, please pass an empty string.
'xml-attr-single-space' => true,
'translation-methods' => true
];

/**
Expand Down
9 changes: 0 additions & 9 deletions src/Toolkit/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ public static function attr(
return null;
}

// TODO: In 5.0, remove this block to render space as space
// @codeCoverageIgnoreStart
if ($value === ' ') {
Helpers::deprecated('Passing a single space as value to `Xml::attr()` has been deprecated. In a future version, passing a single space won\'t render an empty value anymore but a single space. To render an empty value, please pass an empty string.', 'xml-attr-single-space');

return $name . '=""';
}
// @codeCoverageIgnoreEnd

if ($value === true) {
return $name . '="' . $name . '"';
}
Expand Down

0 comments on commit 06dc8f9

Please sign in to comment.