_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q261600 | CacheMembers.cacheUnsetByRefPattern | test | protected function cacheUnsetByRefPattern(string $primary_key, string $ref_key_pattern)
{
if (empty($this->x___cache['x___refs'][$primary_key])) {
return; // Nothing to do here.
}
$ref_key_regex = // Allow `**` to indicate everything quickly.
$ref_key_pattern === '**'... | php | {
"resource": ""
} |
q261601 | MapTypeControlHelper.render | test | public function render(MapTypeControl $mapTypeControl)
{
$this->jsonBuilder->reset();
foreach ($mapTypeControl->getMapTypeIds() as $index => $mapTypeId) {
$this->jsonBuilder->setValue(
sprintf('[mapTypeIds][%d]', $index),
$this->mapTypeIdHelper->render($m... | php | {
"resource": ""
} |
q261602 | Escape.sq | test | public function sq($value)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->sq($_value);
} // unset($_key, $_value);
return $value;
}
return str_replace("'", "\\'", (string) $value);
... | php | {
"resource": ""
} |
q261603 | Escape.singleQuote | test | public function singleQuote($value, bool $maybe_use_sld = false)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->singleQuote($_value);
} // unset($_key, $_value);
return $value;
}
$str... | php | {
"resource": ""
} |
q261604 | Escape.doubleQuote | test | public function doubleQuote($value, bool $for_csv = false)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->doubleQuote($_value);
} // unset($_key, $_value);
return $value;
}
return '"'... | php | {
"resource": ""
} |
q261605 | MapTypeControlStyleHelper.render | test | public function render($mapTypeControlStyle)
{
switch ($mapTypeControlStyle) {
case MapTypeControlStyle::DEFAULT_:
case MapTypeControlStyle::DROPDOWN_MENU:
case MapTypeControlStyle::HORIZONTAL_BAR:
return sprintf('google.maps.MapTypeControlStyle.%s', strto... | php | {
"resource": ""
} |
q261606 | BusinessAccount.signUrl | test | public function signUrl($url)
{
$url .= sprintf('&client=gme-%s', $this->clientId);
if ($this->hasChannel()) {
$url .= sprintf('&channel=%s', $this->channel);
}
$urlParts = parse_url($url);
$data = sprintf('%s?%s', $urlParts['path'], $urlParts['query']);
... | php | {
"resource": ""
} |
q261607 | SearchTerms.getHighlighter | test | public function getHighlighter(string $q, array $args = []): Classes\Core\SearchTermHighlighter
{
return $this->App->Di->get(Classes\Core\SearchTermHighlighter::class, compact('q', 'args'));
} | php | {
"resource": ""
} |
q261608 | Sha1Mod.shardId | test | public function shardId(string $string, bool $is_sha1 = false, int $total_shards = 65536): int
{
return $this->__invoke($string, $total_shards, $is_sha1);
} | php | {
"resource": ""
} |
q261609 | Sha1Mod.assignShardId | test | public function assignShardId(string $string, bool $is_sha1 = false)
{
if ($this->total_mysql_db_shards < 1) {
throw $this->c::issue('No MySQL DB shards available.');
}
return $this->shardId($string, $is_sha1, $this->total_mysql_db_shards);
} | php | {
"resource": ""
} |
q261610 | DirectionsStep.setTravelMode | test | public function setTravelMode($travelMode)
{
if (!in_array($travelMode, TravelMode::getTravelModes())) {
throw DirectionsException::invalidDirectionsStepTravelMode();
}
$this->travelMode = $travelMode;
} | php | {
"resource": ""
} |
q261611 | AbstractJavascriptVariableAsset.setPrefixJavascriptVariable | test | public function setPrefixJavascriptVariable($prefixJavascriptVariable)
{
if (!is_string($prefixJavascriptVariable)) {
throw AssetException::invalidPrefixJavascriptVariable();
}
$this->javascriptVariable = $this->generateJavascriptVariable($prefixJavascriptVariable);
} | php | {
"resource": ""
} |
q261612 | Country.selectOptions | test | public function selectOptions(string $selected = '', array $args = []): string
{
$default_args = [
'ip' => null,
'use_ip' => true,
];
$args += $default_args;
$is_cli = $this->c::isCli();
if (!isset($args['ip']) && $args['use_ip']) {
$... | php | {
"resource": ""
} |
q261613 | Country.dropdownItems | test | public function dropdownItems(string $active = '', array $args = []): string
{
$default_args = [
'ip' => null,
'use_ip' => true,
'flags' => false,
];
$args += $default_args;
$is_cli = $this->c::isCli();
if (!isset($args['ip']) && $ar... | php | {
"resource": ""
} |
q261614 | StreetViewControlHelper.render | test | public function render(StreetViewControl $streetViewControl)
{
return $this->jsonBuilder
->reset()
->setValue(
'[position]',
$this->controlPositionHelper->render($streetViewControl->getControlPosition()),
false
)
... | php | {
"resource": ""
} |
q261615 | Eols.normalize | test | public function normalize($value, bool $compress = false)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->normalize($_value, $compress);
} // unset($_key, $_value);
return $value;
}
if... | php | {
"resource": ""
} |
q261616 | RegexPattern.in | test | public function in(string $regex, $value, bool $collect_key_props = false)
{
if (!$regex) { // Empty regex?
return $collect_key_props ? [] : false;
}
$matching_key_props = []; // Initialize.
if (is_array($value) || is_object($value)) {
foreach ($value as $_ke... | php | {
"resource": ""
} |
q261617 | HtmlWhitespace.normalize | test | public function normalize($value, bool $compress = false)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->normalize($_value, $compress);
} // unset($_key, $_value);
return $this->c::normalizeEols($val... | php | {
"resource": ""
} |
q261618 | WRegx.bracketSpecialChars | test | public function bracketSpecialChars($value, bool $will_force_match_all = false)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->bracketSpecialChars($_value, $will_force_match_all);
} // unset($_key, $_value); // ... | php | {
"resource": ""
} |
q261619 | WRegx.urlToUriPattern | test | public function urlToUriPattern($value, bool $will_force_match_all = false)
{
// Note: We must allow for `0` here.
// It will parse as `[path => '0']`, which is valid.
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = ... | php | {
"resource": ""
} |
q261620 | Size.setWidthUnit | test | public function setWidthUnit($widthUnit)
{
if (!is_string($widthUnit) && ($widthUnit !== null)) {
throw BaseException::invalidSizeWidthUnit();
}
$this->widthUnit = $widthUnit;
} | php | {
"resource": ""
} |
q261621 | Size.setHeightUnit | test | public function setHeightUnit($heightUnit)
{
if (!is_string($heightUnit) && ($heightUnit !== null)) {
throw BaseException::invalidSizeHeightUnit();
}
$this->heightUnit = $heightUnit;
} | php | {
"resource": ""
} |
q261622 | Defuse.keygen | test | public function keygen(): string
{
try { // Catch Defuse exceptions.
if (!($key = Key::createNewRandomKey()->saveToAsciiSafeString())) {
throw new Exception('Defuse keygen failure.');
}
} catch (\Throwable $Exception) {
throw $this->c::issue($Excep... | php | {
"resource": ""
} |
q261623 | Sha256.is | test | public function is($value): bool
{
if (!$value) {
return false;
} elseif (!is_string($value)) {
return false;
} elseif (strlen($value) !== 64) {
return false;
} elseif (!ctype_xdigit($value)) {
return false;
}
return tru... | php | {
"resource": ""
} |
q261624 | UrlQuery.strip | test | public function strip(string $url_uri_qsl): string
{
if (!$qs_url_uri) {
return $qs_url_uri; // Possible `0`.
}
if (mb_strpos($url_uri_qsl, '?') !== false) {
$url_uri_qsl = mb_strstr($url_uri_qsl, '?', true);
}
return $url_uri_qsl;
} | php | {
"resource": ""
} |
q261625 | UrlQuery.parse | test | public function parse(string $qs_url_uri): array
{
$qs = $this->string($qs_url_uri);
parse_str($qs, $args); // Possible `0`.
// Note that `0` becomes `[0 => '']`.
return $args;
} | php | {
"resource": ""
} |
q261626 | UrlQuery.build | test | public function build(array $args, string $numeric_prefix = '', string $arg_separator = '&', int $enc_type = PHP_QUERY_RFC1738): string
{
if (!isset($arg_separator[0])) {
$arg_separator = ini_get('arg_separator.output');
}
$query = http_build_query($args, $numeric_prefix, $arg_se... | php | {
"resource": ""
} |
q261627 | UrlQuery.addSha256Sig | test | public function addSha256Sig(string $url_uri_qsl, string $key = '', string $sig_var = ''): string
{
$sig_var = $sig_var ?: $this::DEFAULT_SIG_VAR;
$sig = $this->sha256Sig($url_uri_qsl, $key, $sig_var);
$url_uri_qsl = $this->addArgs([$sig_var => $sig], $url_uri_qsl);
retu... | php | {
"resource": ""
} |
q261628 | UrlQuery.removeSha256Sig | test | public function removeSha256Sig(string $url_uri_qsl, string $sig_var = ''): string
{
$sig_var = $sig_var ?: $this::DEFAULT_SIG_VAR;
$url_uri_qsl = $this->removeArgs([$sig_var], $url_uri_qsl);
return $url_uri_qsl;
} | php | {
"resource": ""
} |
q261629 | UrlQuery.sha256SigOk | test | public function sha256SigOk(string $qs_url_uri, string $key = '', string $sig_var = ''): bool
{
$sig_var = $sig_var ?: $this::DEFAULT_SIG_VAR;
$args = $this->parse($qs_url_uri);
$sig = $this->sha256Sig($qs_url_uri, $key, $sig_var);
return !empty($args[$sig_var]) && $args[$sig... | php | {
"resource": ""
} |
q261630 | MarkerShape.setCoordinates | test | public function setCoordinates(array $coordinates)
{
switch (strtolower($this->type)) {
case 'circle':
if ((count($coordinates) === 3)
&& is_numeric($coordinates[0])
&& is_numeric($coordinates[1])
&& is_numeric($coordina... | php | {
"resource": ""
} |
q261631 | MarkerShape.addPolyCoordinate | test | public function addPolyCoordinate($x, $y)
{
if ($this->type !== 'poly') {
throw OverlayException::invalidMarkerShapeAddPolyCoordinateCall();
}
if (!is_numeric($x) || !is_numeric($y)) {
throw OverlayException::invalidMarkerShapePolyCoordinate();
}
$th... | php | {
"resource": ""
} |
q261632 | Stripe.customer | test | public function customer($args)
{
if (is_string($args)) {
$args = ['customer' => $args];
} // Convert customer ID into args.
$default_args = [
'api_key' => '', // Stripe API key.
'customer' => '', // Existing customer ID.
// Everything else ... | php | {
"resource": ""
} |
q261633 | Stripe.updateCustomer | test | public function updateCustomer(array $args, Customer $Customer = null)
{
$default_args = [
'api_key' => '', // Stripe API key.
'customer' => '', // Existing customer ID.
// Everything else is optional (for update).
// Anything not passed in will not be chang... | php | {
"resource": ""
} |
q261634 | Stripe.unitAmount | test | protected function unitAmount(float $amount, string $currency): int
{
switch (mb_strtoupper($currency)) {
case 'BIF':
case 'DJF':
case 'JPY':
case 'KRW':
case 'PYG':
case 'VND':
case 'XAF':
case 'XPF':
... | php | {
"resource": ""
} |
q261635 | ScopeRepository.getScopeEntityByIdentifier | test | public function getScopeEntityByIdentifier($identifier)
{
if (!empty($this::SCOPES[$identifier])) {
return $this->App->Di->get(ScopeEntity::class, ['identifier' => $identifier]);
}
} | php | {
"resource": ""
} |
q261636 | ScaleControlHelper.render | test | public function render(ScaleControl $scaleControl)
{
return $this->jsonBuilder
->reset()
->setValue('[position]', $this->controlPositionHelper->render($scaleControl->getControlPosition()), false)
->setValue('[style]', $this->scaleControlStyleHelper->render($scaleControl->... | php | {
"resource": ""
} |
q261637 | GeocoderProvider.generateUrl | test | protected function generateUrl(GeocoderRequest $geocoderRequest)
{
$httpQuery = array();
if ($geocoderRequest->hasAddress()) {
$httpQuery['address'] = $geocoderRequest->getAddress();
} else {
$httpQuery['latlng'] = sprintf(
'%s,%s',
$g... | php | {
"resource": ""
} |
q261638 | GeocoderProvider.buildGeocoderResponse | test | protected function buildGeocoderResponse(\stdClass $geocoderResponse)
{
$results = array();
foreach ($geocoderResponse->results as $geocoderResult) {
$results[] = $this->buildGeocoderResult($geocoderResult);
}
$status = $geocoderResponse->status;
return new Geoc... | php | {
"resource": ""
} |
q261639 | GeocoderProvider.buildGeocoderResult | test | protected function buildGeocoderResult(\stdClass $geocoderResult)
{
$addressComponents = $this->buildGeocoderAddressComponents($geocoderResult->address_components);
$formattedAddress = $geocoderResult->formatted_address;
$geometry = $this->buildGeocoderGeometry($geocoderResult->geometry);
... | php | {
"resource": ""
} |
q261640 | GeocoderProvider.buildGeocoderAddressComponents | test | protected function buildGeocoderAddressComponents(array $geocoderAddressComponents)
{
$results = array();
foreach ($geocoderAddressComponents as $geocoderAddressComponent) {
$results[] = $this->buildGeocoderAddressComponent($geocoderAddressComponent);
}
return $results;... | php | {
"resource": ""
} |
q261641 | GeocoderProvider.buildGeocoderAddressComponent | test | protected function buildGeocoderAddressComponent(\stdClass $geocoderAddressComponent)
{
$longName = $geocoderAddressComponent->long_name;
$shortName = $geocoderAddressComponent->short_name;
$types = $geocoderAddressComponent->types;
return new GeocoderAddressComponent($longName, $sh... | php | {
"resource": ""
} |
q261642 | GeocoderProvider.buildGeocoderGeometry | test | protected function buildGeocoderGeometry(\stdClass $geocoderGeometry)
{
$location = new Coordinate(
$geocoderGeometry->location->lat,
$geocoderGeometry->location->lng
);
$locationType = $geocoderGeometry->location_type;
$viewport = new Bound(
new... | php | {
"resource": ""
} |
q261643 | DistanceMatrix.process | test | public function process()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof DistanceMatrixRequest)) {
$distanceMatrixRequest = $args[0];
} elseif ((isset($args[0]) && is_array($args[0])) && (isset($args[1]) && is_array($args[1]))) {
$distanceMatr... | php | {
"resource": ""
} |
q261644 | DistanceMatrix.generateUrl | test | protected function generateUrl(DistanceMatrixRequest $distanceMatrixRequest)
{
$httpQuery = array(
'origins' => array(),
'destinations' => array(),
);
foreach ($distanceMatrixRequest->getOrigins() as $origin) {
if (is_string($origin)) {
... | php | {
"resource": ""
} |
q261645 | DistanceMatrix.parse | test | protected function parse($response)
{
if ($this->format === 'json') {
return $this->parseJSON($response);
}
return $this->parseXML($response);
} | php | {
"resource": ""
} |
q261646 | DistanceMatrix.buildDistanceMatrixResponse | test | protected function buildDistanceMatrixResponse(\stdClass $distanceMatrixResponse)
{
$status = $distanceMatrixResponse->status;
$destinations = $distanceMatrixResponse->destination_addresses;
$origins = $distanceMatrixResponse->origin_addresses;
$rows = $this->buildDistanceMatrixRows(... | php | {
"resource": ""
} |
q261647 | DistanceMatrix.buildDistanceMatrixRows | test | protected function buildDistanceMatrixRows($rows)
{
$results = array();
foreach ($rows as $row) {
$results[] = $this->buildDistanceMatrixRow($row);
}
return $results;
} | php | {
"resource": ""
} |
q261648 | DistanceMatrix.buildDistanceMatrixRow | test | protected function buildDistanceMatrixRow($row)
{
$elements = array();
foreach ($row->elements as $element) {
$elements[] = $this->buildDistanceMatrixResponseElement($element);
}
return new DistanceMatrixResponseRow($elements);
} | php | {
"resource": ""
} |
q261649 | DistanceMatrix.buildDistanceMatrixResponseElement | test | protected function buildDistanceMatrixResponseElement($element)
{
$status = $element->status;
$distance = null;
$duration = null;
if ($element->status === DistanceMatrixElementStatus::OK) {
$distance = new Distance($element->distance->text, $element->distance->value);
... | php | {
"resource": ""
} |
q261650 | PointHelper.render | test | public function render(Point $point)
{
return sprintf(
'%s = new google.maps.Point(%s, %s);'.PHP_EOL,
$point->getJavascriptVariable(),
$point->getX(),
$point->getY()
);
} | php | {
"resource": ""
} |
q261651 | Parser.getParameterStrings | test | private function getParameterStrings(string $parameterString): array
{
$rawParameterStrings = explode(self::TYPE_PARAMETER_SEPARATOR, $parameterString);
$parameterStrings = array();
foreach ($rawParameterStrings as $rawParameterString) {
if ($rawParameterString != '') {
... | php | {
"resource": ""
} |
q261652 | Parser.getParameters | test | private function getParameters($parameterStrings): array
{
$parameters = array();
foreach ($parameterStrings as $parameterString) {
$parameters[] = $this->parameterParser->parse($parameterString);
}
return $parameters;
} | php | {
"resource": ""
} |
q261653 | Headers.current | test | public function current(): array
{
if (($headers = &$this->cacheKey(__FUNCTION__)) !== null) {
return $headers; // Cached this already.
}
$headers = []; // Initialize.
foreach ($_SERVER as $_header => $_value) {
if (mb_stripos($_header, 'HTTP_') === 0) {
... | php | {
"resource": ""
} |
q261654 | Headers.yesCacheSend | test | public function yesCacheSend(int $expires_after = self::SECONDS_IN_YEAR)
{
if (headers_sent()) {
throw $this->c::issue('Headers already sent.');
}
header_remove('last-modified');
foreach ($this->yesCache() as $_header => $_value) {
header($_header.': '.$_valu... | php | {
"resource": ""
} |
q261655 | Headers.noCacheSend | test | public function noCacheSend()
{
if (headers_sent()) {
throw $this->c::issue('Headers already sent.');
}
header_remove('last-modified');
foreach ($this->noCache() as $_header => $_value) {
header($_header.': '.$_value);
} // unset($_header, $_value);
... | php | {
"resource": ""
} |
q261656 | Headers.getStatusSlug | test | public function getStatusSlug(int $status): string
{
return $this->c::nameToSlug($this->getStatusTitle($status));
} | php | {
"resource": ""
} |
q261657 | Headers.getStatusMessage | test | public function getStatusMessage(int $status): string
{
return $this->c::mbUcFirst(mb_strtolower($this->getStatusTitle($status))).'.';
} | php | {
"resource": ""
} |
q261658 | Headers.sendStatus | test | public function sendStatus(int $status, string $protocol = '')
{
if (headers_sent()) {
throw $this->c::issue('Headers already sent.');
}
if (!$protocol && !($protocol = $_SERVER['SERVER_PROTOCOL'] ?? '')) {
$protocol = 'HTTP/1.1'; // Default fallback.
}
... | php | {
"resource": ""
} |
q261659 | Headers.parse | test | public function parse($value): array
{
$headers = []; // Initialize.
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => $_value) {
if ($_key && is_string($_key) && is_string($_value)) {
$headers = array_merge($headers, $this->par... | php | {
"resource": ""
} |
q261660 | PhpStrip.tags | test | public function tags($value)
{
if (is_array($value) || is_object($value)) {
foreach ($value as $_key => &$_value) {
$_value = $this->tags($_value);
} // unset($_key, $_value);
return $value;
}
if (!($string = (string) $value)) {
... | php | {
"resource": ""
} |
q261661 | ModuleProvider.registerMigrations | test | protected function registerMigrations()
{
if (is_dir($dir = $this->module->getPath('src/Database/Migrations'))
|| is_dir($dir = $this->module->getPath('database/migrations'))
) {
$this->loadMigrationsFrom($dir);
}
} | php | {
"resource": ""
} |
q261662 | ModuleProvider.registerTrans | test | protected function registerTrans()
{
$path = base_path("resources/lang/modules/{$this->module->getName()}");
if (is_dir($path)) {
$this->loadTranslationsFrom($path, $this->module->getName());
} else {
$this->loadTranslationsFrom($this->module->getPath('resources/lang... | php | {
"resource": ""
} |
q261663 | InfoWindow.setPixelOffset | test | public function setPixelOffset()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof Size)) {
$this->pixedOffset = $args[0];
} elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) {
if ($this->pixedOffset ... | php | {
"resource": ""
} |
q261664 | InfoWindow.setOpenEvent | test | public function setOpenEvent($openEvent)
{
if (!in_array($openEvent, MouseEvent::getMouseEvents())) {
throw OverlayException::invalidInfoWindowOpenEvent();
}
$this->openEvent = $openEvent;
} | php | {
"resource": ""
} |
q261665 | PanControlHelper.render | test | public function render(PanControl $panControl)
{
return $this->jsonBuilder
->reset()
->setValue('[position]', $this->controlPositionHelper->render($panControl->getControlPosition()), false)
->build();
} | php | {
"resource": ""
} |
q261666 | MouseEvent.getMouseEvents | test | public static function getMouseEvents()
{
return array(
self::CLICK,
self::DBLCLICK,
self::MOUSEUP,
self::MOUSEDOWN,
self::MOUSEOVER,
self::MOUSEOUT,
);
} | php | {
"resource": ""
} |
q261667 | MapTypeControl.setMapTypeIds | test | public function setMapTypeIds($mapTypeIds)
{
$this->mapTypeIds = array();
foreach ($mapTypeIds as $mapTypeId) {
$this->addMapTypeId($mapTypeId);
}
} | php | {
"resource": ""
} |
q261668 | MapTypeControl.addMapTypeId | test | public function addMapTypeId($mapTypeId)
{
if (!in_array($mapTypeId, MapTypeId::getMapTypeIds())) {
throw ControlException::invalidMapTypeId();
}
if (!in_array($mapTypeId, $this->mapTypeIds)) {
$this->mapTypeIds[] = $mapTypeId;
}
} | php | {
"resource": ""
} |
q261669 | MapTypeControl.setMapTypeControlStyle | test | public function setMapTypeControlStyle($mapTypeControlStyle)
{
if (!in_array($mapTypeControlStyle, MapTypeControlStyle::getMapTypeControlStyles())) {
throw ControlException::invalidMapTypeControlStyle();
}
$this->mapTypeControlStyle = $mapTypeControlStyle;
} | php | {
"resource": ""
} |
q261670 | Cookie.setUe | test | public function setUe(
string $name,
string $value,
int $expires_after = null,
string $path = null,
string $domain = null,
bool $secure = null,
bool $http_only = null
) {
if (!$name) { // Must have a cookie name!
throw $this->c::issue('Miss... | php | {
"resource": ""
} |
q261671 | Cookie.getUe | test | public function getUe(string $name): string
{
if (!$name) { // Must have a cookie name!
throw $this->c::issue('Missing cookie name.');
}
if (isset($_COOKIE[$name]) && is_string($_COOKIE[$name])) {
return $_COOKIE[$name];
}
return ''; // Missing cookie.... | php | {
"resource": ""
} |
q261672 | EventManagerHelper.renderDomEvent | test | public function renderDomEvent(Event $domEvent)
{
return sprintf(
'%s = google.maps.event.addDomListener(%s, "%s", %s, %s);'.PHP_EOL,
$domEvent->getJavascriptVariable(),
$domEvent->getInstance(),
$domEvent->getEventName(),
$domEvent->getHandle(),
... | php | {
"resource": ""
} |
q261673 | EventManagerHelper.renderDomEventOnce | test | public function renderDomEventOnce(Event $domEventOnce)
{
return sprintf(
'%s = google.maps.event.addDomListenerOnce(%s, "%s", %s, %s);'.PHP_EOL,
$domEventOnce->getJavascriptVariable(),
$domEventOnce->getInstance(),
$domEventOnce->getEventName(),
$... | php | {
"resource": ""
} |
q261674 | EventManagerHelper.renderEvent | test | public function renderEvent(Event $event)
{
return sprintf(
'%s = google.maps.event.addListener(%s, "%s", %s);'.PHP_EOL,
$event->getJavascriptVariable(),
$event->getInstance(),
$event->getEventName(),
$event->getHandle()
);
} | php | {
"resource": ""
} |
q261675 | EventManagerHelper.renderEventOnce | test | public function renderEventOnce(Event $eventOnce)
{
return sprintf(
'%s = google.maps.event.addListenerOnce(%s, "%s", %s);'.PHP_EOL,
$eventOnce->getJavascriptVariable(),
$eventOnce->getInstance(),
$eventOnce->getEventName(),
$eventOnce->getHandle()... | php | {
"resource": ""
} |
q261676 | AnimationHelper.render | test | public function render($animation)
{
switch ($animation) {
case Animation::BOUNCE:
case Animation::DROP:
return sprintf('google.maps.Animation.%s', strtoupper($animation));
default:
throw HelperException::invalidAnimation();
}
} | php | {
"resource": ""
} |
q261677 | ZoomControlHelper.render | test | public function render(ZoomControl $zoomControl)
{
return $this->jsonBuilder
->reset()
->setValue('[position]', $this->controlPositionHelper->render($zoomControl->getControlPosition()), false)
->setValue('[style]', $this->zoomControlStyleHelper->render($zoomControl->getZo... | php | {
"resource": ""
} |
q261678 | ExecTime.max | test | public function max(int $max = null): int
{
if (isset($max) && $max >= 0) {
@set_time_limit($max);
}
return (int) ini_get('max_execution_time');
} | php | {
"resource": ""
} |
q261679 | WebPurify.checkSlug | test | public function checkSlug(string $slug, array $args = []): bool
{
$text = mb_strtolower($slug);
$text = preg_replace('/[^\p{L}\p{N}]/ui', ' ', $text);
$text = preg_replace('/\s+/u', ' ', $text);
return $this->check($text, $args);
} | php | {
"resource": ""
} |
q261680 | GeocoderResult.getAddressComponents | test | public function getAddressComponents($type = null)
{
if ($type === null) {
return $this->addressComponents;
}
$addressComponents = array();
foreach ($this->addressComponents as $addressComponent) {
if (in_array($type, $addressComponent->getTypes())) {
... | php | {
"resource": ""
} |
q261681 | GeocoderResult.setAddressComponents | test | public function setAddressComponents(array $addressComponents)
{
$this->addressComponents = array();
foreach ($addressComponents as $addressComponent) {
$this->addAddressComponent($addressComponent);
}
} | php | {
"resource": ""
} |
q261682 | GeocoderResult.setPartialMatch | test | public function setPartialMatch($partialMatch = null)
{
if (!is_bool($partialMatch) && ($partialMatch !== null)) {
throw GeocodingException::invalidGeocoderResultPartialMatch();
}
$this->partialMatch = $partialMatch;
} | php | {
"resource": ""
} |
q261683 | Gravatar.url | test | public function url(string $email, int $size = 64, string $scheme = ''): string
{
$md5 = md5(mb_strtolower($this->c::mbTrim($email)));
return $this->c::setScheme('https://www.gravatar.com/avatar/'.$md5.'?s='.$size, $scheme);
} | php | {
"resource": ""
} |
q261684 | Map.setCenter | test | public function setCenter()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof Coordinate)) {
$this->center = $args[0];
} elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) {
$this->center->setLatitude(... | php | {
"resource": ""
} |
q261685 | Map.hasMapOption | test | public function hasMapOption($mapOption)
{
if (!is_string($mapOption)) {
throw MapException::invalidMapOption();
}
return isset($this->mapOptions[$mapOption]);
} | php | {
"resource": ""
} |
q261686 | Map.setMapOptions | test | public function setMapOptions(array $mapOptions)
{
foreach ($mapOptions as $mapOption => $value) {
$this->setMapOption($mapOption, $value);
}
} | php | {
"resource": ""
} |
q261687 | Map.getMapOption | test | public function getMapOption($mapOption)
{
if (!$this->hasMapOption($mapOption)) {
throw MapException::mapOptionDoesNotExist($mapOption);
}
return $this->mapOptions[$mapOption];
} | php | {
"resource": ""
} |
q261688 | Map.setMapOption | test | public function setMapOption($mapOption, $value)
{
if (!is_string($mapOption)) {
throw MapException::invalidMapOption();
}
$this->mapOptions[$mapOption] = $value;
} | php | {
"resource": ""
} |
q261689 | Map.removeMapOption | test | public function removeMapOption($mapOption)
{
if (!$this->hasMapOption($mapOption)) {
throw MapException::mapOptionDoesNotExist($mapOption);
}
unset($this->mapOptions[$mapOption]);
} | php | {
"resource": ""
} |
q261690 | Map.hasStylesheetOption | test | public function hasStylesheetOption($stylesheetOption)
{
if (!is_string($stylesheetOption)) {
throw MapException::invalidStylesheetOption();
}
return isset($this->stylesheetOptions[$stylesheetOption]);
} | php | {
"resource": ""
} |
q261691 | Map.setStylesheetOptions | test | public function setStylesheetOptions(array $stylesheetOptions)
{
foreach ($stylesheetOptions as $stylesheetOption => $value) {
$this->setStylesheetOption($stylesheetOption, $value);
}
} | php | {
"resource": ""
} |
q261692 | Map.getStylesheetOption | test | public function getStylesheetOption($stylesheetOption)
{
if (!$this->hasStylesheetOption($stylesheetOption)) {
throw MapException::stylesheetOptionDoesNotExist($stylesheetOption);
}
return $this->stylesheetOptions[$stylesheetOption];
} | php | {
"resource": ""
} |
q261693 | Map.setStylesheetOption | test | public function setStylesheetOption($stylesheetOption, $value)
{
if (!is_string($stylesheetOption)) {
throw MapException::invalidStylesheetOption();
}
$this->stylesheetOptions[$stylesheetOption] = $value;
} | php | {
"resource": ""
} |
q261694 | Map.removeStylesheetOption | test | public function removeStylesheetOption($stylesheetOption)
{
if (!$this->hasStylesheetOption($stylesheetOption)) {
throw MapException::stylesheetOptionDoesNotExist($stylesheetOption);
}
unset($this->stylesheetOptions[$stylesheetOption]);
} | php | {
"resource": ""
} |
q261695 | Map.setMapTypeControl | test | public function setMapTypeControl()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof MapTypeControl)) {
$this->mapTypeControl = $args[0];
$this->mapOptions['mapTypeControl'] = true;
} elseif ((isset($args[0]) && is_array($args[0]))
&... | php | {
"resource": ""
} |
q261696 | Map.setOverviewMapControl | test | public function setOverviewMapControl()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0]) instanceof OverviewMapControl) {
$this->overviewMapControl = $args[0];
$this->mapOptions['overviewMapControl'] = true;
} elseif (isset($args[0]) && is_bool($args[0]))... | php | {
"resource": ""
} |
q261697 | Map.setPanControl | test | public function setPanControl()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof PanControl)) {
$this->panControl = $args[0];
$this->mapOptions['panControl'] = true;
} elseif (isset($args[0]) && is_string($args[0])) {
if ($this->panC... | php | {
"resource": ""
} |
q261698 | Map.setRotateControl | test | public function setRotateControl()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof RotateControl)) {
$this->rotateControl = $args[0];
$this->mapOptions['rotateControl'] = true;
} elseif (isset($args[0]) && is_string($args[0])) {
if ... | php | {
"resource": ""
} |
q261699 | Map.setScaleControl | test | public function setScaleControl()
{
$args = func_get_args();
if (isset($args[0]) && ($args[0] instanceof ScaleControl)) {
$this->scaleControl = $args[0];
$this->mapOptions['scaleControl'] = true;
} elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) ... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.