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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
221,900 | ins0/google-measurement-php-client | src/Racecore/GATracking/Client/Adapter/Socket.php | Socket.writeHeader | private function writeHeader($endpoint, Request\TrackingRequest $request, $lastData = false)
{
// create data
$payloadString = http_build_query($request->getPayload());
$payloadLength = strlen($payloadString);
$header = 'POST ' . $endpoint['path'] . ' HTTP/1.1' . "\r\n" .
... | php | private function writeHeader($endpoint, Request\TrackingRequest $request, $lastData = false)
{
// create data
$payloadString = http_build_query($request->getPayload());
$payloadLength = strlen($payloadString);
$header = 'POST ' . $endpoint['path'] . ' HTTP/1.1' . "\r\n" .
... | [
"private",
"function",
"writeHeader",
"(",
"$",
"endpoint",
",",
"Request",
"\\",
"TrackingRequest",
"$",
"request",
",",
"$",
"lastData",
"=",
"false",
")",
"{",
"// create data",
"$",
"payloadString",
"=",
"http_build_query",
"(",
"$",
"request",
"->",
"getP... | Write the connection header
@param $endpoint
@param Request\TrackingRequest $request
@param bool $lastData
@return string
@throws Exception\EndpointServerException | [
"Write",
"the",
"connection",
"header"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Client/Adapter/Socket.php#L55-L75 |
221,901 | ins0/google-measurement-php-client | src/Racecore/GATracking/Client/Adapter/Socket.php | Socket.readConnection | private function readConnection(Request\TrackingRequest $request)
{
// response
$response = '';
// receive response
do {
$out = @socket_read($this->connection, self::READ_BUFFER);
$response .= $out;
if (!$out || strlen($out) < self::READ_BUFFER) ... | php | private function readConnection(Request\TrackingRequest $request)
{
// response
$response = '';
// receive response
do {
$out = @socket_read($this->connection, self::READ_BUFFER);
$response .= $out;
if (!$out || strlen($out) < self::READ_BUFFER) ... | [
"private",
"function",
"readConnection",
"(",
"Request",
"\\",
"TrackingRequest",
"$",
"request",
")",
"{",
"// response",
"$",
"response",
"=",
"''",
";",
"// receive response",
"do",
"{",
"$",
"out",
"=",
"@",
"socket_read",
"(",
"$",
"this",
"->",
"connec... | Read from the current connection
@param Request\TrackingRequest $request
@return array|false | [
"Read",
"from",
"the",
"current",
"connection"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Client/Adapter/Socket.php#L82-L100 |
221,902 | ins0/google-measurement-php-client | src/Racecore/GATracking/Client/Adapter/Socket.php | Socket.send | public function send($url, Request\TrackingRequestCollection $requestCollection)
{
// get endpoint
$endpoint = parse_url($url);
$this->createConnection($endpoint);
/** @var Request\TrackingRequest $request */
while ($requestCollection->valid()) {
$request = $req... | php | public function send($url, Request\TrackingRequestCollection $requestCollection)
{
// get endpoint
$endpoint = parse_url($url);
$this->createConnection($endpoint);
/** @var Request\TrackingRequest $request */
while ($requestCollection->valid()) {
$request = $req... | [
"public",
"function",
"send",
"(",
"$",
"url",
",",
"Request",
"\\",
"TrackingRequestCollection",
"$",
"requestCollection",
")",
"{",
"// get endpoint",
"$",
"endpoint",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"this",
"->",
"createConnection",
"(",
... | Send the Request Collection to a Server
@param $url
@param Request\TrackingRequestCollection $requestCollection
@return Request\TrackingRequestCollection|void
@throws Exception\EndpointServerException | [
"Send",
"the",
"Request",
"Collection",
"to",
"a",
"Server"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Client/Adapter/Socket.php#L109-L130 |
221,903 | wallee-payment/php-sdk | lib/Model/SubscriptionAffiliate.php | SubscriptionAffiliate.setMetaData | public function setMetaData($metaData) {
if (is_array($metaData) && empty($metaData)) {
$this->metaData = new \stdClass;
} else {
$this->metaData = $metaData;
}
return $this;
} | php | public function setMetaData($metaData) {
if (is_array($metaData) && empty($metaData)) {
$this->metaData = new \stdClass;
} else {
$this->metaData = $metaData;
}
return $this;
} | [
"public",
"function",
"setMetaData",
"(",
"$",
"metaData",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"metaData",
")",
"&&",
"empty",
"(",
"$",
"metaData",
")",
")",
"{",
"$",
"this",
"->",
"metaData",
"=",
"new",
"\\",
"stdClass",
";",
"}",
"else",
... | Sets metaData.
@param map[string,string] $metaData
@return SubscriptionAffiliate | [
"Sets",
"metaData",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/SubscriptionAffiliate.php#L273-L281 |
221,904 | wallee-payment/php-sdk | lib/Model/LineItemCreate.php | LineItemCreate.setAttributes | public function setAttributes($attributes) {
if (is_array($attributes) && empty($attributes)) {
$this->attributes = new \stdClass;
} else {
$this->attributes = $attributes;
}
return $this;
} | php | public function setAttributes($attributes) {
if (is_array($attributes) && empty($attributes)) {
$this->attributes = new \stdClass;
} else {
$this->attributes = $attributes;
}
return $this;
} | [
"public",
"function",
"setAttributes",
"(",
"$",
"attributes",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"attributes",
")",
"&&",
"empty",
"(",
"$",
"attributes",
")",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"new",
"\\",
"stdClass",
";",
"}",
... | Sets attributes.
@param map[string,\Wallee\Sdk\Model\LineItemAttributeCreate] $attributes
@return LineItemCreate | [
"Sets",
"attributes",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/LineItemCreate.php#L222-L230 |
221,905 | subugoe/typo3-find | Classes/Service/SolrServiceProvider.php | SolrServiceProvider.getActiveFacets | protected function getActiveFacets($arguments)
{
$activeFacets = [];
// Add facets activated by default.
foreach ($this->settings['facets'] as $facet) {
if (!empty($facet['selectedByDefault'])) {
$this->setActiveFacetSelectionForID($activeFacets, $facet['id'], $f... | php | protected function getActiveFacets($arguments)
{
$activeFacets = [];
// Add facets activated by default.
foreach ($this->settings['facets'] as $facet) {
if (!empty($facet['selectedByDefault'])) {
$this->setActiveFacetSelectionForID($activeFacets, $facet['id'], $f... | [
"protected",
"function",
"getActiveFacets",
"(",
"$",
"arguments",
")",
"{",
"$",
"activeFacets",
"=",
"[",
"]",
";",
"// Add facets activated by default.",
"foreach",
"(",
"$",
"this",
"->",
"settings",
"[",
"'facets'",
"]",
"as",
"$",
"facet",
")",
"{",
"i... | Returns array with information about active facets.
@param array $arguments request arguments
@return array of arrays with information about active facets | [
"Returns",
"array",
"with",
"information",
"about",
"active",
"facets",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Service/SolrServiceProvider.php#L321-L340 |
221,906 | subugoe/typo3-find | Classes/Service/SolrServiceProvider.php | SolrServiceProvider.getOffset | protected function getOffset($arguments = null)
{
if (null === $arguments) {
$arguments = $this->requestArguments;
}
$offset = 0;
if (array_key_exists('start', $arguments)) {
$offset = (int) $arguments['start'];
} else {
if (array_key_exi... | php | protected function getOffset($arguments = null)
{
if (null === $arguments) {
$arguments = $this->requestArguments;
}
$offset = 0;
if (array_key_exists('start', $arguments)) {
$offset = (int) $arguments['start'];
} else {
if (array_key_exi... | [
"protected",
"function",
"getOffset",
"(",
"$",
"arguments",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"arguments",
")",
"{",
"$",
"arguments",
"=",
"$",
"this",
"->",
"requestArguments",
";",
"}",
"$",
"offset",
"=",
"0",
";",
"if",
"(",... | Returns the index of the first row to return.
@param array $arguments overrides $this->requestArguments if set
@return int | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"row",
"to",
"return",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Service/SolrServiceProvider.php#L452-L471 |
221,907 | subugoe/typo3-find | Classes/Service/SolrServiceProvider.php | SolrServiceProvider.isExtendedSearch | public function isExtendedSearch()
{
$result = false;
if (array_key_exists('extended', $this->requestArguments)) {
// Show extended search when told so by the »extended« argument.
$result = (true == $this->requestArguments['extended']);
} else {
// Show e... | php | public function isExtendedSearch()
{
$result = false;
if (array_key_exists('extended', $this->requestArguments)) {
// Show extended search when told so by the »extended« argument.
$result = (true == $this->requestArguments['extended']);
} else {
// Show e... | [
"public",
"function",
"isExtendedSearch",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"array_key_exists",
"(",
"'extended'",
",",
"$",
"this",
"->",
"requestArguments",
")",
")",
"{",
"// Show extended search when told so by the »extended« argument.",
... | Returns whether extended search should be used or not.
@return bool | [
"Returns",
"whether",
"extended",
"search",
"should",
"be",
"used",
"or",
"not",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Service/SolrServiceProvider.php#L478-L501 |
221,908 | subugoe/typo3-find | Classes/Service/SolrServiceProvider.php | SolrServiceProvider.getDefaultQuery | public function getDefaultQuery()
{
$this->createQueryForArguments($this->getRequestArguments());
$error = null;
$resultSet = null;
try {
$resultSet = $this->connection->execute($this->query);
} catch (HttpException $exception) {
$this->logger->error(... | php | public function getDefaultQuery()
{
$this->createQueryForArguments($this->getRequestArguments());
$error = null;
$resultSet = null;
try {
$resultSet = $this->connection->execute($this->query);
} catch (HttpException $exception) {
$this->logger->error(... | [
"public",
"function",
"getDefaultQuery",
"(",
")",
"{",
"$",
"this",
"->",
"createQueryForArguments",
"(",
"$",
"this",
"->",
"getRequestArguments",
"(",
")",
")",
";",
"$",
"error",
"=",
"null",
";",
"$",
"resultSet",
"=",
"null",
";",
"try",
"{",
"$",
... | Main starting point for blank index action.
@return array | [
"Main",
"starting",
"point",
"for",
"blank",
"index",
"action",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Service/SolrServiceProvider.php#L735-L758 |
221,909 | subugoe/typo3-find | Classes/Service/SolrServiceProvider.php | SolrServiceProvider.setFields | protected function setFields($arguments)
{
$fieldsConfig = SettingsUtility::getMergedSettings('dataFields', $this->settings, $this->getAction());
$fields = [];
// Use field list from query parameters or from defaults.
if (array_key_exists('data-fields', $arguments) && $arguments['da... | php | protected function setFields($arguments)
{
$fieldsConfig = SettingsUtility::getMergedSettings('dataFields', $this->settings, $this->getAction());
$fields = [];
// Use field list from query parameters or from defaults.
if (array_key_exists('data-fields', $arguments) && $arguments['da... | [
"protected",
"function",
"setFields",
"(",
"$",
"arguments",
")",
"{",
"$",
"fieldsConfig",
"=",
"SettingsUtility",
"::",
"getMergedSettings",
"(",
"'dataFields'",
",",
"$",
"this",
"->",
"settings",
",",
"$",
"this",
"->",
"getAction",
"(",
")",
")",
";",
... | Sets up the fields to be fetched by the query.
@param array $arguments request arguments | [
"Sets",
"up",
"the",
"fields",
"to",
"be",
"fetched",
"by",
"the",
"query",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Service/SolrServiceProvider.php#L809-L839 |
221,910 | subugoe/typo3-find | Classes/Service/SolrServiceProvider.php | SolrServiceProvider.createQuery | protected function createQuery()
{
$this->query = $this->connection->createSelect();
$this->addFeatures();
$this->addTypoScriptFilters();
$this->setConfigurationValue('solarium', $this->query);
} | php | protected function createQuery()
{
$this->query = $this->connection->createSelect();
$this->addFeatures();
$this->addTypoScriptFilters();
$this->setConfigurationValue('solarium', $this->query);
} | [
"protected",
"function",
"createQuery",
"(",
")",
"{",
"$",
"this",
"->",
"query",
"=",
"$",
"this",
"->",
"connection",
"->",
"createSelect",
"(",
")",
";",
"$",
"this",
"->",
"addFeatures",
"(",
")",
";",
"$",
"this",
"->",
"addTypoScriptFilters",
"(",... | Creates a blank query, sets up TypoScript filters and adds it to the view. | [
"Creates",
"a",
"blank",
"query",
"sets",
"up",
"TypoScript",
"filters",
"and",
"adds",
"it",
"to",
"the",
"view",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Service/SolrServiceProvider.php#L844-L851 |
221,911 | wallee-payment/php-sdk | lib/Http/HttpClientFactory.php | HttpClientFactory.getClientInternal | private function getClientInternal($type = null) {
if ($type != null) {
if (isset($this->clients[$type])) {
return $this->clients[$type];
} else {
throw new \Exception("No http client with type '$type' found.");
}
} else {
foreach ($this->clients as $client) {
if ($client->isSupported()) {
... | php | private function getClientInternal($type = null) {
if ($type != null) {
if (isset($this->clients[$type])) {
return $this->clients[$type];
} else {
throw new \Exception("No http client with type '$type' found.");
}
} else {
foreach ($this->clients as $client) {
if ($client->isSupported()) {
... | [
"private",
"function",
"getClientInternal",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"type",
"!=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"clients",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"this... | Returns an HTTP client instance.
@return IHttpClient | [
"Returns",
"an",
"HTTP",
"client",
"instance",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpClientFactory.php#L85-L100 |
221,912 | wallee-payment/php-sdk | lib/Model/ManualTaskAction.php | ManualTaskAction.setLabel | public function setLabel($label) {
if (is_array($label) && empty($label)) {
$this->label = new \stdClass;
} else {
$this->label = $label;
}
return $this;
} | php | public function setLabel($label) {
if (is_array($label) && empty($label)) {
$this->label = new \stdClass;
} else {
$this->label = $label;
}
return $this;
} | [
"public",
"function",
"setLabel",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"label",
")",
"&&",
"empty",
"(",
"$",
"label",
")",
")",
"{",
"$",
"this",
"->",
"label",
"=",
"new",
"\\",
"stdClass",
";",
"}",
"else",
"{",
"$",
... | Sets label.
@param map[string,string] $label
@return ManualTaskAction | [
"Sets",
"label",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/ManualTaskAction.php#L150-L158 |
221,913 | wallee-payment/php-sdk | lib/Http/HttpRequest.php | HttpRequest.getHeaders | public function getHeaders() {
$headers = array();
foreach ($this->headers as $name => $values) {
foreach ($values as $value) {
$headers[] = strtolower($name) . ': ' . $value;
}
}
$headers[] = self::HEADER_KEY_CONTENT_LENGTH . ': ' . strlen($this->getBody());
return $headers;
} | php | public function getHeaders() {
$headers = array();
foreach ($this->headers as $name => $values) {
foreach ($values as $value) {
$headers[] = strtolower($name) . ': ' . $value;
}
}
$headers[] = self::HEADER_KEY_CONTENT_LENGTH . ': ' . strlen($this->getBody());
return $headers;
} | [
"public",
"function",
"getHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"headers",
"as",
"$",
"name",
"=>",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
... | Returns a list of strings which represent the HTTP headers.
@return string[] | [
"Returns",
"a",
"list",
"of",
"strings",
"which",
"represent",
"the",
"HTTP",
"headers",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpRequest.php#L252-L261 |
221,914 | wallee-payment/php-sdk | lib/Http/HttpRequest.php | HttpRequest.addHeader | public function addHeader($key, $value) {
if (is_array($value)) {
foreach ($value as $v) {
$this->addHeader($key, $v);
}
} else {
$this->headers[$key][] = $value;
}
return $this;
} | php | public function addHeader($key, $value) {
if (is_array($value)) {
foreach ($value as $v) {
$this->addHeader($key, $v);
}
} else {
$this->headers[$key][] = $value;
}
return $this;
} | [
"public",
"function",
"addHeader",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"foreach",
"(",
"$",
"value",
"as",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"addHeader",
"(",
"$",
"key",
"... | Adds an HTTP header to the request.
@param string $key the header's key
@param string $value the header's value
@return HttpRequest | [
"Adds",
"an",
"HTTP",
"header",
"to",
"the",
"request",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpRequest.php#L283-L292 |
221,915 | wallee-payment/php-sdk | lib/Http/HttpRequest.php | HttpRequest.setUserAgent | public function setUserAgent($userAgent) {
$this->userAgent = $userAgent;
$this->removeHeader(self::HEADER_KEY_USER_AGENT);
$this->addHeader(self::HEADER_KEY_USER_AGENT, $userAgent);
return $this;
} | php | public function setUserAgent($userAgent) {
$this->userAgent = $userAgent;
$this->removeHeader(self::HEADER_KEY_USER_AGENT);
$this->addHeader(self::HEADER_KEY_USER_AGENT, $userAgent);
return $this;
} | [
"public",
"function",
"setUserAgent",
"(",
"$",
"userAgent",
")",
"{",
"$",
"this",
"->",
"userAgent",
"=",
"$",
"userAgent",
";",
"$",
"this",
"->",
"removeHeader",
"(",
"self",
"::",
"HEADER_KEY_USER_AGENT",
")",
";",
"$",
"this",
"->",
"addHeader",
"(",... | Sets the user agent header.
@param string $userAgent the user agent header value
@return HttpRequest | [
"Sets",
"the",
"user",
"agent",
"header",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpRequest.php#L322-L327 |
221,916 | wallee-payment/php-sdk | lib/Http/HttpRequest.php | HttpRequest.getBody | public function getBody() {
if ($this->body && isset($this->headers[self::HEADER_KEY_CONTENT_TYPE]) && $this->headers[self::HEADER_KEY_CONTENT_TYPE] == 'application/x-www-form-urlencoded') {
return http_build_query($this->body);
} elseif ((is_object($this->body) || is_array($this->body)) &&
(!isset($this->hea... | php | public function getBody() {
if ($this->body && isset($this->headers[self::HEADER_KEY_CONTENT_TYPE]) && $this->headers[self::HEADER_KEY_CONTENT_TYPE] == 'application/x-www-form-urlencoded') {
return http_build_query($this->body);
} elseif ((is_object($this->body) || is_array($this->body)) &&
(!isset($this->hea... | [
"public",
"function",
"getBody",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"body",
"&&",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"self",
"::",
"HEADER_KEY_CONTENT_TYPE",
"]",
")",
"&&",
"$",
"this",
"->",
"headers",
"[",
"self",
"::",
"HE... | Returns the HTTP body.
@return string | [
"Returns",
"the",
"HTTP",
"body",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpRequest.php#L352-L361 |
221,917 | wallee-payment/php-sdk | lib/Http/HttpRequest.php | HttpRequest.toString | public function toString() {
$output = $this->getStatusLine() . "\r\n";
foreach ($this->getHeaders() as $header) {
$output .= $header . "\r\n";
}
$output .= "\r\n";
$output .= $this->getBody();
return $output;
} | php | public function toString() {
$output = $this->getStatusLine() . "\r\n";
foreach ($this->getHeaders() as $header) {
$output .= $header . "\r\n";
}
$output .= "\r\n";
$output .= $this->getBody();
return $output;
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"getStatusLine",
"(",
")",
".",
"\"\\r\\n\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"as",
"$",
"header",
")",
"{",
"$",
"output",
".=",
... | Returns the message as a string.
@return string | [
"Returns",
"the",
"message",
"as",
"a",
"string",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpRequest.php#L379-L387 |
221,918 | wallee-payment/php-sdk | lib/Http/HttpRequest.php | HttpRequest.getRequestPath | private function getRequestPath($url) {
$urlParts = parse_url($url);
$path = $urlParts['path'];
if (isset($urlParts['query'])) {
$path .= '?' . $urlParts['query'];
}
if (isset($urlParts['fragment'])) {
$path .= '#' . $urlParts['fragment'];
}
return $path;
} | php | private function getRequestPath($url) {
$urlParts = parse_url($url);
$path = $urlParts['path'];
if (isset($urlParts['query'])) {
$path .= '?' . $urlParts['query'];
}
if (isset($urlParts['fragment'])) {
$path .= '#' . $urlParts['fragment'];
}
return $path;
} | [
"private",
"function",
"getRequestPath",
"(",
"$",
"url",
")",
"{",
"$",
"urlParts",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"path",
"=",
"$",
"urlParts",
"[",
"'path'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"urlParts",
"[",
"'query'",
... | Returns the request path part of the given url, including query and fragment.
@param string $url the url
@return string | [
"Returns",
"the",
"request",
"path",
"part",
"of",
"the",
"given",
"url",
"including",
"query",
"and",
"fragment",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpRequest.php#L404-L414 |
221,919 | wallee-payment/php-sdk | lib/Http/HttpResponse.php | HttpResponse.parseHttpHeaders | private function parseHttpHeaders($rawHeaders) {
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
$headers = array();
$key = '';
foreach (explode("\n", $rawHeaders) as $h) {
$h = explode(':', $h, 2);
if (isset($h[1])) {
if (!isset($headers[$h[0]])) {
$headers[$h[0]... | php | private function parseHttpHeaders($rawHeaders) {
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
$headers = array();
$key = '';
foreach (explode("\n", $rawHeaders) as $h) {
$h = explode(':', $h, 2);
if (isset($h[1])) {
if (!isset($headers[$h[0]])) {
$headers[$h[0]... | [
"private",
"function",
"parseHttpHeaders",
"(",
"$",
"rawHeaders",
")",
"{",
"// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"key",
"=",
"''",
";",
"foreach",
"(",
"explode",
"(",
"\... | Returns an array of HTTP response headers.
@param string $rawHeaders A string of raw HTTP response headers
@return string[] | [
"Returns",
"an",
"array",
"of",
"HTTP",
"response",
"headers",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpResponse.php#L105-L134 |
221,920 | wallee-payment/php-sdk | lib/Http/HttpResponse.php | HttpResponse.parseRawMessage | private function parseRawMessage($message) {
$positionStartBody = strpos($message, "\r\n\r\n");
$startPositionOffset = 4;
if ($positionStartBody === false) {
$positionStartBody = strpos($message, "\n\n");
$startPositionOffset = 2;
if ($positionStartBody === false) {
throw new \Exception("Invalid HTT... | php | private function parseRawMessage($message) {
$positionStartBody = strpos($message, "\r\n\r\n");
$startPositionOffset = 4;
if ($positionStartBody === false) {
$positionStartBody = strpos($message, "\n\n");
$startPositionOffset = 2;
if ($positionStartBody === false) {
throw new \Exception("Invalid HTT... | [
"private",
"function",
"parseRawMessage",
"(",
"$",
"message",
")",
"{",
"$",
"positionStartBody",
"=",
"strpos",
"(",
"$",
"message",
",",
"\"\\r\\n\\r\\n\"",
")",
";",
"$",
"startPositionOffset",
"=",
"4",
";",
"if",
"(",
"$",
"positionStartBody",
"===",
"... | Parses the given HTTP message.
@param string $message
@return void | [
"Parses",
"the",
"given",
"HTTP",
"message",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpResponse.php#L142-L161 |
221,921 | wallee-payment/php-sdk | lib/Http/HttpResponse.php | HttpResponse.parseStatusLine | private function parseStatusLine($line) {
if (empty($line)) {
throw new \Exception("Empty status line provided.");
}
preg_match('/HTTP\/([^[:space:]])+[[:space:]]+([0-9]*)(.*)/i', $line, $result);
$this->statusCode = (int)$result[2];
} | php | private function parseStatusLine($line) {
if (empty($line)) {
throw new \Exception("Empty status line provided.");
}
preg_match('/HTTP\/([^[:space:]])+[[:space:]]+([0-9]*)(.*)/i', $line, $result);
$this->statusCode = (int)$result[2];
} | [
"private",
"function",
"parseStatusLine",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"line",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Empty status line provided.\"",
")",
";",
"}",
"preg_match",
"(",
"'/HTTP\\/([^[:space:]])+[[:... | Parses the given status line.
@param string $line the request's status line | [
"Parses",
"the",
"given",
"status",
"line",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/HttpResponse.php#L168-L174 |
221,922 | pavlakis/slim-cli | src/CliRequest.php | CliRequest.getUri | private function getUri($path, $params)
{
$uri = '/';
if (strlen($path) > 0) {
$uri = $path;
}
if (strlen($params) > 0) {
$uri .= '?' . $params;
}
return $uri;
} | php | private function getUri($path, $params)
{
$uri = '/';
if (strlen($path) > 0) {
$uri = $path;
}
if (strlen($params) > 0) {
$uri .= '?' . $params;
}
return $uri;
} | [
"private",
"function",
"getUri",
"(",
"$",
"path",
",",
"$",
"params",
")",
"{",
"$",
"uri",
"=",
"'/'",
";",
"if",
"(",
"strlen",
"(",
"$",
"path",
")",
">",
"0",
")",
"{",
"$",
"uri",
"=",
"$",
"path",
";",
"}",
"if",
"(",
"strlen",
"(",
... | Construct the URI if path and params are being passed
@param string $path
@param string $params
@return string | [
"Construct",
"the",
"URI",
"if",
"path",
"and",
"params",
"are",
"being",
"passed"
] | adb02c0fb0ec3357377877ef8fb15f8f195c7471 | https://github.com/pavlakis/slim-cli/blob/adb02c0fb0ec3357377877ef8fb15f8f195c7471/src/CliRequest.php#L77-L89 |
221,923 | ins0/google-measurement-php-client | src/Racecore/GATracking/Tracking/Ecommerce/Transaction.php | Transaction.createPackage | public function createPackage()
{
if (!$this->getID()) {
throw new MissingTrackingParameterException('transaction id is missing');
}
return array(
't' => 'transaction',
'ti' => $this->getID(),
'ta' => $this->getAffiliation(),
'tr' ... | php | public function createPackage()
{
if (!$this->getID()) {
throw new MissingTrackingParameterException('transaction id is missing');
}
return array(
't' => 'transaction',
'ti' => $this->getID(),
'ta' => $this->getAffiliation(),
'tr' ... | [
"public",
"function",
"createPackage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getID",
"(",
")",
")",
"{",
"throw",
"new",
"MissingTrackingParameterException",
"(",
"'transaction id is missing'",
")",
";",
"}",
"return",
"array",
"(",
"'t'",
"=>",... | Returns the Google Paket for Transaction Tracking
@return array
@throws \Racecore\GATracking\Exception\MissingTrackingParameterException | [
"Returns",
"the",
"Google",
"Paket",
"for",
"Transaction",
"Tracking"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Tracking/Ecommerce/Transaction.php#L176-L191 |
221,924 | wallee-payment/php-sdk | lib/ObjectSerializer.php | ObjectSerializer.sanitizeForSerialization | public static function sanitizeForSerialization($data) {
if (is_scalar($data) || null === $data) {
return $data;
} elseif ($data instanceof \DateTime) {
return $data->format(\DateTime::ATOM);
} elseif (is_array($data)) {
foreach ($data as $property => $value) {
$data[$property] = self::sanitizeForSer... | php | public static function sanitizeForSerialization($data) {
if (is_scalar($data) || null === $data) {
return $data;
} elseif ($data instanceof \DateTime) {
return $data->format(\DateTime::ATOM);
} elseif (is_array($data)) {
foreach ($data as $property => $value) {
$data[$property] = self::sanitizeForSer... | [
"public",
"static",
"function",
"sanitizeForSerialization",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"data",
")",
"||",
"null",
"===",
"$",
"data",
")",
"{",
"return",
"$",
"data",
";",
"}",
"elseif",
"(",
"$",
"data",
"instanceof"... | Prepare data for serialization.
@param mixed $data the data to serialize
@return string|object | [
"Prepare",
"data",
"for",
"serialization",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ObjectSerializer.php#L138-L160 |
221,925 | ins0/google-measurement-php-client | src/Racecore/GATracking/Tracking/Event.php | Event.createPackage | public function createPackage()
{
if (!$this->getEventCategory()) {
throw new MissingTrackingParameterException('event category must be set');
}
if (!$this->getEventAction()) {
throw new MissingTrackingParameterException('event action must be set');
}
... | php | public function createPackage()
{
if (!$this->getEventCategory()) {
throw new MissingTrackingParameterException('event category must be set');
}
if (!$this->getEventAction()) {
throw new MissingTrackingParameterException('event action must be set');
}
... | [
"public",
"function",
"createPackage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getEventCategory",
"(",
")",
")",
"{",
"throw",
"new",
"MissingTrackingParameterException",
"(",
"'event category must be set'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"th... | Returns the Paket for Event Tracking
@return array
@throws \Racecore\GATracking\Exception\MissingTrackingParameterException | [
"Returns",
"the",
"Paket",
"for",
"Event",
"Tracking"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Tracking/Event.php#L131-L148 |
221,926 | subugoe/typo3-find | Classes/Utility/LoggerUtility.php | LoggerUtility.exceptionToArray | public static function exceptionToArray($exception, $includePrevious = false)
{
$array = [
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => $excepti... | php | public static function exceptionToArray($exception, $includePrevious = false)
{
$array = [
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => $excepti... | [
"public",
"static",
"function",
"exceptionToArray",
"(",
"$",
"exception",
",",
"$",
"includePrevious",
"=",
"false",
")",
"{",
"$",
"array",
"=",
"[",
"'message'",
"=>",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"'code'",
"=>",
"$",
"exception"... | Returns an array that can be handled by devLog with the information from an exception.
@param \Exception $exception
@return array | [
"Returns",
"an",
"array",
"that",
"can",
"be",
"handled",
"by",
"devLog",
"with",
"the",
"information",
"from",
"an",
"exception",
"."
] | d628a0b6a131d05f4842b08a556fe17cba9d7da0 | https://github.com/subugoe/typo3-find/blob/d628a0b6a131d05f4842b08a556fe17cba9d7da0/Classes/Utility/LoggerUtility.php#L42-L57 |
221,927 | wallee-payment/php-sdk | lib/Model/PaymentProcessor.php | PaymentProcessor.setCompanyName | public function setCompanyName($companyName) {
if (is_array($companyName) && empty($companyName)) {
$this->companyName = new \stdClass;
} else {
$this->companyName = $companyName;
}
return $this;
} | php | public function setCompanyName($companyName) {
if (is_array($companyName) && empty($companyName)) {
$this->companyName = new \stdClass;
} else {
$this->companyName = $companyName;
}
return $this;
} | [
"public",
"function",
"setCompanyName",
"(",
"$",
"companyName",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"companyName",
")",
"&&",
"empty",
"(",
"$",
"companyName",
")",
")",
"{",
"$",
"this",
"->",
"companyName",
"=",
"new",
"\\",
"stdClass",
";",
... | Sets companyName.
@param map[string,string] $companyName
@return PaymentProcessor | [
"Sets",
"companyName",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentProcessor.php#L168-L176 |
221,928 | wallee-payment/php-sdk | lib/Model/PaymentProcessor.php | PaymentProcessor.setHeadquartersLocation | public function setHeadquartersLocation($headquartersLocation) {
if (is_array($headquartersLocation) && empty($headquartersLocation)) {
$this->headquartersLocation = new \stdClass;
} else {
$this->headquartersLocation = $headquartersLocation;
}
return $this;
} | php | public function setHeadquartersLocation($headquartersLocation) {
if (is_array($headquartersLocation) && empty($headquartersLocation)) {
$this->headquartersLocation = new \stdClass;
} else {
$this->headquartersLocation = $headquartersLocation;
}
return $this;
} | [
"public",
"function",
"setHeadquartersLocation",
"(",
"$",
"headquartersLocation",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"headquartersLocation",
")",
"&&",
"empty",
"(",
"$",
"headquartersLocation",
")",
")",
"{",
"$",
"this",
"->",
"headquartersLocation",
... | Sets headquartersLocation.
@param map[string,string] $headquartersLocation
@return PaymentProcessor | [
"Sets",
"headquartersLocation",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentProcessor.php#L245-L253 |
221,929 | wallee-payment/php-sdk | lib/Model/PaymentProcessor.php | PaymentProcessor.setProductName | public function setProductName($productName) {
if (is_array($productName) && empty($productName)) {
$this->productName = new \stdClass;
} else {
$this->productName = $productName;
}
return $this;
} | php | public function setProductName($productName) {
if (is_array($productName) && empty($productName)) {
$this->productName = new \stdClass;
} else {
$this->productName = $productName;
}
return $this;
} | [
"public",
"function",
"setProductName",
"(",
"$",
"productName",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"productName",
")",
"&&",
"empty",
"(",
"$",
"productName",
")",
")",
"{",
"$",
"this",
"->",
"productName",
"=",
"new",
"\\",
"stdClass",
";",
... | Sets productName.
@param map[string,string] $productName
@return PaymentProcessor | [
"Sets",
"productName",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentProcessor.php#L345-L353 |
221,930 | fadion/Rule | src/Rule.php | Rule.add | public function add($input, $attribute = null)
{
$this->input = $input;
static::$rules[$input] = [];
if (isset($attribute)) {
static::$attributes[$input] = $attribute;
}
return $this;
} | php | public function add($input, $attribute = null)
{
$this->input = $input;
static::$rules[$input] = [];
if (isset($attribute)) {
static::$attributes[$input] = $attribute;
}
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"input",
",",
"$",
"attribute",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"$",
"input",
";",
"static",
"::",
"$",
"rules",
"[",
"$",
"input",
"]",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",... | Starts the rule builder with an
input target
@param string $input
@param string|null $attribute
@return Rule | [
"Starts",
"the",
"rule",
"builder",
"with",
"an",
"input",
"target"
] | 643c22340032ee5c627b6f289de7f87ec26c98e1 | https://github.com/fadion/Rule/blob/643c22340032ee5c627b6f289de7f87ec26c98e1/src/Rule.php#L40-L50 |
221,931 | fadion/Rule | src/Rule.php | Rule.message | public function message($message)
{
if (isset($this->currentRule)) {
static::$messages[$this->input.'.'.$this->currentRule] = $message;
}
return $this;
} | php | public function message($message)
{
if (isset($this->currentRule)) {
static::$messages[$this->input.'.'.$this->currentRule] = $message;
}
return $this;
} | [
"public",
"function",
"message",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"currentRule",
")",
")",
"{",
"static",
"::",
"$",
"messages",
"[",
"$",
"this",
"->",
"input",
".",
"'.'",
".",
"$",
"this",
"->",
"current... | Adds a message for the current rule
@return Rule | [
"Adds",
"a",
"message",
"for",
"the",
"current",
"rule"
] | 643c22340032ee5c627b6f289de7f87ec26c98e1 | https://github.com/fadion/Rule/blob/643c22340032ee5c627b6f289de7f87ec26c98e1/src/Rule.php#L96-L103 |
221,932 | fadion/Rule | src/Rule.php | Rule.exists | public function exists($table, $column = null)
{
$rule = $table;
// Take any argument after the 2 defined ones
$args = array_slice(func_get_args(), 2);
if (isset($column)) {
$rule .= ",$column";
}
if ($args) {
// Add optional arguments
... | php | public function exists($table, $column = null)
{
$rule = $table;
// Take any argument after the 2 defined ones
$args = array_slice(func_get_args(), 2);
if (isset($column)) {
$rule .= ",$column";
}
if ($args) {
// Add optional arguments
... | [
"public",
"function",
"exists",
"(",
"$",
"table",
",",
"$",
"column",
"=",
"null",
")",
"{",
"$",
"rule",
"=",
"$",
"table",
";",
"// Take any argument after the 2 defined ones",
"$",
"args",
"=",
"array_slice",
"(",
"func_get_args",
"(",
")",
",",
"2",
"... | The field under validation must exist on
a given database table
@param string $table
@param string $column
@return Rule | [
"The",
"field",
"under",
"validation",
"must",
"exist",
"on",
"a",
"given",
"database",
"table"
] | 643c22340032ee5c627b6f289de7f87ec26c98e1 | https://github.com/fadion/Rule/blob/643c22340032ee5c627b6f289de7f87ec26c98e1/src/Rule.php#L419-L439 |
221,933 | fadion/Rule | src/Rule.php | Rule.unique | public function unique($table, $column = null, $id = false)
{
$rule = $table;
// Take any argument after the 3 defined ones
$args = array_slice(func_get_args(), 3);
if (isset($column)) {
$rule .= ",$column";
}
// A NULL value is a valid one for the vali... | php | public function unique($table, $column = null, $id = false)
{
$rule = $table;
// Take any argument after the 3 defined ones
$args = array_slice(func_get_args(), 3);
if (isset($column)) {
$rule .= ",$column";
}
// A NULL value is a valid one for the vali... | [
"public",
"function",
"unique",
"(",
"$",
"table",
",",
"$",
"column",
"=",
"null",
",",
"$",
"id",
"=",
"false",
")",
"{",
"$",
"rule",
"=",
"$",
"table",
";",
"// Take any argument after the 3 defined ones",
"$",
"args",
"=",
"array_slice",
"(",
"func_ge... | The field under validation must be unique on a
given database table. If the column option is
not specified, the field name will be used
@param string $table
@param string $column
@param mixed $id
@return Rule | [
"The",
"field",
"under",
"validation",
"must",
"be",
"unique",
"on",
"a",
"given",
"database",
"table",
".",
"If",
"the",
"column",
"option",
"is",
"not",
"specified",
"the",
"field",
"name",
"will",
"be",
"used"
] | 643c22340032ee5c627b6f289de7f87ec26c98e1 | https://github.com/fadion/Rule/blob/643c22340032ee5c627b6f289de7f87ec26c98e1/src/Rule.php#L826-L857 |
221,934 | buzzylab/laradown | src/Laradown.php | Laradown.getContainer | public function getContainer($service = null)
{
return is_null($service) ? ($this->container ?: app()) : ($this->container[$service] ?: app($service));
} | php | public function getContainer($service = null)
{
return is_null($service) ? ($this->container ?: app()) : ($this->container[$service] ?: app($service));
} | [
"public",
"function",
"getContainer",
"(",
"$",
"service",
"=",
"null",
")",
"{",
"return",
"is_null",
"(",
"$",
"service",
")",
"?",
"(",
"$",
"this",
"->",
"container",
"?",
":",
"app",
"(",
")",
")",
":",
"(",
"$",
"this",
"->",
"container",
"["... | Get the IoC container instance or any of it's services.
@param string|null $service
@return object | [
"Get",
"the",
"IoC",
"container",
"instance",
"or",
"any",
"of",
"it",
"s",
"services",
"."
] | b726aea44eded0f7da6bf0220dcf1c92697f2412 | https://github.com/buzzylab/laradown/blob/b726aea44eded0f7da6bf0220dcf1c92697f2412/src/Laradown.php#L63-L66 |
221,935 | buzzylab/laradown | src/Laradown.php | Laradown.element | protected function element(array $Element)
{
$markup = '';
if (str_is('h[1-6]', $Element['name'])) {
$link = str_replace(' ', '-', strtolower($Element['text']));
$markup = '<a class="header-link" href="#'.$link.'" id="'.$link.'"><i class="glyphicon glyphicon-link"></i></a>'... | php | protected function element(array $Element)
{
$markup = '';
if (str_is('h[1-6]', $Element['name'])) {
$link = str_replace(' ', '-', strtolower($Element['text']));
$markup = '<a class="header-link" href="#'.$link.'" id="'.$link.'"><i class="glyphicon glyphicon-link"></i></a>'... | [
"protected",
"function",
"element",
"(",
"array",
"$",
"Element",
")",
"{",
"$",
"markup",
"=",
"''",
";",
"if",
"(",
"str_is",
"(",
"'h[1-6]'",
",",
"$",
"Element",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"link",
"=",
"str_replace",
"(",
"' '",
",... | Handlers for all elements.
@param array $Element
@return string | [
"Handlers",
"for",
"all",
"elements",
"."
] | b726aea44eded0f7da6bf0220dcf1c92697f2412 | https://github.com/buzzylab/laradown/blob/b726aea44eded0f7da6bf0220dcf1c92697f2412/src/Laradown.php#L75-L87 |
221,936 | buzzylab/laradown | src/Laradown.php | Laradown.convert | public function convert($markdown)
{
// Fire converting event
$this->getContainer('events')->dispatch('laradown.entity.converting');
$text = $this->text($markdown);
// Fire converted event
$this->getContainer('events')->dispatch('laradown.entity.converted');
return... | php | public function convert($markdown)
{
// Fire converting event
$this->getContainer('events')->dispatch('laradown.entity.converting');
$text = $this->text($markdown);
// Fire converted event
$this->getContainer('events')->dispatch('laradown.entity.converted');
return... | [
"public",
"function",
"convert",
"(",
"$",
"markdown",
")",
"{",
"// Fire converting event",
"$",
"this",
"->",
"getContainer",
"(",
"'events'",
")",
"->",
"dispatch",
"(",
"'laradown.entity.converting'",
")",
";",
"$",
"text",
"=",
"$",
"this",
"->",
"text",
... | Convert markdown to html.
@param $markdown
@return mixed|string | [
"Convert",
"markdown",
"to",
"html",
"."
] | b726aea44eded0f7da6bf0220dcf1c92697f2412 | https://github.com/buzzylab/laradown/blob/b726aea44eded0f7da6bf0220dcf1c92697f2412/src/Laradown.php#L96-L107 |
221,937 | buzzylab/laradown | src/Laradown.php | Laradown.loadStyle | public function loadStyle($file = null)
{
// init required vars
$content = '';
// Get style file or get default
if (is_null($file)) {
$file = __DIR__.'/../public/github.css';
}
// check if style file exists
if ($this->filesystem->exists($file)) {... | php | public function loadStyle($file = null)
{
// init required vars
$content = '';
// Get style file or get default
if (is_null($file)) {
$file = __DIR__.'/../public/github.css';
}
// check if style file exists
if ($this->filesystem->exists($file)) {... | [
"public",
"function",
"loadStyle",
"(",
"$",
"file",
"=",
"null",
")",
"{",
"// init required vars",
"$",
"content",
"=",
"''",
";",
"// Get style file or get default",
"if",
"(",
"is_null",
"(",
"$",
"file",
")",
")",
"{",
"$",
"file",
"=",
"__DIR__",
"."... | Get style.
@param null $file
@return string | [
"Get",
"style",
"."
] | b726aea44eded0f7da6bf0220dcf1c92697f2412 | https://github.com/buzzylab/laradown/blob/b726aea44eded0f7da6bf0220dcf1c92697f2412/src/Laradown.php#L173-L190 |
221,938 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.setConnectionTimeout | public function setConnectionTimeout($connectionTimeout) {
if (!is_numeric($connectionTimeout) || $connectionTimeout < 0) {
throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.');
}
$this->connectionTimeout = $connectionTimeout;
return $this;
} | php | public function setConnectionTimeout($connectionTimeout) {
if (!is_numeric($connectionTimeout) || $connectionTimeout < 0) {
throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.');
}
$this->connectionTimeout = $connectionTimeout;
return $this;
} | [
"public",
"function",
"setConnectionTimeout",
"(",
"$",
"connectionTimeout",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"connectionTimeout",
")",
"||",
"$",
"connectionTimeout",
"<",
"0",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | Sets the connection timeout in seconds.
@param int $connectionTimeout the connection timeout in seconds
@return ApiClient | [
"Sets",
"the",
"connection",
"timeout",
"in",
"seconds",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L236-L243 |
221,939 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.addDefaultHeader | public function addDefaultHeader($key, $value) {
if (!is_string($key)) {
throw new \InvalidArgumentException('The header key must be a string.');
}
$defaultHeaders[$key] = $value;
return $this;
} | php | public function addDefaultHeader($key, $value) {
if (!is_string($key)) {
throw new \InvalidArgumentException('The header key must be a string.');
}
$defaultHeaders[$key] = $value;
return $this;
} | [
"public",
"function",
"addDefaultHeader",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The header key must be a string.'",
")",
";",
"}",
... | Adds a default header.
@param string $key the header's key
@param string $value the header's value
@return ApiClient | [
"Adds",
"a",
"default",
"header",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L299-L306 |
221,940 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.setDebugFile | public function setDebugFile($debugFile) {
$this->debugFile = $debugFile;
$this->serializer->setDebugFile($debugFile);
return $this;
} | php | public function setDebugFile($debugFile) {
$this->debugFile = $debugFile;
$this->serializer->setDebugFile($debugFile);
return $this;
} | [
"public",
"function",
"setDebugFile",
"(",
"$",
"debugFile",
")",
"{",
"$",
"this",
"->",
"debugFile",
"=",
"$",
"debugFile",
";",
"$",
"this",
"->",
"serializer",
"->",
"setDebugFile",
"(",
"$",
"debugFile",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the path to the debug file.
@param string $debugFile the debug file
@return ApiClient | [
"Sets",
"the",
"path",
"to",
"the",
"debug",
"file",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L354-L358 |
221,941 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.selectHeaderContentType | public function selectHeaderContentType($contentType) {
if (count($contentType) === 0 or (count($contentType) === 1 and $contentType[0] === '')) {
return 'application/json';
} elseif (preg_grep("/application\/json/i", $contentType)) {
return 'application/json';
} else {
return implode(',', $contentType);... | php | public function selectHeaderContentType($contentType) {
if (count($contentType) === 0 or (count($contentType) === 1 and $contentType[0] === '')) {
return 'application/json';
} elseif (preg_grep("/application\/json/i", $contentType)) {
return 'application/json';
} else {
return implode(',', $contentType);... | [
"public",
"function",
"selectHeaderContentType",
"(",
"$",
"contentType",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"contentType",
")",
"===",
"0",
"or",
"(",
"count",
"(",
"$",
"contentType",
")",
"===",
"1",
"and",
"$",
"contentType",
"[",
"0",
"]",
"=... | Returns the 'Content Type' based on an array of content types.
@param string[] $contentType the array of content types
@return string | [
"Returns",
"the",
"Content",
"Type",
"based",
"on",
"an",
"array",
"of",
"content",
"types",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L412-L420 |
221,942 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.buildRequestUrl | private function buildRequestUrl($path, $queryParams) {
$url = $this->getBasePath() . $path;
if (!empty($queryParams)) {
$url = ($url . '?' . http_build_query($queryParams));
}
return $url;
} | php | private function buildRequestUrl($path, $queryParams) {
$url = $this->getBasePath() . $path;
if (!empty($queryParams)) {
$url = ($url . '?' . http_build_query($queryParams));
}
return $url;
} | [
"private",
"function",
"buildRequestUrl",
"(",
"$",
"path",
",",
"$",
"queryParams",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getBasePath",
"(",
")",
".",
"$",
"path",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"queryParams",
")",
")",
"{",
"$",... | Returns the request url.
@param string $path the request path
@param array $queryParams an array of query parameters
@return string | [
"Returns",
"the",
"request",
"url",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L486-L492 |
221,943 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.getAuthenticationHeaders | private function getAuthenticationHeaders(HttpRequest $request) {
$timestamp = time();
$version = '1';
$path = $request->getPath();
$securedData = $version . '|' . $this->userId . '|' . $timestamp . '|' . $request->getMethod() . '|' . $path;
$headers = array();
$headers['x-mac-version'] = $version;
$head... | php | private function getAuthenticationHeaders(HttpRequest $request) {
$timestamp = time();
$version = '1';
$path = $request->getPath();
$securedData = $version . '|' . $this->userId . '|' . $timestamp . '|' . $request->getMethod() . '|' . $path;
$headers = array();
$headers['x-mac-version'] = $version;
$head... | [
"private",
"function",
"getAuthenticationHeaders",
"(",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"timestamp",
"=",
"time",
"(",
")",
";",
"$",
"version",
"=",
"'1'",
";",
"$",
"path",
"=",
"$",
"request",
"->",
"getPath",
"(",
")",
";",
"$",
"secu... | Returns the headers used for authentication.
@param HttpRequest $request
@return array | [
"Returns",
"the",
"headers",
"used",
"for",
"authentication",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L500-L512 |
221,944 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.calculateHmac | private function calculateHmac($securedData) {
$decodedSecret = base64_decode($this->applicationKey);
return base64_encode(hash_hmac("sha512", $securedData, $decodedSecret, true));
} | php | private function calculateHmac($securedData) {
$decodedSecret = base64_decode($this->applicationKey);
return base64_encode(hash_hmac("sha512", $securedData, $decodedSecret, true));
} | [
"private",
"function",
"calculateHmac",
"(",
"$",
"securedData",
")",
"{",
"$",
"decodedSecret",
"=",
"base64_decode",
"(",
"$",
"this",
"->",
"applicationKey",
")",
";",
"return",
"base64_encode",
"(",
"hash_hmac",
"(",
"\"sha512\"",
",",
"$",
"securedData",
... | Calculates the hmac of the given data.
@param string $securedData the data to calculate the hmac for
@return string | [
"Calculates",
"the",
"hmac",
"of",
"the",
"given",
"data",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L520-L523 |
221,945 | wallee-payment/php-sdk | lib/ApiClient.php | ApiClient.generateUniqueToken | private function generateUniqueToken() {
$s = strtoupper(md5(uniqid(rand(),true)));
return substr($s,0,8) . '-' .
substr($s,8,4) . '-' .
substr($s,12,4). '-' .
substr($s,16,4). '-' .
substr($s,20);
} | php | private function generateUniqueToken() {
$s = strtoupper(md5(uniqid(rand(),true)));
return substr($s,0,8) . '-' .
substr($s,8,4) . '-' .
substr($s,12,4). '-' .
substr($s,16,4). '-' .
substr($s,20);
} | [
"private",
"function",
"generateUniqueToken",
"(",
")",
"{",
"$",
"s",
"=",
"strtoupper",
"(",
"md5",
"(",
"uniqid",
"(",
"rand",
"(",
")",
",",
"true",
")",
")",
")",
";",
"return",
"substr",
"(",
"$",
"s",
",",
"0",
",",
"8",
")",
".",
"'-'",
... | Generates a unique token to assign to the request.
@return string | [
"Generates",
"a",
"unique",
"token",
"to",
"assign",
"to",
"the",
"request",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/ApiClient.php#L530-L537 |
221,946 | wallee-payment/php-sdk | lib/Model/PaymentConnector.php | PaymentConnector.setDeprecationReason | public function setDeprecationReason($deprecationReason) {
if (is_array($deprecationReason) && empty($deprecationReason)) {
$this->deprecationReason = new \stdClass;
} else {
$this->deprecationReason = $deprecationReason;
}
return $this;
} | php | public function setDeprecationReason($deprecationReason) {
if (is_array($deprecationReason) && empty($deprecationReason)) {
$this->deprecationReason = new \stdClass;
} else {
$this->deprecationReason = $deprecationReason;
}
return $this;
} | [
"public",
"function",
"setDeprecationReason",
"(",
"$",
"deprecationReason",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"deprecationReason",
")",
"&&",
"empty",
"(",
"$",
"deprecationReason",
")",
")",
"{",
"$",
"this",
"->",
"deprecationReason",
"=",
"new",
... | Sets deprecationReason.
@param map[string,string] $deprecationReason
@return PaymentConnector | [
"Sets",
"deprecationReason",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentConnector.php#L266-L274 |
221,947 | wallee-payment/php-sdk | lib/Model/PaymentMethod.php | PaymentMethod.setMerchantDescription | public function setMerchantDescription($merchantDescription) {
if (is_array($merchantDescription) && empty($merchantDescription)) {
$this->merchantDescription = new \stdClass;
} else {
$this->merchantDescription = $merchantDescription;
}
return $this;
} | php | public function setMerchantDescription($merchantDescription) {
if (is_array($merchantDescription) && empty($merchantDescription)) {
$this->merchantDescription = new \stdClass;
} else {
$this->merchantDescription = $merchantDescription;
}
return $this;
} | [
"public",
"function",
"setMerchantDescription",
"(",
"$",
"merchantDescription",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"merchantDescription",
")",
"&&",
"empty",
"(",
"$",
"merchantDescription",
")",
")",
"{",
"$",
"this",
"->",
"merchantDescription",
"=",
... | Sets merchantDescription.
@param map[string,string] $merchantDescription
@return PaymentMethod | [
"Sets",
"merchantDescription",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentMethod.php#L256-L264 |
221,948 | wallee-payment/php-sdk | lib/Model/MetricUsage.php | MetricUsage.setMetricDescription | public function setMetricDescription($metricDescription) {
if (is_array($metricDescription) && empty($metricDescription)) {
$this->metricDescription = new \stdClass;
} else {
$this->metricDescription = $metricDescription;
}
return $this;
} | php | public function setMetricDescription($metricDescription) {
if (is_array($metricDescription) && empty($metricDescription)) {
$this->metricDescription = new \stdClass;
} else {
$this->metricDescription = $metricDescription;
}
return $this;
} | [
"public",
"function",
"setMetricDescription",
"(",
"$",
"metricDescription",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"metricDescription",
")",
"&&",
"empty",
"(",
"$",
"metricDescription",
")",
")",
"{",
"$",
"this",
"->",
"metricDescription",
"=",
"new",
... | Sets metricDescription.
@param map[string,string] $metricDescription
@return MetricUsage | [
"Sets",
"metricDescription",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/MetricUsage.php#L150-L158 |
221,949 | wallee-payment/php-sdk | lib/Model/MetricUsage.php | MetricUsage.setMetricName | public function setMetricName($metricName) {
if (is_array($metricName) && empty($metricName)) {
$this->metricName = new \stdClass;
} else {
$this->metricName = $metricName;
}
return $this;
} | php | public function setMetricName($metricName) {
if (is_array($metricName) && empty($metricName)) {
$this->metricName = new \stdClass;
} else {
$this->metricName = $metricName;
}
return $this;
} | [
"public",
"function",
"setMetricName",
"(",
"$",
"metricName",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"metricName",
")",
"&&",
"empty",
"(",
"$",
"metricName",
")",
")",
"{",
"$",
"this",
"->",
"metricName",
"=",
"new",
"\\",
"stdClass",
";",
"}",
... | Sets metricName.
@param map[string,string] $metricName
@return MetricUsage | [
"Sets",
"metricName",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/MetricUsage.php#L200-L208 |
221,950 | ins0/google-measurement-php-client | src/Racecore/GATracking/Autoloader.php | Autoloader.autoload | public function autoload($class)
{
$filePath = $this->folder . '/' . str_replace('\\', '/', $class) . '.php';
if (file_exists($filePath)) {
return ( (require_once $filePath) === false ? true : false );
}
return false;
} | php | public function autoload($class)
{
$filePath = $this->folder . '/' . str_replace('\\', '/', $class) . '.php';
if (file_exists($filePath)) {
return ( (require_once $filePath) === false ? true : false );
}
return false;
} | [
"public",
"function",
"autoload",
"(",
"$",
"class",
")",
"{",
"$",
"filePath",
"=",
"$",
"this",
"->",
"folder",
".",
"'/'",
".",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"class",
")",
".",
"'.php'",
";",
"if",
"(",
"file_exists",
"(",
... | Handel autoloading of classes
@param $class
@return bool|mixed | [
"Handel",
"autoloading",
"of",
"classes"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/Autoloader.php#L45-L54 |
221,951 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.readFromSocket | private function readFromSocket(ApiClient $apiClient, HttpRequest $request, $socket) {
$inBody = false;
$responseMessage = '';
$chunked = false;
$chunkLength = false;
$maxTime = $this->getStartTime() + $apiClient->getConnectionTimeout();
$contentLength = -1;
$endReached = false;
while ($maxTime > time()... | php | private function readFromSocket(ApiClient $apiClient, HttpRequest $request, $socket) {
$inBody = false;
$responseMessage = '';
$chunked = false;
$chunkLength = false;
$maxTime = $this->getStartTime() + $apiClient->getConnectionTimeout();
$contentLength = -1;
$endReached = false;
while ($maxTime > time()... | [
"private",
"function",
"readFromSocket",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
",",
"$",
"socket",
")",
"{",
"$",
"inBody",
"=",
"false",
";",
"$",
"responseMessage",
"=",
"''",
";",
"$",
"chunked",
"=",
"false",
";",
"$... | This method reads from the given socket. Depending on the given header the read process may be halted after
reading the last chunk. This method is required, because some servers do not close the connection in chunked
transfer. Hence the timeout of the connection must be reached, before the connection is closed. By trac... | [
"This",
"method",
"reads",
"from",
"the",
"given",
"socket",
".",
"Depending",
"on",
"the",
"given",
"header",
"the",
"read",
"process",
"may",
"be",
"halted",
"after",
"reading",
"the",
"last",
"chunk",
".",
"This",
"method",
"is",
"required",
"because",
... | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L79-L150 |
221,952 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.readContentFromSocket | private function readContentFromSocket(ApiClient $apiClient, HttpRequest $request, $socket, $maxNumberOfBytes) {
stream_set_blocking($socket, false);
$maxTime = $this->getStartTime() + $apiClient->getConnectionTimeout();
$numberOfBytesRead = 0;
$result = '';
while ($maxTime >= time() && $numberOfBytesRead < $... | php | private function readContentFromSocket(ApiClient $apiClient, HttpRequest $request, $socket, $maxNumberOfBytes) {
stream_set_blocking($socket, false);
$maxTime = $this->getStartTime() + $apiClient->getConnectionTimeout();
$numberOfBytesRead = 0;
$result = '';
while ($maxTime >= time() && $numberOfBytesRead < $... | [
"private",
"function",
"readContentFromSocket",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
",",
"$",
"socket",
",",
"$",
"maxNumberOfBytes",
")",
"{",
"stream_set_blocking",
"(",
"$",
"socket",
",",
"false",
")",
";",
"$",
"maxTime... | This method reads in blocking fashion from the socket.
We need this method because neither fread nor stream_get_contents do respect timeouts.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@param resource $socket the socket from which should be read
@param int $maxNum... | [
"This",
"method",
"reads",
"in",
"blocking",
"fashion",
"from",
"the",
"socket",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L164-L188 |
221,953 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.readLineFromSocket | private function readLineFromSocket(ApiClient $apiClient, HttpRequest $request, $socket, $maxNumberOfBytes) {
stream_set_blocking($socket, false);
$maxTime = $this->getStartTime() + $apiClient->getConnectionTimeout();
$result = false;
while ($maxTime >= time() && $result === false && !feof($socket)) {
$tmp =... | php | private function readLineFromSocket(ApiClient $apiClient, HttpRequest $request, $socket, $maxNumberOfBytes) {
stream_set_blocking($socket, false);
$maxTime = $this->getStartTime() + $apiClient->getConnectionTimeout();
$result = false;
while ($maxTime >= time() && $result === false && !feof($socket)) {
$tmp =... | [
"private",
"function",
"readLineFromSocket",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
",",
"$",
"socket",
",",
"$",
"maxNumberOfBytes",
")",
"{",
"stream_set_blocking",
"(",
"$",
"socket",
",",
"false",
")",
";",
"$",
"maxTime",
... | This method reads a single line in blocking fashion from the socket. The method does respect the timeout
configured.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@param resource $socket the socket from which should be read
@param int $maxNumberOfBytes the number of b... | [
"This",
"method",
"reads",
"a",
"single",
"line",
"in",
"blocking",
"fashion",
"from",
"the",
"socket",
".",
"The",
"method",
"does",
"respect",
"the",
"timeout",
"configured",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L201-L222 |
221,954 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.startStreamSocket | private function startStreamSocket(ApiClient $apiClient, HttpRequest $request) {
$this->configureRequest($request);
$socket = $this->createSocketStream($apiClient, $request);
$message = $request->toString();
if ($apiClient->isDebuggingEnabled()) {
error_log("[DEBUG] HTTP Request ~BEGIN~".PHP_EOL.$message.... | php | private function startStreamSocket(ApiClient $apiClient, HttpRequest $request) {
$this->configureRequest($request);
$socket = $this->createSocketStream($apiClient, $request);
$message = $request->toString();
if ($apiClient->isDebuggingEnabled()) {
error_log("[DEBUG] HTTP Request ~BEGIN~".PHP_EOL.$message.... | [
"private",
"function",
"startStreamSocket",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"configureRequest",
"(",
"$",
"request",
")",
";",
"$",
"socket",
"=",
"$",
"this",
"->",
"createSocketStream",
"... | Creates a socket and sends the request to the remote host.
As result a stream socket is returned. Which can be used to read the response.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@throws ConnectionException
@return resource | [
"Creates",
"a",
"socket",
"and",
"sends",
"the",
"request",
"to",
"the",
"remote",
"host",
".",
"As",
"result",
"a",
"stream",
"socket",
"is",
"returned",
".",
"Which",
"can",
"be",
"used",
"to",
"read",
"the",
"response",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L233-L248 |
221,955 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.configureRequest | private function configureRequest(HttpRequest $request){
$proxyUrl = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_PROXY_URL);
if ($proxyUrl !== null) {
$proxyUser = parse_url($proxyUrl, PHP_URL_USER);
$proxyPass = parse_url($proxyUrl, PHP_URL_PASS);
if ($proxyUser !== NULL) {
$auth = $prox... | php | private function configureRequest(HttpRequest $request){
$proxyUrl = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_PROXY_URL);
if ($proxyUrl !== null) {
$proxyUser = parse_url($proxyUrl, PHP_URL_USER);
$proxyPass = parse_url($proxyUrl, PHP_URL_PASS);
if ($proxyUser !== NULL) {
$auth = $prox... | [
"private",
"function",
"configureRequest",
"(",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"proxyUrl",
"=",
"$",
"this",
"->",
"readEnvironmentVariable",
"(",
"self",
"::",
"ENVIRONMENT_VARIABLE_PROXY_URL",
")",
";",
"if",
"(",
"$",
"proxyUrl",
"!==",
"null",... | This method modifies the request so it can be sent.
Sub classes may
override this method to apply further modifications.
@param HttpRequest $request the HTTP request | [
"This",
"method",
"modifies",
"the",
"request",
"so",
"it",
"can",
"be",
"sent",
".",
"Sub",
"classes",
"may",
"override",
"this",
"method",
"to",
"apply",
"further",
"modifications",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L257-L271 |
221,956 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.createSocketStream | private function createSocketStream(ApiClient $apiClient, HttpRequest $request) {
if ($request->isSecureConnection()) {
if (!extension_loaded('openssl')) {
throw new \Exception("You have to enable OpenSSL.");
}
}
$proxyUrl = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_PROXY_URL);
if ($p... | php | private function createSocketStream(ApiClient $apiClient, HttpRequest $request) {
if ($request->isSecureConnection()) {
if (!extension_loaded('openssl')) {
throw new \Exception("You have to enable OpenSSL.");
}
}
$proxyUrl = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_PROXY_URL);
if ($p... | [
"private",
"function",
"createSocketStream",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"->",
"isSecureConnection",
"(",
")",
")",
"{",
"if",
"(",
"!",
"extension_loaded",
"(",
"'openssl'",
")... | This method creates a stream socket to the server.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@throws ConnectionException
@return resource | [
"This",
"method",
"creates",
"a",
"stream",
"socket",
"to",
"the",
"server",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L281-L318 |
221,957 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.getSslProtocol | private function getSslProtocol(){
$version = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_SSL_VERSION);
$rs = null;
switch ($version) {
case self::SSL_VERSION_SSLV2:
$rs = 'sslv2';
break;
case self::SSL_VERSION_SSLV3:
$rs = 'sslv3';
break;
case self::SSL_VERSION_TLSV1:
$... | php | private function getSslProtocol(){
$version = $this->readEnvironmentVariable(self::ENVIRONMENT_VARIABLE_SSL_VERSION);
$rs = null;
switch ($version) {
case self::SSL_VERSION_SSLV2:
$rs = 'sslv2';
break;
case self::SSL_VERSION_SSLV3:
$rs = 'sslv3';
break;
case self::SSL_VERSION_TLSV1:
$... | [
"private",
"function",
"getSslProtocol",
"(",
")",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"readEnvironmentVariable",
"(",
"self",
"::",
"ENVIRONMENT_VARIABLE_SSL_VERSION",
")",
";",
"$",
"rs",
"=",
"null",
";",
"switch",
"(",
"$",
"version",
")",
"{",
... | Returns the protocol to use in case of an SSL connection.
@return string | [
"Returns",
"the",
"protocol",
"to",
"use",
"in",
"case",
"of",
"an",
"SSL",
"connection",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L325-L357 |
221,958 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.createStreamContext | private function createStreamContext(ApiClient $apiClient, HttpRequest $request) {
return stream_context_create($this->buildStreamContextOptions($apiClient, $request));
} | php | private function createStreamContext(ApiClient $apiClient, HttpRequest $request) {
return stream_context_create($this->buildStreamContextOptions($apiClient, $request));
} | [
"private",
"function",
"createStreamContext",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
")",
"{",
"return",
"stream_context_create",
"(",
"$",
"this",
"->",
"buildStreamContextOptions",
"(",
"$",
"apiClient",
",",
"$",
"request",
")",... | Creates and returns a new stream context.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@return resource | [
"Creates",
"and",
"returns",
"a",
"new",
"stream",
"context",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L366-L368 |
221,959 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.buildStreamContextOptions | private function buildStreamContextOptions(ApiClient $apiClient, HttpRequest $request) {
$options = array(
'http' => array(),
'ssl' => array()
);
if ($request->isSecureConnection()) {
$options['ssl']['verify_host'] = true;
$options['ssl']['allow_self_signed'] = false;
$options['ssl']['verify_peer']... | php | private function buildStreamContextOptions(ApiClient $apiClient, HttpRequest $request) {
$options = array(
'http' => array(),
'ssl' => array()
);
if ($request->isSecureConnection()) {
$options['ssl']['verify_host'] = true;
$options['ssl']['allow_self_signed'] = false;
$options['ssl']['verify_peer']... | [
"private",
"function",
"buildStreamContextOptions",
"(",
"ApiClient",
"$",
"apiClient",
",",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'http'",
"=>",
"array",
"(",
")",
",",
"'ssl'",
"=>",
"array",
"(",
")",
")",
";",
"... | Generates an option array for creating the stream context.
@param ApiClient $apiClient the API client instance
@param HttpRequest $request the HTTP request
@return array | [
"Generates",
"an",
"option",
"array",
"for",
"creating",
"the",
"stream",
"context",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L377-L405 |
221,960 | wallee-payment/php-sdk | lib/Http/SocketHttpClient.php | SocketHttpClient.readEnvironmentVariable | private function readEnvironmentVariable($name){
if (isset($_SERVER[$name])) {
return $_SERVER[$name];
} else if (isset($_SERVER[strtolower($name)])) {
return $_SERVER[strtolower($name)];
} else {
return null;
}
} | php | private function readEnvironmentVariable($name){
if (isset($_SERVER[$name])) {
return $_SERVER[$name];
} else if (isset($_SERVER[strtolower($name)])) {
return $_SERVER[strtolower($name)];
} else {
return null;
}
} | [
"private",
"function",
"readEnvironmentVariable",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"_SERVER",
"[",
"$",
"name",
"]",
";",
"}",
"else",
"if",
"(",
"isset",
"(",... | Reads the environment variable indicated by the name.
Returns null
when the variable is not defined.
@param string $name
@return string | [
"Reads",
"the",
"environment",
"variable",
"indicated",
"by",
"the",
"name",
".",
"Returns",
"null",
"when",
"the",
"variable",
"is",
"not",
"defined",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Http/SocketHttpClient.php#L431-L439 |
221,961 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.setOption | public function setOption($key, $value)
{
if (isset($this->options[$key]) && is_array($this->options[$key]) && is_array($value)) {
$oldValues = $this->options[$key];
$value = array_merge($oldValues, $value);
}
$this->options[$key] = $value;
} | php | public function setOption($key, $value)
{
if (isset($this->options[$key]) && is_array($this->options[$key]) && is_array($value)) {
$oldValues = $this->options[$key];
$value = array_merge($oldValues, $value);
}
$this->options[$key] = $value;
} | [
"public",
"function",
"setOption",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"key",
"]",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"key",
"]",
")",
"... | Set single Option
@param $key
@param $value | [
"Set",
"single",
"Option"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L156-L164 |
221,962 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.getClientId | public function getClientId()
{
$clientId = $this->getOption('client_id');
if ($clientId) {
return $clientId;
}
// collect user specific data
if (isset($_COOKIE['_ga'])) {
$gaCookie = explode('.', $_COOKIE['_ga']);
if (isset($gaCookie[2]))... | php | public function getClientId()
{
$clientId = $this->getOption('client_id');
if ($clientId) {
return $clientId;
}
// collect user specific data
if (isset($_COOKIE['_ga'])) {
$gaCookie = explode('.', $_COOKIE['_ga']);
if (isset($gaCookie[2]))... | [
"public",
"function",
"getClientId",
"(",
")",
"{",
"$",
"clientId",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'client_id'",
")",
";",
"if",
"(",
"$",
"clientId",
")",
"{",
"return",
"$",
"clientId",
";",
"}",
"// collect user specific data",
"if",
"(",
... | Return the Current Client Id
@return string | [
"Return",
"the",
"Current",
"Client",
"Id"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L206-L235 |
221,963 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.generateUuid | final private function generateUuid()
{
return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
mt_rand(0, 0xffff),
mt_rand(0, 0xffff),
// 16 bits for "time_mid"
mt_rand(0, 0xffff),
// 16 bits for "... | php | final private function generateUuid()
{
return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
mt_rand(0, 0xffff),
mt_rand(0, 0xffff),
// 16 bits for "time_mid"
mt_rand(0, 0xffff),
// 16 bits for "... | [
"final",
"private",
"function",
"generateUuid",
"(",
")",
"{",
"return",
"sprintf",
"(",
"'%04x%04x-%04x-%04x-%04x-%04x%04x%04x'",
",",
"// 32 bits for \"time_low\"",
"mt_rand",
"(",
"0",
",",
"0xffff",
")",
",",
"mt_rand",
"(",
"0",
",",
"0xffff",
")",
",",
"//... | Generate UUID v4 function - needed to generate a CID when one isn't available
@author Andrew Moore http://www.php.net/manual/en/function.uniqid.php#94959
@return string | [
"Generate",
"UUID",
"v4",
"function",
"-",
"needed",
"to",
"generate",
"a",
"CID",
"when",
"one",
"isn",
"t",
"available"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L257-L278 |
221,964 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.getTrackingPayloadData | protected function getTrackingPayloadData(Tracking\AbstractTracking $event)
{
$payloadData = $event->getPackage();
$payloadData['v'] = $this->apiProtocolVersion; // protocol version
$payloadData['tid'] = $this->analyticsAccountUid; // account id
$payloadData['uid'] = $this->getOption... | php | protected function getTrackingPayloadData(Tracking\AbstractTracking $event)
{
$payloadData = $event->getPackage();
$payloadData['v'] = $this->apiProtocolVersion; // protocol version
$payloadData['tid'] = $this->analyticsAccountUid; // account id
$payloadData['uid'] = $this->getOption... | [
"protected",
"function",
"getTrackingPayloadData",
"(",
"Tracking",
"\\",
"AbstractTracking",
"$",
"event",
")",
"{",
"$",
"payloadData",
"=",
"$",
"event",
"->",
"getPackage",
"(",
")",
";",
"$",
"payloadData",
"[",
"'v'",
"]",
"=",
"$",
"this",
"->",
"ap... | Build the Tracking Payload Data
@param Tracking\AbstractTracking $event
@return array
@throws Exception\MissingConfigurationException | [
"Build",
"the",
"Tracking",
"Payload",
"Data"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L287-L309 |
221,965 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.callEndpoint | private function callEndpoint($tracking)
{
$trackingHolder = is_array($tracking) ? $tracking : array($tracking);
$trackingCollection = new Request\TrackingRequestCollection();
foreach ($trackingHolder as $tracking) {
if (!$tracking instanceof Tracking\AbstractTracking) {
... | php | private function callEndpoint($tracking)
{
$trackingHolder = is_array($tracking) ? $tracking : array($tracking);
$trackingCollection = new Request\TrackingRequestCollection();
foreach ($trackingHolder as $tracking) {
if (!$tracking instanceof Tracking\AbstractTracking) {
... | [
"private",
"function",
"callEndpoint",
"(",
"$",
"tracking",
")",
"{",
"$",
"trackingHolder",
"=",
"is_array",
"(",
"$",
"tracking",
")",
"?",
"$",
"tracking",
":",
"array",
"(",
"$",
"tracking",
")",
";",
"$",
"trackingCollection",
"=",
"new",
"Request",
... | Call the client adapter
@param $tracking
@throws Exception\InvalidArgumentException
@throws Exception\MissingConfigurationException
@return Request\TrackingRequestCollection | [
"Call",
"the",
"client",
"adapter"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L319-L340 |
221,966 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.createTracking | public function createTracking($className, $options = null)
{
if (strstr(strtolower($className), 'abstracttracking')) {
return false;
}
$class = 'Racecore\GATracking\Tracking\\' . $className;
if ($options) {
return new $class($options);
}
retu... | php | public function createTracking($className, $options = null)
{
if (strstr(strtolower($className), 'abstracttracking')) {
return false;
}
$class = 'Racecore\GATracking\Tracking\\' . $className;
if ($options) {
return new $class($options);
}
retu... | [
"public",
"function",
"createTracking",
"(",
"$",
"className",
",",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"strstr",
"(",
"strtolower",
"(",
"$",
"className",
")",
",",
"'abstracttracking'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"... | Create a Tracking Class Instance - eg. "Event" or "Ecommerce\Transaction"
@param $className
@param null $options
@return bool | [
"Create",
"a",
"Tracking",
"Class",
"Instance",
"-",
"eg",
".",
"Event",
"or",
"Ecommerce",
"\\",
"Transaction"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L349-L360 |
221,967 | ins0/google-measurement-php-client | src/Racecore/GATracking/GATracking.php | GATracking.sendTracking | public function sendTracking(Tracking\AbstractTracking $tracking)
{
$responseCollection = $this->callEndpoint($tracking);
$responseCollection->rewind();
return $responseCollection->current();
} | php | public function sendTracking(Tracking\AbstractTracking $tracking)
{
$responseCollection = $this->callEndpoint($tracking);
$responseCollection->rewind();
return $responseCollection->current();
} | [
"public",
"function",
"sendTracking",
"(",
"Tracking",
"\\",
"AbstractTracking",
"$",
"tracking",
")",
"{",
"$",
"responseCollection",
"=",
"$",
"this",
"->",
"callEndpoint",
"(",
"$",
"tracking",
")",
";",
"$",
"responseCollection",
"->",
"rewind",
"(",
")",
... | Send single tracking request
@param Tracking\AbstractTracking $tracking
@return Tracking\AbstractTracking | [
"Send",
"single",
"tracking",
"request"
] | 415cabca0c6d83cd0bd6a8ed6fb695b35f892018 | https://github.com/ins0/google-measurement-php-client/blob/415cabca0c6d83cd0bd6a8ed6fb695b35f892018/src/Racecore/GATracking/GATracking.php#L368-L373 |
221,968 | wallee-payment/php-sdk | lib/Model/PaymentMethodConfiguration.php | PaymentMethodConfiguration.setResolvedDescription | public function setResolvedDescription($resolvedDescription) {
if (is_array($resolvedDescription) && empty($resolvedDescription)) {
$this->resolvedDescription = new \stdClass;
} else {
$this->resolvedDescription = $resolvedDescription;
}
return $this;
} | php | public function setResolvedDescription($resolvedDescription) {
if (is_array($resolvedDescription) && empty($resolvedDescription)) {
$this->resolvedDescription = new \stdClass;
} else {
$this->resolvedDescription = $resolvedDescription;
}
return $this;
} | [
"public",
"function",
"setResolvedDescription",
"(",
"$",
"resolvedDescription",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"resolvedDescription",
")",
"&&",
"empty",
"(",
"$",
"resolvedDescription",
")",
")",
"{",
"$",
"this",
"->",
"resolvedDescription",
"=",
... | Sets resolvedDescription.
@param map[string,string] $resolvedDescription
@return PaymentMethodConfiguration | [
"Sets",
"resolvedDescription",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentMethodConfiguration.php#L462-L470 |
221,969 | wallee-payment/php-sdk | lib/Model/PaymentMethodConfiguration.php | PaymentMethodConfiguration.setResolvedTitle | public function setResolvedTitle($resolvedTitle) {
if (is_array($resolvedTitle) && empty($resolvedTitle)) {
$this->resolvedTitle = new \stdClass;
} else {
$this->resolvedTitle = $resolvedTitle;
}
return $this;
} | php | public function setResolvedTitle($resolvedTitle) {
if (is_array($resolvedTitle) && empty($resolvedTitle)) {
$this->resolvedTitle = new \stdClass;
} else {
$this->resolvedTitle = $resolvedTitle;
}
return $this;
} | [
"public",
"function",
"setResolvedTitle",
"(",
"$",
"resolvedTitle",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"resolvedTitle",
")",
"&&",
"empty",
"(",
"$",
"resolvedTitle",
")",
")",
"{",
"$",
"this",
"->",
"resolvedTitle",
"=",
"new",
"\\",
"stdClass",... | Sets resolvedTitle.
@param map[string,string] $resolvedTitle
@return PaymentMethodConfiguration | [
"Sets",
"resolvedTitle",
"."
] | e1d18453855382af3144e845f2d9704efb93e9cb | https://github.com/wallee-payment/php-sdk/blob/e1d18453855382af3144e845f2d9704efb93e9cb/lib/Model/PaymentMethodConfiguration.php#L512-L520 |
221,970 | claroline/CoreBundle | Controller/FileController.php | FileController.getCurrentUser | private function getCurrentUser()
{
if (is_object($token = $this->get('security.token_storage')->getToken()) and is_object($user = $token->getUser())) {
return $user;
}
} | php | private function getCurrentUser()
{
if (is_object($token = $this->get('security.token_storage')->getToken()) and is_object($user = $token->getUser())) {
return $user;
}
} | [
"private",
"function",
"getCurrentUser",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"token",
"=",
"$",
"this",
"->",
"get",
"(",
"'security.token_storage'",
")",
"->",
"getToken",
"(",
")",
")",
"and",
"is_object",
"(",
"$",
"user",
"=",
"$",
"to... | Get Current User
@return mixed Claroline\CoreBundle\Entity\User or null | [
"Get",
"Current",
"User"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/FileController.php#L297-L302 |
221,971 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.editActivity | public function editActivity(Activity $activity)
{
$this->om->persist($activity);
$this->om->flush();
$this->initializePermissions($activity);
return $activity;
} | php | public function editActivity(Activity $activity)
{
$this->om->persist($activity);
$this->om->flush();
$this->initializePermissions($activity);
return $activity;
} | [
"public",
"function",
"editActivity",
"(",
"Activity",
"$",
"activity",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"persist",
"(",
"$",
"activity",
")",
";",
"$",
"this",
"->",
"om",
"->",
"flush",
"(",
")",
";",
"$",
"this",
"->",
"initializePermissions... | Edit an activity | [
"Edit",
"an",
"activity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L82-L89 |
221,972 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.addResource | public function addResource(Activity $activity, ResourceNode $resource)
{
if (!$activity->getParameters()->getSecondaryResources()->contains($resource)) {
$activity->getParameters()->getSecondaryResources()->add($resource);
$this->initializePermissions($activity);
$this->... | php | public function addResource(Activity $activity, ResourceNode $resource)
{
if (!$activity->getParameters()->getSecondaryResources()->contains($resource)) {
$activity->getParameters()->getSecondaryResources()->add($resource);
$this->initializePermissions($activity);
$this->... | [
"public",
"function",
"addResource",
"(",
"Activity",
"$",
"activity",
",",
"ResourceNode",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"$",
"activity",
"->",
"getParameters",
"(",
")",
"->",
"getSecondaryResources",
"(",
")",
"->",
"contains",
"(",
"$",
"r... | Link a resource to an activity | [
"Link",
"a",
"resource",
"to",
"an",
"activity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L103-L113 |
221,973 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.removePrimaryResource | public function removePrimaryResource(Activity $activity)
{
$activity->setPrimaryResource();
$this->om->persist($activity);
$this->om->flush();
} | php | public function removePrimaryResource(Activity $activity)
{
$activity->setPrimaryResource();
$this->om->persist($activity);
$this->om->flush();
} | [
"public",
"function",
"removePrimaryResource",
"(",
"Activity",
"$",
"activity",
")",
"{",
"$",
"activity",
"->",
"setPrimaryResource",
"(",
")",
";",
"$",
"this",
"->",
"om",
"->",
"persist",
"(",
"$",
"activity",
")",
";",
"$",
"this",
"->",
"om",
"->"... | Remove the primary resource of an activity | [
"Remove",
"the",
"primary",
"resource",
"of",
"an",
"activity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L118-L123 |
221,974 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.removeResource | public function removeResource(Activity $activity, ResourceNode $resource)
{
if ($activity->getParameters()->getSecondaryResources()->contains($resource)) {
$activity->getParameters()->getSecondaryResources()->removeElement($resource);
$this->om->persist($activity);
$this... | php | public function removeResource(Activity $activity, ResourceNode $resource)
{
if ($activity->getParameters()->getSecondaryResources()->contains($resource)) {
$activity->getParameters()->getSecondaryResources()->removeElement($resource);
$this->om->persist($activity);
$this... | [
"public",
"function",
"removeResource",
"(",
"Activity",
"$",
"activity",
",",
"ResourceNode",
"$",
"resource",
")",
"{",
"if",
"(",
"$",
"activity",
"->",
"getParameters",
"(",
")",
"->",
"getSecondaryResources",
"(",
")",
"->",
"contains",
"(",
"$",
"resou... | Remove a resource from an activity | [
"Remove",
"a",
"resource",
"from",
"an",
"activity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L128-L137 |
221,975 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.copyActivity | public function copyActivity(Activity $resource)
{
$activity = new Activity();
$activity->setTitle($resource->getTitle());
$activity->setDescription($resource->getDescription());
$activity->setParameters($this->copyParameters($resource));
if ($primaryResource = $resource->g... | php | public function copyActivity(Activity $resource)
{
$activity = new Activity();
$activity->setTitle($resource->getTitle());
$activity->setDescription($resource->getDescription());
$activity->setParameters($this->copyParameters($resource));
if ($primaryResource = $resource->g... | [
"public",
"function",
"copyActivity",
"(",
"Activity",
"$",
"resource",
")",
"{",
"$",
"activity",
"=",
"new",
"Activity",
"(",
")",
";",
"$",
"activity",
"->",
"setTitle",
"(",
"$",
"resource",
"->",
"getTitle",
"(",
")",
")",
";",
"$",
"activity",
"-... | Copy an activity | [
"Copy",
"an",
"activity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L142-L155 |
221,976 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.createBlankEvaluation | public function createBlankEvaluation(User $user, ActivityParameters $activityParams)
{
$evaluationType = $activityParams->getEvaluationType();
$status = null;
$nbAttempts = null;
if ($evaluationType === AbstractEvaluation::TYPE_AUTOMATIC) {
$status = AbstractEvaluation:... | php | public function createBlankEvaluation(User $user, ActivityParameters $activityParams)
{
$evaluationType = $activityParams->getEvaluationType();
$status = null;
$nbAttempts = null;
if ($evaluationType === AbstractEvaluation::TYPE_AUTOMATIC) {
$status = AbstractEvaluation:... | [
"public",
"function",
"createBlankEvaluation",
"(",
"User",
"$",
"user",
",",
"ActivityParameters",
"$",
"activityParams",
")",
"{",
"$",
"evaluationType",
"=",
"$",
"activityParams",
"->",
"getEvaluationType",
"(",
")",
";",
"$",
"status",
"=",
"null",
";",
"... | Creates an empty activity evaluation for a user, so that an evaluation
is available for display and edition even when the user hasn't actually
performed the activity.
@param User $user
@param ActivityParameters $activityParams
@return Evaluation | [
"Creates",
"an",
"empty",
"activity",
"evaluation",
"for",
"a",
"user",
"so",
"that",
"an",
"evaluation",
"is",
"available",
"for",
"display",
"and",
"edition",
"even",
"when",
"the",
"user",
"hasn",
"t",
"actually",
"performed",
"the",
"activity",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L423-L445 |
221,977 | claroline/CoreBundle | Manager/ActivityManager.php | ActivityManager.initializePermissions | public function initializePermissions(Activity $activity)
{
$primary = $activity->getPrimaryResource();
$secondaries = [];
$nodes = [];
$token = $this->tokenStorage->getToken();
$user = $token === null ? $activity->getResourceNode()->getCreator(): $token->getUser();
... | php | public function initializePermissions(Activity $activity)
{
$primary = $activity->getPrimaryResource();
$secondaries = [];
$nodes = [];
$token = $this->tokenStorage->getToken();
$user = $token === null ? $activity->getResourceNode()->getCreator(): $token->getUser();
... | [
"public",
"function",
"initializePermissions",
"(",
"Activity",
"$",
"activity",
")",
"{",
"$",
"primary",
"=",
"$",
"activity",
"->",
"getPrimaryResource",
"(",
")",
";",
"$",
"secondaries",
"=",
"[",
"]",
";",
"$",
"nodes",
"=",
"[",
"]",
";",
"$",
"... | What does it do ? I can't remember. It's annoying.
Initialize the resource permissions of an activity
@param Activity $activity | [
"What",
"does",
"it",
"do",
"?",
"I",
"can",
"t",
"remember",
".",
"It",
"s",
"annoying",
".",
"Initialize",
"the",
"resource",
"permissions",
"of",
"an",
"activity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ActivityManager.php#L753-L798 |
221,978 | claroline/CoreBundle | Library/Home/HomeService.php | HomeService.defaultTemplate | public function defaultTemplate($path)
{
$dir = explode(':', $path);
$controller = preg_split('/(?=[A-Z])/', $dir[0]);
$controller = array_slice($controller, (count($controller) - 2));
$controller = implode('', $controller);
$base = __DIR__ . "/../../Resources/views/";
... | php | public function defaultTemplate($path)
{
$dir = explode(':', $path);
$controller = preg_split('/(?=[A-Z])/', $dir[0]);
$controller = array_slice($controller, (count($controller) - 2));
$controller = implode('', $controller);
$base = __DIR__ . "/../../Resources/views/";
... | [
"public",
"function",
"defaultTemplate",
"(",
"$",
"path",
")",
"{",
"$",
"dir",
"=",
"explode",
"(",
"':'",
",",
"$",
"path",
")",
";",
"$",
"controller",
"=",
"preg_split",
"(",
"'/(?=[A-Z])/'",
",",
"$",
"dir",
"[",
"0",
"]",
")",
";",
"$",
"con... | Verify if a twig template exists, If the template does not exists a default path will be return;
@param string $path The path of the twig template separated by : just as the path for $this->render(...)
@return string | [
"Verify",
"if",
"a",
"twig",
"template",
"exists",
"If",
"the",
"template",
"does",
"not",
"exists",
"a",
"default",
"path",
"will",
"be",
"return",
";"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Home/HomeService.php#L27-L61 |
221,979 | claroline/CoreBundle | Library/Home/HomeService.php | HomeService.isDefinedPush | public function isDefinedPush($array, $name, $variable, $method = null)
{
if ($method and $variable) {
$array[$name] = $variable->$method();
} elseif ($variable) {
$array[$name] = $variable;
}
return $array;
} | php | public function isDefinedPush($array, $name, $variable, $method = null)
{
if ($method and $variable) {
$array[$name] = $variable->$method();
} elseif ($variable) {
$array[$name] = $variable;
}
return $array;
} | [
"public",
"function",
"isDefinedPush",
"(",
"$",
"array",
",",
"$",
"name",
",",
"$",
"variable",
",",
"$",
"method",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"method",
"and",
"$",
"variable",
")",
"{",
"$",
"array",
"[",
"$",
"name",
"]",
"=",
"$"... | Reduce some "overall complexity" | [
"Reduce",
"some",
"overall",
"complexity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Home/HomeService.php#L66-L75 |
221,980 | claroline/CoreBundle | Library/Installation/PlatformInstaller.php | PlatformInstaller.installFromKernel | public function installFromKernel($withOptionalFixtures = true)
{
$this->launchPreInstallActions();
//The core bundle must be installed first
$coreBundle = $this->kernel->getBundle('ClarolineCoreBundle');
$bundles = $this->kernel->getBundles();
$this->baseInstaller->install($... | php | public function installFromKernel($withOptionalFixtures = true)
{
$this->launchPreInstallActions();
//The core bundle must be installed first
$coreBundle = $this->kernel->getBundle('ClarolineCoreBundle');
$bundles = $this->kernel->getBundles();
$this->baseInstaller->install($... | [
"public",
"function",
"installFromKernel",
"(",
"$",
"withOptionalFixtures",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"launchPreInstallActions",
"(",
")",
";",
"//The core bundle must be installed first",
"$",
"coreBundle",
"=",
"$",
"this",
"->",
"kernel",
"->",
... | This is the method fired at the 1st installation.
Either command line or from the web installer.
@param bool $withOptionalFixtures | [
"This",
"is",
"the",
"method",
"fired",
"at",
"the",
"1st",
"installation",
".",
"Either",
"command",
"line",
"or",
"from",
"the",
"web",
"installer",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Installation/PlatformInstaller.php#L110-L128 |
221,981 | claroline/CoreBundle | Manager/ThemeManager.php | ThemeManager.createCustomTheme | public function createCustomTheme($name, File $file)
{
$theme = new Theme();
$theme->setName($name);
$themeDir = "{$this->themeDir}/{$theme->getNormalizedName()}";
$fs = new Filesystem();
$fs->mkdir($themeDir);
$file->move($themeDir, 'bootstrap.css');
$this... | php | public function createCustomTheme($name, File $file)
{
$theme = new Theme();
$theme->setName($name);
$themeDir = "{$this->themeDir}/{$theme->getNormalizedName()}";
$fs = new Filesystem();
$fs->mkdir($themeDir);
$file->move($themeDir, 'bootstrap.css');
$this... | [
"public",
"function",
"createCustomTheme",
"(",
"$",
"name",
",",
"File",
"$",
"file",
")",
"{",
"$",
"theme",
"=",
"new",
"Theme",
"(",
")",
";",
"$",
"theme",
"->",
"setName",
"(",
"$",
"name",
")",
";",
"$",
"themeDir",
"=",
"\"{$this->themeDir}/{$t... | Creates a custom theme based on a css file.
@param string $name
@param File $file | [
"Creates",
"a",
"custom",
"theme",
"based",
"on",
"a",
"css",
"file",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ThemeManager.php#L151-L164 |
221,982 | claroline/CoreBundle | Repository/WorkspaceRepository.php | WorkspaceRepository.findByAnonymous | public function findByAnonymous($orderedToolType = 0)
{
$dql = "
SELECT DISTINCT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
JOIN w.orderedTools ot
JOIN ot.rights otr
JOIN otr.role r
WHERE r.name = 'ROLE_ANONYMOUS'
... | php | public function findByAnonymous($orderedToolType = 0)
{
$dql = "
SELECT DISTINCT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
JOIN w.orderedTools ot
JOIN ot.rights otr
JOIN otr.role r
WHERE r.name = 'ROLE_ANONYMOUS'
... | [
"public",
"function",
"findByAnonymous",
"(",
"$",
"orderedToolType",
"=",
"0",
")",
"{",
"$",
"dql",
"=",
"\"\n SELECT DISTINCT w\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w\n JOIN w.orderedTools ot\n JOIN ot.rights otr\n ... | Returns the workspaces whose at least one tool is accessible to anonymous users.
@return array[Workspace] | [
"Returns",
"the",
"workspaces",
"whose",
"at",
"least",
"one",
"tool",
"is",
"accessible",
"to",
"anonymous",
"users",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceRepository.php#L85-L102 |
221,983 | claroline/CoreBundle | Repository/WorkspaceRepository.php | WorkspaceRepository.findOpenWorkspaceIds | public function findOpenWorkspaceIds(
array $roleNames,
array $workspaces,
$toolName = null,
$action = 'open',
$orderedToolType = 0
)
{
if (count($roleNames) === 0 || count($workspaces) === 0) {
return array();
} else {
$dql = '
... | php | public function findOpenWorkspaceIds(
array $roleNames,
array $workspaces,
$toolName = null,
$action = 'open',
$orderedToolType = 0
)
{
if (count($roleNames) === 0 || count($workspaces) === 0) {
return array();
} else {
$dql = '
... | [
"public",
"function",
"findOpenWorkspaceIds",
"(",
"array",
"$",
"roleNames",
",",
"array",
"$",
"workspaces",
",",
"$",
"toolName",
"=",
"null",
",",
"$",
"action",
"=",
"'open'",
",",
"$",
"orderedToolType",
"=",
"0",
")",
"{",
"if",
"(",
"count",
"(",... | Finds which workspaces can be opened by one of the given roles,
in a given set of workspaces. If a tool name is passed in, the
check will be limited to that tool, otherwise workspaces with
at least one accessible tool will be considered open. Only the
ids are returned.
@param array[string] $roles
@param array[Work... | [
"Finds",
"which",
"workspaces",
"can",
"be",
"opened",
"by",
"one",
"of",
"the",
"given",
"roles",
"in",
"a",
"given",
"set",
"of",
"workspaces",
".",
"If",
"a",
"tool",
"name",
"is",
"passed",
"in",
"the",
"check",
"will",
"be",
"limited",
"to",
"that... | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceRepository.php#L214-L261 |
221,984 | claroline/CoreBundle | Repository/WorkspaceRepository.php | WorkspaceRepository.findByRoleNamesBySearch | public function findByRoleNamesBySearch(array $roleNames, $search, $orderedToolType = 0)
{
$dql = '
SELECT DISTINCT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
JOIN w.orderedTools ot
JOIN ot.rights otr
JOIN otr.role r
WHERE... | php | public function findByRoleNamesBySearch(array $roleNames, $search, $orderedToolType = 0)
{
$dql = '
SELECT DISTINCT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
JOIN w.orderedTools ot
JOIN ot.rights otr
JOIN otr.role r
WHERE... | [
"public",
"function",
"findByRoleNamesBySearch",
"(",
"array",
"$",
"roleNames",
",",
"$",
"search",
",",
"$",
"orderedToolType",
"=",
"0",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT DISTINCT w\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w\n ... | Returns the workspaces whose at least one tool is accessible to one of the given roles
and whose name matches the given search string.
@param array[string] $roleNames
@param string $search
@return array[Workspace] | [
"Returns",
"the",
"workspaces",
"whose",
"at",
"least",
"one",
"tool",
"is",
"accessible",
"to",
"one",
"of",
"the",
"given",
"roles",
"and",
"whose",
"name",
"matches",
"the",
"given",
"search",
"string",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceRepository.php#L301-L327 |
221,985 | claroline/CoreBundle | Repository/WorkspaceRepository.php | WorkspaceRepository.findDisplayableWorkspacesWithout | public function findDisplayableWorkspacesWithout(array $excludedWorkspaces)
{
$dql = '
SELECT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
WHERE w.displayable = true
AND w NOT IN (:excludedWorkspaces)
ORDER BY w.name
';
... | php | public function findDisplayableWorkspacesWithout(array $excludedWorkspaces)
{
$dql = '
SELECT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
WHERE w.displayable = true
AND w NOT IN (:excludedWorkspaces)
ORDER BY w.name
';
... | [
"public",
"function",
"findDisplayableWorkspacesWithout",
"(",
"array",
"$",
"excludedWorkspaces",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT w\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w\n WHERE w.displayable = true\n AND w NOT IN (:e... | Returns the workspaces which are visible and are not in the given list.
@return array[Workspace] | [
"Returns",
"the",
"workspaces",
"which",
"are",
"visible",
"and",
"are",
"not",
"in",
"the",
"given",
"list",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceRepository.php#L619-L632 |
221,986 | claroline/CoreBundle | Repository/WorkspaceRepository.php | WorkspaceRepository.findMyWorkspacesByRoleNames | public function findMyWorkspacesByRoleNames(array $roleNames)
{
$dql = '
SELECT DISTINCT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
WHERE w IN (
SELECT rw.id
FROM Claroline\CoreBundle\Entity\Role r
JOIN Claroli... | php | public function findMyWorkspacesByRoleNames(array $roleNames)
{
$dql = '
SELECT DISTINCT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
WHERE w IN (
SELECT rw.id
FROM Claroline\CoreBundle\Entity\Role r
JOIN Claroli... | [
"public",
"function",
"findMyWorkspacesByRoleNames",
"(",
"array",
"$",
"roleNames",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT DISTINCT w\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w\n WHERE w IN (\n SELECT rw.id\n F... | Returns the workspaces accessible by one of the given roles.
@param array[string] $roleNames
@return array[Workspace] | [
"Returns",
"the",
"workspaces",
"accessible",
"by",
"one",
"of",
"the",
"given",
"roles",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceRepository.php#L779-L797 |
221,987 | claroline/CoreBundle | Repository/WorkspaceRepository.php | WorkspaceRepository.findAllPersonalWorkspaces | public function findAllPersonalWorkspaces($orderedBy = 'name', $order = 'ASC')
{
$dql = "
SELECT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
WHERE EXISTS (
SELECT u
FROM Claroline\CoreBundle\Entity\User u
JOIN u... | php | public function findAllPersonalWorkspaces($orderedBy = 'name', $order = 'ASC')
{
$dql = "
SELECT w
FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
WHERE EXISTS (
SELECT u
FROM Claroline\CoreBundle\Entity\User u
JOIN u... | [
"public",
"function",
"findAllPersonalWorkspaces",
"(",
"$",
"orderedBy",
"=",
"'name'",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"$",
"dql",
"=",
"\"\n SELECT w\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w\n WHERE EXISTS (\n ... | Returns all personal workspaces.
@return array[Workspace] | [
"Returns",
"all",
"personal",
"workspaces",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceRepository.php#L975-L991 |
221,988 | claroline/CoreBundle | Event/StrictDispatcher.php | StrictDispatcher.dispatch | public function dispatch($eventName, $shortEventClassName, array $eventArgs = array())
{
$className = class_exists($shortEventClassName) ?
$shortEventClassName:
"Claroline\CoreBundle\Event\\{$shortEventClassName}Event";
if (!class_exists($className)) {
throw new... | php | public function dispatch($eventName, $shortEventClassName, array $eventArgs = array())
{
$className = class_exists($shortEventClassName) ?
$shortEventClassName:
"Claroline\CoreBundle\Event\\{$shortEventClassName}Event";
if (!class_exists($className)) {
throw new... | [
"public",
"function",
"dispatch",
"(",
"$",
"eventName",
",",
"$",
"shortEventClassName",
",",
"array",
"$",
"eventArgs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"className",
"=",
"class_exists",
"(",
"$",
"shortEventClassName",
")",
"?",
"$",
"shortEventClas... | Dispatches an event and returns its associated event object. The event object
is created according to the short event class name parameter, which must match
an event class located in the core event directory, without the first path
segments and the "Event" suffix.
@param string $eventName Name of the event
@... | [
"Dispatches",
"an",
"event",
"and",
"returns",
"its",
"associated",
"event",
"object",
".",
"The",
"event",
"object",
"is",
"created",
"according",
"to",
"the",
"short",
"event",
"class",
"name",
"parameter",
"which",
"must",
"match",
"an",
"event",
"class",
... | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Event/StrictDispatcher.php#L59-L85 |
221,989 | claroline/CoreBundle | Manager/ApiManager.php | ApiManager.handleFormView | public function handleFormView($template, $form, array $options = array())
{
$httpCode = isset($options['http_code']) ? $options['http_code']: 200;
$parameters = isset($options['form_view']) ? $options['form_view']: array();
$serializerGroup = isset($options['serializer_group']) ? $options['... | php | public function handleFormView($template, $form, array $options = array())
{
$httpCode = isset($options['http_code']) ? $options['http_code']: 200;
$parameters = isset($options['form_view']) ? $options['form_view']: array();
$serializerGroup = isset($options['serializer_group']) ? $options['... | [
"public",
"function",
"handleFormView",
"(",
"$",
"template",
",",
"$",
"form",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"httpCode",
"=",
"isset",
"(",
"$",
"options",
"[",
"'http_code'",
"]",
")",
"?",
"$",
"options",
"["... | helper for the API controllers methods. We only do this in case of html request | [
"helper",
"for",
"the",
"API",
"controllers",
"methods",
".",
"We",
"only",
"do",
"this",
"in",
"case",
"of",
"html",
"request"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ApiManager.php#L112-L122 |
221,990 | claroline/CoreBundle | Repository/WorkspaceTagHierarchyRepository.php | WorkspaceTagHierarchyRepository.findAdminHierarchiesByParent | public function findAdminHierarchiesByParent(WorkspaceTag $workspaceTag)
{
$dql = '
SELECT h
FROM Claroline\CoreBundle\Entity\Workspace\WorkspaceTagHierarchy h
WHERE h.user IS NULL
AND h.parent = :workspaceTag
';
$query = $this->_em->createQuer... | php | public function findAdminHierarchiesByParent(WorkspaceTag $workspaceTag)
{
$dql = '
SELECT h
FROM Claroline\CoreBundle\Entity\Workspace\WorkspaceTagHierarchy h
WHERE h.user IS NULL
AND h.parent = :workspaceTag
';
$query = $this->_em->createQuer... | [
"public",
"function",
"findAdminHierarchiesByParent",
"(",
"WorkspaceTag",
"$",
"workspaceTag",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT h\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\WorkspaceTagHierarchy h\n WHERE h.user IS NULL\n AND h.parent ... | Returns all admin relations where given workspaceTag is parent | [
"Returns",
"all",
"admin",
"relations",
"where",
"given",
"workspaceTag",
"is",
"parent"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceTagHierarchyRepository.php#L23-L35 |
221,991 | claroline/CoreBundle | Repository/WorkspaceTagHierarchyRepository.php | WorkspaceTagHierarchyRepository.findHierarchiesByParent | public function findHierarchiesByParent(
User $user,
WorkspaceTag $workspaceTag
)
{
$dql = '
SELECT h
FROM Claroline\CoreBundle\Entity\Workspace\WorkspaceTagHierarchy h
WHERE h.user = :user
AND h.parent = :workspaceTag
';
$q... | php | public function findHierarchiesByParent(
User $user,
WorkspaceTag $workspaceTag
)
{
$dql = '
SELECT h
FROM Claroline\CoreBundle\Entity\Workspace\WorkspaceTagHierarchy h
WHERE h.user = :user
AND h.parent = :workspaceTag
';
$q... | [
"public",
"function",
"findHierarchiesByParent",
"(",
"User",
"$",
"user",
",",
"WorkspaceTag",
"$",
"workspaceTag",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT h\n FROM Claroline\\CoreBundle\\Entity\\Workspace\\WorkspaceTagHierarchy h\n WHERE h.user = :us... | Returns all relations where given workspaceTag is parent | [
"Returns",
"all",
"relations",
"where",
"given",
"workspaceTag",
"is",
"parent"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceTagHierarchyRepository.php#L40-L56 |
221,992 | claroline/CoreBundle | Repository/GroupRepository.php | GroupRepository.findAllGroupsBySearch | public function findAllGroupsBySearch($search)
{
$upperSearch = strtoupper(trim($search));
if ($search !== '') {
$dql = '
SELECT g
FROM Claroline\CoreBundle\Entity\Group g
WHERE UPPER(g.name) LIKE :search
';
$query... | php | public function findAllGroupsBySearch($search)
{
$upperSearch = strtoupper(trim($search));
if ($search !== '') {
$dql = '
SELECT g
FROM Claroline\CoreBundle\Entity\Group g
WHERE UPPER(g.name) LIKE :search
';
$query... | [
"public",
"function",
"findAllGroupsBySearch",
"(",
"$",
"search",
")",
"{",
"$",
"upperSearch",
"=",
"strtoupper",
"(",
"trim",
"(",
"$",
"search",
")",
")",
";",
"if",
"(",
"$",
"search",
"!==",
"''",
")",
"{",
"$",
"dql",
"=",
"'\n SELE... | Returns all the groups by search.
@param string $search
@return array[Group] | [
"Returns",
"all",
"the",
"groups",
"by",
"search",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/GroupRepository.php#L241-L259 |
221,993 | claroline/CoreBundle | Repository/UserRepository.php | UserRepository.findByName | public function findByName($search, $executeQuery = true, $orderedBy = 'id', $order = null)
{
$upperSearch = strtoupper($search);
$upperSearch = trim($upperSearch);
$upperSearch = preg_replace('/\s+/', ' ', $upperSearch);
$dql = "
SELECT u, r, g FROM Claroline\CoreBundle\... | php | public function findByName($search, $executeQuery = true, $orderedBy = 'id', $order = null)
{
$upperSearch = strtoupper($search);
$upperSearch = trim($upperSearch);
$upperSearch = preg_replace('/\s+/', ' ', $upperSearch);
$dql = "
SELECT u, r, g FROM Claroline\CoreBundle\... | [
"public",
"function",
"findByName",
"(",
"$",
"search",
",",
"$",
"executeQuery",
"=",
"true",
",",
"$",
"orderedBy",
"=",
"'id'",
",",
"$",
"order",
"=",
"null",
")",
"{",
"$",
"upperSearch",
"=",
"strtoupper",
"(",
"$",
"search",
")",
";",
"$",
"up... | Search users whose first name, last name or username match a given search string.
@param string $search
@param boolean $executeQuery
@param string $orderedBy
@param null $order
@return User[]|Query | [
"Search",
"users",
"whose",
"first",
"name",
"last",
"name",
"or",
"username",
"match",
"a",
"given",
"search",
"string",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/UserRepository.php#L125-L151 |
221,994 | claroline/CoreBundle | Repository/UserRepository.php | UserRepository.findByNameAndGroup | public function findByNameAndGroup(
$search,
Group $group,
$executeQuery = true,
$orderedBy = 'id',
$order = 'ASC'
)
{
$dql = "
SELECT DISTINCT u FROM Claroline\CoreBundle\Entity\User u
JOIN u.groups g
WHERE g.id = :groupId
... | php | public function findByNameAndGroup(
$search,
Group $group,
$executeQuery = true,
$orderedBy = 'id',
$order = 'ASC'
)
{
$dql = "
SELECT DISTINCT u FROM Claroline\CoreBundle\Entity\User u
JOIN u.groups g
WHERE g.id = :groupId
... | [
"public",
"function",
"findByNameAndGroup",
"(",
"$",
"search",
",",
"Group",
"$",
"group",
",",
"$",
"executeQuery",
"=",
"true",
",",
"$",
"orderedBy",
"=",
"'id'",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"$",
"dql",
"=",
"\"\n SELECT DISTI... | Returns the users of a group whose first name, last name or username match
a given search string.
@param string $search
@param Group $group
@param boolean $executeQuery
@param string $orderedBy
@return User[]|Query | [
"Returns",
"the",
"users",
"of",
"a",
"group",
"whose",
"first",
"name",
"last",
"name",
"or",
"username",
"match",
"a",
"given",
"search",
"string",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/UserRepository.php#L193-L217 |
221,995 | claroline/CoreBundle | Repository/UserRepository.php | UserRepository.findUsersByWorkspacesAndSearch | public function findUsersByWorkspacesAndSearch(array $workspaces, $search)
{
$upperSearch = strtoupper(trim($search));
$dql = '
SELECT DISTINCT u FROM Claroline\CoreBundle\Entity\User u
JOIN u.roles wr
LEFT JOIN u.groups g
LEFT JOIN g.roles gr
... | php | public function findUsersByWorkspacesAndSearch(array $workspaces, $search)
{
$upperSearch = strtoupper(trim($search));
$dql = '
SELECT DISTINCT u FROM Claroline\CoreBundle\Entity\User u
JOIN u.roles wr
LEFT JOIN u.groups g
LEFT JOIN g.roles gr
... | [
"public",
"function",
"findUsersByWorkspacesAndSearch",
"(",
"array",
"$",
"workspaces",
",",
"$",
"search",
")",
"{",
"$",
"upperSearch",
"=",
"strtoupper",
"(",
"trim",
"(",
"$",
"search",
")",
")",
";",
"$",
"dql",
"=",
"'\n SELECT DISTINCT u FROM ... | Returns the users who are members of one of the given workspaces.
User list is filtered by a search on first name, last name and username
@param array $workspaces
@param string $search
@return User[] | [
"Returns",
"the",
"users",
"who",
"are",
"members",
"of",
"one",
"of",
"the",
"given",
"workspaces",
".",
"User",
"list",
"is",
"filtered",
"by",
"a",
"search",
"on",
"first",
"name",
"last",
"name",
"and",
"username"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/UserRepository.php#L289-L317 |
221,996 | claroline/CoreBundle | Repository/UserRepository.php | UserRepository.countUsersByRole | public function countUsersByRole($role, $restrictionRoleNames)
{
$qb = $this->createQueryBuilder('user')
->select('COUNT(DISTINCT user.id)')
->leftJoin('user.roles', 'roles')
->andWhere('roles.id = :roleId')
->setParameter('roleId', $role->getId());
if... | php | public function countUsersByRole($role, $restrictionRoleNames)
{
$qb = $this->createQueryBuilder('user')
->select('COUNT(DISTINCT user.id)')
->leftJoin('user.roles', 'roles')
->andWhere('roles.id = :roleId')
->setParameter('roleId', $role->getId());
if... | [
"public",
"function",
"countUsersByRole",
"(",
"$",
"role",
",",
"$",
"restrictionRoleNames",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'user'",
")",
"->",
"select",
"(",
"'COUNT(DISTINCT user.id)'",
")",
"->",
"leftJoin",
"(",
... | Counts the users subscribed in a platform role
@param $role
@param $restrictionRoleNames
@return integer | [
"Counts",
"the",
"users",
"subscribed",
"in",
"a",
"platform",
"role"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/UserRepository.php#L408-L422 |
221,997 | claroline/CoreBundle | Repository/UserRepository.php | UserRepository.findUserIdsInRoles | public function findUserIdsInRoles($roleNames)
{
$qb = $this->createQueryBuilder('user')
->select('user.id')
->leftJoin('user.roles', 'roles')
->andWhere('roles.name IN (:roleNames)')
->andWhere('user.isEnabled = true')
->setParameter('roleNames', ... | php | public function findUserIdsInRoles($roleNames)
{
$qb = $this->createQueryBuilder('user')
->select('user.id')
->leftJoin('user.roles', 'roles')
->andWhere('roles.name IN (:roleNames)')
->andWhere('user.isEnabled = true')
->setParameter('roleNames', ... | [
"public",
"function",
"findUserIdsInRoles",
"(",
"$",
"roleNames",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'user'",
")",
"->",
"select",
"(",
"'user.id'",
")",
"->",
"leftJoin",
"(",
"'user.roles'",
",",
"'roles'",
")",
"->... | Returns user Ids that are subscribed to one of the roles given
@param array $roleNames
@return array | [
"Returns",
"user",
"Ids",
"that",
"are",
"subscribed",
"to",
"one",
"of",
"the",
"roles",
"given"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/UserRepository.php#L429-L440 |
221,998 | claroline/CoreBundle | Repository/UserRepository.php | UserRepository.findGroupOutsidersByName | public function findGroupOutsidersByName(Group $group, $search, $executeQuery = true, $orderedBy = 'id')
{
$dql = "
SELECT DISTINCT u FROM Claroline\CoreBundle\Entity\User u
WHERE (
UPPER(u.lastName) LIKE :search
OR UPPER(u.firstName) LIKE :search
... | php | public function findGroupOutsidersByName(Group $group, $search, $executeQuery = true, $orderedBy = 'id')
{
$dql = "
SELECT DISTINCT u FROM Claroline\CoreBundle\Entity\User u
WHERE (
UPPER(u.lastName) LIKE :search
OR UPPER(u.firstName) LIKE :search
... | [
"public",
"function",
"findGroupOutsidersByName",
"(",
"Group",
"$",
"group",
",",
"$",
"search",
",",
"$",
"executeQuery",
"=",
"true",
",",
"$",
"orderedBy",
"=",
"'id'",
")",
"{",
"$",
"dql",
"=",
"\"\n SELECT DISTINCT u FROM Claroline\\CoreBundle\\Ent... | Returns the users who are not members of a group and whose first name, last
name or username match a given search string.
@param \Claroline\CoreBundle\Entity\Group $group
@param string $search
@param boolean $executeQuery
@param string $orderedBy
@return User[]|Query
@todo Find out why the join on profile preference... | [
"Returns",
"the",
"users",
"who",
"are",
"not",
"members",
"of",
"a",
"group",
"and",
"whose",
"first",
"name",
"last",
"name",
"or",
"username",
"match",
"a",
"given",
"search",
"string",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/UserRepository.php#L1513-L1535 |
221,999 | claroline/CoreBundle | Entity/User.php | User.setPlatformRoles | public function setPlatformRoles($platformRoles)
{
$roles = $this->getEntityRoles();
$removedRoles = array();
foreach ($roles as $role) {
if ($role->getType() != Role::WS_ROLE) {
$removedRoles[] = $role;
}
}
foreach ($removedRoles as ... | php | public function setPlatformRoles($platformRoles)
{
$roles = $this->getEntityRoles();
$removedRoles = array();
foreach ($roles as $role) {
if ($role->getType() != Role::WS_ROLE) {
$removedRoles[] = $role;
}
}
foreach ($removedRoles as ... | [
"public",
"function",
"setPlatformRoles",
"(",
"$",
"platformRoles",
")",
"{",
"$",
"roles",
"=",
"$",
"this",
"->",
"getEntityRoles",
"(",
")",
";",
"$",
"removedRoles",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"roles",
"as",
"$",
"role",
")"... | Replace the old platform roles of a user by a new array.
@param $platformRoles | [
"Replace",
"the",
"old",
"platform",
"roles",
"of",
"a",
"user",
"by",
"a",
"new",
"array",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Entity/User.php#L840-L858 |
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.