Skip to content

Commit

Permalink
use php-cs-fixer 2.0 final
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Feb 5, 2017
1 parent 1a7e579 commit dd3ad68
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions .php_cs → .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => false,
'blank_line_before_return' => false,
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'short_array_syntax' => true,
'phpdoc_order' => true,
])
->finder($finder)
->setFinder($finder)
;
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cache:

install:
- phpenv config-rm xdebug.ini || return 0
- travis_retry composer global require friendsofphp/php-cs-fixer:^2.0@dev
- travis_retry composer global require friendsofphp/php-cs-fixer
- travis_retry composer update

script:
Expand Down
10 changes: 5 additions & 5 deletions src/AbstractDateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ abstract class AbstractDateTime extends \DateTimeImmutable implements DateTimeIn

private static $defaultHolidays;

public function __toString(): string
{
return $this->formatIso();
}

/**
* @param \DateTimeInterface $dateTime
*
Expand Down Expand Up @@ -90,11 +95,6 @@ public static function createFromUnknown($dateTime): self
return new $class($dateTime);
}

public function __toString(): string
{
return $this->formatIso();
}

public function formatLocalized(string $format): string
{
return strftime($format, $this->getTimestamp());
Expand Down

0 comments on commit dd3ad68

Please sign in to comment.