• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aplus-framework / config / 4200630019

pending completion
4200630019

push

github

Natan Felles
Use checkout v3

206 of 206 relevant lines covered (100.0%)

2.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Parsers/YamlParser.php
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of Aplus Framework Config Library.
4
 *
5
 * (c) Natan Felles <natanfelles@gmail.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Framework\Config\Parsers;
11

12
/**
13
 * Class YamlParser.
14
 *
15
 * @package config
16
 */
17
class YamlParser extends Parser
18
{
19
    /**
20
     * Parses an YAML file.
21
     *
22
     * @param mixed $config path to the YAML file
23
     *
24
     * @throws ParserException
25
     *
26
     * @return array<mixed> The YAML parsed data
27
     */
28
    public static function parse(mixed $config) : array
29
    {
30
        static::checkConfig($config);
2✔
31
        return static::parseOrThrow(static function () use ($config) : array {
2✔
32
            $data = \yaml_parse_file($config);
2✔
33
            return static::ksortRecursive($data);
1✔
34
        });
2✔
35
    }
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc