Code Duplication    Length = 5-5 lines in 2 locations

src/Yaml/Inline.php 1 location

@@ 301-305 (lines=5) @@
298
        $scalarLower = strtolower($scalar);
299
300
        if (strpos($scalar, "*") === 0) {
301
            if (($pos = strpos($scalar, "#")) !== false) {
302
                $value = substr($scalar, 1, $pos - 2);
303
            } else {
304
                $value = substr($scalar, 1);
305
            }
306
307
            // an unquoted *
308
            if ($value === false || $value === "") {

src/Yaml/Parser.php 1 location

@@ 496-500 (lines=5) @@
493
    protected function parseValue($value, $context)
494
    {
495
        if (strpos($value, "*") === 0) {
496
            if (($pos = strpos($value, "#")) !== false) {
497
                $value = substr($value, 1, $pos - 2);
498
            } else {
499
                $value = substr($value, 1);
500
            }
501
502
            if (!array_key_exists($value, $this->refs)) {
503
                throw new ParseException(sprintf("Reference \"%s\" does not exist.", $value), $this->currentLine);