for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
<?php
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <[email protected]>
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
namespace Respect\Validation\Rules;
use Respect\Validation\Result;
use Respect\Validation\Rule;
/**
* Validates if none of the given validators validate.
* @author Alexandre Gomes Gaigalas <[email protected]>
* @author Henrique Moody <[email protected]>
* @since 0.3.9
final class OneOf implements Rule
{
* @var Rule[]
private $rules = [];
* Initializes the rule.
* @param Result $child
$child
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param Result ...$child2
public function __construct(Rule ...$rule)
$this->rules = $rule;
}
* {@inheritdoc}
public function validate($input): Result
$isValid = false;
$childrenResults = [];
foreach ($this->rules as $rule) {
$childResult = $rule->validate($input);
$isValid = $childResult->isValid() || $isValid;
$childrenResults[] = $childResult;
return new Result($isValid, $input, $this, [], ...$childrenResults);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.