File BlockBox.php
has 517 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* BlockBox class.
BlockBox
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
The class BlockBox has 27 non-getter- and setter-methods. Consider refactoring BlockBox to keep number of methods under 25. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class BlockBox has 25 public methods. Consider refactoring BlockBox to keep number of public methods under 10. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class BlockBox has an overall complexity of 94 which is very high. The configured complexity threshold is 50. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Exclude checks
Function measureWidth
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
$dimensions = $this->getDimensions();
$parent = $this->getParent();
if ($parent) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method measureWidth
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
$dimensions = $this->getDimensions();
$parent = $this->getParent();
if ($parent) {
Function measureOffset
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
return $this;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method measureOffset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
return $this;
}
Function mergeLineGroups
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function mergeLineGroups(array $lineGroups)
{
$lines = [];
foreach ($lineGroups as $lines) {
if (!empty($lines)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function divideLines
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function divideLines()
{
$this->mergeLineGroups($this->groupLines());
foreach ($this->getChildren() as $child) {
if ($child instanceof LineBox) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function replacePageNumbers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function replacePageNumbers()
{
$allChildren = [];
$this->getAllChildren($allChildren);
foreach ($allChildren as $child) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function hideEmptyLines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function hideEmptyLines()
{
foreach ($this->getChildren() as $child) {
if ($child instanceof LineBox) {
if ($child->isEmpty() && !$child->getStyle()->haveSpacing()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method addBackgroundImageInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addBackgroundImageInstructions(array $element, $pdfX, $pdfY, $width, $height)
Method addBackgroundColorInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addBackgroundColorInstructions(array $element, $pdfX, $pdfY, $width, $height)
Function groupLines
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function groupLines()
{
$lineGroups = [];
$currentGroup = 0;
foreach ($this->getChildren() as $child) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method measureWidth() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public function measureWidth(bool $afterPageDividing = false)
{
$dimensions = $this->getDimensions();
$parent = $this->getParent();
if ($parent) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Class "BlockBox" has 33 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed. Open
public function measureWidth(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Reduce the number of returns of this function 4, down to the maximum allowed 3. Open
public function measureWidth(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.
Noncompliant Code Example
With the default threshold of 3:
function myFunction(){ // Noncompliant as there are 4 return statements if (condition1) { return true; } else { if (condition2) { return false; } else { return true; } } return false; }
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. Open
public function measureOffset(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
The class BlockBox has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The method measurePosition has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation. Open
public function measurePosition(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method measureWidth has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation. Open
public function measureWidth(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method measureOffset has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation. Open
public function measureOffset(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method measureHeight has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation. Open
public function measureHeight(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method layout has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation. Open
public function layout(bool $afterPageDividing = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureWidth'. Open
$dimensions->setWidth(Math::sub($parent->getDimensions()->getInnerWidth(), $this->getStyle()->getHorizontalMarginsWidth()));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureOffset'. Open
$left = Math::add($left, $this->getStyle()->getRules('margin-left'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method hideEmptyLines uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$child->setRenderable();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '652', column '7'). Open
public function measurePosition(bool $afterPageDividing = false)
{
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
return $this;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureOffset'. Open
$top = Math::add($top, (string) $marginTop);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureOffset'. Open
$marginTop = Math::add($marginTop, $previous->getStyle()->getRules('margin-bottom'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measurePosition'. Open
$y = Math::add($parent->getCoordinates()->getY(), $this->getOffset()->getTop());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getNewLineBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->appendChild($this->currentLineBox);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method appendBarcodeBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$currentLineBox = $this->getNewLineBox();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method appendInlineBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$currentLineBox = $this->getNewLineBox();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureWidth'. Open
$maxWidth = Math::sub($maxWidth, $style->getHorizontalMarginsWidth());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureOffset'. Open
$top = Math::add($previous->getOffset()->getTop(), $previous->getDimensions()->getHeight());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measurePosition'. Open
$x = Math::add($parent->getCoordinates()->getX(), $this->getOffset()->getLeft());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method appendInlineBlockBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$currentLineBox = $this->getNewLineBox();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method groupLines uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (isset($lineGroups[$currentGroup])) {
++$currentGroup;
}
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '612', column '7'). Open
public function measureOffset(bool $afterPageDividing = false)
{
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
return $this;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureOffset'. Open
$marginTop = Math::comp($marginTop, $previous->getStyle()->getRules('margin-bottom')) > 0 ? $marginTop : $previous->getStyle()->getRules('margin-bottom');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureHeight'. Open
$height = Math::add($height, $child->getDimensions()->getHeight(), $child->getStyle()->getVerticalMarginsWidth());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureHeight'. Open
$height = Math::add($height, $style->getVerticalPaddingsWidth(), $style->getVerticalBordersWidth());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '616', column '8'). Open
public function measureOffset(bool $afterPageDividing = false)
{
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
return $this;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureWidth'. Open
$maxWidth = Math::max($maxWidth, $child->getDimensions()->getOuterWidth());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureWidth'. Open
$maxWidth = Math::add($maxWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "display" 4 times. Open
$box->getStyle()->init()->setRule('display', 'block');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Rename "$currentLineBox" which has the same name as the field declared at line 31. Open
$currentLineBox = $this->getCurrentLineBox();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Define a constant instead of duplicating this literal "margin-bottom" 3 times. Open
$marginTop = Math::comp($marginTop, $previous->getStyle()->getRules('margin-bottom')) > 0 ? $marginTop : $previous->getStyle()->getRules('margin-bottom');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "background-color" 4 times. Open
if ('transparent' !== $rules['background-color']) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Rename "$currentLineBox" which has the same name as the field declared at line 31. Open
$currentLineBox = $this->getCurrentLineBox();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$currentLineBox" which has the same name as the field declared at line 31. Open
$currentLineBox = $this->getCurrentLineBox();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Avoid unused parameters such as '$childDomElement'. Open
public function appendWatermarkBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$parentBlock'. Open
public function appendWatermarkBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$childDomElement'. Open
public function appendHeaderBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$childDomElement'. Open
public function appendStyleBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$parentBlock'. Open
public function appendHeaderBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$parentBlock'. Open
public function appendBarcodeBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$parentBlock'. Open
public function appendFooterBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$parentBlock'. Open
public function appendStyleBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$childDomElement'. Open
public function appendFooterBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$parentBlock'. Open
public function appendFontBox($childDomElement, $element, $style, $parentBlock)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function addBackgroundColorInstructions(array $element, $pdfX, $pdfY, $width, $height)
{
if ('none' === $this->getStyle()->getRules('display')) {
return $element;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 192.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
public function appendWatermarkBox($childDomElement, $element, $style, $parentBlock)
{
if ($this->getCurrentLineBox()) {
$this->closeLine();
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
public function appendFooterBox($childDomElement, $element, $style, $parentBlock)
{
if ($this->getCurrentLineBox()) {
$this->closeLine();
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
public function appendHeaderBox($childDomElement, $element, $style, $parentBlock)
{
if ($this->getCurrentLineBox()) {
$this->closeLine();
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid variables with short names like $x. Configured minimum length is 3. Open
$x = $this->document->getCurrentPage()->getCoordinates()->getX();
- Read upRead up
- Exclude checks
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
$y = $this->document->getCurrentPage()->getCoordinates()->getY();
- Read upRead up
- Exclude checks
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
* Parent width cache.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $currentLineBox;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \YetiForcePDF\Layout\LineBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function init()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->currentLineBox->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeLine();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setFontFamily($childDomElement->getAttribute('data-family'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setBox($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$style = (new Style())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new HeaderBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setFontWeight($childDomElement->getAttribute('data-weight'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new StyleBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Append barcode box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->dimensions = (new BoxDimensions())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getElement()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->element = $element;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $createNew
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->currentLineBox;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $childDomElement
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return HeaderBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Append font box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new FontBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->buildTree($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setElement(Element $element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \YetiForcePDF\Layout\LineBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendFooterBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->buildTree($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendWatermarkBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeLine();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setDisplayable(false)->setRenderable(false)->setForMeasurement(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLineBox = $this->getCurrentLineBox();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Close line box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get current linebox.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \InvalidArgumentException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $currentLineBox->appendBarcode($childDomElement, $element, $style, $this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var LineBox[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->offset = (new Offset())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Element $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element->setBox($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'always' === $this->getStyle()->getRules('break-page-after');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($this->currentLineBox);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->saveSourceLine($this->currentLineBox);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Append header box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $style
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->loadFont();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \YetiForcePDF\Layout\LineBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->currentLineBox;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendBlockBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendHeaderBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setDisplayable(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $childDomElement
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get element.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setBox($this->currentLineBox);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->currentLineBox->setStyle($style);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $childDomElement
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeLine();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setDisplayable(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeLine();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->getStyle()->init()->setRule('display', 'block');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// if parent doesn't have a width specified
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \InvalidArgumentException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new WatermarkBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \InvalidArgumentException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLineBox = $this->getNewLineBox();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $sourceLines = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setBox($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get new line box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \YetiForcePDF\Layout\LineBox|null $lineBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Append watermark box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return HeaderBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->insertBefore($this->currentLineBox, $before);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->currentLineBox;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \YetiForcePDF\Layout\LineBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $style
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \InvalidArgumentException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setElement($element)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLineBox = $this->getCurrentLineBox();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $parentWidth = '0';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setBox($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->element;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->currentLineBox = (new LineBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new FooterBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setDisplayable(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new TableWrapperBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->coordinates = (new Coordinates())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setDocument($this->document)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Box $before [optional]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set element.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->currentLineBox = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function closeLine()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new self())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $style
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeLine();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return HeaderBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->appendChild($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function shouldBreakPage()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setDisplayable(false)->setRenderable(false)->setForMeasurement(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getCurrentLineBox()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->buildTree($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendFontBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Append footer box.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setFontFile($childDomElement->getAttribute('data-file'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Should we break page after this element?
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return HeaderBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendStyleBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getNewLineBox($before = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $before) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $style
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $childDomElement
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $style
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->buildTree($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setFontStyle($childDomElement->getAttribute('data-style'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->buildTree($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $childDomElement
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \InvalidArgumentException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->closeLine();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setParent($this)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// we wan't to build tree from here - we will build it from TableBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return HeaderBox
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendBarcodeBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLineBox = $this->getCurrentLineBox();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->parentWidth === $parent->getDimensions()->getWidth()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->measureWidth($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->measureWidth($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$currentGroup;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $lineGroups
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lines = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($lineGroups as $lines) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($child instanceof LineBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$height = Math::add($height, $child->getDimensions()->getHeight(), $child->getStyle()->getVerticalMarginsWidth());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->applyStyleHeight();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->measureWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Replace page numbers.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$style = $this->getStyle();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $parent->getDimensions()->getWidth()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Group sibling line boxes into two dimensional array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lineGroups = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Merge line groups into one line (reverse divide - reorganize).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxWidth = Math::sub($maxWidth, $style->getHorizontalMarginsWidth());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($child instanceof LineBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $lineGroups;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->insertBefore($line, $child);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLine = $this->getNewLineBox($lines[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Divide lines.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Measure height.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$left = $this->document->getCurrentPage()->getCoordinates()->getX();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$left = $parentStyle->getOffsetLeft();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$marginTop = Math::comp($marginTop, $previous->getStyle()->getRules('margin-bottom')) > 0 ? $marginTop : $previous->getStyle()->getRules('margin-bottom');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->measureHeight($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getDimensions()->setHeight($height);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dimensions->setWidth(Math::sub($parent->getDimensions()->getInnerWidth(), $this->getStyle()->getHorizontalMarginsWidth()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getAllChildren($allChildren);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->measurePosition($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$graphicStateStr = '/' . $graphicState->getNumber() . ' gs';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->measureWidth($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function saveSourceLine(LineBox $line)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Offset elements.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($previous->getOffset()->getTop()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (!$previous instanceof LineBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parent = $this->getParent();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function measurePosition(bool $afterPageDividing = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getCoordinates()->setX($x);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getCoordinates()->setY($y);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$width = $this->document->getCurrentPage()->getDimensions()->getWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function mergeLineGroups(array $lineGroups)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($lines)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->removeChild($line);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this instanceof InlineBlockBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->removeChild($child);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$height = Math::add($height, $child->getDimensions()->getHeight(), $child->getStyle()->getVerticalMarginsWidth());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->measureOffset($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Layout elements.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pages = (string) $this->document->getCurrentPage()->getPageCount();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($line->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lines[] = $currentLine;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function groupLines()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($parent) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->sourceLines[] = $line->clone();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return LineBox[]
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$dimensions->setWidth(Math::sub($parent->getDimensions()->getInnerWidth(), $this->getStyle()->getHorizontalMarginsWidth()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $lines;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($oldWidth !== $this->getDimensions()->getWidth()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function hideEmptyLines()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$line->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$style = $this->getStyle();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 174 characters Open
$marginTop = Math::comp($marginTop, $previous->getStyle()->getRules('margin-bottom')) > 0 ? $marginTop : $previous->getStyle()->getRules('margin-bottom');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function measureOffset(bool $afterPageDividing = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $afterPageDividing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->alignText();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$marginTop = $this->getStyle()->getRules('margin-top');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$y = $this->document->getCurrentPage()->getCoordinates()->getY();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$x = Math::add($parent->getCoordinates()->getX(), $this->getOffset()->getLeft());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function layout(bool $afterPageDividing = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$y = Math::add($parent->getCoordinates()->getY(), $this->getOffset()->getTop());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->getClosestByType('BlockBox')->layout();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLineBox = $this->getNewLineBox();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->getClosestByType('BlockBox')->layout();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dimensions = $this->getDimensions();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lineGroups[$currentGroup][] = $child;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->applyStyleWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getDimensions()->getWidth() !== $width) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function divideLines()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$line->removeWhiteSpaces();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$line->measureWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function measureHeight(bool $afterPageDividing = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentStyle = $parent->getStyle();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->measureHeight($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($allChildren);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lines = $child->divide();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($lines);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $afterPageDividing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$top = $this->document->getCurrentPage()->getCoordinates()->getY();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLineBox = $this->getNewLineBox();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $currentLineBox->appendInlineBlock($childDomElement, $element, $style, $this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->parentWidth = $parent->getDimensions()->getWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxWidth = '0';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxWidth = Math::max($maxWidth, $child->getDimensions()->getOuterWidth());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->divideLines();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentGroup = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Save source lines before any dividing process (to get maximal width of the block for tables later).
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get initial lines before any process was applied.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->sourceLines;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->hideEmptyLines();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('block' === $previous->getStyle()->getRules('display')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getOffset()->setTop($top);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getCurrentLineBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Measure width of this block.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function measureWidth(bool $afterPageDividing = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->divideLines();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->applyStyleWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($lines as $line) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentLine->appendChild($line->removeChild($child));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$height = Math::add($height, $style->getVerticalPaddingsWidth(), $style->getVerticalBordersWidth());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($parent = $this->getParent()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== mb_stripos($child->getTextContent(), '{p}')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $currentLineBox->appendInline($childDomElement, $element, $style, $this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->divideLines();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->divideLines();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxWidth = Math::add($maxWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dimensions->setWidth($width);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($child->isEmpty() && !$child->getStyle()->haveSpacing()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param LineBox $line
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$top = $parentStyle->getOffsetTop();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($previous = $this->getPrevious()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getOffset()->setLeft($left);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$allChildren = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$oldWidth = $this->getDimensions()->getWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dimensions->setWidth($maxWidth);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return LineBox[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($child instanceof LineBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($lines as $line) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $afterPageDividing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$top = Math::add($top, (string) $marginTop);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $afterPageDividing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$afterPageDividing) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function replacePageNumbers()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Hide empty lines.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->mergeLineGroups($this->groupLines());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$height = '0';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($parent = $this->getParent()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->measureOffset($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->measurePosition($afterPageDividing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function appendInlineBox($childDomElement, $element, $style, $parentBlock)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $afterPageDividing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->applyStyleWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($lineGroups[$currentGroup])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->setForMeasurement(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->setRenderable(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->setRenderable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSourceLines()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->applyStyleHeight();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$top = Math::add($previous->getOffset()->getTop(), $previous->getDimensions()->getHeight());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$marginTop = Math::add($marginTop, $previous->getStyle()->getRules('margin-bottom'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$left = Math::add($left, $this->getStyle()->getRules('margin-left'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Position.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$x = $this->document->getCurrentPage()->getCoordinates()->getX();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'q',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('transparent' !== $rules['background-image']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"$width 0 0 $height 0 0 cm",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"{$rules['background-color'][0]} {$rules['background-color'][1]} {$rules['background-color'][2]} rg",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"0 0 $width $height re",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = array_merge($element, $bgColor);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $pdfY
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getInstructions(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('none' === $this->getStyle()->getRules('display')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pdfX = $coordinates->getPdfX();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dimensions = $this->getDimensions();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$height = $dimensions->getHeight();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pageNumber = $this->document->getCurrentPage()->getPageNumber();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('transparent' !== $rules['background-color']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $height
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$graphicStateStr,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add background color instructions.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $pdfX
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'/' . $this->getStyle()->getBackgroundImageStream()->getImageName() . ' Do',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add background color instructions.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('always' === $child->getStyle()->getRules('page-break-after')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($allChildren as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->setText(preg_replace('/{p}/ui', (string) $pageNumber, $child->getTextContent()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $pdfY
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$graphicState = $this->style->getGraphicState();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $width
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $element;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'q',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"1 0 0 1 $pdfX $pdfY cm",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = array_merge($element, $bgColor);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$allChildren = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$breakAfter[] = $child;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $width
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function addBackgroundImageInstructions(array $element, $pdfX, $pdfY, $width, $height)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$graphicStateStr = '/' . $graphicState->getNumber() . ' gs';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($allChildren as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== mb_stripos($child->getTextContent(), '{a}')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$graphicStateStr,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->document->getCurrentPage()->breakAfter($breakBox);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($child instanceof TextBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rules = $this->style->getRules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'f',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$breakAfter = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = $this->addBackgroundColorInstructions($element, $pdfX, $pdfY, $width, $height);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $pdfX
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $height
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function addBackgroundColorInstructions(array $element, $pdfX, $pdfY, $width, $height)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $element;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Q',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rules = $this->style->getRules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('none' === $this->getStyle()->getRules('display')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$child->setText(preg_replace('/{a}/ui', $pages, $child->getTextContent()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bgColor = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Divide content into pages.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function breakPageAfter()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$coordinates = $this->getCoordinates();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $element;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Q',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $element;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getAllChildren($allChildren);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($breakAfter as $breakBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get element PDF instructions to use in content stream.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pdfY = $coordinates->getPdfY();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = $this->addBackgroundImageInstructions($element, $pdfX, $pdfY, $width, $height);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return implode("\n", $element);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$graphicState = $this->style->getGraphicState();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bgColor = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"1 0 0 1 $pdfX $pdfY cm",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null === $this->getStyle()->getBackgroundImageStream()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$width = $dimensions->getWidth();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = $this->addBorderInstructions($element, $pdfX, $pdfY, $width, $height);
- Exclude checks