Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
45 /** | 45 /** |
46 * {@inheritdoc} | 46 * {@inheritdoc} |
47 */ | 47 */ |
48 public function createArgumentMetadata($controller) | 48 public function createArgumentMetadata($controller) |
49 { | 49 { |
50 $arguments = array(); | 50 $arguments = []; |
51 | 51 |
52 if (is_array($controller)) { | 52 if (\is_array($controller)) { |
53 $reflection = new \ReflectionMethod($controller[0], $controller[1]); | 53 $reflection = new \ReflectionMethod($controller[0], $controller[1]); |
54 } elseif (is_object($controller) && !$controller instanceof \Closure) { | 54 } elseif (\is_object($controller) && !$controller instanceof \Closure) { |
55 $reflection = (new \ReflectionObject($controller))->getMethod('__invoke'); | 55 $reflection = (new \ReflectionObject($controller))->getMethod('__invoke'); |
56 } else { | 56 } else { |
57 $reflection = new \ReflectionFunction($controller); | 57 $reflection = new \ReflectionFunction($controller); |
58 } | 58 } |
59 | 59 |
103 /** | 103 /** |
104 * Returns an associated type to the given parameter if available. | 104 * Returns an associated type to the given parameter if available. |
105 * | 105 * |
106 * @param \ReflectionParameter $parameter | 106 * @param \ReflectionParameter $parameter |
107 * | 107 * |
108 * @return null|string | 108 * @return string|null |
109 */ | 109 */ |
110 private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function) | 110 private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function) |
111 { | 111 { |
112 if ($this->supportsParameterType) { | 112 if ($this->supportsParameterType) { |
113 if (!$type = $parameter->getType()) { | 113 if (!$type = $parameter->getType()) { |