Completed
Push — master ( 4d24a6...d4ace1 )
by Terry
01:46
created
src/AssertionFailedException.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Terah\Assert;
4 4
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @param string $level
42 42
      * @param string $propertyPath
43 43
      */
44
-    public function __construct(string $message, int $code, string $fieldName='', $value='', array $constraints=[], string $level='critical', string $propertyPath='')
44
+    public function __construct(string $message, int $code, string $fieldName = '', $value = '', array $constraints = [ ], string $level = 'critical', string $propertyPath = '')
45 45
     {
46 46
         parent::__construct($message, $code);
47 47
         $this->fieldName        = $fieldName;
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
         $this->constraints      = $constraints;
50 50
         $this->level            = $level;
51 51
         $this->propertyPath     = $propertyPath;
52
-        foreach ( $this->getTrace() as $point )
52
+        foreach ($this->getTrace() as $point)
53 53
         {
54
-            $class = $point['class'] ??0?: '';
55
-            if ( $class !== Assert::class )
54
+            $class = $point[ 'class' ] ??0 ?: '';
55
+            if ($class !== Assert::class)
56 56
             {
57 57
                 $this->location = (object)$point;
58 58
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function getPropertyPathAndCallingLocation() : string
124 124
     {
125
-        return $this->getPropertyPath() . ' in ' . $this->getCallingFileAndLine();
125
+        return $this->getPropertyPath().' in '.$this->getCallingFileAndLine();
126 126
     }
127 127
 
128 128
     /**
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
      */
134 134
     protected function getCallingFileAndLine() : string
135 135
     {
136
-        foreach ( $this->getTrace() as $trace )
136
+        foreach ($this->getTrace() as $trace)
137 137
         {
138 138
             $trace = (object)$trace;
139
-            if ( empty($trace->file) )
139
+            if (empty($trace->file))
140 140
             {
141 141
                 continue;
142 142
             }
143 143
             $file = static::beforeLast('.php', static::afterLast('/', $trace->file));
144
-            if ( in_array($file, ['AssertionChain', 'Assertion']) )
144
+            if (in_array($file, [ 'AssertionChain', 'Assertion' ]))
145 145
             {
146 146
                 continue;
147 147
             }
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
      * @param bool $returnOriginal
169 169
      * @return string
170 170
      */
171
-    public static function afterLast(string $needle, string $haystack, bool $returnOriginal=false) : string
171
+    public static function afterLast(string $needle, string $haystack, bool $returnOriginal = false) : string
172 172
     {
173
-        if ( static::strrevpos($haystack, $needle) !== -1 )
173
+        if (static::strrevpos($haystack, $needle) !== -1)
174 174
         {
175 175
             return mb_substr($haystack, static::strrevpos($haystack, $needle) + mb_strlen($needle));
176 176
         }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public static function beforeLast(string $needle, string $haystack) : string
199 199
     {
200
-        $position   = static::strrevpos($haystack, $needle);
200
+        $position = static::strrevpos($haystack, $needle);
201 201
 
202 202
         return $position === -1 ? '' : mb_substr($haystack, 0, static::strrevpos($haystack, $needle));
203 203
     }
Please login to merge, or discard this patch.