mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
harmonise namespace
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
|
// Exit if this file is called directly.
|
||||||
|
if (!defined('ABSPATH')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
final class DateTimeWrapper {
|
final class DateTimeWrapper {
|
||||||
private $dateTime;
|
private $dateTime;
|
||||||
@@ -12,13 +18,13 @@ final class DateTimeWrapper {
|
|||||||
if (!$timeZone) {
|
if (!$timeZone) {
|
||||||
$timeZone = 'utc';
|
$timeZone = 'utc';
|
||||||
}
|
}
|
||||||
$this->dateTime = new DateTime($text);
|
$this->dateTime = new \DateTime($text);
|
||||||
$this->locale = $locale;
|
$this->locale = $locale;
|
||||||
$this->timeZone = new DateTimeZone($timeZone);
|
$this->timeZone = new \DateTimeZone($timeZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShortDate(): string {
|
public function getShortDate(): string {
|
||||||
$formatter = IntlDateFormatter::create($this->locale, IntlDateFormatter::SHORT, IntlDateFormatter::NONE, $this->timeZone);
|
$formatter = \IntlDateFormatter::create($this->locale, \IntlDateFormatter::SHORT, \IntlDateFormatter::NONE, $this->timeZone);
|
||||||
return $formatter->format($this->dateTime);
|
return $formatter->format($this->dateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +33,7 @@ final class DateTimeWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function get24Time(): string {
|
public function get24Time(): string {
|
||||||
$formatter = IntlDateFormatter::create($this->locale, IntlDateFormatter::NONE, IntlDateFormatter::SHORT, $this->timeZone);
|
$formatter = \IntlDateFormatter::create($this->locale, \IntlDateFormatter::NONE, \IntlDateFormatter::SHORT, $this->timeZone);
|
||||||
return $formatter->format($this->dateTime);
|
return $formatter->format($this->dateTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
|
// Exit if this file is called directly.
|
||||||
|
if (!defined('ABSPATH')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
final class Formatter
|
final class Formatter
|
||||||
{
|
{
|
||||||
public static function format_date(string $locale, string $timeZone, string $start, ?string $end, bool $isShortOffsetNameShown): string {
|
public static function format_date(string $locale, string $timeZone, string $start, ?string $end, bool $isShortOffsetNameShown): string {
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace MobilizonConnector;
|
||||||
|
|
||||||
// Exit if this file is called directly.
|
// Exit if this file is called directly.
|
||||||
if (!defined('ABSPATH')) {
|
if (!defined('ABSPATH')) {
|
||||||
exit;
|
exit;
|
||||||
|
Reference in New Issue
Block a user