for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace MichaelRubel\EnhancedContainer\Core;
class Forwarding
{
public const CONTAINER_KEY = '_forwarding';
/**
* @var string
*/
public string $pendingClass;
* Initialize the forwarding.
*
* @return self
public static function enable(): self
return new self();
}
* @param string $class
* @return $this
public function from(string $class): static
$this->pendingClass = $class;
return $this;
* @param string $destination
public function to(string $destination): static
app()->singleton($this->pendingClass . static::CONTAINER_KEY, $destination);