Error 500 Internal Server Error

GET https://dev.darksoft-inc.wtf/login

Exceptions

Too few arguments to function App\Form\LoginFormType::__construct(), 0 passed in /home/ubuntu/work/mossleigh/var/cache/dev/ContainerJDxM9Sl/getLoginFormTypeService.php on line 25 and exactly 1 expected

Exception

ArgumentCountError

  1. use Symfony\Contracts\Translation\TranslatorInterface;
  2. class LoginFormType extends AbstractType
  3. {
  4. public function __construct(
  5. private readonly TranslatorInterface $trans,
  6. ) {
  7. }
  8. public function buildForm(FormBuilderInterface $builder, array $options): void
  9. {
  1. {
  2. include_once \dirname(__DIR__, 4).'/vendor/symfony/form/FormTypeInterface.php';
  3. include_once \dirname(__DIR__, 4).'/vendor/symfony/form/AbstractType.php';
  4. include_once \dirname(__DIR__, 4).'/src/Form/LoginFormType.php';
  5. return $container->privates['App\\Form\\LoginFormType'] = new \App\Form\LoginFormType();
  6. }
  7. }
  1. $file .= '.php';
  2. }
  3. $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  4. return class_exists($class, false) ? $class::do($this, $lazyLoad) : $service;
  5. }
  6. protected function createProxy($class, \Closure $factory)
  7. {
  8. class_exists($class, false) || require __DIR__.'/'.$class.'.php';
  1. }
  2. if (null === $method) {
  3. return false !== $registry ? $this->{$registry}[$id] ?? null : null;
  4. }
  5. if (false !== $registry) {
  6. return $this->{$registry}[$id] ??= $load ? $this->load($method) : $this->{$method}($this);
  7. }
  8. if (!$load) {
  9. return $this->{$method}($this);
  10. }
  1. public function get(string $id): mixed
  2. {
  3. return match (\count($this->serviceMap[$id] ?? [])) {
  4. 0 => parent::get($id),
  5. 1 => $this->serviceMap[$id][0],
  6. default => ($this->factory)(...$this->serviceMap[$id]),
  7. };
  8. }
  9. public function getProvidedServices(): array
  10. {
  1. {
  2. if (!$this->typeContainer->has($name)) {
  3. throw new InvalidArgumentException(\sprintf('The field type "%s" is not registered in the service container.', $name));
  4. }
  5. return $this->typeContainer->get($name);
  6. }
  7. public function hasType(string $name): bool
  8. {
  9. return $this->typeContainer->has($name);
  1. if (!isset($this->types[$name])) {
  2. $type = null;
  3. foreach ($this->extensions as $extension) {
  4. if ($extension->hasType($name)) {
  5. $type = $extension->getType($name);
  6. break;
  7. }
  8. }
  9. if (!$type) {
  1. /**
  2. * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowBuilderInterface : FormBuilderInterface)
  3. */
  4. public function createBuilder(string $type = FormType::class, mixed $data = null, array $options = []): FormBuilderInterface
  5. {
  6. return $this->createNamedBuilder($this->registry->getType($type)->getBlockPrefix(), $type, $data, $options);
  7. }
  8. /**
  9. * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowBuilderInterface : FormBuilderInterface)
  10. */
in vendor/symfony/form/FormFactory.php -> createBuilder (line 32)
  1. /**
  2. * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface)
  3. */
  4. public function create(string $type = FormType::class, mixed $data = null, array $options = []): FormInterface
  5. {
  6. return $this->createBuilder($type, $data, $options)->getForm();
  7. }
  8. /**
  9. * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface)
  10. */
  1. *
  2. * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface)
  3. */
  4. protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface
  5. {
  6. return $this->container->get('form.factory')->create($type, $data, $options);
  7. }
  8. /**
  9. * Creates and returns a form builder instance.
  10. */
AbstractController->createForm() in src/Controller/SecurityController.php (line 39)
  1. $error = $authenticationUtils->getLastAuthenticationError();
  2. // last username entered by the user
  3. $lastUsername = $authenticationUtils->getLastUsername();
  4. $form = $this->createForm(LoginFormType::class, [
  5. '_username' => $lastUsername,
  6. ], [
  7. 'action' => $this->generateUrl('app_login'),
  8. 'method' => 'POST',
  9. ]);
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $controllerMetadata);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type, $controllerMetadata);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. if (!$this->handlingHttpCache) {
  2. $this->resetServices = true;
  3. }
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. $response->send(false);
  7. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
  8. fastcgi_finish_request();
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/home/ubuntu/work/mossleigh/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return static function (array $context) {
  5. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

Level Channel Message
INFO 05:09:16 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "9e097b"
    },
    "request_uri": "https://dev.darksoft-inc.wtf/_profiler/9e097b",
    "method": "GET"
}

Stack Trace

ArgumentCountError
ArgumentCountError:
Too few arguments to function App\Form\LoginFormType::__construct(), 0 passed in /home/ubuntu/work/mossleigh/var/cache/dev/ContainerJDxM9Sl/getLoginFormTypeService.php on line 25 and exactly 1 expected

  at src/Form/LoginFormType.php:17
  at App\Form\LoginFormType->__construct()
     (var/cache/dev/ContainerJDxM9Sl/getLoginFormTypeService.php:25)
  at ContainerJDxM9Sl\getLoginFormTypeService::do()
     (var/cache/dev/ContainerJDxM9Sl/App_KernelDevDebugContainer.php:567)
  at ContainerJDxM9Sl\App_KernelDevDebugContainer->load()
     (vendor/symfony/dependency-injection/Container.php:404)
  at Symfony\Component\DependencyInjection\Container->getService()
     (vendor/symfony/dependency-injection/Argument/ServiceLocator.php:36)
  at Symfony\Component\DependencyInjection\Argument\ServiceLocator->get()
     (vendor/symfony/form/Extension/DependencyInjection/DependencyInjectionExtension.php:43)
  at Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension->getType()
     (vendor/symfony/form/FormRegistry.php:64)
  at Symfony\Component\Form\FormRegistry->getType()
     (vendor/symfony/form/FormFactory.php:53)
  at Symfony\Component\Form\FormFactory->createBuilder()
     (vendor/symfony/form/FormFactory.php:32)
  at Symfony\Component\Form\FormFactory->create()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:356)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createForm()
     (src/Controller/SecurityController.php:39)
  at App\Controller\SecurityController->login()
     (vendor/symfony/http-kernel/HttpKernel.php:188)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:143)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/home/ubuntu/work/mossleigh/vendor/autoload_runtime.php')
     (public/index.php:5)