Overview

Namespaces

  • Charcoal
    • Factory

Classes

  • AbstractFactory
  • GenericFactory
  • GenericResolver
  • MapFactory
  • ResolverFactory

Interfaces

  • FactoryInterface
  • Overview
  • Namespace
  • Class

Class ResolverFactory

The Resolver Factory resolves the class name by different configurably methods applied to the type.

Charcoal\Factory\AbstractFactory implements Charcoal\Factory\FactoryInterface
Extended by Charcoal\Factory\ResolverFactory
Namespace: Charcoal\Factory
Located at Charcoal/Factory/ResolverFactory.php
Methods summary
public
# __construct( array $data = null )

Parameters

$data
Factory arguments.

Overrides

Charcoal\Factory\AbstractFactory::__construct()
public Charcoal\Factory\ResolverFactory
# setResolverPrefix( string $prefix )

Parameters

$prefix
The resolver prefix string.

Returns

Charcoal\Factory\ResolverFactory
Chainable

Throws

InvalidArgumentException
If the prefix argument is not a string.
public string
# resolverPrefix( )

Returns

string
public Charcoal\Factory\ResolverFactory
# setResolverSuffix( string $suffix )

Parameters

$suffix
The resolver suffix string.

Returns

Charcoal\Factory\ResolverFactory
Chainable

Throws

InvalidArgumentException
If the suffix argument is not a string.
public string
# resolverSuffix( )

Returns

string
public Charcoal\Factory\ResolverFactory
# setResolverCapitals( array $capitals )

Parameters

$capitals
The array of letter to "calitalize-next" (uppercase next letter in the string).

Returns

Charcoal\Factory\ResolverFactory
Chainable
public array
# resolverCapitals( )

Returns

array
public Charcoal\Factory\ResolverFactory
# setResolverReplacements( array $replacements )

Parameters

$replacements
The array (key=>value) of replacements.

Returns

Charcoal\Factory\ResolverFactory
Chainable
public array
# resolverReplacements( )

Returns

array
public string
# resolve( string $type )

Resolve the class name from the requested type.

Resolve the class name from the requested type.

Parameters

$type
The "type" of object to resolve (the object ident).

Returns

string
The resolved class name (FQN).

Throws

InvalidArgumentException
If the type parameter is not a string.

Overrides

Charcoal\Factory\AbstractFactory::resolve()
public boolean
# isResolvable( string $type )

Parameters

$type
The "type" of object to resolve (the object ident).

Returns

boolean

Throws

InvalidArgumentException
If the type parameter is not a string.

Overrides

Charcoal\Factory\AbstractFactory::isResolvable()
Methods inherited from Charcoal\Factory\AbstractFactory
addClassToMap(), arguments(), baseClass(), callback(), create(), createClass(), defaultClass(), get(), map(), resolver(), setArguments(), setBaseClass(), setCallback(), setDefaultClass()
Properties inherited from Charcoal\Factory\AbstractFactory
$resolved
API documentation generated by ApiGen