open-orchestra/open-orchestra-media-bundle

View on GitHub
Media/Exception/BadOptionException.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace OpenOrchestra\Media\Exception;

use Symfony\Component\HttpKernel\Exception\HttpException;

/**
 * Class BadOptionException
 */
class BadOptionException extends HttpException
{
    /**
     * BadOptionException constructor.
     *
     * @param string $badOption
     * @param array  $goodOptions
     * @param string $method
     */
    public function __construct($badOption, array $goodOptions, $method)
    {
        parent::__construct(500, 'The option \'' . $badOption . '\' is not valid in ' . $method . '.'
            . ' You can only use the following options: ' . implode(', ', $goodOptions));
    }
}