Skip to content

Commit

Permalink
Fix phpcs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo-d committed Jan 29, 2024
1 parent d0c6e8a commit ff6813b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
15 changes: 9 additions & 6 deletions src/Elements/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ protected function styles($styles): string
return trim($styles);
}

protected function renderChildren($children, $options = []) {
protected function renderChildren($children, $options = [])

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (8.1, false)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has no return type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (8.1, false)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has parameter $children with no type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (8.2, true)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has no return type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (8.2, true)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has parameter $children with no type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (8.0, false)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has no return type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (8.0, false)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has parameter $children with no type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (7.4, false)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has no return type specified.

Check failure on line 223 in src/Elements/AbstractElement.php

View workflow job for this annotation

GitHub Actions / 3️⃣ Static analysis checks (7.4, false)

Method MadeByDenis\PhpMjmlRenderer\Elements\AbstractElement::renderChildren() has parameter $children with no type specified.
{

$children = $children ?? $this->children;

Expand Down Expand Up @@ -274,12 +275,14 @@ protected function renderChildren($children, $options = []) {
//
// index++ // eslint-disable-line no-plusplus
// })
return $output;
}

return $output;
}

private function formatAttributes(array $defaultAttributes, array $allowedAttributes, ?array $passedAttributes = []): array
{
private function formatAttributes(
array $defaultAttributes,
array $allowedAttributes,
?array $passedAttributes = []
): array {
/*
* Check if the attributes are of the proper format based on the allowed attributes.
* For instance, if you pass a non string value to the 'align' attribute, you should get an error.
Expand Down
6 changes: 3 additions & 3 deletions src/Elements/ElementFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ private static function getTagClass(string $tag): string

// We can do this, because we are using PSR-4 convention.
$classFQN = 'MadeByDenis\\PhpMjmlRenderer\\Elements' . self::getElementClass(
__DIR__,
$fileInfo->getPathName()
);
__DIR__,
$fileInfo->getPathName()
);
$classNames[$classFQN::TAG_NAME] = $classFQN;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Validation/TypeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TypeValidator implements Validator
*
* @var String[]
*/
private array $namedColors = ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'inherit', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'transparent', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen',];
private array $namedColors = ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'inherit', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'transparent', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen',]; // phpcs:ignore Generic.Files.LineLength

private array $allowedAlignment = [
'left' => true,
Expand Down Expand Up @@ -88,12 +88,12 @@ public function isValidColor(string $color): bool

// Check if the color is in valid LAB format.
if (preg_match('/^lab\(\d+(\.\d+)?%?,?\s?\d+(\.\d+)?,?\s?\d+(\.\d+)|(\s?\/?\s?\d+(\.\d+))?\)$/', $color)) {
return true;
return true;
}

// Check if the color is in valid LCH format.
if (preg_match('/^lch\(\d+(\.\d+)?%?,?\s?\d+(\.\d+)?,?\s?\d+(\.\d+)|(\s?\/?\s?\d+(\.\d+))?\)$/', $color)) {
return true;
return true;
}

// Check if the color is in valid Oklab format.
Expand Down

0 comments on commit ff6813b

Please sign in to comment.