-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8a8454
commit 8c62154
Showing
3 changed files
with
31 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
<?php | ||
<?php declare(strict_types=1); | ||
namespace Imbo\Helpers; | ||
|
||
use DateTime; | ||
use DateTimeZone; | ||
|
||
/** | ||
* Date formatter helper class | ||
*/ | ||
class DateFormatter { | ||
class DateFormatter | ||
{ | ||
/** | ||
* Get a formatted date | ||
* | ||
* @param DateTime $date An instance of DateTime | ||
* @return string Returns a formatted date string | ||
*/ | ||
public function formatDate(DateTime $date) { | ||
$date->setTimezone(new DateTimeZone('UTC')); | ||
|
||
return $date->format('D, d M Y H:i:s') . ' GMT'; | ||
public function formatDate(DateTime $date): string | ||
{ | ||
return $date | ||
->setTimezone(new DateTimeZone('UTC')) | ||
->format('D, d M Y H:i:s') . ' GMT'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
<?php | ||
<?php declare(strict_types=1); | ||
namespace Imbo\Helpers; | ||
|
||
use Imagick as ImagickInternal; | ||
|
||
/** | ||
* Helper class for Imagick | ||
*/ | ||
class Imagick { | ||
class Imagick | ||
{ | ||
/** | ||
* Get the version number (x.y.z-p) of the ImageMagick version installed (not the extension version, but | ||
* the version of ImageMagick it's using). Returns null on failure. | ||
* | ||
* @return string|null | ||
* @return ?string | ||
*/ | ||
public static function getInstalledVersion() { | ||
$params = explode(' ', \Imagick::getVersion()['versionString']); | ||
public static function getInstalledVersion(): ?string | ||
{ | ||
$params = explode(' ', ImagickInternal::getVersion()['versionString']); | ||
|
||
if (count($params) > 2) { | ||
return $params[1]; | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters