Passed
Branch master (1a0423)
by jelmer
02:33
created
src/Monolog/SlackWebhookHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      *
40 40
      * @throws MissingExtensionException When the curl extension is not activated
41 41
      */
42
-    public function __construct(SlackConfig $slackConfig, MonologConfig $monologConfig, Curl\Util $curlUtil)
42
+    public function __construct (SlackConfig $slackConfig, MonologConfig $monologConfig, Curl\Util $curlUtil)
43 43
     {
44 44
         parent::__construct($monologConfig->getLevel(), $monologConfig->doesBubble());
45 45
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     /**
52 52
      * {@inheritdoc}
53 53
      */
54
-    public function write(array $record)
54
+    public function write (array $record)
55 55
     {
56 56
         $curlUtil = $this->curlUtil;
57 57
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * @return array
74 74
      */
75
-    private function getPayload($record)
75
+    private function getPayload ($record)
76 76
     {
77 77
         return [
78 78
             'payload' => new Payload($record, $this->slackConfig),
Please login to merge, or discard this patch.
src/Slack/Attachment/BasicInfoAttachment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param array $record
35 35
      * @param ErrorInterface $error
36 36
      */
37
-    public function __construct(array $record, ErrorInterface $error = null)
37
+    public function __construct (array $record, ErrorInterface $error = null)
38 38
     {
39 39
         $this->record = $record;
40 40
         $this->error = $error;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return Colour
62 62
      */
63
-    private function getColourForLoggerLevel()
63
+    private function getColourForLoggerLevel ()
64 64
     {
65 65
         switch (true) {
66 66
             case $this->record['level'] >= Logger::ERROR:
Please login to merge, or discard this patch.
src/Slack/Attachment/TraceAttachment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @param ErrorInterface $error
36 36
      * @param StringFormat $formatter
37 37
      */
38
-    public function __construct(ErrorInterface $error, StringFormat $formatter)
38
+    public function __construct (ErrorInterface $error, StringFormat $formatter)
39 39
     {
40 40
         $this->error = $error;
41 41
         $this->formatter = $formatter;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         );
54 54
     }
55 55
 
56
-    private function parseTraceItem(array $traceItem)
56
+    private function parseTraceItem (array $traceItem)
57 57
     {
58 58
         $text = '';
59 59
         $info = [
Please login to merge, or discard this patch.
src/Slack/Payload.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @param array $record
50 50
      * @param SlackConfigInterface $slackConfig
51 51
      */
52
-    public function __construct(array $record, SlackConfigInterface $slackConfig = null)
52
+    public function __construct (array $record, SlackConfigInterface $slackConfig = null)
53 53
     {
54 54
         $this->record = $record;
55 55
         $this->slackConfig = $slackConfig;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $this->generatePayload();
58 58
     }
59 59
 
60
-    private function generatePayload()
60
+    private function generatePayload ()
61 61
     {
62 62
         $this->setErrorData();
63 63
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     /**
72 72
      * Generate the payload for the slack config.
73 73
      */
74
-    private function generatePayloadForSlackConfig()
74
+    private function generatePayloadForSlackConfig ()
75 75
     {
76 76
         $this->setChannel();
77 77
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         }
81 81
     }
82 82
 
83
-    private function generatePayloadForCustomUser()
83
+    private function generatePayloadForCustomUser ()
84 84
     {
85 85
         $this->setIcon();
86 86
         $this->setUsername();
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     /**
90 90
      * Set a custom icon if available.
91 91
      */
92
-    private function setIcon()
92
+    private function setIcon ()
93 93
     {
94 94
         if (!$this->slackConfig->getCustomUser()->hasIcon()) {
95 95
             return;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     /**
103 103
      * Set a custom username if available.
104 104
      */
105
-    private function setUsername()
105
+    private function setUsername ()
106 106
     {
107 107
         if (!$this->slackConfig->getCustomUser()->hasUsername()) {
108 108
             return;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     /**
115 115
      * Set a custom channel if available.
116 116
      */
117
-    private function setChannel()
117
+    private function setChannel ()
118 118
     {
119 119
         if (!$this->slackConfig->getWebhook()->hasCustomChannel()) {
120 120
             return;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     /**
127 127
      * If available set the error data.
128 128
      */
129
-    private function setErrorData()
129
+    private function setErrorData ()
130 130
     {
131 131
         if (!isset($this->record['context']['error'])) {
132 132
             return;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $this->errorData = $this->record['context']['error'];
136 136
     }
137 137
 
138
-    private function setAttachments()
138
+    private function setAttachments ()
139 139
     {
140 140
         $this->payload['attachments'] = [
141 141
             new BasicInfoAttachment($this->record, $this->errorData),
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         }
147 147
     }
148 148
 
149
-    private function addErrorSpecificAttachments()
149
+    private function addErrorSpecificAttachments ()
150 150
     {
151 151
         $formatter = new StringFormat();
152 152
         $this->payload['attachments'][] = new TraceAttachment($this->errorData, $formatter);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     /**
156 156
      * {@inheritdoc}
157 157
      */
158
-    public function jsonSerialize()
158
+    public function jsonSerialize ()
159 159
     {
160 160
         return $this->payload;
161 161
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     /**
164 164
      * @inheritDoc
165 165
      */
166
-    public function __toString()
166
+    public function __toString ()
167 167
     {
168 168
         return json_encode($this->jsonSerialize());
169 169
     }
Please login to merge, or discard this patch.
src/Slack/StringFormat.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      *
23 23
      * @return string
24 24
      */
25
-    public function escape($unescapedText)
25
+    public function escape ($unescapedText)
26 26
     {
27 27
         return str_replace(['&', '<', '>'], ['&amp;', '&lt;', '&gt;'], $unescapedText);
28 28
     }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      *
35 35
      * @return string
36 36
      */
37
-    public function emphasis($text)
37
+    public function emphasis ($text)
38 38
     {
39 39
         return $this->wrapStringWith($text, '*');
40 40
     }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      *
47 47
      * @return string
48 48
      */
49
-    public function italicize($text)
49
+    public function italicize ($text)
50 50
     {
51 51
         return $this->wrapStringWith($text, '_');
52 52
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      *
59 59
      * @return string
60 60
      */
61
-    public function strikethrough($text)
61
+    public function strikethrough ($text)
62 62
     {
63 63
         return $this->wrapStringWith($text, '~');
64 64
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return string
72 72
      */
73
-    public function pre($text)
73
+    public function pre ($text)
74 74
     {
75 75
         return $this->wrapStringWith($text, '```');
76 76
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      *
83 83
      * @return string
84 84
      */
85
-    public function code($text)
85
+    public function code ($text)
86 86
     {
87 87
         return $this->wrapStringWith($text, '`');
88 88
     }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      *
97 97
      * @return string
98 98
      */
99
-    public function indent($text)
99
+    public function indent ($text)
100 100
     {
101 101
         return '>' . str_replace("\n", "\n>", $text);
102 102
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      *
109 109
      * @return string
110 110
      */
111
-    public function arrayToNumberedList(array $listItems)
111
+    public function arrayToNumberedList (array $listItems)
112 112
     {
113 113
         $formattedList = '';
114 114
         $number = 1;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      *
128 128
      * @return string
129 129
      */
130
-    public function arrayToKeyValueList(array $listItems)
130
+    public function arrayToKeyValueList (array $listItems)
131 131
     {
132 132
         $formattedList = '';
133 133
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      *
147 147
      * @return string
148 148
      */
149
-    public function arrayToBulletList(array $listItems, $bulletCharacter = '•')
149
+    public function arrayToBulletList (array $listItems, $bulletCharacter = '•')
150 150
     {
151 151
         $formattedList = '';
152 152
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      *
166 166
      * @return string
167 167
      */
168
-    private function wrapStringWith($text, $wrapper)
168
+    private function wrapStringWith ($text, $wrapper)
169 169
     {
170 170
         return sprintf("%1\$s%2\$s%1\$s", $wrapper, $text);
171 171
     }
Please login to merge, or discard this patch.