Code Duplication    Length = 10-12 lines in 5 locations

src/Picqer/Financials/Exact/PurchaseEntry.php 1 location

@@ 68-79 (lines=12) @@
65
        'YourRef',
66
    ];
67
68
    public function addItem(array $array)
69
    {
70
        if (! isset($this->attributes['PurchaseEntryLines']) || $this->attributes['PurchaseEntryLines'] == null) {
71
            $this->attributes['PurchaseEntryLines'] = [];
72
        }
73
        if (! isset($array['LineNumber'])) {
74
            $array['LineNumber'] = count($this->attributes['PurchaseEntryLines']) + 1;
75
        }
76
        $this->attributes['PurchaseEntryLines'][] = $array;
77
    }
78
79
    protected $url = 'purchaseentry/PurchaseEntries';
80
}
81

src/Picqer/Financials/Exact/PurchaseOrder.php 1 location

@@ 125-134 (lines=10) @@
122
    /**
123
     * @param array $array
124
     */
125
    public function addItem(array $array)
126
    {
127
        if (! isset($this->attributes['PurchaseOrderLines']) || $this->attributes['PurchaseOrderLines'] == null) {
128
            $this->attributes['PurchaseOrderLines'] = [];
129
        }
130
        if (! isset($array['LineNumber'])) {
131
            $array['LineNumber'] = count($this->attributes['PurchaseOrderLines']) + 1;
132
        }
133
        $this->attributes['PurchaseOrderLines'][] = $array;
134
    }
135
136
    protected $url = 'purchaseorder/PurchaseOrders';
137
}

src/Picqer/Financials/Exact/SalesEntry.php 1 location

@@ 113-122 (lines=10) @@
110
    ];
111
112
113
    public function addItem(array $array)
114
    {
115
        if (! isset($this->attributes['SalesEntryLines']) || $this->attributes['SalesEntryLines'] == null) {
116
            $this->attributes['SalesEntryLines'] = [];
117
        }
118
        if (! isset($array['LineNumber'])) {
119
            $array['LineNumber'] = count($this->attributes['SalesEntryLines']) + 1;
120
        }
121
        $this->attributes['SalesEntryLines'][] = $array;
122
    }
123
    
124
    protected $url = 'salesentry/SalesEntries';
125
}

src/Picqer/Financials/Exact/SalesOrder.php 1 location

@@ 143-152 (lines=10) @@
140
    /**
141
     * @param array $array
142
     */
143
    public function addItem(array $array)
144
    {
145
        if (! isset($this->attributes['SalesOrderLines']) || $this->attributes['SalesOrderLines'] == null) {
146
            $this->attributes['SalesOrderLines'] = [];
147
        }
148
        if (! isset($array['LineNumber'])) {
149
            $array['LineNumber'] = count($this->attributes['SalesOrderLines']) + 1;
150
        }
151
        $this->attributes['SalesOrderLines'][] = $array;
152
    }
153
154
    protected $url = 'salesorder/SalesOrders';
155
}

src/Picqer/Financials/Exact/GoodsReceipts.php 1 location

@@ 74-85 (lines=12) @@
71
        'YourRef',
72
    ];
73
74
    public function addItem(array $array)
75
    {
76
        if ( ! isset($this->attributes['GoodsReceiptLines']) || $this->attributes['GoodsReceiptLines'] == null)
77
        {
78
            $this->attributes['GoodsReceiptLines'] = [];
79
        }
80
        if ( ! isset($array['LineNumber']))
81
        {
82
            $array['LineNumber'] = count($this->attributes['GoodsReceiptLines']) + 1;
83
        }
84
        $this->attributes['GoodsReceiptLines'][] = $array;
85
    }
86
87
88
    protected $url = 'purchaseorder/GoodsReceipts';