Skip to content

Commit 1036bce

Browse files
author
Robin Chalas
committed
Merge branch '4.4' into 5.0
* 4.4: (38 commits) reset the kernel cache after each test [HttpKernel] Ability to define multiple kernel.reset tags [Routing] Continue supporting single colon in object route loaders [FWBundle] Remove unused parameter [Intl] [Workflow] fixes English grammar typos [Filesystem] [Serializer] fixes English grammar typo mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport has_roles should be is_granted in upgrade files [HttpClient] Fix early cleanup of pushed HTTP/2 responses skip test on incompatible PHP versions [HttpKernel] Don't cache "not-fresh" state [FrameworkBundle][Cache] Don't deep-merge cache pools configuration [Messenger] Adding exception to amqp transport in case amqp ext is not installed [SecurityBundle] Don't require a user provider for the anonymous listener [Monolog Bridge] Fixed accessing static property as non static. Improve Symfony description [Mailer] Add UPGRADE entries about Envelope and MessageEvent [FrameworkBundle] fix leftover mentioning "secret:" processor Add DateTimeZoneNormalizer into Dependency Injection [Messenger] Error when specified default bus is not among the configured ...
2 parents 5d67bc1 + 6d701c4 commit 1036bce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Loader/ObjectLoader.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ abstract protected function getObject(string $id);
4242
*/
4343
public function load($resource, string $type = null)
4444
{
45-
if (!preg_match('/^[^\:]+(?:::(?:[^\:]+))?$/', $resource)) {
45+
if (!preg_match('/^[^\:]+(?:::?(?:[^\:]+))?$/', $resource)) {
4646
throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the %s route loader: use the format "object_id::method" or "object_id" if your object class has an "__invoke" method.', $resource, \is_string($type) ? '"'.$type.'"' : 'object'));
4747
}
4848

49+
if (1 === substr_count($resource, ':')) {
50+
$resource = str_replace(':', '::', $resource);
51+
@trigger_error(sprintf('Referencing object route loaders with a single colon is deprecated since Symfony 4.1. Use %s instead.', $resource), E_USER_DEPRECATED);
52+
}
53+
4954
$parts = explode('::', $resource);
5055
$method = $parts[1] ?? '__invoke';
5156

0 commit comments

Comments
 (0)