Skip to content

Commit

Permalink
set diff builder because from sebastian/diff version 5 is builder no …
Browse files Browse the repository at this point in the history
…longer optional
  • Loading branch information
sspooky13 committed Mar 6, 2024
1 parent 2c73d13 commit 37bb2e4
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/Model/YamlAlphabetical/YamlAlphabeticalChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlAlphabetical;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use Symfony\Component\Yaml\Yaml;
use YamlStandards\Model\AbstractChecker;
use YamlStandards\Model\Config\StandardParametersData;
Expand All @@ -31,7 +32,7 @@ public function check(string $pathToFile, StandardParametersData $standardParame
return new Result($pathToFile, Result::RESULT_CODE_OK);
}

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($fileContent, $rightFileContent);

return new Result($pathToFile, Result::RESULT_CODE_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlAlphabetical/YamlAlphabeticalFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlAlphabetical;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use Symfony\Component\Yaml\Yaml;
use YamlStandards\Model\AbstractFixer;
use YamlStandards\Model\Config\StandardParametersData;
Expand Down Expand Up @@ -33,7 +34,7 @@ public function fix(string $pathToFile, string $pathToDumpFixedFile, StandardPar

file_put_contents($pathToDumpFixedFile, $rightFileContent);

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($fileContent, $rightFileContent);

return new Result($pathToFile, Result::RESULT_CODE_FIXED_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlEmptyLineAtEnd/YamlEmptyLineAtEndChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlEmptyLineAtEnd;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractChecker;
use YamlStandards\Model\Config\StandardParametersData;
use YamlStandards\Result\Result;
Expand All @@ -30,7 +31,7 @@ public function check(string $pathToFile, StandardParametersData $standardParame
return new Result($pathToFile, Result::RESULT_CODE_OK);
}

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($yamlContent, $correctYamlContent);

return new Result($pathToFile, Result::RESULT_CODE_INVALID_FILE_SYNTAX, $diffBetweenStrings, true);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlEmptyLineAtEnd/YamlEmptyLineAtEndFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlEmptyLineAtEnd;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractFixer;
use YamlStandards\Model\Config\StandardParametersData;
use YamlStandards\Result\Result;
Expand Down Expand Up @@ -32,7 +33,7 @@ public function fix(string $pathToFile, string $pathToDumpFixedFile, StandardPar

file_put_contents($pathToDumpFixedFile, $correctYamlContent);

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($yamlContent, $correctYamlContent);

return new Result($pathToFile, Result::RESULT_CODE_FIXED_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlIndent/YamlIndentChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlIndent;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractChecker;
use YamlStandards\Model\Config\StandardParametersData;
use YamlStandards\Result\Result;
Expand Down Expand Up @@ -35,7 +36,7 @@ public function check(string $pathToFile, StandardParametersData $standardParame
return new Result($pathToFile, Result::RESULT_CODE_OK);
}

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($fileContent, $rightFileContent);

return new Result($pathToFile, Result::RESULT_CODE_INVALID_FILE_SYNTAX, $diffBetweenStrings, true);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlIndent/YamlIndentFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlIndent;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractFixer;
use YamlStandards\Model\Config\StandardParametersData;
use YamlStandards\Result\Result;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function fix(string $pathToFile, string $pathToDumpFixedFile, StandardPar

file_put_contents($pathToDumpFixedFile, $rightFileContent);

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($fileContent, $rightFileContent);

return new Result($pathToFile, Result::RESULT_CODE_FIXED_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlInline/YamlInlineChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlInline;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use Symfony\Component\Yaml\Yaml;
use YamlStandards\Model\AbstractChecker;
use YamlStandards\Model\Component\YamlService;
Expand Down Expand Up @@ -41,7 +42,7 @@ public function check(string $pathToFile, StandardParametersData $standardParame
return new Result($pathToFile, Result::RESULT_CODE_OK);
}

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($filteredYamlFile, $yamlStringData);

return new Result($pathToFile, Result::RESULT_CODE_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlServiceAliasing/YamlServiceAliasingChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlServiceAliasing;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractChecker;
use YamlStandards\Model\Component\YamlService;
use YamlStandards\Model\Config\StandardParametersData;
Expand Down Expand Up @@ -35,7 +36,7 @@ public function check(string $pathToFile, StandardParametersData $standardParame
return new Result($pathToFile, Result::RESULT_CODE_OK);
}

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($yamlContent, $correctYamlContent);

return new Result($pathToFile, Result::RESULT_CODE_INVALID_FILE_SYNTAX, $diffBetweenStrings, true);
Expand Down
3 changes: 2 additions & 1 deletion src/Model/YamlServiceAliasing/YamlServiceAliasingFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlServiceAliasing;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractFixer;
use YamlStandards\Model\Component\YamlService;
use YamlStandards\Model\Config\StandardParametersData;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function fix(string $pathToFile, string $pathToDumpFixedFile, StandardPar

file_put_contents($pathToDumpFixedFile, $correctYamlContent);

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($yamlContent, $correctYamlContent);

return new Result($pathToFile, Result::RESULT_CODE_FIXED_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlSpacesBetweenGroups;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractChecker;
use YamlStandards\Model\Component\YamlService;
use YamlStandards\Model\Config\StandardParametersData;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function check(string $pathToFile, StandardParametersData $standardParame
return new Result($pathToFile, Result::RESULT_CODE_OK);
}

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($yamlContent, $correctYamlContent);

return new Result($pathToFile, Result::RESULT_CODE_INVALID_FILE_SYNTAX, $diffBetweenStrings, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace YamlStandards\Model\YamlSpacesBetweenGroups;

use SebastianBergmann\Diff\Differ;
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
use YamlStandards\Model\AbstractFixer;
use YamlStandards\Model\Component\YamlService;
use YamlStandards\Model\Config\StandardParametersData;
Expand Down Expand Up @@ -39,7 +40,7 @@ public function fix(string $pathToFile, string $pathToDumpFixedFile, StandardPar

file_put_contents($pathToDumpFixedFile, $correctYamlContent);

$differ = new Differ();
$differ = new Differ(new UnifiedDiffOutputBuilder());
$diffBetweenStrings = $differ->diff($yamlContent, $correctYamlContent);

return new Result($pathToFile, Result::RESULT_CODE_FIXED_INVALID_FILE_SYNTAX, $diffBetweenStrings);
Expand Down

0 comments on commit 37bb2e4

Please sign in to comment.