Symfony console issue with Laravel 11

I upgraded my Laravel 8 to 11 (after going through 9 and 10 first), I updated the php version to 8.2 and installed its packages, I updated the composer packages’ version and edited some of the php code where it was required by the documentation … I run composer install and it went well, but, when I run php artisan optimize it threw this error:

PHP Fatal error:  Declaration of SymfonyComponentConsoleStyleOutputStyle::write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) must be compatible with SymfonyComponentConsoleOutputOutputInterface::write(Traversable|array|string $messages, bool $newline = false, int $options = 0): void in /home/admin/web/workingexampledomain.com/public_html/vendor/symfony/console/Style/OutputStyle.php on line 52

   SymfonyComponentErrorHandlerErrorFatalError

  Declaration of SymfonyComponentConsoleStyleOutputStyle::write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) must be compatible with SymfonyComponentConsoleOutputOutputInterface::write(Traversable|array|string $messages, bool $newline = false, int $options = 0): void

  at /home/admin/web/workingexampledomain.com/public_html/vendor/symfony/console/Style/OutputStyle.php:52
     48▕
     49▕     /**
     50▕      * {@inheritdoc}
     51▕      */
  ➜  52▕     public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL)
     53▕     {
     54▕         $this->output->write($messages, $newline, $type);
     55▕     }
     56▕


   

I tried checking if there is any package that conflicts with the latest version of symfony console but I didn’t find anything.