Skip to content

Commit

Permalink
Merge pull request #449 from php-http/1-to-2
Browse files Browse the repository at this point in the history
1 to 2
  • Loading branch information
dbu committed Feb 27, 2024
2 parents 710ae3a + 8987784 commit 78a66e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,10 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee

# Version 1

# 1.33.0 - 2024-02-27

- Support php-http/cache-plugin 2.0 and bump minimal version to 1.7 by defaulting the stream factory for cache to `httplug.psr17_stream_factory` (#448).

# 1.32.0 - 2023-12-06

- Added support for Symfony 7
Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -43,6 +43,7 @@
},
"conflict": {
"php-http/guzzle6-adapter": "<1.1",
"php-http/cache-plugin": "<1.7.0",
"php-http/curl-client": "<2.0",
"php-http/socket-client": "<2.0",
"kriswallsmith/buzz": "<0.17",
Expand Down
6 changes: 3 additions & 3 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -13,8 +13,8 @@
use Http\Client\Plugin\Vcr\Recorder\RecorderInterface;
use Http\Message\CookieJar;
use Http\Message\Formatter;
use Http\Message\StreamFactory;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
Expand Down Expand Up @@ -739,7 +739,7 @@ private function createCachePluginNode(): NodeDefinition
// Cannot set both respect_cache_headers and respect_response_cache_directives
return isset($config['respect_cache_headers'], $config['respect_response_cache_directives']);
})
->thenInvalid('You can\'t provide config option "respect_cache_headers" and "respect_response_cache_directives" simultaniously. Use "respect_response_cache_directives" instead.')
->thenInvalid('You can\'t provide config option "respect_cache_headers" and "respect_response_cache_directives" simultaneously. Use "respect_response_cache_directives" instead.')
->end()
->children()
->scalarNode('cache_key_generator')
Expand Down Expand Up @@ -851,7 +851,7 @@ private function createCachePluginNode(): NodeDefinition
->cannotBeEmpty()
->end()
->scalarNode('stream_factory')
->info('This must be a service id to a service implementing '.StreamFactory::class)
->info('This must be a service id to a service implementing '.StreamFactoryInterface::class)
->defaultValue('httplug.psr17_stream_factory')
->cannotBeEmpty()
->end()
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/DependencyInjection/ConfigurationTest.php
Expand Up @@ -348,7 +348,7 @@ public function testInvalidCacheConfig(): void
$file = __DIR__.'/../../Resources/Fixtures/config/invalid_cache_config.yml';

$this->expectException(InvalidConfigurationException::class);
$this->expectExceptionMessage('Invalid configuration for path "httplug.plugins.cache.config": You can\'t provide config option "respect_cache_headers" and "respect_response_cache_directives" simultaniously. Use "respect_response_cache_directives" instead.');
$this->expectExceptionMessage('Invalid configuration for path "httplug.plugins.cache.config": You can\'t provide config option "respect_cache_headers" and "respect_response_cache_directives" simultaneously. Use "respect_response_cache_directives" instead.');
$this->assertProcessedConfigurationEquals([], [$file]);
}

Expand Down

0 comments on commit 78a66e0

Please sign in to comment.