<?php

/*
 * This file is part of the Sonata Project package.
 *
 * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\CoreBundle\Serializer;

if (!interface_exists(\Sonata\Serializer\SerializerHandlerInterface::class, false)) {
    @trigger_error(
        'The '.__NAMESPACE__.'\SerializerHandlerInterface class is deprecated since version 3.x and will be removed in 4.0.'
        .' Use Sonata\Serializer\SerializerHandlerInterface instead.',
        E_USER_DEPRECATED
    );
}

class_alias(
    \Sonata\Serializer\SerializerHandlerInterface::class,
    __NAMESPACE__.'\SerializerHandlerInterface'
);

if (false) {
    /**
     * @deprecated Since version 3.x, to be removed in 4.0.
     */
    interface SerializerHandlerInterface extends \Sonata\Serializer\SerializerHandlerInterface
    {
        /**
         * @return string
         */
        public static function getType();
    }
}

<?php

/*
 * This file is part of the Sonata Project package.
 *
 * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\CoreBundle\Serializer;

if (!class_exists(\Sonata\Serializer\SerializerHandlerInterface::class, false)) {
    @trigger_error(
        'The '.__NAMESPACE__.'\SerializerHandlerInterface class is deprecated since version 3.x and will be removed in 4.0.'
        .' Use Sonata\Serializer\SerializerHandlerInterface instead.',
        E_USER_DEPRECATED
    );
}

class_alias(
    \Sonata\Serializer\SerializerHandlerInterface::class,
    __NAMESPACE__.'\SerializerHandlerInterface'
);

if (false) {
    /**
     * @deprecated Since version 3.x, to be removed in 4.0.
     */
    interface SerializerHandlerInterface extends \Sonata\Serializer\SerializerHandlerInterface
    {
        /**
         * @return string
         */
        public static function getType();
    }
}

--- 
+++ 
@@ -11,7 +11,7 @@
 
 namespace Sonata\CoreBundle\Serializer;
 
-if (!class_exists(\Sonata\Serializer\SerializerHandlerInterface::class, false)) {
+if (!interface_exists(\Sonata\Serializer\SerializerHandlerInterface::class, false)) {
     @trigger_error(
         'The '.__NAMESPACE__.'\SerializerHandlerInterface class is deprecated since version 3.x and will be removed in 4.0.'
         .' Use Sonata\Serializer\SerializerHandlerInterface instead.',
Use the correct function to trigger autoload

I think this must be pedantic because there is no way you could know it
is actually an interface before loading the file.
