Skip to content

Commit a4db8b8

Browse files
committed
Use .yaml instead of .yml as extension
1 parent a8bc89c commit a4db8b8

File tree

13 files changed

+33
-33
lines changed

13 files changed

+33
-33
lines changed

components/config/caching.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ should be regenerated::
3232
$userMatcherCache = new ConfigCache($cachePath, true);
3333

3434
if (!$userMatcherCache->isFresh()) {
35-
// fill this with an array of 'users.yml' file paths
35+
// fill this with an array of 'users.yaml' file paths
3636
$yamlUserFiles = ...;
3737

3838
$resources = array();

components/config/definition.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,10 @@ Otherwise the result is a clean array of configuration values::
804804
use Acme\DatabaseConfiguration;
805805

806806
$config1 = Yaml::parse(
807-
file_get_contents(__DIR__.'/src/Matthias/config/config.yml')
807+
file_get_contents(__DIR__.'/src/Matthias/config/config.yaml')
808808
);
809809
$config2 = Yaml::parse(
810-
file_get_contents(__DIR__.'/src/Matthias/config/config_extra.yml')
810+
file_get_contents(__DIR__.'/src/Matthias/config/config_extra.yaml')
811811
);
812812

813813
$configs = array($config1, $config2);

components/config/resources.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ files. This can be done with the :class:`Symfony\\Component\\Config\\FileLocator
2222
$configDirectories = array(__DIR__.'/app/config');
2323

2424
$locator = new FileLocator($configDirectories);
25-
$yamlUserFiles = $locator->locate('users.yml', null, false);
25+
$yamlUserFiles = $locator->locate('users.yaml', null, false);
2626

2727
The locator receives a collection of locations where it should look for
2828
files. The first argument of ``locate()`` is the name of the file to look
@@ -53,12 +53,12 @@ which allows for recursively importing other resources::
5353

5454
// maybe import some other resource:
5555

56-
// $this->import('extra_users.yml');
56+
// $this->import('extra_users.yaml');
5757
}
5858

5959
public function supports($resource, $type = null)
6060
{
61-
return is_string($resource) && 'yml' === pathinfo(
61+
return is_string($resource) && 'yaml' === pathinfo(
6262
$resource,
6363
PATHINFO_EXTENSION
6464
);
@@ -88,5 +88,5 @@ the resource::
8888
$delegatingLoader = new DelegatingLoader($loaderResolver);
8989

9090
// YamlUserLoader is used to load this resource because it supports
91-
// files with the '.yml' extension
92-
$delegatingLoader->load(__DIR__.'/users.yml');
91+
// files with the '.yaml' extension
92+
$delegatingLoader->load(__DIR__.'/users.yaml');

components/dependency_injection/_imports-parameters-note.rst.inc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88

99
.. code-block:: yaml
1010

11-
# app/config/config.yml
11+
# config/services.yaml
1212
imports:
13-
- { resource: '%kernel.project_dir%/somefile.yml' }
13+
- { resource: '%kernel.project_dir%/somefile.yaml' }
1414

1515
.. code-block:: xml
1616

17-
<!-- app/config/config.xml -->
17+
<!-- config/services.xml -->
1818
<?xml version="1.0" encoding="UTF-8" ?>
1919
<container xmlns="http://symfony.com/schema/dic/services"
2020
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2121
xsi:schemaLocation="http://symfony.com/schema/dic/services
2222
http://symfony.com/schema/dic/services/services-1.0.xsd">
2323

2424
<imports>
25-
<import resource="%kernel.project_dir%/somefile.yml" />
25+
<import resource="%kernel.project_dir%/somefile.yaml" />
2626
</imports>
2727
</container>
2828

2929
.. code-block:: php
3030

31-
// app/config/config.php
32-
$loader->import('%kernel.project_dir%/somefile.yml');
31+
// config/services.php
32+
$loader->import('%kernel.project_dir%/somefile.yaml');

components/dependency_injection/compilation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ are loaded::
121121
$container->registerExtension(new AcmeDemoExtension);
122122

123123
$loader = new YamlFileLoader($container, new FileLocator(__DIR__));
124-
$loader->load('config.yml');
124+
$loader->load('config.yaml');
125125

126126
// ...
127127
$container->compile();

components/http_foundation/session_configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ configuration:
147147

148148
.. code-block:: yaml
149149
150-
# config.yml
150+
# config/packages/framework.yaml
151151
framework:
152152
session:
153153
gc_probability: null

components/property_info.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ It can also provide return and scalar types for PHP 7+.
355355

356356
.. code-block:: yaml
357357
358-
# app/config/config.yml
358+
# config/packages/framework.yaml
359359
framework:
360360
property_info:
361361
enabled: true

components/routing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ If you're using the ``YamlFileLoader``, then route definitions look like this:
246246

247247
.. code-block:: yaml
248248
249-
# routes.yml
249+
# routes.yaml
250250
route1:
251251
path: /foo
252252
defaults: { _controller: 'MyController::fooAction' }
@@ -256,15 +256,15 @@ If you're using the ``YamlFileLoader``, then route definitions look like this:
256256
defaults: { _controller: 'MyController::foobarAction' }
257257
258258
To load this file, you can use the following code. This assumes that your
259-
``routes.yml`` file is in the same directory as the below code::
259+
``routes.yaml`` file is in the same directory as the below code::
260260

261261
use Symfony\Component\Config\FileLocator;
262262
use Symfony\Component\Routing\Loader\YamlFileLoader;
263263

264264
// look inside *this* directory
265265
$locator = new FileLocator(array(__DIR__));
266266
$loader = new YamlFileLoader($locator);
267-
$collection = $loader->load('routes.yml');
267+
$collection = $loader->load('routes.yaml');
268268

269269
Besides :class:`Symfony\\Component\\Routing\\Loader\\YamlFileLoader` there are two
270270
other loaders that work the same way:
@@ -337,7 +337,7 @@ automatically in the background if you want to use it. A basic example of the
337337

338338
$router = new Router(
339339
new YamlFileLoader($locator),
340-
'routes.yml',
340+
'routes.yaml',
341341
array('cache_dir' => __DIR__.'/cache'),
342342
$requestContext
343343
);

components/serializer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ the middle. This way, Encoders will only deal with turning specific
2121
**formats** into **arrays** and vice versa. The same way, Normalizers
2222
will deal with turning specific **objects** into **arrays** and vice versa.
2323

24-
Serialization is a complex topic. This component may not cover all your use cases out of the box,
24+
Serialization is a complex topic. This component may not cover all your use cases out of the box,
2525
but it can be useful for developing tools to serialize and deserialize your objects.
2626

2727
Installation
@@ -243,7 +243,7 @@ like the following::
243243
// For XML
244244
// $classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));
245245
// For YAML
246-
// $classMetadataFactory = new ClassMetadataFactory(new YamlFileLoader('/path/to/your/definition.yml'));
246+
// $classMetadataFactory = new ClassMetadataFactory(new YamlFileLoader('/path/to/your/definition.yaml'));
247247

248248
.. _component-serializer-attributes-groups-annotations:
249249

components/translation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ file as the second argument, instead of an array::
128128

129129
// ...
130130
$translator->addLoader('yaml', new YamlFileLoader());
131-
$translator->addResource('yaml', 'path/to/messages.fr.yml', 'fr_FR');
131+
$translator->addResource('yaml', 'path/to/messages.fr.yaml', 'fr_FR');
132132

133133
The Translation Process
134134
-----------------------

components/translation/custom_formats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ YAML file are dumped into a text file with the custom format::
119119
use Symfony\Component\Translation\Loader\YamlFileLoader;
120120

121121
$loader = new YamlFileLoader();
122-
$catalogue = $loader->load(__DIR__ . '/translations/messages.fr_FR.yml' , 'fr_FR');
122+
$catalogue = $loader->load(__DIR__ . '/translations/messages.fr_FR.yaml' , 'fr_FR');
123123

124124
$dumper = new MyFormatDumper();
125125
$dumper->dump($catalogue, array('path' => __DIR__.'/dumps'));

components/validator/resources.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ configure the locations of these files::
7171
use Symfony\Component\Validator\Validation;
7272

7373
$validator = Validation::createValidatorBuilder()
74-
->addYamlMapping('config/validation.yml')
74+
->addYamlMapping('config/validation.yaml')
7575
->getValidator();
7676

7777
.. note::
@@ -173,13 +173,13 @@ Using a Custom MetadataFactory
173173
------------------------------
174174

175175
All the loaders and the cache are passed to an instance of
176-
:class:`Symfony\\Component\\Validator\\Mapping\\Factory\\LazyLoadingMetadataFactory`.
176+
:class:`Symfony\\Component\\Validator\\Mapping\\Factory\\LazyLoadingMetadataFactory`.
177177
This class is responsible for creating a ``ClassMetadata`` instance from all the
178178
configured resources.
179179

180180
You can also use a custom metadata factory implementation by creating a class
181181
which implements
182-
:class:`Symfony\\Component\\Validator\\Mapping\\Factory\\MetadataFactoryInterface`.
182+
:class:`Symfony\\Component\\Validator\\Mapping\\Factory\\MetadataFactoryInterface`.
183183
You can set this custom implementation using
184184
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::setMetadataFactory`::
185185

components/yaml.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ contents of the given file path and converts them to a PHP value::
128128

129129
use Symfony\Component\Yaml\Yaml;
130130

131-
$value = Yaml::parseFile('/path/to/file.yml');
131+
$value = Yaml::parseFile('/path/to/file.yaml');
132132

133133
If an error occurs during parsing, the parser throws a ``ParseException`` exception.
134134

@@ -151,7 +151,7 @@ array to its YAML representation:
151151
152152
$yaml = Yaml::dump($array);
153153
154-
file_put_contents('/path/to/file.yml', $yaml);
154+
file_put_contents('/path/to/file.yaml', $yaml);
155155
156156
If an error occurs during the dump, the parser throws a
157157
:class:`Symfony\\Component\\Yaml\\Exception\\DumpException` exception.
@@ -356,20 +356,20 @@ Then, execute the script for validating contents:
356356
.. code-block:: terminal
357357
358358
# validates a single file
359-
$ php lint.php path/to/file.yml
359+
$ php lint.php path/to/file.yaml
360360
361361
# or all the files in a directory
362362
$ php lint.php path/to/directory
363363
364364
# or contents passed to STDIN
365-
$ cat path/to/file.yml | php lint.php
365+
$ cat path/to/file.yaml | php lint.php
366366
367367
The result is written to STDOUT and uses a plain text format by default.
368368
Add the ``--format`` option to get the output in JSON format:
369369

370370
.. code-block:: terminal
371371
372-
$ php lint.php path/to/file.yml --format json
372+
$ php lint.php path/to/file.yaml --format json
373373
374374
.. tip::
375375

0 commit comments

Comments
 (0)