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

Add doctrine/persistence v4 support #1022

Merged
merged 1 commit into from
Jan 1, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.1 || ^8.0",
"doctrine/persistence": "^2.0 || ^3.0"
"doctrine/persistence": "^2.0 || ^3.0 || ^4.0"
},
"require-dev": {
"doctrine/collections": "^1",
Expand Down
32 changes: 16 additions & 16 deletions tests/Common/Proxy/LazyLoadableObjectClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ class LazyLoadableObjectClassMetadata implements ClassMetadata
/**
* {@inheritDoc}
*/
public function getName()
public function getName(): string
{
return $this->getReflectionClass()->getName();
}

/**
* {@inheritDoc}
*/
public function getIdentifier()
public function getIdentifier(): array
{
return array_keys($this->identifier);
}

/**
* {@inheritDoc}
*/
public function getReflectionClass()
public function getReflectionClass(): ReflectionClass
{
if ($this->reflectionClass === null) {
$this->reflectionClass = new ReflectionClass(__NAMESPACE__ . '\LazyLoadableObject');
Expand All @@ -66,103 +66,103 @@ public function getReflectionClass()
/**
* {@inheritDoc}
*/
public function isIdentifier($fieldName)
public function isIdentifier($fieldName): bool
{
return isset($this->identifier[$fieldName]);
}

/**
* {@inheritDoc}
*/
public function hasField($fieldName)
public function hasField($fieldName): bool
{
return isset($this->fields[$fieldName]);
}

/**
* {@inheritDoc}
*/
public function hasAssociation($fieldName)
public function hasAssociation($fieldName): bool
{
return isset($this->associations[$fieldName]);
}

/**
* {@inheritDoc}
*/
public function isSingleValuedAssociation($fieldName)
public function isSingleValuedAssociation($fieldName): bool
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function isCollectionValuedAssociation($fieldName)
public function isCollectionValuedAssociation($fieldName): bool
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function getFieldNames()
public function getFieldNames(): array
{
return array_keys($this->fields);
}

/**
* {@inheritDoc}
*/
public function getIdentifierFieldNames()
public function getIdentifierFieldNames(): array
{
return $this->getIdentifier();
}

/**
* {@inheritDoc}
*/
public function getAssociationNames()
public function getAssociationNames(): array
{
return array_keys($this->associations);
}

/**
* {@inheritDoc}
*/
public function getTypeOfField($fieldName)
public function getTypeOfField($fieldName): ?string
{
return 'string';
}

/**
* {@inheritDoc}
*/
public function getAssociationTargetClass($assocName)
public function getAssociationTargetClass($assocName): ?string
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function isAssociationInverseSide($assocName)
public function isAssociationInverseSide($assocName): bool
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function getAssociationMappedByTargetField($assocName)
public function getAssociationMappedByTargetField($assocName): string
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function getIdentifierValues($object)
public function getIdentifierValues($object): array
{
throw new BadMethodCallException('not implemented');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ class LazyLoadableObjectWithNullableTypehintsClassMetadata implements ClassMetad
/**
* {@inheritDoc}
*/
public function getName()
public function getName(): string
{
return $this->getReflectionClass()->getName();
}

/**
* {@inheritDoc}
*/
public function getIdentifier()
public function getIdentifier(): array
{
return array_keys($this->identifier);
}

/**
* {@inheritDoc}
*/
public function getReflectionClass()
public function getReflectionClass(): ReflectionClass
{
if ($this->reflectionClass === null) {
$this->reflectionClass = new ReflectionClass(__NAMESPACE__ . '\LazyLoadableObjectWithNullableTypehints');
Expand All @@ -58,103 +58,103 @@ public function getReflectionClass()
/**
* {@inheritDoc}
*/
public function isIdentifier($fieldName)
public function isIdentifier($fieldName): bool
{
return isset($this->identifier[$fieldName]);
}

/**
* {@inheritDoc}
*/
public function hasField($fieldName)
public function hasField($fieldName): bool
{
return isset($this->fields[$fieldName]);
}

/**
* {@inheritDoc}
*/
public function hasAssociation($fieldName)
public function hasAssociation($fieldName): bool
{
return false;
}

/**
* {@inheritDoc}
*/
public function isSingleValuedAssociation($fieldName)
public function isSingleValuedAssociation($fieldName): bool
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function isCollectionValuedAssociation($fieldName)
public function isCollectionValuedAssociation($fieldName): bool
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function getFieldNames()
public function getFieldNames(): array
{
return array_keys($this->fields);
}

/**
* {@inheritDoc}
*/
public function getIdentifierFieldNames()
public function getIdentifierFieldNames(): array
{
return $this->getIdentifier();
}

/**
* {@inheritDoc}
*/
public function getAssociationNames()
public function getAssociationNames(): array
{
return [];
}

/**
* {@inheritDoc}
*/
public function getTypeOfField($fieldName)
public function getTypeOfField($fieldName): ?string
{
return 'string';
}

/**
* {@inheritDoc}
*/
public function getAssociationTargetClass($assocName)
public function getAssociationTargetClass($assocName): ?string
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function isAssociationInverseSide($assocName)
public function isAssociationInverseSide($assocName): bool
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function getAssociationMappedByTargetField($assocName)
public function getAssociationMappedByTargetField($assocName): string
{
throw new BadMethodCallException('not implemented');
}

/**
* {@inheritDoc}
*/
public function getIdentifierValues($object)
public function getIdentifierValues($object): array
{
throw new BadMethodCallException('not implemented');
}
Expand Down
Loading