Completed
Branch dev-hide-sensitive-data (cbca34)
by Tyler
02:20
created
src/Factories/MonologHandlerFactory.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
 
108 108
     /**
109 109
      * Validates that the subject is an unempty string
110
-     * @param  mixed $subject The value to check
110
+     * @param  string $subject The value to check
111 111
      * @return void
112 112
      */
113 113
     private function checkSubject($subject) {
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 namespace Tylercd100\LERN\Notifications;
4 4
 
5 5
 use Exception;
6
-use Monolog\Logger;
7 6
 use Monolog\Handler\HandlerInterface;
7
+use Monolog\Logger;
8 8
 use Tylercd100\LERN\Notifications\MonologHandlerFactory;
9 9
 
10 10
 class Notifier {
Please login to merge, or discard this patch.
src/Components/Notifier.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 use Exception;
6 6
 use Monolog\Handler\HandlerInterface;
7 7
 use Monolog\Logger;
8
-use Tylercd100\LERN\Factories\MonologHandlerFactory;
9 8
 use Tylercd100\LERN\Exceptions\NotifierFailedException;
9
+use Tylercd100\LERN\Factories\MonologHandlerFactory;
10 10
 
11 11
 class Notifier extends Component {
12 12
     protected $config;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function send(Exception $e, array $context = []) {
112 112
         
113
-        if($this->shouldntHandle($e)){
113
+        if ($this->shouldntHandle($e)) {
114 114
             return false;
115 115
         }
116 116
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $message = $this->getMessage($e);
121 121
         $subject = $this->getSubject($e);
122 122
         
123
-        try{
123
+        try {
124 124
             foreach ($drivers as $driver) {
125 125
                 $handler = $factory->create($driver, $subject);
126 126
                 $this->log->pushHandler($handler);
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
      * @param  array  $context Additional information that you would like to pass to Monolog
142 142
      * @return array           The modified context array
143 143
      */
144
-    protected function buildContext(array $context = []){
145
-        if(in_array('pushover', $this->drivers)){
144
+    protected function buildContext(array $context = []) {
145
+        if (in_array('pushover', $this->drivers)) {
146 146
             $context['sound'] = $this->config['pushover']['sound'];
147 147
         }
148 148
         return $context;
Please login to merge, or discard this patch.
src/Components/Recorder.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@
 block discarded – undo
86 86
             case 'data':
87 87
                 return $this->getData();
88 88
             case 'status_code':
89
-                if($e===null)
90
-                    return 0;
89
+                if($e===null) {
90
+                                    return 0;
91
+                }
91 92
                 return $this->getStatusCode($e);
92 93
             default:
93 94
                 throw new Exception("{$key} is not supported! Therefore it cannot be collected!");
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 use Tylercd100\LERN\Exceptions\RecorderFailedException;
11 11
 use Tylercd100\LERN\Models\ExceptionModel;
12 12
 
13
-class Recorder extends Component{
13
+class Recorder extends Component {
14 14
 
15 15
     /**
16 16
      * @var mixed
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function record(Exception $e)
33 33
     {
34
-        if($this->shouldntHandle($e)){
34
+        if ($this->shouldntHandle($e)) {
35 35
             return false;
36 36
         }
37 37
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     /**
77 77
      * @param string $key
78 78
      */
79
-    protected function collect($key,Exception $e = null){
79
+    protected function collect($key, Exception $e = null) {
80 80
         switch ($key) {
81 81
             case 'user_id':
82 82
                 return $this->getUserId();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             case 'data':
88 88
                 return $this->getData();
89 89
             case 'status_code':
90
-                if($e===null)
90
+                if ($e === null)
91 91
                     return 0;
92 92
                 return $this->getStatusCode($e);
93 93
             default:
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
      * @param  array  &$data [description]
167 167
      * @return void
168 168
      */
169
-    protected function excludeKeys(array $data){
169
+    protected function excludeKeys(array $data) {
170 170
         $keys = $this->config['excludeKeys'];
171 171
         foreach ($data as $key => &$value) {
172
-            if(in_array($key,$keys)){
172
+            if (in_array($key, $keys)) {
173 173
                 unset($data[$key]);
174
-            } else if(is_array($value)){
174
+            } else if (is_array($value)) {
175 175
                 $value = $this->excludeKeys($value);
176 176
             }
177 177
         }
Please login to merge, or discard this patch.
src/Components/Component.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
      * @param  \Exception  $e
26 26
      * @return bool
27 27
      */
28
-    protected function shouldntHandle(Exception $e){
29
-        $dontHandle = array_merge($this->dontHandle,$this->absolutelyDontHandle);
28
+    protected function shouldntHandle(Exception $e) {
29
+        $dontHandle = array_merge($this->dontHandle, $this->absolutelyDontHandle);
30 30
 
31 31
         foreach ($dontHandle as $type) {
32 32
             if ($e instanceof $type) {
Please login to merge, or discard this patch.
src/Exceptions/RecorderFailedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Tylercd100\LERN\Exceptions;
4 4
 
5
-class RecorderFailedException extends \Exception{
5
+class RecorderFailedException extends \Exception {
6 6
 
7 7
 }
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/NotifierFailedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Tylercd100\LERN\Exceptions;
4 4
 
5
-class NotifierFailedException extends \Exception{
5
+class NotifierFailedException extends \Exception {
6 6
 
7 7
 }
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
config/lern.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         'pushover'=>[
45 45
             'token' => env('PUSHOVER_APP_TOKEN'),
46 46
             'user'  => env('PUSHOVER_USER_KEY'),
47
-            'sound' => env('PUSHOVER_SOUND_ERROR','siren'), // https://pushover.net/api#sounds
47
+            'sound' => env('PUSHOVER_SOUND_ERROR', 'siren'), // https://pushover.net/api#sounds
48 48
         ],
49 49
 
50 50
         /**
Please login to merge, or discard this patch.