Skip to content

Commit

Permalink
Fix parsing JoinTable without table name explicitly set (#5236)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarJak authored Jan 19, 2021
1 parent 6b196a9 commit 477ccbb
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class JoinTableTagValueNode extends AbstractDoctrineTagValueNode implement
private const INVERSE_JOIN_COLUMNS = 'inverseJoinColumns';

/**
* @var string
* @var string|null
*/
private $name;

Expand Down Expand Up @@ -57,7 +57,7 @@ final class JoinTableTagValueNode extends AbstractDoctrineTagValueNode implement
* @param JoinColumnTagValueNode[] $inverseJoinColumns
*/
public function __construct(
string $name,
?string $name,
?string $schema = null,
array $joinColumns = [],
array $inverseJoinColumns = [],
Expand Down Expand Up @@ -93,8 +93,10 @@ public function getShortName(): string
public function getAttributableItems(): array
{
$items = [];

$items['name'] = $this->name;

if ($this->name !== null) {
$items['name'] = $this->name;
}

if ($this->schema !== null) {
$items['schema'] = $this->schema;
Expand Down Expand Up @@ -133,7 +135,9 @@ private function createItems(): array
{
$items = [];

$items['name'] = sprintf('"%s"', $this->name);
if ($this->name !== null) {
$items['name'] = sprintf('"%s"', $this->name);
}

if ($this->schema !== null) {
$items['schema'] = sprintf('"%s"', $this->schema);
Expand Down

0 comments on commit 477ccbb

Please sign in to comment.