MethodArgumentValueNotImplementedException.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Locale\Exception;
  11. use Symfony\Component\Locale\Exception\NotImplementedException;
  12. /**
  13. * @author Eriksen Costa <eriksen.costa@infranology.com.br>
  14. */
  15. class MethodArgumentValueNotImplementedException extends NotImplementedException
  16. {
  17. /**
  18. * Constructor
  19. *
  20. * @param string $methodName The method name that raised the exception
  21. * @param string $argName The argument name
  22. * @param string $argValue The argument value that is not implemented
  23. * @param string $additionalMessage An optional additional message to append to the exception message
  24. */
  25. public function __construct($methodName, $argName, $argValue, $additionalMessage = '')
  26. {
  27. $message = sprintf(
  28. 'The %s() method\'s argument $%s value %s behavior is not implemented.%s',
  29. $methodName,
  30. $argName,
  31. var_export($argValue, true),
  32. $additionalMessage !== '' ? ' '.$additionalMessage.'. ' : ''
  33. );
  34. parent::__construct($message);
  35. }
  36. }