From b92107302f4bb41ef40a14404e65df385ace7b0d Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Thu, 7 May 2026 14:53:31 +0200 Subject: [PATCH] Revert "Backport CMS features" --- composer.json | 2 +- src/PreloadManager.php | 8 +- src/PreloadManagerInterface.php | 100 ------------------ tests/EventListener/PreloadSubscriberTest.php | 4 - 4 files changed, 4 insertions(+), 110 deletions(-) delete mode 100644 src/PreloadManagerInterface.php diff --git a/composer.json b/composer.json index bdee0ef..69a5c66 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "require": { "php": "^8.3.0", "fig/link-util": "^1.0", - "psr/link": "^1.1|^2.0" + "psr/link": "^2.0" }, "require-dev": { "joomla/application": "^4.0", diff --git a/src/PreloadManager.php b/src/PreloadManager.php index 1b89bf1..979efa9 100644 --- a/src/PreloadManager.php +++ b/src/PreloadManager.php @@ -18,7 +18,7 @@ * * @since 2.0.0 */ -class PreloadManager implements PreloadManagerInterface +class PreloadManager { /** * The link provider @@ -57,15 +57,13 @@ public function getLinkProvider(): EvolvableLinkProviderInterface * * @param EvolvableLinkProviderInterface $linkProvider The link provider * - * @return $this + * @return void * * @since 2.0.0 */ - public function setLinkProvider(EvolvableLinkProviderInterface $linkProvider): self + public function setLinkProvider(EvolvableLinkProviderInterface $linkProvider): void { $this->linkProvider = $linkProvider; - - return $this; } /** diff --git a/src/PreloadManagerInterface.php b/src/PreloadManagerInterface.php deleted file mode 100644 index db20a4d..0000000 --- a/src/PreloadManagerInterface.php +++ /dev/null @@ -1,100 +0,0 @@ - true)", "array('crossorigin' => 'use-credentials')") - * - * @return void - * - * @since 4.1.0 - */ - public function preload(string $uri, array $attributes = []); - - /** - * Resolves a resource origin as early as possible. - * - * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") - * - * @return void - * - * @since 4.1.0 - */ - public function dnsPrefetch(string $uri, array $attributes = []); - - /** - * Initiates an early connection to a resource (DNS resolution, TCP handshake, TLS negotiation). - * - * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") - * - * @return void - * - * @since 4.1.0 - */ - public function preconnect(string $uri, array $attributes = []); - - /** - * Indicates to the client that it should prefetch this resource. - * - * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") - * - * @return void - * - * @since 4.1.0 - */ - public function prefetch(string $uri, array $attributes = []); - - /** - * Indicates to the client that it should prerender this resource. - * - * @param string $uri A public path - * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") - * - * @return void - * - * @since 4.1.0 - */ - public function prerender(string $uri, array $attributes = []); -} diff --git a/tests/EventListener/PreloadSubscriberTest.php b/tests/EventListener/PreloadSubscriberTest.php index 8a63b34..05003b3 100644 --- a/tests/EventListener/PreloadSubscriberTest.php +++ b/tests/EventListener/PreloadSubscriberTest.php @@ -12,7 +12,6 @@ use Joomla\Application\Event\ApplicationEvent; use Joomla\Preload\EventListener\PreloadSubscriber; use Joomla\Preload\PreloadManager; -use Laminas\Diactoros\Response; use PHPUnit\Framework\TestCase; use Psr\Link\EvolvableLinkProviderInterface; @@ -58,9 +57,6 @@ public function testAddHeaderToApplication() * @since 1.0 */ class TestAbstractWebApplication extends AbstractWebApplication { - public function __construct() { - $this->setResponse(new Response()); - } protected function doExecute() { // TODO: Implement doExecute() method.