PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.5.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.5.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Dom / Contracts / Modifier.php

Modifier.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.5.0, at src/Performance/Dom/Contracts/Modifier.php

44 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The pipeline dom modifier stage contract.
4 *
5 * Each modifier should implement this interface.
6 *
7 * @package SolidWP\Performance
8 */
9
10 declare( strict_types=1 );
11
12 namespace SolidWP\Performance\Dom\Contracts;
13
14 use Closure;
15 use SolidWP\Performance\Symfony\Component\DomCrawler\Crawler;
16
17 /**
18 * @internal
19 */
20 interface Modifier {
21
22 /**
23 * Should immediately return true if this pipeline stage is enabled, otherwise
24 * pass the current $enabled value to the next stage.
25 *
26 * @param bool $enabled Whether the previous stage is enabled.
27 * @param Closure $next The closure passed to the next stage.
28 *
29 * @return bool
30 */
31 public function enabled( bool $enabled, Closure $next ): bool;
32
33 /**
34 * Handle modifying the HTML and passing it to the next stage of the pipeline,
35 * assuming it's enabled.
36 *
37 * @param Crawler $crawler The symfony dom crawler instance.
38 * @param Closure $next The closure passed to the next stage.
39 *
40 * @return Crawler
41 */
42 public function modify( Crawler $crawler, Closure $next ): Crawler;
43 }
44