]> git.mxchange.org Git - friendica-addons.git/blob
1b366c599f28fbe5f34ba68568a31d5b036686ce
[friendica-addons.git] /
1 <?php
2
3 /*
4  * This file is part of the Fxp Composer Asset Plugin package.
5  *
6  * (c) François Pluchino <francois.pluchino@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
12 namespace Fxp\Composer\AssetPlugin\Tests\Fixtures\Repository\Vcs;
13
14 use Composer\Config;
15 use Composer\IO\IOInterface;
16 use Composer\Repository\Vcs\VcsDriverInterface;
17
18 /**
19  * Mock vcs driver.
20  *
21  * @author François Pluchino <francois.pluchino@gmail.com>
22  */
23 class MockVcsDriver implements VcsDriverInterface
24 {
25     /**
26      * @var bool
27      */
28     public static $supported = true;
29
30     /**
31      * @var mixed
32      */
33     public $contents = null;
34
35     /**
36      * {@inheritdoc}
37      */
38     public function initialize()
39     {
40         // no action
41     }
42
43     /**
44      * {@inheritdoc}
45      */
46     public function getComposerInformation($identifier)
47     {
48         return;
49     }
50
51     /**
52      * {@inheritdoc}
53      */
54     public function getRootIdentifier()
55     {
56         return;
57     }
58
59     /**
60      * {@inheritdoc}
61      */
62     public function getBranches()
63     {
64         return array();
65     }
66
67     /**
68      * {@inheritdoc}
69      */
70     public function getTags()
71     {
72         return array();
73     }
74
75     /**
76      * {@inheritdoc}
77      */
78     public function getDist($identifier)
79     {
80         return;
81     }
82
83     /**
84      * {@inheritdoc}
85      */
86     public function getSource($identifier)
87     {
88         return;
89     }
90
91     /**
92      * {@inheritdoc}
93      */
94     public function getUrl()
95     {
96         return;
97     }
98
99     /**
100      * {@inheritdoc}
101      */
102     public function hasComposerFile($identifier)
103     {
104         return false;
105     }
106
107     /**
108      * {@inheritdoc}
109      */
110     public function cleanup()
111     {
112         // no action
113     }
114
115     /**
116      * {@inheritdoc}
117      */
118     public static function supports(IOInterface $io, Config $config, $url, $deep = false)
119     {
120         return static::$supported;
121     }
122
123     /**
124      * @return mixed
125      */
126     protected function getContents()
127     {
128         return $this->contents;
129     }
130
131     /**
132      * {@inheritdoc}
133      */
134     public function getFileContent($file, $identifier)
135     {
136     }
137
138     /**
139      * {@inheritdoc}
140      */
141     public function getChangeDate($identifier)
142     {
143         return new \DateTime();
144     }
145 }