for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace UniMan\Drivers\RabbitMQ\Forms;
use UniMan\Core\CredentialsFormInterface;
use Nette\Application\UI\Form;
class RabbitMQCredentialsForm implements CredentialsFormInterface
{
public function addFieldsToForm(Form $form)
$form->addText('user', 'rabbitmq.form.user.label')
->setAttribute('placeholder', 'guest')
'guest'
string
boolean
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
->setAttribute('autofocus');
$form->addPassword('password', 'rabbitmq.form.password.label')
->setAttribute('placeholder', 'guest');
$form->addText('host', 'rabbitmq.form.host.label')
->setAttribute('placeholder', 'localhost');
'localhost'
$form->addText('port', 'rabbitmq.form.port.label')
->setAttribute('placeholder', '5672');
'5672'
$form->addText('api_host', 'rabbitmq.form.rabbitmq_management_http_api_host.label')
->setAttribute('placeholder', 'localhost')
->setOption('description', 'rabbitmq.form.rabbitmq_management_http_api_host.description');
$form->addText('api_port', 'rabbitmq.form.rabbitmq_management_http_api_port.label')
->setAttribute('placeholder', '15672')
'15672'
->setOption('description', 'rabbitmq.form.rabbitmq_management_http_api_port.description');
}
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: