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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
233,500 | jumilla/php-source-generator | sources/FileGenerator.php | FileGenerator.read | protected function read($stub_path)
{
$content = $this->stubbox->read($stub_path);
if ($content === false) {
throw new InvalidArgumentException("File '$stub_path' is not found.");
}
return $content;
} | php | protected function read($stub_path)
{
$content = $this->stubbox->read($stub_path);
if ($content === false) {
throw new InvalidArgumentException("File '$stub_path' is not found.");
}
return $content;
} | [
"protected",
"function",
"read",
"(",
"$",
"stub_path",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"stubbox",
"->",
"read",
"(",
"$",
"stub_path",
")",
";",
"if",
"(",
"$",
"content",
"===",
"false",
")",
"{",
"throw",
"new",
"InvalidArgumentExc... | Read stub file
@param string $content
@param array $arguments
@return mixed | [
"Read",
"stub",
"file"
] | 7982dc2dc91504d2119fc09b949c28dcc7c3b9d9 | https://github.com/jumilla/php-source-generator/blob/7982dc2dc91504d2119fc09b949c28dcc7c3b9d9/sources/FileGenerator.php#L345-L354 |
233,501 | civicrm/civicrm-setup | src/Setup/Template.php | Template.getContent | public function getContent($infile) {
$contents = $this->smarty->fetch($infile);
if ($this->filetype === 'php') {
$this->beautifier->setInputString($contents);
$this->beautifier->process();
$contents = $this->beautifier->get();
// The beautifier isn't as beautiful as one would hope. Her... | php | public function getContent($infile) {
$contents = $this->smarty->fetch($infile);
if ($this->filetype === 'php') {
$this->beautifier->setInputString($contents);
$this->beautifier->process();
$contents = $this->beautifier->get();
// The beautifier isn't as beautiful as one would hope. Her... | [
"public",
"function",
"getContent",
"(",
"$",
"infile",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"->",
"smarty",
"->",
"fetch",
"(",
"$",
"infile",
")",
";",
"if",
"(",
"$",
"this",
"->",
"filetype",
"===",
"'php'",
")",
"{",
"$",
"this",
"->",... | Run template generator.
@param string $infile
Filename of the template, without a path.
@return string | [
"Run",
"template",
"generator",
"."
] | 556b312faf78781c85c4fc4ae6c1c3b658da9e09 | https://github.com/civicrm/civicrm-setup/blob/556b312faf78781c85c4fc4ae6c1c3b658da9e09/src/Setup/Template.php#L41-L62 |
233,502 | CampaignChain/core | Entity/Milestone.php | Milestone.getJavascriptTimestamp | public function getJavascriptTimestamp()
{
$date = new \DateTime($this->startDate->format('Y-m-d H:i:s'));
$javascriptTimestamp = $date->getTimestamp()*1000;
return $javascriptTimestamp;
} | php | public function getJavascriptTimestamp()
{
$date = new \DateTime($this->startDate->format('Y-m-d H:i:s'));
$javascriptTimestamp = $date->getTimestamp()*1000;
return $javascriptTimestamp;
} | [
"public",
"function",
"getJavascriptTimestamp",
"(",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"this",
"->",
"startDate",
"->",
"format",
"(",
"'Y-m-d H:i:s'",
")",
")",
";",
"$",
"javascriptTimestamp",
"=",
"$",
"date",
"->",
"getTime... | Get time in JavaScript timestamp format
@return \DateTime | [
"Get",
"time",
"in",
"JavaScript",
"timestamp",
"format"
] | 82526548a223ed49fcd65ed7c23638544499775f | https://github.com/CampaignChain/core/blob/82526548a223ed49fcd65ed7c23638544499775f/Entity/Milestone.php#L69-L74 |
233,503 | jumilla/php-source-generator | sources/Php/ConfigGenerator.php | ConfigGenerator.generate | public function generate(array $config, $namespace = null)
{
$this->writeLine('<?php'.PHP_EOL);
if ($namespace) {
$this->writeLine("namespace $namespace;".PHP_EOL);
}
$this->indent = 0;
$this->writeLine('return [');
$this->generateArray($config);
... | php | public function generate(array $config, $namespace = null)
{
$this->writeLine('<?php'.PHP_EOL);
if ($namespace) {
$this->writeLine("namespace $namespace;".PHP_EOL);
}
$this->indent = 0;
$this->writeLine('return [');
$this->generateArray($config);
... | [
"public",
"function",
"generate",
"(",
"array",
"$",
"config",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"writeLine",
"(",
"'<?php'",
".",
"PHP_EOL",
")",
";",
"if",
"(",
"$",
"namespace",
")",
"{",
"$",
"this",
"->",
"writeLin... | Generate php source text.
@param array $config
@param string $namespace
@return string | [
"Generate",
"php",
"source",
"text",
"."
] | 7982dc2dc91504d2119fc09b949c28dcc7c3b9d9 | https://github.com/jumilla/php-source-generator/blob/7982dc2dc91504d2119fc09b949c28dcc7c3b9d9/sources/Php/ConfigGenerator.php#L40-L57 |
233,504 | jumilla/php-source-generator | sources/Php/ConfigGenerator.php | ConfigGenerator.generateArray | private function generateArray(array $config)
{
++$this->indent;
foreach ($config as $key => $value) {
if (is_null($value)) {
if (is_string($key)) {
$this->writeLine(sprintf("'%s' => %s,", $key, 'null'));
} else {
$... | php | private function generateArray(array $config)
{
++$this->indent;
foreach ($config as $key => $value) {
if (is_null($value)) {
if (is_string($key)) {
$this->writeLine(sprintf("'%s' => %s,", $key, 'null'));
} else {
$... | [
"private",
"function",
"generateArray",
"(",
"array",
"$",
"config",
")",
"{",
"++",
"$",
"this",
"->",
"indent",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",... | Generate php array elements
@param array $config | [
"Generate",
"php",
"array",
"elements"
] | 7982dc2dc91504d2119fc09b949c28dcc7c3b9d9 | https://github.com/jumilla/php-source-generator/blob/7982dc2dc91504d2119fc09b949c28dcc7c3b9d9/sources/Php/ConfigGenerator.php#L64-L113 |
233,505 | jumilla/php-source-generator | sources/Php/ConfigGenerator.php | ConfigGenerator.writeLine | private function writeLine($line)
{
$this->text .= str_repeat(' ', $this->indent * 4);
$this->text .= $line;
$this->text .= PHP_EOL;
} | php | private function writeLine($line)
{
$this->text .= str_repeat(' ', $this->indent * 4);
$this->text .= $line;
$this->text .= PHP_EOL;
} | [
"private",
"function",
"writeLine",
"(",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"text",
".=",
"str_repeat",
"(",
"' '",
",",
"$",
"this",
"->",
"indent",
"*",
"4",
")",
";",
"$",
"this",
"->",
"text",
".=",
"$",
"line",
";",
"$",
"this",
"->",... | Write a source line.
@param string $line | [
"Write",
"a",
"source",
"line",
"."
] | 7982dc2dc91504d2119fc09b949c28dcc7c3b9d9 | https://github.com/jumilla/php-source-generator/blob/7982dc2dc91504d2119fc09b949c28dcc7c3b9d9/sources/Php/ConfigGenerator.php#L120-L125 |
233,506 | kgilden/php-digidoc | src/Signature.php | Signature.createFromSoap | public static function createFromSoap(SignatureInfo $info)
{
$signature = new static();
$signature->id = $info->Id;
$signature->seal();
return $signature;
} | php | public static function createFromSoap(SignatureInfo $info)
{
$signature = new static();
$signature->id = $info->Id;
$signature->seal();
return $signature;
} | [
"public",
"static",
"function",
"createFromSoap",
"(",
"SignatureInfo",
"$",
"info",
")",
"{",
"$",
"signature",
"=",
"new",
"static",
"(",
")",
";",
"$",
"signature",
"->",
"id",
"=",
"$",
"info",
"->",
"Id",
";",
"$",
"signature",
"->",
"seal",
"(",
... | Creates a new Signature object from its Soap counterpart.
@internal
@param SignatureInfo $info
@return Signature | [
"Creates",
"a",
"new",
"Signature",
"object",
"from",
"its",
"Soap",
"counterpart",
"."
] | 88112ba05688fc1d32c0ff948cb8e1f4d2f264d3 | https://github.com/kgilden/php-digidoc/blob/88112ba05688fc1d32c0ff948cb8e1f4d2f264d3/src/Signature.php#L74-L81 |
233,507 | ionux/phactor | src/ASN1.php | ASN1.pemInitialDataCheck | private function pemInitialDataCheck($keypair)
{
if (true === empty($keypair) || false === is_array($keypair) || strlen($keypair[0]) < 62 || strlen($keypair[1]) < 126) {
throw new \Exception('Invalid or corrupt secp256k1 keypair provided. Cannot encode the keys to PEM format. Value checked was... | php | private function pemInitialDataCheck($keypair)
{
if (true === empty($keypair) || false === is_array($keypair) || strlen($keypair[0]) < 62 || strlen($keypair[1]) < 126) {
throw new \Exception('Invalid or corrupt secp256k1 keypair provided. Cannot encode the keys to PEM format. Value checked was... | [
"private",
"function",
"pemInitialDataCheck",
"(",
"$",
"keypair",
")",
"{",
"if",
"(",
"true",
"===",
"empty",
"(",
"$",
"keypair",
")",
"||",
"false",
"===",
"is_array",
"(",
"$",
"keypair",
")",
"||",
"strlen",
"(",
"$",
"keypair",
"[",
"0",
"]",
... | Ensures the data we want to PEM encode is acceptable.
@param array $keypair The values to check.
@throws \Exception | [
"Ensures",
"the",
"data",
"we",
"want",
"to",
"PEM",
"encode",
"is",
"acceptable",
"."
] | 667064d3930e043fd78abed9a2324aee52466fa5 | https://github.com/ionux/phactor/blob/667064d3930e043fd78abed9a2324aee52466fa5/src/ASN1.php#L113-L118 |
233,508 | ionux/phactor | src/ASN1.php | ASN1.pemKeyLenCheck | private function pemKeyLenCheck($values)
{
if (!is_array($values) || strlen($values[0]) < 62 || strlen($values[1]) < 126) {
throw new \Exception('Invalid or corrupt secp256k1 key provided. Cannot decode the supplied PEM data. Key lengths too short. Values checked were "' . var_export($values[0]... | php | private function pemKeyLenCheck($values)
{
if (!is_array($values) || strlen($values[0]) < 62 || strlen($values[1]) < 126) {
throw new \Exception('Invalid or corrupt secp256k1 key provided. Cannot decode the supplied PEM data. Key lengths too short. Values checked were "' . var_export($values[0]... | [
"private",
"function",
"pemKeyLenCheck",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
"||",
"strlen",
"(",
"$",
"values",
"[",
"0",
"]",
")",
"<",
"62",
"||",
"strlen",
"(",
"$",
"values",
"[",
"1",
"]",
")",... | Ensures the decoded PEM key lengths are acceptable.
@param array $values The key values to check.
@throws \Exception | [
"Ensures",
"the",
"decoded",
"PEM",
"key",
"lengths",
"are",
"acceptable",
"."
] | 667064d3930e043fd78abed9a2324aee52466fa5 | https://github.com/ionux/phactor/blob/667064d3930e043fd78abed9a2324aee52466fa5/src/ASN1.php#L139-L144 |
233,509 | ionux/phactor | src/ASN1.php | ASN1.pemDataClean | private function pemDataClean($value)
{
$value = str_ireplace('-----BEGIN EC PRIVATE KEY-----', '', $value);
$value = str_ireplace('-----END EC PRIVATE KEY-----', '', $value);
$value = str_ireplace("\r", '', trim($value));
$value = str_ireplace("\n", '', trim($value));
$value... | php | private function pemDataClean($value)
{
$value = str_ireplace('-----BEGIN EC PRIVATE KEY-----', '', $value);
$value = str_ireplace('-----END EC PRIVATE KEY-----', '', $value);
$value = str_ireplace("\r", '', trim($value));
$value = str_ireplace("\n", '', trim($value));
$value... | [
"private",
"function",
"pemDataClean",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"str_ireplace",
"(",
"'-----BEGIN EC PRIVATE KEY-----'",
",",
"''",
",",
"$",
"value",
")",
";",
"$",
"value",
"=",
"str_ireplace",
"(",
"'-----END EC PRIVATE KEY-----'",
",",... | Cleans the PEM data of unwanted data.
@param string $value The value to clean.
@return string $value The cleaned value. | [
"Cleans",
"the",
"PEM",
"data",
"of",
"unwanted",
"data",
"."
] | 667064d3930e043fd78abed9a2324aee52466fa5 | https://github.com/ionux/phactor/blob/667064d3930e043fd78abed9a2324aee52466fa5/src/ASN1.php#L165-L174 |
233,510 | ionux/phactor | src/ASN1.php | ASN1.decodeOID | public function decodeOID($data)
{
$bin_data = array();
$index = 0;
$binary_string = '';
$oid = array();
// first two numbers are: (40*x)+y
// all next chars are 7-bit numbers
foreach ($data as $key => $value) {
$bin_data[$i... | php | public function decodeOID($data)
{
$bin_data = array();
$index = 0;
$binary_string = '';
$oid = array();
// first two numbers are: (40*x)+y
// all next chars are 7-bit numbers
foreach ($data as $key => $value) {
$bin_data[$i... | [
"public",
"function",
"decodeOID",
"(",
"$",
"data",
")",
"{",
"$",
"bin_data",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"$",
"binary_string",
"=",
"''",
";",
"$",
"oid",
"=",
"array",
"(",
")",
";",
"// first two numbers are: (40*x)+y... | Decodes an OID hex value obtained from
a PEM file or other encoded key file.
@param string $data The hex OID string to decode.
@return string The decoded OID string. | [
"Decodes",
"an",
"OID",
"hex",
"value",
"obtained",
"from",
"a",
"PEM",
"file",
"or",
"other",
"encoded",
"key",
"file",
"."
] | 667064d3930e043fd78abed9a2324aee52466fa5 | https://github.com/ionux/phactor/blob/667064d3930e043fd78abed9a2324aee52466fa5/src/ASN1.php#L183-L228 |
233,511 | prooph/link-process-manager | src/Model/Task.php | Task.updateMetadata | public function updateMetadata(ProcessingMetadata $metadata)
{
$this->recordThat(TaskMetadataWasUpdated::record($this->id(), $metadata));
} | php | public function updateMetadata(ProcessingMetadata $metadata)
{
$this->recordThat(TaskMetadataWasUpdated::record($this->id(), $metadata));
} | [
"public",
"function",
"updateMetadata",
"(",
"ProcessingMetadata",
"$",
"metadata",
")",
"{",
"$",
"this",
"->",
"recordThat",
"(",
"TaskMetadataWasUpdated",
"::",
"record",
"(",
"$",
"this",
"->",
"id",
"(",
")",
",",
"$",
"metadata",
")",
")",
";",
"}"
] | Simply override existing metadata with the new one
@param ProcessingMetadata $metadata | [
"Simply",
"override",
"existing",
"metadata",
"with",
"the",
"new",
"one"
] | 3d6c8bdc72e855786227747bf06bcf8221f7860a | https://github.com/prooph/link-process-manager/blob/3d6c8bdc72e855786227747bf06bcf8221f7860a/src/Model/Task.php#L81-L84 |
233,512 | malenkiki/aleavatar | src/Malenki/Aleavatar/Primitive/Triangle.php | Triangle.point | public function point($int_x, $int_y)
{
if (count($this->arr_points) >= 3) {
throw new \RuntimeException('Triangle has only three points!');
}
return parent::point($int_x, $int_y);
} | php | public function point($int_x, $int_y)
{
if (count($this->arr_points) >= 3) {
throw new \RuntimeException('Triangle has only three points!');
}
return parent::point($int_x, $int_y);
} | [
"public",
"function",
"point",
"(",
"$",
"int_x",
",",
"$",
"int_y",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"arr_points",
")",
">=",
"3",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Triangle has only three points!'",
")",
";... | Set one point by giving its coordinates.
@param integer $int_x
@param integer $int_y
@throws \RuntimeException If you try to set 4th point.
@access public
@return void | [
"Set",
"one",
"point",
"by",
"giving",
"its",
"coordinates",
"."
] | 91affa83f8580c8e6da62c77ce34b1c4451784bf | https://github.com/malenkiki/aleavatar/blob/91affa83f8580c8e6da62c77ce34b1c4451784bf/src/Malenki/Aleavatar/Primitive/Triangle.php#L44-L51 |
233,513 | Nono1971/Doctrine-MetadataGrapher | lib/Onurb/Doctrine/ORMMetadataGrapher/YumlMetadataGrapher/ClassStore.php | ClassStore.getClassByName | public function getClassByName($className)
{
$classMap = $this->getClassMap($this->splitClassName($className)) . "[\"__class\"]";
$return = null;
eval(
"if (isset(\$this->indexedClasses$classMap)) {"
. " \$return = \$this->indexedClasses$classMap;"
. "}"
... | php | public function getClassByName($className)
{
$classMap = $this->getClassMap($this->splitClassName($className)) . "[\"__class\"]";
$return = null;
eval(
"if (isset(\$this->indexedClasses$classMap)) {"
. " \$return = \$this->indexedClasses$classMap;"
. "}"
... | [
"public",
"function",
"getClassByName",
"(",
"$",
"className",
")",
"{",
"$",
"classMap",
"=",
"$",
"this",
"->",
"getClassMap",
"(",
"$",
"this",
"->",
"splitClassName",
"(",
"$",
"className",
")",
")",
".",
"\"[\\\"__class\\\"]\"",
";",
"$",
"return",
"=... | Retrieve a class metadata instance by name from the given array
@param string $className
@return ClassMetadata|null | [
"Retrieve",
"a",
"class",
"metadata",
"instance",
"by",
"name",
"from",
"the",
"given",
"array"
] | 414b95f81d36b6530b083b296c5eeb700679ab3b | https://github.com/Nono1971/Doctrine-MetadataGrapher/blob/414b95f81d36b6530b083b296c5eeb700679ab3b/lib/Onurb/Doctrine/ORMMetadataGrapher/YumlMetadataGrapher/ClassStore.php#L61-L73 |
233,514 | Nono1971/Doctrine-MetadataGrapher | lib/Onurb/Doctrine/ORMMetadataGrapher/YumlMetadataGrapher/ClassStore.php | ClassStore.getParent | public function getParent(ClassMetadata $class)
{
$className = $class->getName();
if (!class_exists($className) || (!$parent = get_parent_class($className))) {
return null;
}
return $this->getClassByName($parent);
} | php | public function getParent(ClassMetadata $class)
{
$className = $class->getName();
if (!class_exists($className) || (!$parent = get_parent_class($className))) {
return null;
}
return $this->getClassByName($parent);
} | [
"public",
"function",
"getParent",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"className",
"=",
"$",
"class",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"className",
")",
"||",
"(",
"!",
"$",
"parent",
"=",
"get... | Retrieve a class metadata's parent class metadata
@param ClassMetadata $class
@return ClassMetadata|null | [
"Retrieve",
"a",
"class",
"metadata",
"s",
"parent",
"class",
"metadata"
] | 414b95f81d36b6530b083b296c5eeb700679ab3b | https://github.com/Nono1971/Doctrine-MetadataGrapher/blob/414b95f81d36b6530b083b296c5eeb700679ab3b/lib/Onurb/Doctrine/ORMMetadataGrapher/YumlMetadataGrapher/ClassStore.php#L82-L90 |
233,515 | sulu/SuluAutomationBundle | EventSubscriber/PHPTaskEventSubscriber.php | PHPTaskEventSubscriber.pushRequest | public function pushRequest(TaskEvent $event)
{
$task = $this->taskRepository->findByTaskId($event->getTask()->getUuid());
if (!$task) {
// current task is not managed by this bundle
return;
}
$request = new Request(
[],
[],
... | php | public function pushRequest(TaskEvent $event)
{
$task = $this->taskRepository->findByTaskId($event->getTask()->getUuid());
if (!$task) {
// current task is not managed by this bundle
return;
}
$request = new Request(
[],
[],
... | [
"public",
"function",
"pushRequest",
"(",
"TaskEvent",
"$",
"event",
")",
"{",
"$",
"task",
"=",
"$",
"this",
"->",
"taskRepository",
"->",
"findByTaskId",
"(",
"$",
"event",
"->",
"getTask",
"(",
")",
"->",
"getUuid",
"(",
")",
")",
";",
"if",
"(",
... | Create and push new request to requests-stack.
@param TaskEvent $event | [
"Create",
"and",
"push",
"new",
"request",
"to",
"requests",
"-",
"stack",
"."
] | 2cfc3a7122a96939d2f203f6fe54bcb74e2cfd46 | https://github.com/sulu/SuluAutomationBundle/blob/2cfc3a7122a96939d2f203f6fe54bcb74e2cfd46/EventSubscriber/PHPTaskEventSubscriber.php#L53-L72 |
233,516 | sulu/SuluAutomationBundle | EventSubscriber/PHPTaskEventSubscriber.php | PHPTaskEventSubscriber.popRequest | public function popRequest(TaskEvent $event)
{
$request = $this->requestStack->getCurrentRequest();
if (!$request || $request->attributes->get('_task_id') !== $event->getTask()->getUuid()) {
// current request was not created for current task
return;
}
$this... | php | public function popRequest(TaskEvent $event)
{
$request = $this->requestStack->getCurrentRequest();
if (!$request || $request->attributes->get('_task_id') !== $event->getTask()->getUuid()) {
// current request was not created for current task
return;
}
$this... | [
"public",
"function",
"popRequest",
"(",
"TaskEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"requestStack",
"->",
"getCurrentRequest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"request",
"||",
"$",
"request",
"->",
"attributes",
"->"... | Pop request from request stack.
@param TaskEvent $event | [
"Pop",
"request",
"from",
"request",
"stack",
"."
] | 2cfc3a7122a96939d2f203f6fe54bcb74e2cfd46 | https://github.com/sulu/SuluAutomationBundle/blob/2cfc3a7122a96939d2f203f6fe54bcb74e2cfd46/EventSubscriber/PHPTaskEventSubscriber.php#L79-L89 |
233,517 | kgilden/php-digidoc | src/Encoder.php | Encoder.decode | public function decode($data)
{
$decoded = '';
$delimiters = "\n";
$token = strtok($data, $delimiters);
while (false !== $token) {
$decoded .= base64_decode($token);
$token = strtok($delimiters);
}
return $decoded;
} | php | public function decode($data)
{
$decoded = '';
$delimiters = "\n";
$token = strtok($data, $delimiters);
while (false !== $token) {
$decoded .= base64_decode($token);
$token = strtok($delimiters);
}
return $decoded;
} | [
"public",
"function",
"decode",
"(",
"$",
"data",
")",
"{",
"$",
"decoded",
"=",
"''",
";",
"$",
"delimiters",
"=",
"\"\\n\"",
";",
"$",
"token",
"=",
"strtok",
"(",
"$",
"data",
",",
"$",
"delimiters",
")",
";",
"while",
"(",
"false",
"!==",
"$",
... | Decodes a piece of data from base64. The encoded data may be either
a long string in base64 or delimited by newline characters.
@param string $data The encoded data
@return string | [
"Decodes",
"a",
"piece",
"of",
"data",
"from",
"base64",
".",
"The",
"encoded",
"data",
"may",
"be",
"either",
"a",
"long",
"string",
"in",
"base64",
"or",
"delimited",
"by",
"newline",
"characters",
"."
] | 88112ba05688fc1d32c0ff948cb8e1f4d2f264d3 | https://github.com/kgilden/php-digidoc/blob/88112ba05688fc1d32c0ff948cb8e1f4d2f264d3/src/Encoder.php#L51-L64 |
233,518 | kgilden/php-digidoc | src/Encoder.php | Encoder.getFileContent | private function getFileContent($pathToFile)
{
$level = error_reporting(0);
$content = file_get_contents($pathToFile);
error_reporting($level);
if (false === $content) {
$error = error_get_last();
throw new RuntimeException($error['message']);
}
... | php | private function getFileContent($pathToFile)
{
$level = error_reporting(0);
$content = file_get_contents($pathToFile);
error_reporting($level);
if (false === $content) {
$error = error_get_last();
throw new RuntimeException($error['message']);
}
... | [
"private",
"function",
"getFileContent",
"(",
"$",
"pathToFile",
")",
"{",
"$",
"level",
"=",
"error_reporting",
"(",
"0",
")",
";",
"$",
"content",
"=",
"file_get_contents",
"(",
"$",
"pathToFile",
")",
";",
"error_reporting",
"(",
"$",
"level",
")",
";",... | Gets the file content.
@todo Refactor this out to some other class
@param string $pathToFile
@return string | [
"Gets",
"the",
"file",
"content",
"."
] | 88112ba05688fc1d32c0ff948cb8e1f4d2f264d3 | https://github.com/kgilden/php-digidoc/blob/88112ba05688fc1d32c0ff948cb8e1f4d2f264d3/src/Encoder.php#L75-L87 |
233,519 | PhillippOhlandt/materializecss-laravel-pagination | src/Presenters/Pagination/Materialize.php | Materialize.render | public function render()
{
if (!$this->hasPages())
return '';
return sprintf(
'<div><ul class="pagination">%s %s %s</ul></div>',
$this->getPreviousButton(),
$this->getLinks(),
$this->getNextButton()
);
} | php | public function render()
{
if (!$this->hasPages())
return '';
return sprintf(
'<div><ul class="pagination">%s %s %s</ul></div>',
$this->getPreviousButton(),
$this->getLinks(),
$this->getNextButton()
);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPages",
"(",
")",
")",
"return",
"''",
";",
"return",
"sprintf",
"(",
"'<div><ul class=\"pagination\">%s %s %s</ul></div>'",
",",
"$",
"this",
"->",
"getPreviousButton",
"(",... | Convert the URL window into Materialize CSS HTML.
@return string | [
"Convert",
"the",
"URL",
"window",
"into",
"Materialize",
"CSS",
"HTML",
"."
] | a56d0c0f4c1a069f287d13dc1c88d60ab8efac9b | https://github.com/PhillippOhlandt/materializecss-laravel-pagination/blob/a56d0c0f4c1a069f287d13dc1c88d60ab8efac9b/src/Presenters/Pagination/Materialize.php#L17-L28 |
233,520 | PhillippOhlandt/materializecss-laravel-pagination | src/Presenters/Pagination/Materialize.php | Materialize.getDisabledTextWrapper | protected function getDisabledTextWrapper($text)
{
$hide = '';
if ($text == "«") {
$text = '<i class="material-icons">chevron_left</i>';
$hide = 'hide';
} elseif ($text == "»") {
$text = '<i class="material-icons">chevron_right</i>';
... | php | protected function getDisabledTextWrapper($text)
{
$hide = '';
if ($text == "«") {
$text = '<i class="material-icons">chevron_left</i>';
$hide = 'hide';
} elseif ($text == "»") {
$text = '<i class="material-icons">chevron_right</i>';
... | [
"protected",
"function",
"getDisabledTextWrapper",
"(",
"$",
"text",
")",
"{",
"$",
"hide",
"=",
"''",
";",
"if",
"(",
"$",
"text",
"==",
"\"«\"",
")",
"{",
"$",
"text",
"=",
"'<i class=\"material-icons\">chevron_left</i>'",
";",
"$",
"hide",
"=",
"'hi... | Get HTML wrapper for disabled text.
Hide disabled arrows.
@param string $text
@return string | [
"Get",
"HTML",
"wrapper",
"for",
"disabled",
"text",
".",
"Hide",
"disabled",
"arrows",
"."
] | a56d0c0f4c1a069f287d13dc1c88d60ab8efac9b | https://github.com/PhillippOhlandt/materializecss-laravel-pagination/blob/a56d0c0f4c1a069f287d13dc1c88d60ab8efac9b/src/Presenters/Pagination/Materialize.php#L37-L50 |
233,521 | PhillippOhlandt/materializecss-laravel-pagination | src/Presenters/Pagination/Materialize.php | Materialize.getActivePageWrapper | protected function getActivePageWrapper($text)
{
$color = '';
if ($this->color) {
$color = $this->color;
}
return '<li class="active ' . $color . '"><a>' . $text . '</a></li>';
} | php | protected function getActivePageWrapper($text)
{
$color = '';
if ($this->color) {
$color = $this->color;
}
return '<li class="active ' . $color . '"><a>' . $text . '</a></li>';
} | [
"protected",
"function",
"getActivePageWrapper",
"(",
"$",
"text",
")",
"{",
"$",
"color",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"color",
")",
"{",
"$",
"color",
"=",
"$",
"this",
"->",
"color",
";",
"}",
"return",
"'<li class=\"active '",
".",... | Get HTML wrapper for active text.
@param string $text
@return string | [
"Get",
"HTML",
"wrapper",
"for",
"active",
"text",
"."
] | a56d0c0f4c1a069f287d13dc1c88d60ab8efac9b | https://github.com/PhillippOhlandt/materializecss-laravel-pagination/blob/a56d0c0f4c1a069f287d13dc1c88d60ab8efac9b/src/Presenters/Pagination/Materialize.php#L58-L67 |
233,522 | kgilden/php-digidoc | src/Ocsp/Response.php | Response.getResponseMapped | private function getResponseMapped()
{
$parser = new Asn1Parser();
$responseBasicDecoded = $parser->decodeBER(base64_decode($this->response));
return $parser->asn1map($responseBasicDecoded[0], $this->asn1->BasicOCSPResponse);
} | php | private function getResponseMapped()
{
$parser = new Asn1Parser();
$responseBasicDecoded = $parser->decodeBER(base64_decode($this->response));
return $parser->asn1map($responseBasicDecoded[0], $this->asn1->BasicOCSPResponse);
} | [
"private",
"function",
"getResponseMapped",
"(",
")",
"{",
"$",
"parser",
"=",
"new",
"Asn1Parser",
"(",
")",
";",
"$",
"responseBasicDecoded",
"=",
"$",
"parser",
"->",
"decodeBER",
"(",
"base64_decode",
"(",
"$",
"this",
"->",
"response",
")",
")",
";",
... | Decodes and maps the BasicOCSPResponse part of the response.
@return array | [
"Decodes",
"and",
"maps",
"the",
"BasicOCSPResponse",
"part",
"of",
"the",
"response",
"."
] | 88112ba05688fc1d32c0ff948cb8e1f4d2f264d3 | https://github.com/kgilden/php-digidoc/blob/88112ba05688fc1d32c0ff948cb8e1f4d2f264d3/src/Ocsp/Response.php#L169-L175 |
233,523 | sulu/SuluAutomationBundle | Serializer/TaskSerializerSubscriber.php | TaskSerializerSubscriber.onTaskSerialize | public function onTaskSerialize(ObjectEvent $event)
{
$object = $event->getObject();
if (!$object instanceof TaskInterface) {
return;
}
$handler = $this->handlerFactory->create($object->getHandlerClass());
if ($handler instanceof AutomationTaskHandlerInterface) {... | php | public function onTaskSerialize(ObjectEvent $event)
{
$object = $event->getObject();
if (!$object instanceof TaskInterface) {
return;
}
$handler = $this->handlerFactory->create($object->getHandlerClass());
if ($handler instanceof AutomationTaskHandlerInterface) {... | [
"public",
"function",
"onTaskSerialize",
"(",
"ObjectEvent",
"$",
"event",
")",
"{",
"$",
"object",
"=",
"$",
"event",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"TaskInterface",
")",
"{",
"return",
";",
"}",
"$",
"h... | Append task-name to task-serialization.
@param ObjectEvent $event | [
"Append",
"task",
"-",
"name",
"to",
"task",
"-",
"serialization",
"."
] | 2cfc3a7122a96939d2f203f6fe54bcb74e2cfd46 | https://github.com/sulu/SuluAutomationBundle/blob/2cfc3a7122a96939d2f203f6fe54bcb74e2cfd46/Serializer/TaskSerializerSubscriber.php#L68-L84 |
233,524 | notthatbad/silverstripe-rest-api | code/authenticators/AuthFactory.php | AuthFactory.generate_token | public static function generate_token($user) {
$generator = new \RandomGenerator();
$tokenString = $generator->randomToken();
$e = \PasswordEncryptor::create_for_algorithm('blowfish');
$salt = $e->salt($tokenString);
$token = sha1($e->encrypt($tokenString, $salt)) . substr(md5($u... | php | public static function generate_token($user) {
$generator = new \RandomGenerator();
$tokenString = $generator->randomToken();
$e = \PasswordEncryptor::create_for_algorithm('blowfish');
$salt = $e->salt($tokenString);
$token = sha1($e->encrypt($tokenString, $salt)) . substr(md5($u... | [
"public",
"static",
"function",
"generate_token",
"(",
"$",
"user",
")",
"{",
"$",
"generator",
"=",
"new",
"\\",
"RandomGenerator",
"(",
")",
";",
"$",
"tokenString",
"=",
"$",
"generator",
"->",
"randomToken",
"(",
")",
";",
"$",
"e",
"=",
"\\",
"Pas... | Generates an encrypted random token.
@param \Member $user
@throws \PasswordEncryptor_NotFoundException
@return string | [
"Generates",
"an",
"encrypted",
"random",
"token",
"."
] | aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621 | https://github.com/notthatbad/silverstripe-rest-api/blob/aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621/code/authenticators/AuthFactory.php#L26-L33 |
233,525 | notthatbad/silverstripe-rest-api | code/authenticators/AuthFactory.php | AuthFactory.get_token | public static function get_token($request) {
// try to get the token from request object
$tokenStrFromHeader = $request->getHeader('Authorization');
$tokenStrFromVar = $request->requestVar('access_token');
if (!empty($tokenStrFromHeader)) {
// string must have format: type t... | php | public static function get_token($request) {
// try to get the token from request object
$tokenStrFromHeader = $request->getHeader('Authorization');
$tokenStrFromVar = $request->requestVar('access_token');
if (!empty($tokenStrFromHeader)) {
// string must have format: type t... | [
"public",
"static",
"function",
"get_token",
"(",
"$",
"request",
")",
"{",
"// try to get the token from request object",
"$",
"tokenStrFromHeader",
"=",
"$",
"request",
"->",
"getHeader",
"(",
"'Authorization'",
")",
";",
"$",
"tokenStrFromVar",
"=",
"$",
"request... | Returns the token from the request.
Silverstripe doesn't include Authorization header in its requests. We should check it, because we can use the
mechanism in the tests.
@param \SS_HTTPRequest $request
@return String the token
@throws \Exception | [
"Returns",
"the",
"token",
"from",
"the",
"request",
"."
] | aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621 | https://github.com/notthatbad/silverstripe-rest-api/blob/aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621/code/authenticators/AuthFactory.php#L44-L62 |
233,526 | joomla-framework/twitter-api | src/Places.php | Places.createPlace | public function createPlace($lat, $long, $name, $geoToken, $within, $attribute = null, $callback = null)
{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'place');
$data['lat'] = $lat;
$data['long'] = $long;
$data['name'] = rawurlencode($name);
... | php | public function createPlace($lat, $long, $name, $geoToken, $within, $attribute = null, $callback = null)
{
// Check the rate limit for remaining hits
$this->checkRateLimit('geo', 'place');
$data['lat'] = $lat;
$data['long'] = $long;
$data['name'] = rawurlencode($name);
... | [
"public",
"function",
"createPlace",
"(",
"$",
"lat",
",",
"$",
"long",
",",
"$",
"name",
",",
"$",
"geoToken",
",",
"$",
"within",
",",
"$",
"attribute",
"=",
"null",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"// Check the rate limit for remaining hits... | Method to create a new place object at the given latitude and longitude.
@param float $lat The latitude to search around.
@param float $long The longitude to search around.
@param string $name The name a place is known as.
@param string $geoToken The token found in the response from ... | [
"Method",
"to",
"create",
"a",
"new",
"place",
"object",
"at",
"the",
"given",
"latitude",
"and",
"longitude",
"."
] | 289719bbd67e83c7cfaf515b94b1d5497b1f0525 | https://github.com/joomla-framework/twitter-api/blob/289719bbd67e83c7cfaf515b94b1d5497b1f0525/src/Places.php#L261-L289 |
233,527 | CampaignChain/core | Module/Kernel.php | Kernel.registerConfigs | protected function registerConfigs()
{
$hasNewConfigs = false;
$yamlConfig = new YamlConfig('', $this->configFiles['config']);
$parameters = $yamlConfig->read();
$configs = $this->kernelConfig->getConfigs();
if (!count($configs)) {
return;
}
fo... | php | protected function registerConfigs()
{
$hasNewConfigs = false;
$yamlConfig = new YamlConfig('', $this->configFiles['config']);
$parameters = $yamlConfig->read();
$configs = $this->kernelConfig->getConfigs();
if (!count($configs)) {
return;
}
fo... | [
"protected",
"function",
"registerConfigs",
"(",
")",
"{",
"$",
"hasNewConfigs",
"=",
"false",
";",
"$",
"yamlConfig",
"=",
"new",
"YamlConfig",
"(",
"''",
",",
"$",
"this",
"->",
"configFiles",
"[",
"'config'",
"]",
")",
";",
"$",
"parameters",
"=",
"$"... | Register bundle's config.yml files | [
"Register",
"bundle",
"s",
"config",
".",
"yml",
"files"
] | 82526548a223ed49fcd65ed7c23638544499775f | https://github.com/CampaignChain/core/blob/82526548a223ed49fcd65ed7c23638544499775f/Module/Kernel.php#L193-L223 |
233,528 | CampaignChain/core | Module/Kernel.php | Kernel.registerSecurity | protected function registerSecurity()
{
/*
* Re-create the security.yml file to avoid duplicates in merged array
* that occur upon multiple parsing.
*/
$fs = new Filesystem();
if(!$fs->exists($this->configFiles['security'])){
$fs->copy(
... | php | protected function registerSecurity()
{
/*
* Re-create the security.yml file to avoid duplicates in merged array
* that occur upon multiple parsing.
*/
$fs = new Filesystem();
if(!$fs->exists($this->configFiles['security'])){
$fs->copy(
... | [
"protected",
"function",
"registerSecurity",
"(",
")",
"{",
"/*\n * Re-create the security.yml file to avoid duplicates in merged array\n * that occur upon multiple parsing.\n */",
"$",
"fs",
"=",
"new",
"Filesystem",
"(",
")",
";",
"if",
"(",
"!",
"$",
... | Register bundle's security.yml files | [
"Register",
"bundle",
"s",
"security",
".",
"yml",
"files"
] | 82526548a223ed49fcd65ed7c23638544499775f | https://github.com/CampaignChain/core/blob/82526548a223ed49fcd65ed7c23638544499775f/Module/Kernel.php#L228-L261 |
233,529 | CampaignChain/core | Module/Kernel.php | Kernel.registerRoutings | protected function registerRoutings()
{
$yamlConfig = new YamlConfig('', $this->configFiles['routing']);
$parameters = $yamlConfig->read();
$hasNewRoutings = false;
$routings = $this->kernelConfig->getRoutings();
if (!count($routings)) {
return false;
}... | php | protected function registerRoutings()
{
$yamlConfig = new YamlConfig('', $this->configFiles['routing']);
$parameters = $yamlConfig->read();
$hasNewRoutings = false;
$routings = $this->kernelConfig->getRoutings();
if (!count($routings)) {
return false;
}... | [
"protected",
"function",
"registerRoutings",
"(",
")",
"{",
"$",
"yamlConfig",
"=",
"new",
"YamlConfig",
"(",
"''",
",",
"$",
"this",
"->",
"configFiles",
"[",
"'routing'",
"]",
")",
";",
"$",
"parameters",
"=",
"$",
"yamlConfig",
"->",
"read",
"(",
")",... | Register bundle's routing.yml files | [
"Register",
"bundle",
"s",
"routing",
".",
"yml",
"files"
] | 82526548a223ed49fcd65ed7c23638544499775f | https://github.com/CampaignChain/core/blob/82526548a223ed49fcd65ed7c23638544499775f/Module/Kernel.php#L266-L301 |
233,530 | vinterskogen/laravel-uploaded-image | src/AdvancedUploadedImage.php | AdvancedUploadedImage.createFromBase | public static function createFromBase($uploadedImage)
{
$interventionImage = $uploadedImage->getInterventionImage();
$driver = $interventionImage->getDriver();
$core = $interventionImage->getCore();
$image = new self($uploadedImage, $driver, $core);
$image->mime = $interve... | php | public static function createFromBase($uploadedImage)
{
$interventionImage = $uploadedImage->getInterventionImage();
$driver = $interventionImage->getDriver();
$core = $interventionImage->getCore();
$image = new self($uploadedImage, $driver, $core);
$image->mime = $interve... | [
"public",
"static",
"function",
"createFromBase",
"(",
"$",
"uploadedImage",
")",
"{",
"$",
"interventionImage",
"=",
"$",
"uploadedImage",
"->",
"getInterventionImage",
"(",
")",
";",
"$",
"driver",
"=",
"$",
"interventionImage",
"->",
"getDriver",
"(",
")",
... | Create advanced uploaded image with given uploaded image instance.
@param \Vinterskogen\UploadedImage\UploadedImage $uploadedImage
@return \Vinterskogen\UploadedImage\AdvancedUploadedImage | [
"Create",
"advanced",
"uploaded",
"image",
"with",
"given",
"uploaded",
"image",
"instance",
"."
] | 1b2c06ce3386622ac9360cc7895c5e5db0211797 | https://github.com/vinterskogen/laravel-uploaded-image/blob/1b2c06ce3386622ac9360cc7895c5e5db0211797/src/AdvancedUploadedImage.php#L167-L180 |
233,531 | malenkiki/aleavatar | src/Malenki/Aleavatar/Unit.php | Unit.generate | public function generate($rank1, $rank2)
{
$str_method_name = 'row' . $rank1;
if (method_exists($this,$str_method_name)) {
$this->$str_method_name($rank2);
} else {
throw new \RuntimeException('Not implemented yet!');
}
return $this;
} | php | public function generate($rank1, $rank2)
{
$str_method_name = 'row' . $rank1;
if (method_exists($this,$str_method_name)) {
$this->$str_method_name($rank2);
} else {
throw new \RuntimeException('Not implemented yet!');
}
return $this;
} | [
"public",
"function",
"generate",
"(",
"$",
"rank1",
",",
"$",
"rank2",
")",
"{",
"$",
"str_method_name",
"=",
"'row'",
".",
"$",
"rank1",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"str_method_name",
")",
")",
"{",
"$",
"this",
"->... | Generates unit part by giving row index and column index to
choose the shapes to populate with.
Parameters are both integers from 0 to 15 inclusive.
@uses Unit::row0 Various shapes DONE
@uses Unit::row1 Square shapes DONE
@uses Unit::row2 Triangle shapes DONE
@uses Unit::row3 Rectangle shapes DONE
@uses Unit::row4 Ci... | [
"Generates",
"unit",
"part",
"by",
"giving",
"row",
"index",
"and",
"column",
"index",
"to",
"choose",
"the",
"shapes",
"to",
"populate",
"with",
"."
] | 91affa83f8580c8e6da62c77ce34b1c4451784bf | https://github.com/malenkiki/aleavatar/blob/91affa83f8580c8e6da62c77ce34b1c4451784bf/src/Malenki/Aleavatar/Unit.php#L2931-L2941 |
233,532 | opus-online/yii2-payment | lib/services/ServicesAbstract.php | ServicesAbstract.loadAdapters | public function loadAdapters()
{
$this->paymentAdapters = array();
foreach ($this->paymentHandler->getAdapters() as $adapterName => $paymentAdapter) {
$interfaceClass = sprintf(
'%s\%s\AdapterInterface',
__NAMESPACE__,
ucwords($this->getSer... | php | public function loadAdapters()
{
$this->paymentAdapters = array();
foreach ($this->paymentHandler->getAdapters() as $adapterName => $paymentAdapter) {
$interfaceClass = sprintf(
'%s\%s\AdapterInterface',
__NAMESPACE__,
ucwords($this->getSer... | [
"public",
"function",
"loadAdapters",
"(",
")",
"{",
"$",
"this",
"->",
"paymentAdapters",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"paymentHandler",
"->",
"getAdapters",
"(",
")",
"as",
"$",
"adapterName",
"=>",
"$",
"paymentAdapter... | Load supported adapters for this service | [
"Load",
"supported",
"adapters",
"for",
"this",
"service"
] | df48093f7ef1368a0992460bc66f12f0f090044c | https://github.com/opus-online/yii2-payment/blob/df48093f7ef1368a0992460bc66f12f0f090044c/lib/services/ServicesAbstract.php#L48-L61 |
233,533 | Patroklo/yii2-comments | models/CommentModel.php | CommentModel.validateParentID | public function validateParentID($attribute)
{
if ($this->{$attribute} !== NULL)
{
$comment = self::find()->where(['id' => $this->{$attribute}, 'entity' => $this->entity, 'entityId' => $this->entityId])->active()->exists();
if ($comment === FALSE)
{
... | php | public function validateParentID($attribute)
{
if ($this->{$attribute} !== NULL)
{
$comment = self::find()->where(['id' => $this->{$attribute}, 'entity' => $this->entity, 'entityId' => $this->entityId])->active()->exists();
if ($comment === FALSE)
{
... | [
"public",
"function",
"validateParentID",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"{",
"$",
"attribute",
"}",
"!==",
"NULL",
")",
"{",
"$",
"comment",
"=",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'id'",
"=>"... | Validate parentId attribute
@param $attribute | [
"Validate",
"parentId",
"attribute"
] | e06409ea52b12dc14d0594030088fd7d2c2e160a | https://github.com/Patroklo/yii2-comments/blob/e06409ea52b12dc14d0594030088fd7d2c2e160a/models/CommentModel.php#L102-L112 |
233,534 | Patroklo/yii2-comments | models/CommentModel.php | CommentModel.behaviors | public function behaviors()
{
return [
'blameable' => [
'class' => BlameableBehavior::className(),
'createdByAttribute' => 'createdBy',
'updatedByAttribute' => 'updatedBy',
],
'timestamp' => [
'class' => Time... | php | public function behaviors()
{
return [
'blameable' => [
'class' => BlameableBehavior::className(),
'createdByAttribute' => 'createdBy',
'updatedByAttribute' => 'updatedBy',
],
'timestamp' => [
'class' => Time... | [
"public",
"function",
"behaviors",
"(",
")",
"{",
"return",
"[",
"'blameable'",
"=>",
"[",
"'class'",
"=>",
"BlameableBehavior",
"::",
"className",
"(",
")",
",",
"'createdByAttribute'",
"=>",
"'createdBy'",
",",
"'updatedByAttribute'",
"=>",
"'updatedBy'",
",",
... | Returns a list of behaviors that this component should behave as.
@return array | [
"Returns",
"a",
"list",
"of",
"behaviors",
"that",
"this",
"component",
"should",
"behave",
"as",
"."
] | e06409ea52b12dc14d0594030088fd7d2c2e160a | https://github.com/Patroklo/yii2-comments/blob/e06409ea52b12dc14d0594030088fd7d2c2e160a/models/CommentModel.php#L119-L139 |
233,535 | Patroklo/yii2-comments | models/CommentModel.php | CommentModel.beforeSave | public function beforeSave($insert)
{
if (parent::beforeSave($insert))
{
if ($this->parentId > 0)
{
$parentNodeLevel = (int)self::find()->select('level')->where(['id' => $this->parentId])->scalar();
$this->level = $parentNodeLevel + 1;
... | php | public function beforeSave($insert)
{
if (parent::beforeSave($insert))
{
if ($this->parentId > 0)
{
$parentNodeLevel = (int)self::find()->select('level')->where(['id' => $this->parentId])->scalar();
$this->level = $parentNodeLevel + 1;
... | [
"public",
"function",
"beforeSave",
"(",
"$",
"insert",
")",
"{",
"if",
"(",
"parent",
"::",
"beforeSave",
"(",
"$",
"insert",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parentId",
">",
"0",
")",
"{",
"$",
"parentNodeLevel",
"=",
"(",
"int",
")"... | This method is called at the beginning of inserting or updating a record.
@param bool $insert
@return bool | [
"This",
"method",
"is",
"called",
"at",
"the",
"beginning",
"of",
"inserting",
"or",
"updating",
"a",
"record",
"."
] | e06409ea52b12dc14d0594030088fd7d2c2e160a | https://github.com/Patroklo/yii2-comments/blob/e06409ea52b12dc14d0594030088fd7d2c2e160a/models/CommentModel.php#L174-L190 |
233,536 | Patroklo/yii2-comments | models/CommentModel.php | CommentModel.getContent | public function getContent($deletedCommentText = NULL)
{
if (is_null($deletedCommentText))
{
$deletedCommentText = Yii::t('app', 'Comment was deleted.');
}
return $this->isDeleted ? $deletedCommentText : Yii::$app->formatter->asNtext($this->content);
} | php | public function getContent($deletedCommentText = NULL)
{
if (is_null($deletedCommentText))
{
$deletedCommentText = Yii::t('app', 'Comment was deleted.');
}
return $this->isDeleted ? $deletedCommentText : Yii::$app->formatter->asNtext($this->content);
} | [
"public",
"function",
"getContent",
"(",
"$",
"deletedCommentText",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"deletedCommentText",
")",
")",
"{",
"$",
"deletedCommentText",
"=",
"Yii",
"::",
"t",
"(",
"'app'",
",",
"'Comment was deleted.'",
")"... | Get comment content
@param string $deletedCommentText
@return string | [
"Get",
"comment",
"content"
] | e06409ea52b12dc14d0594030088fd7d2c2e160a | https://github.com/Patroklo/yii2-comments/blob/e06409ea52b12dc14d0594030088fd7d2c2e160a/models/CommentModel.php#L394-L402 |
233,537 | Patroklo/yii2-comments | models/CommentModel.php | CommentModel.getAvatar | public function getAvatar($imgOptions = [])
{
$imgOptions = ArrayHelper::merge($imgOptions, ['class' => 'img-responsive']);
if (is_null($this->createdBy))
{
return Html::img("http://gravatar.com/avatar/1/?s=50", $imgOptions);
}
return Html::img("http://gravatar.... | php | public function getAvatar($imgOptions = [])
{
$imgOptions = ArrayHelper::merge($imgOptions, ['class' => 'img-responsive']);
if (is_null($this->createdBy))
{
return Html::img("http://gravatar.com/avatar/1/?s=50", $imgOptions);
}
return Html::img("http://gravatar.... | [
"public",
"function",
"getAvatar",
"(",
"$",
"imgOptions",
"=",
"[",
"]",
")",
"{",
"$",
"imgOptions",
"=",
"ArrayHelper",
"::",
"merge",
"(",
"$",
"imgOptions",
",",
"[",
"'class'",
"=>",
"'img-responsive'",
"]",
")",
";",
"if",
"(",
"is_null",
"(",
"... | Get avatar user
@param array $imgOptions
@return string | [
"Get",
"avatar",
"user"
] | e06409ea52b12dc14d0594030088fd7d2c2e160a | https://github.com/Patroklo/yii2-comments/blob/e06409ea52b12dc14d0594030088fd7d2c2e160a/models/CommentModel.php#L409-L419 |
233,538 | civicrm/civicrm-setup | src/Setup/UI/SetupController.php | SetupController.runStart | public function runStart($method, $fields) {
$checkInstalled = $this->setup->checkInstalled();
if ($checkInstalled->isDatabaseInstalled() || $checkInstalled->isSettingInstalled()) {
return $this->createError("CiviCRM is already installed");
}
/**
* @var \Civi\Setup\Model $model
*/
$... | php | public function runStart($method, $fields) {
$checkInstalled = $this->setup->checkInstalled();
if ($checkInstalled->isDatabaseInstalled() || $checkInstalled->isSettingInstalled()) {
return $this->createError("CiviCRM is already installed");
}
/**
* @var \Civi\Setup\Model $model
*/
$... | [
"public",
"function",
"runStart",
"(",
"$",
"method",
",",
"$",
"fields",
")",
"{",
"$",
"checkInstalled",
"=",
"$",
"this",
"->",
"setup",
"->",
"checkInstalled",
"(",
")",
";",
"if",
"(",
"$",
"checkInstalled",
"->",
"isDatabaseInstalled",
"(",
")",
"|... | Run the main installer page.
@param string $method
Ex: 'GET' or 'POST'.
@param array $fields
List of any HTTP GET/POST fields.
@return array
The HTTP headers and response text.
[0 => array $headers, 1 => string $body]. | [
"Run",
"the",
"main",
"installer",
"page",
"."
] | 556b312faf78781c85c4fc4ae6c1c3b658da9e09 | https://github.com/civicrm/civicrm-setup/blob/556b312faf78781c85c4fc4ae6c1c3b658da9e09/src/Setup/UI/SetupController.php#L81-L107 |
233,539 | civicrm/civicrm-setup | src/Setup/UI/SetupController.php | SetupController.runInstall | public function runInstall($method, $fields) {
$checkInstalled = $this->setup->checkInstalled();
if ($checkInstalled->isDatabaseInstalled() || $checkInstalled->isSettingInstalled()) {
return $this->createError("CiviCRM is already installed");
}
$reqs = $this->setup->checkRequirements();
if (c... | php | public function runInstall($method, $fields) {
$checkInstalled = $this->setup->checkInstalled();
if ($checkInstalled->isDatabaseInstalled() || $checkInstalled->isSettingInstalled()) {
return $this->createError("CiviCRM is already installed");
}
$reqs = $this->setup->checkRequirements();
if (c... | [
"public",
"function",
"runInstall",
"(",
"$",
"method",
",",
"$",
"fields",
")",
"{",
"$",
"checkInstalled",
"=",
"$",
"this",
"->",
"setup",
"->",
"checkInstalled",
"(",
")",
";",
"if",
"(",
"$",
"checkInstalled",
"->",
"isDatabaseInstalled",
"(",
")",
... | Perform the installation action.
@param string $method
Ex: 'GET' or 'POST'.
@param array $fields
List of any HTTP GET/POST fields.
@return array
The HTTP headers and response text.
[0 => array $headers, 1 => string $body]. | [
"Perform",
"the",
"installation",
"action",
"."
] | 556b312faf78781c85c4fc4ae6c1c3b658da9e09 | https://github.com/civicrm/civicrm-setup/blob/556b312faf78781c85c4fc4ae6c1c3b658da9e09/src/Setup/UI/SetupController.php#L120-L143 |
233,540 | civicrm/civicrm-setup | src/Setup/UI/SetupController.php | SetupController.parseAction | protected function parseAction($fields, $default) {
if (empty($fields[self::PREFIX]['action'])) {
return $default;
}
else {
if (is_array($fields[self::PREFIX]['action'])) {
foreach ($fields[self::PREFIX]['action'] as $name => $label) {
return $name;
}
}
else... | php | protected function parseAction($fields, $default) {
if (empty($fields[self::PREFIX]['action'])) {
return $default;
}
else {
if (is_array($fields[self::PREFIX]['action'])) {
foreach ($fields[self::PREFIX]['action'] as $name => $label) {
return $name;
}
}
else... | [
"protected",
"function",
"parseAction",
"(",
"$",
"fields",
",",
"$",
"default",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"fields",
"[",
"self",
"::",
"PREFIX",
"]",
"[",
"'action'",
"]",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"else",
"{... | Given an HTML submission, determine the name.
@param array $fields
HTTP inputs -- e.g. with a form element like this:
`<input type="submit" name="civisetup[action][Foo]" value="Do the foo">`
@return string
The name of the action.
Ex: 'Foo'. | [
"Given",
"an",
"HTML",
"submission",
"determine",
"the",
"name",
"."
] | 556b312faf78781c85c4fc4ae6c1c3b658da9e09 | https://github.com/civicrm/civicrm-setup/blob/556b312faf78781c85c4fc4ae6c1c3b658da9e09/src/Setup/UI/SetupController.php#L232-L247 |
233,541 | CampaignChain/core | Wizard/InstallWizard.php | InstallWizard.getSortedSteps | private function getSortedSteps()
{
$sortedSteps = array();
ksort($this->steps);
foreach ($this->steps as $steps) {
$sortedSteps = array_merge($sortedSteps, $steps);
}
return $sortedSteps;
} | php | private function getSortedSteps()
{
$sortedSteps = array();
ksort($this->steps);
foreach ($this->steps as $steps) {
$sortedSteps = array_merge($sortedSteps, $steps);
}
return $sortedSteps;
} | [
"private",
"function",
"getSortedSteps",
"(",
")",
"{",
"$",
"sortedSteps",
"=",
"array",
"(",
")",
";",
"ksort",
"(",
"$",
"this",
"->",
"steps",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"steps",
"as",
"$",
"steps",
")",
"{",
"$",
"sortedSteps",... | Sort routers by priority.
The lowest number is the highest priority
@return StepInterface[] | [
"Sort",
"routers",
"by",
"priority",
".",
"The",
"lowest",
"number",
"is",
"the",
"highest",
"priority"
] | 82526548a223ed49fcd65ed7c23638544499775f | https://github.com/CampaignChain/core/blob/82526548a223ed49fcd65ed7c23638544499775f/Wizard/InstallWizard.php#L71-L81 |
233,542 | notthatbad/silverstripe-rest-api | code/serializers/SerializerFactory.php | SerializerFactory.create | public static function create($mimeType='application/json') {
$availableSerializers = \ClassInfo::implementorsOf('Ntb\RestAPI\IRestSerializer');
foreach($availableSerializers as $serializer) {
/** @var IRestSerializer $instance */
$instance = new $serializer();
if($in... | php | public static function create($mimeType='application/json') {
$availableSerializers = \ClassInfo::implementorsOf('Ntb\RestAPI\IRestSerializer');
foreach($availableSerializers as $serializer) {
/** @var IRestSerializer $instance */
$instance = new $serializer();
if($in... | [
"public",
"static",
"function",
"create",
"(",
"$",
"mimeType",
"=",
"'application/json'",
")",
"{",
"$",
"availableSerializers",
"=",
"\\",
"ClassInfo",
"::",
"implementorsOf",
"(",
"'Ntb\\RestAPI\\IRestSerializer'",
")",
";",
"foreach",
"(",
"$",
"availableSeriali... | Returns a new instance of a serializer depending on the given type.
@param string $mimeType the serializer type; Default: application/json
@return IRestSerializer an instance of a serializer
@throws RestUserException | [
"Returns",
"a",
"new",
"instance",
"of",
"a",
"serializer",
"depending",
"on",
"the",
"given",
"type",
"."
] | aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621 | https://github.com/notthatbad/silverstripe-rest-api/blob/aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621/code/serializers/SerializerFactory.php#L24-L34 |
233,543 | notthatbad/silverstripe-rest-api | code/serializers/SerializerFactory.php | SerializerFactory.create_from_request | public static function create_from_request($request) {
if($type = $request->getVar('accept')) {
try {
if(array_key_exists($type, self::$lookup)) {
return self::create(self::$lookup[$type]);
}
} catch(\Exception $e) {}
}
... | php | public static function create_from_request($request) {
if($type = $request->getVar('accept')) {
try {
if(array_key_exists($type, self::$lookup)) {
return self::create(self::$lookup[$type]);
}
} catch(\Exception $e) {}
}
... | [
"public",
"static",
"function",
"create_from_request",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"type",
"=",
"$",
"request",
"->",
"getVar",
"(",
"'accept'",
")",
")",
"{",
"try",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"type",
",",
"self",... | Determines the correct serializer from an incoming request.
@param \SS_HTTPRequest $request the request object
@return IRestSerializer a new instance of a serializer which fits the request best
@throws RestUserException | [
"Determines",
"the",
"correct",
"serializer",
"from",
"an",
"incoming",
"request",
"."
] | aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621 | https://github.com/notthatbad/silverstripe-rest-api/blob/aed8e9812a01d4ab1e7cdfe7c3e0161ca368e621/code/serializers/SerializerFactory.php#L43-L58 |
233,544 | prooph/link-process-manager | src/Infrastructure/DbalProcessLogger.php | DbalProcessLogger.logProcessStartedByMessage | public function logProcessStartedByMessage(ProcessId $processId, $startMessageName)
{
$data = [
'start_message' => $startMessageName,
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_null($entry)) {
$data['status'] = self::STATUS_RUNNING;
... | php | public function logProcessStartedByMessage(ProcessId $processId, $startMessageName)
{
$data = [
'start_message' => $startMessageName,
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_null($entry)) {
$data['status'] = self::STATUS_RUNNING;
... | [
"public",
"function",
"logProcessStartedByMessage",
"(",
"ProcessId",
"$",
"processId",
",",
"$",
"startMessageName",
")",
"{",
"$",
"data",
"=",
"[",
"'start_message'",
"=>",
"$",
"startMessageName",
",",
"]",
";",
"$",
"entry",
"=",
"$",
"this",
"->",
"loa... | Create or update entry for process with the start message name.
If a new process needs to be created set status to "running".
@param string $startMessageName
@param ProcessId $processId
@return void | [
"Create",
"or",
"update",
"entry",
"for",
"process",
"with",
"the",
"start",
"message",
"name",
".",
"If",
"a",
"new",
"process",
"needs",
"to",
"be",
"created",
"set",
"status",
"to",
"running",
"."
] | 3d6c8bdc72e855786227747bf06bcf8221f7860a | https://github.com/prooph/link-process-manager/blob/3d6c8bdc72e855786227747bf06bcf8221f7860a/src/Infrastructure/DbalProcessLogger.php#L57-L72 |
233,545 | prooph/link-process-manager | src/Infrastructure/DbalProcessLogger.php | DbalProcessLogger.logProcessStartedAt | public function logProcessStartedAt(ProcessId $processId, \DateTimeImmutable $startedAt)
{
$data = [
'started_at' => $startedAt->format(\DateTime::ISO8601),
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_null($entry)) {
$data['status'] = sel... | php | public function logProcessStartedAt(ProcessId $processId, \DateTimeImmutable $startedAt)
{
$data = [
'started_at' => $startedAt->format(\DateTime::ISO8601),
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_null($entry)) {
$data['status'] = sel... | [
"public",
"function",
"logProcessStartedAt",
"(",
"ProcessId",
"$",
"processId",
",",
"\\",
"DateTimeImmutable",
"$",
"startedAt",
")",
"{",
"$",
"data",
"=",
"[",
"'started_at'",
"=>",
"$",
"startedAt",
"->",
"format",
"(",
"\\",
"DateTime",
"::",
"ISO8601",
... | Create or update entry for process with the started at information.
If a new process needs to be created set status to "running".
@param ProcessId $processId
@param \DateTimeImmutable $startedAt
@return void | [
"Create",
"or",
"update",
"entry",
"for",
"process",
"with",
"the",
"started",
"at",
"information",
".",
"If",
"a",
"new",
"process",
"needs",
"to",
"be",
"created",
"set",
"status",
"to",
"running",
"."
] | 3d6c8bdc72e855786227747bf06bcf8221f7860a | https://github.com/prooph/link-process-manager/blob/3d6c8bdc72e855786227747bf06bcf8221f7860a/src/Infrastructure/DbalProcessLogger.php#L82-L97 |
233,546 | prooph/link-process-manager | src/Infrastructure/DbalProcessLogger.php | DbalProcessLogger.logProcessSucceed | public function logProcessSucceed(ProcessId $processId, \DateTimeImmutable $finishedAt)
{
$data = [
'finished_at' => $finishedAt->format(\DateTime::ISO8601),
'status' => self::STATUS_SUCCEED,
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_nu... | php | public function logProcessSucceed(ProcessId $processId, \DateTimeImmutable $finishedAt)
{
$data = [
'finished_at' => $finishedAt->format(\DateTime::ISO8601),
'status' => self::STATUS_SUCCEED,
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_nu... | [
"public",
"function",
"logProcessSucceed",
"(",
"ProcessId",
"$",
"processId",
",",
"\\",
"DateTimeImmutable",
"$",
"finishedAt",
")",
"{",
"$",
"data",
"=",
"[",
"'finished_at'",
"=>",
"$",
"finishedAt",
"->",
"format",
"(",
"\\",
"DateTime",
"::",
"ISO8601",... | Create or update entry for process with finished at information.
Set status to "succeed".
@param ProcessId $processId
@param \DateTimeImmutable $finishedAt
@return void | [
"Create",
"or",
"update",
"entry",
"for",
"process",
"with",
"finished",
"at",
"information",
".",
"Set",
"status",
"to",
"succeed",
"."
] | 3d6c8bdc72e855786227747bf06bcf8221f7860a | https://github.com/prooph/link-process-manager/blob/3d6c8bdc72e855786227747bf06bcf8221f7860a/src/Infrastructure/DbalProcessLogger.php#L107-L121 |
233,547 | prooph/link-process-manager | src/Infrastructure/DbalProcessLogger.php | DbalProcessLogger.logProcessFailed | public function logProcessFailed(ProcessId $processId, \DateTimeImmutable $finishedAt)
{
$data = [
'finished_at' => $finishedAt->format(\DateTime::ISO8601),
'status' => self::STATUS_FAILED,
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_null... | php | public function logProcessFailed(ProcessId $processId, \DateTimeImmutable $finishedAt)
{
$data = [
'finished_at' => $finishedAt->format(\DateTime::ISO8601),
'status' => self::STATUS_FAILED,
];
$entry = $this->loadProcessEntryIfExists($processId);
if (is_null... | [
"public",
"function",
"logProcessFailed",
"(",
"ProcessId",
"$",
"processId",
",",
"\\",
"DateTimeImmutable",
"$",
"finishedAt",
")",
"{",
"$",
"data",
"=",
"[",
"'finished_at'",
"=>",
"$",
"finishedAt",
"->",
"format",
"(",
"\\",
"DateTime",
"::",
"ISO8601",
... | Create or update entry for process with finished at information.
Set status to "failed".
@param ProcessId $processId
@param \DateTimeImmutable $finishedAt
@return void | [
"Create",
"or",
"update",
"entry",
"for",
"process",
"with",
"finished",
"at",
"information",
".",
"Set",
"status",
"to",
"failed",
"."
] | 3d6c8bdc72e855786227747bf06bcf8221f7860a | https://github.com/prooph/link-process-manager/blob/3d6c8bdc72e855786227747bf06bcf8221f7860a/src/Infrastructure/DbalProcessLogger.php#L131-L145 |
233,548 | vinterskogen/laravel-uploaded-image | src/Concerns/HandlesImage.php | HandlesImage.encode | public function encode($format, $quality = null)
{
$this->toggleModified();
$this->getInterventionImage()->encode($format, $quality);
return $this;
} | php | public function encode($format, $quality = null)
{
$this->toggleModified();
$this->getInterventionImage()->encode($format, $quality);
return $this;
} | [
"public",
"function",
"encode",
"(",
"$",
"format",
",",
"$",
"quality",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"toggleModified",
"(",
")",
";",
"$",
"this",
"->",
"getInterventionImage",
"(",
")",
"->",
"encode",
"(",
"$",
"format",
",",
"$",
"qu... | Encode uploaded image to given format and quality.
@param mixed $format
@param int|null $quality
@return $this | [
"Encode",
"uploaded",
"image",
"to",
"given",
"format",
"and",
"quality",
"."
] | 1b2c06ce3386622ac9360cc7895c5e5db0211797 | https://github.com/vinterskogen/laravel-uploaded-image/blob/1b2c06ce3386622ac9360cc7895c5e5db0211797/src/Concerns/HandlesImage.php#L119-L126 |
233,549 | vinterskogen/laravel-uploaded-image | src/Concerns/HandlesImage.php | HandlesImage.scale | public function scale($percentage)
{
$this->validatePercentageValue($percentage);
$this->toggleModified();
$percentage = floatval($percentage);
$width = $this->width() / 100 * $percentage;
$height = $this->height() / 100 * $percentage;
$this->getInterventionImage()... | php | public function scale($percentage)
{
$this->validatePercentageValue($percentage);
$this->toggleModified();
$percentage = floatval($percentage);
$width = $this->width() / 100 * $percentage;
$height = $this->height() / 100 * $percentage;
$this->getInterventionImage()... | [
"public",
"function",
"scale",
"(",
"$",
"percentage",
")",
"{",
"$",
"this",
"->",
"validatePercentageValue",
"(",
"$",
"percentage",
")",
";",
"$",
"this",
"->",
"toggleModified",
"(",
")",
";",
"$",
"percentage",
"=",
"floatval",
"(",
"$",
"percentage",... | Scale the uploaded image size using given percentage.
@param int|float $percentage
@return $this | [
"Scale",
"the",
"uploaded",
"image",
"size",
"using",
"given",
"percentage",
"."
] | 1b2c06ce3386622ac9360cc7895c5e5db0211797 | https://github.com/vinterskogen/laravel-uploaded-image/blob/1b2c06ce3386622ac9360cc7895c5e5db0211797/src/Concerns/HandlesImage.php#L134-L147 |
233,550 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getDBInstance | public function getDBInstance()
{
if ($this->database === null) {
$this->database = new MySQLDBImpl($this->config);
}
return $this->database;
} | php | public function getDBInstance()
{
if ($this->database === null) {
$this->database = new MySQLDBImpl($this->config);
}
return $this->database;
} | [
"public",
"function",
"getDBInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"database",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"database",
"=",
"new",
"MySQLDBImpl",
"(",
"$",
"this",
"->",
"config",
")",
";",
"}",
"return",
"$",
"this",... | This will return a DB. The same from time to time
@return DB | [
"This",
"will",
"return",
"a",
"DB",
".",
"The",
"same",
"from",
"time",
"to",
"time"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L81-L88 |
233,551 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getAJAXServerInstance | public function getAJAXServerInstance()
{
if ($this->ajaxServer === null) {
$this->ajaxServer = new ServerImpl($this);
}
return $this->ajaxServer;
} | php | public function getAJAXServerInstance()
{
if ($this->ajaxServer === null) {
$this->ajaxServer = new ServerImpl($this);
}
return $this->ajaxServer;
} | [
"public",
"function",
"getAJAXServerInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ajaxServer",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"ajaxServer",
"=",
"new",
"ServerImpl",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | This will return an ajax register, and reuse it from time to time
@return ServerImpl | [
"This",
"will",
"return",
"an",
"ajax",
"register",
"and",
"reuse",
"it",
"from",
"time",
"to",
"time"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L95-L101 |
233,552 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getPageOrderInstance | public function getPageOrderInstance()
{
if ($this->pageOrder === null) {
$this->pageOrder = new PageOrderImpl($this);
}
return $this->pageOrder;
} | php | public function getPageOrderInstance()
{
if ($this->pageOrder === null) {
$this->pageOrder = new PageOrderImpl($this);
}
return $this->pageOrder;
} | [
"public",
"function",
"getPageOrderInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pageOrder",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"pageOrder",
"=",
"new",
"PageOrderImpl",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | This will return an instance of PageOrder, and reuse it.
@return PageOrder | [
"This",
"will",
"return",
"an",
"instance",
"of",
"PageOrder",
"and",
"reuse",
"it",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L107-L113 |
233,553 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getCurrentPageStrategyInstance | public function getCurrentPageStrategyInstance()
{
if ($this->currentPageStrategy === null) {
$this->currentPageStrategy = new CurrentPageStrategyImpl($this);
}
return $this->currentPageStrategy;
} | php | public function getCurrentPageStrategyInstance()
{
if ($this->currentPageStrategy === null) {
$this->currentPageStrategy = new CurrentPageStrategyImpl($this);
}
return $this->currentPageStrategy;
} | [
"public",
"function",
"getCurrentPageStrategyInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currentPageStrategy",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"currentPageStrategy",
"=",
"new",
"CurrentPageStrategyImpl",
"(",
"$",
"this",
")",
";",
"}... | This will return an instance of CurrentPageStrategy, and reuse it.
@return CurrentPageStrategy | [
"This",
"will",
"return",
"an",
"instance",
"of",
"CurrentPageStrategy",
"and",
"reuse",
"it",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L119-L125 |
233,554 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getUserLibraryInstance | public function getUserLibraryInstance()
{
if ($this->userLibrary === null) {
$this->userLibrary = new UserLibraryImpl($this);
}
return $this->userLibrary;
} | php | public function getUserLibraryInstance()
{
if ($this->userLibrary === null) {
$this->userLibrary = new UserLibraryImpl($this);
}
return $this->userLibrary;
} | [
"public",
"function",
"getUserLibraryInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"userLibrary",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"userLibrary",
"=",
"new",
"UserLibraryImpl",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
... | Will create and reuse an instance of UserLibrary
@return UserLibrary | [
"Will",
"create",
"and",
"reuse",
"an",
"instance",
"of",
"UserLibrary"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L141-L147 |
233,555 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getDefaultPageLibraryInstance | public function getDefaultPageLibraryInstance()
{
if ($this->defaultPageLibrary === null) {
$this->defaultPageLibrary = new DefaultPageLibraryImpl($this);
}
return $this->defaultPageLibrary;
} | php | public function getDefaultPageLibraryInstance()
{
if ($this->defaultPageLibrary === null) {
$this->defaultPageLibrary = new DefaultPageLibraryImpl($this);
}
return $this->defaultPageLibrary;
} | [
"public",
"function",
"getDefaultPageLibraryInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"defaultPageLibrary",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"defaultPageLibrary",
"=",
"new",
"DefaultPageLibraryImpl",
"(",
"$",
"this",
")",
";",
"}",
... | Will create and reuse an instance of DefaultPageLibrary
@return DefaultPageLibrary | [
"Will",
"create",
"and",
"reuse",
"an",
"instance",
"of",
"DefaultPageLibrary"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L154-L161 |
233,556 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getCacheControlInstance | public function getCacheControlInstance()
{
if ($this->cacheControl == null) {
$this->cacheControl = new CacheControlImpl($this->getSiteInstance(), $this->getCurrentPageStrategyInstance());
}
return $this->cacheControl;
} | php | public function getCacheControlInstance()
{
if ($this->cacheControl == null) {
$this->cacheControl = new CacheControlImpl($this->getSiteInstance(), $this->getCurrentPageStrategyInstance());
}
return $this->cacheControl;
} | [
"public",
"function",
"getCacheControlInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cacheControl",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"cacheControl",
"=",
"new",
"CacheControlImpl",
"(",
"$",
"this",
"->",
"getSiteInstance",
"(",
")",
",... | Will create and reuse an instance of CacheControl
@return CacheControl | [
"Will",
"create",
"and",
"reuse",
"an",
"instance",
"of",
"CacheControl"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L168-L174 |
233,557 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getUpdaterInstance | public function getUpdaterInstance()
{
if ($this->updater == null) {
$this->updater = new GitUpdaterImpl($this, $this->getConfigInstance()->getRootPath());
}
return $this->updater;
} | php | public function getUpdaterInstance()
{
if ($this->updater == null) {
$this->updater = new GitUpdaterImpl($this, $this->getConfigInstance()->getRootPath());
}
return $this->updater;
} | [
"public",
"function",
"getUpdaterInstance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"updater",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"updater",
"=",
"new",
"GitUpdaterImpl",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"getConfigInstance",
"(",
... | Will create and reuse an instance of Updater
@return mixed | [
"Will",
"create",
"and",
"reuse",
"an",
"instance",
"of",
"Updater"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L180-L186 |
233,558 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getSiteInstance | public function getSiteInstance()
{
return $this->site == null ? $this->site = new SiteImpl($this) : $this->site;
} | php | public function getSiteInstance()
{
return $this->site == null ? $this->site = new SiteImpl($this) : $this->site;
} | [
"public",
"function",
"getSiteInstance",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"site",
"==",
"null",
"?",
"$",
"this",
"->",
"site",
"=",
"new",
"SiteImpl",
"(",
"$",
"this",
")",
":",
"$",
"this",
"->",
"site",
";",
"}"
] | Will create and reuse an instance of Variables.
These should reflect the site scoped variables.
@return Site | [
"Will",
"create",
"and",
"reuse",
"an",
"instance",
"of",
"Variables",
".",
"These",
"should",
"reflect",
"the",
"site",
"scoped",
"variables",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L193-L196 |
233,559 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getFileLibraryInstance | public function getFileLibraryInstance()
{
return $this->fileLibrary == null ? $this->fileLibrary = new FileLibraryImpl($this, new FolderImpl($this->getConfigInstance()->getRootPath() . "/files/")) : $this->fileLibrary;
} | php | public function getFileLibraryInstance()
{
return $this->fileLibrary == null ? $this->fileLibrary = new FileLibraryImpl($this, new FolderImpl($this->getConfigInstance()->getRootPath() . "/files/")) : $this->fileLibrary;
} | [
"public",
"function",
"getFileLibraryInstance",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"fileLibrary",
"==",
"null",
"?",
"$",
"this",
"->",
"fileLibrary",
"=",
"new",
"FileLibraryImpl",
"(",
"$",
"this",
",",
"new",
"FolderImpl",
"(",
"$",
"this",
"->... | Will create and reuse an instance of FileLibrary.
@return FileLibrary | [
"Will",
"create",
"and",
"reuse",
"an",
"instance",
"of",
"FileLibrary",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L202-L205 |
233,560 | budde377/Part | lib/BackendSingletonContainerImpl.php | BackendSingletonContainerImpl.getTypeHandlerLibraryInstance | public function getTypeHandlerLibraryInstance()
{
return $this->typeHandlerLib == null ? $this->typeHandlerLib = new TypeHandlerLibraryImpl($this) : $this->typeHandlerLib;
} | php | public function getTypeHandlerLibraryInstance()
{
return $this->typeHandlerLib == null ? $this->typeHandlerLib = new TypeHandlerLibraryImpl($this) : $this->typeHandlerLib;
} | [
"public",
"function",
"getTypeHandlerLibraryInstance",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"typeHandlerLib",
"==",
"null",
"?",
"$",
"this",
"->",
"typeHandlerLib",
"=",
"new",
"TypeHandlerLibraryImpl",
"(",
"$",
"this",
")",
":",
"$",
"this",
"->",
... | Will create and reuse instance of TypeHandlerLibrary.
@return TypeHandlerLibrary | [
"Will",
"create",
"and",
"reuse",
"instance",
"of",
"TypeHandlerLibrary",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/BackendSingletonContainerImpl.php#L361-L364 |
233,561 | skeeks-semenov/yii2-ckeditor | src/assets/lib/geshi/geshi.php | GeSHi.load_language | function load_language($file_name) {
if ($file_name == $this->loaded_language) {
// this file is already loaded!
return;
}
//Prepare some stuff before actually loading the language file
$this->loaded_language = $file_name;
$this->parse_cache_built = false... | php | function load_language($file_name) {
if ($file_name == $this->loaded_language) {
// this file is already loaded!
return;
}
//Prepare some stuff before actually loading the language file
$this->loaded_language = $file_name;
$this->parse_cache_built = false... | [
"function",
"load_language",
"(",
"$",
"file_name",
")",
"{",
"if",
"(",
"$",
"file_name",
"==",
"$",
"this",
"->",
"loaded_language",
")",
"{",
"// this file is already loaded!",
"return",
";",
"}",
"//Prepare some stuff before actually loading the language file",
"$",... | Gets language information and stores it for later use
@param string The filename of the language file you want to load
@since 1.0.0
@access private
@todo Needs to load keys for lexic permissions for keywords, regexps etc | [
"Gets",
"language",
"information",
"and",
"stores",
"it",
"for",
"later",
"use"
] | ffb4ef7b7ff4d68d25a0b00493554f93e525e2f4 | https://github.com/skeeks-semenov/yii2-ckeditor/blob/ffb4ef7b7ff4d68d25a0b00493554f93e525e2f4/src/assets/lib/geshi/geshi.php#L3761-L3850 |
233,562 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.input | public static function input( $name, $size = false, $value = false, $attribs = array() ) {
$attributes = array( 'name' => $name );
if( $size ) {
$attributes['size'] = $size;
}
if( $value !== false ) { // maybe 0
$attributes['value'] = $value;
}
return self::element( 'input', $attributes + $attribs ... | php | public static function input( $name, $size = false, $value = false, $attribs = array() ) {
$attributes = array( 'name' => $name );
if( $size ) {
$attributes['size'] = $size;
}
if( $value !== false ) { // maybe 0
$attributes['value'] = $value;
}
return self::element( 'input', $attributes + $attribs ... | [
"public",
"static",
"function",
"input",
"(",
"$",
"name",
",",
"$",
"size",
"=",
"false",
",",
"$",
"value",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'name'",
"=>",
"$",
"name",
... | Convenience function to build an HTML text input field
@param string $name value of the name attribute
@param bool|int $size value of the size attribute
@param mixed $value mixed value of the value attribute
@param array $attribs other attributes
@return string HTML | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"text",
"input",
"field"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L176-L188 |
233,563 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.password | public static function password( $name, $size = false, $value = false, $attribs = array() ) {
return self::input( $name, $size, $value, array_merge( $attribs, array( 'type' => 'password' ) ) );
} | php | public static function password( $name, $size = false, $value = false, $attribs = array() ) {
return self::input( $name, $size, $value, array_merge( $attribs, array( 'type' => 'password' ) ) );
} | [
"public",
"static",
"function",
"password",
"(",
"$",
"name",
",",
"$",
"size",
"=",
"false",
",",
"$",
"value",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"input",
"(",
"$",
"name",
",",
"$",
"si... | Convenience function to build an HTML password input field
@param string $name value of the name attribute
@param bool|int $size value of the size attribute
@param $value mixed value of the value attribute
@param array $attribs other attributes
@return string HTML | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"password",
"input",
"field"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L198-L200 |
233,564 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.check | public static function check( $name, $checked = false, $attribs = array() ) {
return self::element(
'input', array_merge(
array(
'name' => $name,
'type' => 'checkbox',
'value' => 1
),
self::attrib( 'checked', $checked ),
$attribs
)
);
} | php | public static function check( $name, $checked = false, $attribs = array() ) {
return self::element(
'input', array_merge(
array(
'name' => $name,
'type' => 'checkbox',
'value' => 1
),
self::attrib( 'checked', $checked ),
$attribs
)
);
} | [
"public",
"static",
"function",
"check",
"(",
"$",
"name",
",",
"$",
"checked",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"element",
"(",
"'input'",
",",
"array_merge",
"(",
"array",
"(",
"'name'",
"... | Convenience function to build an HTML checkbox
@param string $name value of the name attribute
@param bool $checked Whether the checkbox is checked or not
@param array $attribs other attributes
@return string HTML | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"checkbox"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L221-L233 |
233,565 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.radio | public static function radio( $name, $value, $checked = false, $attribs = array() ) {
return self::element(
'input', array(
'name' => $name,
'type' => 'radio',
'value' => $value
) + self::attrib( 'checked', $checked ) + $attribs
);
} | php | public static function radio( $name, $value, $checked = false, $attribs = array() ) {
return self::element(
'input', array(
'name' => $name,
'type' => 'radio',
'value' => $value
) + self::attrib( 'checked', $checked ) + $attribs
);
} | [
"public",
"static",
"function",
"radio",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"checked",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"element",
"(",
"'input'",
",",
"array",
"(",
"'name'",
... | Convenience function to build an HTML radio button
@param string $name value of the name attribute
@param string $value value of the value attribute
@param bool $checked Whether the checkbox is checked or not
@param array $attribs other attributes
@return string HTML | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"radio",
"button"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L243-L251 |
233,566 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.label | public static function label( $label, $id, $attribs = array() ) {
$a = array( 'for' => $id );
// FIXME avoid copy pasting below:
if( isset( $attribs['class'] ) ) {
$a['class'] = $attribs['class'];
}
if( isset( $attribs['title'] ) ) {
$a['title'] = $attribs['title'];
}
return self::element( 'label'... | php | public static function label( $label, $id, $attribs = array() ) {
$a = array( 'for' => $id );
// FIXME avoid copy pasting below:
if( isset( $attribs['class'] ) ) {
$a['class'] = $attribs['class'];
}
if( isset( $attribs['title'] ) ) {
$a['title'] = $attribs['title'];
}
return self::element( 'label'... | [
"public",
"static",
"function",
"label",
"(",
"$",
"label",
",",
"$",
"id",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"a",
"=",
"array",
"(",
"'for'",
"=>",
"$",
"id",
")",
";",
"// FIXME avoid copy pasting below:",
"if",
"(",
"isse... | Convenience function to build an HTML form label
@param string $label text of the label
@param $id
@param array $attribs an attribute array. This will usually be
the same array as is passed to the corresponding input element,
so this function will cherry-pick appropriate attributes to
apply to the label as well; only ... | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"form",
"label"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L263-L275 |
233,567 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.inputLabel | public static function inputLabel( $label, $name, $id, $size = false, $value = false, $attribs = array() ) {
list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs );
return $label . ' ' . $input;
} | php | public static function inputLabel( $label, $name, $id, $size = false, $value = false, $attribs = array() ) {
list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs );
return $label . ' ' . $input;
} | [
"public",
"static",
"function",
"inputLabel",
"(",
"$",
"label",
",",
"$",
"name",
",",
"$",
"id",
",",
"$",
"size",
"=",
"false",
",",
"$",
"value",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"list",
"(",
"$",
"label",
... | Convenience function to build an HTML text input field with a label
@param string $label text of the label
@param string $name value of the name attribute
@param string $id id of the input
@param int|Bool $size value of the size attribute
@param string|Bool $value value of the value attribute
@param array $attribs othe... | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"text",
"input",
"field",
"with",
"a",
"label"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L287-L290 |
233,568 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.checkLabel | public static function checkLabel( $label, $name, $id, $checked = false, $attribs = array() ) {
return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) .
' ' .
self::label( $label, $id, $attribs );
} | php | public static function checkLabel( $label, $name, $id, $checked = false, $attribs = array() ) {
return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) .
' ' .
self::label( $label, $id, $attribs );
} | [
"public",
"static",
"function",
"checkLabel",
"(",
"$",
"label",
",",
"$",
"name",
",",
"$",
"id",
",",
"$",
"checked",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"check",
"(",
"$",
"name",
",",
"... | Convenience function to build an HTML checkbox with a label
@param $label
@param $name
@param $id
@param $checked bool
@param $attribs array
@return string HTML | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"checkbox",
"with",
"a",
"label"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L322-L326 |
233,569 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.radioLabel | public static function radioLabel( $label, $name, $value, $id, $checked = false, $attribs = array() ) {
return self::radio( $name, $value, $checked, array( 'id' => $id ) + $attribs ) .
' ' .
self::label( $label, $id, $attribs );
} | php | public static function radioLabel( $label, $name, $value, $id, $checked = false, $attribs = array() ) {
return self::radio( $name, $value, $checked, array( 'id' => $id ) + $attribs ) .
' ' .
self::label( $label, $id, $attribs );
} | [
"public",
"static",
"function",
"radioLabel",
"(",
"$",
"label",
",",
"$",
"name",
",",
"$",
"value",
",",
"$",
"id",
",",
"$",
"checked",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"radio",
"(",
... | Convenience function to build an HTML radio button with a label
@param $label
@param $name
@param $value
@param $id
@param $checked bool
@param $attribs array
@return string HTML | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"radio",
"button",
"with",
"a",
"label"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L340-L344 |
233,570 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.option | public static function option( $text, $value = null, $selected = false,
$attribs = array() ) {
if( !is_null( $value ) ) {
$attribs['value'] = $value;
}
if( $selected ) {
$attribs['selected'] = 'selected';
}
return self::element( 'option', $attribs, $text );
} | php | public static function option( $text, $value = null, $selected = false,
$attribs = array() ) {
if( !is_null( $value ) ) {
$attribs['value'] = $value;
}
if( $selected ) {
$attribs['selected'] = 'selected';
}
return self::element( 'option', $attribs, $text );
} | [
"public",
"static",
"function",
"option",
"(",
"$",
"text",
",",
"$",
"value",
"=",
"null",
",",
"$",
"selected",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
... | Convenience function to build an HTML drop-down list item.
@param string $text text for this item. Will be HTML escaped
@param string $value form submission value; if empty, use text
@param $selected boolean: if true, will be the default selected item
@param array $attribs optional additional HTML attributes
@return st... | [
"Convenience",
"function",
"to",
"build",
"an",
"HTML",
"drop",
"-",
"down",
"list",
"item",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L364-L373 |
233,571 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.listDropDown | public static function listDropDown( $name = '', $list = '', $other = '', $selected = '', $class = '', $tabindex = null ) {
$optgroup = false;
$options = self::option( $other, 'other', $selected === 'other' );
foreach( explode( "\n", $list ) as $option ){
$value = trim( $option );
if( $value == '' ) {
... | php | public static function listDropDown( $name = '', $list = '', $other = '', $selected = '', $class = '', $tabindex = null ) {
$optgroup = false;
$options = self::option( $other, 'other', $selected === 'other' );
foreach( explode( "\n", $list ) as $option ){
$value = trim( $option );
if( $value == '' ) {
... | [
"public",
"static",
"function",
"listDropDown",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"list",
"=",
"''",
",",
"$",
"other",
"=",
"''",
",",
"$",
"selected",
"=",
"''",
",",
"$",
"class",
"=",
"''",
",",
"$",
"tabindex",
"=",
"null",
")",
"{",
... | Build a drop-down box from a textual list.
@param $name Mixed: Name and id for the drop-down
@param $list Mixed: Correctly formatted text (newline delimited) to be used to generate the options
@param $other Mixed: Text for the "Other reasons" option
@param $selected Mixed: Option which should be pre-selected
@param $c... | [
"Build",
"a",
"drop",
"-",
"down",
"box",
"from",
"a",
"textual",
"list",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L386-L441 |
233,572 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.fieldset | public static function fieldset( $legend = false, $content = false, $attribs = array() ) {
$s = self::openElement( 'fieldset', $attribs ) . "\n";
if( $legend ) {
$s .= self::element( 'legend', null, $legend ) . "\n";
}
if( $content !== false ) {
$s .= $content . "\n";
$s .= self::closeElement( 'field... | php | public static function fieldset( $legend = false, $content = false, $attribs = array() ) {
$s = self::openElement( 'fieldset', $attribs ) . "\n";
if( $legend ) {
$s .= self::element( 'legend', null, $legend ) . "\n";
}
if( $content !== false ) {
$s .= $content . "\n";
$s .= self::closeElement( 'field... | [
"public",
"static",
"function",
"fieldset",
"(",
"$",
"legend",
"=",
"false",
",",
"$",
"content",
"=",
"false",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"s",
"=",
"self",
"::",
"openElement",
"(",
"'fieldset'",
",",
"$",
"attribs"... | Shortcut for creating fieldsets.
@param string|bool $legend Legend of the fieldset. If evaluates to false, legend is not added.
@param string|bool $content Pre-escaped content for the fieldset. If false, only open fieldset is returned.
@param array $attribs Any attributes to fieldset-element.
@return string | [
"Shortcut",
"for",
"creating",
"fieldsets",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L452-L465 |
233,573 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.textarea | public static function textarea( $name, $content, $cols = 40, $rows = 5, $attribs = array() ) {
return self::element(
'textarea',
array(
'name' => $name,
'id' => $name,
'cols' => $cols,
'rows' => $rows
) + $attribs,
$content, false
);
} | php | public static function textarea( $name, $content, $cols = 40, $rows = 5, $attribs = array() ) {
return self::element(
'textarea',
array(
'name' => $name,
'id' => $name,
'cols' => $cols,
'rows' => $rows
) + $attribs,
$content, false
);
} | [
"public",
"static",
"function",
"textarea",
"(",
"$",
"name",
",",
"$",
"content",
",",
"$",
"cols",
"=",
"40",
",",
"$",
"rows",
"=",
"5",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"element",
"(",
"'textarea'",... | Shortcut for creating textareas.
@param string $name The 'name' for the textarea
@param string $content Content for the textarea
@param int $cols The number of columns for the textarea
@param int $rows The number of rows for the textarea
@param array $attribs Any other attributes for the textarea
@return string | [
"Shortcut",
"for",
"creating",
"textareas",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L478-L489 |
233,574 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.isWellFormed | public static function isWellFormed( $text ) {
$parser = xml_parser_create( "UTF-8" );
# case folding violates XML standard, turn it off
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false );
if( !xml_parse( $parser, $text, true ) ) {
//$err = xml_error_string( xml_get_error_code( $parser ) );
... | php | public static function isWellFormed( $text ) {
$parser = xml_parser_create( "UTF-8" );
# case folding violates XML standard, turn it off
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false );
if( !xml_parse( $parser, $text, true ) ) {
//$err = xml_error_string( xml_get_error_code( $parser ) );
... | [
"public",
"static",
"function",
"isWellFormed",
"(",
"$",
"text",
")",
"{",
"$",
"parser",
"=",
"xml_parser_create",
"(",
"\"UTF-8\"",
")",
";",
"# case folding violates XML standard, turn it off",
"xml_parser_set_option",
"(",
"$",
"parser",
",",
"XML_OPTION_CASE_FOLDI... | Check if a string is well-formed XML.
Must include the surrounding tag.
@param string $text string to test.
@return bool
@todo Error position reporting return | [
"Check",
"if",
"a",
"string",
"is",
"well",
"-",
"formed",
"XML",
".",
"Must",
"include",
"the",
"surrounding",
"tag",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L605-L623 |
233,575 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.buildTable | public static function buildTable( $rows, $attribs = array(), $headers = null ) {
$s = self::openElement( 'table', $attribs );
if( is_array( $headers ) ) {
$s .= self::openElement( 'thead', $attribs );
foreach( $headers as $id => $header ){
$attribs = array();
if( is_string( $id ) ) {
$attribs... | php | public static function buildTable( $rows, $attribs = array(), $headers = null ) {
$s = self::openElement( 'table', $attribs );
if( is_array( $headers ) ) {
$s .= self::openElement( 'thead', $attribs );
foreach( $headers as $id => $header ){
$attribs = array();
if( is_string( $id ) ) {
$attribs... | [
"public",
"static",
"function",
"buildTable",
"(",
"$",
"rows",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
",",
"$",
"headers",
"=",
"null",
")",
"{",
"$",
"s",
"=",
"self",
"::",
"openElement",
"(",
"'table'",
",",
"$",
"attribs",
")",
";",
"if"... | Build a table of data
@param array $rows An array of arrays of strings, each to be a row in a table
@param array $attribs An array of attributes to apply to the table tag [optional]
@param array $headers An array of strings to use as table headers [optional]
@return string | [
"Build",
"a",
"table",
"of",
"data"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L928-L959 |
233,576 | MW-Peachy/Peachy | Plugins/Xml.php | Xml.buildTableRow | public static function buildTableRow( $attribs, $cells ) {
$s = self::openElement( 'tr', $attribs );
foreach( $cells as $id => $cell ){
$attribs = array();
if( is_string( $id ) ) {
$attribs['id'] = $id;
}
$s .= self::element( 'td', $attribs, $cell );
}
$s .= self::closeElement( 'tr' );
re... | php | public static function buildTableRow( $attribs, $cells ) {
$s = self::openElement( 'tr', $attribs );
foreach( $cells as $id => $cell ){
$attribs = array();
if( is_string( $id ) ) {
$attribs['id'] = $id;
}
$s .= self::element( 'td', $attribs, $cell );
}
$s .= self::closeElement( 'tr' );
re... | [
"public",
"static",
"function",
"buildTableRow",
"(",
"$",
"attribs",
",",
"$",
"cells",
")",
"{",
"$",
"s",
"=",
"self",
"::",
"openElement",
"(",
"'tr'",
",",
"$",
"attribs",
")",
";",
"foreach",
"(",
"$",
"cells",
"as",
"$",
"id",
"=>",
"$",
"ce... | Build a row for a table
@param array $attribs An array of attributes to apply to the tr tag
@param array $cells An array of strings to put in <td>
@return string | [
"Build",
"a",
"row",
"for",
"a",
"table"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/Xml.php#L967-L983 |
233,577 | scherersoftware/cake-notifications | src/Transport/EmailTransport.php | EmailTransport.processQueueObject | public static function processQueueObject(Base $job)
{
$notification = new EmailNotification();
if ($job->data('beforeSendCallback') !== []) {
foreach ($job->data('beforeSendCallback') as $callback) {
$notification->addBeforeSendCallback($callback['class'], $callback['ar... | php | public static function processQueueObject(Base $job)
{
$notification = new EmailNotification();
if ($job->data('beforeSendCallback') !== []) {
foreach ($job->data('beforeSendCallback') as $callback) {
$notification->addBeforeSendCallback($callback['class'], $callback['ar... | [
"public",
"static",
"function",
"processQueueObject",
"(",
"Base",
"$",
"job",
")",
"{",
"$",
"notification",
"=",
"new",
"EmailNotification",
"(",
")",
";",
"if",
"(",
"$",
"job",
"->",
"data",
"(",
"'beforeSendCallback'",
")",
"!==",
"[",
"]",
")",
"{"... | Process the job coming from the queue
@param Base $job Queuesadilla base job
@return void | [
"Process",
"the",
"job",
"coming",
"from",
"the",
"queue"
] | 916fa8d60dbe94c0b146339eed147b1a1f2a1902 | https://github.com/scherersoftware/cake-notifications/blob/916fa8d60dbe94c0b146339eed147b1a1f2a1902/src/Transport/EmailTransport.php#L47-L67 |
233,578 | goalio/GoalioMailService | src/GoalioMailService/Mail/Service/Message.php | Message.createTextMessage | public function createTextMessage($from, $to, $subject, $nameOrModel, $values = array()) {
$renderer = $this->getRenderer();
$content = $renderer->render($nameOrModel, $values);
return $this->getDefaultMessage($from, 'utf-8', $to, $subject, $content);
} | php | public function createTextMessage($from, $to, $subject, $nameOrModel, $values = array()) {
$renderer = $this->getRenderer();
$content = $renderer->render($nameOrModel, $values);
return $this->getDefaultMessage($from, 'utf-8', $to, $subject, $content);
} | [
"public",
"function",
"createTextMessage",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"nameOrModel",
",",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"$",
"renderer",
"=",
"$",
"this",
"->",
"getRenderer",
"(",
")",
";",
... | Return a text message ready to be sent
@param array|string $from
A string containing the sender e-mail address, or if array with keys email and name
@param array|string $to
An array containing the recipients of the mail
@param string $subject
Subject of the mail
@param string|\Zend\View\Model\ModelInterface $nameOrMod... | [
"Return",
"a",
"text",
"message",
"ready",
"to",
"be",
"sent"
] | 49f69fb5e29885b70712660b1ac5bb934164bbbb | https://github.com/goalio/GoalioMailService/blob/49f69fb5e29885b70712660b1ac5bb934164bbbb/src/GoalioMailService/Mail/Service/Message.php#L96-L101 |
233,579 | wardrobecms/core-archived | src/Wardrobe/Core/Models/Post.php | Post.getParsedContentAttribute | public function getParsedContentAttribute()
{
if (Config::get('core::wardrobe.cache'))
{
$content = $this->attributes['content'];
return Cache::rememberForever('post-'.$this->attributes['id'], function() use ($content)
{
return md($content);
});
}
return md($this->attributes['content']);
} | php | public function getParsedContentAttribute()
{
if (Config::get('core::wardrobe.cache'))
{
$content = $this->attributes['content'];
return Cache::rememberForever('post-'.$this->attributes['id'], function() use ($content)
{
return md($content);
});
}
return md($this->attributes['content']);
} | [
"public",
"function",
"getParsedContentAttribute",
"(",
")",
"{",
"if",
"(",
"Config",
"::",
"get",
"(",
"'core::wardrobe.cache'",
")",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"attributes",
"[",
"'content'",
"]",
";",
"return",
"Cache",
"::",
"re... | Get the content parsed into html
@return string | [
"Get",
"the",
"content",
"parsed",
"into",
"html"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Models/Post.php#L47-L60 |
233,580 | wardrobecms/core-archived | src/Wardrobe/Core/Models/Post.php | Post.getParsedIntroAttribute | public function getParsedIntroAttribute()
{
$intro = $this->getIntroAttribute();
if (Config::get('core::wardrobe.cache'))
{
return Cache::rememberForever('post-intro-'.$this->attributes['id'], function() use ($intro)
{
return md($intro);
});
}
return md($intro);
} | php | public function getParsedIntroAttribute()
{
$intro = $this->getIntroAttribute();
if (Config::get('core::wardrobe.cache'))
{
return Cache::rememberForever('post-intro-'.$this->attributes['id'], function() use ($intro)
{
return md($intro);
});
}
return md($intro);
} | [
"public",
"function",
"getParsedIntroAttribute",
"(",
")",
"{",
"$",
"intro",
"=",
"$",
"this",
"->",
"getIntroAttribute",
"(",
")",
";",
"if",
"(",
"Config",
"::",
"get",
"(",
"'core::wardrobe.cache'",
")",
")",
"{",
"return",
"Cache",
"::",
"rememberForeve... | Get the parsed short version of a post
@return string | [
"Get",
"the",
"parsed",
"short",
"version",
"of",
"a",
"post"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Models/Post.php#L113-L126 |
233,581 | skrz/meta | gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithEmbeddedMessagePropertyMeta.php | ClassWithEmbeddedMessagePropertyMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new ClassWithEmbeddedMessageProperty();
case 1:
return new ClassWithEmbeddedMessageProperty(func_get_arg(0));
case 2:
return new ClassWithEmbeddedMessageProperty(func_get_arg(0), func_get_arg(1));
case 3:
return n... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new ClassWithEmbeddedMessageProperty();
case 1:
return new ClassWithEmbeddedMessageProperty(func_get_arg(0));
case 2:
return new ClassWithEmbeddedMessageProperty(func_get_arg(0), func_get_arg(1));
case 3:
return n... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"ClassWithEmbeddedMessageProperty",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"ClassWithEmbeddedMessagePrope... | Creates new instance of \Skrz\Meta\Fixtures\Protobuf\ClassWithEmbeddedMessageProperty
@throws \InvalidArgumentException
@return ClassWithEmbeddedMessageProperty | [
"Creates",
"new",
"instance",
"of",
"\\",
"Skrz",
"\\",
"Meta",
"\\",
"Fixtures",
"\\",
"Protobuf",
"\\",
"ClassWithEmbeddedMessageProperty"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithEmbeddedMessagePropertyMeta.php#L67-L91 |
233,582 | skrz/meta | gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithEmbeddedMessagePropertyMeta.php | ClassWithEmbeddedMessagePropertyMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->x)) {
hash_update($ctx, 'x');
EmbeddedMeta::hash($object->x, $ctx);
}
if (is_string($algoOrCtx)) {
return has... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->x)) {
hash_update($ctx, 'x');
EmbeddedMeta::hash($object->x, $ctx);
}
if (is_string($algoOrCtx)) {
return has... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Skrz\Meta\Fixtures\Protobuf\ClassWithEmbeddedMessageProperty
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Skrz",
"\\",
"Meta",
"\\",
"Fixtures",
"\\",
"Protobuf",
"\\",
"ClassWithEmbeddedMessageProperty"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithEmbeddedMessagePropertyMeta.php#L122-L140 |
233,583 | skrz/meta | gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithEmbeddedMessagePropertyMeta.php | ClassWithEmbeddedMessagePropertyMeta.toProtobuf | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->x) && ($filter === null || isset($filter['x']))) {
$output .= "\x0a";
$buffer = EmbeddedMeta::toProtobuf($object->x, $filter === null ? null : $filter['x']);
$output .= Binary::encodeVarint(strlen($buffer));
... | php | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->x) && ($filter === null || isset($filter['x']))) {
$output .= "\x0a";
$buffer = EmbeddedMeta::toProtobuf($object->x, $filter === null ? null : $filter['x']);
$output .= Binary::encodeVarint(strlen($buffer));
... | [
"public",
"static",
"function",
"toProtobuf",
"(",
"$",
"object",
",",
"$",
"filter",
"=",
"NULL",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"x",
")",
"&&",
"(",
"$",
"filter",
"===",
"null",
"||",
"is... | Serialized \Skrz\Meta\Fixtures\Protobuf\ClassWithEmbeddedMessageProperty to Protocol Buffers message.
@param ClassWithEmbeddedMessageProperty $object
@param array $filter
@throws \Exception
@return string | [
"Serialized",
"\\",
"Skrz",
"\\",
"Meta",
"\\",
"Fixtures",
"\\",
"Protobuf",
"\\",
"ClassWithEmbeddedMessageProperty",
"to",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithEmbeddedMessagePropertyMeta.php#L396-L408 |
233,584 | scherersoftware/cake-model-history | src/Model/Entity/HistoryContextTrait.php | HistoryContextTrait.setHistoryContext | public function setHistoryContext(string $type, $dataObject = null, $slug = null): void
{
if (!in_array($type, array_keys(ModelHistory::getContextTypes()))) {
throw new InvalidArgumentException("$type is not allowed as context type. Allowed types are: " . implode(', ', ModelHistory::getContextTy... | php | public function setHistoryContext(string $type, $dataObject = null, $slug = null): void
{
if (!in_array($type, array_keys(ModelHistory::getContextTypes()))) {
throw new InvalidArgumentException("$type is not allowed as context type. Allowed types are: " . implode(', ', ModelHistory::getContextTy... | [
"public",
"function",
"setHistoryContext",
"(",
"string",
"$",
"type",
",",
"$",
"dataObject",
"=",
"null",
",",
"$",
"slug",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"type",
",",
"array_keys",
"(",
"ModelHistory",
"::"... | Sets a context given through a request to identify the creation
point of the revision.
@param string $type Context type
@param object $dataObject Optional dataobject to get additional data from
@param string $slug Optional slug. Must implement getContexts() when using
@return void | [
"Sets",
"a",
"context",
"given",
"through",
"a",
"request",
"to",
"identify",
"the",
"creation",
"point",
"of",
"the",
"revision",
"."
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Entity/HistoryContextTrait.php#L48-L109 |
233,585 | yeephp/yeephp | Yee/Yee.php | Yee.getDefaultSettings | public static function getDefaultSettings()
{
return array(
// Application
'mode' => 'development',
// Debugging
'debug' => true,
// Logging
'log.writer' => null,
'log.level' => \Yee\Log::DEBUG,
'log.enabled' => ... | php | public static function getDefaultSettings()
{
return array(
// Application
'mode' => 'development',
// Debugging
'debug' => true,
// Logging
'log.writer' => null,
'log.level' => \Yee\Log::DEBUG,
'log.enabled' => ... | [
"public",
"static",
"function",
"getDefaultSettings",
"(",
")",
"{",
"return",
"array",
"(",
"// Application",
"'mode'",
"=>",
"'development'",
",",
"// Debugging",
"'debug'",
"=>",
"true",
",",
"// Logging",
"'log.writer'",
"=>",
"null",
",",
"'log.level'",
"=>",... | Get default application settings
@return array | [
"Get",
"default",
"application",
"settings"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L292-L322 |
233,586 | yeephp/yeephp | Yee/Yee.php | Yee.config | public function config($name, $value = null)
{
$c = $this->container;
if (is_array($name)) {
if (true === $value) {
$c['settings'] = array_merge_recursive($c['settings'], $name);
} else {
$c['settings'] = array_merge($c['settings'], $name);
... | php | public function config($name, $value = null)
{
$c = $this->container;
if (is_array($name)) {
if (true === $value) {
$c['settings'] = array_merge_recursive($c['settings'], $name);
} else {
$c['settings'] = array_merge($c['settings'], $name);
... | [
"public",
"function",
"config",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"container",
";",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"value",
")",... | Configure Yee Settings
This method defines application settings and acts as a setter and a getter.
If only one argument is specified and that argument is a string, the value
of the setting identified by the first argument will be returned, or NULL if
that setting does not exist.
If only one argument is specified and... | [
"Configure",
"Yee",
"Settings"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L343-L360 |
233,587 | yeephp/yeephp | Yee/Yee.php | Yee.put | public function put()
{
$args = func_get_args();
return $this->mapRoute($args)->via(\Yee\Http\Request::METHOD_PUT);
} | php | public function put()
{
$args = func_get_args();
return $this->mapRoute($args)->via(\Yee\Http\Request::METHOD_PUT);
} | [
"public",
"function",
"put",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"return",
"$",
"this",
"->",
"mapRoute",
"(",
"$",
"args",
")",
"->",
"via",
"(",
"\\",
"Yee",
"\\",
"Http",
"\\",
"Request",
"::",
"METHOD_PUT",
")",
";"... | Add PUT route
@see mapRoute()
@return \Yee\Route | [
"Add",
"PUT",
"route"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L500-L505 |
233,588 | yeephp/yeephp | Yee/Yee.php | Yee.patch | public function patch()
{
$args = func_get_args();
return $this->mapRoute($args)->via(\Yee\Http\Request::METHOD_PATCH);
} | php | public function patch()
{
$args = func_get_args();
return $this->mapRoute($args)->via(\Yee\Http\Request::METHOD_PATCH);
} | [
"public",
"function",
"patch",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"return",
"$",
"this",
"->",
"mapRoute",
"(",
"$",
"args",
")",
"->",
"via",
"(",
"\\",
"Yee",
"\\",
"Http",
"\\",
"Request",
"::",
"METHOD_PATCH",
")",
... | Add PATCH route
@see mapRoute()
@return \Yee\Route | [
"Add",
"PATCH",
"route"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L512-L517 |
233,589 | yeephp/yeephp | Yee/Yee.php | Yee.getCookie | public function getCookie($name, $deleteIfInvalid = true)
{
// Get cookie value
$value = $this->request->cookies->get($name);
// Decode if encrypted
if ($this->config('cookies.encrypt')) {
$value = \Yee\Http\Util::decodeSecureCookie(
$value,
... | php | public function getCookie($name, $deleteIfInvalid = true)
{
// Get cookie value
$value = $this->request->cookies->get($name);
// Decode if encrypted
if ($this->config('cookies.encrypt')) {
$value = \Yee\Http\Util::decodeSecureCookie(
$value,
... | [
"public",
"function",
"getCookie",
"(",
"$",
"name",
",",
"$",
"deleteIfInvalid",
"=",
"true",
")",
"{",
"// Get cookie value",
"$",
"value",
"=",
"$",
"this",
"->",
"request",
"->",
"cookies",
"->",
"get",
"(",
"$",
"name",
")",
";",
"// Decode if encrypt... | Get value of HTTP cookie from the current HTTP request
Return the value of a cookie from the current HTTP request,
or return NULL if cookie does not exist. Cookies created during
the current request will not be available until the next request.
@param string $name
@param bool $deleteIfInvalid
@return st... | [
"Get",
"value",
"of",
"HTTP",
"cookie",
"from",
"the",
"current",
"HTTP",
"request"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L898-L917 |
233,590 | yeephp/yeephp | Yee/Yee.php | Yee.setEncryptedCookie | public function setEncryptedCookie($name, $value, $expires = null, $path = null, $domain = null, $secure = false, $httponly = false)
{
$this->setCookie($name, $value, $expires, $path, $domain, $secure, $httponly);
} | php | public function setEncryptedCookie($name, $value, $expires = null, $path = null, $domain = null, $secure = false, $httponly = false)
{
$this->setCookie($name, $value, $expires, $path, $domain, $secure, $httponly);
} | [
"public",
"function",
"setEncryptedCookie",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"expires",
"=",
"null",
",",
"$",
"path",
"=",
"null",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"secure",
"=",
"false",
",",
"$",
"httponly",
"=",
"false",
... | DEPRECATION WARNING! Use `setCookie` with the `cookies.encrypt` app setting set to `true`.
Set encrypted HTTP cookie
@param string $name The cookie name
@param mixed $value The cookie value
@param mixed $expires The duration of the cookie;
If integer, should be UNIX timestamp;
If string, conv... | [
"DEPRECATION",
"WARNING!",
"Use",
"setCookie",
"with",
"the",
"cookies",
".",
"encrypt",
"app",
"setting",
"set",
"to",
"true",
"."
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L935-L938 |
233,591 | yeephp/yeephp | Yee/Yee.php | Yee.urlFor | public function urlFor($name, $params = array())
{
return $this->request->getRootUri() . $this->router->urlFor($name, $params);
} | php | public function urlFor($name, $params = array())
{
return $this->request->getRootUri() . $this->router->urlFor($name, $params);
} | [
"public",
"function",
"urlFor",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"request",
"->",
"getRootUri",
"(",
")",
".",
"$",
"this",
"->",
"router",
"->",
"urlFor",
"(",
"$",
"name",
",",
... | Get the URL for a named route
@param string $name The route name
@param array $params Associative array of URL parameters and replacement values
@throws \RuntimeException If named route does not exist
@return string | [
"Get",
"the",
"URL",
"for",
"a",
"named",
"route"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L1087-L1090 |
233,592 | yeephp/yeephp | Yee/Yee.php | Yee.flash | public function flash($key, $value)
{
if (isset($this->environment['yee.flash'])) {
$this->environment['yee.flash']->set($key, $value);
}
} | php | public function flash($key, $value)
{
if (isset($this->environment['yee.flash'])) {
$this->environment['yee.flash']->set($key, $value);
}
} | [
"public",
"function",
"flash",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"environment",
"[",
"'yee.flash'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"environment",
"[",
"'yee.flash'",
"]",
"->",
"set",
... | Set flash message for subsequent request
@param string $key
@param mixed $value | [
"Set",
"flash",
"message",
"for",
"subsequent",
"request"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L1119-L1124 |
233,593 | yeephp/yeephp | Yee/Yee.php | Yee.flashNow | public function flashNow($key, $value)
{
if (isset($this->environment['yee.flash'])) {
$this->environment['yee.flash']->now($key, $value);
}
} | php | public function flashNow($key, $value)
{
if (isset($this->environment['yee.flash'])) {
$this->environment['yee.flash']->now($key, $value);
}
} | [
"public",
"function",
"flashNow",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"environment",
"[",
"'yee.flash'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"environment",
"[",
"'yee.flash'",
"]",
"->",
"now",... | Set flash message for current request
@param string $key
@param mixed $value | [
"Set",
"flash",
"message",
"for",
"current",
"request"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Yee.php#L1131-L1136 |
233,594 | simplesamlphp/simplesamlphp-module-aggregator | lib/Aggregator.php | sspmod_aggregator_Aggregator.exclude | public function exclude($exclude) {
$this->excludeTags = array_merge($this->excludeTags, SimpleSAML_Utilities::arrayize($exclude));
} | php | public function exclude($exclude) {
$this->excludeTags = array_merge($this->excludeTags, SimpleSAML_Utilities::arrayize($exclude));
} | [
"public",
"function",
"exclude",
"(",
"$",
"exclude",
")",
"{",
"$",
"this",
"->",
"excludeTags",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"excludeTags",
",",
"SimpleSAML_Utilities",
"::",
"arrayize",
"(",
"$",
"exclude",
")",
")",
";",
"}"
] | Add tag to excelude when collecting source metadata.
$exclude May be string or array identifying a tag to exclude. | [
"Add",
"tag",
"to",
"excelude",
"when",
"collecting",
"source",
"metadata",
"."
] | 1afd0913392193bc4d0b94cfc9a5020daac0fdbe | https://github.com/simplesamlphp/simplesamlphp-module-aggregator/blob/1afd0913392193bc4d0b94cfc9a5020daac0fdbe/lib/Aggregator.php#L70-L72 |
233,595 | simplesamlphp/simplesamlphp-module-aggregator | lib/Aggregator.php | sspmod_aggregator_Aggregator.getSources | public function getSources() {
$sourcesDef = $this->aConfig->getArray('sources');
try {
$sources = SimpleSAML_Metadata_MetaDataStorageSource::parseSources($sourcesDef);
} catch (Exception $e) {
throw new Exception('Invalid aggregator source configuration for aggregator ' .
var_export($id, TRUE) . ':... | php | public function getSources() {
$sourcesDef = $this->aConfig->getArray('sources');
try {
$sources = SimpleSAML_Metadata_MetaDataStorageSource::parseSources($sourcesDef);
} catch (Exception $e) {
throw new Exception('Invalid aggregator source configuration for aggregator ' .
var_export($id, TRUE) . ':... | [
"public",
"function",
"getSources",
"(",
")",
"{",
"$",
"sourcesDef",
"=",
"$",
"this",
"->",
"aConfig",
"->",
"getArray",
"(",
"'sources'",
")",
";",
"try",
"{",
"$",
"sources",
"=",
"SimpleSAML_Metadata_MetaDataStorageSource",
"::",
"parseSources",
"(",
"$",... | Returns a list of entities with metadata | [
"Returns",
"a",
"list",
"of",
"entities",
"with",
"metadata"
] | 1afd0913392193bc4d0b94cfc9a5020daac0fdbe | https://github.com/simplesamlphp/simplesamlphp-module-aggregator/blob/1afd0913392193bc4d0b94cfc9a5020daac0fdbe/lib/Aggregator.php#L77-L122 |
233,596 | morilog/InfinityCache | src/Builder.php | Builder.get | public function get($columns = ['*'])
{
$cacheKey = $this->generateCacheKey();
if (null === ($results = $this->cache->tags($this->cacheTag)->get($cacheKey))) {
$results = parent::get($columns);
if ($this->isTimeAwareQuery) {
// Cache results for $cacheLifeTi... | php | public function get($columns = ['*'])
{
$cacheKey = $this->generateCacheKey();
if (null === ($results = $this->cache->tags($this->cacheTag)->get($cacheKey))) {
$results = parent::get($columns);
if ($this->isTimeAwareQuery) {
// Cache results for $cacheLifeTi... | [
"public",
"function",
"get",
"(",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"generateCacheKey",
"(",
")",
";",
"if",
"(",
"null",
"===",
"(",
"$",
"results",
"=",
"$",
"this",
"->",
"cache",
"->",
"t... | Execute the query as a "select" statement.
All Cached results will be flushed after every CUD operations
@param array $columns
@return array|static[] | [
"Execute",
"the",
"query",
"as",
"a",
"select",
"statement",
".",
"All",
"Cached",
"results",
"will",
"be",
"flushed",
"after",
"every",
"CUD",
"operations"
] | c87231b9995fbbcfdd0a67ab5ffc2697382031d7 | https://github.com/morilog/InfinityCache/blob/c87231b9995fbbcfdd0a67ab5ffc2697382031d7/src/Builder.php#L64-L82 |
233,597 | morilog/InfinityCache | src/Builder.php | Builder.newQuery | public function newQuery()
{
return new static(
$this->cache,
$this->connection,
$this->grammar,
$this->processor,
$this->cacheTag
);
} | php | public function newQuery()
{
return new static(
$this->cache,
$this->connection,
$this->grammar,
$this->processor,
$this->cacheTag
);
} | [
"public",
"function",
"newQuery",
"(",
")",
"{",
"return",
"new",
"static",
"(",
"$",
"this",
"->",
"cache",
",",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"grammar",
",",
"$",
"this",
"->",
"processor",
",",
"$",
"this",
"->",
"cacheT... | Get a new instance of the query builder.
@return Builder | [
"Get",
"a",
"new",
"instance",
"of",
"the",
"query",
"builder",
"."
] | c87231b9995fbbcfdd0a67ab5ffc2697382031d7 | https://github.com/morilog/InfinityCache/blob/c87231b9995fbbcfdd0a67ab5ffc2697382031d7/src/Builder.php#L89-L98 |
233,598 | morilog/InfinityCache | src/Builder.php | Builder.generateCacheKey | protected function generateCacheKey()
{
$bindings = array_map(function ($param) {
// Round datetime
if ($param instanceof \DateTime) {
$this->isTimeAwareQuery = true;
return $this->getRoundedDateTime($param);
}
return $param;
... | php | protected function generateCacheKey()
{
$bindings = array_map(function ($param) {
// Round datetime
if ($param instanceof \DateTime) {
$this->isTimeAwareQuery = true;
return $this->getRoundedDateTime($param);
}
return $param;
... | [
"protected",
"function",
"generateCacheKey",
"(",
")",
"{",
"$",
"bindings",
"=",
"array_map",
"(",
"function",
"(",
"$",
"param",
")",
"{",
"// Round datetime",
"if",
"(",
"$",
"param",
"instanceof",
"\\",
"DateTime",
")",
"{",
"$",
"this",
"->",
"isTimeA... | Generate unique cache key from query and it bindings parameters
@return string | [
"Generate",
"unique",
"cache",
"key",
"from",
"query",
"and",
"it",
"bindings",
"parameters"
] | c87231b9995fbbcfdd0a67ab5ffc2697382031d7 | https://github.com/morilog/InfinityCache/blob/c87231b9995fbbcfdd0a67ab5ffc2697382031d7/src/Builder.php#L105-L121 |
233,599 | budde377/Part | lib/model/page/PageImpl.php | PageImpl.getTemplate | public function getTemplate()
{
if($this->template != ''){
return $this->template;
}
if(($defaultTemplate = $this->container->getConfigInstance()->getDefaultTemplateName()) == null){
return '';
}
return $defaultTemplate;
} | php | public function getTemplate()
{
if($this->template != ''){
return $this->template;
}
if(($defaultTemplate = $this->container->getConfigInstance()->getDefaultTemplateName()) == null){
return '';
}
return $defaultTemplate;
} | [
"public",
"function",
"getTemplate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"template",
"!=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"template",
";",
"}",
"if",
"(",
"(",
"$",
"defaultTemplate",
"=",
"$",
"this",
"->",
"container",
"->",
... | The return string should match a template in some config.
@return string | [
"The",
"return",
"string",
"should",
"match",
"a",
"template",
"in",
"some",
"config",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/page/PageImpl.php#L91-L102 |
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.