| Conditions | 3 |
| Paths | 3 |
| Total Lines | 37 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 26 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 1 | public function register( $propertyRegistry ) { |
|
| 23 | |||
| 24 | $propertyDefinitions = [ |
||
| 25 | |||
| 26 | 1 | self::SBL_PARENTPAGE => [ |
|
| 27 | 1 | 'label' => SBL_PROP_PARENTPAGE, |
|
| 28 | 1 | 'type' => '_wpg', |
|
| 29 | 1 | 'alias' => 'sbl-property-alias-parentpage', |
|
| 30 | 'visbility' => true |
||
| 31 | 1 | ] |
|
| 32 | 1 | ]; |
|
| 33 | |||
| 34 | 1 | foreach ( $propertyDefinitions as $propertyId => $definition ) { |
|
| 35 | |||
| 36 | 1 | $propertyRegistry->registerProperty( |
|
| 37 | 1 | $propertyId, |
|
| 38 | 1 | $definition['type'], |
|
| 39 | 1 | $definition['label'], |
|
| 40 | 1 | $definition['visbility'] |
|
| 41 | 1 | ); |
|
| 42 | |||
| 43 | 1 | $propertyRegistry->registerPropertyAlias( |
|
| 44 | 1 | $propertyId, |
|
| 45 | 1 | wfMessage( $definition['alias'] )->text() |
|
| 46 | 1 | ); |
|
| 47 | |||
| 48 | // 2.4+ |
||
| 49 | 1 | if ( method_exists( $propertyRegistry, 'registerPropertyAliasByMsgKey' ) ) { |
|
| 50 | 1 | $propertyRegistry->registerPropertyAliasByMsgKey( |
|
| 51 | 1 | $propertyId, |
|
| 52 | 1 | $definition['alias'] |
|
| 53 | 1 | ); |
|
| 54 | 1 | } |
|
| 55 | 1 | } |
|
| 56 | |||
| 57 | 1 | return true; |
|
| 58 | } |
||
| 59 | |||
| 61 |