_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q261500
ControlPosition.getControlPositions
test
public static function getControlPositions() { return array( self::BOTTOM_CENTER, self::BOTTOM_LEFT, self::BOTTOM_RIGHT, self::LEFT_BOTTOM, self::LEFT_CENTER, self::LEFT_TOP, self::RIGHT_BOTTOM, self::RIGHT_CENTE...
php
{ "resource": "" }
q261501
DirectionsResponse.setStatus
test
public function setStatus($status) { if (!in_array($status, DirectionsStatus::getDirectionsStatus())) { throw DirectionsException::invalidDirectionsResponseStatus(); } $this->status = $status; }
php
{ "resource": "" }
q261502
OverviewMapControlHelper.render
test
public function render(OverviewMapControl $overviewMapControl) { return $this->jsonBuilder ->reset() ->setValue('[opened]', $overviewMapControl->isOpened()) ->build(); }
php
{ "resource": "" }
q261503
BoundHelper.render
test
public function render(Bound $bound) { if ($bound->hasExtends() || !$bound->hasCoordinates()) { return sprintf('%s = new google.maps.LatLngBounds();'.PHP_EOL, $bound->getJavascriptVariable()); } return sprintf( '%s = new google.maps.LatLngBounds(%s, %s);'.PHP_EOL, ...
php
{ "resource": "" }
q261504
BoundHelper.renderExtends
test
public function renderExtends(Bound $bound) { $output = array(); foreach ($bound->getExtends() as $extend) { if (($extend instanceof Marker) || ($extend instanceof InfoWindow)) { $output[] = sprintf( '%s.extend(%s.getPosition());'.PHP_EOL, ...
php
{ "resource": "" }
q261505
Benchmark.printAllStatistics
test
protected function printAllStatistics() { $longest_label_chars = 0; // Initialize. foreach ($this->stats as $_label => $_value) { $longest_label_chars = max($longest_label_chars, mb_strlen($_label)); } echo "\n\n"; // Two lines down... echo '- Benchmark ---------...
php
{ "resource": "" }
q261506
MarkerCluster.setMarkers
test
public function setMarkers($markers) { $this->markers = array(); foreach ($markers as $marker) { $this->addMarker($marker); } }
php
{ "resource": "" }
q261507
MarkerClusterHelper.setHelpers
test
public function setHelpers(array $helpers) { $this->helpers = array(); foreach ($helpers as $name => $helper) { $this->setHelper($name, $helper); } }
php
{ "resource": "" }
q261508
MarkerClusterHelper.getHelper
test
public function getHelper($name) { if (!$this->hasHelper($name)) { throw HelperException::invalidMarkerClusterHelper(); } return $this->helpers[$name]; }
php
{ "resource": "" }
q261509
MapHelper.setExtensionHelpers
test
public function setExtensionHelpers(array $extensionHelpers) { $this->extensionHelpers = array(); foreach ($extensionHelpers as $name => $extensionHelper) { $this->setExtensionHelper($name, $extensionHelper); } }
php
{ "resource": "" }
q261510
MapHelper.getExtensionHelper
test
public function getExtensionHelper($name) { if (!$this->hasExtensionHelper($name)) { throw HelperException::invalidExtension($name); } return $this->extensionHelpers[$name]; }
php
{ "resource": "" }
q261511
MapHelper.removeExtensionHelper
test
public function removeExtensionHelper($name) { if (!$this->hasExtensionHelper($name)) { throw HelperException::invalidExtension($name); } unset($this->extensionHelpers[$name]); }
php
{ "resource": "" }
q261512
MapHelper.renderHtmlContainer
test
public function renderHtmlContainer(Map $map) { return sprintf( '<div id="%s" style="width:%s;height:%s;"></div>'.PHP_EOL, $map->getHtmlContainerId(), $map->getStylesheetOption('width'), $map->getStylesheetOption('height') ); }
php
{ "resource": "" }
q261513
MapHelper.renderStylesheets
test
public function renderStylesheets(Map $map) { $html = array(); $html[] = '<style type="text/css" scoped>'.PHP_EOL; $html[] = '#'.$map->getHtmlContainerId().'{'.PHP_EOL; foreach ($map->getStylesheetOptions() as $option => $value) { $html[] = $option.':'.$value.';'.PHP_EO...
php
{ "resource": "" }
q261514
MapHelper.renderJavascripts
test
public function renderJavascripts(Map $map) { $output = array(); if (!$map->isAsync()) { $output[] = $this->renderJsLibraries($map); } $output[] = '<script type="text/javascript">'.PHP_EOL; $output[] = $this->renderJsBefore($map); $output[] = $this->rend...
php
{ "resource": "" }
q261515
MapHelper.renderJsLibraries
test
public function renderJsLibraries(Map $map) { $output = array(); foreach ($this->getExtensionHelpers() as $extension) { $output[] = $extension->renderLibraries($map); } return implode('', $output); }
php
{ "resource": "" }
q261516
MapHelper.renderJsBefore
test
public function renderJsBefore(Map $map) { $output = array(); foreach ($this->getExtensionHelpers() as $extension) { $output[] = $extension->renderBefore($map); } return implode('', $output); }
php
{ "resource": "" }
q261517
MapHelper.renderJsAfter
test
public function renderJsAfter(Map $map) { $output = array(); foreach (array_reverse($this->getExtensionHelpers()) as $extension) { $output[] = $extension->renderAfter($map); } return implode('', $output); }
php
{ "resource": "" }
q261518
MapHelper.renderJsContainer
test
public function renderJsContainer(Map $map) { $output = array(); $output[] = $this->renderJsContainerInit($map); $output[] = $this->renderJsContainerCoordinates($map); $output[] = $this->renderJsContainerBounds($map); $output[] = $this->renderJsContainerPoints($map); ...
php
{ "resource": "" }
q261519
MapHelper.renderJsContainerCoordinates
test
public function renderJsContainerCoordinates(Map $map) { $output = array(); foreach ($this->computeCoordinates($map) as $coordinate) { $output[] = sprintf( '%s.coordinates.%s = %s', $this->getJsContainerName($map), $coordinate->getJavascri...
php
{ "resource": "" }
q261520
MapHelper.renderJsContainerBounds
test
public function renderJsContainerBounds(Map $map) { $output = array(); foreach ($this->computeBounds($map) as $bound) { $output[] = sprintf( '%s.bounds.%s = %s', $this->getJsContainerName($map), $bound->getJavascriptVariable(), ...
php
{ "resource": "" }
q261521
MapHelper.renderJsContainerPoints
test
public function renderJsContainerPoints(Map $map) { $output = array(); foreach ($this->computePoints($map) as $point) { $output[] = sprintf( '%s.points.%s = %s', $this->getJsContainerName($map), $point->getJavascriptVariable(), ...
php
{ "resource": "" }
q261522
MapHelper.renderJsContainerSizes
test
public function renderJsContainerSizes(Map $map) { $output = array(); foreach ($this->computeSizes($map) as $size) { $output[] = sprintf( '%s.sizes.%s = %s', $this->getJsContainerName($map), $size->getJavascriptVariable(), ...
php
{ "resource": "" }
q261523
MapHelper.renderJsContainerMap
test
public function renderJsContainerMap(Map $map) { return sprintf('%s.map = %s', $this->getJsContainerName($map), $this->renderMap($map)); }
php
{ "resource": "" }
q261524
MapHelper.renderJsContainerCircles
test
public function renderJsContainerCircles(Map $map) { $output = array(); foreach ($map->getCircles() as $circle) { $output[] = sprintf( '%s.circles.%s = %s', $this->getJsContainerName($map), $circle->getJavascriptVariable(), ...
php
{ "resource": "" }
q261525
MapHelper.renderJsContainerEncodedPolylines
test
public function renderJsContainerEncodedPolylines(Map $map) { $output = array(); foreach ($map->getEncodedPolylines() as $encodedPolyline) { $output[] = sprintf( '%s.encoded_polylines.%s = %s', $this->getJsContainerName($map), $encodedPoly...
php
{ "resource": "" }
q261526
MapHelper.renderJsContainerGroundOverlays
test
public function renderJsContainerGroundOverlays(Map $map) { $output = array(); foreach ($map->getGroundOverlays() as $groundOverlay) { $output[] = sprintf( '%s.ground_overlays.%s = %s', $this->getJsContainerName($map), $groundOverlay->getJ...
php
{ "resource": "" }
q261527
MapHelper.renderJsContainerPolygons
test
public function renderJsContainerPolygons(Map $map) { $output = array(); foreach ($map->getPolygons() as $polygon) { $output[] = sprintf( '%s.polygons.%s = %s', $this->getJsContainerName($map), $polygon->getJavascriptVariable(), ...
php
{ "resource": "" }
q261528
MapHelper.renderJsContainerPolylines
test
public function renderJsContainerPolylines(Map $map) { $output = array(); foreach ($map->getPolylines() as $polyline) { $output[] = sprintf( '%s.polylines.%s = %s', $this->getJsContainerName($map), $polyline->getJavascriptVariable(), ...
php
{ "resource": "" }
q261529
MapHelper.renderJsContainerRectangles
test
public function renderJsContainerRectangles(Map $map) { $output = array(); foreach ($map->getRectangles() as $rectangle) { $output[] = sprintf( '%s.rectangles.%s = %s', $this->getJsContainerName($map), $rectangle->getJavascriptVariable(), ...
php
{ "resource": "" }
q261530
MapHelper.renderJsContainerInfoWindows
test
public function renderJsContainerInfoWindows(Map $map) { $output = array(); $mapInfoWindows = $map->getInfoWindows(); $markerInfoWindows = $this->computeMarkerInfoWindows($map); foreach ($mapInfoWindows as $mapInfoWindow) { $output[] = sprintf( '%s.info_...
php
{ "resource": "" }
q261531
MapHelper.renderJsContainerMarkerImages
test
public function renderJsContainerMarkerImages(Map $map) { $output = array(); foreach ($this->computeMarkerImages($map) as $markerImage) { $output[] = sprintf( '%s.marker_images.%s = %s', $this->getJsContainerName($map), $markerImage->getJa...
php
{ "resource": "" }
q261532
MapHelper.renderJsContainerMarkerShapes
test
public function renderJsContainerMarkerShapes(Map $map) { $output = array(); foreach ($this->computeMarkerShapes($map) as $markerShape) { $output[] = sprintf( '%s.marker_shapes.%s = %s', $this->getJsContainerName($map), $markerShape->getJa...
php
{ "resource": "" }
q261533
MapHelper.renderJsContainerMarkerCluster
test
public function renderJsContainerMarkerCluster(Map $map) { $output = array( $this->markerClusterHelper->renderMarkers($map->getMarkerCluster(), $map), $this->markerClusterHelper->render($map->getMarkerCluster(), $map), ); return implode('', $output); }
php
{ "resource": "" }
q261534
MapHelper.renderJsContainerKMLLayers
test
public function renderJsContainerKMLLayers(Map $map) { $output = array(); foreach ($map->getKMLLayers() as $kmlLayer) { $output[] = sprintf( '%s.kml_layers.%s = %s', $this->getJsContainerName($map), $kmlLayer->getJavascriptVariable(), ...
php
{ "resource": "" }
q261535
MapHelper.renderJsContainerEventManager
test
public function renderJsContainerEventManager(Map $map) { $output = array(); foreach ($map->getEventManager()->getDomEvents() as $domEvent) { $output[] = sprintf( '%s.event_manager.dom_events.%s = %s', $this->getJsContainerName($map), $dom...
php
{ "resource": "" }
q261536
MapHelper.renderJsContainerExtra
test
public function renderJsContainerExtra(Map $map) { $output = array(); foreach ($map->getInfoWindows() as $infoWindow) { if ($infoWindow->isOpen()) { $output[] = $this->infoWindowHelper->renderOpen($infoWindow, $map); } } foreach ($map->getMar...
php
{ "resource": "" }
q261537
MapHelper.renderMap
test
public function renderMap(Map $map) { $mapTypeId = $map->getMapOption('mapTypeId'); $map->removeMapOption('mapTypeId'); $this->jsonBuilder ->reset() ->setValue('[mapTypeId]', $this->mapTypeIdHelper->render($mapTypeId), false); $this->renderMapControls($map);...
php
{ "resource": "" }
q261538
MapHelper.renderMapCenter
test
public function renderMapCenter(Map $map) { return sprintf( '%s.setCenter(%s);'.PHP_EOL, $map->getJavascriptVariable(), $map->getCenter()->getJavascriptVariable() ); }
php
{ "resource": "" }
q261539
MapHelper.renderMapBound
test
public function renderMapBound(Map $map) { return sprintf( '%s.fitBounds(%s);'.PHP_EOL, $map->getJavascriptVariable(), $map->getBound()->getJavascriptVariable() ); }
php
{ "resource": "" }
q261540
MapHelper.computeCoordinates
test
protected function computeCoordinates(Map $map) { $coordinates = array(); if (!$map->isAutoZoom() && !in_array($map->getCenter(), $coordinates)) { $coordinates[] = $map->getCenter(); } foreach ($this->computeBounds($map) as $bound) { if (!$bound->hasExtends(...
php
{ "resource": "" }
q261541
MapHelper.computeBounds
test
protected function computeBounds(Map $map) { $bounds = array(); if ($map->isAutoZoom() && !in_array($map->getBound(), $bounds)) { $bounds[] = $map->getBound(); } foreach ($map->getGroundOverlays() as $groundOverlay) { if (!in_array($groundOverlay->getBound()...
php
{ "resource": "" }
q261542
MapHelper.computePoints
test
protected function computePoints(Map $map) { $points = array(); foreach ($map->getMarkers() as $marker) { if ($marker->hasIcon()) { if ($marker->getIcon()->hasAnchor() && !in_array($marker->getIcon()->getAnchor(), $points)) { $points[] = $marker->getI...
php
{ "resource": "" }
q261543
MapHelper.computeSizes
test
protected function computeSizes(Map $map) { $sizes = array(); foreach (array_merge($map->getInfoWindows(), $this->computeMarkerInfoWindows($map)) as $infoWindow) { if ($infoWindow->hasPixelOffset() && !in_array($infoWindow->getPixelOffset(), $sizes)) { $sizes[] = $infoWi...
php
{ "resource": "" }
q261544
MapHelper.computeMarkerImages
test
protected function computeMarkerImages(Map $map) { $markerImages = array(); foreach ($map->getMarkers() as $marker) { if ($marker->hasIcon() && !in_array($marker->getIcon(), $markerImages)) { $markerImages[] = $marker->getIcon(); } if ($marker->h...
php
{ "resource": "" }
q261545
MapHelper.computeMarkerShapes
test
protected function computeMarkerShapes(Map $map) { $markerShapes = array(); foreach ($map->getMarkers() as $marker) { if ($marker->hasShape() && !in_array($marker->getShape(), $markerShapes)) { $markerShapes[] = $marker->getShape(); } } retur...
php
{ "resource": "" }
q261546
MapHelper.computeMarkerInfoWindows
test
protected function computeMarkerInfoWindows(Map $map) { $infoWinfows = array(); foreach ($map->getMarkers() as $marker) { if ($marker->hasInfoWindow() && !in_array($marker->getInfoWindow(), $infoWinfows)) { $infoWinfows[] = $marker->getInfoWindow(); } ...
php
{ "resource": "" }
q261547
MapHelper.renderMapControls
test
protected function renderMapControls(Map $map) { $controlNames = array( 'MapTypeControl', 'OverviewMapControl', 'PanControl', 'RotateControl', 'ScaleControl', 'StreetViewControl', 'ZoomControl', ); foreach (...
php
{ "resource": "" }
q261548
MapHelper.renderMapControl
test
protected function renderMapControl(Map $map, $controlName, $controlHelper) { $lcFirstControlName = lcfirst($controlName); if (!$map->hasMapOption($lcFirstControlName)) { return; } $this->jsonBuilder->setValue( sprintf('[%s]', $lcFirstControlName), ...
php
{ "resource": "" }
q261549
Uuid.v1
test
public function v1(bool $optimize = true): string { $uuid = UuidGen::uuid1()->toString(); if ($optimize) { // See: <http://jas.xyz/1ODZilT> $uuid = substr($uuid, 14, 4). substr($uuid, 9, 4). substr($uuid, 0, 8). substr($uuid, 1...
php
{ "resource": "" }
q261550
Uuid.v3
test
public function v3(string $namespace, string $identifier, bool $optimize = true): string { switch ($namespace) { case 'dns': $namespace = UuidGen::NAMESPACE_DNS; break; // Stop here. case 'url': $namespace = UuidGen::NAMESPACE_URL; ...
php
{ "resource": "" }
q261551
Uuid.v4
test
public function v4(bool $optimize = true): string { $uuid = UuidGen::uuid4()->toString(); return $optimize ? str_replace('-', '', $uuid) : $uuid; }
php
{ "resource": "" }
q261552
Uuid.v4x2
test
public function v4x2(bool $optimize = true): string { $uuid1 = UuidGen::uuid4()->toString(); $uuid2 = UuidGen::uuid4()->toString(); return $optimize ? str_replace('-', '', $uuid1.$uuid2) : $uuid1.'-'.$uuid2; }
php
{ "resource": "" }
q261553
Repository.get
test
public function get($name): PackageContract { if (array_key_exists($name, $this->items)) { return $this->items[$name]; } throw new Exceptions\ModuleNotFoundException("Package '$name' not found."); }
php
{ "resource": "" }
q261554
Repository.each
test
public function each(callable $callback) { foreach ($this->items as $name => $item) { $callback($item, $name); } }
php
{ "resource": "" }
q261555
Repository.filter
test
public function filter(callable $callback):Repository { $result = new Repository(); foreach ($this->items as $name => $item) { if ($callback($item, $name)) { $result->add($item); } } return $result; }
php
{ "resource": "" }
q261556
Repository.add
test
public function add(PackageContract ...$items) { foreach ($items as $item) { $this->items[$item->getName()] = $item; } }
php
{ "resource": "" }
q261557
GeocoderRequest.setAddress
test
public function setAddress($address) { if (!is_string($address) && ($address !== null)) { throw GeocodingException::invalidGeocoderRequestAddress(); } $this->address = $address; }
php
{ "resource": "" }
q261558
GeocoderRequest.setCoordinate
test
public function setCoordinate() { $args = func_get_args(); if (isset($args[0]) && ($args[0] instanceof Coordinate)) { $this->coordinate = $args[0]; } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) { if (!$this->hasCoor...
php
{ "resource": "" }
q261559
GeocoderRequest.setBound
test
public function setBound() { $args = func_get_args(); if (isset($args[0]) && ($args[0] instanceof Bound)) { $this->bound = $args[0]; } elseif ((isset($args[0]) && ($args[0] instanceof Coordinate)) && (isset($args[1]) && ($args[1] instanceof Coordinate)) ) { ...
php
{ "resource": "" }
q261560
GeocoderRequest.setRegion
test
public function setRegion($region = null) { if ((!is_string($region) || (strlen($region) !== 2)) && ($region !== null)) { throw GeocodingException::invalidGeocoderRequestRegion(); } $this->region = $region; }
php
{ "resource": "" }
q261561
GeocoderRequest.setLanguage
test
public function setLanguage($language = null) { if ((!is_string($language) || ((strlen($language) !== 2) && (strlen($language) !== 5))) && ($language !== null)) { throw GeocodingException::invalidGeocoderRequestLanguage(); } $this->language = $language; }
php
{ "resource": "" }
q261562
Route.load
test
public function load(array $args = []) { $default_args = [ 'path' => '', 'dir' => '', 'vars' => [], 'on_resolved' => null, ]; $args += $default_args; $args['path'] = (string) $args['path']; $args['dir'] =...
php
{ "resource": "" }
q261563
Route.get
test
public function get(array $args = []): Classes\Core\Route { return $this->App->Di->get(Classes\Core\Route::class, compact('args')); }
php
{ "resource": "" }
q261564
Yaml.parse
test
public function parse($value) { if (is_array($value) || is_object($value)) { foreach ($value as $_key => &$_value) { $_value = $this->parse($_value, $args); } // unset($_key, $_value); return $value; } if (!($yaml = (string) $value)) { ...
php
{ "resource": "" }
q261565
NoCache.setFlags
test
public function setFlags() { if ($this->c::isWordPress()) { if (!defined('DONOTCACHEPAGE')) { define('DONOTCACHEPAGE', true); } if (!defined('COMET_CACHE_ALLOWED')) { define('COMET_CACHE_ALLOWED', false); } $_SERVER[...
php
{ "resource": "" }
q261566
Sort.byKey
test
public function byKey(array $array, int $flags = SORT_REGULAR): array { ksort($array, $flags); foreach ($array as $_key => &$_value) { if (is_array($_value)) { $_value = $this->byKey($_value, $flags); } } // unset($_key, $_value); // Housekeeping. ...
php
{ "resource": "" }
q261567
UrlCurrent.method
test
public function method(): string { if (($method = &$this->cacheKey(__FUNCTION__)) !== null) { return $method; // Cached this already. } return $method = mb_strtoupper($_SERVER['REQUEST_METHOD']); }
php
{ "resource": "" }
q261568
UrlCurrent.scheme
test
public function scheme(): string { if (($scheme = &$this->cacheKey(__FUNCTION__)) !== null) { return $scheme; // Cached this already. } return $scheme = $this->isSsl() ? 'https' : 'http'; }
php
{ "resource": "" }
q261569
UrlCurrent.host
test
public function host(bool $with_port = true): string { if (($host = &$this->cacheKey(__FUNCTION__, $with_port)) !== null) { return $host; // Cached this already. } $host = mb_strtolower($_SERVER['HTTP_HOST']); if (!$with_port) { // Strip port number? $host = ...
php
{ "resource": "" }
q261570
UrlCurrent.rootHost
test
public function rootHost(bool $with_port = true): string { if (($root_host = &$this->cacheKey(__FUNCTION__, $with_port)) !== null) { return $root_host; // Cached this already. } $name_parts = explode('.', $this->host(false)); $root_name = implode('.', array_s...
php
{ "resource": "" }
q261571
UrlCurrent.isSsl
test
public function isSsl(): bool { if (($is = &$this->cacheKey(__FUNCTION__)) !== null) { return $is; // Cached this already. } if (!empty($_SERVER['SERVER_PORT'])) { if ((int) $_SERVER['SERVER_PORT'] === 443) { return $is = true; } } ...
php
{ "resource": "" }
q261572
UrlCurrent.isLocalhost
test
public function isLocalhost(): bool { if (($is = &$this->cacheKey(__FUNCTION__)) !== null) { return $is; // Cached this already. } if (defined('LOCALHOST') && LOCALHOST) { return $is = true; } elseif (preg_match('/(?:\b(?:localhost|127\.0\.0\.1)\b|\.vm)$/ui', ...
php
{ "resource": "" }
q261573
GeocoderGeometry.setLocationType
test
public function setLocationType($locationType) { if (!in_array($locationType, GeocoderLocationType::getGeocoderLocationTypes())) { throw GeocodingException::invalidGeocoderLocationType(); } $this->locationType = $locationType; }
php
{ "resource": "" }
q261574
RegexEscape.m0EscNoVws
test
public function m0EscNoVws(string $escapable_chars, bool $ungreedy = false): string { $escapable_chars = $this->__invoke($escapable_chars); return '(?:[^\v'.$escapable_chars.'\\\\]|\\\\['.$escapable_chars.'])*'.($ungreedy ? '?' : ''); }
php
{ "resource": "" }
q261575
DirectionsStatus.getDirectionsStatus
test
public static function getDirectionsStatus() { return array( self::INVALID_REQUEST, self::MAX_WAYPOINTS_EXCEEDED, self::NOT_FOUND, self::OK, self::OVER_QUERY_LIMIT, self::REQUEST_DENIED, self::UNKNOWN_ERROR, self...
php
{ "resource": "" }
q261576
OverloadMembers.overloadData
test
protected function overloadData(): array { foreach ($this->x___overload_data as $_key => $_value) { $properties[$_key] = $_value; } // unset($_key, $_value); return $properties ?? []; }
php
{ "resource": "" }
q261577
OverloadMembers.overloadPropertyData
test
protected function overloadPropertyData(): array { foreach ($this->x___overload_data as $_key => $_value) { if (!is_callable($_value)) { $properties[$_key] = $_value; } } // unset($_key, $_value); return $properties ?? []; }
php
{ "resource": "" }
q261578
OverloadMembers.writableOverloadPropertyData
test
protected function writableOverloadPropertyData(): array { foreach ($this->x___overload_data as $_key => $_value) { if (isset($this->x___writable_overload_keys[$_key]) && !is_callable($_value)) { $properties[$_key] = $_value; } } // unset($_key, $_value); ...
php
{ "resource": "" }
q261579
OverloadMembers.overload
test
protected function overload($properties, bool $writable = false) { if (is_object($properties)) { foreach ($properties as $_property => &$_value) { if ($writable) { unset($this->{$_property}); unset($this->x___overload_data[$_property]); ...
php
{ "resource": "" }
q261580
CliOs.openUrl
test
public function openUrl(string $url) { if (!($url = $this->c::mbTrim($url))) { return; // Not possible. } $url_arg = escapeshellarg($url); if ($this->c::isMac()) { `open $url_arg`; } elseif ($this->c::isLinux()) { `xdg-open $url_arg`; ...
php
{ "resource": "" }
q261581
MarkerImage.setAnchor
test
public function setAnchor() { $args = func_get_args(); if ($args[0] instanceof Point) { $this->anchor = $args[0]; } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) { if ($this->anchor === null) { $this->...
php
{ "resource": "" }
q261582
MarkerImage.setOrigin
test
public function setOrigin() { $args = func_get_args(); if (isset($args[0]) && ($args[0] instanceof Point)) { $this->origin = $args[0]; } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) { if ($this->origin === null) { ...
php
{ "resource": "" }
q261583
MarkerImage.setScaledSize
test
public function setScaledSize() { $args = func_get_args(); if (isset($args[0]) && ($args[0] instanceof Size)) { $this->scaledSize = $args[0]; } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) { if ($this->scaledSize ===...
php
{ "resource": "" }
q261584
MarkerImage.setSize
test
public function setSize() { $args = func_get_args(); if (isset($args[0]) && ($args[0] instanceof Size)) { $this->size = $args[0]; } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) { if ($this->size === null) { ...
php
{ "resource": "" }
q261585
InfoWindowHelper.render
test
public function render(InfoWindow $infoWindow, $renderPosition = true) { $this->doRender($infoWindow, $renderPosition); return sprintf( '%s = new google.maps.InfoWindow(%s);'.PHP_EOL, $infoWindow->getJavascriptVariable(), $this->jsonBuilder->build() ); ...
php
{ "resource": "" }
q261586
InfoWindowHelper.renderOpen
test
public function renderOpen(InfoWindow $infoWindow, Map $map, Marker $marker = null) { if ($marker !== null) { return sprintf( '%s.open(%s, %s);'.PHP_EOL, $infoWindow->getJavascriptVariable(), $map->getJavascriptVariable(), $marker->...
php
{ "resource": "" }
q261587
InfoWindowHelper.doRender
test
protected function doRender(InfoWindow $infoWindow, $renderPosition) { $this->jsonBuilder->reset(); if ($renderPosition) { $this->jsonBuilder->setValue('[position]', $infoWindow->getPosition()->getJavascriptVariable(), false); } if ($infoWindow->hasPixelOffset()) { ...
php
{ "resource": "" }
q261588
Modules.register
test
public function register(Application $app) { $this->enabled()->each(function (Module $module) use ($app) { array_map(function ($class) use ($app) { /* @var ServiceProvider $provider */ $provider = new $class($app); if ($provider->isDeferred()) { ...
php
{ "resource": "" }
q261589
Modules.asset
test
public function asset(string $module, string $path, $secure = null): string { if ($this->assetResolver && ($url = call_user_func($this->assetResolver, $module, $path, $secure)) !== null) { return $url; } return $this->app->make('url')->asset($this->getAssetsPath() . "/{$module}/...
php
{ "resource": "" }
q261590
Modules.loadRoutes
test
public function loadRoutes(string $scope = 'web') { $this->app->make('router')->group([ 'as' => $scope === 'web' ? '' : "{$scope}.", ], function (Router $router) use ($scope) { $this->enabled()->each(function (Module $module) use ($scope, $router) { $path = $m...
php
{ "resource": "" }
q261591
PhpHas.callableFunc
test
public function callableFunc(string $function): bool { $function = mb_strtolower($function); if (isset(static::$cache[__FUNCTION__][$function])) { return static::$cache[__FUNCTION__][$function]; } if (!isset(static::$cache[__FUNCTION__.'s_disabled'])) { stati...
php
{ "resource": "" }
q261592
GroundOverlayHelper.render
test
public function render(GroundOverlay $groundOverlay, Map $map) { $this->jsonBuilder ->reset() ->setValue('[map]', $map->getJavascriptVariable(), false) ->setValues($groundOverlay->getOptions()); return sprintf( '%s = new google.maps.GroundOverlay("%s"...
php
{ "resource": "" }
q261593
EchoEmitter.emit
test
public function emit(ResponseInterface $response): void { // Emit http status code echo sprintf( 'HTTP/%s %s %s', $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase() ) . PHP_EOL; // Emit headers it...
php
{ "resource": "" }
q261594
CacheMembers.&
test
protected function &cacheSet(string $primary_key, $sub_key, $value) { if ($primary_key === 'x___keys' || $primary_key === 'x___refs') { throw $this->c::issue('Attempting to set a reserved primary key.'); } $sub_key = (string) $sub_key; $thi...
php
{ "resource": "" }
q261595
CacheMembers.&
test
protected function &cacheGet(string $primary_key, $sub_key) { if ($primary_key === 'x___keys' || $primary_key === 'x___refs') { throw $this->c::issue('Attempting to get a reserved primary key.'); } $sub_key = (string) $sub_key; // Force string. if (isset($this->x___cache...
php
{ "resource": "" }
q261596
CacheMembers.cacheUnset
test
protected function cacheUnset(string $primary_key, $sub_key) { if ($primary_key === 'x___keys' || $primary_key === 'x___refs') { throw $this->c::issue('Attempting to unset a reserved primary key.'); } $sub_key = (string) $sub_key; $this->x_...
php
{ "resource": "" }
q261597
CacheMembers.cacheUnsetPattern
test
protected function cacheUnsetPattern(string $primary_key, string $sub_key_pattern) { if ($primary_key === 'x___keys' || $primary_key === 'x___refs') { throw $this->c::issue('Attempting to unset a reserved primary key.'); } if (empty($this->x___cache[$primary_key])) { ...
php
{ "resource": "" }
q261598
CacheMembers.cacheAddByRef
test
protected function cacheAddByRef(string $primary_key, $ref_key, &$value) { $ref_key = (string) $ref_key; $this->x___cache['x___refs'][$primary_key][$ref_key][] = &$value; }
php
{ "resource": "" }
q261599
CacheMembers.cacheUnsetByRef
test
protected function cacheUnsetByRef(string $primary_key, $ref_key) { $ref_key = (string) $ref_key; // Force string. if (empty($this->x___cache['x___refs'][$primary_key][$ref_key])) { return; // Nothing to do here. } foreach (array_keys($this->x___cache['x___refs'][$primar...
php
{ "resource": "" }