From 4b6dd73a0b392c37d490735b7e48ced8b1da8f24 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Fri, 13 Jan 2017 02:00:21 +0300 Subject: [PATCH] New PHP 7.1 type hints for DataFixtures. --- .../PointToolsBundle/DataFixtures/ORM/LoadCommentsData.php | 2 +- .../Bundle/PointToolsBundle/DataFixtures/ORM/LoadPostData.php | 2 +- .../PointToolsBundle/DataFixtures/ORM/LoadSubscribersData.php | 4 ++-- .../Bundle/PointToolsBundle/DataFixtures/ORM/LoadUserData.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadCommentsData.php b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadCommentsData.php index e406536..14b8a40 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadCommentsData.php +++ b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadCommentsData.php @@ -55,7 +55,7 @@ class LoadCommentsData extends AbstractFixture implements OrderedFixtureInterfac $om->flush(); } - public function getOrder() + public function getOrder(): int { return 3; } diff --git a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadPostData.php b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadPostData.php index a624211..be0e135 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadPostData.php +++ b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadPostData.php @@ -40,7 +40,7 @@ class LoadPostData extends AbstractFixture implements OrderedFixtureInterface $this->addReference('test_post_longpost', $longPost); } - public function getOrder() + public function getOrder(): int { return 2; } diff --git a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadSubscribersData.php b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadSubscribersData.php index e30c37a..8838f3c 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadSubscribersData.php +++ b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadSubscribersData.php @@ -45,7 +45,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter $om->flush(); } - public function getOrder() + public function getOrder(): int { return 4; } @@ -58,7 +58,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter * * @return User[] */ - private function getRandomSubscribers($users, $min = 0) + private function getRandomSubscribers(array $users, int $min = 0): array { if (0 === $number = mt_rand($min, count($users))) { return []; diff --git a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadUserData.php b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadUserData.php index a84e9dc..3e5ae0f 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadUserData.php +++ b/src/Skobkin/Bundle/PointToolsBundle/DataFixtures/ORM/LoadUserData.php @@ -39,7 +39,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface $om->flush(); } - public function getOrder() + public function getOrder(): int { return 1; }