blob: 2b4c48e320a272da1a1b988c636580f3bc1574b2 [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 */
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010011
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020012namespace Carbon\Exceptions;
13
14use Carbon\CarbonInterface;
15use Exception;
16use InvalidArgumentException as BaseInvalidArgumentException;
17
18class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException
19{
20 /**
21 * Constructor.
22 *
23 * @param string $className
24 * @param int $code
25 * @param Exception|null $previous
26 */
27 public function __construct($className, $code = 0, Exception $previous = null)
28 {
29 parent::__construct(sprintf(
30 'Given class does not implement %s: %s',
31 CarbonInterface::class,
32 $className
33 ), $code, $previous);
34 }
35}