mirror of
https://github.com/Respect/Validation.git
synced 2024-06-03 06:12:17 +02:00
Apply "SlevomatCodingStandard.Variables.UnusedVariable"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
e89b32270b
commit
147804287b
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Respect\Validation\Rules;
|
||||
|
||||
use function array_keys;
|
||||
use Respect\Validation\Exceptions\ComponentException;
|
||||
use Respect\Validation\Exceptions\ValidationException;
|
||||
use Respect\Validation\Validatable;
|
||||
|
@ -75,7 +76,7 @@ class KeyValue extends AbstractRule
|
|||
private function overwriteExceptionParams(ValidationException $exception): ValidationException
|
||||
{
|
||||
$params = [];
|
||||
foreach ($exception->getParams() as $key => $value) {
|
||||
foreach (array_keys($exception->getParams()) as $key) {
|
||||
if (in_array($key, ['template', 'translator'])) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
</rule>
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
|
||||
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" />
|
||||
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable" />
|
||||
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
|
||||
<rule ref="Squiz.PHP.CommentedOutCode" />
|
||||
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
|
||||
|
|
|
@ -155,8 +155,6 @@ final class AbstractRelatedTest extends TestCase
|
|||
*/
|
||||
public function shouldNotDefineRuleNameAsReferenceWhenRuleDoesHaveName(): void
|
||||
{
|
||||
$reference = 'something';
|
||||
|
||||
$ruleMock = $this->createMock(Validatable::class);
|
||||
$ruleMock
|
||||
->expects(self::at(0))
|
||||
|
@ -195,8 +193,6 @@ final class AbstractRelatedTest extends TestCase
|
|||
public function shouldDefineChildNameWhenDefiningTheNameOfTheParent(): void
|
||||
{
|
||||
$name = 'My new name';
|
||||
$reference = 'something';
|
||||
|
||||
$ruleMock = $this->createMock(Validatable::class);
|
||||
$ruleMock
|
||||
->expects(self::at(0))
|
||||
|
@ -207,7 +203,7 @@ final class AbstractRelatedTest extends TestCase
|
|||
->method('setName')
|
||||
->with($name);
|
||||
|
||||
$abstractMock = $this
|
||||
$this
|
||||
->getMockBuilder(AbstractRelated::class)
|
||||
->setConstructorArgs(['something', $ruleMock])
|
||||
->getMock();
|
||||
|
|
Loading…
Reference in a new issue