Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
removed unnecessary PHPDocs, added some types to remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-mueller committed Oct 16, 2015
1 parent 8423db0 commit a86e695
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 69 deletions.
3 changes: 1 addition & 2 deletions src/Faker/Calculator/Iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public static function checksum($iban)
}

/**
* @param $match
* @return int
*/
private static function alphaToNumberCallback($match)
Expand Down Expand Up @@ -62,7 +61,7 @@ public static function mod97($number)
/**
* Checks whether an IBAN has a valid checksum
*
* @param $iban
* @param string $iban
* @return boolean
*/
public static function isValid($iban)
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Calculator/Luhn.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class Luhn
{
/**
* @param $number
* @param string $number
* @return int
*/
private static function checksum($number)
Expand Down Expand Up @@ -48,7 +48,7 @@ public static function computeCheckDigit($partialNumber)
/**
* Checks whether a number (partial number + check digit) is Luhn compliant
*
* @param $number
* @param string $number
* @return bool
*/
public static function isValid($number)
Expand Down
6 changes: 3 additions & 3 deletions src/Faker/DefaultGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ public function __construct($default = null)
}

/**
* @param $attribute
* @param string $attribute
*/
public function __get($attribute)
{
return $this->default;
}

/**
* @param $method
* @param $attributes
* @param string $method
* @param array $attributes
*/
public function __call($method, $attributes)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Faker/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public static function create($locale = self::DEFAULT_LOCALE)
}

/**
* @param $provider
* @param string $locale
* @return string
*/
Expand All @@ -47,7 +46,6 @@ protected static function getProviderClassname($provider, $locale = '')
}

/**
* @param $provider
* @param string $locale
* @return string
*/
Expand Down
7 changes: 7 additions & 0 deletions src/Faker/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/Faker/ORM/CakePHP/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public function __construct(\Faker\Generator $generator)
}

/**
* @param $column
* @param $table
* @return \Closure|null
*/
public function guessFormat($column, $table)
Expand Down
26 changes: 2 additions & 24 deletions src/Faker/ORM/CakePHP/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,38 @@ class EntityPopulator
protected $columnFormatters = [];
protected $modifiers = [];

/**
* @param $class
*/
public function __construct($class)
{
$this->class = $class;
}

/**
* @param $name
* @return mixed
* @param string $name
*/
public function __get($name)
{
return $this->{$name};
}

/**
* @param $name
* @param $value
* @param string $name
*/
public function __set($name, $value)
{
$this->{$name} = $value;
}

/**
* @param $columnFormatters
*/
public function mergeColumnFormattersWith($columnFormatters)
{
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
}

/**
* @param $modifiers
*/
public function mergeModifiersWith($modifiers)
{
$this->modifiers = array_merge($this->modifiers, $modifiers);
}

/**
* @param $populator
* @return array
*/
public function guessColumnFormatters($populator)
Expand Down Expand Up @@ -134,10 +122,7 @@ public function guessModifiers()
}

/**
* @param $class
* @param $insertedEntities
* @param array $options
* @return mixed
*/
public function execute($class, $insertedEntities, $options = [])
{
Expand Down Expand Up @@ -166,18 +151,11 @@ public function execute($class, $insertedEntities, $options = [])
return $entity->{$pk[0]};
}

/**
* @param $name
*/
public function setConnection($name)
{
$this->connectionName = $name;
}

/**
* @param $class
* @return mixed
*/
protected function getTable($class)
{
$options = [];
Expand Down
6 changes: 1 addition & 5 deletions src/Faker/ORM/CakePHP/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function getGuessers()
}

/**
* @param $name
* @return $this
*/
public function removeGuesser($name)
Expand All @@ -47,7 +46,6 @@ public function removeGuesser($name)
}

/**
* @param $class
* @return $this
* @throws \Exception
*/
Expand All @@ -66,13 +64,11 @@ public function addGuesser($class)
}

