Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,5 @@
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
234 changes: 0 additions & 234 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -78,162 +78,6 @@ parameters:
count: 1
path: src/Gitonomy/Git/Blame/Line.php

-
message: '#^Method Gitonomy\\Git\\Blob\:\:getContent\(\) should return string but returns string\|null\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Blob.php

-
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
identifier: foreach.nonIterable
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:__construct\(\) has parameter \$data with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getAuthorDate\(\) should return DateTime but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getAuthorEmail\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getAuthorName\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getBodyMessage\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getCommitterDate\(\) should return DateTime but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getCommitterEmail\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getCommitterName\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getMessage\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getParentHashes\(\) should return array\<string\> but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getShortHash\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getShortMessage\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getSubjectMessage\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getTree\(\) should return Gitonomy\\Git\\Tree but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:getTreeHash\(\) should return string but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Commit\:\:setData\(\) has parameter \$data with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$hash of method Gitonomy\\Git\\Repository\:\:getCommit\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$hash of method Gitonomy\\Git\\Repository\:\:getTree\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$haystack of static method Gitonomy\\Git\\Util\\StringHelper\:\:strpos\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$rawDiff of static method Gitonomy\\Git\\Diff\\Diff\:\:parse\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$string of function trim expects string, string\|null given\.$#'
identifier: argument.type
count: 2
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$string of static method Gitonomy\\Git\\Util\\StringHelper\:\:strlen\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#1 \$string of static method Gitonomy\\Git\\Util\\StringHelper\:\:substr\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Commit.php

-
message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#'
identifier: argument.type
count: 2
path: src/Gitonomy/Git/Commit.php

-
message: '#^Method Gitonomy\\Git\\Diff\\Diff\:\:fromArray\(\) has parameter \$array with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -336,72 +180,12 @@ parameters:
count: 1
path: src/Gitonomy/Git/Parser/ParserBase.php

-
message: '#^Parameter \#1 \$string of function trim expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/PushReference.php

-
message: '#^Parameter \#1 \$string of function trim expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Reference.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Branch\:\:isLocal\(\) should return bool but returns bool\|null\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Branch.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getBodyMessage\(\) should return string\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getGPGSignature\(\) should return string\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getMessage\(\) should return string\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getSubjectMessage\(\) should return string\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getTaggerDate\(\) should return DateTime\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getTaggerEmail\(\) should return string\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Method Gitonomy\\Git\\Reference\\Tag\:\:getTaggerName\(\) should return string\|false but returns mixed\.$#'
identifier: return.type
count: 1
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#'
identifier: argument.type
count: 2
path: src/Gitonomy/Git/Reference/Tag.php

-
message: '#^Class Gitonomy\\Git\\ReferenceBag implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#'
identifier: missingType.generics
Expand Down Expand Up @@ -468,12 +252,6 @@ parameters:
count: 1
path: src/Gitonomy/Git/Repository.php

-
message: '#^Parameter \#1 \$rawDiff of static method Gitonomy\\Git\\Diff\\Diff\:\:parse\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/Repository.php

-
message: '#^Parameter \#1 \$string of function trim expects string, string\|false given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -521,15 +299,3 @@ parameters:
identifier: missingType.iterableValue
count: 1
path: src/Gitonomy/Git/WorkingCopy.php

-
message: '#^Parameter \#1 \$rawDiff of static method Gitonomy\\Git\\Diff\\Diff\:\:parse\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 2
path: src/Gitonomy/Git/WorkingCopy.php

-
message: '#^Parameter \#2 \$string of function explode expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Gitonomy/Git/WorkingCopy.php
8 changes: 4 additions & 4 deletions src/Gitonomy/Git/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function init(string $path, bool $bare = true, array $options = []

$process->run();

if (!$process->isSuccessFul()) {
if (!$process->isSuccessful()) {
throw new RuntimeException(\sprintf("Error on repository initialization, command wasn't successful (%s). Error output:\n%s", $process->getCommandLine(), $process->getErrorOutput()));
}

Expand All @@ -62,7 +62,7 @@ public static function isValidRepository(string $url, array $options = []): bool

$process->run();

return $process->isSuccessFul();
return $process->isSuccessful();
}

/**
Expand All @@ -86,7 +86,7 @@ public static function isValidRepositoryAndBranch(string $url, string $branchNam
$process->run();
$processOutput = $process->getOutput();

return $process->isSuccessFul() && str_contains($processOutput, $branchName);
return $process->isSuccessful() && str_contains($processOutput, $branchName);
}

/**
Expand Down Expand Up @@ -149,7 +149,7 @@ public static function cloneRepository(string $path, string $url, array $args =

$process->run();

if (!$process->isSuccessFul()) {
if (!$process->isSuccessful()) {
throw new RuntimeException(\sprintf('Error while initializing repository: %s', $process->getErrorOutput()));
}

Expand Down
9 changes: 8 additions & 1 deletion src/Gitonomy/Git/Blob.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace Gitonomy\Git;

use Gitonomy\Git\Exception\ReferenceNotFoundException;

/**
* Representation of a Blob commit.
*
Expand Down Expand Up @@ -53,7 +55,12 @@ public function getHash(): string
public function getContent(): string
{
if (null === $this->content) {
$this->content = $this->repository->run('cat-file', ['-p', $this->hash]);
$content = $this->repository->run('cat-file', ['-p', $this->hash]);
if (null === $content) {
throw new ReferenceNotFoundException($this->hash);
}

$this->content = $content;
}

return $this->content;
Expand Down
Loading
Loading