Skip to content

Commit

Permalink
Remove party cohort code. (#1755)
Browse files Browse the repository at this point in the history
* Remove party cohort code.

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.

---------

Co-authored-by: Alex Parsons <[email protected]>
  • Loading branch information
dracos and ajparsons authored Feb 21, 2024
1 parent bc15c11 commit 285109c
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 737 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 285109c

Please sign in to comment.