Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Parser/RegexParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private function extractValue($value)
*/
private function isDelimitedValue($value)
{
/** @psalm-suppress ArgumentTypeCoercion */
return strlen($value) >= 2 * $this->parameterValueDelimiterLength
&& 0 === strncmp($value, $this->parameterValueDelimiter, $this->parameterValueDelimiterLength)
&& substr($value, -1 * $this->parameterValueDelimiterLength) === $this->parameterValueDelimiter;
Expand Down
11 changes: 10 additions & 1 deletion tests/FacadeTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Thunder\Shortcode\Tests;

use Composer\InstalledVersions;
use Thunder\Shortcode\EventHandler\FilterRawEventHandler;
use Thunder\Shortcode\Events;
use Thunder\Shortcode\HandlerContainer\HandlerContainer;
Expand Down Expand Up @@ -66,7 +67,15 @@ public function testSerialization()
bbCode: null

EOF;
$this->assertSame($yaml, $facade->serialize($s, 'yaml'));
$yaml8 = <<<EOF
name: c
parameters: {}
content: null
bbCode: null

EOF;
$symfonyYamlVersion = InstalledVersions::getVersion('symfony/yaml');
$this->assertSame(preg_match('~\A8~', $symfonyYamlVersion) ? $yaml8 : $yaml, $facade->serialize($s, 'yaml'));
$this->assertSame('c', $facade->unserialize($yaml, 'yaml')->getName());

$xml = <<<EOF
Expand Down
Loading