GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

OrderInformationExtractor::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 17
nc 1
nop 8

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace Magium\Magento\Extractors\Admin;
4
5
use Magium\Extractors\AbstractExtractor;
6
use Magium\Magento\Extractors\Admin\Order\AccountInformation;
7
use Magium\Magento\Extractors\Admin\Order\BillingAddress;
8
use Magium\Magento\Extractors\Admin\Order\OrderItems;
9
use Magium\Magento\Extractors\Admin\Order\OrderSummary;
10
use Magium\Magento\Extractors\Admin\Order\PaymentInformation;
11
use Magium\Magento\Extractors\Admin\Order\ShippingAddress;
12
use Magium\Magento\Extractors\Admin\Order\ShippingInformation;
13
use Magium\Magento\Extractors\Admin\Order\Totals;
14
15
class OrderInformationExtractor extends AbstractExtractor
16
{
17
    const EXTRACTOR = 'Admin\OrderInformationExtractor';
18
    protected $extractors = [];
19
20
    public function __construct(
21
        AccountInformation      $accountInformation,
22
        BillingAddress          $billingAddress,
23
        OrderItems              $orderItems,
24
        OrderSummary            $orderSummary,
25
        PaymentInformation      $paymentInformation,
26
        ShippingAddress         $shippingAddress,
27
        ShippingInformation     $shippingInformation,
28
        Totals                  $totals
29
    )
30
    {
31
        $this->extractors[] = $accountInformation;
32
        $this->extractors[] = $billingAddress;
33
        $this->extractors[] = $orderItems;
34
        $this->extractors[] = $orderSummary;
35
        $this->extractors[] = $paymentInformation;
36
        $this->extractors[] = $shippingAddress;
37
        $this->extractors[] = $shippingInformation;
38
        $this->extractors[] = $totals;
39
    }
40
41
    public function extract()
42
    {
43
        foreach ($this->extractors as $extractor) {
44
            if ($extractor instanceof AbstractExtractor) {
45
                $extractor->extract();
46
            }
47
        }
48
    }
49
50
}