for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Formularium;
use Formularium\Exception\Exception;
use Formularium\HTMLElement;
abstract class Framework
{
/**
* @var string
*/
protected $name;
public function __construct(string $name)
$this->name = $name;
}
public static function factory(string $framework = ''): Framework
$class = "\\Formularium\\Frontend\\$framework\\Framework";
if (!class_exists($class)) {
throw new Exception("Invalid framework $framework");
return new $class();
public function getRenderable(Datatype $datatype): Renderable
return Renderable::factory($datatype, $this);
public function getName(): string
return $this->name;
* Returns a string with the <head> HTML to generate standalone files.
* This is used by the kitchensink generator.
*
* @return string
public function htmlHead(): string
return '';
* Returns a string with things to add to the footer of the page (such as scripts)
public function htmlFooter(): string
* @param Model $m
* @param HTMLElement[] $elements
* @param string $previousCompose
public function editableCompose(Model $m, array $elements, string $previousCompose): string
$m
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function editableCompose(/** @scrutinizer ignore-unused */ Model $m, array $elements, string $previousCompose): string
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$elements
public function editableCompose(Model $m, /** @scrutinizer ignore-unused */ array $elements, string $previousCompose): string
return $previousCompose;
public function viewableCompose(Model $m, array $elements, string $previousCompose): string
public function viewableCompose(Model $m, /** @scrutinizer ignore-unused */ array $elements, string $previousCompose): string
public function viewableCompose(/** @scrutinizer ignore-unused */ Model $m, array $elements, string $previousCompose): string
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.