From 8d1d060d66353033b5aec0d644a8dff4c8dd0784 Mon Sep 17 00:00:00 2001 From: Beau Simensen Date: Sun, 2 Dec 2012 16:24:39 -0800 Subject: [PATCH] Made getComposerFile static. --- src/Composer/Command/RequireCommand.php | 3 +-- src/Composer/Factory.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 42cf64d54..b67d087d0 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -51,8 +51,7 @@ EOT protected function execute(InputInterface $input, OutputInterface $output) { - $factory = new Factory; - $file = $factory->getComposerFile(); + $file = Factory::getComposerFile(); if (!file_exists($file)) { $output->writeln(''.$file.' not found.'); diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 65f2dd526..2ab506a9c 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -113,7 +113,7 @@ class Factory return $config; } - public function getComposerFile() + public static function getComposerFile() { return getenv('COMPOSER') ?: 'composer.json'; } @@ -171,7 +171,7 @@ class Factory { // load Composer configuration if (null === $localConfig) { - $localConfig = $this->getComposerFile(); + $localConfig = static::getComposerFile(); } if (is_string($localConfig)) {