Passed
Pull Request — master (#6)
by Alexander
05:02
created
tests/Mocks/TimestampTestMock.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         return [
32 32
             'flexibleTimestamp' => [
33 33
                 'class' => FlexibleTimestampBehavior::class,
34
-                'attributes' => ['timestamp', 'date1', 'date2',],
34
+                'attributes' => ['timestamp', 'date1', 'date2', ],
35 35
                 'format' => $this->format,
36 36
             ],
37 37
         ];
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     public function rules()
44 44
     {
45 45
         return [
46
-            [['timestamp', 'date1', 'date2',], 'date', 'format' => 'php:Y-m-d',],
46
+            [['timestamp', 'date1', 'date2', ], 'date', 'format' => 'php:Y-m-d', ],
47 47
         ];
48 48
     }
49 49
 }
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
src/Behaviors/FlexibleTimestampBehavior.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@
 block discarded – undo
40 40
             $date = null;
41 41
             preg_replace_callback_array(
42 42
                 [
43
-                    '/^\d{4}\-\d{2}\-\d{2}$/' => function ($match) use (&$date) {
43
+                    '/^\d{4}\-\d{2}\-\d{2}$/' => function($match) use (&$date) {
44 44
                         $date = Carbon::createFromFormat('Y-m-d', $match[0]);
45 45
                     },
46
-                    '/^\d{2}\.\d{2}\.\d{4}$/' => function ($match) use (&$date) {
46
+                    '/^\d{2}\.\d{2}\.\d{4}$/' => function($match) use (&$date) {
47 47
                         $date = Carbon::createFromFormat('d.m.Y', $match[0]);
48 48
                     },
49
-                    '/^\d+$/' => function ($match) use (&$date) {
49
+                    '/^\d+$/' => function($match) use (&$date) {
50 50
                         $date = Carbon::createFromTimestamp($match[0]);
51 51
                     }
52 52
                 ],
Please login to merge, or discard this patch.