This commit is contained in:
Dennis Eichhorn 2023-09-21 23:25:45 +00:00
commit c87d1df047
4 changed files with 16 additions and 12 deletions

View File

@ -104,7 +104,7 @@ class SpreadsheetDatabaseMapper implements IODatabaseMapper
$cells[] = $workSheet->getCell(StringUtils::intToAlphabet($j) . $line)->getCalculatedValue(); $cells[] = $workSheet->getCell(StringUtils::intToAlphabet($j) . $line)->getCalculatedValue();
} }
var_dump($cells); \var_dump($cells);
++$line; ++$line;

View File

@ -1501,7 +1501,7 @@ class Markdown
return $block; return $block;
} }
protected function checkboxUnchecked($text): string protected function checkboxUnchecked($text) : string
{ {
if ($this->markupEscaped || $this->safeMode) { if ($this->markupEscaped || $this->safeMode) {
$text = self::escape($text); $text = self::escape($text);
@ -1510,7 +1510,7 @@ class Markdown
return '<input type="checkbox" disabled /> '.$this->format($text); return '<input type="checkbox" disabled /> '.$this->format($text);
} }
protected function checkboxChecked($text): string protected function checkboxChecked($text) : string
{ {
if ($this->markupEscaped || $this->safeMode) { if ($this->markupEscaped || $this->safeMode) {
$text = self::escape($text); $text = self::escape($text);
@ -1743,7 +1743,7 @@ class Markdown
* Get only the text from a markdown string. * Get only the text from a markdown string.
* It parses to HTML once then trims the tags to get the text. * It parses to HTML once then trims the tags to get the text.
*/ */
protected function fetchText($text): string protected function fetchText($text) : string
{ {
return \trim(\strip_tags($this->line($text))); return \trim(\strip_tags($this->line($text)));
} }
@ -1781,7 +1781,7 @@ class Markdown
$this->firstHeadLevel = $level; $this->firstHeadLevel = $level;
} }
$cutIndent = $this->firstHeadLevel - 1; $cutIndent = $this->firstHeadLevel - 1;
$level = $cutIndent > $level ? 1 : $level - $cutIndent; $level = $cutIndent > $level ? 1 : $level - $cutIndent;
$indent = \str_repeat(' ', $level); $indent = \str_repeat(' ', $level);
@ -1862,7 +1862,7 @@ class Markdown
// Get the first char before the marker // Get the first char before the marker
$beforeMarkerPosition = $markerPosition - 1; $beforeMarkerPosition = $markerPosition - 1;
$charBeforeMarker = $beforeMarkerPosition >= 0 ? $text[$markerPosition - 1] : ''; $charBeforeMarker = $beforeMarkerPosition >= 0 ? $text[$markerPosition - 1] : '';
$Excerpt = ['text' => $excerpt, 'context' => $text, 'before' => $charBeforeMarker]; $Excerpt = ['text' => $excerpt, 'context' => $text, 'before' => $charBeforeMarker];
@ -2823,12 +2823,12 @@ class Markdown
return $Component['element']; return $Component['element'];
} }
protected function isBlockContinuable($Type): bool protected function isBlockContinuable($Type) : bool
{ {
return \method_exists($this, 'block' . $Type . 'Continue'); return \method_exists($this, 'block' . $Type . 'Continue');
} }
protected function isBlockCompletable($Type): bool protected function isBlockCompletable($Type) : bool
{ {
return \method_exists($this, 'block' . $Type . 'Complete'); return \method_exists($this, 'block' . $Type . 'Complete');
} }
@ -3966,7 +3966,7 @@ class Markdown
return $markup; return $markup;
} }
protected function elements(array $Elements): string protected function elements(array $Elements) : string
{ {
$markup = ''; $markup = '';
@ -3999,7 +3999,7 @@ class Markdown
$Elements = $this->linesElements($lines); $Elements = $this->linesElements($lines);
if (! \in_array('', $lines) if (! \in_array('', $lines)
&& isset($Elements[0]) && isset($Elements[0]['name']) && isset($Elements[0], $Elements[0]['name'])
&& $Elements[0]['name'] === 'p' && $Elements[0]['name'] === 'p'
) { ) {
unset($Elements[0]['name']); unset($Elements[0]['name']);
@ -4110,7 +4110,7 @@ class Markdown
# Static Methods # Static Methods
# #
protected static function escape(string $text, bool $allowQuotes = false): string protected static function escape(string $text, bool $allowQuotes = false) : string
{ {
return \htmlspecialchars($text, $allowQuotes ? \ENT_NOQUOTES : \ENT_QUOTES, 'UTF-8'); return \htmlspecialchars($text, $allowQuotes ? \ENT_NOQUOTES : \ENT_QUOTES, 'UTF-8');
} }

View File

@ -52,6 +52,10 @@ final class RestTest extends \PHPUnit\Framework\TestCase
$request = new HttpRequest(new HttpUri('http://httpbin.org/post')); $request = new HttpRequest(new HttpUri('http://httpbin.org/post'));
$request->setMethod(RequestMethod::POST); $request->setMethod(RequestMethod::POST);
self::assertTrue($request->setData('pdata', 'abc')); self::assertTrue($request->setData('pdata', 'abc'));
<<<<<<< HEAD
=======
\var_dump(REST::request($request)->getJsonData());
>>>>>>> 0080e35aace364fcf8708442f556fff4aba75143
self::assertEquals('abc', REST::request($request)->getJsonData()['form']['pdata'] ?? ''); self::assertEquals('abc', REST::request($request)->getJsonData()['form']['pdata'] ?? '');
} }

View File

@ -144,6 +144,6 @@ final class EnumTest extends \PHPUnit\Framework\TestCase
*/ */
public function testInvalidConstantException() : void public function testInvalidConstantException() : void
{ {
self::assertEquals(null, EnumDemo::getByName('ENUM3')); self::assertNull(EnumDemo::getByName('ENUM3'));
} }
} }