Skip to content

Commit

Permalink
Prepare making the default_formatter mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Dec 3, 2016
1 parent 965706f commit 5d69321
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DependencyInjection/SonataFormatterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public function load(array $configs, ContainerBuilder $container)

// NEXT_MAJOR: remove this if block
if (!isset($config['default_formatter'])) {
@trigger_error(<<<'EOT'
Not setting the default_formatter configuration node is deprecated since 3.x,
and will no longer be supported in 4.0'
EOT
, E_USER_DEPRECATED);
reset($config['formatters']);
$config['default_formatter'] = key($config['formatters']);
}
Expand Down
9 changes: 9 additions & 0 deletions UPGRADE-3.x.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
UPGRADE 3.x
===========

## Deprecated unspecified default_formatter configuration node

The `default_formatter` configuration node will become required.

```yaml
sonata_formatter:
default_formatter: my_formatter
```
UPGRADE FROM 3.0 to 3.1
=======================
Expand Down

0 comments on commit 5d69321

Please sign in to comment.