Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/Approvals.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class Approvals
{
public static function verifyString($received, Reporter $reporter = null)
public static function verifyString($received, ?Reporter $reporter = null)
{
self::verifyStringWithFileExtension($received, 'txt', $reporter);
}

public static function verifyStringWithFileExtension($received, $extensionWithoutDot, Reporter $reporter = null)
public static function verifyStringWithFileExtension($received, $extensionWithoutDot, ?Reporter $reporter = null)
{
self::verify(new TextWriter($received, $extensionWithoutDot), new PHPUnitNamer(), $reporter);
}
Expand All @@ -28,7 +28,7 @@ public static function getReporter()
/**
* Perform the approval test by comparing the contents of one file to another
*/
public static function verify(Writer $writer, Namer $namer, Reporter $reporter = null)
public static function verify(Writer $writer, Namer $namer, ?Reporter $reporter = null)
{
self::satisfyPHPUnitRequirementForAssert();
if ($reporter == null) {
Expand Down
18 changes: 9 additions & 9 deletions src/CombinationApprovals.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,47 @@ class CombinationApprovals
{
static $empty = ["CombinationApprovalsEmpty"];

public static function verifyAllCombinations1($param, array $values, Reporter $reporter = null)
public static function verifyAllCombinations1($param, array $values, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations2($param, array $values1, array $values2, Reporter $reporter = null)
public static function verifyAllCombinations2($param, array $values1, array $values2, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations3($param, array $values1, array $values2, array $values3, Reporter $reporter = null)
public static function verifyAllCombinations3($param, array $values1, array $values2, array $values3, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, $values3, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations4($param, array $values1, array $values2, array $values3, array $values4, Reporter $reporter = null)
public static function verifyAllCombinations4($param, array $values1, array $values2, array $values3, array $values4, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, $values3, $values4, self::$empty, self::$empty, self::$empty, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations5($param, array $values1, array $values2, array $values3, array $values4, array $values5, Reporter $reporter = null)
public static function verifyAllCombinations5($param, array $values1, array $values2, array $values3, array $values4, array $values5, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, $values3, $values4, $values5, self::$empty, self::$empty, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations6($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, Reporter $reporter = null)
public static function verifyAllCombinations6($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, $values3, $values4, $values5, $values6, self::$empty, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations7($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, array $values7, Reporter $reporter = null)
public static function verifyAllCombinations7($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, array $values7, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, $values3, $values4, $values5, $values6, $values7, self::$empty, self::$empty, $reporter);
}

public static function verifyAllCombinations8($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, array $values7, array $values8, Reporter $reporter = null)
public static function verifyAllCombinations8($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, array $values7, array $values8, ?Reporter $reporter = null)
{
self::verifyAllCombinations9($param, $values1, $values2, $values3, $values4, $values5, $values6, $values7, $values8, self::$empty, $reporter);
}

public static function verifyAllCombinations9($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, array $values7, array $values8, array $values9, Reporter $reporter = null)
public static function verifyAllCombinations9($param, array $values1, array $values2, array $values3, array $values4, array $values5, array $values6, array $values7, array $values8, array $values9, ?Reporter $reporter = null)
{
$output = '';
foreach ($values1 as $i1) {
Expand Down
4 changes: 2 additions & 2 deletions src/Reporters/DiffInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DiffInfo
public $parameters;
public $fileExtensions;

public function __construct(string $diffProgram, array $fileExtensions, string $parameters = null)
public function __construct(string $diffProgram, array $fileExtensions, ?string $parameters = null)
{
$this->diffProgram = self::resolveWindowsPath($diffProgram);
$this->parameters = $parameters ?? GenericDiffReporter::$STANDARD_ARGUMENTS;
Expand All @@ -18,7 +18,7 @@ public function __construct(string $diffProgram, array $fileExtensions, string $
private static function resolveWindowsPath(string $diffProgram): string
{
$tag = "{ProgramFiles}";

$startsWith = substr($diffProgram, 0, strlen($tag)) === $tag;
if ($startsWith) {
$diffProgram = self::getPathInProgramFilesX86(substr($diffProgram, strlen($tag)));
Expand Down