Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Annotations/IgnoreValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class IgnoreValidation
{
/**
* Name of the argument to skip validation for. (Can be given as anonymous argument.)
* @var string
* @var string|null
*/
public $argumentName;

Expand All @@ -38,9 +38,9 @@ final class IgnoreValidation
*/
public $evaluate = false;

public function __construct(string $argumentName, bool $evaluate = false)
public function __construct(string $argumentName = null, bool $evaluate = false)
{
$this->argumentName = ltrim($argumentName, '$');
$this->argumentName = $argumentName ? ltrim($argumentName, '$') : null;
$this->evaluate = $evaluate;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
namespace Neos\Flow\Tests\Functional\Mvc\Fixtures\Controller;

/*
* This file is part of the Neos.Flow package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Neos\Flow\Annotations as Flow;

/**
* A nested object with validation
*/
class NestedObject
{
/**
* @var string
* @Flow\Validate(type="NotEmpty")
*/
protected $name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ class TestObjectArgument implements TestObjectInterface
*/
protected $related;

/**
* @var NestedObject
* @Flow\IgnoreValidation
*/
protected $nested;

public function __construct()
{
$this->collection = new ArrayCollection();
$this->nested = new NestedObject();
}

/**
Expand Down