MarkdownTextExtra::scaffoldFormField()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/**
3
 * Same as MarkdownText but Extra markup is enabled by default.
4
 */
5
class MarkdownTextExtra extends MarkdownText
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

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.

Loading history...
6
{
7
    /**
8
     * Return MarkdownExtra content as HTML for templates
9
     * @return string HTML
10
     */
11
    public function forTemplate()
12
    {
13
        return $this->MarkdownExtraAsHTML();
14
    }
15
16
    /**
17
     * Return an instance of the MarkdownTextareaField
18
     * @param  string $title
0 ignored issues
show
Documentation introduced by
Should the type for parameter $title not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

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.

Loading history...
19
     * @param  array  $params
0 ignored issues
show
Documentation introduced by
Should the type for parameter $params not be array|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

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.

Loading history...
20
     * @return MarkdownTextareaField
21
     */
22
    public function scaffoldFormField($title = null, $params = null)
23
    {
24
        $field = new MarkdownTextareaField($this->name, $title);
25
        return $field->enableExtra();
26
    }
27
}
28