for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Rocket\UI\Forms\Fields;
/**
* Manage hidden fields
*/
* Hidden field
*
* @author Stéphane Goetz
class Honeypot extends Field
{
* Extends the type
* @param string $id
* @param array $data
public function __construct($id, $data = [])
$this->id = $data;
$data
array
string
$id
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->time_field = $data['time'];
time_field
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* Override the attributes to stay hidden
public function render()
return (new \Msurguy\Honeypot\Honeypot())->getFormHTML($this->id, $this->time_field);
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..