Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/serializer/Mapping/Factory/ClassResolverTrait.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
31 * | 31 * |
32 * @throws InvalidArgumentException If the class does not exists | 32 * @throws InvalidArgumentException If the class does not exists |
33 */ | 33 */ |
34 private function getClass($value) | 34 private function getClass($value) |
35 { | 35 { |
36 if (is_string($value)) { | 36 if (\is_string($value)) { |
37 if (!class_exists($value) && !interface_exists($value)) { | 37 if (!class_exists($value) && !interface_exists($value)) { |
38 throw new InvalidArgumentException(sprintf('The class or interface "%s" does not exist.', $value)); | 38 throw new InvalidArgumentException(sprintf('The class or interface "%s" does not exist.', $value)); |
39 } | 39 } |
40 | 40 |
41 return ltrim($value, '\\'); | 41 return ltrim($value, '\\'); |
42 } | 42 } |
43 | 43 |
44 if (!is_object($value)) { | 44 if (!\is_object($value)) { |
45 throw new InvalidArgumentException(sprintf('Cannot create metadata for non-objects. Got: "%s"', gettype($value))); | 45 throw new InvalidArgumentException(sprintf('Cannot create metadata for non-objects. Got: "%s"', \gettype($value))); |
46 } | 46 } |
47 | 47 |
48 return get_class($value); | 48 return \get_class($value); |
49 } | 49 } |
50 } | 50 } |