YetiForceCompany/YetiForcePDF

View on GitHub
lib/Objects/TextStream.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid variables with short names like $x. Configured minimum length is 3.
Open

    public function setX(float $x): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $y. Configured minimum length is 3.
Open

    protected $y = 0;
Severity: Minor
Found in lib/Objects/TextStream.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $y. Configured minimum length is 3.
Open

    public function setY(float $y): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $x. Configured minimum length is 3.
Open

    protected $x = 0;
Severity: Minor
Found in lib/Objects/TextStream.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Spaces must be used to indent lines; tabs are not allowed
Open

     * Object name.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $text
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->text = $this->escape($text);
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \YetiForcePDF\Objects\Font $font
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set text x position inside current page.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->font = $font;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setX(float $x): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set text x position inside current page.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Text stream.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $font;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var int
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set text.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \YetiForcePDF\Objects\TextStream
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \YetiForcePDF\Objects\TextStream
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $text = '';
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param float $x
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param float $y
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $x = 0;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var int
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->x = $x;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param float $fontSize
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Font for text stream.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var \YetiForcePDF\Objects\Font
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Text y position at current page.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setText(string $text): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setFont(Font $font): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var float
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $y = 0;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->fontSize = $fontSize;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Text x position at current page.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \YetiForcePDF\Objects\Basic\TextStream
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setFontSize(float $fontSize): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set font.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \YetiForcePDF\Objects\TextStream
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $name = 'TextStream';
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Font size.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set font size.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $fontSize = 10;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Escape string.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function escape(string $str): string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        ]);
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            'endstream',
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return implode("\n", [
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setY(float $y): self
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Line exceeds 120 characters; contains 146 characters
Open

        return 'BT ' . $this->x . ' ' . $this->y . ' Td /' . $this->font->getNumber() . ' ' . $this->fontSize . ' Tf (' . $this->text . ') Tj ET';
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $stream,
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $str
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get raw text stream.
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->y = $y;
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            'endobj',
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getRawStream(): string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return 'BT ' . $this->x . ' ' . $this->y . ' Td /' . $this->font->getNumber() . ' ' . $this->fontSize . ' Tf (' . $this->text . ') Tj ET';
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $stream = $this->getRawStream();
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return strtr($str, [')' => '\\)', '(' => '\\(', '\\' => '\\\\', \chr(13) => '\r']);
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            '<</Length ' . \strlen($stream) . '>>stream',
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->getRawId() . ' obj',
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \YetiForcePDF\Objects\TextStream
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * {@inheritdoc}
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function render(): string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string
Severity: Minor
Found in lib/Objects/TextStream.php by phpcodesniffer

There are no issues that match your filters.

Category
Status