Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 947 Bytes

UPGRADE-2.3.md

File metadata and controls

40 lines (30 loc) · 947 Bytes

UPGRADE FROM 2.2 to 2.3

Deprecated BlockServiceInterface::setDefaultSettings

BlockServiceInterface::setDefaultSettings method is now deprecated.

A new AbstractBlockService implementing BlockServiceInterface was also introduced to prevent BC.

A BlockService should now extends AbstractBlockService and use configureSettings method.

Before:

use Sonata\BlockBundle\Block\BlockServiceInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TextBlockService implements BlockServiceInterface
{
    public function setDefaultSettings(OptionsResolverInterface $resolver)
    {
        // ...
    }
}

After:

use Sonata\BlockBundle\Block\AbstractBlockService;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TextBlockService extends AbstractBlockService
{
    public function configureSettings(OptionsResolver $resolver)
    {
        // ...
    }
}