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
Missing class import via use statement (line '85', column '22'). Open
$cleanStyle = (new \YetiForcePDF\Style\Style())->setDocument($this->document);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
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
Avoid using static access to class '\YetiForcePDF\Math' in method 'measureHeight'. Open
$maxHeight = Math::max($maxHeight, $child->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 'measureHeight'. Open
$maxHeight = Math::add($maxHeight, $style->getVerticalBordersWidth(), $style->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
Avoid unused parameters such as '$childDomElement'. Open
public function appendTableWrapperBox($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 appendInlineBlockBox($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 appendInlineBox($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 '$element'. Open
public function appendBlockBox($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 appendInlineBlockBox($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 '$element'. Open
public function appendTableWrapperBox($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 appendTableWrapperBox($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 '$element'. Open
public function appendInlineBox($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 appendTableBox($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 '$style'. Open
public function appendTableBox($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 '$style'. Open
public function appendTableWrapperBox($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 '$element'. Open
public function appendInlineBlockBox($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 appendBlockBox($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 appendInlineBox($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 '$style'. Open
public function appendBlockBox($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 '$style'. Open
public function appendInlineBlockBox($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 appendTableBox($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 '$style'. Open
public function appendInlineBox($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 appendBlockBox($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 '$element'. Open
public function appendTableBox($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
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* We shouldn't append table wrapper here.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cleanStyle = (new \YetiForcePDF\Style\Style())->setDocument($this->document);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cleanStyle->setRule('display', '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
$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
$this->getDimensions()->setHeight($maxHeight);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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 appendInlineBox($childDomElement, $element, $style, $parentBlock)
- 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
* @param Style $style
- 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 mixed $element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Append table box 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
->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
* {@inheritdoc}
- 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
$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
* @param mixed $childDomElement
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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
* @param \DOMNode $childDomElement
- 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
->setStyle($cleanStyle)
- Exclude checks
Spaces must 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
* We shouldn't append inline block box here.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $parentBlock
- 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
{
- 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 mixed $parentBlock
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $style
- 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
public function appendTableBox($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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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 \YetiForcePDF\Layout\BlockBox $parentBlock
- 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
$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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $childDomElement
- 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->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
foreach ($this->getChildren() as $child) {
- 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
return $this;
- 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
$box = (new TableBox())
- 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->getStyle()->init()->setRule('display', 'block');
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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 $box;
- 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
$maxHeight = Math::max($maxHeight, $child->getDimensions()->getHeight());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* We shouldn't append block box here.
- 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
* {@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
* We shouldn't append inline box here.
- 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
foreach ($this->getChildren() as $child) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->wasCut()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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
* @param mixed $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
//->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
$maxHeight = '0';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxHeight = Math::add($maxHeight, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());
- Exclude checks