Issues (236)

src/settings/easyPay.php (3 issues)

Severity
1
<?php
2
3
namespace BPT\settings;
4
class easyPay {
5
    private array $settings = [];
6
7
    public function setCrypto (array|easyCrypto $crypto): self {
8
        if (!is_array($crypto) && !empty($crypto)) {
0 ignored issues
show
The condition is_array($crypto) is always true.
Loading history...
9
            $crypto = $crypto->getSettings();
10
        }
11
        $this->settings['crypto'] = $crypto;
12
        return $this;
13
    }
14
15
    public function setIdpay (array|easyIdpay $idpay): self {
16
        if (!is_array($idpay) && !empty($idpay)) {
0 ignored issues
show
The condition is_array($idpay) is always true.
Loading history...
17
            $idpay = $idpay->getSettings();
18
        }
19
        $this->settings['idpay'] = $idpay;
20
        return $this;
21
    }
22
23
    public function setZarinpal (array|easyZarinpal $zarinpal): self {
24
        if (!is_array($zarinpal) && !empty($zarinpal)) {
0 ignored issues
show
The condition is_array($zarinpal) is always true.
Loading history...
25
            $zarinpal = $zarinpal->getSettings();
26
        }
27
        $this->settings['zarinpal'] = $zarinpal;
28
        return $this;
29
    }
30
31
    public function getSettings (): array {
32
        return $this->settings;
33
    }
34
}