blob: 78ce9392bfede5732929dd1c96b609f390ff7fc2 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3/**
4 * This file is part of the Carbon package.
5 *
6 * (c) Brian Nesbitt <brian@nesbot.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11namespace Carbon\Exceptions;
12
13use Carbon\CarbonInterface;
14use Exception;
15use InvalidArgumentException as BaseInvalidArgumentException;
16
17class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException
18{
19 /**
20 * Constructor.
21 *
22 * @param string $className
23 * @param int $code
24 * @param Exception|null $previous
25 */
26 public function __construct($className, $code = 0, Exception $previous = null)
27 {
28 parent::__construct(sprintf(
29 'Given class does not implement %s: %s',
30 CarbonInterface::class,
31 $className
32 ), $code, $previous);
33 }
34}