"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

ArgumentMetadataFactory.php  (phplist-3.4.5.tgz):ArgumentMetadataFactory.php  (phplist-3.4.6.tgz)
skipping to change at line 70 skipping to change at line 70
foreach ($reflection->getParameters() as $param) { foreach ($reflection->getParameters() as $param) {
$arguments[] = new ArgumentMetadata($param->getName(), $this->getTyp e($param, $reflection), $this->isVariadic($param), $this->hasDefaultValue($param ), $this->getDefaultValue($param), $param->allowsNull()); $arguments[] = new ArgumentMetadata($param->getName(), $this->getTyp e($param, $reflection), $this->isVariadic($param), $this->hasDefaultValue($param ), $this->getDefaultValue($param), $param->allowsNull());
} }
return $arguments; return $arguments;
} }
/** /**
* Returns whether an argument is variadic. * Returns whether an argument is variadic.
* *
* @param \ReflectionParameter $parameter
*
* @return bool * @return bool
*/ */
private function isVariadic(\ReflectionParameter $parameter) private function isVariadic(\ReflectionParameter $parameter)
{ {
return $this->supportsVariadic && $parameter->isVariadic(); return $this->supportsVariadic && $parameter->isVariadic();
} }
/** /**
* Determines whether an argument has a default value. * Determines whether an argument has a default value.
* *
* @param \ReflectionParameter $parameter
*
* @return bool * @return bool
*/ */
private function hasDefaultValue(\ReflectionParameter $parameter) private function hasDefaultValue(\ReflectionParameter $parameter)
{ {
return $parameter->isDefaultValueAvailable(); return $parameter->isDefaultValueAvailable();
} }
/** /**
* Returns a default value if available. * Returns a default value if available.
* *
* @param \ReflectionParameter $parameter
*
* @return mixed|null * @return mixed|null
*/ */
private function getDefaultValue(\ReflectionParameter $parameter) private function getDefaultValue(\ReflectionParameter $parameter)
{ {
return $this->hasDefaultValue($parameter) ? $parameter->getDefaultValue( ) : null; return $this->hasDefaultValue($parameter) ? $parameter->getDefaultValue( ) : null;
} }
/** /**
* Returns an associated type to the given parameter if available. * Returns an associated type to the given parameter if available.
* *
* @param \ReflectionParameter $parameter
*
* @return string|null * @return string|null
*/ */
private function getType(\ReflectionParameter $parameter, \ReflectionFunctio nAbstract $function) private function getType(\ReflectionParameter $parameter, \ReflectionFunctio nAbstract $function)
{ {
if ($this->supportsParameterType) { if ($this->supportsParameterType) {
if (!$type = $parameter->getType()) { if (!$type = $parameter->getType()) {
return; return null;
} }
$name = $type instanceof \ReflectionNamedType ? $type->getName() : $ type->__toString(); $name = $type instanceof \ReflectionNamedType ? $type->getName() : $ type->__toString();
if ('array' === $name && !$type->isBuiltin()) { if ('array' === $name && !$type->isBuiltin()) {
// Special case for HHVM with variadics // Special case for HHVM with variadics
return; return null;
} }
} elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $par ameter, $name)) { } elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $par ameter, $name)) {
$name = $name[1]; $name = $name[1];
} else { } else {
return; return null;
} }
$lcName = strtolower($name); $lcName = strtolower($name);
if ('self' !== $lcName && 'parent' !== $lcName) { if ('self' !== $lcName && 'parent' !== $lcName) {
return $name; return $name;
} }
if (!$function instanceof \ReflectionMethod) { if (!$function instanceof \ReflectionMethod) {
return; return null;
} }
if ('self' === $lcName) { if ('self' === $lcName) {
return $function->getDeclaringClass()->name; return $function->getDeclaringClass()->name;
} }
if ($parent = $function->getDeclaringClass()->getParentClass()) { if ($parent = $function->getDeclaringClass()->getParentClass()) {
return $parent->name; return $parent->name;
} }
return null;
} }
} }
 End of changes. 9 change blocks. 
12 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)