classRegistry
final class Registry
The source extensions available to a project by format.
html, xml, ietf and markdown are read as documents, json with JSONPath and text by line; configured extension classes are added under their format names and may replace these.
Methods§
public function __construct(array<string, string> $classes = [])Parameters
$classes | array<string, string> | Extension class names by format |
Throws
InvalidInputException When a class does not implement SourceExtensionCalls 7
- new ResourceLoader line 29
- new DomSource line 30
- new JsonSource line 31
- new TextSource line 31
- function-call
is_aline 33 - class-const SourceExtension::class() line 33
- new InvalidInputException line 34
public function get(string $name): SourceExtensionReturns the extension registered for a format.
Parameters
$name | string | The format |
Returns
SourceExtension The extensionThrows
InvalidInputException When no extension reads that formatTest cases 7
RegistryTest::testGetBuiltInExtensioncallsRegistryTest::testGetConfiguredExtensioncallsRegistryTest::testGetConfiguredExtensionReplacesABuiltIncallsRegistryTest::testGetRejectsConfiguredNonExtensionscallsRegistryTest::testGetRejectsUnknownFormatscallsRegistryTest::testGetSharesOneDocumentExtensioncallsRegistryTest::testGetSharesOneLoaderAcrossFormatscalls
Called from 3
- method-call Requirements\Config\Loader::load() packages/requirements/src/Config/Loader.php:65
- method-call Requirements\Report\Analyzer::analyze() packages/requirements/src/Report/Analyzer.php:37
- method-call Requirements\Report\EvidenceMatcher::match() packages/requirements/src/Report/EvidenceMatcher.php:42
Calls 1
Private surface 1§
Implementation details, listed for orientation only.
private array<string, SourceExtension> $extensionsTest cases 26§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
RegistryTest::testGetBuiltInExtensioncallsRegistryTest::testGetConfiguredExtensioncallsRegistryTest::testGetConfiguredExtensionReplacesABuiltIncallsRegistryTest::testGetRejectsConfiguredNonExtensionscallsRegistryTest::testGetRejectsUnknownFormatscallsRegistryTest::testGetSharesOneDocumentExtensioncallsRegistryTest::testGetSharesOneLoaderAcrossFormatscalls
Other tests reaching this symbol 19
LoaderTestcallsMarkdownDocumentTestcallsApplicationTestcallsCommandHandlerTestcallsCommandLineTestcallsExecutorTestcallsFormatterTestcallsAnalyzerTestcallsCoverageTestcallsEvidenceMatcherTest::testMatchReadsTheSnapshotUnlessLivecallsEvidenceMatcherTest::testMatchRejectsAnUnknownFormatcallsEvidenceMatcherTest::testMatchRejectsAPartialQuotationcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingNoUnitcallsEvidenceMatcherTest::testMatchRejectsASelectorMatchingSeveralUnitscallsEvidenceMatcherTest::testMatchRejectsAUnitOutsideTheScopecallsEvidenceMatcherTest::testMatchRejectsTheTextOfTheOtherReadingModecallsEvidenceMatcherTest::testMatchReturnsTheKeyOfTheQuotedUnitcallsSnapshotTestcallsVerifierTestcalls
Relations§
Instantiated in 2
Method calls 3
- method-call Requirements\Config\Loader::load() packages/requirements/src/Config/Loader.php:65
- method-call Requirements\Report\Analyzer::analyze() packages/requirements/src/Report/Analyzer.php:37
- method-call Requirements\Report\EvidenceMatcher::match() packages/requirements/src/Report/EvidenceMatcher.php:42