for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DNADesign\ElementalUserForms\Model;
use SilverStripe\UserForms\Control\UserDefinedFormController;
use SilverStripe\UserForms\UserForm;
use SilverStripe\Control\Controller;
use DNADesign\Elemental\Models\BaseElement;
use DNADesign\ElementalUserForms\Control\ElementFormController;
class ElementForm extends BaseElement
{
use UserForm;
private static $table_name = 'ElementForm';
$table_name
This check marks private properties in classes that are never used. Those properties can be removed.
private static $icon = 'dnadesign/silverstripe-elemental-userforms:images/form.svg';
$icon
private static $controller_class = ElementFormController::class;
$controller_class
private static $singular_name = 'form';
$singular_name
private static $plural_name = 'forms';
$plural_name
/**
* @return UserForm
*/
public function Form()
$controller = UserDefinedFormController::create($this);
$current = Controller::curr();
$controller->setRequest($current->getRequest());
if ($current && $current->getAction() == 'finished') {
return $controller->renderWith(UserDefinedFormController::class .'_ReceivedFormSubmission');
}
$form = $controller->Form();
$form->setFormAction(
Controller::join_links(
$current->Link(),
'element',
$this->owner->ID,
owner
DNADesign\ElementalUserForms\Model\ElementForm
__get
'Form'
)
);
return $form;
public function Link($action = null)
if ($action === 'finished') {
return Controller::join_links(
'finished'
return parent::Link($action);
public function getType()
return _t(__CLASS__ . '.BlockType', 'Form');
This check marks private properties in classes that are never used. Those properties can be removed.