Skip to content

Commit

Permalink
Enhancement: Enable no_superfluous_phpdoc_tags fixer (#199)
Browse files Browse the repository at this point in the history
* Enhancement: Enable no_superfluous_phpdoc_tags fixer

* Fix: Run 'make cs'

* Fix: Run 'make baseline'
  • Loading branch information
localheinz committed Dec 21, 2020
1 parent cc4e86b commit c65e3b6
Show file tree
Hide file tree
Showing 33 changed files with 23 additions and 160 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ return $config
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
Expand Down
30 changes: 15 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ parameters:

-
message: "#^Parameter \\$class of method Faker\\\\ORM\\\\Doctrine\\\\ColumnTypeGuesser\\:\\:guessFormat\\(\\) has invalid typehint type Doctrine\\\\Common\\\\Persistence\\\\Mapping\\\\ClassMetadata\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Doctrine/ColumnTypeGuesser.php

-
Expand All @@ -67,7 +67,7 @@ parameters:

-
message: "#^Parameter \\$class of method Faker\\\\ORM\\\\Doctrine\\\\EntityPopulator\\:\\:__construct\\(\\) has invalid typehint type Doctrine\\\\Common\\\\Persistence\\\\Mapping\\\\ClassMetadata\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Doctrine/EntityPopulator.php

-
Expand Down Expand Up @@ -157,7 +157,7 @@ parameters:

-
message: "#^Parameter \\$manager of method Faker\\\\ORM\\\\Doctrine\\\\EntityPopulator\\:\\:execute\\(\\) has invalid typehint type Doctrine\\\\Common\\\\Persistence\\\\ObjectManager\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Doctrine/EntityPopulator.php

-
Expand Down Expand Up @@ -187,7 +187,7 @@ parameters:

-
message: "#^Parameter \\$manager of method Faker\\\\ORM\\\\Doctrine\\\\EntityPopulator\\:\\:generateId\\(\\) has invalid typehint type Doctrine\\\\Common\\\\Persistence\\\\ObjectManager\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Doctrine/EntityPopulator.php

-
Expand All @@ -202,7 +202,7 @@ parameters:

-
message: "#^Parameter \\$manager of method Faker\\\\ORM\\\\Doctrine\\\\Populator\\:\\:__construct\\(\\) has invalid typehint type Doctrine\\\\Common\\\\Persistence\\\\ObjectManager\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Doctrine/Populator.php

-
Expand All @@ -227,7 +227,7 @@ parameters:

-
message: "#^Parameter \\$mandango of method Faker\\\\ORM\\\\Mandango\\\\EntityPopulator\\:\\:guessColumnFormatters\\(\\) has invalid typehint type Mandango\\\\Mandango\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Mandango/EntityPopulator.php

-
Expand All @@ -237,7 +237,7 @@ parameters:

-
message: "#^Parameter \\$mandango of method Faker\\\\ORM\\\\Mandango\\\\EntityPopulator\\:\\:execute\\(\\) has invalid typehint type Mandango\\\\Mandango\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Mandango/EntityPopulator.php

-
Expand All @@ -252,12 +252,12 @@ parameters:

-
message: "#^Parameter \\$mandango of method Faker\\\\ORM\\\\Mandango\\\\Populator\\:\\:__construct\\(\\) has invalid typehint type Mandango\\\\Mandango\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Mandango/Populator.php

-
message: "#^Parameter \\$column of method Faker\\\\ORM\\\\Propel\\\\ColumnTypeGuesser\\:\\:guessFormat\\(\\) has invalid typehint type ColumnMap\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Propel/ColumnTypeGuesser.php

-
Expand Down Expand Up @@ -402,7 +402,7 @@ parameters:

-
message: "#^Parameter \\$columnMap of method Faker\\\\ORM\\\\Propel\\\\EntityPopulator\\:\\:isColumnBehavior\\(\\) has invalid typehint type ColumnMap\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Propel/EntityPopulator.php

-
Expand Down Expand Up @@ -447,7 +447,7 @@ parameters:

-
message: "#^Parameter \\$column of method Faker\\\\ORM\\\\Propel2\\\\ColumnTypeGuesser\\:\\:guessFormat\\(\\) has invalid typehint type Propel\\\\Runtime\\\\Map\\\\ColumnMap\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Propel2/ColumnTypeGuesser.php

-
Expand Down Expand Up @@ -597,7 +597,7 @@ parameters:

-
message: "#^Parameter \\$columnMap of method Faker\\\\ORM\\\\Propel2\\\\EntityPopulator\\:\\:isColumnBehavior\\(\\) has invalid typehint type Propel\\\\Runtime\\\\Map\\\\ColumnMap\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Propel2/EntityPopulator.php

-
Expand Down Expand Up @@ -652,12 +652,12 @@ parameters:

-
message: "#^Parameter \\$locator of method Faker\\\\ORM\\\\Spot\\\\EntityPopulator\\:\\:__construct\\(\\) has invalid typehint type Spot\\\\Locator\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Spot/EntityPopulator.php

-
message: "#^Parameter \\$mapper of method Faker\\\\ORM\\\\Spot\\\\EntityPopulator\\:\\:__construct\\(\\) has invalid typehint type Spot\\\\Mapper\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Spot/EntityPopulator.php

-
Expand Down Expand Up @@ -707,7 +707,7 @@ parameters:

-
message: "#^Parameter \\$locator of method Faker\\\\ORM\\\\Spot\\\\Populator\\:\\:__construct\\(\\) has invalid typehint type Spot\\\\Locator\\.$#"
count: 2
count: 1
path: src/Faker/ORM/Spot/Populator.php

-
Expand Down
5 changes: 1 addition & 4 deletions psalm.baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
</UndefinedDocblockClass>
</file>
<file src="src/Faker/ORM/Doctrine/Populator.php">
<UndefinedClass occurrences="1">
<code>ObjectManager|null</code>
</UndefinedClass>
<UndefinedClass occurrences="1"/>
<UndefinedDocblockClass occurrences="3">
<code>$this-&gt;manager</code>
<code>ObjectManager|null</code>
Expand Down Expand Up @@ -145,7 +143,6 @@
<file src="src/Faker/ORM/Spot/Populator.php">
<UndefinedClass occurrences="2">
<code>$this-&gt;locator</code>
<code>Locator|null</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="1">
<code>Locator</code>
Expand Down
4 changes: 0 additions & 4 deletions src/Faker/Calculator/Isbn.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class Isbn
* @param string $input ISBN without check-digit
*
* @throws \LengthException When wrong input length passed
*
* @return string
*/
public static function checksum(string $input): string
{
Expand Down Expand Up @@ -48,8 +46,6 @@ function (&$digit, $position) {
* Checks whether the provided number is a valid ISBN-10 number
*
* @param string $isbn ISBN to check
*
* @return bool
*/
public static function isValid(string $isbn): bool
{
Expand Down
4 changes: 0 additions & 4 deletions src/Faker/DefaultGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function __construct($default = null)

/**
* @param string $attribute
*
* @return mixed
*/
public function __get($attribute)
{
Expand All @@ -28,8 +26,6 @@ public function __get($attribute)
/**
* @param string $method
* @param array $attributes
*
* @return mixed
*/
public function __call($method, $attributes)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Faker/Documentor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ class Documentor
{
protected $generator;

/**
* @param Generator $generator
*/
public function __construct(Generator $generator)
{
$this->generator = $generator;
Expand Down
4 changes: 0 additions & 4 deletions src/Faker/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ protected function callFormatWithMatches($matches)

/**
* @param string $attribute
*
* @return mixed
*/
public function __get($attribute)
{
Expand All @@ -298,8 +296,6 @@ public function __get($attribute)
/**
* @param string $method
* @param array $attributes
*
* @return mixed
*/
public function __call($method, $attributes)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Faker/Guesser/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class Name
{
protected $generator;

/**
* @param \Faker\Generator $generator
*/
public function __construct(\Faker\Generator $generator)
{
$this->generator = $generator;
Expand Down
3 changes: 0 additions & 3 deletions src/Faker/ORM/CakePHP/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ class Populator
protected $quantities = [];
protected $guessers = [];

/**
* @param \Faker\Generator $generator
*/
public function __construct(\Faker\Generator $generator)
{
$this->generator = $generator;
Expand Down
2 changes: 0 additions & 2 deletions src/Faker/ORM/Doctrine/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public function __construct(Generator $generator)
}

/**
* @param ClassMetadata $class
*
* @return \Closure|null
*/
public function guessFormat($fieldName, ClassMetadata $class)
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 @@ -23,9 +23,6 @@ class EntityPopulator
*/
protected $modifiers = [];

/**
* @param ClassMetadata $class
*/
public function __construct(ClassMetadata $class)
{
$this->class = $class;
Expand Down Expand Up @@ -57,9 +54,6 @@ public function mergeColumnFormattersWith($columnFormatters)
$this->columnFormatters = array_merge($this->columnFormatters, $columnFormatters);
}

/**
* @param array $modifiers
*/
public function setModifiers(array $modifiers)
{
$this->modifiers = $modifiers;
Expand All @@ -73,17 +67,12 @@ 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)
Expand Down Expand Up @@ -177,8 +166,7 @@ public function guessColumnFormatters(\Faker\Generator $generator)
/**
* Insert one new record using the Entity class.
*
* @param ObjectManager $manager
* @param bool $generateId
* @param bool $generateId
*
* @return EntityPopulator
*/
Expand Down Expand Up @@ -238,8 +226,6 @@ private function callMethods($obj, $insertedEntities)
}

/**
* @param ObjectManager $manager
*
* @return int|null
*/
private function generateId($obj, $column, ObjectManager $manager)
Expand Down
4 changes: 1 addition & 3 deletions src/Faker/ORM/Doctrine/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class Populator
/**
* Populator constructor.
*
* @param Generator $generator
* @param ObjectManager|null $manager
* @param int $batchSize
* @param int $batchSize
*/
public function __construct(Generator $generator, ObjectManager $manager = null, $batchSize = 1000)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Faker/ORM/Mandango/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ class ColumnTypeGuesser
*/
protected $generator;

/**
* @param Generator $generator
*/
public function __construct(Generator $generator)
{
$this->generator = $generator;
Expand Down
5 changes: 0 additions & 5 deletions src/Faker/ORM/Mandango/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public function mergeColumnFormattersWith($columnFormatters)
}

/**
* @param \Faker\Generator $generator
* @param Mandango $mandango
*
* @return array
*/
public function guessColumnFormatters(\Faker\Generator $generator, Mandango $mandango)
Expand Down Expand Up @@ -97,8 +94,6 @@ 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)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Faker/ORM/Mandango/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ class Populator
protected $entities = [];
protected $quantities = [];

/**
* @param \Faker\Generator $generator
* @param Mandango $mandango
*/
public function __construct(\Faker\Generator $generator, Mandango $mandango)
{
$this->generator = $generator;
Expand Down
5 changes: 0 additions & 5 deletions src/Faker/ORM/Propel/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ 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)
Expand Down
Loading

0 comments on commit c65e3b6

Please sign in to comment.