1<?php 2 3declare(strict_types=1); 4 5namespace Nyholm\Dsn\Exception; 6 7/** 8 * Thrown when the provided function is not supported. 9 * 10 * @author Tobias Nyholm <tobias.nyholm@gmail.com> 11 */ 12class FunctionNotSupportedException extends InvalidDsnException 13{ 14 /** 15 * @var string 16 */ 17 private $function; 18 19 public function __construct(string $dsn, string $function, ?string $message = null) 20 { 21 parent::__construct($dsn, $message ?? sprintf('Function "%s" is not supported', $function)); 22 $this->function = $function; 23 } 24 25 public function getFunction(): string 26 { 27 return $this->function; 28 } 29} 30