From 7ef8e99fe605c5da36ab6b5d317b22fcd17f665b Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Thu, 22 Aug 2013 01:01:41 -0700 Subject: Fix CodeSniffer violations Change indentation to ensure code confirms to CodeSniffer rules. --- lib/plugins/syntax.php | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'lib/plugins/syntax.php') diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php index b7839b2b2..6aa403b61 100644 --- a/lib/plugins/syntax.php +++ b/lib/plugins/syntax.php @@ -137,7 +137,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { $idx = array_search(substr(get_class($this), 7), (array) $this->allowedModes); if ($idx !== false) { - unset($this->allowedModes[$idx]); + unset($this->allowedModes[$idx]); } $this->allowedModesSetup = true; } @@ -169,9 +169,9 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * @return string string in appropriate language or english if not available */ function getLang($id) { - if (!$this->localised) $this->setupLocale(); + if (!$this->localised) $this->setupLocale(); - return (isset($this->lang[$id]) ? $this->lang[$id] : ''); + return (isset($this->lang[$id]) ? $this->lang[$id] : ''); } /** @@ -184,7 +184,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * @return string parsed contents of the wiki page in xhtml format */ function locale_xhtml($id) { - return p_cached_output($this->localFN($id)); + return p_cached_output($this->localFN($id)); } /** @@ -193,17 +193,17 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { * plugin equivalent of localFN() */ function localFN($id) { - global $conf; - $plugin = $this->getPluginName(); - $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt'; - if (!@file_exists($file)){ - $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt'; - if(!@file_exists($file)){ - //fall back to english - $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt'; + global $conf; + $plugin = $this->getPluginName(); + $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt'; + if (!@file_exists($file)){ + $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt'; + if(!@file_exists($file)){ + //fall back to english + $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt'; + } } - } - return $file; + return $file; } /** @@ -214,16 +214,16 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { function setupLocale() { if ($this->localised) return; - global $conf; // definitely don't invoke "global $lang" - $path = DOKU_PLUGIN.$this->getPluginName().'/lang/'; - - $lang = array(); - // don't include once, in case several plugin components require the same language file - @include($path.'en/lang.php'); - if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); - - $this->lang = $lang; - $this->localised = true; + global $conf; // definitely don't invoke "global $lang" + $path = DOKU_PLUGIN.$this->getPluginName().'/lang/'; + + $lang = array(); + // don't include once, in case several plugin components require the same language file + @include($path.'en/lang.php'); + if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); + + $this->lang = $lang; + $this->localised = true; } // configuration methods -- cgit v1.2.3 From 2f7a0e94cadfbc1ece3bd1d3ff23483b845cd420 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Tue, 10 Sep 2013 22:17:43 -0700 Subject: Fix CodeSniffer whitespace violoations Removed extraneous whitespace to eliminate errors reported by the Squiz.WhiteSpace.SuperfluousWhitespace sniff. --- lib/plugins/syntax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/plugins/syntax.php') diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php index 6aa403b61..8df5abb08 100644 --- a/lib/plugins/syntax.php +++ b/lib/plugins/syntax.php @@ -216,12 +216,12 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { global $conf; // definitely don't invoke "global $lang" $path = DOKU_PLUGIN.$this->getPluginName().'/lang/'; - + $lang = array(); // don't include once, in case several plugin components require the same language file @include($path.'en/lang.php'); if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); - + $this->lang = $lang; $this->localised = true; } -- cgit v1.2.3