Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add property type declarations #713

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Faker/Core/Blood.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class Blood implements Extension\BloodExtension
/**
* @var string[]
*/
private $bloodTypes = ['A', 'AB', 'B', 'O'];
private array $bloodTypes = ['A', 'AB', 'B', 'O'];

/**
* @var string[]
*/
private $bloodRhFactors = ['+', '-'];
private array $bloodRhFactors = ['+', '-'];

public function bloodType(): string
{
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Core/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class Color implements Extension\ColorExtension
/**
* @var string[]
*/
private $safeColorNames = [
private array $safeColorNames = [
'black', 'maroon', 'green', 'navy', 'olive',
'purple', 'teal', 'lime', 'blue', 'silver',
'gray', 'yellow', 'fuchsia', 'aqua', 'white',
Expand All @@ -24,7 +24,7 @@ final class Color implements Extension\ColorExtension
/**
* @var string[]
*/
private $allColorNames = [
private array $allColorNames = [
'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine',
'Azure', 'Beige', 'Bisque', 'Black', 'BlanchedAlmond',
'Blue', 'BlueViolet', 'Brown', 'BurlyWood', 'CadetBlue',
Expand Down
7 changes: 2 additions & 5 deletions src/Faker/Core/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ final class DateTime implements DateTimeExtension, GeneratorAwareExtension
/**
* @var string[]
*/
private $centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI'];
private array $centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI'];

/**
* @var string
*/
private $defaultTimezone = null;
private ?string $defaultTimezone = null;

/**
* Get the POSIX-timestamp of a DateTime, int or string.
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/Core/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class File implements Extension\FileExtension
*
* @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
*/
private $mimeTypes = [
private array $mimeTypes = [
'application/atom+xml' => 'atom',
'application/ecmascript' => 'ecma',
'application/emma+xml' => 'emma',
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/Core/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class Version implements VersionExtension
/**
* @var string[]
*/
private $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc'];
private array $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc'];

/**
* Represents v2.0.0 of the semantic versioning: https://semver.org/spec/v2.0.0.html
Expand Down