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 Path to Output of ORM\MappingException #2

Closed
wants to merge 2 commits into from
Closed
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 lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getAllClassNames()
if ($this->_paths) {
foreach ((array) $this->_paths as $path) {
if ( ! is_dir($path)) {
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath();
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
}

$iterator = new \RecursiveIteratorIterator(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public function getAllClassNames()

foreach ($this->_paths as $path) {
if ( ! is_dir($path)) {
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath();
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
}

$iterator = new \RecursiveIteratorIterator(
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getAllClassNames()

foreach ($this->_paths as $path) {
if ( ! is_dir($path)) {
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath();
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
}

$iterator = new \RecursiveIteratorIterator(
Expand Down
11 changes: 9 additions & 2 deletions lib/Doctrine/ORM/Mapping/MappingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,16 @@ public static function unsupportedOptimisticLockingType($entity, $fieldName, $un
);
}

public static function fileMappingDriversRequireConfiguredDirectoryPath()
public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
{
return new self('File mapping drivers must have a valid directory path, however the given path seems to be incorrect!');
if ( ! empty($path)) {
$path = '[' . $path . ']';
}

return new self(
'File mapping drivers must have a valid directory path, ' .
'however the given path ' . $path . ' seems to be incorrect!'
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tools/sandbox/Entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class User
/** @Column(type="string", length=50) */
private $name;
/**
* @OneToOne(targetEntity="Address")
* @OneToOne(targetEntity="Address", inversedBy="user")
* @JoinColumn(name="address_id", referencedColumnName="id")
*/
private $address;
Expand Down