Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container::call() now supports invokable class names #192

Merged
merged 2 commits into from Sep 27, 2014
Merged

Conversation

@mnapoli
Copy link
Member

@mnapoli mnapoli commented Sep 27, 2014

Container::call() supports callable objects:

class Foo {
    public function __invoke() {
    }
}

$container->call(new Foo);

This pull request adds support for providing the class name as string: $container->call('Foo');.

The object will be created using $container->get() before being invoked. For example:

$container->call('Foo');

// is the same as
$container->call(
    $container->get('Foo')
);

This feature adds consistency for Container::call() with #185 and #173. Now Container::call() can call anything and it's awesome.

I have also included tests for the definition dumpers.

…ntiate it using Container::get()
@mnapoli mnapoli added this to the 4.4 milestone Sep 27, 2014
@mnapoli mnapoli added the enhancement label Sep 27, 2014
@mnapoli mnapoli self-assigned this Sep 27, 2014
mnapoli added a commit that referenced this pull request Sep 27, 2014
Container::call() now supports invokable class names
@mnapoli mnapoli merged commit b966785 into 4.4 Sep 27, 2014
0 of 2 checks passed
0 of 2 checks passed
ci/scrutinizer Scrutinizer: No new issues — Tests: pending
Details
continuous-integration/travis-ci The Travis CI build is in progress
Details
@mnapoli mnapoli deleted the feature/callable-class branch Sep 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.