Passed
Push — master ( bc3d03...05ab5f )
by Ayesh
05:12 queued 03:27
created
src/Parser.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@  discard block
 block discarded – undo
81 81
     if ($birth_days_since > 500) {
82 82
       $birth_days_since -= 500;
83 83
       $this->data_components['gender'] = 'F';
84
-    }
85
-    else {
84
+    } else {
86 85
       $this->data_components['gender'] = 'M';
87 86
     }
88 87
 
@@ -99,8 +98,7 @@  discard block
 block discarded – undo
99 98
     $strlen = strlen((string) $id_number);
100 99
     if ($strlen === 12) {
101 100
       $this->data_components['format'] = static::ID_FORMAT_2016;
102
-    }
103
-    else {
101
+    } else {
104 102
       $this->data_components['format'] = static::ID_FORMAT_PRE_2016;
105 103
     }
106 104
   }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace SLWDC\NICParser;
5 5
 
Please login to merge, or discard this patch.
examples/parser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $id_number = '862348594v';
11 11
 
12 12
 $parser = new Parser($id_number);
13
-$parser->getBirthday();// Returns a \DateTime object with the date parsed.
13
+$parser->getBirthday(); // Returns a \DateTime object with the date parsed.
14 14
 echo $parser->getBirthday()->format('Y-m-d'); // prints "1986-08-22"
15 15
 echo $parser->getGender(); // Prints "M". M for male, F for female.
16 16
 echo $parser->getSerialNumber(); // Prints "8594"
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $id_number = '19935158154';
22 22
 
23 23
 $parser = new Parser($id_number);
24
-$parser->getBirthday();// Returns a \DateTime object with the date parsed.
24
+$parser->getBirthday(); // Returns a \DateTime object with the date parsed.
25 25
 echo $parser->getBirthday()->format('Y-m-d'); // prints "1993-01-15"
26 26
 echo $parser->getGender(); // Prints "F". M for male, F for female.
27 27
 echo $parser->getSerialNumber(); // Prints "8154"
Please login to merge, or discard this patch.
examples/validation.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 
12 12
 try {
13 13
   $parser = new Parser($id_number);
14
-}
15
-catch (InvalidArgumentException $exception) {
14
+} catch (InvalidArgumentException $exception) {
16 15
   echo $exception->getMessage(); // "Birthday indicator is invalid."
17 16
 }
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace SLWDC\NICParser;
5 5
 
Please login to merge, or discard this patch.