Skip to content

Commit

Permalink
Merge pull request #8 from container-interop/move-interfaces
Browse files Browse the repository at this point in the history
Move MethodCallInterface and PropertyAssignmentInterface in a sub-namespace
  • Loading branch information
moufmouf committed Nov 27, 2015
2 parents 1fa12a3 + cbea540 commit bfc76e0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@
namespace Interop\Container\Definition;

/**
* Represents a factory that provides a container entry.
* Represents a call to a factory. The call returns the container entry.
*
* The factory instance is resolved from the container. That allows to
* The call can either be made:
*
* - on an object method, in which case the factory object is resolved from the container
* - on a static method of a class
*
* When the factory is resolved from the container (non static call), that allows to
* inject dependencies in the factory.
*
* The method to call should accept only one parameter (which can
* be omitted if unneeded): the name of the container entry that is
* being resolved. That allows to reuse a factory to create different
* container entries.
*/
interface FactoryDefinitionInterface extends DefinitionInterface
interface FactoryCallDefinitionInterface extends DefinitionInterface
{
/**
* Returns a reference to the container entry that will act as a factory or a fully qualified class name.
*
* If a fully qualified class name is passed, the method is called statically on the class, otherwise,
* the method is called on the target instance of the reference.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

namespace Interop\Container\Definition;

use Interop\Container\Definition\ObjectInitializer\MethodCallInterface;
use Interop\Container\Definition\ObjectInitializer\PropertyAssignmentInterface;

/**
* Represents an instance declared using the "new" keyword followed by an optional list of
* method calls and properties assignations.
* Represents a class instance.
*
* To create the object, arguments can be passed to its constructor, methods can be called
* and properties can be set.
*/
interface InstanceDefinitionInterface extends DefinitionInterface
interface ObjectDefinitionInterface extends DefinitionInterface
{
/**
* Returns the name of the class to instantiate.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Interop\Container\Definition;
namespace Interop\Container\Definition\ObjectInitializer;

/**
* Represents a call to a method.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php

namespace Interop\Container\Definition;
namespace Interop\Container\Definition\ObjectInitializer;

use Interop\Container\Definition\ReferenceInterface;

/**
* Represents an assignment of a property.
* Represents the assignment of a property.
*/
interface PropertyAssignmentInterface
{
/**
* Returns the name of the property.
* Returns the name of the property to set.
*
* @return string
*/
Expand Down

0 comments on commit bfc76e0

Please sign in to comment.