/vendor/phpunit/phpunit/src/Util/Type.php

https://bitbucket.org/alan_cordova/api-sb-map · PHP · 41 lines · 24 code · 1 blank · 16 comment · 0 complexity · 610380000205632370a3c71985faf2dc MD5 · raw file

  1. <?php
  2. /*
  3. * This file is part of PHPUnit.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Utility class for textual type (and value) representation.
  12. */
  13. class PHPUnit_Util_Type
  14. {
  15. /**
  16. * @param string $type
  17. *
  18. * @return bool
  19. */
  20. public static function isType($type)
  21. {
  22. return in_array(
  23. $type,
  24. [
  25. 'numeric',
  26. 'integer',
  27. 'int',
  28. 'float',
  29. 'string',
  30. 'boolean',
  31. 'bool',
  32. 'null',
  33. 'array',
  34. 'object',
  35. 'resource',
  36. 'scalar'
  37. ]
  38. );
  39. }
  40. }