File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco
4444 private $ cdcLifetime ;
4545
4646
47+ /**
48+ * The default sort weight for entries without 'discopower.weight'.
49+ *
50+ * @var int|null
51+ */
52+ static $ defaultWeight = 50 ;
53+
4754 /**
4855 * Initializes this discovery service.
4956 *
@@ -65,6 +72,8 @@ public function __construct(array $metadataSets, string $instance)
6572 }
6673
6774 $ this ->cdcLifetime = $ this ->discoconfig ->getInteger ('cdc.lifetime ' , null );
75+
76+ self ::$ defaultWeight = $ this ->discoconfig ->getInteger ('defaultweight ' , 50 );
6877 }
6978
7079
@@ -99,10 +108,10 @@ public static function mcmp(array $a, array $b): int
99108 {
100109 // default weights
101110 if (!isset ($ a ['discopower.weight ' ]) || !is_int ($ a ['discopower.weight ' ])) {
102- $ a ['discopower.weight ' ] = $ this -> discoconfig -> getInteger ( ' defaultweight ' , 50 ) ;
111+ $ a ['discopower.weight ' ] = self :: $ defaultWeight ;
103112 }
104113 if (!isset ($ b ['discopower.weight ' ]) || !is_int ($ b ['discopower.weight ' ])) {
105- $ b ['discopower.weight ' ] = $ this -> discoconfig -> getInteger ( ' defaultweight ' , 50 ) ;
114+ $ b ['discopower.weight ' ] = self :: $ defaultWeight ;
106115 }
107116 if ($ a ['discopower.weight ' ] > $ b ['discopower.weight ' ]) {
108117 return -1 ; // higher weights further up
You can’t perform that action at this time.
0 commit comments