엄격한 기준 "만 변수는 참조에 의해 전달되어야한다"변수 만이 C에서 참조에 의해 전달되어야한다 : \ XAMPP \ htdoc 의 \ EliteFifa2 \ SRC \ EliteFifa \ 번들 \ DataFixtures \ ORM \ MatchFixtures.php 라인 (70)Symfony2 DataFixtures 오류가 발생 했습니까?
에 선 (70)는이 라인을 참조한다 :
$lastHomeTeam = array_shift(array_splice($homeTeams, 1, 1));
나는 다음과 같은 알고리즘이 정상 PHP 페이지에서 작동하기 때문에 잘못 무슨 일이 일어나고 있는지 이해가 안 돼요.
class MatchFixtures extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
{
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function load(ObjectManager $manager)
{
$teams = array(0, 1, 2, 3);
$worldSeason1 = $this->getReference("WorldSeason1");
$league1 = $this->getReference("League 1");
$fixtures = $this->createFixtures($teams, $worldSeason1, $league1);
}
private function createFixtures($teams, $season, $competition)
{
$teamsCount = count($teams);
$rounds = $teamsCount - 1;
$matchesPerRound = $teamsCount/2;
$awayTeams = array_splice($teams, $matchesPerRound);
$homeTeams = $teams;
$fixtures = array();
for ($r = 0; $r < $rounds; $r++) {
for ($m = 0; $m < $matchesPerRound; $m++) {
$homeTeam = $homeTeams[$m];
$awayTeam = $awayTeams[$m];
$fixtures[$r][$m]["home"] = $homeTeam;
$fixtures[$r][$m]["away"] = $awayTeam;
}
$lastHomeTeam = array_shift(array_splice($homeTeams, 1, 1));
array_unshift($awayTeams, $lastHomeTeam);
$lastAwayTeam = array_pop($awayTeams);
array_push($homeTeams, $lastAwayTeam);
}
return $fixtures;
}
}
가능한 복제본 [Strict 표준 : 변수 만 참조로 전달해야 함] (http://stackoverflow.com/questions/2354609/strict-standards-only-variables-should-be-passed-by-reference) –