From d702b96070c1726a2ed69a1bdd6bff899ee6f0f3 Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Thu, 29 Aug 2013 19:58:23 +0200 Subject: [PATCH] Fix coding standards --- src/Faker/Provider/Base.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Faker/Provider/Base.php b/src/Faker/Provider/Base.php index 16980f82..e6d69db3 100644 --- a/src/Faker/Provider/Base.php +++ b/src/Faker/Provider/Base.php @@ -191,16 +191,16 @@ class Base /** * Chainable method for making any formatter optional - * @param float $weight Set the percentage that the formatter is empty. "0" would always return null, - * "1" would always return the formatter - * @return null or whatever the formatter would use + * @param float $weight Set the percentage that the formatter is empty. + * "0" would always return null, "1" would always return the formatter + * @return mixed|null */ public function optional($weight = 0.5) { - // Return the formatter - if (mt_rand() / mt_getrandmax() <= $weight) return $this->generator; + if (mt_rand() / mt_getrandmax() <= $weight) { + return $this->generator; + } - // Return NULL - else return new \Faker\NullGenerator(); + return new \Faker\NullGenerator(); } }