Failed Conditions
Push — master ( b155cb...bf56a7 )
by Struan
05:04
created

APPGMembershipAssignment::is_a_member()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
/**
3
 * Mirrors pydantic model for deseralisation in a PHP context.
4
 * For adding display related helper functions.
5
 * @package TheyWorkForYou
6
 */
7
8
declare(strict_types=1);
9
10
namespace MySociety\TheyWorkForYou\DataClass\APPGs;
11
12
use MySociety\TheyWorkForYou\DataClass\BaseModel;
13
14
class APPGMembershipAssignment extends BaseModel {
15
    public APPGMembershipList $is_officer_of;
16
    public APPGMembershipList $is_ordinary_member_of;
17
18
    public function is_an_officer() {
19
        return $this->is_officer_of->count() > 0;
20
    }
21
22
    public function is_a_member() {
23
        return $this->is_ordinary_member_of->count() > 0;
24
    }
25
}
26