Completed
Branch master (8fc554)
by Alexander
06:05
created
src/SVNBuddy/Repository/Parser/LogMessageParser.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$mantis_regexp = '(?:[Bb]ugs?|[Ii]ssues?|[Rr]eports?|[Ff]ixe?s?|[Rr]esolves?)+\s+(?:#?(?:\d+)[,\.\s]*)+';
53 53
 		$mantis_regexp .= "\n" . '(\d+)' . "\n";
54 54
 
55
-		if ( $bugtraq_logregex === $mantis_regexp ) {
55
+		if ($bugtraq_logregex === $mantis_regexp) {
56 56
 			return '([A-Z]+\-\d+)';
57 57
 		}
58 58
 
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 	{
71 71
 		$bugtraq_logregex = array_filter(explode(PHP_EOL, $bugtraq_logregex));
72 72
 
73
-		if ( count($bugtraq_logregex) == 2 ) {
73
+		if (count($bugtraq_logregex) == 2) {
74 74
 			$this->_preFilterRegExp = '/' . $bugtraq_logregex[0] . '/s';
75 75
 			$this->_filterRegExp = '/' . $bugtraq_logregex[1] . '/s';
76 76
 		}
77
-		elseif ( count($bugtraq_logregex) == 1 ) {
77
+		elseif (count($bugtraq_logregex) == 1) {
78 78
 			$this->_preFilterRegExp = '';
79 79
 			$this->_filterRegExp = '/' . $bugtraq_logregex[0] . '/s';
80 80
 		}
@@ -93,19 +93,19 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function parse($log_message)
95 95
 	{
96
-		if ( !$this->_filterRegExp ) {
96
+		if (!$this->_filterRegExp) {
97 97
 			return array();
98 98
 		}
99 99
 
100
-		if ( $this->_preFilterRegExp ) {
101
-			if ( !preg_match_all($this->_preFilterRegExp, $log_message, $pre_filter_regs) ) {
100
+		if ($this->_preFilterRegExp) {
101
+			if (!preg_match_all($this->_preFilterRegExp, $log_message, $pre_filter_regs)) {
102 102
 				return array();
103 103
 			}
104 104
 
105 105
 			$ret = array();
106 106
 
107
-			foreach ( $pre_filter_regs[0] as $match ) {
108
-				if ( preg_match_all($this->_filterRegExp, $match, $filter_regs) ) {
107
+			foreach ($pre_filter_regs[0] as $match) {
108
+				if (preg_match_all($this->_filterRegExp, $match, $filter_regs)) {
109 109
 					$ret = array_merge($ret, $filter_regs[1]);
110 110
 				}
111 111
 			}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			return array_unique($ret);
114 114
 		}
115 115
 
116
-		if ( preg_match_all($this->_filterRegExp, $log_message, $filter_regs) ) {
116
+		if (preg_match_all($this->_filterRegExp, $log_message, $filter_regs)) {
117 117
 			return array_unique($filter_regs[1]);
118 118
 		}
119 119
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,12 +73,10 @@
 block discarded – undo
73 73
 		if ( count($bugtraq_logregex) == 2 ) {
74 74
 			$this->_preFilterRegExp = '/' . $bugtraq_logregex[0] . '/s';
75 75
 			$this->_filterRegExp = '/' . $bugtraq_logregex[1] . '/s';
76
-		}
77
-		elseif ( count($bugtraq_logregex) == 1 ) {
76
+		} elseif ( count($bugtraq_logregex) == 1 ) {
78 77
 			$this->_preFilterRegExp = '';
79 78
 			$this->_filterRegExp = '/' . $bugtraq_logregex[0] . '/s';
80
-		}
81
-		else {
79
+		} else {
82 80
 			$this->_preFilterRegExp = '';
83 81
 			$this->_filterRegExp = '';
84 82
 		}
Please login to merge, or discard this patch.
src/SVNBuddy/Repository/Parser/RevisionListParser.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,22 +30,22 @@
 block discarded – undo
30 30
 		$ret = array();
31 31
 		$range_regexp = '/^([\d]+)' . preg_quote($range_separator, '/') . '([\d]+)\*?$/';
32 32
 
33
-		foreach ( $revisions as $raw_revision ) {
34
-			if ( preg_match($range_regexp, $raw_revision, $regs) ) {
33
+		foreach ($revisions as $raw_revision) {
34
+			if (preg_match($range_regexp, $raw_revision, $regs)) {
35 35
 				$range_start = (int)$regs[1];
36 36
 				$range_end = (int)$regs[2];
37 37
 
38
-				if ( $range_start > $range_end ) {
38
+				if ($range_start > $range_end) {
39 39
 					throw new \InvalidArgumentException(
40 40
 						'Inverted revision range "' . $raw_revision . '" is not implemented.'
41 41
 					);
42 42
 				}
43 43
 
44
-				for ( $i = $range_start; $i <= $range_end; $i++ ) {
44
+				for ($i = $range_start; $i <= $range_end; $i++) {
45 45
 					$ret[$i] = true;
46 46
 				}
47 47
 			}
48
-			elseif ( preg_match('/^([\d]+)\*?$/', $raw_revision, $regs) ) {
48
+			elseif (preg_match('/^([\d]+)\*?$/', $raw_revision, $regs)) {
49 49
 				$ret[(int)$regs[1]] = true;
50 50
 			}
51 51
 			else {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,11 +44,9 @@
 block discarded – undo
44 44
 				for ( $i = $range_start; $i <= $range_end; $i++ ) {
45 45
 					$ret[$i] = true;
46 46
 				}
47
-			}
48
-			elseif ( preg_match('/^([\d]+)\*?$/', $raw_revision, $regs) ) {
47
+			} elseif ( preg_match('/^([\d]+)\*?$/', $raw_revision, $regs) ) {
49 48
 				$ret[(int)$regs[1]] = true;
50
-			}
51
-			else {
49
+			} else {
52 50
 				throw new \InvalidArgumentException('The "' . $raw_revision . '" revision is invalid.');
53 51
 			}
54 52
 		}
Please login to merge, or discard this patch.