mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 04:19:44 +01:00
[Nette] Add ChangeFormArrayAccessToAnnotatedControlVariableRector
This commit is contained in:
parent
91302f50af
commit
407e0c4d33
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Nette\Tests\Rector\ArrayDimFetch\ChangeFormArrayAccessToAnnotatedControlVariableRector\Fixture;
|
||||
|
||||
use Nette\Application\UI\Form;
|
||||
|
||||
class SelectBoxPresenter
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$form = new Form();
|
||||
$this->addText('email', 'Email');
|
||||
$form['email']->value = 'hey@hi.hello';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Nette\Tests\Rector\ArrayDimFetch\ChangeFormArrayAccessToAnnotatedControlVariableRector\Fixture;
|
||||
|
||||
use Nette\Application\UI\Form;
|
||||
|
||||
class SelectBoxPresenter
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$form = new Form();
|
||||
$this->addText('email', 'Email');
|
||||
/** @var \Nette\Forms\Controls\BaseControl $emailControl */
|
||||
$emailControl = $form['email'];
|
||||
$emailControl->value = 'hey@hi.hello';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user