• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Seretos / tcpdf-markdown / 17508958800

06 Sep 2025 02:47AM UTC coverage: 67.411% (-25.7%) from 93.103%
17508958800

push

github

Seretos
add first tcpdf implementations

1 of 211 new or added lines in 7 files covered. (0.47%)

513 of 761 relevant lines covered (67.41%)

21.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Tcpdf/Elements/TcpdfLine.php
1
<?php
2
declare(strict_types=1);
3
/**
4
 * author:  aappen
5
 * project: tcpdf-markdown
6
 */
7

8
namespace seretos\TCPDFMarkdown\Tcpdf\Elements;
9

10
use seretos\TCPDFMarkdown\Tcpdf\TcpdfCell;
11

12
class TcpdfLine extends TcpdfCell
13
{
14
    /*public function __construct(Pdf $pdf, float $x, float $y, float $width, TcpdfStyle $style = new TcpdfStyle())
15
    {
16
        parent::__construct($pdf, $x, $y, $width, $style);
17
    }*/
18

19
    private float $_height = .0;
20
    private float $_width = .0;
21

22
    public function canAddText(TcpdfText $text): bool {
NEW
23
        $currentWidth = $this->getWidth();
×
NEW
24
        $textWidth = $text->getWidth();
×
NEW
25
        if($currentWidth + $textWidth <= $this->width)
×
NEW
26
            return true;
×
NEW
27
        return false;
×
28
    }
29

30
    public function getWidth(): float
31
    {
NEW
32
        return $this->_width;
×
33
    }
34

35
    public function getHeight(): float {
NEW
36
        return $this->_height;
×
37
    }
38

39
    public function addChild(TcpdfCell $child): static
40
    {
NEW
41
        if(!$child instanceof TcpdfText)
×
NEW
42
            return $this;
×
NEW
43
        if($this->style->isTrimLines() && count($this->children) === 0 && trim($child->getText()) === '')
×
NEW
44
            return $this;
×
NEW
45
        $child->x = $this->x + $this->getWidth();
×
NEW
46
        $child->y = $this->y;
×
NEW
47
        if($child->getHeight() > $this->_height)
×
NEW
48
            $this->_height = $child->getHeight();
×
NEW
49
        $this->_width += $child->getWidth();
×
NEW
50
        return parent::addChild($child);
×
51
    }
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc