Browse Source

put str_object back in.

Taylor Otwell 12 years ago
parent
commit
4bee6d1bca
1 changed files with 11 additions and 0 deletions
  1. 11 0
      laravel/helpers.php

+ 11 - 0
laravel/helpers.php

@@ -366,6 +366,17 @@ function str_finish($value, $cap)
 	return rtrim($value, $cap).$cap;
 }
 
+/**
+ * Determine if the given object has a toString method.
+ *
+ * @param  object  $value
+ * @return bool
+ */
+function str_object($value)
+{
+	return is_object($value) and method_exists($value, '__toString');
+}
+
 /**
  * Get the root namespace of a given class.
  *