Skip to content

Commit

Permalink
Updated php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshomoh committed Jun 23, 2021
1 parent a8300d5 commit 34afb02
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,4 @@ The project run's automatic checks to make sure that the Symfony code standards
So, before pushing or making any pull request run the below command:

* `composer test`: For running test
* `composer lint`: For running php-cs-fixer to check that the code meet the set standard
* `composer fixlint`: For running php-cs-fixer to fix linting errors
4 changes: 2 additions & 2 deletions src/Converter/JsonConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class JsonConverter implements ConverterHandlerInterface
{
const FILE_EXTENSION = 'json';
public const FILE_EXTENSION = 'json';

/**
* The converted data.
Expand Down Expand Up @@ -37,6 +37,6 @@ public function convert(array $data): ConverterHandlerInterface

public function write(string $filename): bool
{
return (file_put_contents($filename, $this->data)) ? true : false;
return (bool) file_put_contents($filename, $this->data);
}
}
8 changes: 4 additions & 4 deletions src/Converter/XmlConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class XmlConverter implements ConverterHandlerInterface
{
const FILE_EXTENSION = 'xml';
const DEFAULT_ROOT_ELEMENT = 'data';
const DEFAULT_RECORD_ELEMENT = 'item';
public const FILE_EXTENSION = 'xml';
public const DEFAULT_ROOT_ELEMENT = 'data';
public const DEFAULT_RECORD_ELEMENT = 'item';

/**
* XML node root element.
Expand Down Expand Up @@ -79,6 +79,6 @@ public function write(string $filename): bool

$dom->appendChild($domXml);

return ($dom->save($filename)) ? true : false;
return (bool) $dom->save($filename);
}
}
2 changes: 1 addition & 1 deletion src/Rules/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Url implements ValidationRuleInterface
{
const PATTERN = '~^
public const PATTERN = '~^
(%s):// # protocol
(([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth
(
Expand Down
10 changes: 5 additions & 5 deletions src/Validator/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class Validator
{
use FormatsMessages;

const FILE_EXTENSION = '.csv';
const ERROR_MESSAGE = 'Validation fails.';
const NO_ERROR_MESSAGE = 'File is valid.';
const INVALID_FILE_PATH_ERROR = 'Supplied file is not accessible.';
const SUCCESS_MESSAGE = 'CSV is valid.';
public const FILE_EXTENSION = '.csv';
public const ERROR_MESSAGE = 'Validation fails.';
public const NO_ERROR_MESSAGE = 'File is valid.';
public const INVALID_FILE_PATH_ERROR = 'Supplied file is not accessible.';
public const SUCCESS_MESSAGE = 'CSV is valid.';

/**
* The message bag instance.
Expand Down

0 comments on commit 34afb02

Please sign in to comment.