Passed
Push — master ( 617e52...ff4e9f )
by Arthur
35:51
created
src/Modules/Script/Support/Version.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
     public function setVersion($version)
68 68
     {
69 69
         $semverRegex = '/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Z-.]+))?(?:\+([0-9A-Z-.]+)?)?$/i';
70
-        if (! preg_match($semverRegex, $version, $matches)) {
70
+        if (!preg_match($semverRegex, $version, $matches)) {
71 71
             throw new \Exception('Invalid Semantic Version string provided');
72 72
         }
73
-        $this->major = (int) $matches[1];
74
-        $this->minor = (int) $matches[2];
75
-        $this->patch = (int) $matches[3];
76
-        $this->preRelease = @$matches[4] ?: null;
77
-        $this->build = @$matches[5] ?: null;
73
+        $this->major = (int) $matches[ 1 ];
74
+        $this->minor = (int) $matches[ 2 ];
75
+        $this->patch = (int) $matches[ 3 ];
76
+        $this->preRelease = @$matches[ 4 ] ?: null;
77
+        $this->build = @$matches[ 5 ] ?: null;
78 78
         return $this;
79 79
     }
80 80
     /**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      */
286 286
     public function prefix($prefix = 'v')
287 287
     {
288
-        return $prefix . $this->toString();
288
+        return $prefix.$this->toString();
289 289
     }
290 290
     /**
291 291
      * Get the current version value as a string.
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
      */
295 295
     private function toString()
296 296
     {
297
-        $version = implode('.', [$this->major, $this->minor, $this->patch]);
298
-        $version .= isset($this->preRelease) ? '-' . $this->preRelease : null;
299
-        $version .= isset($this->build) ? '+' . $this->build : null;
297
+        $version = implode('.', [ $this->major, $this->minor, $this->patch ]);
298
+        $version .= isset($this->preRelease) ? '-'.$this->preRelease : null;
299
+        $version .= isset($this->build) ? '+'.$this->build : null;
300 300
         return $version;
301 301
     }
302 302
 }
Please login to merge, or discard this patch.
src/Modules/Script/Support/RsaGenerator.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,18 +44,18 @@
 block discarded – undo
44 44
     private function sshEncodePublicKey($privKey)
45 45
     {
46 46
         $keyInfo = openssl_pkey_get_details($privKey);
47
-        $buffer = pack("N", 7) . "ssh-rsa" .
48
-            $this->sshEncodeBuffer($keyInfo['rsa']['e']) .
49
-            $this->sshEncodeBuffer($keyInfo['rsa']['n']);
50
-        return "ssh-rsa " . base64_encode($buffer);
47
+        $buffer = pack("N", 7)."ssh-rsa".
48
+            $this->sshEncodeBuffer($keyInfo[ 'rsa' ][ 'e' ]).
49
+            $this->sshEncodeBuffer($keyInfo[ 'rsa' ][ 'n' ]);
50
+        return "ssh-rsa ".base64_encode($buffer);
51 51
     }
52 52
 
53 53
     private function sshEncodeBuffer($buffer)
54 54
     {
55 55
         $len = strlen($buffer);
56
-        if (ord($buffer[0]) & 0x80) {
56
+        if (ord($buffer[ 0 ]) & 0x80) {
57 57
             $len++;
58
-            $buffer = "\x00" . $buffer;
58
+            $buffer = "\x00".$buffer;
59 59
         }
60 60
         return pack("Na*", $len, $buffer);
61 61
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@
 block discarded – undo
21 21
 
22 22
     public static function generateKeyPair($keySize = 1024): RsaKeyPair
23 23
     {
24
-        if (self::$instance === null)
25
-            self::$instance = new RsaGenerator();
24
+        if (self::$instance === null) {
25
+                    self::$instance = new RsaGenerator();
26
+        }
26 27
 
27 28
         return self::$instance->generate($keySize);
28 29
     }
Please login to merge, or discard this patch.
src/Modules/Script/Database/factories/ScriptReleaseFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 use Modules\Script\Entities\ScriptRelease;
5 5
 use Modules\Script\Support\Version;
6 6
 
7
-$factory->define(ScriptRelease::class, function (Faker $faker) {
7
+$factory->define(ScriptRelease::class, function(Faker $faker) {
8 8
     return [
9
-        ScriptRelease::TYPE => $faker->randomElement(['MINOR','MAJOR','PATCH']),
9
+        ScriptRelease::TYPE => $faker->randomElement([ 'MINOR', 'MAJOR', 'PATCH' ]),
10 10
         ScriptRelease::CHANGELOG => "A Script Release"
11 11
     ];
12 12
 });
Please login to merge, or discard this patch.
src/Modules/Script/Database/factories/ScriptReviewFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use Modules\Script\Entities\ScriptReview;
5 5
 
6
-$factory->define(ScriptReview::class, function (Faker $faker) {
6
+$factory->define(ScriptReview::class, function(Faker $faker) {
7 7
     return [
8 8
         ScriptReview::REVIEWER_ID => null,
9 9
         ScriptReview::MESSAGE => $faker->text(),
Please login to merge, or discard this patch.
src/Modules/Script/Database/factories/ScriptFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Modules\Script\Entities\Script;
5 5
 use Modules\Script\Support\RsaGenerator;
6 6
 
7
-$factory->define(Script::class, function (Faker $faker) {
7
+$factory->define(Script::class, function(Faker $faker) {
8 8
     $rsa = RsaGenerator::generateKeyPair();
9 9
     return [
10 10
         Script::AUTHOR_ID => null,
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
         Script::SHORT_DESCRIPTION => $faker->text(),
14 14
         Script::GAME => 'OSRS',
15 15
         Script::PUBLIC => $faker->boolean,
16
-        Script::BASE_PRICE => $faker->randomFloat(2,0,50),
17
-        Script::RECURRING_PRICE => $faker->randomFloat(2,0,10),
16
+        Script::BASE_PRICE => $faker->randomFloat(2, 0, 50),
17
+        Script::RECURRING_PRICE => $faker->randomFloat(2, 0, 10),
18 18
         Script::GIT_ACCESS => $faker->boolean,
19 19
         Script::REPOSITORY_URL => $faker->text(),
20 20
         Script::PUBLIC_KEY => $rsa->getPublicKey(),
21 21
         Script::PRIVATE_KEY => $rsa->getPrivateKey(),
22
-        Script::TAGS => []
22
+        Script::TAGS => [ ]
23 23
     ];
24 24
 });
Please login to merge, or discard this patch.
src/Modules/Script/Database/factories/ScriptExclusivityFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use Modules\Script\Entities\ScriptExclusivity;
5 5
 
6
-$factory->define(ScriptExclusivity::class, function (Faker $faker) {
6
+$factory->define(ScriptExclusivity::class, function(Faker $faker) {
7 7
     return [
8
-        ScriptExclusivity::BASE_PRICE => $faker->randomFloat(2,0,50),
9
-        ScriptExclusivity::RECURRING_PRICE => $faker->randomFloat(2,0,10),
8
+        ScriptExclusivity::BASE_PRICE => $faker->randomFloat(2, 0, 50),
9
+        ScriptExclusivity::RECURRING_PRICE => $faker->randomFloat(2, 0, 10),
10 10
     ];
11 11
 });
Please login to merge, or discard this patch.
src/Modules/Script/Database/factories/ScriptSubscriptionFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use Modules\Script\Entities\ScriptSubscription;
5 5
 
6
-$factory->define(ScriptSubscription::class, function (Faker $faker) {
6
+$factory->define(ScriptSubscription::class, function(Faker $faker) {
7 7
     return [
8 8
         ScriptSubscription::USER_ID => null,
9 9
         ScriptSubscription::ACTIVE => $faker->boolean,
10
-        ScriptSubscription::BASE_PRICE => $faker->randomFloat(2, 0,50),
11
-        ScriptSubscription::RECURRING_PRICE => $faker->randomFloat(2, 0,50)
10
+        ScriptSubscription::BASE_PRICE => $faker->randomFloat(2, 0, 50),
11
+        ScriptSubscription::RECURRING_PRICE => $faker->randomFloat(2, 0, 50)
12 12
     ];
13 13
 });
Please login to merge, or discard this patch.
src/Modules/Script/Database/factories/ScriptReviewReplyFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use Modules\Script\Entities\ScriptReviewReply;
5 5
 
6
-$factory->define(ScriptReviewReply::class, function (Faker $faker) {
6
+$factory->define(ScriptReviewReply::class, function(Faker $faker) {
7 7
     return [
8 8
         ScriptReviewReply::REPLIER_ID => null,
9 9
         ScriptReviewReply::MESSAGE => $faker->text
Please login to merge, or discard this patch.
src/Modules/Script/Transformers/ScriptTransformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      *
15 15
      * @var array
16 16
      */
17
-    public $available = [];
17
+    public $available = [ ];
18 18
 
19 19
     /**
20 20
      * Transform the resource into an array.
Please login to merge, or discard this patch.