Skip to content

Commit

Permalink
change version number, add change log, change logic of returning cons…
Browse files Browse the repository at this point in the history
…tants
  • Loading branch information
aleksandr committed Oct 2, 2024
1 parent 6bc786e commit 99dcf06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 27 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Release Notes
## [0.9.1 (Oct 2, 2024)]

- Fixed the use of export options for date formatting

## [0.9.0 (Aug 18, 2022)]

Expand Down
2 changes: 1 addition & 1 deletion controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Controller extends Package
/**
* @var string package version
*/
protected $pkgVersion = '0.9.0';
protected $pkgVersion = '0.9.1';

/**
* {@inheritdoc}
Expand Down
32 changes: 6 additions & 26 deletions src/User/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,32 +231,12 @@ protected function getRecords(): \Generator

protected function getFormatByName(string $formatName = 'ATOM')
{
switch ($formatName) {
case 'COOKIE':
return DATE_COOKIE;
case 'RFC822':
return DATE_RFC822;
case 'RFC850':
return DATE_RFC850;
case 'RFC1036':
return DATE_RFC1036;
case 'RFC1123':
return DATE_RFC1123;
case 'RFC7231':
return DATE_RFC7231;
case 'RFC2822':
return DATE_RFC2822;
case 'RFC3339':
return DATE_RFC3339;
case 'RFC3339_EXTENDED':
return DATE_RFC3339_EXTENDED;
case 'RSS':
return DATE_RSS;
case 'W3C':
return DATE_W3C;
case 'ATOM':
default:
return DATE_ATOM;
$datetime_format_constant = sprintf('DATE_%s', $formatName);

if (defined($datetime_format_constant)) {
return constant($datetime_format_constant);
}

return DATE_ATOM;
}
}

0 comments on commit 99dcf06

Please sign in to comment.