<?php
	namespace Bolt;

	use Bolt\Interfaces\Adapter;
	use Bolt\Interfaces\Connection;

	abstract class Repository extends Base
	{
		protected Adapter $adapter;

		public function __construct(Connection $connection = null, $data = null)
		{
			$this->adapter($connection);

			if ($data !== null)
			{
				parent::__construct($data);
			}
		}

		public function adapter(Connection $connection = null)
		{
			if ($connection !== null)
			{
				$className = $this->className(false);
				$className = "App\\Adapters\\Repositories\\" . $className . "\\" . $connection->className(false);

				$this->adapter = new $className($connection, $this);

				return $this;
			}

			return $this->adapter;
		}

		public function __call($name, $args)
		{
			return $this->adapter->{$name}($args);
		}
	}
?>

<?php
	namespace Bolt;

	use Bolt\Interfaces\Connection;

	abstract class Repository extends Base
	{
		protected ?Adapter $adapter = null;

		public function __construct(Connection $connection = null, $data = null)
		{
			$this->adapter($connection);

			if ($data !== null)
			{
				parent::__construct($data);
			}
		}

		public function adapter(Connection $connection = null)
		{
			if ($connection !== null)
			{
				$className = $this->className(false);
				$className = "App\\Adapters\\Repositories\\" . $className . "\\" . $connection->className(false);

				$this->adapter = new $className($connection, $this);

				return $this;
			}

			return $this->adapter;
		}

		public function __call($name, $args)
		{
			return $this->adapter->{$name}($args);
		}
	}
?>

Correct adapter type to allow nullable
Correct adapter type to allow nullable
