• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pixelpeter / laravel-genderize-api-client / 16567649557

28 Jul 2025 11:20AM UTC coverage: 100.0%. Remained the same
16567649557

Pull #34

github

web-flow
Merge 88ea5c63d into 8a0d5467f
Pull Request #34: Bump aglipanci/laravel-pint-action from 2.5 to 2.6

92 of 92 relevant lines covered (100.0%)

43.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Models/GenderizeResponse.php
1
<?php
2

3
namespace Pixelpeter\Genderize\Models;
4

5
use Illuminate\Support\Collection;
6

7
class GenderizeResponse extends BaseModel
8
{
9
    protected $meta;
10

11
    protected $result;
12

13
    public function __construct($response)
30✔
14
    {
15
        $this->result = $this->setResult($response);
30✔
16
        $this->meta = $this->setMeta($response);
30✔
17
    }
18

19
    protected function setMeta($data)
30✔
20
    {
21
        return new Meta($data);
30✔
22
    }
23

24
    protected function setResult($response)
30✔
25
    {
26
        if (is_array($response->body)) {
30✔
27
            return $this->returnWithCollection($response);
10✔
28
        }
29

30
        return new Name($response->body);
20✔
31
    }
32

33
    protected function returnWithCollection($response)
10✔
34
    {
35
        $collection = new Collection;
10✔
36

37
        foreach ($response->body as $row) {
10✔
38
            $collection->push(new Name($row));
10✔
39
        }
40

41
        return $collection;
10✔
42
    }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc