10000 Merge branch '4.3' into 4.4 · symfony/symfony@47fd08e · GitHub
[go: up one dir, main page]

Skip to content

Commit 47fd08e

Browse files
Merge branch '4.3' into 4.4
* 4.3: Add missed use class for Symfony\Bundle\FrameworkBundle\Test\WebTestCase::$client [HttpClient] Minor fix in an error message Fix parameter documentation for Inflector::pluralize() method Use a more appropriate group when deprecating mode bumped Symfony version to 4.3.1 updated VERSION for 4.3.0 updated CHANGELOG for 4.3.0 [FrameworkBundle] fix test fixture using deprecated controller and add missing deprecation [FrameworkBundle] Add a validation on the messenger section
2 parents 1203290 + 3392186 commit 47fd08e

File tree

10 files changed

+48
-10
lines changed

10 files changed

+48
-10
lines changed

CHANGELOG-4.3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ in 4.3 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.3.0...v4.3.1
99

10+
* 4.3.0 (2019-05-30)
11+
12+
* bug #31654 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping (vilius-g)
13+
1014
* 4.3.0-RC1 (2019-05-28)
1115

1216
* bug #31650 Create an abstract HTTP transport and extend it in all HTTP transports (bocharsky-bw)

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ private function getConfiguration()
228228
return $this->configuration = Configuration::inWeakMode();
229229
}
230230
if (self::MODE_WEAK_VENDORS === $mode) {
231-
++$this->deprecations['remaining selfCount'];
231+
++$this->deprecations['remaining directCount'];
232232
$msg = sprintf('Setting SYMFONY_DEPRECATIONS_HELPER to "%s" is deprecated in favor of "max[self]=0"', $mode);
233-
$ref = &$this->deprecations['remaining self'][$msg]['count'];
233+
$ref = &$this->deprecations['remaining direct'][$msg]['count'];
234234
++$ref;
235235
$mode = 'max[self]=0';
236236
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,10 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode)
11101110
->{!class_exists(FullStack::class) && interface_exists(MessageBusInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
11111111
->fixXmlConfig('transport')
11121112
->fixXmlConfig('bus', 'buses')
1113+
->validate()
1114+
->ifTrue(function ($v) { return isset($v['buses']) && \count($v['buses']) > 1 && null === $v['default_bus']; })
1115+
->thenInvalid('You must specify the "default_bus" if you define more than one bus.')
1116+
->end()
11131117
->children()
11141118
->arrayNode('routing')
11151119
->useAttributeAsKey('message_class')

src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public function onKernelRequest(GetResponseEvent $event)
3737
$controller = $event->getRequest()->attributes->get('_controller');
3838
if (\is_string($controller) && false === strpos($controller, '::') && 2 === substr_count($controller, ':')) {
3939
// controller in the a:b:c notation then
40-
$event->getRequest()->attributes->set('_controller', $this->parser->parse($controller, false));
40+
$event->getRequest()->attributes->set('_controller', $parsedNotation = $this->parser->parse($controller, false));
41+
42+
@trigger_error(sprintf('Referencing controllers with %s is deprecated since Symfony 4.1, use "%s" instead.', $controller, $parsedNotation), E_USER_DEPRECATED);
4143
}
4244
}
4345

src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class WebTestCase extends KernelTestCase
2323
{
2424
use WebTestAssertionsTrait;
2525

26-
/** @var Client|null */
26+
/** @var KernelBrowser|null */
27 B41A 27
protected static $client;
2828

2929
protected function doTearDown(): void

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,31 @@ public function provideInvalidAssetConfigurationTests()
188188
yield [$createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.'];
189189
}
190190

191+
public function testItShowANiceMessageIfTwoMessengerBusesAreConfiguredButNoDefaultBus()
192+
{
193+
$expectedMessage = 'You must specify the "default_bus" if you define more than one bus.';
194+
if (method_exists($this, 'expectException')) {
195+
$this->expectException(InvalidConfigurationException::class);
196+
$this->expectExceptionMessage($expectedMessage);
197+
} else {
198+
$this->setExpectedException(InvalidConfigurationException::class, $expectedMessage);
199+
}
200+
$processor = new Processor();
201+
$configuration = new Configuration(true);
202+
203+
$processor->processConfiguration($configuration, [
204+
'framework' => [
205+
'messenger' => [
206+
'default_bus' => null,
207+
'buses' => [
208+
'first_bus' => [],
209+
'second_bus' => [],
210+
],
211+
],
212+
],
213+
]);
214+
}
215+
191216
protected static function getBundleDefaultConfig()
192217
{
193218
return [

src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/ResolveControllerNameSubscriberTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
class ResolveControllerNameSubscriberTest extends TestCase
2222
{
23+
/**
24+
* @group legacy
25+
*/
2326
public function testReplacesControllerAttribute()
2427
{
2528
$parser = $this->getMockBuilder(ControllerNameParser::class)->disableOriginalConstructor()->getMock();
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{{ render(controller('TestBundle:Fragment:inlined', {'options': {'bar': bar, 'eleven': 11}})) }}
1+
{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::inlinedAction', {'options': {'bar': bar, 'eleven': 11}})) }}
22
--
3-
{{ render(controller('TestBundle:Fragment:customformat', {'_format': 'html'})) }}
3+
{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customformatAction', {'_format': 'html'})) }}
44
--
5-
{{ render(controller('TestBundle:Fragment:customlocale', {'_locale': 'es'})) }}
5+
{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customlocaleAction', {'_locale': 'es'})) }}
66
--
7-
{{ app.request.setLocale('fr') }}{{ render(controller('TestBundle:Fragment:forwardlocale')) -}}
7+
{{ app.request.setLocale('fr') }}{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::forwardlocaleAction')) -}}

src/Symfony/Component/HttpClient/Response/CurlResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private static function perform(CurlClientState $multi, array &$responses = null
260260

261261
while ($info = curl_multi_info_read($multi->handle)) {
262262
$multi->handlesActivity[(int) $info['handle']][] = null;
263-
$multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(sprintf('%s for"%s".', curl_strerror($info['result']), curl_getinfo($info['handle'], CURLINFO_EFFECTIVE_URL)));
263+
$multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(sprintf('%s for "%s".', curl_strerror($info['result']), curl_getinfo($info['handle'], CURLINFO_EFFECTIVE_URL)));
264264
}
265265
} finally {
266266
self::$performing = false;

src/Symfony/Component/Inflector/Inflector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public static function singularize(string $plural)
410410
* If the method can't determine the form with certainty, an array of the
411411
* possible plurals is returned.
412412
*
413-
* @param string $singular A word in plural form
413+
* @param string $singular A word in singular form
414414
*
415415
* @return string|array The plural form or an array of possible plural forms
416416
*/

0 commit comments

Comments
 (0)
0