| Conditions | 1 |
| Paths | 1 |
| Total Lines | 64 |
| Code Lines | 47 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 39 | public function options() { |
||
| 40 | |||
| 41 | $options = array( |
||
| 42 | 'output_options' => array( |
||
| 43 | 'label' => __( 'Output Options', 'pods' ), |
||
| 44 | 'group' => array( |
||
| 45 | static::$type . '_allow_html' => array( |
||
| 46 | 'label' => __( 'Allow HTML?', 'pods' ), |
||
| 47 | 'default' => 1, |
||
| 48 | 'type' => 'boolean', |
||
| 49 | 'dependency' => true, |
||
| 50 | ), |
||
| 51 | static::$type . '_oembed' => array( |
||
| 52 | 'label' => __( 'Enable oEmbed?', 'pods' ), |
||
| 53 | 'default' => 0, |
||
| 54 | 'type' => 'boolean', |
||
| 55 | 'help' => array( |
||
| 56 | __( 'Embed videos, images, tweets, and other content.', 'pods' ), |
||
| 57 | 'http://codex.wordpress.org/Embeds', |
||
| 58 | ), |
||
| 59 | ), |
||
| 60 | static::$type . '_wptexturize' => array( |
||
| 61 | 'label' => __( 'Enable wptexturize?', 'pods' ), |
||
| 62 | 'default' => 1, |
||
| 63 | 'type' => 'boolean', |
||
| 64 | 'help' => array( |
||
| 65 | __( 'Transforms less-beautfiul text characters into stylized equivalents.', 'pods' ), |
||
| 66 | 'http://codex.wordpress.org/Function_Reference/wptexturize', |
||
| 67 | ), |
||
| 68 | ), |
||
| 69 | static::$type . '_convert_chars' => array( |
||
| 70 | 'label' => __( 'Enable convert_chars?', 'pods' ), |
||
| 71 | 'default' => 1, |
||
| 72 | 'type' => 'boolean', |
||
| 73 | 'help' => array( |
||
| 74 | __( 'Converts text into valid XHTML and Unicode', 'pods' ), |
||
| 75 | 'http://codex.wordpress.org/Function_Reference/convert_chars', |
||
| 76 | ), |
||
| 77 | ), |
||
| 78 | static::$type . '_wpautop' => array( |
||
| 79 | 'label' => __( 'Enable wpautop?', 'pods' ), |
||
| 80 | 'default' => 1, |
||
| 81 | 'type' => 'boolean', |
||
| 82 | 'help' => array( |
||
| 83 | __( 'Changes double line-breaks in the text into HTML paragraphs.', 'pods' ), |
||
| 84 | 'http://codex.wordpress.org/Function_Reference/wpautop', |
||
| 85 | ), |
||
| 86 | ), |
||
| 87 | static::$type . '_allow_shortcode' => array( |
||
| 88 | 'label' => __( 'Allow Shortcodes?', 'pods' ), |
||
| 89 | 'default' => 0, |
||
| 90 | 'type' => 'boolean', |
||
| 91 | 'dependency' => true, |
||
| 92 | 'help' => array( |
||
| 93 | __( 'Embed [shortcodes] that help transform your static content into dynamic content.', 'pods' ), |
||
| 94 | 'http://codex.wordpress.org/Shortcode_API', |
||
| 95 | ), |
||
| 96 | ), |
||
| 97 | ), |
||
| 98 | ), |
||
| 99 | ); |
||
| 100 | |||
| 101 | return $options; |
||
| 102 | } |
||
| 103 | |||
| 171 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.