src/ChunkDecoder/EvolutionChunkDecoder.php
private function probabilityChunkDecoder($evolution, $chunk, $decoded_taf)
    {
        $regexp = '#^(PROB[034]{2}\s+){1}(TEMPO\s+){0,1}([0-9]{4}/[0-9]{4}){0,1}(.*)#';

        if (preg_match($regexp, $chunk, $matches)) {
            $found = $matches;
        } else {
            return $chunk;
        }

        $prob = trim($found[1]);
        $type = trim($found[2]);
        $period = trim($found[3]);
        $remaining = trim($found[4]);

        if (strpos($prob, 'PROB') !== false) {
            $evolution->setProbability($prob);
            $embeddedEvolution = new Evolution();
            if ($type) {
                $embeddedEvolution->setType($type);
            } else {
                $embeddedEvolution->setType('probability');
            }
            $periodArr = explode('/', $period);
            $embeddedEvolution->setFromDay(intval(mb_substr($periodArr[0], 0, 2)));
            $embeddedEvolution->setFromTime(mb_substr($periodArr[0], 2, 2).':00 UTC');
            $embeddedEvolution->setToDay(intval(mb_substr($periodArr[1], 0, 2)));
            $embeddedEvolution->setToTime(mb_substr($periodArr[1], 2, 2).':00 UTC');

            $evolution->addEvolution($embeddedEvolution);
            // recurse on the remaining chunk to extract the weather elements it contains
            $chunk = $this->parseEntitiesChunk($evolution, $remaining, $decoded_taf);
        }

        return $chunk;
    }
private function probabilityChunkDecoder($evolution, $chunk, $decoded_taf)
    {
        $regexp = '#^(PROB[034]{2}\s+){1}(TEMPO\s+){0,1}([0-9]{4}/[0-9]{4}){0,1}(.*)#';

        if (preg_match($regexp, $chunk, $matches)) {
            $found = $matches;
        } else {
            return $chunk;
        }

        $prob = trim($found[1]);
        $type = trim($found[2]);
        $period = trim($found[3]);
        $remaining = trim($found[4]);

        if (strpos($prob, 'PROB') !== false) {
            $evolution->setProbability($prob);
            $embeddedEvolution = new Evolution();
            if ($type) {
                $embeddedEvolution->setType($type);
            } else {
                $embeddedEvolution->setType('probability');
            }
            $periodArr = explode('/', $period);
            $embeddedEvolution->setFromDay(intval(mb_substr($periodArr[0], 0, 2)));
            $embeddedEvolution->setFromTime(mb_substr($periodArr[0], 2, 2).':00 UTC');
            $embeddedEvolution->setToDay(intval(mb_substr($periodArr[1], 0, 2)));
            $embeddedEvolution->setToTime(mb_substr($periodArr[1], 2, 2).':00 UTC');

            $evolution->addEvolution($embeddedEvolution);
            // recurse on the remaining chunk to extract the weather elements it contains
            $chunk = $this->parseEntitiesChunk($evolution, $remaining, $decoded_taf);
        }

        return $chunk;
    }
Look recursively for probability (PROBnn) attributes and embed a new evolution object one level deeper for each

@param Evolution $evolution
@param string $chunk
@param DecodedTaf $decoded_taf
@return string