for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Form\Tests\Traits;
use Nip\Form\Form;
use Nip\Form\Tests\AbstractTest;
/**
* Class NewElementsMethodsTest
* @package Nip\Form\Tests\Traits
*/
class NewElementsMethodsTest extends AbstractTest
{
public function test_add_with_options()
$form = new Form();
$form->add('test', 'label', 'input', true, ['value' => 5]);
'label'
string
boolean
$label
Nip\Form\AbstractForm::add()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
$form->add('test', /** @scrutinizer ignore-type */ 'label', 'input', true, ['value' => 5]);
$element = $form->getElement('test');
self::assertSame(['value' => 5], $element->getOptions());
}