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,300 | MyAllocator/myallocator-pms-php | src/MyAllocator/Api/MaApi.php | MaApi.assertReqParameters | private function assertReqParameters($keys, $params = null)
{
if (!empty($keys['args']['req'])) {
if (!$params) {
$msg = 'No parameters provided. (HINT: Reference the $keys '
. 'property at the top of the API class file for '
. 'required ... | php | private function assertReqParameters($keys, $params = null)
{
if (!empty($keys['args']['req'])) {
if (!$params) {
$msg = 'No parameters provided. (HINT: Reference the $keys '
. 'property at the top of the API class file for '
. 'required ... | [
"private",
"function",
"assertReqParameters",
"(",
"$",
"keys",
",",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"keys",
"[",
"'args'",
"]",
"[",
"'req'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"$",
"params",
")",
"{",
... | Validate required parameters for API.
@param array $keys Array of required and optional
authentication and argument keys (string) for API method.
@param array $params API specific parameters.
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Validate",
"required",
"parameters",
"for",
"API",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Api/MaApi.php#L502-L522 |
191,301 | MyAllocator/myallocator-pms-php | src/MyAllocator/Api/MaApi.php | MaApi.removeUnknownParameters | private function removeUnknownParameters($keys, $params)
{
$valid_keys = array_merge(
$keys['auth']['req'],
$keys['auth']['opt'],
$keys['args']['req'],
$keys['args']['opt']
);
foreach ($params as $k => $v) {
if (!in_array($k, $vali... | php | private function removeUnknownParameters($keys, $params)
{
$valid_keys = array_merge(
$keys['auth']['req'],
$keys['auth']['opt'],
$keys['args']['req'],
$keys['args']['opt']
);
foreach ($params as $k => $v) {
if (!in_array($k, $vali... | [
"private",
"function",
"removeUnknownParameters",
"(",
"$",
"keys",
",",
"$",
"params",
")",
"{",
"$",
"valid_keys",
"=",
"array_merge",
"(",
"$",
"keys",
"[",
"'auth'",
"]",
"[",
"'req'",
"]",
",",
"$",
"keys",
"[",
"'auth'",
"]",
"[",
"'opt'",
"]",
... | Strip parameters not defined in API keys array.
@param array $keys Array of required and optional
authentication and argument keys (string) for API method.
@param array $params API specific parameters.
@return array API parameters with unknown parameters
removed. | [
"Strip",
"parameters",
"not",
"defined",
"in",
"API",
"keys",
"array",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Api/MaApi.php#L534-L550 |
191,302 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.request | public function request($method, $url, $params = null)
{
if (!$params) {
$params = array();
} else {
$params = self::encodeObjects($params);
}
// Set request data if configured
if (in_array('request', $this->config['dataResponse'])) {
$thi... | php | public function request($method, $url, $params = null)
{
if (!$params) {
$params = array();
} else {
$params = self::encodeObjects($params);
}
// Set request data if configured
if (in_array('request', $this->config['dataResponse'])) {
$thi... | [
"public",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"params",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"}",
"else",
"{",
"$",
"params",
"=",
"self",
... | Send an API request, interpret and return the response.
@param string $method HTTP method.
@param string $url API endpoint.
@param array|null $params API parameters.
@return mixed API response, code, headers (XML only).
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Send",
"an",
"API",
"request",
"interpret",
"and",
"return",
"the",
"response",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L85-L155 |
191,303 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.curlRequest | private function curlRequest($method, $absUrl, $params)
{
$result = array();
$opts = array();
$curl = curl_init();
if ($method == 'post') {
$opts[CURLOPT_POST] = 1;
$opts[CURLOPT_POSTFIELDS] = $params;
} else {
throw new ApiException('Unsu... | php | private function curlRequest($method, $absUrl, $params)
{
$result = array();
$opts = array();
$curl = curl_init();
if ($method == 'post') {
$opts[CURLOPT_POST] = 1;
$opts[CURLOPT_POSTFIELDS] = $params;
} else {
throw new ApiException('Unsu... | [
"private",
"function",
"curlRequest",
"(",
"$",
"method",
",",
"$",
"absUrl",
",",
"$",
"params",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"opts",
"=",
"array",
"(",
")",
";",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"if",
... | Send a JSON or XML CURL request.
@param string $method HTTP method.
@param string $absUrl The absolute endpoint URL.
@param array|null $params API parameters.
@return mixed API response, code, headers.
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Send",
"a",
"JSON",
"or",
"XML",
"CURL",
"request",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L168-L221 |
191,304 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.interpretResponseJSON | private function interpretResponseJSON()
{
$this->debug_echo("\n\nResponse (json):\n");
$this->debug_print_r($this->state['response']['body_raw']);
// Convert response from json to array format if required
if ($this->config['dataFormat'] == 'array') {
try {
... | php | private function interpretResponseJSON()
{
$this->debug_echo("\n\nResponse (json):\n");
$this->debug_print_r($this->state['response']['body_raw']);
// Convert response from json to array format if required
if ($this->config['dataFormat'] == 'array') {
try {
... | [
"private",
"function",
"interpretResponseJSON",
"(",
")",
"{",
"$",
"this",
"->",
"debug_echo",
"(",
"\"\\n\\nResponse (json):\\n\"",
")",
";",
"$",
"this",
"->",
"debug_print_r",
"(",
"$",
"this",
"->",
"state",
"[",
"'response'",
"]",
"[",
"'body_raw'",
"]",... | Process a JSON CURL response.
@return mixed API response. The format depends on dataFormat.
@throws MyAllocator\phpsdk\src\Exception\ApiException | [
"Process",
"a",
"JSON",
"CURL",
"response",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L230-L260 |
191,305 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.interpretResponseXML | private function interpretResponseXML()
{
$this->debug_echo("\n\nResponse (xml):\n".$this->state['response']['body_raw']);
$this->state['response']['body'] = $this->state['response']['body_raw'];
if ($this->state['response']['code'] < 200 ||
$this->state['response']['code'] >= ... | php | private function interpretResponseXML()
{
$this->debug_echo("\n\nResponse (xml):\n".$this->state['response']['body_raw']);
$this->state['response']['body'] = $this->state['response']['body_raw'];
if ($this->state['response']['code'] < 200 ||
$this->state['response']['code'] >= ... | [
"private",
"function",
"interpretResponseXML",
"(",
")",
"{",
"$",
"this",
"->",
"debug_echo",
"(",
"\"\\n\\nResponse (xml):\\n\"",
".",
"$",
"this",
"->",
"state",
"[",
"'response'",
"]",
"[",
"'body_raw'",
"]",
")",
";",
"$",
"this",
"->",
"state",
"[",
... | Process a XML CURL response.
@return mixed API response. The format depends on dataFormat. | [
"Process",
"a",
"XML",
"CURL",
"response",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L267-L280 |
191,306 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.handleCurlError | private function handleCurlError($errno, $message)
{
$apiBase = $this->apiBase;
switch ($errno) {
case CURLE_COULDNT_CONNECT:
case CURLE_COULDNT_RESOLVE_HOST:
case CURLE_OPERATION_TIMEOUTED:
$msg = 'Could not connect to MyAllocator (' . $apiBase . ... | php | private function handleCurlError($errno, $message)
{
$apiBase = $this->apiBase;
switch ($errno) {
case CURLE_COULDNT_CONNECT:
case CURLE_COULDNT_RESOLVE_HOST:
case CURLE_OPERATION_TIMEOUTED:
$msg = 'Could not connect to MyAllocator (' . $apiBase . ... | [
"private",
"function",
"handleCurlError",
"(",
"$",
"errno",
",",
"$",
"message",
")",
"{",
"$",
"apiBase",
"=",
"$",
"this",
"->",
"apiBase",
";",
"switch",
"(",
"$",
"errno",
")",
"{",
"case",
"CURLE_COULDNT_CONNECT",
":",
"case",
"CURLE_COULDNT_RESOLVE_HO... | Handle a CURL error resulting from a request.
@param integer $errno The CURL error code.
@param string $message The CURL error nessage.
@throws MyAllocator\phpsdk\src\Exception\ApiConnectionException | [
"Handle",
"a",
"CURL",
"error",
"resulting",
"from",
"a",
"request",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L290-L308 |
191,307 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.handleHttpError | private function handleHttpError()
{
$msg = 'HTTP API Error (HTTP response code was '.$this->state['response']['code'].')';
switch ($this->state['response']['code']) {
case 404:
throw new InvalidRequestException($msg, $this->state);
case 401:
t... | php | private function handleHttpError()
{
$msg = 'HTTP API Error (HTTP response code was '.$this->state['response']['code'].')';
switch ($this->state['response']['code']) {
case 404:
throw new InvalidRequestException($msg, $this->state);
case 401:
t... | [
"private",
"function",
"handleHttpError",
"(",
")",
"{",
"$",
"msg",
"=",
"'HTTP API Error (HTTP response code was '",
".",
"$",
"this",
"->",
"state",
"[",
"'response'",
"]",
"[",
"'code'",
"]",
".",
"')'",
";",
"switch",
"(",
"$",
"this",
"->",
"state",
... | Handle a HTTP error resulting from a request.
@param mixed $body The HTTP response body.
@param integer $code The HTTP error code.
@param string $resp The JSON encoded response body.
@throws MyAllocator\phpsdk\src\Exception\InvalidRequestException
@throws MyAllocator\phpsdk\src\Exception\APIAuthenticationException
@t... | [
"Handle",
"a",
"HTTP",
"error",
"resulting",
"from",
"a",
"request",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L321-L332 |
191,308 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.apiUrl | private function apiUrl($url = '', $format = 'json')
{
if (!$url) {
return false;
}
$absUrl = sprintf('https://%s/pms/v%d/%s/%s',
$this->apiBase,
$this->version,
$format,
$ur... | php | private function apiUrl($url = '', $format = 'json')
{
if (!$url) {
return false;
}
$absUrl = sprintf('https://%s/pms/v%d/%s/%s',
$this->apiBase,
$this->version,
$format,
$ur... | [
"private",
"function",
"apiUrl",
"(",
"$",
"url",
"=",
"''",
",",
"$",
"format",
"=",
"'json'",
")",
"{",
"if",
"(",
"!",
"$",
"url",
")",
"{",
"return",
"false",
";",
"}",
"$",
"absUrl",
"=",
"sprintf",
"(",
"'https://%s/pms/v%d/%s/%s'",
",",
"$",
... | Get the absolute URL for an API request.
@param string $url The API method endpoint.
@param string $format The request data format.
@return string The absolute API URL. | [
"Get",
"the",
"absolute",
"URL",
"for",
"an",
"API",
"request",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L342-L355 |
191,309 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.encodeObjects | private static function encodeObjects($d)
{
if ($d instanceof Api) {
return self::utf8(Common::getClassName(get_class($d)));
} else if ($d === true) {
return 'true';
} else if ($d === false) {
return 'false';
} else if (is_array($d)) {
... | php | private static function encodeObjects($d)
{
if ($d instanceof Api) {
return self::utf8(Common::getClassName(get_class($d)));
} else if ($d === true) {
return 'true';
} else if ($d === false) {
return 'false';
} else if (is_array($d)) {
... | [
"private",
"static",
"function",
"encodeObjects",
"(",
"$",
"d",
")",
"{",
"if",
"(",
"$",
"d",
"instanceof",
"Api",
")",
"{",
"return",
"self",
"::",
"utf8",
"(",
"Common",
"::",
"getClassName",
"(",
"get_class",
"(",
"$",
"d",
")",
")",
")",
";",
... | Encode an object.
@param mixed $d The object to encode.
@return mixed The encoded object. | [
"Encode",
"an",
"object",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L418-L435 |
191,310 | MyAllocator/myallocator-pms-php | src/MyAllocator/Util/Requestor.php | Requestor.formatResponse | private function formatResponse()
{
$return = array();
// Method
if (isset($this->state['method'])) {
$return['method'] = $this->state['method'];
}
// Request
if (!empty($this->state['request'])) {
$return['request'] = $this->state['request']... | php | private function formatResponse()
{
$return = array();
// Method
if (isset($this->state['method'])) {
$return['method'] = $this->state['method'];
}
// Request
if (!empty($this->state['request'])) {
$return['request'] = $this->state['request']... | [
"private",
"function",
"formatResponse",
"(",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"// Method",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"state",
"[",
"'method'",
"]",
")",
")",
"{",
"$",
"return",
"[",
"'method'",
"]",
"=",
"$"... | Format a response from available state data.
@return array Formatted response. | [
"Format",
"a",
"response",
"from",
"available",
"state",
"data",
"."
] | e0b18ba21787e143f88ecf92b6974336256d6aa1 | https://github.com/MyAllocator/myallocator-pms-php/blob/e0b18ba21787e143f88ecf92b6974336256d6aa1/src/MyAllocator/Util/Requestor.php#L442-L462 |
191,311 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php | AbstractEncoder.handleEncode | public function handleEncode(EncodeValueEvent $event)
{
$definition = $event->getValue();
if (!$definition instanceof Definition) {
return;
}
$type = $definition->getType();
$method = 'encode' . $this->convertTypeToMethod($type);
if (method_exists($thi... | php | public function handleEncode(EncodeValueEvent $event)
{
$definition = $event->getValue();
if (!$definition instanceof Definition) {
return;
}
$type = $definition->getType();
$method = 'encode' . $this->convertTypeToMethod($type);
if (method_exists($thi... | [
"public",
"function",
"handleEncode",
"(",
"EncodeValueEvent",
"$",
"event",
")",
"{",
"$",
"definition",
"=",
"$",
"event",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"!",
"$",
"definition",
"instanceof",
"Definition",
")",
"{",
"return",
";",
"}",
"$"... | Handle compile event.
@param EncodeValueEvent $event The subscribed event.
@return void | [
"Handle",
"compile",
"event",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php#L62-L82 |
191,312 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php | AbstractEncoder.handleGetReference | public function handleGetReference(EncodeReferenceEvent $event)
{
$definition = $event->getObject();
if ($definition instanceof Definition) {
$this->setReference($definition, $event);
}
} | php | public function handleGetReference(EncodeReferenceEvent $event)
{
$definition = $event->getObject();
if ($definition instanceof Definition) {
$this->setReference($definition, $event);
}
} | [
"public",
"function",
"handleGetReference",
"(",
"EncodeReferenceEvent",
"$",
"event",
")",
"{",
"$",
"definition",
"=",
"$",
"event",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"$",
"definition",
"instanceof",
"Definition",
")",
"{",
"$",
"this",
"->",
... | Handle get reference event.
@param EncodeReferenceEvent $event The event.
@return void | [
"Handle",
"get",
"reference",
"event",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php#L91-L98 |
191,313 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php | AbstractEncoder.convertTypeToMethod | private function convertTypeToMethod($type)
{
$parts = explode('.', str_replace(['-', '_'], '.', $type));
$parts = array_map('ucfirst', $parts);
return implode('', $parts);
} | php | private function convertTypeToMethod($type)
{
$parts = explode('.', str_replace(['-', '_'], '.', $type));
$parts = array_map('ucfirst', $parts);
return implode('', $parts);
} | [
"private",
"function",
"convertTypeToMethod",
"(",
"$",
"type",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"str_replace",
"(",
"[",
"'-'",
",",
"'_'",
"]",
",",
"'.'",
",",
"$",
"type",
")",
")",
";",
"$",
"parts",
"=",
"array_map",
"... | Convert definition type to method name.
@param string $type The type as string.
@return string | [
"Convert",
"definition",
"type",
"to",
"method",
"name",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php#L107-L113 |
191,314 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php | AbstractEncoder.getReferences | protected function getReferences(array $values, Encoder $encoder)
{
return array_map(
function ($value) use ($encoder) {
return $encoder->encodeReference($value);
},
$values
);
} | php | protected function getReferences(array $values, Encoder $encoder)
{
return array_map(
function ($value) use ($encoder) {
return $encoder->encodeReference($value);
},
$values
);
} | [
"protected",
"function",
"getReferences",
"(",
"array",
"$",
"values",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"encoder",
")",
"{",
"return",
"$",
"encoder",
"->",
"encode... | Get references of given values.
@param array $values Set of values.
@param Encoder $encoder The encoder.
@return array | [
"Get",
"references",
"of",
"given",
"values",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/AbstractEncoder.php#L155-L163 |
191,315 | digiaonline/lumen-oauth2 | src/OAuth2Service.php | OAuth2Service.newAuthorizeRequest | public function newAuthorizeRequest($type, $typeId, $authParams = [])
{
if ($this->authorizationServer->hasGrantType('authorization_code')) {
/** @var AuthCodeGrant $authGrant */
$authGrant = $this->authorizationServer->getGrantType('authorization_code');
return $authGran... | php | public function newAuthorizeRequest($type, $typeId, $authParams = [])
{
if ($this->authorizationServer->hasGrantType('authorization_code')) {
/** @var AuthCodeGrant $authGrant */
$authGrant = $this->authorizationServer->getGrantType('authorization_code');
return $authGran... | [
"public",
"function",
"newAuthorizeRequest",
"(",
"$",
"type",
",",
"$",
"typeId",
",",
"$",
"authParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"authorizationServer",
"->",
"hasGrantType",
"(",
"'authorization_code'",
")",
")",
"{",
"/** ... | Parse a new authorize request
@param string $type The session owner's type
@param string $typeId The session owner's ID
@param array $authParams The authorize request $_GET parameters
@return string | [
"Parse",
"a",
"new",
"authorize",
"request"
] | e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873 | https://github.com/digiaonline/lumen-oauth2/blob/e5aa268a68bdbe9f4aba4fa5e2e3a36a44990873/src/OAuth2Service.php#L122-L131 |
191,316 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/GroupEncoder.php | GroupEncoder.encodeGeoJson | public function encodeGeoJson(GeoJson $geoJson, Encoder $encoder)
{
$buffer = sprintf(
'%s = L.geoJson(%s, %s);',
$encoder->encodeReference($geoJson),
$encoder->encodeValue($geoJson->getInitializationData()),
$encoder->encodeValue($geoJson->getOptions())
... | php | public function encodeGeoJson(GeoJson $geoJson, Encoder $encoder)
{
$buffer = sprintf(
'%s = L.geoJson(%s, %s);',
$encoder->encodeReference($geoJson),
$encoder->encodeValue($geoJson->getInitializationData()),
$encoder->encodeValue($geoJson->getOptions())
... | [
"public",
"function",
"encodeGeoJson",
"(",
"GeoJson",
"$",
"geoJson",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"$",
"buffer",
"=",
"sprintf",
"(",
"'%s = L.geoJson(%s, %s);'",
",",
"$",
"encoder",
"->",
"encodeReference",
"(",
"$",
"geoJson",
")",
",",
"$"... | Encode a feature group.
@param GeoJson $geoJson The layer group.
@param Encoder $encoder The builder.
@return bool | [
"Encode",
"a",
"feature",
"group",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/GroupEncoder.php#L76-L94 |
191,317 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/GroupEncoder.php | GroupEncoder.doGroupEncode | private function doGroupEncode($type, LayerGroup $group, Encoder $encoder)
{
return sprintf(
'%s = L.%s(%s);',
$encoder->encodeReference($group),
$type,
$this->encodeLayersInformation($group->getLayers(), $encoder)
);
} | php | private function doGroupEncode($type, LayerGroup $group, Encoder $encoder)
{
return sprintf(
'%s = L.%s(%s);',
$encoder->encodeReference($group),
$type,
$this->encodeLayersInformation($group->getLayers(), $encoder)
);
} | [
"private",
"function",
"doGroupEncode",
"(",
"$",
"type",
",",
"LayerGroup",
"$",
"group",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"return",
"sprintf",
"(",
"'%s = L.%s(%s);'",
",",
"$",
"encoder",
"->",
"encodeReference",
"(",
"$",
"group",
")",
",",
"$... | Encode the group.
@param string $type The group type.
@param LayerGroup $group The group instance.
@param Encoder $encoder The encoder.
@return string | [
"Encode",
"the",
"group",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/GroupEncoder.php#L105-L113 |
191,318 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Encoder/GroupEncoder.php | GroupEncoder.encodeLayersInformation | private function encodeLayersInformation($layers, Encoder $encoder)
{
$layers = array_map(
function ($layer) use ($encoder) {
return $encoder->encodeReference($layer);
},
$layers
);
return '[' . implode(', ', $layers) . ']';
} | php | private function encodeLayersInformation($layers, Encoder $encoder)
{
$layers = array_map(
function ($layer) use ($encoder) {
return $encoder->encodeReference($layer);
},
$layers
);
return '[' . implode(', ', $layers) . ']';
} | [
"private",
"function",
"encodeLayersInformation",
"(",
"$",
"layers",
",",
"Encoder",
"$",
"encoder",
")",
"{",
"$",
"layers",
"=",
"array_map",
"(",
"function",
"(",
"$",
"layer",
")",
"use",
"(",
"$",
"encoder",
")",
"{",
"return",
"$",
"encoder",
"->"... | Get layer information correctly encoded.
@param Layer[] $layers The layers.
@param Encoder $encoder The encoder.
@return array | [
"Get",
"layer",
"information",
"correctly",
"encoded",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Encoder/GroupEncoder.php#L123-L133 |
191,319 | 10quality/license-keys-php-client | src/LicenseRequest.php | LicenseRequest.enableOffline | public function enableOffline()
{
$this->settings['offline'] = $this->data['offline_interval'] === 'unlimited'
? true
: strtotime('+'.intval($this->data['offline_value']).' '.$this->data['offline_interval']);
$this->touch(false);
} | php | public function enableOffline()
{
$this->settings['offline'] = $this->data['offline_interval'] === 'unlimited'
? true
: strtotime('+'.intval($this->data['offline_value']).' '.$this->data['offline_interval']);
$this->touch(false);
} | [
"public",
"function",
"enableOffline",
"(",
")",
"{",
"$",
"this",
"->",
"settings",
"[",
"'offline'",
"]",
"=",
"$",
"this",
"->",
"data",
"[",
"'offline_interval'",
"]",
"===",
"'unlimited'",
"?",
"true",
":",
"strtotime",
"(",
"'+'",
".",
"intval",
"(... | Enables offline mode.
@since 1.0.0 | [
"Enables",
"offline",
"mode",
"."
] | 61067d13bd4cde1492f0990ba60d75e6a1ecb72b | https://github.com/10quality/license-keys-php-client/blob/61067d13bd4cde1492f0990ba60d75e6a1ecb72b/src/LicenseRequest.php#L234-L240 |
191,320 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLngBounds.php | LatLngBounds.fromArray | public static function fromArray(array $native)
{
if (!isset($native[0]) || !isset($native[1])) {
throw new \InvalidArgumentException('LatLngBounds array format not supported.');
}
return new static(
LatLng::fromArray($native[0]),
LatLng::fromArray($nativ... | php | public static function fromArray(array $native)
{
if (!isset($native[0]) || !isset($native[1])) {
throw new \InvalidArgumentException('LatLngBounds array format not supported.');
}
return new static(
LatLng::fromArray($native[0]),
LatLng::fromArray($nativ... | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"native",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"native",
"[",
"0",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"native",
"[",
"1",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"In... | Create from native array format.
@param array $native The native boundary.
@return LatLngBounds
@throws \InvalidArgumentException If the array format is not supported. | [
"Create",
"from",
"native",
"array",
"format",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLngBounds.php#L57-L67 |
191,321 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLngBounds.php | LatLngBounds.fromString | public static function fromString($native, $separator = ',')
{
$values = explode($separator, $native, 4);
if (count($values) !== 4) {
throw new \InvalidArgumentException(
sprintf('LatLngBounds can not be created from string "%s"', $native)
);
}
... | php | public static function fromString($native, $separator = ',')
{
$values = explode($separator, $native, 4);
if (count($values) !== 4) {
throw new \InvalidArgumentException(
sprintf('LatLngBounds can not be created from string "%s"', $native)
);
}
... | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"native",
",",
"$",
"separator",
"=",
"','",
")",
"{",
"$",
"values",
"=",
"explode",
"(",
"$",
"separator",
",",
"$",
"native",
",",
"4",
")",
";",
"if",
"(",
"count",
"(",
"$",
"values",
")"... | Create from a string format.
@param string $native Bounds string representation.
@param string $separator Separator string of each value.
@return LatLngBounds
@throws \InvalidArgumentException If an invalid value is given. | [
"Create",
"from",
"a",
"string",
"format",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLngBounds.php#L78-L92 |
191,322 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLngBounds.php | LatLngBounds.getCenter | public function getCenter()
{
return new LatLng(
($this->getNorth() - $this->getSouth()),
($this->getWest() - $this->getEast())
);
} | php | public function getCenter()
{
return new LatLng(
($this->getNorth() - $this->getSouth()),
($this->getWest() - $this->getEast())
);
} | [
"public",
"function",
"getCenter",
"(",
")",
"{",
"return",
"new",
"LatLng",
"(",
"(",
"$",
"this",
"->",
"getNorth",
"(",
")",
"-",
"$",
"this",
"->",
"getSouth",
"(",
")",
")",
",",
"(",
"$",
"this",
"->",
"getWest",
"(",
")",
"-",
"$",
"this",... | Get the center.
@return LatLng | [
"Get",
"the",
"center",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLngBounds.php#L169-L175 |
191,323 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLngBounds.php | LatLngBounds.equals | public function equals(LatLngBounds $other)
{
if (!$this->getNorthEast()->equals($other->getNorthEast())) {
return false;
}
return $this->getSouthWest()->equals($other->getSouthWest());
} | php | public function equals(LatLngBounds $other)
{
if (!$this->getNorthEast()->equals($other->getNorthEast())) {
return false;
}
return $this->getSouthWest()->equals($other->getSouthWest());
} | [
"public",
"function",
"equals",
"(",
"LatLngBounds",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getNorthEast",
"(",
")",
"->",
"equals",
"(",
"$",
"other",
"->",
"getNorthEast",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Compare two bounds.
@param LatLngBounds $other The other bounds.
@return bool | [
"Compare",
"two",
"bounds",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLngBounds.php#L194-L201 |
191,324 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLngBounds.php | LatLngBounds.overlaps | public function overlaps(LatLngBounds $other)
{
$southWest = $other->getSouthWest();
$northEast = $other->getNorthEast();
$latOverlaps = ($northEast->getLatitude() > $this->southWest->getLatitude())
&& ($southWest->getLatitude() < $this->northEast->getLatitude());
$lngO... | php | public function overlaps(LatLngBounds $other)
{
$southWest = $other->getSouthWest();
$northEast = $other->getNorthEast();
$latOverlaps = ($northEast->getLatitude() > $this->southWest->getLatitude())
&& ($southWest->getLatitude() < $this->northEast->getLatitude());
$lngO... | [
"public",
"function",
"overlaps",
"(",
"LatLngBounds",
"$",
"other",
")",
"{",
"$",
"southWest",
"=",
"$",
"other",
"->",
"getSouthWest",
"(",
")",
";",
"$",
"northEast",
"=",
"$",
"other",
"->",
"getNorthEast",
"(",
")",
";",
"$",
"latOverlaps",
"=",
... | Check if bounds overlaps.
@param LatLngBounds $other The over bounds to check.
@return bool | [
"Check",
"if",
"bounds",
"overlaps",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLngBounds.php#L210-L222 |
191,325 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Value/LatLngBounds.php | LatLngBounds.contains | public function contains($object)
{
if ($object instanceof LatLng) {
$lat = $object->getLatitude();
$lng = $object->getLongitude();
if ($this->getWest() > $lng || $this->getEast() < $lng) {
return false;
}
return ($this->getSouth(... | php | public function contains($object)
{
if ($object instanceof LatLng) {
$lat = $object->getLatitude();
$lng = $object->getLongitude();
if ($this->getWest() > $lng || $this->getEast() < $lng) {
return false;
}
return ($this->getSouth(... | [
"public",
"function",
"contains",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"LatLng",
")",
"{",
"$",
"lat",
"=",
"$",
"object",
"->",
"getLatitude",
"(",
")",
";",
"$",
"lng",
"=",
"$",
"object",
"->",
"getLongitude",
"(",... | Check if given object in in the bounds.
@param LatLng|LatLngBounds $object The given object.
@return bool
@throws \RuntimeException If LatLngBounds is checked. Not implemented yet. | [
"Check",
"if",
"given",
"object",
"in",
"in",
"the",
"bounds",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Value/LatLngBounds.php#L295-L311 |
191,326 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Leaflet.php | Leaflet.registerStylesheet | public function registerStylesheet($name, $source, $type = Assets::TYPE_FILE)
{
$this->stylesheets[$name][] = array($source, $type);
return $this;
} | php | public function registerStylesheet($name, $source, $type = Assets::TYPE_FILE)
{
$this->stylesheets[$name][] = array($source, $type);
return $this;
} | [
"public",
"function",
"registerStylesheet",
"(",
"$",
"name",
",",
"$",
"source",
",",
"$",
"type",
"=",
"Assets",
"::",
"TYPE_FILE",
")",
"{",
"$",
"this",
"->",
"stylesheets",
"[",
"$",
"name",
"]",
"[",
"]",
"=",
"array",
"(",
"$",
"source",
",",
... | Register a stylesheet for the library.
@param string $name Library name.
@param string $source The stylesheet source.
@param string $type Resource type.
@return $this | [
"Register",
"a",
"stylesheet",
"for",
"the",
"library",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Leaflet.php#L92-L97 |
191,327 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Leaflet.php | Leaflet.registerJavascript | public function registerJavascript($name, $source, $type = Assets::TYPE_FILE)
{
$this->javascripts[$name][] = array($source, $type);
return $this;
} | php | public function registerJavascript($name, $source, $type = Assets::TYPE_FILE)
{
$this->javascripts[$name][] = array($source, $type);
return $this;
} | [
"public",
"function",
"registerJavascript",
"(",
"$",
"name",
",",
"$",
"source",
",",
"$",
"type",
"=",
"Assets",
"::",
"TYPE_FILE",
")",
"{",
"$",
"this",
"->",
"javascripts",
"[",
"$",
"name",
"]",
"[",
"]",
"=",
"array",
"(",
"$",
"source",
",",
... | Register a javascript for the library.
@param string $name Library name.
@param string $source The javascript source.
@param string $type Resource type.
@return $this | [
"Register",
"a",
"javascript",
"for",
"the",
"library",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Leaflet.php#L108-L113 |
191,328 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Leaflet.php | Leaflet.build | public function build(Map $map, Assets $assets = null)
{
$prefix = 'var map, layers = {}, controls = {}, icons = {};' . "\n";
if (!$assets) {
return $prefix . $this->javascriptBuilder->encode($map, $this->jsonEncodeFlags);
}
$collector = new Collector($assets, $this->ja... | php | public function build(Map $map, Assets $assets = null)
{
$prefix = 'var map, layers = {}, controls = {}, icons = {};' . "\n";
if (!$assets) {
return $prefix . $this->javascriptBuilder->encode($map, $this->jsonEncodeFlags);
}
$collector = new Collector($assets, $this->ja... | [
"public",
"function",
"build",
"(",
"Map",
"$",
"map",
",",
"Assets",
"$",
"assets",
"=",
"null",
")",
"{",
"$",
"prefix",
"=",
"'var map, layers = {}, controls = {}, icons = {};'",
".",
"\"\\n\"",
";",
"if",
"(",
"!",
"$",
"assets",
")",
"{",
"return",
"$... | Build map as a javascript resource.
It always return the generated map no matter if an assets object is given or not. If you want to get the
combined generated assets, just use $assets->getHtml().
@param Map $map The map being created.
@param Assets $assets Optional pass an assets instance which collects all re... | [
"Build",
"map",
"as",
"a",
"javascript",
"resource",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Leaflet.php#L156-L172 |
191,329 | unclecheese/silverstripe-event-calendar | code/ICSWriter.php | ICSWriter.getOutput | public function getOutput() {
$this->lines = array();
$this->addLine('BEGIN:VCALENDAR');
$this->addLine('VERSION:2.0');
if( is_null($this->prodid) ) {
$this->addLine("PRODID:" . '-//'.$this->host.'//NONSGML v1.0//EN');
}
elseif( !is_null($this->prodid) ) {
$this->addLine("PRODID:" . $th... | php | public function getOutput() {
$this->lines = array();
$this->addLine('BEGIN:VCALENDAR');
$this->addLine('VERSION:2.0');
if( is_null($this->prodid) ) {
$this->addLine("PRODID:" . '-//'.$this->host.'//NONSGML v1.0//EN');
}
elseif( !is_null($this->prodid) ) {
$this->addLine("PRODID:" . $th... | [
"public",
"function",
"getOutput",
"(",
")",
"{",
"$",
"this",
"->",
"lines",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"addLine",
"(",
"'BEGIN:VCALENDAR'",
")",
";",
"$",
"this",
"->",
"addLine",
"(",
"'VERSION:2.0'",
")",
";",
"if",
"(",
"is_... | Get the calendar as a string.
@author Alex Hayes <alex.hayes@dimension27.com> | [
"Get",
"the",
"calendar",
"as",
"a",
"string",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/ICSWriter.php#L80-L101 |
191,330 | unclecheese/silverstripe-event-calendar | code/ICSWriter.php | ICSWriter.getFormatedDateTime | protected function getFormatedDateTime( Date $date = null, Time $time = null ) {
$timestamp = null;
if($date && $time) {
$timestamp = strtotime($date . ' ' . $time);
}
else {
$timestamp = time();
}
return gmdate('Ymd\THis\Z', $timestamp);
} | php | protected function getFormatedDateTime( Date $date = null, Time $time = null ) {
$timestamp = null;
if($date && $time) {
$timestamp = strtotime($date . ' ' . $time);
}
else {
$timestamp = time();
}
return gmdate('Ymd\THis\Z', $timestamp);
} | [
"protected",
"function",
"getFormatedDateTime",
"(",
"Date",
"$",
"date",
"=",
"null",
",",
"Time",
"$",
"time",
"=",
"null",
")",
"{",
"$",
"timestamp",
"=",
"null",
";",
"if",
"(",
"$",
"date",
"&&",
"$",
"time",
")",
"{",
"$",
"timestamp",
"=",
... | Get an ical formatted datetime string.
@param Date $date
@param Time $time
@return string
@todo Add timezone support - note atm there is no timezone support in either Date or Time.
@author Alex Hayes <alex.hayes@dimension27.com> | [
"Get",
"an",
"ical",
"formatted",
"datetime",
"string",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/ICSWriter.php#L138-L147 |
191,331 | unclecheese/silverstripe-event-calendar | code/ICSWriter.php | ICSWriter.addDateTime | protected function addDateTime( CalendarDateTime $dateTime ) {
$this->addLine('BEGIN:VEVENT');
$this->addLine('UID:' . $this->getUID($dateTime) );
$this->addLine('DTSTAMP;TZID=' . Calendar::config()->timezone . ':' . $this->getFormatedDateTime());
$this->addLine('DTSTART;TZID=' . Calendar::config()->timezone... | php | protected function addDateTime( CalendarDateTime $dateTime ) {
$this->addLine('BEGIN:VEVENT');
$this->addLine('UID:' . $this->getUID($dateTime) );
$this->addLine('DTSTAMP;TZID=' . Calendar::config()->timezone . ':' . $this->getFormatedDateTime());
$this->addLine('DTSTART;TZID=' . Calendar::config()->timezone... | [
"protected",
"function",
"addDateTime",
"(",
"CalendarDateTime",
"$",
"dateTime",
")",
"{",
"$",
"this",
"->",
"addLine",
"(",
"'BEGIN:VEVENT'",
")",
";",
"$",
"this",
"->",
"addLine",
"(",
"'UID:'",
".",
"$",
"this",
"->",
"getUID",
"(",
"$",
"dateTime",
... | Add a CalendarDateTime to the stack.
@param CalendarDateTime $dateTime
@return void
@author Alex Hayes <alex.hayes@dimension27.com> | [
"Add",
"a",
"CalendarDateTime",
"to",
"the",
"stack",
"."
] | 13c151c8fd011a98c131471cb21310124a264785 | https://github.com/unclecheese/silverstripe-event-calendar/blob/13c151c8fd011a98c131471cb21310124a264785/code/ICSWriter.php#L157-L166 |
191,332 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Map.php | Map.setCenter | public function setCenter($center)
{
if (!$center instanceof LatLng) {
$center = LatLng::fromNative($center);
}
Assertion::isInstanceOf($center, 'Netzmacht\LeafletPHP\Value\LatLng');
return $this->setOption('center', $center);
} | php | public function setCenter($center)
{
if (!$center instanceof LatLng) {
$center = LatLng::fromNative($center);
}
Assertion::isInstanceOf($center, 'Netzmacht\LeafletPHP\Value\LatLng');
return $this->setOption('center', $center);
} | [
"public",
"function",
"setCenter",
"(",
"$",
"center",
")",
"{",
"if",
"(",
"!",
"$",
"center",
"instanceof",
"LatLng",
")",
"{",
"$",
"center",
"=",
"LatLng",
"::",
"fromNative",
"(",
"$",
"center",
")",
";",
"}",
"Assertion",
"::",
"isInstanceOf",
"(... | Set the center.
@param LatLng|array $center The map center.
@return $this
@see http://leafletjs.com/reference.html#map-center | [
"Set",
"the",
"center",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Map.php#L367-L376 |
191,333 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Map.php | Map.removeControl | public function removeControl(Control $control)
{
$key = array_search($control, $this->controls);
if ($key !== false) {
unset($this->controls[$key]);
}
return $this;
} | php | public function removeControl(Control $control)
{
$key = array_search($control, $this->controls);
if ($key !== false) {
unset($this->controls[$key]);
}
return $this;
} | [
"public",
"function",
"removeControl",
"(",
"Control",
"$",
"control",
")",
"{",
"$",
"key",
"=",
"array_search",
"(",
"$",
"control",
",",
"$",
"this",
"->",
"controls",
")",
";",
"if",
"(",
"$",
"key",
"!==",
"false",
")",
"{",
"unset",
"(",
"$",
... | Remove a control from the map.
@param Control $control Control being removed.
@return $this | [
"Remove",
"a",
"control",
"from",
"the",
"map",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Map.php#L460-L469 |
191,334 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/Map.php | Map.setMaxBounds | public function setMaxBounds($bounds)
{
if (is_array($bounds)) {
$bounds = LatLngBounds::fromArray($bounds);
}
Assertion::isInstanceOf($bounds, 'Netzmacht/LeafletPHP/Type/LatLngBounds');
return $this->setOption('maxBounds', $bounds);
} | php | public function setMaxBounds($bounds)
{
if (is_array($bounds)) {
$bounds = LatLngBounds::fromArray($bounds);
}
Assertion::isInstanceOf($bounds, 'Netzmacht/LeafletPHP/Type/LatLngBounds');
return $this->setOption('maxBounds', $bounds);
} | [
"public",
"function",
"setMaxBounds",
"(",
"$",
"bounds",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"bounds",
")",
")",
"{",
"$",
"bounds",
"=",
"LatLngBounds",
"::",
"fromArray",
"(",
"$",
"bounds",
")",
";",
"}",
"Assertion",
"::",
"isInstanceOf",
"... | Set max bounds option.
@param LatLngBounds|array $bounds Max bounds.
@return $this
@see http://leafletjs.com/reference.html#map-maxbounds
@throws InvalidArgumentException If invalid bounds given. | [
"Set",
"max",
"bounds",
"option",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/Map.php#L587-L596 |
191,335 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/UI/Marker.php | Marker.setLatLng | public function setLatLng($latLng)
{
if (!$latLng instanceof LatLng) {
$latLng = LatLng::fromNative($latLng);
}
$this->latLng = $latLng;
return $this;
} | php | public function setLatLng($latLng)
{
if (!$latLng instanceof LatLng) {
$latLng = LatLng::fromNative($latLng);
}
$this->latLng = $latLng;
return $this;
} | [
"public",
"function",
"setLatLng",
"(",
"$",
"latLng",
")",
"{",
"if",
"(",
"!",
"$",
"latLng",
"instanceof",
"LatLng",
")",
"{",
"$",
"latLng",
"=",
"LatLng",
"::",
"fromNative",
"(",
"$",
"latLng",
")",
";",
"}",
"$",
"this",
"->",
"latLng",
"=",
... | Set coordinates of the marker.
@param LatLng|array|string $latLng The new coordinates.
@return $this | [
"Set",
"coordinates",
"of",
"the",
"marker",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/UI/Marker.php#L85-L94 |
191,336 | netzmacht/php-leaflet | src/Netzmacht/LeafletPHP/Definition/UI/Marker.php | Marker.toGeoJsonFeature | public function toGeoJsonFeature()
{
$feature = new Feature($this, $this->getId());
$options = $this->getOptions();
if ($this->getIcon()) {
$feature->setProperty('icon', $this->getIcon()->getId());
unset($options['icon']);
}
$feature->setProperty('op... | php | public function toGeoJsonFeature()
{
$feature = new Feature($this, $this->getId());
$options = $this->getOptions();
if ($this->getIcon()) {
$feature->setProperty('icon', $this->getIcon()->getId());
unset($options['icon']);
}
$feature->setProperty('op... | [
"public",
"function",
"toGeoJsonFeature",
"(",
")",
"{",
"$",
"feature",
"=",
"new",
"Feature",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"if",
"(",
... | Get marker as geo json feature.
@return Feature | [
"Get",
"marker",
"as",
"geo",
"json",
"feature",
"."
] | ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb | https://github.com/netzmacht/php-leaflet/blob/ebe88eaa2bf58fa20a03e55fa2e6228ef10b37fb/src/Netzmacht/LeafletPHP/Definition/UI/Marker.php#L352-L365 |
191,337 | vi-kon/laravel-diff | src/ViKon/Diff/Diff.php | Diff.toHTML | public function toHTML($separator = '<br/>') {
$output = '';
foreach ($this->diff as $entry) {
$element = '';
if ($entry instanceof UnmodifiedEntry) {
$element = 'span';
} elseif ($entry instanceof DeletedEntry) {
$element = 'del';
... | php | public function toHTML($separator = '<br/>') {
$output = '';
foreach ($this->diff as $entry) {
$element = '';
if ($entry instanceof UnmodifiedEntry) {
$element = 'span';
} elseif ($entry instanceof DeletedEntry) {
$element = 'del';
... | [
"public",
"function",
"toHTML",
"(",
"$",
"separator",
"=",
"'<br/>'",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"diff",
"as",
"$",
"entry",
")",
"{",
"$",
"element",
"=",
"''",
";",
"if",
"(",
"$",
"entry",
"ins... | Render diff to HTML
* span tag - no changes
* del tag - deleted entry
* ins tag - inserted entry
@param string $separator
@return string | [
"Render",
"diff",
"to",
"HTML"
] | 936d23a2031c3629017f1a77622a67f712cfc530 | https://github.com/vi-kon/laravel-diff/blob/936d23a2031c3629017f1a77622a67f712cfc530/src/ViKon/Diff/Diff.php#L107-L123 |
191,338 | ogheo/yii2-htmlcompress | src/View.php | View.compress | public static function compress($html)
{
$filters = array(
// remove javascript comments
'/(?:<script[^>]*>|\G(?!\A))(?:[^\'"\/<]+|"(?:[^\\"]+|\\.)*"|\'(?:[^\\\']+|\\.)*\'|\/(?!\/)|<(?!\/script))*+\K\/\/[^\n|<]*/xsu' => '',
// remove html comments except IE conditions
... | php | public static function compress($html)
{
$filters = array(
// remove javascript comments
'/(?:<script[^>]*>|\G(?!\A))(?:[^\'"\/<]+|"(?:[^\\"]+|\\.)*"|\'(?:[^\\\']+|\\.)*\'|\/(?!\/)|<(?!\/script))*+\K\/\/[^\n|<]*/xsu' => '',
// remove html comments except IE conditions
... | [
"public",
"static",
"function",
"compress",
"(",
"$",
"html",
")",
"{",
"$",
"filters",
"=",
"array",
"(",
"// remove javascript comments",
"'/(?:<script[^>]*>|\\G(?!\\A))(?:[^\\'\"\\/<]+|\"(?:[^\\\\\"]+|\\\\.)*\"|\\'(?:[^\\\\\\']+|\\\\.)*\\'|\\/(?!\\/)|<(?!\\/script))*+\\K\\/\\/[^\\n|... | HTML compress function.
@param $html
@return mixed | [
"HTML",
"compress",
"function",
"."
] | e1fcbc75bf1b6146fd42d929f94f55f337c6d8e4 | https://github.com/ogheo/yii2-htmlcompress/blob/e1fcbc75bf1b6146fd42d929f94f55f337c6d8e4/src/View.php#L46-L66 |
191,339 | TeleSign/php_telesign | src/score/ScoreClient.php | ScoreClient.score | function score ($phone_number, $account_lifecycle_event, array $other = []) {
return $this->post(sprintf(self::SCORE_RESOURCE, $phone_number), array_merge($other, [
"account_lifecycle_event" => $account_lifecycle_event
]));
} | php | function score ($phone_number, $account_lifecycle_event, array $other = []) {
return $this->post(sprintf(self::SCORE_RESOURCE, $phone_number), array_merge($other, [
"account_lifecycle_event" => $account_lifecycle_event
]));
} | [
"function",
"score",
"(",
"$",
"phone_number",
",",
"$",
"account_lifecycle_event",
",",
"array",
"$",
"other",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"post",
"(",
"sprintf",
"(",
"self",
"::",
"SCORE_RESOURCE",
",",
"$",
"phone_number",
"... | Score is an API that delivers reputation scoring based on phone number intelligence, traffic patterns, machine
learning, and a global data consortium.
See https://developer.telesign.com/docs/score-api for detailed API documentation. | [
"Score",
"is",
"an",
"API",
"that",
"delivers",
"reputation",
"scoring",
"based",
"on",
"phone",
"number",
"intelligence",
"traffic",
"patterns",
"machine",
"learning",
"and",
"a",
"global",
"data",
"consortium",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/score/ScoreClient.php#L20-L24 |
191,340 | modxcms/teleport | src/Teleport/Request/CLIRequest.php | CLIRequest.parseArguments | public function parseArguments(array $args)
{
$this->action = null;
$this->arguments = array();
$parsed = array();
$argument = reset($args);
while ($argument) {
if (strpos($argument, '=') > 0) {
$arg = explode('=', $argument);
$argK... | php | public function parseArguments(array $args)
{
$this->action = null;
$this->arguments = array();
$parsed = array();
$argument = reset($args);
while ($argument) {
if (strpos($argument, '=') > 0) {
$arg = explode('=', $argument);
$argK... | [
"public",
"function",
"parseArguments",
"(",
"array",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"action",
"=",
"null",
";",
"$",
"this",
"->",
"arguments",
"=",
"array",
"(",
")",
";",
"$",
"parsed",
"=",
"array",
"(",
")",
";",
"$",
"argument",
"=... | Parse the CLI request arguments into a normalized format.
@param array $args An array of CLI arguments to parse.
@return array The normalized array of parsed arguments.
@throws RequestException If no valid action argument is specified. | [
"Parse",
"the",
"CLI",
"request",
"arguments",
"into",
"a",
"normalized",
"format",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/CLIRequest.php#L30-L64 |
191,341 | modxcms/teleport | src/Teleport/Request/CLIRequest.php | CLIRequest.switchUser | private function switchUser()
{
if (isset($this->user) && function_exists('posix_getpwnam')) {
$current_user = @posix_getpwuid(@posix_getuid());
if (!is_array($current_user)) {
$this->log("user switch to {$this->user} failed: could not determine current username");
... | php | private function switchUser()
{
if (isset($this->user) && function_exists('posix_getpwnam')) {
$current_user = @posix_getpwuid(@posix_getuid());
if (!is_array($current_user)) {
$this->log("user switch to {$this->user} failed: could not determine current username");
... | [
"private",
"function",
"switchUser",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"user",
")",
"&&",
"function_exists",
"(",
"'posix_getpwnam'",
")",
")",
"{",
"$",
"current_user",
"=",
"@",
"posix_getpwuid",
"(",
"@",
"posix_getuid",
"(",
... | Switch the user executing the current process.
If user arg is provided and the current user does not match, attempt to
switch to this user via posix_ functions.
@return bool True if the user and group were successfully switched, the
process is already running as the requested user, or no user arg was
provided. | [
"Switch",
"the",
"user",
"executing",
"the",
"current",
"process",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/CLIRequest.php#L83-L113 |
191,342 | modxcms/teleport | src/Teleport/Config.php | Config.get | public function get($key, $options = null, $default = null, $filter = null)
{
$value = $default;
if (is_array($options) && array_key_exists($key, $options)) {
$value = $options[$key];
} elseif (array_key_exists($key, $this->config)) {
$value = $this->config[$key];
... | php | public function get($key, $options = null, $default = null, $filter = null)
{
$value = $default;
if (is_array($options) && array_key_exists($key, $options)) {
$value = $options[$key];
} elseif (array_key_exists($key, $this->config)) {
$value = $this->config[$key];
... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"options",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"default",
";",
"if",
"(",
"is_array",
"(",
"$",
"options",
")",
... | Get a Config option value.
@param string $key The option key to lookup a value for.
@param array|null $options An associative array of options to override the persistent config.
@param mixed $default A default value to return if the lookup fails.
@param callable|null $filter An optional callback to f... | [
"Get",
"a",
"Config",
"option",
"value",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Config.php#L45-L57 |
191,343 | modxcms/teleport | src/Teleport/Config.php | Config.find | public function find($search = null)
{
$results = array();
if (empty($search)) {
$results = $this->config;
} elseif (is_scalar($search)) {
$results = array_filter($this->config, function ($value, $key) use ($search) {
return strpos($key, $search) !... | php | public function find($search = null)
{
$results = array();
if (empty($search)) {
$results = $this->config;
} elseif (is_scalar($search)) {
$results = array_filter($this->config, function ($value, $key) use ($search) {
return strpos($key, $search) !... | [
"public",
"function",
"find",
"(",
"$",
"search",
"=",
"null",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"search",
")",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"config",
";",
"}",
"elseif",
"... | Find Config options by searching the keys.
Use null to return all Config options.
@param string|null $search An optional string to search the option keys with, or null to return all options.
@return array An array containing the options matching the search, or all options if null is passed. | [
"Find",
"Config",
"options",
"by",
"searching",
"the",
"keys",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Config.php#L79-L95 |
191,344 | modxcms/teleport | src/Teleport/Compiler.php | Compiler.compile | public function compile($name = 'teleport.phar')
{
$this->cleanse($name);
$this->getVersion();
echo "building {$name} version {$this->version} ({$this->versionDate})" . PHP_EOL;
$phar = $this->preparePhar($name);
$this->addSrc($phar);
$this->addTpl($phar);
... | php | public function compile($name = 'teleport.phar')
{
$this->cleanse($name);
$this->getVersion();
echo "building {$name} version {$this->version} ({$this->versionDate})" . PHP_EOL;
$phar = $this->preparePhar($name);
$this->addSrc($phar);
$this->addTpl($phar);
... | [
"public",
"function",
"compile",
"(",
"$",
"name",
"=",
"'teleport.phar'",
")",
"{",
"$",
"this",
"->",
"cleanse",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"getVersion",
"(",
")",
";",
"echo",
"\"building {$name} version {$this->version} ({$this->versionDa... | Compile Teleport into a Phar for distribution.
@throws \RuntimeException If there is an error during compilation of the phar. | [
"Compile",
"Teleport",
"into",
"a",
"Phar",
"for",
"distribution",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Compiler.php#L58-L85 |
191,345 | modxcms/teleport | src/Teleport/Compiler.php | Compiler.preparePhar | private function preparePhar($name)
{
/* start building the Phar */
$phar = new \Phar($name, 0, $this->alias);
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
return $phar;
} | php | private function preparePhar($name)
{
/* start building the Phar */
$phar = new \Phar($name, 0, $this->alias);
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
return $phar;
} | [
"private",
"function",
"preparePhar",
"(",
"$",
"name",
")",
"{",
"/* start building the Phar */",
"$",
"phar",
"=",
"new",
"\\",
"Phar",
"(",
"$",
"name",
",",
"0",
",",
"$",
"this",
"->",
"alias",
")",
";",
"$",
"phar",
"->",
"setSignatureAlgorithm",
"... | Prepare a phar object for adding files.
@param string $name The filename for the phar.
@return \Phar The phar object ready to add files to. | [
"Prepare",
"a",
"phar",
"object",
"for",
"adding",
"files",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Compiler.php#L134-L142 |
191,346 | modxcms/teleport | src/Teleport/Compiler.php | Compiler.addAutoload | private function addAutoload($phar)
{
$this->addFile($phar, new \SplFileInfo($this->path . '/vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo($this->path . '/vendor/composer/autoload_classmap.php'));
$this->addFile($phar, new \SplFileInfo($this->path . '/vendor/composer/autoloa... | php | private function addAutoload($phar)
{
$this->addFile($phar, new \SplFileInfo($this->path . '/vendor/autoload.php'));
$this->addFile($phar, new \SplFileInfo($this->path . '/vendor/composer/autoload_classmap.php'));
$this->addFile($phar, new \SplFileInfo($this->path . '/vendor/composer/autoloa... | [
"private",
"function",
"addAutoload",
"(",
"$",
"phar",
")",
"{",
"$",
"this",
"->",
"addFile",
"(",
"$",
"phar",
",",
"new",
"\\",
"SplFileInfo",
"(",
"$",
"this",
"->",
"path",
".",
"'/vendor/autoload.php'",
")",
")",
";",
"$",
"this",
"->",
"addFile... | Add the Composer autoload infrastructure.
@param \Phar $phar | [
"Add",
"the",
"Composer",
"autoload",
"infrastructure",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Compiler.php#L188-L207 |
191,347 | modxcms/teleport | src/Teleport/Compiler.php | Compiler.addLicense | private function addLicense($phar)
{
if (is_readable($this->path . '/LICENSE')) {
$this->addFile($phar, new \SplFileInfo($this->path . '/LICENSE'), false);
}
} | php | private function addLicense($phar)
{
if (is_readable($this->path . '/LICENSE')) {
$this->addFile($phar, new \SplFileInfo($this->path . '/LICENSE'), false);
}
} | [
"private",
"function",
"addLicense",
"(",
"$",
"phar",
")",
"{",
"if",
"(",
"is_readable",
"(",
"$",
"this",
"->",
"path",
".",
"'/LICENSE'",
")",
")",
"{",
"$",
"this",
"->",
"addFile",
"(",
"$",
"phar",
",",
"new",
"\\",
"SplFileInfo",
"(",
"$",
... | Add the LICENSE file if it exists.
@param \Phar $phar | [
"Add",
"the",
"LICENSE",
"file",
"if",
"it",
"exists",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Compiler.php#L325-L330 |
191,348 | TeleSign/php_telesign | src/phoneid/PhoneIdClient.php | PhoneIdClient.phoneid | function phoneid ($phone_number, array $fields = []) {
return $this->post(sprintf(self::PHONEID_RESOURCE, $phone_number), $fields);
} | php | function phoneid ($phone_number, array $fields = []) {
return $this->post(sprintf(self::PHONEID_RESOURCE, $phone_number), $fields);
} | [
"function",
"phoneid",
"(",
"$",
"phone_number",
",",
"array",
"$",
"fields",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"post",
"(",
"sprintf",
"(",
"self",
"::",
"PHONEID_RESOURCE",
",",
"$",
"phone_number",
")",
",",
"$",
"fields",
")",
... | The PhoneID API provides a cleansed phone number, phone type, and telecom carrier information to determine the
best communication method - SMS or voice.
See https://developer.telesign.com/docs/phoneid-api for detailed API documentation. | [
"The",
"PhoneID",
"API",
"provides",
"a",
"cleansed",
"phone",
"number",
"phone",
"type",
"and",
"telecom",
"carrier",
"information",
"to",
"determine",
"the",
"best",
"communication",
"method",
"-",
"SMS",
"or",
"voice",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/phoneid/PhoneIdClient.php#L24-L26 |
191,349 | modxcms/teleport | src/Teleport/Beam/Endpoint.php | Endpoint.instance | public static function instance(array $options = array(), $forceNew = false)
{
if (self::$instance === null || $forceNew === true) {
self::$instance = new Endpoint($options);
} else {
self::$instance->setConfig($options);
}
return self::$instance;
} | php | public static function instance(array $options = array(), $forceNew = false)
{
if (self::$instance === null || $forceNew === true) {
self::$instance = new Endpoint($options);
} else {
self::$instance->setConfig($options);
}
return self::$instance;
} | [
"public",
"static",
"function",
"instance",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"forceNew",
"=",
"false",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"instance",
"===",
"null",
"||",
"$",
"forceNew",
"===",
"true",
")",
"{",
... | Get a singleton instance of the Teleport Endpoint listener.
@param array $options An associative array of Teleport Config options for the instance.
@param bool $forceNew If true, a new instance of Teleport is created and replaces the existing singleton.
@return HttpServer | [
"Get",
"a",
"singleton",
"instance",
"of",
"the",
"Teleport",
"Endpoint",
"listener",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Beam/Endpoint.php#L34-L42 |
191,350 | xsist10/HaveIBeenPwned | src/Adapter/Curl.php | Curl._createCurlHandle | private function _createCurlHandle() {
// Make sure the cURL extension is enabled
if (!$this->isSupported()) {
$this->logger->error("cURL extension not found (or not enabled).");
throw new UnsupportedException('cURL extension not found (or not enabled).');
}
$thi... | php | private function _createCurlHandle() {
// Make sure the cURL extension is enabled
if (!$this->isSupported()) {
$this->logger->error("cURL extension not found (or not enabled).");
throw new UnsupportedException('cURL extension not found (or not enabled).');
}
$thi... | [
"private",
"function",
"_createCurlHandle",
"(",
")",
"{",
"// Make sure the cURL extension is enabled",
"if",
"(",
"!",
"$",
"this",
"->",
"isSupported",
"(",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"\"cURL extension not found (or not enable... | Build a cURL resource with basic configurations already made
@return resource cURL handle | [
"Build",
"a",
"cURL",
"resource",
"with",
"basic",
"configurations",
"already",
"made"
] | 31231481965a7920530ad6e379a5fb14a67d5d44 | https://github.com/xsist10/HaveIBeenPwned/blob/31231481965a7920530ad6e379a5fb14a67d5d44/src/Adapter/Curl.php#L35-L71 |
191,351 | xsist10/HaveIBeenPwned | src/Adapter/Curl.php | Curl.get | public function get($url) {
$curl = $this->_createCurlHandle();
// Configure our cURL handle for our GET call
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_URL,... | php | public function get($url) {
$curl = $this->_createCurlHandle();
// Configure our cURL handle for our GET call
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_URL,... | [
"public",
"function",
"get",
"(",
"$",
"url",
")",
"{",
"$",
"curl",
"=",
"$",
"this",
"->",
"_createCurlHandle",
"(",
")",
";",
"// Configure our cURL handle for our GET call",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_RETURNTRANSFER",
",",
"true",
")",
... | Perform a GET request using a cURL handle
@param string $url What URL are we requesting from the API?
@return string Returns the body of the response | [
"Perform",
"a",
"GET",
"request",
"using",
"a",
"cURL",
"handle"
] | 31231481965a7920530ad6e379a5fb14a67d5d44 | https://github.com/xsist10/HaveIBeenPwned/blob/31231481965a7920530ad6e379a5fb14a67d5d44/src/Adapter/Curl.php#L79-L137 |
191,352 | TeleSign/php_telesign | src/rest/RestClient.php | RestClient.generateTelesignHeaders | static function generateTelesignHeaders (
$customer_id,
$api_key,
$method_name,
$resource,
$url_encoded_fields,
$date = null,
$nonce = null,
$user_agent = null,
$content_type = null
) {
if (!$date) {
$date = gmdate("D, d M Y H:i:s T");
}
if (!$nonce) {
$non... | php | static function generateTelesignHeaders (
$customer_id,
$api_key,
$method_name,
$resource,
$url_encoded_fields,
$date = null,
$nonce = null,
$user_agent = null,
$content_type = null
) {
if (!$date) {
$date = gmdate("D, d M Y H:i:s T");
}
if (!$nonce) {
$non... | [
"static",
"function",
"generateTelesignHeaders",
"(",
"$",
"customer_id",
",",
"$",
"api_key",
",",
"$",
"method_name",
",",
"$",
"resource",
",",
"$",
"url_encoded_fields",
",",
"$",
"date",
"=",
"null",
",",
"$",
"nonce",
"=",
"null",
",",
"$",
"user_age... | Generates the TeleSign REST API headers used to authenticate requests.
Creates the canonicalized string_to_sign and generates the HMAC signature. This is used to authenticate requests
against the TeleSign REST API.
See https://developer.telesign.com/docs/authentication-1 for detailed API documentation.
@param string... | [
"Generates",
"the",
"TeleSign",
"REST",
"API",
"headers",
"used",
"to",
"authenticate",
"requests",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/rest/RestClient.php#L82-L141 |
191,353 | TeleSign/php_telesign | src/rest/RestClient.php | RestClient.execute | protected function execute ($method_name, $resource, $fields = [], $date = null, $nonce = null) {
$url_encoded_fields = http_build_query($fields, null, "&");
$headers = $this->generateTelesignHeaders(
$this->customer_id,
$this->api_key,
$method_name,
$resource,
$url_encoded_fields... | php | protected function execute ($method_name, $resource, $fields = [], $date = null, $nonce = null) {
$url_encoded_fields = http_build_query($fields, null, "&");
$headers = $this->generateTelesignHeaders(
$this->customer_id,
$this->api_key,
$method_name,
$resource,
$url_encoded_fields... | [
"protected",
"function",
"execute",
"(",
"$",
"method_name",
",",
"$",
"resource",
",",
"$",
"fields",
"=",
"[",
"]",
",",
"$",
"date",
"=",
"null",
",",
"$",
"nonce",
"=",
"null",
")",
"{",
"$",
"url_encoded_fields",
"=",
"http_build_query",
"(",
"$",... | Generic TeleSign REST API request handler
@param string $resource The partial resource URI to perform the request against
@param array $fields Body of query params to perform the HTTP request with
@param string $date The date and time of the request
@param string $nonce A unique cryptographic nonce for the r... | [
"Generic",
"TeleSign",
"REST",
"API",
"request",
"handler"
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/rest/RestClient.php#L209-L230 |
191,354 | vi-kon/laravel-diff | src/ViKon/Diff/DiffGroup.php | DiffGroup.addEntry | public function addEntry(AbstractEntry $entry, $prepend = false) {
if ($prepend) {
array_unshift($this->entries, $entry);
} else {
$this->entries[] = $entry;
}
} | php | public function addEntry(AbstractEntry $entry, $prepend = false) {
if ($prepend) {
array_unshift($this->entries, $entry);
} else {
$this->entries[] = $entry;
}
} | [
"public",
"function",
"addEntry",
"(",
"AbstractEntry",
"$",
"entry",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"prepend",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"entries",
",",
"$",
"entry",
")",
";",
"}",
"else",
"{",... | Add new entry to group
@param \ViKon\Diff\Entry\AbstractEntry $entry
@param bool $prepend prepend or not entry to group | [
"Add",
"new",
"entry",
"to",
"group"
] | 936d23a2031c3629017f1a77622a67f712cfc530 | https://github.com/vi-kon/laravel-diff/blob/936d23a2031c3629017f1a77622a67f712cfc530/src/ViKon/Diff/DiffGroup.php#L27-L33 |
191,355 | xsist10/HaveIBeenPwned | src/HaveIBeenPwned.php | HaveIBeenPwned.getAdapter | protected function getAdapter() {
// Backwards compatability as I won't bump the version number for this
// yet. When I add PHP 7 support I'll bump it and remove this.
if (!$this->adapter) {
$this->adapter = new Curl();
$this->adapter->setLogger(new NullLogger());
... | php | protected function getAdapter() {
// Backwards compatability as I won't bump the version number for this
// yet. When I add PHP 7 support I'll bump it and remove this.
if (!$this->adapter) {
$this->adapter = new Curl();
$this->adapter->setLogger(new NullLogger());
... | [
"protected",
"function",
"getAdapter",
"(",
")",
"{",
"// Backwards compatability as I won't bump the version number for this",
"// yet. When I add PHP 7 support I'll bump it and remove this.",
"if",
"(",
"!",
"$",
"this",
"->",
"adapter",
")",
"{",
"$",
"this",
"->",
"adapte... | Return the adapter being used to connect to the remote server
@return Adapter | [
"Return",
"the",
"adapter",
"being",
"used",
"to",
"connect",
"to",
"the",
"remote",
"server"
] | 31231481965a7920530ad6e379a5fb14a67d5d44 | https://github.com/xsist10/HaveIBeenPwned/blob/31231481965a7920530ad6e379a5fb14a67d5d44/src/HaveIBeenPwned.php#L32-L40 |
191,356 | modxcms/teleport | src/Teleport/Action/Profile.php | Profile.process | public function process()
{
parent::process();
try {
if (!array_key_exists('config_key', $this->request->args())) {
$this->config_key = 'config';
}
if (!array_key_exists('code', $this->request->args())) {
$this->code = str_replace(a... | php | public function process()
{
parent::process();
try {
if (!array_key_exists('config_key', $this->request->args())) {
$this->config_key = 'config';
}
if (!array_key_exists('code', $this->request->args())) {
$this->code = str_replace(a... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'config_key'",
",",
"$",
"this",
"->",
"request",
"->",
"args",
"(",
")",
")",
")",
"{",
"$",
"this",
"-... | Process this action.
@throws \Teleport\Action\ActionException If an error is encountered processing this Action.
@return void | [
"Process",
"this",
"action",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Profile.php#L35-L90 |
191,357 | TeleSign/php_telesign | src/appverify/AppVerifyClient.php | AppVerifyClient.status | function status ($external_id, array $params = []) {
return $this->get(sprintf(self::APPVERIFY_STATUS_RESOURCE, $external_id), $params);
} | php | function status ($external_id, array $params = []) {
return $this->get(sprintf(self::APPVERIFY_STATUS_RESOURCE, $external_id), $params);
} | [
"function",
"status",
"(",
"$",
"external_id",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"sprintf",
"(",
"self",
"::",
"APPVERIFY_STATUS_RESOURCE",
",",
"$",
"external_id",
")",
",",
"$",
"params",
"... | Retrieves the verification result for an App Verify transaction by external_id. To ensure a secure verification
flow you must check the status using TeleSign's servers on your backend. Do not rely on the SDK alone to
indicate a successful verification.
See https://developer.telesign.com/docs/app-verify-android-sdk-sel... | [
"Retrieves",
"the",
"verification",
"result",
"for",
"an",
"App",
"Verify",
"transaction",
"by",
"external_id",
".",
"To",
"ensure",
"a",
"secure",
"verification",
"flow",
"you",
"must",
"check",
"the",
"status",
"using",
"TeleSign",
"s",
"servers",
"on",
"you... | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/appverify/AppVerifyClient.php#L24-L26 |
191,358 | modxcms/teleport | src/Teleport/Teleport.php | Teleport.loadProfile | public static function loadProfile($profile)
{
$decoded = json_decode(file_get_contents($profile));
if (!empty($decoded->code)) {
$decoded->code = str_replace(array('-', '.'), array('_', '_'), $decoded->code);
} else {
throw new InvalidProfileException("Error getting ... | php | public static function loadProfile($profile)
{
$decoded = json_decode(file_get_contents($profile));
if (!empty($decoded->code)) {
$decoded->code = str_replace(array('-', '.'), array('_', '_'), $decoded->code);
} else {
throw new InvalidProfileException("Error getting ... | [
"public",
"static",
"function",
"loadProfile",
"(",
"$",
"profile",
")",
"{",
"$",
"decoded",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"profile",
")",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"decoded",
"->",
"code",
")",
")",
"{",
... | Load JSON profile data into a PHP stdObject instance.
@param string $profile A valid stream or file location for the profile.
@throws InvalidProfileException If a valid code cannot be found in the
profile.
@return \stdClass A stdObject representation of the JSON profile data. | [
"Load",
"JSON",
"profile",
"data",
"into",
"a",
"PHP",
"stdObject",
"instance",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Teleport.php#L72-L81 |
191,359 | modxcms/teleport | src/Teleport/Teleport.php | Teleport.getMODX | public function getMODX($profile = null, array $options = array(), array &$results = array())
{
if ($profile === null && !$this->modx instanceof \modX) {
throw new InvalidMODXException("No profile or MODX instance was provided");
}
if (!$this->modx instanceof \modX) {
... | php | public function getMODX($profile = null, array $options = array(), array &$results = array())
{
if ($profile === null && !$this->modx instanceof \modX) {
throw new InvalidMODXException("No profile or MODX instance was provided");
}
if (!$this->modx instanceof \modX) {
... | [
"public",
"function",
"getMODX",
"(",
"$",
"profile",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"array",
"&",
"$",
"results",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"profile",
"===",
"null",
"&&",
"!",
"$"... | Get a MODX reference for Teleport to operate on.
IMPORTANT: Only one modX instance can be instantiated with Teleport in
a single PHP execution cycle.
@param \stdClass|null $profile An object of properties describing the modX instance.
@param array $options An array of initialization options.
@param array ... | [
"Get",
"a",
"MODX",
"reference",
"for",
"Teleport",
"to",
"operate",
"on",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Teleport.php#L96-L135 |
191,360 | modxcms/teleport | src/Teleport/Teleport.php | Teleport.setMODX | public function setMODX(\modX $modx, array $options = array())
{
if ($this->modx instanceof \modX) {
throw new InvalidMODXException('MODX already set; you cannot set another MODX instance');
}
if (!$modx instanceof \modX) {
throw new InvalidMODXException('Attempt to s... | php | public function setMODX(\modX $modx, array $options = array())
{
if ($this->modx instanceof \modX) {
throw new InvalidMODXException('MODX already set; you cannot set another MODX instance');
}
if (!$modx instanceof \modX) {
throw new InvalidMODXException('Attempt to s... | [
"public",
"function",
"setMODX",
"(",
"\\",
"modX",
"$",
"modx",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"modx",
"instanceof",
"\\",
"modX",
")",
"{",
"throw",
"new",
"InvalidMODXException",
"(",
... | Set a MODX instance to use with Teleport explicitly.
@param \modX $modx A MODX instance to attach to the Teleport instance.
@param array $options An array of options to override the profile.
@throws InvalidMODXException
@return resource A stream resource containing the profile ready for reading. | [
"Set",
"a",
"MODX",
"instance",
"to",
"use",
"with",
"Teleport",
"explicitly",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Teleport.php#L146-L177 |
191,361 | modxcms/teleport | src/Teleport/Teleport.php | Teleport.& | public function &getRequest($requestClass = '')
{
if (!is_string($requestClass) || $requestClass === '') {
$requestClass = $this->getConfig()->get('Request.class', null, 'Teleport\Request\CLIRequest');
}
if (!$this->request instanceof $requestClass) {
$this->request =... | php | public function &getRequest($requestClass = '')
{
if (!is_string($requestClass) || $requestClass === '') {
$requestClass = $this->getConfig()->get('Request.class', null, 'Teleport\Request\CLIRequest');
}
if (!$this->request instanceof $requestClass) {
$this->request =... | [
"public",
"function",
"&",
"getRequest",
"(",
"$",
"requestClass",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"requestClass",
")",
"||",
"$",
"requestClass",
"===",
"''",
")",
"{",
"$",
"requestClass",
"=",
"$",
"this",
"->",
"getConfi... | Get a Teleport Request object of a specific class.
@param string $requestClass The Request class to get an instance of.
@return Request A Teleport Request object. | [
"Get",
"a",
"Teleport",
"Request",
"object",
"of",
"a",
"specific",
"class",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Teleport.php#L209-L218 |
191,362 | modxcms/teleport | src/Teleport/Teleport.php | Teleport.registerStreamHandlers | protected function registerStreamHandlers()
{
$handlers = $this->getConfig()->get('stream_handlers', null, array());
if (!is_array($handlers)) {
throw new ConfigException('Invalid stream_handlers configuration', E_USER_ERROR);
}
$defaultStreamContext = array();
f... | php | protected function registerStreamHandlers()
{
$handlers = $this->getConfig()->get('stream_handlers', null, array());
if (!is_array($handlers)) {
throw new ConfigException('Invalid stream_handlers configuration', E_USER_ERROR);
}
$defaultStreamContext = array();
f... | [
"protected",
"function",
"registerStreamHandlers",
"(",
")",
"{",
"$",
"handlers",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"get",
"(",
"'stream_handlers'",
",",
"null",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$"... | Register stream handlers specified in the Teleport Config.
@throws ConfigException If an error occurs attempting to register a
stream_handler configuration element. | [
"Register",
"stream",
"handlers",
"specified",
"in",
"the",
"Teleport",
"Config",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Teleport.php#L226-L261 |
191,363 | TeleSign/php_telesign | src/voice/VoiceClient.php | VoiceClient.call | function call ($phone_number, $message, $message_type, array $other = []) {
return $this->post(self::VOICE_RESOURCE, array_merge($other, [
"phone_number" => $phone_number,
"message" => $message,
"message_type" => $message_type
]));
} | php | function call ($phone_number, $message, $message_type, array $other = []) {
return $this->post(self::VOICE_RESOURCE, array_merge($other, [
"phone_number" => $phone_number,
"message" => $message,
"message_type" => $message_type
]));
} | [
"function",
"call",
"(",
"$",
"phone_number",
",",
"$",
"message",
",",
"$",
"message_type",
",",
"array",
"$",
"other",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"post",
"(",
"self",
"::",
"VOICE_RESOURCE",
",",
"array_merge",
"(",
"$",
... | Send a voice call to the target phone_number.
See https://developer.telesign.com/docs/voice-api for detailed API documentation. | [
"Send",
"a",
"voice",
"call",
"to",
"the",
"target",
"phone_number",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/voice/VoiceClient.php#L21-L27 |
191,364 | TeleSign/php_telesign | src/voice/VoiceClient.php | VoiceClient.status | function status ($reference_id, array $params = []) {
return $this->get(sprintf(self::VOICE_STATUS_RESOURCE, $reference_id), $params);
} | php | function status ($reference_id, array $params = []) {
return $this->get(sprintf(self::VOICE_STATUS_RESOURCE, $reference_id), $params);
} | [
"function",
"status",
"(",
"$",
"reference_id",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"sprintf",
"(",
"self",
"::",
"VOICE_STATUS_RESOURCE",
",",
"$",
"reference_id",
")",
",",
"$",
"params",
")"... | Retrieves the current status of the voice call.
See https://developer.telesign.com/docs/voice-api for detailed API documentation. | [
"Retrieves",
"the",
"current",
"status",
"of",
"the",
"voice",
"call",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/voice/VoiceClient.php#L34-L36 |
191,365 | modxcms/teleport | src/Teleport/Action/Action.php | Action.& | public function &getMODX($profile)
{
if (!$this->modx instanceof \modX) {
$results = $this->request->getResults();
$this->modx = Teleport::instance()->getMODX($profile, $this->request->args(), $results);
}
return $this->modx;
} | php | public function &getMODX($profile)
{
if (!$this->modx instanceof \modX) {
$results = $this->request->getResults();
$this->modx = Teleport::instance()->getMODX($profile, $this->request->args(), $results);
}
return $this->modx;
} | [
"public",
"function",
"&",
"getMODX",
"(",
"$",
"profile",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"modx",
"instanceof",
"\\",
"modX",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"request",
"->",
"getResults",
"(",
")",
";",
"$",
"this",... | Get a MODX reference to operate on.
@param \stdClass $profile An object describing properties of a MODX
instance.
@return \modX A reference to a MODX instance. | [
"Get",
"a",
"MODX",
"reference",
"to",
"operate",
"on",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Action.php#L85-L92 |
191,366 | modxcms/teleport | src/Teleport/Action/Action.php | Action.validate | public function validate()
{
if (!empty($this->required)) {
$invalid = array_diff($this->required, array_keys($this->request->args()));
if (!empty($invalid)) {
foreach ($invalid as $argKey) {
$this->request->addResult("{$argKey} required for this r... | php | public function validate()
{
if (!empty($this->required)) {
$invalid = array_diff($this->required, array_keys($this->request->args()));
if (!empty($invalid)) {
foreach ($invalid as $argKey) {
$this->request->addResult("{$argKey} required for this r... | [
"public",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"required",
")",
")",
"{",
"$",
"invalid",
"=",
"array_diff",
"(",
"$",
"this",
"->",
"required",
",",
"array_keys",
"(",
"$",
"this",
"->",
"request",
... | Validate the arguments specified for this Action.
@throws \Teleport\Action\ActionException If required arguments are not specified.
@return bool TRUE if the arguments are valid, FALSE otherwise. | [
"Validate",
"the",
"arguments",
"specified",
"for",
"this",
"Action",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Action.php#L121-L132 |
191,367 | modxcms/teleport | src/Teleport/Action/Action.php | Action.pull | public function pull($source, $target)
{
$pulled = false;
if ($this->modx->getCacheManager()) {
$pulled = $this->modx->cacheManager->copyFile($source, $target, array('copy_preserve_permissions' => true));
}
return $pulled;
} | php | public function pull($source, $target)
{
$pulled = false;
if ($this->modx->getCacheManager()) {
$pulled = $this->modx->cacheManager->copyFile($source, $target, array('copy_preserve_permissions' => true));
}
return $pulled;
} | [
"public",
"function",
"pull",
"(",
"$",
"source",
",",
"$",
"target",
")",
"{",
"$",
"pulled",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"modx",
"->",
"getCacheManager",
"(",
")",
")",
"{",
"$",
"pulled",
"=",
"$",
"this",
"->",
"modx",
"-... | Pull a source to a specified target location.
@param string $source A valid stream URI or file path to the snapshot source.
@param string $target A valid stream URI or file path to copy the snapshot to.
@return bool Returns true if the pull was completed successfully. | [
"Pull",
"a",
"source",
"to",
"a",
"specified",
"target",
"location",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Action.php#L142-L149 |
191,368 | modxcms/teleport | src/Teleport/Action/Action.php | Action.push | public function push($source, $target)
{
$pushed = false;
if ($this->modx->getCacheManager()) {
$pushed = $this->modx->cacheManager->copyFile($source, $target, array('copy_preserve_permissions' => true));
}
return $pushed;
} | php | public function push($source, $target)
{
$pushed = false;
if ($this->modx->getCacheManager()) {
$pushed = $this->modx->cacheManager->copyFile($source, $target, array('copy_preserve_permissions' => true));
}
return $pushed;
} | [
"public",
"function",
"push",
"(",
"$",
"source",
",",
"$",
"target",
")",
"{",
"$",
"pushed",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"modx",
"->",
"getCacheManager",
"(",
")",
")",
"{",
"$",
"pushed",
"=",
"$",
"this",
"->",
"modx",
"-... | Push a source to a specified target location.
@param string $source A valid file or stream location source.
@param string $target A valid file or stream location target.
@return bool Returns true if the source was pushed successfully to the target, false otherwise. | [
"Push",
"a",
"source",
"to",
"a",
"specified",
"target",
"location",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Action.php#L159-L166 |
191,369 | xsist10/HaveIBeenPwned | src/Adapter/FileGetContents.php | FileGetContents.get | public function get($url) {
// Ensure we have the allow_url_fopen directive enabled
if (!$this->isSupported()) {
$this->logger->error("allow_url_fopen is disabled.");
throw new UnsupportedException('allow_url_fopen disabled.');
}
$this->logger->info("allow_url_fop... | php | public function get($url) {
// Ensure we have the allow_url_fopen directive enabled
if (!$this->isSupported()) {
$this->logger->error("allow_url_fopen is disabled.");
throw new UnsupportedException('allow_url_fopen disabled.');
}
$this->logger->info("allow_url_fop... | [
"public",
"function",
"get",
"(",
"$",
"url",
")",
"{",
"// Ensure we have the allow_url_fopen directive enabled",
"if",
"(",
"!",
"$",
"this",
"->",
"isSupported",
"(",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"\"allow_url_fopen is disabl... | Perform a GET request using a file handle
@param string $url What URL are we requesting from the API?
@return string Returns the body of the response | [
"Perform",
"a",
"GET",
"request",
"using",
"a",
"file",
"handle"
] | 31231481965a7920530ad6e379a5fb14a67d5d44 | https://github.com/xsist10/HaveIBeenPwned/blob/31231481965a7920530ad6e379a5fb14a67d5d44/src/Adapter/FileGetContents.php#L35-L61 |
191,370 | A1essandro/Diamond-And-Square | src/DiamondAndSquare.php | DiamondAndSquare.square | private function square($x, $y, $size, $offset)
{
$a = $this->getCellHeight($x - $size, $y - $size, $size);
$b = $this->getCellHeight($x + $size, $y + $size, $size);
$c = $this->getCellHeight($x - $size, $y + $size, $size);
$d = $this->getCellHeight($x + $size, $y - $size, $size);
... | php | private function square($x, $y, $size, $offset)
{
$a = $this->getCellHeight($x - $size, $y - $size, $size);
$b = $this->getCellHeight($x + $size, $y + $size, $size);
$c = $this->getCellHeight($x - $size, $y + $size, $size);
$d = $this->getCellHeight($x + $size, $y - $size, $size);
... | [
"private",
"function",
"square",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"size",
",",
"$",
"offset",
")",
"{",
"$",
"a",
"=",
"$",
"this",
"->",
"getCellHeight",
"(",
"$",
"x",
"-",
"$",
"size",
",",
"$",
"y",
"-",
"$",
"size",
",",
"$",
"s... | Definition of height middle point in square
@param $x int
@param $y int
@param $size int
@param $offset float | [
"Definition",
"of",
"height",
"middle",
"point",
"in",
"square"
] | f872758f750e52f563a79935f3d8a5a497fb7a74 | https://github.com/A1essandro/Diamond-And-Square/blob/f872758f750e52f563a79935f3d8a5a497fb7a74/src/DiamondAndSquare.php#L205-L219 |
191,371 | A1essandro/Diamond-And-Square | src/DiamondAndSquare.php | DiamondAndSquare.diamond | private function diamond($x, $y, $size, $offset)
{
$a = $this->getCellHeight($x, $y - $size, $size);
$b = $this->getCellHeight($x, $y + $size, $size);
$c = $this->getCellHeight($x - $size, $y, $size);
$d = $this->getCellHeight($x + $size, $y, $size);
$average = ($a + $b + $c... | php | private function diamond($x, $y, $size, $offset)
{
$a = $this->getCellHeight($x, $y - $size, $size);
$b = $this->getCellHeight($x, $y + $size, $size);
$c = $this->getCellHeight($x - $size, $y, $size);
$d = $this->getCellHeight($x + $size, $y, $size);
$average = ($a + $b + $c... | [
"private",
"function",
"diamond",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"size",
",",
"$",
"offset",
")",
"{",
"$",
"a",
"=",
"$",
"this",
"->",
"getCellHeight",
"(",
"$",
"x",
",",
"$",
"y",
"-",
"$",
"size",
",",
"$",
"size",
")",
";",
"... | Definition of height middle point in diamond
@param $x int
@param $y int
@param $size int
@param $offset float | [
"Definition",
"of",
"height",
"middle",
"point",
"in",
"diamond"
] | f872758f750e52f563a79935f3d8a5a497fb7a74 | https://github.com/A1essandro/Diamond-And-Square/blob/f872758f750e52f563a79935f3d8a5a497fb7a74/src/DiamondAndSquare.php#L229-L239 |
191,372 | A1essandro/Diamond-And-Square | src/DiamondAndSquare.php | DiamondAndSquare.getOffset | private function getOffset($stepSize)
{
$stepOffset = $stepSize / $this->size * mt_rand(-$this->size, $this->size);
$sign = $stepOffset < 0 ? -1 : 1;
return $sign * pow(abs($stepOffset), 1 / sqrt($this->getPersistence()));
} | php | private function getOffset($stepSize)
{
$stepOffset = $stepSize / $this->size * mt_rand(-$this->size, $this->size);
$sign = $stepOffset < 0 ? -1 : 1;
return $sign * pow(abs($stepOffset), 1 / sqrt($this->getPersistence()));
} | [
"private",
"function",
"getOffset",
"(",
"$",
"stepSize",
")",
"{",
"$",
"stepOffset",
"=",
"$",
"stepSize",
"/",
"$",
"this",
"->",
"size",
"*",
"mt_rand",
"(",
"-",
"$",
"this",
"->",
"size",
",",
"$",
"this",
"->",
"size",
")",
";",
"$",
"sign",... | Getting random displacement
@param float $stepSize
@return float | [
"Getting",
"random",
"displacement"
] | f872758f750e52f563a79935f3d8a5a497fb7a74 | https://github.com/A1essandro/Diamond-And-Square/blob/f872758f750e52f563a79935f3d8a5a497fb7a74/src/DiamondAndSquare.php#L248-L253 |
191,373 | A1essandro/Diamond-And-Square | src/DiamondAndSquare.php | DiamondAndSquare.getCellHeight | private function getCellHeight($x, $y, $stepSize = 0)
{
try {
return $this->terra[$x][$y];
} catch (Exception $e) {
return $this->getOffset($stepSize);
}
} | php | private function getCellHeight($x, $y, $stepSize = 0)
{
try {
return $this->terra[$x][$y];
} catch (Exception $e) {
return $this->getOffset($stepSize);
}
} | [
"private",
"function",
"getCellHeight",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"stepSize",
"=",
"0",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"terra",
"[",
"$",
"x",
"]",
"[",
"$",
"y",
"]",
";",
"}",
"catch",
"(",
"Exception",
"$",
... | return point height if point exists, else random height
@param $x
@param $y
@param $stepSize
@return double | [
"return",
"point",
"height",
"if",
"point",
"exists",
"else",
"random",
"height"
] | f872758f750e52f563a79935f3d8a5a497fb7a74 | https://github.com/A1essandro/Diamond-And-Square/blob/f872758f750e52f563a79935f3d8a5a497fb7a74/src/DiamondAndSquare.php#L264-L271 |
191,374 | modxcms/teleport | src/Teleport/Action/Inject.php | Inject.process | public function process()
{
parent::process();
try {
$this->profile = Teleport::loadProfile($this->profile);
$this->getMODX($this->profile);
$this->modx->setOption(\xPDO::OPT_SETUP, true);
$this->modx->loadClass('transport.xPDOTransport', XPDO_CORE_... | php | public function process()
{
parent::process();
try {
$this->profile = Teleport::loadProfile($this->profile);
$this->getMODX($this->profile);
$this->modx->setOption(\xPDO::OPT_SETUP, true);
$this->modx->loadClass('transport.xPDOTransport', XPDO_CORE_... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"try",
"{",
"$",
"this",
"->",
"profile",
"=",
"Teleport",
"::",
"loadProfile",
"(",
"$",
"this",
"->",
"profile",
")",
";",
"$",
"this",
"->",
"getMODX",
"(",
... | Process the Inject action.
@throws ActionException If an error is encountered during processing. | [
"Process",
"the",
"Inject",
"action",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Inject.php#L41-L91 |
191,375 | modxcms/teleport | src/Teleport/Beam/HttpServer.php | HttpServer.run | public function run($port)
{
$port = (integer)$port;
if ($port < 1) {
throw new \RuntimeException("Invalid port specified for Teleport HTTP Server", E_USER_ERROR);
}
/** @var \React\EventLoop\LibEventLoop $loop */
$loop = \React\EventLoop\Factory::create();
... | php | public function run($port)
{
$port = (integer)$port;
if ($port < 1) {
throw new \RuntimeException("Invalid port specified for Teleport HTTP Server", E_USER_ERROR);
}
/** @var \React\EventLoop\LibEventLoop $loop */
$loop = \React\EventLoop\Factory::create();
... | [
"public",
"function",
"run",
"(",
"$",
"port",
")",
"{",
"$",
"port",
"=",
"(",
"integer",
")",
"$",
"port",
";",
"if",
"(",
"$",
"port",
"<",
"1",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"Invalid port specified for Teleport HTTP Server\... | Run the Teleport HTTP Server on the specified port.
@param int $port A valid port to run the Teleport HTTP Server on.
@throws \RuntimeException If an invalid port is specified. | [
"Run",
"the",
"Teleport",
"HTTP",
"Server",
"on",
"the",
"specified",
"port",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Beam/HttpServer.php#L42-L96 |
191,376 | modxcms/teleport | src/Teleport/Action/Extract.php | Extract.process | public function process()
{
parent::process();
try {
$this->profile = Teleport::loadProfile($this->profile);
$this->getMODX($this->profile);
$this->tpl = $this->loadTpl($this->tpl);
$this->package = $this->createPackage($this->getName(), $this->getV... | php | public function process()
{
parent::process();
try {
$this->profile = Teleport::loadProfile($this->profile);
$this->getMODX($this->profile);
$this->tpl = $this->loadTpl($this->tpl);
$this->package = $this->createPackage($this->getName(), $this->getV... | [
"public",
"function",
"process",
"(",
")",
"{",
"parent",
"::",
"process",
"(",
")",
";",
"try",
"{",
"$",
"this",
"->",
"profile",
"=",
"Teleport",
"::",
"loadProfile",
"(",
"$",
"this",
"->",
"profile",
")",
";",
"$",
"this",
"->",
"getMODX",
"(",
... | Process the Extract action.
@throws ActionException If an error is encountered during processing. | [
"Process",
"the",
"Extract",
"action",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Extract.php#L49-L100 |
191,377 | modxcms/teleport | src/Teleport/Action/Extract.php | Extract.loadTpl | protected function loadTpl($tpl)
{
$this->tplBase = $this->request->args('tplBase') ? $this->request->args('tplBase') : dirname($tpl);
$content = file_get_contents($tpl);
$this->prepareTpl($content);
return json_decode($content, true);
} | php | protected function loadTpl($tpl)
{
$this->tplBase = $this->request->args('tplBase') ? $this->request->args('tplBase') : dirname($tpl);
$content = file_get_contents($tpl);
$this->prepareTpl($content);
return json_decode($content, true);
} | [
"protected",
"function",
"loadTpl",
"(",
"$",
"tpl",
")",
"{",
"$",
"this",
"->",
"tplBase",
"=",
"$",
"this",
"->",
"request",
"->",
"args",
"(",
"'tplBase'",
")",
"?",
"$",
"this",
"->",
"request",
"->",
"args",
"(",
"'tplBase'",
")",
":",
"dirname... | Load the JSON extract tpl data into a PHP array.
@param string $tpl A valid stream or file location for the tpl.
@return array An array of the tpl data. | [
"Load",
"the",
"JSON",
"extract",
"tpl",
"data",
"into",
"a",
"PHP",
"array",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Extract.php#L109-L115 |
191,378 | modxcms/teleport | src/Teleport/Action/Extract.php | Extract.prepareTpl | protected function prepareTpl(&$content)
{
$this->modx->loadClass('modParser', '', false, true);
$parser = new Parser($this->modx);
$this->modx->toPlaceholders($this->profile);
$this->modx->toPlaceholders($this->request->args());
$parser->processElementTags('', $content);
... | php | protected function prepareTpl(&$content)
{
$this->modx->loadClass('modParser', '', false, true);
$parser = new Parser($this->modx);
$this->modx->toPlaceholders($this->profile);
$this->modx->toPlaceholders($this->request->args());
$parser->processElementTags('', $content);
... | [
"protected",
"function",
"prepareTpl",
"(",
"&",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"modx",
"->",
"loadClass",
"(",
"'modParser'",
",",
"''",
",",
"false",
",",
"true",
")",
";",
"$",
"parser",
"=",
"new",
"Parser",
"(",
"$",
"this",
"->",
... | Parse the tpl replacing placeholders from the profile and request arguments.
@param string $content The content of the tpl. | [
"Parse",
"the",
"tpl",
"replacing",
"placeholders",
"from",
"the",
"profile",
"and",
"request",
"arguments",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Extract.php#L122-L129 |
191,379 | modxcms/teleport | src/Teleport/Action/Extract.php | Extract.createPackage | protected function createPackage($name, $version, $release = '')
{
$this->modx->loadClass('transport.xPDOTransport', XPDO_CORE_PATH, true, true);
$this->modx->loadClass('transport.xPDOVehicle', XPDO_CORE_PATH, true, true);
$this->modx->loadClass('transport.xPDOObjectVehicle', XPDO_CORE_PATH,... | php | protected function createPackage($name, $version, $release = '')
{
$this->modx->loadClass('transport.xPDOTransport', XPDO_CORE_PATH, true, true);
$this->modx->loadClass('transport.xPDOVehicle', XPDO_CORE_PATH, true, true);
$this->modx->loadClass('transport.xPDOObjectVehicle', XPDO_CORE_PATH,... | [
"protected",
"function",
"createPackage",
"(",
"$",
"name",
",",
"$",
"version",
",",
"$",
"release",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"modx",
"->",
"loadClass",
"(",
"'transport.xPDOTransport'",
",",
"XPDO_CORE_PATH",
",",
"true",
",",
"true",
")",... | Create a Transport package to store extracted data into.
@param string $name The name of the package to create.
@param string $version The version of the package to create.
@param string $release The release of the package to create.
@return Transport A new Transport instance with a signature compiled from name, vers... | [
"Create",
"a",
"Transport",
"package",
"to",
"store",
"extracted",
"data",
"into",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Extract.php#L140-L176 |
191,380 | modxcms/teleport | src/Teleport/Action/Extract.php | Extract.getSequence | protected function getSequence()
{
return $this->getRequest()->args('version') || $this->getRequest()->args('release')
? ($this->getRequest()->args('release') === null
? ''
: $this->getRequest()->args('release'))
: $this->modx->version['full_version'];... | php | protected function getSequence()
{
return $this->getRequest()->args('version') || $this->getRequest()->args('release')
? ($this->getRequest()->args('release') === null
? ''
: $this->getRequest()->args('release'))
: $this->modx->version['full_version'];... | [
"protected",
"function",
"getSequence",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"args",
"(",
"'version'",
")",
"||",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"args",
"(",
"'release'",
")",
"?",
"(",
"$",
"thi... | Get a package sequence for this snapshot.
@return string The package sequence string. | [
"Get",
"a",
"package",
"sequence",
"for",
"this",
"snapshot",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Action/Extract.php#L203-L210 |
191,381 | TeleSign/php_telesign | src/messaging/MessagingClient.php | MessagingClient.message | function message ($phone_number, $message, $message_type, array $other = []) {
return $this->post(self::MESSAGING_RESOURCE, array_merge($other, [
"phone_number" => $phone_number,
"message" => $message,
"message_type" => $message_type
]));
} | php | function message ($phone_number, $message, $message_type, array $other = []) {
return $this->post(self::MESSAGING_RESOURCE, array_merge($other, [
"phone_number" => $phone_number,
"message" => $message,
"message_type" => $message_type
]));
} | [
"function",
"message",
"(",
"$",
"phone_number",
",",
"$",
"message",
",",
"$",
"message_type",
",",
"array",
"$",
"other",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"post",
"(",
"self",
"::",
"MESSAGING_RESOURCE",
",",
"array_merge",
"(",
... | Send a message to the target phone_number.
See https://developer.telesign.com/docs/messaging-api for detailed API documentation. | [
"Send",
"a",
"message",
"to",
"the",
"target",
"phone_number",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/messaging/MessagingClient.php#L21-L27 |
191,382 | TeleSign/php_telesign | src/messaging/MessagingClient.php | MessagingClient.status | function status ($reference_id, array $params = []) {
return $this->get(sprintf(self::MESSAGING_STATUS_RESOURCE, $reference_id), $params);
} | php | function status ($reference_id, array $params = []) {
return $this->get(sprintf(self::MESSAGING_STATUS_RESOURCE, $reference_id), $params);
} | [
"function",
"status",
"(",
"$",
"reference_id",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"sprintf",
"(",
"self",
"::",
"MESSAGING_STATUS_RESOURCE",
",",
"$",
"reference_id",
")",
",",
"$",
"params",
... | Retrieves the current status of the message.
See https://developer.telesign.com/docs/messaging-api for detailed API documentation. | [
"Retrieves",
"the",
"current",
"status",
"of",
"the",
"message",
"."
] | ed69d398de99b3659f01a179a6a1a80aa34c54e0 | https://github.com/TeleSign/php_telesign/blob/ed69d398de99b3659f01a179a6a1a80aa34c54e0/src/messaging/MessagingClient.php#L34-L36 |
191,383 | modxcms/teleport | src/Teleport/Composer.php | Composer.copyTpl | public static function copyTpl(CommandEvent $event)
{
$config = self::getOptions($event);
/* symlink the tpl files from the teleport library */
$sources = new Finder();
$sources->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.tpl.json')->name('*.php')->in(dirname(dirname(__... | php | public static function copyTpl(CommandEvent $event)
{
$config = self::getOptions($event);
/* symlink the tpl files from the teleport library */
$sources = new Finder();
$sources->files()->ignoreVCS(true)->ignoreDotFiles(true)->name('*.tpl.json')->name('*.php')->in(dirname(dirname(__... | [
"public",
"static",
"function",
"copyTpl",
"(",
"CommandEvent",
"$",
"event",
")",
"{",
"$",
"config",
"=",
"self",
"::",
"getOptions",
"(",
"$",
"event",
")",
";",
"/* symlink the tpl files from the teleport library */",
"$",
"sources",
"=",
"new",
"Finder",
"(... | Copy teleport tpl files in local tpl directory.
@param CommandEvent $event The composer Event object. | [
"Copy",
"teleport",
"tpl",
"files",
"in",
"local",
"tpl",
"directory",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Composer.php#L48-L59 |
191,384 | modxcms/teleport | src/Teleport/Composer.php | Composer.getOptions | protected static function getOptions(CommandEvent $event)
{
$options = array_merge(
array(
'teleport-tpl-dir' => 'tpl',
'teleport-tpl-update' => true
),
$event->getComposer()->getPackage()->getExtra()
);
return $options;
... | php | protected static function getOptions(CommandEvent $event)
{
$options = array_merge(
array(
'teleport-tpl-dir' => 'tpl',
'teleport-tpl-update' => true
),
$event->getComposer()->getPackage()->getExtra()
);
return $options;
... | [
"protected",
"static",
"function",
"getOptions",
"(",
"CommandEvent",
"$",
"event",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"array",
"(",
"'teleport-tpl-dir'",
"=>",
"'tpl'",
",",
"'teleport-tpl-update'",
"=>",
"true",
")",
",",
"$",
"event",
"->",
... | Get the config data from the extra definition in composer.json.
@param CommandEvent $event The composer Event object.
@return array An array of options from the package extra. | [
"Get",
"the",
"config",
"data",
"from",
"the",
"extra",
"definition",
"in",
"composer",
".",
"json",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Composer.php#L92-L102 |
191,385 | modxcms/teleport | src/Teleport/Request/Request.php | Request.__isset | public function __isset($name)
{
$isset = false;
if (!empty($name)) {
$isset = array_key_exists($name, $this->arguments);
}
return $isset;
} | php | public function __isset($name)
{
$isset = false;
if (!empty($name)) {
$isset = array_key_exists($name, $this->arguments);
}
return $isset;
} | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"$",
"isset",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"$",
"isset",
"=",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"arguments",
... | See if an argument or member variable isset for this request.
@param string $name The name of the argument or member variable.
@return bool TRUE if the argument or variable exists, FALSE otherwise. | [
"See",
"if",
"an",
"argument",
"or",
"member",
"variable",
"isset",
"for",
"this",
"request",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/Request.php#L39-L46 |
191,386 | modxcms/teleport | src/Teleport/Request/Request.php | Request.args | public function args($key = array())
{
if (is_array($key)) {
$args = array();
if (!empty($key)) {
foreach ($key as $k) $args[$k] = $this->args($k);
} else {
$args = $this->arguments;
}
return $args;
} elseif ... | php | public function args($key = array())
{
if (is_array($key)) {
$args = array();
if (!empty($key)) {
foreach ($key as $k) $args[$k] = $this->args($k);
} else {
$args = $this->arguments;
}
return $args;
} elseif ... | [
"public",
"function",
"args",
"(",
"$",
"key",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"args",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"fore... | Get one or more arguments from the request.
An empty array will return all arguments.
@param array|string $key The argument key or an array of argument keys.
@return array|mixed|null The value or an array of values for the requested
argument(s). | [
"Get",
"one",
"or",
"more",
"arguments",
"from",
"the",
"request",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/Request.php#L97-L112 |
191,387 | modxcms/teleport | src/Teleport/Request/Request.php | Request.handle | public function handle(array $arguments)
{
$this->parseArguments($arguments);
$actionClass = $this->getActionClass();
if (class_exists($actionClass, true)) {
try {
/** @var \Teleport\Action\Action $handler */
$handler = new $actionClass($this);
... | php | public function handle(array $arguments)
{
$this->parseArguments($arguments);
$actionClass = $this->getActionClass();
if (class_exists($actionClass, true)) {
try {
/** @var \Teleport\Action\Action $handler */
$handler = new $actionClass($this);
... | [
"public",
"function",
"handle",
"(",
"array",
"$",
"arguments",
")",
"{",
"$",
"this",
"->",
"parseArguments",
"(",
"$",
"arguments",
")",
";",
"$",
"actionClass",
"=",
"$",
"this",
"->",
"getActionClass",
"(",
")",
";",
"if",
"(",
"class_exists",
"(",
... | Handle the requested action.
@param array $arguments An array of arguments for the request.
@throws RequestException If an error occurs handling the request. | [
"Handle",
"the",
"requested",
"action",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/Request.php#L130-L148 |
191,388 | modxcms/teleport | src/Teleport/Request/Request.php | Request.log | public function log($msg, $timestamp = true)
{
if ($timestamp) {
$timestamp = strftime("%Y-%m-%d %H:%M:%S");
$msg = "[{$timestamp}] {$msg}";
}
$this->addResult($msg);
if ($this->verbose) echo $msg . PHP_EOL;
} | php | public function log($msg, $timestamp = true)
{
if ($timestamp) {
$timestamp = strftime("%Y-%m-%d %H:%M:%S");
$msg = "[{$timestamp}] {$msg}";
}
$this->addResult($msg);
if ($this->verbose) echo $msg . PHP_EOL;
} | [
"public",
"function",
"log",
"(",
"$",
"msg",
",",
"$",
"timestamp",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"timestamp",
")",
"{",
"$",
"timestamp",
"=",
"strftime",
"(",
"\"%Y-%m-%d %H:%M:%S\"",
")",
";",
"$",
"msg",
"=",
"\"[{$timestamp}] {$msg}\"",
";... | Log a result message and echo it if verbose is true.
@param string $msg The result message.
@param bool $timestamp Indicates if the log entry should include a timestamp.
@return void | [
"Log",
"a",
"result",
"message",
"and",
"echo",
"it",
"if",
"verbose",
"is",
"true",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/Request.php#L191-L199 |
191,389 | modxcms/teleport | src/Teleport/Request/Request.php | Request.parseArguments | public function parseArguments(array $args)
{
if (!isset($args['action']) || empty($args['action'])) {
if (isset($args['version']) || isset($args['V'])) {
$this->action = 'Version';
$this->arguments = $args;
return $this->arguments;
}
... | php | public function parseArguments(array $args)
{
if (!isset($args['action']) || empty($args['action'])) {
if (isset($args['version']) || isset($args['V'])) {
$this->action = 'Version';
$this->arguments = $args;
return $this->arguments;
}
... | [
"public",
"function",
"parseArguments",
"(",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"args",
"[",
"'action'",
"]",
")",
"||",
"empty",
"(",
"$",
"args",
"[",
"'action'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",... | Parse the request arguments into a normalized format.
@param array $args An array of arguments to parse.
@return array The normalized array of parsed arguments.
@throws RequestException If no valid action argument is specified. | [
"Parse",
"the",
"request",
"arguments",
"into",
"a",
"normalized",
"format",
"."
] | 242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73 | https://github.com/modxcms/teleport/blob/242f69fcb6b2505d6f76d548d3f7eca7fb4f3a73/src/Teleport/Request/Request.php#L219-L238 |
191,390 | php-quartz/quartz | Core/TriggerBuilder.php | TriggerBuilder.withIdentity | public function withIdentity($name, $group = null)
{
$this->key = new Key($name, $group);
return $this;
} | php | public function withIdentity($name, $group = null)
{
$this->key = new Key($name, $group);
return $this;
} | [
"public",
"function",
"withIdentity",
"(",
"$",
"name",
",",
"$",
"group",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"key",
"=",
"new",
"Key",
"(",
"$",
"name",
",",
"$",
"group",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Use a TriggerKey with the given name and group to
identify the Trigger.
<p>If none of the 'withIdentity' methods are set on the TriggerBuilder,
then a random, unique TriggerKey will be generated.</p>
@param string $name the name element for the Trigger's TriggerKey
@param string $group the group element for the Trigg... | [
"Use",
"a",
"TriggerKey",
"with",
"the",
"given",
"name",
"and",
"group",
"to",
"identify",
"the",
"Trigger",
"."
] | a8ea9d5153cce188c7f9f2b84c4e252397e535a5 | https://github.com/php-quartz/quartz/blob/a8ea9d5153cce188c7f9f2b84c4e252397e535a5/Core/TriggerBuilder.php#L159-L164 |
191,391 | php-quartz/quartz | Core/TriggerBuilder.php | TriggerBuilder.forJobDetail | public function forJobDetail(JobDetail $jobDetail)
{
if(null == $key = $jobDetail->getKey()) {
throw new InvalidArgumentException('The given job has not yet had a key assigned to it.');
}
$this->jobKey = clone $key;
return $this;
} | php | public function forJobDetail(JobDetail $jobDetail)
{
if(null == $key = $jobDetail->getKey()) {
throw new InvalidArgumentException('The given job has not yet had a key assigned to it.');
}
$this->jobKey = clone $key;
return $this;
} | [
"public",
"function",
"forJobDetail",
"(",
"JobDetail",
"$",
"jobDetail",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"key",
"=",
"$",
"jobDetail",
"->",
"getKey",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The given job has not yet had... | Set the identity of the Job which should be fired by the produced
Trigger, by extracting the JobKey from the given job.
@param JobDetail $jobDetail the Job to fire.
@return TriggerBuilder
@see Trigger#getJobKey() | [
"Set",
"the",
"identity",
"of",
"the",
"Job",
"which",
"should",
"be",
"fired",
"by",
"the",
"produced",
"Trigger",
"by",
"extracting",
"the",
"JobKey",
"from",
"the",
"given",
"job",
"."
] | a8ea9d5153cce188c7f9f2b84c4e252397e535a5 | https://github.com/php-quartz/quartz/blob/a8ea9d5153cce188c7f9f2b84c4e252397e535a5/Core/TriggerBuilder.php#L362-L371 |
191,392 | stephweb/daw-php-pagination | src/DawPhpPagination/RendererGenerator.php | RendererGenerator.render | final public function render($ifIssetGet = null): string
{
$html = '';
$andIfHasQueryParams = $this->accumulateIfHasQueryParams($ifIssetGet);
if ($this->pagination->getGetPP() != Pagination::ALL && $this->pagination->getCount() > $this->pagination->getPerPage()) {
$html ... | php | final public function render($ifIssetGet = null): string
{
$html = '';
$andIfHasQueryParams = $this->accumulateIfHasQueryParams($ifIssetGet);
if ($this->pagination->getGetPP() != Pagination::ALL && $this->pagination->getCount() > $this->pagination->getPerPage()) {
$html ... | [
"final",
"public",
"function",
"render",
"(",
"$",
"ifIssetGet",
"=",
"null",
")",
":",
"string",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"andIfHasQueryParams",
"=",
"$",
"this",
"->",
"accumulateIfHasQueryParams",
"(",
"$",
"ifIssetGet",
")",
";",
"if",
... | Pour afficher la pagination
@param array|string|null $ifIssetGet - Si il y a déjà des GET dans l'URL, les cumuler avec les liens
@return string | [
"Pour",
"afficher",
"la",
"pagination"
] | 60108cd2f130db26f5bbb1b8cbc7e15fa3cc7f85 | https://github.com/stephweb/daw-php-pagination/blob/60108cd2f130db26f5bbb1b8cbc7e15fa3cc7f85/src/DawPhpPagination/RendererGenerator.php#L76-L105 |
191,393 | radnan/rdn-csv | src/RdnCsv/Controller/Plugin/CsvImport.php | CsvImport.rewind | public function rewind()
{
$this->file->rewind();
if ($this->useFirstRecordAsHeader)
{
if (!$this->file->valid())
{
throw new \RuntimeException('Expected first row to be header, but reached EOF instead');
}
$this->header = $this->file->current();
$this->file->next();
}
} | php | public function rewind()
{
$this->file->rewind();
if ($this->useFirstRecordAsHeader)
{
if (!$this->file->valid())
{
throw new \RuntimeException('Expected first row to be header, but reached EOF instead');
}
$this->header = $this->file->current();
$this->file->next();
}
} | [
"public",
"function",
"rewind",
"(",
")",
"{",
"$",
"this",
"->",
"file",
"->",
"rewind",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"useFirstRecordAsHeader",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
"->",
"valid",
"(",
")",
")",
"{... | Rewind the Iterator to the first element. Optionally consumes the first record as the header.
@return void
@throws \RuntimeException | [
"Rewind",
"the",
"Iterator",
"to",
"the",
"first",
"element",
".",
"Optionally",
"consumes",
"the",
"first",
"record",
"as",
"the",
"header",
"."
] | 1c21ddbcc777bba2a6f584fb0ce41c6963fd6494 | https://github.com/radnan/rdn-csv/blob/1c21ddbcc777bba2a6f584fb0ce41c6963fd6494/src/RdnCsv/Controller/Plugin/CsvImport.php#L67-L79 |
191,394 | radnan/rdn-csv | src/RdnCsv/Controller/Plugin/CsvImport.php | CsvImport.current | public function current()
{
$line = $this->file->current();
if ($this->useFirstRecordAsHeader)
{
$header = $this->header;
if (count($line) != count($header))
{
$size = min(count($header), count($line));
$header = array_slice($this->header, 0, $size);
$line = array_slice($line, 0, $size);
... | php | public function current()
{
$line = $this->file->current();
if ($this->useFirstRecordAsHeader)
{
$header = $this->header;
if (count($line) != count($header))
{
$size = min(count($header), count($line));
$header = array_slice($this->header, 0, $size);
$line = array_slice($line, 0, $size);
... | [
"public",
"function",
"current",
"(",
")",
"{",
"$",
"line",
"=",
"$",
"this",
"->",
"file",
"->",
"current",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"useFirstRecordAsHeader",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"header",
";",
"if... | Return the current record. Optionally uses the header record as keys.
@return array | [
"Return",
"the",
"current",
"record",
".",
"Optionally",
"uses",
"the",
"header",
"record",
"as",
"keys",
"."
] | 1c21ddbcc777bba2a6f584fb0ce41c6963fd6494 | https://github.com/radnan/rdn-csv/blob/1c21ddbcc777bba2a6f584fb0ce41c6963fd6494/src/RdnCsv/Controller/Plugin/CsvImport.php#L96-L111 |
191,395 | cheprasov/php-parallel | src/Parallel/Parallel.php | Parallel.run | public function run($name, $callback) {
if (!is_callable($callback)) {
throw new \InvalidArgumentException('$callback is not callable');
}
// Because, we need to remove exists Instance before fork
$this->Storage->setup();
$pid = pcntl_fork();
if ($pid === -1... | php | public function run($name, $callback) {
if (!is_callable($callback)) {
throw new \InvalidArgumentException('$callback is not callable');
}
// Because, we need to remove exists Instance before fork
$this->Storage->setup();
$pid = pcntl_fork();
if ($pid === -1... | [
"public",
"function",
"run",
"(",
"$",
"name",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$callback is not callable'",
")",
";",
"}",
"// Beca... | Run a new fork with some name
@param string $name
@param \Closure|string|array $callback
@return bool | [
"Run",
"a",
"new",
"fork",
"with",
"some",
"name"
] | 5473371a95df375c8ed4c1f18e6d5f845ccbce9e | https://github.com/cheprasov/php-parallel/blob/5473371a95df375c8ed4c1f18e6d5f845ccbce9e/src/Parallel/Parallel.php#L48-L69 |
191,396 | josegonzalez/php-error-handlers | src/Utility/ConfigTrait.php | ConfigTrait.configDefault | public function configDefault($key, $default = null)
{
$value = $this->config($key);
if ($value === null) {
$this->config($key, $default);
}
} | php | public function configDefault($key, $default = null)
{
$value = $this->config($key);
if ($value === null) {
$this->config($key, $default);
}
} | [
"public",
"function",
"configDefault",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"config",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"this",
"->",
... | Sets a default value for a given key
@param string|array|null $key The key to set
@param mixed|null $value The value to set.
@return void | [
"Sets",
"a",
"default",
"value",
"for",
"a",
"given",
"key"
] | 4808a018f5fd6293d606ce00170519ed0211cf95 | https://github.com/josegonzalez/php-error-handlers/blob/4808a018f5fd6293d606ce00170519ed0211cf95/src/Utility/ConfigTrait.php#L13-L19 |
191,397 | jasonlam604/Stringizer | src/Stringizer.php | Stringizer.concat | public function concat($value, $preAppend = false)
{
$transformer = new Concat($this->value, $value);
$transformer->setPreAppend($preAppend);
$this->value = $transformer->execute();
return $this;
} | php | public function concat($value, $preAppend = false)
{
$transformer = new Concat($this->value, $value);
$transformer->setPreAppend($preAppend);
$this->value = $transformer->execute();
return $this;
} | [
"public",
"function",
"concat",
"(",
"$",
"value",
",",
"$",
"preAppend",
"=",
"false",
")",
"{",
"$",
"transformer",
"=",
"new",
"Concat",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"value",
")",
";",
"$",
"transformer",
"->",
"setPreAppend",
"(",
"... | Append 2 String values
@param string $value
@param string $preAppend
flag when true to prepend value
@return \Stringizer\Stringizer | [
"Append",
"2",
"String",
"values"
] | 5ce3732152ea03a375251ff0b95d8f05b9d3fd53 | https://github.com/jasonlam604/Stringizer/blob/5ce3732152ea03a375251ff0b95d8f05b9d3fd53/src/Stringizer.php#L209-L215 |
191,398 | jasonlam604/Stringizer | src/Stringizer.php | Stringizer.delete | public function delete($needles)
{
$this->value = (new Replace($this->value, $needles, ""))->execute();
return $this;
} | php | public function delete($needles)
{
$this->value = (new Replace($this->value, $needles, ""))->execute();
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"needles",
")",
"{",
"$",
"this",
"->",
"value",
"=",
"(",
"new",
"Replace",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"needles",
",",
"\"\"",
")",
")",
"->",
"execute",
"(",
")",
";",
"return",
"$",
"th... | Delete runes in str matching the pattern, similiar in Ruby
Simple wrapper to Replace
@param string or array $needles
@return \Stringizer\Stringizer | [
"Delete",
"runes",
"in",
"str",
"matching",
"the",
"pattern",
"similiar",
"in",
"Ruby"
] | 5ce3732152ea03a375251ff0b95d8f05b9d3fd53 | https://github.com/jasonlam604/Stringizer/blob/5ce3732152ea03a375251ff0b95d8f05b9d3fd53/src/Stringizer.php#L257-L261 |
191,399 | jasonlam604/Stringizer | src/Stringizer.php | Stringizer.truncate | public function truncate($numberToTruncate)
{
$this->value = (new Truncate($this->value, $numberToTruncate))->execute();
return $this;
} | php | public function truncate($numberToTruncate)
{
$this->value = (new Truncate($this->value, $numberToTruncate))->execute();
return $this;
} | [
"public",
"function",
"truncate",
"(",
"$",
"numberToTruncate",
")",
"{",
"$",
"this",
"->",
"value",
"=",
"(",
"new",
"Truncate",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"numberToTruncate",
")",
")",
"->",
"execute",
"(",
")",
";",
"return",
"$",
... | Truncate remove the number of indicated values at the end of the string
@param int $numberToTruncate
@throws \InvalidArgumentException
@return \Stringizer\Stringizer | [
"Truncate",
"remove",
"the",
"number",
"of",
"indicated",
"values",
"at",
"the",
"end",
"of",
"the",
"string"
] | 5ce3732152ea03a375251ff0b95d8f05b9d3fd53 | https://github.com/jasonlam604/Stringizer/blob/5ce3732152ea03a375251ff0b95d8f05b9d3fd53/src/Stringizer.php#L651-L655 |
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.