diff --git a/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestBundle.php b/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestBundle.php index 75819f4..c9baa25 100644 --- a/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestBundle.php +++ b/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestBundle.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\locale_test\LocaleTestBundle. + * Contains \Drupal\locale_test\LocaleTestBundle. * * This is a workaround to make sure the 'Last-Modified' HTTP header is not * overridden by FinishResponseSubscriber. 'Last-Modified' is set when a remote @@ -21,11 +21,12 @@ class LocaleTestBundle extends Bundle { /** - * Overrides Symfony\Component\HttpKernel\Bundle\Bundle::build(). + * {@inheritdoc} */ public function build(ContainerBuilder $container) { // Register our response subscriber to handle finished responses. $container->register('locale_test_finish_response_subscriber', 'Drupal\locale_test\LocaleTestFinishResponseSubscriber') ->addTag('event_subscriber'); } + } diff --git a/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestFinishResponseSubscriber.php b/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestFinishResponseSubscriber.php index b9b4a7e..74b6cb6 100644 --- a/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestFinishResponseSubscriber.php +++ b/core/modules/locale/tests/modules/locale_test/lib/Drupal/locale_test/LocaleTestFinishResponseSubscriber.php @@ -2,17 +2,18 @@ /** * @file - * Definition of Drupal\locale_test\LocaleTestFinishResponseSubscriber. + * Contains of \Drupal\locale_test\LocaleTestFinishResponseSubscriber. * * This is a workaround to make sure the 'Last-Modified' HTTP header is not * overridden by FinishResponseSubscriber. 'Last-Modified' is set when a remote * translation file is served via a menu callback. So this is a new event * subscriber which saves the value and sets it back. - * It does so with the saveLastModified() method which has a very high priority, - * so it can save the defined header really early in a class property. Then - * later on the setLastModified() method can set the header again using the - * value from this property, since it has a very low priority, it can manipulate - * the header after FinishResponseSubscriber has done its changes. + * + * This uses the saveLastModified() method which has a very high priority, so it + * can save the defined header really early in a class property. Then later on + * the setLastModified() method can set the header again using the value from + * this property, which has a very low priority, so it can manipulate the header + * after FinishResponseSubscriber has done its changes. */ namespace Drupal\locale_test; @@ -26,6 +27,11 @@ */ class LocaleTestFinishResponseSubscriber implements EventSubscriberInterface { + /** + * The 'Last-Modified' HTTP header. + * + * @var string + */ public $lastModified; /** @@ -42,6 +48,9 @@ public static function getSubscribedEvents() { /** * Saves the 'Last-Modified' HTTP header in a class property. + * + * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event + * The event where a translation file was served. */ public function saveLastModified(FilterResponseEvent $event) { $this->lastModified = $event->getResponse()->headers->get('Last-Modified'); @@ -49,10 +58,14 @@ public function saveLastModified(FilterResponseEvent $event) { /** * Sets the 'Last-Modified' HTTP header to the response. + * + * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event + * The event where a translation file was served. */ public function setLastModified(FilterResponseEvent $event) { if (!empty($this->lastModified)) { $event->getResponse()->headers->set('Last-Modified', $this->lastModified); } } + } diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.info.yml b/core/modules/locale/tests/modules/locale_test/locale_test.info.yml index 73cf050..8490e1a 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.info.yml +++ b/core/modules/locale/tests/modules/locale_test/locale_test.info.yml @@ -7,4 +7,4 @@ hidden: true 'interface translation project': locale_test 'interface translation server pattern': core/modules/locale/test/test.%language.po dependencies: - - locale \ No newline at end of file + - locale diff --git a/core/modules/locale/tests/modules/locale_test_contrib_one/locale_test_contrib_one.info.yml b/core/modules/locale/tests/modules/locale_test_contrib_one/locale_test_contrib_one.info.yml index 73cf050..8490e1a 100644 --- a/core/modules/locale/tests/modules/locale_test_contrib_one/locale_test_contrib_one.info.yml +++ b/core/modules/locale/tests/modules/locale_test_contrib_one/locale_test_contrib_one.info.yml @@ -7,4 +7,4 @@ hidden: true 'interface translation project': locale_test 'interface translation server pattern': core/modules/locale/test/test.%language.po dependencies: - - locale \ No newline at end of file + - locale