8000 "doctrine:mapping:import" does not escape quotes in field comments · Issue #7763 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
"doctrine:mapping:import" does not escape quotes in field comments #7763
Closed
@guillaume-a

Description

@guillaume-a

Bug Report

Hi, I made this repo to reproduce easily this bug : https://github.com/guillaume-a/doctrine-orm-7763

I don't really know how to create a PR, and I don't event know if my solution is the best way.

Q A
BC Break no
Version 2.6.3

Summary

After creating the following table in my DB

CREATE TABLE `unicorn` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(40) NOT NULL COMMENT 'enter a "comment" here'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

I try to import the mapping and generate getters/setters.
The following exception appears

In AnnotationException.php line 42:
                                                                                 
  [Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_CURLY_B  
  RACES, got 'comment' at position 122 in property App\Entity\Unicorn::$name

Because the annotation generated for the 'name' field is as :

// src/Entity/Unicorn.php
/**
 * @var string
 *
 * @ORM\Column(name="name", type="string", length=40, nullable=false, options={"comment"="enter a "comment" here"})
 */
private $name;

How to reproduce

Follow README.md from https://github.com/guillaume-a/doctrine-orm-7763

Expected behavior

We expected quotes to be escaped or doubled like so :

// src/Entity/Unicorn.php
/**
 * @var string
 *
 * @ORM\Column(name="name", type="string", length=40, nullable=false, options={"comment"="enter a ""comment"" here"})
 */
private $name;

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0