Completed
Push — master ( 97969c...f86d77 )
by Ryosuke
02:19
created
src/Convert.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $argc = count($args);
48 48
         if ($argc < $required) {
49
-            throw new \InvalidArgumentException(get_called_class() . "::$method() expects at least $required parameters, $argc given");
49
+            throw new \InvalidArgumentException(get_called_class()."::$method() expects at least $required parameters, $argc given");
50 50
         }
51 51
         if ($required === 2 and !is_string($args[0]) and !is_object($args[0]) || !method_exists($args[0], '__toString')) {
52
-            throw new \InvalidArgumentException(get_called_class() . "::$method() expects parameter 1 to be string, " . gettype($args[0]) . ' given');
52
+            throw new \InvalidArgumentException(get_called_class()."::$method() expects parameter 1 to be string, ".gettype($args[0]).' given');
53 53
         }
54 54
         if (!is_callable($args[$required - 1])) {
55
-            throw new \InvalidArgumentException(get_called_class() . "::$method() expects parameter $required to be callable, " . gettype($args[$required - 1]) . ' given');
55
+            throw new \InvalidArgumentException(get_called_class()."::$method() expects parameter $required to be callable, ".gettype($args[$required - 1]).' given');
56 56
         }
57 57
         if (isset($args[$required]) && !is_numeric($args[$required])) {
58
-            throw new \InvalidArgumentException(get_called_class() . "::$method() expects parameter " . ($required + 1) . ' to be integer, ' . gettype($args[$required]) . ' given');
58
+            throw new \InvalidArgumentException(get_called_class()."::$method() expects parameter ".($required + 1).' to be integer, '.gettype($args[$required]).' given');
59 59
         }
60 60
     }
61 61
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public static function __callStatic($method, array $args)
68 68
     {
69 69
         if (strtolower(substr($method, 0, 2)) !== 'to') {
70
-            throw new \BadMethodCallException('Call to undefined method ' . get_called_class() . "::$method()");
70
+            throw new \BadMethodCallException('Call to undefined method '.get_called_class()."::$method()");
71 71
         }
72 72
 
73 73
         $class = substr($method, 2);
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
         self::validateArgumentTypes($method, $args, $required);
76 76
 
77 77
         if ($class === '') {
78
-            $class = (string)array_shift($args);
78
+            $class = (string) array_shift($args);
79 79
         }
80 80
 
81 81
         if (!class_exists($class) and !is_subclass_of($class, '\Exception') and \PHP_VERSION < 7 || !is_subclass_of($class, '\Throwable')) {
82 82
             throw new \DomainException("The class \"$class\" must be an instance of Exception or Throwable");
83 83
         }
84 84
 
85
-        return Core::handle($args[0], function ($severity, $message, $file, $line) use ($class, $args) {
85
+        return Core::handle($args[0], function($severity, $message, $file, $line) use ($class, $args) {
86 86
             if (!(error_reporting() & $severity)) {
87 87
                 return;
88 88
             }
89 89
             throw Core::rewriteLocation(new $class($message), $file, $line);
90
-        }, isset($args[1]) ? (int)$args[1] : E_ALL | E_STRICT);
90
+        }, isset($args[1]) ? (int) $args[1] : E_ALL | E_STRICT);
91 91
     }
92 92
 
93 93
     /**
@@ -98,17 +98,17 @@  discard block
 block discarded – undo
98 98
     public static function toErrorException($callback, $types = E_ALL | E_STRICT)
99 99
     {
100 100
         if (!is_callable($callback)) {
101
-            throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 1 to be callable, ' . gettype($callback) . ' given');
101
+            throw new \InvalidArgumentException(get_called_class().'::'.__METHOD__.'() expects parameter 1 to be callable, '.gettype($callback).' given');
102 102
         }
103 103
         if ($types !== null && !is_numeric($types)) {
104
-            throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 2 to be integer, ' . gettype($types) . ' given');
104
+            throw new \InvalidArgumentException(get_called_class().'::'.__METHOD__.'() expects parameter 2 to be integer, '.gettype($types).' given');
105 105
         }
106 106
 
107
-        return Core::handle($callback, function ($severity, $message, $file, $line) {
107
+        return Core::handle($callback, function($severity, $message, $file, $line) {
108 108
             if (!(error_reporting() & $severity)) {
109 109
                 return;
110 110
             }
111 111
             throw new \ErrorException($message, 0, $severity, $file, $line);
112
-        }, (int)$types);
112
+        }, (int) $types);
113 113
     }
114 114
 }
115 115
\ No newline at end of file
Please login to merge, or discard this patch.