style: phpcs (ItemKeys, VariableValue, Docblock)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
c6daae131d
commit
2307027eae
@@ -14,8 +14,13 @@ final class ItemKeys
|
||||
* @param list<string> $allowed
|
||||
* @param array<string, string> $errors gets one entry per unknown key (field.key)
|
||||
*/
|
||||
public static function refuseUnknown(array $item, array $allowed, string $field, array &$errors, string $deleteHint): void
|
||||
{
|
||||
public static function refuseUnknown(
|
||||
array $item,
|
||||
array $allowed,
|
||||
string $field,
|
||||
array &$errors,
|
||||
string $deleteHint
|
||||
): void {
|
||||
foreach (array_diff(array_map('strval', array_keys($item)), $allowed) as $key) {
|
||||
$errors[$field . '.' . $key] = $key === 'delete' ? 'unbekanntes Feld; ' . $deleteHint : 'unbekanntes Feld';
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ defined('ABSPATH') || exit;
|
||||
* with variable, ruling V9): every attribute value that is exactly one reference $variable({"type":"content",
|
||||
* "value":{"name":"<id>",…}})$ becomes the value – for a strings variable with the reference's own before/after
|
||||
* around it. References embedded in a longer text stay (Divi resolves them inside the text; cutting them out would
|
||||
* change the text) and are reported through leftover() (ReportsLeftovers). Other references – colors, other variables, dynamic content – stay
|
||||
* untouched. Pure PHP.
|
||||
* change the text) and are reported through leftover() (ReportsLeftovers). Other references – colors, other
|
||||
* variables, dynamic content – stay untouched. Pure PHP.
|
||||
*/
|
||||
final class VariableDetachRewrite implements NodeRewrite, ReportsLeftovers
|
||||
{
|
||||
|
||||
@@ -77,8 +77,9 @@ final class VariableValue
|
||||
|
||||
private static function links(string $value): ?string
|
||||
{
|
||||
if (mb_strlen($value) > self::URL_MAX || preg_match(self::URL, $value) !== 1
|
||||
|| preg_match(self::URL_CONTROL, $value) === 1) {
|
||||
$invalid = mb_strlen($value) > self::URL_MAX || preg_match(self::URL, $value) !== 1
|
||||
|| preg_match(self::URL_CONTROL, $value) === 1;
|
||||
if ($invalid) {
|
||||
return 'Link: eine http(s)://- oder /-URL, mailto: oder tel: mit höchstens 2000 Zeichen.';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user