Skip to content

Commit 9d71166

Browse files
Merge branch '11.5' into 12.0
2 parents ffa8053 + 67a48da commit 9d71166

File tree

5 files changed

+133
-133
lines changed

5 files changed

+133
-133
lines changed

src/Framework/Constraint/String/StringContains.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ public function toString(): string
5353
return sprintf(
5454
'contains "%s" [%s](length: %s)',
5555
$needle,
56-
$this->getDetectedEncoding($needle),
56+
$this->detectedEncoding($needle),
5757
strlen($needle),
5858
);
5959
}
6060

6161
public function failureDescription(mixed $other): string
6262
{
6363
$stringifiedHaystack = Exporter::export($other);
64-
$haystackEncoding = $this->getDetectedEncoding($other);
65-
$haystackLength = $this->getHaystackLength($other);
64+
$haystackEncoding = $this->detectedEncoding($other);
65+
$haystackLength = $this->haystackLength($other);
6666

6767
$haystackInformation = sprintf(
6868
'%s [%s](length: %s) ',
@@ -115,7 +115,7 @@ protected function matches(mixed $other): bool
115115
return str_contains($haystack, $this->needle);
116116
}
117117

118-
private function getDetectedEncoding(mixed $other): string
118+
private function detectedEncoding(mixed $other): string
119119
{
120120
if ($this->ignoreCase) {
121121
return 'Encoding ignored';
@@ -134,7 +134,7 @@ private function getDetectedEncoding(mixed $other): string
134134
return $detectedEncoding;
135135
}
136136

137-
private function getHaystackLength(mixed $haystack): int
137+
private function haystackLength(mixed $haystack): int
138138
{
139139
if (!is_string($haystack)) {
140140
return 0;

src/Framework/MockObject/Generator/Generator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testDouble(string $type, bool $mockObject, ?array $methods = [],
118118
$callOriginalClone,
119119
);
120120

121-
$object = $this->getObject(
121+
$object = $this->instantiate(
122122
$mock,
123123
$callOriginalConstructor,
124124
$arguments,
@@ -298,7 +298,7 @@ private function userDefinedInterfaceMethods(string $interfaceName): array
298298
* @throws ReflectionException
299299
* @throws RuntimeException
300300
*/
301-
private function getObject(DoubledClass $mockClass, bool $callOriginalConstructor = false, array $arguments = [], bool $returnValueGeneration = true): object
301+
private function instantiate(DoubledClass $mockClass, bool $callOriginalConstructor = false, array $arguments = [], bool $returnValueGeneration = true): object
302302
{
303303
$className = $mockClass->generate();
304304

src/Framework/TestCase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,14 +1481,14 @@ private function stopOutputBuffering(): bool
14811481

14821482
private function snapshotGlobalErrorExceptionHandlers(): void
14831483
{
1484-
$this->backupGlobalErrorHandlers = $this->getActiveErrorHandlers();
1485-
$this->backupGlobalExceptionHandlers = $this->getActiveExceptionHandlers();
1484+
$this->backupGlobalErrorHandlers = $this->activeErrorHandlers();
1485+
$this->backupGlobalExceptionHandlers = $this->activeExceptionHandlers();
14861486
}
14871487

14881488
private function restoreGlobalErrorExceptionHandlers(): void
14891489
{
1490-
$activeErrorHandlers = $this->getActiveErrorHandlers();
1491-
$activeExceptionHandlers = $this->getActiveExceptionHandlers();
1490+
$activeErrorHandlers = $this->activeErrorHandlers();
1491+
$activeExceptionHandlers = $this->activeExceptionHandlers();
14921492

14931493
$message = null;
14941494

@@ -1551,7 +1551,7 @@ private function restoreGlobalErrorExceptionHandlers(): void
15511551
/**
15521552
* @return list<callable>
15531553
*/
1554-
private function getActiveErrorHandlers(): array
1554+
private function activeErrorHandlers(): array
15551555
{
15561556
$activeErrorHandlers = [];
15571557

@@ -1597,7 +1597,7 @@ private function getActiveErrorHandlers(): array
15971597
/**
15981598
* @return list<callable>
15991599
*/
1600-
private function getActiveExceptionHandlers(): array
1600+
private function activeExceptionHandlers(): array
16011601
{
16021602
$res = [];
16031603

src/Runner/PHPT/PhptTestCase.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function run(): void
230230
$diff = $e->getMessage();
231231
}
232232

233-
$hint = $this->getLocationHintFromDiff($diff, $sections);
233+
$hint = $this->locationHintFromDiff($diff, $sections);
234234
$trace = array_merge($hint, debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));
235235
$failure = new PhptAssertionFailedError(
236236
$e->getMessage(),
@@ -697,7 +697,7 @@ private function render(string $code): string
697697
/**
698698
* @return array{coverage: non-empty-string, job: non-empty-string}
699699
*/
700-
private function getCoverageFiles(): array
700+
private function coverageFiles(): array
701701
{
702702
$baseDir = dirname(realpath($this->filename)) . DIRECTORY_SEPARATOR;
703703
$basename = basename($this->filename, 'phpt');
@@ -717,7 +717,7 @@ private function getCoverageFiles(): array
717717
*/
718718
private function renderForCoverage(string &$job, bool $pathCoverage, ?string $codeCoverageCacheDirectory): void
719719
{
720-
$files = $this->getCoverageFiles();
720+
$files = $this->coverageFiles();
721721

722722
$template = new Template(
723723
__DIR__ . '/templates/phpt.tpl',
@@ -771,7 +771,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co
771771
private function cleanupForCoverage(): RawCodeCoverageData
772772
{
773773
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
774-
$files = $this->getCoverageFiles();
774+
$files = $this->coverageFiles();
775775

776776
$buffer = false;
777777

@@ -823,7 +823,7 @@ private function stringifyIni(array $ini): array
823823
*
824824
* @return non-empty-list<array{file: non-empty-string, line: int}>
825825
*/
826-
private function getLocationHintFromDiff(string $message, array $sections): array
826+
private function locationHintFromDiff(string $message, array $sections): array
827827
{
828828
$needle = '';
829829
$previousLine = '';
@@ -842,13 +842,13 @@ private function getLocationHintFromDiff(string $message, array $sections): arra
842842

843843
if ($block === 'diff') {
844844
if (str_starts_with($line, '+')) {
845-
$needle = $this->getCleanDiffLine($previousLine);
845+
$needle = $this->cleanDiffLine($previousLine);
846846

847847
break;
848848
}
849849

850850
if (str_starts_with($line, '-')) {
851-
$needle = $this->getCleanDiffLine($line);
851+
$needle = $this->cleanDiffLine($line);
852852

853853
break;
854854
}
@@ -859,10 +859,10 @@ private function getLocationHintFromDiff(string $message, array $sections): arra
859859
}
860860
}
861861

862-
return $this->getLocationHint($needle, $sections);
862+
return $this->locationHint($needle, $sections);
863863
}
864864

865-
private function getCleanDiffLine(string $line): string
865+
private function cleanDiffLine(string $line): string
866866
{
867867
if (preg_match('/^[\-+]([\'\"]?)(.*)\1$/', $line, $matches)) {
868868
$line = $matches[2];
@@ -876,7 +876,7 @@ private function getCleanDiffLine(string $line): string
876876
*
877877
* @return non-empty-list<array{file: non-empty-string, line: int}>
878878
*/
879-
private function getLocationHint(string $needle, array $sections): array
879+
private function locationHint(string $needle, array $sections): array
880880
{
881881
$needle = trim($needle);
882882

0 commit comments

Comments
 (0)