id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
191,200 | davidtsadler/ebay-sdk | src/DTS/eBaySDK/Services/BaseService.php | BaseService.logRequest | private function logRequest($url, $name, $headers, $body)
{
if ($this->logger) {
$this->logger->debug('Request', array(
'url' => $url,
'name' => $name,
'headers' => $headers,
'body' => $body
));
}
} | php | private function logRequest($url, $name, $headers, $body)
{
if ($this->logger) {
$this->logger->debug('Request', array(
'url' => $url,
'name' => $name,
'headers' => $headers,
'body' => $body
));
}
} | [
"private",
"function",
"logRequest",
"(",
"$",
"url",
",",
"$",
"name",
",",
"$",
"headers",
",",
"$",
"body",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"'Request'",
",",
"array",
... | Logs the request details.
@param string $name The name of the operation.
@param string $url API endpoint.
@param array $headers Associative array of HTTP headers.
@param string $body The XML body of the POST request. | [
"Logs",
"the",
"request",
"details",
"."
] | faf4327880f70dfcec08e7bb9a832b8baecf8a4d | https://github.com/davidtsadler/ebay-sdk/blob/faf4327880f70dfcec08e7bb9a832b8baecf8a4d/src/DTS/eBaySDK/Services/BaseService.php#L355-L365 |
191,201 | unclecheese/silverstripe-event-calendar | code/CalendarUtil.php | CalendarUtil.date_sort_callback | public static function date_sort_callback($a, $b) {
if($a->StartDate == $b->StartDate) {
if($a->StartTime == $b->StartTime)
return 0;
else if(strtotime($a->StartTime) > strtotime($b->StartTime))
return 1;
else
return -1;
}
else if(strtotime($a->StartDate) > strtotime($b->StartDate))
retur... | php | public static function date_sort_callback($a, $b) {
if($a->StartDate == $b->StartDate) {
if($a->StartTime == $b->StartTime)
return 0;
else if(strtotime($a->StartTime) > strtotime($b->StartTime))
return 1;
else
return -1;
}
else if(strtotime($a->StartDate) > strtotime($b->StartDate))
retur... | [
"public",
"static",
"function",
"date_sort_callback",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"if",
"(",
"$",
"a",
"->",
"StartDate",
"==",
"$",
"b",
"->",
"StartDate",
")",
"{",
"if",
"(",
"$",
"a",
"->",
"StartTime",
"==",
"$",
"b",
"->",
"Star... | Callback used by column_sort | [
"Callback",
"used",
"by",
"column_sort"
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/CalendarUtil.php#L199-L213 |
191,202 | 10quality/license-keys-php-client | src/Client.php | Client.setSSL | private function setSSL()
{
curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
} | php | private function setSSL()
{
curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
} | [
"private",
"function",
"setSSL",
"(",
")",
"{",
"curl_setopt",
"(",
"$",
"this",
"->",
"curl",
",",
"CURLOPT_SSL_VERIFYHOST",
",",
"0",
")",
";",
"curl_setopt",
"(",
"$",
"this",
"->",
"curl",
",",
"CURLOPT_SSL_VERIFYPEER",
",",
"0",
")",
";",
"curl_setopt... | Sets SSL curl properties when requesting an https url.
@since 1.0.2 | [
"Sets",
"SSL",
"curl",
"properties",
"when",
"requesting",
"an",
"https",
"url",
"."
] | 61067d13bd4cde1492f0990ba60d75e6a1ecb72b | https://github.com/10quality/license-keys-php-client/blob/61067d13bd4cde1492f0990ba60d75e6a1ecb72b/src/Client.php#L134-L139 |
191,203 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLng.php | LatLng.fromNative | public static function fromNative($latLng)
{
if (is_string($latLng)) {
return static::fromString($latLng);
} elseif (is_array($latLng) || $latLng instanceof \ArrayObject) {
return static::fromArray($latLng);
}
throw new InvalidArgumentException('Could not cre... | php | public static function fromNative($latLng)
{
if (is_string($latLng)) {
return static::fromString($latLng);
} elseif (is_array($latLng) || $latLng instanceof \ArrayObject) {
return static::fromArray($latLng);
}
throw new InvalidArgumentException('Could not cre... | [
"public",
"static",
"function",
"fromNative",
"(",
"$",
"latLng",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"latLng",
")",
")",
"{",
"return",
"static",
"::",
"fromString",
"(",
"$",
"latLng",
")",
";",
"}",
"elseif",
"(",
"is_array",
"(",
"$",
"la... | Create LatLng from a native representation.
Supported values are array and string. Look at fromString and fromArray method for more details.
@param mixed $latLng Native latLng representation.
@return LatLng
@throws InvalidArgumentException If LatLng could not be created. | [
"Create",
"LatLng",
"from",
"a",
"native",
"representation",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLng.php#L74-L83 |
191,204 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLng.php | LatLng.fromArray | public static function fromArray($native)
{
$keys = array(
array(0, 1, 2),
array('lat', 'lng', 'alt'),
array('latitude', 'longitude', 'altitude'),
);
foreach ($keys as $key) {
if (isset($native[$key[0]]) && isset($native[$key[1]])) {
... | php | public static function fromArray($native)
{
$keys = array(
array(0, 1, 2),
array('lat', 'lng', 'alt'),
array('latitude', 'longitude', 'altitude'),
);
foreach ($keys as $key) {
if (isset($native[$key[0]]) && isset($native[$key[1]])) {
... | [
"public",
"static",
"function",
"fromArray",
"(",
"$",
"native",
")",
"{",
"$",
"keys",
"=",
"array",
"(",
"array",
"(",
"0",
",",
"1",
",",
"2",
")",
",",
"array",
"(",
"'lat'",
",",
"'lng'",
",",
"'alt'",
")",
",",
"array",
"(",
"'latitude'",
"... | Create LatLng from array.
@param array $native Native array.
Following keys are supported:
- Numeric keys 0-2
- Short names "lat", "lng", "alt"
- Long names "latitude", "longitude", "altitude".
@return LatLng
@throws \InvalidArgumentException If format is not supported. | [
"Create",
"LatLng",
"from",
"array",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLng.php#L97-L116 |
191,205 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLng.php | LatLng.fromString | public static function fromString($latLng)
{
list($latitude, $longitude, $altitude) = explode(',', $latLng);
Assertion::numeric($latitude);
Assertion::numeric($longitude);
Assertion::nullOrNumeric($altitude);
return new static($latitude, $longitude, $altitude);
} | php | public static function fromString($latLng)
{
list($latitude, $longitude, $altitude) = explode(',', $latLng);
Assertion::numeric($latitude);
Assertion::numeric($longitude);
Assertion::nullOrNumeric($altitude);
return new static($latitude, $longitude, $altitude);
} | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"latLng",
")",
"{",
"list",
"(",
"$",
"latitude",
",",
"$",
"longitude",
",",
"$",
"altitude",
")",
"=",
"explode",
"(",
"','",
",",
"$",
"latLng",
")",
";",
"Assertion",
"::",
"numeric",
"(",
"... | Create latlng from a string reprensentation.
@param string $latLng Comma separated list of latlng values.
@return LatLng
@throws InvalidArgumentException If LatLng could not be created. | [
"Create",
"latlng",
"from",
"a",
"string",
"reprensentation",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLng.php#L126-L135 |
191,206 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLng.php | LatLng.equals | public function equals(LatLng $other, $maxMargin = null, $ignoreAltitude = true)
{
if ($maxMargin !== null) {
$margin = max(
abs(($this->getLatitude() - $other->getLatitude())),
abs(($this->getLongitude() - $other->getLongitude()))
);
... | php | public function equals(LatLng $other, $maxMargin = null, $ignoreAltitude = true)
{
if ($maxMargin !== null) {
$margin = max(
abs(($this->getLatitude() - $other->getLatitude())),
abs(($this->getLongitude() - $other->getLongitude()))
);
... | [
"public",
"function",
"equals",
"(",
"LatLng",
"$",
"other",
",",
"$",
"maxMargin",
"=",
"null",
",",
"$",
"ignoreAltitude",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"maxMargin",
"!==",
"null",
")",
"{",
"$",
"margin",
"=",
"max",
"(",
"abs",
"(",
"(... | Compare 2 coordinates. It ignores the altitude.
@param LatLng $other Another coordinate.
@param int $maxMargin Margin of tolerance.
@param bool $ignoreAltitude If true only longitude and latitude are compared.
@return bool | [
"Compare",
"2",
"coordinates",
".",
"It",
"ignores",
"the",
"altitude",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLng.php#L186-L217 |
191,207 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLng.php | LatLng.toGeoJson | public function toGeoJson()
{
$raw = array (
$this->getLongitude(),
$this->getLatitude()
);
if ($this->hasAltitude()) {
$raw[] = $this->getAltitude();
}
return $raw;
} | php | public function toGeoJson()
{
$raw = array (
$this->getLongitude(),
$this->getLatitude()
);
if ($this->hasAltitude()) {
$raw[] = $this->getAltitude();
}
return $raw;
} | [
"public",
"function",
"toGeoJson",
"(",
")",
"{",
"$",
"raw",
"=",
"array",
"(",
"$",
"this",
"->",
"getLongitude",
"(",
")",
",",
"$",
"this",
"->",
"getLatitude",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasAltitude",
"(",
")",
")",
"... | Get latlng as geo json coordinate.
@return array | [
"Get",
"latlng",
"as",
"geo",
"json",
"coordinate",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLng.php#L224-L236 |
191,208 | MyAllocator/myallocator-pms-php | src/MyAllocator/MaBaseClass.php | MaBaseClass.setConfig | public function setConfig($key = null, $value = null)
{
if ($key == null || $value == null) {
return null;
}
return ($this->config[$key] = $value);
} | php | public function setConfig($key = null, $value = null)
{
if ($key == null || $value == null) {
return null;
}
return ($this->config[$key] = $value);
} | [
"public",
"function",
"setConfig",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"null",
"||",
"$",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"$",
"this",
... | Set an API configuration key.
@param key $key The configuration key.
@param value $value The configuration key value.
@return boolean|null Result of the set. | [
"Set",
"an",
"API",
"configuration",
"key",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/MaBaseClass.php#L65-L71 |
191,209 | MyAllocator/myallocator-pms-php | src/MyAllocator/MaBaseClass.php | MaBaseClass.debug | protected function debug($type, $mixed)
{
if ($this->config && $this->config['debugsEnabled']) {
switch ($type) {
case 'echo':
echo $mixed;
break;
case 'print_r':
print_r($mixed);
brea... | php | protected function debug($type, $mixed)
{
if ($this->config && $this->config['debugsEnabled']) {
switch ($type) {
case 'echo':
echo $mixed;
break;
case 'print_r':
print_r($mixed);
brea... | [
"protected",
"function",
"debug",
"(",
"$",
"type",
",",
"$",
"mixed",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"&&",
"$",
"this",
"->",
"config",
"[",
"'debugsEnabled'",
"]",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'echo'... | Generates some output if debugsEnabled is set to true.
@param string $type The output type.
@param mixed $mixed The object, array, or variable. | [
"Generates",
"some",
"output",
"if",
"debugsEnabled",
"is",
"set",
"to",
"true",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/MaBaseClass.php#L192-L207 |
191,210 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/PopupTrait.php | PopupTrait.bindPopup | public function bindPopup($popup, $options = null)
{
$this->popup = $popup;
$this->popupOptions = $options;
if (!empty($options)) {
return $this->addMethod('binPopup', array($popup, $options));
}
return $this->addMethod('bindPopup', array($popup));
} | php | public function bindPopup($popup, $options = null)
{
$this->popup = $popup;
$this->popupOptions = $options;
if (!empty($options)) {
return $this->addMethod('binPopup', array($popup, $options));
}
return $this->addMethod('bindPopup', array($popup));
} | [
"public",
"function",
"bindPopup",
"(",
"$",
"popup",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"popup",
"=",
"$",
"popup",
";",
"$",
"this",
"->",
"popupOptions",
"=",
"$",
"options",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
... | Bind marker to a popup.
@param Popup|string $popup The popup.
@param array|null $options Optional popup options.
@return $this | [
"Bind",
"marker",
"to",
"a",
"popup",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/PopupTrait.php#L77-L87 |
191,211 | nystudio107/craft-eagerbeaver | src/services/EagerBeaverService.php | EagerBeaverService.eagerLoadElements | public function eagerLoadElements($elements, $with)
{
// Bail if there aren't even any elements
if (empty($elements)) {
return;
}
if (!\is_array($elements)) {
$elements = [$elements];
}
// We are assuming all of these elements are of the same ... | php | public function eagerLoadElements($elements, $with)
{
// Bail if there aren't even any elements
if (empty($elements)) {
return;
}
if (!\is_array($elements)) {
$elements = [$elements];
}
// We are assuming all of these elements are of the same ... | [
"public",
"function",
"eagerLoadElements",
"(",
"$",
"elements",
",",
"$",
"with",
")",
"{",
"// Bail if there aren't even any elements",
"if",
"(",
"empty",
"(",
"$",
"elements",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$... | Eager-loads additional elements onto a given set of elements.
@param ElementInterface[] $elements The root element models that should
be updated with the eager-loaded
elements
@param string|array $with Dot-delimited paths of the elements
that should be eager-loaded into the
root elements
@return void | [
"Eager",
"-",
"loads",
"additional",
"elements",
"onto",
"a",
"given",
"set",
"of",
"elements",
"."
] | e3b2d3e1847bfca022812a2a2aba2481636a85ea | https://github.com/nystudio107/craft-eagerbeaver/blob/e3b2d3e1847bfca022812a2a2aba2481636a85ea/src/services/EagerBeaverService.php#L43-L58 |
191,212 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Vector/Polyline.php | Polyline.addLatLng | public function addLatLng($latLng, $ringIndex = 0)
{
if (is_scalar($latLng)) {
$latLng = LatLng::fromNative($latLng);
}
Assertion::isInstanceOf($latLng, 'Netzmacht\LeafletPHP\Value\LatLng');
$ringIndex = (int) $ringIndex;
$this->latLngs[$ringIn... | php | public function addLatLng($latLng, $ringIndex = 0)
{
if (is_scalar($latLng)) {
$latLng = LatLng::fromNative($latLng);
}
Assertion::isInstanceOf($latLng, 'Netzmacht\LeafletPHP\Value\LatLng');
$ringIndex = (int) $ringIndex;
$this->latLngs[$ringIn... | [
"public",
"function",
"addLatLng",
"(",
"$",
"latLng",
",",
"$",
"ringIndex",
"=",
"0",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"latLng",
")",
")",
"{",
"$",
"latLng",
"=",
"LatLng",
"::",
"fromNative",
"(",
"$",
"latLng",
")",
";",
"}",
"Asser... | Add a latitude longitude position.
This method differs from the Leaflet JS API! Instead of passing the shape as second argument you can define
the index of the ring.
@param LatLng|array|string $latLng LatLng coordinate.
@param int $ringIndex The index of the ring.
@return $this | [
"Add",
"a",
"latitude",
"longitude",
"position",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Vector/Polyline.php#L121-L133 |
191,213 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Vector/Polyline.php | Polyline.addLatLngs | public function addLatLngs($values, $ringIndex = 0)
{
foreach ($values as $position) {
$this->addLatLng($position, $ringIndex);
}
return $this;
} | php | public function addLatLngs($values, $ringIndex = 0)
{
foreach ($values as $position) {
$this->addLatLng($position, $ringIndex);
}
return $this;
} | [
"public",
"function",
"addLatLngs",
"(",
"$",
"values",
",",
"$",
"ringIndex",
"=",
"0",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"position",
")",
"{",
"$",
"this",
"->",
"addLatLng",
"(",
"$",
"position",
",",
"$",
"ringIndex",
")",
";",
... | Add a list of values.
@param array $values Position list.
@param int $ringIndex The index of the ring.
@return $this
@throws InvalidArgumentException If LatLng could not be created. | [
"Add",
"a",
"list",
"of",
"values",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Vector/Polyline.php#L144-L151 |
191,214 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Vector/Polyline.php | Polyline.getLatLngs | public function getLatLngs($preferFlat = true)
{
if ($preferFlat) {
$value = [];
foreach ($this->latLngs as $ring) {
$value = array_merge($value, $ring);
}
return $value;
}
return $this->latLngs;
} | php | public function getLatLngs($preferFlat = true)
{
if ($preferFlat) {
$value = [];
foreach ($this->latLngs as $ring) {
$value = array_merge($value, $ring);
}
return $value;
}
return $this->latLngs;
} | [
"public",
"function",
"getLatLngs",
"(",
"$",
"preferFlat",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"preferFlat",
")",
"{",
"$",
"value",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"latLngs",
"as",
"$",
"ring",
")",
"{",
"$",
"value",
... | Get all lat lngs.
@param bool $preferFlat If true a flat array is returned instead of a list of rings.
@return array | [
"Get",
"all",
"lat",
"lngs",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Vector/Polyline.php#L160-L173 |
191,215 | digiaonline/lumen-oauth2 | src/OAuth2ServiceProvider.php | OAuth2ServiceProvider.createService | protected function createService(Container $container, array $config)
{
$authorizationServer = $this->createAuthorizationServer($container, $config);
$resourceServer = $this->createResourceServer($container);
return new OAuth2Service($authorizationServer, $resourceServer);
} | php | protected function createService(Container $container, array $config)
{
$authorizationServer = $this->createAuthorizationServer($container, $config);
$resourceServer = $this->createResourceServer($container);
return new OAuth2Service($authorizationServer, $resourceServer);
} | [
"protected",
"function",
"createService",
"(",
"Container",
"$",
"container",
",",
"array",
"$",
"config",
")",
"{",
"$",
"authorizationServer",
"=",
"$",
"this",
"->",
"createAuthorizationServer",
"(",
"$",
"container",
",",
"$",
"config",
")",
";",
"$",
"r... | Creates the service instance.
@param Container $container
@param array $config
@return OAuth2Service | [
"Creates",
"the",
"service",
"instance",
"."
] | e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873 | https://github.com/digiaonline/lumen-oauth2/blob/e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873/src/OAuth2ServiceProvider.php#L72-L78 |
191,216 | digiaonline/lumen-oauth2 | src/OAuth2ServiceProvider.php | OAuth2ServiceProvider.createAuthorizationServer | protected function createAuthorizationServer(Container $container, array $config)
{
// TODO: Support scopes
$authorizationServer = $container->make(AuthorizationServer::class);
$authorizationServer->setSessionStorage($container->make(SessionInterface::class));
$authorizationServer-... | php | protected function createAuthorizationServer(Container $container, array $config)
{
// TODO: Support scopes
$authorizationServer = $container->make(AuthorizationServer::class);
$authorizationServer->setSessionStorage($container->make(SessionInterface::class));
$authorizationServer-... | [
"protected",
"function",
"createAuthorizationServer",
"(",
"Container",
"$",
"container",
",",
"array",
"$",
"config",
")",
"{",
"// TODO: Support scopes",
"$",
"authorizationServer",
"=",
"$",
"container",
"->",
"make",
"(",
"AuthorizationServer",
"::",
"class",
")... | Creates the authorization instance.
@param Container $container
@param array $config
@return AuthorizationServer
@throws Exception | [
"Creates",
"the",
"authorization",
"instance",
"."
] | e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873 | https://github.com/digiaonline/lumen-oauth2/blob/e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873/src/OAuth2ServiceProvider.php#L90-L106 |
191,217 | digiaonline/lumen-oauth2 | src/OAuth2ServiceProvider.php | OAuth2ServiceProvider.configureAuthorizationServer | protected function configureAuthorizationServer(AuthorizationServer $authorizationServer, array $config)
{
if (isset($config['scope_param'])) {
$authorizationServer->requireScopeParam($config['scope_param']);
}
if (isset($config['default_scope'])) {
$authorizationServ... | php | protected function configureAuthorizationServer(AuthorizationServer $authorizationServer, array $config)
{
if (isset($config['scope_param'])) {
$authorizationServer->requireScopeParam($config['scope_param']);
}
if (isset($config['default_scope'])) {
$authorizationServ... | [
"protected",
"function",
"configureAuthorizationServer",
"(",
"AuthorizationServer",
"$",
"authorizationServer",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'scope_param'",
"]",
")",
")",
"{",
"$",
"authorizationServer",
... | Configures the authorization server instance.
@param AuthorizationServer $authorizationServer
@param array $config | [
"Configures",
"the",
"authorization",
"server",
"instance",
"."
] | e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873 | https://github.com/digiaonline/lumen-oauth2/blob/e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873/src/OAuth2ServiceProvider.php#L115-L134 |
191,218 | digiaonline/lumen-oauth2 | src/OAuth2ServiceProvider.php | OAuth2ServiceProvider.configureGrantTypes | protected function configureGrantTypes(AuthorizationServer $authorizationServer, array $config)
{
// TODO: Support configuring of the remaining grant types
foreach ($config as $name => $params) {
if (!isset($params['class']) || !class_exists($params['class'])) {
continue;... | php | protected function configureGrantTypes(AuthorizationServer $authorizationServer, array $config)
{
// TODO: Support configuring of the remaining grant types
foreach ($config as $name => $params) {
if (!isset($params['class']) || !class_exists($params['class'])) {
continue;... | [
"protected",
"function",
"configureGrantTypes",
"(",
"AuthorizationServer",
"$",
"authorizationServer",
",",
"array",
"$",
"config",
")",
"{",
"// TODO: Support configuring of the remaining grant types",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"para... | Configures the grant types for the authorization server instance.
@param AuthorizationServer $authorizationServer
@param array $config
@throws InvalidArgument | [
"Configures",
"the",
"grant",
"types",
"for",
"the",
"authorization",
"server",
"instance",
"."
] | e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873 | https://github.com/digiaonline/lumen-oauth2/blob/e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873/src/OAuth2ServiceProvider.php#L145-L179 |
191,219 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/VectorEncoder.php | VectorEncoder.doVectorEncode | private function doVectorEncode($type, Vector $vector, Encoder $builder)
{
return sprintf(
'%s = L.%s(%s, %s);',
$builder->encodeReference($vector),
$type,
$builder->encodeArray($vector->getLatLngs()),
$builder->encodeValue($vector->getOptions())
... | php | private function doVectorEncode($type, Vector $vector, Encoder $builder)
{
return sprintf(
'%s = L.%s(%s, %s);',
$builder->encodeReference($vector),
$type,
$builder->encodeArray($vector->getLatLngs()),
$builder->encodeValue($vector->getOptions())
... | [
"private",
"function",
"doVectorEncode",
"(",
"$",
"type",
",",
"Vector",
"$",
"vector",
",",
"Encoder",
"$",
"builder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.%s(%s, %s);'",
",",
"$",
"builder",
"->",
"encodeReference",
"(",
"$",
"vector",
")",
",",
... | Encode a vector.
@param string $type The type name.
@param Vector $vector The vector.
@param Encoder $builder The builder.
@return string | [
"Encode",
"a",
"vector",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/VectorEncoder.php#L117-L126 |
191,220 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/VectorEncoder.php | VectorEncoder.doCircleEncode | private function doCircleEncode($type, CircleMarker $circle, Encoder $builder)
{
return sprintf(
'%s = L.%s(%s);',
$builder->encodeReference($circle),
$type,
$builder->encodeArguments(array($circle->getLatLng(), $circle, $circle->getOptions()))
);
... | php | private function doCircleEncode($type, CircleMarker $circle, Encoder $builder)
{
return sprintf(
'%s = L.%s(%s);',
$builder->encodeReference($circle),
$type,
$builder->encodeArguments(array($circle->getLatLng(), $circle, $circle->getOptions()))
);
... | [
"private",
"function",
"doCircleEncode",
"(",
"$",
"type",
",",
"CircleMarker",
"$",
"circle",
",",
"Encoder",
"$",
"builder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.%s(%s);'",
",",
"$",
"builder",
"->",
"encodeReference",
"(",
"$",
"circle",
")",
",",... | Encode a circle.
@param string $type The circle type.
@param CircleMarker $circle The circle object.
@param Encoder $builder The builder.
@return array | [
"Encode",
"a",
"circle",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/VectorEncoder.php#L137-L145 |
191,221 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Control/Attribution.php | Attribution.removeAttribution | public function removeAttribution($attribution)
{
$key = array_search($attribution, $this->attributions);
if ($key !== false) {
unset($this->attributions[$key]);
} else {
$this->addMethod('removeAttribution', array($attribution));
}
return $this;
... | php | public function removeAttribution($attribution)
{
$key = array_search($attribution, $this->attributions);
if ($key !== false) {
unset($this->attributions[$key]);
} else {
$this->addMethod('removeAttribution', array($attribution));
}
return $this;
... | [
"public",
"function",
"removeAttribution",
"(",
"$",
"attribution",
")",
"{",
"$",
"key",
"=",
"array_search",
"(",
"$",
"attribution",
",",
"$",
"this",
"->",
"attributions",
")",
";",
"if",
"(",
"$",
"key",
"!==",
"false",
")",
"{",
"unset",
"(",
"$"... | Remove attribution.
@param string $attribution The attribution.
@return $this | [
"Remove",
"attribution",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Control/Attribution.php#L83-L94 |
191,222 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/OmnivoreLayer.php | OmnivoreLayer.setCustomLayer | public function setCustomLayer(Layer $customLayer)
{
Assertion::count($this->getMethodCalls(), 0, 'Setting custom layer has to be done before any method call.');
$this->customLayer = $customLayer;
return $this;
} | php | public function setCustomLayer(Layer $customLayer)
{
Assertion::count($this->getMethodCalls(), 0, 'Setting custom layer has to be done before any method call.');
$this->customLayer = $customLayer;
return $this;
} | [
"public",
"function",
"setCustomLayer",
"(",
"Layer",
"$",
"customLayer",
")",
"{",
"Assertion",
"::",
"count",
"(",
"$",
"this",
"->",
"getMethodCalls",
"(",
")",
",",
"0",
",",
"'Setting custom layer has to be done before any method call.'",
")",
";",
"$",
"this... | Set the custom layer.
@param Layer $customLayer The custom layer.
@return $this | [
"Set",
"the",
"custom",
"layer",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/OmnivoreLayer.php#L121-L128 |
191,223 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/OptionsTrait.php | OptionsTrait.setOptions | public function setOptions(array $options)
{
foreach ($options as $name => $value) {
$method = 'set' . ucfirst($name);
if (method_exists($this, $method)) {
$this->$method($value);
} else {
$this->options[$name] = $value;
}
... | php | public function setOptions(array $options)
{
foreach ($options as $name => $value) {
$method = 'set' . ucfirst($name);
if (method_exists($this, $method)) {
$this->$method($value);
} else {
$this->options[$name] = $value;
}
... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"method",
"=",
"'set'",
".",
"ucfirst",
"(",
"$",
"name",
")",
";",
"if",
"(",
"method... | Set options by calling options methods.
If a set<OptionName> method does not exists it ignores the option.
The setter method should handle the converting from native value to expected value.
@param array $options Options being added.
@return $this | [
"Set",
"options",
"by",
"calling",
"options",
"methods",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/OptionsTrait.php#L49-L62 |
191,224 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php | Omnivore.csv | public static function csv($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Csv($layerId, $url, $parserOptions, $customLayer);
} | php | public static function csv($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Csv($layerId, $url, $parserOptions, $customLayer);
} | [
"public",
"static",
"function",
"csv",
"(",
"$",
"layerId",
",",
"$",
"url",
",",
"$",
"parserOptions",
"=",
"array",
"(",
")",
",",
"Layer",
"$",
"customLayer",
"=",
"null",
")",
"{",
"return",
"new",
"Csv",
"(",
"$",
"layerId",
",",
"$",
"url",
"... | Create a csv file loading request.
@param string $layerId The layer id.
@param string $url The file url.
@param array $parserOptions Parser options.
@param Layer $customLayer Optional custom layer where the data is added.
@return Csv | [
"Create",
"a",
"csv",
"file",
"loading",
"request",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php#L36-L39 |
191,225 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php | Omnivore.gpx | public static function gpx($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Gpx($layerId, $url, $parserOptions, $customLayer);
} | php | public static function gpx($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Gpx($layerId, $url, $parserOptions, $customLayer);
} | [
"public",
"static",
"function",
"gpx",
"(",
"$",
"layerId",
",",
"$",
"url",
",",
"$",
"parserOptions",
"=",
"array",
"(",
")",
",",
"Layer",
"$",
"customLayer",
"=",
"null",
")",
"{",
"return",
"new",
"Gpx",
"(",
"$",
"layerId",
",",
"$",
"url",
"... | Create a gpx file loading request.
@param string $layerId The layer id.
@param string $url The file url.
@param array $parserOptions Parser options.
@param Layer $customLayer Optional custom layer where the data is added.
@return Gpx | [
"Create",
"a",
"gpx",
"file",
"loading",
"request",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php#L64-L67 |
191,226 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php | Omnivore.geojson | public static function geojson($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new GeoJson($layerId, $url, $parserOptions, $customLayer);
} | php | public static function geojson($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new GeoJson($layerId, $url, $parserOptions, $customLayer);
} | [
"public",
"static",
"function",
"geojson",
"(",
"$",
"layerId",
",",
"$",
"url",
",",
"$",
"parserOptions",
"=",
"array",
"(",
")",
",",
"Layer",
"$",
"customLayer",
"=",
"null",
")",
"{",
"return",
"new",
"GeoJson",
"(",
"$",
"layerId",
",",
"$",
"u... | Create a geoJSON file loading request.
@param string $layerId The layer id.
@param string $url The file url.
@param array $parserOptions Parser options.
@param Layer $customLayer Optional custom layer where the data is added.
@return GeoJson | [
"Create",
"a",
"geoJSON",
"file",
"loading",
"request",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php#L79-L82 |
191,227 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php | Omnivore.wkt | public static function wkt($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Wkt($layerId, $url, $parserOptions, $customLayer);
} | php | public static function wkt($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Wkt($layerId, $url, $parserOptions, $customLayer);
} | [
"public",
"static",
"function",
"wkt",
"(",
"$",
"layerId",
",",
"$",
"url",
",",
"$",
"parserOptions",
"=",
"array",
"(",
")",
",",
"Layer",
"$",
"customLayer",
"=",
"null",
")",
"{",
"return",
"new",
"Wkt",
"(",
"$",
"layerId",
",",
"$",
"url",
"... | Create a wkt file loading request.
@param string $layerId The layer id.
@param string $url The file url.
@param array $parserOptions Parser options.
@param Layer $customLayer Optional custom layer where the data is added.
@return Wkt | [
"Create",
"a",
"wkt",
"file",
"loading",
"request",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php#L94-L97 |
191,228 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php | Omnivore.topojson | public static function topojson($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new TopoJson($layerId, $url, $parserOptions, $customLayer);
} | php | public static function topojson($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new TopoJson($layerId, $url, $parserOptions, $customLayer);
} | [
"public",
"static",
"function",
"topojson",
"(",
"$",
"layerId",
",",
"$",
"url",
",",
"$",
"parserOptions",
"=",
"array",
"(",
")",
",",
"Layer",
"$",
"customLayer",
"=",
"null",
")",
"{",
"return",
"new",
"TopoJson",
"(",
"$",
"layerId",
",",
"$",
... | Create a TopoJSON file loading request.
@param string $layerId The layer id.
@param string $url The file url.
@param array $parserOptions Parser options.
@param Layer $customLayer Optional custom layer where the data is added.
@return TopoJson | [
"Create",
"a",
"TopoJSON",
"file",
"loading",
"request",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php#L109-L112 |
191,229 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php | Omnivore.polyline | public static function polyline($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Polyline($layerId, $url, $parserOptions, $customLayer);
} | php | public static function polyline($layerId, $url, $parserOptions = array(), Layer $customLayer = null)
{
return new Polyline($layerId, $url, $parserOptions, $customLayer);
} | [
"public",
"static",
"function",
"polyline",
"(",
"$",
"layerId",
",",
"$",
"url",
",",
"$",
"parserOptions",
"=",
"array",
"(",
")",
",",
"Layer",
"$",
"customLayer",
"=",
"null",
")",
"{",
"return",
"new",
"Polyline",
"(",
"$",
"layerId",
",",
"$",
... | Create a polyline file loading request.
@param string $layerId The layer id.
@param string $url The file url.
@param array $parserOptions Parser options.
@param Layer $customLayer Optional custom layer where the data is added.
@return Polyline | [
"Create",
"a",
"polyline",
"file",
"loading",
"request",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Omnivore/Omnivore.php#L124-L127 |
191,230 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php | ControlEncoder.encodeControlAttribution | public function encodeControlAttribution(Attribution $attribution, Encoder $encoder)
{
$result = $this->doControlEncode('attribution', $attribution, $encoder);
foreach ($attribution->getAttributions() as $value) {
$result .= sprintf(
'%s.addAttribution(\'%s\');' . "\n",
... | php | public function encodeControlAttribution(Attribution $attribution, Encoder $encoder)
{
$result = $this->doControlEncode('attribution', $attribution, $encoder);
foreach ($attribution->getAttributions() as $value) {
$result .= sprintf(
'%s.addAttribution(\'%s\');' . "\n",
... | [
"public",
"function",
"encodeControlAttribution",
"(",
"Attribution",
"$",
"attribution",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"doControlEncode",
"(",
"'attribution'",
",",
"$",
"attribution",
",",
"$",
"encoder",
")... | Compile attributions.
@param Attribution $attribution The attributions.
@param Encoder $encoder The encoder.
@return bool | [
"Compile",
"attributions",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php#L66-L79 |
191,231 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php | ControlEncoder.encodeControlLayers | public function encodeControlLayers(Layers $layers, Encoder $encoder)
{
return sprintf(
'%s = L.control.layers(%s, %s, %s);',
$encoder->encodeReference($layers),
$this->encodeLayersInformation($layers->getBaseLayers(), $encoder),
$this->encodeLayersInformation... | php | public function encodeControlLayers(Layers $layers, Encoder $encoder)
{
return sprintf(
'%s = L.control.layers(%s, %s, %s);',
$encoder->encodeReference($layers),
$this->encodeLayersInformation($layers->getBaseLayers(), $encoder),
$this->encodeLayersInformation... | [
"public",
"function",
"encodeControlLayers",
"(",
"Layers",
"$",
"layers",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.control.layers(%s, %s, %s);'",
",",
"$",
"encoder",
"->",
"encodeReference",
"(",
"$",
"layers",
")",
",",
"$"... | Compile layer control.
@param Layers $layers The layers control.
@param Encoder $encoder The encoder.
@return bool | [
"Compile",
"layer",
"control",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php#L89-L98 |
191,232 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php | ControlEncoder.doControlEncode | private function doControlEncode($type, Control $control, Encoder $encoder)
{
return sprintf(
'%s = L.control.%s(%s);',
$encoder->encodeReference($control),
$type,
$encoder->encodeArguments(array($control->getOptions()))
);
} | php | private function doControlEncode($type, Control $control, Encoder $encoder)
{
return sprintf(
'%s = L.control.%s(%s);',
$encoder->encodeReference($control),
$type,
$encoder->encodeArguments(array($control->getOptions()))
);
} | [
"private",
"function",
"doControlEncode",
"(",
"$",
"type",
",",
"Control",
"$",
"control",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.control.%s(%s);'",
",",
"$",
"encoder",
"->",
"encodeReference",
"(",
"$",
"control",
")",
... | Compile a control.
@param string $type The control type.
@param Control $control The control definition.
@param Encoder $encoder The encoder.
@return string | [
"Compile",
"a",
"control",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php#L119-L127 |
191,233 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php | ControlEncoder.encodeLayersInformation | private function encodeLayersInformation($layers, Encoder $encoder)
{
$prepared = '';
foreach ($layers as $layer) {
if ($prepared) {
$prepared .= ', ';
}
$prepared .= sprintf(
'%s: %s',
$encoder->encodeValue($layer... | php | private function encodeLayersInformation($layers, Encoder $encoder)
{
$prepared = '';
foreach ($layers as $layer) {
if ($prepared) {
$prepared .= ', ';
}
$prepared .= sprintf(
'%s: %s',
$encoder->encodeValue($layer... | [
"private",
"function",
"encodeLayersInformation",
"(",
"$",
"layers",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"$",
"prepared",
"=",
"''",
";",
"foreach",
"(",
"$",
"layers",
"as",
"$",
"layer",
")",
"{",
"if",
"(",
"$",
"prepared",
")",
"{",
"$",
"... | Get layer information, so that label is used.
@param Layer[] $layers The layers.
@param Encoder $encoder The encoder.
@return array | [
"Get",
"layer",
"information",
"so",
"that",
"label",
"is",
"used",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/ControlEncoder.php#L137-L154 |
191,234 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/AbstractDefinition.php | AbstractDefinition.addMethod | protected function addMethod($name, array $arguments = array())
{
$this->methods[] = new MethodCall($this, $name, $arguments);
return $this;
} | php | protected function addMethod($name, array $arguments = array())
{
$this->methods[] = new MethodCall($this, $name, $arguments);
return $this;
} | [
"protected",
"function",
"addMethod",
"(",
"$",
"name",
",",
"array",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"methods",
"[",
"]",
"=",
"new",
"MethodCall",
"(",
"$",
"this",
",",
"$",
"name",
",",
"$",
"arguments",
"... | Add a method call.
@param string $name Method name.
@param array $arguments Method arguments.
@return $this | [
"Add",
"a",
"method",
"call",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/AbstractDefinition.php#L77-L82 |
191,235 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/EncodeHelperTrait.php | EncodeHelperTrait.encodeSimpleControl | protected function encodeSimpleControl($name, AbstractControl $control, Encoder $encoder, $flags = null)
{
$buffer = sprintf(
'%s = L.%s(%s)%s',
$encoder->encodeReference($control),
$name,
$encoder->encodeValue($control->getOptions()),
$encoder->cl... | php | protected function encodeSimpleControl($name, AbstractControl $control, Encoder $encoder, $flags = null)
{
$buffer = sprintf(
'%s = L.%s(%s)%s',
$encoder->encodeReference($control),
$name,
$encoder->encodeValue($control->getOptions()),
$encoder->cl... | [
"protected",
"function",
"encodeSimpleControl",
"(",
"$",
"name",
",",
"AbstractControl",
"$",
"control",
",",
"Encoder",
"$",
"encoder",
",",
"$",
"flags",
"=",
"null",
")",
"{",
"$",
"buffer",
"=",
"sprintf",
"(",
"'%s = L.%s(%s)%s'",
",",
"$",
"encoder",
... | Encode an control.
@param string $name Control name.
@param AbstractControl $control The control object.
@param Encoder $encoder Javascript encoder.
@param null $flags Encoder flags.
@return string | [
"Encode",
"an",
"control",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/EncodeHelperTrait.php#L58-L71 |
191,236 | unclecheese/silverstripe-event-calendar | code/sfdate/sfDateTimeToolkit.php | sfDateTimeToolkit.breakdown | public static function breakdown($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
// gather individual variables
$H = date('H', $ts); // hour
$i = date('i', $ts); // minute
$s = date('s', $ts); // second
$m = date('m', $ts); // month
$d = date('d', $ts); // day
$Y ... | php | public static function breakdown($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
// gather individual variables
$H = date('H', $ts); // hour
$i = date('i', $ts); // minute
$s = date('s', $ts); // second
$m = date('m', $ts); // month
$d = date('d', $ts); // day
$Y ... | [
"public",
"static",
"function",
"breakdown",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"// gather individual variables",
"$",
"H",
... | Breaks down the individual components of the timestamp.
@param timestamp
@return array | [
"Breaks",
"down",
"the",
"individual",
"components",
"of",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfDateTimeToolkit.php#L29-L43 |
191,237 | unclecheese/silverstripe-event-calendar | code/sfdate/sfDateTimeToolkit.php | sfDateTimeToolkit.getTS | public static function getTS($value = null)
{
if ($value === null)
{
return sfDateTimeToolkit::now();
}
else if ($value instanceof sfDate)
{
return $value->get();
}
else if (!is_numeric($value))
{
return strtotime($value);
}
else if (is_numeric($value))
{
return $value;
}
throw... | php | public static function getTS($value = null)
{
if ($value === null)
{
return sfDateTimeToolkit::now();
}
else if ($value instanceof sfDate)
{
return $value->get();
}
else if (!is_numeric($value))
{
return strtotime($value);
}
else if (is_numeric($value))
{
return $value;
}
throw... | [
"public",
"static",
"function",
"getTS",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"}",
"else",
"if",
"(",
"$",
"value",
"instanceof",
"sfDat... | Retrieve the timestamp from a number of different formats.
@param mixed value to use for timestamp retrieval | [
"Retrieve",
"the",
"timestamp",
"from",
"a",
"number",
"of",
"different",
"formats",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfDateTimeToolkit.php#L62-L82 |
191,238 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/TypeEncoder.php | TypeEncoder.encodeIcon | public function encodeIcon(ImageIcon $icon, Encoder $encoder)
{
return sprintf(
'%s = L.icon(%s);',
$encoder->encodeReference($icon),
$encoder->encodeArguments(array($icon->getOptions()))
);
} | php | public function encodeIcon(ImageIcon $icon, Encoder $encoder)
{
return sprintf(
'%s = L.icon(%s);',
$encoder->encodeReference($icon),
$encoder->encodeArguments(array($icon->getOptions()))
);
} | [
"public",
"function",
"encodeIcon",
"(",
"ImageIcon",
"$",
"icon",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.icon(%s);'",
",",
"$",
"encoder",
"->",
"encodeReference",
"(",
"$",
"icon",
")",
",",
"$",
"encoder",
"->",
"en... | Encode the icon.
@param ImageIcon $icon The icon.
@param Encoder $encoder The encoder.
@return string | [
"Encode",
"the",
"icon",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/TypeEncoder.php#L48-L55 |
191,239 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/TypeEncoder.php | TypeEncoder.encodeDivIcon | public function encodeDivIcon(DivIcon $icon, Encoder $encoder)
{
return sprintf(
'%s = L.divIcon(%s);',
$encoder->encodeReference($icon),
$encoder->encodeArguments(array($icon->getOptions()))
);
} | php | public function encodeDivIcon(DivIcon $icon, Encoder $encoder)
{
return sprintf(
'%s = L.divIcon(%s);',
$encoder->encodeReference($icon),
$encoder->encodeArguments(array($icon->getOptions()))
);
} | [
"public",
"function",
"encodeDivIcon",
"(",
"DivIcon",
"$",
"icon",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.divIcon(%s);'",
",",
"$",
"encoder",
"->",
"encodeReference",
"(",
"$",
"icon",
")",
",",
"$",
"encoder",
"->",
... | Encode the div icon.
@param DivIcon $icon The div icon.
@param Encoder $encoder The encoder.
@return string | [
"Encode",
"the",
"div",
"icon",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/TypeEncoder.php#L65-L72 |
191,240 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/RasterEncoder.php | RasterEncoder.encodeTileLayer | public function encodeTileLayer(TileLayer $layer, Encoder $builder)
{
return sprintf(
'%s = L.tileLayer(%s);',
$builder->encodeReference($layer),
$builder->encodeArguments(array($layer->getUrl(), $layer->getOptions()))
);
} | php | public function encodeTileLayer(TileLayer $layer, Encoder $builder)
{
return sprintf(
'%s = L.tileLayer(%s);',
$builder->encodeReference($layer),
$builder->encodeArguments(array($layer->getUrl(), $layer->getOptions()))
);
} | [
"public",
"function",
"encodeTileLayer",
"(",
"TileLayer",
"$",
"layer",
",",
"Encoder",
"$",
"builder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.tileLayer(%s);'",
",",
"$",
"builder",
"->",
"encodeReference",
"(",
"$",
"layer",
")",
",",
"$",
"builder",
... | Encode a tile layer.
@param TileLayer $layer The layer.
@param Encoder $builder The builder.
@return bool | [
"Encode",
"a",
"tile",
"layer",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/RasterEncoder.php#L46-L53 |
191,241 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/UI/Popup.php | Popup.openOn | public function openOn(Map $map)
{
$this->map = $map;
$map->addLayer($this);
return $this->addMethod('openOn', array($map));
} | php | public function openOn(Map $map)
{
$this->map = $map;
$map->addLayer($this);
return $this->addMethod('openOn', array($map));
} | [
"public",
"function",
"openOn",
"(",
"Map",
"$",
"map",
")",
"{",
"$",
"this",
"->",
"map",
"=",
"$",
"map",
";",
"$",
"map",
"->",
"addLayer",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
"->",
"addMethod",
"(",
"'openOn'",
",",
"array",
"... | Create openOn map method.
@param Map $map The map.
@return $this | [
"Create",
"openOn",
"map",
"method",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/UI/Popup.php#L439-L445 |
191,242 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/UI/Popup.php | Popup.setLatLng | public function setLatLng(LatLng $latLng)
{
$this->latLng = $latLng;
$this->addMethod('setLatLng', array($latLng));
return $this;
} | php | public function setLatLng(LatLng $latLng)
{
$this->latLng = $latLng;
$this->addMethod('setLatLng', array($latLng));
return $this;
} | [
"public",
"function",
"setLatLng",
"(",
"LatLng",
"$",
"latLng",
")",
"{",
"$",
"this",
"->",
"latLng",
"=",
"$",
"latLng",
";",
"$",
"this",
"->",
"addMethod",
"(",
"'setLatLng'",
",",
"array",
"(",
"$",
"latLng",
")",
")",
";",
"return",
"$",
"this... | Sets the geographical point where the popup will open.
It creates the method call and sets internal the latLng property.
@param LatLng $latLng The geographical point where the popup will open.
@return $this
@see http://leafletjs.com/reference.html#popup-setlatlng | [
"Sets",
"the",
"geographical",
"point",
"where",
"the",
"popup",
"will",
"open",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/UI/Popup.php#L457-L463 |
191,243 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Control/Layers.php | Layers.removeLayer | public function removeLayer(Layer $layer)
{
$key = array_search($layer, $this->baseLayers);
if ($key !== false) {
unset($this->baseLayers[$key]);
}
$key = array_search($layer, $this->overlays);
if ($key !== false) {
unset($this->overlays[$key]);
... | php | public function removeLayer(Layer $layer)
{
$key = array_search($layer, $this->baseLayers);
if ($key !== false) {
unset($this->baseLayers[$key]);
}
$key = array_search($layer, $this->overlays);
if ($key !== false) {
unset($this->overlays[$key]);
... | [
"public",
"function",
"removeLayer",
"(",
"Layer",
"$",
"layer",
")",
"{",
"$",
"key",
"=",
"array_search",
"(",
"$",
"layer",
",",
"$",
"this",
"->",
"baseLayers",
")",
";",
"if",
"(",
"$",
"key",
"!==",
"false",
")",
"{",
"unset",
"(",
"$",
"this... | Remove a layer.
@param Layer $layer Layer to be removed.
@return $this | [
"Remove",
"a",
"layer",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Control/Layers.php#L180-L193 |
191,244 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Vector/Rectangle.php | Rectangle.jsonSerialize | public function jsonSerialize()
{
$bounds = $this->getBounds();
// No rectangle support of geojson, so create a polygon
return array(
'type' => 'Polygon',
'coordinates' => array(
array(
$bounds->getNorthEast()->toGeoJson(),
... | php | public function jsonSerialize()
{
$bounds = $this->getBounds();
// No rectangle support of geojson, so create a polygon
return array(
'type' => 'Polygon',
'coordinates' => array(
array(
$bounds->getNorthEast()->toGeoJson(),
... | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"$",
"bounds",
"=",
"$",
"this",
"->",
"getBounds",
"(",
")",
";",
"// No rectangle support of geojson, so create a polygon",
"return",
"array",
"(",
"'type'",
"=>",
"'Polygon'",
",",
"'coordinates'",
"=>",
"ar... | Get definition as feature collection.
@return Feature|FeatureCollection | [
"Get",
"definition",
"as",
"feature",
"collection",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Vector/Rectangle.php#L84-L100 |
191,245 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/Loading/LoadingControl.php | LoadingControl.setSeparate | public function setSeparate($separate)
{
if ($separate) {
$this->setOption('zoomControl', null);
}
return $this->setOption('separate', (bool) $separate);
} | php | public function setSeparate($separate)
{
if ($separate) {
$this->setOption('zoomControl', null);
}
return $this->setOption('separate', (bool) $separate);
} | [
"public",
"function",
"setSeparate",
"(",
"$",
"separate",
")",
"{",
"if",
"(",
"$",
"separate",
")",
"{",
"$",
"this",
"->",
"setOption",
"(",
"'zoomControl'",
",",
"null",
")",
";",
"}",
"return",
"$",
"this",
"->",
"setOption",
"(",
"'separate'",
",... | Set separate mode.
@param bool $separate Is separate from a zoom control.
@return $this | [
"Set",
"separate",
"mode",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/Loading/LoadingControl.php#L57-L64 |
191,246 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Assets/Collector.php | Collector.collect | public function collect(EncodeValueEvent $event)
{
$value = $event->getValue();
if ($value instanceof Definition) {
foreach ($value->getRequiredLibraries() as $library) {
if (isset($this->libraries[$library])) {
continue;
}
... | php | public function collect(EncodeValueEvent $event)
{
$value = $event->getValue();
if ($value instanceof Definition) {
foreach ($value->getRequiredLibraries() as $library) {
if (isset($this->libraries[$library])) {
continue;
}
... | [
"public",
"function",
"collect",
"(",
"EncodeValueEvent",
"$",
"event",
")",
"{",
"$",
"value",
"=",
"$",
"event",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"value",
"instanceof",
"Definition",
")",
"{",
"foreach",
"(",
"$",
"value",
"->",
"getR... | Collect all libraries.
@param EncodeValueEvent $event The subscribed event.
@return void | [
"Collect",
"all",
"libraries",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Assets/Collector.php#L86-L111 |
191,247 | stidges/country-flags | src/CountryFlag.php | CountryFlag.get | public function get($countryCode)
{
if (strlen($countryCode) !== 2) {
throw new \InvalidArgumentException('Please provide a 2 character country code.');
}
$countryCode = strtoupper($countryCode);
if (array_key_exists($countryCode, $this->aliases)) {
$country... | php | public function get($countryCode)
{
if (strlen($countryCode) !== 2) {
throw new \InvalidArgumentException('Please provide a 2 character country code.');
}
$countryCode = strtoupper($countryCode);
if (array_key_exists($countryCode, $this->aliases)) {
$country... | [
"public",
"function",
"get",
"(",
"$",
"countryCode",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"countryCode",
")",
"!==",
"2",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Please provide a 2 character country code.'",
")",
";",
"}",
"$",
... | Get the flag for the given country code.
@param string $countryCode
@return string | [
"Get",
"the",
"flag",
"for",
"the",
"given",
"country",
"code",
"."
] | 9ae96df3f4f3649716d09fa0af24c5806ac192be | https://github.com/stidges/country-flags/blob/9ae96df3f4f3649716d09fa0af24c5806ac192be/src/CountryFlag.php#L37-L50 |
191,248 | stidges/country-flags | src/CountryFlag.php | CountryFlag.setAliases | public function setAliases(array $aliases)
{
$this->aliases = [];
foreach ($aliases as $alias => $countryCode) {
$this->aliases[strtoupper($alias)] = strtoupper($countryCode);
}
} | php | public function setAliases(array $aliases)
{
$this->aliases = [];
foreach ($aliases as $alias => $countryCode) {
$this->aliases[strtoupper($alias)] = strtoupper($countryCode);
}
} | [
"public",
"function",
"setAliases",
"(",
"array",
"$",
"aliases",
")",
"{",
"$",
"this",
"->",
"aliases",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aliases",
"as",
"$",
"alias",
"=>",
"$",
"countryCode",
")",
"{",
"$",
"this",
"->",
"aliases",
"[",
... | Set the country code aliases.
@param array $aliases | [
"Set",
"the",
"country",
"code",
"aliases",
"."
] | 9ae96df3f4f3649716d09fa0af24c5806ac192be | https://github.com/stidges/country-flags/blob/9ae96df3f4f3649716d09fa0af24c5806ac192be/src/CountryFlag.php#L57-L64 |
191,249 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Plugins/LeafletProviders/Provider.php | Provider.encodeName | protected function encodeName()
{
$name = $this->getProvider();
if ($this->getVariant()) {
$name .= '.' . $this->getVariant();
return $name;
}
return $name;
} | php | protected function encodeName()
{
$name = $this->getProvider();
if ($this->getVariant()) {
$name .= '.' . $this->getVariant();
return $name;
}
return $name;
} | [
"protected",
"function",
"encodeName",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getProvider",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getVariant",
"(",
")",
")",
"{",
"$",
"name",
".=",
"'.'",
".",
"$",
"this",
"->",
"getVariant",... | Encode provider name.
@return string | [
"Encode",
"provider",
"name",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Plugins/LeafletProviders/Provider.php#L122-L133 |
191,250 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/AbstractLayer.php | AbstractLayer.addTo | public function addTo(Map $map)
{
$this->map = $map;
$map->addLayer($this);
return $this->addMethod('addTo', array($map));
} | php | public function addTo(Map $map)
{
$this->map = $map;
$map->addLayer($this);
return $this->addMethod('addTo', array($map));
} | [
"public",
"function",
"addTo",
"(",
"Map",
"$",
"map",
")",
"{",
"$",
"this",
"->",
"map",
"=",
"$",
"map",
";",
"$",
"map",
"->",
"addLayer",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
"->",
"addMethod",
"(",
"'addTo'",
",",
"array",
"("... | Add layer to the map.
Instead create an addTo method, it's assigned to the map.
This is required so that the encoder knows the relation between the map and the layer.
@param Map $map The leaflet map.
@return $this | [
"Add",
"layer",
"to",
"the",
"map",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/AbstractLayer.php#L43-L49 |
191,251 | unclecheese/silverstripe-event-calendar | code/sfdate/sfDate.php | sfDate.retrieve | public function retrieve($unit = sfTime::DAY)
{
switch ($unit)
{
case sfTime::SECOND:
return date('s', $this->ts);
case sfTime::MINUTE:
return date('i', $this->ts);
case sfTime::HOUR:
return date('H', $this->ts);
case sfTime::DAY:
return date('d', $this->ts);
case sfTime::WEEK:
r... | php | public function retrieve($unit = sfTime::DAY)
{
switch ($unit)
{
case sfTime::SECOND:
return date('s', $this->ts);
case sfTime::MINUTE:
return date('i', $this->ts);
case sfTime::HOUR:
return date('H', $this->ts);
case sfTime::DAY:
return date('d', $this->ts);
case sfTime::WEEK:
r... | [
"public",
"function",
"retrieve",
"(",
"$",
"unit",
"=",
"sfTime",
"::",
"DAY",
")",
"{",
"switch",
"(",
"$",
"unit",
")",
"{",
"case",
"sfTime",
"::",
"SECOND",
":",
"return",
"date",
"(",
"'s'",
",",
"$",
"this",
"->",
"ts",
")",
";",
"case",
"... | Retrieves the given unit of time from the timestamp.
@param int unit of time (accepts sfTime constants).
@return int the unit of time
@throws sfDateTimeException | [
"Retrieves",
"the",
"given",
"unit",
"of",
"time",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfDate.php#L111-L140 |
191,252 | unclecheese/silverstripe-event-calendar | code/sfdate/sfDate.php | sfDate.set | public function set($value = null)
{
$ts = sfDateTimeToolkit::getTS($value);
$this->ts = $ts;
if ($this->init === null)
{
$this->init = $ts;
}
return $this;
} | php | public function set($value = null)
{
$ts = sfDateTimeToolkit::getTS($value);
$this->ts = $ts;
if ($this->init === null)
{
$this->init = $ts;
}
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"getTS",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"ts",
"=",
"$",
"ts",
";",
"if",
"(",
"$",
"this",
"->",
"init",
"===",
"... | Sets the timestamp value of this sfDate instance.
This function accepts several froms of a date value:
- timestamp
- string, parsed with <code>strtotime</code>
- sfDate object
@return sfDate the modified object, for chainability | [
"Sets",
"the",
"timestamp",
"value",
"of",
"this",
"sfDate",
"instance",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfDate.php#L162-L173 |
191,253 | unclecheese/silverstripe-event-calendar | code/sfdate/sfDate.php | sfDate.cmp | public function cmp($value)
{
$ts = sfDateTimeToolkit::getTS($value);
if ($this->ts < $ts)
{
// less than
return -1;
}
else if ($this->ts > $ts)
{
// greater than
return 1;
}
// equal to
return 0;
} | php | public function cmp($value)
{
$ts = sfDateTimeToolkit::getTS($value);
if ($this->ts < $ts)
{
// less than
return -1;
}
else if ($this->ts > $ts)
{
// greater than
return 1;
}
// equal to
return 0;
} | [
"public",
"function",
"cmp",
"(",
"$",
"value",
")",
"{",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"getTS",
"(",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"ts",
"<",
"$",
"ts",
")",
"{",
"// less than",
"return",
"-",
"1",
";",
"}",... | Compares two date values.
@param mixed timestamp, string, or sfDate object
@return int -1, 0, or 1 | [
"Compares",
"two",
"date",
"values",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfDate.php#L193-L210 |
191,254 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/MapEncoder.php | MapEncoder.getStack | public function getStack(GetObjectStackEvent $event)
{
$stack = array();
$value = $event->getValue();
if ($value instanceof Map) {
foreach ($value->getControls() as $control) {
if ($control instanceof Layers) {
$this->addLayersToStack($control... | php | public function getStack(GetObjectStackEvent $event)
{
$stack = array();
$value = $event->getValue();
if ($value instanceof Map) {
foreach ($value->getControls() as $control) {
if ($control instanceof Layers) {
$this->addLayersToStack($control... | [
"public",
"function",
"getStack",
"(",
"GetObjectStackEvent",
"$",
"event",
")",
"{",
"$",
"stack",
"=",
"array",
"(",
")",
";",
"$",
"value",
"=",
"$",
"event",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"value",
"instanceof",
"Map",
")",
"{",... | Get object stack of the map as far as possible.
@param GetObjectStackEvent $event The subscribed event.
@return void | [
"Get",
"object",
"stack",
"of",
"the",
"map",
"as",
"far",
"as",
"possible",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/MapEncoder.php#L58-L77 |
191,255 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/MapEncoder.php | MapEncoder.encodeMap | public function encodeMap(Map $map, Encoder $encoder)
{
$output = $encoder->getOutput();
$hash = spl_object_hash($map);
if (!isset($this->initialized[$hash])) {
$output->prepend(
sprintf(
'%s = L.map(%s);',
$encoder->enco... | php | public function encodeMap(Map $map, Encoder $encoder)
{
$output = $encoder->getOutput();
$hash = spl_object_hash($map);
if (!isset($this->initialized[$hash])) {
$output->prepend(
sprintf(
'%s = L.map(%s);',
$encoder->enco... | [
"public",
"function",
"encodeMap",
"(",
"Map",
"$",
"map",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"$",
"output",
"=",
"$",
"encoder",
"->",
"getOutput",
"(",
")",
";",
"$",
"hash",
"=",
"spl_object_hash",
"(",
"$",
"map",
")",
";",
"if",
"(",
"!... | Compile a map.
@param Map $map The map.
@param Encoder $encoder The builder.
@return void | [
"Compile",
"a",
"map",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/MapEncoder.php#L87-L113 |
191,256 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/MapEncoder.php | MapEncoder.addLayersToStack | private function addLayersToStack($layers, &$stack)
{
foreach ($layers as $layer) {
if ($layer instanceof LayerGroup) {
$this->addLayersToStack($layer->getLayers(), $stack);
}
$stack[] = $layer;
}
} | php | private function addLayersToStack($layers, &$stack)
{
foreach ($layers as $layer) {
if ($layer instanceof LayerGroup) {
$this->addLayersToStack($layer->getLayers(), $stack);
}
$stack[] = $layer;
}
} | [
"private",
"function",
"addLayersToStack",
"(",
"$",
"layers",
",",
"&",
"$",
"stack",
")",
"{",
"foreach",
"(",
"$",
"layers",
"as",
"$",
"layer",
")",
"{",
"if",
"(",
"$",
"layer",
"instanceof",
"LayerGroup",
")",
"{",
"$",
"this",
"->",
"addLayersTo... | Add layers to to the stack.
@param array $layers The layers to be added.
@param array $stack The object stack being built.
@return void | [
"Add",
"layers",
"to",
"to",
"the",
"stack",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/MapEncoder.php#L133-L142 |
191,257 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Common.php | Common.getAuthEnv | public static function getAuthEnv($keys = null, $debug = false)
{
if (!$keys) {
$msg = 'Keys parameter is required. (Keys to set from env)';
throw new ApiException($msg);
}
/*
* Some tests require all parameters to be from environment.
* Otherwise, ... | php | public static function getAuthEnv($keys = null, $debug = false)
{
if (!$keys) {
$msg = 'Keys parameter is required. (Keys to set from env)';
throw new ApiException($msg);
}
/*
* Some tests require all parameters to be from environment.
* Otherwise, ... | [
"public",
"static",
"function",
"getAuthEnv",
"(",
"$",
"keys",
"=",
"null",
",",
"$",
"debug",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"keys",
")",
"{",
"$",
"msg",
"=",
"'Keys parameter is required. (Keys to set from env)'",
";",
"throw",
"new",
"Ap... | Get an auth object from the local ENV or test data.
@param array $keys The authentication keys to set.
@param string $debug Enable debug.
@return array(Auth, string) Authentication object and bool if pulled from ENV.
@throws MyAllocator\phpsdk\src\Exception\ApiException If no keys supplied. | [
"Get",
"an",
"auth",
"object",
"from",
"the",
"local",
"ENV",
"or",
"test",
"data",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Common.php#L46-L93 |
191,258 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/GeoJson/FeatureTrait.php | FeatureTrait.createFeature | protected function createFeature()
{
$feature = new Feature($this, $this->getId());
$feature->setProperty('type', lcfirst(static::getType()));
$feature->setProperty('options', $this->getOptions());
return $feature;
} | php | protected function createFeature()
{
$feature = new Feature($this, $this->getId());
$feature->setProperty('type', lcfirst(static::getType()));
$feature->setProperty('options', $this->getOptions());
return $feature;
} | [
"protected",
"function",
"createFeature",
"(",
")",
"{",
"$",
"feature",
"=",
"new",
"Feature",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"feature",
"->",
"setProperty",
"(",
"'type'",
",",
"lcfirst",
"(",
"static",
... | Create feature of the given definition.
@return Feature | [
"Create",
"feature",
"of",
"the",
"given",
"definition",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/GeoJson/FeatureTrait.php#L29-L36 |
191,259 | MyAllocator/myallocator-pms-php | src/MyAllocator/Object/Auth.php | Auth.getAuthKeyVar | public function getAuthKeyVar($key)
{
if (!isset($this->authKeyMap[$key])) {
$msg = 'Invalid Auth key requested: ' . $key;
throw new ApiException($msg);
}
$property = $this->authKeyMap[$key];
return $this->$property;
} | php | public function getAuthKeyVar($key)
{
if (!isset($this->authKeyMap[$key])) {
$msg = 'Invalid Auth key requested: ' . $key;
throw new ApiException($msg);
}
$property = $this->authKeyMap[$key];
return $this->$property;
} | [
"public",
"function",
"getAuthKeyVar",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"authKeyMap",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"msg",
"=",
"'Invalid Auth key requested: '",
".",
"$",
"key",
";",
"throw",
"n... | Map an API authentication key to the Auth object's
variable and return it.
@param string $key The API authentication key.
@return mixed The requested API variable.
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Map",
"an",
"API",
"authentication",
"key",
"to",
"the",
"Auth",
"object",
"s",
"variable",
"and",
"return",
"it",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Object/Auth.php#L100-L109 |
191,260 | MyAllocator/myallocator-pms-php | src/MyAllocator/Object/Auth.php | Auth.getAuthKeyByVar | public function getAuthKeyByVar($property)
{
if (!($key = array_search($property, $this->authKeyMap))) {
$msg = 'Invalid Auth property requested: ' . $property;
throw new ApiException($msg);
}
return $key;
} | php | public function getAuthKeyByVar($property)
{
if (!($key = array_search($property, $this->authKeyMap))) {
$msg = 'Invalid Auth property requested: ' . $property;
throw new ApiException($msg);
}
return $key;
} | [
"public",
"function",
"getAuthKeyByVar",
"(",
"$",
"property",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"key",
"=",
"array_search",
"(",
"$",
"property",
",",
"$",
"this",
"->",
"authKeyMap",
")",
")",
")",
"{",
"$",
"msg",
"=",
"'Invalid Auth property reques... | Get an authentication key by variable name.
@param string $property The property/variable name.
@return string The authentication key.
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Get",
"an",
"authentication",
"key",
"by",
"variable",
"name",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Object/Auth.php#L120-L128 |
191,261 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.add | public static function add($ts = null, $num = 1, $unit = sfTime::DAY)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
// gather individual variables for readability and maintainability
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
// determine which unit of tim... | php | public static function add($ts = null, $num = 1, $unit = sfTime::DAY)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
// gather individual variables for readability and maintainability
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
// determine which unit of tim... | [
"public",
"static",
"function",
"add",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
",",
"$",
"unit",
"=",
"sfTime",
"::",
"DAY",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit... | Adds the specified number of given units of time to the given date.
<b>Example:</b>
<code>
// tomorrow
$dt = sfTime::add();
// day after
$dt = sfTime::add($mydate);
// 5 days after
$dt = sfTime::add($mydate, 5);
// 2 months after
$dt = sfTime::add($mydate, 2, sfTime::MONTH);
// 4 weeks after
$dt = sfTime::add($mydate,... | [
"Adds",
"the",
"specified",
"number",
"of",
"given",
"units",
"of",
"time",
"to",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L89-L125 |
191,262 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtract | public static function subtract($ts = null, $num = 1, $unit = sfTime::DAY)
{
return sfTime::add($ts, $num * -1, $unit);
} | php | public static function subtract($ts = null, $num = 1, $unit = sfTime::DAY)
{
return sfTime::add($ts, $num * -1, $unit);
} | [
"public",
"static",
"function",
"subtract",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
",",
"$",
"unit",
"=",
"sfTime",
"::",
"DAY",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
"*",
"-",
"1",
",",
... | Subtracts the specified number of given units of time from the given date.
<b>Example:</b>
<code>
// yesterday
$dt = sfTime::subtract();
// day before
$dt = sfTime::subtract($mydate);
// 5 days before
$dt = sfTime::subtract($mydate, 5);
// 2 months before
$dt = sfTime::subtract($mydate, 2, sfTime::MONTH);
// 4 weeks b... | [
"Subtracts",
"the",
"specified",
"number",
"of",
"given",
"units",
"of",
"time",
"from",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L151-L154 |
191,263 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.clearTime | public static function clearTime($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
return mktime(0, 0, 0, $m, $d, $Y);
} | php | public static function clearTime($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
return mktime(0, 0, 0, $m, $d, $Y);
} | [
"public",
"static",
"function",
"clearTime",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"list",
"(",
"$",
"H",
",",
"$",
"i"... | Returns the timestamp with the date but without the time of day.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"with",
"the",
"date",
"but",
"without",
"the",
"time",
"of",
"day",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L162-L170 |
191,264 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.clearDate | public static function clearDate($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
return mktime($H, $i, $s, 0, 0, 0);
} | php | public static function clearDate($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
return mktime($H, $i, $s, 0, 0, 0);
} | [
"public",
"static",
"function",
"clearDate",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"list",
"(",
"$",
"H",
",",
"$",
"i"... | Returns the timestamp with the time of day but without the date.
@deprecated This is a deprecated function. Do not use!
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"with",
"the",
"time",
"of",
"day",
"but",
"without",
"the",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L180-L188 |
191,265 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.setDay | public static function setDay($ts = null, $day = 1)
{
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
return mktime($H, $i, $s, $m, $day, $Y);
} | php | public static function setDay($ts = null, $day = 1)
{
list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
return mktime($H, $i, $s, $m, $day, $Y);
} | [
"public",
"static",
"function",
"setDay",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"day",
"=",
"1",
")",
"{",
"list",
"(",
"$",
"H",
",",
"$",
"i",
",",
"$",
"s",
",",
"$",
"m",
",",
"$",
"d",
",",
"$",
"Y",
")",
"=",
"sfDateTimeToolkit",
"::... | Set the day value of this timestamp.
@param timestamp
@param int
@return timestamp | [
"Set",
"the",
"day",
"value",
"of",
"this",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L281-L286 |
191,266 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addSecond | public static function addSecond($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::SECOND);
} | php | public static function addSecond($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::SECOND);
} | [
"public",
"static",
"function",
"addSecond",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"SECOND",
")",
";",
"}"
] | Adds the specified number of seconds to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"seconds",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L349-L352 |
191,267 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractSecond | public static function subtractSecond($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::SECOND);
} | php | public static function subtractSecond($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::SECOND);
} | [
"public",
"static",
"function",
"subtractSecond",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"SECOND",
")",
";",
"}"
] | Subtracts the specified number of seconds from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"seconds",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L361-L364 |
191,268 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addMinute | public static function addMinute($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::MINUTE);
} | php | public static function addMinute($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::MINUTE);
} | [
"public",
"static",
"function",
"addMinute",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"MINUTE",
")",
";",
"}"
] | Adds the specified number of minutes to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"minutes",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L373-L376 |
191,269 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractMinute | public static function subtractMinute($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::MINUTE);
} | php | public static function subtractMinute($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::MINUTE);
} | [
"public",
"static",
"function",
"subtractMinute",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"MINUTE",
")",
";",
"}"
] | Subtracts the specified number of minutes from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"minutes",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L385-L388 |
191,270 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addHour | public static function addHour($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::HOUR);
} | php | public static function addHour($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::HOUR);
} | [
"public",
"static",
"function",
"addHour",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"HOUR",
")",
";",
"}"
] | Adds the specified number of hours to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"hours",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L397-L400 |
191,271 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractHour | public static function subtractHour($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::HOUR);
} | php | public static function subtractHour($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::HOUR);
} | [
"public",
"static",
"function",
"subtractHour",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"HOUR",
")",
";",
"}"
] | Subtracts the specified number of hours from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"hours",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L409-L412 |
191,272 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addDay | public static function addDay($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::DAY);
} | php | public static function addDay($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::DAY);
} | [
"public",
"static",
"function",
"addDay",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"DAY",
")",
";",
"}"
] | Adds the specified number of days to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"days",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L421-L424 |
191,273 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractDay | public static function subtractDay($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::DAY);
} | php | public static function subtractDay($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::DAY);
} | [
"public",
"static",
"function",
"subtractDay",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"DAY",
")",
";",
"}"
] | Subtracts the specified number of days from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"days",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L433-L436 |
191,274 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addWeek | public static function addWeek($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::WEEK);
} | php | public static function addWeek($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::WEEK);
} | [
"public",
"static",
"function",
"addWeek",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"WEEK",
")",
";",
"}"
] | Adds the specified number of weeks to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"weeks",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L445-L448 |
191,275 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractWeek | public static function subtractWeek($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::WEEK);
} | php | public static function subtractWeek($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::WEEK);
} | [
"public",
"static",
"function",
"subtractWeek",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"WEEK",
")",
";",
"}"
] | Subtracts the specified number of weeks from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"weeks",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L457-L460 |
191,276 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addMonth | public static function addMonth($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::MONTH);
} | php | public static function addMonth($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::MONTH);
} | [
"public",
"static",
"function",
"addMonth",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"MONTH",
")",
";",
"}"
] | Adds the specified number of months to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"months",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L469-L472 |
191,277 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractMonth | public static function subtractMonth($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::MONTH);
} | php | public static function subtractMonth($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::MONTH);
} | [
"public",
"static",
"function",
"subtractMonth",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"MONTH",
")",
";",
"}"
] | Subtracts the specified number of months from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"months",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L481-L484 |
191,278 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addQuarter | public static function addQuarter($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::QUARTER);
} | php | public static function addQuarter($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::QUARTER);
} | [
"public",
"static",
"function",
"addQuarter",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"QUARTER",
")",
";",
"}"
] | Adds the specified number of quarters to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"quarters",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L493-L496 |
191,279 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractQuarter | public static function subtractQuarter($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::QUARTER);
} | php | public static function subtractQuarter($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::QUARTER);
} | [
"public",
"static",
"function",
"subtractQuarter",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"QUARTER",
")",
";",
"}"
] | Subtracts the specified number of quarters from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"quarters",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L505-L508 |
191,280 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addYear | public static function addYear($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::YEAR);
} | php | public static function addYear($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::YEAR);
} | [
"public",
"static",
"function",
"addYear",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"YEAR",
")",
";",
"}"
] | Adds the specified number of years to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"years",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L517-L520 |
191,281 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractYear | public static function subtractYear($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::YEAR);
} | php | public static function subtractYear($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::YEAR);
} | [
"public",
"static",
"function",
"subtractYear",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"YEAR",
")",
";",
"}"
] | Subtracts the specified number of years from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"years",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L529-L532 |
191,282 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addDecade | public static function addDecade($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::DECADE);
} | php | public static function addDecade($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::DECADE);
} | [
"public",
"static",
"function",
"addDecade",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"DECADE",
")",
";",
"}"
] | Adds the specified number of decades to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"decades",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L541-L544 |
191,283 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractDecade | public static function subtractDecade($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::DECADE);
} | php | public static function subtractDecade($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::DECADE);
} | [
"public",
"static",
"function",
"subtractDecade",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"DECADE",
")",
";",
"}"
] | Subtracts the specified number of decades from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"decades",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L553-L556 |
191,284 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addCentury | public static function addCentury($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::CENTURY);
} | php | public static function addCentury($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::CENTURY);
} | [
"public",
"static",
"function",
"addCentury",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"CENTURY",
")",
";",
"}"
] | Adds the specified number of centuries to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"centuries",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L565-L568 |
191,285 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractCentury | public static function subtractCentury($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::CENTURY);
} | php | public static function subtractCentury($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::CENTURY);
} | [
"public",
"static",
"function",
"subtractCentury",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"CENTURY",
")",
";",
"}"
] | Subtracts the specified number of centuries from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"centuries",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L577-L580 |
191,286 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.addMillenium | public static function addMillenium($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::MILLENIUM);
} | php | public static function addMillenium($ts = null, $num = 1)
{
return sfTime::add($ts, $num, sfTime::MILLENIUM);
} | [
"public",
"static",
"function",
"addMillenium",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"add",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"MILLENIUM",
")",
";",
"}"
] | Adds the specified number of millenia to the timestamp.
@param timestamp
@param int
@return timestamp | [
"Adds",
"the",
"specified",
"number",
"of",
"millenia",
"to",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L589-L592 |
191,287 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.subtractMillenium | public static function subtractMillenium($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::MILLENIUM);
} | php | public static function subtractMillenium($ts = null, $num = 1)
{
return sfTime::subtract($ts, $num, sfTime::MILLENIUM);
} | [
"public",
"static",
"function",
"subtractMillenium",
"(",
"$",
"ts",
"=",
"null",
",",
"$",
"num",
"=",
"1",
")",
"{",
"return",
"sfTime",
"::",
"subtract",
"(",
"$",
"ts",
",",
"$",
"num",
",",
"sfTime",
"::",
"MILLENIUM",
")",
";",
"}"
] | Subtracts the specified number of millenia from the timestamp.
@param timestamp
@param int
@return timestamp | [
"Subtracts",
"the",
"specified",
"number",
"of",
"millenia",
"from",
"the",
"timestamp",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L601-L604 |
191,288 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.firstDayOfWeek | public static function firstDayOfWeek($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
return sfTime::subtractDay($ts, date('w', $ts));
} | php | public static function firstDayOfWeek($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
return sfTime::subtractDay($ts, date('w', $ts));
} | [
"public",
"static",
"function",
"firstDayOfWeek",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"return",
"sfTime",
"::",
"subtractDa... | Returns the timestamp for first day of the week for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"first",
"day",
"of",
"the",
"week",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L612-L618 |
191,289 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.finalDayOfWeek | public static function finalDayOfWeek($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfWeek(sfTime::addWeek($ts)));
} | php | public static function finalDayOfWeek($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfWeek(sfTime::addWeek($ts)));
} | [
"public",
"static",
"function",
"finalDayOfWeek",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"return",
"sfTime",
"::",
"subtractDay",
"(",
"sfTime",
"::",
"firstDayOfWeek",
"(",
"sfTime",
"::",
"addWeek",
"(",
"$",
"ts",
")",
")",
")",
";",
"}"
] | Returns the timestamp for last day of the week for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"last",
"day",
"of",
"the",
"week",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L626-L629 |
191,290 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.firstDayOfMonth | public static function firstDayOfMonth($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
return sfTime::subtractDay($ts, date('d', $ts) - 1);
} | php | public static function firstDayOfMonth($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
return sfTime::subtractDay($ts, date('d', $ts) - 1);
} | [
"public",
"static",
"function",
"firstDayOfMonth",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"return",
"sfTime",
"::",
"subtractD... | Returns the timestamp for first day of the month for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"first",
"day",
"of",
"the",
"month",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L637-L643 |
191,291 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.finalDayOfMonth | public static function finalDayOfMonth($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfMonth(sfTime::addMonth($ts)));
} | php | public static function finalDayOfMonth($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfMonth(sfTime::addMonth($ts)));
} | [
"public",
"static",
"function",
"finalDayOfMonth",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"return",
"sfTime",
"::",
"subtractDay",
"(",
"sfTime",
"::",
"firstDayOfMonth",
"(",
"sfTime",
"::",
"addMonth",
"(",
"$",
"ts",
")",
")",
")",
";",
"}"
] | Returns the timestamp for last day of the month for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"last",
"day",
"of",
"the",
"month",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L651-L654 |
191,292 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.firstDayOfQuarter | public static function firstDayOfQuarter($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
// variables for computation
$month = date('m', $ts);
$quarter = ceil($month / 3) - 1; // zero based quarter
return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), $month - (... | php | public static function firstDayOfQuarter($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
// variables for computation
$month = date('m', $ts);
$quarter = ceil($month / 3) - 1; // zero based quarter
return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), $month - (... | [
"public",
"static",
"function",
"firstDayOfQuarter",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"// variables for computation",
"$",
... | Returns the timestamp for first day of thequarter for the given date.
NOTE: Computes the quarter as:
<code>
$quarter = ceil(date('m', $ts) / 3); // 1 - 4
</code>
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"first",
"day",
"of",
"thequarter",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L667-L677 |
191,293 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.finalDayOfQuarter | public static function finalDayOfQuarter($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfQuarter(sfTime::addQuarter($ts)));
} | php | public static function finalDayOfQuarter($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfQuarter(sfTime::addQuarter($ts)));
} | [
"public",
"static",
"function",
"finalDayOfQuarter",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"return",
"sfTime",
"::",
"subtractDay",
"(",
"sfTime",
"::",
"firstDayOfQuarter",
"(",
"sfTime",
"::",
"addQuarter",
"(",
"$",
"ts",
")",
")",
")",
";",
"}"
] | Returns the timestamp for last day of the quarter for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"last",
"day",
"of",
"the",
"quarter",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L685-L688 |
191,294 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.firstDayOfYear | public static function firstDayOfYear($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), date('m', $ts) - 1);
} | php | public static function firstDayOfYear($ts = null)
{
// default to now
if ($ts === null) $ts = sfDateTimeToolkit::now();
return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), date('m', $ts) - 1);
} | [
"public",
"static",
"function",
"firstDayOfYear",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"// default to now",
"if",
"(",
"$",
"ts",
"===",
"null",
")",
"$",
"ts",
"=",
"sfDateTimeToolkit",
"::",
"now",
"(",
")",
";",
"return",
"sfTime",
"::",
"subtractMo... | Returns the timestamp for first day of the year for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"first",
"day",
"of",
"the",
"year",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L696-L702 |
191,295 | unclecheese/silverstripe-event-calendar | code/sfdate/sfTime.php | sfTime.finalDayOfYear | public static function finalDayOfYear($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfYear(sfTime::addYear($ts)));
} | php | public static function finalDayOfYear($ts = null)
{
return sfTime::subtractDay(sfTime::firstDayOfYear(sfTime::addYear($ts)));
} | [
"public",
"static",
"function",
"finalDayOfYear",
"(",
"$",
"ts",
"=",
"null",
")",
"{",
"return",
"sfTime",
"::",
"subtractDay",
"(",
"sfTime",
"::",
"firstDayOfYear",
"(",
"sfTime",
"::",
"addYear",
"(",
"$",
"ts",
")",
")",
")",
";",
"}"
] | Returns the timestamp for last day of the year for the given date.
@param timestamp
@return timestamp | [
"Returns",
"the",
"timestamp",
"for",
"last",
"day",
"of",
"the",
"year",
"for",
"the",
"given",
"date",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/sfdate/sfTime.php#L710-L713 |
191,296 | MyAllocator/myallocator-pms-php | src/MyAllocator/Api/MaApi.php | MaApi.getAuth | public function getAuth($errorOnNull = false)
{
if ($errorOnNull && !$this->auth) {
$msg = 'No Auth object provided. (HINT: Set your Auth data using '
. '"$API->setAuth(Auth $auth)" or $API\' constructor. '
. 'See https://TODO for details.';
throw ... | php | public function getAuth($errorOnNull = false)
{
if ($errorOnNull && !$this->auth) {
$msg = 'No Auth object provided. (HINT: Set your Auth data using '
. '"$API->setAuth(Auth $auth)" or $API\' constructor. '
. 'See https://TODO for details.';
throw ... | [
"public",
"function",
"getAuth",
"(",
"$",
"errorOnNull",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"errorOnNull",
"&&",
"!",
"$",
"this",
"->",
"auth",
")",
"{",
"$",
"msg",
"=",
"'No Auth object provided. (HINT: Set your Auth data using '",
".",
"'\"$API->setAu... | Get the authentication object.
@param string $errorOnNull If true, throw an exception if auth null.
@return MyAllocator\phpsdk\src\Object\Auth API Authentication object.
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Get",
"the",
"authentication",
"object",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Api/MaApi.php#L157-L167 |
191,297 | MyAllocator/myallocator-pms-php | src/MyAllocator/Api/MaApi.php | MaApi.validateApiParameters | private function validateApiParameters($keys = null, $params = null)
{
// Assert API has defined an id/endpoint
$this->assertApiId();
// Assert API keys array structure is valid
$this->assertKeysArrayValid($keys);
// Assert keys array has minimum required optional parameter... | php | private function validateApiParameters($keys = null, $params = null)
{
// Assert API has defined an id/endpoint
$this->assertApiId();
// Assert API keys array structure is valid
$this->assertKeysArrayValid($keys);
// Assert keys array has minimum required optional parameter... | [
"private",
"function",
"validateApiParameters",
"(",
"$",
"keys",
"=",
"null",
",",
"$",
"params",
"=",
"null",
")",
"{",
"// Assert API has defined an id/endpoint",
"$",
"this",
"->",
"assertApiId",
"(",
")",
";",
"// Assert API keys array structure is valid",
"$",
... | Validate authentication and argument parameters for an API.
@param array $keys Array of required and optional
authentication and argument keys (string) for API method.
@param array $params API specific parameters.
@return array Validated API parameters. | [
"Validate",
"authentication",
"and",
"argument",
"parameters",
"for",
"an",
"API",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Api/MaApi.php#L273-L295 |
191,298 | MyAllocator/myallocator-pms-php | src/MyAllocator/Api/MaApi.php | MaApi.assertKeysArrayValid | private function assertKeysArrayValid($keys = null)
{
if ((!$keys) ||
(!is_array($keys)) ||
(!isset($keys['auth'])) ||
(!is_array($keys['auth'])) ||
(!isset($keys['auth']['req'])) ||
(!is_array($keys['auth']['req'])) ||
(!isset($keys[... | php | private function assertKeysArrayValid($keys = null)
{
if ((!$keys) ||
(!is_array($keys)) ||
(!isset($keys['auth'])) ||
(!is_array($keys['auth'])) ||
(!isset($keys['auth']['req'])) ||
(!is_array($keys['auth']['req'])) ||
(!isset($keys[... | [
"private",
"function",
"assertKeysArrayValid",
"(",
"$",
"keys",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"!",
"$",
"keys",
")",
"||",
"(",
"!",
"is_array",
"(",
"$",
"keys",
")",
")",
"||",
"(",
"!",
"isset",
"(",
"$",
"keys",
"[",
"'auth'",
"]",
... | Assert required API keys exist and are valid.
@param array $keys Array of required and optional
authentication and argument keys (string) for API method. | [
"Assert",
"required",
"API",
"keys",
"exist",
"and",
"are",
"valid",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Api/MaApi.php#L315-L338 |
191,299 | MyAllocator/myallocator-pms-php | src/MyAllocator/Api/MaApi.php | MaApi.setAuthenticationParameters | private function setAuthenticationParameters(
$keys = null,
$params = null,
$type = 'req'
) {
if (!empty($keys['auth'][$type])) {
if ($this->auth == null) {
$msg = 'No Auth object provided. (HINT: Set your Auth data using '
. '"$API->... | php | private function setAuthenticationParameters(
$keys = null,
$params = null,
$type = 'req'
) {
if (!empty($keys['auth'][$type])) {
if ($this->auth == null) {
$msg = 'No Auth object provided. (HINT: Set your Auth data using '
. '"$API->... | [
"private",
"function",
"setAuthenticationParameters",
"(",
"$",
"keys",
"=",
"null",
",",
"$",
"params",
"=",
"null",
",",
"$",
"type",
"=",
"'req'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"keys",
"[",
"'auth'",
"]",
"[",
"$",
"type",
"]",
")... | Validate and set required authentication parameters from Auth object.
@param array $keys Array of required and optional
authentication and argument keys (string) for API method.
@param array $params API specific parameters.
@param string $type The type of authentication parameters to
process (optional or required).
@... | [
"Validate",
"and",
"set",
"required",
"authentication",
"parameters",
"from",
"Auth",
"object",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Api/MaApi.php#L377-L452 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.