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

Commit a86e695

Browse files
removed unnecessary PHPDocs, added some types to remaining
1 parent 8423db0 commit a86e695

15 files changed

+21
-69
lines changed

src/Faker/Calculator/Iban.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public static function checksum($iban)
2525
}
2626

2727
/**
28-
* @param $match
2928
* @return int
3029
*/
3130
private static function alphaToNumberCallback($match)
@@ -62,7 +61,7 @@ public static function mod97($number)
6261
/**
6362
* Checks whether an IBAN has a valid checksum
6463
*
65-
* @param $iban
64+
* @param string $iban
6665
* @return boolean
6766
*/
6867
public static function isValid($iban)

src/Faker/Calculator/Luhn.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class Luhn
1414
{
1515
/**
16-
* @param $number
16+
* @param string $number
1717
* @return int
1818
*/
1919
private static function checksum($number)
@@ -48,7 +48,7 @@ public static function computeCheckDigit($partialNumber)
4848
/**
4949
* Checks whether a number (partial number + check digit) is Luhn compliant
5050
*
51-
* @param $number
51+
* @param string $number
5252
* @return bool
5353
*/
5454
public static function isValid($number)

src/Faker/DefaultGenerator.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ public function __construct($default = null)
1919
}
2020

2121
/**
22-
* @param $attribute
22+
* @param string $attribute
2323
*/
2424
public function __get($attribute)
2525
{
2626
return $this->default;
2727
}
2828

2929
/**
30-
* @param $method
31-
* @param $attributes
30+
* @param string $method
31+
* @param array $attributes
3232
*/
3333
public function __call($method, $attributes)
3434
{

src/Faker/Factory.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public static function create($locale = self::DEFAULT_LOCALE)
2626
}
2727

2828
/**
29-
* @param $provider
3029
* @param string $locale
3130
* @return string
3231
*/
@@ -47,7 +46,6 @@ protected static function getProviderClassname($provider, $locale = '')
4746
}
4847

4948
/**
50-
* @param $provider
5149
* @param string $locale
5250
* @return string
5351
*/

src/Faker/Generator.php

+7
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,18 @@ protected function callFormatWithMatches($matches)
228228
return $this->format($matches[1]);
229229
}
230230

231+
/**
232+
* @param string $attribute
233+
*/
231234
public function __get($attribute)
232235
{
233236
return $this->format($attribute);
234237
}
235238

239+
/**
240+
* @param string $method
241+
* @param array $attributes
242+
*/
236243
public function __call($method, $attributes)
237244
{
238245
return $this->format($method, $attributes);

src/Faker/ORM/CakePHP/ColumnTypeGuesser.php

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ public function __construct(\Faker\Generator $generator)
1212
}
1313

1414
/**
15-
* @param $column
16-
* @param $table
1715
* @return \Closure|null
1816
*/
1917
public function guessFormat($column, $table)

src/Faker/ORM/CakePHP/EntityPopulator.php

+2-24
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,38 @@ class EntityPopulator
1212
protected $columnFormatters = [];
1313
protected $modifiers = [];
1414

15-
/**
16-
* @param $class
17-
*/
1815
public function __construct($class)
1916
{
2017
$this->class = $class;
2118
}
2219

2320
/**
24-
* @param $name
25-
* @return mixed
21+
* @param string $name
2622
*/
2723
public function __get($name)
2824
{
2925
return $this->{$name};
3026
}
3127

3228
/**
33-
* @param $name
34-
* @param $value
29+
* @param string $name
3530
*/
3631
public function __set($name, $value)
3732
{
3833
$this->{$name} = $value;
3934
}
4035

41-
/**
42-
* @param $columnFormatters
43-
*/
4436
public function mergeColumnFormattersWith($columnFormatters)
4537
{
4638
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
4739
}
4840

49-
/**
50-
* @param $modifiers
51-
*/
5241
public function mergeModifiersWith($modifiers)
5342
{
5443
$this->modifiers = array_merge($this->modifiers, $modifiers);
5544
}
5645

5746
/**
58-
* @param $populator
5947
* @return array
6048
*/
6149
public function guessColumnFormatters($populator)
@@ -134,10 +122,7 @@ public function guessModifiers()
134122
}
135123

136124
/**
137-
* @param $class
138-
* @param $insertedEntities
139125
* @param array $options
140-
* @return mixed
141126
*/
142127
public function execute($class, $insertedEntities, $options = [])
143128
{
@@ -166,18 +151,11 @@ public function execute($class, $insertedEntities, $options = [])
166151
return $entity->{$pk[0]};
167152
}
168153

169-
/**
170-
* @param $name
171-
*/
172154
public function setConnection($name)
173155
{
174156
$this->connectionName = $name;
175157
}
176158

177-
/**
178-
* @param $class
179-
* @return mixed
180-
*/
181159
protected function getTable($class)
182160
{
183161
$options = [];

src/Faker/ORM/CakePHP/Populator.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function getGuessers()
3535
}
3636

3737
/**
38-
* @param $name
3938
* @return $this
4039
*/
4140
public function removeGuesser($name)
@@ -47,7 +46,6 @@ public function removeGuesser($name)
4746
}
4847

