1 | <?php |
||
17 | class Plugin implements |
||
18 | CPlugin\PluginInterface, |
||
19 | EventDispatcher\EventSubscriberInterface |
||
20 | { |
||
21 | /** @var IO\IOInterface */ |
||
22 | private $io; |
||
23 | |||
24 | /** @var Composer\Config */ |
||
25 | private $config; |
||
26 | |||
27 | /** @var array */ |
||
28 | private $package; |
||
29 | private $cached = false; |
||
30 | |||
31 | /** @var boolean */ |
||
32 | private $disabled = false; |
||
33 | |||
34 | private static $pluginClasses = array( |
||
35 | 'BaseRequest', |
||
36 | 'ConfigFacade', |
||
37 | 'CopyRequest', |
||
38 | 'CurlMulti', |
||
39 | 'CurlRemoteFilesystem', |
||
40 | 'FetchException', |
||
41 | 'FetchRequest', |
||
42 | 'FileDownloaderDummy', |
||
43 | 'ParallelizedComposerRepository', |
||
44 | 'Plugin', |
||
45 | 'Prefetcher', |
||
46 | 'Share', |
||
47 | ); |
||
48 | |||
49 | 2 | public function activate(Composer $composer, IO\IOInterface $io) |
|
68 | |||
69 | 1 | public static function getSubscribedEvents() |
|
79 | |||
80 | /** |
||
81 | * Keep-Alived file downloader |
||
82 | */ |
||
83 | public function onPreFileDownload(CPlugin\PreFileDownloadEvent $ev) |
||
84 | { |
||
85 | if ($this->disabled) { |
||
86 | return; |
||
87 | } |
||
88 | $rfs = $ev->getRemoteFilesystem(); |
||
89 | $curlrfs = new CurlRemoteFilesystem( |
||
90 | $this->io, |
||
91 | $this->config, |
||
92 | $rfs->getOptions() |
||
93 | ); |
||
94 | $ev->setRemoteFilesystem($curlrfs); |
||
95 | } |
||
96 | |||
97 | public function onPreDependenciesSolving(Installer\InstallerEvent $ev) |
||
98 | { |
||
99 | if ($this->disabled) { |
||
100 | return; |
||
101 | } |
||
102 | if ($this->cached) { |
||
103 | return; |
||
104 | } |
||
105 | $repos = $this->package->getRepositories(); |
||
106 | if (isset($repos['packagist']['type']) && $repos['packagist']['type'] === 'composer') { |
||
107 | $repo = new ParallelizedComposerRepository($repos['packagist'], $this->io, $this->config); |
||
108 | $repo->prefetch(); |
||
109 | $this->cached = true; |
||
110 | } |
||
111 | } |
||
112 | |||
113 | /** |
||
114 | * pre-fetch parallel by curl_multi |
||
115 | */ |
||
116 | 1 | public function onPostDependenciesSolving(Installer\InstallerEvent $ev) |
|
117 | { |
||
118 | 1 | if ($this->disabled) { |
|
119 | 1 | return; |
|
120 | } |
||
121 | 1 | $prefetcher = new Prefetcher; |
|
122 | 1 | $prefetcher->fetchAllFromOperations( |
|
123 | 1 | $this->io, |
|
124 | 1 | $this->config, |
|
125 | 1 | $ev->getOperations() |
|
126 | 1 | ); |
|
127 | 1 | } |
|
128 | |||
129 | 1 | public function disable() |
|
133 | |||
134 | 1 | public function isDisabled() |
|
138 | } |
||
139 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..