Enforce return types on all components

This commit is contained in:
Nicolas Grekas
2025-06-04 18:31:05 +02:00
parent 6b69b27868
commit dcfe49b62f
6 changed files with 14 additions and 46 deletions

View File

@@ -31,27 +31,19 @@ abstract class Bundle implements BundleInterface
private string $namespace;
/**
* @return void
*/
public function boot()
public function boot(): void
{
}
/**
* @return void
*/
public function shutdown()
public function shutdown(): void
{
}
/**
* This method can be overridden to register compilation passes,
* other extensions, ...
*
* @return void
*/
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
}
@@ -118,10 +110,7 @@ abstract class Bundle implements BundleInterface
return $this->name;
}
/**
* @return void
*/
public function registerCommands(Application $application)
public function registerCommands(Application $application): void
{
}

View File

@@ -24,26 +24,20 @@ interface BundleInterface
{
/**
* Boots the Bundle.
*
* @return void
*/
public function boot();
public function boot(): void;
/**
* Shutdowns the Bundle.
*
* @return void
*/
public function shutdown();
public function shutdown(): void;
/**
* Builds the bundle.
*
* It is only ever called once when the cache is empty.
*
* @return void
*/
public function build(ContainerBuilder $container);
public function build(ContainerBuilder $container): void;
/**
* Returns the container extension that should be implicitly loaded.

View File

@@ -107,10 +107,7 @@ abstract class DataCollector implements DataCollectorInterface
{
}
/**
* @return void
*/
public function reset()
public function reset(): void
{
$this->data = [];
}

View File

@@ -24,15 +24,11 @@ interface DataCollectorInterface extends ResetInterface
{
/**
* Collects data for the given Request and Response.
*
* @return void
*/
public function collect(Request $request, Response $response, ?\Throwable $exception = null);
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void;
/**
* Returns the name of the collector.
*
* @return string
*/
public function getName();
public function getName(): string;
}

View File

@@ -20,8 +20,6 @@ interface LateDataCollectorInterface
{
/**
* Collects data as late as possible.
*
* @return void
*/
public function lateCollect();
public function lateCollect(): void;
}

View File

@@ -33,26 +33,20 @@ interface KernelInterface extends HttpKernelInterface
/**
* Loads the container configuration.
*
* @return void
*/
public function registerContainerConfiguration(LoaderInterface $loader);
public function registerContainerConfiguration(LoaderInterface $loader): void;
/**
* Boots the current kernel.
*
* @return void
*/
public function boot();
public function boot(): void;
/**
* Shutdowns the kernel.
*
* This method is mainly useful when doing functional testing.
*
* @return void
*/
public function shutdown();
public function shutdown(): void;
/**
* Gets the registered bundle instances.