Skip to content

Commit

Permalink
Remove party cohort code.
Browse files Browse the repository at this point in the history
We store/use the figures returned externally. Some of the tests are
therefore now only testing that what is stored in the fixture is
displayed, rather than any calculations involved.
  • Loading branch information
dracos committed Dec 19, 2023
1 parent 81e888f commit f0f7d1b
Show file tree
Hide file tree
Showing 12 changed files with 163 additions and 725 deletions.
19 changes: 3 additions & 16 deletions classes/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ public function isDead() {

}


/**
* Cohort Key
*
* Gets a key that defines the periods and party a member should be compared against
*
* @return string of party and entry dates
*/

public function cohortKey($house = HOUSE_TYPE_COMMONS) {
// get the hash_id for the cohort this member belongs to
$person_id = $this->person_id();
return PartyCohort::getHashforPerson($person_id);
}

public function cohortPartyComparisonDirection() {
// Is this MP and their cohort compared against the
// first or last party they have?
Expand Down Expand Up @@ -143,8 +128,10 @@ public function cohortParty($house = HOUSE_TYPE_COMMONS){
$party = $row["party"];
if ( $party == 'Labour/Co-operative' ) {
$party = 'Labour';
} elseif ($party == 'Sinn Féin') {
$party = 'Sinn Fein';
}
return $party;
return slugify($party);
} else {
return null;
}
Expand Down
Loading

0 comments on commit f0f7d1b

Please sign in to comment.