diff --git a/.github/workflows/branch-alias.yaml b/.github/workflows/branch-alias.yaml index dcd71f110..7370c8811 100644 --- a/.github/workflows/branch-alias.yaml +++ b/.github/workflows/branch-alias.yaml @@ -54,7 +54,7 @@ jobs: composer config extra.branch-alias.dev-main ${{ steps.find_alias.outputs.alias }}-dev - name: "Create Pull Request" - uses: "peter-evans/create-pull-request@v4" + uses: "peter-evans/create-pull-request@v5" with: base: "main" branch: "branch-alias-update" diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index d80d5723d..d17e34db0 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -37,10 +37,9 @@ jobs: uses: "actions/cache@v3" with: path: "${{ steps.composer-cache.outputs.directory }}" - key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}" + key: "composer-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}" restore-keys: | - composer-${{ runner.os }}-${{ matrix.php-version }}- - composer-${{ runner.os }}- + composer-${{ matrix.php-version }}- composer- - name: "Download dependencies" diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 2bf12611d..ff9a01316 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -8,6 +8,9 @@ '.github/', 'vendor-bin/', ]) + ->notPath([ + 'test/Fixture/Enum/BackedEnum.php', + ]) ->ignoreDotFiles(false) ->in(__DIR__); @@ -51,9 +54,6 @@ 'yield', ], ], - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - ], 'cast_spaces' => true, 'class_attributes_separation' => [ 'elements' => [ @@ -65,7 +65,11 @@ 'concat_space' => [ 'spacing' => 'one', ], + 'control_structure_braces' => true, + 'control_structure_continuation_position' => true, + 'curly_braces_position' => true, 'declare_equal_normalize' => true, + 'declare_parentheses' => true, 'function_typehint_space' => true, 'general_phpdoc_annotation_remove' => [ 'annotations' => [ @@ -99,6 +103,7 @@ 'no_extra_blank_lines' => true, 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, + 'no_multiple_statements_per_line' => true, 'no_spaces_around_offset' => true, 'no_superfluous_elseif' => true, 'no_superfluous_phpdoc_tags' => true, @@ -184,8 +189,24 @@ 'single_blank_line_before_namespace' => true, 'single_line_comment_style' => true, 'single_quote' => true, + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ + 'elseif', + 'for', + 'foreach', + 'if', + 'match', + 'while', + 'use_lambda', + ], + 'constructs_preceded_by_a_single_space' => [ + 'use_lambda', + ], + ], 'single_trait_insert_per_statement' => true, 'standardize_not_equals' => true, + 'statement_indentation' => true, 'static_lambda' => true, 'strict_param' => true, 'switch_case_space' => true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 566ad322c..40516fb8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # CHANGELOG -## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.20.0...main) +## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.22.0...main) + +## [2023-05-14, v1.22.0](https://github.com/FakerPHP/Faker/compare/v1.21.0..v1.22.0) + +- Fixed `randomElements()` to accept empty iterator (#605) +- Added support for passing an `Enum` to `randomElement()` and `randomElements()` (#620) +- Started rejecting invalid arguments passed to `randomElement()` and `randomElements()` (#642) ## [2022-12-13, v1.21.0](https://github.com/FakerPHP/Faker/compare/v1.20.0..v1.21.0) diff --git a/README.md b/README.md index c3c199d5c..2c6a26843 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,18 @@ to run `rector/rector`. *Note:* do not forget to replace `src/` with the path to your source directory. -Another way is to use it in your `rector.php` file: +Alternatively, import the configuration in your `rector.php` file: ```php -$rectorConfig->import('vendor/fakerphp/faker/rector-migrate.php'); -$faker($rectorConfig); +import('vendor/fakerphp/faker/rector-migrate.php'); +}; ``` ## License diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 67c2a8417..a9b8f8536 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -611,7 +611,7 @@ parameters: path: src/Faker/ORM/Spot/Populator.php - - message: "#^Instanceof between array and Traversable will always evaluate to false\\.$#" + message: "#^Class UnitEnum not found\\.$#" count: 2 path: src/Faker/Provider/Base.php @@ -643,16 +643,6 @@ parameters: count: 1 path: src/Faker/Provider/Base.php - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/Faker/Provider/Base.php - - - - message: "#^Ternary operator condition is always false\\.$#" - count: 1 - path: src/Faker/Provider/Base.php - - message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 @@ -678,6 +668,16 @@ parameters: count: 1 path: src/Faker/Provider/File.php + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/Faker/Provider/Lorem.php + + - + message: "#^Variable \\$text in empty\\(\\) always exists and is always falsy\\.$#" + count: 1 + path: src/Faker/Provider/Lorem.php + - message: "#^Parameter \\#1 \\$str of function md5 expects string, int given\\.$#" count: 1 diff --git a/psalm.baseline.xml b/psalm.baseline.xml index 7c3b4e871..271a6a6b2 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,64 +1,65 @@ - + - + 0 - + string - - $this->uniqueGenerator + + uniqueGenerator]]> new ChanceGenerator($this, $weight, $default) new ValidGenerator($this, $validator, $maxRetries) - + self self self - + TableRegistry - - $this->class + + class]]> + class->associationMappings]]> \Doctrine\ODM\MongoDB\Mapping\ClassMetadata \Doctrine\ODM\MongoDB\Mapping\ClassMetadata \Doctrine\ODM\MongoDB\Mapping\ClassMetadata \Doctrine\ORM\Mapping\ClassMetadata \Doctrine\ORM\Mapping\ClassMetadata - + createQueryBuilder getAssociationMappings newInstance - + Mandango Mandango - - $this->mandango + + mandango]]> Mandango - + \ColumnMap - + $columnMap $columnMap $columnMap @@ -71,20 +72,20 @@ - + \Propel - + PropelPDO - + ColumnMap - + $columnMap $columnMap $columnMap @@ -97,131 +98,115 @@ - + Propel - + PropelPDO - - $this->mapper + + mapper]]> - + string - + $relation $relation BelongsTo Locator Mapper - + $locator - $this->mapper - $this->mapper - $this->mapper - $this->mapper - $this->mapper + mapper]]> + mapper]]> + mapper]]> + mapper]]> + mapper]]> Locator Mapper - - $this->locator + + locator]]> Locator - + Locator - + [static::class, 'randomDigit'] - - $array - - + + \UnitEnum + \UnitEnum + + Closure + + enum_exists($array) + enum_exists($array) + + + + + callable + - + false - - - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $root->ownerDocument - - - + $imei - + int - + static::$cityPrefix - + static::birthNumber(static::GENDER_FEMALE) static::birthNumber(static::GENDER_MALE) - + $weights[$i] - + $ref[$i] - + static::split($text) - - - $multipliers[$i - 1] - - - + $weights[$i] $weights[$i] - - - $weights[$i] - - - + $high[$i] $low[$i] $result[$i] @@ -229,17 +214,12 @@ $weights[$i] $weights[$i] - + DateTime - - - $multipliers[$i] - - - + static::lastName() static::lastName() diff --git a/psalm.xml b/psalm.xml index 3c640b9cc..a10904b5b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,6 +6,8 @@ cacheDirectory=".build/psalm/" errorBaseline="psalm.baseline.xml" errorLevel="5" + findUnusedBaselineEntry="true" + findUnusedCode="false" resolveFromConfigFile="true" > diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php index ec77c0874..2cad02d7a 100644 --- a/src/Faker/Generator.php +++ b/src/Faker/Generator.php @@ -275,7 +275,7 @@ * * @property string $imageUrl * - * @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false) + * @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false, string $format = 'png') * * @property string $image * diff --git a/src/Faker/Provider/Base.php b/src/Faker/Provider/Base.php index e3713ce0e..675cf89e7 100644 --- a/src/Faker/Provider/Base.php +++ b/src/Faker/Provider/Base.php @@ -179,67 +179,109 @@ public static function randomAscii() /** * Returns randomly ordered subsequence of $count elements from a provided array * - * @param array $array Array to take elements from. Defaults to a-c - * @param int $count Number of elements to take. - * @param bool $allowDuplicates Allow elements to be picked several times. Defaults to false + * @param array|class-string|\Traversable $array Array to take elements from. Defaults to a-c + * @param int $count Number of elements to take. + * @param bool $allowDuplicates Allow elements to be picked several times. Defaults to false * - * @throws \LengthException When requesting more elements than provided + * @throws \InvalidArgumentException + * @throws \LengthException When requesting more elements than provided * * @return array New array with $count elements from $array */ public static function randomElements($array = ['a', 'b', 'c'], $count = 1, $allowDuplicates = false) { - $traversables = []; + $elements = $array; + + if (is_string($array) && function_exists('enum_exists') && enum_exists($array)) { + $elements = $array::cases(); + } if ($array instanceof \Traversable) { - foreach ($array as $element) { - $traversables[] = $element; - } + $elements = \iterator_to_array($array, false); } - $arr = count($traversables) ? $traversables : $array; + if (!is_array($elements)) { + throw new \InvalidArgumentException(sprintf( + 'Argument for parameter $array needs to be array, an instance of %s, or an instance of %s, got %s instead.', + \UnitEnum::class, + \Traversable::class, + is_object($array) ? get_class($array) : gettype($array), + )); + } - $allKeys = array_keys($arr); - $numKeys = count($allKeys); + $numberOfElements = count($elements); - if (!$allowDuplicates && $numKeys < $count) { - throw new \LengthException(sprintf('Cannot get %d elements, only %d in array', $count, $numKeys)); + if (!$allowDuplicates && $numberOfElements < $count) { + throw new \LengthException(sprintf( + 'Cannot get %d elements, only %d in array', + $count, + $numberOfElements, + )); } - $highKey = $numKeys - 1; - $keys = $elements = []; - $numElements = 0; + $randomElements = []; + + $keys = array_keys($elements); + $maxIndex = $numberOfElements - 1; + $elementHasBeenSelectedAlready = []; + $numberOfRandomElements = 0; - while ($numElements < $count) { - $num = mt_rand(0, $highKey); + while ($numberOfRandomElements < $count) { + $index = mt_rand(0, $maxIndex); if (!$allowDuplicates) { - if (isset($keys[$num])) { + if (isset($elementHasBeenSelectedAlready[$index])) { continue; } - $keys[$num] = true; + + $elementHasBeenSelectedAlready[$index] = true; } - $elements[] = $arr[$allKeys[$num]]; - ++$numElements; + $key = $keys[$index]; + + $randomElements[] = $elements[$key]; + + ++$numberOfRandomElements; } - return $elements; + return $randomElements; } /** * Returns a random element from a passed array * - * @param array $array + * @param array|class-string|\Traversable $array + * + * @throws \InvalidArgumentException */ public static function randomElement($array = ['a', 'b', 'c']) { - if (!$array || ($array instanceof \Traversable && !count($array))) { + $elements = $array; + + if (is_string($array) && function_exists('enum_exists') && enum_exists($array)) { + $elements = $array::cases(); + } + + if ($array instanceof \Traversable) { + $elements = iterator_to_array($array, false); + } + + if ($elements === []) { return null; } - $elements = static::randomElements($array, 1); - return $elements[0]; + if (!is_array($elements)) { + throw new \InvalidArgumentException(sprintf( + 'Argument for parameter $array needs to be array, an instance of %s, or an instance of %s, got %s instead.', + \UnitEnum::class, + \Traversable::class, + is_object($array) ? get_class($array) : gettype($array), + )); + } + + $randomElements = static::randomElements($elements, 1); + + return $randomElements[0]; } /** diff --git a/src/Faker/Provider/DateTime.php b/src/Faker/Provider/DateTime.php index 46c3c90fe..25df1c992 100644 --- a/src/Faker/Provider/DateTime.php +++ b/src/Faker/Provider/DateTime.php @@ -334,9 +334,15 @@ public static function century() * * @example 'Europe/Paris' */ - public static function timezone() + public static function timezone(string $countryCode = null) { - return static::randomElement(\DateTimeZone::listIdentifiers()); + if ($countryCode) { + $timezones = \DateTimeZone::listIdentifiers(\DateTimeZone::PER_COUNTRY, $countryCode); + } else { + $timezones = \DateTimeZone::listIdentifiers(); + } + + return static::randomElement($timezones); } /** diff --git a/src/Faker/Provider/Lorem.php b/src/Faker/Provider/Lorem.php index a55144a58..2cfb70ea7 100644 --- a/src/Faker/Provider/Lorem.php +++ b/src/Faker/Provider/Lorem.php @@ -184,7 +184,15 @@ public static function text($maxNbChars = 200) throw new \InvalidArgumentException('text() can only generate text of at least 5 characters'); } - $type = ($maxNbChars < 25) ? 'word' : (($maxNbChars < 100) ? 'sentence' : 'paragraph'); + $type = 'paragraph'; + + if ($maxNbChars < 100) { + $type = 'sentence'; + } + + if ($maxNbChars < 25) { + $type = 'word'; + } $text = []; diff --git a/src/Faker/Provider/Miscellaneous.php b/src/Faker/Provider/Miscellaneous.php index 91d992ec4..354f67bb3 100644 --- a/src/Faker/Provider/Miscellaneous.php +++ b/src/Faker/Provider/Miscellaneous.php @@ -202,11 +202,12 @@ class Miscellaneous extends Base /** * @see https://en.wikipedia.org/wiki/ISO_4217 - * On date of 2019-09-27 + * On date of 2023-01-01 * * With the following exceptions: * SVC has been replaced by the USD in 2001: https://en.wikipedia.org/wiki/Salvadoran_col%C3%B3n * ZWL has been suspended since 2009: https://en.wikipedia.org/wiki/Zimbabwean_dollar + * HRK has been replaced by EUR since 2023: https://en.wikipedia.org/wiki/Croatian_kuna */ protected static $currencyCode = [ 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AWG', 'AZN', @@ -214,17 +215,17 @@ class Miscellaneous extends Base 'BSD', 'BTN', 'BWP', 'BYN', 'BZD', 'CAD', 'CDF', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'EUR', 'FJD', 'FKP', 'GBP', 'GEL', 'GHS', 'GIP', - 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', - 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', - 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', - 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', - 'MRU', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', - 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', - 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', - 'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STN', 'SYP', 'SZL', - 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', - 'UGX', 'USD', 'UYU', 'UZS', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XCD', - 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HTG', 'HUF', 'IDR', 'ILS', + 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', + 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', + 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRU', + 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STN', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'USD', 'UYU', 'UZS', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', + 'XPF', 'YER', 'ZAR', 'ZMW', ]; /** diff --git a/src/Faker/Provider/ar_EG/Person.php b/src/Faker/Provider/ar_EG/Person.php index 76f6f79e6..e456a07f9 100644 --- a/src/Faker/Provider/ar_EG/Person.php +++ b/src/Faker/Provider/ar_EG/Person.php @@ -29,7 +29,7 @@ class Person extends \Faker\Provider\Person 'حاتم', 'حازم', 'حافظ', 'حامد', 'حبيب', 'حسام', 'حسان', 'حسن', 'حسني', 'حسين', 'حمدان', 'حمدي', 'حمزة', 'حميد', 'خالد', 'خضر', 'خلف', 'خليفة', 'خليل', 'خميس', 'داوود', 'دياب', 'رأفت', 'رؤوف', 'رائد', 'رائف', 'راجح', 'راجي', 'راشد', 'راضي', 'راغب', 'رافت', 'راكان', 'رامز', 'رامي', 'ربيع', 'رجب', 'رزق', 'رشاد', 'رشيد', 'رضا', 'رضوان', 'رياض', 'ريان', 'زاهر', 'زاهي', 'زايد', 'زكريا', 'زمام', 'زهير', 'زياد', 'زيد', 'زيدان', 'زين', 'سالم', 'سامح', 'سامر', 'سامي', 'سعد', 'سعيد', 'سلام', 'سلطان', 'سلمان', 'سليم', 'سليمان', 'سمعان', 'سميح', 'سنان', 'سند', - 'سيف', 'شادي', 'شاكر', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرغام', 'ضياء', 'ضياء الدين’, ', 'طارق', 'طالب', 'طاهر', 'طه', 'عادل', 'عاصم', 'عاطف', + 'سيف', 'شادي', 'شاكر', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرغام', 'ضياء', 'ضياء الدين', 'طارق', 'طالب', 'طاهر', 'طه', 'عادل', 'عاصم', 'عاطف', 'عبيدة', 'عثمان', 'عدلي', 'عدنان', 'عزت', 'عصام', 'علاء', 'علي', 'عماد', 'عمار', 'عمر', 'عمرو', 'عنان', 'عواد', 'عوض', 'عوف', 'عوني', 'عيد', 'عيسى', 'غازي', 'غسان', 'غيث', 'فؤاد', 'فادي', 'فارس', 'فاروق', 'فاضل', 'فايز', 'فتحي', 'فراس', 'فرح', 'فريد', 'فهد', 'فهمي', 'فوزي', 'فيصل', 'قارس', 'قاسم', 'قيس', 'كامل', 'كرم', 'كريم', 'كمال', 'لؤي', 'لبيب', 'لطفي', 'ليث', 'مأمون', diff --git a/src/Faker/Provider/ar_SA/Person.php b/src/Faker/Provider/ar_SA/Person.php index 505c8640c..91527c39a 100644 --- a/src/Faker/Provider/ar_SA/Person.php +++ b/src/Faker/Provider/ar_SA/Person.php @@ -36,7 +36,7 @@ class Person extends \Faker\Provider\Person 'جواد', 'حابس', 'حاتم', 'حارث', 'حازم', 'حافظ', 'حاكم', 'حامد', 'حبيب', 'حذيفة', 'حسام', 'حسان', 'حسن', 'حسني', 'حسين', 'حكم', 'حمد', 'حمدالله', 'حمدان', 'حمدي', 'حمزة', 'حمود', 'حميد', 'خالد', 'خضر', 'خلدون', 'خلف', 'خليفة', 'خليل', 'خميس', 'داوود', 'ذياب', 'ذيب', 'رأفت', 'رؤوف', 'رئاد', 'رائد', 'رائف', 'راجح', 'راجي', 'راشد', 'راضي', 'راغب', 'رافت', 'رافع', 'رافي', 'راكان', 'رامان', 'رامز', 'رامي', 'رامين', 'ربيع', 'رجا', 'رجائي', 'رجب', 'رداد', 'رزق', 'رسلان', 'رشاد', 'رشيد', 'رضا', 'رضوان', 'رعد', 'رغد', 'رغيد', 'ركان', 'رماح', 'رياض', 'ريان', 'زاهر', 'زاهي', 'زايد', 'زكريا', 'زمام', 'زهير', 'زياد', 'زيد', 'زيدان', 'زيدون', 'زين', 'زين العابدين', 'سائد', 'ساري', 'سالم', 'سامح', 'سامر', 'سامي', 'ساهر', 'سدير', 'سرمد', 'سري', 'سعد', 'سعود', 'سعيد', 'سفيان', 'سكوت', 'سلام', 'سلطان', 'سلمان', 'سليم', 'سليمان', 'سمعان', 'سميح', 'سنان', 'سند', 'سهل', 'سهم', - 'سيف', 'شادي', 'شافع', 'شاكر', 'شامل', 'شاهر', 'شرحبيل', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صخر', 'صدام', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرار', 'ضرغام', 'ضياء', 'ضياء الدين’, ', 'طارق', 'طالب', 'طاهر', 'طلال', 'طه', 'عادل', 'عاصم', 'عاطف', + 'سيف', 'شادي', 'شافع', 'شاكر', 'شامل', 'شاهر', 'شرحبيل', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صخر', 'صدام', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرار', 'ضرغام', 'ضياء', 'ضياء الدين', 'طارق', 'طالب', 'طاهر', 'طلال', 'طه', 'عادل', 'عاصم', 'عاطف', 'عامر', 'عايد', 'عبادة', 'عباس', 'عبد الباري', 'عبد الحافظ', 'عبد الحكيم', 'عبد الحليم', 'عبد الحميد', 'عبد الحي', 'عبد الرحمان', 'عبد الرحمن', 'عبد الرحيم', 'عبد الرزاق', 'عبد السلام', 'عبد السميع', 'عبد العزيز', 'عبد العفو', 'عبد الغني', 'عبد الفتاح', 'عبد القادر', 'عبد الكريم', 'عبد اللطيف', 'عبد الله', 'عبد المجيد', 'عبد المولى', 'عبد الناصر', 'عبد الهادي', 'عبد ربه', 'عبداالله', 'عبدالاله', 'عبدالباسط', 'عبدالجليل', 'عبدالجواد', 'عبدالحليم', 'عبدالحميد', 'عبدالرؤوف', 'عبدالرحمن', 'عبدالرحيم', 'عبدالرزاق', 'عبدالسلام', 'عبدالعزيز', 'عبدالفتاح', 'عبدالقادر', 'عبدالكريم', 'عبداللطيف', 'عبدالله', 'عبدالمجيد', 'عبدالمطلب', 'عبدالمعطي', 'عبدالمهيمن', 'عبدالناصر', 'عبدالهادي', 'عبدالوهاب', 'عبيدالله', 'عبيدة', 'عتيبه', 'عثمان', 'عدب', 'عدلي', 'عدنان', 'عدوان', 'عدي', 'عرار', 'عرمان', 'عروة', 'عريق', 'عرين', 'عز الدين', 'عزالدين', 'عزام', 'عزت', diff --git a/src/Faker/Provider/cs_CZ/Person.php b/src/Faker/Provider/cs_CZ/Person.php index 6e2bab137..64b4e9e0c 100644 --- a/src/Faker/Provider/cs_CZ/Person.php +++ b/src/Faker/Provider/cs_CZ/Person.php @@ -438,8 +438,8 @@ public function birthNumber($gender = null, $minAge = 0, $maxAge = 100, $slashPr $gender = $this->generator->boolean() ? static::GENDER_MALE : static::GENDER_FEMALE; } - $startTimestamp = strtotime("-${maxAge} year"); - $endTimestamp = strtotime("-${minAge} year"); + $startTimestamp = strtotime(sprintf('-%d year', $maxAge)); + $endTimestamp = strtotime(sprintf('-%d year', $minAge)); $randTimestamp = self::numberBetween($startTimestamp, $endTimestamp); $year = (int) (date('Y', $randTimestamp)); diff --git a/src/Faker/Provider/da_DK/Person.php b/src/Faker/Provider/da_DK/Person.php index fa1e89c6c..732afeb21 100644 --- a/src/Faker/Provider/da_DK/Person.php +++ b/src/Faker/Provider/da_DK/Person.php @@ -36,7 +36,7 @@ class Person extends \Faker\Provider\Person * @var array Danish first names. */ protected static $firstNameMale = [ - 'Aage', 'Adam', 'Adolf', 'Ahmad', 'Ahmed', 'Aksel', 'Albert', 'Alex', 'Alexander', 'Alf', 'Alfred', 'Ali', 'Allan', + 'Aage', 'Adam', 'Ahmad', 'Ahmed', 'Aksel', 'Albert', 'Alex', 'Alexander', 'Alf', 'Alfred', 'Ali', 'Allan', 'Anders', 'Andreas', 'Anker', 'Anton', 'Arne', 'Arnold', 'Arthur', 'Asbjørn', 'Asger', 'August', 'Axel', 'Benjamin', 'Benny', 'Bent', 'Bernhard', 'Birger', 'Bjarne', 'Bjørn', 'Bo', 'Brian', 'Bruno', 'Børge', 'Carl', 'Carlo', 'Carsten', 'Casper', 'Charles', 'Chris', 'Christian', 'Christoffer', 'Christopher', 'Claus', 'Dan', 'Daniel', 'David', 'Dennis', diff --git a/src/Faker/Provider/de_CH/Person.php b/src/Faker/Provider/de_CH/Person.php index 9910b1272..d3ead307d 100644 --- a/src/Faker/Provider/de_CH/Person.php +++ b/src/Faker/Provider/de_CH/Person.php @@ -8,7 +8,7 @@ class Person extends \Faker\Provider\de_DE\Person * @see http://www.bfs.admin.ch/bfs/portal/de/index/themen/01/02/blank/dos/prenoms/02.html */ protected static $firstNameMale = [ - 'Adolf', 'Adrian', 'Alain', 'Albert', 'Alessandro', 'Alex', 'Alexander', 'Alfred', 'Ali', 'Alois', 'Andrea', 'Andreas', 'Andrin', 'André', 'Angelo', 'Anton', 'Antonio', 'Armin', 'Arnold', 'Arthur', + 'Adrian', 'Alain', 'Albert', 'Alessandro', 'Alex', 'Alexander', 'Alfred', 'Ali', 'Alois', 'Andrea', 'Andreas', 'Andrin', 'André', 'Angelo', 'Anton', 'Antonio', 'Armin', 'Arnold', 'Arthur', 'Beat', 'Benjamin', 'Bernhard', 'Bruno', 'Carlo', 'Carlos', 'Christian', 'Christoph', 'Claudio', 'Cyrill', 'Cédric', 'Damian', 'Daniel', 'Dario', 'David', 'Denis', 'Diego', 'Dieter', 'Dominic', 'Dominik', diff --git a/src/Faker/Provider/de_DE/Person.php b/src/Faker/Provider/de_DE/Person.php index 45a0c2e6f..44f205e06 100644 --- a/src/Faker/Provider/de_DE/Person.php +++ b/src/Faker/Provider/de_DE/Person.php @@ -31,7 +31,7 @@ class Person extends \Faker\Provider\Person * {@link} From https://de.wiktionary.org/wiki/Verzeichnis:Deutsch/Namen/die_h%C3%A4ufigsten_m%C3%A4nnlichen_Vornamen_Deutschlands */ protected static $firstNameMale = [ - 'Achim', 'Adalbert', 'Adam', 'Adolf', 'Adrian', 'Ahmed', 'Ahmet', 'Albert', 'Albin', 'Albrecht', 'Alex', 'Alexander', 'Alfons', 'Alfred', 'Ali', 'Alois', 'Aloys', 'Alwin', 'Anatoli', 'Andre', 'Andreas', 'Andree', 'Andrej', 'Andrzej', 'André', 'Andy', 'Angelo', 'Ansgar', 'Anton', 'Antonio', 'Antonius', 'Armin', 'Arnd', 'Arndt', 'Arne', 'Arno', 'Arnold', 'Arnulf', 'Arthur', 'Artur', 'August', 'Axel', + 'Achim', 'Adalbert', 'Adam', 'Adrian', 'Ahmed', 'Ahmet', 'Albert', 'Albin', 'Albrecht', 'Alex', 'Alexander', 'Alfons', 'Alfred', 'Ali', 'Alois', 'Aloys', 'Alwin', 'Anatoli', 'Andre', 'Andreas', 'Andree', 'Andrej', 'Andrzej', 'André', 'Andy', 'Angelo', 'Ansgar', 'Anton', 'Antonio', 'Antonius', 'Armin', 'Arnd', 'Arndt', 'Arne', 'Arno', 'Arnold', 'Arnulf', 'Arthur', 'Artur', 'August', 'Axel', 'Bastian', 'Benedikt', 'Benjamin', 'Benno', 'Bernard', 'Bernd', 'Berndt', 'Bernhard', 'Bert', 'Berthold', 'Bertram', 'Björn', 'Bodo', 'Bogdan', 'Boris', 'Bruno', 'Burghard', 'Burkhard', 'Carl', 'Carlo', 'Carlos', 'Carsten', 'Christian', 'Christof', 'Christoph', 'Christopher', 'Christos', 'Claudio', 'Claus', 'Claus-Dieter', 'Claus-Peter', 'Clemens', 'Cornelius', 'Daniel', 'Danny', 'Darius', 'David', 'Denis', 'Dennis', 'Detlef', 'Detlev', 'Dierk', 'Dieter', 'Diethard', 'Diethelm', 'Dietmar', 'Dietrich', 'Dimitri', 'Dimitrios', 'Dirk', 'Domenico', 'Dominik', diff --git a/src/Faker/Provider/en_US/Person.php b/src/Faker/Provider/en_US/Person.php index 3c6f99a4f..5cd22d43e 100644 --- a/src/Faker/Provider/en_US/Person.php +++ b/src/Faker/Provider/en_US/Person.php @@ -27,7 +27,7 @@ class Person extends \Faker\Provider\Person ]; protected static $firstNameMale = [ - 'Aaron', 'Abdiel', 'Abdul', 'Abdullah', 'Abe', 'Abel', 'Abelardo', 'Abner', 'Abraham', 'Adalberto', 'Adam', 'Adan', 'Adelbert', 'Adolf', 'Adolfo', 'Adolph', 'Adolphus', 'Adonis', 'Adrain', 'Adrian', 'Adriel', 'Adrien', 'Afton', 'Agustin', 'Ahmad', 'Ahmed', 'Aidan', 'Aiden', 'Akeem', 'Al', 'Alan', 'Albert', 'Alberto', 'Albin', 'Alden', 'Alec', 'Alejandrin', 'Alek', 'Alessandro', 'Alex', 'Alexander', 'Alexandre', 'Alexandro', 'Alexie', 'Alexis', 'Alexys', 'Alexzander', 'Alf', 'Alfonso', 'Alfonzo', 'Alford', 'Alfred', 'Alfredo', 'Ali', 'Allan', 'Allen', 'Alphonso', 'Alvah', 'Alvis', 'Amani', 'Amari', 'Ambrose', 'Americo', 'Amir', 'Amos', 'Amparo', 'Anastacio', 'Anderson', 'Andre', 'Andres', 'Andrew', 'Andy', 'Angel', 'Angelo', 'Angus', 'Anibal', 'Ansel', 'Ansley', 'Anthony', 'Antone', 'Antonio', 'Antwan', 'Antwon', 'Arch', 'Archibald', 'Arden', 'Arely', 'Ari', 'Aric', 'Ariel', 'Arjun', 'Arlo', 'Armand', 'Armando', 'Armani', 'Arnaldo', 'Arne', 'Arno', 'Arnold', 'Arnoldo', 'Arnulfo', 'Aron', 'Art', 'Arthur', 'Arturo', 'Arvel', 'Arvid', 'Ashton', 'August', 'Augustus', 'Aurelio', 'Austen', 'Austin', 'Austyn', 'Avery', 'Axel', 'Ayden', + 'Aaron', 'Abdiel', 'Abdul', 'Abdullah', 'Abe', 'Abel', 'Abelardo', 'Abner', 'Abraham', 'Adalberto', 'Adam', 'Adan', 'Adelbert', 'Adolfo', 'Adolphus', 'Adonis', 'Adrain', 'Adrian', 'Adriel', 'Adrien', 'Afton', 'Agustin', 'Ahmad', 'Ahmed', 'Aidan', 'Aiden', 'Akeem', 'Al', 'Alan', 'Albert', 'Alberto', 'Albin', 'Alden', 'Alec', 'Alejandrin', 'Alek', 'Alessandro', 'Alex', 'Alexander', 'Alexandre', 'Alexandro', 'Alexie', 'Alexis', 'Alexys', 'Alexzander', 'Alf', 'Alfonso', 'Alfonzo', 'Alford', 'Alfred', 'Alfredo', 'Ali', 'Allan', 'Allen', 'Alphonso', 'Alvah', 'Alvis', 'Amani', 'Amari', 'Ambrose', 'Americo', 'Amir', 'Amos', 'Amparo', 'Anastacio', 'Anderson', 'Andre', 'Andres', 'Andrew', 'Andy', 'Angel', 'Angelo', 'Angus', 'Anibal', 'Ansel', 'Ansley', 'Anthony', 'Antone', 'Antonio', 'Antwan', 'Antwon', 'Arch', 'Archibald', 'Arden', 'Arely', 'Ari', 'Aric', 'Ariel', 'Arjun', 'Arlo', 'Armand', 'Armando', 'Armani', 'Arnaldo', 'Arne', 'Arno', 'Arnold', 'Arnoldo', 'Arnulfo', 'Aron', 'Art', 'Arthur', 'Arturo', 'Arvel', 'Arvid', 'Ashton', 'August', 'Augustus', 'Aurelio', 'Austen', 'Austin', 'Austyn', 'Avery', 'Axel', 'Ayden', 'Bailey', 'Barney', 'Baron', 'Barrett', 'Barry', 'Bart', 'Bartholome', 'Barton', 'Baylee', 'Beau', 'Bell', 'Ben', 'Benedict', 'Benjamin', 'Bennett', 'Bennie', 'Benny', 'Benton', 'Bernard', 'Bernardo', 'Bernhard', 'Bernie', 'Berry', 'Berta', 'Bertha', 'Bertram', 'Bertrand', 'Bill', 'Billy', 'Blair', 'Blaise', 'Blake', 'Blaze', 'Bo', 'Bobbie', 'Bobby', 'Boris', 'Boyd', 'Brad', 'Braden', 'Bradford', 'Bradley', 'Bradly', 'Brady', 'Braeden', 'Brain', 'Brando', 'Brandon', 'Brandt', 'Brannon', 'Branson', 'Brant', 'Braulio', 'Braxton', 'Brayan', 'Brendan', 'Brenden', 'Brendon', 'Brennan', 'Brennon', 'Brent', 'Bret', 'Brett', 'Brian', 'Brice', 'Brock', 'Broderick', 'Brody', 'Brook', 'Brooks', 'Brown', 'Bruce', 'Bryce', 'Brycen', 'Bryon', 'Buck', 'Bud', 'Buddy', 'Buford', 'Burley', 'Buster', 'Cade', 'Caden', 'Caesar', 'Cale', 'Caleb', 'Camden', 'Cameron', 'Camren', 'Camron', 'Camryn', 'Candelario', 'Candido', 'Carey', 'Carleton', 'Carlo', 'Carlos', 'Carmel', 'Carmelo', 'Carmine', 'Carol', 'Carroll', 'Carson', 'Carter', 'Cary', 'Casey', 'Casimer', 'Casimir', 'Casper', 'Ceasar', 'Cecil', 'Cedrick', 'Celestino', 'Cesar', 'Chad', 'Chadd', 'Chadrick', 'Chaim', 'Chance', 'Chandler', 'Charles', 'Charley', 'Charlie', 'Chase', 'Chauncey', 'Chaz', 'Chelsey', 'Chesley', 'Chester', 'Chet', 'Chris', 'Christ', 'Christian', 'Christop', 'Christophe', 'Christopher', 'Cicero', 'Cielo', 'Clair', 'Clark', 'Claud', 'Claude', 'Clay', 'Clemens', 'Clement', 'Cleo', 'Cletus', 'Cleve', 'Cleveland', 'Clifford', 'Clifton', 'Clint', 'Clinton', 'Clovis', 'Cloyd', 'Clyde', 'Coby', 'Cody', 'Colby', 'Cole', 'Coleman', 'Colin', 'Collin', 'Colt', 'Colten', 'Colton', 'Columbus', 'Conner', 'Connor', 'Conor', 'Conrad', 'Constantin', 'Consuelo', 'Cooper', 'Corbin', 'Cordelia', 'Cordell', 'Cornelius', 'Cornell', 'Cortez', 'Cory', 'Coty', 'Coy', 'Craig', 'Crawford', 'Cristian', 'Cristina', 'Cristobal', 'Cristopher', 'Cruz', 'Cullen', 'Curt', 'Curtis', 'Cyril', 'Cyrus', 'Dagmar', 'Dale', 'Dallas', 'Dallin', 'Dalton', 'Dameon', 'Damian', 'Damien', 'Damion', 'Damon', 'Dan', 'Dane', 'D\'angelo', 'Dangelo', 'Danial', 'Danny', 'Dante', 'Daren', 'Darian', 'Darien', 'Dario', 'Darion', 'Darius', 'Daron', 'Darrel', 'Darrell', 'Darren', 'Darrick', 'Darrin', 'Darrion', 'Darron', 'Darryl', 'Darwin', 'Daryl', 'Dashawn', 'Dave', 'David', 'Davin', 'Davion', 'Davon', 'Davonte', 'Dawson', 'Dax', 'Dayne', 'Dayton', 'Dean', 'Deangelo', 'Declan', 'Dedric', 'Dedrick', 'Dee', 'Deion', 'Dejon', 'Dejuan', 'Delaney', 'Delbert', 'Dell', 'Delmer', 'Demarco', 'Demarcus', 'Demario', 'Demetrius', 'Demond', 'Denis', 'Dennis', 'Deon', 'Deondre', 'Deontae', 'Deonte', 'Dereck', 'Derek', 'Derick', 'Deron', 'Derrick', 'Deshaun', 'Deshawn', 'Desmond', 'Destin', 'Devan', 'Devante', 'Deven', 'Devin', 'Devon', 'Devonte', 'Devyn', 'Dewayne', 'Dewitt', 'Dexter', 'Diamond', 'Diego', 'Dillan', 'Dillon', 'Dimitri', 'Dino', 'Dion', 'Dock', 'Domenic', 'Domenick', 'Domenico', 'Domingo', 'Dominic', 'Don', 'Donald', 'Donato', 'Donavon', 'Donnell', 'Donnie', 'Donny', 'Dorcas', 'Dorian', 'Doris', 'Dorthy', 'Doug', 'Douglas', 'Doyle', 'Drake', 'Dudley', 'Duncan', 'Durward', 'Dustin', 'Dusty', 'Dwight', 'Dylan', diff --git a/src/Faker/Provider/nb_NO/Person.php b/src/Faker/Provider/nb_NO/Person.php index dff5d2dd4..86ce721ba 100644 --- a/src/Faker/Provider/nb_NO/Person.php +++ b/src/Faker/Provider/nb_NO/Person.php @@ -134,7 +134,7 @@ class Person extends \Faker\Provider\Person 'Abdirahim', 'Abdirahman', 'Abdirashid', 'Abdirizak', 'Abdul', 'Abdulahi', 'Abdulkadir', 'Abdullah', 'Abdullahi', 'Abdulqadir', 'Abdurahman', 'Abed', 'Abel', 'Abid', 'Abraham', 'Absalon', 'Abu', 'Abubakar', 'Adam', 'Adan', 'Adeel', 'Adelheid', 'Adelsten', 'Adem', 'Aden', 'Adham', 'Adi', 'Adil', 'Adis', 'Adler', - 'Admir', 'Adnan', 'Adolf', 'Adrian', 'Afanasi', 'Afrim', 'Afshin', 'Agim', 'Agmund', 'Agnar', 'Agvald', 'Ahmad', + 'Admir', 'Adnan', 'Adrian', 'Afanasi', 'Afrim', 'Afshin', 'Agim', 'Agmund', 'Agnar', 'Agvald', 'Ahmad', 'Ahmed', 'Aiden', 'Ailo', 'Aimar', 'Aime', 'Ajdin', 'Ajmal', 'Akam', 'Akbar', 'Akram', 'Aksel', 'Alain', 'Alan', 'Alban', 'Albert', 'Alberto', 'Albin', 'Albrecht', 'Alejandro', 'Aleksander', 'Alen', 'Alessandro', 'Alex', 'Alexander', 'Alexsander', 'Alf', 'Alfred', 'Algirdas', 'Algot', 'Ali', 'Allan', 'Almar', 'Almas', 'Almaz', diff --git a/src/Faker/Provider/sk_SK/Person.php b/src/Faker/Provider/sk_SK/Person.php index 5f8fe70ad..583759ba4 100644 --- a/src/Faker/Provider/sk_SK/Person.php +++ b/src/Faker/Provider/sk_SK/Person.php @@ -34,7 +34,7 @@ class Person extends \Faker\Provider\Person 'Vlastimil', 'Boleslav', 'Eduard', 'Jozef', 'Víťazoslav', 'Blahoslav', 'Beňadik', 'Adrián', 'Gabriel', 'Marián', 'Emanuel', 'Miroslav', 'Benjamín', 'Hugo', 'Richard', 'Izidor', 'Zoltán', 'Albert', 'Igor', 'Július', 'Aleš', 'Fedor', 'Rudolf', 'Valér', 'Marcel', 'Ervín', 'Slavomír', 'Vojtech', 'Juraj', 'Marek', 'Jaroslav', 'Žigmund', 'Florián', 'Roland', 'Pankrác', 'Servác', 'Bonifác', 'Svetozár', 'Bernard', - 'Júlia', 'Urban', 'Dušan', 'Viliam', 'Ferdinand', 'Norbert', 'Róbert', 'Medard', 'Zlatko', 'Anton', 'Vasil', 'Vít', 'Adolf', 'Vratislav', + 'Júlia', 'Urban', 'Dušan', 'Viliam', 'Ferdinand', 'Norbert', 'Róbert', 'Medard', 'Zlatko', 'Anton', 'Vasil', 'Vít', 'Vratislav', 'Alfréd', 'Alojz', 'Ján', 'Tadeáš', 'Ladislav', 'Peter', 'Pavol', 'Miloslav', 'Prokop', 'Cyril', 'Metod', 'Patrik', 'Oliver', 'Ivan', 'Kamil', 'Henrich', 'Drahomír', 'Bohuslav', 'Iľja', 'Daniel', 'Vladimír', 'Jakub', 'Krištof', 'Ignác', 'Gustáv', 'Jerguš', 'Dominik', 'Oskar', 'Vavrinec', 'Ľubomír', 'Mojmír', 'Leonard', 'Tichomír', 'Filip', 'Bartolomej', 'Ľudovít', 'Samuel', 'Augustín', 'Belo', 'Oleg', diff --git a/src/Faker/Provider/sl_SI/Person.php b/src/Faker/Provider/sl_SI/Person.php index 08463950a..20a294694 100644 --- a/src/Faker/Provider/sl_SI/Person.php +++ b/src/Faker/Provider/sl_SI/Person.php @@ -25,7 +25,7 @@ class Person extends \Faker\Provider\Person * @see http://www.stat.si/doc/vsebina/05/imena/TOPIMENA_SI.xlsx */ protected static $firstNameMale = [ - 'Adam', 'Adolf', 'Albert', 'Albin', 'Aleks', 'Aleksandar', 'Aleksander', 'Aleksej', 'Alen', + 'Adam', 'Albert', 'Albin', 'Aleks', 'Aleksandar', 'Aleksander', 'Aleksej', 'Alen', 'Alex', 'Aleš', 'Aljaž', 'Aljoša', 'Alojz', 'Alojzij', 'Andraž', 'Andrej', 'Anej', 'Anton', 'Anže', 'Avgust', 'Ažbe', 'Benjamin', 'Bernard', 'Bine', 'Blaž', 'Bogdan', 'Bogomir', 'Bojan', 'Bor', 'Boris', 'Borut', 'Boštjan', 'Božidar', 'Branko', 'Brin', 'Bruno', 'Ciril', diff --git a/src/Faker/Provider/sv_SE/Person.php b/src/Faker/Provider/sv_SE/Person.php index c078f6bf8..a98f0871b 100644 --- a/src/Faker/Provider/sv_SE/Person.php +++ b/src/Faker/Provider/sv_SE/Person.php @@ -59,7 +59,7 @@ class Person extends \Faker\Provider\Person * @see http://spraakbanken.gu.se/statistik/lbfnamnalf.phtml */ protected static $firstNameMale = [ - 'Abraham', 'Adam', 'Adolf', 'Adrian', 'Agaton', 'Agne', 'Albert', 'Albin', 'Aldor', 'Alex', 'Alexander', 'Alexis', 'Alexius', 'Alf', 'Alfons', 'Alfred', 'Algot', 'Allan', 'Alrik', 'Alvar', 'Alve', 'Amandus', 'Anders', 'André', 'Andreas', 'Anselm', 'Anshelm', 'Antero', 'Anton', 'Antonius', 'Arne', 'Arnold', 'Aron', 'Arthur', 'Artur', 'Arvid', 'Assar', 'Astor', 'August', 'Augustin', 'Axel', + 'Abraham', 'Adam', 'Adrian', 'Agaton', 'Agne', 'Albert', 'Albin', 'Aldor', 'Alex', 'Alexander', 'Alexis', 'Alexius', 'Alf', 'Alfons', 'Alfred', 'Algot', 'Allan', 'Alrik', 'Alvar', 'Alve', 'Amandus', 'Anders', 'André', 'Andreas', 'Anselm', 'Anshelm', 'Antero', 'Anton', 'Antonius', 'Arne', 'Arnold', 'Aron', 'Arthur', 'Artur', 'Arvid', 'Assar', 'Astor', 'August', 'Augustin', 'Axel', 'Bengt', 'Bengt-Göran', 'Bengt-Olof', 'Bengt-Åke', 'Benny', 'Berndt', 'Berne', 'Bernhard', 'Bernt', 'Bert', 'Berth', 'Berthold', 'Bertil', 'Bill', 'Billy', 'Birger', 'Bjarne', 'Björn', 'Bo', 'Boris', 'Bror', 'Bruno', 'Brynolf', 'Börje', 'Carl', 'Carl-Axel', 'Carl-Erik', 'Carl-Gustaf', 'Carl-Gustav', 'Carl-Johan', 'Charles', 'Christer', 'Christian', 'Claes', 'Claes-Göran', 'Clarence', 'Clas', 'Conny', 'Crister', 'Curt', 'Dag', 'Dan', 'Daniel', 'David', 'Dennis', 'Dick', 'Donald', 'Douglas', diff --git a/test/Faker/Provider/BaseTest.php b/test/Faker/Provider/BaseTest.php index 0cf06b768..bb64857f8 100644 --- a/test/Faker/Provider/BaseTest.php +++ b/test/Faker/Provider/BaseTest.php @@ -3,6 +3,7 @@ namespace Faker\Test\Provider; use Faker\Provider\Base as BaseProvider; +use Faker\Test\Fixture; use Faker\Test\TestCase; /** @@ -548,22 +549,91 @@ public function testRandomElementsThrowsWhenRequestingTooManyKeys(): void BaseProvider::randomElements(['foo'], 2); } - public function testRandomElements(): void + public function testRandomElementsRejectsInvalidArgument(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage(sprintf( + 'Argument for parameter $array needs to be array, an instance of %s, or an instance of %s, got %s instead.', + \UnitEnum::class, + \Traversable::class, + \stdClass::class, + )); + + BaseProvider::randomElements(new \stdClass()); + } + + public function testRandomElementRejectsInvalidArgument(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage(sprintf( + 'Argument for parameter $array needs to be array, an instance of %s, or an instance of %s, got %s instead.', + \UnitEnum::class, + \Traversable::class, + 'string', + )); + + BaseProvider::randomElement('foo'); + } + + public function testRandomElementsWorksWithoutArgument(): void { self::assertCount(1, BaseProvider::randomElements(), 'Should work without any input'); + } + + public function testRandomElementsWorksWithEmptyArray(): void + { + $randomElements = BaseProvider::randomElements([], 0); + + self::assertIsArray($randomElements); + self::assertCount(0, $randomElements); + } + + public function testRandomElementsWorksWithEmptyTraversable(): void + { + $randomElements = BaseProvider::randomElements(new \ArrayIterator(), 0); + + self::assertIsArray($randomElements); + self::assertCount(0, $randomElements); + } + + public function testRandomElementsWorksWithNonEmptyTraversable(): void + { + $randomElements = BaseProvider::randomElements(['foo', 'bar', 'baz'], 3); + + self::assertContains('foo', $randomElements); + self::assertContains('bar', $randomElements); + self::assertContains('baz', $randomElements); + } + + public function testRandomElementsWorksWithAllowDuplicates(): void + { + $randomElements = BaseProvider::randomElements(['foo', 'bar'], 3, true); + + self::assertCount(3, $randomElements); + self::assertContainsOnly('string', $randomElements); + } - $empty = BaseProvider::randomElements([], 0); - self::assertIsArray($empty); - self::assertCount(0, $empty); + /** + * @requires PHP 8.1 + */ + public function testRandomElementsWithEnum(): void + { + $count = 2; - $shuffled = BaseProvider::randomElements(['foo', 'bar', 'baz'], 3); - self::assertContains('foo', $shuffled); - self::assertContains('bar', $shuffled); - self::assertContains('baz', $shuffled); + $randomElements = BaseProvider::randomElements(Fixture\Enum\BackedEnum::class, $count); + + self::assertCount($count, $randomElements); + self::assertContainsOnlyInstancesOf(Fixture\Enum\BackedEnum::class, $randomElements); + } + + /** + * @requires PHP 8.1 + */ + public function testRandomElementWithEnum(): void + { + $randomElement = BaseProvider::randomElement(Fixture\Enum\BackedEnum::class); - $allowDuplicates = BaseProvider::randomElements(['foo', 'bar'], 3, true); - self::assertCount(3, $allowDuplicates); - self::assertContainsOnly('string', $allowDuplicates); + self::assertInstanceOf(Fixture\Enum\BackedEnum::class, $randomElement); } } diff --git a/test/Faker/Provider/DateTimeTest.php b/test/Faker/Provider/DateTimeTest.php index 5b0ce2bdf..0dc446c64 100644 --- a/test/Faker/Provider/DateTimeTest.php +++ b/test/Faker/Provider/DateTimeTest.php @@ -281,4 +281,15 @@ public function testFixedSeedWithMaximumTimestamp(): void self::assertEquals($dateTimeThisYear, DateTimeProvider::dateTimeThisYear($max)); mt_srand(); } + + public function testTimezone(): void + { + $timezone = DateTimeProvider::timezone(); + $countryTimezone = DateTimeProvider::timezone('US'); + + self::assertIsString($timezone); + self::assertContains($timezone, \DateTimeZone::listIdentifiers()); + self::assertIsString($countryTimezone); + self::assertContains($countryTimezone, \DateTimeZone::listIdentifiers(\DateTimeZone::PER_COUNTRY, 'US')); + } } diff --git a/test/Fixture/Enum/BackedEnum.php b/test/Fixture/Enum/BackedEnum.php new file mode 100644 index 000000000..965df23bb --- /dev/null +++ b/test/Fixture/Enum/BackedEnum.php @@ -0,0 +1,12 @@ +=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -934,24 +851,27 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.2", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + "reference": "dfc078e8af9c99210337325ff5aa152872c98714" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", + "reference": "dfc078e8af9c99210337325ff5aa152872c98714", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", @@ -983,9 +903,54 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" + }, + "time": "2023-03-27T19:02:04+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.20.4", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" }, - "time": "2022-10-14T12:47:21+00:00" + "time": "2023-05-02T09:19:37+00:00" }, { "name": "psr/container", @@ -1087,16 +1052,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -1141,7 +1106,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -1149,20 +1114,84 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" + }, + { + "name": "spatie/array-to-xml", + "version": "2.17.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", + "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": "^7.4|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.2", + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^9.0", + "spatie/pest-plugin-snapshots": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ArrayToXml\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://freek.dev", + "role": "Developer" + } + ], + "description": "Convert an array to xml", + "homepage": "https://github.com/spatie/array-to-xml", + "keywords": [ + "array", + "convert", + "xml" + ], + "support": { + "source": "https://github.com/spatie/array-to-xml/tree/2.17.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-12-26T08:22:07+00:00" }, { "name": "symfony/console", - "version": "v5.4.16", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" + "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", "shasum": "" }, "require": { @@ -1227,12 +1256,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.16" + "source": "https://github.com/symfony/console/tree/v5.4.23" }, "funding": [ { @@ -1248,7 +1277,7 @@ "type": "tidelift" } ], - "time": "2022-11-25T14:09:27+00:00" + "time": "2023-04-24T18:47:29+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1319,16 +1348,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.13", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", "shasum": "" }, "require": { @@ -1363,7 +1392,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + "source": "https://github.com/symfony/filesystem/tree/v5.4.23" }, "funding": [ { @@ -1379,7 +1408,7 @@ "type": "tidelift" } ], - "time": "2022-09-21T19:53:16+00:00" + "time": "2023-03-02T11:38:35+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1958,16 +1987,16 @@ }, { "name": "symfony/string", - "version": "v5.4.15", + "version": "v5.4.22", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" + "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", "shasum": "" }, "require": { @@ -2024,7 +2053,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.15" + "source": "https://github.com/symfony/string/tree/v5.4.22" }, "funding": [ { @@ -2040,26 +2069,26 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:16:54+00:00" + "time": "2023-03-14T06:11:53+00:00" }, { "name": "vimeo/psalm", - "version": "5.2.0", + "version": "5.11.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" + "reference": "c9b192ab8400fdaf04b2b13d110575adc879aa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", - "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/c9b192ab8400fdaf04b2b13d110575adc879aa90", + "reference": "c9b192ab8400fdaf04b2b13d110575adc879aa90", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.10.0", + "composer-runtime-api": "^2", "composer/semver": "^1.4 || ^2.0 || ^3.0", "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", @@ -2072,28 +2101,28 @@ "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.1", "felixfbecker/language-server-protocol": "^1.5.2", - "fidry/cpu-core-counter": "^0.4.0", + "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.13", - "openlss/lib-array2xml": "^1.0", + "nikic/php-parser": "^4.14", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", - "sebastian/diff": "^4.0", + "sebastian/diff": "^4.0 || ^5.0", + "spatie/array-to-xml": "^2.17.0 || ^3.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/polyfill-php80": "^1.25" + "symfony/filesystem": "^5.4 || ^6.0" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { + "amphp/phpunit-util": "^2.0", "bamarni/composer-bin-plugin": "^1.4", - "brianium/paratest": "^6.0", + "brianium/paratest": "^6.9", "ext-curl": "*", "mockery/mockery": "^1.5", "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpdoc-parser": "^1.6", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6", "psalm/plugin-mockery": "^1.1", "psalm/plugin-phpunit": "^0.18", "slevomat/coding-standard": "^8.4", @@ -2139,13 +2168,14 @@ "keywords": [ "code", "inspection", - "php" + "php", + "static analysis" ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.2.0" + "source": "https://github.com/vimeo/psalm/tree/5.11.0" }, - "time": "2022-12-12T08:18:56+00:00" + "time": "2023-05-04T21:35:44+00:00" }, { "name": "webmozart/assert", diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json index 6cd9a8238..daf132ee1 100644 --- a/vendor-bin/rector/composer.json +++ b/vendor-bin/rector/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^8.1", - "rector/rector": "^0.15.0" + "rector/rector": "^0.16.0" }, "config": { "platform": { diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock index ca0fbed69..367f67377 100644 --- a/vendor-bin/rector/composer.lock +++ b/vendor-bin/rector/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "be38cafadfc09ca7ff05a317facfa0d5", + "content-hash": "31d6590ac94472981a79ba104001dbbb", "packages": [ { "name": "phpstan/phpstan", - "version": "1.9.2", + "version": "1.10.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" + "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", + "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", "shasum": "" }, "require": { @@ -46,8 +46,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.2" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -63,30 +66,29 @@ "type": "tidelift" } ], - "time": "2022-11-10T09:56:11+00:00" + "time": "2023-05-09T15:28:01+00:00" }, { "name": "rector/rector", - "version": "0.15.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "fbfbe499d0fedfac7fe2fed1a55a00bd08f19c91" + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/fbfbe499d0fedfac7fe2fed1a55a00bd08f19c91", - "reference": "fbfbe499d0fedfac7fe2fed1a55a00bd08f19c91", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.9.2" + "phpstan/phpstan": "^1.10.14" }, "conflict": { "rector/rector-doctrine": "*", "rector/rector-downgrade-php": "*", - "rector/rector-php-parser": "*", "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, @@ -96,7 +98,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.14-dev" + "dev-main": "0.15-dev" } }, "autoload": { @@ -109,9 +111,15 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.0" + "source": "https://github.com/rectorphp/rector/tree/0.16.0" }, "funding": [ { @@ -119,7 +127,7 @@ "type": "github" } ], - "time": "2022-12-04T22:40:18+00:00" + "time": "2023-05-05T12:12:17+00:00" } ], "packages-dev": [],