Skip to content

Commit 0ba5b55

Browse files
committed
Coding guidelines / whitespace
1 parent cdc7008 commit 0ba5b55

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

SourceVisualSVNServer/SourceVisualSVNServer.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,30 @@ public function get_visualsvnserver_url_prefix( $p_repo ) {
5151
protected function url_base( $p_repo ) {
5252
# VisualSVN Server web interface is always on the same host name
5353
# as the HTTP(S)-served repositories, accessed via the /!/#reponame path
54-
$t_repo_url = parse_url($p_repo->url);
54+
$t_repo_url = parse_url( $p_repo->url );
5555
$t_repo_path = $t_repo_url['path'];
5656

5757
$t_url_prefix = $this->get_visualsvnserver_url_prefix( $p_repo );
5858

5959
# Strip repo prefix (typically '/svn/') from path
60-
$t_prefix = empty( $t_url_prefix ) ? '/' : '/' . urlencode($t_url_prefix) . '/';
61-
if (substr($t_repo_path, 0, strlen($t_prefix)) == $t_prefix) {
62-
$t_repo_path = substr($t_repo_path, strlen($t_prefix));
60+
$t_prefix = empty( $t_url_prefix ) ? '/' : '/' . urlencode( $t_url_prefix ) . '/';
61+
if( substr( $t_repo_path, 0, strlen( $t_prefix ) ) == $t_prefix ) {
62+
$t_repo_path = substr( $t_repo_path, strlen( $t_prefix ) );
6363
}
6464

6565
# Only include port in final URL if it was present originally
6666
$t_port = isset( $t_repo_url['port'] ) ? ':' . $t_repo_url['port'] : '';
67-
67+
6868
$t_url = $t_repo_url['scheme'] . '://' . $t_repo_url['host'] . $t_port . '/!/#' . $t_repo_path;
6969
return $t_url;
7070
}
7171

72-
public function url_repo( $p_repo, $p_changeset=null ) {
72+
public function url_repo( $p_repo, $p_changeset = null ) {
7373
$t_url = $this->url_base( $p_repo );
74-
75-
if ( !is_null( $p_changeset ) ) {
74+
75+
if( !is_null( $p_changeset ) ) {
7676
$t_revision = $p_changeset->revision;
77-
$t_url .= '/view/r' . urlencode($t_revision) . '/';
77+
$t_url .= '/view/r' . urlencode( $t_revision ) . '/';
7878
}
7979

8080
return $t_url;
@@ -84,7 +84,7 @@ public function url_changeset( $p_repo, $p_changeset ) {
8484
$t_repo_url = $this->url_base( $p_repo );
8585
$t_revision = $p_changeset->revision;
8686

87-
$t_url = $t_repo_url . '/commit/r' . urlencode($t_revision) . '/';
87+
$t_url = $t_repo_url . '/commit/r' . urlencode( $t_revision ) . '/';
8888
return $t_url;
8989
}
9090

@@ -93,19 +93,19 @@ public function url_file( $p_repo, $p_changeset, $p_file ) {
9393

9494
# if the file has been removed, it doesn't exist in current revision
9595
# so we generate a link to (current revision - 1)
96-
$t_revision = ($p_file->action == 'rm')
97-
? $p_changeset->revision - 1
98-
: $p_changeset->revision;
96+
$t_revision = ( $p_file->action == 'rm' )
97+
? $p_changeset->revision - 1
98+
: $p_changeset->revision;
99+
100+
$t_url = $t_repo_url . '/view/r' . urlencode( $t_revision ) . $p_file->filename;
99101

100-
$t_url = $t_repo_url . '/view/r' . urlencode($t_revision) . $p_file->filename;
101-
102102
return $t_url;
103103
}
104104

105105
public function url_diff( $p_repo, $p_changeset, $p_file ) {
106-
if ( $p_file->action == 'rm' || $p_file->action == 'add' ) {
106+
if( $p_file->action == 'rm' || $p_file->action == 'add' ) {
107107
# Return default no-link for add/remove change diffs
108-
return parent::url_diff($p_repo, $p_changeset, $p_file);
108+
return parent::url_diff( $p_repo, $p_changeset, $p_file );
109109
}
110110

111111
# The web interface for VisualSVN Server displays file diffs as inline content
@@ -117,22 +117,21 @@ public function url_diff( $p_repo, $p_changeset, $p_file ) {
117117
}
118118

119119
public function update_repo_form( $p_repo ) {
120-
$t_url_prefix = $this->get_visualsvnserver_url_prefix( $p_repo );
121-
120+
$t_url_prefix = $this->get_visualsvnserver_url_prefix( $p_repo );
122121
?>
123122
<tr>
124123
<td class="category"><?php echo plugin_lang_get( 'visualsvnserver_url_prefix' ) ?></td>
125124
<td>
126-
<input type="text" name="visualsvnserver_url_prefix" maxlength="250" size="40" value="<?php echo string_attribute( $t_url_prefix ) ?>"/>
125+
<input type="text" name="visualsvnserver_url_prefix" maxlength="250" size="40"
126+
value="<?php echo string_attribute( $t_url_prefix ) ?>"
127+
/>
127128
</td>
128129
</tr>
129130
<?php
130-
131131
return parent::update_repo_form( $p_repo );
132132
}
133133

134134
public function update_repo( $p_repo ) {
135-
136135
$p_repo->info['visualsvnserver_url_prefix'] = gpc_get_string( 'visualsvnserver_url_prefix' );
137136

138137
return parent::update_repo( $p_repo );

0 commit comments

Comments
 (0)