Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix fatal errors when classes have static or final methods

  • Loading branch information...
commit 5050b874665810fb4919edd3d6cb5dea764e8c58 1 parent 47b426d
Daniel Howlett authored
Showing with 20 additions and 0 deletions.
  1. +5 −0 src/Doubles/Core/Subject.php
  2. +15 −0 tests/src/Doubles/Test/Dummy.php
View
5 src/Doubles/Core/Subject.php
@@ -46,6 +46,11 @@ public function getMethodNames()
$methodNames = array();
foreach ($methods as $method) {
+
+ if ($method->isStatic() || $method->isFinal()) {
+ continue;
+ }
+
$methodNames[] = $method->name;
}
View
15 tests/src/Doubles/Test/Dummy.php
@@ -19,6 +19,21 @@ protected function getProtectedValue()
return 'bar';
}
+ /**
+ * Static functions are currently ignored. Including this ensures they don't
+ * cause any bugs when included.
+ */
+ public static function getStaticValue()
+ {
+ }
+
+ /**
+ * See getStaticValue()
+ */
+ final public function getFinalValue()
+ {
+ }
+
public function getConstructedValue()
{
return $this->constructedValue;
Please sign in to comment.
Something went wrong with that request. Please try again.