Permalink
Browse files

* extends BaseDumper, implements interface

 * put $keys into BaseDumper
  • Loading branch information...
1 parent 8a9a988 commit a2dcf30200d1fe8061d4f4d943bc671fd63b6020 @till committed Jun 15, 2012
Showing with 4 additions and 19 deletions.
  1. +4 −19 src/Composer/Package/Dumper/ArrayDumper.php
@@ -12,34 +12,19 @@
namespace Composer\Package\Dumper;
+use Composer\Package\Dumper\BaseDumper;
+use Composer\Package\Dumper\DumperInterface;
use Composer\Package\BasePackage;
use Composer\Package\PackageInterface;
/**
* @author Konstantin Kudryashiv <ever.zet@gmail.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
-class ArrayDumper
+class ArrayDumper extends BaseDumper implements DumperInterface
{
public function dump(PackageInterface $package)
{
- $keys = array(
- 'binaries' => 'bin',
- 'scripts',
- 'type',
- 'extra',
- 'installationSource' => 'installation-source',
- 'license',
- 'authors',
- 'description',
- 'homepage',
- 'keywords',
- 'autoload',
- 'repositories',
- 'includePaths' => 'include-path',
- 'support',
- );
-
$data = array();
$data['name'] = $package->getPrettyName();
$data['version'] = $package->getPrettyVersion();
@@ -78,7 +63,7 @@ public function dump(PackageInterface $package)
$data['suggest'] = $packages;
}
- foreach ($keys as $method => $key) {
+ foreach (self::$keys as $method => $key) {
if (is_numeric($method)) {
$method = $key;
}

0 comments on commit a2dcf30

Please sign in to comment.