Passed
Pull Request — master (#370)
by Valentin
04:51
created
monorepo-builder.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  *
11 11
  * @see https://github.com/symplify/symplify/issues/2061
12 12
  */
13
-\register_shutdown_function(static function () {
14
-    $dest = \json_decode(\file_get_contents(__DIR__ . '/composer.json'), true);
13
+\register_shutdown_function(static function (){
14
+    $dest = \json_decode(\file_get_contents(__DIR__.'/composer.json'), true);
15 15
 
16 16
     $result = [
17 17
         'name'              => 'spiral/framework',
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     $json = \json_encode($result, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES);
48 48
 
49
-    \file_put_contents(__DIR__ . '/composer.json', $json . "\n");
49
+    \file_put_contents(__DIR__.'/composer.json', $json."\n");
50 50
 });
51 51
 
52 52
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,8 @@
 block discarded – undo
10 10
  *
11 11
  * @see https://github.com/symplify/symplify/issues/2061
12 12
  */
13
-\register_shutdown_function(static function () {
13
+\register_shutdown_function(static function ()
14
+{
14 15
     $dest = \json_decode(\file_get_contents(__DIR__ . '/composer.json'), true);
15 16
 
16 17
     $result = [
Please login to merge, or discard this patch.
src/Streams/tests/StreamsTest.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 class StreamsTest extends TestCase
19 19
 {
20
-    private const FIXTURE_DIRECTORY = __DIR__ . '/fixtures';
20
+    private const FIXTURE_DIRECTORY = __DIR__.'/fixtures';
21 21
 
22 22
     public function setUp(): void
23 23
     {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $this->assertSame(strlen('sample text'), filesize($filename));
43 43
         $this->assertSame(md5('sample text'), md5_file($filename));
44 44
 
45
-        $newFilename = self::FIXTURE_DIRECTORY . '/test.txt';
45
+        $newFilename = self::FIXTURE_DIRECTORY.'/test.txt';
46 46
         copy($filename, $newFilename);
47 47
 
48 48
         $this->assertFileExists($newFilename);
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function testException()
85 85
     {
86
-        try {
86
+        try{
87 87
             fopen('spiral://non-exists', 'rb');
88
-        } catch (\Throwable $e) {
88
+        }catch (\Throwable $e){
89 89
             $this->assertStringContainsString('failed to open stream', $e->getMessage());
90 90
         }
91 91
 
92
-        try {
92
+        try{
93 93
             filemtime('spiral://non-exists');
94
-        } catch (\Throwable $e) {
94
+        }catch (\Throwable $e){
95 95
             $this->assertStringContainsString('stat failed', $e->getMessage());
96 96
         }
97 97
     }
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function testExceptionPHP8()
103 103
     {
104
-        try {
104
+        try{
105 105
             fopen('spiral://non-exists', 'rb');
106
-        } catch (\Throwable $e) {
106
+        }catch (\Throwable $e){
107 107
             $this->assertStringContainsString('Failed to open stream', $e->getMessage());
108 108
         }
109 109
 
110
-        try {
110
+        try{
111 111
             filemtime('spiral://non-exists');
112
-        } catch (\Throwable $e) {
112
+        }catch (\Throwable $e){
113 113
             $this->assertStringContainsString('stat failed', $e->getMessage());
114 114
         }
115 115
     }
Please login to merge, or discard this patch.
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -83,15 +83,21 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function testException()
85 85
     {
86
-        try {
86
+        try
87
+        {
87 88
             fopen('spiral://non-exists', 'rb');
88
-        } catch (\Throwable $e) {
89
+        }
90
+        catch (\Throwable $e)
91
+        {
89 92
             $this->assertStringContainsString('failed to open stream', $e->getMessage());
90 93
         }
91 94
 
92
-        try {
95
+        try
96
+        {
93 97
             filemtime('spiral://non-exists');
94
-        } catch (\Throwable $e) {
98
+        }
99
+        catch (\Throwable $e)
100
+        {
95 101
             $this->assertStringContainsString('stat failed', $e->getMessage());
96 102
         }
97 103
     }
@@ -101,15 +107,21 @@  discard block
 block discarded – undo
101 107
      */
102 108
     public function testExceptionPHP8()
103 109
     {
104
-        try {
110
+        try
111
+        {
105 112
             fopen('spiral://non-exists', 'rb');
106
-        } catch (\Throwable $e) {
113
+        }
114
+        catch (\Throwable $e)
115
+        {
107 116
             $this->assertStringContainsString('Failed to open stream', $e->getMessage());
108 117
         }
109 118
 
110
-        try {
119
+        try
120
+        {
111 121
             filemtime('spiral://non-exists');
112
-        } catch (\Throwable $e) {
122
+        }
123
+        catch (\Throwable $e)
124
+        {
113 125
             $this->assertStringContainsString('stat failed', $e->getMessage());
114 126
         }
115 127
     }
Please login to merge, or discard this patch.
src/SendIt/src/MessageSerializer.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@
 block discarded – undo
51 51
     public static function unpack(array $payload): MessageInterface
52 52
     {
53 53
         $message = new Message($payload['subject'], $payload['to'], $payload['data']);
54
-        if ($payload['from'] !== null) {
54
+        if ($payload['from'] !== null){
55 55
             $message->setFrom($payload['from']);
56 56
         }
57 57
 
58
-        if ($payload['replyTo'] !== null) {
58
+        if ($payload['replyTo'] !== null){
59 59
             $message->setReplyTo($payload['replyTo']);
60 60
         }
61 61
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,11 +51,13 @@
 block discarded – undo
51 51
     public static function unpack(array $payload): MessageInterface
52 52
     {
53 53
         $message = new Message($payload['subject'], $payload['to'], $payload['data']);
54
-        if ($payload['from'] !== null) {
54
+        if ($payload['from'] !== null)
55
+        {
55 56
             $message->setFrom($payload['from']);
56 57
         }
57 58
 
58
-        if ($payload['replyTo'] !== null) {
59
+        if ($payload['replyTo'] !== null)
60
+        {
59 61
             $message->setReplyTo($payload['replyTo']);
60 62
         }
61 63
 
Please login to merge, or discard this patch.
src/SendIt/src/Renderer/ViewRenderer.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function render(MessageInterface $message): Email
39 39
     {
40
-        try {
40
+        try{
41 41
             $view = $this->views->get($message->getSubject());
42
-        } catch (ViewException $e) {
42
+        }catch (ViewException $e){
43 43
             throw new MailerException(
44 44
                 sprintf('Invalid email template `%s`: %s', $message->getSubject(), $e->getMessage()),
45 45
                 $e->getCode(),
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         $msg = new Email();
51 51
 
52
-        if ($message->getFrom() !== null) {
52
+        if ($message->getFrom() !== null){
53 53
             $msg->from([$message->getFrom()]);
54 54
         }
55 55
 
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
         $msg->cc(...$message->getCC());
58 58
         $msg->bcc(...$message->getBCC());
59 59
 
60
-        try {
60
+        try{
61 61
             // render message partials
62 62
             $view->render(array_merge(['_msg_' => $msg], $message->getData()));
63
-        } catch (ViewException $e) {
63
+        }catch (ViewException $e){
64 64
             throw new MailerException(
65 65
                 sprintf('Unable to render email `%s`: %s', $message->getSubject(), $e->getMessage()),
66 66
                 $e->getCode(),
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public static function escapeSubject(string $subject): string
82 82
     {
83
-        if (!preg_match('/[^\x20-\x7e]/', $subject)) {
83
+        if (!preg_match('/[^\x20-\x7e]/', $subject)){
84 84
             // ascii-only subject, return as-is
85 85
             return $subject;
86 86
         }
@@ -90,6 +90,6 @@  discard block
 block discarded – undo
90 90
         $prefix = '=?UTF-8?q?';
91 91
         $suffix = '?=';
92 92
 
93
-        return $prefix . str_replace("=\r\n", $suffix . "\r\n  " . $prefix, $encoded) . $suffix;
93
+        return $prefix.str_replace("=\r\n", $suffix."\r\n  ".$prefix, $encoded).$suffix;
94 94
     }
95 95
 }
Please login to merge, or discard this patch.
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,9 +37,12 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function render(MessageInterface $message): Email
39 39
     {
40
-        try {
40
+        try
41
+        {
41 42
             $view = $this->views->get($message->getSubject());
42
-        } catch (ViewException $e) {
43
+        }
44
+        catch (ViewException $e)
45
+        {
43 46
             throw new MailerException(
44 47
                 sprintf('Invalid email template `%s`: %s', $message->getSubject(), $e->getMessage()),
45 48
                 $e->getCode(),
@@ -49,7 +52,8 @@  discard block
 block discarded – undo
49 52
 
50 53
         $msg = new Email();
51 54
 
52
-        if ($message->getFrom() !== null) {
55
+        if ($message->getFrom() !== null)
56
+        {
53 57
             $msg->from([$message->getFrom()]);
54 58
         }
55 59
 
@@ -57,10 +61,13 @@  discard block
 block discarded – undo
57 61
         $msg->cc(...$message->getCC());
58 62
         $msg->bcc(...$message->getBCC());
59 63
 
60
-        try {
64
+        try
65
+        {
61 66
             // render message partials
62 67
             $view->render(array_merge(['_msg_' => $msg], $message->getData()));
63
-        } catch (ViewException $e) {
68
+        }
69
+        catch (ViewException $e)
70
+        {
64 71
             throw new MailerException(
65 72
                 sprintf('Unable to render email `%s`: %s', $message->getSubject(), $e->getMessage()),
66 73
                 $e->getCode(),
@@ -80,7 +87,8 @@  discard block
 block discarded – undo
80 87
      */
81 88
     public static function escapeSubject(string $subject): string
82 89
     {
83
-        if (!preg_match('/[^\x20-\x7e]/', $subject)) {
90
+        if (!preg_match('/[^\x20-\x7e]/', $subject))
91
+        {
84 92
             // ascii-only subject, return as-is
85 93
             return $subject;
86 94
         }
Please login to merge, or discard this patch.
src/SendIt/src/Bootloader/BuilderBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,6 +35,6 @@
 block discarded – undo
35 35
      */
36 36
     public function boot(ViewsBootloader $views): void
37 37
     {
38
-        $views->addDirectory('sendit', __DIR__ . '/../../views');
38
+        $views->addDirectory('sendit', __DIR__.'/../../views');
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
src/SendIt/src/MailQueue.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function send(MessageInterface ...$message): void
44 44
     {
45
-        foreach ($message as $msg) {
45
+        foreach ($message as $msg){
46 46
             $this->queue->push(
47 47
                 self::JOB_NAME,
48 48
                 MessageSerializer::pack($msg),
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@
 block discarded – undo
42 42
      */
43 43
     public function send(MessageInterface ...$message): void
44 44
     {
45
-        foreach ($message as $msg) {
45
+        foreach ($message as $msg)
46
+        {
46 47
             $this->queue->push(
47 48
                 self::JOB_NAME,
48 49
                 MessageSerializer::pack($msg),
Please login to merge, or discard this patch.
src/SendIt/tests/RenderTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
     public function setUp(): void
27 27
     {
28 28
         $this->app = App::init([
29
-            'root' => __DIR__ . '/App',
30
-            'app'  => __DIR__ . '/App'
29
+            'root' => __DIR__.'/App',
30
+            'app'  => __DIR__.'/App'
31 31
         ]);
32 32
     }
33 33
 
Please login to merge, or discard this patch.
src/SendIt/tests/QueueTest.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@
 block discarded – undo
37 37
         $mail->setBCC('[email protected]');
38 38
 
39 39
         $queue->expects('push')->withArgs(
40
-            function ($job, $data, Options $options) use ($mail) {
40
+            function ($job, $data, Options $options) use ($mail)
41
+            {
41 42
                 $this->assertSame(MailQueue::JOB_NAME, $job);
42 43
                 $this->assertSame($data, MessageSerializer::pack($mail));
43 44
                 $this->assertSame('mailer', $options->getPipeline());
Please login to merge, or discard this patch.
src/Mailer/src/Message.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     public function __construct(string $subject, $to, array $data = [])
46 46
     {
47 47
         $this->setSubject($subject);
48
-        $this->setTo(...(array) $to);
48
+        $this->setTo(...(array)$to);
49 49
         $this->setData($data);
50 50
     }
51 51
 
Please login to merge, or discard this patch.