Function appendText
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
{
$text = $childDomElement->textContent;
$whiteSpace = $this->getStyle()->getRules('white-space');
switch ($whiteSpace) {
- 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 class InlineBox has 13 public methods. Consider refactoring InlineBox to keep number of public methods under 10. Open
class InlineBox extends ElementBox implements BoxInterface, BuildTreeInterface, AppendChildInterface
{
/**
* @var \YetiForcePDF\Layout\TextBox
*/
- 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 InlineBox has an overall complexity of 53 which is very high. The configured complexity threshold is 50. Open
class InlineBox extends ElementBox implements BoxInterface, BuildTreeInterface, AppendChildInterface
{
/**
* @var \YetiForcePDF\Layout\TextBox
*/
- Exclude checks
File InlineBox.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* InlineBox class.
Method appendText
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
{
$text = $childDomElement->textContent;
$whiteSpace = $this->getStyle()->getRules('white-space');
switch ($whiteSpace) {
Method addBackgroundColorInstructions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addBackgroundColorInstructions(array $element, $pdfX, $pdfY, $width, $height)
Function measureOffset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
$rules = $this->getStyle()->getRules();
$parent = $this->getParent();
$top = $parent->getStyle()->getOffsetTop();
- 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 measureWidth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
$style = $this->getStyle();
if ($this->parentWidth === $this->getParent()->getDimensions()->getWidth() && null !== $this->getDimensions()->getWidth()) {
if (!$this->isForMeasurement()) {
- 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 appendText() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
{
$text = $childDomElement->textContent;
$whiteSpace = $this->getStyle()->getRules('white-space');
switch ($whiteSpace) {
- 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
Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
- 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 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 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 createText has a boolean flag argument $sameId, which is a certain sign of a Single Responsibility Principle violation. Open
public function createText($content, bool $sameId = 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 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
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureWidth'. Open
$width = Math::add($width, $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
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureOffset'. Open
$left = Math::add($left, $parent->getStyle()->getOffsetLeft());
- 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 appendText uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->createText(' ', true);
}
- 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
$this->getDimensions()->setWidth(Math::add($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
Avoid assigning values to variables in if clauses and the like (line '322', column '7'). Open
public function measureOffset(bool $afterPageDividing = false)
{
$rules = $this->getStyle()->getRules();
$parent = $this->getParent();
$top = $parent->getStyle()->getOffsetTop();
- 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
The method appendBlockBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->appendChild($box);
}
- 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 createText uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->appendChild($box);
$this->previousTextBox = $box;
}
- 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 'measurePosition'. Open
$this->getCoordinates()->setX(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 createText uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$box = (new TextBox())
->setDocument($this->document)
->setParent($this)
->init();
- 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 'measureOffset'. Open
$top = Math::sub($lineHeight, $this->getStyle()->getFont()->getTextHeight());
- 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 {
$this->appendChild($box);
}
- 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 'measureOffset'. Open
$left = Math::add($left, $previous->getOffset()->getLeft(), $previous->getDimensions()->getWidth(), $previous->getStyle()->getRules('margin-right'));
- 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
$this->getCoordinates()->setY(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 appendTableWrapperBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->appendChild($box);
}
- 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 'measureOffset'. Open
$top = Math::sub(Math::div($lineHeight, '2'), Math::div($height, '2'));
- 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
$this->getDimensions()->setHeight(Math::add($this->getStyle()->getLineHeight(), $this->getStyle()->getVerticalPaddingsWidth()));
- 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 appendText uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->createText(' ', true);
}
- 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 measureOffset uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$left = Math::add($left, $parent->getStyle()->getOffsetLeft());
}
- 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 '51', column '7'). Open
public function cloneParent(Box $box)
{
if ($parent = $this->getParent()) {
$clone = clone $this;
$clone->getStyle()->setBox($clone);
- 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
The method cloneParent uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$parent->appendChild($clone);
}
- 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 '196', column '23'). Open
protected function getPreviousText()
{
$closest = $this->getClosestLineBox()->getLastChild();
$previousTop = $closest->getPrevious();
if ($previousTop && $textBox = $previousTop->getFirstTextBox()) {
- 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::sub(Math::div($lineHeight, '2'), Math::div($height, '2'));
- 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 appendInlineBox uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->appendChild($box);
}
- 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
$width = Math::add($width, $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 'measureOffset'. Open
$top = Math::sub(Math::div($lineHeight, '2'), Math::div($height, '2'));
- 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 "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.
Define a constant instead of duplicating this literal "vertical-align" 4 times. Open
if ('bottom' === $rules['vertical-align']) {
- 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.
Add a "case default" clause to this "switch" statement. Open
switch ($whiteSpace) {
- Read upRead up
- Exclude checks
The requirement for a final case default
clause is defensive programming. The clause should either take appropriate action, or contain
a suitable comment as to why no action is taken. Even when the switch
covers all current values of an enum
, a default case
should still be used because there is no guarantee that the enum
won't be extended.
Noncompliant Code Example
switch ($param) { //missing default clause case 0: do_something(); break; case 1: do_something_else(); break; } switch ($param) { default: // default clause should be the last one error(); break; case 0: do_something(); break; case 1: do_something_else(); break; }
Compliant Solution
switch ($param) { case 0: do_something(); break; case 1: do_something_else(); break; default: error(); break; }
See
- MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
- MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
- MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
- MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
- MISRA C:2012, 16.1 - All switch statements shall be well-formed
- MISRA C:2012, 16.4 - Every switch statement shall have a default label
- MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
- MITRE, CWE-478 - Missing Default Case in Switch Statement
- CERT, MSC01-C. - Strive for logical completeness
- CERT, MSC01-CPP. - Strive for logical completeness
Avoid unused parameters such as '$element'. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
- 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 appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
- 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 '$style'. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
- 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 appendBlockBox($childDomElement, $element, $style, $parentBlock)
{
$box = (new BlockBox())
->setDocument($this->document)
->setParent($this)
- 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 appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
{
$box = (new InlineBlockBox())
->setDocument($this->document)
->setParent($this)
- 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 appendInlineBox($childDomElement, $element, $style, $parentBlock)
{
$box = (new self())
->setDocument($this->document)
->setParent($this)
- 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
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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new BlockBox())
- 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
if (isset($this->getChildren()[0])) {
- Exclude checks
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
$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
$clone->getDimensions()->setBox($clone);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clone->getCoordinates()->setBox($clone);
- 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
->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
* @var \YetiForcePDF\Layout\TextBox
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clone->getStyle()->setBox($clone);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parent->cloneParent($clone);
- 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->getStyle()->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function cloneParent(Box $box)
- 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
$this->cloneParent($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Parent height cache.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Go up to Line box and clone and wrap element.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->getChildren()[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
$box->buildTree($box);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clone->getElement()->setBox($clone);
- 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
// so we need to wrap this box later and split lines at block element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// if we add this child to parent box we loose parent inline styles if nested
- 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 ($parent = $this->getParent()) {
- 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
->setElement($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
/**
- 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 appendBlockBox($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
$clone = clone $this;
- 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->cloneParent($box);
- 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
// so we need to wrap this box later and split lines at block 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
*
- 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
{
- 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 $previousTextBox;
- 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
->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 Box $box
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$parent instanceof LineBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// if we add this child to parent box we loose parent inline styles if nested
- 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
$parent->appendChild($clone);
- 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 appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $parentHeight = '0';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clone->getOffset()->setBox($clone);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clone->appendChild($box);
- 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 (isset($this->getChildren()[0])) {
- 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
$box->buildTree($parentBlock);
- 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
* @param \DOMNode $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
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new InlineBlockBox())
- 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
* {@inheritdoc}
- 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
->init();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->getChildren()[0])) {
- 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
break;
- 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
}
- 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
// if we add this child to parent box we loose parent inline styles if nested
- 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
if ($sameId && $this->previousTextBox) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $textBox->getText();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$anonymous = ($parent instanceof self && $parent->isAnonymous()) || $parent instanceof LineBox;
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$anonymous = ($parent instanceof self && $parent->isAnonymous()) || $parent instanceof LineBox;
- 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
* Create text.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $sameId
- 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
switch ($whiteSpace) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('normal' === $whiteSpace) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$words = preg_split('/ /u', $text, 0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($index + 1 !== $count || $anonymous) {
- 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
->setStyle($style)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->getChildren()[0])) {
- 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
$box = (new self())
- 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
$box->buildTree($box);
- 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
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = $childDomElement->textContent;
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box->setText($content);
- 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
$text = preg_replace('/ +/u', ' ', $text);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('nowrap' === $whiteSpace) {
- 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->previousTextBox = $this->cloneParent($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
* Get previous sibling inline-level element text.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Style $style
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = preg_replace('/([\t ]+)?\r([\t ]+)?/u', "\r", $text);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($count) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->createText(' ', true);
- 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
// so we need to wrap this box later and split lines at block element
- 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
$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 = $this->previousTextBox->clone();
- 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
if ($previousTop && $textBox = $previousTop->getFirstTextBox()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \YetiForcePDF\Layout\BlockBox|null $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
if ('' !== $text) {
- 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
$this->cloneParent($box);
- 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
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'nowrap':
- 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
$text = preg_replace('/\r+/u', ' ', $text);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$box = (new TextBox())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('' !== $word) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->previousTextBox = $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->createText($text, true);
- 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 appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($words as $index => $word) {
- 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
/**
- 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
// we don't want 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
return $box;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $content
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$closest = $this->getClosestLineBox()->getLastChild();
- 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 text.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->createText(' ', true);
- 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
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->cloneParent($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
$previousTop = $closest->getPrevious();
- 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
$count = \count($words);
- 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
public function createText($content, bool $sameId = 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
$this->previousTextBox = $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
protected function getPreviousText()
- 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 === $this->getParent()->getDimensions()->getWidth() && null !== $this->getDimensions()->getWidth()) {
- 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
public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
- 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
->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
->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
$whiteSpace = $this->getStyle()->getRules('white-space');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Measure 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
$box->getStyle()->init();
- 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
* @return string|null
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'normal':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = preg_replace('/\t+/u', ' ', $text);
- 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->createText($word);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->createText(' ', true);
- 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
// margin top inside inline and inline block doesn't affect relative to line top position
- 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->style = clone $this->style;
- 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
];
- 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()->setWidth(Math::add($style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth()));
- 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()->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
*/
- 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 measureOffset(bool $afterPageDividing = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$height = $this->getStyle()->getFont()->getTextHeight();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$left = Math::add($left, $previous->getOffset()->getLeft(), $previous->getDimensions()->getWidth(), $previous->getStyle()->getRules('margin-right'));
- 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
$parent = $this->getParent();
- 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 __clone()
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
if ($this->parentWidth === $this->getParent()->getDimensions()->getWidth() && null !== $this->getDimensions()->getWidth()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->coordinates = clone $this->coordinates;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->children = [];
- 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
$dimensions = $this->getDimensions();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->dimensions->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
$parent = $this->getClosestLineBox();
- 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
'f',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->isForMeasurement()) {
- 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
$parent = $this->getParent();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$top = $this->getStyle()->getFont()->getDescender();
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->offset = clone $this->offset;
- 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
$lineHeight = $this->getClosestLineBox()->getDimensions()->getHeight();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$top = Math::sub(Math::div($lineHeight, '2'), Math::div($height, '2'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->element = clone $this->element;
- 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
if ('transparent' !== $rules['background-color']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$element = $this->addBorderInstructions($element, $pdfX, $pdfY, $width, $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
$this->applyStyleHeight();
- 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
*
- 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
$this->style->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
$graphicState = $this->style->getGraphicState();
- 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 ($this->isForMeasurement()) {
- 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 ('bottom' === $rules['vertical-align']) {
- 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
$width = '0';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->dimensions = clone $this->dimensions;
- 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
$width = Math::add($width, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());
- 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
} elseif ('top' === $rules['vertical-align']) {
- 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
$element = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// it only affects line margins
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->parentWidth = $this->getParent()->getDimensions()->getWidth();
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
$left = Math::add($left, $previous->getOffset()->getLeft(), $previous->getDimensions()->getWidth(), $previous->getStyle()->getRules('margin-right'));
- 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 = Math::add($width, $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->getOffset()->setLeft($left);
- 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
public function measurePosition(bool $afterPageDividing = false)
- 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
}
- 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
$height = $dimensions->getHeight();
- 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
$top = $parent->getStyle()->getOffsetTop();
- 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
* 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getCoordinates()->setX(Math::add($parent->getCoordinates()->getX(), $this->getOffset()->getLeft()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getCoordinates()->setY(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
"1 0 0 1 $pdfX $pdfY cm",
- 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
* @return string
- 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
$pdfX = $coordinates->getPdfX();
- 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
if ('none' === $this->getStyle()->getRules('display')) {
- 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
$bgColor = [
- 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
*
- 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
$width = $dimensions->getWidth();
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
$this->getDimensions()->setWidth(Math::add($style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth()));
- 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
* @param bool $afterPageDividing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getDimensions()->setHeight(Math::add($this->getStyle()->getLineHeight(), $this->getStyle()->getVerticalPaddingsWidth()));
- 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::sub($lineHeight, $this->getStyle()->getFont()->getTextHeight());
- 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
Line exceeds 120 characters; contains 136 characters Open
$this->getDimensions()->setHeight(Math::add($this->getStyle()->getLineHeight(), $this->getStyle()->getVerticalPaddingsWidth()));
- 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
return $element;
- 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
$child->measureWidth($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
* @return $this
- 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
$rules = $this->getStyle()->getRules();
- 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
$this->coordinates->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
$coordinates = $this->getCoordinates();
- 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
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
} elseif ('middle' === $rules['vertical-align'] || 'baseline' === $rules['vertical-align']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$left = (string) $rules['margin-left'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$left = Math::add($left, $parent->getStyle()->getOffsetLeft());
- 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
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->element->setBox($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->offset->setBox($this);
- 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
$element = $this->addBackgroundColorInstructions($element, $pdfX, $pdfY, $width, $height);
- Exclude checks