Skip to content

Commit 9cbfd65

Browse files
committed
Merge branch 'origin/QA_5_3' into main
2 parents d938279 + 0ea7e6b commit 9cbfd65

File tree

14 files changed

+220
-43
lines changed

14 files changed

+220
-43
lines changed

.gitattributes

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
.gitignore export-ignore
33
.github export-ignore
44
phpcs.xml.dist export-ignore
5+
phpunit.xml.dist export-ignore
56
phpstan.neon.dist export-ignore
67
phpstan-baseline.neon export-ignore
78
scripts export-ignore
8-
makefile export-ignore
9+
Makefile export-ignore
910
src/Resources/themes/default/data export-ignore
11+
.editorconfig export-ignore
12+
/examples export-ignore
13+
/locale/Doctum.pot export-ignore
14+
/locale/*.po export-ignore
15+
/tests export-ignore
16+
CHANGELOG.md export-ignore

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@
6161
},
6262
"autoload": {
6363
"psr-4": {
64-
"Doctum\\": "src/",
64+
"Doctum\\": "src/"
65+
}
66+
},
67+
"autoload-dev": {
68+
"psr-4": {
6569
"Doctum\\Tests\\": "tests/"
6670
}
6771
},

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,11 +1900,6 @@ parameters:
19001900
count: 1
19011901
path: src/Renderer/TwigExtension.php
19021902

1903-
-
1904-
message: "#^Method Doctum\\\\Renderer\\\\TwigExtension\\:\\:parseDesc\\(\\) has parameter \\$desc with no typehint specified\\.$#"
1905-
count: 1
1906-
path: src/Renderer/TwigExtension.php
1907-
19081903
-
19091904
message: "#^Method Doctum\\\\Renderer\\\\TwigExtension\\:\\:pathForClass\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
19101905
count: 1

src/Renderer/TwigExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,18 @@ public static function abbrClass($class, bool $absolute = false): string
140140
return sprintf('<abbr title="%s">%s</abbr>', htmlentities($class, ENT_QUOTES), htmlspecialchars($short));
141141
}
142142

143-
public function parseDesc(array $context, $desc, Reflection $classOrFunctionRefl)
143+
public function parseDesc(array $context, ?string $desc, Reflection $classOrFunctionRefl)
144144
{
145-
if (!$desc) {
145+
if ($desc === null || $desc === '') {
146146
return $desc;
147147
}
148148

149149
if (null === $this->markdown) {
150150
$this->markdown = new Parsedown();
151151
}
152152

153+
$desc = str_replace(['<code>', '</code>'], ['```', '```'], $desc);
154+
153155
// FIXME: the @see argument is more complex than just a class (Class::Method, local method directly, ...)
154156
$desc = preg_replace_callback(
155157
'/@see ([^ ]+)/',

src/Resources/themes/default/class.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
<div class="col-md-2 type">
247247
{% if method.static %}static&nbsp;{% endif %}{{ hint_link(method.hint) }}
248248
</div>
249-
<div class="col-md-8 type">
249+
<div class="col-md-8">
250250
<a href="#method_{{ method.name|raw }}">{{ method.name|raw }}</a>{{ block('method_parameters_signature') }}
251251
{% if not method.shortdesc %}
252252
<p class="no-description">{% trans 'No description' %}</p>

src/Resources/themes/default/css/doctum.css

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ a abbr {
336336
font-size: 90%;
337337
}
338338

339+
.type {
340+
overflow-wrap: break-word;
341+
}
342+
339343
/* Namespaces page */
340344

341345
.namespaces {
@@ -352,6 +356,13 @@ a abbr {
352356
margin: 0 0 20px 0;
353357
}
354358

359+
.namespace-container > h2 {
360+
background-color: #edf3fe;
361+
padding: 4px 4px 4px 8px;
362+
font-size: 25px;
363+
margin: 20px 0;
364+
}
365+
355366
@media (max-width: 991px) {
356367
.namespaces .namespace-container {
357368
margin-right: 0;
@@ -390,13 +401,15 @@ pre {
390401
pre.examples {
391402
padding: 1rem;
392403
}
393-
h2 {
404+
405+
#page-content > h2 {
394406
background-color: #edf3fe;
395407
padding: 4px 4px 4px 8px;
396408
font-size: 25px;
397409
margin: 20px 0;
398410
}
399411

412+
400413
/** Doc index **/
401414

402415
dt {
@@ -432,14 +445,14 @@ dd {
432445
border-bottom: 1px solid #ccc;
433446
}
434447

435-
.search-results h2 {
448+
.search-results > li > h2 {
436449
background: none;
437450
margin: 0;
438451
padding: 0;
439452
font-size: 18px;
440453
}
441454

442-
.search-results h2 a {
455+
.search-results > li > h2 > a {
443456
float: left;
444457
display: block;
445458
margin: 0 0 4px 0;

src/Resources/themes/default/namespace.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
{% if function.isPrivate() %}private{% endif %}
4949
{{ hint_link(function.hint) }}
5050
</div>
51-
<div class="col-md-8 type">
51+
<div class="col-md-8">
5252
{{ function.name|raw }}
5353
{{- function_parameters_signature(function) -}}
5454
<br>

tests/Console/CommandHelpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types = 1);
44

5-
namespace Doctum\Tests\Command;
5+
namespace Doctum\Tests\Console;
66

77
use Doctum\Console\Command\ParseCommand;
88
use Doctum\Console\Command\RenderCommand;

tests/Console/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types = 1);
44

5-
namespace Doctum\Tests\Command;
5+
namespace Doctum\Tests\Console;
66

77
use Doctum\Console\Command\ParseCommand;
88
use Doctum\Console\Command\RenderCommand;

tests/Renderer/DiffTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Doctum\Renderer\Diff;
88
use Doctum\Tests\AbstractTestCase;
99

10-
class RendererTest extends AbstractTestCase
10+
class DiffTest extends AbstractTestCase
1111
{
1212

1313
public function testIsPhpClass(): void

0 commit comments

Comments
 (0)