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

APPGMembershipAssignment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 10
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A is_a_member() 0 2 1
A is_an_officer() 0 2 1
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