code: private function filterMatchingDefinitions(array $definitions, $objectType)
      {
          return array_filter($definitions, function (Definition $definition) use ($objectType) {
              return strtolower($definition->getObjectType()) === strtolower($objectType) || null === $objectType;
          });
      }
docs: @param Definition[] $definitions
  @param null|string  $objectType
  
  @return Definition[]