public function remove($query, $language = 'glob')
{
$resources = $this->find($query, $language);
$nbOfResources = count($this->resources);
// Run the assertion after find(), so that we know that $query is valid
Assert::notEmpty(trim($query, '/'), 'The root directory cannot be removed.');
foreach ($resources as $resource) {
$this->removeResource($resource);
}
return $nbOfResources - count($this->resources);
}