@@ -76,10 +76,10 @@ discard block |
||
| 76 | 76 | return $this instanceof SVNHelper_Target_Folder; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * Runs an update of the file or folder. |
|
| 81 | - * @return SVNHelper_Command_Update |
|
| 82 | - */ |
|
| 79 | + /** |
|
| 80 | + * Runs an update of the file or folder. |
|
| 81 | + * @return SVNHelper_Command_Update |
|
| 82 | + */ |
|
| 83 | 83 | public function runUpdate() |
| 84 | 84 | { |
| 85 | 85 | $cmd = $this->createUpdate(); |
@@ -88,55 +88,55 @@ discard block |
||
| 88 | 88 | return $cmd; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * Creates an update command instance for the target file or folder. |
|
| 93 | - * @return SVNHelper_Command_Update |
|
| 94 | - */ |
|
| 91 | + /** |
|
| 92 | + * Creates an update command instance for the target file or folder. |
|
| 93 | + * @return SVNHelper_Command_Update |
|
| 94 | + */ |
|
| 95 | 95 | public function createUpdate() |
| 96 | 96 | { |
| 97 | 97 | return $this->helper->createUpdate($this); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * Creates a status command instance for the target file or folder. |
|
| 102 | - * @return SVNHelper_Command_Status |
|
| 103 | - */ |
|
| 100 | + /** |
|
| 101 | + * Creates a status command instance for the target file or folder. |
|
| 102 | + * @return SVNHelper_Command_Status |
|
| 103 | + */ |
|
| 104 | 104 | public function createStatus() |
| 105 | 105 | { |
| 106 | 106 | return $this->helper->createStatus($this); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * Creates an info command instance for the target file or folder. |
|
| 111 | - * @return SVNHelper_Command_Info |
|
| 112 | - */ |
|
| 109 | + /** |
|
| 110 | + * Creates an info command instance for the target file or folder. |
|
| 111 | + * @return SVNHelper_Command_Info |
|
| 112 | + */ |
|
| 113 | 113 | public function createInfo() |
| 114 | 114 | { |
| 115 | 115 | return $this->helper->createInfo($this); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - /** |
|
| 119 | - * Creates a commit command instance for the target file or folder. |
|
| 120 | - * @param string $message |
|
| 121 | - * @return SVNHelper_Command_Commit |
|
| 122 | - */ |
|
| 118 | + /** |
|
| 119 | + * Creates a commit command instance for the target file or folder. |
|
| 120 | + * @param string $message |
|
| 121 | + * @return SVNHelper_Command_Commit |
|
| 122 | + */ |
|
| 123 | 123 | public function createCommit($message) |
| 124 | 124 | { |
| 125 | 125 | return $this->helper->createCommit($this, $message); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - /** |
|
| 129 | - * Creates an add command instance for the target file or folder. |
|
| 130 | - * @return SVNHelper_Command_Add |
|
| 131 | - */ |
|
| 128 | + /** |
|
| 129 | + * Creates an add command instance for the target file or folder. |
|
| 130 | + * @return SVNHelper_Command_Add |
|
| 131 | + */ |
|
| 132 | 132 | public function createAdd() |
| 133 | 133 | { |
| 134 | 134 | return $this->helper->createAdd($this); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - /** |
|
| 138 | - * @return SVNHelper_Command_Status |
|
| 139 | - */ |
|
| 137 | + /** |
|
| 138 | + * @return SVNHelper_Command_Status |
|
| 139 | + */ |
|
| 140 | 140 | public function getStatus() |
| 141 | 141 | { |
| 142 | 142 | $cmd = $this->createStatus(); |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | return $this; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - /** |
|
| 158 | - * Whether the target is versioned or needs to be added. |
|
| 159 | - * @return boolean |
|
| 160 | - */ |
|
| 157 | + /** |
|
| 158 | + * Whether the target is versioned or needs to be added. |
|
| 159 | + * @return boolean |
|
| 160 | + */ |
|
| 161 | 161 | public function isVersioned() |
| 162 | 162 | { |
| 163 | 163 | return $this->getInfo()->isVersioned(); |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | $this->cache = array(); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - /** |
|
| 174 | - * Retrieves information on the target. |
|
| 175 | - * @return SVNHelper_Command_Info |
|
| 176 | - */ |
|
| 173 | + /** |
|
| 174 | + * Retrieves information on the target. |
|
| 175 | + * @return SVNHelper_Command_Info |
|
| 176 | + */ |
|
| 177 | 177 | public function getInfo() |
| 178 | 178 | { |
| 179 | 179 | if(!isset($this->cache['info'])) { |
@@ -183,15 +183,15 @@ discard block |
||
| 183 | 183 | return $this->cache['info']; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - /** |
|
| 187 | - * Commits the target file or folder. If it has |
|
| 188 | - * not been added to the repository yet, it is |
|
| 189 | - * added automatically beforehand. If it does |
|
| 190 | - * not need to be committed, no changes are made. |
|
| 191 | - * |
|
| 192 | - * @param string $message |
|
| 193 | - * @return SVNHelper_Target |
|
| 194 | - */ |
|
| 186 | + /** |
|
| 187 | + * Commits the target file or folder. If it has |
|
| 188 | + * not been added to the repository yet, it is |
|
| 189 | + * added automatically beforehand. If it does |
|
| 190 | + * not need to be committed, no changes are made. |
|
| 191 | + * |
|
| 192 | + * @param string $message |
|
| 193 | + * @return SVNHelper_Target |
|
| 194 | + */ |
|
| 195 | 195 | public function runCommit($message) |
| 196 | 196 | { |
| 197 | 197 | if(!$this->isVersioned()) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $this->url = $this->helper->getURL().'/'.$this->relativePath; |
| 29 | 29 | |
| 30 | 30 | $path = $this->helper->getPath(); |
| 31 | - if(!empty($relativePath)) { |
|
| 31 | + if (!empty($relativePath)) { |
|
| 32 | 32 | $path .= $this->helper->getSlash().$this->relativePath; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | // this is relevant). |
| 39 | 39 | $this->path = realpath($path); |
| 40 | 40 | |
| 41 | - if(!$this->path || !file_exists($this->path)) { |
|
| 41 | + if (!$this->path || !file_exists($this->path)) { |
|
| 42 | 42 | throw new SVNHelper_Exception( |
| 43 | 43 | 'File not found', |
| 44 | 44 | sprintf( |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | public function runAdd() |
| 148 | 148 | { |
| 149 | - if(!$this->isVersioned()) { |
|
| 149 | + if (!$this->isVersioned()) { |
|
| 150 | 150 | $this->createAdd()->execute(); |
| 151 | 151 | $this->clearCache(); |
| 152 | 152 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function getInfo() |
| 178 | 178 | { |
| 179 | - if(!isset($this->cache['info'])) { |
|
| 179 | + if (!isset($this->cache['info'])) { |
|
| 180 | 180 | $this->cache['info'] = $this->helper->createInfo($this); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -194,12 +194,12 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function runCommit($message) |
| 196 | 196 | { |
| 197 | - if(!$this->isVersioned()) { |
|
| 197 | + if (!$this->isVersioned()) { |
|
| 198 | 198 | $this->log('Adding the unversioned file.'); |
| 199 | 199 | $this->runAdd(); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if(!$this->isCommitted()) { |
|
| 202 | + if (!$this->isCommitted()) { |
|
| 203 | 203 | $this->createCommit($message)->execute(); |
| 204 | 204 | $this->clearCache(); |
| 205 | 205 | } |
@@ -202,8 +202,7 @@ |
||
| 202 | 202 | if(!$this->isCommitted()) { |
| 203 | 203 | $this->createCommit($message)->execute(); |
| 204 | 204 | $this->clearCache(); |
| 205 | - } |
|
| 206 | - else |
|
| 205 | + } else |
|
| 207 | 206 | { |
| 208 | 207 | $this->log('Already committed, nothing to do.'); |
| 209 | 208 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | protected $result; |
| 20 | 20 | |
| 21 | - public function __construct($message, $details, $code, SVNHelper_CommandResult $result, $previous=null) |
|
| 21 | + public function __construct($message, $details, $code, SVNHelper_CommandResult $result, $previous = null) |
|
| 22 | 22 | { |
| 23 | 23 | parent::__construct($message, $details, $code, $previous); |
| 24 | 24 | $this->result = $result; |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | 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 |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var SVNHelper_CommandResult |
|
| 35 | + */ |
|
| 36 | 36 | protected $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; |
@@ -99,15 +99,15 @@ discard block |
||
| 99 | 99 | return $cmd; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - /** |
|
| 103 | - * Executes the specified command, and returns a result |
|
| 104 | - * instance to read the results. |
|
| 105 | - * |
|
| 106 | - * @param string $mode The command mode, e.g. commit / update... |
|
| 107 | - * @param string $path The path to apply the command to |
|
| 108 | - * @param array $params |
|
| 109 | - * @return SVNHelper_CommandResult |
|
| 110 | - */ |
|
| 102 | + /** |
|
| 103 | + * Executes the specified command, and returns a result |
|
| 104 | + * instance to read the results. |
|
| 105 | + * |
|
| 106 | + * @param string $mode The command mode, e.g. commit / update... |
|
| 107 | + * @param string $path The path to apply the command to |
|
| 108 | + * @param array $params |
|
| 109 | + * @return SVNHelper_CommandResult |
|
| 110 | + */ |
|
| 111 | 111 | protected function execCommand($mode, $path=null, $params=array()) |
| 112 | 112 | { |
| 113 | 113 | $relative = $this->helper->relativizePath($path); |
@@ -194,10 +194,10 @@ discard block |
||
| 194 | 194 | return $this->result; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - /** |
|
| 198 | - * Retrieves the type of command, e.g. "Commit" |
|
| 199 | - * @return string |
|
| 200 | - */ |
|
| 197 | + /** |
|
| 198 | + * Retrieves the type of command, e.g. "Commit" |
|
| 199 | + * @return string |
|
| 200 | + */ |
|
| 201 | 201 | public function getType() |
| 202 | 202 | { |
| 203 | 203 | 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 | return $this->result; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | putenv('LC_ALL='.$locale); |
| 67 | 67 | |
| 68 | 68 | $this->result = $this->_execute(); |
| 69 | - if(!$this->result instanceof SVNHelper_CommandResult) { |
|
| 69 | + if (!$this->result instanceof SVNHelper_CommandResult) { |
|
| 70 | 70 | throw new SVNHelper_Exception( |
| 71 | 71 | 'Not a valid SVN command result', |
| 72 | 72 | sprintf( |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | abstract protected function _execute(); |
| 84 | 84 | |
| 85 | - protected function buildCommand($mode, $path=null, $params=array()) |
|
| 85 | + protected function buildCommand($mode, $path = null, $params = array()) |
|
| 86 | 86 | { |
| 87 | 87 | $params[] = 'non-interactive'; |
| 88 | 88 | $params[] = 'username '.$this->helper->getAuthUser(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $cmd = 'svn '.$mode.' '.$path.' '; |
| 92 | 92 | |
| 93 | - foreach($params as $param) { |
|
| 93 | + foreach ($params as $param) { |
|
| 94 | 94 | $cmd .= '--'.$param.' '; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param array $params |
| 109 | 109 | * @return SVNHelper_CommandResult |
| 110 | 110 | */ |
| 111 | - protected function execCommand($mode, $path=null, $params=array()) |
|
| 111 | + protected function execCommand($mode, $path = null, $params = array()) |
|
| 112 | 112 | { |
| 113 | 113 | $relative = $this->helper->relativizePath($path); |
| 114 | 114 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | exec($cmd, $output); |
| 124 | 124 | |
| 125 | 125 | $lines = array(); |
| 126 | - foreach($output as $line) { |
|
| 126 | + foreach ($output as $line) { |
|
| 127 | 127 | $lines[] = mb_strtolower(trim(utf8_encode($line))); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | // |
| 136 | 136 | // Can happen for example when the path is not under version |
| 137 | 137 | // control. |
| 138 | - if(isset($lines[0]) && substr($lines[0], 0, 7) == 'skipped') |
|
| 138 | + if (isset($lines[0]) && substr($lines[0], 0, 7) == 'skipped') |
|
| 139 | 139 | { |
| 140 | 140 | $tokens = explode('--', $lines[0]); |
| 141 | 141 | $message = trim(array_pop($tokens)); |
@@ -156,20 +156,20 @@ discard block |
||
| 156 | 156 | // svn: w123456: warning message |
| 157 | 157 | else |
| 158 | 158 | { |
| 159 | - foreach($lines as $line) |
|
| 159 | + foreach ($lines as $line) |
|
| 160 | 160 | { |
| 161 | - if(strstr($line, 'svn:')) |
|
| 161 | + if (strstr($line, 'svn:')) |
|
| 162 | 162 | { |
| 163 | 163 | $result = array(); |
| 164 | 164 | preg_match_all('/svn:[ ]*(e|warning:[ ]*w)([0-9]+):(.*)/', $line, $result, PREG_PATTERN_ORDER); |
| 165 | 165 | |
| 166 | - if(isset($result[1]) && isset($result[1][0])) |
|
| 166 | + if (isset($result[1]) && isset($result[1][0])) |
|
| 167 | 167 | { |
| 168 | 168 | $message = trim($result[3][0]); |
| 169 | 169 | $code = trim($result[2][0]); |
| 170 | 170 | $type = self::SVN_ERROR_TYPE_ERROR; |
| 171 | 171 | |
| 172 | - if($result[1][0] != 'e') { |
|
| 172 | + if ($result[1][0] != 'e') { |
|
| 173 | 173 | $type = self::SVN_ERROR_TYPE_WARNING; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $result = new SVNHelper_CommandResult($this, $cmd, $lines, $errorMessages); |
| 184 | 184 | |
| 185 | - if($result->isError()) { |
|
| 185 | + if ($result->isError()) { |
|
| 186 | 186 | $this->log(sprintf('[%s] | Command returned errors.', $relative)); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | protected function throwExceptionUnexpected(SVNHelper_CommandResult $result) |
| 207 | 207 | { |
| 208 | - if($result->isConnectionFailed()) { |
|
| 208 | + if ($result->isConnectionFailed()) { |
|
| 209 | 209 | $this->throwException( |
| 210 | 210 | t('Could not connect to the remote SVN repository'), |
| 211 | 211 | '', |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | ); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - if($result->hasConflicts()) { |
|
| 217 | + if ($result->hasConflicts()) { |
|
| 218 | 218 | $this->throwException( |
| 219 | 219 | t('SVN command reported conflicts'), |
| 220 | 220 | '', |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | ); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if($result->hasLocks()) { |
|
| 226 | + if ($result->hasLocks()) { |
|
| 227 | 227 | $this->throwException( |
| 228 | 228 | t('The target SVN folder or file is locked.'), |
| 229 | 229 | '', |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | ); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - protected function throwException($message, $details, $code, SVNHelper_CommandResult $result, $previous=null) |
|
| 243 | + protected function throwException($message, $details, $code, SVNHelper_CommandResult $result, $previous = null) |
|
| 244 | 244 | { |
| 245 | 245 | $body = |
| 246 | 246 | '<p>'. |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | '</p>'. |
| 256 | 256 | '<ul>'; |
| 257 | 257 | $errors = $result->getErrorMessages(); |
| 258 | - foreach($errors as $error) { |
|
| 258 | + foreach ($errors as $error) { |
|
| 259 | 259 | $body .= |
| 260 | 260 | '<li>'. |
| 261 | 261 | $error. |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | $result = $this->execCommand('add', $this->target->getPath()); |
| 16 | 16 | |
| 17 | - if($result->isError()) { |
|
| 17 | + if ($result->isError()) { |
|
| 18 | 18 | throw new SVNHelper_Exception( |
| 19 | 19 | 'Could not add target path', |
| 20 | 20 | sprintf( |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $line = $result->getFirstLine(); |
| 30 | - if(substr($line, 0, 1) != 'a') { |
|
| 30 | + if (substr($line, 0, 1) != 'a') { |
|
| 31 | 31 | throw new SVNHelper_Exception( |
| 32 | 32 | 'Unexpected result for adding a path', |
| 33 | 33 | sprintf( |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | ) |
| 17 | 17 | ); |
| 18 | 18 | |
| 19 | - if($result->isError()) { |
|
| 19 | + if ($result->isError()) { |
|
| 20 | 20 | $this->throwExceptionUnexpected($result); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -44,12 +44,12 @@ |
||
| 44 | 44 | return $result; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Whether the file or folder has already been committed |
|
| 49 | - * and has no pending changes. |
|
| 50 | - * |
|
| 51 | - * @return boolean |
|
| 52 | - */ |
|
| 47 | + /** |
|
| 48 | + * Whether the file or folder has already been committed |
|
| 49 | + * and has no pending changes. |
|
| 50 | + * |
|
| 51 | + * @return boolean |
|
| 52 | + */ |
|
| 53 | 53 | public function isCommitted() |
| 54 | 54 | { |
| 55 | 55 | $status = $this->target->getStatus(); |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | $this->params = array(); |
| 16 | 16 | |
| 17 | - if($result->isError()) { |
|
| 17 | + if ($result->isError()) { |
|
| 18 | 18 | // this error code means the target exists, but is not versioned yet |
| 19 | - if(!$result->hasErrorCode('200009')) { |
|
| 19 | + if (!$result->hasErrorCode('200009')) { |
|
| 20 | 20 | $this->throwExceptionUnexpected($result); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $lines = $result->getOutput(); |
| 31 | 31 | |
| 32 | - foreach($lines as $line) |
|
| 32 | + foreach ($lines as $line) |
|
| 33 | 33 | { |
| 34 | - if(!strstr($line, ':')) { |
|
| 34 | + if (!strstr($line, ':')) { |
|
| 35 | 35 | continue; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $pos = strpos($line, ':'); |
| 39 | 39 | $name = str_replace(' ', '-', substr($line, 0, $pos)); |
| 40 | - $value = trim(substr($line, $pos+1)); |
|
| 40 | + $value = trim(substr($line, $pos + 1)); |
|
| 41 | 41 | $this->params[$name] = $value; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $this->execute(); |
| 91 | 91 | |
| 92 | - if(isset($this->params[$name])) { |
|
| 92 | + if (isset($this->params[$name])) { |
|
| 93 | 93 | return $this->params[$name]; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -28,17 +28,17 @@ discard block |
||
| 28 | 28 | return $result; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var SVNHelper_Command_Update_Status[] |
|
| 33 | - */ |
|
| 31 | + /** |
|
| 32 | + * @var SVNHelper_Command_Update_Status[] |
|
| 33 | + */ |
|
| 34 | 34 | protected $stati; |
| 35 | 35 | |
| 36 | 36 | protected $revision; |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Parses the command output to find out which files have been modified, and how. |
|
| 40 | - * @param SVNHelper_CommandResult $result |
|
| 41 | - */ |
|
| 38 | + /** |
|
| 39 | + * Parses the command output to find out which files have been modified, and how. |
|
| 40 | + * @param SVNHelper_CommandResult $result |
|
| 41 | + */ |
|
| 42 | 42 | protected function parseResult(SVNHelper_CommandResult $result) |
| 43 | 43 | { |
| 44 | 44 | $this->stati = array(); |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | return $this->getByStatus('a'); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - /** |
|
| 123 | - * Whether there were files with the specified status code. |
|
| 124 | - * @param string $status |
|
| 125 | - * @return boolean |
|
| 126 | - */ |
|
| 122 | + /** |
|
| 123 | + * Whether there were files with the specified status code. |
|
| 124 | + * @param string $status |
|
| 125 | + * @return boolean |
|
| 126 | + */ |
|
| 127 | 127 | protected function hasStatus($status) |
| 128 | 128 | { |
| 129 | 129 | $this->execute(); |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | $result = $this->execCommand('update', $this->target->getPath()); |
| 12 | 12 | |
| 13 | - if($result->isError()) { |
|
| 13 | + if ($result->isError()) { |
|
| 14 | 14 | $this->throwExceptionUnexpected($result); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $this->parseResult($result); |
| 18 | 18 | |
| 19 | - if(!isset($this->revision)) { |
|
| 19 | + if (!isset($this->revision)) { |
|
| 20 | 20 | $this->throwException( |
| 21 | 21 | 'No update revision returned', |
| 22 | 22 | 'The command did not return the expected last line with "at revision x".', |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $lines = $result->getLines(); |
| 47 | 47 | |
| 48 | - foreach($lines as $line) |
|
| 48 | + foreach ($lines as $line) |
|
| 49 | 49 | { |
| 50 | 50 | $result = array(); |
| 51 | 51 | preg_match_all('/\A(a|c|d|u)[ ]+(.+)/si', $line, $result, PREG_PATTERN_ORDER); |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | // is this a file update status line? It looks like this: |
| 54 | 54 | // a c:\path\to\file.ext |
| 55 | 55 | // ^ status code |
| 56 | - if(isset($result[0]) && isset($result[1][0]) && !empty($result[1][0])) |
|
| 56 | + if (isset($result[0]) && isset($result[1][0]) && !empty($result[1][0])) |
|
| 57 | 57 | { |
| 58 | 58 | $status = $result[1][0]; |
| 59 | 59 | $path = $result[2][0]; |
| 60 | 60 | $obj = new SVNHelper_Command_Update_Status($this, $status, $path); |
| 61 | 61 | |
| 62 | - if(!isset($this->stati[$status])) { |
|
| 62 | + if (!isset($this->stati[$status])) { |
|
| 63 | 63 | $this->stati[$status] = array(); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // the revision line, "updated to revision X" or "at revision X" |
| 72 | - if(strstr($line, 'revision ')) { |
|
| 72 | + if (strstr($line, 'revision ')) { |
|
| 73 | 73 | preg_match('/(at revision|to revision) ([0-9]+)/si', $line, $result); |
| 74 | - if(isset($result[2])) { |
|
| 74 | + if (isset($result[2])) { |
|
| 75 | 75 | $this->revision = $result[2]; |
| 76 | 76 | } |
| 77 | 77 | continue; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $this->execute(); |
| 137 | 137 | |
| 138 | - if(isset($this->stati[$status])) { |
|
| 138 | + if (isset($this->stati[$status])) { |
|
| 139 | 139 | return $this->stati[$status]; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | const STATUS_FILETYPE_CHANGE = 'filetype-change'; |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @var array |
|
| 29 | - * @see http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.status.html |
|
| 30 | - */ |
|
| 27 | + /** |
|
| 28 | + * @var array |
|
| 29 | + * @see http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.status.html |
|
| 30 | + */ |
|
| 31 | 31 | protected static $knownStati = array( |
| 32 | 32 | 'a' => self::STATUS_ADD, |
| 33 | 33 | 'd' => self::STATUS_DELETE, |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | '~' => self::STATUS_FILETYPE_CHANGE, |
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @var string |
|
| 45 | - */ |
|
| 43 | + /** |
|
| 44 | + * @var string |
|
| 45 | + */ |
|
| 46 | 46 | protected $status; |
| 47 | 47 | |
| 48 | 48 | protected function _execute() |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $svnStatusCode = strtolower(substr($lines[0], 0, 1)); |
| 67 | 67 | if(isset(self::$knownStati[$svnStatusCode])) { |
| 68 | - $this->status = self::$knownStati[$svnStatusCode]; |
|
| 68 | + $this->status = self::$knownStati[$svnStatusCode]; |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | $result = $this->execCommand('status', $this->target->getPath(), array('depth empty')); |
| 51 | 51 | |
| 52 | - if($result->isError()) { |
|
| 52 | + if ($result->isError()) { |
|
| 53 | 53 | $this->throwExceptionUnexpected($result); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $lines = $result->getOutput(); |
| 57 | 57 | |
| 58 | - if(empty($lines)) |
|
| 58 | + if (empty($lines)) |
|
| 59 | 59 | { |
| 60 | 60 | $this->status = self::STATUS_NOT_MODIFIED; |
| 61 | 61 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->status = self::STATUS_UNKNOWN; |
| 65 | 65 | |
| 66 | 66 | $svnStatusCode = strtolower(substr($lines[0], 0, 1)); |
| 67 | - if(isset(self::$knownStati[$svnStatusCode])) { |
|
| 67 | + if (isset(self::$knownStati[$svnStatusCode])) { |
|
| 68 | 68 | $this->status = self::$knownStati[$svnStatusCode]; |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if(empty($lines)) |
| 59 | 59 | { |
| 60 | 60 | $this->status = self::STATUS_NOT_MODIFIED; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->status = self::STATUS_UNKNOWN; |
| 65 | 64 | |
@@ -64,8 +64,7 @@ |
||
| 64 | 64 | if(is_array($subject)) |
| 65 | 65 | { |
| 66 | 66 | $this->parseSerialized($subject); |
| 67 | - } |
|
| 68 | - else |
|
| 67 | + } else |
|
| 69 | 68 | { |
| 70 | 69 | $this->parseException($subject); |
| 71 | 70 | } |
@@ -14,49 +14,49 @@ discard block |
||
| 14 | 14 | const CONTEXT_COMMAND_LINE = 'cli'; |
| 15 | 15 | const CONTEXT_WEB = 'web'; |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @var \Throwable |
|
| 19 | - */ |
|
| 17 | + /** |
|
| 18 | + * @var \Throwable |
|
| 19 | + */ |
|
| 20 | 20 | protected $exception; |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @var ConvertHelper_ThrowableInfo_Call[] |
|
| 24 | - */ |
|
| 22 | + /** |
|
| 23 | + * @var ConvertHelper_ThrowableInfo_Call[] |
|
| 24 | + */ |
|
| 25 | 25 | protected $calls = array(); |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @var integer |
|
| 29 | - */ |
|
| 27 | + /** |
|
| 28 | + * @var integer |
|
| 29 | + */ |
|
| 30 | 30 | protected $code; |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 32 | + /** |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | 35 | protected $message; |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @var integer |
|
| 39 | - */ |
|
| 37 | + /** |
|
| 38 | + * @var integer |
|
| 39 | + */ |
|
| 40 | 40 | protected $callsCount = 0; |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @var ConvertHelper_ThrowableInfo |
|
| 44 | - */ |
|
| 42 | + /** |
|
| 43 | + * @var ConvertHelper_ThrowableInfo |
|
| 44 | + */ |
|
| 45 | 45 | protected $previous; |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @var string |
|
| 49 | - */ |
|
| 47 | + /** |
|
| 48 | + * @var string |
|
| 49 | + */ |
|
| 50 | 50 | protected $referer = ''; |
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @var \DateTime |
|
| 54 | - */ |
|
| 52 | + /** |
|
| 53 | + * @var \DateTime |
|
| 54 | + */ |
|
| 55 | 55 | protected $date; |
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @var string |
|
| 59 | - */ |
|
| 57 | + /** |
|
| 58 | + * @var string |
|
| 59 | + */ |
|
| 60 | 60 | protected $context = self::CONTEXT_WEB; |
| 61 | 61 | |
| 62 | 62 | protected function __construct($subject) |
@@ -103,16 +103,16 @@ discard block |
||
| 103 | 103 | return isset($this->previous); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * Retrieves the information on the previous exception. |
|
| 108 | - * |
|
| 109 | - * NOTE: Throws an exception if there is no previous |
|
| 110 | - * exception. Use hasPrevious() first to avoid this. |
|
| 111 | - * |
|
| 112 | - * @throws ConvertHelper_Exception |
|
| 113 | - * @return ConvertHelper_ThrowableInfo |
|
| 114 | - * @see ConvertHelper_ThrowableInfo::ERROR_NO_PREVIOUS_EXCEPTION |
|
| 115 | - */ |
|
| 106 | + /** |
|
| 107 | + * Retrieves the information on the previous exception. |
|
| 108 | + * |
|
| 109 | + * NOTE: Throws an exception if there is no previous |
|
| 110 | + * exception. Use hasPrevious() first to avoid this. |
|
| 111 | + * |
|
| 112 | + * @throws ConvertHelper_Exception |
|
| 113 | + * @return ConvertHelper_ThrowableInfo |
|
| 114 | + * @see ConvertHelper_ThrowableInfo::ERROR_NO_PREVIOUS_EXCEPTION |
|
| 115 | + */ |
|
| 116 | 116 | public function getPrevious() : ConvertHelper_ThrowableInfo |
| 117 | 117 | { |
| 118 | 118 | if(isset($this->previous)) { |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | return !empty($this->code); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - /** |
|
| 135 | - * Improved textonly exception trace. |
|
| 136 | - */ |
|
| 134 | + /** |
|
| 135 | + * Improved textonly exception trace. |
|
| 136 | + */ |
|
| 137 | 137 | public function toString() : string |
| 138 | 138 | { |
| 139 | 139 | $calls = $this->getCalls(); |
@@ -161,73 +161,73 @@ discard block |
||
| 161 | 161 | return $string; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - /** |
|
| 165 | - * Retrieves the URL of the page in which the exception |
|
| 166 | - * was thrown, if applicable: in CLI context, this will |
|
| 167 | - * return an empty string. |
|
| 168 | - * |
|
| 169 | - * @return string |
|
| 170 | - */ |
|
| 164 | + /** |
|
| 165 | + * Retrieves the URL of the page in which the exception |
|
| 166 | + * was thrown, if applicable: in CLI context, this will |
|
| 167 | + * return an empty string. |
|
| 168 | + * |
|
| 169 | + * @return string |
|
| 170 | + */ |
|
| 171 | 171 | public function getReferer() : string |
| 172 | 172 | { |
| 173 | 173 | return $this->referer; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - /** |
|
| 177 | - * Whether the exception occurred in a command line context. |
|
| 178 | - * @return bool |
|
| 179 | - */ |
|
| 176 | + /** |
|
| 177 | + * Whether the exception occurred in a command line context. |
|
| 178 | + * @return bool |
|
| 179 | + */ |
|
| 180 | 180 | public function isCommandLine() : bool |
| 181 | 181 | { |
| 182 | 182 | return $this->getContext() === self::CONTEXT_COMMAND_LINE; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - /** |
|
| 186 | - * Whether the exception occurred during an http request. |
|
| 187 | - * @return bool |
|
| 188 | - */ |
|
| 185 | + /** |
|
| 186 | + * Whether the exception occurred during an http request. |
|
| 187 | + * @return bool |
|
| 188 | + */ |
|
| 189 | 189 | public function isWebRequest() : bool |
| 190 | 190 | { |
| 191 | 191 | return $this->getContext() === self::CONTEXT_WEB; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - /** |
|
| 195 | - * Retrieves the context identifier, i.e. if the exception |
|
| 196 | - * occurred in a command line context or regular web request. |
|
| 197 | - * |
|
| 198 | - * @return string |
|
| 199 | - * |
|
| 200 | - * @see ConvertHelper_ThrowableInfo::isCommandLine() |
|
| 201 | - * @see ConvertHelper_ThrowableInfo::isWebRequest() |
|
| 202 | - * @see ConvertHelper_ThrowableInfo::CONTEXT_COMMAND_LINE |
|
| 203 | - * @see ConvertHelper_ThrowableInfo::CONTEXT_WEB |
|
| 204 | - */ |
|
| 194 | + /** |
|
| 195 | + * Retrieves the context identifier, i.e. if the exception |
|
| 196 | + * occurred in a command line context or regular web request. |
|
| 197 | + * |
|
| 198 | + * @return string |
|
| 199 | + * |
|
| 200 | + * @see ConvertHelper_ThrowableInfo::isCommandLine() |
|
| 201 | + * @see ConvertHelper_ThrowableInfo::isWebRequest() |
|
| 202 | + * @see ConvertHelper_ThrowableInfo::CONTEXT_COMMAND_LINE |
|
| 203 | + * @see ConvertHelper_ThrowableInfo::CONTEXT_WEB |
|
| 204 | + */ |
|
| 205 | 205 | public function getContext() : string |
| 206 | 206 | { |
| 207 | 207 | return $this->context; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - /** |
|
| 211 | - * Retrieves the date of the exception, and approximate time: |
|
| 212 | - * since exceptions do not store time, this is captured the |
|
| 213 | - * moment the ThrowableInfo is created. |
|
| 214 | - * |
|
| 215 | - * @return \DateTime |
|
| 216 | - */ |
|
| 210 | + /** |
|
| 211 | + * Retrieves the date of the exception, and approximate time: |
|
| 212 | + * since exceptions do not store time, this is captured the |
|
| 213 | + * moment the ThrowableInfo is created. |
|
| 214 | + * |
|
| 215 | + * @return \DateTime |
|
| 216 | + */ |
|
| 217 | 217 | public function getDate() : \DateTime |
| 218 | 218 | { |
| 219 | 219 | return $this->date; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - /** |
|
| 223 | - * Serializes all information on the exception to an |
|
| 224 | - * associative array. This can be saved (file, database, |
|
| 225 | - * session...), and later be restored into a throwable |
|
| 226 | - * info instance using the fromSerialized() method. |
|
| 227 | - * |
|
| 228 | - * @return array |
|
| 229 | - * @see ConvertHelper_ThrowableInfo::fromSerialized() |
|
| 230 | - */ |
|
| 222 | + /** |
|
| 223 | + * Serializes all information on the exception to an |
|
| 224 | + * associative array. This can be saved (file, database, |
|
| 225 | + * session...), and later be restored into a throwable |
|
| 226 | + * info instance using the fromSerialized() method. |
|
| 227 | + * |
|
| 228 | + * @return array |
|
| 229 | + * @see ConvertHelper_ThrowableInfo::fromSerialized() |
|
| 230 | + */ |
|
| 231 | 231 | public function serialize() : array |
| 232 | 232 | { |
| 233 | 233 | $result = array( |
@@ -254,24 +254,24 @@ discard block |
||
| 254 | 254 | return $result; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - /** |
|
| 258 | - * Sets the maximum folder depth to show in the |
|
| 259 | - * file paths, to avoid them being too long. |
|
| 260 | - * |
|
| 261 | - * @param int $depth |
|
| 262 | - * @return ConvertHelper_ThrowableInfo |
|
| 263 | - */ |
|
| 257 | + /** |
|
| 258 | + * Sets the maximum folder depth to show in the |
|
| 259 | + * file paths, to avoid them being too long. |
|
| 260 | + * |
|
| 261 | + * @param int $depth |
|
| 262 | + * @return ConvertHelper_ThrowableInfo |
|
| 263 | + */ |
|
| 264 | 264 | public function setFolderDepth(int $depth) : ConvertHelper_ThrowableInfo |
| 265 | 265 | { |
| 266 | 266 | return $this->setOption('folder-depth', $depth); |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - /** |
|
| 270 | - * Retrieves the current folder depth option value. |
|
| 271 | - * |
|
| 272 | - * @return int |
|
| 273 | - * @see ConvertHelper_ThrowableInfo::setFolderDepth() |
|
| 274 | - */ |
|
| 269 | + /** |
|
| 270 | + * Retrieves the current folder depth option value. |
|
| 271 | + * |
|
| 272 | + * @return int |
|
| 273 | + * @see ConvertHelper_ThrowableInfo::setFolderDepth() |
|
| 274 | + */ |
|
| 275 | 275 | public function getFolderDepth() : int |
| 276 | 276 | { |
| 277 | 277 | $depth = $this->getOption('folder-depth'); |
@@ -282,19 +282,19 @@ discard block |
||
| 282 | 282 | return 2; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - /** |
|
| 286 | - * Retrieves all function calls that led to the error. |
|
| 287 | - * @return ConvertHelper_ThrowableInfo_Call[] |
|
| 288 | - */ |
|
| 285 | + /** |
|
| 286 | + * Retrieves all function calls that led to the error. |
|
| 287 | + * @return ConvertHelper_ThrowableInfo_Call[] |
|
| 288 | + */ |
|
| 289 | 289 | public function getCalls() |
| 290 | 290 | { |
| 291 | 291 | return $this->calls; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - /** |
|
| 295 | - * Returns the amount of function and method calls in the stack trace. |
|
| 296 | - * @return int |
|
| 297 | - */ |
|
| 294 | + /** |
|
| 295 | + * Returns the amount of function and method calls in the stack trace. |
|
| 296 | + * @return int |
|
| 297 | + */ |
|
| 298 | 298 | public function countCalls() : int |
| 299 | 299 | { |
| 300 | 300 | return $this->callsCount; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | protected function __construct($subject) |
| 63 | 63 | { |
| 64 | - if(is_array($subject)) |
|
| 64 | + if (is_array($subject)) |
|
| 65 | 65 | { |
| 66 | 66 | $this->parseSerialized($subject); |
| 67 | 67 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function getPrevious() : ConvertHelper_ThrowableInfo |
| 117 | 117 | { |
| 118 | - if(isset($this->previous)) { |
|
| 118 | + if (isset($this->previous)) { |
|
| 119 | 119 | return $this->previous; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -140,18 +140,18 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | $string = 'Exception'; |
| 142 | 142 | |
| 143 | - if($this->hasCode()) { |
|
| 143 | + if ($this->hasCode()) { |
|
| 144 | 144 | $string .= ' #'.$this->code; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | $string .= ': '.$this->getMessage().PHP_EOL; |
| 148 | 148 | |
| 149 | - foreach($calls as $call) |
|
| 149 | + foreach ($calls as $call) |
|
| 150 | 150 | { |
| 151 | 151 | $string .= $call->toString().PHP_EOL; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if($this->hasPrevious()) |
|
| 154 | + if ($this->hasPrevious()) |
|
| 155 | 155 | { |
| 156 | 156 | $string .= PHP_EOL.PHP_EOL. |
| 157 | 157 | 'Previous error:'.PHP_EOL.PHP_EOL. |
@@ -242,11 +242,11 @@ discard block |
||
| 242 | 242 | 'previous' => null, |
| 243 | 243 | ); |
| 244 | 244 | |
| 245 | - if($this->hasPrevious()) { |
|
| 246 | - $result['previous'] = $this->previous->serialize(); |
|
| 245 | + if ($this->hasPrevious()) { |
|
| 246 | + $result['previous'] = $this->previous->serialize(); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - foreach($this->calls as $call) |
|
| 249 | + foreach ($this->calls as $call) |
|
| 250 | 250 | { |
| 251 | 251 | $result['calls'][] = $call->serialize(); |
| 252 | 252 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | public function getFolderDepth() : int |
| 276 | 276 | { |
| 277 | 277 | $depth = $this->getOption('folder-depth'); |
| 278 | - if(!empty($depth)) { |
|
| 278 | + if (!empty($depth)) { |
|
| 279 | 279 | return $depth; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -311,12 +311,12 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $this->setOptions($serialized['options']); |
| 313 | 313 | |
| 314 | - if(!empty($serialized['previous'])) |
|
| 314 | + if (!empty($serialized['previous'])) |
|
| 315 | 315 | { |
| 316 | 316 | $this->previous = ConvertHelper_ThrowableInfo::fromSerialized($serialized['previous']); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | - foreach($serialized['calls'] as $def) |
|
| 319 | + foreach ($serialized['calls'] as $def) |
|
| 320 | 320 | { |
| 321 | 321 | $this->calls[] = ConvertHelper_ThrowableInfo_Call::fromSerialized($this, $def); |
| 322 | 322 | } |
@@ -328,16 +328,16 @@ discard block |
||
| 328 | 328 | $this->message = $e->getMessage(); |
| 329 | 329 | $this->code = intval($e->getCode()); |
| 330 | 330 | |
| 331 | - if(!isset($_REQUEST) || !isset($_REQUEST['REQUEST_URI'])) { |
|
| 331 | + if (!isset($_REQUEST) || !isset($_REQUEST['REQUEST_URI'])) { |
|
| 332 | 332 | $this->context = self::CONTEXT_COMMAND_LINE; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | $previous = $e->getPrevious(); |
| 336 | - if(!empty($previous)) { |
|
| 336 | + if (!empty($previous)) { |
|
| 337 | 337 | $this->previous = ConvertHelper::throwable2info($previous); |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | - if(isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) { |
|
| 340 | + if (isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) { |
|
| 341 | 341 | $this->referer = $_SERVER['REQUEST_URI']; |
| 342 | 342 | } |
| 343 | 343 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | $idx = 1; |
| 353 | 353 | |
| 354 | - foreach($trace as $entry) |
|
| 354 | + foreach ($trace as $entry) |
|
| 355 | 355 | { |
| 356 | 356 | $this->calls[] = ConvertHelper_ThrowableInfo_Call::fromTrace($this, $idx, $entry); |
| 357 | 357 | |