Skip to content

Commit

Permalink
Add line break before even more return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Mar 21, 2020
1 parent 603a336 commit a37fb18
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/GitElephant/Command/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public function normalizeOptions(
}
}
}

return $normalizedOptions;
}

Expand Down Expand Up @@ -353,6 +353,7 @@ private function getCLICommandArguments(): string
if (count($combinedArguments) > 0) {
$command .= ' ' . implode(' ', array_map('escapeshellarg', $combinedArguments));
}

return $command;
}

Expand Down Expand Up @@ -385,6 +386,7 @@ private function getCLIConfigs(): string
);
}
}

return $command;
}

Expand All @@ -401,6 +403,7 @@ private function getCLIGlobalOptions(): string
$command .= sprintf(' %s=%s', escapeshellarg($name), escapeshellarg($value));
}
}

return $command;
}

Expand All @@ -415,6 +418,7 @@ private function getCLIPath(): string
if (!is_null($this->path)) {
$command .= sprintf(' -- %s', escapeshellarg($this->path));
}

return $command;
}

Expand Down Expand Up @@ -447,6 +451,7 @@ private function getCLISubjects(): string
$command .= escapeshellarg($this->commandSubject2);
}
}

return $command;
}

Expand All @@ -458,6 +463,7 @@ public function getBinaryVersion(): string
if (is_null($this->binaryVersion)) {
$this->binaryVersion = $this->repo->getCaller()->getBinaryVersion();
}

return $this->binaryVersion;
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/BranchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function create(string $name, string $startPoint = null): string
if (null !== $startPoint) {
$this->addCommandSubject2($startPoint);
}

return $this->getCommand();
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/Caller/AbstractCaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function getOutputLines(bool $stripBlankLines = false): array

return $output;
}

return $this->outputLines;
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/Caller/Caller.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public function getOutputLines(bool $stripBlankLines = false): array

return $output;
}

return $this->outputLines;
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/CloneCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function cloneUrl(
if ($recursive) {
$this->addCommandArgument('--recursive');
}

return $this->getCommand();
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/FetchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function fetch($remote = null, $branch = null, array $options = []): stri
if (!is_null($branch)) {
$this->addCommandSubject2($branch);
}

return $this->getCommand();
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/LogCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function showObjectLog(NodeObject $obj, $branch = null, int $limit = null
$subject .= (string) $branch;
}
}

return $this->showLog($subject, $obj->getFullPath(), $limit, $offset);
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/MainCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function status($porcelain = false): string
} else {
$this->addConfigs(['color.status' => 'false']);
}

return $this->getCommand();
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/PullCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function pull($remote = null, $branch = null, $rebase = false): string
if (!is_null($branch)) {
$this->addCommandSubject2($branch);
}

return $this->getCommand();
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/PushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function push($remote = 'origin', $branch = 'master', string $args = null
if (!is_null($args)) {
$this->addCommandArgument($args);
}

return $this->getCommand();
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/Remote/AddSubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public function prepare($name, $url, $options = []): self
foreach ($options as $option) {
$this->addCommandArgument($option);
}

return $this;
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/Remote/ShowSubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function prepare($name = null, $queryRemotes = true): self
if (!$queryRemotes) {
$this->addCommandArgument('-n');
}

return $this;
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/RemoteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function remote(SubCommandCommand $subcommand = null, array $options = []
if ($subcommand !== null) {
$this->addCommandSubject($subcommand);
}

return $this->getCommand();
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/ResetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function reset($arg = null, array $options = []): string
if ($arg != null) {
$this->addCommandSubject2($arg);
}

return $this->getCommand();
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Command/RevParseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function revParse($arg = null, array $options = []): string
if (!is_null($arg)) {
$this->addCommandSubject2($arg);
}

return $this->getCommand();
}
}
5 changes: 5 additions & 0 deletions src/GitElephant/Command/StashCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function save($message = null, $includeUntracked = false, $keepIndex = fa
if ($keepIndex) {
$this->addCommandArgument('--keep-index');
}

return $this->getCommand();
}

Expand All @@ -82,6 +83,7 @@ public function listStashes(array $options = null): string
if (null !== $options) {
$this->addCommandSubject($options);
}

return $this->getCommand();
}

Expand Down Expand Up @@ -136,6 +138,7 @@ public function apply($stash, $index = false): string
if ($index) {
$this->addCommandArgument('--index');
}

return $this->getCommand();
}

Expand All @@ -156,6 +159,7 @@ public function pop($stash, $index = false): string
if ($index) {
$this->addCommandArgument('--index');
}

return $this->getCommand();
}

Expand Down Expand Up @@ -211,6 +215,7 @@ private function normalizeStashName($stash): string
if (0 !== strpos($stash, 'stash@{')) {
$stash = 'stash@{' . $stash . '}';
}

