Jelajahi Sumber

Don't check for __invoke on non-objects

`method_exists` will cause autoloading for strings. Fixes #257
Dominic Scheirlinck 10 tahun lalu
induk
melakukan
6fbe2d5fa3
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/Configuration/Options.php

+ 1 - 1
src/Configuration/Options.php

@@ -100,7 +100,7 @@ class Options implements OptionsInterface
             $value = $this->input[$option];
             unset($this->input[$option]);
 
-            if (method_exists($value, '__invoke')) {
+            if (is_object($value) && method_exists($value, '__invoke')) {
                 $value = $value($this, $option);
             }