original_string: public static function buildIndexClassesAndProperties($objectManager)
      {
          /** @var ReflectionService $reflectionService */
          $reflectionService = $objectManager->get(ReflectionService::class);
  
          $indexAnnotations = [];
  
          $annotationClassName = Indexable::class;
          foreach ($reflectionService->getClassNamesByAnnotation($annotationClassName) as $className) {
              if ($reflectionService->isClassAbstract($className)) {
                  throw new ElasticSearchException(sprintf('The class with name "%s" is annotated with %s, but is abstract. Indexable classes must not be abstract.', $className, $annotationClassName), 1339595182);
              }
              $indexAnnotations[$className]['annotation'] = $reflectionService->getClassAnnotation($className, $annotationClassName);
  
              // if no single properties are set to be indexed, consider all properties to be indexed.
              $annotatedProperties = $reflectionService->getPropertyNamesByAnnotation($className, $annotationClassName);
              if (!empty($annotatedProperties)) {
                  $indexAnnotations[$className]['properties'] = $annotatedProperties;
              } else {
                  foreach ($reflectionService->getClassPropertyNames($className) as $propertyName) {
                      $indexAnnotations[$className]['properties'][] = $propertyName;
                  }
              }
          }
  
          return $indexAnnotations;
      }
code: public static function buildIndexClassesAndProperties($objectManager)
      {
          /** @var ReflectionService $reflectionService */
          $reflectionService = $objectManager->get(ReflectionService::class);
  
          $indexAnnotations = [];
  
          $annotationClassName = Indexable::class;
          foreach ($reflectionService->getClassNamesByAnnotation($annotationClassName) as $className) {
              if ($reflectionService->isClassAbstract($className)) {
                  throw new ElasticSearchException(sprintf('The class with name "%s" is annotated with %s, but is abstract. Indexable classes must not be abstract.', $className, $annotationClassName), 1339595182);
              }
              $indexAnnotations[$className]['annotation'] = $reflectionService->getClassAnnotation($className, $annotationClassName);
  
              // if no single properties are set to be indexed, consider all properties to be indexed.
              $annotatedProperties = $reflectionService->getPropertyNamesByAnnotation($className, $annotationClassName);
              if (!empty($annotatedProperties)) {
                  $indexAnnotations[$className]['properties'] = $annotatedProperties;
              } else {
                  foreach ($reflectionService->getClassPropertyNames($className) as $propertyName) {
                      $indexAnnotations[$className]['properties'][] = $propertyName;
                  }
              }
          }
  
          return $indexAnnotations;
      }
code_tokens: public static function buildIndexClassesAndProperties ( $ objectManager ) { /** @var ReflectionService $reflectionService */ $ reflectionService = $ objectManager -> get ( ReflectionService :: class ) ; $ indexAnnotations = [ ] ; $ annotationClassName = Indexable :: class ; foreach ( $ reflectionService -> getClassNamesByAnnotation ( $ annotationClassName ) as $ className ) { if ( $ reflectionService -> isClassAbstract ( $ className ) ) { throw new ElasticSearchException ( sprintf ( 'The class with name "%s" is annotated with %s, but is abstract. Indexable classes must not be abstract.' , $ className , $ annotationClassName ) , 1339595182 ) ; } $ indexAnnotations [ $ className ] [ 'annotation' ] = $ reflectionService -> getClassAnnotation ( $ className , $ annotationClassName ) ; // if no single properties are set to be indexed, consider all properties to be indexed. $ annotatedProperties = $ reflectionService -> getPropertyNamesByAnnotation ( $ className , $ annotationClassName ) ; if ( ! empty ( $ annotatedProperties ) ) { $ indexAnnotations [ $ className ] [ 'properties' ] = $ annotatedProperties ; } else { foreach ( $ reflectionService -> getClassPropertyNames ( $ className ) as $ propertyName ) { $ indexAnnotations [ $ className ] [ 'properties' ] [ ] = $ propertyName ; } } } return $ indexAnnotations ; }
docstring: Creates the source array of what classes and properties have to be annotated.
  The returned array consists of class names, with a sub-key having both 'annotation' and 'properties' set.
  The annotation contains the class's annotation, while properties contains each property that has to be indexed.
  Each property might either have TRUE as value, or also an annotation instance, if given.
  
  @param ObjectManagerInterface $objectManager
  @return array
  @throws ElasticSearchException
docstring_tokens: Creates the source array of what classes and properties have to be annotated . The returned array consists of class names with a sub - key having both annotation and properties set . The annotation contains the class s annotation while properties contains each property that has to be indexed . Each property might either have TRUE as value or also an annotation instance if given .