Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
JsonSchemaHooksHelper
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 isSchemaNamespaceEnabled
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\EventLogging;
4
5use MediaWiki\Config\ServiceOptions;
6
7class JsonSchemaHooksHelper {
8    public const CONSTRUCTOR_OPTIONS = [
9        'EventLoggingDBname',
10        'DBname',
11    ];
12
13    private ServiceOptions $options;
14
15    public function __construct( ServiceOptions $options ) {
16        $this->options = $options;
17        $this->options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
18    }
19
20    /**
21     * Convenience function to determine whether the Schema namespace is enabled.
22     *
23     * @return bool
24     */
25    public function isSchemaNamespaceEnabled(): bool {
26        return $this->options->get( 'EventLoggingDBname' ) === $this->options->get( 'DBname' );
27    }
28}