1<?php
2
3/*
4 * This file is part of the Prophecy.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6 *     Marcello Duarte <marcello.duarte@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Prophecy\Doubler\ClassPatch;
13
14use Prophecy\Doubler\Generator\Node\ClassNode;
15
16/**
17 * Class patch interface.
18 * Class patches extend doubles functionality or help
19 * Prophecy to avoid some internal PHP bugs.
20 *
21 * @author Konstantin Kudryashov <ever.zet@gmail.com>
22 */
23interface ClassPatchInterface
24{
25    /**
26     * Checks if patch supports specific class node.
27     *
28     * @param ClassNode $node
29     *
30     * @return bool
31     */
32    public function supports(ClassNode $node);
33
34    /**
35     * Applies patch to the specific class node.
36     *
37     * @param ClassNode $node
38     * @return void
39     */
40    public function apply(ClassNode $node);
41
42    /**
43     * Returns patch priority, which determines when patch will be applied.
44     *
45     * @return int Priority number (higher - earlier)
46     */
47    public function getPriority();
48}
49