for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace hemio\form;
class FieldText extends Abstract_\FormFieldInput {
public function getInputType() {
return 'text';
}
/**
*
* @param string $placeholder
*/
public function setPlaceholder($placeholder) {
$this->getControlElement()->setAttribute('placeholder', $placeholder);
* @param boolean $allow
public function setAllowMultiple($allow = true) {
$this->getControlElement()->setAttribute('multiple', (boolean) $allow);
* @param boolean $required
public function setRequired($required = true) {
$this->addValidityCheck(new CheckMinLength(1));
$this->required = $required;
$this->getControlElement()->setAttribute('required', (boolean) $required);
public function setPattern($pattern, $message = null) {
$this->addValidityCheck(new CheckPattern('pattern', $pattern, $message));
'pattern'
string
object<hemio\form\type>
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);
$this->getControlElement()->setAttribute('pattern', $pattern);
if ($message !== null)
$this->getControlElement()->setAttribute('title', $message);
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: