Skip to content

Commit

Permalink
formatting and method name change
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 6, 2020
1 parent 0459c4b commit 9b73540
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Illuminate/Foundation/PackageManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,36 @@ public function __construct(Filesystem $files, $basePath, $manifestPath)
}

/**
* Get all of the $name values for all packages.
* Get all of the service provider class names for all packages.
*
* @param string $name
* @return array
*/
public function getRegisteredExtra($name)
public function providers()
{
return collect($this->getManifest())->flatMap(function ($configuration) use ($name) {
return (array) ($configuration[$name] ?? []);
})->filter()->all();
return $this->config('providers');
}

/**
* Get all of the service provider class names for all packages.
* Get all of the aliases for all packages.
*
* @return array
*/
public function providers()
public function aliases()
{
return $this->getRegisteredExtra('providers');
return $this->config('aliases');
}

/**
* Get all of the aliases for all packages.
* Get all of the values for all packages for the given configuration name.
*
* @param string $key
* @return array
*/
public function aliases()
public function config($key)
{
return $this->getRegisteredExtra('aliases');
return collect($this->getManifest())->flatMap(function ($configuration) use ($key) {
return (array) ($configuration[$key] ?? []);
})->filter()->all();
}

/**
Expand Down

0 comments on commit 9b73540

Please sign in to comment.