Fatal error: Class App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber contains 1 abstract method and must therefore be declared abstract or implement the remaining method (Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents) in /var/www/html/src/Components/Cookie/Model/Event/Subscriber/CookieSubscriber.php on line 15
Error: Class App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber contains 1 abstract method and must therefore be declared abstract or implement the remaining method (Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents) (500 Internal Server Error)

Symfony Exception

FatalError

HTTP 500 Internal Server Error

Error: Class App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber contains 1 abstract method and must therefore be declared abstract or implement the remaining method (Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents)

Exception

Symfony\Component\ErrorHandler\Error\ FatalError

Show exception properties
Symfony\Component\ErrorHandler\Error\FatalError {#51
  -error: array:5 [
    "type" => 1
    "message" => "Class App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber contains 1 abstract method and must therefore be declared abstract or implement the remaining method (Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents)"
    "file" => "/var/www/html/src/Components/Cookie/Model/Event/Subscriber/CookieSubscriber.php"
    "line" => 15
    "trace" => array:15 [
      0 => array:3 [
        "file" => "/var/www/html/vendor/symfony/error-handler/DebugClassLoader.php"
        "line" => 347
        "function" => "include"
      ]
      1 => array:4 [
        "function" => "loadClass"
        "class" => "Symfony\Component\ErrorHandler\DebugClassLoader"
        "type" => "->"
        "args" => array:1 [
          0 => "App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber"
        ]
      ]
      2 => array:6 [
        "file" => "/var/www/html/vendor/symfony/config/Resource/ReflectionClassResource.php"
        "line" => 105
        "function" => "__construct"
        "class" => "ReflectionClass"
        "type" => "->"
        "args" => array:1 [
          0 => "App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber"
        ]
      ]
      3 => array:6 [
        "file" => "/var/www/html/vendor/symfony/config/Resource/ReflectionClassResource.php"
        "line" => 51
        "function" => "computeHash"
        "class" => "Symfony\Component\Config\Resource\ReflectionClassResource"
        "type" => "->"
        "args" => []
      ]
      4 => array:6 [
        "file" => "/var/www/html/vendor/symfony/config/Resource/SelfCheckingResourceChecker.php"
        "line" => 44
        "function" => "isFresh"
        "class" => "Symfony\Component\Config\Resource\ReflectionClassResource"
        "type" => "->"
        "args" => array:1 [
          0 => 1786058062
        ]
      ]
      5 => array:6 [
        "file" => "/var/www/html/vendor/symfony/config/ResourceCheckerConfigCache.php"
        "line" => 88
        "function" => "isFresh"
        "class" => "Symfony\Component\Config\Resource\SelfCheckingResourceChecker"
        "type" => "->"
        "args" => array:2 [
          0 => Symfony\Component\Config\Resource\ReflectionClassResource {#88
            -files: array:1 [
              "/var/www/html/src/Components/Cookie/Model/Event/Subscriber/CookieSubscriber.php" => null
            ]
            -className: "App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber"
            -excludedVendors: array:1 [
              0 => "/var/www/html/vendor"
            ]
            -hash: "c3c2a8ae401be7882cc865e85b4c15bd"
            -classReflector: ? ReflectionClass
          }
          1 => 1786058062
        ]
      ]
      6 => array:6 [
        "file" => "/var/www/html/vendor/symfony/config/ConfigCache.php"
        "line" => 65
        "function" => "isFresh"
        "class" => "Symfony\Component\Config\ResourceCheckerConfigCache"
        "type" => "->"
        "args" => []
      ]
      7 => array:6 [
        "file" => "/var/www/html/vendor/symfony/dependency-injection/Kernel/KernelTrait.php"
        "line" => 136
        "function" => "isFresh"
        "class" => "Symfony\Component\Config\ConfigCache"
        "type" => "->"
        "args" => []
      ]
      8 => array:6 [
        "file" => "/var/www/html/vendor/symfony/http-kernel/Kernel.php"
        "line" => 202
        "function" => "doInitializeContainer"
        "class" => "App\Kernel"
        "type" => "->"
        "args" => []
      ]
      9 => array:6 [
        "file" => "/var/www/html/vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php"
        "line" => 85
        "function" => "initializeContainer"
        "class" => "Symfony\Component\HttpKernel\Kernel"
        "type" => "->"
        "args" => []
      ]
      10 => array:6 [
        "file" => "/var/www/html/vendor/symfony/http-kernel/Kernel.php"
        "line" => 258
        "function" => "initializeContainer"
        "class" => "App\Kernel"
        "type" => "->"
        "args" => []
      ]
      11 => array:6 [
        "file" => "/var/www/html/vendor/symfony/http-kernel/Kernel.php"
        "line" => 122
        "function" => "preBoot"
        "class" => "Symfony\Component\HttpKernel\Kernel"
        "type" => "->"
        "args" => []
      ]
      12 => array:6 [
        "file" => "/var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php"
        "line" => 34
        "function" => "handle"
        "class" => "Symfony\Component\HttpKernel\Kernel"
        "type" => "->"
        "args" => array:1 [
          0 => Symfony\Component\HttpFoundation\Request {#2
            +attributes: Symfony\Component\HttpFoundation\ParameterBag {#17
              #parameters: []
            }
            +request: Symfony\Component\HttpFoundation\InputBag {#5
              #parameters: []
            }
            +query: Symfony\Component\HttpFoundation\InputBag {#15
              #parameters: array:2 [
                "panel" => "time"
                "type" => "request"
              ]
            }
            +server: Symfony\Component\HttpFoundation\ServerBag {#23
              #parameters: array:67 [
                "HOSTNAME" => "3f0a2a489c8d"
                "PHP_INI_DIR" => "/usr/local/etc/php"
                "HOME" => "/var/www"
                "PHP_LDFLAGS" => "-Wl,-O1 -pie"
                "PHP_CFLAGS" => "-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
                "PHP_VERSION" => "8.5.9"
                "GPG_KEYS" => "1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5"
                "PHP_CPPFLAGS" => "-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
                "PHP_ASC_URL" => "https://www.php.net/distributions/php-8.5.9.tar.xz.asc"
                "PHP_URL" => "https://www.php.net/distributions/php-8.5.9.tar.xz"
                "PATH" => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                "PHPIZE_DEPS" => "autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c"
                "PWD" => "/var/www/html"
                "PHP_SHA256" => "0db7855f25bcd0ab1d592cdb35e284d6f6a5d2ae0f6f621122e364cc39b708f4"
                "USER" => "www-data"
                "HTTP_X_REAL_IP" => "104.23.197.227"
                "HTTP_X_FORWARDED_SERVER" => "36a519e03f15"
                "HTTP_X_FORWARDED_PROTO" => "https"
                "HTTP_X_FORWARDED_PORT" => "443"
                "HTTP_X_FORWARDED_HOST" => "test-hotel.praisethelord.site"
                "HTTP_X_FORWARDED_FOR" => "104.23.197.227"
                "HTTP_CF_VISITOR" => "{"scheme":"https"}"
                "HTTP_CF_RAY" => "a27389da98866483-CMH"
                "HTTP_CF_IPCOUNTRY" => "US"
                "HTTP_CF_CONNECTING_IP" => "216.73.217.69"
                "HTTP_CDN_LOOP" => "cloudflare; loops=1"
                "HTTP_ACCEPT_ENCODING" => "gzip, br"
                "HTTP_ACCEPT" => "*/*"
                "HTTP_USER_AGENT" => "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
                "HTTP_HOST" => "test-hotel.praisethelord.site"
                "PHP_VALUE" => "expose_php=0"
                "SCRIPT_FILENAME" => "/var/www/html/public/index.php"
                "REDIRECT_STATUS" => "200"
                "SERVER_NAME" => ""
                "SERVER_PORT" => "80"
                "SERVER_ADDR" => "172.18.0.3"
                "REMOTE_PORT" => "48798"
                "REMOTE_ADDR" => "172.18.0.2"
                "SERVER_SOFTWARE" => "nginx/1.27.5"
                "GATEWAY_INTERFACE" => "CGI/1.1"
                "REQUEST_SCHEME" => "http"
                "SERVER_PROTOCOL" => "HTTP/1.1"
                "DOCUMENT_ROOT" => "/var/www/html/public"
                "DOCUMENT_URI" => "/index.php"
                "REQUEST_URI" => "/_profiler/3d11d2?panel=time&type=request"
                "SCRIPT_NAME" => "/index.php"
                "CONTENT_LENGTH" => ""
                "CONTENT_TYPE" => ""
                "REQUEST_METHOD" => "GET"
                "QUERY_STRING" => "panel=time&type=request"
                "FCGI_ROLE" => "RESPONDER"
                "PHP_SELF" => "/index.php"
                "REQUEST_TIME_FLOAT" => 1786076947.6681
                "REQUEST_TIME" => 1786076947
                "APP_RUNTIME_OPTIONS" => array:1 [
                  "project_dir" => "/var/www/html"
                ]
                "APP_RUNTIME" => "Symfony\Component\Runtime\SymfonyRuntime"
                "APP_PROJECT_DIR" => "/var/www/html"
                "SYMFONY_DOTENV_PATH" => "/var/www/html/.env"
                "APP_ENV" => "dev"
                "APP_SECRET" => ""
                "DEFAULT_URI" => "http://localhost"
                "DATABASE_URL" => "mysql://ucornerhotelcom:app_pass_cornerhotelcom@mariadb:3306/dbcornerhotelcom?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
                "MESSENGER_TRANSPORT_DSN" => "doctrine://default?auto_setup=0"
                "MAILER_DSN" => "null://null"
                "ADMIN_URL" => "admin23"
                "SYMFONY_DOTENV_VARS" => "APP_ENV,APP_SECRET,DEFAULT_URI,DATABASE_URL,MESSENGER_TRANSPORT_DSN,MAILER_DSN,ADMIN_URL"
                "APP_DEBUG" => "1"
              ]
            }
            +files: Symfony\Component\HttpFoundation\FileBag {#21
              #parameters: []
            }
            +cookies: Symfony\Component\HttpFoundation\InputBag {#19
              #parameters: []
            }
            +headers: Symfony\Component\HttpFoundation\HeaderBag {#25
              #headers: array:15 [
                "x-real-ip" => array:1 [
                  0 => "104.23.197.227"
                ]
                "x-forwarded-server" => array:1 [
                  0 => "36a519e03f15"
                ]
                "x-forwarded-proto" => array:1 [
                  0 => "https"
                ]
                "x-forwarded-port" => array:1 [
                  0 => "443"
                ]
                "x-forwarded-host" => array:1 [
                  0 => "test-hotel.praisethelord.site"
                ]
                "x-forwarded-for" => array:1 [
                  0 => "104.23.197.227"
                ]
                "cf-visitor" => array:1 [
                  0 => "{"scheme":"https"}"
                ]
                "cf-ray" => array:1 [
                  0 => "a27389da98866483-CMH"
                ]
                "cf-ipcountry" => array:1 [
                  0 => "US"
                ]
                "cf-connecting-ip" => array:1 [
                  0 => "216.73.217.69"
                ]
                "cdn-loop" => array:1 [
                  0 => "cloudflare; loops=1"
                ]
                "accept-encoding" => array:1 [
                  0 => "gzip, br"
                ]
                "accept" => array:1 [
                  0 => "*/*"
                ]
                "user-agent" => array:1 [
                  0 => "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
                ]
                "host" => array:1 [
                  0 => "test-hotel.praisethelord.site"
                ]
              ]
              #cacheControl: []
            }
            #content: null
            #languages: null
            #charsets: null
            #encodings: null
            #acceptableContentTypes: null
            #pathInfo: null
            #requestUri: null
            #baseUrl: null
            #basePath: null
            #method: null
            #format: null
            #session: null
            #locale: null
            #defaultLocale: "en"
            -preferredFormat: null
            -isHostValid: true
            -isForwardedValid: true
            -isSafeContentPreferred: ? bool
            -trustedValuesCache: []
            -isIisRewrite: false
            pathInfo: "/_profiler/3d11d2"
            requestUri: "/_profiler/3d11d2?panel=time&type=request"
            baseUrl: ""
            basePath: ""
            method: "GET"
            format: "html"
          }
        ]
      ]
      13 => array:6 [
        "file" => "/var/www/html/vendor/autoload_runtime.php"
        "line" => 32
        "function" => "run"
        "class" => "Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner"
        "type" => "->"
        "args" => []
      ]
      14 => array:4 [
        "file" => "/var/www/html/public/index.php"
        "line" => 7
        "args" => array:1 [
          0 => "/var/www/html/vendor/autoload_runtime.php"
        ]
        "function" => "require_once"
      ]
    ]
  ]
}
  1. use Symfony\Component\HttpFoundation\RedirectResponse;
  2. use Symfony\Component\HttpKernel\Event\RequestEvent;
  3. use Symfony\Component\HttpKernel\KernelEvents;
  4. use Symfony\Component\Routing\RouterInterface;
  5. class CookieSubscriber implements EventSubscriberInterface
  6. {
  7. public function __construct(
  8. private readonly RouterInterface $router,
  9. private readonly CookieService $service
  10. ) {

Stack Trace

FatalError
Symfony\Component\ErrorHandler\Error\FatalError:
Error: Class App\Components\Cookie\Model\Event\Subscriber\CookieSubscriber contains 1 abstract method and must therefore be declared abstract or implement the remaining method (Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents)

  at /var/www/html/src/Components/Cookie/Model/Event/Subscriber/CookieSubscriber.php:15