Commit 8e2009f7 authored by catch's avatar catch
Browse files

Issue #2608054 by stefan.r: Give more context in invalid placeholder error...

Issue #2608054 by stefan.r: Give more context in invalid placeholder error message PlaceholderTrait::placeholderFormat()
parent 5098f718
......@@ -237,7 +237,7 @@ protected static function placeholderFormat($string, array $args) {
if (!ctype_alpha($key[0])) {
// We trigger an error as we may want to introduce new placeholders
// in the future without breaking backward compatibility.
trigger_error('Invalid placeholder: ' . $key, E_USER_ERROR);
trigger_error('Invalid placeholder (' . $key . ') in string: ' . $string, E_USER_ERROR);
}
break;
}
......
......@@ -205,7 +205,7 @@ public function testUnexpectedFormat() {
restore_error_handler();
$this->assertEquals(E_USER_ERROR, $this->lastErrorNumber);
$this->assertEquals('Invalid placeholder: ~placeholder', $this->lastErrorMessage);
$this->assertEquals('Invalid placeholder (~placeholder) in string: Broken placeholder: ~placeholder', $this->lastErrorMessage);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment