Skip to content

Commit d557250

Browse files
authored
Merge pull request #17 from derhasi/12-deprecation-notice
Fix deprecation notice
2 parents 351d9e4 + 0008aa2 commit d557250

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

src/Plugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Composer\EventDispatcher\EventSubscriberInterface;
1515
use Composer\IO\IOInterface;
1616
use Composer\Plugin\PluginInterface;
17-
use Composer\Script\PackageEvent;
17+
use Composer\Installer\PackageEvent;
1818
use Composer\Script\ScriptEvents;
1919
use Composer\Util\Filesystem;
2020

@@ -55,7 +55,7 @@ public static function getSubscribedEvents()
5555
/**
5656
* Pre Package event behaviour for backing up preserved paths.
5757
*
58-
* @param \Composer\Script\PackageEvent $event
58+
* @param \Composer\Installer\PackageEvent $event
5959
*/
6060
public function prePackage(PackageEvent $event)
6161
{
@@ -66,7 +66,7 @@ public function prePackage(PackageEvent $event)
6666
/**
6767
* Pre Package event behaviour for backing up preserved paths.
6868
*
69-
* @param \Composer\Script\PackageEvent $event
69+
* @param \Composer\Installer\PackageEvent $event
7070
*/
7171
public function postPackage(PackageEvent $event)
7272
{

src/PluginWrapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Composer\EventDispatcher\EventSubscriberInterface;
1515
use Composer\IO\IOInterface;
1616
use Composer\Plugin\PluginInterface;
17-
use Composer\Script\PackageEvent;
17+
use Composer\Installer\PackageEvent;
1818
use Composer\Script\ScriptEvents;
1919
use Composer\Util\Filesystem;
2020

@@ -57,7 +57,7 @@ public function __construct(Composer $composer, IOInterface $io)
5757
/**
5858
* Pre Package event behaviour for backing up preserved paths.
5959
*
60-
* @param \Composer\Script\PackageEvent $event
60+
* @param \Composer\Installer\PackageEvent $event
6161
*/
6262
public function prePackage(PackageEvent $event)
6363
{
@@ -82,7 +82,7 @@ public function prePackage(PackageEvent $event)
8282
/**
8383
* Pre Package event behaviour for backing up preserved paths.
8484
*
85-
* @param \Composer\Script\PackageEvent $event
85+
* @param \Composer\Installer\PackageEvent $event
8686
*/
8787
public function postPackage(PackageEvent $event)
8888
{
@@ -100,7 +100,7 @@ public function postPackage(PackageEvent $event)
100100
* In the case of update, the target package is retrieved, as that will
101101
* provide the path the package will be installed to.
102102
*
103-
* @param \Composer\Script\PackageEvent $event
103+
* @param \Composer\Installer\PackageEvent $event
104104
* @return \Composer\Package\PackageInterface[]
105105
* @throws \Exception
106106
*/

tests/FixturesTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ public function testFixtures($folder, $commands = array(), $files = array())
5858
// the latest code.
5959
$this->composer('config', 'repositories.dev', 'path', $this->projectRoot);
6060

61-
$this->composer('install');
61+
$output = $this->composer('install');
62+
63+
// Check for deprecation notices.
64+
$this->assertDeprecationNotice($output);
6265

6366
// Run additional composer commands.
6467
foreach ($commands as $command) {
@@ -123,4 +126,15 @@ protected function composer($command)
123126

124127
return $output;
125128
}
129+
130+
/**
131+
* Check lines for not having any deprecation notice.
132+
* @param string[] $lines
133+
*/
134+
protected function assertDeprecationNotice($lines)
135+
{
136+
foreach ($lines as $line) {
137+
$this->assertNotContains('Deprecation Notice:', $line);
138+
}
139+
}
126140
}

0 commit comments

Comments
 (0)