New PHP 7.1 type hints for DataFixtures.

This commit is contained in:
Alexey Skobkin 2017-01-13 02:00:21 +03:00
parent 89998a6418
commit 4b6dd73a0b
4 changed files with 5 additions and 5 deletions

View file

@ -55,7 +55,7 @@ class LoadCommentsData extends AbstractFixture implements OrderedFixtureInterfac
$om->flush(); $om->flush();
} }
public function getOrder() public function getOrder(): int
{ {
return 3; return 3;
} }

View file

@ -40,7 +40,7 @@ class LoadPostData extends AbstractFixture implements OrderedFixtureInterface
$this->addReference('test_post_longpost', $longPost); $this->addReference('test_post_longpost', $longPost);
} }
public function getOrder() public function getOrder(): int
{ {
return 2; return 2;
} }

View file

@ -45,7 +45,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
$om->flush(); $om->flush();
} }
public function getOrder() public function getOrder(): int
{ {
return 4; return 4;
} }
@ -58,7 +58,7 @@ class LoadSubscribersData extends AbstractFixture implements OrderedFixtureInter
* *
* @return User[] * @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))) { if (0 === $number = mt_rand($min, count($users))) {
return []; return [];

View file

@ -39,7 +39,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
$om->flush(); $om->flush();
} }
public function getOrder() public function getOrder(): int
{ {
return 1; return 1;
} }