Passed
Push — master ( 1f6501...911244 )
by butschster
33:53 queued 27:07
created
builder/ValidateVersionReleaseWorker.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,7 +14,8 @@  discard block
 block discarded – undo
14 14
         private readonly TagParserInterface $parser,
15 15
         private ?string $gitDirectory = null
16 16
     ) {
17
-        if ($gitDirectory === null) {
17
+        if ($gitDirectory === null)
18
+        {
18 19
             $this->gitDirectory = \dirname(__DIR__);
19 20
         }
20 21
     }
@@ -32,13 +33,15 @@  discard block
 block discarded – undo
32 33
         $mostRecentVersion = $this->findMostRecentVersion($version);
33 34
 
34 35
         // no tag yet
35
-        if ($mostRecentVersion === null) {
36
+        if ($mostRecentVersion === null)
37
+        {
36 38
             return;
37 39
         }
38 40
 
39 41
         // validation
40 42
         $mostRecentVersion = new Version(\strtolower($mostRecentVersion));
41
-        if ($version->isGreaterThan($mostRecentVersion)) {
43
+        if ($version->isGreaterThan($mostRecentVersion))
44
+        {
42 45
             return;
43 46
         }
44 47
 
@@ -52,23 +55,28 @@  discard block
 block discarded – undo
52 55
     private function findMostRecentVersion(Version $version): ?string
53 56
     {
54 57
         $tags = [];
55
-        foreach ($this->parser->parse($this->gitDirectory) as $tag) {
58
+        foreach ($this->parser->parse($this->gitDirectory) as $tag)
59
+        {
56 60
             $tag = new Version(\strtolower($tag));
57 61
 
58 62
             // all previous major versions
59
-            if ($version->getMajor()->getValue() > $tag->getMajor()->getValue()) {
63
+            if ($version->getMajor()->getValue() > $tag->getMajor()->getValue())
64
+            {
60 65
                 $tags[] = $tag;
61 66
             }
62 67
 
63 68
             // all minor versions up to the requested in the requested major version
64
-            if ($version->getMajor()->getValue() === $tag->getMajor()->getValue()) {
65
-                if ($version->getMinor()->getValue() >= $tag->getMinor()->getValue()) {
69
+            if ($version->getMajor()->getValue() === $tag->getMajor()->getValue())
70
+            {
71
+                if ($version->getMinor()->getValue() >= $tag->getMinor()->getValue())
72
+                {
66 73
                     $tags[] = $tag;
67 74
                 }
68 75
             }
69 76
         }
70 77
 
71
-        if ($tags === []) {
78
+        if ($tags === [])
79
+        {
72 80
             return null;
73 81
         }
74 82
 
Please login to merge, or discard this patch.