xref: /dokuwiki/inc/Parsing/Handler/ReWriterInterface.php (revision 533aca443d11c7850d99ed088b80c85fdff14be3)
1be906b56SAndreas Gohr<?php
2be906b56SAndreas Gohr
3be906b56SAndreas Gohrnamespace dokuwiki\Parsing\Handler;
4be906b56SAndreas Gohr
5be906b56SAndreas Gohr/**
6be906b56SAndreas Gohr * A ReWriter takes over from the orignal call writer and handles all new calls itself until
7be906b56SAndreas Gohr * the process method is called and control is given back to the original writer.
8*533aca44SAndreas Gohr *
9*533aca44SAndreas Gohr * @property array[] $calls The list of current calls
10be906b56SAndreas Gohr */
11be906b56SAndreas Gohrinterface ReWriterInterface extends CallWriterInterface
12be906b56SAndreas Gohr{
13be906b56SAndreas Gohr    /**
14be906b56SAndreas Gohr     * ReWriterInterface constructor.
15be906b56SAndreas Gohr     *
16be906b56SAndreas Gohr     * This rewriter will be registered as the new call writer in the Handler.
17be906b56SAndreas Gohr     * The original is passed as parameter
18be906b56SAndreas Gohr     *
19be906b56SAndreas Gohr     * @param CallWriterInterface $callWriter the original callwriter
20be906b56SAndreas Gohr     */
21be906b56SAndreas Gohr    public function __construct(CallWriterInterface $callWriter);
22be906b56SAndreas Gohr
23be906b56SAndreas Gohr    /**
24be906b56SAndreas Gohr     * Process any calls that have been added and add them to the
25be906b56SAndreas Gohr     * original call writer
26be906b56SAndreas Gohr     *
27be906b56SAndreas Gohr     * @return CallWriterInterface the orignal call writer
28be906b56SAndreas Gohr     */
29be906b56SAndreas Gohr    public function process();
30*533aca44SAndreas Gohr
31*533aca44SAndreas Gohr    /**
32*533aca44SAndreas Gohr     * Accessor for this rewriter's original CallWriter
33*533aca44SAndreas Gohr     *
34*533aca44SAndreas Gohr     * @return CallWriterInterface
35*533aca44SAndreas Gohr     */
36*533aca44SAndreas Gohr    public function getCallWriter();
37be906b56SAndreas Gohr}
38