Skip to content

Commit cd0f49c

Browse files
committed
Downgrade Markdown deps
1 parent ebafb53 commit cd0f49c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1894
-1432
lines changed

components/DataLiberation/BlockMarkup/BlockMarkupProcessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ private function block_attribute_updates_to_modifiable_text_updates() {
476476
JSON_HEX_TAG | // Convert < and > to \u003C and \u003E
477477
JSON_HEX_AMP // Convert & to \u0026
478478
);
479+
var_dump($encoded_attributes);
479480
if ( $encoded_attributes === '[]' ) {
480481
$encoded_attributes = '';
481482
} else {

components/DataLiberation/Tests/MySQLExportTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testExportFromDatabaseToSQL(): void {
4949
*
5050
* @see https://github.com/laravel/framework/issues/3548
5151
*/
52-
if ( version_compare( PHP_VERSION, '8.0', '<=' ) ) {
52+
if ( version_compare( PHP_VERSION, '8.1', '<' ) ) {
5353
$expected = "INSERT INTO posts (ID, post_title) VALUES ('1', 'First Post');\n" .
5454
"INSERT INTO posts (ID, post_title) VALUES ('2', 'Second Post');\n";
5555
} else {
@@ -116,7 +116,7 @@ public function testExportWithCreateTableStatement(): void {
116116
*
117117
* @see https://github.com/laravel/framework/issues/3548
118118
*/
119-
if ( version_compare( PHP_VERSION, '8.0', '<=' ) ) {
119+
if ( version_compare( PHP_VERSION, '8.1', '<' ) ) {
120120
$expected = <<<SQL
121121
CREATE TABLE posts (ID INTEGER PRIMARY KEY, post_title TEXT);
122122
INSERT INTO posts (ID, post_title) VALUES ('1', 'First Post');
@@ -168,7 +168,7 @@ public function testExportWithCursor(): void {
168168
*
169169
* @see https://github.com/laravel/framework/issues/3548
170170
*/
171-
if ( version_compare( PHP_VERSION, '8.0', '<=' ) ) {
171+
if ( version_compare( PHP_VERSION, '8.1', '<' ) ) {
172172
$expected = "INSERT INTO posts (ID, post_title) VALUES ('1', 'First Post');\n" .
173173
"INSERT INTO posts (ID, post_title) VALUES ('2', 'Second Post');\n";
174174
} else {

components/Markdown/vendor-patched/nette/schema/src/Schema/Context.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@
1212

1313
final class Context
1414
{
15-
public bool $skipDefaults = false;
15+
/**
16+
* @var bool
17+
*/
18+
public $skipDefaults = false;
1619

1720
/** @var string[] */
18-
public array $path = [];
21+
public $path = [];
1922

20-
public bool $isKey = false;
23+
/**
24+
* @var bool
25+
*/
26+
public $isKey = false;
2127

2228
/** @var Message[] */
23-
public array $errors = [];
29+
public $errors = [];
2430

2531
/** @var Message[] */
26-
public array $warnings = [];
32+
public $warnings = [];
2733

2834
/** @var array[] */
29-
public array $dynamics = [];
35+
public $dynamics = [];
3036

3137

3238
public function addError(string $message, string $code, array $variables = []): Message
@@ -46,6 +52,8 @@ public function addWarning(string $message, string $code, array $variables = [])
4652
public function createChecker(): \Closure
4753
{
4854
$count = count($this->errors);
49-
return fn(): bool => $count === count($this->errors);
55+
return function () use ($count) : bool {
56+
return $count === count($this->errors);
57+
};
5058
}
5159
}

components/Markdown/vendor-patched/nette/schema/src/Schema/Elements/AnyOf.php

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ final class AnyOf implements Schema
1919
{
2020
use Base;
2121

22-
private array $set;
22+
/**
23+
* @var mixed[]
24+
*/
25+
private $set;
2326

2427

25-
public function __construct(mixed ...$set)
28+
/**
29+
* @param mixed ...$set
30+
*/
31+
public function __construct(...$set)
2632
{
2733
if (!$set) {
2834
throw new Nette\InvalidStateException('The enumeration must not be empty.');
@@ -54,15 +60,22 @@ public function dynamic(): self
5460

5561

5662
/********************* processing ****************d*g**/
57-
58-
59-
public function normalize(mixed $value, Context $context): mixed
63+
/**
64+
* @param mixed $value
65+
* @return mixed
66+
*/
67+
public function normalize($value, Context $context)
6068
{
6169
return $this->doNormalize($value, $context);
6270
}
6371

6472

65-
public function merge(mixed $value, mixed $base): mixed
73+
/**
74+
* @param mixed $value
75+
* @param mixed $base
76+
* @return mixed
77+
*/
78+
public function merge($value, $base)
6679
{
6780
if (is_array($value) && isset($value[Helpers::PreventMerging])) {
6881
unset($value[Helpers::PreventMerging]);
@@ -73,7 +86,11 @@ public function merge(mixed $value, mixed $base): mixed
7386
}
7487

7588

76-
public function complete(mixed $value, Context $context): mixed
89+
/**
90+
* @param mixed $value
91+
* @return mixed
92+
*/
93+
public function complete($value, Context $context)
7794
{
7895
$isOk = $context->createChecker();
7996
$value = $this->findAlternative($value, $context);
@@ -82,7 +99,11 @@ public function complete(mixed $value, Context $context): mixed
8299
}
83100

84101

85-
private function findAlternative(mixed $value, Context $context): mixed
102+
/**
103+
* @param mixed $value
104+
* @return mixed
105+
*/
106+
private function findAlternative($value, Context $context)
86107
{
87108
$expecteds = $innerErrors = [];
88109
foreach ($this->set as $item) {
@@ -114,27 +135,23 @@ private function findAlternative(mixed $value, Context $context): mixed
114135
if ($innerErrors) {
115136
$context->errors = array_merge($context->errors, $innerErrors);
116137
} else {
117-
$context->addError(
118-
'The %label% %path% expects to be %expected%, %value% given.',
119-
Nette\Schema\Message::TypeMismatch,
120-
[
138+
$context->addError('The %label% %path% expects to be %expected%, %value% given.', Nette\Schema\Message::TypeMismatch, [
121139
'value' => $value,
122140
'expected' => implode('|', array_unique($expecteds)),
123-
],
124-
);
141+
]);
125142
}
126143

127144
return null;
128145
}
129146

130147

131-
public function completeDefault(Context $context): mixed
148+
/**
149+
* @return mixed
150+
*/
151+
public function completeDefault(Context $context)
132152
{
133153
if ($this->required) {
134-
$context->addError(
135-
'The mandatory item %path% is missing.',
136-
Nette\Schema\Message::MissingItem,
137-
);
154+
$context->addError('The mandatory item %path% is missing.', Nette\Schema\Message::MissingItem);
138155
return null;
139156
}
140157

components/Markdown/vendor-patched/nette/schema/src/Schema/Elements/Base.php

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,30 @@
1919
*/
2020
trait Base
2121
{
22-
private bool $required = false;
23-
private mixed $default = null;
22+
/**
23+
* @var bool
24+
*/
25+
private $required = false;
26+
/**
27+
* @var mixed
28+
*/
29+
private $default = null;
2430

2531
/** @var ?callable */
2632
private $before;
2733

2834
/** @var callable[] */
29-
private array $transforms = [];
30-
private ?string $deprecated = null;
35+
private $transforms = [];
36+
/**
37+
* @var string|null
38+
*/
39+
private $deprecated;
3140

3241

33-
public function default(mixed $value): self
42+
/**
43+
* @param mixed $value
44+
*/
45+
public function default($value): self
3446
{
3547
$this->default = $value;
3648
return $this;
@@ -71,11 +83,7 @@ public function assert(callable $handler, ?string $description = null): self
7183
if ($handler($value)) {
7284
return $value;
7385
}
74-
$context->addError(
75-
'Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.',
76-
Nette\Schema\Message::FailedAssertion,
77-
['value' => $value, 'assertion' => $expected],
78-
);
86+
$context->addError('Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.', Nette\Schema\Message::FailedAssertion, ['value' => $value, 'assertion' => $expected]);
7987
});
8088
}
8189

@@ -88,21 +96,25 @@ public function deprecated(string $message = 'The item %path% is deprecated.'):
8896
}
8997

9098

91-
public function completeDefault(Context $context): mixed
99+
/**
100+
* @return mixed
101+
*/
102+
public function completeDefault(Context $context)
92103
{
93104
if ($this->required) {
94-
$context->addError(
95-
'The mandatory item %path% is missing.',
96-
Nette\Schema\Message::MissingItem,
97-
);
105+
$context->addError('The mandatory item %path% is missing.', Nette\Schema\Message::MissingItem);
98106
return null;
99107
}
100108

101109
return $this->default;
102110
}
103111

104112

105-
public function doNormalize(mixed $value, Context $context): mixed
113+
/**
114+
* @param mixed $value
115+
* @return mixed
116+
*/
117+
public function doNormalize($value, Context $context)
106118
{
107119
if ($this->before) {
108120
$value = ($this->before)($value);
@@ -115,15 +127,16 @@ public function doNormalize(mixed $value, Context $context): mixed
115127
private function doDeprecation(Context $context): void
116128
{
117129
if ($this->deprecated !== null) {
118-
$context->addWarning(
119-
$this->deprecated,
120-
Nette\Schema\Message::Deprecated,
121-
);
130+
$context->addWarning($this->deprecated, Nette\Schema\Message::Deprecated);
122131
}
123132
}
124133

125134

126-
private function doTransform(mixed $value, Context $context): mixed
135+
/**
136+
* @param mixed $value
137+
* @return mixed
138+
*/
139+
private function doTransform($value, Context $context)
127140
{
128141
$isOk = $context->createChecker();
129142
foreach ($this->transforms as $handler) {
@@ -136,26 +149,30 @@ private function doTransform(mixed $value, Context $context): mixed
136149
}
137150

138151

139-
/** @deprecated use Nette\Schema\Validators::validateType() */
140-
private function doValidate(mixed $value, string $expected, Context $context): bool
152+
/** @deprecated use Nette\Schema\Validators::validateType()
153+
* @param mixed $value */
154+
private function doValidate($value, string $expected, Context $context): bool
141155
{
142156
$isOk = $context->createChecker();
143157
Helpers::validateType($value, $expected, $context);
144158
return $isOk();
145159
}
146160

147161

148-
/** @deprecated use Nette\Schema\Validators::validateRange() */
149-
private static function doValidateRange(mixed $value, array $range, Context $context, string $types = ''): bool
162+
/** @deprecated use Nette\Schema\Validators::validateRange()
163+
* @param mixed $value */
164+
private static function doValidateRange($value, array $range, Context $context, string $types = ''): bool
150165
{
151166
$isOk = $context->createChecker();
152167
Helpers::validateRange($value, $range, $context, $types);
153168
return $isOk();
154169
}
155170

156171

157-
/** @deprecated use doTransform() */
158-
private function doFinalize(mixed $value, Context $context): mixed
172+
/** @deprecated use doTransform()
173+
* @param mixed $value
174+
* @return mixed */
175+
private function doFinalize($value, Context $context)
159176
{
160177
return $this->doTransform($value, $context);
161178
}

0 commit comments

Comments
 (0)