@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function get() { |
42 | 42 | |
43 | - if ( ! $this->_isScreenIconVisible() ) { |
|
43 | + if ( !$this->_isScreenIconVisible() ) { |
|
44 | 44 | return ''; |
45 | 45 | } |
46 | 46 | return $this->_getScreenIcon( $this->sPageSlug ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | private function _isScreenIconVisible() { |
54 | 54 | |
55 | - $_bShowPageTitle = $this->getElement( |
|
55 | + $_bShowPageTitle = $this->getElement( |
|
56 | 56 | $this->oFactory->oProp->aPages, |
57 | 57 | array( $this->sPageSlug, 'show_page_title' ) |
58 | 58 | ); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | array( $sPageSlug, 'href_icon_32x32' ), |
131 | 131 | '' |
132 | 132 | ); |
133 | - if ( ! $_sScreenIconPath ) { |
|
133 | + if ( !$_sScreenIconPath ) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | $_sScreenIconPath = $this->getResolvedSRC( |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $_aAttributes = array( |
141 | 141 | 'style' => $this->getInlineCSS( |
142 | 142 | array( |
143 | - 'background-image' => "url('" . esc_url( $_sScreenIconPath ) . "')" |
|
143 | + 'background-image' => "url('".esc_url( $_sScreenIconPath )."')" |
|
144 | 144 | ) |
145 | 145 | ) |
146 | 146 | ); |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | array( $sPageSlug, 'screen_icon_id' ), |
165 | 165 | '' |
166 | 166 | ); |
167 | - if ( ! $_sScreenIconID ) { |
|
167 | + if ( !$_sScreenIconID ) { |
|
168 | 168 | return; |
169 | 169 | } |
170 | 170 | |
171 | 171 | $_aAttributes = array( |
172 | - 'id' => "icon-" . $_sScreenIconID, |
|
172 | + 'id' => "icon-".$_sScreenIconID, |
|
173 | 173 | ); |
174 | 174 | |
175 | 175 | // Go to the catch clause. |
@@ -192,16 +192,16 @@ discard block |
||
192 | 192 | 'class' => $this->getClassAttribute( |
193 | 193 | $this->getAOrB( |
194 | 194 | empty( $_sIconIDAttribute ) && $_oScreen->post_type, |
195 | - sanitize_html_class( 'icon32-posts-' . $_oScreen->post_type ), |
|
195 | + sanitize_html_class( 'icon32-posts-'.$_oScreen->post_type ), |
|
196 | 196 | '' |
197 | 197 | ), |
198 | 198 | $this->getAOrB( |
199 | 199 | empty( $_sIconIDAttribute ) || $_sIconIDAttribute == $this->oFactory->oProp->sClassName, |
200 | - 'generic', // the default value |
|
200 | + 'generic', // the default value |
|
201 | 201 | '' |
202 | 202 | ) |
203 | 203 | ), |
204 | - 'id' => "icon-" . $_sIconIDAttribute, |
|
204 | + 'id' => "icon-".$_sIconIDAttribute, |
|
205 | 205 | ); |
206 | 206 | return $this->_getScreenIconByAttributes( $_aAttributes ); |
207 | 207 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | private function _getScreenIDAttribute( $oScreen ) { |
217 | 217 | |
218 | - if ( ! empty( $oScreen->parent_base ) ) { |
|
218 | + if ( !empty( $oScreen->parent_base ) ) { |
|
219 | 219 | return $oScreen->parent_base; |
220 | 220 | } |
221 | 221 | if ( 'page' === $oScreen->post_type ) { |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | private function _getScreenIconByAttributes( array $aAttributes ) { |
237 | 237 | |
238 | 238 | $aAttributes[ 'class' ] = $this->getClassAttribute( |
239 | - 'icon32', // required for a screen icon container element. |
|
239 | + 'icon32', // required for a screen icon container element. |
|
240 | 240 | $this->getElement( $aAttributes, 'class' ) |
241 | 241 | ); |
242 | - return "<div " . $this->getAttributes( $aAttributes ) . ">" |
|
242 | + return "<div ".$this->getAttributes( $aAttributes ).">" |
|
243 | 243 | . "<br />" |
244 | 244 | . "</div>"; |
245 | 245 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function construct() { |
30 | 30 | |
31 | 31 | add_filter( |
32 | - 'options_' . $this->aArguments[ 'caller_id' ], |
|
32 | + 'options_'.$this->aArguments[ 'caller_id' ], |
|
33 | 33 | array( $this, '_replyToSanitizeSavedFormData' ), |
34 | 34 | 5 // high priority as it must be done earlier |
35 | 35 | ); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | // Extract the meta box field form data (options) from the page form data (options). |
55 | 55 | return $this->castArrayContents( |
56 | - $this->getDataStructureFromAddedFieldsets(), // form data structure generate from fieldsets |
|
56 | + $this->getDataStructureFromAddedFieldsets(), // form data structure generate from fieldsets |
|
57 | 57 | $aSavedFormData |
58 | 58 | ); |
59 | 59 |
@@ -23,12 +23,12 @@ |
||
23 | 23 | * @since 3.0.0 |
24 | 24 | * @deprecated 3.7.0 Use `AdminPageFramework_PageMetaBox` instead. |
25 | 25 | */ |
26 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
26 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
27 | 27 | |
28 | 28 | parent::__construct( $sMetaBoxID, $sTitle, $asPageSlugs, $sContext, $sPriority, $sCapability, $sTextDomain ); |
29 | 29 | |
30 | 30 | $this->oUtil->showDeprecationNotice( |
31 | - 'The class, ' . __CLASS__ . ',', // deprecated item |
|
31 | + 'The class, '.__CLASS__.',', // deprecated item |
|
32 | 32 | 'AdminPageFramework_PageMetaBox' // alternative |
33 | 33 | ); |
34 | 34 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | return "{$_aField['field_id']}{$_sKey}"; |
69 | 69 | } |
70 | 70 | |
71 | - /** |
|
71 | + /** |
|
72 | 72 | * Adds input fields |
73 | 73 | * |
74 | 74 | * @internal |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | '', |
48 | 48 | "[{$_sKey}]" |
49 | 49 | ); |
50 | - return $_aField['field_id'] . $_sKey; |
|
50 | + return $_aField[ 'field_id' ].$_sKey; |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | '', |
66 | 66 | "|{$_sKey}" |
67 | 67 | ); |
68 | - return "{$_aField['field_id']}{$_sKey}"; |
|
68 | + return "{$_aField[ 'field_id' ]}{$_sKey}"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $_aOutput = array(); |
116 | 116 | |
117 | 117 | // Set nonce. |
118 | - $_aOutput[] = wp_nonce_field( |
|
118 | + $_aOutput[ ] = wp_nonce_field( |
|
119 | 119 | $this->oProp->sClassHash, |
120 | 120 | $this->oProp->sClassHash, |
121 | 121 | true, |
@@ -126,17 +126,17 @@ discard block |
||
126 | 126 | $this->_setOptionArray( $iTermID, $this->oProp->sOptionKey ); |
127 | 127 | |
128 | 128 | // Get the field outputs |
129 | - $_aOutput[] = $this->oForm->get( $bRenderTableRow ); |
|
129 | + $_aOutput[ ] = $this->oForm->get( $bRenderTableRow ); |
|
130 | 130 | |
131 | 131 | // Filter the output |
132 | 132 | $_sOutput = $this->oUtil->addAndApplyFilters( |
133 | 133 | $this, |
134 | - 'content_' . $this->oProp->sClassName, |
|
134 | + 'content_'.$this->oProp->sClassName, |
|
135 | 135 | $this->content( implode( PHP_EOL, $_aOutput ) ) |
136 | 136 | ); |
137 | 137 | |
138 | 138 | // Do action |
139 | - $this->oUtil->addAndDoActions( $this, 'do_' . $this->oProp->sClassName, $this ); |
|
139 | + $this->oUtil->addAndDoActions( $this, 'do_'.$this->oProp->sClassName, $this ); |
|
140 | 140 | |
141 | 141 | return $_sOutput; |
142 | 142 |
@@ -19,22 +19,22 @@ |
||
19 | 19 | abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View { |
20 | 20 | |
21 | 21 | /** |
22 | - * The method for necessary set-ups. |
|
23 | - * |
|
24 | - * <h4>Example</h4> |
|
25 | - * <code> |
|
26 | - * public function setUp() { |
|
27 | - * $this->setArguments( |
|
28 | - * array( |
|
29 | - * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
30 | - * ) |
|
31 | - * ); |
|
32 | - * } |
|
33 | - * </code> |
|
34 | - * |
|
35 | - * @abstract |
|
36 | - * @since 3.2.0 |
|
37 | - */ |
|
22 | + * The method for necessary set-ups. |
|
23 | + * |
|
24 | + * <h4>Example</h4> |
|
25 | + * <code> |
|
26 | + * public function setUp() { |
|
27 | + * $this->setArguments( |
|
28 | + * array( |
|
29 | + * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
30 | + * ) |
|
31 | + * ); |
|
32 | + * } |
|
33 | + * </code> |
|
34 | + * |
|
35 | + * @abstract |
|
36 | + * @since 3.2.0 |
|
37 | + */ |
|
38 | 38 | public function setUp() {} |
39 | 39 | |
40 | 40 | /** |
@@ -131,7 +131,7 @@ |
||
131 | 131 | * @see https://codex.wordpress.org/Function_Reference/wp_register_sidebar_widget |
132 | 132 | * @return void |
133 | 133 | */ |
134 | - protected function setArguments( array $aArguments=array() ) { |
|
134 | + protected function setArguments( array $aArguments = array() ) { |
|
135 | 135 | $this->oProp->aWidgetArguments = $aArguments; |
136 | 136 | } |
137 | 137 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | if ( $this->oProp->bIsAdmin ) { |
38 | 38 | add_filter( |
39 | - 'validation_' . $this->oProp->sClassName, |
|
39 | + 'validation_'.$this->oProp->sClassName, |
|
40 | 40 | array( $this, '_replyToSortInputs' ), |
41 | - 1, // set a high priority |
|
41 | + 1, // set a high priority |
|
42 | 42 | 3 // number of parameters |
43 | 43 | ); |
44 | 44 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function _replyToRegisterWidget() { |
110 | 110 | |
111 | - if ( ! is_object( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
111 | + if ( !is_object( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param integer $iDepth The header number to parse. |
38 | 38 | * @param string $sTitle The heading title which appears at the beginning of the output. |
39 | 39 | */ |
40 | - public function __construct( $sHTML, $iDepth=4, $sTitle='' ) { |
|
40 | + public function __construct( $sHTML, $iDepth = 4, $sTitle = '' ) { |
|
41 | 41 | |
42 | 42 | $this->sTitle = $sTitle; |
43 | 43 | $this->sHTML = $sHTML; |
@@ -75,26 +75,26 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function getTOC() { |
77 | 77 | |
78 | - $iDepth = $this->iDepth; |
|
78 | + $iDepth = $this->iDepth; |
|
79 | 79 | |
80 | 80 | // get the headings down to the specified depth |
81 | 81 | $this->sHTML = preg_replace_callback( |
82 | - '/<h[2-' . $iDepth . ']*[^>]*>.*?<\/h[2-' . $iDepth . ']>/i', |
|
82 | + '/<h[2-'.$iDepth.']*[^>]*>.*?<\/h[2-'.$iDepth.']>/i', |
|
83 | 83 | array( $this, '_replyToInsertNamedElement' ), |
84 | 84 | $this->sHTML |
85 | 85 | ); |
86 | 86 | |
87 | 87 | $_aOutput = array(); |
88 | - foreach( $this->_aMatches as $_iIndex => $_sMatch ) { |
|
88 | + foreach ( $this->_aMatches as $_iIndex => $_sMatch ) { |
|
89 | 89 | $_sMatch = strip_tags( $_sMatch, '<h1><h2><h3><h4><h5><h6><h7><h8>' ); |
90 | - $_sMatch = preg_replace( '/<h([1-' . $iDepth . '])>/', '<li class="toc$1"><a href="#toc_' . $_iIndex . '">', $_sMatch ); |
|
91 | - $_sMatch = preg_replace( '/<\/h[1-' . $iDepth . ']>/', '</a></li>', $_sMatch ); |
|
92 | - $_aOutput[] = $_sMatch; |
|
90 | + $_sMatch = preg_replace( '/<h([1-'.$iDepth.'])>/', '<li class="toc$1"><a href="#toc_'.$_iIndex.'">', $_sMatch ); |
|
91 | + $_sMatch = preg_replace( '/<\/h[1-'.$iDepth.']>/', '</a></li>', $_sMatch ); |
|
92 | + $_aOutput[ ] = $_sMatch; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | // plug the results into appropriate HTML tags |
96 | 96 | $this->sTitle = $this->sTitle |
97 | - ? '<p class="toc-title">' . $this->sTitle . '</p>' |
|
97 | + ? '<p class="toc-title">'.$this->sTitle.'</p>' |
|
98 | 98 | : ''; |
99 | 99 | return '<div class="toc">' |
100 | 100 | . $this->sTitle |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | public function _replyToInsertNamedElement( $aMatches ) { |
112 | 112 | static $_icount = -1; |
113 | 113 | $_icount++; |
114 | - $this->_aMatches[] = $aMatches[ 0 ]; |
|
115 | - return "<span class='toc_header_link' id='toc_{$_icount}'></span>" . PHP_EOL |
|
114 | + $this->_aMatches[ ] = $aMatches[ 0 ]; |
|
115 | + return "<span class='toc_header_link' id='toc_{$_icount}'></span>".PHP_EOL |
|
116 | 116 | . $aMatches[ 0 ]; |
117 | 117 | } |
118 | 118 | /**#@-*/ |
@@ -349,7 +349,7 @@ |
||
349 | 349 | ? "<strong>" . $this->_sScriptName . "</strong>: " |
350 | 350 | : ''; |
351 | 351 | return $_sScripTitle |
352 | - . implode( '<br />', $_aWarnings ); |
|
352 | + . implode( '<br />', $_aWarnings ); |
|
353 | 353 | |
354 | 354 | } |
355 | 355 |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | * </ul> |
136 | 136 | * @param string $sScriptName The script name. |
137 | 137 | */ |
138 | - public function __construct( array $aRequirements=array(), $sScriptName='' ) { |
|
138 | + public function __construct( array $aRequirements = array(), $sScriptName = '' ) { |
|
139 | 139 | |
140 | 140 | // Avoid undefined index warnings. |
141 | 141 | $aRequirements = $aRequirements + $this->_aDefaultRequirements; |
142 | 142 | $aRequirements = array_filter( $aRequirements, 'is_array' ); |
143 | - foreach( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) { |
|
143 | + foreach ( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) { |
|
144 | 144 | if ( isset( $aRequirements[ $_sName ] ) ) { |
145 | 145 | $aRequirements[ $_sName ] = $aRequirements[ $_sName ] + $this->_aDefaultRequirements[ $_sName ]; |
146 | 146 | } |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | $_aWarnings = array(); |
166 | 166 | |
167 | 167 | // PHP, WordPress, MySQL |
168 | - $_aWarnings[] = $this->_getWarningByType( 'php' ); |
|
169 | - $_aWarnings[] = $this->_getWarningByType( 'wordpress' ); |
|
170 | - $_aWarnings[] = $this->_getWarningByType( 'mysql' ); |
|
168 | + $_aWarnings[ ] = $this->_getWarningByType( 'php' ); |
|
169 | + $_aWarnings[ ] = $this->_getWarningByType( 'wordpress' ); |
|
170 | + $_aWarnings[ ] = $this->_getWarningByType( 'mysql' ); |
|
171 | 171 | |
172 | 172 | // Ensure necessary array elements. |
173 | 173 | $this->_aRequirements = $this->_aRequirements + array( |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | // Check the rest. |
181 | 181 | $_aWarnings = array_merge( |
182 | 182 | $_aWarnings, |
183 | - $this->_checkFunctions( $this->_aRequirements['functions'] ), |
|
184 | - $this->_checkClasses( $this->_aRequirements['classes'] ), |
|
185 | - $this->_checkConstants( $this->_aRequirements['constants'] ), |
|
186 | - $this->_checkFiles( $this->_aRequirements['files'] ) |
|
183 | + $this->_checkFunctions( $this->_aRequirements[ 'functions' ] ), |
|
184 | + $this->_checkClasses( $this->_aRequirements[ 'classes' ] ), |
|
185 | + $this->_checkConstants( $this->_aRequirements[ 'constants' ] ), |
|
186 | + $this->_checkFiles( $this->_aRequirements[ 'files' ] ) |
|
187 | 187 | ); |
188 | 188 | |
189 | 189 | $this->aWarnings = array_filter( $_aWarnings ); // drop empty elements. |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @return string The warning. |
198 | 198 | */ |
199 | 199 | private function _getWarningByType( $sType ) { |
200 | - if ( ! isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
|
200 | + if ( !isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
|
201 | 201 | return ''; |
202 | 202 | } |
203 | 203 | if ( $this->_checkPHPVersion( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @internal |
227 | 227 | */ |
228 | 228 | private function _checkWordPressVersion( $sWordPressVersion ) { |
229 | - return version_compare( $GLOBALS['wp_version'], $sWordPressVersion, ">=" ); |
|
229 | + return version_compare( $GLOBALS[ 'wp_version' ], $sWordPressVersion, ">=" ); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -298,9 +298,9 @@ discard block |
||
298 | 298 | */ |
299 | 299 | private function _getWarningsByFunctionName( $sFuncName, $aSubjects ) { |
300 | 300 | $_aWarnings = array(); |
301 | - foreach( $aSubjects as $_sSubject => $_sWarning ) { |
|
302 | - if ( ! call_user_func_array( $sFuncName, array( $_sSubject ) ) ) { |
|
303 | - $_aWarnings[] = sprintf( $_sWarning, $_sSubject ); |
|
301 | + foreach ( $aSubjects as $_sSubject => $_sWarning ) { |
|
302 | + if ( !call_user_func_array( $sFuncName, array( $_sSubject ) ) ) { |
|
303 | + $_aWarnings[ ] = sprintf( $_sWarning, $_sSubject ); |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | return $_aWarnings; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public function _replyToPrintAdminNotices() { |
324 | 324 | |
325 | - $_aWarnings = array_unique( $this->aWarnings ); |
|
325 | + $_aWarnings = array_unique( $this->aWarnings ); |
|
326 | 326 | if ( empty( $_aWarnings ) ) { |
327 | 327 | return; |
328 | 328 | } |
@@ -341,12 +341,12 @@ discard block |
||
341 | 341 | */ |
342 | 342 | private function _getWarnings() { |
343 | 343 | |
344 | - $_aWarnings = array_unique( $this->aWarnings ); |
|
344 | + $_aWarnings = array_unique( $this->aWarnings ); |
|
345 | 345 | if ( empty( $_aWarnings ) ) { |
346 | 346 | return ''; |
347 | 347 | } |
348 | - $_sScripTitle = $this->_sScriptName |
|
349 | - ? "<strong>" . $this->_sScriptName . "</strong>: " |
|
348 | + $_sScripTitle = $this->_sScriptName |
|
349 | + ? "<strong>".$this->_sScriptName."</strong>: " |
|
350 | 350 | : ''; |
351 | 351 | return $_sScripTitle |
352 | 352 | . implode( '<br />', $_aWarnings ); |
@@ -361,12 +361,12 @@ discard block |
||
361 | 361 | * @param boolean $bIsOnActivation Whether it is called upon plugin activation hook. |
362 | 362 | * @return void |
363 | 363 | */ |
364 | - public function deactivatePlugin( $sPluginFilePath, $sMessage='', $bIsOnActivation=false ) { |
|
364 | + public function deactivatePlugin( $sPluginFilePath, $sMessage = '', $bIsOnActivation = false ) { |
|
365 | 365 | |
366 | 366 | add_action( 'admin_notices', array( $this, '_replyToPrintAdminNotices' ) ); |
367 | - $this->aWarnings[] = '<strong>' . $sMessage . '</strong>'; |
|
368 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
369 | - if ( ! @include( ABSPATH . 'wp-admin/includes/plugin.php' ) ) { |
|
367 | + $this->aWarnings[ ] = '<strong>'.$sMessage.'</strong>'; |
|
368 | + if ( !function_exists( 'deactivate_plugins' ) ) { |
|
369 | + if ( !@include( ABSPATH.'wp-admin/includes/plugin.php' ) ) { |
|
370 | 370 | return; |
371 | 371 | } |
372 | 372 | } |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | // Before that, we can display messages to the user. |
377 | 377 | if ( $bIsOnActivation ) { |
378 | 378 | |
379 | - $_sPluginListingPage = add_query_arg( array(), $GLOBALS['pagenow'] ); |
|
380 | - wp_die( $this->_getWarnings() . "<p><a href='$_sPluginListingPage'>Go back</a>.</p>" ); |
|
379 | + $_sPluginListingPage = add_query_arg( array(), $GLOBALS[ 'pagenow' ] ); |
|
380 | + wp_die( $this->_getWarnings()."<p><a href='$_sPluginListingPage'>Go back</a>.</p>" ); |
|
381 | 381 | |
382 | 382 | } |
383 | 383 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @since 3.5.0 |
97 | 97 | * @since 3.6.0 Made it accept string content to be passed to the first parameter. |
98 | 98 | */ |
99 | - public function __construct( $sFilePathOrContent='', array $aReplacements=array(), array $aCallbacks=array() ) { |
|
99 | + public function __construct( $sFilePathOrContent = '', array $aReplacements = array(), array $aCallbacks = array() ) { |
|
100 | 100 | |
101 | 101 | $this->sText = file_exists( $sFilePathOrContent ) |
102 | 102 | ? file_get_contents( $sFilePathOrContent ) |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | '/^[\s]*==[\s]*(.+?)[\s]*==/m', |
133 | 133 | $sText, |
134 | 134 | -1, |
135 | - PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY |
|
135 | + PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY |
|
136 | 136 | ); |
137 | 137 | return $_aSections; |
138 | 138 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @since 3.5.0 |
144 | 144 | * @return string |
145 | 145 | */ |
146 | - public function get( $sSectionName='' ) { |
|
146 | + public function get( $sSectionName = '' ) { |
|
147 | 147 | return $sSectionName |
148 | 148 | ? $this->getSection( $sSectionName ) |
149 | 149 | : $this->_getParsedText( $this->sText ); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function _replyToReplaceCodeBlocks( $aMatches ) { |
207 | 207 | |
208 | - if ( ! isset( $aMatches[ 1 ] ) ) { |
|
208 | + if ( !isset( $aMatches[ 1 ] ) ) { |
|
209 | 209 | return $aMatches[ 0 ]; |
210 | 210 | } |
211 | 211 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function getRawSection( $sSectionName ) { |
230 | 230 | |
231 | - $_iIndex = array_search( $sSectionName, $this->_aSections ); |
|
231 | + $_iIndex = array_search( $sSectionName, $this->_aSections ); |
|
232 | 232 | return false === $_iIndex |
233 | 233 | ? '' |
234 | 234 | : trim( $this->_aSections[ $_iIndex + 1 ] ); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | // If <?php notation is missing, highlight_string() will not highlight the syntax so add it. |
249 | 249 | $_bHasPHPTag = "<?php" === substr( $sCode, 0, 5 ); |
250 | 250 | |
251 | - $sCode = $_bHasPHPTag ? $sCode : "<?php " . $sCode; |
|
251 | + $sCode = $_bHasPHPTag ? $sCode : "<?php ".$sCode; |
|
252 | 252 | |
253 | 253 | $sCode = str_replace( '"', "'", $sCode ); // highlight_string() crashes if double quotes are contained in the code. |
254 | 254 | $sCode = highlight_string( $sCode, true ); |