Commit 0b292218 authored by Katherine Bailey's avatar Katherine Bailey
Browse files

Addressing some documentation and code style issues

parent 5d8b06a1
......@@ -218,8 +218,11 @@ function drupal_cache_system_paths() {
// after we have left the scope of the Request, the call to current_path()
// here does not return the system path, and instead calls out to
// _current_path(), which returns the alias. So the alias gets used as the
// key instead. There is a separate issue for fixing up the path alias logic
// here:
// key instead. At lookup time, whether the alias or the source is used as
// the key depends on when the first call to url() is made for that path.
// If this is within the request scope, it uses the system_path and so will
// be a cache miss. There is a separate issue for fixing up the path alias
// logic here:
// Generate a cache ID (cid) specifically for this page.
$cid = current_path();
......@@ -369,6 +372,8 @@ function current_path() {
if (drupal_container()->has('request')) {
return drupal_container()->get('request')->attributes->get('system_path');
// If we are outside the request scope, e.g. during $kernel->terminate, fall
// back to using the path stored in _current_path().
return _current_path();
......@@ -7,6 +7,7 @@
namespace Drupal\Core\DependencyInjection\Compiler;
use InvalidArgumentException;
use ReflectionClass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
......@@ -29,7 +30,7 @@ public function process(ContainerBuilder $container)
$refClass = new ReflectionClass($class);
$interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';
if (!$refClass->implementsInterface($interface)) {
throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
$definition->addMethodCall('addSubscriberService', array($id, $class));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment