Skip to content

Commit

Permalink
Deprecate not-enabling lazy-ghosts and decouple from doctrine/common'…
Browse files Browse the repository at this point in the history
…s proxies
  • Loading branch information
nicolas-grekas committed Jul 31, 2023
1 parent 89250b8 commit a195469
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 73 deletions.
27 changes: 27 additions & 0 deletions lib/Doctrine/ORM/ORMInvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use function get_debug_type;
use function gettype;
use function implode;
use function is_scalar;
use function method_exists;
use function reset;
use function spl_object_id;
Expand Down Expand Up @@ -261,6 +262,32 @@ public static function invalidEntityName($entityName)
return new self(sprintf('Entity name must be a string, %s given', get_debug_type($entityName)));
}

/** @param mixed $value */
public static function invalidAutoGenerateMode($value): self
{
return new self(sprintf('Invalid auto generate mode "%s" given.', is_scalar($value) ? (string) $value : get_debug_type($value)));
}

public static function missingPrimaryKeyValue(string $className, string $idField): self
{
return new self(sprintf('Missing value for primary key %s on %s', $idField, $className));
}

public static function proxyDirectoryRequired(): self
{
return new self('You must configure a proxy directory. See docs for details');
}

public static function proxyNamespaceRequired(): self
{
return new self('You must configure a proxy namespace');
}

public static function proxyDirectoryNotWritable(string $proxyDirectory): self
{
return new self(sprintf('Your proxy directory "%s" must be writable', $proxyDirectory));
}

/**
* Helper method to show an object as string.
*
Expand Down
Loading

0 comments on commit a195469

Please sign in to comment.