Skip to content

Commit dfe22a6

Browse files
committed
fix some docs in Date* Classes #4
1 parent 2cef08f commit dfe22a6

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

lib/Webforge/Common/DateTime/DateInterval.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public function addTo(DateTime $dateTime) {
6868
}
6969

7070
/**
71-
* Nimmt eine internal::DateInterval und führt dieses in ein PscDateInterval über
71+
* Create a DateInterval from an PHP Dateinterval
7272
*
7373
* @param DateInterval $interval
74-
* @return PscDateInterval
74+
* @return DateInterval
7575
*/
7676
public static function createFromDateInterval(\DateInterval $interval) {
7777
if ($interval instanceof DateInterval) return $interval;

lib/Webforge/Common/DateTime/DateTime.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use DateTimeZone;
66
use Webforge\Common\Util AS Code;
7+
use Webforge\Common\Exception;
8+
use InvalidArgumentException;
79

810
class DateTime extends \DateTime {
911

@@ -24,7 +26,7 @@ class DateTime extends \DateTime {
2426

2527
public function __construct($time = NULL, DateTimeZone $object = NULL) {
2628
if (isset($object)) {
27-
throw new \Psc\Exception('Timezone im Constructor setzen geht nicht in PHP 5.3');
29+
throw new Exception('Timezone im Constructor setzen geht nicht in PHP 5.3');
2830
}
2931

3032
if ($time instanceof \DateTime) {
@@ -56,7 +58,7 @@ public function __construct($time = NULL, DateTimeZone $object = NULL) {
5658
}
5759

5860
/**
59-
* @return PscDateTime
61+
* @return DateTime
6062
*/
6163
public static function factory($time = NULL, DateTimeZone $object = NULL) {
6264
return new DateTime($time, $object);
@@ -155,7 +157,7 @@ public static function parse($format, $time, DateTimeZone $timezone = NULL) {
155157
* Wollen wir den Montag des Sonntages liegt das Datum in der Vergangenheit
156158
*
157159
* ist heute also Sonntag der 20.3.2011 und der Parameter ist MON gibt Funktion Montag den 14.03.2011 zurück (gleiche Uhrzeit wie jetzt)
158-
* @return PscDateTime
160+
* @return DateTime
159161
*/
160162
public function getWeekday($day) {
161163

@@ -243,15 +245,6 @@ public function getWalkableFields() {
243245
);
244246
}
245247

246-
247-
public function getWalkableType($field) {
248-
if ($field === 'date') {
249-
return \Psc\Data\Type\Type::create('Integer');
250-
} elseif ($field === 'timezone') {
251-
return \Psc\Data\Type\Type::create('String');
252-
}
253-
}
254-
255248
public function export() {
256249
return (object) array(
257250
'date'=>$this->format('U'),
@@ -268,7 +261,7 @@ public static function import(\stdClass $o) {
268261
* @param int $year unbedingt ein int
269262
*/
270263
public function setYear($year) {
271-
if (!is_int($year)) throw new \InvalidArgumentException('Parameter 1 muss ein Integer sein');
264+
if (!is_int($year)) throw new InvalidArgumentException('Parameter 1 muss ein Integer sein');
272265
$this->setDate($year, $this->getMonth(), $this->getDay()); // das ist die PHP Funktion
273266
return $this;
274267
}

0 commit comments

Comments
 (0)