Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
ConceptNamespaces
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 2
12
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
 getLocal
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace MediaWiki\Extension\WikibaseManifest;
4
5use Wikibase\Repo\Rdf\RdfVocabulary;
6
7class ConceptNamespaces {
8    private $localEntitySource;
9    private $rdfVocabulary;
10
11    public function __construct( $localEntitySource, RdfVocabulary $rdfVocabulary ) {
12        $this->localEntitySource = $localEntitySource;
13        $this->rdfVocabulary = $rdfVocabulary;
14    }
15
16    public function getLocal() {
17        $rdfVocabulary = $this->rdfVocabulary;
18        $dataNamespaces = [ RdfVocabulary::NS_DATA => $rdfVocabulary->dataNamespaceNames['local'] ];
19        $entityNamespaces = [ RdfVocabulary::NS_ENTITY => $rdfVocabulary->entityNamespaceNames['local'] ];
20        $propertyNamespaces = $rdfVocabulary->propertyNamespaceNames['local'];
21        $statementNamespaces = $rdfVocabulary->statementNamespaceNames['local'];
22        $relevant_ns = array_merge(
23            $entityNamespaces,
24            $dataNamespaces,
25            $statementNamespaces,
26            $propertyNamespaces
27        );
28
29        $result = [];
30        foreach ( $relevant_ns as $key => $value ) {
31            $result[$key] = $rdfVocabulary->getNamespaceURI( $value );
32        }
33
34        return $result;
35    }
36}