private function getSnippet($location, $callback, $extensionName = 'core', $callbackArguments = []) { $snippet = (new Snippet())->setLocation($location)->setCallback($callback)->setCallbackArguments($callbackArguments); return $snippet; }