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 16, 2023
1 parent dca7ddf commit 21dd52a
Show file tree
Hide file tree
Showing 4 changed files with 364 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

Check warning on line 266 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L266

Added line #L266 was not covered by tests
{
return new self(sprintf('Invalid auto generate mode "%s" given.', is_scalar($value) ? (string) $value : get_debug_type($value)));

Check warning on line 268 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L268

Added line #L268 was not covered by tests
}

public static function missingPrimaryKeyValue(string $className, string $idField): self

Check warning on line 271 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L271

Added line #L271 was not covered by tests
{
return new self(sprintf('Missing value for primary key %s on %s', $idField, $className));

Check warning on line 273 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L273

Added line #L273 was not covered by tests
}

public static function proxyDirectoryRequired(): self

Check warning on line 276 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L276

Added line #L276 was not covered by tests
{
return new self('You must configure a proxy directory. See docs for details');

Check warning on line 278 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L278

Added line #L278 was not covered by tests
}

public static function proxyNamespaceRequired(): self

Check warning on line 281 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L281

Added line #L281 was not covered by tests
{
return new self('You must configure a proxy namespace');

Check warning on line 283 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L283

Added line #L283 was not covered by tests
}

public static function proxyDirectoryNotWritable(string $proxyDirectory): self

Check warning on line 286 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L286

Added line #L286 was not covered by tests
{
return new self(sprintf('Your proxy directory "%s" must be writable', $proxyDirectory));

Check warning on line 288 in lib/Doctrine/ORM/ORMInvalidArgumentException.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/ORMInvalidArgumentException.php#L288

Added line #L288 was not covered by tests
}

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

0 comments on commit 21dd52a

Please sign in to comment.