@param string|Closure $class
@param string|Closure $transformer

@return $this
195822
public function bind($class, $transformer = null)
	{
		if(!$transformer) {
			return $this->autoBind($class);
		}

		$this->binds[$class] = $transformer;

		return $this;
	}
337767
public function resolveTransformer()
    {
        if (is_string($this->resolver)) {
            return $this->container->make($this->resolver);
        } elseif (is_callable($this->resolver)) {
            return call_user_func($this->resolver, $this->container);
        } elseif (is_object($this->resolver)) {
            return $this->resolver;
        }

        throw new RuntimeException('Unable to resolve transformer binding.');
    }
123340
public function itemWith($entity, $transformer, $key = null): TransformationFactory
	{
		$this->entity      = $entity;
		$this->transformer = $transformer;
		$this->resource    = new Item($entity, $transformer, $key);

		return $this;
	}
1028300
protected function transform($instance, string $transformer, ?string $serializer = null, array $options = [])
    {
        if (\is_null($serializer)) {
            $serializer = $transformer;
        }

        return $this->serializeWith(
            $this->transformWith($instance, $transformer, $options),
            $serializer,
            $options
        );
    }
76617
public function defineInlineOperator(string $operator, callable $transformer)
    {
        unset($this->operators[$operator]);
        $this->inlineOperators[$operator] = $transformer;
    }
882023
public static <T extends Transformer<?>> TransformerBeanDescriptor<T> ofTransformer(Class<T> transformerClass) {
        return new AnnotationBasedTransformerBeanDescriptor<T>(transformerClass);
    }
239164
public function setTranslator($class) {
        if (is_string($class)) {
            $this->_translator = new $class;
        } else {
            $this->_translator = $class;
        }
        if (!is_a($this->_translator, '\\mpf\\interfaces\\TranslatorInterface')) {
            $this->_translator = null;
            throw new Exception("Invalid translator $class!  Must implement \\mpf\\interfaces\\TranslatorInterface!");
        }
        $this->translator = $class;
    }
1210016
public function setClass($id, $class)
    {
        $this->classes[$id] = $class;
        if (isset($this->items[$id])) {
            unset($this->items[$id]);
        }
        $this->allCreated = false;
        return $this;
    }
1266438
public function addGenerator($generatorClass, $suffix, \Closure $factory = null)
    {
        $this->generators[] = new GeneratorWrapper($this->createGeneratorFactory($generatorClass, $factory), $suffix);
        return $this;
    }
644718
private function createGeneratorFactory($generatorClass, \Closure $factory = null)
    {
        return function ($sourceClass, $prefixClass) use ($factory, $generatorClass) {
            if ($factory) {
                return $factory($sourceClass, $prefixClass, $this->generationIo, $this->definedClasses, $generatorClass);
            }

            return new $generatorClass($sourceClass, $prefixClass, $this->generationIo, null, $this->definedClasses);
        };
    }
860407
protected function getBinding($class)
    {
        if ($this->isCollection($class) && ! $class->isEmpty()) {
            return $this->getBindingFromCollection($class);
        }

        $class = is_object($class) ? get_class($class) : $class;

        if (! $this->hasBinding($class)) {
            throw new RuntimeException('Unable to find bound transformer for "'.$class.'" class.');
        }

        return $this->bindings[$class];
    }
352844
final public function set(string $id, string $class = null): ServiceConfigurator
    {
        $this->__destruct();

        return $this->parent->set($id, $class);
    }
211900
public function removeClass($class)
    {
        $index = array_search((string) $class, $this->class);
        if ($index !== false) {
            unset($this->class[$index]);
        }
        return $this;
    }
449356
protected function resolve($class)
    {
        if (isset($this->container)) {
            $instance = $this->container->make($class);

            $instance->setContainer($this->container);
        } else {
            $instance = new $class;
        }

        if (isset($this->command)) {
            $instance->setCommand($this->command);
        }

        return $instance;
    }
365281
public function removeClass($class)
    {
        $classes = $this->get('class');
        if ($classes) {
            $classes = trim(preg_replace('/(^| ){1}' . $class . '( |$){1}/i', ' ', $classes));
            $this->set('class', $classes);
        }

        return $this;
    }
191264
public function item($item, $transformer, $parameters = [], Closure $after = null)
    {
        $class = get_class($item);

        if ($parameters instanceof \Closure) {
            $after = $parameters;
            $parameters = [];
        }

        $binding = $this->transformer->register($class, $transformer, $parameters, $after);

        return new Response($item, 200, [], $binding);
    }
635846
public function setTransformer($transformer = null)
    {
        if (!$this->resource) {
            throw new MissingResourceException('Resource must be specified before setting a transformer');
        }
        $this->resource->setTransformer($transformer);

        return $this;
    }