Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • Dumper
  • Escaper
  • Inline
  • Parser
  • Unescaper
  • Yaml
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class Yaml

Yaml offers convenience methods to load and dump YAML.

Namespace: Symfony\Component\Yaml
Author: Fabien Potencier <fabien@symfony.com>
Api
Located at yaml/Symfony/Component/Yaml/Yaml.php
Methods summary
public static array
# parse( string $input, mixed $exceptionOnInvalidType = false, mixed $objectSupport = false )

Parses YAML into a PHP array.

Parses YAML into a PHP array.

The parse method, when supplied with a YAML stream (string or file), will do its best to convert YAML in a file into a PHP array.
Usage:

 $array = Yaml::parse('config.yml');
 print_r($array);

As this method accepts both plain strings and file names as an input, you must validate the input before calling this method. Passing a file as an input is a deprecated feature and will be removed in 3.0.

Parameters

$input
string
$input Path to a YAML file or a string containing YAML
$exceptionOnInvalidType
$objectSupport

Returns

array
The YAML converted to a PHP array

Throws

Symfony\Component\Yaml\Exception\ParseException
If the YAML is not valid

Api

public static string
# dump( array $array, integer $inline = 2, integer $indent = 4, Boolean $exceptionOnInvalidType = false, Boolean $objectSupport = false )

Dumps a PHP array to a YAML string.

Dumps a PHP array to a YAML string.

The dump method, when supplied with an array, will do its best to convert the array into friendly YAML.

Parameters

$array
array
$array PHP array
$inline
integer
$inline The level where you switch to inline YAML
$indent
integer
$indent The amount of spaces to use for indentation of nested nodes.
$exceptionOnInvalidType
Boolean
$exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
$objectSupport
Boolean
$objectSupport true if object support is enabled, false otherwise

Returns

string
A YAML string representing the original PHP array

Api

php-coveralls API documentation generated by ApiGen 2.8.0