Skip to content
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
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"doctrine/cache": "^1.11 || ^2.0",
"doctrine/collections": "^1.0",
"doctrine/event-manager": "^1.0",
"psr/cache": "^1.0|^2.0|^3.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"doctrine/deprecations": "^0.5.3"
},
"require-dev": {
"composer/package-versions-deprecated": "^1.11",
"phpstan/phpstan": "1.0.1",
"phpstan/phpstan": "1.2.0",
"doctrine/coding-standard": "^6.0 || ^9.0",
"doctrine/common": "^3.0",
"phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0",
"symfony/cache": "^4.4|^5.0",
"vimeo/psalm": "4.7.0"
"symfony/cache": "^4.4 || ^5.0",
"vimeo/psalm": "4.13.1"
},
"conflict": {
"doctrine/common": "<2.10@dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,22 +444,22 @@ abstract protected function newClassMetadataInstance($className);
/**
* {@inheritDoc}
*
* @psalm-param class-string|string $class
* @psalm-param class-string|string $className
*/
public function isTransient($class)
public function isTransient($className)
{
if (! $this->initialized) {
$this->initialize();
}

// Check for namespace alias
if (strpos($class, ':') !== false) {
[$namespaceAlias, $simpleClassName] = explode(':', $class, 2);
$class = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
if (strpos($className, ':') !== false) {
[$namespaceAlias, $simpleClassName] = explode(':', $className, 2);
$className = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
}

/** @psalm-var class-string $class */
return $this->getDriver()->isTransient($class);
/** @psalm-var class-string $className */
return $this->getDriver()->isTransient($className);
}

/**
Expand Down
15 changes: 8 additions & 7 deletions lib/Doctrine/Persistence/Mapping/StaticReflectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,26 @@ public function getParentClasses($class)
/**
* {@inheritDoc}
*/
public function getClassShortName($className)
public function getClassShortName($class)
{
$nsSeparatorLastPosition = strrpos($className, '\\');
$nsSeparatorLastPosition = strrpos($class, '\\');

if ($nsSeparatorLastPosition !== false) {
$className = substr($className, $nsSeparatorLastPosition + 1);
$class = substr($class, $nsSeparatorLastPosition + 1);
}

return $className;
return $class;
}

/**
* {@inheritDoc}
*/
public function getClassNamespace($className)
public function getClassNamespace($class)
{
$namespace = '';
if (strpos($className, '\\') !== false) {
$namespace = strrev(substr(strrev($className), (int) strpos(strrev($className), '\\') + 1));

if (strpos($class, '\\') !== false) {
$namespace = strrev(substr(strrev($class), (int) strpos(strrev($class), '\\') + 1));
}

return $namespace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ protected function onNotFoundMetadata($className)
/**
* {@inheritDoc}
*/
public function isTransient($class): bool
public function isTransient($className): bool
{
$name = $this->metadata->getName();

return $class !== $name;
return $className !== $this->metadata->getName();
}

public function getCacheKey(string $realClassName): string
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/Persistence/PersistentObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function isSingleValuedAssociation($fieldName): bool
/**
* {@inheritDoc}
*/
public function getIdentifierValues($entity): array
public function getIdentifierValues($object): array
{
throw new LogicException('Not implemented');
}
Expand Down