Completed
Push — master ( e3b055...197347 )
by mehdi
02:54
created

Datium::createTimestamp()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 20
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 20
rs 9.4285
cc 3
eloc 7
nc 2
nop 1
1
<?php
2
/**
3
 * Main Datium class
4
 *
5
 * @category Core
6
 * @package  OpenCafe\Datium
7
 * @author   Mehdi Hosseini <[email protected]>
8
 * @license  License https://opensource.org/licenses/MIT
9
 * @link     https://github.com/opencafe/datium
10
 * @since    Aug 17, 2015
11
 */
12
13
namespace OpenCafe;
14
15
use DateTime;
16
use DateInterval;
17
use OpenCafe\Tools\Convert;
18
use OpenCafe\Tools\Leap;
19
use OpenCafe\Tools\DayOf;
20
use OpenCafe\Tools\Lang;
21
use OpenCafe\Tools\TimeAgo;
22
23
/**
24
 * Main Datium class
25
 *
26
 * @category Core
27
 * @package  OpenCafe\Datium
28
 * @author   Mehdi Hosseini <[email protected]>
29
 * @license  icense https://opensource.org/licenses/MIT
30
 * @link     https://github.com/opencafe/datium
31
 * @since    Aug 17, 2015
32
 */
33
class Datium
34
{
35
36
    /**
37
   * Store DateTime object
38
   */
39
    protected $date_time;
40
41
    protected static $static_date_time;
42
43
    /**
44
   * Store config file statements
45
   *
46
   * @param array
47
   */
48
    protected $config;
49
50
    protected $date_interval_expression;
51
52
    protected static $date_start;
53
54
    protected static $date_end;
55
56
    protected $translate_from;
57
58
    protected $translate_to;
59
60
    protected $toConfig;
61
62
    protected $fromConfig;
63
64
    /**
65
   * Return store day number
66
   *
67
   * @param integer
68
   */
69
    protected $day_of;
70
71
    protected $leap;
72
73
    protected $events;
74
75
    protected $translate;
76
77
    protected $gregorian_DayofWeek;
78
79
    protected $convert_calendar;
80
81
    protected $calendar_type;
82
83
    protected static $array_date;
84
85
    protected static $call_type;
86
87
    protected $translate_from_file;
88
89
    protected $translate_to_file;
90
91
    protected $language;
92
93
    protected static $timestamp;
94
95
    /**
96
    * Timeago
97
    *
98
    * @param integer
99
    */
100
    protected $ago;
101
102
    /**
103
    * Datium class constructure
104
    */
105
    public function __construct()
106
    {
107
108
        $this->language = 'en';
109
110
        $this->translate_from = 'gregorian';
111
112
        $this->translate_to = 'gregorian';
113
114
        $this->config = include 'Config.php';
115
116
        $this->calendar_type = $this->config[ 'default_calendar' ];
117
118
        date_default_timezone_set($this->config[ 'timezone' ]);
119
120
        $this->calendar_type = 'gregorian';
121
122
        switch (Datium::$call_type) {
123
124
125
            case 'create-timestamp':
126
127
                $this->date_time = new DateTime();
128
129
                $this->date_time->setTimestamp( self::$timestamp );
130
131
                break;
132
133
            case 'now':
134
135
                $this->date_time = new DateTime('now');
136
137
                break;
138
139
            case 'make':
140
141
                $this->date_time = new DateTime('now');
142
143
                $this->date_time->setDate(
144
                    self::$array_date[ 'year' ],
145
                    self::$array_date[ 'month' ],
146
                    self::$array_date[ 'day' ]
147
                );
148
149
                $this->date_time->setTime(
150
                    self::$array_date[ 'hour' ],
151
                    self::$array_date[ 'minute' ],
152
                    self::$array_date[ 'second' ]
153
                );
154
155
                break;
156
157
            case 'set':
158
159
                $this->date_time = Datium::$static_date_time;
160
161
        }
162
163
        $this->gregorian_DayofWeek = $this->date_time->format('w');
164
165
        $this->convert_calendar = new Convert();
166
167
    }
168
169
    /**
170
    * Return all datetime parts as an object
171
    *
172
    * @return object
173
    */
174
    public function all()
175
    {
176
177
        return ( object ) array(
178
179
        'second' => $this->date_time->format('s'),
180
181
        'minute' => $this->date_time->format('m'),
182
183
        'hour' => $this->date_time->format('H'),
184
185
        'day' => $this->date_time->format('d'),
186
187
        'month' => $this->date_time->format('m'),
188
189
        'year' => $this->date_time->format('Y')
190
191
        );
192
193
    }
194
195
    /**
196
   * Get current datetime
197
   *
198
   * @since  Aug 17 2015
199
   * @return object
200
   */
201
    public static function now()
202
    {
203
204
        self::$call_type = 'now';
205
206
        return new Datium();
207
208
    }
209
210
    /**
211
   * Create new date time
212
   *
213
   * @param integer $year   Year number
214
   * @param integer $month  month number
215
   * @param integer $day    day number
216
   * @param integer $hour   hour number
217
   * @param integer $minute minute number
218
   * @param integer $second second number
219
   *
220
   * @return object
221
   */
222
    public static function create(
223
        $year = 2000,
224
        $month = 1,
225
        $day = 1,
226
        $hour = 0,
227
        $minute = 0,
228
        $second = 0
229
    ) {
230
231
232
        /**
233
       * When we want to set a Datetime object to Datium
234
       */
235
        if (func_num_args() === 1) {
236
            self::$static_date_time = func_get_arg(0);
237
238
            self::$call_type = 'set';
239
        } else {
240
            self::$array_date = array(
241
              'year' => $year,
242
              'month' => $month,
243
              'day' => $day,
244
              'hour' => $hour,
245
              'minute' => $minute,
246
              'second' => $second
247
            );
248
249
            self::$call_type = 'make';
250
        }
251
252
          return new Datium();
253
254
    }
255
256
    /**
257
    * Accecpt Timestamp as Datium initializion
258
    *
259
    * @param  timestamp $timestamp Input timestamp value
260
    * @return object
261
    */
262
    public static function createTimestamp( $timestamp )
263
    {
264
265
      if( $timestamp != null && is_int( $timestamp ) )
266
      {
267
268
        self::$call_type = 'create-timestamp';
269
270
        self::$timestamp = $timestamp;
271
272
        return new Datium();
273
274
      } else {
275
276
        throw new \Exception("Error timestamp is not entered in true format", 1);
277
278
      }
279
280
281
    }
282
283
    /**
284
    * Select The range between two date object
285
    *
286
    * @param object $date_start Start of the DateTime
287
    * @param object $date_end   End of the DateTime
288
    *
289
    * @return object
290
    */
291
    public static function between($date_start, $date_end)
292
    {
293
294
        self::$date_start = $date_start;
295
296
        self::$date_end = $date_end;
297
298
        self::$call_type = 'between';
299
300
        return new Datium();
301
302
    }
303
304
    /**
305
   * Convert from current calendar, what type is current calendar?
306
   *
307
   * @param object $calendar Assigned calendar to start from
308
   *
309
   * @return $object
0 ignored issues
show
Documentation introduced by
The doc-type $object could not be parsed: Unknown type name "$object" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
310
   */
311 View Code Duplication
    public function from($calendar)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
312
    {
313
314
        $this->convert = new Convert($this->date_time);
0 ignored issues
show
Bug introduced by
The property convert does not seem to exist. Did you mean convert_calendar?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
315
316
        $this->date_time = $this->convert->from($calendar);
0 ignored issues
show
Bug introduced by
The property convert does not seem to exist. Did you mean convert_calendar?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
317
318
319
        /**
320
     * We need this part for DayOf class
321
     */
322
        $this->calendar_type = $calendar;
323
324
        $this->translate_to = $calendar;
325
326
        return $this;
327
328
    }
329
330
    /**
331
    * Convert date to current Date
332
    *
333
    * @param object $calendar Assigned calendar to when calendar should start.
334
    *
335
    * @return object
336
    */
337 View Code Duplication
    public function to($calendar)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
338
    {
339
340
        $this->convert = new Convert($this->date_time);
0 ignored issues
show
Bug introduced by
The property convert does not seem to exist. Did you mean convert_calendar?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
341
342
        $this->date_time = $this->convert->to($calendar);
0 ignored issues
show
Bug introduced by
The property convert does not seem to exist. Did you mean convert_calendar?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
343
344
        /**
345
     * We need this part for DayOf class
346
     */
347
        $this->calendar_type = $calendar;
348
349
        $this->translate_to = $calendar;
350
351
        return $this;
352
353
    }
354
355
    /**
356
   * Difference between two time
357
   *
358
   * @param DateTime $start Start of the date
359
   * @param DateTime $end   End of the date
360
   *
361
   * @return object
362
   */
363
    public static function diff($start, $end)
364
    {
365
366
        $difference = date_diff($start, $end);
367
368
        $difference->second = $difference->s;
369
370
        $difference->minute = $difference->i;
371
372
        $difference->hour = $difference->h;
373
374
        $difference->day = $difference->d;
375
376
        $difference->month = $difference->m;
377
378
        $difference->year = $difference->y;
379
380
        return $difference;
381
382
    }
383
384
    /**
385
   * Add new date value to current date
386
   *
387
   * @param string $value How much date should be added to current date
388
   *
389
   * @return object
390
   */
391 View Code Duplication
    public function add($value)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
392
    {
393
394
        $this->date_interval_expression = str_replace(
395
            $this->config[ 'date_simple' ],
396
            $this->config[ 'date_interval' ],
397
            $value
398
        );
399
400
        $unit = 'P';
401
402
        if (strpos($this->date_interval_expression, 'T')) {
403
            $this->date_interval_expression= str_replace(
404
                'T',
405
                '',
406
                $this->date_interval_expression
407
            );
408
409
            $unit = 'PT';
410
        }
411
412
        $this->date_interval_expression = str_replace(
413
            ' ',
414
            '',
415
            $unit . $this->date_interval_expression
416
        );
417
418
        $this->date_time->add(
419
            new DateInterval($this->date_interval_expression)
420
        );
421
422
        return $this;
423
424
    }
425
426
    /**
427
   * Sub date from current date
428
   *
429
   * @param string $value How much date should increase from current date
430
   *
431
   * @return obejct
432
   */
433 View Code Duplication
    public function sub($value)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
434
    {
435
436
        $this->date_interval_expression = str_replace(
437
            $this->config[ 'date_simple' ],
438
            $this->config[ 'date_interval' ],
439
            $value
440
        );
441
442
        $unit = 'P';
443
444
        if (strpos($this->date_interval_expression, 'T')) {
445
            $this->date_interval_expression= str_replace(
446
                'T',
447
                '',
448
                $this->date_interval_expression
449
            );
450
451
            $unit = 'PT';
452
        }
453
454
        $this->date_interval_expression = str_replace(
455
            ' ',
456
            '',
457
            $unit . $this->date_interval_expression
458
        );
459
460
        $this->date_time->sub(
461
            new DateInterval($this->date_interval_expression)
462
        );
463
464
        return $this;
465
466
    }
467
468
    /**
469
   * Check if current year is leap or not
470
   *
471
   * @param string $type Name of the calendar to caculate leap year
0 ignored issues
show
Bug introduced by
There is no parameter named $type. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
472
   *
473
   * @return boolean
474
   */
475
    public function leap()
476
    {
477
478
        $this->leap = new Leap($this->date_time->format('Y'), $this->calendar_type);
0 ignored issues
show
Bug introduced by
It seems like $this->calendar_type can also be of type object; however, OpenCafe\Tools\Leap::__construct() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
479
480
        return $this->leap;
481
482
    }
483
484
    /**
485
    * Calculate how many time ago datetime happens
486
    *
487
    * @return string
488
    */
489
    public function ago()
490
    {
491
492
        $this->ago = new TimeAgo($this->date_time, $this->language);
493
494
        return $this->ago;
495
496
    }
497
498
    /**
499
    * Caculate day of year or week
500
    *
501
    * @since Aug, 22 2015
502
    *
503
    * @return integer
504
    */
505
    public function dayOf()
506
    {
507
508
        $this->day_of = new DayOf($this->date_time, $this->calendar_type);
0 ignored issues
show
Bug introduced by
It seems like $this->calendar_type can also be of type object; however, OpenCafe\Tools\DayOf::__construct() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
509
510
        return $this->day_of;
511
512
    }
513
514
    // public function events()
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
515
    // {
516
    //
517
    //     if (Datium::$call_type == 'between' ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
47% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
518
    //
519
    //         $this->events = new Events(Datium::$date_start, Datium::$date_end);
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
520
    //
521
    //     } else {
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
522
    //
523
    //         $this->events = new Events($this->date_time);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
524
    //
525
    //     }
526
    //
527
    //     return $this->events;
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
528
    //
529
    // }
530
531
    /**
532
    * Return Datetime as a original object
533
    *
534
    * @since Oct 22, 2015
535
    *
536
    * @return object
537
    */
538
    public function object()
539
    {
540
541
        return $this->date_time;
542
543
    }
544
545
    /**
546
    * Translate current date string to selected language
547
    *
548
    * @param string $language language short name fa, en, ar ...
549
    *
550
    * @return object
551
    */
552
    public function lang($language = 'fa')
553
    {
554
555
        $this->language = $language;
556
557
        $this->result = new Lang();
0 ignored issues
show
Bug introduced by
The property result does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
558
559
        $this->result->setConfig($this->language);
560
561
        $this->toConfig = $this->result->getConfig();
562
563
        return $this;
564
565
    }
566
567
    /**
568
    * Return object as timestamp
569
    *
570
    * @return timestamp
571
    */
572
    public function timestamp()
573
    {
574
575
        return strtotime($this->date_time->format('Y-m-d H:i:s'));
576
577
    }
578
579
    /**
580
   * Return fainal result
581
   *
582
   * @param string $format Date format
583
   *
584
   * @since Aug 17 2015
585
   *
586
   * @return string
587
   */
588
    public function get($format = 'Y-m-d H:i:s')
589
    {
590
591
        // $this->translate_from_file = include( 'Lang/en/general.php' );
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
592
        //
593
        // $this->translate_to_file = include( 'Lang/' . $this->language . '/general.php' );
0 ignored issues
show
Unused Code Comprehensibility introduced by
42% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
594
595
        if (is_null($this->fromConfig)) {
596
            $this->fromConfig = include 'CalendarSettings/' .
597
                                ucfirst($this->translate_from) . '.php';
598
        }
599
600
601
        if (is_null($this->toConfig)) {
602
            $this->toConfig = include 'CalendarSettings/' .
603
                                       ucfirst($this->translate_to) . '.php';
604
        }
605
606
        $string_date = $this->date_time->format($format);
607
608
        if ($this->translate_to != 'gregorian') {
609
            $string_date = str_replace(
610
                $this->fromConfig[ 'month' ],
611
                $this->toConfig[ 'month' ],
612
                $string_date
613
            );
614
615
            $string_date = str_replace(
616
                $this->fromConfig[ 'days_of_week' ],
617
                $this->toConfig[ 'days_of_week' ][ $this->gregorian_DayofWeek ],
618
                $string_date
619
            );
620
621
            $string_date = str_replace(
622
                $this->fromConfig[ 'numbers' ],
623
                $this->toConfig[ 'numbers' ],
624
                $string_date
625
            );
626
627
            $string_date = str_replace(
628
                $this->fromConfig[ 'am_time' ],
629
                $this->toConfig[ 'am_time' ],
630
                $string_date
631
            );
632
633
            $string_date = str_replace(
634
                $this->fromConfig[ 'pm_time' ],
635
                $this->toConfig[ 'pm_time' ],
636
                $string_date
637
            );
638
639
            $string_date = str_replace(
640
                $this->fromConfig[ 'end_of_days' ],
641
                $this->toConfig[ 'end_of_days' ],
642
                $string_date
643
            );
644
        }
645
646
        // foreach( $this->translate_to_file as $key => $value ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
647
        //
648
          // $string_date = str_replace(
649
          //   $this->translate_from_file[ $key ],
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
650
          //   $this->translate_to_file[ $key ],
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
651
          //   $string_date
652
          // );
653
        //
654
        // }
655
656
        return $string_date;
657
658
    }
659
}
660