for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace OldSound\RabbitMqBundle\RabbitMq\Validator;
use DOMDocument;
class XmlValidator implements ValidatorInterface
{
private $schema = null;
public function setSchema($schema, $additionalProperties = array()) {
$this->schema = $schema;
}
public function validate($msg)
$xml = new DOMDocument();
$xml->load($msg);
return $xml->schemaValidate($this->schema) == true ? null : "XML schema validation failed.";
===
When comparing two booleans, it is generally considered safer to use the strict comparison operator.
public function getContentType() {
return "application/xml";
When comparing two booleans, it is generally considered safer to use the strict comparison operator.