Module aims to simplify routines of collecting and modifying the data via module_invoke() and drupal_alter().

Example

use Drupal\pinmap\Searcher\SearcherInterface;
use Drupal\pinmap\Searcher\Coordinates;
use Drupal\pinmap\Searcher\Name;

/**
 * Implements hook_pinmap_searchers().
 */
function pinmap_pinmap_searchers() {
  $searchers = [];

  $searchers['coordinates'] = Coordinates::class;
  $searchers['name'] = Name::class;

  return $searchers;
}

/**
 * Implements hook_pinmap_searchers_alter().
 */
function pinmap_pinmap_searchers_alter(array &$searchers) {
  // This entry will be removed due to it incorrectness.
  $searchers['coordinates'] = 'Coordinates::class';
}

/**
 * Returns list of registered searchers.
 *
 * @return SearcherInterface[]
 *   List of registered searchers.
 */
function pinmap_searchers() {
  return service_collector(__FUNCTION__, function ($name, $class) {
    if (!is_subclass_of($class, SearcherInterface::class, TRUE)) {
      throw new \InvalidArgumentException(sprintf('Searcher "%s" must implement the "%s" interface', $class, SearcherInterface::class));
    }
  });
}
Supporting organizations: 

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Module categories: Developer Tools
  • chart icon1 site reports using this module
  • Created by BR0kEN on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    There are currently no supported stable releases.

Releases