Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Nov 25, 2023
1 parent a75eddd commit df4df5a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 36 deletions.
12 changes: 1 addition & 11 deletions src/Constraint/XmlMatchesXsdForV5.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,11 @@ public function __construct($xsd)
$this->xsd = $xsd;
}

/**
* {@inheritdoc}
*/
public function toString()
{
return 'matches XSD';
}

/**
* {@inheritdoc}
*/
protected function failureDescription($other)
{
if (\is_string($other)) {
Expand All @@ -79,15 +73,11 @@ protected function failureDescription($other)
return $type.' '.$this->toString();
}

/**
* {@inheritdoc}
*/
protected function matches($other)
{
return \is_string($other)
? $this->stringMatches($other)
: false
;
: false;
}

/**
Expand Down
12 changes: 1 addition & 11 deletions src/Constraint/XmlMatchesXsdForV7.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,11 @@ public function __construct($xsd)
$this->xsd = $xsd;
}

/**
* {@inheritdoc}
*/
public function toString(): string
{
return 'matches XSD';
}

/**
* {@inheritdoc}
*/
protected function failureDescription($other): string
{
if (\is_string($other)) {
Expand All @@ -75,15 +69,11 @@ protected function failureDescription($other): string
return $type.' '.$this->toString();
}

/**
* {@inheritdoc}
*/
protected function matches($other): bool
{
return \is_string($other)
? $this->stringMatches($other)
: false
;
: false;
}

/**
Expand Down
12 changes: 1 addition & 11 deletions src/Constraint/XmlMatchesXsdForV8.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,11 @@ public function __construct($xsd)
$this->xsd = $xsd;
}

/**
* {@inheritdoc}
*/
public function toString(): string
{
return 'matches XSD';
}

/**
* {@inheritdoc}
*/
protected function failureDescription($other): string
{
if (\is_string($other)) {
Expand All @@ -73,15 +67,11 @@ protected function failureDescription($other): string
return $type.' '.$this->toString();
}

/**
* {@inheritdoc}
*/
protected function matches($other): bool
{
return \is_string($other)
? $this->stringMatches($other)
: false
;
: false;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Constraint/XmlMatchesXsdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public function testAssertXMLMatchesXSD()
}

$constraint->evaluate($content); // should not throw an exception
static::assertTrue($constraint->evaluate($content, '', true));
self::assertTrue($constraint->evaluate($content, '', true));
}

public function testXMLValidConstraintBasics()
{
$constraint = new XmlMatchesXsd('');
static::assertSame(1, $constraint->count());
static::assertSame('matches XSD', $constraint->toString());
self::assertSame(1, $constraint->count());
self::assertSame('matches XSD', $constraint->toString());
}

public function testXMLValidConstraintFalse()
Expand Down

0 comments on commit df4df5a

Please sign in to comment.