phpDocumentor / phpDocumentor/ReflectionDocBlock
Inline tag handling with nested braces is not working as expected
Đang mở
Chưa có ai nhận issue này.
bug
help wanted
- Ngôn ngữ chính
- PHP
- Star
- 9.4k
- Fork
- 137
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Given the following test case, our Description doesn't work as expected with nested braces in inline tags.
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
* @uses \phpDocumentor\Reflection\Types\Context
*
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionCanParseStringWithInlineTagAndBraces() : void
{
$contents = 'This description has a {@link http://phpdoc.org/ This contains {braces} }';
$context = new Context('');
$tagFactory = m::mock(TagFactory::class);
$tagFactory->shouldReceive('create')
->twice()
->andReturnValues(
[
new LinkTag('http://phpdoc.org/', new Description('This contains {braces}')),
]
);
$factory = new DescriptionFactory($tagFactory);
$description = $factory->create($contents, $context);
$this->assertSame($contents, $description->render());
$this->assertSame('This description has a %1$s', $description->getBodyTemplate());
}
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tìm DescriptionFactory và phương thức kiểm thử testDescriptionCanParseStringWithInlineTagAndBraces được hiển thị trong issue. Theo dõi cách nội dung inline {@link ...} được phân tích cú pháp khi phần mô tả chứa các dấu ngoặc nhọn lồng nhau. Được xem là hoàn thành khi các assertion được cung cấp đều đạt, đồng thời giữ nguyên nội dung đã render và body template mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- php
- Lĩnh vực
- documentation
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100