Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 1
NoopValidator
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 6
42
0.00% covered (danger)
0.00%
0 / 1
 validateStrictly
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 validatePermissively
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 areSchemasSupported
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSchemaBuilder
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSchemaVersion
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSchemaIterator
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\CommunityConfiguration\Validation;
4
5use Iterator;
6use LogicException;
7use MediaWiki\Extension\CommunityConfiguration\Schema\SchemaBuilder;
8
9/**
10 * Validator that always passes
11 *
12 * Useful for testing purposes or for configuration providers that can work with arbitrary data.
13 */
14class NoopValidator implements IValidator {
15
16    /**
17     * @inheritDoc
18     */
19    public function validateStrictly( $config ): ValidationStatus {
20        return ValidationStatus::newGood();
21    }
22
23    /**
24     * @inheritDoc
25     */
26    public function validatePermissively( $config ): ValidationStatus {
27        return ValidationStatus::newGood();
28    }
29
30    /**
31     * @inheritDoc
32     */
33    public function areSchemasSupported(): bool {
34        return false;
35    }
36
37    /**
38     * @inheritDoc
39     * @return never
40     */
41    public function getSchemaBuilder(): SchemaBuilder {
42        throw new LogicException( __METHOD__ . ' is not supported' );
43    }
44
45    /**
46     * @inheritDoc
47     * @return never
48     */
49    public function getSchemaVersion(): ?string {
50        throw new LogicException( __METHOD__ . ' is not supported' );
51    }
52
53    /**
54     * @inheritDoc
55     * @return never
56     */
57    public function getSchemaIterator(): Iterator {
58        throw new LogicException( __METHOD__ . ' is not supported' );
59    }
60}