4948
/**
50-
* @param $class
5149
* @return $this
5250
* @throws \Exception
5351
*/
@@ -66,13 +64,11 @@ public function addGuesser($class)
6664
}
6765

6866
/**
69-
* @param $entity
70-
* @param $number
7167
* @param array $customColumnFormatters
7268
* @param array $customModifiers
7369
* @return $this
7470
*/
75-
public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = [])
71+
public function addEntEntityPopulatority($entity, $number, $customColumnFormatters = [], $customModifiers = [])
7672
{
7773
if (!$entity instanceof EntityPopulator) {
7874
$entity = new EntityPopulator($entity);

src/Faker/ORM/Doctrine/ColumnTypeGuesser.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public function __construct(\Faker\Generator $generator)
1717
}
1818

1919
/**
20-
* @param $fieldName
2120
* @param ClassMetadata $class
2221
* @return \Closure|null
2322
*/

src/Faker/ORM/Doctrine/EntityPopulator.php

+1-15
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public function getColumnFormatters()
5858
return $this->columnFormatters;
5959
}
6060

61-
/**
62-
* @param $columnFormatters
63-
*/
6461
public function mergeColumnFormattersWith($columnFormatters)
6562
{
6663
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
@@ -162,9 +159,8 @@ public function guessColumnFormatters(\Faker\Generator $generator)
162159
/**
163160
* Insert one new record using the Entity class.
164161
* @param ObjectManager $manager
165-
* @param $insertedEntities
166162
* @param bool $generateId
167-
* @return
163+
* @return EntityPopulator
168164
*/
169165
public function execute(ObjectManager $manager, $insertedEntities, $generateId = false)
170166
{
@@ -186,10 +182,6 @@ public function execute(ObjectManager $manager, $insertedEntities, $generateId =
186182
return $obj;
187183
}
188184

189-
/**
190-
* @param $obj
191-
* @param $insertedEntities
192-
*/
193185
private function fillColumns($obj, $insertedEntities)
194186
{
195187
foreach ($this->columnFormatters as $field => $format) {
@@ -200,10 +192,6 @@ private function fillColumns($obj, $insertedEntities)
200192
}
201193
}
202194

203-
/**
204-
* @param $obj
205-
* @param $insertedEntities
206-
*/
207195
private function callMethods($obj, $insertedEntities)
208196
{
209197
foreach ($this->getModifiers() as $modifier) {
@@ -212,8 +200,6 @@ private function callMethods($obj, $insertedEntities)
212200
}
213201

214202
/**
215-
* @param $obj
216-
* @param $column
217203
* @param EntityManagerInterface $manager
218204
* @return int|null
219205
*/

src/Faker/ORM/Doctrine/Populator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function addEntity($entity, $number, $customColumnFormatters = array(), $
5555
/**
5656
* Populate the database using all the Entity classes previously added.
5757
*
58-
* @param EntityManager $entityManager A Doctrine connection object
58+
* @param null|EntityManager $entityManager A Doctrine connection object
5959
*
6060
* @return array A list of the inserted PKs
6161
*/

src/Faker/ORM/Mandango/ColumnTypeGuesser.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public function __construct(\Faker\Generator $generator)
1515
}
1616

1717
/**
18-
* @param $field
1918
* @return \Closure|null
2019
*/
2120
public function guessFormat($field)

src/Faker/ORM/Mandango/EntityPopulator.php

-8
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ public function getClass()
3131
return $this->class;
3232
}
3333

34-
/**
35-
* @param $columnFormatters
36-
*/
3734
public function setColumnFormatters($columnFormatters)
3835
{
3936
$this->columnFormatters = $columnFormatters;
@@ -47,9 +44,6 @@ public function getColumnFormatters()
4744
return $this->columnFormatters;
4845
}
4946

50-
/**
51-
* @param $columnFormatters
52-
*/
5347
public function mergeColumnFormattersWith($columnFormatters)
5448
{
5549
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
@@ -100,8 +94,6 @@ public function guessColumnFormatters(\Faker\Generator $generator, Mandango $man
10094
/**
10195
* Insert one new record using the Entity class.
10296
* @param Mandango $mandango
103-
* @param $insertedEntities
104-
* @return
10597
*/
10698
public function execute(Mandango $mandango, $insertedEntities)
10799
{

src/Faker/ORM/Propel/EntityPopulator.php

-3
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ public function guessModifiers(\Faker\Generator $generator)
184184

185185
/**
186186
* Insert one new record using the Entity class.
187-
* @param $con
188-
* @param $insertedEntities
189-
* @return
190187
*/
191188
public function execute($con, $insertedEntities)
192189
{

src/Faker/UniqueGenerator.php

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct(Generator $generator, $maxRetries)
2424

2525
/**
2626
* Catch and proxy all generator calls but return only unique values
27+
* @param string $attribute
2728
*/
2829
public function __get($attribute)
2930
{
@@ -32,6 +33,8 @@ public function __get($attribute)
3233

3334
/**
3435
* Catch and proxy all generator calls with arguments but return only unique values
36+
* @param string $name
37+
* @param array $arguments
3538
*/
3639
public function __call($name, $arguments)
3740
{

0 commit comments

Comments
 (0)