diff --git a/src/Faker/Calculator/Iban.php b/src/Faker/Calculator/Iban.php index 99c0f0efc7..ee2c459139 100644 --- a/src/Faker/Calculator/Iban.php +++ b/src/Faker/Calculator/Iban.php @@ -24,6 +24,9 @@ public static function checksum($iban) return str_pad($checksum, 2, '0', STR_PAD_LEFT); } + /** + * @return int + */ private static function alphaToNumberCallback($match) { return self::alphaToNumber($match[0]); @@ -44,7 +47,6 @@ public static function alphaToNumber($char) * Calculates mod97 on a numeric string * * @param string $number Numeric string - * @param int * @return int */ public static function mod97($number) @@ -59,6 +61,7 @@ public static function mod97($number) /** * Checks whether an IBAN has a valid checksum * + * @param string $iban * @return boolean */ public static function isValid($iban) diff --git a/src/Faker/Calculator/Luhn.php b/src/Faker/Calculator/Luhn.php index 4caad29fb3..f0a86023d5 100644 --- a/src/Faker/Calculator/Luhn.php +++ b/src/Faker/Calculator/Luhn.php @@ -13,6 +13,7 @@ class Luhn { /** + * @param string $number * @return int */ private static function checksum($number) @@ -31,6 +32,7 @@ private static function checksum($number) } /** + * @param $partialNumber * @return string */ public static function computeCheckDigit($partialNumber) @@ -46,7 +48,8 @@ public static function computeCheckDigit($partialNumber) /** * Checks whether a number (partial number + check digit) is Luhn compliant * - * @return boolean + * @param string $number + * @return bool */ public static function isValid($number) { diff --git a/src/Faker/DefaultGenerator.php b/src/Faker/DefaultGenerator.php index 03e3d60d84..4210f93fef 100644 --- a/src/Faker/DefaultGenerator.php +++ b/src/Faker/DefaultGenerator.php @@ -15,11 +15,18 @@ public function __construct($default = null) $this->default = $default; } + /** + * @param string $attribute + */ public function __get($attribute) { return $this->default; } + /** + * @param string $method + * @param array $attributes + */ public function __call($method, $attributes) { return $this->default; diff --git a/src/Faker/Documentor.php b/src/Faker/Documentor.php index 216e208d19..e42bdf40d3 100644 --- a/src/Faker/Documentor.php +++ b/src/Faker/Documentor.php @@ -6,11 +6,17 @@ class Documentor { protected $generator; + /** + * @param Generator $generator + */ public function __construct(Generator $generator) { $this->generator = $generator; } + /** + * @return array + */ public function getFormatters() { $formatters = array(); diff --git a/src/Faker/Factory.php b/src/Faker/Factory.php index 756539bd2b..e02bc7d2bb 100644 --- a/src/Faker/Factory.php +++ b/src/Faker/Factory.php @@ -25,6 +25,11 @@ public static function create($locale = self::DEFAULT_LOCALE) return $generator; } + /** + * @param string $provider + * @param string $locale + * @return string + */ protected static function getProviderClassname($provider, $locale = '') { if ($providerClass = self::findProviderClassname($provider, $locale)) { @@ -41,6 +46,11 @@ protected static function getProviderClassname($provider, $locale = '') throw new \InvalidArgumentException(sprintf('Unable to find provider "%s" with locale "%s"', $provider, $locale)); } + /** + * @param string $provider + * @param string $locale + * @return string + */ protected static function findProviderClassname($provider, $locale = '') { $providerClass = 'Faker\\' . ($locale ? sprintf('Provider\%s\%s', $locale, $provider) : sprintf('Provider\%s', $provider)); diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php index 3378797360..9316a132d2 100644 --- a/src/Faker/Generator.php +++ b/src/Faker/Generator.php @@ -228,11 +228,18 @@ protected function callFormatWithMatches($matches) return $this->format($matches[1]); } + /** + * @param string $attribute + */ public function __get($attribute) { return $this->format($attribute); } + /** + * @param string $method + * @param array $attributes + */ public function __call($method, $attributes) { return $this->format($method, $attributes); diff --git a/src/Faker/Guesser/Name.php b/src/Faker/Guesser/Name.php index 856920f66d..0b303db160 100644 --- a/src/Faker/Guesser/Name.php +++ b/src/Faker/Guesser/Name.php @@ -8,6 +8,9 @@ class Name { protected $generator; + /** + * @param \Faker\Generator $generator + */ public function __construct(\Faker\Generator $generator) { $this->generator = $generator; diff --git a/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php b/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php index 0796c1690e..78412e84c5 100644 --- a/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php +++ b/src/Faker/ORM/CakePHP/ColumnTypeGuesser.php @@ -11,6 +11,9 @@ public function __construct(\Faker\Generator $generator) $this->generator = $generator; } + /** + * @return \Closure|null + */ public function guessFormat($column, $table) { $generator = $this->generator; diff --git a/src/Faker/ORM/CakePHP/EntityPopulator.php b/src/Faker/ORM/CakePHP/EntityPopulator.php index b64a1de39e..2873b406c1 100644 --- a/src/Faker/ORM/CakePHP/EntityPopulator.php +++ b/src/Faker/ORM/CakePHP/EntityPopulator.php @@ -17,11 +17,17 @@ public function __construct($class) $this->class = $class; } + /** + * @param string $name + */ public function __get($name) { return $this->{$name}; } + /** + * @param string $name + */ public function __set($name, $value) { $this->{$name} = $value; @@ -37,6 +43,9 @@ public function mergeModifiersWith($modifiers) $this->modifiers = array_merge($this->modifiers, $modifiers); } + /** + * @return array + */ public function guessColumnFormatters($populator) { $formatters = []; @@ -71,7 +80,10 @@ public function guessColumnFormatters($populator) return $formatters; } - public function guessModifiers($populator) + /** + * @return array + */ + public function guessModifiers() { $modifiers = []; $table = $this->getTable($this->class); @@ -109,6 +121,9 @@ public function guessModifiers($populator) return $modifiers; } + /** + * @param array $options + */ public function execute($class, $insertedEntities, $options = []) { $table = $this->getTable($class); diff --git a/src/Faker/ORM/CakePHP/Populator.php b/src/Faker/ORM/CakePHP/Populator.php index 4c42b28148..9744d30d0f 100644 --- a/src/Faker/ORM/CakePHP/Populator.php +++ b/src/Faker/ORM/CakePHP/Populator.php @@ -10,21 +10,33 @@ class Populator protected $quantities = []; protected $guessers = []; + /** + * @param \Faker\Generator $generator + */ public function __construct(\Faker\Generator $generator) { $this->generator = $generator; } + /** + * @return \Faker\Generator + */ public function getGenerator() { return $this->generator; } + /** + * @return array + */ public function getGuessers() { return $this->guessers; } + /** + * @return $this + */ public function removeGuesser($name) { if ($this->guessers[$name]) { @@ -33,6 +45,10 @@ public function removeGuesser($name) return $this; } + /** + * @return $this + * @throws \Exception + */ public function addGuesser($class) { if (!is_object($class)) { @@ -47,7 +63,12 @@ public function addGuesser($class) return $this; } - public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = []) + /** + * @param array $customColumnFormatters + * @param array $customModifiers + * @return $this + */ + public function addEntEntityPopulatority($entity, $number, $customColumnFormatters = [], $customModifiers = []) { if (!$entity instanceof EntityPopulator) { $entity = new EntityPopulator($entity); @@ -69,6 +90,10 @@ public function addEntity($entity, $number, $customColumnFormatters = [], $custo return $this; } + /** + * @param array $options + * @return array + */ public function execute($options = []) { $insertedEntities = []; diff --git a/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php b/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php index 899dc95b70..824f8c034a 100644 --- a/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php +++ b/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php @@ -8,11 +8,18 @@ class ColumnTypeGuesser { protected $generator; + /** + * @param \Faker\Generator $generator + */ public function __construct(\Faker\Generator $generator) { $this->generator = $generator; } + /** + * @param ClassMetadata $class + * @return \Closure|null + */ public function guessFormat($fieldName, ClassMetadata $class) { $generator = $this->generator; diff --git a/src/Faker/ORM/Doctrine/EntityPopulator.php b/src/Faker/ORM/Doctrine/EntityPopulator.php index 3eab1a2423..13e22086f9 100644 --- a/src/Faker/ORM/Doctrine/EntityPopulator.php +++ b/src/Faker/ORM/Doctrine/EntityPopulator.php @@ -42,11 +42,17 @@ public function getClass() return $this->class->getName(); } + /** + * @param $columnFormatters + */ public function setColumnFormatters($columnFormatters) { $this->columnFormatters = $columnFormatters; } + /** + * @return array + */ public function getColumnFormatters() { return $this->columnFormatters; @@ -57,21 +63,34 @@ public function mergeColumnFormattersWith($columnFormatters) $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); } + /** + * @param array $modifiers + */ public function setModifiers(array $modifiers) { $this->modifiers = $modifiers; } + /** + * @return array + */ public function getModifiers() { return $this->modifiers; } + /** + * @param array $modifiers + */ public function mergeModifiersWith(array $modifiers) { $this->modifiers = array_merge($this->modifiers, $modifiers); } + /** + * @param \Faker\Generator $generator + * @return array + */ public function guessColumnFormatters(\Faker\Generator $generator) { $formatters = array(); @@ -139,6 +158,9 @@ public function guessColumnFormatters(\Faker\Generator $generator) /** * Insert one new record using the Entity class. + * @param ObjectManager $manager + * @param bool $generateId + * @return EntityPopulator */ public function execute(ObjectManager $manager, $insertedEntities, $generateId = false) { @@ -177,6 +199,10 @@ private function callMethods($obj, $insertedEntities) } } + /** + * @param EntityManagerInterface $manager + * @return int|null + */ private function generateId($obj, $column, EntityManagerInterface $manager) { /* @var $repository \Doctrine\ORM\EntityRepository */ diff --git a/src/Faker/ORM/Doctrine/Populator.php b/src/Faker/ORM/Doctrine/Populator.php index 27114c03df..d4fe897c61 100644 --- a/src/Faker/ORM/Doctrine/Populator.php +++ b/src/Faker/ORM/Doctrine/Populator.php @@ -16,6 +16,10 @@ class Populator protected $quantities = array(); protected $generateId = array(); + /** + * @param \Faker\Generator $generator + * @param ObjectManager|null $manager + */ public function __construct(\Faker\Generator $generator, ObjectManager $manager = null) { $this->generator = $generator; @@ -51,7 +55,7 @@ public function addEntity($entity, $number, $customColumnFormatters = array(), $ /** * Populate the database using all the Entity classes previously added. * - * @param EntityManager $entityManager A Doctrine connection object + * @param null|EntityManager $entityManager A Doctrine connection object * * @return array A list of the inserted PKs */ diff --git a/src/Faker/ORM/Mandango/ColumnTypeGuesser.php b/src/Faker/ORM/Mandango/ColumnTypeGuesser.php index e64dc758f6..d318b0aa09 100644 --- a/src/Faker/ORM/Mandango/ColumnTypeGuesser.php +++ b/src/Faker/ORM/Mandango/ColumnTypeGuesser.php @@ -6,11 +6,17 @@ class ColumnTypeGuesser { protected $generator; + /** + * @param \Faker\Generator $generator + */ public function __construct(\Faker\Generator $generator) { $this->generator = $generator; } + /** + * @return \Closure|null + */ public function guessFormat($field) { $generator = $this->generator; diff --git a/src/Faker/ORM/Mandango/EntityPopulator.php b/src/Faker/ORM/Mandango/EntityPopulator.php index 061df77f66..667f5bec36 100644 --- a/src/Faker/ORM/Mandango/EntityPopulator.php +++ b/src/Faker/ORM/Mandango/EntityPopulator.php @@ -23,6 +23,9 @@ public function __construct($class) $this->class = $class; } + /** + * @return string + */ public function getClass() { return $this->class; @@ -33,6 +36,9 @@ public function setColumnFormatters($columnFormatters) $this->columnFormatters = $columnFormatters; } + /** + * @return array + */ public function getColumnFormatters() { return $this->columnFormatters; @@ -43,6 +49,11 @@ public function mergeColumnFormattersWith($columnFormatters) $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); } + /** + * @param \Faker\Generator $generator + * @param Mandango $mandango + * @return array + */ public function guessColumnFormatters(\Faker\Generator $generator, Mandango $mandango) { $formatters = array(); @@ -82,6 +93,7 @@ public function guessColumnFormatters(\Faker\Generator $generator, Mandango $man /** * Insert one new record using the Entity class. + * @param Mandango $mandango */ public function execute(Mandango $mandango, $insertedEntities) { diff --git a/src/Faker/ORM/Mandango/Populator.php b/src/Faker/ORM/Mandango/Populator.php index 57a06a54b8..26736dc4d5 100644 --- a/src/Faker/ORM/Mandango/Populator.php +++ b/src/Faker/ORM/Mandango/Populator.php @@ -15,6 +15,10 @@ class Populator protected $entities = array(); protected $quantities = array(); + /** + * @param \Faker\Generator $generator + * @param Mandango $mandango + */ public function __construct(\Faker\Generator $generator, Mandango $mandango) { $this->generator = $generator; diff --git a/src/Faker/ORM/Propel/ColumnTypeGuesser.php b/src/Faker/ORM/Propel/ColumnTypeGuesser.php index e4067687de..ac9cdb42ea 100644 --- a/src/Faker/ORM/Propel/ColumnTypeGuesser.php +++ b/src/Faker/ORM/Propel/ColumnTypeGuesser.php @@ -9,11 +9,18 @@ class ColumnTypeGuesser { protected $generator; + /** + * @param \Faker\Generator $generator + */ public function __construct(\Faker\Generator $generator) { $this->generator = $generator; } + /** + * @param ColumnMap $column + * @return \Closure|null + */ public function guessFormat(ColumnMap $column) { $generator = $this->generator; diff --git a/src/Faker/ORM/Propel/EntityPopulator.php b/src/Faker/ORM/Propel/EntityPopulator.php index 5af6810086..7c0b112a56 100644 --- a/src/Faker/ORM/Propel/EntityPopulator.php +++ b/src/Faker/ORM/Propel/EntityPopulator.php @@ -24,6 +24,9 @@ public function __construct($class) $this->class = $class; } + /** + * @return string + */ public function getClass() { return $this->class; @@ -34,6 +37,9 @@ public function setColumnFormatters($columnFormatters) $this->columnFormatters = $columnFormatters; } + /** + * @return array + */ public function getColumnFormatters() { return $this->columnFormatters; @@ -44,6 +50,10 @@ public function mergeColumnFormattersWith($columnFormatters) $this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters); } + /** + * @param \Faker\Generator $generator + * @return array + */ public function guessColumnFormatters(\Faker\Generator $generator) { $formatters = array(); @@ -80,6 +90,10 @@ public function guessColumnFormatters(\Faker\Generator $generator) return $formatters; } + /** + * @param ColumnMap $columnMap + * @return bool + */ protected function isColumnBehavior(ColumnMap $columnMap) { foreach ($columnMap->getTable()->getBehaviors() as $name => $params) { @@ -108,6 +122,9 @@ public function setModifiers($modifiers) $this->modifiers = $modifiers; } + /** + * @return array + */ public function getModifiers() { return $this->modifiers; @@ -118,6 +135,10 @@ public function mergeModifiersWith($modifiers) $this->modifiers = array_merge($this->modifiers, $modifiers); } + /** + * @param \Faker\Generator $generator + * @return array + */ public function guessModifiers(\Faker\Generator $generator) { $modifiers = array(); diff --git a/src/Faker/ORM/Propel/Populator.php b/src/Faker/ORM/Propel/Populator.php index 067229bc02..4285727805 100644 --- a/src/Faker/ORM/Propel/Populator.php +++ b/src/Faker/ORM/Propel/Populator.php @@ -12,6 +12,9 @@ class Populator protected $entities = array(); protected $quantities = array(); + /** + * @param \Faker\Generator $generator + */ public function __construct(\Faker\Generator $generator) { $this->generator = $generator; diff --git a/src/Faker/UniqueGenerator.php b/src/Faker/UniqueGenerator.php index 335882dd4d..536f0dbf83 100644 --- a/src/Faker/UniqueGenerator.php +++ b/src/Faker/UniqueGenerator.php @@ -12,6 +12,9 @@ class UniqueGenerator protected $maxRetries; protected $uniques = array(); + /** + * @param Generator $generator + */ public function __construct(Generator $generator, $maxRetries) { $this->generator = $generator; @@ -20,6 +23,7 @@ public function __construct(Generator $generator, $maxRetries) /** * Catch and proxy all generator calls but return only unique values + * @param string $attribute */ public function __get($attribute) { @@ -28,6 +32,8 @@ public function __get($attribute) /** * Catch and proxy all generator calls with arguments but return only unique values + * @param string $name + * @param array $arguments */ public function __call($name, $arguments) {