| Conditions | 1 |
| Paths | 1 |
| Total Lines | 121 |
| Code Lines | 95 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 45 | protected function bbcode_data() |
||
| 46 | { |
||
| 47 | return array( |
||
| 48 | 'font=' => array( |
||
| 49 | 'bbcode_helpline' => 'ABBC3_FONT_HELPLINE', |
||
| 50 | 'bbcode_match' => '[font={INTTEXT}]{TEXT}[/font]', |
||
| 51 | 'bbcode_tpl' => '<span style="font-family: {INTTEXT};">{TEXT}</span>', |
||
| 52 | ), |
||
| 53 | 'highlight=' => array( |
||
| 54 | 'bbcode_helpline' => 'ABBC3_HIGHLIGHT_HELPLINE', |
||
| 55 | 'bbcode_match' => '[highlight={COLOR}]{TEXT}[/highlight]', |
||
| 56 | 'bbcode_tpl' => '<span style="background-color: {COLOR};">{TEXT}</span>', |
||
| 57 | ), |
||
| 58 | 'align=center' => array( |
||
| 59 | 'bbcode_helpline' => 'ABBC3_ALIGN_HELPLINE', |
||
| 60 | 'bbcode_match' => '[align={IDENTIFIER}]{TEXT}[/align]', |
||
| 61 | 'bbcode_tpl' => '<span style="text-align:{IDENTIFIER}; display:block;">{TEXT}</span>', |
||
| 62 | ), |
||
| 63 | 'float=' => array( |
||
| 64 | 'bbcode_helpline' => 'ABBC3_FLOAT_HELPLINE', |
||
| 65 | 'bbcode_match' => '[float={IDENTIFIER}]{TEXT}[/float]', |
||
| 66 | 'bbcode_tpl' => '<div style="float:{IDENTIFIER}; padding:0 10px;">{TEXT}</div>', |
||
| 67 | ), |
||
| 68 | 'pre' => array( |
||
| 69 | 'bbcode_helpline' => 'ABBC3_PREFORMAT_HELPLINE', |
||
| 70 | 'bbcode_match' => '[pre]{TEXT}[/pre]', |
||
| 71 | 'bbcode_tpl' => '<pre class="abbc3_pre">{TEXT}</pre>', |
||
| 72 | ), |
||
| 73 | 's' => array( |
||
| 74 | 'bbcode_helpline' => 'ABBC3_STRIKE_HELPLINE', |
||
| 75 | 'bbcode_match' => '[s]{TEXT}[/s]', |
||
| 76 | 'bbcode_tpl' => '<span class="abbc3_strike">{TEXT}</span>', |
||
| 77 | ), |
||
| 78 | 'sup' => array( |
||
| 79 | 'bbcode_helpline' => 'ABBC3_SUP_HELPLINE', |
||
| 80 | 'bbcode_match' => '[sup]{TEXT}[/sup]', |
||
| 81 | 'bbcode_tpl' => '<sup>{TEXT}</sup>', |
||
| 82 | ), |
||
| 83 | 'sub' => array( |
||
| 84 | 'bbcode_helpline' => 'ABBC3_SUB_HELPLINE', |
||
| 85 | 'bbcode_match' => '[sub]{TEXT}[/sub]', |
||
| 86 | 'bbcode_tpl' => '<sub>{TEXT}</sub>', |
||
| 87 | ), |
||
| 88 | 'glow=' => array( |
||
| 89 | 'bbcode_helpline' => 'ABBC3_GLOW_HELPLINE', |
||
| 90 | 'bbcode_match' => '[glow={COLOR}]{TEXT}[/glow]', |
||
| 91 | 'bbcode_tpl' => '<span class="glow" style="display: inline; padding: 0 6px; color: #ffffff; text-shadow: 0 0 1em {COLOR}, 0 0 1em {COLOR}, 0 0 1.2em {COLOR};">{TEXT}</span>', |
||
| 92 | ), |
||
| 93 | 'shadow=' => array( |
||
| 94 | 'bbcode_helpline' => 'ABBC3_SHADOW_HELPLINE', |
||
| 95 | 'bbcode_match' => '[shadow={COLOR}]{TEXT}[/shadow]', |
||
| 96 | 'bbcode_tpl' => '<span class="shadow" style="display: inline; padding: 0 6px; color: {COLOR}; text-shadow: -2px 2px 2px #999;">{TEXT}</span>', |
||
| 97 | ), |
||
| 98 | 'dropshadow=' => array( |
||
| 99 | 'bbcode_helpline' => 'ABBC3_DROPSHADOW_HELPLINE', |
||
| 100 | 'bbcode_match' => '[dropshadow={COLOR}]{TEXT}[/dropshadow]', |
||
| 101 | 'bbcode_tpl' => '<span class="dropshadow" style="display: inline; padding: 0 6px; color: {COLOR}; text-shadow: -1px 1px 0 #999;">{TEXT}</span>', |
||
| 102 | ), |
||
| 103 | 'blur=' => array( |
||
| 104 | 'bbcode_helpline' => 'ABBC3_BLUR_HELPLINE', |
||
| 105 | 'bbcode_match' => '[blur={COLOR}]{TEXT}[/blur]', |
||
| 106 | 'bbcode_tpl' => '<span class="blur" style="display: inline; padding: 0 6px; color: transparent; text-shadow: 0 0 0.2em {COLOR};">{TEXT}</span>', |
||
| 107 | ), |
||
| 108 | 'fade' => array( |
||
| 109 | 'bbcode_helpline' => 'ABBC3_FADE_HELPLINE', |
||
| 110 | 'bbcode_match' => '[fade]{TEXT}[/fade]', |
||
| 111 | 'bbcode_tpl' => '<span class="fadeEffect">{TEXT}</span>', |
||
| 112 | ), |
||
| 113 | 'dir=ltr' => array( |
||
| 114 | 'bbcode_helpline' => 'ABBC3_DIR_HELPLINE', |
||
| 115 | 'bbcode_match' => '[dir={IDENTIFIER}]{TEXT}[/dir]', |
||
| 116 | 'bbcode_tpl' => '<bdo dir="{IDENTIFIER}">{TEXT}</bdo>', |
||
| 117 | ), |
||
| 118 | 'marq=up' => array( |
||
| 119 | 'bbcode_helpline' => 'ABBC3_MARQUEE_HELPLINE', |
||
| 120 | 'bbcode_match' => '[marq={IDENTIFIER}]{TEXT}[/marq]', |
||
| 121 | 'bbcode_tpl' => '<marquee class="abbc3_marquee" direction="{IDENTIFIER}" scrolldelay="100" onmouseover="this.scrollDelay=10000000;" onmouseout="this.scrollDelay=100;">{TEXT}</marquee>', |
||
| 122 | ), |
||
| 123 | 'spoil' => array( |
||
| 124 | 'bbcode_helpline' => 'ABBC3_SPOILER_HELPLINE', |
||
| 125 | 'bbcode_match' => '[spoil]{TEXT}[/spoil]', |
||
| 126 | 'bbcode_tpl' => '<div class="spoilwrapper"><div class="spoiltitle"><span class="spoilbtn" data-show="{L_ABBC3_SPOILER_SHOW}" data-hide="{L_ABBC3_SPOILER_HIDE}">{L_ABBC3_SPOILER_SHOW}</span></div><div style="display: none;" class="spoilcontent">{TEXT}</div></div>', |
||
| 127 | ), |
||
| 128 | 'hidden' => array( |
||
| 129 | 'bbcode_helpline' => 'ABBC3_HIDDEN_HELPLINE', |
||
| 130 | 'bbcode_match' => '[hidden]{TEXT}[/hidden]', |
||
| 131 | 'bbcode_tpl' => '<!-- ABBC3_BBCODE_HIDDEN -->{TEXT}<!-- ABBC3_BBCODE_HIDDEN -->', |
||
| 132 | ), |
||
| 133 | 'offtopic' => array( |
||
| 134 | 'bbcode_helpline' => 'ABBC3_OFFTOPIC_HELPLINE', |
||
| 135 | 'bbcode_match' => '[offtopic]{TEXT}[/offtopic]', |
||
| 136 | 'bbcode_tpl' => '<div class="offtopic"><div class="offtopic_title">{L_ABBC3_OFFTOPIC}</div><div class="offtopic_text">{TEXT}</div></div>', |
||
| 137 | ), |
||
| 138 | 'mod=' => array( |
||
| 139 | 'bbcode_helpline' => 'ABBC3_MOD_HELPLINE', |
||
| 140 | 'bbcode_match' => '[mod={TEXT1}]{TEXT2}[/mod]', |
||
| 141 | 'bbcode_tpl' => '<table class="ModTable"><tr><td class="exclamation" rowspan="2"> ! </td><td class="rowuser">{L_MESSAGE} {L_FROM}{L_COLON} {TEXT1}</td></tr><tr><td class="rowtext">{TEXT2}</td></tr></table>', |
||
| 142 | ), |
||
| 143 | 'nfo' => array( |
||
| 144 | 'bbcode_helpline' => 'ABBC3_NFO_HELPLINE', |
||
| 145 | 'bbcode_match' => '[nfo]{TEXT}[/nfo]', |
||
| 146 | 'bbcode_tpl' => '<pre class="nfo">{TEXT}</pre>', |
||
| 147 | ), |
||
| 148 | 'soundcloud' => array( |
||
| 149 | 'bbcode_helpline' => 'ABBC3_SOUNDCLOUD_HELPLINE', |
||
| 150 | 'bbcode_match' => '[soundcloud]{URL}[/soundcloud]', |
||
| 151 | 'bbcode_tpl' => '<object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url={URL}&g=bb"><param name="allowscriptaccess" value="always"><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url={URL}&g=bb" type="application/x-shockwave-flash" width="100%"></embed></object>', |
||
| 152 | ), |
||
| 153 | 'BBvideo' => array( |
||
| 154 | 'bbcode_helpline' => 'ABBC3_BBVIDEO_HELPLINE', |
||
| 155 | 'bbcode_match' => '[BBvideo={NUMBER1},{NUMBER2}]{URL}[/BBvideo]', |
||
| 156 | 'bbcode_tpl' => '<a href="{URL}" class="bbvideo" data-bbvideo="{NUMBER1},{NUMBER2}" target="_blank">{URL}</a>', |
||
| 157 | ), |
||
| 158 | 'youtube' => array( |
||
| 159 | 'bbcode_helpline' => 'ABBC3_YOUTUBE_HELPLINE', |
||
| 160 | 'bbcode_match' => '[youtube]{URL}[/youtube]', |
||
| 161 | 'bbcode_tpl' => '<a href="{URL}" class="bbvideo" data-bbvideo="560,315">{URL}</a>', |
||
| 162 | 'display_on_posting'=> 0, |
||
| 163 | ), |
||
| 164 | ); |
||
| 165 | } |
||
| 166 | } |
||
| 167 |