for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helmut\Forms\Fields\Checkbox;
use Helmut\Forms\Field;
class Checkbox extends Field {
public $value = false;
public function getValue()
{
return $this->value;
}
public function getButtonName()
//
public function renderWith()
return ['checked' => $this->value];
public function setChecked()
$this->default = true;
true
boolean
array
$default
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..
return $this;
public function setUnchecked()
$this->default = false;
false
public function setValueFromDefault()
$this->value = $this->default;
$this->default
$value
public function setValueFromModel($model)
if (property_exists($model, $this->name)) $this->value = $model->{$this->name} ? true : false;
public function setValueFromRequest($request)
$this->value = $request->get($this->name) ? true : false;
public function fillModelWithValue($model)
if (property_exists($model, $this->name)) $model->{$this->name} = $this->value ? 1 : 0;
public function validateRequired()
return $this->value === true;
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..