return $stash;
}
}
3 changes: 3 additions & 0 deletions src/GitElephant/Command/SubmoduleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function add($gitUrl, $path = null): string
if (null !== $path) {
$this->addCommandSubject($path);
}

return $this->getCommand();
}

Expand All @@ -82,6 +83,7 @@ public function init($path = null): string
if (null !== $path) {
$this->addPath($path);
}

return $this->getCommand();
}

Expand Down Expand Up @@ -140,6 +142,7 @@ public function update($recursive = false, $init = false, $force = false, $path
if ($path !== null) {
$this->addPath($path);
}

return $this->getCommand();
}
}
1 change: 1 addition & 0 deletions src/GitElephant/Command/TagCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function create(string $name, $startPoint = null, $message = null): strin
} else {
$this->addCommandSubject($name);
}

return $this->getCommand();
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Objects/Branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public static function getMatches(string $branchString): array
if (empty($matches)) {
throw new \InvalidArgumentException(sprintf('the branch string is not valid: %s', $branchString));
}

return array_map('trim', $matches);
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Objects/NodeObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public static function createFromOutputLine(Repository $repository, string $outp
$path = substr($fullPath, 0, $pos);
$name = substr($fullPath, $pos + 1);
}

return new static(
$repository,
$slices['permissions'],
Expand Down
6 changes: 6 additions & 0 deletions src/GitElephant/Objects/Remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function __construct(Repository $repository, string $name = null, bool $q
$this->name = trim($name);
$this->createFromCommand($queryRemotes);
}

return $this;
}

Expand Down Expand Up @@ -309,6 +310,7 @@ public function parseRemoteBranches(array $lines): array
$branches[$parts[0]] = ['local_relationship' => $parts[1]];
}
}

return $branches;
}

Expand All @@ -332,6 +334,7 @@ public function parseLocalPullBranches($lines): array
$branches[$parts[0]] = ['merges_with' => $parts[1]];
}
}

return $branches;
}

Expand All @@ -356,6 +359,7 @@ public function parseLocalPushRefs($lines): array
$branches[$parts[0]] = ['pushes_to' => $value[0], 'local_state' => $value[1]];
}
}

return $branches;
}

Expand All @@ -374,6 +378,7 @@ public function parseName($line)
if (!isset($matches[1])) {
return '';
}

return $matches[1];
}

Expand All @@ -392,6 +397,7 @@ public static function getMatches(string $remoteString): array
if (empty($matches)) {
throw new \InvalidArgumentException(sprintf('the remote string is not valid: %s', $remoteString));
}

return array_map('trim', $matches);
}

Expand Down
9 changes: 9 additions & 0 deletions src/GitElephant/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ public function commit(string $message, $stageAll = false, $ref = null, $author
if (!is_null($ref)) {
$this->checkout($currentBranch);
}

return $this;
}

Expand Down Expand Up @@ -476,6 +477,7 @@ function ($v) {
$branches[] = Branch::createFromOutputLine($this, $branchLine);
}
}

return $branches;
}

Expand Down Expand Up @@ -518,6 +520,7 @@ public function getBranch(string $name): ?\GitElephant\Objects\Branch
return $branch;
}
}

return null;
}

Expand Down Expand Up @@ -625,6 +628,7 @@ public function deleteTag($tag): self
} else {
Tag::pick($this, $tag)->delete();
}

return $this;
}

Expand Down Expand Up @@ -723,6 +727,7 @@ public function getTag(string $name): ?\GitElephant\Objects\Tag
return new Tag($this, $name);
}
}

return null;
}

Expand Down Expand Up @@ -775,6 +780,7 @@ public function getBranchOrTag(string $name)
return new Tag($this, $name);
}
}

return null;
}

Expand Down Expand Up @@ -856,6 +862,7 @@ public function getLogRange(
if (preg_match('~^[0]+$~', $refEnd)) {
$refEnd = $refStart;
}

return new LogRange($this, $refStart, $refEnd, $path, $limit, $offset, $firstParent);
}

Expand Down Expand Up @@ -930,6 +937,7 @@ public function getTree($ref = 'HEAD', $path = null): \GitElephant\Objects\Tree

$path = TreeObject::createFromOutputLine($this, $outputLines[0]);
}

return new Tree($this, $ref, $path);
}

Expand Down Expand Up @@ -1028,6 +1036,7 @@ public function getRemotes(bool $queryRemotes = true): array
foreach ($remoteNames as $remoteName) {
$remotes[] = $this->getRemote($remoteName, $queryRemotes);
}

return $remotes;
}

Expand Down
1 change: 1 addition & 0 deletions src/GitElephant/Status/StatusFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public function getDescription(): string
if ($this->description === null) {
$this->calculateDescription();
}

return $this->description;
}

Expand Down
Loading

0 comments on commit a37fb18

Please sign in to comment.