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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
17,200 | qcubed/orm | src/Codegen/CodegenBase.php | CodegenBase.dataListItemName | public static function dataListItemName(SqlTable $objTable)
{
if (($o = $objTable->Options) && isset ($o['ItemName'])) { // Did developer override?
return $o['ItemName'];
}
return QString::wordsFromCamelCase($objTable->ClassName);
} | php | public static function dataListItemName(SqlTable $objTable)
{
if (($o = $objTable->Options) && isset ($o['ItemName'])) { // Did developer override?
return $o['ItemName'];
}
return QString::wordsFromCamelCase($objTable->ClassName);
} | [
"public",
"static",
"function",
"dataListItemName",
"(",
"SqlTable",
"$",
"objTable",
")",
"{",
"if",
"(",
"(",
"$",
"o",
"=",
"$",
"objTable",
"->",
"Options",
")",
"&&",
"isset",
"(",
"$",
"o",
"[",
"'ItemName'",
"]",
")",
")",
"{",
"// Did developer... | Returns the name of an item in the data list as will be displayed in the edit panel.
@param SqlTable $objTable
@return string | [
"Returns",
"the",
"name",
"of",
"an",
"item",
"in",
"the",
"data",
"list",
"as",
"will",
"be",
"displayed",
"in",
"the",
"edit",
"panel",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Codegen/CodegenBase.php#L1026-L1032 |
17,201 | qcubed/orm | src/Codegen/CodegenBase.php | CodegenBase.variableTypeFromDbType | protected function variableTypeFromDbType($strDbType)
{
switch ($strDbType) {
case Database\FieldType::BIT:
return Type::BOOLEAN;
case Database\FieldType::BLOB:
return Type::STRING;
case Database\FieldType::CHAR:
return Type... | php | protected function variableTypeFromDbType($strDbType)
{
switch ($strDbType) {
case Database\FieldType::BIT:
return Type::BOOLEAN;
case Database\FieldType::BLOB:
return Type::STRING;
case Database\FieldType::CHAR:
return Type... | [
"protected",
"function",
"variableTypeFromDbType",
"(",
"$",
"strDbType",
")",
"{",
"switch",
"(",
"$",
"strDbType",
")",
"{",
"case",
"Database",
"\\",
"FieldType",
"::",
"BIT",
":",
"return",
"Type",
"::",
"BOOLEAN",
";",
"case",
"Database",
"\\",
"FieldTy... | Returns the variable type corresponding to the database column type
@param string $strDbType
@return string
@throws \Exception | [
"Returns",
"the",
"variable",
"type",
"corresponding",
"to",
"the",
"database",
"column",
"type"
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Codegen/CodegenBase.php#L1290-L1316 |
17,202 | qcubed/orm | src/Codegen/CodegenBase.php | CodegenBase.pluralize | protected function pluralize($strName)
{
// Special Rules go Here
switch (true) {
case (strtolower($strName) == 'play'):
return $strName . 's';
}
$intLength = strlen($strName);
if (substr($strName, $intLength - 1) == "y") {
return subs... | php | protected function pluralize($strName)
{
// Special Rules go Here
switch (true) {
case (strtolower($strName) == 'play'):
return $strName . 's';
}
$intLength = strlen($strName);
if (substr($strName, $intLength - 1) == "y") {
return subs... | [
"protected",
"function",
"pluralize",
"(",
"$",
"strName",
")",
"{",
"// Special Rules go Here",
"switch",
"(",
"true",
")",
"{",
"case",
"(",
"strtolower",
"(",
"$",
"strName",
")",
"==",
"'play'",
")",
":",
"return",
"$",
"strName",
".",
"'s'",
";",
"}... | Return the plural of the given name. Override this and return the plural version of particular names
if this generic version isn't working for you.
@param string $strName
@return string | [
"Return",
"the",
"plural",
"of",
"the",
"given",
"name",
".",
"Override",
"this",
"and",
"return",
"the",
"plural",
"version",
"of",
"particular",
"names",
"if",
"this",
"generic",
"version",
"isn",
"t",
"working",
"for",
"you",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Codegen/CodegenBase.php#L1325-L1354 |
17,203 | austinkregel/Warden | src/Warden/Traits/Wardenable.php | Wardenable.toArray | public function toArray()
{
$attr = !empty($this->getWarden()) ? $this->getWarden() : null;
if (empty($attr)) {
$attr = empty($this->getVisible()) ? $this->getFillable() : $this->getVisible();
}
$returnable = [];
$f_model = \FormModel::using('plain')->withModel($... | php | public function toArray()
{
$attr = !empty($this->getWarden()) ? $this->getWarden() : null;
if (empty($attr)) {
$attr = empty($this->getVisible()) ? $this->getFillable() : $this->getVisible();
}
$returnable = [];
$f_model = \FormModel::using('plain')->withModel($... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"attr",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"getWarden",
"(",
")",
")",
"?",
"$",
"this",
"->",
"getWarden",
"(",
")",
":",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"attr",
")",
")",... | Parses the warden config.
@return array | [
"Parses",
"the",
"warden",
"config",
"."
] | 6f5a98bd79a488f0f300f4851061ac6f7d19f8a3 | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Traits/Wardenable.php#L36-L61 |
17,204 | ClanCats/Core | src/bundles/Mail/CCMail.php | CCMail.cc | public function cc( $email, $name = null )
{
if ( !is_array( $email ) )
{
$email = array( $email => $name );
}
foreach( $email as $address => $name )
{
if ( is_numeric( $address ) && is_string( $name ) )
{
$this->cc[$name] = null;
}
else
{
$this->cc[$address] = $name;
}
}... | php | public function cc( $email, $name = null )
{
if ( !is_array( $email ) )
{
$email = array( $email => $name );
}
foreach( $email as $address => $name )
{
if ( is_numeric( $address ) && is_string( $name ) )
{
$this->cc[$name] = null;
}
else
{
$this->cc[$address] = $name;
}
}... | [
"public",
"function",
"cc",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"email",
")",
")",
"{",
"$",
"email",
"=",
"array",
"(",
"$",
"email",
"=>",
"$",
"name",
")",
";",
"}",
"foreach",
... | Add Carbon copies
Works like the 'to' function.
@param string $email
@param string $name
@return self | [
"Add",
"Carbon",
"copies"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/CCMail.php#L196-L216 |
17,205 | ClanCats/Core | src/bundles/Mail/CCMail.php | CCMail.send | public function send()
{
// load the mail configuration
$config = \CCConfig::create( 'mail' );
// when mailing is disabled do nothing just return
if ( $config->disabled === true )
{
return;
}
// we cannot send a mail without recipients
if ( empty( $this->to ) )
{
throw new Exception( "Can... | php | public function send()
{
// load the mail configuration
$config = \CCConfig::create( 'mail' );
// when mailing is disabled do nothing just return
if ( $config->disabled === true )
{
return;
}
// we cannot send a mail without recipients
if ( empty( $this->to ) )
{
throw new Exception( "Can... | [
"public",
"function",
"send",
"(",
")",
"{",
"// load the mail configuration",
"$",
"config",
"=",
"\\",
"CCConfig",
"::",
"create",
"(",
"'mail'",
")",
";",
"// when mailing is disabled do nothing just return",
"if",
"(",
"$",
"config",
"->",
"disabled",
"===",
"... | Prepare the message for sending to the transport
@return void | [
"Prepare",
"the",
"message",
"for",
"sending",
"to",
"the",
"transport"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/CCMail.php#L361-L399 |
17,206 | ClanCats/Core | src/bundles/Mail/CCMail.php | CCMail.transport | protected function transport( $transporter = null )
{
if ( !is_null( $transporter ) )
{
$transporter = Transporter::create( $transporter );
}
else
{
$transporter = $this->transporter;
}
// pass the current mail to the transporter
$transporter->send( $this );
} | php | protected function transport( $transporter = null )
{
if ( !is_null( $transporter ) )
{
$transporter = Transporter::create( $transporter );
}
else
{
$transporter = $this->transporter;
}
// pass the current mail to the transporter
$transporter->send( $this );
} | [
"protected",
"function",
"transport",
"(",
"$",
"transporter",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"transporter",
")",
")",
"{",
"$",
"transporter",
"=",
"Transporter",
"::",
"create",
"(",
"$",
"transporter",
")",
";",
"}",
"el... | Transport the message
@param string $transport Use a diffrent transporter
@return void | [
"Transport",
"the",
"message"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/CCMail.php#L407-L420 |
17,207 | datasift/php_webdriver | src/php/DataSift/WebDriver/WebDriverBase.php | WebDriverBase.returnExceptionToThrow | public function returnExceptionToThrow($status_code)
{
static $map = array (
1 => 'E4xx_IndexOutOfBoundsWebDriverError',
2 => 'E4xx_NoCollectionWebDriverError',
3 => 'E4xx_NoStringWebDriverError',
4 => 'E4xx_NoStringLengthWebDriverError',
5 =>... | php | public function returnExceptionToThrow($status_code)
{
static $map = array (
1 => 'E4xx_IndexOutOfBoundsWebDriverError',
2 => 'E4xx_NoCollectionWebDriverError',
3 => 'E4xx_NoStringWebDriverError',
4 => 'E4xx_NoStringLengthWebDriverError',
5 =>... | [
"public",
"function",
"returnExceptionToThrow",
"(",
"$",
"status_code",
")",
"{",
"static",
"$",
"map",
"=",
"array",
"(",
"1",
"=>",
"'E4xx_IndexOutOfBoundsWebDriverError'",
",",
"2",
"=>",
"'E4xx_NoCollectionWebDriverError'",
",",
"3",
"=>",
"'E4xx_NoStringWebDrive... | Returns the name of the exception class to throw
@param int $status_code the status code returned from webdriver
@return string the name of the exception class to throw, or null if no error occurred | [
"Returns",
"the",
"name",
"of",
"the",
"exception",
"class",
"to",
"throw"
] | efca991198616b53c8f40b59ad05306e2b10e7f0 | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/WebDriver/WebDriverBase.php#L45-L96 |
17,208 | datasift/php_webdriver | src/php/DataSift/WebDriver/WebDriverBase.php | WebDriverBase.getHttpVerb | private function getHttpVerb($webdriver_command)
{
$methods = $this->getMethods();
if (!isset($methods[$webdriver_command])) {
throw new E5xx_BadMethodCallWebDriverError(sprintf(
'%s is not a valid webdriver command.',
$webdriver_command
));
... | php | private function getHttpVerb($webdriver_command)
{
$methods = $this->getMethods();
if (!isset($methods[$webdriver_command])) {
throw new E5xx_BadMethodCallWebDriverError(sprintf(
'%s is not a valid webdriver command.',
$webdriver_command
));
... | [
"private",
"function",
"getHttpVerb",
"(",
"$",
"webdriver_command",
")",
"{",
"$",
"methods",
"=",
"$",
"this",
"->",
"getMethods",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"methods",
"[",
"$",
"webdriver_command",
"]",
")",
")",
"{",
"throw"... | determine the HTTP verb to use for a given webdriver command
@param string $webdriver_command the webdriver command to use
@return string the HTTP verb to use | [
"determine",
"the",
"HTTP",
"verb",
"to",
"use",
"for",
"a",
"given",
"webdriver",
"command"
] | efca991198616b53c8f40b59ad05306e2b10e7f0 | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/WebDriver/WebDriverBase.php#L311-L324 |
17,209 | webforge-labs/psc-cms | lib/Psc/CMS/ProjectsFactory.php | ProjectsFactory.getProjectRoot | public function getProjectRoot($name, $mode = Project::MODE_SRC) {
/* root
entweder ist projects.$name.root in der host-config gesetzt, oder es wird angenommen
dass das projekt in
CONFIG[projects.root]/$name/Umsetzung
ist
wenn der Mode PHAR ist, wird das Phar base Directo... | php | public function getProjectRoot($name, $mode = Project::MODE_SRC) {
/* root
entweder ist projects.$name.root in der host-config gesetzt, oder es wird angenommen
dass das projekt in
CONFIG[projects.root]/$name/Umsetzung
ist
wenn der Mode PHAR ist, wird das Phar base Directo... | [
"public",
"function",
"getProjectRoot",
"(",
"$",
"name",
",",
"$",
"mode",
"=",
"Project",
"::",
"MODE_SRC",
")",
"{",
"/* root\n \n entweder ist projects.$name.root in der host-config gesetzt, oder es wird angenommen\n dass das projekt in\n CONFIG[projects.root]/$... | Macht keine Checks ob das Projekt existiert
@return Dir | [
"Macht",
"keine",
"Checks",
"ob",
"das",
"Projekt",
"existiert"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/ProjectsFactory.php#L134-L155 |
17,210 | spiral-modules/scaffolder | source/Scaffolder/Configs/ScaffolderConfig.php | ScaffolderConfig.parseName | private function parseName(string $name): array
{
$name = str_replace('/', '\\', $name);
if (strpos($name, '\\') !== false) {
$names = explode('\\', $name);
$class = array_pop($names);
return [join('\\', $names), $class];
}
//No user namespace
... | php | private function parseName(string $name): array
{
$name = str_replace('/', '\\', $name);
if (strpos($name, '\\') !== false) {
$names = explode('\\', $name);
$class = array_pop($names);
return [join('\\', $names), $class];
}
//No user namespace
... | [
"private",
"function",
"parseName",
"(",
"string",
"$",
"name",
")",
":",
"array",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'/'",
",",
"'\\\\'",
",",
"$",
"name",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'\\\\'",
")",
"!==",
"false... | Split user name into namespace and class name.
@param string $name
@return array [namespace, name] | [
"Split",
"user",
"name",
"into",
"namespace",
"and",
"class",
"name",
"."
] | 9be9dd0da6e4b02232db24e797fe5c288afbbddf | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Configs/ScaffolderConfig.php#L179-L192 |
17,211 | 4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.getGalleryList | private function getGalleryList(Response $response)
{
$list = $this->manager->getGalleryList();
foreach ($list as $gallery) {
/* @var \FDevs\Photatoes\Gallery $gallery */
$file = $this->prepareGallery($gallery);
$response->addFile($file);
$response->ad... | php | private function getGalleryList(Response $response)
{
$list = $this->manager->getGalleryList();
foreach ($list as $gallery) {
/* @var \FDevs\Photatoes\Gallery $gallery */
$file = $this->prepareGallery($gallery);
$response->addFile($file);
$response->ad... | [
"private",
"function",
"getGalleryList",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"manager",
"->",
"getGalleryList",
"(",
")",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"gallery",
")",
"{",
"/* @var \\FDevs\\Phota... | get Gallery list.
@param Response $response | [
"get",
"Gallery",
"list",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L160-L169 |
17,212 | 4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.getGallery | private function getGallery(Response $response, $target = '')
{
if ($target && $gallery = $this->manager->getGallery(basename($target))) {
$response->setCwd($this->prepareGallery($gallery));
$images = $gallery->getImages(true);
foreach ($images as $img) {
... | php | private function getGallery(Response $response, $target = '')
{
if ($target && $gallery = $this->manager->getGallery(basename($target))) {
$response->setCwd($this->prepareGallery($gallery));
$images = $gallery->getImages(true);
foreach ($images as $img) {
... | [
"private",
"function",
"getGallery",
"(",
"Response",
"$",
"response",
",",
"$",
"target",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"target",
"&&",
"$",
"gallery",
"=",
"$",
"this",
"->",
"manager",
"->",
"getGallery",
"(",
"basename",
"(",
"$",
"target",
... | get Gallery.
@param Response $response
@param string $target | [
"get",
"Gallery",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L177-L190 |
17,213 | 4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.prepareGallery | private function prepareGallery(Gallery $gallery)
{
$time = $gallery->getUpdatedAt() ? $gallery->getUpdatedAt()->getTimestamp() : time();
$file = new FileInfo($gallery->getName(), $this->driverId, $time, $this->driverOptions['rootName']);
$file->setHash(
$this->getDriverId().'_'.... | php | private function prepareGallery(Gallery $gallery)
{
$time = $gallery->getUpdatedAt() ? $gallery->getUpdatedAt()->getTimestamp() : time();
$file = new FileInfo($gallery->getName(), $this->driverId, $time, $this->driverOptions['rootName']);
$file->setHash(
$this->getDriverId().'_'.... | [
"private",
"function",
"prepareGallery",
"(",
"Gallery",
"$",
"gallery",
")",
"{",
"$",
"time",
"=",
"$",
"gallery",
"->",
"getUpdatedAt",
"(",
")",
"?",
"$",
"gallery",
"->",
"getUpdatedAt",
"(",
")",
"->",
"getTimestamp",
"(",
")",
":",
"time",
"(",
... | prepare Gallery.
@param Gallery $gallery
@return FileInfo | [
"prepare",
"Gallery",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L199-L210 |
17,214 | 4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.addImage | private function addImage(Response $response, Image $image, $galleryId, $imageSize)
{
if ($image->get($imageSize)) {
$href = $image->get($imageSize)->getHref();
$file = new FileInfo(
$image->getTitle().'('.$imageSize.')',
$this->getDriverId(),
... | php | private function addImage(Response $response, Image $image, $galleryId, $imageSize)
{
if ($image->get($imageSize)) {
$href = $image->get($imageSize)->getHref();
$file = new FileInfo(
$image->getTitle().'('.$imageSize.')',
$this->getDriverId(),
... | [
"private",
"function",
"addImage",
"(",
"Response",
"$",
"response",
",",
"Image",
"$",
"image",
",",
"$",
"galleryId",
",",
"$",
"imageSize",
")",
"{",
"if",
"(",
"$",
"image",
"->",
"get",
"(",
"$",
"imageSize",
")",
")",
"{",
"$",
"href",
"=",
"... | add Image.
@param Response $response
@param Image $image
@param string $galleryId
@param string $imageSize | [
"add",
"Image",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L236-L252 |
17,215 | qcubed/orm | src/Query/QQ.php | QQ.getVirtualAlias | static public function getVirtualAlias($strName)
{
$strName = trim($strName);
$strName = str_replace(" ", "_", $strName);
$strName = strtolower($strName);
return $strName;
} | php | static public function getVirtualAlias($strName)
{
$strName = trim($strName);
$strName = str_replace(" ", "_", $strName);
$strName = strtolower($strName);
return $strName;
} | [
"static",
"public",
"function",
"getVirtualAlias",
"(",
"$",
"strName",
")",
"{",
"$",
"strName",
"=",
"trim",
"(",
"$",
"strName",
")",
";",
"$",
"strName",
"=",
"str_replace",
"(",
"\" \"",
",",
"\"_\"",
",",
"$",
"strName",
")",
";",
"$",
"strName",... | Converts a virtual attribute name to an alias used in the query. The name is converted to an identifier
that will work on any SQL database. In the query itself, the name
will have two underscores in front of the alias name to prevent conflicts with column names.
@param $strName
@return mixed|string | [
"Converts",
"a",
"virtual",
"attribute",
"name",
"to",
"an",
"alias",
"used",
"in",
"the",
"query",
".",
"The",
"name",
"is",
"converted",
"to",
"an",
"identifier",
"that",
"will",
"work",
"on",
"any",
"SQL",
"database",
".",
"In",
"the",
"query",
"itsel... | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L261-L267 |
17,216 | qcubed/orm | src/Query/QQ.php | QQ.extractSelectClause | public static function extractSelectClause($objClauses)
{
if ($objClauses instanceof Clause\Select) {
return $objClauses;
}
if (is_array($objClauses)) {
$hasSelects = false;
$objSelect = QQ::select();
foreach ($objClauses as $objClause) {
... | php | public static function extractSelectClause($objClauses)
{
if ($objClauses instanceof Clause\Select) {
return $objClauses;
}
if (is_array($objClauses)) {
$hasSelects = false;
$objSelect = QQ::select();
foreach ($objClauses as $objClause) {
... | [
"public",
"static",
"function",
"extractSelectClause",
"(",
"$",
"objClauses",
")",
"{",
"if",
"(",
"$",
"objClauses",
"instanceof",
"Clause",
"\\",
"Select",
")",
"{",
"return",
"$",
"objClauses",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"objClauses",
"... | Searches for all the Clause\Select clauses and merges them into one clause and returns that clause.
Returns null if none found.
@param Clause\Base[]|Clause\Base|null $objClauses Clause\Base object or array of Clause\Base objects
@return Clause\Select Clause\Select clause containing all the nodes from all the Clause\Se... | [
"Searches",
"for",
"all",
"the",
"Clause",
"\\",
"Select",
"clauses",
"and",
"merges",
"them",
"into",
"one",
"clause",
"and",
"returns",
"that",
"clause",
".",
"Returns",
"null",
"if",
"none",
"found",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L380-L401 |
17,217 | qcubed/orm | src/Query/QQ.php | QQ.func | static public function func($strName, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\FunctionNode($strFunc, $args);
} | php | static public function func($strName, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\FunctionNode($strFunc, $args);
} | [
"static",
"public",
"function",
"func",
"(",
"$",
"strName",
",",
"$",
"param1",
"/** ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"strFunc",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"new",
"Node",
"\\",
... | Apply an arbitrary scalar function using the given parameters. See below for functions that let you apply
common SQL functions. The list below only includes sql operations that are generic to all supported versions
of SQL. However, you can call Func directly with any named function that works in your current SQL versio... | [
"Apply",
"an",
"arbitrary",
"scalar",
"function",
"using",
"the",
"given",
"parameters",
".",
"See",
"below",
"for",
"functions",
"that",
"let",
"you",
"apply",
"common",
"SQL",
"functions",
".",
"The",
"list",
"below",
"only",
"includes",
"sql",
"operations",... | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L438-L443 |
17,218 | qcubed/orm | src/Query/QQ.php | QQ.mathOp | static public function mathOp($strOperation, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\Math($strFunc, $args);
} | php | static public function mathOp($strOperation, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\Math($strFunc, $args);
} | [
"static",
"public",
"function",
"mathOp",
"(",
"$",
"strOperation",
",",
"$",
"param1",
"/** ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"strFunc",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"new",
"Node",
"... | Apply an arbitrary math operation to 2 or more operands. Operands can be scalar values, or column nodes.
@param string $strOperation The operation symbol, like + or *
@param Node\NodeBase|mixed $param1 The first parameter
@return Node\Math The resulting wrapper node | [
"Apply",
"an",
"arbitrary",
"math",
"operation",
"to",
"2",
"or",
"more",
"operands",
".",
"Operands",
"can",
"be",
"scalar",
"values",
"or",
"column",
"nodes",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L524-L529 |
17,219 | CPSB/Validation-helper | src/FormServiceProvider.php | FormServiceProvider.registerBladeDirectives | protected function registerBladeDirectives()
{
Blade::directive('form', function ($expression) {
$expression = $this->addParenthesis($expression);
return "<?php app('Activisme_BE')->model{$expression}; ?>";
});
Blade::directive('input', function ($expression) {
... | php | protected function registerBladeDirectives()
{
Blade::directive('form', function ($expression) {
$expression = $this->addParenthesis($expression);
return "<?php app('Activisme_BE')->model{$expression}; ?>";
});
Blade::directive('input', function ($expression) {
... | [
"protected",
"function",
"registerBladeDirectives",
"(",
")",
"{",
"Blade",
"::",
"directive",
"(",
"'form'",
",",
"function",
"(",
"$",
"expression",
")",
"{",
"$",
"expression",
"=",
"$",
"this",
"->",
"addParenthesis",
"(",
"$",
"expression",
")",
";",
... | Register blade directives.
@return void | [
"Register",
"blade",
"directives",
"."
] | adb91cb42b7e3c1f88be059a8b4f86de5aba64cc | https://github.com/CPSB/Validation-helper/blob/adb91cb42b7e3c1f88be059a8b4f86de5aba64cc/src/FormServiceProvider.php#L75-L111 |
17,220 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style/Cell.php | PHPWord_Style_Cell.setStyleValue | public function setStyleValue($key, $value) {
if($key == '_borderSize') {
$this->setBorderSize($value);
} elseif($key == '_borderColor') {
$this->setBorderColor($value);
} else {
$this->$key = $value;
}
} | php | public function setStyleValue($key, $value) {
if($key == '_borderSize') {
$this->setBorderSize($value);
} elseif($key == '_borderColor') {
$this->setBorderColor($value);
} else {
$this->$key = $value;
}
} | [
"public",
"function",
"setStyleValue",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'_borderSize'",
")",
"{",
"$",
"this",
"->",
"setBorderSize",
"(",
"$",
"value",
")",
";",
"}",
"elseif",
"(",
"$",
"key",
"==",
"'_b... | Set style value
@var string $key
@var mixed $value | [
"Set",
"style",
"value"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style/Cell.php#L150-L158 |
17,221 | LeadPages/php_auth_package | src/Auth/LeadpagesLogin.php | LeadpagesLogin.getUser | public function getUser($username, $password)
{
$authHash = $this->hashUserNameAndPassword($username, $password);
$body = json_encode(['clientType' => 'wp-plugin']);
try {
$response = $this->client->post(
$this->loginurl, [
'headers' => ['Author... | php | public function getUser($username, $password)
{
$authHash = $this->hashUserNameAndPassword($username, $password);
$body = json_encode(['clientType' => 'wp-plugin']);
try {
$response = $this->client->post(
$this->loginurl, [
'headers' => ['Author... | [
"public",
"function",
"getUser",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"authHash",
"=",
"$",
"this",
"->",
"hashUserNameAndPassword",
"(",
"$",
"username",
",",
"$",
"password",
")",
";",
"$",
"body",
"=",
"json_encode",
"(",
"[",
... | get user information
@param string $username
@param string $password
@return array|\GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null | [
"get",
"user",
"information"
] | 0294a053ce3d1a13a58fea85b0a14ffc98cf5893 | https://github.com/LeadPages/php_auth_package/blob/0294a053ce3d1a13a58fea85b0a14ffc98cf5893/src/Auth/LeadpagesLogin.php#L52-L81 |
17,222 | LeadPages/php_auth_package | src/Auth/LeadpagesLogin.php | LeadpagesLogin.createApiKey | public function createApiKey()
{
if (!isset($this->token)) {
return false;
}
$authHeader = 'LP-Security-Token';
if (stripos($this->token, 'lp ') === 0) {
$authHeader = 'Authorization';
}
try {
$response = $this->client->post($this->k... | php | public function createApiKey()
{
if (!isset($this->token)) {
return false;
}
$authHeader = 'LP-Security-Token';
if (stripos($this->token, 'lp ') === 0) {
$authHeader = 'Authorization';
}
try {
$response = $this->client->post($this->k... | [
"public",
"function",
"createApiKey",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"token",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"authHeader",
"=",
"'LP-Security-Token'",
";",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->... | Create an API key for account
@return string|boolean JSON encode key or false | [
"Create",
"an",
"API",
"key",
"for",
"account"
] | 0294a053ce3d1a13a58fea85b0a14ffc98cf5893 | https://github.com/LeadPages/php_auth_package/blob/0294a053ce3d1a13a58fea85b0a14ffc98cf5893/src/Auth/LeadpagesLogin.php#L88-L125 |
17,223 | LeadPages/php_auth_package | src/Auth/LeadpagesLogin.php | LeadpagesLogin.parseResponse | public function parseResponse($deleteTokenOnFail = false)
{
$responseArray = json_decode($this->response, true);
if (isset($responseArray['error']) && $responseArray['error']) {
// token should be unset assumed to be no longer valid
unset($this->token);
// delete ... | php | public function parseResponse($deleteTokenOnFail = false)
{
$responseArray = json_decode($this->response, true);
if (isset($responseArray['error']) && $responseArray['error']) {
// token should be unset assumed to be no longer valid
unset($this->token);
// delete ... | [
"public",
"function",
"parseResponse",
"(",
"$",
"deleteTokenOnFail",
"=",
"false",
")",
"{",
"$",
"responseArray",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"response",
",",
"true",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"responseArray",
"[",
"'error'"... | Parse response for call to Leadpages Login. If response does
not contain a error we will return a response with
HttpResponseCode and Message
@param bool $deleteTokenOnFail
@return string json encoded response for client to handle | [
"Parse",
"response",
"for",
"call",
"to",
"Leadpages",
"Login",
".",
"If",
"response",
"does",
"not",
"contain",
"a",
"error",
"we",
"will",
"return",
"a",
"response",
"with",
"HttpResponseCode",
"and",
"Message"
] | 0294a053ce3d1a13a58fea85b0a14ffc98cf5893 | https://github.com/LeadPages/php_auth_package/blob/0294a053ce3d1a13a58fea85b0a14ffc98cf5893/src/Auth/LeadpagesLogin.php#L135-L149 |
17,224 | tigris-php/telegram-bot-api | src/Types/Updates/Update.php | Update.detectType | protected static function detectType(array $data)
{
foreach ([
self::TYPE_MESSAGE,
self::TYPE_EDITED_MESSAGE,
self::TYPE_CHANNEL_POST,
self::TYPE_EDITED_CHANNEL_POST,
self::TYPE_INLINE_QUERY,
self::TYPE_CHOSEN_INLINE_RESULT,
... | php | protected static function detectType(array $data)
{
foreach ([
self::TYPE_MESSAGE,
self::TYPE_EDITED_MESSAGE,
self::TYPE_CHANNEL_POST,
self::TYPE_EDITED_CHANNEL_POST,
self::TYPE_INLINE_QUERY,
self::TYPE_CHOSEN_INLINE_RESULT,
... | [
"protected",
"static",
"function",
"detectType",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"[",
"self",
"::",
"TYPE_MESSAGE",
",",
"self",
"::",
"TYPE_EDITED_MESSAGE",
",",
"self",
"::",
"TYPE_CHANNEL_POST",
",",
"self",
"::",
"TYPE_EDITED_CHANNEL_POS... | Detects update type
@param $data
@return string | [
"Detects",
"update",
"type"
] | 7350c81d571387005d58079d8c654ee44504cdcf | https://github.com/tigris-php/telegram-bot-api/blob/7350c81d571387005d58079d8c654ee44504cdcf/src/Types/Updates/Update.php#L66-L82 |
17,225 | ClanCats/Core | src/classes/CCRequest.php | CCRequest.perform | public function perform()
{
// set the input
if ( !is_null( $this->input ) )
{
CCIn::instance( $this->input );
} else {
CCIn::instance( CCServer::instance() );
}
// set current request
static::$_current =& $this;
// route is invalid show 404
if ( !$this->route instanceof CCRoute )
{... | php | public function perform()
{
// set the input
if ( !is_null( $this->input ) )
{
CCIn::instance( $this->input );
} else {
CCIn::instance( CCServer::instance() );
}
// set current request
static::$_current =& $this;
// route is invalid show 404
if ( !$this->route instanceof CCRoute )
{... | [
"public",
"function",
"perform",
"(",
")",
"{",
"// set the input",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"input",
")",
")",
"{",
"CCIn",
"::",
"instance",
"(",
"$",
"this",
"->",
"input",
")",
";",
"}",
"else",
"{",
"CCIn",
"::",
"ins... | Execute the Request
@param array $action
@param array $params
@return self | [
"Execute",
"the",
"Request"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRequest.php#L110-L199 |
17,226 | PortaText/php-sdk | src/PortaText/Command/Api/CreditCards.php | CreditCards.cardInfo | public function cardInfo($number, $expirationDate, $code)
{
$this->setArgument('card_number', $number);
$this->setArgument('card_expiration_date', $expirationDate);
return $this->setArgument('card_code', $code);
} | php | public function cardInfo($number, $expirationDate, $code)
{
$this->setArgument('card_number', $number);
$this->setArgument('card_expiration_date', $expirationDate);
return $this->setArgument('card_code', $code);
} | [
"public",
"function",
"cardInfo",
"(",
"$",
"number",
",",
"$",
"expirationDate",
",",
"$",
"code",
")",
"{",
"$",
"this",
"->",
"setArgument",
"(",
"'card_number'",
",",
"$",
"number",
")",
";",
"$",
"this",
"->",
"setArgument",
"(",
"'card_expiration_dat... | Set card information.
@param string $number The card number.
@param string $expirationDate In format: YYYY-MM.
@param string $code The card security code.
@return PortaText\Command\ICommand | [
"Set",
"card",
"information",
"."
] | dbe04ef043db5b251953f9de57aa4d0f1785dfcc | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/CreditCards.php#L55-L60 |
17,227 | PortaText/php-sdk | src/PortaText/Command/Api/CreditCards.php | CreditCards.address | public function address($streetAddress, $city, $state, $zip, $country)
{
$this->setArgument('address', $streetAddress);
$this->setArgument('city', $city);
$this->setArgument('state', $state);
$this->setArgument('zip', $zip);
return $this->setArgument('country', $country);
... | php | public function address($streetAddress, $city, $state, $zip, $country)
{
$this->setArgument('address', $streetAddress);
$this->setArgument('city', $city);
$this->setArgument('state', $state);
$this->setArgument('zip', $zip);
return $this->setArgument('country', $country);
... | [
"public",
"function",
"address",
"(",
"$",
"streetAddress",
",",
"$",
"city",
",",
"$",
"state",
",",
"$",
"zip",
",",
"$",
"country",
")",
"{",
"$",
"this",
"->",
"setArgument",
"(",
"'address'",
",",
"$",
"streetAddress",
")",
";",
"$",
"this",
"->... | Set card billing address.
@param string $streetAddress The full street address.
@param string $city The city name.
@param string $state The state name.
@param string $zip The ZIP code.
@param string $country The country name.
@return PortaText\Command\ICommand | [
"Set",
"card",
"billing",
"address",
"."
] | dbe04ef043db5b251953f9de57aa4d0f1785dfcc | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/CreditCards.php#L73-L80 |
17,228 | danrevah/shortify-punit | src/Stub/WhenChainCase.php | WhenChainCase.createChainArrayOfReturnValues | private function createChainArrayOfReturnValues($action, $response)
{
// Pop first method
$methods = $this->methods;
$firstMethod = array_pop($methods);
$lastValue = $response;
$mockClassType = get_class($this->mockClass);
if ( ! $this->mockClass instanceof MockInt... | php | private function createChainArrayOfReturnValues($action, $response)
{
// Pop first method
$methods = $this->methods;
$firstMethod = array_pop($methods);
$lastValue = $response;
$mockClassType = get_class($this->mockClass);
if ( ! $this->mockClass instanceof MockInt... | [
"private",
"function",
"createChainArrayOfReturnValues",
"(",
"$",
"action",
",",
"$",
"response",
")",
"{",
"// Pop first method",
"$",
"methods",
"=",
"$",
"this",
"->",
"methods",
";",
"$",
"firstMethod",
"=",
"array_pop",
"(",
"$",
"methods",
")",
";",
"... | Creating a chain array of return values
@param $action
@param $response | [
"Creating",
"a",
"chain",
"array",
"of",
"return",
"values"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/Stub/WhenChainCase.php#L59-L122 |
17,229 | danrevah/shortify-punit | src/Stub/WhenChainCase.php | WhenChainCase.extractChainedMethodsBefore | private function extractChainedMethodsBefore($methods, $currentMethod)
{
$chainedMethodsBefore = [];
$currentMethodName = key($currentMethod);
foreach ($methods as $method)
{
$methodName = key($method);
if ($methodName == $currentMethodName) {
... | php | private function extractChainedMethodsBefore($methods, $currentMethod)
{
$chainedMethodsBefore = [];
$currentMethodName = key($currentMethod);
foreach ($methods as $method)
{
$methodName = key($method);
if ($methodName == $currentMethodName) {
... | [
"private",
"function",
"extractChainedMethodsBefore",
"(",
"$",
"methods",
",",
"$",
"currentMethod",
")",
"{",
"$",
"chainedMethodsBefore",
"=",
"[",
"]",
";",
"$",
"currentMethodName",
"=",
"key",
"(",
"$",
"currentMethod",
")",
";",
"foreach",
"(",
"$",
"... | Extracting chained methods before current method into an array
@param $methods
@param $currentMethod
@return array | [
"Extracting",
"chained",
"methods",
"before",
"current",
"method",
"into",
"an",
"array"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/Stub/WhenChainCase.php#L162-L179 |
17,230 | joomlatools/joomlatools-platform-legacy | code/base/tree.php | JTree.addChild | public function addChild(&$node, $setCurrent = false)
{
JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current->addChild($node);
if ($setCurrent)
{
$this->_current = &$node;
}
} | php | public function addChild(&$node, $setCurrent = false)
{
JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current->addChild($node);
if ($setCurrent)
{
$this->_current = &$node;
}
} | [
"public",
"function",
"addChild",
"(",
"&",
"$",
"node",
",",
"$",
"setCurrent",
"=",
"false",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JTree::addChild() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"this",
"->",
"_curre... | Method to add a child
@param array &$node The node to process
@param boolean $setCurrent True to set as current working node
@return mixed
@since 11.1 | [
"Method",
"to",
"add",
"a",
"child"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/tree.php#L60-L70 |
17,231 | joomlatools/joomlatools-platform-legacy | code/base/tree.php | JTree.getParent | public function getParent()
{
JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current = &$this->_current->getParent();
} | php | public function getParent()
{
JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current = &$this->_current->getParent();
} | [
"public",
"function",
"getParent",
"(",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JTree::getParent() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"this",
"->",
"_current",
"=",
"&",
"$",
"this",
"->",
"_current",
"->",
"g... | Method to get the parent
@return void
@since 11.1 | [
"Method",
"to",
"get",
"the",
"parent"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/tree.php#L79-L84 |
17,232 | CakeCMS/Core | src/Helper/Manager.php | Manager.addNamespace | public function addNamespace($name)
{
if (!Arr::in($name, self::$_namespace)) {
self::$_namespace[] = $name;
return true;
}
return false;
} | php | public function addNamespace($name)
{
if (!Arr::in($name, self::$_namespace)) {
self::$_namespace[] = $name;
return true;
}
return false;
} | [
"public",
"function",
"addNamespace",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"in",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"_namespace",
")",
")",
"{",
"self",
"::",
"$",
"_namespace",
"[",
"]",
"=",
"$",
"name",
";",
"return"... | Add new helper group namespace.
@param string $name
@return bool | [
"Add",
"new",
"helper",
"group",
"namespace",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L71-L79 |
17,233 | CakeCMS/Core | src/Helper/Manager.php | Manager._register | protected function _register($id, $className)
{
$id = (string) $id;
if (class_exists($className)) {
self::$_loaded[$id] = $className;
$this[$id] = function () use ($className) {
return new $className();
};
} else {
throw new Exc... | php | protected function _register($id, $className)
{
$id = (string) $id;
if (class_exists($className)) {
self::$_loaded[$id] = $className;
$this[$id] = function () use ($className) {
return new $className();
};
} else {
throw new Exc... | [
"protected",
"function",
"_register",
"(",
"$",
"id",
",",
"$",
"className",
")",
"{",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
"if",
"(",
"class_exists",
"(",
"$",
"className",
")",
")",
"{",
"self",
"::",
"$",
"_loaded",
"[",
"$",
"i... | Register helper class.
@param string $id
@param $className | [
"Register",
"helper",
"class",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L104-L115 |
17,234 | CakeCMS/Core | src/Helper/Manager.php | Manager._getClassName | protected function _getClassName($class)
{
$class = Str::low($class);
list ($plugin, $className) = pluginSplit($class);
$return = self::HELPER_SUFFIX . '\\' . Inflector::camelize($className) . self::HELPER_SUFFIX;
if ($plugin !== null) {
return Inflector::camelize($plugin... | php | protected function _getClassName($class)
{
$class = Str::low($class);
list ($plugin, $className) = pluginSplit($class);
$return = self::HELPER_SUFFIX . '\\' . Inflector::camelize($className) . self::HELPER_SUFFIX;
if ($plugin !== null) {
return Inflector::camelize($plugin... | [
"protected",
"function",
"_getClassName",
"(",
"$",
"class",
")",
"{",
"$",
"class",
"=",
"Str",
"::",
"low",
"(",
"$",
"class",
")",
";",
"list",
"(",
"$",
"plugin",
",",
"$",
"className",
")",
"=",
"pluginSplit",
"(",
"$",
"class",
")",
";",
"$",... | Get current helper class name.
@param string $class
@return string | [
"Get",
"current",
"helper",
"class",
"name",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L123-L133 |
17,235 | afrittella/back-project | src/app/Traits/Sluggable.php | Sluggable.createSlug | public function createSlug($value, $id = 0)
{
$slug = str_slug($value);
$relatedSlugs = $this->getRelatedSlugs($slug, $id);
if (!$relatedSlugs->contains('slug', $slug)) {
return $slug;
}
$completed = false;
$i = 1;
while ($completed == false) {... | php | public function createSlug($value, $id = 0)
{
$slug = str_slug($value);
$relatedSlugs = $this->getRelatedSlugs($slug, $id);
if (!$relatedSlugs->contains('slug', $slug)) {
return $slug;
}
$completed = false;
$i = 1;
while ($completed == false) {... | [
"public",
"function",
"createSlug",
"(",
"$",
"value",
",",
"$",
"id",
"=",
"0",
")",
"{",
"$",
"slug",
"=",
"str_slug",
"(",
"$",
"value",
")",
";",
"$",
"relatedSlugs",
"=",
"$",
"this",
"->",
"getRelatedSlugs",
"(",
"$",
"slug",
",",
"$",
"id",
... | Create a unique slug
@param $value
@param $id
@return string | [
"Create",
"a",
"unique",
"slug"
] | e1aa2e3ee03d453033f75a4b16f073c60b5f32d1 | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Traits/Sluggable.php#L12-L34 |
17,236 | afrittella/back-project | src/app/Traits/Sluggable.php | Sluggable.getRelatedSlugs | protected function getRelatedSlugs($slug, $id = 0)
{
return $this->select('slug')->where('slug', 'like', $slug.'%')->where('id', '<>', $id)->get();
} | php | protected function getRelatedSlugs($slug, $id = 0)
{
return $this->select('slug')->where('slug', 'like', $slug.'%')->where('id', '<>', $id)->get();
} | [
"protected",
"function",
"getRelatedSlugs",
"(",
"$",
"slug",
",",
"$",
"id",
"=",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"select",
"(",
"'slug'",
")",
"->",
"where",
"(",
"'slug'",
",",
"'like'",
",",
"$",
"slug",
".",
"'%'",
")",
"->",
"wher... | Get similar slugs
@param $slug
@param $id
@return mixed | [
"Get",
"similar",
"slugs"
] | e1aa2e3ee03d453033f75a4b16f073c60b5f32d1 | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Traits/Sluggable.php#L42-L45 |
17,237 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setUser | public function setUser(User $v = null)
{
if ($v === null) {
$this->setUserId(NULL);
} else {
$this->setUserId($v->getId());
}
$this->aUser = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | php | public function setUser(User $v = null)
{
if ($v === null) {
$this->setUserId(NULL);
} else {
$this->setUserId($v->getId());
}
$this->aUser = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | [
"public",
"function",
"setUser",
"(",
"User",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setUserId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setUserId",
"(",
"$",
"v",... | Declares an association between this object and a User object.
@param User $v
@return UserRole The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"User",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L868-L886 |
17,238 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.getUser | public function getUser(PropelPDO $con = null, $doQuery = true)
{
if ($this->aUser === null && ($this->user_id !== null) && $doQuery) {
$this->aUser = UserQuery::create()->findPk($this->user_id, $con);
/* The following can be used additionally to
guarantee the related... | php | public function getUser(PropelPDO $con = null, $doQuery = true)
{
if ($this->aUser === null && ($this->user_id !== null) && $doQuery) {
$this->aUser = UserQuery::create()->findPk($this->user_id, $con);
/* The following can be used additionally to
guarantee the related... | [
"public",
"function",
"getUser",
"(",
"PropelPDO",
"$",
"con",
"=",
"null",
",",
"$",
"doQuery",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aUser",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"user_id",
"!==",
"null",
")",
"&&",
"$",
... | Get the associated User object
@param PropelPDO $con Optional Connection object.
@param $doQuery Executes a query to get the object if required
@return User The associated User object.
@throws PropelException | [
"Get",
"the",
"associated",
"User",
"object"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L897-L911 |
17,239 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setRole | public function setRole(Role $v = null)
{
if ($v === null) {
$this->setRoleId(NULL);
} else {
$this->setRoleId($v->getId());
}
$this->aRole = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | php | public function setRole(Role $v = null)
{
if ($v === null) {
$this->setRoleId(NULL);
} else {
$this->setRoleId($v->getId());
}
$this->aRole = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | [
"public",
"function",
"setRole",
"(",
"Role",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setRoleId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setRoleId",
"(",
"$",
"v",... | Declares an association between this object and a Role object.
@param Role $v
@return UserRole The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"Role",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L920-L938 |
17,240 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.getRole | public function getRole(PropelPDO $con = null, $doQuery = true)
{
if ($this->aRole === null && ($this->role_id !== null) && $doQuery) {
$this->aRole = RoleQuery::create()->findPk($this->role_id, $con);
/* The following can be used additionally to
guarantee the related... | php | public function getRole(PropelPDO $con = null, $doQuery = true)
{
if ($this->aRole === null && ($this->role_id !== null) && $doQuery) {
$this->aRole = RoleQuery::create()->findPk($this->role_id, $con);
/* The following can be used additionally to
guarantee the related... | [
"public",
"function",
"getRole",
"(",
"PropelPDO",
"$",
"con",
"=",
"null",
",",
"$",
"doQuery",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aRole",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"role_id",
"!==",
"null",
")",
"&&",
"$",
... | Get the associated Role object
@param PropelPDO $con Optional Connection object.
@param $doQuery Executes a query to get the object if required
@return Role The associated Role object.
@throws PropelException | [
"Get",
"the",
"associated",
"Role",
"object"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L949-L963 |
17,241 | dashifen/wordpress-php7-plugin-boilerplate | src/Controller/ControllerTraits/PostTypesTrait.php | PostTypesTrait.initPostTypesTrait | final protected function initPostTypesTrait() {
add_action("init", function () {
$postTypes = $this->getPostTypes();
foreach ($postTypes as $postType) {
$this->registerPostType($postType);
}
});
} | php | final protected function initPostTypesTrait() {
add_action("init", function () {
$postTypes = $this->getPostTypes();
foreach ($postTypes as $postType) {
$this->registerPostType($postType);
}
});
} | [
"final",
"protected",
"function",
"initPostTypesTrait",
"(",
")",
"{",
"add_action",
"(",
"\"init\"",
",",
"function",
"(",
")",
"{",
"$",
"postTypes",
"=",
"$",
"this",
"->",
"getPostTypes",
"(",
")",
";",
"foreach",
"(",
"$",
"postTypes",
"as",
"$",
"p... | Called automatically when the plugins are loaded, this method
registers our post types for the users of this boilerplate.
@return void | [
"Called",
"automatically",
"when",
"the",
"plugins",
"are",
"loaded",
"this",
"method",
"registers",
"our",
"post",
"types",
"for",
"the",
"users",
"of",
"this",
"boilerplate",
"."
] | c7875deb403d311efca72dc3c8beb566972a56cb | https://github.com/dashifen/wordpress-php7-plugin-boilerplate/blob/c7875deb403d311efca72dc3c8beb566972a56cb/src/Controller/ControllerTraits/PostTypesTrait.php#L82-L89 |
17,242 | anime-db/app-bundle | src/Event/Listener/Package.php | Package.onUpdated | public function onUpdated(UpdatedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | php | public function onUpdated(UpdatedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | [
"public",
"function",
"onUpdated",
"(",
"UpdatedEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"PLUGIN_TYPE",
")",
"{",
"$",
"this",
"->",
"addPackage",
"(",
"$",
... | Update plugin data.
@param UpdatedEvent $event | [
"Update",
"plugin",
"data",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L85-L90 |
17,243 | anime-db/app-bundle | src/Event/Listener/Package.php | Package.onInstalled | public function onInstalled(InstalledEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | php | public function onInstalled(InstalledEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | [
"public",
"function",
"onInstalled",
"(",
"InstalledEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"PLUGIN_TYPE",
")",
"{",
"$",
"this",
"->",
"addPackage",
"(",
"$"... | Registr plugin.
@param InstalledEvent $event | [
"Registr",
"plugin",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L97-L102 |
17,244 | anime-db/app-bundle | src/Event/Listener/Package.php | Package.addPackage | protected function addPackage(ComposerPackage $package)
{
$plugin = $this->rep->find($package->getName());
// create new plugin if not exists
if (!$plugin) {
$plugin = new Plugin();
$plugin->setName($package->getName());
}
list($vendor, $package) = e... | php | protected function addPackage(ComposerPackage $package)
{
$plugin = $this->rep->find($package->getName());
// create new plugin if not exists
if (!$plugin) {
$plugin = new Plugin();
$plugin->setName($package->getName());
}
list($vendor, $package) = e... | [
"protected",
"function",
"addPackage",
"(",
"ComposerPackage",
"$",
"package",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"rep",
"->",
"find",
"(",
"$",
"package",
"->",
"getName",
"(",
")",
")",
";",
"// create new plugin if not exists",
"if",
"(",
... | Add plugin from package.
@param ComposerPackage $package | [
"Add",
"plugin",
"from",
"package",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L109-L133 |
17,245 | anime-db/app-bundle | src/Event/Listener/Package.php | Package.onRemoved | public function onRemoved(RemovedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$plugin = $this->rep->find($event->getPackage()->getName());
if ($plugin) {
$this->em->remove($plugin);
$this->em->flush();
}
... | php | public function onRemoved(RemovedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$plugin = $this->rep->find($event->getPackage()->getName());
if ($plugin) {
$this->em->remove($plugin);
$this->em->flush();
}
... | [
"public",
"function",
"onRemoved",
"(",
"RemovedEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"PLUGIN_TYPE",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"rep... | Unregistr plugin.
@param RemovedEvent $event | [
"Unregistr",
"plugin",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L140-L150 |
17,246 | anime-db/app-bundle | src/Event/Listener/Package.php | Package.onInstalledConfigureShmop | public function onInstalledConfigureShmop(InstalledEvent $event)
{
// use Shmop as driver for Cache Time Keeper
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.multi');
$this->parameter... | php | public function onInstalledConfigureShmop(InstalledEvent $event)
{
// use Shmop as driver for Cache Time Keeper
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.multi');
$this->parameter... | [
"public",
"function",
"onInstalledConfigureShmop",
"(",
"InstalledEvent",
"$",
"event",
")",
"{",
"// use Shmop as driver for Cache Time Keeper",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getName",
"(",
")",
"==",
"self",
"::",
"PACKAGE_SHMOP",
... | Configure shmop.
@param InstalledEvent $event | [
"Configure",
"shmop",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L157-L164 |
17,247 | anime-db/app-bundle | src/Event/Listener/Package.php | Package.onRemovedShmop | public function onRemovedShmop(RemovedEvent $event)
{
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.file');
}
} | php | public function onRemovedShmop(RemovedEvent $event)
{
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.file');
}
} | [
"public",
"function",
"onRemovedShmop",
"(",
"RemovedEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getName",
"(",
")",
"==",
"self",
"::",
"PACKAGE_SHMOP",
")",
"{",
"$",
"this",
"->",
"parameters",
"->",
... | Restore config on removed shmop.
@param RemovedEvent $event | [
"Restore",
"config",
"on",
"removed",
"shmop",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L171-L176 |
17,248 | SAREhub/PHP_Commons | src/SAREhub/Commons/Misc/SimpleSemafor.php | SimpleSemafor.lock | public function lock()
{
if (!$this->isLocked()) {
$file = fopen($this->getFilePath(), 'w');
if ($file) {
fwrite($file, getmypid());
fclose($file);
return true;
}
}
return false;
} | php | public function lock()
{
if (!$this->isLocked()) {
$file = fopen($this->getFilePath(), 'w');
if ($file) {
fwrite($file, getmypid());
fclose($file);
return true;
}
}
return false;
} | [
"public",
"function",
"lock",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLocked",
"(",
")",
")",
"{",
"$",
"file",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getFilePath",
"(",
")",
",",
"'w'",
")",
";",
"if",
"(",
"$",
"file",
")",
"{"... | Try create semafor file
@return bool When successful locked | [
"Try",
"create",
"semafor",
"file"
] | 4e1769ab6411a584112df1151dcc90e6b82fe2bb | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Misc/SimpleSemafor.php#L23-L34 |
17,249 | mmieluch/laravel-serve-custom-ini | src/ServeCommand.php | ServeCommand.buildCommand | protected function buildCommand($binary, $host, $port, $base)
{
$binary = $this->handleCustomIni($binary);
$base = str_replace("'", '', $base);
$command = "{$binary} -S {$host}:{$port} {$base}/server.php";
return $command;
} | php | protected function buildCommand($binary, $host, $port, $base)
{
$binary = $this->handleCustomIni($binary);
$base = str_replace("'", '', $base);
$command = "{$binary} -S {$host}:{$port} {$base}/server.php";
return $command;
} | [
"protected",
"function",
"buildCommand",
"(",
"$",
"binary",
",",
"$",
"host",
",",
"$",
"port",
",",
"$",
"base",
")",
"{",
"$",
"binary",
"=",
"$",
"this",
"->",
"handleCustomIni",
"(",
"$",
"binary",
")",
";",
"$",
"base",
"=",
"str_replace",
"(",... | Returns a command to pass through to shell.
@param string $binary Usually full path to the PHP executable
@param string $host Hostname
@param int $port
@param string $base Full path to Laravel project root
@return string | [
"Returns",
"a",
"command",
"to",
"pass",
"through",
"to",
"shell",
"."
] | 38e547b8496a6123fe63be0901a07fd798537ad7 | https://github.com/mmieluch/laravel-serve-custom-ini/blob/38e547b8496a6123fe63be0901a07fd798537ad7/src/ServeCommand.php#L80-L89 |
17,250 | mmieluch/laravel-serve-custom-ini | src/ServeCommand.php | ServeCommand.handleCustomIni | protected function handleCustomIni($command)
{
// If --ini parameter was not specified, just return the command
// is at has been constructed.
if (!$this->option('ini')) {
return $command;
}
// Additional parameter will not work when escaped with single quotes.
... | php | protected function handleCustomIni($command)
{
// If --ini parameter was not specified, just return the command
// is at has been constructed.
if (!$this->option('ini')) {
return $command;
}
// Additional parameter will not work when escaped with single quotes.
... | [
"protected",
"function",
"handleCustomIni",
"(",
"$",
"command",
")",
"{",
"// If --ini parameter was not specified, just return the command",
"// is at has been constructed.",
"if",
"(",
"!",
"$",
"this",
"->",
"option",
"(",
"'ini'",
")",
")",
"{",
"return",
"$",
"c... | Adds parameter telling PHP built-in server to respect a custom
php.ini file.
@param string $command Command built up to this point.
@return string | [
"Adds",
"parameter",
"telling",
"PHP",
"built",
"-",
"in",
"server",
"to",
"respect",
"a",
"custom",
"php",
".",
"ini",
"file",
"."
] | 38e547b8496a6123fe63be0901a07fd798537ad7 | https://github.com/mmieluch/laravel-serve-custom-ini/blob/38e547b8496a6123fe63be0901a07fd798537ad7/src/ServeCommand.php#L99-L130 |
17,251 | webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.getChoices | public function getChoices($username = null, $email = null, $or = false, $limit = null)
{
$qb = $this->getRepository()->createQueryBuilder('u');
$qb->orderBy('u.username');
$method = $or ? 'orWhere' : 'andWhere';
if ($username) {
$qb->$method('u.username LIKE :username');... | php | public function getChoices($username = null, $email = null, $or = false, $limit = null)
{
$qb = $this->getRepository()->createQueryBuilder('u');
$qb->orderBy('u.username');
$method = $or ? 'orWhere' : 'andWhere';
if ($username) {
$qb->$method('u.username LIKE :username');... | [
"public",
"function",
"getChoices",
"(",
"$",
"username",
"=",
"null",
",",
"$",
"email",
"=",
"null",
",",
"$",
"or",
"=",
"false",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"cr... | Find user choices
@param string $username
@param string $email
@param bool $or combine search params with OR
@param int $limit Limit the number of results
@return array | [
"Find",
"user",
"choices"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L67-L85 |
17,252 | webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.getChoicesAsEmailUsername | public function getChoicesAsEmailUsername(array &$choices)
{
$ret = [];
foreach ($choices as $item) {
$ret[] = sprintf('%s (%s)', $item->getEmail(), $item->getUsername());
}
return $ret;
} | php | public function getChoicesAsEmailUsername(array &$choices)
{
$ret = [];
foreach ($choices as $item) {
$ret[] = sprintf('%s (%s)', $item->getEmail(), $item->getUsername());
}
return $ret;
} | [
"public",
"function",
"getChoicesAsEmailUsername",
"(",
"array",
"&",
"$",
"choices",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"choices",
"as",
"$",
"item",
")",
"{",
"$",
"ret",
"[",
"]",
"=",
"sprintf",
"(",
"'%s (%s)'",
",",
... | Get selector choices as combined username+email
@param User[] $choices
@return string[] | [
"Get",
"selector",
"choices",
"as",
"combined",
"username",
"+",
"email"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L94-L102 |
17,253 | webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.updateUser | public function updateUser(User $user, UserUpdater $up)
{
$up->updateUser($user, $this->getEncoder());
$em = $this->getRegistry()->getManager();
$em->persist($user);
$em->flush();
} | php | public function updateUser(User $user, UserUpdater $up)
{
$up->updateUser($user, $this->getEncoder());
$em = $this->getRegistry()->getManager();
$em->persist($user);
$em->flush();
} | [
"public",
"function",
"updateUser",
"(",
"User",
"$",
"user",
",",
"UserUpdater",
"$",
"up",
")",
"{",
"$",
"up",
"->",
"updateUser",
"(",
"$",
"user",
",",
"$",
"this",
"->",
"getEncoder",
"(",
")",
")",
";",
"$",
"em",
"=",
"$",
"this",
"->",
"... | Update user details
@param User $user
@param UserUpdater $up | [
"Update",
"user",
"details"
] | 86c656c131295fe1f3f7694fd4da1e5e454076b9 | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L128-L134 |
17,254 | Double-Opt-in/php-client-api | src/Guzzle/Plugin/AccessTokenCache.php | AccessTokenCache.get | public function get()
{
if ( ! file_exists($this->file))
return array();
$data = unserialize(base64_decode(file_get_contents($this->file)));
return $data ?: array();
} | php | public function get()
{
if ( ! file_exists($this->file))
return array();
$data = unserialize(base64_decode(file_get_contents($this->file)));
return $data ?: array();
} | [
"public",
"function",
"get",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
"return",
"array",
"(",
")",
";",
"$",
"data",
"=",
"unserialize",
"(",
"base64_decode",
"(",
"file_get_contents",
"(",
"$",
"this",
... | returns the cached access token
@return array | [
"returns",
"the",
"cached",
"access",
"token"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Guzzle/Plugin/AccessTokenCache.php#L32-L40 |
17,255 | Double-Opt-in/php-client-api | src/Guzzle/Plugin/AccessTokenCache.php | AccessTokenCache.put | public function put($accessToken)
{
if ($accessToken === null)
return unlink($this->file);
file_put_contents($this->file, base64_encode(serialize($accessToken)));
return file_exists($this->file);
} | php | public function put($accessToken)
{
if ($accessToken === null)
return unlink($this->file);
file_put_contents($this->file, base64_encode(serialize($accessToken)));
return file_exists($this->file);
} | [
"public",
"function",
"put",
"(",
"$",
"accessToken",
")",
"{",
"if",
"(",
"$",
"accessToken",
"===",
"null",
")",
"return",
"unlink",
"(",
"$",
"this",
"->",
"file",
")",
";",
"file_put_contents",
"(",
"$",
"this",
"->",
"file",
",",
"base64_encode",
... | store the access token
@param array $accessToken
@return bool | [
"store",
"the",
"access",
"token"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Guzzle/Plugin/AccessTokenCache.php#L49-L57 |
17,256 | ClanCats/Core | src/bundles/Database/Model.php | Model._fetch_handler | public static function _fetch_handler( &$query )
{
// because the model is an object we force the fetch
// arguments to obj so that we can still make use of
// the group by and forward key functions
$query->fetch_arguments = array( 'obj' );
// Run the query and assign the reults
// here we force the fetch... | php | public static function _fetch_handler( &$query )
{
// because the model is an object we force the fetch
// arguments to obj so that we can still make use of
// the group by and forward key functions
$query->fetch_arguments = array( 'obj' );
// Run the query and assign the reults
// here we force the fetch... | [
"public",
"static",
"function",
"_fetch_handler",
"(",
"&",
"$",
"query",
")",
"{",
"// because the model is an object we force the fetch",
"// arguments to obj so that we can still make use of",
"// the group by and forward key functions",
"$",
"query",
"->",
"fetch_arguments",
"=... | Fetch from the databse and created models out of the reults
@param DB\Query_Select $query
@return array | [
"Fetch",
"from",
"the",
"databse",
"and",
"created",
"models",
"out",
"of",
"the",
"reults"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L126-L137 |
17,257 | ClanCats/Core | src/bundles/Database/Model.php | Model.find | public static function find( $param = null, $param2 = null )
{
$settings = static::_model();
$query = DB::select( $settings['table'] );
// Do we have a find modifier?
if ( !is_null( $settings['find_modifier'] ) )
{
$callbacks = $settings['find_modifier'];
if ( !\CCArr::is_collection( $callbacks ) ... | php | public static function find( $param = null, $param2 = null )
{
$settings = static::_model();
$query = DB::select( $settings['table'] );
// Do we have a find modifier?
if ( !is_null( $settings['find_modifier'] ) )
{
$callbacks = $settings['find_modifier'];
if ( !\CCArr::is_collection( $callbacks ) ... | [
"public",
"static",
"function",
"find",
"(",
"$",
"param",
"=",
"null",
",",
"$",
"param2",
"=",
"null",
")",
"{",
"$",
"settings",
"=",
"static",
"::",
"_model",
"(",
")",
";",
"$",
"query",
"=",
"DB",
"::",
"select",
"(",
"$",
"settings",
"[",
... | Model finder
This function allows you direct access to your records.
@param mixed $param
@param mixed $param2
@return CCModel | [
"Model",
"finder",
"This",
"function",
"allows",
"you",
"direct",
"access",
"to",
"your",
"records",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L157-L219 |
17,258 | ClanCats/Core | src/bundles/Database/Model.php | Model.__call_property | public function __call_property( $key )
{
$result = parent::__call_property( $key );
// when we recive a relation we execute it and save it
// to the data to avoid mutlitple queries
if ( $result instanceof Model_Relation )
{
return $this->_data_store[$key] = $result->run();
}
return $result;
} | php | public function __call_property( $key )
{
$result = parent::__call_property( $key );
// when we recive a relation we execute it and save it
// to the data to avoid mutlitple queries
if ( $result instanceof Model_Relation )
{
return $this->_data_store[$key] = $result->run();
}
return $result;
} | [
"public",
"function",
"__call_property",
"(",
"$",
"key",
")",
"{",
"$",
"result",
"=",
"parent",
"::",
"__call_property",
"(",
"$",
"key",
")",
";",
"// when we recive a relation we execute it and save it",
"// to the data to avoid mutlitple queries",
"if",
"(",
"$",
... | Call a function as a property
@param string $key
@return mixed | [
"Call",
"a",
"function",
"as",
"a",
"property"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L227-L239 |
17,259 | ClanCats/Core | src/bundles/Database/Model.php | Model.has_one | protected function has_one( $model, $foreign_key = null, $local_key = null )
{
return new Model_Relation_HasOne( $this, $model, $foreign_key, $local_key );
} | php | protected function has_one( $model, $foreign_key = null, $local_key = null )
{
return new Model_Relation_HasOne( $this, $model, $foreign_key, $local_key );
} | [
"protected",
"function",
"has_one",
"(",
"$",
"model",
",",
"$",
"foreign_key",
"=",
"null",
",",
"$",
"local_key",
"=",
"null",
")",
"{",
"return",
"new",
"Model_Relation_HasOne",
"(",
"$",
"this",
",",
"$",
"model",
",",
"$",
"foreign_key",
",",
"$",
... | Has one releationships
Model Car:
function engine()
{
return $this->has_one( 'Car_Engine', 'car_id', 'id' );
}
@param Model $model
@param mixed $foreign_key
@param mixed $key
@return array | [
"Has",
"one",
"releationships"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L255-L258 |
17,260 | ClanCats/Core | src/bundles/Database/Model.php | Model.has_many | protected function has_many( $model, $foreign_key = null, $local_key = null )
{
return new Model_Relation_HasMany( $this, $model, $foreign_key, $local_key );
} | php | protected function has_many( $model, $foreign_key = null, $local_key = null )
{
return new Model_Relation_HasMany( $this, $model, $foreign_key, $local_key );
} | [
"protected",
"function",
"has_many",
"(",
"$",
"model",
",",
"$",
"foreign_key",
"=",
"null",
",",
"$",
"local_key",
"=",
"null",
")",
"{",
"return",
"new",
"Model_Relation_HasMany",
"(",
"$",
"this",
",",
"$",
"model",
",",
"$",
"foreign_key",
",",
"$",... | Has many releationships
Model Car:
function wheels()
{
return $this->has_many( 'Car_Wheel', 'car_id', 'id' );
}
@param Model $model
@param mixed $foreign_key
@param mixed $key
@return array | [
"Has",
"many",
"releationships"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L274-L277 |
17,261 | ClanCats/Core | src/bundles/Database/Model.php | Model.belongs_to | protected function belongs_to( $model, $foreign_key = null, $local_key = null )
{
return new Model_Relation_BelongsTo( $this, $model, $foreign_key, $local_key );
} | php | protected function belongs_to( $model, $foreign_key = null, $local_key = null )
{
return new Model_Relation_BelongsTo( $this, $model, $foreign_key, $local_key );
} | [
"protected",
"function",
"belongs_to",
"(",
"$",
"model",
",",
"$",
"foreign_key",
"=",
"null",
",",
"$",
"local_key",
"=",
"null",
")",
"{",
"return",
"new",
"Model_Relation_BelongsTo",
"(",
"$",
"this",
",",
"$",
"model",
",",
"$",
"foreign_key",
",",
... | Belongs To releationships
Model Car_Engine:
function car()
{
return $this->belongs_to( 'Car', 'id', 'car_id' );
}
@param Model $model
@param mixed $foreign_key
@param mixed $key
@return array | [
"Belongs",
"To",
"releationships"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L293-L296 |
17,262 | ClanCats/Core | src/bundles/Database/Model.php | Model.with | public static function with( $with, $callback = null )
{
if ( !is_array( $with ) )
{
$with = array( $with );
}
$settings = static::_model();
$query = DB::select( $settings['table'] );
// run the callback
if ( !is_null( $callback ) )
{
call_user_func_array( $callback, array( &$query ) )... | php | public static function with( $with, $callback = null )
{
if ( !is_array( $with ) )
{
$with = array( $with );
}
$settings = static::_model();
$query = DB::select( $settings['table'] );
// run the callback
if ( !is_null( $callback ) )
{
call_user_func_array( $callback, array( &$query ) )... | [
"public",
"static",
"function",
"with",
"(",
"$",
"with",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"with",
")",
")",
"{",
"$",
"with",
"=",
"array",
"(",
"$",
"with",
")",
";",
"}",
"$",
"settings",
"="... | find with an relationship
Person::with( 'cars' );
@param array|string $with
@param callback $callback
@return array | [
"find",
"with",
"an",
"relationship"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L307-L398 |
17,263 | ClanCats/Core | src/bundles/Database/Model.php | Model.save | public function save( $fields = null )
{
$settings = static::_model();
// check if we should save just some fields
if ( is_null( $fields ) )
{
$fields = array_keys( $settings['defaults'] );
}
elseif ( !is_array( $fields ) )
{
$fields = array( $fields );
}
$pkey = $this->_data_store[$settin... | php | public function save( $fields = null )
{
$settings = static::_model();
// check if we should save just some fields
if ( is_null( $fields ) )
{
$fields = array_keys( $settings['defaults'] );
}
elseif ( !is_array( $fields ) )
{
$fields = array( $fields );
}
$pkey = $this->_data_store[$settin... | [
"public",
"function",
"save",
"(",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"settings",
"=",
"static",
"::",
"_model",
"(",
")",
";",
"// check if we should save just some fields",
"if",
"(",
"is_null",
"(",
"$",
"fields",
")",
")",
"{",
"$",
"fields",
... | save an model
@param mixed $fields
@return self | [
"save",
"an",
"model"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L406-L495 |
17,264 | ClanCats/Core | src/bundles/Database/Model.php | Model.delete | public function delete()
{
$settings = static::_model();
$result = DB::delete( $settings['table'] )
->where( $settings['primary_key'], $this->_data_store[$settings['primary_key']] )
->limit(1)
->run( $settings['handler'] );
$this->_data_store[$cache['primary_key']] = null;
return $result;
} | php | public function delete()
{
$settings = static::_model();
$result = DB::delete( $settings['table'] )
->where( $settings['primary_key'], $this->_data_store[$settings['primary_key']] )
->limit(1)
->run( $settings['handler'] );
$this->_data_store[$cache['primary_key']] = null;
return $result;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"settings",
"=",
"static",
"::",
"_model",
"(",
")",
";",
"$",
"result",
"=",
"DB",
"::",
"delete",
"(",
"$",
"settings",
"[",
"'table'",
"]",
")",
"->",
"where",
"(",
"$",
"settings",
"[",
"'prim... | Delete the current model from the database
@return DB\Model | [
"Delete",
"the",
"current",
"model",
"from",
"the",
"database"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L512-L524 |
17,265 | GrahamDeprecated/CMS-Core | src/Providers/PageProvider.php | PageProvider.navigation | public function navigation()
{
// caching logic
if ($this->validCache($this->nav)) {
// get the value from the class cache
$value = $this->nav;
} else {
// pull from the cache
$value = $this->getCache();
// check if the value is val... | php | public function navigation()
{
// caching logic
if ($this->validCache($this->nav)) {
// get the value from the class cache
$value = $this->nav;
} else {
// pull from the cache
$value = $this->getCache();
// check if the value is val... | [
"public",
"function",
"navigation",
"(",
")",
"{",
"// caching logic",
"if",
"(",
"$",
"this",
"->",
"validCache",
"(",
"$",
"this",
"->",
"nav",
")",
")",
"{",
"// get the value from the class cache",
"$",
"value",
"=",
"$",
"this",
"->",
"nav",
";",
"}",... | Get the page navigation.
@return array | [
"Get",
"the",
"page",
"navigation",
"."
] | 5603e2bfa2fac6cf46ca3ed62d21518f2f653675 | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/Providers/PageProvider.php#L51-L74 |
17,266 | GrahamDeprecated/CMS-Core | src/Providers/PageProvider.php | PageProvider.validCache | protected function validCache($value)
{
if (is_null($value) || !is_array($value) || empty($value)) {
return false;
}
return true;
} | php | protected function validCache($value)
{
if (is_null($value) || !is_array($value) || empty($value)) {
return false;
}
return true;
} | [
"protected",
"function",
"validCache",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
"||",
"!",
"is_array",
"(",
"$",
"value",
")",
"||",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",... | Check of the nav var is not corrupt.
@param array $value
@return bool | [
"Check",
"of",
"the",
"nav",
"var",
"is",
"not",
"corrupt",
"."
] | 5603e2bfa2fac6cf46ca3ed62d21518f2f653675 | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/Providers/PageProvider.php#L138-L145 |
17,267 | neos/doctools | Classes/Command/CommandReferenceCommandController.php | CommandReferenceCommandController.renderCommand | public function renderCommand($reference = null)
{
$references = $reference !== null ? [$reference] : array_keys($this->settings['commandReferences']);
$this->renderReferences($references);
} | php | public function renderCommand($reference = null)
{
$references = $reference !== null ? [$reference] : array_keys($this->settings['commandReferences']);
$this->renderReferences($references);
} | [
"public",
"function",
"renderCommand",
"(",
"$",
"reference",
"=",
"null",
")",
"{",
"$",
"references",
"=",
"$",
"reference",
"!==",
"null",
"?",
"[",
"$",
"reference",
"]",
":",
"array_keys",
"(",
"$",
"this",
"->",
"settings",
"[",
"'commandReferences'"... | Renders command reference documentation from source code.
@param string $reference to render. If not specified all configured references will be rendered
@return void
@throws \Neos\Flow\Mvc\Exception\StopActionException
@throws \Neos\FluidAdaptor\Exception | [
"Renders",
"command",
"reference",
"documentation",
"from",
"source",
"code",
"."
] | 726981245a8d59319ee594a582f80a30256df98b | https://github.com/neos/doctools/blob/726981245a8d59319ee594a582f80a30256df98b/Classes/Command/CommandReferenceCommandController.php#L48-L52 |
17,268 | neos/doctools | Classes/Command/CommandReferenceCommandController.php | CommandReferenceCommandController.renderReferences | protected function renderReferences($references)
{
foreach ($references as $reference) {
$this->outputLine('Rendering Reference "%s"', [$reference]);
$this->renderReference($reference);
}
} | php | protected function renderReferences($references)
{
foreach ($references as $reference) {
$this->outputLine('Rendering Reference "%s"', [$reference]);
$this->renderReference($reference);
}
} | [
"protected",
"function",
"renderReferences",
"(",
"$",
"references",
")",
"{",
"foreach",
"(",
"$",
"references",
"as",
"$",
"reference",
")",
"{",
"$",
"this",
"->",
"outputLine",
"(",
"'Rendering Reference \"%s\"'",
",",
"[",
"$",
"reference",
"]",
")",
";... | Render a set of CLI command references to reStructuredText.
@param array $references to render.
@return void
@throws \Neos\Flow\Mvc\Exception\StopActionException
@throws \Neos\FluidAdaptor\Exception | [
"Render",
"a",
"set",
"of",
"CLI",
"command",
"references",
"to",
"reStructuredText",
"."
] | 726981245a8d59319ee594a582f80a30256df98b | https://github.com/neos/doctools/blob/726981245a8d59319ee594a582f80a30256df98b/Classes/Command/CommandReferenceCommandController.php#L84-L90 |
17,269 | Chill-project/Main | Controller/ScopeController.php | ScopeController.createCreateForm | private function createCreateForm(Scope $scope)
{
$form = $this->createForm(new ScopeType(), $scope, array(
'action' => $this->generateUrl('admin_scope_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $form... | php | private function createCreateForm(Scope $scope)
{
$form = $this->createForm(new ScopeType(), $scope, array(
'action' => $this->generateUrl('admin_scope_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $form... | [
"private",
"function",
"createCreateForm",
"(",
"Scope",
"$",
"scope",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ScopeType",
"(",
")",
",",
"$",
"scope",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"generateU... | Creates a form to create a Scope entity.
@param Scope $scope The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"Scope",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ScopeController.php#L63-L73 |
17,270 | Chill-project/Main | Controller/ScopeController.php | ScopeController.newAction | public function newAction()
{
$scope = new Scope();
$form = $this->createCreateForm($scope);
return $this->render('ChillMainBundle:Scope:new.html.twig', array(
'entity' => $scope,
'form' => $form->createView(),
));
} | php | public function newAction()
{
$scope = new Scope();
$form = $this->createCreateForm($scope);
return $this->render('ChillMainBundle:Scope:new.html.twig', array(
'entity' => $scope,
'form' => $form->createView(),
));
} | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"scope",
"=",
"new",
"Scope",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"scope",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",
"'ChillMainBundle:Scop... | Displays a form to create a new Scope entity. | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Scope",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ScopeController.php#L79-L88 |
17,271 | Chill-project/Main | Controller/ScopeController.php | ScopeController.createEditForm | private function createEditForm(Scope $scope)
{
$form = $this->createForm(new ScopeType(), $scope, array(
'action' => $this->generateUrl('admin_scope_update', array('id' => $scope->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Upd... | php | private function createEditForm(Scope $scope)
{
$form = $this->createForm(new ScopeType(), $scope, array(
'action' => $this->generateUrl('admin_scope_update', array('id' => $scope->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Upd... | [
"private",
"function",
"createEditForm",
"(",
"Scope",
"$",
"scope",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ScopeType",
"(",
")",
",",
"$",
"scope",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"generateUrl... | Creates a form to edit a Scope entity.
@param Scope $scope The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"Scope",
"entity",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ScopeController.php#L138-L148 |
17,272 | djgadd/themosis-illuminate | src/Config/ConfigFinder.php | ConfigFinder.fileMatchesMoreSpecificExtension | protected function fileMatchesMoreSpecificExtension(string $filename, string $extension) : bool
{
return array_reduce($this->extensions, function ($match, $compare) use ($filename, $extension) {
if ($match || $compare === $extension || strlen($compare) < strlen($extension)) {
return $match;
... | php | protected function fileMatchesMoreSpecificExtension(string $filename, string $extension) : bool
{
return array_reduce($this->extensions, function ($match, $compare) use ($filename, $extension) {
if ($match || $compare === $extension || strlen($compare) < strlen($extension)) {
return $match;
... | [
"protected",
"function",
"fileMatchesMoreSpecificExtension",
"(",
"string",
"$",
"filename",
",",
"string",
"$",
"extension",
")",
":",
"bool",
"{",
"return",
"array_reduce",
"(",
"$",
"this",
"->",
"extensions",
",",
"function",
"(",
"$",
"match",
",",
"$",
... | Determines if a file matches another more specific extension
@param string $filename
@param string $extension
@return bool | [
"Determines",
"if",
"a",
"file",
"matches",
"another",
"more",
"specific",
"extension"
] | 13ee4c3413cddd85a2f262ac361f35c81da0c53c | https://github.com/djgadd/themosis-illuminate/blob/13ee4c3413cddd85a2f262ac361f35c81da0c53c/src/Config/ConfigFinder.php#L67-L76 |
17,273 | djgadd/themosis-illuminate | src/Config/ConfigFinder.php | ConfigFinder.mergeConfigs | protected function mergeConfigs(array $old, array $new) : array
{
foreach ($new as $key => $val) {
if (!array_key_exists($key, $old) || !is_array($old[$key]) || !is_array($val)) {
$old[$key] = $val;
continue;
}
if (is_int($key)) {
$old[] = $val;
... | php | protected function mergeConfigs(array $old, array $new) : array
{
foreach ($new as $key => $val) {
if (!array_key_exists($key, $old) || !is_array($old[$key]) || !is_array($val)) {
$old[$key] = $val;
continue;
}
if (is_int($key)) {
$old[] = $val;
... | [
"protected",
"function",
"mergeConfigs",
"(",
"array",
"$",
"old",
",",
"array",
"$",
"new",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"new",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",... | Recusively merges configs together
@param array $old
@param array $new
@return array | [
"Recusively",
"merges",
"configs",
"together"
] | 13ee4c3413cddd85a2f262ac361f35c81da0c53c | https://github.com/djgadd/themosis-illuminate/blob/13ee4c3413cddd85a2f262ac361f35c81da0c53c/src/Config/ConfigFinder.php#L106-L123 |
17,274 | lmammino/e-foundation | src/Common/Doctrine/MappingLocator.php | MappingLocator.getMappings | public static function getMappings()
{
$basePath = self::getBasePath();
return array(
realpath($basePath.'Address/Resources/config/doctrine/model') => 'LMammino\EFoundation\Address\Model',
realpath($basePath.'Attribute/Resources/config/doctrine/model') =>
'LM... | php | public static function getMappings()
{
$basePath = self::getBasePath();
return array(
realpath($basePath.'Address/Resources/config/doctrine/model') => 'LMammino\EFoundation\Address\Model',
realpath($basePath.'Attribute/Resources/config/doctrine/model') =>
'LM... | [
"public",
"static",
"function",
"getMappings",
"(",
")",
"{",
"$",
"basePath",
"=",
"self",
"::",
"getBasePath",
"(",
")",
";",
"return",
"array",
"(",
"realpath",
"(",
"$",
"basePath",
".",
"'Address/Resources/config/doctrine/model'",
")",
"=>",
"'LMammino\\EFo... | Get the mapping
@return array | [
"Get",
"the",
"mapping"
] | 198b7047d93eb11c9bc0c7ddf0bfa8229d42807a | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Common/Doctrine/MappingLocator.php#L17-L32 |
17,275 | silvercommerce/catalogue-frontend | src/extensions/CategoryExtension.php | CategoryExtension.PrimaryImage | public function PrimaryImage()
{
// If we have associated an image, return it
$image = $this->owner->Image();
if ($image->exists()) {
return $image;
}
// Next try and get a child product image
$product = $this->owner->AllProducts()->first();
if ... | php | public function PrimaryImage()
{
// If we have associated an image, return it
$image = $this->owner->Image();
if ($image->exists()) {
return $image;
}
// Next try and get a child product image
$product = $this->owner->AllProducts()->first();
if ... | [
"public",
"function",
"PrimaryImage",
"(",
")",
"{",
"// If we have associated an image, return it",
"$",
"image",
"=",
"$",
"this",
"->",
"owner",
"->",
"Image",
"(",
")",
";",
"if",
"(",
"$",
"image",
"->",
"exists",
"(",
")",
")",
"{",
"return",
"$",
... | Gets the main image to use for this category, this
can either be the selected image, an image from the
first product or the default "no-product" image.
@return Image | [
"Gets",
"the",
"main",
"image",
"to",
"use",
"for",
"this",
"category",
"this",
"can",
"either",
"be",
"the",
"selected",
"image",
"an",
"image",
"from",
"the",
"first",
"product",
"or",
"the",
"default",
"no",
"-",
"product",
"image",
"."
] | 671f1e32bf6bc6eb193c6608ae904cd055540cc4 | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/extensions/CategoryExtension.php#L35-L53 |
17,276 | devmobgroup/postcodes | src/Util/Json.php | Json.decode | public static function decode(ResponseInterface $response): array
{
$contents = $response->getBody()->getContents();
$decoded = json_decode($contents, true);
$response->getBody()->rewind();
if (json_last_error() !== JSON_ERROR_NONE || ! is_array($decoded)) {
throw new Js... | php | public static function decode(ResponseInterface $response): array
{
$contents = $response->getBody()->getContents();
$decoded = json_decode($contents, true);
$response->getBody()->rewind();
if (json_last_error() !== JSON_ERROR_NONE || ! is_array($decoded)) {
throw new Js... | [
"public",
"static",
"function",
"decode",
"(",
"ResponseInterface",
"$",
"response",
")",
":",
"array",
"{",
"$",
"contents",
"=",
"$",
"response",
"->",
"getBody",
"(",
")",
"->",
"getContents",
"(",
")",
";",
"$",
"decoded",
"=",
"json_decode",
"(",
"$... | Json decode an http response.
@param \Psr\Http\Message\ResponseInterface $response
@return array
@throws \DevMob\Postcodes\Exceptions\JsonException | [
"Json",
"decode",
"an",
"http",
"response",
"."
] | 1a8438fd960a8f50ec28d61af94560892b529f12 | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Util/Json.php#L17-L28 |
17,277 | Nozemi/SlickBoard-Library | lib/SBLib/Database/DBUtil.php | DBUtil.addQuery | public function addQuery(DBUtilQuery $query) {
if($query->getName() !== null) {
$this->_queryQueue[$query->getName()] = $query;
} else {
$this->_queryQueue[] = $query;
}
new Logger('Query added to the queue.', Logger::DEBUG, __CLASS__, __LINE__);
return $... | php | public function addQuery(DBUtilQuery $query) {
if($query->getName() !== null) {
$this->_queryQueue[$query->getName()] = $query;
} else {
$this->_queryQueue[] = $query;
}
new Logger('Query added to the queue.', Logger::DEBUG, __CLASS__, __LINE__);
return $... | [
"public",
"function",
"addQuery",
"(",
"DBUtilQuery",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getName",
"(",
")",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"_queryQueue",
"[",
"$",
"query",
"->",
"getName",
"(",
")",
"]",
"=",
"$"... | Adds a query with it's parameters to the query queue.
@param DBUtilQuery $query
@return $this | [
"Adds",
"a",
"query",
"with",
"it",
"s",
"parameters",
"to",
"the",
"query",
"queue",
"."
] | c9f0a26a30f8127c997f75d7232eac170972418d | https://github.com/Nozemi/SlickBoard-Library/blob/c9f0a26a30f8127c997f75d7232eac170972418d/lib/SBLib/Database/DBUtil.php#L123-L132 |
17,278 | Nozemi/SlickBoard-Library | lib/SBLib/Database/DBUtil.php | DBUtil.addQueries | public function addQueries($queries) {
if(is_array($queries)) {
foreach($queries as $query) {
$this->addQuery($query);
}
new Logger('Queries added to the queue.', Logger::DEBUG, __CLASS__, __LINE__);
return $this;
}
new Logger('Fa... | php | public function addQueries($queries) {
if(is_array($queries)) {
foreach($queries as $query) {
$this->addQuery($query);
}
new Logger('Queries added to the queue.', Logger::DEBUG, __CLASS__, __LINE__);
return $this;
}
new Logger('Fa... | [
"public",
"function",
"addQueries",
"(",
"$",
"queries",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"queries",
")",
")",
"{",
"foreach",
"(",
"$",
"queries",
"as",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"addQuery",
"(",
"$",
"query",
")",
";",
... | Add an array of "DBUtilQuery"s to the query_queue.
@param $queries
@return $this | [
"Add",
"an",
"array",
"of",
"DBUtilQuery",
"s",
"to",
"the",
"query_queue",
"."
] | c9f0a26a30f8127c997f75d7232eac170972418d | https://github.com/Nozemi/SlickBoard-Library/blob/c9f0a26a30f8127c997f75d7232eac170972418d/lib/SBLib/Database/DBUtil.php#L140-L152 |
17,279 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.add_error | public function add_error( $key, $message )
{
$this->success = false;
$this->errors[$key][] = $message;
} | php | public function add_error( $key, $message )
{
$this->success = false;
$this->errors[$key][] = $message;
} | [
"public",
"function",
"add_error",
"(",
"$",
"key",
",",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"success",
"=",
"false",
";",
"$",
"this",
"->",
"errors",
"[",
"$",
"key",
"]",
"[",
"]",
"=",
"$",
"message",
";",
"}"
] | Add an error to validator
@param string $key
@param string $message
@return void | [
"Add",
"an",
"error",
"to",
"validator"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L165-L169 |
17,280 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.label | public function label( $data, $value = null )
{
if ( !is_null( $value ) && !is_array( $data ) )
{
$data = array( $data => $value );
}
if ( !is_array( $data ) )
{
throw new \InvalidArgumentException( 'CCValidator::label - invalid label data given' );
}
$this->labels = array_merge( $this->labels, $... | php | public function label( $data, $value = null )
{
if ( !is_null( $value ) && !is_array( $data ) )
{
$data = array( $data => $value );
}
if ( !is_array( $data ) )
{
throw new \InvalidArgumentException( 'CCValidator::label - invalid label data given' );
}
$this->labels = array_merge( $this->labels, $... | [
"public",
"function",
"label",
"(",
"$",
"data",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"value",
")",
"&&",
"!",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"$",
"data",
... | Set a data value
@param string $data
@param mixed $value
@return void | [
"Set",
"a",
"data",
"value"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L190-L203 |
17,281 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rules | public function rules()
{
$args = func_get_args();
$key = array_shift( $args );
if ( !is_array( reset( $args ) ) )
{
$rules = $args;
}
else
{
$rules = array_shift( $args );
}
$success = true;
foreach( $rules as $rule )
{
$rule = explode( ':', $rule );
$params = array();
if ( ... | php | public function rules()
{
$args = func_get_args();
$key = array_shift( $args );
if ( !is_array( reset( $args ) ) )
{
$rules = $args;
}
else
{
$rules = array_shift( $args );
}
$success = true;
foreach( $rules as $rule )
{
$rule = explode( ':', $rule );
$params = array();
if ( ... | [
"public",
"function",
"rules",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"reset",
"(",
"$",
"args",
")",
")",
")",
"{",
"$",
"ru... | Apply multiple rules to one attribute
@param ...string
@return bool | [
"Apply",
"multiple",
"rules",
"to",
"one",
"attribute"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L231-L269 |
17,282 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.message | public function message()
{
$params = func_get_args();
$message = array_shift( $params );
$method = array_shift( $params );
if ( !$result = $this->validate( $method, $params ) )
{
$key = array_shift( $params );
$params = $this->get_error_message_params( $key, $params );
// replace the params ins... | php | public function message()
{
$params = func_get_args();
$message = array_shift( $params );
$method = array_shift( $params );
if ( !$result = $this->validate( $method, $params ) )
{
$key = array_shift( $params );
$params = $this->get_error_message_params( $key, $params );
// replace the params ins... | [
"public",
"function",
"message",
"(",
")",
"{",
"$",
"params",
"=",
"func_get_args",
"(",
")",
";",
"$",
"message",
"=",
"array_shift",
"(",
"$",
"params",
")",
";",
"$",
"method",
"=",
"array_shift",
"(",
"$",
"params",
")",
";",
"if",
"(",
"!",
"... | Run the validation with a custom message
@param mixed...
@return bool | [
"Run",
"the",
"validation",
"with",
"a",
"custom",
"message"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L296-L319 |
17,283 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.validate | protected function validate( $method, $params )
{
$reverse = false;
// when the method starts with not we assume that we
// have to reverse the validation means only accepting the opposite
if ( substr( $method, 0, 4 ) === 'not_' )
{
$reverse = true; $method = substr( $method, 4 );
}
if ( array_key_... | php | protected function validate( $method, $params )
{
$reverse = false;
// when the method starts with not we assume that we
// have to reverse the validation means only accepting the opposite
if ( substr( $method, 0, 4 ) === 'not_' )
{
$reverse = true; $method = substr( $method, 4 );
}
if ( array_key_... | [
"protected",
"function",
"validate",
"(",
"$",
"method",
",",
"$",
"params",
")",
"{",
"$",
"reverse",
"=",
"false",
";",
"// when the method starts with not we assume that we ",
"// have to reverse the validation means only accepting the opposite",
"if",
"(",
"substr",
"("... | Run an validation call
@param string $rule
@param array $params
@return bool | [
"Run",
"an",
"validation",
"call"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L328-L350 |
17,284 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.proof_result | protected function proof_result( $rule, $key, $result )
{
if ( $result === false )
{
$this->failed[$key][] = $rule;
}
if ( $this->success === true )
{
return $this->success = $result;
}
return $result;
} | php | protected function proof_result( $rule, $key, $result )
{
if ( $result === false )
{
$this->failed[$key][] = $rule;
}
if ( $this->success === true )
{
return $this->success = $result;
}
return $result;
} | [
"protected",
"function",
"proof_result",
"(",
"$",
"rule",
",",
"$",
"key",
",",
"$",
"result",
")",
"{",
"if",
"(",
"$",
"result",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"failed",
"[",
"$",
"key",
"]",
"[",
"]",
"=",
"$",
"rule",
";",
"}... | Proof a single result and update the success property
@param string $rule
@param string $key
@param array $result
@return bool | [
"Proof",
"a",
"single",
"result",
"and",
"update",
"the",
"success",
"property"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L360-L373 |
17,285 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.apply_rule | protected function apply_rule( $rule, $callback, $params, $reverse )
{
$data_key = array_shift( $params );
// In case of that the requested data set does not exist
// we always set the test as failure.
if ( !array_key_exists( $data_key, $this->data ) )
{
return $this->proof_result( $rule, $data_key, ( $r... | php | protected function apply_rule( $rule, $callback, $params, $reverse )
{
$data_key = array_shift( $params );
// In case of that the requested data set does not exist
// we always set the test as failure.
if ( !array_key_exists( $data_key, $this->data ) )
{
return $this->proof_result( $rule, $data_key, ( $r... | [
"protected",
"function",
"apply_rule",
"(",
"$",
"rule",
",",
"$",
"callback",
",",
"$",
"params",
",",
"$",
"reverse",
")",
"{",
"$",
"data_key",
"=",
"array_shift",
"(",
"$",
"params",
")",
";",
"// In case of that the requested data set does not exist",
"// w... | Apply an rule executes the rule and runs the result proof
@param string $rule
@param callback $callback
@param array $params
@return bool | [
"Apply",
"an",
"rule",
"executes",
"the",
"rule",
"and",
"runs",
"the",
"result",
"proof"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L383-L407 |
17,286 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.get_error_message_params | protected function get_error_message_params( $key, $params )
{
// do we have a label to replace the key?
if ( isset( $this->labels[$key] ) )
{
$field = $this->labels[$key];
} else {
$field = ucfirst( str_replace( array( '_', '-' ), ' ', $key ) );
}
return array_merge( array( 'field' => $field ), $pa... | php | protected function get_error_message_params( $key, $params )
{
// do we have a label to replace the key?
if ( isset( $this->labels[$key] ) )
{
$field = $this->labels[$key];
} else {
$field = ucfirst( str_replace( array( '_', '-' ), ' ', $key ) );
}
return array_merge( array( 'field' => $field ), $pa... | [
"protected",
"function",
"get_error_message_params",
"(",
"$",
"key",
",",
"$",
"params",
")",
"{",
"// do we have a label to replace the key?",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"labels",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"field",
"=",
"... | Get the parameter array for the error messages
@param string $key
@param array $params
@return array | [
"Get",
"the",
"parameter",
"array",
"for",
"the",
"error",
"messages"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L416-L427 |
17,287 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.generate_error_message | protected function generate_error_message( $rule, $key, $params )
{
$params = $this->get_error_message_params( $key, $params );
return __( ClanCats::$config->get( 'validation.language_prefix' ).'.'.$rule, $params );
} | php | protected function generate_error_message( $rule, $key, $params )
{
$params = $this->get_error_message_params( $key, $params );
return __( ClanCats::$config->get( 'validation.language_prefix' ).'.'.$rule, $params );
} | [
"protected",
"function",
"generate_error_message",
"(",
"$",
"rule",
",",
"$",
"key",
",",
"$",
"params",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"get_error_message_params",
"(",
"$",
"key",
",",
"$",
"params",
")",
";",
"return",
"__",
"(",
"... | Generate the error message for an rule
@param string $rule
@param string $key
@param array $params
@return string | [
"Generate",
"the",
"error",
"message",
"for",
"an",
"rule"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L437-L441 |
17,288 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rule_required | public function rule_required( $key, $value )
{
if ( is_null( $value ) )
{
return false;
}
elseif ( is_string( $value ) && trim( $value ) == '' )
{
return false;
}
return true;
} | php | public function rule_required( $key, $value )
{
if ( is_null( $value ) )
{
return false;
}
elseif ( is_string( $value ) && trim( $value ) == '' )
{
return false;
}
return true;
} | [
"public",
"function",
"rule_required",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"elseif",
"(",
"is_string",
"(",
"$",
"value",
")",
"&&",
"trim",
"(",
"$",
... | Check if the field is set an not empty
@param string $key
@param string $value
@return bool | [
"Check",
"if",
"the",
"field",
"is",
"set",
"an",
"not",
"empty"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L454-L465 |
17,289 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rule_between_num | public function rule_between_num( $key, $value, $min, $max )
{
if ( !$this->rule_min_num( $key, $value, $min ) )
{
return false;
}
if ( !$this->rule_max_num( $key, $value, $max ) )
{
return false;
}
return true;
} | php | public function rule_between_num( $key, $value, $min, $max )
{
if ( !$this->rule_min_num( $key, $value, $min ) )
{
return false;
}
if ( !$this->rule_max_num( $key, $value, $max ) )
{
return false;
}
return true;
} | [
"public",
"function",
"rule_between_num",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"min",
",",
"$",
"max",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"rule_min_num",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"min",
")",
")",
"{",
"re... | Is the given number between min and max
@param string $key
@param string $value
@return bool | [
"Is",
"the",
"given",
"number",
"between",
"min",
"and",
"max"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L518-L529 |
17,290 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rule_min | public function rule_min( $key, $value, $min )
{
return $this->rule_min_num( $key, strlen( $value ), $min );
} | php | public function rule_min( $key, $value, $min )
{
return $this->rule_min_num( $key, strlen( $value ), $min );
} | [
"public",
"function",
"rule_min",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"min",
")",
"{",
"return",
"$",
"this",
"->",
"rule_min_num",
"(",
"$",
"key",
",",
"strlen",
"(",
"$",
"value",
")",
",",
"$",
"min",
")",
";",
"}"
] | Is the given string at least some size
@param string $key
@param string $value
@return bool | [
"Is",
"the",
"given",
"string",
"at",
"least",
"some",
"size"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L538-L541 |
17,291 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rule_max | public function rule_max( $key, $value, $max )
{
return $this->rule_max_num( $key, strlen( $value ), $max );
} | php | public function rule_max( $key, $value, $max )
{
return $this->rule_max_num( $key, strlen( $value ), $max );
} | [
"public",
"function",
"rule_max",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"max",
")",
"{",
"return",
"$",
"this",
"->",
"rule_max_num",
"(",
"$",
"key",
",",
"strlen",
"(",
"$",
"value",
")",
",",
"$",
"max",
")",
";",
"}"
] | Is the given string max some size
@param string $key
@param string $value
@return bool | [
"Is",
"the",
"given",
"string",
"max",
"some",
"size"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L550-L553 |
17,292 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rule_between | public function rule_between( $key, $value, $min, $max )
{
return $this->rule_between_num( $key, strlen( $value ), $min, $max );
} | php | public function rule_between( $key, $value, $min, $max )
{
return $this->rule_between_num( $key, strlen( $value ), $min, $max );
} | [
"public",
"function",
"rule_between",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"min",
",",
"$",
"max",
")",
"{",
"return",
"$",
"this",
"->",
"rule_between_num",
"(",
"$",
"key",
",",
"strlen",
"(",
"$",
"value",
")",
",",
"$",
"min",
",",
"... | Is the given string between min and max
@param string $key
@param string $value
@return bool | [
"Is",
"the",
"given",
"string",
"between",
"min",
"and",
"max"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L562-L565 |
17,293 | ClanCats/Core | src/classes/CCValidator.php | CCValidator.rule_date_format | public function rule_date_format( $key, $value, $format = 'd/m/Y' )
{
return date( $format, strtotime( trim( $value ) ) ) == trim( $value );
} | php | public function rule_date_format( $key, $value, $format = 'd/m/Y' )
{
return date( $format, strtotime( trim( $value ) ) ) == trim( $value );
} | [
"public",
"function",
"rule_date_format",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"format",
"=",
"'d/m/Y'",
")",
"{",
"return",
"date",
"(",
"$",
"format",
",",
"strtotime",
"(",
"trim",
"(",
"$",
"value",
")",
")",
")",
"==",
"trim",
"(",
"$... | Check if valid date format
@param string $key
@param string $value
@param string $format
@param bool | [
"Check",
"if",
"valid",
"date",
"format"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCValidator.php#L711-L714 |
17,294 | devmobgroup/postcodes | src/Traits/AccessesProperties.php | AccessesProperties.get | protected function get($data, string $key)
{
$dot = $data instanceof Dot ? $data : new Dot($data);
if (isset($dot[$key])) {
return $dot[$key];
}
throw new UnexpectedResponseException(sprintf('Missing key \'%s\' in data'));
} | php | protected function get($data, string $key)
{
$dot = $data instanceof Dot ? $data : new Dot($data);
if (isset($dot[$key])) {
return $dot[$key];
}
throw new UnexpectedResponseException(sprintf('Missing key \'%s\' in data'));
} | [
"protected",
"function",
"get",
"(",
"$",
"data",
",",
"string",
"$",
"key",
")",
"{",
"$",
"dot",
"=",
"$",
"data",
"instanceof",
"Dot",
"?",
"$",
"data",
":",
"new",
"Dot",
"(",
"$",
"data",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"dot",
"[",... | Extract data from an array using dot notation.
Throws an exception when the provided key does not exist.
@param array|\Adbar\Dot $data
@param string $key Supports dot notation {@see https://github.com/adbario/php-dot-notation}
@return mixed
@throws \DevMob\Postcodes\Exceptions\UnexpectedResponseException | [
"Extract",
"data",
"from",
"an",
"array",
"using",
"dot",
"notation",
".",
"Throws",
"an",
"exception",
"when",
"the",
"provided",
"key",
"does",
"not",
"exist",
"."
] | 1a8438fd960a8f50ec28d61af94560892b529f12 | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Traits/AccessesProperties.php#L19-L28 |
17,295 | maximebf/events | src/Events/Notifier.php | Notifier.notify | public function notify($eventName, array $params = array())
{
$this->dispatcher->notify($e = $this->createEvent($eventName, $params));
return $e;
} | php | public function notify($eventName, array $params = array())
{
$this->dispatcher->notify($e = $this->createEvent($eventName, $params));
return $e;
} | [
"public",
"function",
"notify",
"(",
"$",
"eventName",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"dispatcher",
"->",
"notify",
"(",
"$",
"e",
"=",
"$",
"this",
"->",
"createEvent",
"(",
"$",
"eventName",
",",
... | Creates and dispatches an event
@see EventDispatcher::notify()
@param string $eventName
@param array $params
@return Event | [
"Creates",
"and",
"dispatches",
"an",
"event"
] | b9861c260ee9eaabb9aa986bab76a2e039eb871f | https://github.com/maximebf/events/blob/b9861c260ee9eaabb9aa986bab76a2e039eb871f/src/Events/Notifier.php#L139-L143 |
17,296 | maximebf/events | src/Events/Notifier.php | Notifier.notifyUntil | public function notifyUntil($eventName, array $params = array(), $callback = null)
{
$this->dispatcher->notifyUntil($e = $this->createEvent($eventName, $params), $callback);
return $e;
} | php | public function notifyUntil($eventName, array $params = array(), $callback = null)
{
$this->dispatcher->notifyUntil($e = $this->createEvent($eventName, $params), $callback);
return $e;
} | [
"public",
"function",
"notifyUntil",
"(",
"$",
"eventName",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"dispatcher",
"->",
"notifyUntil",
"(",
"$",
"e",
"=",
"$",
"this",
"->",... | Creates and dispatches an event until it has been processed.
@see EventDispatcher::notifyUntil()
@param string $eventName
@param array $params
@param callback $callback
@return Event | [
"Creates",
"and",
"dispatches",
"an",
"event",
"until",
"it",
"has",
"been",
"processed",
"."
] | b9861c260ee9eaabb9aa986bab76a2e039eb871f | https://github.com/maximebf/events/blob/b9861c260ee9eaabb9aa986bab76a2e039eb871f/src/Events/Notifier.php#L154-L158 |
17,297 | crypto-markets/common | src/Common/Endpoint.php | Endpoint.make | public static function make(Client $httpClient, array $params = [])
{
$instance = new static($httpClient);
$instance->configure($params);
return $instance;
} | php | public static function make(Client $httpClient, array $params = [])
{
$instance = new static($httpClient);
$instance->configure($params);
return $instance;
} | [
"public",
"static",
"function",
"make",
"(",
"Client",
"$",
"httpClient",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
"$",
"httpClient",
")",
";",
"$",
"instance",
"->",
"configure",
"(",
"$",
"pa... | Create a new resource instance.
@param \CryptoMarkets\Common\Client $httpClient
@param array $params
@return static | [
"Create",
"a",
"new",
"resource",
"instance",
"."
] | 206b1d9b88502d3fb73cef1323cd086156d3e633 | https://github.com/crypto-markets/common/blob/206b1d9b88502d3fb73cef1323cd086156d3e633/src/Common/Endpoint.php#L48-L55 |
17,298 | crypto-markets/common | src/Common/Endpoint.php | Endpoint.send | public function send()
{
$request = $this->createRequest();
$response = $this->httpClient->sendRequest($request);
return $this->mapResponse((array) $this->parseResponse($response));
} | php | public function send()
{
$request = $this->createRequest();
$response = $this->httpClient->sendRequest($request);
return $this->mapResponse((array) $this->parseResponse($response));
} | [
"public",
"function",
"send",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"createRequest",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"httpClient",
"->",
"sendRequest",
"(",
"$",
"request",
")",
";",
"return",
"$",
"this",
"->... | Send a new request.
@return array | [
"Send",
"a",
"new",
"request",
"."
] | 206b1d9b88502d3fb73cef1323cd086156d3e633 | https://github.com/crypto-markets/common/blob/206b1d9b88502d3fb73cef1323cd086156d3e633/src/Common/Endpoint.php#L75-L82 |
17,299 | crypto-markets/common | src/Common/Endpoint.php | Endpoint.getPreparedData | public function getPreparedData()
{
$params = $this->getData();
if ($this->authorize) {
$params = array_merge($params, $this->authenticationData($params));
}
return $params;
} | php | public function getPreparedData()
{
$params = $this->getData();
if ($this->authorize) {
$params = array_merge($params, $this->authenticationData($params));
}
return $params;
} | [
"public",
"function",
"getPreparedData",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"authorize",
")",
"{",
"$",
"params",
"=",
"array_merge",
"(",
"$",
"params",
",",
"$",
"this",
"... | Get the request data for authorized or not.
@return string | [
"Get",
"the",
"request",
"data",
"for",
"authorized",
"or",
"not",
"."
] | 206b1d9b88502d3fb73cef1323cd086156d3e633 | https://github.com/crypto-markets/common/blob/206b1d9b88502d3fb73cef1323cd086156d3e633/src/Common/Endpoint.php#L141-L150 |
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.