Skip to content

Commit

Permalink
[TASK] Fix code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
a-r-m-i-n committed Jul 19, 2024
1 parent 6df98e4 commit 653e0e1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Application extends SingleCommandApplication

private bool $isVerbose = false;

public function __construct(string $name = 'ec', Scanner $scanner = null)
public function __construct(string $name = 'ec', ?Scanner $scanner = null)
{
TimeTrackingUtility::reset();
TimeTrackingUtility::addStep('Start');
Expand Down Expand Up @@ -358,7 +358,7 @@ private function createProgressBar(SymfonyStyle $io, int $fileCount): ProgressBa
*
* @return array|string[]
*/
private function parseSkippingRules(array $skippingRules = null): array
private function parseSkippingRules(?array $skippingRules = null): array
{
if (!$skippingRules) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion src/EditorConfig/Rules/File/InsertFinalNewLineRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InsertFinalNewLineRule extends Rule
{
private readonly string $newLineFormat;

public function __construct(string $filePath, string $fileContent, string $newLineFormat = null)
public function __construct(string $filePath, string $fileContent, ?string $newLineFormat = null)
{
if (null === $newLineFormat) {
$newLineFormat = LineEndingUtility::detectLineEnding($fileContent, false);
Expand Down
2 changes: 1 addition & 1 deletion src/EditorConfig/Rules/Line/MaxLineLengthRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MaxLineLengthRule extends Rule
{
public function __construct(
string $filePath,
string $fileContent = null,
?string $fileContent = null,
private readonly ?int $maxLineLength = null
) {
parent::__construct($filePath, $fileContent);
Expand Down
2 changes: 1 addition & 1 deletion src/EditorConfig/Rules/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function getDefinitions(): array

public function __construct(
protected string $filePath,
string $fileContent = null
?string $fileContent = null
) {
$this->validate($fileContent ?? (string)file_get_contents($this->filePath));
}
Expand Down
6 changes: 3 additions & 3 deletions src/EditorConfig/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Scanner
* @param string[] $skippingRules
*/
public function __construct(
EditorConfig $editorConfig = null,
Validator $validator = null,
?EditorConfig $editorConfig = null,
?Validator $validator = null,
private ?string $rootPath = null,
private array $skippingRules = []
) {
Expand Down Expand Up @@ -85,7 +85,7 @@ public function getUnavailableFiles(): array
*
* @return array|FileResult[]
*/
public function scan(Finder $finderInstance, bool $strict = false, callable $tickCallback = null, bool $collectBinaryFiles = false): array
public function scan(Finder $finderInstance, bool $strict = false, ?callable $tickCallback = null, bool $collectBinaryFiles = false): array
{
$results = [];
foreach ($finderInstance as $file) {
Expand Down
2 changes: 1 addition & 1 deletion src/EditorConfig/Utility/FinderUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FinderUtility
/**
* Creates new Symfony Finder instance based on given config.
*/
public static function createByFinderOptions(array $finderOptions, string $gitOnly = null): Finder
public static function createByFinderOptions(array $finderOptions, ?string $gitOnly = null): Finder
{
if (!empty($gitOnly)) {
return self::buildGitOnlyFinder($finderOptions['path'], $gitOnly);
Expand Down

0 comments on commit 653e0e1

Please sign in to comment.