Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
covex-nn committed Apr 25, 2018
1 parent 5cccbab commit f602634
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('db_driver')
->defaultValue('no_driver')
->info('Choose persistence mechanism driver from the following list: "doctrine_orm", "doctrine_mongodb", "doctrine_phpcr"')
->validate()
->ifNotInArray(self::DB_DRIVERS)
->thenInvalid('SonataMediaBundle - Invalid db driver %s.')
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/NoDriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class NoDriverException extends \RuntimeException
{
const DEFAULT_MESSAGE = 'The child node "db_driver" at path "sonata_media" must be configured.';

public function __construct($message = self::DEFAULT_MESSAGE, $code = 0, \Throwable $previous = null)
public function __construct($message = self::DEFAULT_MESSAGE, $code = 0, \Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/no_driver.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sonata.media.manager.media" class="Sonata\MediaBundle\Model\NoDriverManager"/>
<service id="sonata.media.manager.gallery" class="Sonata\MediaBundle\Model\NoDriverManager"/>
<service id="sonata.media.manager.media" class="Sonata\MediaBundle\Model\NoDriverManager" public="true"/>
<service id="sonata.media.manager.gallery" class="Sonata\MediaBundle\Model\NoDriverManager" public="true"/>
<service id="sonata.media.generator.default" class="Sonata\MediaBundle\Generator\NoDriverGenerator"/>
</services>
</container>

0 comments on commit f602634

Please sign in to comment.