original_string: public function getServiceNamesByType($types, $only_active = false)
      {
          $names = [];
          $map = $this->getServiceNameTypeMap($only_active);
          if (is_string($types)) {
              $types = array_map('trim', explode(',', trim($types, ',')));
          }
          foreach ($map as $name => $type) {
              if (false !== array_search($type, $types)) {
                  $names[] = $name;
              }
          }
  
          return $names;
      }
code: public function getServiceNamesByType($types, $only_active = false)
      {
          $names = [];
          $map = $this->getServiceNameTypeMap($only_active);
          if (is_string($types)) {
              $types = array_map('trim', explode(',', trim($types, ',')));
          }
          foreach ($map as $name => $type) {
              if (false !== array_search($type, $types)) {
                  $names[] = $name;
              }
          }
  
          return $names;
      }
code_tokens: public function getServiceNamesByType ( $ types , $ only_active = false ) { $ names = [ ] ; $ map = $ this -> getServiceNameTypeMap ( $ only_active ) ; if ( is_string ( $ types ) ) { $ types = array_map ( 'trim' , explode ( ',' , trim ( $ types , ',' ) ) ) ; } foreach ( $ map as $ name => $ type ) { if ( false !== array_search ( $ type , $ types ) ) { $ names [ ] = $ name ; } } return $ names ; }
docstring: Return all of the created service names by type.
  
  @param string|array $types
  @param bool         $only_active
  
  @return array
docstring_tokens: Return all of the created service names by type .