Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpFoundation][HttpKernel] Add missing void PHPdoc return types #49599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 282 additions & 2 deletions .github/expected-missing-return-types.diff

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public function registerBundles(): iterable
}
}

/**
* @return void
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(function (ContainerBuilder $container) use ($loader) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getLogDir(): string
return sys_get_temp_dir().'/'.$this->varDir.'/'.$this->testCase.'/logs';
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
foreach ($this->rootConfig as $config) {
$loader->load($config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function registerBundles(): iterable
return [new TwigBundle()];
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(static function (ContainerBuilder $container) {
$container->register('error_renderer.html', HtmlErrorRenderer::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function registerBundles(): iterable
return [new FrameworkBundle(), new TwigBundle()];
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(function (ContainerBuilder $container) {
$container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public function get(string $name, mixed $default = null): mixed;

/**
* Sets an attribute.
*
* @return void
*/
public function set(string $name, mixed $value);

Expand All @@ -42,6 +44,9 @@ public function set(string $name, mixed $value);
*/
public function all(): array;

/**
* @return void
*/
public function replace(array $attributes);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ interface FlashBagInterface extends SessionBagInterface
{
/**
* Adds a flash message for the given type.
*
* @return void
*/
public function add(string $type, mixed $message);

/**
* Registers one or more messages for a given type.
*
* @return void
*/
public function set(string $type, string|array $messages);

Expand Down Expand Up @@ -57,6 +61,8 @@ public function all(): array;

/**
* Sets all flash messages.
*
* @return void
*/
public function setAll(array $messages);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public function getName(): string;

/**
* Initializes the Bag.
*
* @return void
*/
public function initialize(array &$array);

Expand Down
14 changes: 14 additions & 0 deletions src/Symfony/Component/HttpFoundation/Session/SessionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public function getId(): string;

/**
* Sets the session ID.
*
* @return void
*/
public function setId(string $id);

Expand All @@ -44,6 +46,8 @@ public function getName(): string;

/**
* Sets the session name.
*
* @return void
*/
public function setName(string $name);

Expand Down Expand Up @@ -78,6 +82,8 @@ public function migrate(bool $destroy = false, int $lifetime = null): bool;
* This method is generally not required for real sessions as
* the session will be automatically saved at the end of
* code execution.
*
* @return void
*/
public function save();

Expand All @@ -93,6 +99,8 @@ public function get(string $name, mixed $default = null): mixed;

/**
* Sets an attribute.
*
* @return void
*/
public function set(string $name, mixed $value);

Expand All @@ -103,6 +111,8 @@ public function all(): array;

/**
* Sets attributes.
*
* @return void
*/
public function replace(array $attributes);

Expand All @@ -115,6 +125,8 @@ public function remove(string $name): mixed;

/**
* Clears all attributes.
*
* @return void
*/
public function clear();

Expand All @@ -125,6 +137,8 @@ public function isStarted(): bool;

/**
* Registers a SessionBagInterface with the session.
*
* @return void
*/
public function registerBag(SessionBagInterface $bag);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function getId(): string;

/**
* Sets the session ID.
*
* @return void
*/
public function setId(string $id);

Expand All @@ -50,6 +52,8 @@ public function getName(): string;

/**
* Sets the session name.
*
* @return void
*/
public function setName(string $name);

Expand Down Expand Up @@ -90,13 +94,17 @@ public function regenerate(bool $destroy = false, int $lifetime = null): bool;
* a real PHP session would interfere with testing, in which case
* it should actually persist the session data if required.
*
* @return void
*
* @throws \RuntimeException if the session is saved without being started, or if the session
* is already closed
*/
public function save();

/**
* Clear all session data in memory.
*
* @return void
*/
public function clear();

Expand All @@ -109,6 +117,8 @@ public function getBag(string $name): SessionBagInterface;

/**
* Registers a SessionBagInterface for use.
*
* @return void
*/
public function registerBag(SessionBagInterface $bag);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface CacheClearerInterface
{
/**
* Clears any caches necessary.
*
* @return void
*/
public function clear(string $cacheDir);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ interface ResponseCacheStrategyInterface
{
/**
* Adds a Response.
*
* @return void
*/
public function add(Response $response);

/**
* Updates the Response HTTP headers based on the embedded Responses.
*
* @return void
*/
public function update(Response $response);
}
4 changes: 4 additions & 0 deletions src/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function write(Request $request, Response $response): string;

/**
* Invalidates all cache entries that match the request.
*
* @return void
*/
public function invalidate(Request $request);

Expand Down Expand Up @@ -74,6 +76,8 @@ public function purge(string $url): bool;

/**
* Cleanups storage.
*
* @return void
*/
public function cleanup();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ public function hasSurrogateCapability(Request $request): bool;

/**
* Adds Surrogate-capability to the given Request.
*
* @return void
*/
public function addSurrogateCapability(Request $request);

/**
* Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.
*
* This method only adds an Surrogate HTTP header if the Response has some Surrogate tags.
*
* @return void
*/
public function addSurrogateControl(Response $response);

Expand Down
6 changes: 6 additions & 0 deletions src/Symfony/Component/HttpKernel/KernelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,24 @@ public function registerBundles(): iterable;

/**
* Loads the container configuration.
*
* @return void
*/
public function registerContainerConfiguration(LoaderInterface $loader);

/**
* Boots the current kernel.
*
* @return void
*/
public function boot();

/**
* Shutdowns the kernel.
*
* This method is mainly useful when doing functional testing.
*
* @return void
*/
public function shutdown();

Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function countErrors(Request $request = null);

/**
* Removes all log records.
*
* @return void
*/
public function clear();
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function write(Profile $profile): bool;

/**
* Purges all data from the database.
*
* @return void
*/
public function purge();
}
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/RebootableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface RebootableInterface
* while building the container. Use the %kernel.build_dir% parameter instead.
*
* @param string|null $warmupDir pass null to reboot in the regular build directory
*
* @return void
*/
public function reboot(?string $warmupDir);
}
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/TerminableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ interface TerminableInterface
* Terminates a request/response cycle.
*
* Should be called after sending the response and before shutting down the kernel.
*
* @return void
*/
public function terminate(Request $request, Response $response);
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function getBundles(): array
return [];
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/Tests/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getLogs($level = false): array
return false === $level ? $this->logs : $this->logs[$level];
}

public function clear()
public function clear(): void
{
$this->logs = [
'emergency' => [],
Expand Down