Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Sep 29, 2022
1 parent efadb52 commit e594d5b
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/Documentation/StandardDocumentationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function get(DOMElement $node): string
foreach ($childNode->childNodes as $subChildNode) {
if ($subChildNode instanceof DOMElement && $subChildNode->localName == 'documentation') {
if (!empty($doc)) {
$doc .= "\n" . ($subChildNode->nodeValue);
$doc .= "\n".($subChildNode->nodeValue);
} else {
$doc .= ($subChildNode->nodeValue);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Element/ElementSingle.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

interface ElementSingle extends ElementItem, InterfaceSetMinMax, InterfaceSetDefault
{
public function getType(): ? Type;
public function getType(): ?Type;

public function isQualified(): bool;

Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Inheritance/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class Base
*/
protected $base;

public function getBase(): ? Type
public function getBase(): ?Type
{
return $this->base;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Inheritance/Restriction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public function getChecks(): array
*/
public function getChecksByType(string $type): array
{
return isset($this->checks[$type]) ? $this->checks[$type] : [];
return $this->checks[$type] ?? [];
}
}
8 changes: 4 additions & 4 deletions src/Schema/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function findSomethingNoThrow(
string $name,
string $namespace = null,
array &$calling = []
): ? SchemaItem {
): ?SchemaItem {
$calling[spl_object_hash($this)] = true;
$cid = "$getter, $name, $namespace";

Expand Down Expand Up @@ -64,7 +64,7 @@ protected function findSomethingNoThrowSchemas(
string $name,
string $namespace = null,
array &$calling = []
): ? SchemaItem {
): ?SchemaItem {
foreach ($schemas as $childSchema) {
if (!isset($calling[spl_object_hash($childSchema)])) {
/**
Expand Down Expand Up @@ -182,7 +182,7 @@ public function getTargetNamespace(): ?string
return $this->targetNamespace;
}

public function setTargetNamespace(? string $targetNamespace): void
public function setTargetNamespace(?string $targetNamespace): void
{
$this->targetNamespace = $targetNamespace;
}
Expand Down Expand Up @@ -318,7 +318,7 @@ public function getType(string $name): ?Type
return null;
}

public function getAttribute(string $name): ? AttributeItem
public function getAttribute(string $name): ?AttributeItem
{
if (isset($this->attributes[$name])) {
return $this->attributes[$name];
Expand Down
25 changes: 12 additions & 13 deletions src/SchemaReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ private function loadSequenceChildNode(
ElementContainer $elementContainer,
DOMElement $node,
DOMElement $childNode,
? int $max,
? int $min = null
?int $max,
?int $min = null
): void {
switch ($childNode->localName) {
case 'sequence':
Expand Down Expand Up @@ -419,8 +419,8 @@ private function loadSequenceChildNodeLoadElement(
ElementContainer $elementContainer,
DOMElement $node,
DOMElement $childNode,
? int $max,
? int $min
?int $max,
?int $min
): void {
if ($childNode->hasAttribute('ref')) {
$elementDef = $this->findElement($elementContainer->getSchema(), $node, $childNode->getAttribute('ref'));
Expand Down Expand Up @@ -915,7 +915,7 @@ private static function splitParts(DOMElement $node, string $typeName): array
$prefix = null;
$name = $typeName;
if (strpos($typeName, ':') !== false) {
list($prefix, $name) = explode(':', $typeName);
[$prefix, $name] = explode(':', $typeName);
}

/**
Expand All @@ -932,7 +932,7 @@ private static function splitParts(DOMElement $node, string $typeName): array

private function findAttributeItem(Schema $schema, DOMElement $node, string $typeName): AttributeItem
{
list($name, $namespace) = static::splitParts($node, $typeName);
[$name, $namespace] = static::splitParts($node, $typeName);

/**
* @var string|null $namespace
Expand All @@ -953,7 +953,7 @@ private function findAttributeItem(Schema $schema, DOMElement $node, string $typ

private function findAttributeGroup(Schema $schema, DOMElement $node, string $typeName): AttributeGroup
{
list($name, $namespace) = static::splitParts($node, $typeName);
[$name, $namespace] = static::splitParts($node, $typeName);

/**
* @var string|null $namespace
Expand All @@ -974,7 +974,7 @@ private function findAttributeGroup(Schema $schema, DOMElement $node, string $ty

private function findElement(Schema $schema, DOMElement $node, string $typeName): ElementDef
{
list($name, $namespace) = static::splitParts($node, $typeName);
[$name, $namespace] = static::splitParts($node, $typeName);

/**
* @var string|null $namespace
Expand All @@ -990,7 +990,7 @@ private function findElement(Schema $schema, DOMElement $node, string $typeName)

private function findGroup(Schema $schema, DOMElement $node, string $typeName): Group
{
list($name, $namespace) = static::splitParts($node, $typeName);
[$name, $namespace] = static::splitParts($node, $typeName);

/**
* @var string|null $namespace
Expand All @@ -1011,7 +1011,7 @@ private function findGroup(Schema $schema, DOMElement $node, string $typeName):

private function findType(Schema $schema, DOMElement $node, string $typeName): SchemaItem
{
list($name, $namespace) = static::splitParts($node, $typeName);
[$name, $namespace] = static::splitParts($node, $typeName);

/**
* @var string|null $namespace
Expand Down Expand Up @@ -1165,9 +1165,8 @@ private function loadImportFresh(
): Closure {
return function () use ($namespace, $schema, $file): void {
$dom = $this->getDOM(
isset($this->knownLocationSchemas[$file])
? $this->knownLocationSchemas[$file]
: $file
$this->knownLocationSchemas[$file]
?? $file
);

$schemaNew = $this->createOrUseSchemaForNs($schema, $namespace);
Expand Down
2 changes: 1 addition & 1 deletion tests/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FilesystemTest extends BaseTest
*
* Covers the issue described in {@link https://github.com/goetas/xsd-reader/pull/10 PR #10}.
*/
public function testReferencedOnFileSystem_1()
public function testReferencedOnFileSystem1()
{
/*
* Using vfsStream seems ideal, but currently seems to have an issue with directorypaths with a space in
Expand Down
20 changes: 10 additions & 10 deletions tests/RestrictionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class RestrictionsTest extends BaseTest
/**
* Test the correct detection an Enumeration-restriction.
*/
public function testRestriction_1()
public function testRestriction1()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -52,7 +52,7 @@ public function testRestriction_1()
/**
* Test the correct detection a pattern-restriction.
*/
public function testRestriction_2()
public function testRestriction2()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -87,7 +87,7 @@ public function testRestriction_2()
/**
* Test the correct detection a length-restriction.
*/
public function testRestriction_3()
public function testRestriction3()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -122,7 +122,7 @@ public function testRestriction_3()
/**
* Test the correct detection a minLength- and maxLength-restriction.
*/
public function testRestriction_4()
public function testRestriction4()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -164,7 +164,7 @@ public function testRestriction_4()
/**
* Test the correct detection a minInclusive- and maxInclusive-restriction.
*/
public function testRestriction_5()
public function testRestriction5()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -206,7 +206,7 @@ public function testRestriction_5()
/**
* Test the correct detection a minExclusive- and maxExclusive-restriction.
*/
public function testRestriction_6()
public function testRestriction6()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -248,7 +248,7 @@ public function testRestriction_6()
/**
* Test the correct detection a fractionDigits-restriction.
*/
public function testRestriction_7()
public function testRestriction7()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -283,7 +283,7 @@ public function testRestriction_7()
/**
* Test the correct detection a totalDigits-restriction.
*/
public function testRestriction_8()
public function testRestriction8()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -318,7 +318,7 @@ public function testRestriction_8()
/**
* Test the correct detection a totalDigits- and fractionDigits-restriction.
*/
public function testRestriction_9()
public function testRestriction9()
{
$schema = $this->reader->readString(
'
Expand Down Expand Up @@ -360,7 +360,7 @@ public function testRestriction_9()
/**
* Test the correct detection a whiteSpace-restriction.
*/
public function testRestriction_10()
public function testRestriction10()
{
$schema = $this->reader->readString(
'
Expand Down
1 change: 0 additions & 1 deletion tests/TypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ public function getMaxOccurencesOverride()
];
}


public function getMinOccurences()
{
return [
Expand Down

0 comments on commit e594d5b

Please sign in to comment.