diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-15 18:31:46 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-15 18:31:46 +0200 |
commit | 90771c1762b1302eff9df4f9335db3f382991fea (patch) | |
tree | c4b854386ea4ec5e6c9992ed6b83351570d75a2b /phpBB/phpbb | |
parent | 759950c1a62923422af16f0d90414f5a5047d455 (diff) | |
parent | a9ed32663ac0eeb4254a54f4fbc7db6971007d03 (diff) | |
download | forums-90771c1762b1302eff9df4f9335db3f382991fea.tar forums-90771c1762b1302eff9df4f9335db3f382991fea.tar.gz forums-90771c1762b1302eff9df4f9335db3f382991fea.tar.bz2 forums-90771c1762b1302eff9df4f9335db3f382991fea.tar.xz forums-90771c1762b1302eff9df4f9335db3f382991fea.zip |
Merge pull request #3024 from marc1706/ticket/13124
[ticket/13124] Also trim spaces in front of comments except for first line
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/event/php_exporter.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index badbbb48fd..35144eeeec 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -253,7 +253,7 @@ class php_exporter public function get_event_name($event_line, $is_dispatch) { $event_text_line = $this->file_lines[$event_line]; - $event_text_line = ltrim($event_text_line, "\t"); + $event_text_line = ltrim($event_text_line, "\t "); if ($is_dispatch) { @@ -389,7 +389,7 @@ class php_exporter $found_comment_end = false; while (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") !== '/**') { - if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") === '*/') + if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t ") === '*/') { $found_comment_end = true; } @@ -471,7 +471,7 @@ class php_exporter { $find_tag_line = 0; $found_comment_end = false; - while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $find_tag . ' ') !== 0) + while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $find_tag . ' ') !== 0) { if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**') { @@ -482,7 +482,7 @@ class php_exporter foreach ($disallowed_tags as $disallowed_tag) { - if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $disallowed_tag) === 0) + if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $disallowed_tag) === 0) { // Found @var after the @since throw new \LogicException("Found '@{$disallowed_tag}' information after '@{$find_tag}' for event " @@ -490,7 +490,7 @@ class php_exporter } } - if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '*/') + if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t ") === '*/') { $found_comment_end = true; } @@ -550,7 +550,7 @@ class php_exporter public function validate_since($line) { $match = array(); - preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t"), $match); + preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t "), $match); if (!isset($match[1])) { throw new \LogicException("Invalid '@since' information for event " @@ -570,7 +570,7 @@ class php_exporter */ public function validate_event($event_name, $line) { - $event = substr(ltrim($line, "\t"), strlen('* @event ')); + $event = substr(ltrim($line, "\t "), strlen('* @event ')); if ($event !== trim($event)) { |