• 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/Name.php
1
<?php
2

3
namespace Pixelpeter\Genderize\Models;
4

5
class Name extends BaseModel
6
{
7
    protected $gender;
8

9
    protected $name;
10

11
    protected $probability;
12

13
    protected $count;
14

15
    /**
16
     * Create new instance of Name model
17
     */
18
    public function __construct($data)
90✔
19
    {
20
        $data = $this->prepareData($data);
90✔
21

22
        $this->name = $data->name;
90✔
23
        $this->gender = $data->gender;
90✔
24
        $this->probability = $data->probability;
90✔
25
        $this->count = $data->count;
90✔
26
    }
27

28
    /**
29
     * Merge data with default so every field is available
30
     *
31
     * @return object
32
     */
33
    protected function prepareData($data)
90✔
34
    {
35
        $default = new \StdClass;
90✔
36
        $default->name = null;
90✔
37
        $default->gender = null;
90✔
38
        $default->probability = null;
90✔
39
        $default->count = null;
90✔
40

41
        return (object) array_merge(
90✔
42
            (array) $default,
90✔
43
            (array) $data
90✔
44
        );
90✔
45
    }
46

47
    /**
48
     * Check if name is male
49
     *
50
     * @return bool
51
     */
52
    public function isMale()
10✔
53
    {
54
        return $this->gender === 'male';
10✔
55
    }
56

57
    /**
58
     * Check if name is not male
59
     *
60
     * @return bool
61
     */
62
    public function isNotMale()
10✔
63
    {
64
        return $this->gender !== 'male';
10✔
65
    }
66

67
    /**
68
     * Check if name is female
69
     *
70
     * @return bool
71
     */
72
    public function isFemale()
10✔
73
    {
74
        return $this->gender === 'female';
10✔
75
    }
76

77
    /**
78
     * Check if name is not female
79
     *
80
     * @return bool
81
     */
82
    public function isNotFemale()
10✔
83
    {
84
        return $this->gender !== 'female';
10✔
85
    }
86
}
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