Skip to content

Commit

Permalink
use default annotation method property
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Sep 16, 2015
1 parent b06d3e0 commit 142eb88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/Fake/FakeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function setForm(FormInterface $form)

/**
* @FormValidation
*
*
* = is same as @ FormValidation(form="form", onFailure="createActionValidationFailed")
*/
public function createAction($name)
Expand Down
7 changes: 4 additions & 3 deletions tests/Fake/FakeControllerVndError.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Ray\Di\Di\Inject;
use Ray\Di\Di\Named;
use Ray\WebFormModule\Annotation\FormValidation;
use Ray\WebFormModule\Annotation\InputValidation;
use Ray\WebFormModule\Annotation\VndError;

class FakeControllerVndError
Expand All @@ -24,10 +24,11 @@ public function setForm(FormInterface $form)
}

/**
* @FormValidation(form="form1", onFailure="badRequestAction")
* @InputValidation(form="form1")
* @VndError(
* message="foo validation failed",
* logref="a1000", path="/path/to/error",
* logref="a1000",
* path="/path/to/error",
* href={"_self"="/path/to/error", "help"="/path/to/help"}
* )
*/
Expand Down
6 changes: 3 additions & 3 deletions tests/Fake/FakeInputValidationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ class FakeInputValidationController
/**
* @var FormInterface
*/
protected $form1;
protected $form;

/**
* @Inject
* @Named("contact_form")
*/
public function setForm(FormInterface $form)
{
$this->form1 = $form;
$this->form = $form;
}

/**
* @InputValidation(form="form1")
* @InputValidation
*/
public function createAction($name)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Fake/FakeInvalidController2.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FakeInvalidController2
private $form = null;

/**
* @FormValidation(form="form")
* @FormValidation
*/
public function createAction()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Fake/FakeInvalidInstanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FakeInvalidInstanceController
private $form;

/**
* @FormValidation(form="form")
* @FormValidation
*/
public function createAction()
{
Expand Down

0 comments on commit 142eb88

Please sign in to comment.