Skip to content

Commit

Permalink
Fix: Methods can be static
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Mar 28, 2020
1 parent 0d02aa9 commit e25bdac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/EntityDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(ORM\Mapping\ClassMetadata $classMetadata, array $fie
}

foreach ($fieldDefinitions as $fieldName => $fieldDefinition) {
$this->fieldDefinitions[$fieldName] = $this->normalizeFieldDefinition($fieldDefinition);
$this->fieldDefinitions[$fieldName] = self::normalizeFieldDefinition($fieldDefinition);
}

$defaultEntity = $this->classMetadata->newInstance();
Expand Down Expand Up @@ -131,7 +131,7 @@ public function configuration()
return $this->configuration;
}

private function normalizeFieldDefinition($fieldDefinition)
private static function normalizeFieldDefinition($fieldDefinition)
{
if (\is_callable($fieldDefinition)) {
if (\method_exists($fieldDefinition, '__invoke')) {
Expand Down
4 changes: 2 additions & 2 deletions src/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private function setField($entity, EntityDefinition $entityDefinition, $fieldNam
$classMetadata = $entityDefinition->classMetadata();

if ($classMetadata->isCollectionValuedAssociation($fieldName)) {
$classMetadata->setFieldValue($entity, $fieldName, $this->createCollectionFrom($fieldValue));
$classMetadata->setFieldValue($entity, $fieldName, self::createCollectionFrom($fieldValue));
} else {
$classMetadata->setFieldValue($entity, $fieldName, $fieldValue);

Expand All @@ -275,7 +275,7 @@ private function setField($entity, EntityDefinition $entityDefinition, $fieldNam
}
}

private function createCollectionFrom($array = [])
private static function createCollectionFrom($array = [])
{
if (\is_array($array)) {
return new Common\Collections\ArrayCollection($array);
Expand Down

0 comments on commit e25bdac

Please sign in to comment.