Merge branch '3.4' into 4.0

* 3.4:
  Improve the documentation of `Finder::exclude()`
  [DI] Skip resource tracking if disabled
  [WebProfilerBundle] fix wrong variable for profiler counting ajax requests
This commit is contained in:
Fabien Potencier 2018-03-05 10:28:26 -08:00
commit fa8455aba6
2 changed files with 7 additions and 1 deletions

View File

@ -326,9 +326,11 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
try {
if (isset($this->classReflectors[$class])) {
$classReflector = $this->classReflectors[$class];
} else {
} elseif ($this->trackResources) {
$resource = new ClassExistenceResource($class, false);
$classReflector = $resource->isFresh(0) ? false : new \ReflectionClass($class);
} else {
$classReflector = new \ReflectionClass($class);
}
} catch (\ReflectionException $e) {
if ($throw) {

View File

@ -297,6 +297,10 @@ class Finder implements \IteratorAggregate, \Countable
/**
* Excludes directories.
*
* Directories passed as argument must be relative to the ones defined with the `in()` method. For example:
*
* $finder->in(__DIR__)->exclude('ruby');
*
* @param string|array $dirs A directory path or an array of directories
*
* @return $this