Remove unused SettingsController::convertStylesToString method
[MAILPOET-5798]
This commit is contained in:
committed by
Rostislav Wolný
parent
15e0c3fa4d
commit
47a4871600
@ -103,17 +103,6 @@ class SettingsController {
|
||||
return "{$width}px";
|
||||
}
|
||||
|
||||
/**
|
||||
* This functions converts an array of styles to a string that can be used in HTML.
|
||||
*/
|
||||
public function convertStylesToString(array $styles): string {
|
||||
$cssString = '';
|
||||
foreach ($styles as $property => $value) {
|
||||
$cssString .= $property . ':' . $value . ';';
|
||||
}
|
||||
return trim($cssString); // Remove trailing space and return the formatted string
|
||||
}
|
||||
|
||||
public function parseStylesToArray(string $styles): array {
|
||||
$styles = explode(';', $styles);
|
||||
$parsedStyles = [];
|
||||
|
@ -26,15 +26,4 @@ class SettingsControllerTest extends \MailPoetUnitTest {
|
||||
$expectedWidth = (int)SettingsController::EMAIL_WIDTH - 10 * 2;
|
||||
verify($layoutWidth)->equals($expectedWidth . 'px');
|
||||
}
|
||||
|
||||
public function testItConvertsStylesToString(): void {
|
||||
$settingsController = new SettingsController($this->makeEmpty(ThemeController::class));
|
||||
$styles = [
|
||||
'width' => '600px',
|
||||
'background' => '#ffffff',
|
||||
'padding-left' => '15px',
|
||||
];
|
||||
$string = $settingsController->convertStylesToString($styles);
|
||||
verify($string)->equals('width:600px;background:#ffffff;padding-left:15px;');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user