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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,800 | surebert/surebert-framework | src/sb/Request.php | Request.setInputArgsDelimiter | public function setInputArgsDelimiter($input_args_delimiter)
{
//parse arguments by removing path
$args = preg_replace("~^.{" . strlen($this->path) . "}/?~", "", $this->request);
//remove $_GET string
$args = preg_replace("~\?.*?$~", "", $args);
if ($args !== '') {
... | php | public function setInputArgsDelimiter($input_args_delimiter)
{
//parse arguments by removing path
$args = preg_replace("~^.{" . strlen($this->path) . "}/?~", "", $this->request);
//remove $_GET string
$args = preg_replace("~\?.*?$~", "", $args);
if ($args !== '') {
... | [
"public",
"function",
"setInputArgsDelimiter",
"(",
"$",
"input_args_delimiter",
")",
"{",
"//parse arguments by removing path",
"$",
"args",
"=",
"preg_replace",
"(",
"\"~^.{\"",
".",
"strlen",
"(",
"$",
"this",
"->",
"path",
")",
".",
"\"}/?~\"",
",",
"\"\"",
... | Sets the input argument delimeter and parses it
@param $input_args_delimiter | [
"Sets",
"the",
"input",
"argument",
"delimeter",
"and",
"parses",
"it"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Request.php#L138-L160 |
20,801 | surebert/surebert-framework | src/sb/Request.php | Request.getFile | public function getFile($key)
{
if (isset($this->files[$key])) {
return $this->files[$key];
}
return null;
} | php | public function getFile($key)
{
if (isset($this->files[$key])) {
return $this->files[$key];
}
return null;
} | [
"public",
"function",
"getFile",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"files",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"files",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"null",
";",
... | Gets a uploaded file reference, otherwise returns null
@param string $key The key to look for
@return array the file that was uploaded | [
"Gets",
"a",
"uploaded",
"file",
"reference",
"otherwise",
"returns",
"null"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Request.php#L290-L297 |
20,802 | rhosocial/yii2-user | UserSearch.php | UserSearch.gmdate | public function gmdate($attribute, $params, $validator)
{
if (isset($this->$attribute)) {
$timestamp = strtotime($this->$attribute);
$this->{$attribute . 'InUtc'} = gmdate('Y-m-d H:i:s', $timestamp);
}
} | php | public function gmdate($attribute, $params, $validator)
{
if (isset($this->$attribute)) {
$timestamp = strtotime($this->$attribute);
$this->{$attribute . 'InUtc'} = gmdate('Y-m-d H:i:s', $timestamp);
}
} | [
"public",
"function",
"gmdate",
"(",
"$",
"attribute",
",",
"$",
"params",
",",
"$",
"validator",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"$",
"attribute",
")",
")",
"{",
"$",
"timestamp",
"=",
"strtotime",
"(",
"$",
"this",
"->",
"$"... | Convert time attribute to UTC time.
@param string $attribute
@param array $params
@param mixed $validator | [
"Convert",
"time",
"attribute",
"to",
"UTC",
"time",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/UserSearch.php#L84-L90 |
20,803 | rhosocial/yii2-user | UserSearch.php | UserSearch.attributeLabels | public function attributeLabels()
{
$attributeLabels = parent::attributeLabels();
$attributeLabels['id'] = Yii::t('user', 'User ID');
$attributeLabels['nickname'] = Yii::t('user', 'Nickname');
$attributeLabels['first_name'] = Yii::t('user', 'First Name');
$attributeLabels['la... | php | public function attributeLabels()
{
$attributeLabels = parent::attributeLabels();
$attributeLabels['id'] = Yii::t('user', 'User ID');
$attributeLabels['nickname'] = Yii::t('user', 'Nickname');
$attributeLabels['first_name'] = Yii::t('user', 'First Name');
$attributeLabels['la... | [
"public",
"function",
"attributeLabels",
"(",
")",
"{",
"$",
"attributeLabels",
"=",
"parent",
"::",
"attributeLabels",
"(",
")",
";",
"$",
"attributeLabels",
"[",
"'id'",
"]",
"=",
"Yii",
"::",
"t",
"(",
"'user'",
",",
"'User ID'",
")",
";",
"$",
"attri... | Add `createdFrom` & `createdTo` attributes.
@return array | [
"Add",
"createdFrom",
"&",
"createdTo",
"attributes",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/UserSearch.php#L176-L187 |
20,804 | Danack/GithubArtaxService | lib/GithubService/GithubArtaxService/GithubArtaxService.php | GithubArtaxService.shouldResponseBeCached | public function shouldResponseBeCached(\Amp\Artax\Response $response) {
$status = $response->getStatus();
if ($status == 200) {
return true;
}
return false;
} | php | public function shouldResponseBeCached(\Amp\Artax\Response $response) {
$status = $response->getStatus();
if ($status == 200) {
return true;
}
return false;
} | [
"public",
"function",
"shouldResponseBeCached",
"(",
"\\",
"Amp",
"\\",
"Artax",
"\\",
"Response",
"$",
"response",
")",
"{",
"$",
"status",
"=",
"$",
"response",
"->",
"getStatus",
"(",
")",
";",
"if",
"(",
"$",
"status",
"==",
"200",
")",
"{",
"retur... | Determine whether the response should be cached.
@return boolean | [
"Determine",
"whether",
"the",
"response",
"should",
"be",
"cached",
"."
] | 9f62b5be4f413207d4012e7fa084d0ae505680eb | https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2574-L2581 |
20,805 | roshangara/parser | src/Parser.php | Parser.fromXml | public function fromXml(string $xml): array
{
if (!$this->isEmptyValue($xml)) {
libxml_use_internal_errors(true);
// convert string to xml object
$result = simplexml_load_string("$xml", 'SimpleXMLElement', LIBXML_NOCDATA);
if ($result) {
ret... | php | public function fromXml(string $xml): array
{
if (!$this->isEmptyValue($xml)) {
libxml_use_internal_errors(true);
// convert string to xml object
$result = simplexml_load_string("$xml", 'SimpleXMLElement', LIBXML_NOCDATA);
if ($result) {
ret... | [
"public",
"function",
"fromXml",
"(",
"string",
"$",
"xml",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEmptyValue",
"(",
"$",
"xml",
")",
")",
"{",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"// convert string to xml object",
"... | Convert xml to array
@param string $xml
@return array|mixed | [
"Convert",
"xml",
"to",
"array"
] | 24c6c3781fd4416fefb5218daad765b9edbcaa76 | https://github.com/roshangara/parser/blob/24c6c3781fd4416fefb5218daad765b9edbcaa76/src/Parser.php#L27-L57 |
20,806 | roshangara/parser | src/Parser.php | Parser.fromXSD | public function fromXSD($xsd): array
{
if (!$this->isEmptyValue($xsd)) {
return $this->fromXml($xsd->output);
}
return $this->result;
} | php | public function fromXSD($xsd): array
{
if (!$this->isEmptyValue($xsd)) {
return $this->fromXml($xsd->output);
}
return $this->result;
} | [
"public",
"function",
"fromXSD",
"(",
"$",
"xsd",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEmptyValue",
"(",
"$",
"xsd",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromXml",
"(",
"$",
"xsd",
"->",
"output",
")",
";",
"}",
... | Convert class to array
@param $xsd
@return array|mixed | [
"Convert",
"class",
"to",
"array"
] | 24c6c3781fd4416fefb5218daad765b9edbcaa76 | https://github.com/roshangara/parser/blob/24c6c3781fd4416fefb5218daad765b9edbcaa76/src/Parser.php#L81-L89 |
20,807 | roshangara/parser | src/Parser.php | Parser.fromJson | public function fromJson(string $json): array
{
if (!$this->isEmptyValue($json)) {
if ($decode = json_decode(trim($json), true) and json_last_error() == JSON_ERROR_NONE)
$this->result = $decode;
else
$this->setError(json_last_error(), json_last_error_... | php | public function fromJson(string $json): array
{
if (!$this->isEmptyValue($json)) {
if ($decode = json_decode(trim($json), true) and json_last_error() == JSON_ERROR_NONE)
$this->result = $decode;
else
$this->setError(json_last_error(), json_last_error_... | [
"public",
"function",
"fromJson",
"(",
"string",
"$",
"json",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEmptyValue",
"(",
"$",
"json",
")",
")",
"{",
"if",
"(",
"$",
"decode",
"=",
"json_decode",
"(",
"trim",
"(",
"$",
"json",
... | Convert json to array
@param string $json
@return array|mixed | [
"Convert",
"json",
"to",
"array"
] | 24c6c3781fd4416fefb5218daad765b9edbcaa76 | https://github.com/roshangara/parser/blob/24c6c3781fd4416fefb5218daad765b9edbcaa76/src/Parser.php#L112-L123 |
20,808 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.setSourceList | protected function setSourceList(array $sourceParameters, array $globalParameters = array())
{
// Creating as many Source instances as configured in the configuration file
foreach ($sourceParameters as $key => $parameters) {
if (!isset($parameters['type'])) {
throw new Ex... | php | protected function setSourceList(array $sourceParameters, array $globalParameters = array())
{
// Creating as many Source instances as configured in the configuration file
foreach ($sourceParameters as $key => $parameters) {
if (!isset($parameters['type'])) {
throw new Ex... | [
"protected",
"function",
"setSourceList",
"(",
"array",
"$",
"sourceParameters",
",",
"array",
"$",
"globalParameters",
"=",
"array",
"(",
")",
")",
"{",
"// Creating as many Source instances as configured in the configuration file",
"foreach",
"(",
"$",
"sourceParameters",... | Creates and adds to the Source object list all the configured Source instances
@param array $sourceParameters the configuration parameter array
@param array $globalParameters the global configuration parameter array
@throws \Msl\ResourceProxy\Exception\BadProxyConfigurationException
@return void | [
"Creates",
"and",
"adds",
"to",
"the",
"Source",
"object",
"list",
"all",
"the",
"configured",
"Source",
"instances"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L171-L211 |
20,809 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.processResources | public function processResources()
{
// Fetching the sources iterator
$errors = array();
foreach($this->sourcesIterator as $source) {
// Processing all resources associated to the current source object
if ($source instanceof SourceInterface) {
try {
... | php | public function processResources()
{
// Fetching the sources iterator
$errors = array();
foreach($this->sourcesIterator as $source) {
// Processing all resources associated to the current source object
if ($source instanceof SourceInterface) {
try {
... | [
"public",
"function",
"processResources",
"(",
")",
"{",
"// Fetching the sources iterator",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"sourcesIterator",
"as",
"$",
"source",
")",
"{",
"// Processing all resources associated to t... | Processes all resources associated to the configured source objects for a proxy implementation
@throws \Msl\ResourceProxy\Exception\GlobalProcessException
@return void | [
"Processes",
"all",
"resources",
"associated",
"to",
"the",
"configured",
"source",
"objects",
"for",
"a",
"proxy",
"implementation"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L222-L261 |
20,810 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.processResourcesBySource | public function processResourcesBySource(SourceInterface $source)
{
// Getting all resources for the given source and process them (save the content in the configured output folder)
// Getting result iterator
$resources = $this->getResources($source);
// Parsing the resource iterato... | php | public function processResourcesBySource(SourceInterface $source)
{
// Getting all resources for the given source and process them (save the content in the configured output folder)
// Getting result iterator
$resources = $this->getResources($source);
// Parsing the resource iterato... | [
"public",
"function",
"processResourcesBySource",
"(",
"SourceInterface",
"$",
"source",
")",
"{",
"// Getting all resources for the given source and process them (save the content in the configured output folder)",
"// Getting result iterator",
"$",
"resources",
"=",
"$",
"this",
"-... | Processes all resources associated to the given Source object
@param SourceInterface $source the source object to be processed
@throws \Msl\ResourceProxy\Exception\SourceGetDataException
@throws \Msl\ResourceProxy\Exception\PostParseException
@return bool | [
"Processes",
"all",
"resources",
"associated",
"to",
"the",
"given",
"Source",
"object"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L273-L344 |
20,811 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.processResourcesBySourceName | public function processResourcesBySourceName($sourceName)
{
// Getting source object
$source = $this->getSourceByName($sourceName);
if (!$source instanceof SourceInterface) {
throw new Exception\SourceNotFoundException(
$sourceName,
sprintf(
... | php | public function processResourcesBySourceName($sourceName)
{
// Getting source object
$source = $this->getSourceByName($sourceName);
if (!$source instanceof SourceInterface) {
throw new Exception\SourceNotFoundException(
$sourceName,
sprintf(
... | [
"public",
"function",
"processResourcesBySourceName",
"(",
"$",
"sourceName",
")",
"{",
"// Getting source object",
"$",
"source",
"=",
"$",
"this",
"->",
"getSourceByName",
"(",
"$",
"sourceName",
")",
";",
"if",
"(",
"!",
"$",
"source",
"instanceof",
"SourceIn... | Processes all resources associated to a Source object for the given source name
@param string $sourceName the source name to be processed
@return bool
@throws \Msl\ResourceProxy\Exception\SourceNotFoundException
@throws \Msl\ResourceProxy\Exception\SourceGetDataException
@throws \Msl\ResourceProxy\Exception\PostPars... | [
"Processes",
"all",
"resources",
"associated",
"to",
"a",
"Source",
"object",
"for",
"the",
"given",
"source",
"name"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L357-L373 |
20,812 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.getSourceByName | public function getSourceByName($sourceName)
{
if (isset($this->sources[$sourceName])) {
return $this->sources[$sourceName];
}
return null;
} | php | public function getSourceByName($sourceName)
{
if (isset($this->sources[$sourceName])) {
return $this->sources[$sourceName];
}
return null;
} | [
"public",
"function",
"getSourceByName",
"(",
"$",
"sourceName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"sources",
"[",
"$",
"sourceName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"sources",
"[",
"$",
"sourceName",
"]",
";",
"}... | Returns the Source object for the given source name
@param string $sourceName the source name
@return null|SourceInterface | [
"Returns",
"the",
"Source",
"object",
"for",
"the",
"given",
"source",
"name"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L439-L445 |
20,813 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.getResources | public function getResources(SourceInterface $source)
{
// Getting resources iterator
try {
return $source->getContentIterator();
} catch (\Exception $e) {
throw new Exception\SourceGetDataException(
sprintf(
'Exception caught while... | php | public function getResources(SourceInterface $source)
{
// Getting resources iterator
try {
return $source->getContentIterator();
} catch (\Exception $e) {
throw new Exception\SourceGetDataException(
sprintf(
'Exception caught while... | [
"public",
"function",
"getResources",
"(",
"SourceInterface",
"$",
"source",
")",
"{",
"// Getting resources iterator",
"try",
"{",
"return",
"$",
"source",
"->",
"getContentIterator",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
... | Returns an Iterator containing all the resources for the given source object
@param \Msl\ResourceProxy\Source\SourceInterface $source the source object
@throws \Msl\ResourceProxy\Exception\SourceGetDataException
@return null|Iterator | [
"Returns",
"an",
"Iterator",
"containing",
"all",
"the",
"resources",
"for",
"the",
"given",
"source",
"object"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L456-L469 |
20,814 | mslib/resource-proxy | Msl/ResourceProxy/Proxy/AbstractProxy.php | AbstractProxy.getResourcesBySourceName | public function getResourcesBySourceName($sourceName)
{
// Getting source object first
$source = $this->getSourceByName($sourceName);
// Getting the data
if ($source instanceof SourceInterface) {
// Getting result iterator
try {
return $source... | php | public function getResourcesBySourceName($sourceName)
{
// Getting source object first
$source = $this->getSourceByName($sourceName);
// Getting the data
if ($source instanceof SourceInterface) {
// Getting result iterator
try {
return $source... | [
"public",
"function",
"getResourcesBySourceName",
"(",
"$",
"sourceName",
")",
"{",
"// Getting source object first",
"$",
"source",
"=",
"$",
"this",
"->",
"getSourceByName",
"(",
"$",
"sourceName",
")",
";",
"// Getting the data",
"if",
"(",
"$",
"source",
"inst... | Returns an Iterator containing all the resources for the given source name
@param string $sourceName the source name
@throws \Msl\ResourceProxy\Exception\SourceGetDataException
@return null|Iterator | [
"Returns",
"an",
"Iterator",
"containing",
"all",
"the",
"resources",
"for",
"the",
"given",
"source",
"name"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L480-L500 |
20,815 | jasny/codeception-module | src/Module.php | Module.init | public function init()
{
$this->container = $this->initContainer();
if ($this->container->has(ServerRequestInterface::class)) {
$this->baseRequest = $this->container->get(ServerRequestInterface::class);
}
if ($this->container->has(ResponseInterface::class)) {
... | php | public function init()
{
$this->container = $this->initContainer();
if ($this->container->has(ServerRequestInterface::class)) {
$this->baseRequest = $this->container->get(ServerRequestInterface::class);
}
if ($this->container->has(ResponseInterface::class)) {
... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"$",
"this",
"->",
"initContainer",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"ServerRequestInterface",
"::",
"class",
")",
")",
"{",
... | Initialize the module | [
"Initialize",
"the",
"module"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L109-L120 |
20,816 | jasny/codeception-module | src/Module.php | Module._before | public function _before(TestInterface $test)
{
$this->init();
$this->client = new Connector();
$this->client->setRouter($this->container->get(RouterInterface::class));
if (isset($this->baseRequest)) {
$this->client->setBaseRequest($this->baseRequest);
}
... | php | public function _before(TestInterface $test)
{
$this->init();
$this->client = new Connector();
$this->client->setRouter($this->container->get(RouterInterface::class));
if (isset($this->baseRequest)) {
$this->client->setBaseRequest($this->baseRequest);
}
... | [
"public",
"function",
"_before",
"(",
"TestInterface",
"$",
"test",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"$",
"this",
"->",
"client",
"=",
"new",
"Connector",
"(",
")",
";",
"$",
"this",
"->",
"client",
"->",
"setRouter",
"(",
"$",
"... | Before each test
@param TestInterface $test | [
"Before",
"each",
"test"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L153-L169 |
20,817 | jasny/codeception-module | src/Module.php | Module._after | public function _after(TestInterface $test)
{
if ($this->sessionStatus() === PHP_SESSION_ACTIVE) {
$this->sessionDestroy();
}
if (isset($this->client) && $this->client instanceof Connector) {
$this->client->reset();
if (isset($this->baseReque... | php | public function _after(TestInterface $test)
{
if ($this->sessionStatus() === PHP_SESSION_ACTIVE) {
$this->sessionDestroy();
}
if (isset($this->client) && $this->client instanceof Connector) {
$this->client->reset();
if (isset($this->baseReque... | [
"public",
"function",
"_after",
"(",
"TestInterface",
"$",
"test",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sessionStatus",
"(",
")",
"===",
"PHP_SESSION_ACTIVE",
")",
"{",
"$",
"this",
"->",
"sessionDestroy",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(... | After each test
@param TestInterface $test | [
"After",
"each",
"test"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L176-L195 |
20,818 | jasny/codeception-module | src/Module.php | Module._failed | public function _failed(TestInterface $test, $fail)
{
if (isset($this->container) && $this->container->has(ErrorHandlerInterface::class)) {
$error = $this->container->get(ErrorHandlerInterface::class)->getError();
if ($error) {
$this->debug((string)$error... | php | public function _failed(TestInterface $test, $fail)
{
if (isset($this->container) && $this->container->has(ErrorHandlerInterface::class)) {
$error = $this->container->get(ErrorHandlerInterface::class)->getError();
if ($error) {
$this->debug((string)$error... | [
"public",
"function",
"_failed",
"(",
"TestInterface",
"$",
"test",
",",
"$",
"fail",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"container",
")",
"&&",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"ErrorHandlerInterface",
"::",
"class",
... | Called when test fails
@param TestInterface $test
@param mixed $fail | [
"Called",
"when",
"test",
"fails"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L203-L215 |
20,819 | wboyz/laravel-enum | src/BaseEnum.php | BaseEnum.getValue | public static function getValue($key)
{
$className = get_called_class();
$reflectionClass = new ReflectionClass($className);
if (! $reflectionClass->hasConstant($key)) {
return static::DEFAULT_VALUE;
}
return $reflectionClass->getConstant($key);
} | php | public static function getValue($key)
{
$className = get_called_class();
$reflectionClass = new ReflectionClass($className);
if (! $reflectionClass->hasConstant($key)) {
return static::DEFAULT_VALUE;
}
return $reflectionClass->getConstant($key);
} | [
"public",
"static",
"function",
"getValue",
"(",
"$",
"key",
")",
"{",
"$",
"className",
"=",
"get_called_class",
"(",
")",
";",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"if",
"(",
"!",
"$",
"reflectionClass",... | Returns an enum value by its key.
@return mixed | [
"Returns",
"an",
"enum",
"value",
"by",
"its",
"key",
"."
] | 7e34d4eca779e3764fb9b56f612db9bc0b54c9c2 | https://github.com/wboyz/laravel-enum/blob/7e34d4eca779e3764fb9b56f612db9bc0b54c9c2/src/BaseEnum.php#L16-L26 |
20,820 | wboyz/laravel-enum | src/BaseEnum.php | BaseEnum.toDictionary | public static function toDictionary()
{
$className = get_called_class();
$reflectionClass = new ReflectionClass($className);
$dictionary = $reflectionClass->getConstants();
unset($dictionary['DEFAULT_VALUE']);
return $dictionary;
} | php | public static function toDictionary()
{
$className = get_called_class();
$reflectionClass = new ReflectionClass($className);
$dictionary = $reflectionClass->getConstants();
unset($dictionary['DEFAULT_VALUE']);
return $dictionary;
} | [
"public",
"static",
"function",
"toDictionary",
"(",
")",
"{",
"$",
"className",
"=",
"get_called_class",
"(",
")",
";",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"$",
"dictionary",
"=",
"$",
"reflectionClass",
"... | Returns the enum as dictionary.
@return array | [
"Returns",
"the",
"enum",
"as",
"dictionary",
"."
] | 7e34d4eca779e3764fb9b56f612db9bc0b54c9c2 | https://github.com/wboyz/laravel-enum/blob/7e34d4eca779e3764fb9b56f612db9bc0b54c9c2/src/BaseEnum.php#L53-L62 |
20,821 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.connect | protected function connect()
{
$errno = null;
$errstr = null;
if ( $this->options->connectionType !== self::CONNECTION_PLAIN &&
!ezcBaseFeatures::hasExtensionSupport( 'openssl' ) )
{
throw new ezcBaseExtensionNotFoundException( 'openssl', null, "PHP not confi... | php | protected function connect()
{
$errno = null;
$errstr = null;
if ( $this->options->connectionType !== self::CONNECTION_PLAIN &&
!ezcBaseFeatures::hasExtensionSupport( 'openssl' ) )
{
throw new ezcBaseExtensionNotFoundException( 'openssl', null, "PHP not confi... | [
"protected",
"function",
"connect",
"(",
")",
"{",
"$",
"errno",
"=",
"null",
";",
"$",
"errstr",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"options",
"->",
"connectionType",
"!==",
"self",
"::",
"CONNECTION_PLAIN",
"&&",
"!",
"ezcBaseFeatures",
":... | Creates a connection to the SMTP server and initiates the login
procedure.
@todo The @ should be removed when PHP doesn't throw warnings for connect problems
@throws ezcMailTransportSmtpException
if no connection could be made
or if the login failed
@throws ezcBaseExtensionNotFoundException
if trying to use SSL and t... | [
"Creates",
"a",
"connection",
"to",
"the",
"SMTP",
"server",
"and",
"initiates",
"the",
"login",
"procedure",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L537-L569 |
20,822 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.login | protected function login()
{
if ( $this->doAuthenticate )
{
$this->sendData( 'EHLO ' . $this->senderHost );
}
else
{
$this->sendData( 'HELO ' . $this->senderHost );
}
if ( $this->getReplyCode( $response ) !== '250' )
{
... | php | protected function login()
{
if ( $this->doAuthenticate )
{
$this->sendData( 'EHLO ' . $this->senderHost );
}
else
{
$this->sendData( 'HELO ' . $this->senderHost );
}
if ( $this->getReplyCode( $response ) !== '250' )
{
... | [
"protected",
"function",
"login",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"doAuthenticate",
")",
"{",
"$",
"this",
"->",
"sendData",
"(",
"'EHLO '",
".",
"$",
"this",
"->",
"senderHost",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"sendData",... | Performs the initial handshake with the SMTP server and
authenticates the user, if login data is provided to the
constructor.
@throws ezcMailTransportSmtpException
if the HELO/EHLO command or authentication fails | [
"Performs",
"the",
"initial",
"handshake",
"with",
"the",
"SMTP",
"server",
"and",
"authenticates",
"the",
"user",
"if",
"login",
"data",
"is",
"provided",
"to",
"the",
"constructor",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L579-L632 |
20,823 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authCramMd5 | protected function authCramMd5()
{
$this->sendData( 'AUTH CRAM-MD5' );
if ( $this->getReplyCode( $response ) !== '334' )
{
throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH CRAM-MD5.' );
}
$serverDigest = trim( substr( $response, 4 ) );
... | php | protected function authCramMd5()
{
$this->sendData( 'AUTH CRAM-MD5' );
if ( $this->getReplyCode( $response ) !== '334' )
{
throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH CRAM-MD5.' );
}
$serverDigest = trim( substr( $response, 4 ) );
... | [
"protected",
"function",
"authCramMd5",
"(",
")",
"{",
"$",
"this",
"->",
"sendData",
"(",
"'AUTH CRAM-MD5'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getReplyCode",
"(",
"$",
"response",
")",
"!==",
"'334'",
")",
"{",
"throw",
"new",
"ezcMailTransportSmtp... | Tries to login to the SMTP server with 'AUTH CRAM-MD5' and returns true if
successful.
@throws ezcMailTransportSmtpException
if the SMTP server returned an error
@return bool | [
"Tries",
"to",
"login",
"to",
"the",
"SMTP",
"server",
"with",
"AUTH",
"CRAM",
"-",
"MD5",
"and",
"returns",
"true",
"if",
"successful",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L828-L847 |
20,824 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authNtlm | protected function authNtlm()
{
if ( !ezcBaseFeatures::hasExtensionSupport( 'mcrypt' ) )
{
throw new ezcBaseExtensionNotFoundException( 'mcrypt', null, "PHP not compiled with --with-mcrypt." );
}
// Send NTLM type 1 message
$msg1 = base64_encode( $this->authNtlmM... | php | protected function authNtlm()
{
if ( !ezcBaseFeatures::hasExtensionSupport( 'mcrypt' ) )
{
throw new ezcBaseExtensionNotFoundException( 'mcrypt', null, "PHP not compiled with --with-mcrypt." );
}
// Send NTLM type 1 message
$msg1 = base64_encode( $this->authNtlmM... | [
"protected",
"function",
"authNtlm",
"(",
")",
"{",
"if",
"(",
"!",
"ezcBaseFeatures",
"::",
"hasExtensionSupport",
"(",
"'mcrypt'",
")",
")",
"{",
"throw",
"new",
"ezcBaseExtensionNotFoundException",
"(",
"'mcrypt'",
",",
"null",
",",
"\"PHP not compiled with --wit... | Tries to login to the SMTP server with 'AUTH NTLM' and returns true if
successful.
@throws ezcMailTransportSmtpException
if the SMTP server returned an error
@return bool | [
"Tries",
"to",
"login",
"to",
"the",
"SMTP",
"server",
"with",
"AUTH",
"NTLM",
"and",
"returns",
"true",
"if",
"successful",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L857-L894 |
20,825 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authLogin | protected function authLogin()
{
$this->sendData( 'AUTH LOGIN' );
if ( $this->getReplyCode( $error ) !== '334' )
{
throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH LOGIN.' );
}
$this->sendData( base64_encode( $this->user ) );
if ... | php | protected function authLogin()
{
$this->sendData( 'AUTH LOGIN' );
if ( $this->getReplyCode( $error ) !== '334' )
{
throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH LOGIN.' );
}
$this->sendData( base64_encode( $this->user ) );
if ... | [
"protected",
"function",
"authLogin",
"(",
")",
"{",
"$",
"this",
"->",
"sendData",
"(",
"'AUTH LOGIN'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getReplyCode",
"(",
"$",
"error",
")",
"!==",
"'334'",
")",
"{",
"throw",
"new",
"ezcMailTransportSmtpExceptio... | Tries to login to the SMTP server with 'AUTH LOGIN' and returns true if
successful.
@throws ezcMailTransportSmtpException
if the SMTP server returned an error
@return bool | [
"Tries",
"to",
"login",
"to",
"the",
"SMTP",
"server",
"with",
"AUTH",
"LOGIN",
"and",
"returns",
"true",
"if",
"successful",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L904-L925 |
20,826 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authPlain | protected function authPlain()
{
$digest = base64_encode( "\0{$this->user}\0{$this->password}" );
$this->sendData( "AUTH PLAIN {$digest}" );
if ( $this->getReplyCode( $error ) !== '235' )
{
throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided ... | php | protected function authPlain()
{
$digest = base64_encode( "\0{$this->user}\0{$this->password}" );
$this->sendData( "AUTH PLAIN {$digest}" );
if ( $this->getReplyCode( $error ) !== '235' )
{
throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided ... | [
"protected",
"function",
"authPlain",
"(",
")",
"{",
"$",
"digest",
"=",
"base64_encode",
"(",
"\"\\0{$this->user}\\0{$this->password}\"",
")",
";",
"$",
"this",
"->",
"sendData",
"(",
"\"AUTH PLAIN {$digest}\"",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getReply... | Tries to login to the SMTP server with 'AUTH PLAIN' and returns true if
successful.
@throws ezcMailTransportSmtpException
if the SMTP server returned an error
@return bool | [
"Tries",
"to",
"login",
"to",
"the",
"SMTP",
"server",
"with",
"AUTH",
"PLAIN",
"and",
"returns",
"true",
"if",
"successful",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L935-L945 |
20,827 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.disconnect | public function disconnect()
{
if ( $this->status != self::STATUS_NOT_CONNECTED )
{
$this->sendData( 'QUIT' );
$replyCode = $this->getReplyCode( $error ) !== '221';
fclose( $this->connection );
$this->status = self::STATUS_NOT_CONNECTED;
if... | php | public function disconnect()
{
if ( $this->status != self::STATUS_NOT_CONNECTED )
{
$this->sendData( 'QUIT' );
$replyCode = $this->getReplyCode( $error ) !== '221';
fclose( $this->connection );
$this->status = self::STATUS_NOT_CONNECTED;
if... | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"status",
"!=",
"self",
"::",
"STATUS_NOT_CONNECTED",
")",
"{",
"$",
"this",
"->",
"sendData",
"(",
"'QUIT'",
")",
";",
"$",
"replyCode",
"=",
"$",
"this",
"->",
"getReply... | Sends the QUIT command to the server and breaks the connection.
@throws ezcMailTransportSmtpException
if the QUIT command failed | [
"Sends",
"the",
"QUIT",
"command",
"to",
"the",
"server",
"and",
"breaks",
"the",
"connection",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L953-L966 |
20,828 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.cmdData | protected function cmdData()
{
if ( $this->status === self::STATUS_AUTHENTICATED )
{
$this->sendData( 'DATA' );
if ( $this->getReplyCode( $error ) !== '354' )
{
throw new ezcMailTransportSmtpException( "DATA failed with error: $error." );
... | php | protected function cmdData()
{
if ( $this->status === self::STATUS_AUTHENTICATED )
{
$this->sendData( 'DATA' );
if ( $this->getReplyCode( $error ) !== '354' )
{
throw new ezcMailTransportSmtpException( "DATA failed with error: $error." );
... | [
"protected",
"function",
"cmdData",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"status",
"===",
"self",
"::",
"STATUS_AUTHENTICATED",
")",
"{",
"$",
"this",
"->",
"sendData",
"(",
"'DATA'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getReplyCode",
"(",... | Sends the DATA command to the SMTP server.
@throws ezcMailTransportSmtpException
if there is no valid connection
or if the DATA command failed | [
"Sends",
"the",
"DATA",
"command",
"to",
"the",
"SMTP",
"server",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1043-L1053 |
20,829 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.getData | protected function getData()
{
$data = '';
$line = '';
$loops = 0;
if ( is_resource( $this->connection ) )
{
while ( ( strpos( $data, self::CRLF ) === false || (string) substr( $line, 3, 1 ) !== ' ' ) && $loops < 100 )
{
$line = fge... | php | protected function getData()
{
$data = '';
$line = '';
$loops = 0;
if ( is_resource( $this->connection ) )
{
while ( ( strpos( $data, self::CRLF ) === false || (string) substr( $line, 3, 1 ) !== ' ' ) && $loops < 100 )
{
$line = fge... | [
"protected",
"function",
"getData",
"(",
")",
"{",
"$",
"data",
"=",
"''",
";",
"$",
"line",
"=",
"''",
";",
"$",
"loops",
"=",
"0",
";",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"connection",
")",
")",
"{",
"while",
"(",
"(",
"strpos",
... | Returns data received from the connection stream.
@throws ezcMailTransportSmtpException
if there is no valid connection
@return string | [
"Returns",
"data",
"received",
"from",
"the",
"connection",
"stream",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1083-L1100 |
20,830 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authNtlmMessageType1 | protected function authNtlmMessageType1( $workstation, $domain )
{
$parts = array(
"NTLMSSP\x00",
"\x01\x00\x00\x00",
"\x07\x32\x00\x00",
$this->authNtlmSecurityBuffer( $domain, 32 + strlen( $workstation ) ),
... | php | protected function authNtlmMessageType1( $workstation, $domain )
{
$parts = array(
"NTLMSSP\x00",
"\x01\x00\x00\x00",
"\x07\x32\x00\x00",
$this->authNtlmSecurityBuffer( $domain, 32 + strlen( $workstation ) ),
... | [
"protected",
"function",
"authNtlmMessageType1",
"(",
"$",
"workstation",
",",
"$",
"domain",
")",
"{",
"$",
"parts",
"=",
"array",
"(",
"\"NTLMSSP\\x00\"",
",",
"\"\\x01\\x00\\x00\\x00\"",
",",
"\"\\x07\\x32\\x00\\x00\"",
",",
"$",
"this",
"->",
"authNtlmSecurityBu... | Generates an NTLM type 1 message.
@param string $workstation
@param string $domain
@return string | [
"Generates",
"an",
"NTLM",
"type",
"1",
"message",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1145-L1158 |
20,831 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authNtlmResponse | protected function authNtlmResponse( $challenge, $password )
{
$password = chunk_split( $password, 1, "\x00" );
$password = hash( 'md4', $password, true );
$password .= str_repeat( "\x00", 21 - strlen( $password ) );
$td = mcrypt_module_open( 'des', '', 'ecb', '' );
$iv = mc... | php | protected function authNtlmResponse( $challenge, $password )
{
$password = chunk_split( $password, 1, "\x00" );
$password = hash( 'md4', $password, true );
$password .= str_repeat( "\x00", 21 - strlen( $password ) );
$td = mcrypt_module_open( 'des', '', 'ecb', '' );
$iv = mc... | [
"protected",
"function",
"authNtlmResponse",
"(",
"$",
"challenge",
",",
"$",
"password",
")",
"{",
"$",
"password",
"=",
"chunk_split",
"(",
"$",
"password",
",",
"1",
",",
"\"\\x00\"",
")",
";",
"$",
"password",
"=",
"hash",
"(",
"'md4'",
",",
"$",
"... | Calculates an NTLM response to be used in the creation of the NTLM type 3
message.
@param string $challenge
@param string $password
@return string | [
"Calculates",
"an",
"NTLM",
"response",
"to",
"be",
"used",
"in",
"the",
"creation",
"of",
"the",
"NTLM",
"type",
"3",
"message",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1215-L1248 |
20,832 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php | ezcMailSmtpTransport.authNtlmSecurityBuffer | protected function authNtlmSecurityBuffer( $text, $offset )
{
return pack( 'v', strlen( $text ) ) .
pack( 'v', strlen( $text ) ) .
pack( 'V', $offset );
} | php | protected function authNtlmSecurityBuffer( $text, $offset )
{
return pack( 'v', strlen( $text ) ) .
pack( 'v', strlen( $text ) ) .
pack( 'V', $offset );
} | [
"protected",
"function",
"authNtlmSecurityBuffer",
"(",
"$",
"text",
",",
"$",
"offset",
")",
"{",
"return",
"pack",
"(",
"'v'",
",",
"strlen",
"(",
"$",
"text",
")",
")",
".",
"pack",
"(",
"'v'",
",",
"strlen",
"(",
"$",
"text",
")",
")",
".",
"pa... | Creates an NTLM security buffer information string.
The structure of the security buffer is:
- a short containing the length of the buffer content in bytes (may be
zero).
- a short containing the allocated space for the buffer in bytes (greater
than or equal to the length; typically the same as the length).
- a long c... | [
"Creates",
"an",
"NTLM",
"security",
"buffer",
"information",
"string",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1272-L1277 |
20,833 | surebert/surebert-framework | src/sb/Excel/Reader/HTML.php | HTML.hyperlink | public function hyperlink($row, $col, $sheet=0)
{
$link = isset($this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink']) ? $this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink'] : false;
if ($link) {
return $link['link'];
}
return '';
} | php | public function hyperlink($row, $col, $sheet=0)
{
$link = isset($this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink']) ? $this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink'] : false;
if ($link) {
return $link['link'];
}
return '';
} | [
"public",
"function",
"hyperlink",
"(",
"$",
"row",
",",
"$",
"col",
",",
"$",
"sheet",
"=",
"0",
")",
"{",
"$",
"link",
"=",
"isset",
"(",
"$",
"this",
"->",
"sheets",
"[",
"$",
"sheet",
"]",
"[",
"'cellsInfo'",
"]",
"[",
"$",
"row",
"]",
"[",... | get hyperlink if cell is hyperlinked
@param int $row
@param int $col
@param int $sheet
@return string | [
"get",
"hyperlink",
"if",
"cell",
"is",
"hyperlinked"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader/HTML.php#L107-L114 |
20,834 | JBZoo/Assets | src/Collection.php | Collection.remove | public function remove($name)
{
$names = (array)$name;
foreach ($names as $name) {
if (Arr::key($name, $this->_assets)) {
unset($this->_assets[$name]);
}
}
} | php | public function remove($name)
{
$names = (array)$name;
foreach ($names as $name) {
if (Arr::key($name, $this->_assets)) {
unset($this->_assets[$name]);
}
}
} | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"$",
"names",
"=",
"(",
"array",
")",
"$",
"name",
";",
"foreach",
"(",
"$",
"names",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"$",
"name",
",",
"$",
"this",
... | Removes assets from collection.
@param string|array $name
@return void | [
"Removes",
"assets",
"from",
"collection",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Collection.php#L82-L91 |
20,835 | wilmoore/attributes.php | src/Attributes.php | Attributes.resetChangeHistory | function resetChangeHistory($attribute) {
if ($this->propertyExists($attribute, 'changes')) {
$this->setPropertyFor($attribute, 'changes', [], null, false);
}
return $this;
} | php | function resetChangeHistory($attribute) {
if ($this->propertyExists($attribute, 'changes')) {
$this->setPropertyFor($attribute, 'changes', [], null, false);
}
return $this;
} | [
"function",
"resetChangeHistory",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"propertyExists",
"(",
"$",
"attribute",
",",
"'changes'",
")",
")",
"{",
"$",
"this",
"->",
"setPropertyFor",
"(",
"$",
"attribute",
",",
"'changes'",
",",
... | `resetChangeHistory` clears the change history for an attribute
@param string $attribute attribute name
@return $this | [
"resetChangeHistory",
"clears",
"the",
"change",
"history",
"for",
"an",
"attribute"
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L48-L54 |
20,836 | wilmoore/attributes.php | src/Attributes.php | Attributes.propertyExists | function propertyExists($attribute, $property) {
return array_key_exists($attribute, $this->__attributes)
&& array_key_exists($property, $this->__attributes[$attribute]);
} | php | function propertyExists($attribute, $property) {
return array_key_exists($attribute, $this->__attributes)
&& array_key_exists($property, $this->__attributes[$attribute]);
} | [
"function",
"propertyExists",
"(",
"$",
"attribute",
",",
"$",
"property",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"attribute",
",",
"$",
"this",
"->",
"__attributes",
")",
"&&",
"array_key_exists",
"(",
"$",
"property",
",",
"$",
"this",
"->",
"... | `propertyExists` determines if an attribute property has been set.
@param string $attribute attribute name
@param string $property property name
@api public
@return boolean | [
"propertyExists",
"determines",
"if",
"an",
"attribute",
"property",
"has",
"been",
"set",
"."
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L79-L82 |
20,837 | wilmoore/attributes.php | src/Attributes.php | Attributes.get | function get($name, $default=null) {
$map = array_map(function($name) use($default){
if ($this->__isset($name)) {
return $this->__attributes[$name]['value'];
} elseif ($this->propertyExists($name, 'default')) {
return $this->__attributes[$name]['default'];
}
return (null ===... | php | function get($name, $default=null) {
$map = array_map(function($name) use($default){
if ($this->__isset($name)) {
return $this->__attributes[$name]['value'];
} elseif ($this->propertyExists($name, 'default')) {
return $this->__attributes[$name]['default'];
}
return (null ===... | [
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"map",
"=",
"array_map",
"(",
"function",
"(",
"$",
"name",
")",
"use",
"(",
"$",
"default",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"__isset",
"(",
"$",
"nam... | `get` returns attributes value or, if attribute value is null, returns default value if given
@param string $name attribute name
@param mixed $default [optional] default return value
@return mixed | [
"get",
"returns",
"attributes",
"value",
"or",
"if",
"attribute",
"value",
"is",
"null",
"returns",
"default",
"value",
"if",
"given"
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L109-L121 |
20,838 | wilmoore/attributes.php | src/Attributes.php | Attributes.set | function set($attribute, $value = null) {
$attributes = is_array($attribute)
? $attribute
: [$attribute => $value];
foreach ($attributes as $attr => $val) {
if ($this->getPropertyFor($attr, 'accepts')) {
$acceptsConstraint = new Attributes\Constraint\Accepts($th... | php | function set($attribute, $value = null) {
$attributes = is_array($attribute)
? $attribute
: [$attribute => $value];
foreach ($attributes as $attr => $val) {
if ($this->getPropertyFor($attr, 'accepts')) {
$acceptsConstraint = new Attributes\Constraint\Accepts($th... | [
"function",
"set",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"attributes",
"=",
"is_array",
"(",
"$",
"attribute",
")",
"?",
"$",
"attribute",
":",
"[",
"$",
"attribute",
"=>",
"$",
"value",
"]",
";",
"foreach",
"(",
"$"... | `set` attributes value
@param string $attribute attribute name
@param mixed $value attribute value
@return $this | [
"set",
"attributes",
"value"
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L144-L176 |
20,839 | wilmoore/attributes.php | src/Attributes.php | Attributes.push | function push($attribute, $value) {
if (! $this->has($attribute)) {
return $this;
}
$new = $this->get($attribute);
if (! is_array($new) && !$new instanceof Traversable) {
return $this;
}
$new[] = $value;
$this->setPropertyFor($attribute, 'value', $new, 'push');
return $... | php | function push($attribute, $value) {
if (! $this->has($attribute)) {
return $this;
}
$new = $this->get($attribute);
if (! is_array($new) && !$new instanceof Traversable) {
return $this;
}
$new[] = $value;
$this->setPropertyFor($attribute, 'value', $new, 'push');
return $... | [
"function",
"push",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"attribute",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"new",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"att... | `push` a new value onto end of array
@param string $attribute attribute name
@param mixed $value attribute value
@return $this | [
"push",
"a",
"new",
"value",
"onto",
"end",
"of",
"array"
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L187-L202 |
20,840 | wilmoore/attributes.php | src/Attributes.php | Attributes.getPropertyFor | private function getPropertyFor($attribute, $property) {
return $this->propertyExists($attribute, $property)
? $this->__attributes[$attribute][$property]
: null;
} | php | private function getPropertyFor($attribute, $property) {
return $this->propertyExists($attribute, $property)
? $this->__attributes[$attribute][$property]
: null;
} | [
"private",
"function",
"getPropertyFor",
"(",
"$",
"attribute",
",",
"$",
"property",
")",
"{",
"return",
"$",
"this",
"->",
"propertyExists",
"(",
"$",
"attribute",
",",
"$",
"property",
")",
"?",
"$",
"this",
"->",
"__attributes",
"[",
"$",
"attribute",
... | `getPropertyFor` returns an attribute property by name
@param string $attribute attribute name
@param string $property property name
@return boolean | [
"getPropertyFor",
"returns",
"an",
"attribute",
"property",
"by",
"name"
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L239-L243 |
20,841 | wilmoore/attributes.php | src/Attributes.php | Attributes.setPropertyFor | private function setPropertyFor($attribute, $property, $value, $action, $changeTracking = true) {
if (! $this->has($attribute)) {return;}
if ($changeTracking) {
$this->__attributes[$attribute]['changes'][] = [
'action' => $action,
'from' => $this->get($attribute),
'to' => $v... | php | private function setPropertyFor($attribute, $property, $value, $action, $changeTracking = true) {
if (! $this->has($attribute)) {return;}
if ($changeTracking) {
$this->__attributes[$attribute]['changes'][] = [
'action' => $action,
'from' => $this->get($attribute),
'to' => $v... | [
"private",
"function",
"setPropertyFor",
"(",
"$",
"attribute",
",",
"$",
"property",
",",
"$",
"value",
",",
"$",
"action",
",",
"$",
"changeTracking",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"attribute",
")",
")",... | `setPropertyFor` sets an attribute property value
@param string $attribute attribute name
@param string $property property name
@param mixed $value property value
@return boolean | [
"setPropertyFor",
"sets",
"an",
"attribute",
"property",
"value"
] | d36de26a0d28c35d64ce9b3fc868572e39911ee7 | https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L255-L268 |
20,842 | barrelstrength/craftnet-php | src/PluginLicenses.php | PluginLicenses.get | public function get(array $options = [])
{
$pagination = '';
if (isset($options['page']) && is_int($options['page'])) {
$pagination = '?page='.$options['page'];
}
if (isset($options['key'])) {
return $this->client->get('plugin-licenses/'.$options['key'].$pag... | php | public function get(array $options = [])
{
$pagination = '';
if (isset($options['page']) && is_int($options['page'])) {
$pagination = '?page='.$options['page'];
}
if (isset($options['key'])) {
return $this->client->get('plugin-licenses/'.$options['key'].$pag... | [
"public",
"function",
"get",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"pagination",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'page'",
"]",
")",
"&&",
"is_int",
"(",
"$",
"options",
"[",
"'page'",
"]",
")",... | Gets one or more licenses for the given Craft ID account
@param array $options
@return mixed|\Psr\Http\Message\ResponseInterface
@throws \GuzzleHttp\Exception\GuzzleException | [
"Gets",
"one",
"or",
"more",
"licenses",
"for",
"the",
"given",
"Craft",
"ID",
"account"
] | 90c9767b6bef6078bc062b3bfcdde38b24c843fc | https://github.com/barrelstrength/craftnet-php/blob/90c9767b6bef6078bc062b3bfcdde38b24c843fc/src/PluginLicenses.php#L30-L43 |
20,843 | phpnfe/tools | src/Certificado/Base.php | Base.pem2Der | protected static function pem2Der($pemData)
{
$begin = 'CERTIFICATE-----';
$end = '-----END';
//extrai o conteúdo do certificado entre as marcas BEGIN e END
$pemData1 = substr($pemData, strpos($pemData, $begin) + strlen($begin));
$pemData2 = substr($pemData1, 0, strpos($pemDa... | php | protected static function pem2Der($pemData)
{
$begin = 'CERTIFICATE-----';
$end = '-----END';
//extrai o conteúdo do certificado entre as marcas BEGIN e END
$pemData1 = substr($pemData, strpos($pemData, $begin) + strlen($begin));
$pemData2 = substr($pemData1, 0, strpos($pemDa... | [
"protected",
"static",
"function",
"pem2Der",
"(",
"$",
"pemData",
")",
"{",
"$",
"begin",
"=",
"'CERTIFICATE-----'",
";",
"$",
"end",
"=",
"'-----END'",
";",
"//extrai o conteúdo do certificado entre as marcas BEGIN e END",
"$",
"pemData1",
"=",
"substr",
"(",
"$",... | pem2Der
Transforma o certificado do formato PEM para o formato DER.
@param string $pem_data
@return string | [
"pem2Der",
"Transforma",
"o",
"certificado",
"do",
"formato",
"PEM",
"para",
"o",
"formato",
"DER",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L12-L23 |
20,844 | phpnfe/tools | src/Certificado/Base.php | Base.xBase128 | protected static function xBase128($abIn, $qIn, $flag)
{
$abc = $abIn;
if ($qIn > 127) {
$abc = self::xBase128($abc, floor($qIn / 128), false);
}
$qIn2 = $qIn % 128;
if ($flag) {
$abc[] = $qIn2;
} else {
$abc[] = 0x80 | $qIn2;
... | php | protected static function xBase128($abIn, $qIn, $flag)
{
$abc = $abIn;
if ($qIn > 127) {
$abc = self::xBase128($abc, floor($qIn / 128), false);
}
$qIn2 = $qIn % 128;
if ($flag) {
$abc[] = $qIn2;
} else {
$abc[] = 0x80 | $qIn2;
... | [
"protected",
"static",
"function",
"xBase128",
"(",
"$",
"abIn",
",",
"$",
"qIn",
",",
"$",
"flag",
")",
"{",
"$",
"abc",
"=",
"$",
"abIn",
";",
"if",
"(",
"$",
"qIn",
">",
"127",
")",
"{",
"$",
"abc",
"=",
"self",
"::",
"xBase128",
"(",
"$",
... | xBase128
Retorna o dado convertido em asc.
@param array $abIn
@param int $qIn
@param bool $flag
@return int | [
"xBase128",
"Retorna",
"o",
"dado",
"convertido",
"em",
"asc",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L71-L85 |
20,845 | phpnfe/tools | src/Certificado/Base.php | Base.printHex | protected static function printHex($value)
{
$tabVal = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
$hex = '';
for ($i = 0; $i < strlen($value); $i++) {
$lsig = ord(substr($value, $i, 1)) % 16;
$msig = (ord(substr($value, $i, 1)) -... | php | protected static function printHex($value)
{
$tabVal = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
$hex = '';
for ($i = 0; $i < strlen($value); $i++) {
$lsig = ord(substr($value, $i, 1)) % 16;
$msig = (ord(substr($value, $i, 1)) -... | [
"protected",
"static",
"function",
"printHex",
"(",
"$",
"value",
")",
"{",
"$",
"tabVal",
"=",
"[",
"'0'",
",",
"'1'",
",",
"'2'",
",",
"'3'",
",",
"'4'",
",",
"'5'",
",",
"'6'",
",",
"'7'",
",",
"'8'",
",",
"'9'",
",",
"'A'",
",",
"'B'",
",",... | Retorna o valor em caracteres hexadecimais.
@param string $value
@return string
@return void | [
"Retorna",
"o",
"valor",
"em",
"caracteres",
"hexadecimais",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L94-L107 |
20,846 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Controller/ModelManager.php | Aoe_Layout_Controller_ModelManager.editAction | public function editAction()
{
$model = $this->loadModel();
if ($model->isObjectNew()) {
$this->_forward('noroute');
return;
}
if ($this->getRequest()->isPost()) {
$postData = $this->getRequest()->getPost();
try {
forea... | php | public function editAction()
{
$model = $this->loadModel();
if ($model->isObjectNew()) {
$this->_forward('noroute');
return;
}
if ($this->getRequest()->isPost()) {
$postData = $this->getRequest()->getPost();
try {
forea... | [
"public",
"function",
"editAction",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"loadModel",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"isObjectNew",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_forward",
"(",
"'noroute'",
")",
";",
"retur... | Edit an existing record | [
"Edit",
"an",
"existing",
"record"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/ModelManager.php#L51-L80 |
20,847 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Controller/ModelManager.php | Aoe_Layout_Controller_ModelManager.deleteAction | public function deleteAction()
{
$model = $this->loadModel();
if ($model->isObjectNew()) {
$this->_forward('noroute');
return;
}
try {
$model->delete();
$this->_redirectUrl($this->getHelper()->getGridUrl());
$this->_getSess... | php | public function deleteAction()
{
$model = $this->loadModel();
if ($model->isObjectNew()) {
$this->_forward('noroute');
return;
}
try {
$model->delete();
$this->_redirectUrl($this->getHelper()->getGridUrl());
$this->_getSess... | [
"public",
"function",
"deleteAction",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"loadModel",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"isObjectNew",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_forward",
"(",
"'noroute'",
")",
";",
"ret... | Delete an existing record | [
"Delete",
"an",
"existing",
"record"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/ModelManager.php#L85-L105 |
20,848 | jeffturcotte/jest | src/Jest/Injector.php | Injector.invoke | public function invoke(Callable $callable)
{
$reflection = $this->reflectCallable($callable);
$args = [];
foreach($reflection->getParameters() as $param) {
$type = $param->getClass()->getName();
if (in_array($type, $this->resolving)) {
throw new \LogicException("Recursive dependency: $type is curren... | php | public function invoke(Callable $callable)
{
$reflection = $this->reflectCallable($callable);
$args = [];
foreach($reflection->getParameters() as $param) {
$type = $param->getClass()->getName();
if (in_array($type, $this->resolving)) {
throw new \LogicException("Recursive dependency: $type is curren... | [
"public",
"function",
"invoke",
"(",
"Callable",
"$",
"callable",
")",
"{",
"$",
"reflection",
"=",
"$",
"this",
"->",
"reflectCallable",
"(",
"$",
"callable",
")",
";",
"$",
"args",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"reflection",
"->",
"getPara... | Invoke a callable and injects dependencies
@param $callable mixed
The Closure or object to inject dependencies into
@return mixed
The value return from the callable | [
"Invoke",
"a",
"callable",
"and",
"injects",
"dependencies"
] | 1afab9a2939d0c3d977b3992563ca37e77f87c1f | https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L55-L72 |
20,849 | jeffturcotte/jest | src/Jest/Injector.php | Injector.offsetGet | public function offsetGet($class)
{
if (!isset($this->factories[$class]) && !isset($this->instances[$class])) {
throw new \InvalidArgumentException("$class has not been defined");
}
if (isset($this->instances[$class])) {
return $this->instances[$class];
}
array_push($this->resolving, $class);
$obje... | php | public function offsetGet($class)
{
if (!isset($this->factories[$class]) && !isset($this->instances[$class])) {
throw new \InvalidArgumentException("$class has not been defined");
}
if (isset($this->instances[$class])) {
return $this->instances[$class];
}
array_push($this->resolving, $class);
$obje... | [
"public",
"function",
"offsetGet",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"factories",
"[",
"$",
"class",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"class",
"]",
")",
")",
... | get a dependency for the supplied class
@param $type string
The type to get
@return mixed
The dependency/type value | [
"get",
"a",
"dependency",
"for",
"the",
"supplied",
"class"
] | 1afab9a2939d0c3d977b3992563ca37e77f87c1f | https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L110-L125 |
20,850 | jeffturcotte/jest | src/Jest/Injector.php | Injector.offsetSet | public function offsetSet($class, $factory)
{
if (is_callable($factory)) {
$this->factories[$class] = $factory;
} else if (is_object($factory)) {
$this->instances[$class] = $factory;
} else {
throw new \InvalidArgumentException("Dependency supplied is neither a callable or an object");
}
} | php | public function offsetSet($class, $factory)
{
if (is_callable($factory)) {
$this->factories[$class] = $factory;
} else if (is_object($factory)) {
$this->instances[$class] = $factory;
} else {
throw new \InvalidArgumentException("Dependency supplied is neither a callable or an object");
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"class",
",",
"$",
"factory",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"factory",
")",
")",
"{",
"$",
"this",
"->",
"factories",
"[",
"$",
"class",
"]",
"=",
"$",
"factory",
";",
"}",
"else",
"if",
... | Registers a dependency for injection
@throws \InvalidArgumentException
@param $class string
The class to register
@param $factory mixed A callable or object
The factory used to create the dependency or the instance of the dependency | [
"Registers",
"a",
"dependency",
"for",
"injection"
] | 1afab9a2939d0c3d977b3992563ca37e77f87c1f | https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L139-L148 |
20,851 | jeffturcotte/jest | src/Jest/Injector.php | Injector.reflectCallable | protected function reflectCallable($callable)
{
if (is_string($callable) && strpos($callable, '::')) {
$callable = explode('::', $callable, 2);
}
if (is_a($callable, 'Closure')) {
$reflection = new \ReflectionFunction($callable);
} else if (is_object($callable)) {
$reflection = new \ReflectionMethod(... | php | protected function reflectCallable($callable)
{
if (is_string($callable) && strpos($callable, '::')) {
$callable = explode('::', $callable, 2);
}
if (is_a($callable, 'Closure')) {
$reflection = new \ReflectionFunction($callable);
} else if (is_object($callable)) {
$reflection = new \ReflectionMethod(... | [
"protected",
"function",
"reflectCallable",
"(",
"$",
"callable",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"callable",
")",
"&&",
"strpos",
"(",
"$",
"callable",
",",
"'::'",
")",
")",
"{",
"$",
"callable",
"=",
"explode",
"(",
"'::'",
",",
"$",
"... | Reflect a callable
@param $callable Callable
The callable to reflect
@return ReflectionFunction|ReflectionMethod | [
"Reflect",
"a",
"callable"
] | 1afab9a2939d0c3d977b3992563ca37e77f87c1f | https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L159-L176 |
20,852 | InactiveProjects/limoncello-illuminate | app/Database/Seeds/Runner.php | Runner.run | public function run()
{
Model::unguard();
try {
foreach ($this->seederClasses as $seederClass) {
$this->parentSeeder->call($seederClass);
}
} finally {
Model::reguard();
}
} | php | public function run()
{
Model::unguard();
try {
foreach ($this->seederClasses as $seederClass) {
$this->parentSeeder->call($seederClass);
}
} finally {
Model::reguard();
}
} | [
"public",
"function",
"run",
"(",
")",
"{",
"Model",
"::",
"unguard",
"(",
")",
";",
"try",
"{",
"foreach",
"(",
"$",
"this",
"->",
"seederClasses",
"as",
"$",
"seederClass",
")",
"{",
"$",
"this",
"->",
"parentSeeder",
"->",
"call",
"(",
"$",
"seede... | Run seeders.
@return void
@SuppressWarnings(PHPMD.StaticAccess) | [
"Run",
"seeders",
"."
] | cae6fc26190efcf090495a5c3582c10fa2430897 | https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Database/Seeds/Runner.php#L44-L54 |
20,853 | interactivesolutions/honeycomb-core | src/http/controllers/traits/HCQueryMaking.php | HCQueryMaking.checkForDeleted | protected function checkForDeleted(Builder $query)
{
if (request()->has('deleted') && request()->input('deleted') === '1')
$query = $query->onlyTrashed();
return $query;
} | php | protected function checkForDeleted(Builder $query)
{
if (request()->has('deleted') && request()->input('deleted') === '1')
$query = $query->onlyTrashed();
return $query;
} | [
"protected",
"function",
"checkForDeleted",
"(",
"Builder",
"$",
"query",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"has",
"(",
"'deleted'",
")",
"&&",
"request",
"(",
")",
"->",
"input",
"(",
"'deleted'",
")",
"===",
"'1'",
")",
"$",
"query",
... | Check for deleted records option
@param Builder $query
@return mixed | [
"Check",
"for",
"deleted",
"records",
"option"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/traits/HCQueryMaking.php#L140-L146 |
20,854 | gregoryv/php-logger | src/Logger.php | Logger.turn | public function turn($toggle)
{
if(preg_match_all('/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/', $toggle, $matches)) {
$flag = $matches[1][0];
$all = $matches[2][0];
$name = $matches[3][0];
$this->sieve->toggle($flag, $name);
... | php | public function turn($toggle)
{
if(preg_match_all('/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/', $toggle, $matches)) {
$flag = $matches[1][0];
$all = $matches[2][0];
$name = $matches[3][0];
$this->sieve->toggle($flag, $name);
... | [
"public",
"function",
"turn",
"(",
"$",
"toggle",
")",
"{",
"if",
"(",
"preg_match_all",
"(",
"'/^(on|off) (all)?\\s?(debug|info|notice|warn|error|critical|alert|emergency)$/'",
",",
"$",
"toggle",
",",
"$",
"matches",
")",
")",
"{",
"$",
"flag",
"=",
"$",
"matche... | Sets logging state of the given severity level in a readable format
@example $log->turn('on debug');
@example $log->turn('off all warn');
@param string $toggle format: (on|off) [all] (debug|info|notice|warn|error|critical|alert|emergency) | [
"Sets",
"logging",
"state",
"of",
"the",
"given",
"severity",
"level",
"in",
"a",
"readable",
"format"
] | 0f8ffc360a0233531a9775359929af8876997862 | https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/Logger.php#L68-L81 |
20,855 | zhouyl/mellivora | Mellivora/Support/Collection.php | Collection.every | public function every($key, $operator = null, $value = null)
{
if (func_num_args() === 1) {
$callback = $this->valueRetriever($key);
foreach ($this->items as $k => $v) {
if (!$callback($v, $k)) {
return false;
}
}
... | php | public function every($key, $operator = null, $value = null)
{
if (func_num_args() === 1) {
$callback = $this->valueRetriever($key);
foreach ($this->items as $k => $v) {
if (!$callback($v, $k)) {
return false;
}
}
... | [
"public",
"function",
"every",
"(",
"$",
"key",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"1",
")",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"valueRetriever",
"(",... | Determine if all items in the collection pass the given test.
@param callable|string $key
@param mixed $operator
@param mixed $value
@return bool | [
"Determine",
"if",
"all",
"items",
"in",
"the",
"collection",
"pass",
"the",
"given",
"test",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Support/Collection.php#L289-L310 |
20,856 | zhouyl/mellivora | Mellivora/Support/Collection.php | Collection.mapToGroups | public function mapToGroups(callable $callback)
{
$groups = $this->map($callback)->reduce(function ($groups, $pair) {
$groups[key($pair)][] = reset($pair);
return $groups;
}, []);
return (new static($groups))->map([$this, 'make']);
} | php | public function mapToGroups(callable $callback)
{
$groups = $this->map($callback)->reduce(function ($groups, $pair) {
$groups[key($pair)][] = reset($pair);
return $groups;
}, []);
return (new static($groups))->map([$this, 'make']);
} | [
"public",
"function",
"mapToGroups",
"(",
"callable",
"$",
"callback",
")",
"{",
"$",
"groups",
"=",
"$",
"this",
"->",
"map",
"(",
"$",
"callback",
")",
"->",
"reduce",
"(",
"function",
"(",
"$",
"groups",
",",
"$",
"pair",
")",
"{",
"$",
"groups",
... | Run a grouping map over the items.
The callback should return an associative array with a single key/value pair.
@param callable $callback
@return static | [
"Run",
"a",
"grouping",
"map",
"over",
"the",
"items",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Support/Collection.php#L771-L780 |
20,857 | hametuha/wpametu | src/WPametu/AutoLoader.php | AutoLoader.register_commands | private function register_commands() {
foreach ( $this->commands as $class_name ) {
\WP_CLI::add_command( $class_name::COMMAND_NAME, $class_name );
}
} | php | private function register_commands() {
foreach ( $this->commands as $class_name ) {
\WP_CLI::add_command( $class_name::COMMAND_NAME, $class_name );
}
} | [
"private",
"function",
"register_commands",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"commands",
"as",
"$",
"class_name",
")",
"{",
"\\",
"WP_CLI",
"::",
"add_command",
"(",
"$",
"class_name",
"::",
"COMMAND_NAME",
",",
"$",
"class_name",
")",
";"... | Register All commands | [
"Register",
"All",
"commands"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/AutoLoader.php#L259-L263 |
20,858 | hametuha/wpametu | src/WPametu/AutoLoader.php | AutoLoader.ajax_register | public function ajax_register() {
if ( AjaxBase::is_ajax() ) {
foreach ( $this->ajax_controllers as $class_name ) {
/** @var AjaxBase $instance */
$instance = $class_name::get_instance();
$instance->register();
}
}
} | php | public function ajax_register() {
if ( AjaxBase::is_ajax() ) {
foreach ( $this->ajax_controllers as $class_name ) {
/** @var AjaxBase $instance */
$instance = $class_name::get_instance();
$instance->register();
}
}
} | [
"public",
"function",
"ajax_register",
"(",
")",
"{",
"if",
"(",
"AjaxBase",
"::",
"is_ajax",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"ajax_controllers",
"as",
"$",
"class_name",
")",
"{",
"/** @var AjaxBase $instance */",
"$",
"instance",
"="... | Register ajax actions | [
"Register",
"ajax",
"actions"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/AutoLoader.php#L268-L276 |
20,859 | hametuha/wpametu | src/WPametu/AutoLoader.php | AutoLoader.scan_post_type | public function scan_post_type() {
$flg = false;
foreach ( $this->namespaces as $ns => $dir ) {
$dir = $dir . '/' . $ns . '/ThePost';
if ( is_dir( $dir ) ) {
foreach ( scandir( $dir ) as $file ) {
if ( ! preg_match( '/^\./u', $file ) ) {
$base_class = str_replace( '.php', '', $file );
$cl... | php | public function scan_post_type() {
$flg = false;
foreach ( $this->namespaces as $ns => $dir ) {
$dir = $dir . '/' . $ns . '/ThePost';
if ( is_dir( $dir ) ) {
foreach ( scandir( $dir ) as $file ) {
if ( ! preg_match( '/^\./u', $file ) ) {
$base_class = str_replace( '.php', '', $file );
$cl... | [
"public",
"function",
"scan_post_type",
"(",
")",
"{",
"$",
"flg",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"namespaces",
"as",
"$",
"ns",
"=>",
"$",
"dir",
")",
"{",
"$",
"dir",
"=",
"$",
"dir",
".",
"'/'",
".",
"$",
"ns",
".",
"'... | Scan original post type to override | [
"Scan",
"original",
"post",
"type",
"to",
"override"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/AutoLoader.php#L281-L301 |
20,860 | gruzilla/hydra | src/Hydra/Hydra.php | Hydra.run | public function run()
{
foreach ($this->jobs as $job) {
$this->worker->run($job);
}
while ($this->worker->isRunning()) {
// waiting for worker to finish
}
// allow chaining
return $this;
} | php | public function run()
{
foreach ($this->jobs as $job) {
$this->worker->run($job);
}
while ($this->worker->isRunning()) {
// waiting for worker to finish
}
// allow chaining
return $this;
} | [
"public",
"function",
"run",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"jobs",
"as",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"worker",
"->",
"run",
"(",
"$",
"job",
")",
";",
"}",
"while",
"(",
"$",
"this",
"->",
"worker",
"->",
"isRun... | run all jobs using the worker
@return self | [
"run",
"all",
"jobs",
"using",
"the",
"worker"
] | 47f381cc48e1a26bfe2e211d8dcb54c787ea0478 | https://github.com/gruzilla/hydra/blob/47f381cc48e1a26bfe2e211d8dcb54c787ea0478/src/Hydra/Hydra.php#L90-L102 |
20,861 | Erdiko/core | src/cache/Memcached.php | Memcached.put | public function put($key, $data)
{
$key = $this->getKeyCode($key);
$data = json_encode($data);
$this->memcacheObj->set($key, $data);
} | php | public function put($key, $data)
{
$key = $this->getKeyCode($key);
$data = json_encode($data);
$this->memcacheObj->set($key, $data);
} | [
"public",
"function",
"put",
"(",
"$",
"key",
",",
"$",
"data",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getKeyCode",
"(",
"$",
"key",
")",
";",
"$",
"data",
"=",
"json_encode",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"memcacheObj",
... | Put data into cache
@parm mixed $key
@parm mixed $data
@note If you put a object into cache,
the json_encode function will ignore any private property. | [
"Put",
"data",
"into",
"cache"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/cache/Memcached.php#L77-L83 |
20,862 | Erdiko/core | src/cache/Memcached.php | Memcached.has | public function has($key)
{
$key = $this->getKeyCode($key);
$value = $this->memcacheObj->get($key);
if (!$value) {
return false;
} else {
return true;
}
} | php | public function has($key)
{
$key = $this->getKeyCode($key);
$value = $this->memcacheObj->get($key);
if (!$value) {
return false;
} else {
return true;
}
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getKeyCode",
"(",
"$",
"key",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"memcacheObj",
"->",
"get",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
... | Check if the key exists in cache
@parm mixed $key
@return true if the key exist in cache
@return false if the key does not exist in cache | [
"Check",
"if",
"the",
"key",
"exists",
"in",
"cache"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/cache/Memcached.php#L109-L120 |
20,863 | Erdiko/core | src/cache/Memcached.php | Memcached.delete | public function delete($key)
{
$filename = $this->getKeyCode($key);
$this->memcacheObj->delete($filename);
} | php | public function delete($key)
{
$filename = $this->getKeyCode($key);
$this->memcacheObj->delete($filename);
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"getKeyCode",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"memcacheObj",
"->",
"delete",
"(",
"$",
"filename",
")",
";",
"}"
] | Remove a key from cache
@parm mixed $key | [
"Remove",
"a",
"key",
"from",
"cache"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/cache/Memcached.php#L128-L132 |
20,864 | JBZoo/Assets | src/Factory.php | Factory.create | public function create($alias, $source, $dependencies = [], $options = [])
{
$assetType = isset($options['type']) ? $options['type'] : '';
if (isset($this->_customTypes[$assetType])) {
$assetType = $this->_customTypes[$assetType];
} elseif (is_callable($source)) {
$... | php | public function create($alias, $source, $dependencies = [], $options = [])
{
$assetType = isset($options['type']) ? $options['type'] : '';
if (isset($this->_customTypes[$assetType])) {
$assetType = $this->_customTypes[$assetType];
} elseif (is_callable($source)) {
$... | [
"public",
"function",
"create",
"(",
"$",
"alias",
",",
"$",
"source",
",",
"$",
"dependencies",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"assetType",
"=",
"isset",
"(",
"$",
"options",
"[",
"'type'",
"]",
")",
"?",
"$",
... | Create asset instance.
@param string $alias
@param mixed $source
@param string|array $dependencies
@param string|array $options
@throws Exception
@return Asset | [
"Create",
"asset",
"instance",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Factory.php#L75-L112 |
20,865 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.getStatusOfTaskWithId | public function getStatusOfTaskWithId($taskId)
{
$task = $this->taskRepo->find($taskId);
if (!($task instanceof Task)) {
//the task was not found
return Task::STATUS_GONE;
}
return $task->getStatus();
} | php | public function getStatusOfTaskWithId($taskId)
{
$task = $this->taskRepo->find($taskId);
if (!($task instanceof Task)) {
//the task was not found
return Task::STATUS_GONE;
}
return $task->getStatus();
} | [
"public",
"function",
"getStatusOfTaskWithId",
"(",
"$",
"taskId",
")",
"{",
"$",
"task",
"=",
"$",
"this",
"->",
"taskRepo",
"->",
"find",
"(",
"$",
"taskId",
")",
";",
"if",
"(",
"!",
"(",
"$",
"task",
"instanceof",
"Task",
")",
")",
"{",
"//the ta... | Returns the current status of a task
@param integer $taskId
@return string | [
"Returns",
"the",
"current",
"status",
"of",
"a",
"task"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L126-L134 |
20,866 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.cleanUpTasks | public function cleanUpTasks($timePeriod)
{
$query = $this->entityManager->createQuery(
'DELETE
FROM WebdevviePheanstalkTaskQueueBundle:Task t
WHERE
t.status = :status and
t.created <= :older'
);
$query->setParameter('status', array... | php | public function cleanUpTasks($timePeriod)
{
$query = $this->entityManager->createQuery(
'DELETE
FROM WebdevviePheanstalkTaskQueueBundle:Task t
WHERE
t.status = :status and
t.created <= :older'
);
$query->setParameter('status', array... | [
"public",
"function",
"cleanUpTasks",
"(",
"$",
"timePeriod",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"createQuery",
"(",
"'DELETE\n FROM WebdevviePheanstalkTaskQueueBundle:Task t\n WHERE\n t.status = :status and\n ... | Cleans up tasks that are marked as done
@param integer $timePeriod
@return void | [
"Cleans",
"up",
"tasks",
"that",
"are",
"marked",
"as",
"done"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L202-L214 |
20,867 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.reserveTask | public function reserveTask($tube = null)
{
if (is_null($tube)) {
$tube = $this->defaultTube;
}
$inTask = $this->beanstalk
->watch($tube)
->ignore('default')
->reserve(2);
if ($inTask === false) {
return null;
}
... | php | public function reserveTask($tube = null)
{
if (is_null($tube)) {
$tube = $this->defaultTube;
}
$inTask = $this->beanstalk
->watch($tube)
->ignore('default')
->reserve(2);
if ($inTask === false) {
return null;
}
... | [
"public",
"function",
"reserveTask",
"(",
"$",
"tube",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"tube",
")",
")",
"{",
"$",
"tube",
"=",
"$",
"this",
"->",
"defaultTube",
";",
"}",
"$",
"inTask",
"=",
"$",
"this",
"->",
"beanstalk",
... | Returns a task to work on.
@param string $tube (optional) the tube(queue) to reserve a task from
@throws TaskQueueServiceException
@return WorkPackage | [
"Returns",
"a",
"task",
"to",
"work",
"on",
"."
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L224-L275 |
20,868 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.markDone | public function markDone(WorkPackage $task, $log)
{
if ($this->logWorkerOutputOnSuccess) {
$this->updateTaskLog($task, $log);
}
$this->updateTaskStatus($task, Task::STATUS_DONE);
$this->beanstalk->delete($task->getPheanstalkJob());
} | php | public function markDone(WorkPackage $task, $log)
{
if ($this->logWorkerOutputOnSuccess) {
$this->updateTaskLog($task, $log);
}
$this->updateTaskStatus($task, Task::STATUS_DONE);
$this->beanstalk->delete($task->getPheanstalkJob());
} | [
"public",
"function",
"markDone",
"(",
"WorkPackage",
"$",
"task",
",",
"$",
"log",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logWorkerOutputOnSuccess",
")",
"{",
"$",
"this",
"->",
"updateTaskLog",
"(",
"$",
"task",
",",
"$",
"log",
")",
";",
"}",
"$... | Deletes a task from the queue
@param WorkPackage $task
@param string $log
@throws TaskQueueServiceException
@return void | [
"Deletes",
"a",
"task",
"from",
"the",
"queue"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L285-L292 |
20,869 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.markFailed | public function markFailed(WorkPackage $task, $log)
{
if ($this->logWorkerOutputOnFailure) {
$this->updateTaskLog($task, $log);
}
$this->updateTaskStatus($task, Task::STATUS_FAILED);
$this->beanstalk->delete($task->getPheanstalkJob());
} | php | public function markFailed(WorkPackage $task, $log)
{
if ($this->logWorkerOutputOnFailure) {
$this->updateTaskLog($task, $log);
}
$this->updateTaskStatus($task, Task::STATUS_FAILED);
$this->beanstalk->delete($task->getPheanstalkJob());
} | [
"public",
"function",
"markFailed",
"(",
"WorkPackage",
"$",
"task",
",",
"$",
"log",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logWorkerOutputOnFailure",
")",
"{",
"$",
"this",
"->",
"updateTaskLog",
"(",
"$",
"task",
",",
"$",
"log",
")",
";",
"}",
... | Marks a job as failed and deletes it from the beanstalk tube
@param WorkPackage $task
@param string $log
@throws TaskQueueServiceException
@return void | [
"Marks",
"a",
"job",
"as",
"failed",
"and",
"deletes",
"it",
"from",
"the",
"beanstalk",
"tube"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L302-L309 |
20,870 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.updateTaskLog | private function updateTaskLog(WorkPackage $task, $log)
{
if ($this->databaseDisabled) {
return;
}
$taskEntity = $task->getTaskEntity();
if ($taskEntity instanceof Task) {
$taskEntity->setLog($log);
//make sure it is stored...
$this->en... | php | private function updateTaskLog(WorkPackage $task, $log)
{
if ($this->databaseDisabled) {
return;
}
$taskEntity = $task->getTaskEntity();
if ($taskEntity instanceof Task) {
$taskEntity->setLog($log);
//make sure it is stored...
$this->en... | [
"private",
"function",
"updateTaskLog",
"(",
"WorkPackage",
"$",
"task",
",",
"$",
"log",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"databaseDisabled",
")",
"{",
"return",
";",
"}",
"$",
"taskEntity",
"=",
"$",
"task",
"->",
"getTaskEntity",
"(",
")",
";... | Writes the log to the Task entity
@param WorkPackage $task
@param string $log
@return void
@throws TaskQueueServiceException | [
"Writes",
"the",
"log",
"to",
"the",
"Task",
"entity"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L319-L332 |
20,871 | webdevvie/pheanstalk-task-queue-bundle | Service/TaskQueueService.php | TaskQueueService.updateTaskStatus | private function updateTaskStatus(WorkPackage $task, $status)
{
if ($this->databaseDisabled) {
return;
}
$taskEntity = $task->getTaskEntity();
if ($taskEntity instanceof Task) {
$taskEntity->setStatus($status);
//make sure it is stored...
... | php | private function updateTaskStatus(WorkPackage $task, $status)
{
if ($this->databaseDisabled) {
return;
}
$taskEntity = $task->getTaskEntity();
if ($taskEntity instanceof Task) {
$taskEntity->setStatus($status);
//make sure it is stored...
... | [
"private",
"function",
"updateTaskStatus",
"(",
"WorkPackage",
"$",
"task",
",",
"$",
"status",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"databaseDisabled",
")",
"{",
"return",
";",
"}",
"$",
"taskEntity",
"=",
"$",
"task",
"->",
"getTaskEntity",
"(",
")"... | Updates the task status
@param WorkPackage $task
@param string $status
@return void
@throws TaskQueueServiceException | [
"Updates",
"the",
"task",
"status"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Service/TaskQueueService.php#L342-L355 |
20,872 | thanhtaivtt/taiscript | src/Handler/Handler.php | Handler.readData | public function readData($pathFilename)
{
$pathFilename = ucfirst($pathFilename);
$pathFilename = realpath(__DIR__) . "/../Template/{$pathFilename}.template";
$file = fopen($pathFilename, 'r');
if ($data = fread($file, filesize($pathFilename))) {
return str_replace('<\... | php | public function readData($pathFilename)
{
$pathFilename = ucfirst($pathFilename);
$pathFilename = realpath(__DIR__) . "/../Template/{$pathFilename}.template";
$file = fopen($pathFilename, 'r');
if ($data = fread($file, filesize($pathFilename))) {
return str_replace('<\... | [
"public",
"function",
"readData",
"(",
"$",
"pathFilename",
")",
"{",
"$",
"pathFilename",
"=",
"ucfirst",
"(",
"$",
"pathFilename",
")",
";",
"$",
"pathFilename",
"=",
"realpath",
"(",
"__DIR__",
")",
".",
"\"/../Template/{$pathFilename}.template\"",
";",
"$",
... | Read data form template folder
@param $pathFilename
@return mixed
@throws \ErrorException | [
"Read",
"data",
"form",
"template",
"folder"
] | fbc0d2e30172dcfb9de48a457872f12c7ab5c6ca | https://github.com/thanhtaivtt/taiscript/blob/fbc0d2e30172dcfb9de48a457872f12c7ab5c6ca/src/Handler/Handler.php#L27-L40 |
20,873 | z38/pc-axis | src/Px.php | Px.variables | public function variables()
{
if (!$this->hasKeyword('STUB')) {
return $this->keyword('HEADING')->values;
} elseif (!$this->hasKeyword('HEADING')) {
return $this->keyword('STUB')->values;
} else {
return array_merge($this->keyword('STUB')->values, $this->k... | php | public function variables()
{
if (!$this->hasKeyword('STUB')) {
return $this->keyword('HEADING')->values;
} elseif (!$this->hasKeyword('HEADING')) {
return $this->keyword('STUB')->values;
} else {
return array_merge($this->keyword('STUB')->values, $this->k... | [
"public",
"function",
"variables",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasKeyword",
"(",
"'STUB'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"keyword",
"(",
"'HEADING'",
")",
"->",
"values",
";",
"}",
"elseif",
"(",
"!",
"$",
"this... | Returns a list of all variables.
@return array | [
"Returns",
"a",
"list",
"of",
"all",
"variables",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L71-L80 |
20,874 | z38/pc-axis | src/Px.php | Px.values | public function values($variable)
{
foreach ($this->keywordList('VALUES') as $keyword) {
if ($keyword->subKeys[0] == $variable) {
return $keyword->values;
}
}
throw new RuntimeException(sprintf('Could not determine values of "%s".', $variable));
} | php | public function values($variable)
{
foreach ($this->keywordList('VALUES') as $keyword) {
if ($keyword->subKeys[0] == $variable) {
return $keyword->values;
}
}
throw new RuntimeException(sprintf('Could not determine values of "%s".', $variable));
} | [
"public",
"function",
"values",
"(",
"$",
"variable",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"keywordList",
"(",
"'VALUES'",
")",
"as",
"$",
"keyword",
")",
"{",
"if",
"(",
"$",
"keyword",
"->",
"subKeys",
"[",
"0",
"]",
"==",
"$",
"variable",
... | Returns a list of all possible values of a variable.
@param string $variable
@return array | [
"Returns",
"a",
"list",
"of",
"all",
"possible",
"values",
"of",
"a",
"variable",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L89-L97 |
20,875 | z38/pc-axis | src/Px.php | Px.codes | public function codes($variable)
{
foreach ($this->keywordList('CODES') as $keyword) {
if ($keyword->subKeys[0] == $variable) {
return $keyword->values;
}
}
return null;
} | php | public function codes($variable)
{
foreach ($this->keywordList('CODES') as $keyword) {
if ($keyword->subKeys[0] == $variable) {
return $keyword->values;
}
}
return null;
} | [
"public",
"function",
"codes",
"(",
"$",
"variable",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"keywordList",
"(",
"'CODES'",
")",
"as",
"$",
"keyword",
")",
"{",
"if",
"(",
"$",
"keyword",
"->",
"subKeys",
"[",
"0",
"]",
"==",
"$",
"variable",
... | Returns a list of all possible codes of a variable.
@param string $variable
@return array|null | [
"Returns",
"a",
"list",
"of",
"all",
"possible",
"codes",
"of",
"a",
"variable",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L106-L115 |
20,876 | z38/pc-axis | src/Px.php | Px.index | public function index($indices)
{
$this->assertIndexMultipliers();
$index = 0;
for ($i = 0, $length = count($this->indexMultipliers); $i < $length; ++$i) {
$index += $indices[$i] * $this->indexMultipliers[$i];
}
return $index;
} | php | public function index($indices)
{
$this->assertIndexMultipliers();
$index = 0;
for ($i = 0, $length = count($this->indexMultipliers); $i < $length; ++$i) {
$index += $indices[$i] * $this->indexMultipliers[$i];
}
return $index;
} | [
"public",
"function",
"index",
"(",
"$",
"indices",
")",
"{",
"$",
"this",
"->",
"assertIndexMultipliers",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"length",
"=",
"count",
"(",
"$",
"this",
"->",
"inde... | Computes the index within the data matrix.
@param array $indices An array of all value indices
@return int | [
"Computes",
"the",
"index",
"within",
"the",
"data",
"matrix",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L124-L134 |
20,877 | z38/pc-axis | src/Px.php | Px.datum | public function datum($indices)
{
$this->assertData();
$index = $this->index($indices);
if (isset($this->data[$index])) {
return $this->data[$index];
} else {
return null;
}
} | php | public function datum($indices)
{
$this->assertData();
$index = $this->index($indices);
if (isset($this->data[$index])) {
return $this->data[$index];
} else {
return null;
}
} | [
"public",
"function",
"datum",
"(",
"$",
"indices",
")",
"{",
"$",
"this",
"->",
"assertData",
"(",
")",
";",
"$",
"index",
"=",
"$",
"this",
"->",
"index",
"(",
"$",
"indices",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
... | Gets a single data point.
@param array $indices An array of all value indices
@return string | [
"Gets",
"a",
"single",
"data",
"point",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L143-L153 |
20,878 | z38/pc-axis | src/Px.php | Px.keywordList | public function keywordList($keyword)
{
$this->assertKeywords();
if (isset($this->keywords[$keyword])) {
return $this->keywords[$keyword];
} else {
return [];
}
} | php | public function keywordList($keyword)
{
$this->assertKeywords();
if (isset($this->keywords[$keyword])) {
return $this->keywords[$keyword];
} else {
return [];
}
} | [
"public",
"function",
"keywordList",
"(",
"$",
"keyword",
")",
"{",
"$",
"this",
"->",
"assertKeywords",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"keywords",
"[",
"$",
"keyword",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"k... | Returns all keywords with a given name.
@param string $keyword
@return array | [
"Returns",
"all",
"keywords",
"with",
"a",
"given",
"name",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L174-L183 |
20,879 | z38/pc-axis | src/Px.php | Px.keyword | public function keyword($keyword)
{
$list = $this->keywordList($keyword);
if (empty($list)) {
throw new RuntimeException(sprintf('Keyword "%s" does not exist.', $keyword));
}
return $list[0];
} | php | public function keyword($keyword)
{
$list = $this->keywordList($keyword);
if (empty($list)) {
throw new RuntimeException(sprintf('Keyword "%s" does not exist.', $keyword));
}
return $list[0];
} | [
"public",
"function",
"keyword",
"(",
"$",
"keyword",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"keywordList",
"(",
"$",
"keyword",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"list",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf"... | Returns the first keyword with a given name.
@param string $keyword
@return object | [
"Returns",
"the",
"first",
"keyword",
"with",
"a",
"given",
"name",
"."
] | de568ff3525e4ea76870749a49cffdae4e05a603 | https://github.com/z38/pc-axis/blob/de568ff3525e4ea76870749a49cffdae4e05a603/src/Px.php#L206-L214 |
20,880 | eXistenZNL/PermCheck | src/Filesystem/AbstractFilesystem.php | AbstractFilesystem.getFiles | public function getFiles()
{
$iterator = new RecursiveDirectoryIterator(
$this->directory,
FilesystemIterator::SKIP_DOTS
);
$iterator = new RecursiveIteratorIterator($iterator);
$iterator->rewind();
return $iterator;
} | php | public function getFiles()
{
$iterator = new RecursiveDirectoryIterator(
$this->directory,
FilesystemIterator::SKIP_DOTS
);
$iterator = new RecursiveIteratorIterator($iterator);
$iterator->rewind();
return $iterator;
} | [
"public",
"function",
"getFiles",
"(",
")",
"{",
"$",
"iterator",
"=",
"new",
"RecursiveDirectoryIterator",
"(",
"$",
"this",
"->",
"directory",
",",
"FilesystemIterator",
"::",
"SKIP_DOTS",
")",
";",
"$",
"iterator",
"=",
"new",
"RecursiveIteratorIterator",
"("... | Give back a list of all files in a given directory, recursively
This returns the filename relative to the given directory.
@return Iterator | [
"Give",
"back",
"a",
"list",
"of",
"all",
"files",
"in",
"a",
"given",
"directory",
"recursively",
"This",
"returns",
"the",
"filename",
"relative",
"to",
"the",
"given",
"directory",
"."
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/Filesystem/AbstractFilesystem.php#L51-L61 |
20,881 | Erdiko/core | src/AjaxResponse.php | AjaxResponse.render | public function render()
{
$responseData = array(
"status" => $this->_statusCode,
"body" => $this->_content,
"errors" => $this->_errors
);
return json_encode($responseData);
} | php | public function render()
{
$responseData = array(
"status" => $this->_statusCode,
"body" => $this->_content,
"errors" => $this->_errors
);
return json_encode($responseData);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"responseData",
"=",
"array",
"(",
"\"status\"",
"=>",
"$",
"this",
"->",
"_statusCode",
",",
"\"body\"",
"=>",
"$",
"this",
"->",
"_content",
",",
"\"errors\"",
"=>",
"$",
"this",
"->",
"_errors",
")",... | Ajax render function
@return string | [
"Ajax",
"render",
"function"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/AjaxResponse.php#L72-L81 |
20,882 | xiewulong/yii2-fileupload | oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/XcacheClassLoader.php | XcacheClassLoader.findFile | public function findFile($class)
{
if (xcache_isset($this->prefix.$class)) {
$file = xcache_get($this->prefix.$class);
} else {
xcache_set($this->prefix.$class, $file = $this->classFinder->findFile($class));
}
return $file;
} | php | public function findFile($class)
{
if (xcache_isset($this->prefix.$class)) {
$file = xcache_get($this->prefix.$class);
} else {
xcache_set($this->prefix.$class, $file = $this->classFinder->findFile($class));
}
return $file;
} | [
"public",
"function",
"findFile",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"xcache_isset",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"class",
")",
")",
"{",
"$",
"file",
"=",
"xcache_get",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"class",
")",
... | Finds a file by class name while caching lookups to Xcache.
@param string $class A class name to resolve to file
@return string|null | [
"Finds",
"a",
"file",
"by",
"class",
"name",
"while",
"caching",
"lookups",
"to",
"Xcache",
"."
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/XcacheClassLoader.php#L114-L123 |
20,883 | stk2k/net-driver | src/Http/HttpRequest.php | HttpRequest.addHttpHeader | public function addHttpHeader($http_header, $value)
{
$field = EnumRequestOption::HTTP_HEADERS;
$http_headers = isset($this->options[$field]) ? $this->options[$field] : [];
foreach($http_headers as $key => $header){
if (strpos($header, $http_header) === 0){
$http... | php | public function addHttpHeader($http_header, $value)
{
$field = EnumRequestOption::HTTP_HEADERS;
$http_headers = isset($this->options[$field]) ? $this->options[$field] : [];
foreach($http_headers as $key => $header){
if (strpos($header, $http_header) === 0){
$http... | [
"public",
"function",
"addHttpHeader",
"(",
"$",
"http_header",
",",
"$",
"value",
")",
"{",
"$",
"field",
"=",
"EnumRequestOption",
"::",
"HTTP_HEADERS",
";",
"$",
"http_headers",
"=",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"field",
"]",
... | Add HTTP Header
@param string $http_header
@param string $value | [
"Add",
"HTTP",
"Header"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpRequest.php#L74-L88 |
20,884 | stk2k/net-driver | src/Http/HttpRequest.php | HttpRequest.getHttpHeaders | public function getHttpHeaders()
{
$field = EnumRequestOption::HTTP_HEADERS;
$http_deaders = isset($this->options[$field]) ? $this->options[$field] : [];
$http_deaders = array_merge($this->getDefaultHttpHeaders(), $http_deaders);
return $http_deaders;
} | php | public function getHttpHeaders()
{
$field = EnumRequestOption::HTTP_HEADERS;
$http_deaders = isset($this->options[$field]) ? $this->options[$field] : [];
$http_deaders = array_merge($this->getDefaultHttpHeaders(), $http_deaders);
return $http_deaders;
} | [
"public",
"function",
"getHttpHeaders",
"(",
")",
"{",
"$",
"field",
"=",
"EnumRequestOption",
"::",
"HTTP_HEADERS",
";",
"$",
"http_deaders",
"=",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"field",
"]",
")",
"?",
"$",
"this",
"->",
"options"... | Get HTTP headers
@return array | [
"Get",
"HTTP",
"headers"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpRequest.php#L95-L103 |
20,885 | stk2k/net-driver | src/Http/HttpRequest.php | HttpRequest.getExtraOptions | public function getExtraOptions()
{
$field = EnumRequestOption::EXTRA_OPTIONS;
return isset($this->options[$field]) ? $this->options[$field] : [];
} | php | public function getExtraOptions()
{
$field = EnumRequestOption::EXTRA_OPTIONS;
return isset($this->options[$field]) ? $this->options[$field] : [];
} | [
"public",
"function",
"getExtraOptions",
"(",
")",
"{",
"$",
"field",
"=",
"EnumRequestOption",
"::",
"EXTRA_OPTIONS",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"field",
"]",
")",
"?",
"$",
"this",
"->",
"options",
"[",
"$",
... | Get extra options
@return array | [
"Get",
"extra",
"options"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpRequest.php#L110-L114 |
20,886 | stk2k/net-driver | src/Http/HttpRequest.php | HttpRequest.getVerbose | public function getVerbose()
{
$field = EnumRequestOption::VERBOSE;
return isset($this->options[$field]) ? $this->options[$field] : false;
} | php | public function getVerbose()
{
$field = EnumRequestOption::VERBOSE;
return isset($this->options[$field]) ? $this->options[$field] : false;
} | [
"public",
"function",
"getVerbose",
"(",
")",
"{",
"$",
"field",
"=",
"EnumRequestOption",
"::",
"VERBOSE",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"field",
"]",
")",
"?",
"$",
"this",
"->",
"options",
"[",
"$",
"field",
... | Get verbose options
@return bool | [
"Get",
"verbose",
"options"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpRequest.php#L121-L125 |
20,887 | GrupaZero/api | src/Gzero/Api/Transformer/ContentTransformer.php | ContentTransformer.transform | public function transform($content)
{
$content = $this->entityToArray(Content::class, $content);
return [
'id' => $this->setNullableValue($content['id']),
'parentId' => $this->setNullableValue($content['parent_id']),
'type' => $co... | php | public function transform($content)
{
$content = $this->entityToArray(Content::class, $content);
return [
'id' => $this->setNullableValue($content['id']),
'parentId' => $this->setNullableValue($content['parent_id']),
'type' => $co... | [
"public",
"function",
"transform",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"Content",
"::",
"class",
",",
"$",
"content",
")",
";",
"return",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"setNullableValue",
... | Transforms content entity
@param Content|array $content Content entity
@return array | [
"Transforms",
"content",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/ContentTransformer.php#L46-L67 |
20,888 | GrupaZero/api | src/Gzero/Api/Transformer/FileTransformer.php | FileTransformer.transform | public function transform($file)
{
$thumb = null;
if ($file->type === 'image') {
$width = config('gzero.image.thumb.width');
$height = config('gzero.image.thumb.height');
$thumb = croppaUrl($file->getFullPath(), $width, $height);
}
$file = $thi... | php | public function transform($file)
{
$thumb = null;
if ($file->type === 'image') {
$width = config('gzero.image.thumb.width');
$height = config('gzero.image.thumb.height');
$thumb = croppaUrl($file->getFullPath(), $width, $height);
}
$file = $thi... | [
"public",
"function",
"transform",
"(",
"$",
"file",
")",
"{",
"$",
"thumb",
"=",
"null",
";",
"if",
"(",
"$",
"file",
"->",
"type",
"===",
"'image'",
")",
"{",
"$",
"width",
"=",
"config",
"(",
"'gzero.image.thumb.width'",
")",
";",
"$",
"height",
"... | Transforms file entity
@param File|array $file file entity
@return array | [
"Transforms",
"file",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/FileTransformer.php#L35-L61 |
20,889 | GrupaZero/api | src/Gzero/Api/Transformer/FileTransformer.php | FileTransformer.setPivotNullableValue | private function setPivotNullableValue($file, $key)
{
if (array_key_exists('pivot', $file)) {
return $this->setNullableValue($file['pivot'][$key]);
}
return null;
} | php | private function setPivotNullableValue($file, $key)
{
if (array_key_exists('pivot', $file)) {
return $this->setNullableValue($file['pivot'][$key]);
}
return null;
} | [
"private",
"function",
"setPivotNullableValue",
"(",
"$",
"file",
",",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'pivot'",
",",
"$",
"file",
")",
")",
"{",
"return",
"$",
"this",
"->",
"setNullableValue",
"(",
"$",
"file",
"[",
"'pivot'"... | Returns pivot integer value or null
@param array $file file to check for pivot
@param string $key to evaluate
@return int|null | [
"Returns",
"pivot",
"integer",
"value",
"or",
"null"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/FileTransformer.php#L96-L103 |
20,890 | Visithor/visithor | src/Visithor/Executor/Executor.php | Executor.execute | public function execute(
UrlChain $urlChain,
RendererInterface $renderer,
OutputInterface $output
) {
$result = 0;
foreach ($urlChain->getUrls() as $url) {
$result = $result | $this->executeUrl(
$this->client,
$url,
... | php | public function execute(
UrlChain $urlChain,
RendererInterface $renderer,
OutputInterface $output
) {
$result = 0;
foreach ($urlChain->getUrls() as $url) {
$result = $result | $this->executeUrl(
$this->client,
$url,
... | [
"public",
"function",
"execute",
"(",
"UrlChain",
"$",
"urlChain",
",",
"RendererInterface",
"$",
"renderer",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"result",
"=",
"0",
";",
"foreach",
"(",
"$",
"urlChain",
"->",
"getUrls",
"(",
")",
"as",
... | Renders the output of the result of executing some urls given a client
instance
If all urls are executed as expected, then the result of the operation
will be 0. Otherwise, the result will be 1.
@param UrlChain $urlChain Url chain
@param RendererInterface $renderer Renderer
@param OutputInterface $output ... | [
"Renders",
"the",
"output",
"of",
"the",
"result",
"of",
"executing",
"some",
"urls",
"given",
"a",
"client",
"instance"
] | 201ba2cfc536a0875983c79226947aa20b9f4dca | https://github.com/Visithor/visithor/blob/201ba2cfc536a0875983c79226947aa20b9f4dca/src/Visithor/Executor/Executor.php#L71-L88 |
20,891 | Visithor/visithor | src/Visithor/Executor/Executor.php | Executor.executeUrl | protected function executeUrl(
ClientInterface $client,
Url $url,
RendererInterface $renderer,
OutputInterface $output
) {
$resultHTTPCode = $client->getResponseHTTPCode($url);
$resultExecution = in_array(
$resultHTTPCode,
$url->getAcceptableHt... | php | protected function executeUrl(
ClientInterface $client,
Url $url,
RendererInterface $renderer,
OutputInterface $output
) {
$resultHTTPCode = $client->getResponseHTTPCode($url);
$resultExecution = in_array(
$resultHTTPCode,
$url->getAcceptableHt... | [
"protected",
"function",
"executeUrl",
"(",
"ClientInterface",
"$",
"client",
",",
"Url",
"$",
"url",
",",
"RendererInterface",
"$",
"renderer",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"resultHTTPCode",
"=",
"$",
"client",
"->",
"getResponseHTTPCod... | Executes an URL and render the result given a renderer.
If the url is executed as expected, then the result of the operation will
be 0. Otherwise, the result will be 1.
@param ClientInterface $client Client
@param Url $url Url
@param RendererInterface $renderer Renderer
@param OutputInterface ... | [
"Executes",
"an",
"URL",
"and",
"render",
"the",
"result",
"given",
"a",
"renderer",
"."
] | 201ba2cfc536a0875983c79226947aa20b9f4dca | https://github.com/Visithor/visithor/blob/201ba2cfc536a0875983c79226947aa20b9f4dca/src/Visithor/Executor/Executor.php#L115-L137 |
20,892 | OKTOTV/OktolabMediaBundle | Model/StreamService.php | StreamService.createStream | public function createStream($serverconfig = null)
{
if ($serverconfig == null) {
$serverconfig = $this->default_streamserver_config;
}
$stream = new $this->stream_class;
$stream->setRtmpServer($this->streamserver_config[$serverconfig]['rtmp_url']);
$stream->setRt... | php | public function createStream($serverconfig = null)
{
if ($serverconfig == null) {
$serverconfig = $this->default_streamserver_config;
}
$stream = new $this->stream_class;
$stream->setRtmpServer($this->streamserver_config[$serverconfig]['rtmp_url']);
$stream->setRt... | [
"public",
"function",
"createStream",
"(",
"$",
"serverconfig",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"serverconfig",
"==",
"null",
")",
"{",
"$",
"serverconfig",
"=",
"$",
"this",
"->",
"default_streamserver_config",
";",
"}",
"$",
"stream",
"=",
"new",
... | returns a new stream object preset with default streamserver config | [
"returns",
"a",
"new",
"stream",
"object",
"preset",
"with",
"default",
"streamserver",
"config"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/StreamService.php#L36-L45 |
20,893 | OKTOTV/OktolabMediaBundle | Model/StreamService.php | StreamService.startRecording | public function startRecording($stream)
{
$parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
$rtmp_app = end($parts);
$success = $this->record(
$this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
$rtmp_app,
... | php | public function startRecording($stream)
{
$parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
$rtmp_app = end($parts);
$success = $this->record(
$this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
$rtmp_app,
... | [
"public",
"function",
"startRecording",
"(",
"$",
"stream",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"streamserver_config",
"[",
"$",
"stream",
"->",
"getRtmpServer",
"(",
")",
"]",
"[",
"'rtmp_url'",
"]",
")",
";",
"... | start recording a stream. | [
"start",
"recording",
"a",
"stream",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/StreamService.php#L78-L100 |
20,894 | OKTOTV/OktolabMediaBundle | Model/StreamService.php | StreamService.endRecording | public function endRecording($stream)
{
$parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
$rtmp_app = end($parts);
$success = $this->record(
$this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
$rtmp_app,
... | php | public function endRecording($stream)
{
$parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
$rtmp_app = end($parts);
$success = $this->record(
$this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
$rtmp_app,
... | [
"public",
"function",
"endRecording",
"(",
"$",
"stream",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"streamserver_config",
"[",
"$",
"stream",
"->",
"getRtmpServer",
"(",
")",
"]",
"[",
"'rtmp_url'",
"]",
")",
";",
"$"... | end recording a stream | [
"end",
"recording",
"a",
"stream"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/StreamService.php#L105-L128 |
20,895 | OKTOTV/OktolabMediaBundle | Model/StreamService.php | StreamService.addPublishToAdress | public function addPublishToAdress($stream, $rtmp_adress, $clientid, $new_name, $type = 'publisher', $srv = null)
{
return $this->redirect(
$stream->getRtmpApp(),
$stream->getUniqID(),
$rtmp_adress,
$clientid,
$new_name,
$type,
... | php | public function addPublishToAdress($stream, $rtmp_adress, $clientid, $new_name, $type = 'publisher', $srv = null)
{
return $this->redirect(
$stream->getRtmpApp(),
$stream->getUniqID(),
$rtmp_adress,
$clientid,
$new_name,
$type,
... | [
"public",
"function",
"addPublishToAdress",
"(",
"$",
"stream",
",",
"$",
"rtmp_adress",
",",
"$",
"clientid",
",",
"$",
"new_name",
",",
"$",
"type",
"=",
"'publisher'",
",",
"$",
"srv",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
... | adds a push to another rtmp server. can be used to send a stream to facebook, youtube, etc.
@var stream the stream you want to push
@var rtmp_adress the adress you want to push to
@var cientid the streamkey of the destination
@var new_name the app of the rtmp server you want to push to
@var srv optional nginx server to... | [
"adds",
"a",
"push",
"to",
"another",
"rtmp",
"server",
".",
"can",
"be",
"used",
"to",
"send",
"a",
"stream",
"to",
"facebook",
"youtube",
"etc",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/StreamService.php#L154-L165 |
20,896 | OKTOTV/OktolabMediaBundle | Model/StreamService.php | StreamService.drop | public function drop($control_url, $app, $name, $type = 'publisher', $addr = null, $clientid = null, $srv = null)
{
$query = [];
$query['app'] = $app;
$query['name'] = $name;
if ($addr) {
$query['addr'] = $addr;
}
if ($clientid) {
$query['clie... | php | public function drop($control_url, $app, $name, $type = 'publisher', $addr = null, $clientid = null, $srv = null)
{
$query = [];
$query['app'] = $app;
$query['name'] = $name;
if ($addr) {
$query['addr'] = $addr;
}
if ($clientid) {
$query['clie... | [
"public",
"function",
"drop",
"(",
"$",
"control_url",
",",
"$",
"app",
",",
"$",
"name",
",",
"$",
"type",
"=",
"'publisher'",
",",
"$",
"addr",
"=",
"null",
",",
"$",
"clientid",
"=",
"null",
",",
"$",
"srv",
"=",
"null",
")",
"{",
"$",
"query"... | send a drop command to the rtmp server
@var app the app name
@var name the streamkey
@var type the type for your drop command publisher|subscriber|client
@var addr the optional client adress
@var clientId the optional nginx client id
@var srv optional server{} block number within rtmp{} block. default the first is used... | [
"send",
"a",
"drop",
"command",
"to",
"the",
"rtmp",
"server"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/StreamService.php#L228-L261 |
20,897 | OKTOTV/OktolabMediaBundle | Model/StreamService.php | StreamService.redirect | public function redirect($control_url, $app, $name, $new_adress, $new_clientid, $new_name, $type = 'publisher', $srv = null)
{
$query = [];
$query['app'] = $app;
$query['name'] = $name;
$query['addr'] = $new_adress;
$query['clientid'] = $new_clientid;
$query['newname'... | php | public function redirect($control_url, $app, $name, $new_adress, $new_clientid, $new_name, $type = 'publisher', $srv = null)
{
$query = [];
$query['app'] = $app;
$query['name'] = $name;
$query['addr'] = $new_adress;
$query['clientid'] = $new_clientid;
$query['newname'... | [
"public",
"function",
"redirect",
"(",
"$",
"control_url",
",",
"$",
"app",
",",
"$",
"name",
",",
"$",
"new_adress",
",",
"$",
"new_clientid",
",",
"$",
"new_name",
",",
"$",
"type",
"=",
"'publisher'",
",",
"$",
"srv",
"=",
"null",
")",
"{",
"$",
... | sends a redirect command to the rtmp server
@var app the rtmp app name
@var name the streamkey
@var new_adress the optional client adress
@var clientId the optional nginx client id
@var new_name new stream name to redirect to (streamkey)
@var new_clientid optional nginx client id | [
"sends",
"a",
"redirect",
"command",
"to",
"the",
"rtmp",
"server"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/StreamService.php#L272-L302 |
20,898 | wenbinye/PhalconX | src/Http/Request.php | Request.getFile | public function getFile($name)
{
if (!isset($this->files)) {
$files = $this->getUploadedFiles();
foreach ($files as $file) {
$key = $file->getKey();
if (isset($key)) {
$this->files[$key] = $file;
} else {
... | php | public function getFile($name)
{
if (!isset($this->files)) {
$files = $this->getUploadedFiles();
foreach ($files as $file) {
$key = $file->getKey();
if (isset($key)) {
$this->files[$key] = $file;
} else {
... | [
"public",
"function",
"getFile",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"files",
")",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getUploadedFiles",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$"... | Gets upload file object by name
@return Phalcon\Http\Request\File | [
"Gets",
"upload",
"file",
"object",
"by",
"name"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Http/Request.php#L50-L68 |
20,899 | wenbinye/PhalconX | src/Http/Request.php | Request.getBody | public function getBody()
{
if (!isset($this->body)) {
if (function_exists('http_get_request_body')) {
$this->body = http_get_request_body();
} else {
$this->body = @file_get_contents('php://input');
}
}
return $this->body;
... | php | public function getBody()
{
if (!isset($this->body)) {
if (function_exists('http_get_request_body')) {
$this->body = http_get_request_body();
} else {
$this->body = @file_get_contents('php://input');
}
}
return $this->body;
... | [
"public",
"function",
"getBody",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"body",
")",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'http_get_request_body'",
")",
")",
"{",
"$",
"this",
"->",
"body",
"=",
"http_get_request_body",
... | Gets post body content
@return string | [
"Gets",
"post",
"body",
"content"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Http/Request.php#L75-L85 |
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.