Browse Source

Made getComposerFile static.

Beau Simensen 12 years ago
parent
commit
8d1d060d66
2 changed files with 3 additions and 4 deletions
  1. 1 2
      src/Composer/Command/RequireCommand.php
  2. 2 2
      src/Composer/Factory.php

+ 1 - 2
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('<error>'.$file.' not found.</error>');

+ 2 - 2
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)) {