Skip to content

Break compatibility with doctrine/orm 3.5.8 #713

@janatjak

Description

@janatjak

after last release doctrine/orm 3.5.8

phpstan-doctrine returns error:

Uncaught Doctrine\ORM\ORMInvalidArgumentException: Symfony LazyGhost is not available. Please install the "symfony/var-exporter" package version 6.4 or 7 to use this feature or enable PHP 8.4 native lazy objects. in vendor/doctrine/orm/src/ORMInvalidArgumentException.php:165

possible way how to fix this issue:

// class PHPStan\Doctrine\Mapping\ClassMetadataFactory


		if (PHP_VERSION_ID >= 80400) {
			$config->enableNativeLazyObjects(true);
		} else {
			$config->setAutoGenerateProxyClasses(true);
			$config->setProxyDir($this->tmpDir);
			$config->setProxyNamespace('__PHPStanDoctrine__\\Proxy');
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions