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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
227,600 | authlete/authlete-php | src/Web/HttpHeaders.php | HttpHeaders.get | public function get($name)
{
if (is_null($name) || empty($name))
{
return null;
}
$loweredKey = strtolower($name);
if (array_key_exists($loweredKey, $this->keyMap) === false)
{
return null;
}
$originalKey = $this->keyMap[$low... | php | public function get($name)
{
if (is_null($name) || empty($name))
{
return null;
}
$loweredKey = strtolower($name);
if (array_key_exists($loweredKey, $this->keyMap) === false)
{
return null;
}
$originalKey = $this->keyMap[$low... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
"||",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"loweredKey",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
... | Get the values of an HTTP header.
@param string $name
HTTP header name. For example, `Location`. Case-insensitive.
@return array
Values of the HTTP header. | [
"Get",
"the",
"values",
"of",
"an",
"HTTP",
"header",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Web/HttpHeaders.php#L100-L117 |
227,601 | authlete/authlete-php | src/Web/HttpHeaders.php | HttpHeaders.parse | public static function parse($input)
{
$headers = new HttpHeaders();
if (is_null($input) || empty($input))
{
return $headers;
}
$lines = preg_split('/\R/', $input);
foreach ($lines as $header)
{
$elements = explode(':', $header, 2);
... | php | public static function parse($input)
{
$headers = new HttpHeaders();
if (is_null($input) || empty($input))
{
return $headers;
}
$lines = preg_split('/\R/', $input);
foreach ($lines as $header)
{
$elements = explode(':', $header, 2);
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"input",
")",
"{",
"$",
"headers",
"=",
"new",
"HttpHeaders",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"input",
")",
"||",
"empty",
"(",
"$",
"input",
")",
")",
"{",
"return",
"$",
"headers",... | Parse HTTP headers and generate an instance of HttpHeaders that
represents the HTTP headers.
```
$input = "Fruits: Apple\r\n"
. "fruits: Banana\r\n"
. "FRUITS: Cherry\r\n"
. "Animals: Cat\r\n"
;
$headers = HttpHeaders::parse($input);
```
@param string $input
HTTP headers delimited by newlines (CRLF or LF).
@return H... | [
"Parse",
"HTTP",
"headers",
"and",
"generate",
"an",
"instance",
"of",
"HttpHeaders",
"that",
"represents",
"the",
"HTTP",
"headers",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Web/HttpHeaders.php#L173-L197 |
227,602 | movim/moxl | src/Moxl/Utils.php | Utils.cleanXML | public static function cleanXML($xml)
{
if($xml != '') {
$doc = new \DOMDocument();
$doc->loadXML($xml);
$doc->formatOutput = true;
return $doc->saveXML();
} else {
return '';
}
} | php | public static function cleanXML($xml)
{
if($xml != '') {
$doc = new \DOMDocument();
$doc->loadXML($xml);
$doc->formatOutput = true;
return $doc->saveXML();
} else {
return '';
}
} | [
"public",
"static",
"function",
"cleanXML",
"(",
"$",
"xml",
")",
"{",
"if",
"(",
"$",
"xml",
"!=",
"''",
")",
"{",
"$",
"doc",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"doc",
"->",
"loadXML",
"(",
"$",
"xml",
")",
";",
"$",
"doc",
... | A simple function which clean and reindent an XML string | [
"A",
"simple",
"function",
"which",
"clean",
"and",
"reindent",
"an",
"XML",
"string"
] | bfe3e1d83ef3bbbd270150f2f1164e8a662ef716 | https://github.com/movim/moxl/blob/bfe3e1d83ef3bbbd270150f2f1164e8a662ef716/src/Moxl/Utils.php#L18-L28 |
227,603 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedRevocationAuthMethods | public function setSupportedRevocationAuthMethods(array $methods = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$methods', $methods, '\Authlete\Types\ClientAuthMethod');
$this->supportedRevocationAuthMethods = $methods;
return $this;
} | php | public function setSupportedRevocationAuthMethods(array $methods = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$methods', $methods, '\Authlete\Types\ClientAuthMethod');
$this->supportedRevocationAuthMethods = $methods;
return $this;
} | [
"public",
"function",
"setSupportedRevocationAuthMethods",
"(",
"array",
"$",
"methods",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$methods'",
",",
"$",
"methods",
",",
"'\\Authlete\\Types\\ClientAuthMethod'",
")",
";",
"$",
"... | Set client authentication methods at the revocation endpoint
supported by this service.
This corresponds to the `revocation_endpoint_auth_methods_supported`
metadata defined in "OAuth 2.0 Authorization Server Metadata".
@param ClientAuthMethod[] $methods
Supported client authentication methods at the revocation endpo... | [
"Set",
"client",
"authentication",
"methods",
"at",
"the",
"revocation",
"endpoint",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L415-L423 |
227,604 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedScopes | public function setSupportedScopes(array $scopes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$scopes', $scopes, __NAMESPACE__ . '\Scope');
$this->supportedScopes = $scopes;
return $this;
} | php | public function setSupportedScopes(array $scopes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$scopes', $scopes, __NAMESPACE__ . '\Scope');
$this->supportedScopes = $scopes;
return $this;
} | [
"public",
"function",
"setSupportedScopes",
"(",
"array",
"$",
"scopes",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$scopes'",
",",
"$",
"scopes",
",",
"__NAMESPACE__",
".",
"'\\Scope'",
")",
";",
"$",
"this",
"->",
"su... | Set the scopes supported by this service.
This corresponds to the `scopes_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html).
@param Scop... | [
"Set",
"the",
"scopes",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L611-L619 |
227,605 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedResponseTypes | public function setSupportedResponseTypes(array $responseTypes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$responseTypes', $responseTypes, '\Authlete\Types\ResponseType');
$this->supportedResponseTypes = $responseTypes;
return $this;
} | php | public function setSupportedResponseTypes(array $responseTypes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$responseTypes', $responseTypes, '\Authlete\Types\ResponseType');
$this->supportedResponseTypes = $responseTypes;
return $this;
} | [
"public",
"function",
"setSupportedResponseTypes",
"(",
"array",
"$",
"responseTypes",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$responseTypes'",
",",
"$",
"responseTypes",
",",
"'\\Authlete\\Types\\ResponseType'",
")",
";",
"$... | Set the response types supported by this service.
This corresponds to the `response_types_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.htm... | [
"Set",
"the",
"response",
"types",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L655-L663 |
227,606 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedGrantTypes | public function setSupportedGrantTypes(array $grantTypes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$grantTypes', $grantTypes, '\Authlete\Types\GrantType');
$this->supportedGrantTypes = $grantTypes;
return $this;
} | php | public function setSupportedGrantTypes(array $grantTypes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$grantTypes', $grantTypes, '\Authlete\Types\GrantType');
$this->supportedGrantTypes = $grantTypes;
return $this;
} | [
"public",
"function",
"setSupportedGrantTypes",
"(",
"array",
"$",
"grantTypes",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$grantTypes'",
",",
"$",
"grantTypes",
",",
"'\\Authlete\\Types\\GrantType'",
")",
";",
"$",
"this",
... | Set the grant types supported by this service.
This corresponds to the `grant_types_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html).
@... | [
"Set",
"the",
"grant",
"types",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L695-L703 |
227,607 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedTokenAuthMethods | public function setSupportedTokenAuthMethods(array $methods = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$methods', $methods, '\Authlete\Types\ClientAuthMethod');
$this->supportedTokenAuthMethods = $methods;
return $this;
} | php | public function setSupportedTokenAuthMethods(array $methods = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$methods', $methods, '\Authlete\Types\ClientAuthMethod');
$this->supportedTokenAuthMethods = $methods;
return $this;
} | [
"public",
"function",
"setSupportedTokenAuthMethods",
"(",
"array",
"$",
"methods",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$methods'",
",",
"$",
"methods",
",",
"'\\Authlete\\Types\\ClientAuthMethod'",
")",
";",
"$",
"this"... | Set client authentication methods at the token endpoint supported
by this service.
This corresponds to the `token_endpoint_auth_methods_supported`
metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://ope... | [
"Set",
"client",
"authentication",
"methods",
"at",
"the",
"token",
"endpoint",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L780-L788 |
227,608 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedDisplays | public function setSupportedDisplays(array $displays = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$displays', $displays, '\Authlete\Types\Display');
$this->supportedDisplays = $displays;
return $this;
} | php | public function setSupportedDisplays(array $displays = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$displays', $displays, '\Authlete\Types\Display');
$this->supportedDisplays = $displays;
return $this;
} | [
"public",
"function",
"setSupportedDisplays",
"(",
"array",
"$",
"displays",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$displays'",
",",
"$",
"displays",
",",
"'\\Authlete\\Types\\Display'",
")",
";",
"$",
"this",
"->",
"s... | Set the values of the "display" request parameter supported by
this service.
This corresponds to the `display_values_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openi... | [
"Set",
"the",
"values",
"of",
"the",
"display",
"request",
"parameter",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L822-L830 |
227,609 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedClaimTypes | public function setSupportedClaimTypes(array $claimTypes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$claimTypes', $claimTypes, '\Authlete\Types\ClaimType');
$this->supportedClaimTypes = $claimTypes;
return $this;
} | php | public function setSupportedClaimTypes(array $claimTypes = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$claimTypes', $claimTypes, '\Authlete\Types\ClaimType');
$this->supportedClaimTypes = $claimTypes;
return $this;
} | [
"public",
"function",
"setSupportedClaimTypes",
"(",
"array",
"$",
"claimTypes",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$claimTypes'",
",",
"$",
"claimTypes",
",",
"'\\Authlete\\Types\\ClaimType'",
")",
";",
"$",
"this",
... | Set claim types supported by this service.
This corresponds to the `claim_types_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html).
@para... | [
"Set",
"claim",
"types",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L862-L870 |
227,610 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedClaims | public function setSupportedClaims(array $claims = null)
{
ValidationUtility::ensureNullOrArrayOfString('$claims', $claims);
$this->supportedClaims = $claims;
return $this;
} | php | public function setSupportedClaims(array $claims = null)
{
ValidationUtility::ensureNullOrArrayOfString('$claims', $claims);
$this->supportedClaims = $claims;
return $this;
} | [
"public",
"function",
"setSupportedClaims",
"(",
"array",
"$",
"claims",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfString",
"(",
"'$claims'",
",",
"$",
"claims",
")",
";",
"$",
"this",
"->",
"supportedClaims",
"=",
"$",
"claims",
";... | Set claims supported by this service.
This corresponds to the `claims_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html).
@param string[]... | [
"Set",
"claims",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L902-L909 |
227,611 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedClaimLocales | public function setSupportedClaimLocales(array $locales = null)
{
ValidationUtility::ensureNullOrArrayOfString('$locales', $locales);
$this->supportedClaimLocales = $locales;
return $this;
} | php | public function setSupportedClaimLocales(array $locales = null)
{
ValidationUtility::ensureNullOrArrayOfString('$locales', $locales);
$this->supportedClaimLocales = $locales;
return $this;
} | [
"public",
"function",
"setSupportedClaimLocales",
"(",
"array",
"$",
"locales",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfString",
"(",
"'$locales'",
",",
"$",
"locales",
")",
";",
"$",
"this",
"->",
"supportedClaimLocales",
"=",
"$",
... | Set language and scripts for claim values supported by this service.
This corresponds to the `claims_locales_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connec... | [
"Set",
"language",
"and",
"scripts",
"for",
"claim",
"values",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L982-L989 |
227,612 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedUiLocales | public function setSupportedUiLocales(array $locales = null)
{
ValidationUtility::ensureNullOrArrayOfString('$locales', $locales);
$this->supportedUiLocales = $locales;
return $this;
} | php | public function setSupportedUiLocales(array $locales = null)
{
ValidationUtility::ensureNullOrArrayOfString('$locales', $locales);
$this->supportedUiLocales = $locales;
return $this;
} | [
"public",
"function",
"setSupportedUiLocales",
"(",
"array",
"$",
"locales",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfString",
"(",
"'$locales'",
",",
"$",
"locales",
")",
";",
"$",
"this",
"->",
"supportedUiLocales",
"=",
"$",
"loca... | Set language and scripts for the user interface supported by this
service.
This corresponds to the `ui_locales_supported` metadata defined in
[3. OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)
of [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-conn... | [
"Set",
"language",
"and",
"scripts",
"for",
"the",
"user",
"interface",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L1023-L1030 |
227,613 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedSnses | public function setSupportedSnses(array $snses = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$snses', $snses, '\Authlete\Types\Sns');
$this->supportedSnses = $snses;
return $this;
} | php | public function setSupportedSnses(array $snses = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$snses', $snses, '\Authlete\Types\Sns');
$this->supportedSnses = $snses;
return $this;
} | [
"public",
"function",
"setSupportedSnses",
"(",
"array",
"$",
"snses",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$snses'",
",",
"$",
"snses",
",",
"'\\Authlete\\Types\\Sns'",
")",
";",
"$",
"this",
"->",
"supportedSnses",
... | Set the list of supported SNSes for social login at the direct
authorization endpoint.
@param Sns[] $snses
Supported SNSes for social login at the direct authorization
endpoint.
@return Service
`$this` object. | [
"Set",
"the",
"list",
"of",
"supported",
"SNSes",
"for",
"social",
"login",
"at",
"the",
"direct",
"authorization",
"endpoint",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L1456-L1464 |
227,614 | authlete/authlete-php | src/Dto/Service.php | Service.setSnsCredentials | public function setSnsCredentials(array $credentials = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$credentials', $credentials, __NAMESPACE__ . '\SnsCredentials');
$this->snsCredentials = $credentials;
return $this;
} | php | public function setSnsCredentials(array $credentials = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$credentials', $credentials, __NAMESPACE__ . '\SnsCredentials');
$this->snsCredentials = $credentials;
return $this;
} | [
"public",
"function",
"setSnsCredentials",
"(",
"array",
"$",
"credentials",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$credentials'",
",",
"$",
"credentials",
",",
"__NAMESPACE__",
".",
"'\\SnsCredentials'",
")",
";",
"$",
... | Set the list of SNS credentials used for social login.
@param SnsCredentials[] $credentials
The list of SNS credentials.
@return Service
`$this` object. | [
"Set",
"the",
"list",
"of",
"SNS",
"credentials",
"used",
"for",
"social",
"login",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L1488-L1496 |
227,615 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedDeveloperSnses | public function setSupportedDeveloperSnses(array $snses = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$snses', $snses, '\Authlete\Types\Sns');
$this->supportedDeveloperSnses = $snses;
return $this;
} | php | public function setSupportedDeveloperSnses(array $snses = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$snses', $snses, '\Authlete\Types\Sns');
$this->supportedDeveloperSnses = $snses;
return $this;
} | [
"public",
"function",
"setSupportedDeveloperSnses",
"(",
"array",
"$",
"snses",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$snses'",
",",
"$",
"snses",
",",
"'\\Authlete\\Types\\Sns'",
")",
";",
"$",
"this",
"->",
"supporte... | Set the list of supported SNSes used for social login at the developer
console.
NOTE: This feature is not implemented yet.
@param Sns[] $snses
Supported SNSes for social login at the developer console.
@return Service
`$this` object. | [
"Set",
"the",
"list",
"of",
"supported",
"SNSes",
"used",
"for",
"social",
"login",
"at",
"the",
"developer",
"console",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L1693-L1701 |
227,616 | authlete/authlete-php | src/Dto/Service.php | Service.setDeveloperSnsCredentials | public function setDeveloperSnsCredentials(array $credentials = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$credentials', $credentials, __NAMESPACE__ . '\SnsCredentials');
$this->developerSnsCredentials = $credentials;
return $this;
} | php | public function setDeveloperSnsCredentials(array $credentials = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$credentials', $credentials, __NAMESPACE__ . '\SnsCredentials');
$this->developerSnsCredentials = $credentials;
return $this;
} | [
"public",
"function",
"setDeveloperSnsCredentials",
"(",
"array",
"$",
"credentials",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$credentials'",
",",
"$",
"credentials",
",",
"__NAMESPACE__",
".",
"'\\SnsCredentials'",
")",
";"... | Get the list of SNS credentials used for social login at the developer
console.
NOTE: This feature is not implemented yet.
@param SnsCredentials[] $credentials
The list of SNS credentials used for social login at the developer
console.
@return Service
`$this` object. | [
"Get",
"the",
"list",
"of",
"SNS",
"credentials",
"used",
"for",
"social",
"login",
"at",
"the",
"developer",
"console",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L1733-L1741 |
227,617 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedServiceProfiles | public function setSupportedServiceProfiles(array $serviceProfiles = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$serviceProfiles', $serviceProfiles, '\Authlete\Types\ServiceProfile');
$this->supportedServiceProfiles = $serviceProfiles;
return $this;
} | php | public function setSupportedServiceProfiles(array $serviceProfiles = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$serviceProfiles', $serviceProfiles, '\Authlete\Types\ServiceProfile');
$this->supportedServiceProfiles = $serviceProfiles;
return $this;
} | [
"public",
"function",
"setSupportedServiceProfiles",
"(",
"array",
"$",
"serviceProfiles",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$serviceProfiles'",
",",
"$",
"serviceProfiles",
",",
"'\\Authlete\\Types\\ServiceProfile'",
")",
... | Set the service profile supported by this service.
@param ServiceProfile[] $serviceProfiles
Supported service profiles.
@return Service
`$this` object. | [
"Set",
"the",
"service",
"profile",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L2392-L2400 |
227,618 | authlete/authlete-php | src/Dto/Service.php | Service.setSupportedIntrospectionAuthMethods | public function setSupportedIntrospectionAuthMethods(array $methods = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$methods', $methods, '\Authlete\Types\ClientAuthMethod');
$this->supportedIntrospectionAuthMethods = $methods;
return $this;
} | php | public function setSupportedIntrospectionAuthMethods(array $methods = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$methods', $methods, '\Authlete\Types\ClientAuthMethod');
$this->supportedIntrospectionAuthMethods = $methods;
return $this;
} | [
"public",
"function",
"setSupportedIntrospectionAuthMethods",
"(",
"array",
"$",
"methods",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$methods'",
",",
"$",
"methods",
",",
"'\\Authlete\\Types\\ClientAuthMethod'",
")",
";",
"$",
... | Set client authentication methods at the introspection endpoint
supported by this service.
This corresponds to the `introspection_endpoint_auth_methods_supported`
metadata defined in "OAuth 2.0 Authorization Server Metadata".
@param ClientAuthMethod[] $methods
Supported client authentication methods at the introspect... | [
"Set",
"client",
"authentication",
"methods",
"at",
"the",
"introspection",
"endpoint",
"supported",
"by",
"this",
"service",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L2555-L2563 |
227,619 | authlete/authlete-php | src/Dto/Service.php | Service.setTrustedRootCertificates | public function setTrustedRootCertificates(array $certificates = null)
{
ValidationUtility::ensureNullOrArrayOfString('$certificates', $certificates);
$this->trustedRootCertificates = $certificates;
return $this;
} | php | public function setTrustedRootCertificates(array $certificates = null)
{
ValidationUtility::ensureNullOrArrayOfString('$certificates', $certificates);
$this->trustedRootCertificates = $certificates;
return $this;
} | [
"public",
"function",
"setTrustedRootCertificates",
"(",
"array",
"$",
"certificates",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfString",
"(",
"'$certificates'",
",",
"$",
"certificates",
")",
";",
"$",
"this",
"->",
"trustedRootCertificate... | Set trusted root certificates.
If `isMutualTlsValidatePkiCertChain()` returns `true`, pre-registered
trusted root certificates are used to validate client certificates.
@param string[] $certificates
Trusted root certificates.
@return Service
`$this` object.
@since 1.3 | [
"Set",
"trusted",
"root",
"certificates",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/Service.php#L2597-L2604 |
227,620 | TimeToogo/RapidRoute | src/Router.php | Router.clearCompiled | public function clearCompiled()
{
if(file_exists($this->compiledRouterPath)) {
@unlink($this->compiledRouterPath);
}
$this->compiledRouter = null;
} | php | public function clearCompiled()
{
if(file_exists($this->compiledRouterPath)) {
@unlink($this->compiledRouterPath);
}
$this->compiledRouter = null;
} | [
"public",
"function",
"clearCompiled",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"compiledRouterPath",
")",
")",
"{",
"@",
"unlink",
"(",
"$",
"this",
"->",
"compiledRouterPath",
")",
";",
"}",
"$",
"this",
"->",
"compiledRouter",
... | Clears the compiled router, it will be recompiled when next requested.
@return void | [
"Clears",
"the",
"compiled",
"router",
"it",
"will",
"be",
"recompiled",
"when",
"next",
"requested",
"."
] | 5ef2c90a1ab5f02565c4a22bc0bf979c98f15292 | https://github.com/TimeToogo/RapidRoute/blob/5ef2c90a1ab5f02565c4a22bc0bf979c98f15292/src/Router.php#L125-L132 |
227,621 | Vinelab/api-manager | src/Vinelab/Api/Api.php | Api.readConfigFile | private function readConfigFile()
{
// reading the config file to be stored in the 'configurations' variable below
$configurations = $this->config_reader->get('api');
$this->mappers_base_namespace = $configurations['mappers'];
$this->limit = $configurations['limit'];
} | php | private function readConfigFile()
{
// reading the config file to be stored in the 'configurations' variable below
$configurations = $this->config_reader->get('api');
$this->mappers_base_namespace = $configurations['mappers'];
$this->limit = $configurations['limit'];
} | [
"private",
"function",
"readConfigFile",
"(",
")",
"{",
"// reading the config file to be stored in the 'configurations' variable below",
"$",
"configurations",
"=",
"$",
"this",
"->",
"config_reader",
"->",
"get",
"(",
"'api'",
")",
";",
"$",
"this",
"->",
"mappers_bas... | get config file values and store them in attributes. | [
"get",
"config",
"file",
"values",
"and",
"store",
"them",
"in",
"attributes",
"."
] | c48576e47db9863fca4c634df1ff7558957c90f5 | https://github.com/Vinelab/api-manager/blob/c48576e47db9863fca4c634df1ff7558957c90f5/src/Vinelab/Api/Api.php#L67-L73 |
227,622 | Vinelab/api-manager | src/Vinelab/Api/Api.php | Api.respond | public function respond($mapper, $data)
{
$arguments = [];
// if data is instance of Paginator then get the values of the total and the page from the paginator,
// and add them to the arguments array (total, page)
if ($this->isPaginatorInstance($data)) {
$arguments[0] = $... | php | public function respond($mapper, $data)
{
$arguments = [];
// if data is instance of Paginator then get the values of the total and the page from the paginator,
// and add them to the arguments array (total, page)
if ($this->isPaginatorInstance($data)) {
$arguments[0] = $... | [
"public",
"function",
"respond",
"(",
"$",
"mapper",
",",
"$",
"data",
")",
"{",
"$",
"arguments",
"=",
"[",
"]",
";",
"// if data is instance of Paginator then get the values of the total and the page from the paginator,",
"// and add them to the arguments array (total, page)",
... | Map and respond.
@param string|mixed $mapper
@param mixed $data
@throws ApiException
@return Illuminate\Http\JsonResponse | [
"Map",
"and",
"respond",
"."
] | c48576e47db9863fca4c634df1ff7558957c90f5 | https://github.com/Vinelab/api-manager/blob/c48576e47db9863fca4c634df1ff7558957c90f5/src/Vinelab/Api/Api.php#L85-L107 |
227,623 | Vinelab/api-manager | src/Vinelab/Api/Api.php | Api.data | public function data($mapper, $data)
{
// we won't deal with empty data
if (is_array($data) && empty($data)
|| (($this->isPaginatorInstance($data)) && $data->isEmpty())
|| ($data instanceof Collection && $data->isEmpty())
) {
return [];
}
/... | php | public function data($mapper, $data)
{
// we won't deal with empty data
if (is_array($data) && empty($data)
|| (($this->isPaginatorInstance($data)) && $data->isEmpty())
|| ($data instanceof Collection && $data->isEmpty())
) {
return [];
}
/... | [
"public",
"function",
"data",
"(",
"$",
"mapper",
",",
"$",
"data",
")",
"{",
"// we won't deal with empty data",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
"&&",
"empty",
"(",
"$",
"data",
")",
"||",
"(",
"(",
"$",
"this",
"->",
"isPaginatorInstance"... | Get the formatted data out of the given mapper and data.
@param string|mixed $mapper
@param mixed $data
@return array | [
"Get",
"the",
"formatted",
"data",
"out",
"of",
"the",
"given",
"mapper",
"and",
"data",
"."
] | c48576e47db9863fca4c634df1ff7558957c90f5 | https://github.com/Vinelab/api-manager/blob/c48576e47db9863fca4c634df1ff7558957c90f5/src/Vinelab/Api/Api.php#L129-L162 |
227,624 | Vinelab/api-manager | src/Vinelab/Api/Api.php | Api.content | public function content($mapper, $data)
{
$response = call_user_func_array([$this, 'respond'], func_get_args());
return $response->getData(true);
} | php | public function content($mapper, $data)
{
$response = call_user_func_array([$this, 'respond'], func_get_args());
return $response->getData(true);
} | [
"public",
"function",
"content",
"(",
"$",
"mapper",
",",
"$",
"data",
")",
"{",
"$",
"response",
"=",
"call_user_func_array",
"(",
"[",
"$",
"this",
",",
"'respond'",
"]",
",",
"func_get_args",
"(",
")",
")",
";",
"return",
"$",
"response",
"->",
"get... | Get the content only from the response.
@param mixed $mapper
@param mixed $data
@return array | [
"Get",
"the",
"content",
"only",
"from",
"the",
"response",
"."
] | c48576e47db9863fca4c634df1ff7558957c90f5 | https://github.com/Vinelab/api-manager/blob/c48576e47db9863fca4c634df1ff7558957c90f5/src/Vinelab/Api/Api.php#L206-L211 |
227,625 | Vinelab/api-manager | src/Vinelab/Api/Api.php | Api.limit | public function limit()
{
// get limit from config file
$limit = $this->getMaximumLimit();
// get the limit from the request if available else get the the default predefined limit from the config file
if (Input::get('limit') && is_numeric(Input::get('limit'))) {
$limit = ... | php | public function limit()
{
// get limit from config file
$limit = $this->getMaximumLimit();
// get the limit from the request if available else get the the default predefined limit from the config file
if (Input::get('limit') && is_numeric(Input::get('limit'))) {
$limit = ... | [
"public",
"function",
"limit",
"(",
")",
"{",
"// get limit from config file",
"$",
"limit",
"=",
"$",
"this",
"->",
"getMaximumLimit",
"(",
")",
";",
"// get the limit from the request if available else get the the default predefined limit from the config file",
"if",
"(",
"... | this function will be accessed as facade from anywhere to get the limit number of data for the endpoint call.
@return int | [
"this",
"function",
"will",
"be",
"accessed",
"as",
"facade",
"from",
"anywhere",
"to",
"get",
"the",
"limit",
"number",
"of",
"data",
"for",
"the",
"endpoint",
"call",
"."
] | c48576e47db9863fca4c634df1ff7558957c90f5 | https://github.com/Vinelab/api-manager/blob/c48576e47db9863fca4c634df1ff7558957c90f5/src/Vinelab/Api/Api.php#L228-L239 |
227,626 | jumilla/laravel-versionia | sources/Commands/DatabaseRollbackCommand.php | DatabaseRollbackCommand.doRollback | protected function doRollback(Migrator $migrator, $target_group, $target_version)
{
$installed_migrations = $migrator->installedMigrationsByDesc();
if (!isset($installed_migrations[$target_group])) {
$this->info("Nothing migrations for group '$target_group'.");
return;
... | php | protected function doRollback(Migrator $migrator, $target_group, $target_version)
{
$installed_migrations = $migrator->installedMigrationsByDesc();
if (!isset($installed_migrations[$target_group])) {
$this->info("Nothing migrations for group '$target_group'.");
return;
... | [
"protected",
"function",
"doRollback",
"(",
"Migrator",
"$",
"migrator",
",",
"$",
"target_group",
",",
"$",
"target_version",
")",
"{",
"$",
"installed_migrations",
"=",
"$",
"migrator",
"->",
"installedMigrationsByDesc",
"(",
")",
";",
"if",
"(",
"!",
"isset... | Execute rollback.
@param \Jumilla\Versionia\Laravel\Migrator $migrator
@param string $target_group
@param string $target_version | [
"Execute",
"rollback",
"."
] | 08ca0081c856c658d8b235c758c242b80b25da13 | https://github.com/jumilla/laravel-versionia/blob/08ca0081c856c658d8b235c758c242b80b25da13/sources/Commands/DatabaseRollbackCommand.php#L67-L87 |
227,627 | TimeToogo/RapidRoute | src/Compilation/VarExporter.php | VarExporter.export | public static function export($value)
{
if (is_array($value)) {
if(empty($value)) {
return '[]';
} elseif(count($value) === 1) {
reset($value);
return '[' . self::export(key($value)) . ' => ' . self::export(current($value)) . ']';
... | php | public static function export($value)
{
if (is_array($value)) {
if(empty($value)) {
return '[]';
} elseif(count($value) === 1) {
reset($value);
return '[' . self::export(key($value)) . ' => ' . self::export(current($value)) . ']';
... | [
"public",
"static",
"function",
"export",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
"'[]'",
";",
"}",
"elseif",
"(",
"count",
"(",
"$",
... | Converts the supplied value into a valid PHP representation.
@param mixed $value
@return string | [
"Converts",
"the",
"supplied",
"value",
"into",
"a",
"valid",
"PHP",
"representation",
"."
] | 5ef2c90a1ab5f02565c4a22bc0bf979c98f15292 | https://github.com/TimeToogo/RapidRoute/blob/5ef2c90a1ab5f02565c4a22bc0bf979c98f15292/src/Compilation/VarExporter.php#L20-L57 |
227,628 | authlete/authlete-php | src/Dto/TokenRequest.php | TokenRequest.setClientCertificatePath | public function setClientCertificatePath(array $path = null)
{
ValidationUtility::ensureNullOrArrayOfString('$path', $path);
$this->clientCertificatePath = $path;
return $this;
} | php | public function setClientCertificatePath(array $path = null)
{
ValidationUtility::ensureNullOrArrayOfString('$path', $path);
$this->clientCertificatePath = $path;
return $this;
} | [
"public",
"function",
"setClientCertificatePath",
"(",
"array",
"$",
"path",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfString",
"(",
"'$path'",
",",
"$",
"path",
")",
";",
"$",
"this",
"->",
"clientCertificatePath",
"=",
"$",
"path",
... | Set the certificate path presented by the client during client
authentication.
@param string[] $path
Certificates in PEM format.
@return TokenRequest
`$this` object.
@since 1.3 | [
"Set",
"the",
"certificate",
"path",
"presented",
"by",
"the",
"client",
"during",
"client",
"authentication",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/TokenRequest.php#L241-L248 |
227,629 | TimeToogo/RapidRoute | src/Compilation/RouteTree/RouteTreeOptimizer.php | RouteTreeOptimizer.optimize | public function optimize(RouteTree $routeTree)
{
$segmentDepthNodeMap = $routeTree->getSegmentDepthNodesMap();
foreach ($segmentDepthNodeMap as $segmentDepth => $nodes) {
$segmentDepthNodeMap[$segmentDepth] = $this->optimizeNodes($nodes);
}
return new RouteTree($routeTr... | php | public function optimize(RouteTree $routeTree)
{
$segmentDepthNodeMap = $routeTree->getSegmentDepthNodesMap();
foreach ($segmentDepthNodeMap as $segmentDepth => $nodes) {
$segmentDepthNodeMap[$segmentDepth] = $this->optimizeNodes($nodes);
}
return new RouteTree($routeTr... | [
"public",
"function",
"optimize",
"(",
"RouteTree",
"$",
"routeTree",
")",
"{",
"$",
"segmentDepthNodeMap",
"=",
"$",
"routeTree",
"->",
"getSegmentDepthNodesMap",
"(",
")",
";",
"foreach",
"(",
"$",
"segmentDepthNodeMap",
"as",
"$",
"segmentDepth",
"=>",
"$",
... | Optimizes the supplied route tree
@param RouteTree $routeTree
@return RouteTree | [
"Optimizes",
"the",
"supplied",
"route",
"tree"
] | 5ef2c90a1ab5f02565c4a22bc0bf979c98f15292 | https://github.com/TimeToogo/RapidRoute/blob/5ef2c90a1ab5f02565c4a22bc0bf979c98f15292/src/Compilation/RouteTree/RouteTreeOptimizer.php#L28-L37 |
227,630 | alhoqbani/ar-php | src/ArUtil/I18N/Identifier.php | Identifier.identify | public static function identify($str)
{
$minAr = 55436;
$maxAr = 55698;
$probAr = false;
$arFlag = false;
$arRef = array();
$max = strlen($str);
$i = -1;
while (++$i < $max) {
$cDec = ord($str[$i]);
/... | php | public static function identify($str)
{
$minAr = 55436;
$maxAr = 55698;
$probAr = false;
$arFlag = false;
$arRef = array();
$max = strlen($str);
$i = -1;
while (++$i < $max) {
$cDec = ord($str[$i]);
/... | [
"public",
"static",
"function",
"identify",
"(",
"$",
"str",
")",
"{",
"$",
"minAr",
"=",
"55436",
";",
"$",
"maxAr",
"=",
"55698",
";",
"$",
"probAr",
"=",
"false",
";",
"$",
"arFlag",
"=",
"false",
";",
"$",
"arRef",
"=",
"array",
"(",
")",
";"... | Identify Arabic text in a given UTF-8 multi language string
@param string $str UTF-8 multi language string
@return array Offset of the beginning and end of each Arabic segment in
sequence in the given UTF-8 multi language string
@author Khaled Al-Sham'aa <khaled@ar-php.org> | [
"Identify",
"Arabic",
"text",
"in",
"a",
"given",
"UTF",
"-",
"8",
"multi",
"language",
"string"
] | 27a451d79591f7e49a300e97e3b32ecf24934c86 | https://github.com/alhoqbani/ar-php/blob/27a451d79591f7e49a300e97e3b32ecf24934c86/src/ArUtil/I18N/Identifier.php#L124-L180 |
227,631 | alhoqbani/ar-php | src/ArUtil/I18N/Identifier.php | Identifier.isArabic | public static function isArabic($str)
{
$isArabic = false;
$arr = self::identify($str);
if (count($arr) == 1 && $arr[0] == 0) {
$isArabic = true;
}
return $isArabic;
} | php | public static function isArabic($str)
{
$isArabic = false;
$arr = self::identify($str);
if (count($arr) == 1 && $arr[0] == 0) {
$isArabic = true;
}
return $isArabic;
} | [
"public",
"static",
"function",
"isArabic",
"(",
"$",
"str",
")",
"{",
"$",
"isArabic",
"=",
"false",
";",
"$",
"arr",
"=",
"self",
"::",
"identify",
"(",
"$",
"str",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arr",
")",
"==",
"1",
"&&",
"$",
"ar... | Find out if given string is Arabic text or not
@param string $str String
@return boolean True if given string is UTF-8 Arabic, else will return False
@author Khaled Al-Sham'aa <khaled@ar-php.org> | [
"Find",
"out",
"if",
"given",
"string",
"is",
"Arabic",
"text",
"or",
"not"
] | 27a451d79591f7e49a300e97e3b32ecf24934c86 | https://github.com/alhoqbani/ar-php/blob/27a451d79591f7e49a300e97e3b32ecf24934c86/src/ArUtil/I18N/Identifier.php#L190-L200 |
227,632 | slince/smartqq | src/Credential.php | Credential.fromArray | public static function fromArray(array $data)
{
$cookieJar = null;
if (isset($data['cookies'])) {
$cookieJar = new CookieJar();
foreach ($data['cookies'] as $cookie) {
$cookieJar->setCookie(new SetCookie($cookie));
}
}
return new s... | php | public static function fromArray(array $data)
{
$cookieJar = null;
if (isset($data['cookies'])) {
$cookieJar = new CookieJar();
foreach ($data['cookies'] as $cookie) {
$cookieJar->setCookie(new SetCookie($cookie));
}
}
return new s... | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"cookieJar",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'cookies'",
"]",
")",
")",
"{",
"$",
"cookieJar",
"=",
"new",
"CookieJar",
"(",
")",
"... | Create from a array data.
@param array $data
@return static | [
"Create",
"from",
"a",
"array",
"data",
"."
] | 06ad056d47f2324f81e7118b47cc492529325252 | https://github.com/slince/smartqq/blob/06ad056d47f2324f81e7118b47cc492529325252/src/Credential.php#L189-L203 |
227,633 | JimmDiGrizli/phalcon-bootstrap | src/Bootstrap.php | Bootstrap.run | public function run($hide = false)
{
$this->boot();
$this->initNamespace();
$this->initModules();
$this->initServices();
if ($hide === false) {
return $this->handle()->getContent();
} else {
return 'true';
}
} | php | public function run($hide = false)
{
$this->boot();
$this->initNamespace();
$this->initModules();
$this->initServices();
if ($hide === false) {
return $this->handle()->getContent();
} else {
return 'true';
}
} | [
"public",
"function",
"run",
"(",
"$",
"hide",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"boot",
"(",
")",
";",
"$",
"this",
"->",
"initNamespace",
"(",
")",
";",
"$",
"this",
"->",
"initModules",
"(",
")",
";",
"$",
"this",
"->",
"initServices",
... | Running the application
@param bool $hide
@return string | [
"Running",
"the",
"application"
] | e165150644e908f62c20a12539d380152dd74232 | https://github.com/JimmDiGrizli/phalcon-bootstrap/blob/e165150644e908f62c20a12539d380152dd74232/src/Bootstrap.php#L80-L91 |
227,634 | JimmDiGrizli/phalcon-bootstrap | src/Bootstrap.php | Bootstrap.boot | protected function boot()
{
$configLoader = new ConfigLoader($this->environment);
$this->di->setShared('config-loader', $configLoader);
$id = Bootstrap::CONFIG . '_' . $this->name . '_' . $this->environment;
$cache = null;
if ($this->cacheable === true) {
$cache =... | php | protected function boot()
{
$configLoader = new ConfigLoader($this->environment);
$this->di->setShared('config-loader', $configLoader);
$id = Bootstrap::CONFIG . '_' . $this->name . '_' . $this->environment;
$cache = null;
if ($this->cacheable === true) {
$cache =... | [
"protected",
"function",
"boot",
"(",
")",
"{",
"$",
"configLoader",
"=",
"new",
"ConfigLoader",
"(",
"$",
"this",
"->",
"environment",
")",
";",
"$",
"this",
"->",
"di",
"->",
"setShared",
"(",
"'config-loader'",
",",
"$",
"configLoader",
")",
";",
"$",... | Loads the settings option and a list of services for the application | [
"Loads",
"the",
"settings",
"option",
"and",
"a",
"list",
"of",
"services",
"for",
"the",
"application"
] | e165150644e908f62c20a12539d380152dd74232 | https://github.com/JimmDiGrizli/phalcon-bootstrap/blob/e165150644e908f62c20a12539d380152dd74232/src/Bootstrap.php#L96-L118 |
227,635 | JimmDiGrizli/phalcon-bootstrap | src/Bootstrap.php | Bootstrap.initNamespace | protected function initNamespace()
{
$namespaces = $this->config->get('namespaces', null);
if ($namespaces !== null) {
foreach ($namespaces as $namespace => $path) {
$this->loader->registerNamespaces([$namespace => $path], true);
}
$this->loader->... | php | protected function initNamespace()
{
$namespaces = $this->config->get('namespaces', null);
if ($namespaces !== null) {
foreach ($namespaces as $namespace => $path) {
$this->loader->registerNamespaces([$namespace => $path], true);
}
$this->loader->... | [
"protected",
"function",
"initNamespace",
"(",
")",
"{",
"$",
"namespaces",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'namespaces'",
",",
"null",
")",
";",
"if",
"(",
"$",
"namespaces",
"!==",
"null",
")",
"{",
"foreach",
"(",
"$",
"namespac... | Initializing namespace of application | [
"Initializing",
"namespace",
"of",
"application"
] | e165150644e908f62c20a12539d380152dd74232 | https://github.com/JimmDiGrizli/phalcon-bootstrap/blob/e165150644e908f62c20a12539d380152dd74232/src/Bootstrap.php#L190-L201 |
227,636 | JimmDiGrizli/phalcon-bootstrap | src/Bootstrap.php | Bootstrap.initServices | protected function initServices()
{
$dependencies = $this->config->get('dependencies', null);
$this->getDI()->setShared('registrant', new Registrant($dependencies));
$this->getDI()->setShared('config', $this->config);
$this->getDI()->get('registrant')->registration();
} | php | protected function initServices()
{
$dependencies = $this->config->get('dependencies', null);
$this->getDI()->setShared('registrant', new Registrant($dependencies));
$this->getDI()->setShared('config', $this->config);
$this->getDI()->get('registrant')->registration();
} | [
"protected",
"function",
"initServices",
"(",
")",
"{",
"$",
"dependencies",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'dependencies'",
",",
"null",
")",
";",
"$",
"this",
"->",
"getDI",
"(",
")",
"->",
"setShared",
"(",
"'registrant'",
",",
... | Initializing services in dependency injection | [
"Initializing",
"services",
"in",
"dependency",
"injection"
] | e165150644e908f62c20a12539d380152dd74232 | https://github.com/JimmDiGrizli/phalcon-bootstrap/blob/e165150644e908f62c20a12539d380152dd74232/src/Bootstrap.php#L206-L212 |
227,637 | artur-graniszewski/tigra-image-library | gd2imaging.php | Color.getChroma | public function getChroma() {
$r = ($this->rgb >> 16) & 0xff;
$g = ($this->rgb >> 8) & 0xff;
$b = $this->rgb & 0xff;
return (max($r, $g, $b) - min($r, $g, $b)) / 255;
} | php | public function getChroma() {
$r = ($this->rgb >> 16) & 0xff;
$g = ($this->rgb >> 8) & 0xff;
$b = $this->rgb & 0xff;
return (max($r, $g, $b) - min($r, $g, $b)) / 255;
} | [
"public",
"function",
"getChroma",
"(",
")",
"{",
"$",
"r",
"=",
"(",
"$",
"this",
"->",
"rgb",
">>",
"16",
")",
"&",
"0xff",
";",
"$",
"g",
"=",
"(",
"$",
"this",
"->",
"rgb",
">>",
"8",
")",
"&",
"0xff",
";",
"$",
"b",
"=",
"$",
"this",
... | Returns color chroma.
@return float | [
"Returns",
"color",
"chroma",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L265-L270 |
227,638 | artur-graniszewski/tigra-image-library | gd2imaging.php | Color.getHue | public function getHue() {
$rgb = $this->rgb;
$r = (($rgb >> 16) & 0xff) / 255;
$g = (($rgb >> 8) & 0xff) / 255;
$b = ($rgb & 0xff) / 255;
$hue = rad2deg(atan2(1.7320508075688 /* = sqrt(3) */ * ($g - $b), 2 * $r - $g - $b));
return $hue >= 0 ? $hue : 360 + $hue;
} | php | public function getHue() {
$rgb = $this->rgb;
$r = (($rgb >> 16) & 0xff) / 255;
$g = (($rgb >> 8) & 0xff) / 255;
$b = ($rgb & 0xff) / 255;
$hue = rad2deg(atan2(1.7320508075688 /* = sqrt(3) */ * ($g - $b), 2 * $r - $g - $b));
return $hue >= 0 ? $hue : 360 + $hue;
} | [
"public",
"function",
"getHue",
"(",
")",
"{",
"$",
"rgb",
"=",
"$",
"this",
"->",
"rgb",
";",
"$",
"r",
"=",
"(",
"(",
"$",
"rgb",
">>",
"16",
")",
"&",
"0xff",
")",
"/",
"255",
";",
"$",
"g",
"=",
"(",
"(",
"$",
"rgb",
">>",
"8",
")",
... | Returns color hue.
@return int Value in degrees (0 => 360). | [
"Returns",
"color",
"hue",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L276-L283 |
227,639 | artur-graniszewski/tigra-image-library | gd2imaging.php | Color.getSaturation | public function getSaturation($colorMode = self::HSL) {
$r = (($this->rgb >> 16) & 0xff) / 255;
$g = (($this->rgb >> 8) & 0xff) / 255;
$b = ($this->rgb & 0xff) / 255;
$max = max($r, $g, $b);
$min = min($r, $g, $b);
if($max === 0) {
return 0;
}
if($colorMode === self::HSL) {
$diff = $max ... | php | public function getSaturation($colorMode = self::HSL) {
$r = (($this->rgb >> 16) & 0xff) / 255;
$g = (($this->rgb >> 8) & 0xff) / 255;
$b = ($this->rgb & 0xff) / 255;
$max = max($r, $g, $b);
$min = min($r, $g, $b);
if($max === 0) {
return 0;
}
if($colorMode === self::HSL) {
$diff = $max ... | [
"public",
"function",
"getSaturation",
"(",
"$",
"colorMode",
"=",
"self",
"::",
"HSL",
")",
"{",
"$",
"r",
"=",
"(",
"(",
"$",
"this",
"->",
"rgb",
">>",
"16",
")",
"&",
"0xff",
")",
"/",
"255",
";",
"$",
"g",
"=",
"(",
"(",
"$",
"this",
"->... | Returns color saturation.
@param int $colorMode Color mode for saturation (use Color::HSV, Color::HSI or Color::HSL as the value), default is Color::HSL
@return float | [
"Returns",
"color",
"saturation",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L291-L319 |
227,640 | artur-graniszewski/tigra-image-library | gd2imaging.php | Color.getLuminance | public function getLuminance($mode = self::HSL) {
$r = ($this->rgb >> 16) & 0xff;
$g = ($this->rgb >> 8) & 0xff;
$b = $this->rgb & 0xff;
switch ($mode) {
case 0:
// fastest, but less accurate.
return (($r + $r + $r + $b + $g + $g + $g + $g) >> 3) / 255;
break;
case 1:
// Digita... | php | public function getLuminance($mode = self::HSL) {
$r = ($this->rgb >> 16) & 0xff;
$g = ($this->rgb >> 8) & 0xff;
$b = $this->rgb & 0xff;
switch ($mode) {
case 0:
// fastest, but less accurate.
return (($r + $r + $r + $b + $g + $g + $g + $g) >> 3) / 255;
break;
case 1:
// Digita... | [
"public",
"function",
"getLuminance",
"(",
"$",
"mode",
"=",
"self",
"::",
"HSL",
")",
"{",
"$",
"r",
"=",
"(",
"$",
"this",
"->",
"rgb",
">>",
"16",
")",
"&",
"0xff",
";",
"$",
"g",
"=",
"(",
"$",
"this",
"->",
"rgb",
">>",
"8",
")",
"&",
... | Returns color luminance.
@param int $mode Luminance mode: 0 = fastest, 1 = Digital CCIR601, 2 = Digital ITU-R, 3 = HSP (best quality), Color::HSL = HSL (default), Color::HSV = HSV
@return float | [
"Returns",
"color",
"luminance",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L336-L374 |
227,641 | artur-graniszewski/tigra-image-library | gd2imaging.php | Dimensions.multiply | public function multiply($x, $y) {
$this->width *= $x;
$this->height *= $y;
return $this;
} | php | public function multiply($x, $y) {
$this->width *= $x;
$this->height *= $y;
return $this;
} | [
"public",
"function",
"multiply",
"(",
"$",
"x",
",",
"$",
"y",
")",
"{",
"$",
"this",
"->",
"width",
"*=",
"$",
"x",
";",
"$",
"this",
"->",
"height",
"*=",
"$",
"y",
";",
"return",
"$",
"this",
";",
"}"
] | Multiplies width and height by a given values.
@param int $x Value to multiply a width dimension.
@param int $y Value to multiply a height dimension.
@return Dimensions | [
"Multiplies",
"width",
"and",
"height",
"by",
"a",
"given",
"values",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L424-L428 |
227,642 | artur-graniszewski/tigra-image-library | gd2imaging.php | Dimensions.add | public function add($x = 0, $y = 0) {
$this->width += $x;
$this->height += $y;
return $this;
} | php | public function add($x = 0, $y = 0) {
$this->width += $x;
$this->height += $y;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"x",
"=",
"0",
",",
"$",
"y",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"width",
"+=",
"$",
"x",
";",
"$",
"this",
"->",
"height",
"+=",
"$",
"y",
";",
"return",
"$",
"this",
";",
"}"
] | Adds values to width and height respectively.
@param int $x Value to add to a width dimension.
@param int $y Value to add to a height dimension.
@return Dimensions | [
"Adds",
"values",
"to",
"width",
"and",
"height",
"respectively",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L437-L441 |
227,643 | artur-graniszewski/tigra-image-library | gd2imaging.php | Dimensions.getDiagonalWidth | public function getDiagonalWidth() {
return sqrt($this->width * $this->width + $this->height * $this->height);
} | php | public function getDiagonalWidth() {
return sqrt($this->width * $this->width + $this->height * $this->height);
} | [
"public",
"function",
"getDiagonalWidth",
"(",
")",
"{",
"return",
"sqrt",
"(",
"$",
"this",
"->",
"width",
"*",
"$",
"this",
"->",
"width",
"+",
"$",
"this",
"->",
"height",
"*",
"$",
"this",
"->",
"height",
")",
";",
"}"
] | Returns width of the diagonal line.
@return double | [
"Returns",
"width",
"of",
"the",
"diagonal",
"line",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L448-L450 |
227,644 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.addNoise | public function addNoise($level) {
$components = array();
foreach($this->components as $component) {
$components[] = $component + rand() * 2 * $level - $level;
}
$this->components = $components;
return $this;
} | php | public function addNoise($level) {
$components = array();
foreach($this->components as $component) {
$components[] = $component + rand() * 2 * $level - $level;
}
$this->components = $components;
return $this;
} | [
"public",
"function",
"addNoise",
"(",
"$",
"level",
")",
"{",
"$",
"components",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"components",
"as",
"$",
"component",
")",
"{",
"$",
"components",
"[",
"]",
"=",
"$",
"component",
"+",... | Adds noise to this vector.
@param int $level Noise level.
@return Vector | [
"Adds",
"noise",
"to",
"this",
"vector",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L526-L533 |
227,645 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.add | public function add(Vector $v) {
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$components = array();
$otherComponents = $v->toArray();
foreach($this->components as $i => $component) {
$components[] = $component + $otherComponents[$... | php | public function add(Vector $v) {
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$components = array();
$otherComponents = $v->toArray();
foreach($this->components as $i => $component) {
$components[] = $component + $otherComponents[$... | [
"public",
"function",
"add",
"(",
"Vector",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dimension",
"!=",
"$",
"v",
"->",
"getDimensions",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Both vectors must have the same size\"",
")",
";",
... | Adds two vectors.
@param Vector $v A vector to add.
@return Vector | [
"Adds",
"two",
"vectors",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L592-L604 |
227,646 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.multiply | public function multiply($v) {
$components = array();
if(is_object($v)) {
if(!($v instanceof Vector)) {
throw new Exception('Unspupported data structure');
}
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$otherComponents ... | php | public function multiply($v) {
$components = array();
if(is_object($v)) {
if(!($v instanceof Vector)) {
throw new Exception('Unspupported data structure');
}
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$otherComponents ... | [
"public",
"function",
"multiply",
"(",
"$",
"v",
")",
"{",
"$",
"components",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"v",
")",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"v",
"instanceof",
"Vector",
")",
")",
"{",
"throw",
"new... | Multiplies two vectors or by a given scalar value.
@param mixed $v A vector or scalar value to multiply.
@return Vector | [
"Multiplies",
"two",
"vectors",
"or",
"by",
"a",
"given",
"scalar",
"value",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L612-L632 |
227,647 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.negate | public function negate() {
$components = array();
foreach($this->components as $index => $component) {
$components[$index] = -$component;
}
$this->components = $components;
return $this;
} | php | public function negate() {
$components = array();
foreach($this->components as $index => $component) {
$components[$index] = -$component;
}
$this->components = $components;
return $this;
} | [
"public",
"function",
"negate",
"(",
")",
"{",
"$",
"components",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"components",
"as",
"$",
"index",
"=>",
"$",
"component",
")",
"{",
"$",
"components",
"[",
"$",
"index",
"]",
"=",
"-... | Negates this vector.
@return Vector | [
"Negates",
"this",
"vector",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L639-L647 |
227,648 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.getSubstractedLength | public function getSubstractedLength(Vector $v) {
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$j = 0;
$otherComponents = $v->toArray();
foreach($this->components as $i => $component) {
$value = $component - $otherComponents[$i];
... | php | public function getSubstractedLength(Vector $v) {
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$j = 0;
$otherComponents = $v->toArray();
foreach($this->components as $i => $component) {
$value = $component - $otherComponents[$i];
... | [
"public",
"function",
"getSubstractedLength",
"(",
"Vector",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dimension",
"!=",
"$",
"v",
"->",
"getDimensions",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Both vectors must have the same size\"",... | Returns substracted length
@param Vector $v A vector to substract
@return float | [
"Returns",
"substracted",
"length"
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L675-L688 |
227,649 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.equals | public function equals(Vector $v) {
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$otherComponents = $v->toArray();
$ret = true;
for($i = 0; $ret && $i < $this->dimension; ++$i) {
$ret = ($this->components[$i] == $otherComponents[$i... | php | public function equals(Vector $v) {
if($this->dimension != $v->getDimensions()) {
throw new Exception("Both vectors must have the same size");
}
$otherComponents = $v->toArray();
$ret = true;
for($i = 0; $ret && $i < $this->dimension; ++$i) {
$ret = ($this->components[$i] == $otherComponents[$i... | [
"public",
"function",
"equals",
"(",
"Vector",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dimension",
"!=",
"$",
"v",
"->",
"getDimensions",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Both vectors must have the same size\"",
")",
";",... | Compares two vectors.
@param Vector $v
@return bool True if vectors are equal, false otherwise. | [
"Compares",
"two",
"vectors",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L696-L707 |
227,650 | artur-graniszewski/tigra-image-library | gd2imaging.php | Vector.normalize | public function normalize() {
$j = $this->getLength();
if($j === 0) {
throw new Exception('Cannot normalize zero length vector');
}
$j *= $j;
$components = array();
foreach($this->components as $component) {
$components[] = sqrt(($component * $component) / $j);
}
$this->components = $com... | php | public function normalize() {
$j = $this->getLength();
if($j === 0) {
throw new Exception('Cannot normalize zero length vector');
}
$j *= $j;
$components = array();
foreach($this->components as $component) {
$components[] = sqrt(($component * $component) / $j);
}
$this->components = $com... | [
"public",
"function",
"normalize",
"(",
")",
"{",
"$",
"j",
"=",
"$",
"this",
"->",
"getLength",
"(",
")",
";",
"if",
"(",
"$",
"j",
"===",
"0",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Cannot normalize zero length vector'",
")",
";",
"}",
"$",
... | Performs Vector normalization.
@return Vector | [
"Performs",
"Vector",
"normalization",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L714-L726 |
227,651 | artur-graniszewski/tigra-image-library | gd2imaging.php | Quantizator.addGlyph | public function addGlyph(Vector $v, $identifier = null) {
$v = $v->getCopy();
$v->setIdentifier($identifier);
$this->glyphs[] = $v;
return $this;
} | php | public function addGlyph(Vector $v, $identifier = null) {
$v = $v->getCopy();
$v->setIdentifier($identifier);
$this->glyphs[] = $v;
return $this;
} | [
"public",
"function",
"addGlyph",
"(",
"Vector",
"$",
"v",
",",
"$",
"identifier",
"=",
"null",
")",
"{",
"$",
"v",
"=",
"$",
"v",
"->",
"getCopy",
"(",
")",
";",
"$",
"v",
"->",
"setIdentifier",
"(",
"$",
"identifier",
")",
";",
"$",
"this",
"->... | Adds vector to the vectors database.
@param Vector $v Vector to add.
@param mixed $identifier Vector identifier.
@return Quantizator | [
"Adds",
"vector",
"to",
"the",
"vectors",
"database",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L784-L789 |
227,652 | artur-graniszewski/tigra-image-library | gd2imaging.php | Quantizator.findNearestEuklid | public function findNearestEuklid(Vector $v, $noise = 0) {
$minDimension = 1000000;
foreach($this->glyphs as $index => $w) {
$w = $w->getCopy();
if($noise) {
$w = $w->addNoise($noise);
}
$dimension = $w->getSubstractedLength($v);
if($dimension < $minDimension) {
$ret = $w;
$... | php | public function findNearestEuklid(Vector $v, $noise = 0) {
$minDimension = 1000000;
foreach($this->glyphs as $index => $w) {
$w = $w->getCopy();
if($noise) {
$w = $w->addNoise($noise);
}
$dimension = $w->getSubstractedLength($v);
if($dimension < $minDimension) {
$ret = $w;
$... | [
"public",
"function",
"findNearestEuklid",
"(",
"Vector",
"$",
"v",
",",
"$",
"noise",
"=",
"0",
")",
"{",
"$",
"minDimension",
"=",
"1000000",
";",
"foreach",
"(",
"$",
"this",
"->",
"glyphs",
"as",
"$",
"index",
"=>",
"$",
"w",
")",
"{",
"$",
"w"... | Finds nearest euklid.
@param Vector $v Vector to compare.
@param int $noise Noise to add (default: 0 for no noise)
@return mixed[] array containing ID of the similar vector, and it's distance to the compared vector. | [
"Finds",
"nearest",
"euklid",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L798-L818 |
227,653 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.resize | public function resize($widthOrDimensions, $height = null, $useResampling = true) {
if(is_object($widthOrDimensions) && $widthOrDimensions instanceof Dimensions) {
$y = $widthOrDimensions->height;
$x = $widthOrDimensions->width;
} else {
$x = $widthOrDimensions;
$y = $height;
}
$newImage = i... | php | public function resize($widthOrDimensions, $height = null, $useResampling = true) {
if(is_object($widthOrDimensions) && $widthOrDimensions instanceof Dimensions) {
$y = $widthOrDimensions->height;
$x = $widthOrDimensions->width;
} else {
$x = $widthOrDimensions;
$y = $height;
}
$newImage = i... | [
"public",
"function",
"resize",
"(",
"$",
"widthOrDimensions",
",",
"$",
"height",
"=",
"null",
",",
"$",
"useResampling",
"=",
"true",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"widthOrDimensions",
")",
"&&",
"$",
"widthOrDimensions",
"instanceof",
"Dimen... | Resizes this image.
@param mixed $widthOrDimensions New width (or Dimensions) of the this image.
@param int $height New height of this image (used only if $widthOrDimensions is not an instance of Dimensions class)
@param bool Use resampling? Default: true (slower)
@return Image | [
"Resizes",
"this",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1003-L1020 |
227,654 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.resizeAndKeepAspect | public function resizeAndKeepAspect($widthOrDimensions, $height = null, $useResampling = true) {
if(is_object($widthOrDimensions) && $widthOrDimensions instanceof Dimensions) {
$y = $widthOrDimensions->height;
$x = $widthOrDimensions->width;
} else {
$x = $widthOrDimensions;
$y = $height;
}
... | php | public function resizeAndKeepAspect($widthOrDimensions, $height = null, $useResampling = true) {
if(is_object($widthOrDimensions) && $widthOrDimensions instanceof Dimensions) {
$y = $widthOrDimensions->height;
$x = $widthOrDimensions->width;
} else {
$x = $widthOrDimensions;
$y = $height;
}
... | [
"public",
"function",
"resizeAndKeepAspect",
"(",
"$",
"widthOrDimensions",
",",
"$",
"height",
"=",
"null",
",",
"$",
"useResampling",
"=",
"true",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"widthOrDimensions",
")",
"&&",
"$",
"widthOrDimensions",
"instance... | Resizes this image and keeps the image aspect.
@param mixed $widthOrDimensions New width (or Dimensions) of the this image.
@param int $height New height of this image (used only if $widthOrDimensions is not an instance of Dimensions class)
@param bool Use resampling? Default: true (slower)
@return Image | [
"Resizes",
"this",
"image",
"and",
"keeps",
"the",
"image",
"aspect",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1030-L1053 |
227,655 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.rescale | public function rescale($x, $y) {
if(is_object($x) && $x instanceof Dimensions) {
$y = $x->height;
$x = $x->width;
}
$newImage = imagecreatetruecolor($this->width * $x, $this->height * $y);
$x = imagesx($newImage);
$y = imagesy($newImage);
imagecopyresampled($newImage, $this->image, 0, 0, 0, 0... | php | public function rescale($x, $y) {
if(is_object($x) && $x instanceof Dimensions) {
$y = $x->height;
$x = $x->width;
}
$newImage = imagecreatetruecolor($this->width * $x, $this->height * $y);
$x = imagesx($newImage);
$y = imagesy($newImage);
imagecopyresampled($newImage, $this->image, 0, 0, 0, 0... | [
"public",
"function",
"rescale",
"(",
"$",
"x",
",",
"$",
"y",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"x",
")",
"&&",
"$",
"x",
"instanceof",
"Dimensions",
")",
"{",
"$",
"y",
"=",
"$",
"x",
"->",
"height",
";",
"$",
"x",
"=",
"$",
"x",
... | Scales this image.
@return Image | [
"Scales",
"this",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1060-L1072 |
227,656 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getPointRgb | public function getPointRgb(Point $position) {
return imagecolorat($this->image, $position->x, $position->y);
} | php | public function getPointRgb(Point $position) {
return imagecolorat($this->image, $position->x, $position->y);
} | [
"public",
"function",
"getPointRgb",
"(",
"Point",
"$",
"position",
")",
"{",
"return",
"imagecolorat",
"(",
"$",
"this",
"->",
"image",
",",
"$",
"position",
"->",
"x",
",",
"$",
"position",
"->",
"y",
")",
";",
"}"
] | Returns a RGB value of the pixel at the coordinates described in the Point object.
@param Point $position Position of the pixel to check.
@return int RGB value of the pixel. | [
"Returns",
"a",
"RGB",
"value",
"of",
"the",
"pixel",
"at",
"the",
"coordinates",
"described",
"in",
"the",
"Point",
"object",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1102-L1104 |
227,657 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getPointColor | public function getPointColor(Point $position) {
return new Color(imagecolorat($this->image, $position->x, $position->y));
} | php | public function getPointColor(Point $position) {
return new Color(imagecolorat($this->image, $position->x, $position->y));
} | [
"public",
"function",
"getPointColor",
"(",
"Point",
"$",
"position",
")",
"{",
"return",
"new",
"Color",
"(",
"imagecolorat",
"(",
"$",
"this",
"->",
"image",
",",
"$",
"position",
"->",
"x",
",",
"$",
"position",
"->",
"y",
")",
")",
";",
"}"
] | Returns a color of the pixel at the coordinates described in the Point object.
@param Point $position Position of the pixel to check.
@return Color Object describing the color of the pixel. | [
"Returns",
"a",
"color",
"of",
"the",
"pixel",
"at",
"the",
"coordinates",
"described",
"in",
"the",
"Point",
"object",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1112-L1114 |
227,658 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.setPointColor | public function setPointColor(Point $position, Color $color) {
imagesetpixel($this->image, $position->x, $position->y, $color->rgb);
return $this;
} | php | public function setPointColor(Point $position, Color $color) {
imagesetpixel($this->image, $position->x, $position->y, $color->rgb);
return $this;
} | [
"public",
"function",
"setPointColor",
"(",
"Point",
"$",
"position",
",",
"Color",
"$",
"color",
")",
"{",
"imagesetpixel",
"(",
"$",
"this",
"->",
"image",
",",
"$",
"position",
"->",
"x",
",",
"$",
"position",
"->",
"y",
",",
"$",
"color",
"->",
"... | Sets a color of the pixel at the coordinates described in the Point object.
@param Point $position Position of the pixel to set.
@return Image | [
"Sets",
"a",
"color",
"of",
"the",
"pixel",
"at",
"the",
"coordinates",
"described",
"in",
"the",
"Point",
"object",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1122-L1125 |
227,659 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.setPointRgb | public function setPointRgb(Point $position, $rgb) {
imagesetpixel($this->image, $position->x, $position->y, $rgb);
return $this;
} | php | public function setPointRgb(Point $position, $rgb) {
imagesetpixel($this->image, $position->x, $position->y, $rgb);
return $this;
} | [
"public",
"function",
"setPointRgb",
"(",
"Point",
"$",
"position",
",",
"$",
"rgb",
")",
"{",
"imagesetpixel",
"(",
"$",
"this",
"->",
"image",
",",
"$",
"position",
"->",
"x",
",",
"$",
"position",
"->",
"y",
",",
"$",
"rgb",
")",
";",
"return",
... | Sets a RGB value of the pixel at the coordinates described in the Point object.
@param Point $position Position of the pixel to set.
@return Image | [
"Sets",
"a",
"RGB",
"value",
"of",
"the",
"pixel",
"at",
"the",
"coordinates",
"described",
"in",
"the",
"Point",
"object",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1133-L1136 |
227,660 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.setPixelColor | public function setPixelColor($x, $y, Color $color) {
imagesetpixel($this->image, $x, $y, $color->rgb);
return $this;
} | php | public function setPixelColor($x, $y, Color $color) {
imagesetpixel($this->image, $x, $y, $color->rgb);
return $this;
} | [
"public",
"function",
"setPixelColor",
"(",
"$",
"x",
",",
"$",
"y",
",",
"Color",
"$",
"color",
")",
"{",
"imagesetpixel",
"(",
"$",
"this",
"->",
"image",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"color",
"->",
"rgb",
")",
";",
"return",
"$",
... | Sets a color of the pixel at the X,Y coordinates.
@param int $x X-coordinate of the pixel to set.
@param int $y Y-coordinate of the pixel to set.
@return Image | [
"Sets",
"a",
"color",
"of",
"the",
"pixel",
"at",
"the",
"X",
"Y",
"coordinates",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1145-L1148 |
227,661 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.setPixelRgb | public function setPixelRgb($x, $y, $rgb) {
imagesetpixel($this->image, $x, $y, $rgb);
return $this;
} | php | public function setPixelRgb($x, $y, $rgb) {
imagesetpixel($this->image, $x, $y, $rgb);
return $this;
} | [
"public",
"function",
"setPixelRgb",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"rgb",
")",
"{",
"imagesetpixel",
"(",
"$",
"this",
"->",
"image",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"rgb",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets a RGB value of the pixel at the X,Y coordinates.
@param int $x X-coordinate of the pixel to set.
@param int $y Y-coordinate of the pixel to set.
@return Image | [
"Sets",
"a",
"RGB",
"value",
"of",
"the",
"pixel",
"at",
"the",
"X",
"Y",
"coordinates",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1157-L1160 |
227,662 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getSubImage | public function getSubImage(Point $position, Dimensions $size) {
return new Image(null, $this->image, $position, $size);
} | php | public function getSubImage(Point $position, Dimensions $size) {
return new Image(null, $this->image, $position, $size);
} | [
"public",
"function",
"getSubImage",
"(",
"Point",
"$",
"position",
",",
"Dimensions",
"$",
"size",
")",
"{",
"return",
"new",
"Image",
"(",
"null",
",",
"$",
"this",
"->",
"image",
",",
"$",
"position",
",",
"$",
"size",
")",
";",
"}"
] | Returns a sub image of this image.
@param Point $position
@param Dimensions $size
@return Image | [
"Returns",
"a",
"sub",
"image",
"of",
"this",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1188-L1190 |
227,663 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getVector | public function getVector(Point $position = null, Dimensions $size = null, $round = false, $colorMask = 0) {
if($position === null) {
$position = new Point(0, 0);
}
if($size === null) {
$size = $this->getDimensions();
}
$x = $position->x;
$y = $position->y;
$width = $size->width;
$height... | php | public function getVector(Point $position = null, Dimensions $size = null, $round = false, $colorMask = 0) {
if($position === null) {
$position = new Point(0, 0);
}
if($size === null) {
$size = $this->getDimensions();
}
$x = $position->x;
$y = $position->y;
$width = $size->width;
$height... | [
"public",
"function",
"getVector",
"(",
"Point",
"$",
"position",
"=",
"null",
",",
"Dimensions",
"$",
"size",
"=",
"null",
",",
"$",
"round",
"=",
"false",
",",
"$",
"colorMask",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"position",
"===",
"null",
")",
... | Creates a vector from a part of an image.
@param Point $position X,Y-coordinates of the left upper-most point of the image.
@param Dimensions $size Width and height of the image.
@param bool $round Round the values?
@param int $colorMask Color bitmask.
@return Vector | [
"Creates",
"a",
"vector",
"from",
"a",
"part",
"of",
"an",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1201-L1255 |
227,664 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.rotate | public function rotate($angle, $backgroundColor = -1) {
if($backgroundColor === -1) {
$backgroundColor = hexdec($this->getBackgroundColor()->getHexValue());
}
$this->image = imagerotate($this->image, $angle, (int) $backgroundColor);
$this->getSize();
return $this;
} | php | public function rotate($angle, $backgroundColor = -1) {
if($backgroundColor === -1) {
$backgroundColor = hexdec($this->getBackgroundColor()->getHexValue());
}
$this->image = imagerotate($this->image, $angle, (int) $backgroundColor);
$this->getSize();
return $this;
} | [
"public",
"function",
"rotate",
"(",
"$",
"angle",
",",
"$",
"backgroundColor",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"$",
"backgroundColor",
"===",
"-",
"1",
")",
"{",
"$",
"backgroundColor",
"=",
"hexdec",
"(",
"$",
"this",
"->",
"getBackgroundColor",
... | Rotates image by a given angle.
@param int $angle Angle in degrees (not radians).
@param int $backgroundColor Backround color used to fill empty spaces after rotation (or -1 for autodetection).
@return Image | [
"Rotates",
"image",
"by",
"a",
"given",
"angle",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1273-L1280 |
227,665 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.crop | public function crop(Point $position, Dimensions $dimensions) {
$newImage = imagecreate($dimensions->width, $dimensions->height);
imagecopy($newImage, $this->image, 0, 0, $position->x, $position->y, $dimensions->width, $dimensions->height);
$this->image = $newImage;
$this->getSize();
$this->position = $p... | php | public function crop(Point $position, Dimensions $dimensions) {
$newImage = imagecreate($dimensions->width, $dimensions->height);
imagecopy($newImage, $this->image, 0, 0, $position->x, $position->y, $dimensions->width, $dimensions->height);
$this->image = $newImage;
$this->getSize();
$this->position = $p... | [
"public",
"function",
"crop",
"(",
"Point",
"$",
"position",
",",
"Dimensions",
"$",
"dimensions",
")",
"{",
"$",
"newImage",
"=",
"imagecreate",
"(",
"$",
"dimensions",
"->",
"width",
",",
"$",
"dimensions",
"->",
"height",
")",
";",
"imagecopy",
"(",
"... | Crops current image.
@param Point $position Position of the upper left point of the area to crop.
@param Dimensions $dimensions Size of the area to crop.
@return Image | [
"Crops",
"current",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1388-L1395 |
227,666 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.tiltAndCompare | private function tiltAndCompare(Image $otherImage, $minAngle = -20, $maxAngle = 20, $backgroundColor = 0xffffff, &$minDimension) {
if($minAngle > $maxAngle) {
$tmp = $maxAngle;
$maxAngle = $minAngle;
$minAngle = $tmp;
}
$quantization = new Quantizator();
$vector = $otherImage->getVector(new Po... | php | private function tiltAndCompare(Image $otherImage, $minAngle = -20, $maxAngle = 20, $backgroundColor = 0xffffff, &$minDimension) {
if($minAngle > $maxAngle) {
$tmp = $maxAngle;
$maxAngle = $minAngle;
$minAngle = $tmp;
}
$quantization = new Quantizator();
$vector = $otherImage->getVector(new Po... | [
"private",
"function",
"tiltAndCompare",
"(",
"Image",
"$",
"otherImage",
",",
"$",
"minAngle",
"=",
"-",
"20",
",",
"$",
"maxAngle",
"=",
"20",
",",
"$",
"backgroundColor",
"=",
"0xffffff",
",",
"&",
"$",
"minDimension",
")",
"{",
"if",
"(",
"$",
"min... | Experimental functionality, do not use!.
@param Image $otherImage
@param mixed $minAngle
@param mixed $maxAngle
@param mixed $backgroundColor
@param mixed $minDimension | [
"Experimental",
"functionality",
"do",
"not",
"use!",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1406-L1441 |
227,667 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.show | public function show($die = false) {
header('Content-Type: image/png');
imagepng($this->image);
if($die) {
die();
}
return $this;
} | php | public function show($die = false) {
header('Content-Type: image/png');
imagepng($this->image);
if($die) {
die();
}
return $this;
} | [
"public",
"function",
"show",
"(",
"$",
"die",
"=",
"false",
")",
"{",
"header",
"(",
"'Content-Type: image/png'",
")",
";",
"imagepng",
"(",
"$",
"this",
"->",
"image",
")",
";",
"if",
"(",
"$",
"die",
")",
"{",
"die",
"(",
")",
";",
"}",
"return"... | Displays the image.
@param bool $die Die after displaying an image? Default: false
@return Image | [
"Displays",
"the",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1473-L1480 |
227,668 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.deskew | public function deskew($backgroundColor = -1, $precisionLevel = true, $debugMode = false) {
// detect the background color
if($backgroundColor < 0) {
$backgroundColor = hexdec($this->getBackgroundColor(1, $precisionLevel === true)->getHexValue());
}
// calculate a Hough matrix and get the skew angle
... | php | public function deskew($backgroundColor = -1, $precisionLevel = true, $debugMode = false) {
// detect the background color
if($backgroundColor < 0) {
$backgroundColor = hexdec($this->getBackgroundColor(1, $precisionLevel === true)->getHexValue());
}
// calculate a Hough matrix and get the skew angle
... | [
"public",
"function",
"deskew",
"(",
"$",
"backgroundColor",
"=",
"-",
"1",
",",
"$",
"precisionLevel",
"=",
"true",
",",
"$",
"debugMode",
"=",
"false",
")",
"{",
"// detect the background color\r",
"if",
"(",
"$",
"backgroundColor",
"<",
"0",
")",
"{",
"... | Deskews the image.
@param int $backgroundColor Color of the background to use, or -1 (default) to use auto detection.
@param bool $precisionLevel Set true or 1 to enable turbo mode (may be less accurate) or use 2-4 values to increase the deskew precision.
@param bool $debugMode Set true to enable the debug mode.
@retu... | [
"Deskews",
"the",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1523-L1544 |
227,669 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getSize | public function getSize() {
list($this->width, $this->height) = $result = array(imagesx($this->image), imagesy($this->image));
return $result;
} | php | public function getSize() {
list($this->width, $this->height) = $result = array(imagesx($this->image), imagesy($this->image));
return $result;
} | [
"public",
"function",
"getSize",
"(",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"width",
",",
"$",
"this",
"->",
"height",
")",
"=",
"$",
"result",
"=",
"array",
"(",
"imagesx",
"(",
"$",
"this",
"->",
"image",
")",
",",
"imagesy",
"(",
"$",
"thi... | Calculates the size of this image.
@return int[] An array containing a width and height of this image. | [
"Calculates",
"the",
"size",
"of",
"this",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1551-L1554 |
227,670 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.drawHoughLine | protected function drawHoughLine($distance, $theta, $color = 111111) {
if($theta === 0 || $theta === 360) {
return $this;
}
$theta = deg2rad($theta);
$sizeX2 = $this->width / 2;
$sizeY2 = $this->height / 2;
for($x = 0; $x< $this->width; ++$x) {
$y1 = (int)($distance / sin($theta) - ($x - $s... | php | protected function drawHoughLine($distance, $theta, $color = 111111) {
if($theta === 0 || $theta === 360) {
return $this;
}
$theta = deg2rad($theta);
$sizeX2 = $this->width / 2;
$sizeY2 = $this->height / 2;
for($x = 0; $x< $this->width; ++$x) {
$y1 = (int)($distance / sin($theta) - ($x - $s... | [
"protected",
"function",
"drawHoughLine",
"(",
"$",
"distance",
",",
"$",
"theta",
",",
"$",
"color",
"=",
"111111",
")",
"{",
"if",
"(",
"$",
"theta",
"===",
"0",
"||",
"$",
"theta",
"===",
"360",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
... | Draws the Hough line.
@param int $distance Distance from the origin.
@param int $theta Angle in degrees.
@return Image | [
"Draws",
"the",
"Hough",
"line",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L1980-L2000 |
227,671 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getBinaryBuffer | protected function getBinaryBuffer() {
// catch the GD2 output
ob_start();
// convert a (probably) color/greyscale image to the monochrome counterpart.
imagewbmp($this->image);
// catch contents of the WBMP file.
$wbmp = ob_get_clean();
// ignore 2 bytes of WBMP file header
$i = 2;
//... | php | protected function getBinaryBuffer() {
// catch the GD2 output
ob_start();
// convert a (probably) color/greyscale image to the monochrome counterpart.
imagewbmp($this->image);
// catch contents of the WBMP file.
$wbmp = ob_get_clean();
// ignore 2 bytes of WBMP file header
$i = 2;
//... | [
"protected",
"function",
"getBinaryBuffer",
"(",
")",
"{",
"// catch the GD2 output\r",
"ob_start",
"(",
")",
";",
"// convert a (probably) color/greyscale image to the monochrome counterpart.\r",
"imagewbmp",
"(",
"$",
"this",
"->",
"image",
")",
";",
"// catch contents of t... | Returns binary frame buffer of the current image.
In case of color/grayscale images, use Image::toBinary() first.
@param resource $image Image to binarize.
@return string String of chars. | [
"Returns",
"binary",
"frame",
"buffer",
"of",
"the",
"current",
"image",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2010-L2033 |
227,672 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.isBinaryBufferEmpty | public function isBinaryBufferEmpty($threshold = 0.01) {
$bin = $this->getBinaryBuffer();
// delete all empty bytes
if(strlen(trim($bin, chr(255))) / strlen($bin) < $threshold || strlen(trim($bin, chr(0))) / strlen($bin) < $threshold) {
// something is wrong, image is filled (almost) solid color.
retur... | php | public function isBinaryBufferEmpty($threshold = 0.01) {
$bin = $this->getBinaryBuffer();
// delete all empty bytes
if(strlen(trim($bin, chr(255))) / strlen($bin) < $threshold || strlen(trim($bin, chr(0))) / strlen($bin) < $threshold) {
// something is wrong, image is filled (almost) solid color.
retur... | [
"public",
"function",
"isBinaryBufferEmpty",
"(",
"$",
"threshold",
"=",
"0.01",
")",
"{",
"$",
"bin",
"=",
"$",
"this",
"->",
"getBinaryBuffer",
"(",
")",
";",
"// delete all empty bytes\r",
"if",
"(",
"strlen",
"(",
"trim",
"(",
"$",
"bin",
",",
"chr",
... | Detects if the binary buffer of this image is empty after conversion to two-colors mode.
Empty buffer may mean that the conversion failed.
@param double $threshold The threshold.
@return bool True if empty, false otherwise. | [
"Detects",
"if",
"the",
"binary",
"buffer",
"of",
"this",
"image",
"is",
"empty",
"after",
"conversion",
"to",
"two",
"-",
"colors",
"mode",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2043-L2051 |
227,673 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getHistogramData | public function getHistogramData($channels, $colorMode = Color::HSL) {
$colors = array_fill(0, 256, 0);
for($y = 0; $y < $this->height; ++$y) {
for($x = 0; $x < $this->width; ++$x) {
$rgb = imagecolorat($this->image, $x, $y);
$r = ($rgb >> 16) & 0xff;
$g = ($rgb >> 8) & 0xff;
$b = $rgb & 0... | php | public function getHistogramData($channels, $colorMode = Color::HSL) {
$colors = array_fill(0, 256, 0);
for($y = 0; $y < $this->height; ++$y) {
for($x = 0; $x < $this->width; ++$x) {
$rgb = imagecolorat($this->image, $x, $y);
$r = ($rgb >> 16) & 0xff;
$g = ($rgb >> 8) & 0xff;
$b = $rgb & 0... | [
"public",
"function",
"getHistogramData",
"(",
"$",
"channels",
",",
"$",
"colorMode",
"=",
"Color",
"::",
"HSL",
")",
"{",
"$",
"colors",
"=",
"array_fill",
"(",
"0",
",",
"256",
",",
"0",
")",
";",
"for",
"(",
"$",
"y",
"=",
"0",
";",
"$",
"y",... | Generate histogram data.
@param int $channels Channels to draw, possibilities: Channel::RGB (default), Channel::RED, Channel::GREEN, Channel::BLUE
@param int $colorMode Color mode for saturation (use Color::HSV, Color::HSI or Color::HSL as the value), default is Color::HSL
@return int[] Histogram data | [
"Generate",
"histogram",
"data",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2096-L2140 |
227,674 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.getHistogram | public function getHistogram($channels = Channel::RGB, $color = 0, $backgroundColor = 0xffffff, $turboMode = false) {
$colors = $colors2 = $this->getHistogramData($channels, $turboMode ? null : Color::HSL);
sort($colors2, SORT_NUMERIC);
$min = $colors2[0];
$max = $colors2[255];
$diff = $max - $min;
$r... | php | public function getHistogram($channels = Channel::RGB, $color = 0, $backgroundColor = 0xffffff, $turboMode = false) {
$colors = $colors2 = $this->getHistogramData($channels, $turboMode ? null : Color::HSL);
sort($colors2, SORT_NUMERIC);
$min = $colors2[0];
$max = $colors2[255];
$diff = $max - $min;
$r... | [
"public",
"function",
"getHistogram",
"(",
"$",
"channels",
"=",
"Channel",
"::",
"RGB",
",",
"$",
"color",
"=",
"0",
",",
"$",
"backgroundColor",
"=",
"0xffffff",
",",
"$",
"turboMode",
"=",
"false",
")",
"{",
"$",
"colors",
"=",
"$",
"colors2",
"=",
... | Creates an image histogram.
@param int $channels Channels to draw, possibilities: Channel::RGB (default), Channel::RED, Channel::GREEN, Channel::BLUE
@param int $color Foreground color.
@param int $backgroundColor Background color.
@param bool $turboMode Use turbo mode (less accurate).
@return Image A histogram image | [
"Creates",
"an",
"image",
"histogram",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2151-L2165 |
227,675 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.changeHsl | public function changeHsl($hueAngle = 0, $saturationFactor = 1, $luminanceFactor = 1) {
$hueAngle /= 360;
$this->useShader('
$hue += $args[0];
$saturation *= $args[1];
$luminance *= $args[2];
', array($hueAngle, $saturationFactor, $luminanceFactor));
return $this;
} | php | public function changeHsl($hueAngle = 0, $saturationFactor = 1, $luminanceFactor = 1) {
$hueAngle /= 360;
$this->useShader('
$hue += $args[0];
$saturation *= $args[1];
$luminance *= $args[2];
', array($hueAngle, $saturationFactor, $luminanceFactor));
return $this;
} | [
"public",
"function",
"changeHsl",
"(",
"$",
"hueAngle",
"=",
"0",
",",
"$",
"saturationFactor",
"=",
"1",
",",
"$",
"luminanceFactor",
"=",
"1",
")",
"{",
"$",
"hueAngle",
"/=",
"360",
";",
"$",
"this",
"->",
"useShader",
"(",
"'\r\n\t\t\t$hue += $args[0]... | Changes HSL values.
@param mixed $value
@return Image | [
"Changes",
"HSL",
"values",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2532-L2540 |
227,676 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.useMedian | public function useMedian($maskWidth = 3, $maskHeight = 3) {
// initialize scanline buffer
$scanLines = array();
// precalculate some variables for better performance
$maskWidth2 = (int)($maskWidth / 2);
$maskHeight2 = (int)($maskHeight / 2);
$maskMiddle = (int)(($maskWidth * $maskHeight) / 2);
$... | php | public function useMedian($maskWidth = 3, $maskHeight = 3) {
// initialize scanline buffer
$scanLines = array();
// precalculate some variables for better performance
$maskWidth2 = (int)($maskWidth / 2);
$maskHeight2 = (int)($maskHeight / 2);
$maskMiddle = (int)(($maskWidth * $maskHeight) / 2);
$... | [
"public",
"function",
"useMedian",
"(",
"$",
"maskWidth",
"=",
"3",
",",
"$",
"maskHeight",
"=",
"3",
")",
"{",
"// initialize scanline buffer\r",
"$",
"scanLines",
"=",
"array",
"(",
")",
";",
"// precalculate some variables for better performance\r",
"$",
"maskWid... | Uses median filter to reduce image noise.
@param int $maskWidth Width of the median mask (default: 3)
@param int $maskHeight Height of the median mask (default: 3)
@return Image This image. | [
"Uses",
"median",
"filter",
"to",
"reduce",
"image",
"noise",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2591-L2629 |
227,677 | artur-graniszewski/tigra-image-library | gd2imaging.php | Image.createImageMatrix | protected function createImageMatrix($size = 0, &$ratio) {
// create two-color image
$this->toBinary(false);
// rescale if necessary (for performance reasons)
if($size > 0 && ($this->width > $size || $this->height > $size)) {
if($this->width > $this->height) {
$ratio = $size / $this->width;
}... | php | protected function createImageMatrix($size = 0, &$ratio) {
// create two-color image
$this->toBinary(false);
// rescale if necessary (for performance reasons)
if($size > 0 && ($this->width > $size || $this->height > $size)) {
if($this->width > $this->height) {
$ratio = $size / $this->width;
}... | [
"protected",
"function",
"createImageMatrix",
"(",
"$",
"size",
"=",
"0",
",",
"&",
"$",
"ratio",
")",
"{",
"// create two-color image\r",
"$",
"this",
"->",
"toBinary",
"(",
"false",
")",
";",
"// rescale if necessary (for performance reasons)\r",
"if",
"(",
"$",... | Creates the image buffer used by the skew functions.
@param int $size Size of the matrix.
@param int $ratio Rescale ratio of this image (value is returned by this method)
@return string Binary frame buffer | [
"Creates",
"the",
"image",
"buffer",
"used",
"by",
"the",
"skew",
"functions",
"."
] | b9b97ea6890f76a957e9e3c74687edc2aa95b57e | https://github.com/artur-graniszewski/tigra-image-library/blob/b9b97ea6890f76a957e9e3c74687edc2aa95b57e/gd2imaging.php#L2714-L2760 |
227,678 | pagekit/razr | src/Extension/CoreExtension.php | CoreExtension.block | public function block($name, $value = null)
{
if ($value === null) {
return isset($this->blocks[$name]) ? $this->blocks[$name] : null;
}
$this->blocks[$name] = $value;
} | php | public function block($name, $value = null)
{
if ($value === null) {
return isset($this->blocks[$name]) ? $this->blocks[$name] : null;
}
$this->blocks[$name] = $value;
} | [
"public",
"function",
"block",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"blocks",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->"... | Gets or sets a block.
@param string $name
@param mixed $value
@return string | [
"Gets",
"or",
"sets",
"a",
"block",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Extension/CoreExtension.php#L60-L67 |
227,679 | pagekit/razr | src/Extension/CoreExtension.php | CoreExtension.startBlock | public function startBlock($name)
{
if (in_array($name, $this->openBlocks)) {
throw new InvalidArgumentException(sprintf('A block "%s" is already started.', $name));
}
$this->openBlocks[] = $name;
if (!isset($this->blocks[$name])) {
$this->blocks[$name] = nu... | php | public function startBlock($name)
{
if (in_array($name, $this->openBlocks)) {
throw new InvalidArgumentException(sprintf('A block "%s" is already started.', $name));
}
$this->openBlocks[] = $name;
if (!isset($this->blocks[$name])) {
$this->blocks[$name] = nu... | [
"public",
"function",
"startBlock",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"openBlocks",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'A block \"%s\" is already started.'... | Starts a block.
@param string $name
@throws InvalidArgumentException | [
"Starts",
"a",
"block",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Extension/CoreExtension.php#L75-L89 |
227,680 | pagekit/razr | src/Extension/CoreExtension.php | CoreExtension.endBlock | public function endBlock()
{
if (!$this->openBlocks) {
throw new RuntimeException('No block started.');
}
$name = array_pop($this->openBlocks);
$value = ob_get_clean();
if ($this->blocks[$name] === null) {
$this->blocks[$name] = $value;
}
... | php | public function endBlock()
{
if (!$this->openBlocks) {
throw new RuntimeException('No block started.');
}
$name = array_pop($this->openBlocks);
$value = ob_get_clean();
if ($this->blocks[$name] === null) {
$this->blocks[$name] = $value;
}
... | [
"public",
"function",
"endBlock",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"openBlocks",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'No block started.'",
")",
";",
"}",
"$",
"name",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"openBlocks"... | Stops a block.
@throws RuntimeException
@return string | [
"Stops",
"a",
"block",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Extension/CoreExtension.php#L97-L111 |
227,681 | pagekit/razr | src/Extension/CoreExtension.php | CoreExtension.getConstant | public function getConstant($name, $object = null)
{
if ($object !== null) {
$name = sprintf('%s::%s', get_class($object), $name);
}
return constant($name);
} | php | public function getConstant($name, $object = null)
{
if ($object !== null) {
$name = sprintf('%s::%s', get_class($object), $name);
}
return constant($name);
} | [
"public",
"function",
"getConstant",
"(",
"$",
"name",
",",
"$",
"object",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"object",
"!==",
"null",
")",
"{",
"$",
"name",
"=",
"sprintf",
"(",
"'%s::%s'",
",",
"get_class",
"(",
"$",
"object",
")",
",",
"$",
... | Gets a constant from an object.
@param string $name
@param object $object
@return mixed | [
"Gets",
"a",
"constant",
"from",
"an",
"object",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Extension/CoreExtension.php#L131-L138 |
227,682 | alhoqbani/ar-php | src/ArUtil/I18N/CharsetD.php | CharsetD.getCharset | public function getCharset($string)
{
if (preg_match('/<meta .* charset=([^\"]+)".*>/sim', $string, $matches)) {
$value = $matches[1];
} else {
$charset = $this->guess($string);
arsort($charset);
$value = key($charset);
}
return $value... | php | public function getCharset($string)
{
if (preg_match('/<meta .* charset=([^\"]+)".*>/sim', $string, $matches)) {
$value = $matches[1];
} else {
$charset = $this->guess($string);
arsort($charset);
$value = key($charset);
}
return $value... | [
"public",
"function",
"getCharset",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/<meta .* charset=([^\\\"]+)\".*>/sim'",
",",
"$",
"string",
",",
"$",
"matches",
")",
")",
"{",
"$",
"value",
"=",
"$",
"matches",
"[",
"1",
"]",
";",
"}",... | Find the most possible character set for given Arabic string in unknown
format
@param String $string Arabic string in unknown format
@return String The most possible character set for given Arabic string in
unknown format[utf-8|windows-1256|iso-8859-6]
@author Khaled Al-Sham'aa <khaled@ar-php.org> | [
"Find",
"the",
"most",
"possible",
"character",
"set",
"for",
"given",
"Arabic",
"string",
"in",
"unknown",
"format"
] | 27a451d79591f7e49a300e97e3b32ecf24934c86 | https://github.com/alhoqbani/ar-php/blob/27a451d79591f7e49a300e97e3b32ecf24934c86/src/ArUtil/I18N/CharsetD.php#L144-L155 |
227,683 | authlete/authlete-php | src/Types/EnumTrait.php | EnumTrait.valueOf | public static function valueOf($value)
{
if ($value instanceof self)
{
return $value;
}
if (is_null($value))
{
return null;
}
$class = get_called_class();
if (!is_string($value))
{
throw new \InvalidArgume... | php | public static function valueOf($value)
{
if ($value instanceof self)
{
return $value;
}
if (is_null($value))
{
return null;
}
$class = get_called_class();
if (!is_string($value))
{
throw new \InvalidArgume... | [
"public",
"static",
"function",
"valueOf",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"self",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
... | Get an instance of this class that the given argument represents.
If the given argument is an instance of this class, the instance
itself is returned.
Otherwise, if the given argument is `null`, `null` is returned.
Otherwise, if the type of the given argument is not `string`,
an `InvalidArgumentException` is returne... | [
"Get",
"an",
"instance",
"of",
"this",
"class",
"that",
"the",
"given",
"argument",
"represents",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Types/EnumTrait.php#L109-L137 |
227,684 | alhoqbani/ar-php | src/ArUtil/I18N/Arabic.php | Arabic.load | public function load($library)
{
if ($this->_compatibleMode
&& array_key_exists($library, $this->_compatible)
) {
$library = $this->_compatible[$library];
}
$library = "\\ArUtil\\I18N\\$library";
$this->myFile = $library;
$this->myClass = $lib... | php | public function load($library)
{
if ($this->_compatibleMode
&& array_key_exists($library, $this->_compatible)
) {
$library = $this->_compatible[$library];
}
$library = "\\ArUtil\\I18N\\$library";
$this->myFile = $library;
$this->myClass = $lib... | [
"public",
"function",
"load",
"(",
"$",
"library",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_compatibleMode",
"&&",
"array_key_exists",
"(",
"$",
"library",
",",
"$",
"this",
"->",
"_compatible",
")",
")",
"{",
"$",
"library",
"=",
"$",
"this",
"->",
... | Load selected Arabic library and create an instance of its class
@param string $library Library name
@return null
@author Khaled Al-Shamaa <khaled@ar-php.org> | [
"Load",
"selected",
"Arabic",
"library",
"and",
"create",
"an",
"instance",
"of",
"its",
"class"
] | 27a451d79591f7e49a300e97e3b32ecf24934c86 | https://github.com/alhoqbani/ar-php/blob/27a451d79591f7e49a300e97e3b32ecf24934c86/src/ArUtil/I18N/Arabic.php#L217-L238 |
227,685 | alhoqbani/ar-php | src/ArUtil/I18N/Arabic.php | Arabic.setInputCharset | public function setInputCharset($charset)
{
$flag = true;
$charset = strtolower($charset);
$charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6');
if (in_array($charset, $charsets)) {
if ($charset == 'windows-1256') {
$charse... | php | public function setInputCharset($charset)
{
$flag = true;
$charset = strtolower($charset);
$charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6');
if (in_array($charset, $charsets)) {
if ($charset == 'windows-1256') {
$charse... | [
"public",
"function",
"setInputCharset",
"(",
"$",
"charset",
")",
"{",
"$",
"flag",
"=",
"true",
";",
"$",
"charset",
"=",
"strtolower",
"(",
"$",
"charset",
")",
";",
"$",
"charsets",
"=",
"array",
"(",
"'utf-8'",
",",
"'windows-1256'",
",",
"'cp1256'"... | Set charset used in class input Arabic strings
@param string $charset Input charset [utf-8|windows-1256|iso-8859-6]
@return TRUE if success, or FALSE if fail
@author Khaled Al-Shamaa <khaled@ar-php.org> | [
"Set",
"charset",
"used",
"in",
"class",
"input",
"Arabic",
"strings"
] | 27a451d79591f7e49a300e97e3b32ecf24934c86 | https://github.com/alhoqbani/ar-php/blob/27a451d79591f7e49a300e97e3b32ecf24934c86/src/ArUtil/I18N/Arabic.php#L342-L359 |
227,686 | alhoqbani/ar-php | src/ArUtil/I18N/Arabic.php | Arabic.setOutputCharset | public function setOutputCharset($charset)
{
$flag = true;
$charset = strtolower($charset);
$charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6');
if (in_array($charset, $charsets)) {
if ($charset == 'windows-1256') {
$chars... | php | public function setOutputCharset($charset)
{
$flag = true;
$charset = strtolower($charset);
$charsets = array('utf-8', 'windows-1256', 'cp1256', 'iso-8859-6');
if (in_array($charset, $charsets)) {
if ($charset == 'windows-1256') {
$chars... | [
"public",
"function",
"setOutputCharset",
"(",
"$",
"charset",
")",
"{",
"$",
"flag",
"=",
"true",
";",
"$",
"charset",
"=",
"strtolower",
"(",
"$",
"charset",
")",
";",
"$",
"charsets",
"=",
"array",
"(",
"'utf-8'",
",",
"'windows-1256'",
",",
"'cp1256'... | Set charset used in class output Arabic strings
@param string $charset Output charset [utf-8|windows-1256|iso-8859-6]
@return boolean TRUE if success, or FALSE if fail
@author Khaled Al-Shamaa <khaled@ar-php.org> | [
"Set",
"charset",
"used",
"in",
"class",
"output",
"Arabic",
"strings"
] | 27a451d79591f7e49a300e97e3b32ecf24934c86 | https://github.com/alhoqbani/ar-php/blob/27a451d79591f7e49a300e97e3b32ecf24934c86/src/ArUtil/I18N/Arabic.php#L369-L386 |
227,687 | jumilla/laravel-versionia | sources/Commands/DatabaseStatusCommand.php | DatabaseStatusCommand.showMigrations | protected function showMigrations(Migrator $migrator)
{
$this->line('<comment>Migrations</comment>');
$groups = $migrator->migrationGroups();
if (count($groups) > 0) {
// get [$group => $items]
$installed_migrations = $migrator->installedMigrationsByDesc();
... | php | protected function showMigrations(Migrator $migrator)
{
$this->line('<comment>Migrations</comment>');
$groups = $migrator->migrationGroups();
if (count($groups) > 0) {
// get [$group => $items]
$installed_migrations = $migrator->installedMigrationsByDesc();
... | [
"protected",
"function",
"showMigrations",
"(",
"Migrator",
"$",
"migrator",
")",
"{",
"$",
"this",
"->",
"line",
"(",
"'<comment>Migrations</comment>'",
")",
";",
"$",
"groups",
"=",
"$",
"migrator",
"->",
"migrationGroups",
"(",
")",
";",
"if",
"(",
"count... | Show migration infomation.
@param \Jumilla\Versionia\Laravel\Migrator $migrator | [
"Show",
"migration",
"infomation",
"."
] | 08ca0081c856c658d8b235c758c242b80b25da13 | https://github.com/jumilla/laravel-versionia/blob/08ca0081c856c658d8b235c758c242b80b25da13/sources/Commands/DatabaseStatusCommand.php#L48-L100 |
227,688 | jumilla/laravel-versionia | sources/Commands/DatabaseStatusCommand.php | DatabaseStatusCommand.showSeeds | protected function showSeeds(Migrator $migrator)
{
$this->line('<comment>Seeds</comment>');
$seeds = $migrator->seedNames();
if (count($seeds) > 0) {
$default_seed = $migrator->defaultSeed();
foreach ($seeds as $seed) {
$class = $migrator->seedClass... | php | protected function showSeeds(Migrator $migrator)
{
$this->line('<comment>Seeds</comment>');
$seeds = $migrator->seedNames();
if (count($seeds) > 0) {
$default_seed = $migrator->defaultSeed();
foreach ($seeds as $seed) {
$class = $migrator->seedClass... | [
"protected",
"function",
"showSeeds",
"(",
"Migrator",
"$",
"migrator",
")",
"{",
"$",
"this",
"->",
"line",
"(",
"'<comment>Seeds</comment>'",
")",
";",
"$",
"seeds",
"=",
"$",
"migrator",
"->",
"seedNames",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
... | Show seed infomation.
@param \Jumilla\Versionia\Laravel\Migrator $migrator | [
"Show",
"seed",
"infomation",
"."
] | 08ca0081c856c658d8b235c758c242b80b25da13 | https://github.com/jumilla/laravel-versionia/blob/08ca0081c856c658d8b235c758c242b80b25da13/sources/Commands/DatabaseStatusCommand.php#L107-L141 |
227,689 | jumilla/laravel-versionia | sources/Commands/DatabaseRefreshCommand.php | DatabaseRefreshCommand.doRefresh | protected function doRefresh(Migrator $migrator)
{
// retreive installed versions
$installed_migrations = $migrator->installedMigrationsByDesc();
// downgrade
foreach ($installed_migrations as $group => $migrations) {
foreach ($migrations as $data) {
$thi... | php | protected function doRefresh(Migrator $migrator)
{
// retreive installed versions
$installed_migrations = $migrator->installedMigrationsByDesc();
// downgrade
foreach ($installed_migrations as $group => $migrations) {
foreach ($migrations as $data) {
$thi... | [
"protected",
"function",
"doRefresh",
"(",
"Migrator",
"$",
"migrator",
")",
"{",
"// retreive installed versions",
"$",
"installed_migrations",
"=",
"$",
"migrator",
"->",
"installedMigrationsByDesc",
"(",
")",
";",
"// downgrade",
"foreach",
"(",
"$",
"installed_mig... | Execute clean and upgrade.
@param \Jumilla\Versionia\Laravel\Migrator $migrator | [
"Execute",
"clean",
"and",
"upgrade",
"."
] | 08ca0081c856c658d8b235c758c242b80b25da13 | https://github.com/jumilla/laravel-versionia/blob/08ca0081c856c658d8b235c758c242b80b25da13/sources/Commands/DatabaseRefreshCommand.php#L60-L82 |
227,690 | concrete5/doctrine-xml | src/Checker.php | Checker.checkString | public static function checkString($xml, $filename = '')
{
$doc = Utilities::stringToDOMDocument($xml, $filename);
$errors = null;
$preUseInternalErrors = libxml_use_internal_errors(true);
try {
if (!$doc->schemaValidateSource(static::getSchema())) {
$erro... | php | public static function checkString($xml, $filename = '')
{
$doc = Utilities::stringToDOMDocument($xml, $filename);
$errors = null;
$preUseInternalErrors = libxml_use_internal_errors(true);
try {
if (!$doc->schemaValidateSource(static::getSchema())) {
$erro... | [
"public",
"static",
"function",
"checkString",
"(",
"$",
"xml",
",",
"$",
"filename",
"=",
"''",
")",
"{",
"$",
"doc",
"=",
"Utilities",
"::",
"stringToDOMDocument",
"(",
"$",
"xml",
",",
"$",
"filename",
")",
";",
"$",
"errors",
"=",
"null",
";",
"$... | Check if an xml code satisfy the schema.
@param string $xml The xml code to verify
@param string $filename The name of the file from which the xml code has been read from
@return string[]|null Return null of all is ok, a list of errors otherwise | [
"Check",
"if",
"an",
"xml",
"code",
"satisfy",
"the",
"schema",
"."
] | 03f1209d42477070a58d29e5af15688b96c66b56 | https://github.com/concrete5/doctrine-xml/blob/03f1209d42477070a58d29e5af15688b96c66b56/src/Checker.php#L19-L36 |
227,691 | concrete5/doctrine-xml | src/Checker.php | Checker.checkFile | public static function checkFile($filename)
{
$fileContents = (is_file($filename) && is_readable($filename)) ? @file_get_contents($filename) : false;
if ($fileContents === false) {
throw new Exception('Failed to load the file '.$filename);
}
return static::checkString($f... | php | public static function checkFile($filename)
{
$fileContents = (is_file($filename) && is_readable($filename)) ? @file_get_contents($filename) : false;
if ($fileContents === false) {
throw new Exception('Failed to load the file '.$filename);
}
return static::checkString($f... | [
"public",
"static",
"function",
"checkFile",
"(",
"$",
"filename",
")",
"{",
"$",
"fileContents",
"=",
"(",
"is_file",
"(",
"$",
"filename",
")",
"&&",
"is_readable",
"(",
"$",
"filename",
")",
")",
"?",
"@",
"file_get_contents",
"(",
"$",
"filename",
")... | Check if an xml file satisfy the schema.
@param string $filename The name of the file to verify
@throws Exception
@return string[]|null Return null of all is ok, a list of errors otherwise | [
"Check",
"if",
"an",
"xml",
"file",
"satisfy",
"the",
"schema",
"."
] | 03f1209d42477070a58d29e5af15688b96c66b56 | https://github.com/concrete5/doctrine-xml/blob/03f1209d42477070a58d29e5af15688b96c66b56/src/Checker.php#L46-L54 |
227,692 | concrete5/doctrine-xml | src/Checker.php | Checker.getSchema | protected static function getSchema()
{
static $cache = null;
if (!isset($cache)) {
$schemaFile = __DIR__.'/doctrine-xml-0.5.xsd';
$s = (is_file($schemaFile) && is_readable($schemaFile)) ? @file_get_contents($schemaFile) : false;
if ($s === false) {
... | php | protected static function getSchema()
{
static $cache = null;
if (!isset($cache)) {
$schemaFile = __DIR__.'/doctrine-xml-0.5.xsd';
$s = (is_file($schemaFile) && is_readable($schemaFile)) ? @file_get_contents($schemaFile) : false;
if ($s === false) {
... | [
"protected",
"static",
"function",
"getSchema",
"(",
")",
"{",
"static",
"$",
"cache",
"=",
"null",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"cache",
")",
")",
"{",
"$",
"schemaFile",
"=",
"__DIR__",
".",
"'/doctrine-xml-0.5.xsd'",
";",
"$",
"s",
"=",
... | Returns the xml schema.
@throws Exception Throws an Exception if the xsd file couldn't be read.
@return string | [
"Returns",
"the",
"xml",
"schema",
"."
] | 03f1209d42477070a58d29e5af15688b96c66b56 | https://github.com/concrete5/doctrine-xml/blob/03f1209d42477070a58d29e5af15688b96c66b56/src/Checker.php#L62-L75 |
227,693 | pagekit/razr | src/Parser.php | Parser.parse | public function parse($stream, $filename = null)
{
$this->stream = $stream;
$this->filename = $filename;
$this->variables = array();
return $this->parseMain();
} | php | public function parse($stream, $filename = null)
{
$this->stream = $stream;
$this->filename = $filename;
$this->variables = array();
return $this->parseMain();
} | [
"public",
"function",
"parse",
"(",
"$",
"stream",
",",
"$",
"filename",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"stream",
"=",
"$",
"stream",
";",
"$",
"this",
"->",
"filename",
"=",
"$",
"filename",
";",
"$",
"this",
"->",
"variables",
"=",
"ar... | Parsing method.
@param TokenStream $stream
@param string $filename
@return string | [
"Parsing",
"method",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Parser.php#L29-L36 |
227,694 | pagekit/razr | src/Parser.php | Parser.parseMain | public function parseMain()
{
$out = '';
while ($token = $this->stream->next()) {
if ($token->test(T_COMMENT, '/* OUTPUT */')) {
$out .= $this->parseOutput();
} elseif ($token->test(T_COMMENT, '/* DIRECTIVE */')) {
$out .= $this->parseDirectiv... | php | public function parseMain()
{
$out = '';
while ($token = $this->stream->next()) {
if ($token->test(T_COMMENT, '/* OUTPUT */')) {
$out .= $this->parseOutput();
} elseif ($token->test(T_COMMENT, '/* DIRECTIVE */')) {
$out .= $this->parseDirectiv... | [
"public",
"function",
"parseMain",
"(",
")",
"{",
"$",
"out",
"=",
"''",
";",
"while",
"(",
"$",
"token",
"=",
"$",
"this",
"->",
"stream",
"->",
"next",
"(",
")",
")",
"{",
"if",
"(",
"$",
"token",
"->",
"test",
"(",
"T_COMMENT",
",",
"'/* OUTPU... | Parse main.
@return string | [
"Parse",
"main",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Parser.php#L43-L64 |
227,695 | pagekit/razr | src/Parser.php | Parser.parseDirective | public function parseDirective()
{
$out = '';
foreach ($this->engine->getDirectives() as $directive) {
if ($out = $directive->parse($this->stream, $this->stream->get())) {
break;
}
}
return $out;
} | php | public function parseDirective()
{
$out = '';
foreach ($this->engine->getDirectives() as $directive) {
if ($out = $directive->parse($this->stream, $this->stream->get())) {
break;
}
}
return $out;
} | [
"public",
"function",
"parseDirective",
"(",
")",
"{",
"$",
"out",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"engine",
"->",
"getDirectives",
"(",
")",
"as",
"$",
"directive",
")",
"{",
"if",
"(",
"$",
"out",
"=",
"$",
"directive",
"->",
"... | Parse directive.
@return string | [
"Parse",
"directive",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Parser.php#L87-L98 |
227,696 | pagekit/razr | src/Parser.php | Parser.parseExpression | public function parseExpression()
{
$out = '';
$brackets = array();
do {
if ($token = $this->stream->nextIf(T_STRING)) {
$name = $token->getValue();
if ($this->stream->test('(') && $this->engine->getFunction($name)) {
$out .... | php | public function parseExpression()
{
$out = '';
$brackets = array();
do {
if ($token = $this->stream->nextIf(T_STRING)) {
$name = $token->getValue();
if ($this->stream->test('(') && $this->engine->getFunction($name)) {
$out .... | [
"public",
"function",
"parseExpression",
"(",
")",
"{",
"$",
"out",
"=",
"''",
";",
"$",
"brackets",
"=",
"array",
"(",
")",
";",
"do",
"{",
"if",
"(",
"$",
"token",
"=",
"$",
"this",
"->",
"stream",
"->",
"nextIf",
"(",
"T_STRING",
")",
")",
"{"... | Parse expression.
@return string | [
"Parse",
"expression",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Parser.php#L105-L143 |
227,697 | pagekit/razr | src/Parser.php | Parser.parseSubscript | public function parseSubscript($out)
{
while (true) {
if ($this->stream->nextIf('.')) {
if (!$this->stream->test(T_STRING)) {
$this->stream->prev();
break;
}
$val = $this->stream->next()->getValue();
... | php | public function parseSubscript($out)
{
while (true) {
if ($this->stream->nextIf('.')) {
if (!$this->stream->test(T_STRING)) {
$this->stream->prev();
break;
}
$val = $this->stream->next()->getValue();
... | [
"public",
"function",
"parseSubscript",
"(",
"$",
"out",
")",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"->",
"nextIf",
"(",
"'.'",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stream",
"->",
"test",
"(",
... | Parse subscript.
@param string $out
@return string | [
"Parse",
"subscript",
"."
] | 5ba5e580bd71e0907e3966a122ac7b6869bac7f8 | https://github.com/pagekit/razr/blob/5ba5e580bd71e0907e3966a122ac7b6869bac7f8/src/Parser.php#L151-L189 |
227,698 | authlete/authlete-php | src/Dto/ServiceListResponse.php | ServiceListResponse.setServices | public function setServices(array $services = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$services', $services, __NAMESPACE__ . '\Service');
$this->services = $services;
return $this;
} | php | public function setServices(array $services = null)
{
ValidationUtility::ensureNullOrArrayOfType(
'$services', $services, __NAMESPACE__ . '\Service');
$this->services = $services;
return $this;
} | [
"public",
"function",
"setServices",
"(",
"array",
"$",
"services",
"=",
"null",
")",
"{",
"ValidationUtility",
"::",
"ensureNullOrArrayOfType",
"(",
"'$services'",
",",
"$",
"services",
",",
"__NAMESPACE__",
".",
"'\\Service'",
")",
";",
"$",
"this",
"->",
"s... | Set the list of services that match the query conditions.
@param Service[] $services
The list of services that match the query conditions.
@return ServiceListResponse
`$this` object. | [
"Set",
"the",
"list",
"of",
"services",
"that",
"match",
"the",
"query",
"conditions",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Dto/ServiceListResponse.php#L178-L186 |
227,699 | authlete/authlete-php | src/Util/ValidationUtility.php | ValidationUtility.ensureNullOrStringOrInteger | public static function ensureNullOrStringOrInteger($name, $value)
{
if (is_null($value) || is_string($value) || is_integer($value))
{
return;
}
throw new \InvalidArgumentException("'$name' must be null, a string or an integer.");
} | php | public static function ensureNullOrStringOrInteger($name, $value)
{
if (is_null($value) || is_string($value) || is_integer($value))
{
return;
}
throw new \InvalidArgumentException("'$name' must be null, a string or an integer.");
} | [
"public",
"static",
"function",
"ensureNullOrStringOrInteger",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
"||",
"is_string",
"(",
"$",
"value",
")",
"||",
"is_integer",
"(",
"$",
"value",
")",
")",
"{",... | Ensure that the given object is `null`, a `string` instance,
or an `integer` instance.
@param string $name
Name of a parameter.
@param integer $value
Value of a parameter.
@throws \InvalidArgumentException
`$value` is not `null`, a `string` instance or an `integer` instance. | [
"Ensure",
"that",
"the",
"given",
"object",
"is",
"null",
"a",
"string",
"instance",
"or",
"an",
"integer",
"instance",
"."
] | bfa05f52dd39c7be66378770e50e303d12b33fb6 | https://github.com/authlete/authlete-php/blob/bfa05f52dd39c7be66378770e50e303d12b33fb6/src/Util/ValidationUtility.php#L237-L245 |
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.