You are here

private function NetlifyManager::filterByBranch in Build Hooks 3.x

Same name and namespace in other branches
  1. 8.2 modules/build_hooks_netlify/src/NetlifyManager.php \Drupal\build_hooks_netlify\NetlifyManager::filterByBranch()

Simple callback to filter an array by the branch property.

Parameters

string $branch: The branch to filter for.

Return value

\Closure Closure to be used in array_filter.

1 call to NetlifyManager::filterByBranch()
NetlifyManager::retrieveLatestBuildsFromNetlifyForEnvironment in modules/build_hooks_netlify/src/NetlifyManager.php
Get the latest builds from netlify for and environment.

File

modules/build_hooks_netlify/src/NetlifyManager.php, line 120

Class

NetlifyManager
Defines a manager service for netlify deployments.

Namespace

Drupal\build_hooks_netlify

Code

private function filterByBranch($branch) {
  return function ($item) use ($branch) {
    return $item['branch'] == $branch;
  };
}