src/PaymentSlip.php
protected function setAttributes(
        &$element,
        $posX = null,
        $posY = null,
        $width = null,
        $height = null,
        $background = null,
        $fontFamily = null,
        $fontSize = null,
        $fontColor = null,
        $lineHeight = null,
        $textAlign = null
    ) {
        if ($posX) {
            $element['PosX'] = $posX;
        } elseif (!isset($element['PosX'])) {
            $element['PosX'] = 0;
        }
        if ($posY) {
            $element['PosY'] = $posY;
        } elseif (!isset($element['PosY'])) {
            $element['PosY'] = 0;
        }
        if ($width) {
            $element['Width'] = $width;
        } elseif (!isset($element['Width'])) {
            $element['Width'] = 0;
        }
        if ($height) {
            $element['Height'] = $height;
        } elseif (!isset($element['Height'])) {
            $element['Height'] = 0;
        }
        if (!empty($background)) {
            $element['Background'] = $background;
        } elseif (!isset($element['Background'])) {
            $element['Background'] = 'transparent';
        }
        if (!empty($fontFamily)) {
            $element['FontFamily'] = $fontFamily;
        } elseif (!isset($element['FontFamily'])) {
            $element['FontFamily'] = $this->defaultFontFamily;
        }
        if ($fontSize) {
            $element['FontSize'] = $fontSize;
        } elseif (!isset($element['FontSize'])) {
            $element['FontSize'] = $this->defaultFontSize;
        }
        if (!empty($fontColor)) {
            $element['FontColor'] = $fontColor;
        } elseif (!isset($element['FontColor'])) {
            $element['FontColor'] = $this->defaultFontColor;
        }
        if ($lineHeight) {
            $element['LineHeight'] = $lineHeight;
        } elseif (!isset($element['LineHeight'])) {
            $element['LineHeight'] = $this->defaultLineHeight;
        }
        if (!empty($textAlign)) {
            $element['TextAlign'] = $textAlign;
        } elseif (!isset($element['TextAlign'])) {
            $element['TextAlign'] = $this->defaultTextAlign;
        }

        return $this;
    }
protected function setAttributes(
        &$element,
        $posX = null,
        $posY = null,
        $width = null,
        $height = null,
        $background = null,
        $fontFamily = null,
        $fontSize = null,
        $fontColor = null,
        $lineHeight = null,
        $textAlign = null
    ) {
        if ($posX) {
            $element['PosX'] = $posX;
        } elseif (!isset($element['PosX'])) {
            $element['PosX'] = 0;
        }
        if ($posY) {
            $element['PosY'] = $posY;
        } elseif (!isset($element['PosY'])) {
            $element['PosY'] = 0;
        }
        if ($width) {
            $element['Width'] = $width;
        } elseif (!isset($element['Width'])) {
            $element['Width'] = 0;
        }
        if ($height) {
            $element['Height'] = $height;
        } elseif (!isset($element['Height'])) {
            $element['Height'] = 0;
        }
        if (!empty($background)) {
            $element['Background'] = $background;
        } elseif (!isset($element['Background'])) {
            $element['Background'] = 'transparent';
        }
        if (!empty($fontFamily)) {
            $element['FontFamily'] = $fontFamily;
        } elseif (!isset($element['FontFamily'])) {
            $element['FontFamily'] = $this->defaultFontFamily;
        }
        if ($fontSize) {
            $element['FontSize'] = $fontSize;
        } elseif (!isset($element['FontSize'])) {
            $element['FontSize'] = $this->defaultFontSize;
        }
        if (!empty($fontColor)) {
            $element['FontColor'] = $fontColor;
        } elseif (!isset($element['FontColor'])) {
            $element['FontColor'] = $this->defaultFontColor;
        }
        if ($lineHeight) {
            $element['LineHeight'] = $lineHeight;
        } elseif (!isset($element['LineHeight'])) {
            $element['LineHeight'] = $this->defaultLineHeight;
        }
        if (!empty($textAlign)) {
            $element['TextAlign'] = $textAlign;
        } elseif (!isset($element['TextAlign'])) {
            $element['TextAlign'] = $this->defaultTextAlign;
        }

        return $this;
    }
protected function setAttributes ( & $ element , $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { if ( $ posX ) { $ element [ 'PosX' ] = $ posX ; } elseif ( ! isset ( $ element [ 'PosX' ] ) ) { $ element [ 'PosX' ] = 0 ; } if ( $ posY ) { $ element [ 'PosY' ] = $ posY ; } elseif ( ! isset ( $ element [ 'PosY' ] ) ) { $ element [ 'PosY' ] = 0 ; } if ( $ width ) { $ element [ 'Width' ] = $ width ; } elseif ( ! isset ( $ element [ 'Width' ] ) ) { $ element [ 'Width' ] = 0 ; } if ( $ height ) { $ element [ 'Height' ] = $ height ; } elseif ( ! isset ( $ element [ 'Height' ] ) ) { $ element [ 'Height' ] = 0 ; } if ( ! empty ( $ background ) ) { $ element [ 'Background' ] = $ background ; } elseif ( ! isset ( $ element [ 'Background' ] ) ) { $ element [ 'Background' ] = 'transparent' ; } if ( ! empty ( $ fontFamily ) ) { $ element [ 'FontFamily' ] = $ fontFamily ; } elseif ( ! isset ( $ element [ 'FontFamily' ] ) ) { $ element [ 'FontFamily' ] = $ this -> defaultFontFamily ; } if ( $ fontSize ) { $ element [ 'FontSize' ] = $ fontSize ; } elseif ( ! isset ( $ element [ 'FontSize' ] ) ) { $ element [ 'FontSize' ] = $ this -> defaultFontSize ; } if ( ! empty ( $ fontColor ) ) { $ element [ 'FontColor' ] = $ fontColor ; } elseif ( ! isset ( $ element [ 'FontColor' ] ) ) { $ element [ 'FontColor' ] = $ this -> defaultFontColor ; } if ( $ lineHeight ) { $ element [ 'LineHeight' ] = $ lineHeight ; } elseif ( ! isset ( $ element [ 'LineHeight' ] ) ) { $ element [ 'LineHeight' ] = $ this -> defaultLineHeight ; } if ( ! empty ( $ textAlign ) ) { $ element [ 'TextAlign' ] = $ textAlign ; } elseif ( ! isset ( $ element [ 'TextAlign' ] ) ) { $ element [ 'TextAlign' ] = $ this -> defaultTextAlign ; } return $ this ; }
Set the attributes for a given payment slip element

@param array $element The element (attributes) to set.
@param float|null $posX The X position.
@param float|null $posY The Y Position.
@param float|null $width The width.
@param float|null $height The height.
@param string|null $background The background.
@param string|null $fontFamily The font family.
@param float|null $fontSize The font size.
@param string|null $fontColor The font color.
@param float|null $lineHeight The line height.
@param string|null $textAlign The text alignment.
@return $this The current instance for a fluent interface.
Set the attributes for a given payment slip element