Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
NoTransform
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 getInstance
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
 apply
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MobileFrontend\Transforms;
4
5use DOMElement;
6
7class NoTransform implements IMobileTransform {
8
9    /** @var self */
10    private static $instance;
11
12    /**
13     * Returns a static instance of NoTransform class.
14     *
15     * Note: There's no need in many instances of this class as it does nothing.
16     * So it's a common pre-optimization to make such classes as singleton, what's
17     * rather a matter of convenience than real optimization.
18     *
19     * @return self
20     */
21    public static function getInstance(): self {
22        if ( self::$instance === null ) {
23            self::$instance = new self();
24        }
25        return self::$instance;
26    }
27
28    /**
29     * Does nothing.
30     * @param DOMElement $node to be transformed
31     */
32    public function apply( DOMElement $node ) {
33        // nothing happens
34    }
35}