Skip to content

Commit 837760a

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 9f5823e + 83bf24f commit 837760a

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 1.1.0
4+
- issue #5 - No autocomplete because of return type on a new line after @return in annotation
5+
36
## 1.0.1
47
- issue #4 - Cyrillic alphabet is not handled well
58

src/Element/PhpAnnotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function getPhpContent()
6464
$content = array(
6565
$fullContent,
6666
);
67-
if (strlen($fullContent) > $this->getMaxLength()) {
67+
if ($this->getPhpName() === '' && strlen($fullContent) > $this->getMaxLength()) {
6868
$content = explode(self::BREAK_LINE_CHAR, wordwrap($fullContent, $this->getMaxLength(), self::BREAK_LINE_CHAR, true));
6969
}
7070
return array_map(function ($element) {

tests/Element/PhpAnnotationBlockTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ public function testGetSeveralLinesWithNameToString()
4848
));
4949

5050
$this->assertSame("/**\n" .
51-
" * @description This sample annotation is on one line This sample annotation is on\n" .
52-
" * one line This sample annotation is on one line This sample annotation is on one\n" .
53-
" * line This sample annotation is on one line This sample annotation is on one line\n" .
54-
" * This sample annotation is on one line\n" .
51+
" * @description This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line\n" .
5552
" */", $annotationBlock->toString());
5653
}
5754

@@ -96,10 +93,7 @@ public function testToStringSeveralLinesWithNameToString()
9693
));
9794

9895
$this->assertSame("/**\n" .
99-
" * @description This sample annotation is on one line This sample annotation is on\n" .
100-
" * one line This sample annotation is on one line This sample annotation is on one\n" .
101-
" * line This sample annotation is on one line This sample annotation is on one line\n" .
102-
" * This sample annotation is on one line\n" .
96+
" * @description This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line\n" .
10397
" */", $annotationBlock->toString());
10498
}
10599

tests/Element/PhpAnnotationTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@ public function testGetSeveralLinesWithNamePhpDeclaration()
3535
{
3636
$annotation = new PhpAnnotation('description', str_repeat('This sample annotation is on one line ', 7));
3737

38-
$this->assertSame(" * @description This sample annotation is on one line This sample annotation is on\n" .
39-
" * one line This sample annotation is on one line This sample annotation is on one\n" .
40-
" * line This sample annotation is on one line This sample annotation is on one line\n" .
41-
" * This sample annotation is on one line", $annotation->getPhpDeclaration());
38+
$this->assertSame(" * @description This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line", $annotation->getPhpDeclaration());
4239
}
4340

4441
public function testGetSeveralLinesLargerWithNamePhpDeclaration()
4542
{
46-
$annotation = new PhpAnnotation('description', str_repeat('This sample annotation is on one line ', 7), 300);
43+
$annotation = new PhpAnnotation('description', str_repeat('This sample annotation is on one line ', 7));
4744

4845
$this->assertSame(" * @description This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line This sample annotation is on one line", $annotation->getPhpDeclaration());
4946
}

0 commit comments

Comments
 (0)