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

pixelpeter / laravel5-genderize-api-client / 15695833074

17 Jun 2025 01:29AM UTC coverage: 98.925%. Remained the same
15695833074

Pull #25

github

web-flow
Merge 6c20c15f7 into cc744372a
Pull Request #25: Bump stefanzweifel/git-auto-commit-action from 5 to 6

92 of 93 relevant lines covered (98.92%)

21.77 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)
54✔
19
    {
20
        $data = $this->prepareData($data);
54✔
21

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

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

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

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

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

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

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