Skip to content

Commit

Permalink
Merge branch '3.1' into 3.2
Browse files Browse the repository at this point in the history
* 3.1: (31 commits)
  fixed CS
  fixed CS
  fixed CS fixer config
  fixed typo
  Revert "fixed typo"
  fixed typo
  fixed CS
  Avoid setting request attributes from signature arguments in AnnotationClassLoader
  [DependencyInjection] Add some missing typehints in YamlFileLoader
  [DependencyInjection] minor: Fix a DocBlock
  [HttpKernel] Give higher priority to adding request formats
  [PropertyInfo] Don't try to access a property thru a static method
  [PropertyInfo] Exclude static methods form properties guessing
  [FrameworkBundle] Fix third level headers for MarkdownDescriptor
  [Ldap] Using Ldap stored username instead of form submitted one
  [Ldap] load users with the good username case
  [DoctrineBridge] Fixed invalid unique value as composite key
  [Doctrine Bridge] fix UniqueEntityValidator for composite object primary keys
  [TwigBundle] do not lose already set method calls
  #20411 fix Yaml parsing for very long quoted strings
  ...
  • Loading branch information
fabpot committed Jan 21, 2017
2 parents fda2c67 + f9cb2e6 commit 86a87a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 0 additions & 5 deletions Loader/AnnotationClassLoader.php
Expand Up @@ -138,11 +138,6 @@ protected function addRoute(RouteCollection $collection, $annot, $globals, \Refl
}

$defaults = array_replace($globals['defaults'], $annot->getDefaults());
foreach ($method->getParameters() as $param) {
if (!isset($defaults[$param->getName()]) && $param->isDefaultValueAvailable()) {
$defaults[$param->getName()] = $param->getDefaultValue();
}
}
$requirements = array_replace($globals['requirements'], $annot->getRequirements());
$options = array_replace($globals['options'], $annot->getOptions());
$schemes = array_merge($globals['schemes'], $annot->getSchemes());
Expand Down
7 changes: 3 additions & 4 deletions Tests/Loader/AnnotationClassLoaderTest.php
Expand Up @@ -136,11 +136,10 @@ public function testLoad($className, $routeData = array(), $methodArgs = array()
array_intersect_assoc($routeData['options'], $route->getOptions()),
'->load preserves options annotation'
);
$defaults = array_replace($methodArgs, $routeData['defaults']);
$this->assertCount(
count($defaults),
array_intersect_assoc($defaults, $route->getDefaults()),
'->load preserves defaults annotation and merges them with default arguments in method signature'
count($routeData['defaults']),
$route->getDefaults(),
'->load preserves defaults annotation'
);
$this->assertEquals($routeData['schemes'], $route->getSchemes(), '->load preserves schemes annotation');
$this->assertEquals($routeData['methods'], $route->getMethods(), '->load preserves methods annotation');
Expand Down

0 comments on commit 86a87a1

Please sign in to comment.