for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Represents a large text field that contains HTML and Markdown content.
* Markdown gets processed automatically to HTML in templates
*/
class MarkdownText extends HTMLText {
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.
* Define the casting for field names and types
* @var array
public static $casting = array(
'MarkdownAsHTML' => 'MarkdownText',
'MarkdownExtraAsHTML' => 'MarkdownText',
);
* Returns Markdown content as HTML for templates
* @return string HTML
public function forTemplate() {
return $this->MarkdownAsHTML();
}
* Return Markdown content as HTML
public function MarkdownAsHTML() {
$parser = new MarkdownParser($this->value);
return $parser->parse();
* Return MarkdownExtra content as HTML
public function MarkdownExtraAsHTML() {
return $parser->parseExtra();
* Return an instance of the MarkdownTextareaField
* @param string $title
$title
string|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
* @param array $params
$params
array|null
* @return MarkdownTextareaField
public function scaffoldFormField($title = null, $params = null) {
return new MarkdownTextareaField($this->name, $title);
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.