Skip to content

Commit

Permalink
Do not override System instances if already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Aug 10, 2024
1 parent 32fb82c commit 275ac2e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `Slytherin` will be documented in this file.

## [0.9.9](https://github.com/rougin/slytherin/compare/v0.9.7...v0.9.8) - Unreleased

### Changed
- Do not override `System` implementations if already defined from `ContainerInterface`

## [0.9.8](https://github.com/rougin/slytherin/compare/v0.9.7...v0.9.8) - 2024-05-23

### Added
Expand Down
12 changes: 10 additions & 2 deletions src/Http/HttpIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,17 @@ protected function resolve(ContainerInterface $container, ServerRequestInterface
$request = ServerRequestFactory::fromGlobals();
}

$container->set(System::REQUEST, $request);
if (! $container->has(System::REQUEST))
{
$container->set(System::REQUEST, $request);
}

if (! $container->has(System::RESPONSE))
{
$container->set(System::RESPONSE, $response);
}

return $container->set(System::RESPONSE, $response);
return $container;
}

/**
Expand Down

0 comments on commit 275ac2e

Please sign in to comment.