for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package userforms
*/
class UserFormsCheckboxSetField extends CheckboxSetField {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
* jQuery validate requires that the value of the option does not contain
* the actual value of the input.
*
* @return ArrayList
public function getOptions() {
$options = parent::getOptions();
foreach($options as $option) {
$option->Name = "{$this->name}[]";
}
return $options;
* @inheritdoc
* @return array
public function getSourceAsArray()
{
$array = parent::getSourceAsArray();
return array_values($array);
* @param Validator $validator
* @return bool
public function validate($validator)
// get the previous values (could contain comma-delimited list)
$previous = $value = $this->Value();
if (strstr($value, ",")) {
$value = explode(",", $value);
// set the value as an array for parent validation
$this->setValue($value);
$validated = parent::validate($validator);
// restore previous value after validation
$this->setValue($previous);
return $validated;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.