Skip to content

Commit

Permalink
Apply inflectors before object return
Browse files Browse the repository at this point in the history
  • Loading branch information
philipobenito committed Sep 2, 2015
1 parent b94bf78 commit 627a29e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,21 @@ public function __construct(
public function get($alias, array $args = [])
{
if ($this->hasShared($alias)) {
return $this->shared[$alias];
return $this->inflectors->inflect($this->shared[$alias]);
}

if ($this->providers->provides($alias)) {
$this->providers->register($alias);
}

if (array_key_exists($alias, $this->definitions)) {
return $this->definitions[$alias]->build($args);
return $this->inflectors->inflect(
$this->definitions[$alias]->build($args)
);
}

if ($resolved = $this->getFromDelegate($alias, $args)) {
return $resolved;
return $this->inflectors->inflect($resolved);
}

throw new NotFoundException(
Expand Down

0 comments on commit 627a29e

Please sign in to comment.