OrderBillingAddress   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 14
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\View\Helper;
6
7
use Application\Model\Order;
8
use Laminas\View\Helper\AbstractHelper;
9
10
class OrderBillingAddress extends AbstractHelper
11
{
12 5
    public function __invoke(?Order $order): string
13
    {
14 5
        $result = '<ul>';
15 5
        $result .= '<li>' . $this->view->escapeHtml($order->getFirstName()) . '</li>';
0 ignored issues
show
Bug introduced by
The method getFirstName() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $result .= '<li>' . $this->view->escapeHtml($order->/** @scrutinizer ignore-call */ getFirstName()) . '</li>';

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method escapeHtml() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $result .= '<li>' . $this->view->/** @scrutinizer ignore-call */ escapeHtml($order->getFirstName()) . '</li>';

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16 5
        $result .= '<li>' . $this->view->escapeHtml($order->getLastName()) . '</li>';
17 5
        $result .= '<li>' . $this->view->escapeHtml($order->getStreet()) . '</li>';
18 5
        $result .= '<li>' . $this->view->escapeHtml($order->getPostcode()) . '</li>';
19 5
        $result .= '<li>' . $this->view->escapeHtml($order->getLocality()) . '</li>';
20 5
        $result .= '<li>' . $this->view->escapeHtml($order->getCountry() ? $order->getCountry()->getName() : '') . '</li>';
21 5
        $result .= '</ul>';
22
23 5
        return $result;
24
    }
25
}
26