Code Duplication    Length = 7-7 lines in 4 locations

src/Validators/Card/CardValidator.php 1 location

@@ 165-171 (lines=7) @@
162
     * @return void
163
     * @throws \InvalidArgumentException
164
     */
165
    private function validateType()
166
    {
167
        $type = $this->card->type;
168
        if (empty($type) || !is_string($type)) {
169
            throw new \InvalidArgumentException('type should be a string');
170
        }
171
    }
172
}
173

src/Validators/Pix/BankValidator.php 1 location

@@ 76-82 (lines=7) @@
73
     * @return void
74
     * @throws \InvalidArgumentException
75
     */
76
    private function validateName()
77
    {
78
        $name = $this->bank->name;
79
        if (empty($name) || !is_string($name)) {
80
            throw new \InvalidArgumentException('bank name should be a string');
81
        }
82
    }
83
}
84

src/Validators/Pix/PixCashoutStaticQrCodeValidator.php 2 locations

@@ 66-72 (lines=7) @@
63
     * @return void
64
     * @throws \InvalidArgumentException
65
     */
66
    private function validateDescription()
67
    {
68
        $description = $this->pixCashoutStaticQrCode->description;
69
        if (empty($description) || !is_string($description)) {
70
            throw new \InvalidArgumentException('cashout description should be a string');
71
        }
72
    }
73
74
    /**
75
     * This validates a sender bank account
@@ 132-138 (lines=7) @@
129
     * @return void
130
     * @throws \InvalidArgumentException
131
     */
132
    private function validateEndToEndId()
133
    {
134
        $endToEndId = $this->pixCashoutStaticQrCode->endToEndId;
135
        if (empty($endToEndId) || !is_string($endToEndId)) {
136
            throw new \InvalidArgumentException('end to end id should be a string');
137
        }
138
    }
139
}
140