Skip to content

Commit ff48d32

Browse files
authored
Enhancement: Enable and configure phpdoc_types_order fixer (#182)
* Enhancement: Enable and configure phpdoc_types_order fixer * Fix: Run 'make cs' * Fix: Run 'make baseline'
1 parent fd205f5 commit ff48d32

File tree

10 files changed

+25
-22
lines changed

10 files changed

+25
-22
lines changed

.php_cs.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ return $config
117117
'phpdoc_single_line_var_spacing' => true,
118118
'phpdoc_trim' => true,
119119
'phpdoc_types' => true,
120+
'phpdoc_types_order' => [
121+
'null_adjustment' => 'always_last',
122+
'sort_algorithm' => 'alpha',
123+
],
120124
'phpdoc_var_without_name' => true,
121125
'pow_to_exponentiation' => true,
122126
'psr_autoloading' => true,

psalm.baseline.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
<UndefinedDocblockClass occurrences="3">
5252
<code>$this-&gt;manager</code>
5353
<code>ObjectManager|null</code>
54-
<code>null|EntityManager</code>
5554
</UndefinedDocblockClass>
5655
</file>
5756
<file src="src/Faker/ORM/Mandango/EntityPopulator.php">

src/Faker/Generator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@
5858
* @property string $vat
5959
*
6060
* @property string $word
61-
* @property string|array $words
62-
* @method string|array words($nb = 3, $asText = false)
61+
* @property array|string $words
62+
* @method array|string words($nb = 3, $asText = false)
6363
* @method string word()
6464
* @property string $sentence
6565
* @method string sentence($nbWords = 6, $variableNbWords = true)
66-
* @property string|array $sentences
67-
* @method string|array sentences($nb = 3, $asText = false)
66+
* @property array|string $sentences
67+
* @method array|string sentences($nb = 3, $asText = false)
6868
* @property string $paragraph
6969
* @method string paragraph($nbSentences = 3, $variableNbSentences = true)
70-
* @property string|array $paragraphs
71-
* @method string|array paragraphs($nb = 3, $asText = false)
70+
* @property array|string $paragraphs
71+
* @method array|string paragraphs($nb = 3, $asText = false)
7272
* @property string $text
7373
* @method string text($maxNbChars = 200)
7474
*

src/Faker/ORM/Doctrine/Populator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function addEntity($entity, $number, $customColumnFormatters = [], $custo
7474
* Please note that large amounts of data will result in more memory usage since the the Populator will return
7575
* all newly created primary keys after executing.
7676
*
77-
* @param null|EntityManager $entityManager A Doctrine connection object
77+
* @param EntityManager|null $entityManager A Doctrine connection object
7878
*
7979
* @return array A list of the inserted PKs
8080
*/

src/Faker/Provider/Base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public static function randomNumber($nbDigits = null, $strict = false)
9797
* Return a random float number
9898
*
9999
* @param int $nbMaxDecimals
100-
* @param int|float $min
101-
* @param int|float $max
100+
* @param float|int $min
101+
* @param float|int $max
102102
* @example 48.8932
103103
*
104104
* @return float

src/Faker/Provider/DateTime.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class DateTime extends Base
99
protected static $defaultTimezone = null;
1010

1111
/**
12-
* @param \DateTime|string|float|int $max
13-
* @return int|false
12+
* @param \DateTime|float|int|string $max
13+
* @return false|int
1414
*/
1515
protected static function getMaxTimestamp($max = 'now')
1616
{
@@ -332,7 +332,7 @@ public static function getDefaultTimezone()
332332

333333
/**
334334
* @param string|null $timezone
335-
* @return null|string
335+
* @return string|null
336336
*/
337337
private static function resolveTimezone($timezone)
338338
{

src/Faker/Provider/id_ID/Person.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ public static function suffix()
297297
*
298298
* @link https://en.wikipedia.org/wiki/National_identification_number#Indonesia
299299
*
300-
* @param null|string $gender
301-
* @param null|\DateTime $birthDate
300+
* @param string|null $gender
301+
* @param \DateTime|null $birthDate
302302
* @return string
303303
*/
304304
public function nik($gender = null, $birthDate = null)

src/Faker/Provider/ms_MY/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public function townshipSuffix()
597597
* @example '55100'
598598
* @link https://en.wikipedia.org/wiki/Postal_codes_in_Malaysia#States
599599
*
600-
* @param null|string $state 'state' or null
600+
* @param string|null $state 'state' or null
601601
*
602602
* @return string
603603
*/

src/Faker/Provider/pt_BR/check_digit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @link http://pt.wikipedia.org/wiki/CNPJ#Algoritmo_de_Valida.C3.A7.C3.A3o
99
* @link http://en.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas#Validation
1010
*
11-
* @param string|int $numbers Numbers on which generate the check digit
11+
* @param int|string $numbers Numbers on which generate the check digit
1212
* @return int
1313
*/
1414
function check_digit($numbers)

src/Faker/Provider/ro_RO/Person.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ class Person extends \Faker\Provider\Person
107107
* @link http://ro.wikipedia.org/wiki/Cod_numeric_personal
108108
* @example 1111111111118
109109
*
110-
* @param null|string $gender Person::GENDER_MALE or Person::GENDER_FEMALE
111-
* @param null|string $dateOfBirth (1800-2099) 'Y-m-d', 'Y-m', 'Y' I.E. '1981-06-16', '2085-03', '1900'
112-
* @param null|string $county county code where the CNP was issued
113-
* @param null|bool $isResident flag if the person resides in Romania
110+
* @param string|null $gender Person::GENDER_MALE or Person::GENDER_FEMALE
111+
* @param string|null $dateOfBirth (1800-2099) 'Y-m-d', 'Y-m', 'Y' I.E. '1981-06-16', '2085-03', '1900'
112+
* @param string|null $county county code where the CNP was issued
113+
* @param bool|null $isResident flag if the person resides in Romania
114114
* @return string 13 digits CNP code
115115
*/
116116
public function cnp($gender = null, $dateOfBirth = null, $county = null, $isResident = true)
@@ -144,7 +144,7 @@ public function cnp($gender = null, $dateOfBirth = null, $county = null, $isResi
144144
}
145145

146146
/**
147-
* @param null|string $dateOfBirth
147+
* @param string|null $dateOfBirth
148148
* @return \DateTime
149149
*/
150150
protected function getDateOfBirth($dateOfBirth)

0 commit comments

Comments
 (0)