@@ -42,7 +42,7 @@ |
||
| 42 | 42 | <br> |
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | - foreach($urls as $url) |
|
| 45 | + foreach ($urls as $url) |
|
| 46 | 46 | { |
| 47 | 47 | $info = parseURL($url); |
| 48 | 48 | |
@@ -41,6 +41,6 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function invert() : EightBitChannel |
| 43 | 43 | { |
| 44 | - return ColorChannel::eightBit(255-$this->value); |
|
| 44 | + return ColorChannel::eightBit(255 - $this->value); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $this->validateValue($value); |
| 38 | 38 | |
| 39 | - if(strlen($value) === 1) |
|
| 39 | + if (strlen($value) === 1) |
|
| 40 | 40 | { |
| 41 | 41 | $value = str_repeat($value, 2); |
| 42 | 42 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $match = preg_match('/\A[0-9A-F]{1,2}\z/iU', $hex); |
| 55 | 55 | |
| 56 | - if($match !== false && $match > 0) |
|
| 56 | + if ($match !== false && $match > 0) |
|
| 57 | 57 | { |
| 58 | 58 | return; |
| 59 | 59 | } |
@@ -56,6 +56,6 @@ |
||
| 56 | 56 | |
| 57 | 57 | public function invert() : SevenBitChannel |
| 58 | 58 | { |
| 59 | - return ColorChannel::sevenBit(127-$this->value); |
|
| 59 | + return ColorChannel::sevenBit(127 - $this->value); |
|
| 60 | 60 | } |
| 61 | 61 | } |
@@ -41,6 +41,6 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function invert() : PercentChannel |
| 43 | 43 | { |
| 44 | - return ColorChannel::percent(100-$this->value); |
|
| 44 | + return ColorChannel::percent(100 - $this->value); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -41,6 +41,6 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function invert() : DecimalChannel |
| 43 | 43 | { |
| 44 | - return ColorChannel::decimal(1-$this->value); |
|
| 44 | + return ColorChannel::decimal(1 - $this->value); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | self::SERIALIZED_PREVIOUS => null, |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - if($info->hasPrevious()) |
|
| 42 | + if ($info->hasPrevious()) |
|
| 43 | 43 | { |
| 44 | 44 | $result[self::SERIALIZED_PREVIOUS] = $info->getPrevious()->serialize(); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $calls = $info->getCalls(); |
| 48 | - foreach($calls as $call) |
|
| 48 | + foreach ($calls as $call) |
|
| 49 | 49 | { |
| 50 | 50 | $result[self::SERIALIZED_CALLS][] = $call->serialize(); |
| 51 | 51 | } |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | $data = self::validateSerializedData($serialized); |
| 64 | 64 | $data[self::SERIALIZED_PREVIOUS] = self::unserializePrevious($data[self::SERIALIZED_PREVIOUS]); |
| 65 | 65 | |
| 66 | - if(!isset($data[self::SERIALIZED_CLASS])) |
|
| 66 | + if (!isset($data[self::SERIALIZED_CLASS])) |
|
| 67 | 67 | { |
| 68 | 68 | $data[self::SERIALIZED_CLASS] = ''; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if(!isset($data[self::SERIALIZED_DETAILS])) |
|
| 71 | + if (!isset($data[self::SERIALIZED_DETAILS])) |
|
| 72 | 72 | { |
| 73 | 73 | $data[self::SERIALIZED_DETAILS] = ''; |
| 74 | 74 | } |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | self::SERIALIZED_CALLS => 'array' |
| 95 | 95 | ); |
| 96 | 96 | |
| 97 | - foreach($keys as $key => $type) |
|
| 97 | + foreach ($keys as $key => $type) |
|
| 98 | 98 | { |
| 99 | - if(!isset($serialized[$key]) || gettype($serialized[$key]) !== $type) |
|
| 99 | + if (!isset($serialized[$key]) || gettype($serialized[$key]) !== $type) |
|
| 100 | 100 | { |
| 101 | 101 | throw self::createTypeException($key, $type); |
| 102 | 102 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | private static function unserializePrevious(?array $previous) : ?ConvertHelper_ThrowableInfo |
| 127 | 127 | { |
| 128 | - if(!empty($previous)) |
|
| 128 | + if (!empty($previous)) |
|
| 129 | 129 | { |
| 130 | 130 | return ConvertHelper_ThrowableInfo::fromSerialized($previous); |
| 131 | 131 | } |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | public const SVN_ERROR_TYPE_WARNING = 'warning'; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * @var SVNHelper |
|
| 25 | - */ |
|
| 24 | + * @var SVNHelper |
|
| 25 | + */ |
|
| 26 | 26 | protected $helper; |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var SVNHelper_Target |
|
| 30 | - */ |
|
| 28 | + /** |
|
| 29 | + * @var SVNHelper_Target |
|
| 30 | + */ |
|
| 31 | 31 | protected $target; |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var SVNHelper_CommandResult|NULL |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var SVNHelper_CommandResult|NULL |
|
| 35 | + */ |
|
| 36 | 36 | protected ?SVNHelper_CommandResult $result; |
| 37 | 37 | |
| 38 | 38 | public function __construct(SVNHelper $helper, SVNHelper_Target $target) |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | $this->target = $target; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @return SVNHelper |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @return SVNHelper |
|
| 46 | + */ |
|
| 47 | 47 | public function getSVN() |
| 48 | 48 | { |
| 49 | 49 | return $this->helper; |
@@ -100,15 +100,15 @@ discard block |
||
| 100 | 100 | return $cmd; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * Executes the specified command, and returns a result |
|
| 105 | - * instance to read the results. |
|
| 106 | - * |
|
| 107 | - * @param string $mode The command mode, e.g. commit / update... |
|
| 108 | - * @param string $path The path to apply the command to |
|
| 109 | - * @param array $params |
|
| 110 | - * @return SVNHelper_CommandResult |
|
| 111 | - */ |
|
| 103 | + /** |
|
| 104 | + * Executes the specified command, and returns a result |
|
| 105 | + * instance to read the results. |
|
| 106 | + * |
|
| 107 | + * @param string $mode The command mode, e.g. commit / update... |
|
| 108 | + * @param string $path The path to apply the command to |
|
| 109 | + * @param array $params |
|
| 110 | + * @return SVNHelper_CommandResult |
|
| 111 | + */ |
|
| 112 | 112 | protected function execCommand($mode, $path=null, $params=array()) |
| 113 | 113 | { |
| 114 | 114 | $relative = $this->helper->relativizePath($path); |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | return $this->result; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - /** |
|
| 199 | - * Retrieves the type of command, e.g. "Commit" |
|
| 200 | - * @return string |
|
| 201 | - */ |
|
| 198 | + /** |
|
| 199 | + * Retrieves the type of command, e.g. "Commit" |
|
| 200 | + * @return string |
|
| 201 | + */ |
|
| 202 | 202 | public function getType() |
| 203 | 203 | { |
| 204 | 204 | return str_replace('SVNHelper_Command_', '', get_class($this)); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function execute() |
| 58 | 58 | { |
| 59 | - if(isset($this->result)) |
|
| 59 | + if (isset($this->result)) |
|
| 60 | 60 | { |
| 61 | 61 | return $this->result; |
| 62 | 62 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | putenv('LC_ALL='.$locale); |
| 68 | 68 | |
| 69 | 69 | $this->result = $this->_execute(); |
| 70 | - if(!$this->result instanceof SVNHelper_CommandResult) { |
|
| 70 | + if (!$this->result instanceof SVNHelper_CommandResult) { |
|
| 71 | 71 | throw new SVNHelper_Exception( |
| 72 | 72 | 'Not a valid SVN command result', |
| 73 | 73 | sprintf( |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | abstract protected function _execute(); |
| 85 | 85 | |
| 86 | - protected function buildCommand($mode, $path=null, $params=array()) |
|
| 86 | + protected function buildCommand($mode, $path = null, $params = array()) |
|
| 87 | 87 | { |
| 88 | 88 | $params[] = 'non-interactive'; |
| 89 | 89 | $params[] = 'username '.$this->helper->getAuthUser(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $cmd = 'svn '.$mode.' '.$path.' '; |
| 93 | 93 | |
| 94 | - foreach($params as $param) { |
|
| 94 | + foreach ($params as $param) { |
|
| 95 | 95 | $cmd .= '--'.$param.' '; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param array $params |
| 110 | 110 | * @return SVNHelper_CommandResult |
| 111 | 111 | */ |
| 112 | - protected function execCommand($mode, $path=null, $params=array()) |
|
| 112 | + protected function execCommand($mode, $path = null, $params = array()) |
|
| 113 | 113 | { |
| 114 | 114 | $relative = $this->helper->relativizePath($path); |
| 115 | 115 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | exec($cmd, $output); |
| 125 | 125 | |
| 126 | 126 | $lines = array(); |
| 127 | - foreach($output as $line) { |
|
| 127 | + foreach ($output as $line) { |
|
| 128 | 128 | $lines[] = mb_strtolower(trim(utf8_encode($line))); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | // |
| 137 | 137 | // Can happen for example when the path is not under version |
| 138 | 138 | // control. |
| 139 | - if(isset($lines[0]) && substr($lines[0], 0, 7) == 'skipped') |
|
| 139 | + if (isset($lines[0]) && substr($lines[0], 0, 7) == 'skipped') |
|
| 140 | 140 | { |
| 141 | 141 | $tokens = explode('--', $lines[0]); |
| 142 | 142 | $message = trim(array_pop($tokens)); |
@@ -157,20 +157,20 @@ discard block |
||
| 157 | 157 | // svn: w123456: warning message |
| 158 | 158 | else |
| 159 | 159 | { |
| 160 | - foreach($lines as $line) |
|
| 160 | + foreach ($lines as $line) |
|
| 161 | 161 | { |
| 162 | - if(strstr($line, 'svn:')) |
|
| 162 | + if (strstr($line, 'svn:')) |
|
| 163 | 163 | { |
| 164 | 164 | $result = array(); |
| 165 | 165 | preg_match_all('/svn:[ ]*(e|warning:[ ]*w)([0-9]+):(.*)/', $line, $result, PREG_PATTERN_ORDER); |
| 166 | 166 | |
| 167 | - if(isset($result[1]) && isset($result[1][0])) |
|
| 167 | + if (isset($result[1]) && isset($result[1][0])) |
|
| 168 | 168 | { |
| 169 | 169 | $message = trim($result[3][0]); |
| 170 | 170 | $code = trim($result[2][0]); |
| 171 | 171 | $type = self::SVN_ERROR_TYPE_ERROR; |
| 172 | 172 | |
| 173 | - if($result[1][0] != 'e') { |
|
| 173 | + if ($result[1][0] != 'e') { |
|
| 174 | 174 | $type = self::SVN_ERROR_TYPE_WARNING; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $result = new SVNHelper_CommandResult($this, $cmd, $lines, $errorMessages); |
| 185 | 185 | |
| 186 | - if($result->isError()) { |
|
| 186 | + if ($result->isError()) { |
|
| 187 | 187 | $this->log(sprintf('[%s] | Command returned errors.', $relative)); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | protected function throwExceptionUnexpected(SVNHelper_CommandResult $result) |
| 208 | 208 | { |
| 209 | - if($result->isConnectionFailed()) { |
|
| 209 | + if ($result->isConnectionFailed()) { |
|
| 210 | 210 | $this->throwException( |
| 211 | 211 | t('Could not connect to the remote SVN repository'), |
| 212 | 212 | '', |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | ); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if($result->hasConflicts()) { |
|
| 218 | + if ($result->hasConflicts()) { |
|
| 219 | 219 | $this->throwException( |
| 220 | 220 | t('SVN command reported conflicts'), |
| 221 | 221 | '', |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | ); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if($result->hasLocks()) { |
|
| 227 | + if ($result->hasLocks()) { |
|
| 228 | 228 | $this->throwException( |
| 229 | 229 | t('The target SVN folder or file is locked.'), |
| 230 | 230 | '', |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | ); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - protected function throwException($message, $details, $code, SVNHelper_CommandResult $result, $previous=null) |
|
| 244 | + protected function throwException($message, $details, $code, SVNHelper_CommandResult $result, $previous = null) |
|
| 245 | 245 | { |
| 246 | 246 | $body = |
| 247 | 247 | '<p>'. |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | '</p>'. |
| 257 | 257 | '<ul>'; |
| 258 | 258 | $errors = $result->getErrorMessages(); |
| 259 | - foreach($errors as $error) { |
|
| 259 | + foreach ($errors as $error) { |
|
| 260 | 260 | $body .= |
| 261 | 261 | '<li>'. |
| 262 | 262 | $error. |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | public function hasAnyErrorCode(array $codes) : bool |
| 120 | 120 | { |
| 121 | 121 | $items = array(); |
| 122 | - foreach($codes as $code) { |
|
| 122 | + foreach ($codes as $code) { |
|
| 123 | 123 | $items[] = $this->filterCode($code); |
| 124 | 124 | } |
| 125 | 125 | |