Skip to content
This repository

[DCOM-118] fix for issue #195 #198

Closed
wants to merge 3 commits into from

5 participants

Philipp Scheit doctrinebot Christophe Coevoet Marco Pivetta Jordi Boggiano
Philipp Scheit

I'm sorry, i have no idea why i got here now 23 commits .. i tried but no success.

doctrinebot
Collaborator

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DCOM-121

Christophe Coevoet
Collaborator

you have 23 commits becasuse you started your feature branch based on the 2.3 branch instead of master.
Here is the way to fix it:

git checkout doclexingfail

# save a reference to the current state of the feature branch
git branch tmp

# reset the feature branch to master
git fetch upstream
git reset --hard upstream/master

# cherry-pick the meaningful commit for the feature
git cherry-pick f1516fb

# IMPORTANT: at this point, check that the feature branch is working properly with your changes

# update the PR by forcing the push
git push origin doclexingfail --force
Christophe Coevoet
Collaborator

and please also add a test for this

Philipp Scheit

thx for the help, cherry pick was the command i didn't find.
The test was alreay in Seldaeks commit.

please read:
http://doctrine-project.org/jira/browse/DCOM-118
before merging

tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php
@@ -104,6 +104,16 @@ public function testAnnotationsWithVarType()
104 104
         $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', $barAnnot[0]->annotation);
105 105
     }
106 106
 
  107
+    public function testAtInDescription()
  108
+    {
  109
+        $reader = $this->getReader();
  110
+        $class  = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAtInDescriptionAndAnnotation');
  111
+
  112
+        $this->assertEquals(1,count($fooAnnot = $reader->getPropertyAnnotations($class->getProperty('foo'))));
1
Christophe Coevoet Collaborator
stof added a note October 05, 2012

could you use assertCount here ?
and a space is missing after the comma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Marco Pivetta Ocramius referenced this pull request from a commit in Ocramius/annotations December 03, 2013
Marco Pivetta Re-introducing hotfix for DCOM-118 as of @pscheit's PR 3ffadc4
Marco Pivetta Ocramius referenced this pull request in doctrine/annotations December 03, 2013
Closed

[WIP] DCOM-118 - DCOM-121 #17

Marco Pivetta
Collaborator

I ported this PR to doctrine/annotations#17

Marco Pivetta Ocramius closed this December 03, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  lib/Doctrine/Common/Annotations/DocLexer.php
@@ -78,7 +78,7 @@ protected function getCatchablePatterns()
78 78
         return array(
79 79
             '[a-z_\\\][a-z0-9_\:\\\]*[a-z]{1}',
80 80
             '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?',
81  
-            '"(?:[^"]|"")*"',
  81
+            '"(?:[^"\n]|"")*"',
82 82
         );
83 83
     }
84 84
 
10  tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php
@@ -104,6 +104,16 @@ public function testAnnotationsWithVarType()
104 104
         $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', $barAnnot[0]->annotation);
105 105
     }
106 106
 
  107
+    public function testAtInDescription()
  108
+    {
  109
+        $reader = $this->getReader();
  110
+        $class  = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAtInDescriptionAndAnnotation');
  111
+
  112
+        $this->assertCount(1, $fooAnnot = $reader->getPropertyAnnotations($class->getProperty('foo')));
  113
+
  114
+        $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetPropertyMethod', $fooAnnot[0]);
  115
+    }
  116
+
107 117
      /**
108 118
      * @expectedException Doctrine\Common\Annotations\AnnotationException
109 119
      * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetPropertyMethod is not allowed to be declared on class Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass. You may only use this annotation on these code elements: METHOD, PROPERTY
19  tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAtInDescriptionAndAnnotation.php
... ...
@@ -0,0 +1,19 @@
  1
+<?php
  2
+
  3
+namespace Doctrine\Tests\Common\Annotations\Fixtures;
  4
+
  5
+use Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetPropertyMethod;
  6
+
  7
+class ClassWithAtInDescriptionAndAnnotation
  8
+{
  9
+    /**
  10
+     * Lala
  11
+     *
  12
+     * {
  13
+     *     "email": "foo@example.com"
  14
+     * }
  15
+     *
  16
+     * @AnnotationTargetPropertyMethod("Bar")
  17
+     */
  18
+    public $foo;
  19
+}
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.