public function __construct(array $tools) { foreach ($tools as $tool) { if (!$tool instanceof ToolInterface) { throw new InvalidToolInterfaceException($tool); } } $this->tools = $tools; }