[REF] Determine values where they are needed rather than passing them around
authoreileen <emcnaughton@wikimedia.org>
Wed, 21 Oct 2020 10:55:25 +0000 (23:55 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 22 Oct 2020 23:18:12 +0000 (12:18 +1300)
commit751bcac53cd433cb5e0614a1ac33f7e026e53bb2
tree9e46acc3a8660b3a9b44d32c26eaadaa630bde83
parent3c5b9054bc011e611cbfe2f9fc2515c2ee67d8e3
[REF] Determine values where they are needed rather than passing them around

The membershipTypes array is constructed, but barely used. One place it is used
is in this function - which is explictly tested by CRM_Member_Form_MembershipTest::testSubmit

This fixes it to get the values when needed rather than construct a variable miles away from
where it is used - no more pass the parcel
CRM/Member/Form/Membership.php
tests/phpunit/CRM/Member/Form/MembershipTest.php