Skip to content

Commit 5a94880

Browse files
committed
Fix codestyle warnings
1 parent e2bc846 commit 5a94880

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

action/editcommit.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ public function register(EventHandler $controller)
5959
* @param string path to the file or directory to be commited (required for auto determination only)
6060
* @return GitRepo instance or null if there is no repo related to fileOrDirPath
6161
*/
62-
private function initRepo($fileOrDirPath="") {
62+
private function initRepo($fileOrDirPath = "")
63+
{
6364
global $conf;
64-
65+
6566
//set the path to the git binary
6667
$gitPath = trim($this->getConf('gitPath'));
6768
if ($gitPath !== '') {
@@ -89,7 +90,9 @@ private function initRepo($fileOrDirPath="") {
8990
}
9091
// Validate that the git repoPath found is within or below the DokuWiki 'savedir' configured:
9192
if (strpos(realpath($repoPath), realpath($conf['savedir'])) === false) {
92-
//dbglog("GitBacked - WARNING: repoPath=" . $repoPath . " is above the configured savedir=" . realpath($conf['savedir'])." => this git repo will be ignored!");
93+
//dbglog("GitBacked - WARNING: repoPath=" . $repoPath . " is above the configured savedir="
94+
// . realpath($conf['savedir']) . " => this git repo will be ignored!"
95+
//);
9396
return null;
9497
}
9598
$repoWorkDir = '';
@@ -99,7 +102,10 @@ private function initRepo($fileOrDirPath="") {
99102
// the repoPath configured.
100103
if (realpath($configuredRepoPath) === realpath($repoPath)) {
101104
$repoWorkDir = $configuredRepoWorkDir;
102-
//dbglog("GitBacked - INFO: repoPath=" . $repoPath . " is the one explicitly configured => we use the configured workDir=[" . $repoWorkDir . "]");
105+
//dbglog("GitBacked - INFO: repoPath=" . $repoPath
106+
// . " is the one explicitly configured => we use the configured workDir=["
107+
// . $repoWorkDir . "]"
108+
//);
103109
}
104110
}
105111
//dbglog("GitBacked - AUTO_DETERMINE_USE_CASE: repoPath=" . $repoPath);
@@ -117,7 +123,7 @@ private function initRepo($fileOrDirPath="") {
117123
}
118124

119125
Git::setBin(empty($repoWorkDir) ? Git::getBin()
120-
: Git::getBin().' --work-tree ' . escapeshellarg($repoWorkDir));
126+
: Git::getBin() . ' --work-tree ' . escapeshellarg($repoWorkDir));
121127

122128
$params = str_replace(
123129
['%mail%', '%user%'],

classes/GitRepo.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public function setRepoPath($repo_path, $create_new = false, $_init = true)
142142
}
143143
} elseif (!$_init) {
144144
// If we do not have to init the repo, we just reflect that there is no repo path yet.
145-
// This may be the case for auto determining repos, if there is no repo related to the current resource going to be commited.
145+
// This may be the case for auto determining repos,
146+
// if there is no repo related to the current resource going to be commited.
146147
$this->repo_path = '';
147148
} else {
148149
throw new \Exception($this->handleRepoPathError(
@@ -178,7 +179,7 @@ public function setRepoPath($repo_path, $create_new = false, $_init = true)
178179

179180
/**
180181
* Get the path to the repo directory
181-
*
182+
*
182183
* @access public
183184
* @return string
184185
*/
@@ -224,7 +225,8 @@ public function testGit()
224225
* Determine closest parent git repository for a given path as absolute PHP realpath().
225226
*
226227
* @access public
227-
* @return string the next parent git repo root dir as absolute PHP realpath() or empty string, if no parent repo found
228+
* @return string the next parent git repo root dir as absolute PHP realpath()
229+
* or empty string, if no parent repo found.
228230
*/
229231
public function absoluteGitDir($path)
230232
{
@@ -273,7 +275,10 @@ protected function runCommand($command)
273275
{
274276
//dbglog("Git->run_command: repo_path=[" . $this->repo_path . "])");
275277
if (empty($this->repo_path)) {
276-
throw new Exception($this->handleRepoPathError($this->repo_path, "Failure on GitRepo->runCommand(): Git command must not be run for an empty repo path"));
278+
throw new \Exception($this->handleRepoPathError(
279+
$this->repo_path,
280+
"Failure on GitRepo->runCommand(): Git command must not be run for an empty repo path"
281+
));
277282
}
278283
//dbglog("Git->runCommand(command=[".$command."])");
279284
$descriptorspec = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']];

0 commit comments

Comments
 (0)