for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Weew\ConfigSchema\Nodes;
use Weew\ConfigSchema\IConfigSchema;
use Weew\Validator\Constraints\AllowedConstraint;
use Weew\Validator\Constraints\ForbiddenConstraint;
use Weew\Validator\Constraints\NotNullConstraint;
use Weew\Validator\Constraints\NullableConstraint;
class ValueNode extends Node implements IValueNode {
/**
* ValueNode constructor.
*
* @param IConfigSchema $schema
* @param string $key
* @param string $message
*/
public function __construct(IConfigSchema $schema, $key, $message = null) {
parent::__construct($schema, $key);
$this->constraint(
new NotNullConstraint($message)
);
}
* @param array $values
* @return IValueNode
public function allowed(array $values) {
return $this->constraint(new AllowedConstraint($values));
public function forbidden(array $values) {
return $this->constraint(new ForbiddenConstraint($values));
public function nullable() {
return $this->constraint(
new NullableConstraint()