Skip to content

Commit

Permalink
better code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
spipu committed Dec 15, 2021
1 parent a087261 commit 41cfdec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/res/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<h1>Billet soirée spécial Html2Pdf</h1>
&nbsp;&nbsp;&nbsp;&nbsp;<b>Valable le <?php echo $date; ?> à 20h30</b><br>
<img src="./res/logo.gif" alt="logo" style="margin-top: 3mm; margin-left: 20mm">
<img src="./res/logo.gif" alt="logo" style="width: 213px; margin-top: 3mm; margin-left: 20mm">
</div>
</td>
</tr>
Expand Down
12 changes: 6 additions & 6 deletions src/CssConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function convertFontSize($css, $parent = 0.)
*
* @access public
* @param string $css
* @return float $value
* @return array
*/
public function convertToRadius($css)
{
Expand Down Expand Up @@ -207,13 +207,13 @@ protected function convertSubColor($c)
* Analyse a background
*
* @param string $css css background properties
* @param &array $value parsed values (by reference, because, ther is a legacy of the parent CSS properties)
* @param &array $value parsed values (by reference, because, there is a legacy of the parent CSS properties)
*
* @return void
*/
public function convertBackground($css, &$value)
{
// is there a image ?
// is there an image ?
$text = '/url\(([^)]*)\)/isU';
if (preg_match($text, $css, $match)) {
// get the image
Expand Down Expand Up @@ -242,15 +242,15 @@ public function convertBackground($css, &$value)
// if ok => it is a color
if ($ok) {
$value['color'] = $color;
// else if transparent => no coloàr
// else if transparent => no color
} elseif ($val === 'transparent') {
$value['color'] = null;
// else
} else {
// try to parse the value as a repeat
$repeat = $this->convertBackgroundRepeat($val);

// if ok => it is repeat
// if ok => it is repeated
if ($repeat) {
$value['repeat'] = $repeat;
// else => it could only be a position
Expand All @@ -275,7 +275,7 @@ public function convertBackground($css, &$value)
*
* @param string $css
*
* @return string|null $value
* @return float[]|null $value
*/
public function convertBackgroundColor($css)
{
Expand Down

0 comments on commit 41cfdec

Please sign in to comment.