diff --git a/src/Facade/FactoryMuffin.php b/src/Facade/FactoryMuffin.php index 91e49a0..7000b31 100644 --- a/src/Facade/FactoryMuffin.php +++ b/src/Facade/FactoryMuffin.php @@ -12,14 +12,14 @@ * * @method static void setSaveMethod(string $method) Set the method we use when saving objects. * @method static void setDeleteMethod(string $method) Set the method we use when deleting objects. - * @method static object create(string $model, array $attr) Creates and saves in db an instance of the model. + * @method static object create(string $model, array $attr = array()) Creates and saves in db an instance of the model. * @method static mixed save(object $object) Save our object to the db, and keep track of it. * @method static object[] saved() Return an array of saved objects. * @method static void deleteSaved() Call the delete method on any saved objects. - * @method static object instance(string $model, array $attr, bool $save) Return an instance of the model. - * @method static array attributesFor(string $model, array $attr, bool $save) Returns the mock attributes for the model. - * @method static void define(string $model, array $definition) Define a new model factory. - * @method static string|object generateAttr(string $kind, string $model, bool $save) Generate the attributes. + * @method static object instance(string $model, array $attr = array(), bool $save = false) Return an instance of the model. + * @method static array attributesFor(string $model, array $attr = array(), bool $save = false) Returns the mock attributes for the model. + * @method static void define(string $model, array $definition = array()) Define a new model factory. + * @method static string|object generateAttr(string $kind, string $model = null, bool $save = false) Generate the attributes. * @method static void loadFactories(string|string[] $paths) Load the specified factories. * * @package League\FactoryMuffin\Facades @@ -56,6 +56,8 @@ protected static function fmInstance() /** * Handle dynamic, static calls to the object. * + * @codeCoverageIgnore + * * @param string $method * @param array $args * diff --git a/src/FactoryMuffin.php b/src/FactoryMuffin.php index fad81ab..80706c7 100644 --- a/src/FactoryMuffin.php +++ b/src/FactoryMuffin.php @@ -88,7 +88,7 @@ public function setDeleteMethod($method) * * @return object */ - public function create($model, $attr = array()) + public function create($model, array $attr = array()) { $obj = $this->instance($model, $attr, true); @@ -179,7 +179,7 @@ public function deleteSaved() * * @return object */ - public function instance($model, $attr = array(), $save = false) + public function instance($model, array $attr = array(), $save = false) { // Get the factory attributes for that model $attr_array = $this->attributesFor($model, $attr, $save); @@ -203,7 +203,7 @@ public function instance($model, $attr = array(), $save = false) * * @return array */ - public function attributesFor($model, $attr = array(), $save = false) + public function attributesFor($model, array $attr = array(), $save = false) { $factory_attrs = $this->getFactoryAttrs($model);