/**
* @param $entity
* @param $number
* @param array $customColumnFormatters
* @param array $customModifiers
* @return $this
*/
public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = [])
public function addEntEntityPopulatority($entity, $number, $customColumnFormatters = [], $customModifiers = [])

This comment has been minimized.

Copy link
@sdustinh

sdustinh Nov 14, 2015

Contributor

Why was this merged?

This comment has been minimized.

Copy link
@daniel-mueller

daniel-mueller Nov 15, 2015

Author Contributor

Wow, horrible mistake, my bad.
#776

{
if (!$entity instanceof EntityPopulator) {
$entity = new EntityPopulator($entity);
Expand Down
1 change: 0 additions & 1 deletion src/Faker/ORM/Doctrine/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public function __construct(\Faker\Generator $generator)
}

/**
* @param $fieldName
* @param ClassMetadata $class
* @return \Closure|null
*/
Expand Down
16 changes: 1 addition & 15 deletions src/Faker/ORM/Doctrine/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ public function getColumnFormatters()
return $this->columnFormatters;
}

/**
* @param $columnFormatters
*/
public function mergeColumnFormattersWith($columnFormatters)
{
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
Expand Down Expand Up @@ -162,9 +159,8 @@ public function guessColumnFormatters(\Faker\Generator $generator)
/**
* Insert one new record using the Entity class.
* @param ObjectManager $manager
* @param $insertedEntities
* @param bool $generateId
* @return
* @return EntityPopulator
*/
public function execute(ObjectManager $manager, $insertedEntities, $generateId = false)
{
Expand All @@ -186,10 +182,6 @@ public function execute(ObjectManager $manager, $insertedEntities, $generateId =
return $obj;
}

/**
* @param $obj
* @param $insertedEntities
*/
private function fillColumns($obj, $insertedEntities)
{
foreach ($this->columnFormatters as $field => $format) {
Expand All @@ -200,10 +192,6 @@ private function fillColumns($obj, $insertedEntities)
}
}

/**
* @param $obj
* @param $insertedEntities
*/
private function callMethods($obj, $insertedEntities)
{
foreach ($this->getModifiers() as $modifier) {
Expand All @@ -212,8 +200,6 @@ private function callMethods($obj, $insertedEntities)
}

/**
* @param $obj
* @param $column
* @param EntityManagerInterface $manager
* @return int|null
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/ORM/Doctrine/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,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
*/
Expand Down
1 change: 0 additions & 1 deletion src/Faker/ORM/Mandango/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function __construct(\Faker\Generator $generator)
}

/**
* @param $field
* @return \Closure|null
*/
public function guessFormat($field)
Expand Down
8 changes: 0 additions & 8 deletions src/Faker/ORM/Mandango/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public function getClass()
return $this->class;
}

/**
* @param $columnFormatters
*/
public function setColumnFormatters($columnFormatters)
{
$this->columnFormatters = $columnFormatters;
Expand All @@ -47,9 +44,6 @@ public function getColumnFormatters()
return $this->columnFormatters;
}

/**
* @param $columnFormatters
*/
public function mergeColumnFormattersWith($columnFormatters)
{
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
Expand Down Expand Up @@ -100,8 +94,6 @@ public function guessColumnFormatters(\Faker\Generator $generator, Mandango $man
/**
* Insert one new record using the Entity class.
* @param Mandango $mandango
* @param $insertedEntities
* @return
*/
public function execute(Mandango $mandango, $insertedEntities)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Faker/ORM/Propel/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ public function guessModifiers(\Faker\Generator $generator)

/**
* Insert one new record using the Entity class.
* @param $con
* @param $insertedEntities
* @return
*/
public function execute($con, $insertedEntities)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Faker/UniqueGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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)
{
Expand All @@ -32,6 +33,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)
{
Expand Down

0 comments on commit a86e695

Please sign in to comment.