Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Jan 17, 2018
1 parent 921ddb4 commit 6bd2264
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/SchemaReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@ private function loadImport(
Schema $schema,
DOMElement $node
): Closure {

$namespace = $node->getAttribute('namespace');
$schemaLocation = $node->getAttribute('schemaLocation');

Expand All @@ -1088,6 +1087,7 @@ private function loadImport(

if (isset($this->loadedFiles[$file])) {
$schema->addSchema($this->loadedFiles[$file]);

return function () {
};
}
Expand All @@ -1099,7 +1099,6 @@ private function createOrUseSchemaForNs(
Schema $schema,
string $namespace
): Schema {

if (('' !== trim($namespace))) {
$newSchema = new Schema();
$newSchema->addSchema($this->getGlobalSchema());
Expand All @@ -1117,7 +1116,6 @@ private function loadImportFresh(
string $file
): Closure {
return function () use ($namespace, $schema, $file) {

$dom = $this->getDOM(
isset($this->knownLocationSchemas[$file])
? $this->knownLocationSchemas[$file]
Expand Down Expand Up @@ -1208,7 +1206,6 @@ public function readNodes(array $nodes, string $file = null)
$all = array();
foreach ($nodes as $k => $node) {
if (($node instanceof \DOMElement) && $node->namespaceURI === self::XSD_NS && $node->localName == 'schema') {

$holderSchema = new Schema();
$holderSchema->addSchema($this->getGlobalSchema());

Expand All @@ -1224,6 +1221,7 @@ public function readNodes(array $nodes, string $file = null)
foreach ($all as $callback) {
call_user_func($callback);
}

return $rootSchema;
}

Expand All @@ -1238,7 +1236,6 @@ public function readNode(DOMElement $node, string $file = null): Schema

$this->setLoadedSchema($node, $rootSchema);


$callbacks = $this->schemaNode($rootSchema, $node);

foreach ($callbacks as $callback) {
Expand Down
3 changes: 1 addition & 2 deletions tests/ImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function testDependentImport()
');
$schema = $this->reader->readNodes(iterator_to_array($dom->documentElement->childNodes));

$this->assertInstanceOf(ElementDef::class, $schema->findElement("outerEl", "http://tempuri.org/1"));

$this->assertInstanceOf(ElementDef::class, $schema->findElement('outerEl', 'http://tempuri.org/1'));
}
}

0 comments on commit 6bd2264

Please sign in to comment.