Skip to content

Commit 2269dfa

Browse files
committed
Inline single-use wayf_remember_choice coin name
# If applied, this commit will... Remove the COIN_WAYF_REMEMBER_CHOICE constant and use the literal string directly. # Why is this change needed? Prior to this change, this constant had exactly one production call site and one test assertion, which was flagged in review as not earning its keep as a constant. # How does it address the issue? This change inlines the literal 'wayf_remember_choice' at both usage sites and removes the constant declaration. # Provide links to any relevant tickets, articles or other resources #2091
1 parent bfc8d74 commit 2269dfa

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/OpenConext/EngineBlock/Metadata/Entity/Assembler/PushMetadataAssembler.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
*/
4747
class PushMetadataAssembler implements MetadataAssemblerInterface
4848
{
49-
public const COIN_WAYF_REMEMBER_CHOICE = 'wayf_remember_choice';
50-
5149
/**
5250
* @var ValidatorInterface
5351
*/
@@ -223,7 +221,7 @@ private function assembleSp(stdClass $connection)
223221
$properties += $this->setPathFromObjectBool([$connection, 'metadata:coin:trusted_proxy'], 'isTrustedProxy');
224222
$properties += $this->setPathFromObjectBool([$connection, 'metadata:coin:display_unconnected_idps_wayf'], 'displayUnconnectedIdpsWayf');
225223
$properties += $this->setPathFromConnectionStrictBool(
226-
[$connection, 'metadata:coin:' . self::COIN_WAYF_REMEMBER_CHOICE],
224+
[$connection, 'metadata:coin:wayf_remember_choice'],
227225
'wayfRememberChoice'
228226
);
229227

‎tests/integration/OpenConext/EngineBlock/Metadata/Entity/Assembler/PushMetadataAssemblerTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function testCoins($coinName, $roleType, $parameter, $type)
160160

161161
switch ($type) {
162162
case 'bool':
163-
$values = $coinName === PushMetadataAssembler::COIN_WAYF_REMEMBER_CHOICE
163+
$values = $coinName === 'wayf_remember_choice'
164164
? $this->validCoinValuesBoolStrictTrueOnly()
165165
: $this->validCoinValuesBool();
166166
break;

0 commit comments

Comments
 (0)