Skip to content

Commit

Permalink
Merge pull request #6803 from getkirby/v5/fix/xml-attr-remove-deprecated
Browse files Browse the repository at this point in the history
`Xml::attr()`: remove deprecated code
  • Loading branch information
bastianallgeier authored Nov 21, 2024
2 parents 2591e8f + 6f09481 commit 14e4685
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 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
10 changes: 0 additions & 10 deletions src/Toolkit/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Kirby\Toolkit;

use Kirby\Cms\Helpers;
use SimpleXMLElement;

/**
Expand Down Expand Up @@ -97,15 +96,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 14e4685

Please sign in to comment.