repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
jfusion/org.jfusion.framework | src/Installer/Plugin.php | Plugin.uninstall | function uninstall($name)
{
$result = array();
$result['status'] = false;
try {
$JFusionAdmin = Factory::getAdmin($name);
if ($JFusionAdmin->isConfigured()) {
//if this plugin had been valid, call its uninstall function if it exists
$success = 0;
try {
list($s... | php | function uninstall($name)
{
$result = array();
$result['status'] = false;
try {
$JFusionAdmin = Factory::getAdmin($name);
if ($JFusionAdmin->isConfigured()) {
//if this plugin had been valid, call its uninstall function if it exists
$success = 0;
try {
list($s... | [
"function",
"uninstall",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"result",
"[",
"'status'",
"]",
"=",
"false",
";",
"try",
"{",
"$",
"JFusionAdmin",
"=",
"Factory",
"::",
"getAdmin",
"(",
"$",
"name",
")",
";",
... | handles JFusion plugin un-installation
@param string $name name of the JFusion plugin used
@return array | [
"handles",
"JFusion",
"plugin",
"un",
"-",
"installation"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Plugin.php#L233-L320 |
jfusion/org.jfusion.framework | src/Installer/Plugin.php | Plugin.copy | function copy($name, $new_name, $update = false)
{
//replace not-allowed characters with _
$new_name = preg_replace('/([^a-zA-Z0-9_])/', '_', $new_name);
//initialise response element
$result = array();
$result['status'] = false;
if ($name && $new_name) {
//check to see if an integration was selected
... | php | function copy($name, $new_name, $update = false)
{
//replace not-allowed characters with _
$new_name = preg_replace('/([^a-zA-Z0-9_])/', '_', $new_name);
//initialise response element
$result = array();
$result['status'] = false;
if ($name && $new_name) {
//check to see if an integration was selected
... | [
"function",
"copy",
"(",
"$",
"name",
",",
"$",
"new_name",
",",
"$",
"update",
"=",
"false",
")",
"{",
"//replace not-allowed characters with _",
"$",
"new_name",
"=",
"preg_replace",
"(",
"'/([^a-zA-Z0-9_])/'",
",",
"'_'",
",",
"$",
"new_name",
")",
";",
"... | handles copying JFusion plugins
@param string $name name of the JFusion plugin used
@param string $new_name name of the copied plugin
@param boolean $update mark if we updating a copied plugin
@throws RuntimeException
@return boolean | [
"handles",
"copying",
"JFusion",
"plugins"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Plugin.php#L332-L396 |
jfusion/org.jfusion.framework | src/Installer/Plugin.php | Plugin.getManifest | function getManifest($dir)
{
$file = $dir . '/jfusion.xml';
$this->installer->setPath('manifest', $file);
// If we cannot load the xml file return null
$xml = JFusionFramework::getXml($file);
if (!($xml instanceof SimpleXMLElement) || ($xml->getName() != 'extension')) {
... | php | function getManifest($dir)
{
$file = $dir . '/jfusion.xml';
$this->installer->setPath('manifest', $file);
// If we cannot load the xml file return null
$xml = JFusionFramework::getXml($file);
if (!($xml instanceof SimpleXMLElement) || ($xml->getName() != 'extension')) {
... | [
"function",
"getManifest",
"(",
"$",
"dir",
")",
"{",
"$",
"file",
"=",
"$",
"dir",
".",
"'/jfusion.xml'",
";",
"$",
"this",
"->",
"installer",
"->",
"setPath",
"(",
"'manifest'",
",",
"$",
"file",
")",
";",
"// If we cannot load the xml file return null",
"... | load manifest file with installation information
@param string $dir Directory
@return SimpleXMLElement object (or null) | [
"load",
"manifest",
"file",
"with",
"installation",
"information"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Plugin.php#L405-L432 |
jfusion/org.jfusion.framework | src/Installer/Plugin.php | Plugin.getFiles | function getFiles($folder, $name)
{
$filesArray = array();
$files = Folder::files($folder, null, false, true);
$path = JFusionFramework::getPluginPath($name);
foreach ($files as $file) {
$file = str_replace($path . '/', '', $file);
$file = str_replace($path . '\\'... | php | function getFiles($folder, $name)
{
$filesArray = array();
$files = Folder::files($folder, null, false, true);
$path = JFusionFramework::getPluginPath($name);
foreach ($files as $file) {
$file = str_replace($path . '/', '', $file);
$file = str_replace($path . '\\'... | [
"function",
"getFiles",
"(",
"$",
"folder",
",",
"$",
"name",
")",
"{",
"$",
"filesArray",
"=",
"array",
"(",
")",
";",
"$",
"files",
"=",
"Folder",
"::",
"files",
"(",
"$",
"folder",
",",
"null",
",",
"false",
",",
"true",
")",
";",
"$",
"path",... | get files function
@param string $folder folder name
@param string $name name
@return array files | [
"get",
"files",
"function"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Plugin.php#L442-L462 |
jfusion/org.jfusion.framework | src/Installer/Plugin.php | Plugin.getAttribute | function getAttribute($xml, $attribute)
{
if($xml instanceof SimpleXMLElement) {
$attributes = $xml->attributes();
if (isset($attributes[$attribute])) {
$xml = (string)$attributes[$attribute];
} else {
$xml = null;
}
} else {
$xml =... | php | function getAttribute($xml, $attribute)
{
if($xml instanceof SimpleXMLElement) {
$attributes = $xml->attributes();
if (isset($attributes[$attribute])) {
$xml = (string)$attributes[$attribute];
} else {
$xml = null;
}
} else {
$xml =... | [
"function",
"getAttribute",
"(",
"$",
"xml",
",",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"xml",
"instanceof",
"SimpleXMLElement",
")",
"{",
"$",
"attributes",
"=",
"$",
"xml",
"->",
"attributes",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"att... | getAttribute
@param SimpleXMLElement $xml xml object
@param string $attribute attribute name
@return string result | [
"getAttribute"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Plugin.php#L472-L485 |
phug-php/formatter | src/Phug/Formatter/Element/AbstractAssignmentContainerElement.php | AbstractAssignmentContainerElement.addAssignment | public function addAssignment(AssignmentElement $element)
{
$element->setContainer($this);
$this->getAssignments()->attach($element);
return $this;
} | php | public function addAssignment(AssignmentElement $element)
{
$element->setContainer($this);
$this->getAssignments()->attach($element);
return $this;
} | [
"public",
"function",
"addAssignment",
"(",
"AssignmentElement",
"$",
"element",
")",
"{",
"$",
"element",
"->",
"setContainer",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"getAssignments",
"(",
")",
"->",
"attach",
"(",
"$",
"element",
")",
";",
"re... | Add assignment to the markup.
@param AssignmentElement $element
@return $this | [
"Add",
"assignment",
"to",
"the",
"markup",
"."
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Element/AbstractAssignmentContainerElement.php#L20-L26 |
phug-php/formatter | src/Phug/Formatter/Element/AbstractAssignmentContainerElement.php | AbstractAssignmentContainerElement.getAssignmentsByName | public function getAssignmentsByName($name)
{
$result = [];
foreach ($this->getAssignments() as $assignment) {
/* @var AssignmentElement $assignment */
if ($assignment->getName() === $name) {
$result[] = $assignment;
}
}
return $r... | php | public function getAssignmentsByName($name)
{
$result = [];
foreach ($this->getAssignments() as $assignment) {
/* @var AssignmentElement $assignment */
if ($assignment->getName() === $name) {
$result[] = $assignment;
}
}
return $r... | [
"public",
"function",
"getAssignmentsByName",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAssignments",
"(",
")",
"as",
"$",
"assignment",
")",
"{",
"/* @var AssignmentElement $assignment */",
"if",
"... | Return markup assignments list of a specific name.
@param $name
@return AssignmentElement[] | [
"Return",
"markup",
"assignments",
"list",
"of",
"a",
"specific",
"name",
"."
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Element/AbstractAssignmentContainerElement.php#L63-L75 |
qcubed/orm | src/Codegen/TypeTable.php | TypeTable.literal | public static function literal($mixColValue)
{
if (is_null($mixColValue)) {
return 'null';
} elseif (is_integer($mixColValue)) {
return $mixColValue;
} elseif (is_bool($mixColValue)) {
return ($mixColValue ? 'true' : 'false');
} elseif (is_float($m... | php | public static function literal($mixColValue)
{
if (is_null($mixColValue)) {
return 'null';
} elseif (is_integer($mixColValue)) {
return $mixColValue;
} elseif (is_bool($mixColValue)) {
return ($mixColValue ? 'true' : 'false');
} elseif (is_float($m... | [
"public",
"static",
"function",
"literal",
"(",
"$",
"mixColValue",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"mixColValue",
")",
")",
"{",
"return",
"'null'",
";",
"}",
"elseif",
"(",
"is_integer",
"(",
"$",
"mixColValue",
")",
")",
"{",
"return",
"$"... | Returns the string that will be used to represent the literal value given when codegenning a type table
@param mixed $mixColValue
@return string | [
"Returns",
"the",
"string",
"that",
"will",
"be",
"used",
"to",
"represent",
"the",
"literal",
"value",
"given",
"when",
"codegenning",
"a",
"type",
"table"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Codegen/TypeTable.php#L99-L115 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.initOutputConfig | private function initOutputConfig(array $outputOptions)
{
$this->scanFailure = false;
$this->outputFormat = $outputOptions['out_format'];
$this->outputLevel = $outputOptions['out_level'];
$this->preventAnsiColors = $outputOptions['out_no_ansi'];
$this->preventEcho = $outputOp... | php | private function initOutputConfig(array $outputOptions)
{
$this->scanFailure = false;
$this->outputFormat = $outputOptions['out_format'];
$this->outputLevel = $outputOptions['out_level'];
$this->preventAnsiColors = $outputOptions['out_no_ansi'];
$this->preventEcho = $outputOp... | [
"private",
"function",
"initOutputConfig",
"(",
"array",
"$",
"outputOptions",
")",
"{",
"$",
"this",
"->",
"scanFailure",
"=",
"false",
";",
"$",
"this",
"->",
"outputFormat",
"=",
"$",
"outputOptions",
"[",
"'out_format'",
"]",
";",
"$",
"this",
"->",
"o... | @param array $outputOptions
@codeCoverageIgnore | [
"@param",
"array",
"$outputOptions"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L44-L61 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.writeSingleMappingResult | private function writeSingleMappingResult(
CoverFishPHPUnitTest $coverFishTest,
CoverFishResult $coverFishResult
) {
/** @var CoverFishMapping $coverMappings */
foreach ($coverFishTest->getCoverMappings() as $coverMappings) {
$coverFishResult->addTestCount();
... | php | private function writeSingleMappingResult(
CoverFishPHPUnitTest $coverFishTest,
CoverFishResult $coverFishResult
) {
/** @var CoverFishMapping $coverMappings */
foreach ($coverFishTest->getCoverMappings() as $coverMappings) {
$coverFishResult->addTestCount();
... | [
"private",
"function",
"writeSingleMappingResult",
"(",
"CoverFishPHPUnitTest",
"$",
"coverFishTest",
",",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"/** @var CoverFishMapping $coverMappings */",
"foreach",
"(",
"$",
"coverFishTest",
"->",
"getCoverMappings",
"(",
... | output mapping/scanning result of each scanned file
@param CoverFishPHPUnitTest $coverFishTest
@param CoverFishResult $coverFishResult | [
"output",
"mapping",
"/",
"scanning",
"result",
"of",
"each",
"scanned",
"file"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L138-L163 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.writeResult | public function writeResult(CoverFishResult $coverFishResult)
{
/** @var CoverFishPHPUnitFile $coverFishUnitFile */
foreach ($coverFishResult->getUnits() as $coverFishUnitFile) {
$this->scanFailure = false;
$coverFishResult->setFailureStream(null);
if (false === ... | php | public function writeResult(CoverFishResult $coverFishResult)
{
/** @var CoverFishPHPUnitFile $coverFishUnitFile */
foreach ($coverFishResult->getUnits() as $coverFishUnitFile) {
$this->scanFailure = false;
$coverFishResult->setFailureStream(null);
if (false === ... | [
"public",
"function",
"writeResult",
"(",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"/** @var CoverFishPHPUnitFile $coverFishUnitFile */",
"foreach",
"(",
"$",
"coverFishResult",
"->",
"getUnits",
"(",
")",
"as",
"$",
"coverFishUnitFile",
")",
"{",
"$",
"th... | handle single file/unit test result (process/failureStream and final check result)
@param CoverFishResult $coverFishResult
@return null|string | [
"handle",
"single",
"file",
"/",
"unit",
"test",
"result",
"(",
"process",
"/",
"failureStream",
"and",
"final",
"check",
"result",
")"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L172-L188 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.writeFinalCheckResults | private function writeFinalCheckResults(CoverFishResult $coverFishResult)
{
if (false === $this->scanFailure) {
$this->writeFileResult(self::FILE_PASS, null);
} else {
$this->writeFileResult(self::FILE_FAILURE, $coverFishResult->getFailureStream());
}
$this->... | php | private function writeFinalCheckResults(CoverFishResult $coverFishResult)
{
if (false === $this->scanFailure) {
$this->writeFileResult(self::FILE_PASS, null);
} else {
$this->writeFileResult(self::FILE_FAILURE, $coverFishResult->getFailureStream());
}
$this->... | [
"private",
"function",
"writeFinalCheckResults",
"(",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"scanFailure",
")",
"{",
"$",
"this",
"->",
"writeFileResult",
"(",
"self",
"::",
"FILE_PASS",
",",
"null",... | write single file check result
@param CoverFishResult $coverFishResult | [
"write",
"single",
"file",
"check",
"result"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L217-L226 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.writeJsonFailureStream | private function writeJsonFailureStream(
CoverFishResult $coverFishResult,
CoverFishPHPUnitTest $unitTest,
CoverFishMessageError $mappingError,
$coverLine
) {
$this->jsonResult['errorCount'] = $coverFishResult->getFailureCount();
$this->jsonResult['errorMessage'] = $m... | php | private function writeJsonFailureStream(
CoverFishResult $coverFishResult,
CoverFishPHPUnitTest $unitTest,
CoverFishMessageError $mappingError,
$coverLine
) {
$this->jsonResult['errorCount'] = $coverFishResult->getFailureCount();
$this->jsonResult['errorMessage'] = $m... | [
"private",
"function",
"writeJsonFailureStream",
"(",
"CoverFishResult",
"$",
"coverFishResult",
",",
"CoverFishPHPUnitTest",
"$",
"unitTest",
",",
"CoverFishMessageError",
"$",
"mappingError",
",",
"$",
"coverLine",
")",
"{",
"$",
"this",
"->",
"jsonResult",
"[",
"... | write single json error line
@param CoverFishResult $coverFishResult
@param CoverFishPHPUnitTest $unitTest
@param CoverFishMessageError $mappingError
@param $coverLine | [
"write",
"single",
"json",
"error",
"line"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L236-L249 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.getMacroLineInfo | protected function getMacroLineInfo($failureCount, CoverFishPHPUnitTest $unitTest)
{
$lineInfoMacro = '%sError #%s in method "%s" (L:~%s)';
if ($this->outputLevel > 1) {
$lineInfoMacro = '%sError #%s in method "%s", Line ~%s';
}
return sprintf($lineInfoMacro,
... | php | protected function getMacroLineInfo($failureCount, CoverFishPHPUnitTest $unitTest)
{
$lineInfoMacro = '%sError #%s in method "%s" (L:~%s)';
if ($this->outputLevel > 1) {
$lineInfoMacro = '%sError #%s in method "%s", Line ~%s';
}
return sprintf($lineInfoMacro,
... | [
"protected",
"function",
"getMacroLineInfo",
"(",
"$",
"failureCount",
",",
"CoverFishPHPUnitTest",
"$",
"unitTest",
")",
"{",
"$",
"lineInfoMacro",
"=",
"'%sError #%s in method \"%s\" (L:~%s)'",
";",
"if",
"(",
"$",
"this",
"->",
"outputLevel",
">",
"1",
")",
"{"... | message block macro, line 01, message title
@param int $failureCount
@param CoverFishPHPUnitTest $unitTest
@return string | [
"message",
"block",
"macro",
"line",
"01",
"message",
"title"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L269-L289 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.getMacroFileInfo | protected function getMacroFileInfo(CoverFishPHPUnitTest $unitTest)
{
$fileInfoMacro = '%s%s%s: %s';
return sprintf($fileInfoMacro,
PHP_EOL,
$this->setIndent(self::MACRO_CONFIG_DETAIL_LINE_INDENT),
(false === $this->preventAnsiColors)
? Color::tplD... | php | protected function getMacroFileInfo(CoverFishPHPUnitTest $unitTest)
{
$fileInfoMacro = '%s%s%s: %s';
return sprintf($fileInfoMacro,
PHP_EOL,
$this->setIndent(self::MACRO_CONFIG_DETAIL_LINE_INDENT),
(false === $this->preventAnsiColors)
? Color::tplD... | [
"protected",
"function",
"getMacroFileInfo",
"(",
"CoverFishPHPUnitTest",
"$",
"unitTest",
")",
"{",
"$",
"fileInfoMacro",
"=",
"'%s%s%s: %s'",
";",
"return",
"sprintf",
"(",
"$",
"fileInfoMacro",
",",
"PHP_EOL",
",",
"$",
"this",
"->",
"setIndent",
"(",
"self",... | message block macro, line 02, cover/annotation line
@param CoverFishPHPUnitTest $unitTest
@return string | [
"message",
"block",
"macro",
"line",
"02",
"cover",
"/",
"annotation",
"line"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L298-L310 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.getMacroCoverInfo | protected function getMacroCoverInfo($coverLine)
{
$lineCoverMacro = '%s%s%s: %s%s';
return sprintf($lineCoverMacro,
PHP_EOL,
$this->setIndent(self::MACRO_CONFIG_DETAIL_LINE_INDENT),
(false === $this->preventAnsiColors)
? Color::tplDarkGrayColor('A... | php | protected function getMacroCoverInfo($coverLine)
{
$lineCoverMacro = '%s%s%s: %s%s';
return sprintf($lineCoverMacro,
PHP_EOL,
$this->setIndent(self::MACRO_CONFIG_DETAIL_LINE_INDENT),
(false === $this->preventAnsiColors)
? Color::tplDarkGrayColor('A... | [
"protected",
"function",
"getMacroCoverInfo",
"(",
"$",
"coverLine",
")",
"{",
"$",
"lineCoverMacro",
"=",
"'%s%s%s: %s%s'",
";",
"return",
"sprintf",
"(",
"$",
"lineCoverMacro",
",",
"PHP_EOL",
",",
"$",
"this",
"->",
"setIndent",
"(",
"self",
"::",
"MACRO_CO... | message block macro, line 03, cover/annotation line
@param string $coverLine
@return string | [
"message",
"block",
"macro",
"line",
"03",
"cover",
"/",
"annotation",
"line"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L318-L331 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.getMacroCoverErrorMessage | protected function getMacroCoverErrorMessage(CoverFishMessageError $mappingError)
{
$lineMessageMacro = '%s%s: %s ';
if ($this->outputLevel > 1) {
$lineMessageMacro = '%s%s: %s (ErrorCode: %s)';
}
return sprintf($lineMessageMacro,
$this->setIndent(self::MACRO... | php | protected function getMacroCoverErrorMessage(CoverFishMessageError $mappingError)
{
$lineMessageMacro = '%s%s: %s ';
if ($this->outputLevel > 1) {
$lineMessageMacro = '%s%s: %s (ErrorCode: %s)';
}
return sprintf($lineMessageMacro,
$this->setIndent(self::MACRO... | [
"protected",
"function",
"getMacroCoverErrorMessage",
"(",
"CoverFishMessageError",
"$",
"mappingError",
")",
"{",
"$",
"lineMessageMacro",
"=",
"'%s%s: %s '",
";",
"if",
"(",
"$",
"this",
"->",
"outputLevel",
">",
"1",
")",
"{",
"$",
"lineMessageMacro",
"=",
"'... | message block macro, line 04, error message
@param CoverFishMessageError $mappingError
@return string | [
"message",
"block",
"macro",
"line",
"04",
"error",
"message"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L340-L356 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishOutput.php | CoverFishOutput.writeFailureStream | private function writeFailureStream(
CoverFishResult $coverFishResult,
CoverFishPHPUnitTest $unitTest,
CoverFishMapping $coverMapping
)
{
/** @var CoverFishMessageError $mappingError */
foreach ($coverMapping->getValidatorResult()->getErrors() as $mappingError) {
... | php | private function writeFailureStream(
CoverFishResult $coverFishResult,
CoverFishPHPUnitTest $unitTest,
CoverFishMapping $coverMapping
)
{
/** @var CoverFishMessageError $mappingError */
foreach ($coverMapping->getValidatorResult()->getErrors() as $mappingError) {
... | [
"private",
"function",
"writeFailureStream",
"(",
"CoverFishResult",
"$",
"coverFishResult",
",",
"CoverFishPHPUnitTest",
"$",
"unitTest",
",",
"CoverFishMapping",
"$",
"coverMapping",
")",
"{",
"/** @var CoverFishMessageError $mappingError */",
"foreach",
"(",
"$",
"coverM... | @param CoverFishResult $coverFishResult
@param CoverFishPHPUnitTest $unitTest
@param CoverFishMapping $coverMapping
@return null | [
"@param",
"CoverFishResult",
"$coverFishResult",
"@param",
"CoverFishPHPUnitTest",
"$unitTest",
"@param",
"CoverFishMapping",
"$coverMapping"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishOutput.php#L365-L398 |
webforge-labs/psc-cms | lib/Psc/JS/Helper.php | Helper.convertHashMap | public static function convertHashMap(\stdClass $object, $quote = self::QUOTE_SINGLE) {
$hash = '{';
$vars = get_object_vars($object);
if (count($vars) > 0) {
foreach ($vars as $key =>$value) {
$hash .= sprintf('"%s": %s,', $key, self::convertValue($value,$quote)); // json encode kanns au... | php | public static function convertHashMap(\stdClass $object, $quote = self::QUOTE_SINGLE) {
$hash = '{';
$vars = get_object_vars($object);
if (count($vars) > 0) {
foreach ($vars as $key =>$value) {
$hash .= sprintf('"%s": %s,', $key, self::convertValue($value,$quote)); // json encode kanns au... | [
"public",
"static",
"function",
"convertHashMap",
"(",
"\\",
"stdClass",
"$",
"object",
",",
"$",
"quote",
"=",
"self",
"::",
"QUOTE_SINGLE",
")",
"{",
"$",
"hash",
"=",
"'{'",
";",
"$",
"vars",
"=",
"get_object_vars",
"(",
"$",
"object",
")",
";",
"if... | Wandelt ein Object in ein Javascript Object-Literal um
@return string | [
"Wandelt",
"ein",
"Object",
"in",
"ein",
"Javascript",
"Object",
"-",
"Literal",
"um"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/JS/Helper.php#L91-L104 |
webforge-labs/psc-cms | lib/Psc/JS/Helper.php | Helper.requireLoad | public static function requireLoad(Array $requirements, Array $alias, $jsCode) {
return sprintf(
"requireLoad([%s], function (main%s) { // main is unshifted automatically\n %s\n});",
self::buildRequirements($requirements),
count($alias) > 0 ? ', '.implode(', ', $alias) : '',
self::convertJS... | php | public static function requireLoad(Array $requirements, Array $alias, $jsCode) {
return sprintf(
"requireLoad([%s], function (main%s) { // main is unshifted automatically\n %s\n});",
self::buildRequirements($requirements),
count($alias) > 0 ? ', '.implode(', ', $alias) : '',
self::convertJS... | [
"public",
"static",
"function",
"requireLoad",
"(",
"Array",
"$",
"requirements",
",",
"Array",
"$",
"alias",
",",
"$",
"jsCode",
")",
"{",
"return",
"sprintf",
"(",
"\"requireLoad([%s], function (main%s) { // main is unshifted automatically\\n %s\\n});\"",
",",
"self",
... | This function loads inline script in blocking mode
the application has to inject window.requireLoad
this is a blocking way to load, because there is the requireLoad() function which is directly called,
which concatenates the job to the boot.getLoader() the jobs can then be loaded with boot.getLoader().finished() | [
"This",
"function",
"loads",
"inline",
"script",
"in",
"blocking",
"mode"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/JS/Helper.php#L157-L164 |
webforge-labs/psc-cms | lib/Psc/JS/Helper.php | Helper.bootLoad | public static function bootLoad(Array $requirements, $alias = array(), $jsCode) {
return self::requirejs('boot', 'boot', sprintf(
"boot.getLoader().onRequire([%s], function (%s) {\n %s\n });",
self::buildRequirements($requirements),
implode(', ', $alias),
self::convertJSCode($jsCode)
... | php | public static function bootLoad(Array $requirements, $alias = array(), $jsCode) {
return self::requirejs('boot', 'boot', sprintf(
"boot.getLoader().onRequire([%s], function (%s) {\n %s\n });",
self::buildRequirements($requirements),
implode(', ', $alias),
self::convertJSCode($jsCode)
... | [
"public",
"static",
"function",
"bootLoad",
"(",
"Array",
"$",
"requirements",
",",
"$",
"alias",
"=",
"array",
"(",
")",
",",
"$",
"jsCode",
")",
"{",
"return",
"self",
"::",
"requirejs",
"(",
"'boot'",
",",
"'boot'",
",",
"sprintf",
"(",
"\"boot.getLoa... | This function loads inline script in an HTML-page
this is NON blocking way to load, because there the require is nested here
use it in inline scripts which are directly loaded from the HTML on the index page (and only there)
boot is required
boot should have .getLoader() to attach the requirements and loading callbac... | [
"This",
"function",
"loads",
"inline",
"script",
"in",
"an",
"HTML",
"-",
"page"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/JS/Helper.php#L176-L183 |
Chill-project/Main | Form/Type/AppendScopeChoiceTypeTrait.php | AppendScopeChoiceTypeTrait.appendScopeChoices | protected function appendScopeChoices(FormBuilderInterface $builder,
Role $role, Center $center, User $user,
AuthorizationHelper $authorizationHelper,
TranslatableStringHelper $translatableStringHelper,
ObjectManager $om, $name = 'scope')
{
$reachableScopes ... | php | protected function appendScopeChoices(FormBuilderInterface $builder,
Role $role, Center $center, User $user,
AuthorizationHelper $authorizationHelper,
TranslatableStringHelper $translatableStringHelper,
ObjectManager $om, $name = 'scope')
{
$reachableScopes ... | [
"protected",
"function",
"appendScopeChoices",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"Role",
"$",
"role",
",",
"Center",
"$",
"center",
",",
"User",
"$",
"user",
",",
"AuthorizationHelper",
"$",
"authorizationHelper",
",",
"TranslatableStringHelper",
"$"... | Append a scope choice field, with the scopes reachable by given
user for the given role and center.
The field is added on event FormEvents::PRE_SET_DATA
@param FormBuilderInterface $builder
@param Role $role
@param Center $center
@param User $user
@param AuthorizationHelper $authorizationHelper
@param TranslatableStr... | [
"Append",
"a",
"scope",
"choice",
"field",
"with",
"the",
"scopes",
"reachable",
"by",
"given",
"user",
"for",
"the",
"given",
"role",
"and",
"center",
"."
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Form/Type/AppendScopeChoiceTypeTrait.php#L100-L131 |
rayrutjes/domain-foundation | src/Contract/Contract.php | Contract.createFromObject | public static function createFromObject($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Object was expected.');
}
$className = get_class($object);
return new self($className);
} | php | public static function createFromObject($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Object was expected.');
}
$className = get_class($object);
return new self($className);
} | [
"public",
"static",
"function",
"createFromObject",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Object was expected.'",
")",
";",
"}",
"$",
"className"... | @param object $object
@return Contract | [
"@param",
"object",
"$object"
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Contract/Contract.php#L39-L48 |
shrink0r/workflux | src/Error/CorruptExecutionFlow.php | CorruptExecutionFlow.fromExecutionTracker | public static function fromExecutionTracker(ExecutionTracker $execution_tracker, int $max_cycles): self
{
$cycle_crumbs = $execution_tracker->detectExecutionLoop();
$message = sprintf("Trying to execute more than the allowed number of %d workflow steps.\n", $max_cycles);
if (count($cycle_cru... | php | public static function fromExecutionTracker(ExecutionTracker $execution_tracker, int $max_cycles): self
{
$cycle_crumbs = $execution_tracker->detectExecutionLoop();
$message = sprintf("Trying to execute more than the allowed number of %d workflow steps.\n", $max_cycles);
if (count($cycle_cru... | [
"public",
"static",
"function",
"fromExecutionTracker",
"(",
"ExecutionTracker",
"$",
"execution_tracker",
",",
"int",
"$",
"max_cycles",
")",
":",
"self",
"{",
"$",
"cycle_crumbs",
"=",
"$",
"execution_tracker",
"->",
"detectExecutionLoop",
"(",
")",
";",
"$",
... | @param ExecutionTracker $execution_tracker
@param int $max_cycles
@return self | [
"@param",
"ExecutionTracker",
"$execution_tracker",
"@param",
"int",
"$max_cycles"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Error/CorruptExecutionFlow.php#L17-L29 |
laraning/surveyor | src/Traits/UsesProfiles.php | UsesProfiles.hasProfile | public function hasProfile($profiles) : bool
{
$profiles = (array) $profiles;
return count(array_intersect($this->profiles->pluck('code')->toArray(), $profiles)) > 0;
} | php | public function hasProfile($profiles) : bool
{
$profiles = (array) $profiles;
return count(array_intersect($this->profiles->pluck('code')->toArray(), $profiles)) > 0;
} | [
"public",
"function",
"hasProfile",
"(",
"$",
"profiles",
")",
":",
"bool",
"{",
"$",
"profiles",
"=",
"(",
"array",
")",
"$",
"profiles",
";",
"return",
"count",
"(",
"array_intersect",
"(",
"$",
"this",
"->",
"profiles",
"->",
"pluck",
"(",
"'code'",
... | Matches at least one user profile.
@param array $profiles The user profile string array.
@return bool True in case it finds at least one. | [
"Matches",
"at",
"least",
"one",
"user",
"profile",
"."
] | train | https://github.com/laraning/surveyor/blob/d845b74d20f9a4a307991019502c1b14b1730e86/src/Traits/UsesProfiles.php#L23-L28 |
laraning/surveyor | src/Traits/UsesProfiles.php | UsesProfiles.hasAllProfiles | public function hasAllProfiles($profiles) : bool
{
$profiles = (array) $profiles;
return count(array_intersect($this->profiles->pluck('code')->toArray(), $profiles)) == count($profiles);
} | php | public function hasAllProfiles($profiles) : bool
{
$profiles = (array) $profiles;
return count(array_intersect($this->profiles->pluck('code')->toArray(), $profiles)) == count($profiles);
} | [
"public",
"function",
"hasAllProfiles",
"(",
"$",
"profiles",
")",
":",
"bool",
"{",
"$",
"profiles",
"=",
"(",
"array",
")",
"$",
"profiles",
";",
"return",
"count",
"(",
"array_intersect",
"(",
"$",
"this",
"->",
"profiles",
"->",
"pluck",
"(",
"'code'... | Matches ALL user profiles.
@param array $profiles The user profile string array.
@return bool True in case it finds ALL of them. | [
"Matches",
"ALL",
"user",
"profiles",
"."
] | train | https://github.com/laraning/surveyor/blob/d845b74d20f9a4a307991019502c1b14b1730e86/src/Traits/UsesProfiles.php#L37-L42 |
laraning/surveyor | src/Traits/UsesProfiles.php | UsesProfiles.assignProfiles | public function assignProfiles($profiles) : void
{
$profiles = (array) $profiles;
foreach ($profiles as $profile) {
$electedProfile = Profile::where('code', $profile)->first();
// Profile exists and not assigned to user?
if (!is_null($electedProfile) && !$this->h... | php | public function assignProfiles($profiles) : void
{
$profiles = (array) $profiles;
foreach ($profiles as $profile) {
$electedProfile = Profile::where('code', $profile)->first();
// Profile exists and not assigned to user?
if (!is_null($electedProfile) && !$this->h... | [
"public",
"function",
"assignProfiles",
"(",
"$",
"profiles",
")",
":",
"void",
"{",
"$",
"profiles",
"=",
"(",
"array",
")",
"$",
"profiles",
";",
"foreach",
"(",
"$",
"profiles",
"as",
"$",
"profile",
")",
"{",
"$",
"electedProfile",
"=",
"Profile",
... | Assigns profiles to the current model.
@param string|array $profiles The profile name(s) from the profiles table.
@return void | [
"Assigns",
"profiles",
"to",
"the",
"current",
"model",
"."
] | train | https://github.com/laraning/surveyor/blob/d845b74d20f9a4a307991019502c1b14b1730e86/src/Traits/UsesProfiles.php#L51-L68 |
RobinDumontChaponet/TransitiveCore | src/simple/Front.php | Front.getContent | public function getContent(string $contentType = null): string
{
/*
if(null == $contentType)
$contentType = $this->contentType;
*/
switch($contentType) {
case 'application/vnd.transitive.document+json':
return $this->route->getDocument();
break;
... | php | public function getContent(string $contentType = null): string
{
/*
if(null == $contentType)
$contentType = $this->contentType;
*/
switch($contentType) {
case 'application/vnd.transitive.document+json':
return $this->route->getDocument();
break;
... | [
"public",
"function",
"getContent",
"(",
"string",
"$",
"contentType",
"=",
"null",
")",
":",
"string",
"{",
"/*\n if(null == $contentType)\n $contentType = $this->contentType;\n*/",
"switch",
"(",
"$",
"contentType",
")",
"{",
"case",
"'application/vnd.tr... | Return processed content from current route.
@return string
@param string $contentType = null | [
"Return",
"processed",
"content",
"from",
"current",
"route",
"."
] | train | https://github.com/RobinDumontChaponet/TransitiveCore/blob/b83dd6fe0e49b8773de0f60861e5a5c306e2a38d/src/simple/Front.php#L182-L249 |
alphayax/phpdoc_md | src/models/ClassMd.php | ClassMd.computeType | protected function computeType(){
if( interface_exists( $this->class, false)){
$this->type = 'Interface';
return;
}
if( trait_exists( $this->class, false)){
$this->type = 'Trait';
return;
}
$this->type = 'Class';
} | php | protected function computeType(){
if( interface_exists( $this->class, false)){
$this->type = 'Interface';
return;
}
if( trait_exists( $this->class, false)){
$this->type = 'Trait';
return;
}
$this->type = 'Class';
} | [
"protected",
"function",
"computeType",
"(",
")",
"{",
"if",
"(",
"interface_exists",
"(",
"$",
"this",
"->",
"class",
",",
"false",
")",
")",
"{",
"$",
"this",
"->",
"type",
"=",
"'Interface'",
";",
"return",
";",
"}",
"if",
"(",
"trait_exists",
"(",
... | Determine the type of class | [
"Determine",
"the",
"type",
"of",
"class"
] | train | https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/ClassMd.php#L53-L63 |
alphayax/phpdoc_md | src/models/ClassMd.php | ClassMd.getNextComponent | public function getNextComponent( $namespace) {
$namespaceComponents = explode( '\\', $namespace);
$class_x = explode( '\\', $this->class);
while( array_shift( $namespaceComponents)){
array_shift( $class_x);
}
return array_shift( $class_x);
} | php | public function getNextComponent( $namespace) {
$namespaceComponents = explode( '\\', $namespace);
$class_x = explode( '\\', $this->class);
while( array_shift( $namespaceComponents)){
array_shift( $class_x);
}
return array_shift( $class_x);
} | [
"public",
"function",
"getNextComponent",
"(",
"$",
"namespace",
")",
"{",
"$",
"namespaceComponents",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"namespace",
")",
";",
"$",
"class_x",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"this",
"->",
"class",
")",
";... | Get the next namespace component (according the NS given)
@param string $namespace
@return string | [
"Get",
"the",
"next",
"namespace",
"component",
"(",
"according",
"the",
"NS",
"given",
")"
] | train | https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/ClassMd.php#L70-L79 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php | BaseApiLogPeer.getFieldNames | public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, ApiLogPeer::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, Bas... | php | public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, ApiLogPeer::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, Bas... | [
"public",
"static",
"function",
"getFieldNames",
"(",
"$",
"type",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"type",
",",
"ApiLogPeer",
"::",
"$",
"fieldNames",
")",
")",
"{",
"throw",
"new",
"PropelExce... | Returns an array of field names.
@param string $type The type of fieldnames to return:
One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
@return array A list of field names
@throws PropelException - i... | [
"Returns",
"an",
"array",
"of",
"field",
"names",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php#L128-L135 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php | BaseApiLogPeer.addSelectColumns | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(ApiLogPeer::ID);
$criteria->addSelectColumn(ApiLogPeer::DT_CALL);
$criteria->addSelectColumn(ApiLogPeer::REMOTE_APP_ID);
$criteria->a... | php | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(ApiLogPeer::ID);
$criteria->addSelectColumn(ApiLogPeer::DT_CALL);
$criteria->addSelectColumn(ApiLogPeer::REMOTE_APP_ID);
$criteria->a... | [
"public",
"static",
"function",
"addSelectColumns",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"alias",
")",
"{",
"$",
"criteria",
"->",
"addSelectColumn",
"(",
"ApiLogPeer",
"::",
"ID",
")"... | Add all the columns needed to create a new object.
Note: any columns that were marked with lazyLoad="true" in the
XML schema will not be added to the select list and only loaded
on demand.
@param Criteria $criteria object containing the columns to add.
@param string $alias optional table alias
@throws ... | [
"Add",
"all",
"the",
"columns",
"needed",
"to",
"create",
"a",
"new",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php#L166-L181 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php | BaseApiLogPeer.doSelectOne | public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = ApiLogPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
} | php | public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = ApiLogPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
} | [
"public",
"static",
"function",
"doSelectOne",
"(",
"Criteria",
"$",
"criteria",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"critcopy",
"=",
"clone",
"$",
"criteria",
";",
"$",
"critcopy",
"->",
"setLimit",
"(",
"1",
")",
";",
"$",
"obje... | Selects one object from the DB.
@param Criteria $criteria object used to create the SELECT statement.
@param PropelPDO $con
@return ApiLog
@throws PropelException Any exceptions caught during processing will be
rethrown wrapped into a PropelException. | [
"Selects",
"one",
"object",
"from",
"the",
"DB",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php#L236-L246 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php | BaseApiLogPeer.doSelect | public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
return ApiLogPeer::populateObjects(ApiLogPeer::doSelectStmt($criteria, $con));
} | php | public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
return ApiLogPeer::populateObjects(ApiLogPeer::doSelectStmt($criteria, $con));
} | [
"public",
"static",
"function",
"doSelect",
"(",
"Criteria",
"$",
"criteria",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"return",
"ApiLogPeer",
"::",
"populateObjects",
"(",
"ApiLogPeer",
"::",
"doSelectStmt",
"(",
"$",
"criteria",
",",
"$",
"con"... | Selects several row from the DB.
@param Criteria $criteria The Criteria object used to build the SELECT statement.
@param PropelPDO $con
@return array Array of selected Objects
@throws PropelException Any exceptions caught during processing will be
rethrown wrapped into a PropelException. | [
"Selects",
"several",
"row",
"from",
"the",
"DB",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php#L256-L259 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php | BaseApiLogPeer.getInstanceFromPool | public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(ApiLogPeer::$instances[$key])) {
return ApiLogPeer::$instances[$key];
}
}
return null; // just to be explicit
} | php | public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(ApiLogPeer::$instances[$key])) {
return ApiLogPeer::$instances[$key];
}
}
return null; // just to be explicit
} | [
"public",
"static",
"function",
"getInstanceFromPool",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"Propel",
"::",
"isInstancePoolingEnabled",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"ApiLogPeer",
"::",
"$",
"instances",
"[",
"$",
"key",
"]",
")",
")",
... | Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
For tables with a single-column primary key, that simple pkey value will be returned. For tables with
a multi-column primary key, a serialize()d version of the primary key will be returne... | [
"Retrieves",
"a",
"string",
"version",
"of",
"the",
"primary",
"key",
"from",
"the",
"DB",
"resultset",
"row",
"that",
"can",
"be",
"used",
"to",
"uniquely",
"identify",
"a",
"row",
"in",
"this",
"table",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php#L352-L361 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php | BaseApiLogPeer.buildTableMap | public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseApiLogPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseApiLogPeer::TABLE_NAME)) {
$dbMap->addTableObject(new \Slashworks\AppBundle\Model\map\ApiLogTableMap());
}
} | php | public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseApiLogPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseApiLogPeer::TABLE_NAME)) {
$dbMap->addTableObject(new \Slashworks\AppBundle\Model\map\ApiLogTableMap());
}
} | [
"public",
"static",
"function",
"buildTableMap",
"(",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getDatabaseMap",
"(",
"BaseApiLogPeer",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"!",
"$",
"dbMap",
"->",
"hasTable",
"(",
"BaseApiLogPeer",
"::",
"TABLE_N... | Add a TableMap instance to the database for this peer class. | [
"Add",
"a",
"TableMap",
"instance",
"to",
"the",
"database",
"for",
"this",
"peer",
"class",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogPeer.php#L733-L739 |
aedart/laravel-helpers | src/Traits/Auth/PasswordTrait.php | PasswordTrait.getPassword | public function getPassword(): ?PasswordBroker
{
if (!$this->hasPassword()) {
$this->setPassword($this->getDefaultPassword());
}
return $this->password;
} | php | public function getPassword(): ?PasswordBroker
{
if (!$this->hasPassword()) {
$this->setPassword($this->getDefaultPassword());
}
return $this->password;
} | [
"public",
"function",
"getPassword",
"(",
")",
":",
"?",
"PasswordBroker",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPassword",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setPassword",
"(",
"$",
"this",
"->",
"getDefaultPassword",
"(",
")",
")",
";",
... | Get password
If no password has been set, this method will
set and return a default password, if any such
value is available
@see getDefaultPassword()
@return PasswordBroker|null password or null if none password has been set | [
"Get",
"password"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Auth/PasswordTrait.php#L53-L59 |
aedart/laravel-helpers | src/Traits/Auth/PasswordTrait.php | PasswordTrait.getDefaultPassword | public function getDefaultPassword(): ?PasswordBroker
{
// By default, the Password Facade does not return the
// any actual password broker, but rather an
// instance of \Illuminate\Auth\Passwords\PasswordBrokerManager.
// Therefore, we make sure only to obtain its
// "defau... | php | public function getDefaultPassword(): ?PasswordBroker
{
// By default, the Password Facade does not return the
// any actual password broker, but rather an
// instance of \Illuminate\Auth\Passwords\PasswordBrokerManager.
// Therefore, we make sure only to obtain its
// "defau... | [
"public",
"function",
"getDefaultPassword",
"(",
")",
":",
"?",
"PasswordBroker",
"{",
"// By default, the Password Facade does not return the",
"// any actual password broker, but rather an",
"// instance of \\Illuminate\\Auth\\Passwords\\PasswordBrokerManager.",
"// Therefore, we make sure... | Get a default password value, if any is available
@return PasswordBroker|null A default password value or Null if no default value is available | [
"Get",
"a",
"default",
"password",
"value",
"if",
"any",
"is",
"available"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Auth/PasswordTrait.php#L76-L89 |
webforge-labs/psc-cms | lib/Psc/UI/FormInputSet.php | FormInputSet.setStyle | public function setStyle($style,$value) {
if ($this->morphed) {
throw new Exception('setStyle() vor dem morphen aufrufen!');
}
$this->styles[$style] = $value;
return $this;
} | php | public function setStyle($style,$value) {
if ($this->morphed) {
throw new Exception('setStyle() vor dem morphen aufrufen!');
}
$this->styles[$style] = $value;
return $this;
} | [
"public",
"function",
"setStyle",
"(",
"$",
"style",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"morphed",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'setStyle() vor dem morphen aufrufen!'",
")",
";",
"}",
"$",
"this",
"->",
"styles",
"... | Setzt einen HTML-Style für alle Elemente | [
"Setzt",
"einen",
"HTML",
"-",
"Style",
"für",
"alle",
"Elemente"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/FormInputSet.php#L66-L72 |
webforge-labs/psc-cms | lib/Psc/UI/FormInputSet.php | FormInputSet.html | public function html() {
if (!$this->isMorphed())
$this->morph();
$html = NULL;
foreach ($this->elements as $el) {
$html .= $el->html()."\n";
}
return $html;
} | php | public function html() {
if (!$this->isMorphed())
$this->morph();
$html = NULL;
foreach ($this->elements as $el) {
$html .= $el->html()."\n";
}
return $html;
} | [
"public",
"function",
"html",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isMorphed",
"(",
")",
")",
"$",
"this",
"->",
"morph",
"(",
")",
";",
"$",
"html",
"=",
"NULL",
";",
"foreach",
"(",
"$",
"this",
"->",
"elements",
"as",
"$",
"el"... | Wenn noch nicht gemorphed, wird das getan | [
"Wenn",
"noch",
"nicht",
"gemorphed",
"wird",
"das",
"getan"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/FormInputSet.php#L77-L87 |
webtown-php/KunstmaanExtensionBundle | src/Translation/Extraction/File/OriginalTranslationsYmlExtractor.php | OriginalTranslationsYmlExtractor.visitFile | public function visitFile(\SplFileInfo $file, MessageCatalogue $catalogue)
{
if ('.yml' !== substr($file, -4)) {
return;
}
if ($this->skipThisLocale($file, $catalogue->getLocale())) {
return;
}
$domain = substr($file->getFilename(), 0, -7);
$... | php | public function visitFile(\SplFileInfo $file, MessageCatalogue $catalogue)
{
if ('.yml' !== substr($file, -4)) {
return;
}
if ($this->skipThisLocale($file, $catalogue->getLocale())) {
return;
}
$domain = substr($file->getFilename(), 0, -7);
$... | [
"public",
"function",
"visitFile",
"(",
"\\",
"SplFileInfo",
"$",
"file",
",",
"MessageCatalogue",
"$",
"catalogue",
")",
"{",
"if",
"(",
"'.yml'",
"!==",
"substr",
"(",
"$",
"file",
",",
"-",
"4",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
... | Called for non-specially handled files.
This is not called if handled by a more specific method.
@param \SplFileInfo $file
@param MessageCatalogue $catalogue | [
"Called",
"for",
"non",
"-",
"specially",
"handled",
"files",
"."
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Translation/Extraction/File/OriginalTranslationsYmlExtractor.php#L50-L79 |
webtown-php/KunstmaanExtensionBundle | src/Translation/Extraction/File/OriginalTranslationsYmlExtractor.php | OriginalTranslationsYmlExtractor.getFilePieces | protected function getFilePieces(\SplFileInfo $file)
{
$key = $file->getBasename();
if (!array_key_exists($key, $this->filePieces)) {
$pieces = explode('.', $file->getBasename());
if (count($pieces) < 3) {
return true;
}
$extension = ar... | php | protected function getFilePieces(\SplFileInfo $file)
{
$key = $file->getBasename();
if (!array_key_exists($key, $this->filePieces)) {
$pieces = explode('.', $file->getBasename());
if (count($pieces) < 3) {
return true;
}
$extension = ar... | [
"protected",
"function",
"getFilePieces",
"(",
"\\",
"SplFileInfo",
"$",
"file",
")",
"{",
"$",
"key",
"=",
"$",
"file",
"->",
"getBasename",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"filePieces",
")",... | @param \SplFileInfo $file
@return array | [
"@param",
"\\",
"SplFileInfo",
"$file"
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Translation/Extraction/File/OriginalTranslationsYmlExtractor.php#L117-L137 |
yuncms/framework | src/rest/models/NicknameForm.php | NicknameForm.save | public function save()
{
if ($this->validate() && (bool)$this->getUser()->updateAttributes(['nickname' => $this->nickname])) {
return $this->getUser();
}
return false;
} | php | public function save()
{
if ($this->validate() && (bool)$this->getUser()->updateAttributes(['nickname' => $this->nickname])) {
return $this->getUser();
}
return false;
} | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
"&&",
"(",
"bool",
")",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"updateAttributes",
"(",
"[",
"'nickname'",
"=>",
"$",
"this",
"->",
"nickname",
... | 保存昵称
@return boolean | [
"保存昵称"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/models/NicknameForm.php#L47-L53 |
factorio-item-browser/export-data | src/Registry/ModRegistry.php | ModRegistry.set | public function set(Mod $mod): void
{
$this->loadMods();
$this->mods[$mod->getName()] = $mod;
} | php | public function set(Mod $mod): void
{
$this->loadMods();
$this->mods[$mod->getName()] = $mod;
} | [
"public",
"function",
"set",
"(",
"Mod",
"$",
"mod",
")",
":",
"void",
"{",
"$",
"this",
"->",
"loadMods",
"(",
")",
";",
"$",
"this",
"->",
"mods",
"[",
"$",
"mod",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"mod",
";",
"}"
] | Sets a mod into the registry.
@param Mod $mod | [
"Sets",
"a",
"mod",
"into",
"the",
"registry",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/ModRegistry.php#L54-L58 |
factorio-item-browser/export-data | src/Registry/ModRegistry.php | ModRegistry.get | public function get(string $modName): ?Mod
{
$this->loadMods();
return $this->mods[$modName] ?? null;
} | php | public function get(string $modName): ?Mod
{
$this->loadMods();
return $this->mods[$modName] ?? null;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"modName",
")",
":",
"?",
"Mod",
"{",
"$",
"this",
"->",
"loadMods",
"(",
")",
";",
"return",
"$",
"this",
"->",
"mods",
"[",
"$",
"modName",
"]",
"??",
"null",
";",
"}"
] | Returns a mod from the registry.
@param string $modName
@return Mod|null | [
"Returns",
"a",
"mod",
"from",
"the",
"registry",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/ModRegistry.php#L65-L69 |
factorio-item-browser/export-data | src/Registry/ModRegistry.php | ModRegistry.saveMods | public function saveMods(): void
{
$mods = [];
foreach ($this->mods as $mod) {
$mods[] = $mod->writeData();
}
$this->saveContent(self::HASH_FILE_MODS, $this->encodeContent($mods));
} | php | public function saveMods(): void
{
$mods = [];
foreach ($this->mods as $mod) {
$mods[] = $mod->writeData();
}
$this->saveContent(self::HASH_FILE_MODS, $this->encodeContent($mods));
} | [
"public",
"function",
"saveMods",
"(",
")",
":",
"void",
"{",
"$",
"mods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"mods",
"as",
"$",
"mod",
")",
"{",
"$",
"mods",
"[",
"]",
"=",
"$",
"mod",
"->",
"writeData",
"(",
")",
";",
"}... | Saves the currently known mod to the adapter. | [
"Saves",
"the",
"currently",
"known",
"mod",
"to",
"the",
"adapter",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/ModRegistry.php#L84-L91 |
factorio-item-browser/export-data | src/Registry/ModRegistry.php | ModRegistry.loadMods | protected function loadMods(): void
{
if (!$this->isLoaded) {
$this->mods = [];
foreach ($this->decodeContent((string) $this->loadContent(self::HASH_FILE_MODS)) as $modData) {
if (is_array($modData)) {
$mod = new Mod();
$mod->re... | php | protected function loadMods(): void
{
if (!$this->isLoaded) {
$this->mods = [];
foreach ($this->decodeContent((string) $this->loadContent(self::HASH_FILE_MODS)) as $modData) {
if (is_array($modData)) {
$mod = new Mod();
$mod->re... | [
"protected",
"function",
"loadMods",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLoaded",
")",
"{",
"$",
"this",
"->",
"mods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"decodeContent",
"(",
"(",
"string",
")",
... | Loads the mods from the file. | [
"Loads",
"the",
"mods",
"from",
"the",
"file",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/ModRegistry.php#L96-L109 |
webforge-labs/psc-cms | lib/Psc/UI/Accordion.php | Accordion.appendSection | public function appendSection($index, $snippet) {
$index = $index*2+1;
$this->html->content[$index]->content[] = $snippet;
//throw new \Psc\Exception('weiss nicht wie ich an '.Code::varInfo($this->html->content[$index]).' appenden soll');
return $this;
} | php | public function appendSection($index, $snippet) {
$index = $index*2+1;
$this->html->content[$index]->content[] = $snippet;
//throw new \Psc\Exception('weiss nicht wie ich an '.Code::varInfo($this->html->content[$index]).' appenden soll');
return $this;
} | [
"public",
"function",
"appendSection",
"(",
"$",
"index",
",",
"$",
"snippet",
")",
"{",
"$",
"index",
"=",
"$",
"index",
"*",
"2",
"+",
"1",
";",
"$",
"this",
"->",
"html",
"->",
"content",
"[",
"$",
"index",
"]",
"->",
"content",
"[",
"]",
"=",... | Fügt Inhalt einer Section hinzu | [
"Fügt",
"Inhalt",
"einer",
"Section",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/Accordion.php#L122-L128 |
fubhy/graphql-php | src/GraphQL.php | GraphQL.execute | public static function execute(Schema $schema, $request, $root = NULL, $variables = NULL, $operation = NULL)
{
try {
$source = new Source($request ?: '', 'GraphQL request');
$parser = new Parser();
$ast = $parser->parse($source);
return Executor::execute($sch... | php | public static function execute(Schema $schema, $request, $root = NULL, $variables = NULL, $operation = NULL)
{
try {
$source = new Source($request ?: '', 'GraphQL request');
$parser = new Parser();
$ast = $parser->parse($source);
return Executor::execute($sch... | [
"public",
"static",
"function",
"execute",
"(",
"Schema",
"$",
"schema",
",",
"$",
"request",
",",
"$",
"root",
"=",
"NULL",
",",
"$",
"variables",
"=",
"NULL",
",",
"$",
"operation",
"=",
"NULL",
")",
"{",
"try",
"{",
"$",
"source",
"=",
"new",
"S... | @param Schema $schema
@param $request
@param mixed $root
@param array|null $variables
@param string|null $operation
@return array | [
"@param",
"Schema",
"$schema",
"@param",
"$request",
"@param",
"mixed",
"$root",
"@param",
"array|null",
"$variables",
"@param",
"string|null",
"$operation"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/GraphQL.php#L20-L31 |
webforge-labs/psc-cms | lib/Psc/Code/Numbers.php | Numbers.toRoman | public static function toRoman($num) {
$conv = array(
10 => array('X', 'C', 'M'),
5 => array('V', 'L', 'D'),
1 => array('I', 'X', 'C'));
$roman = '';
if ($num < 0) {
return '';
}
$num = (int) $num;
... | php | public static function toRoman($num) {
$conv = array(
10 => array('X', 'C', 'M'),
5 => array('V', 'L', 'D'),
1 => array('I', 'X', 'C'));
$roman = '';
if ($num < 0) {
return '';
}
$num = (int) $num;
... | [
"public",
"static",
"function",
"toRoman",
"(",
"$",
"num",
")",
"{",
"$",
"conv",
"=",
"array",
"(",
"10",
"=>",
"array",
"(",
"'X'",
",",
"'C'",
",",
"'M'",
")",
",",
"5",
"=>",
"array",
"(",
"'V'",
",",
"'L'",
",",
"'D'",
")",
",",
"1",
"=... | Converts a number to its roman numeral representation
@param integer $num An integer between 0 and 3999
inclusive that should be converted
to a roman numeral integers higher than
3999 are supported from version 0.1.2
Note:
For an accurate result the integer shouldn't be higher
than 5 999 999. Higher integers ... | [
"Converts",
"a",
"number",
"to",
"its",
"roman",
"numeral",
"representation"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Numbers.php#L63-L103 |
drupalwxt/pco_cities | src/Composer/Package.php | Package.execute | public static function execute(Event $event) {
$composer = $event->getComposer();
$encoder = new IniEncoder();
// Convert the lock file to a make file using Drush's make-convert command.
$bin_dir = $composer->getConfig()->get('bin-dir');
$make = NULL;
$executor = new ProcessExecutor();
$exe... | php | public static function execute(Event $event) {
$composer = $event->getComposer();
$encoder = new IniEncoder();
// Convert the lock file to a make file using Drush's make-convert command.
$bin_dir = $composer->getConfig()->get('bin-dir');
$make = NULL;
$executor = new ProcessExecutor();
$exe... | [
"public",
"static",
"function",
"execute",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"composer",
"=",
"$",
"event",
"->",
"getComposer",
"(",
")",
";",
"$",
"encoder",
"=",
"new",
"IniEncoder",
"(",
")",
";",
"// Convert the lock file to a make file using Dru... | Script entry point.
@param \Composer\Script\Event $event
The script event. | [
"Script",
"entry",
"point",
"."
] | train | https://github.com/drupalwxt/pco_cities/blob/589651ac4478ce629dd9ad9cf2e15ad1a9de368a/src/Composer/Package.php#L22-L87 |
afrittella/back-project | src/app/BackProjectServiceProvider.php | BackProjectServiceProvider.publishFiles | public function publishFiles()
{
// publish config file
$this->publishes([__DIR__ . '/../config/config.php' => config_path() . '/back-project.php'], 'config');
// publish lang files
$this->publishes([__DIR__ . '/../resources/lang' => resource_path('lang/vendor/back-project')], 'lang'... | php | public function publishFiles()
{
// publish config file
$this->publishes([__DIR__ . '/../config/config.php' => config_path() . '/back-project.php'], 'config');
// publish lang files
$this->publishes([__DIR__ . '/../resources/lang' => resource_path('lang/vendor/back-project')], 'lang'... | [
"public",
"function",
"publishFiles",
"(",
")",
"{",
"// publish config file",
"$",
"this",
"->",
"publishes",
"(",
"[",
"__DIR__",
".",
"'/../config/config.php'",
"=>",
"config_path",
"(",
")",
".",
"'/back-project.php'",
"]",
",",
"'config'",
")",
";",
"// pub... | * Internal function ** | [
"*",
"Internal",
"function",
"**"
] | train | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/BackProjectServiceProvider.php#L105-L121 |
tompedals/helpscout-dynamic-app | src/AppRequestFactory.php | AppRequestFactory.create | public function create(ServerRequestInterface $request)
{
$body = (string) $request->getBody();
$data = $this->decodeJsonBody($body);
$this->verifySignature($body, $request->getHeaderLine(self::SIGNATURE_HEADER));
return new AppRequest(
Customer::create(isset($data['cust... | php | public function create(ServerRequestInterface $request)
{
$body = (string) $request->getBody();
$data = $this->decodeJsonBody($body);
$this->verifySignature($body, $request->getHeaderLine(self::SIGNATURE_HEADER));
return new AppRequest(
Customer::create(isset($data['cust... | [
"public",
"function",
"create",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"body",
"=",
"(",
"string",
")",
"$",
"request",
"->",
"getBody",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"decodeJsonBody",
"(",
"$",
"body",
")",... | @param ServerRequestInterface $request
@return AppRequest | [
"@param",
"ServerRequestInterface",
"$request"
] | train | https://github.com/tompedals/helpscout-dynamic-app/blob/450d660db402a6aced0f541b71b89a0fc44d303a/src/AppRequestFactory.php#L35-L47 |
tompedals/helpscout-dynamic-app | src/AppRequestFactory.php | AppRequestFactory.decodeJsonBody | private function decodeJsonBody($body)
{
$data = json_decode($body, true);
if ($data === null) {
throw new InvalidRequestException('The request JSON body could not be decoded');
}
return $data;
} | php | private function decodeJsonBody($body)
{
$data = json_decode($body, true);
if ($data === null) {
throw new InvalidRequestException('The request JSON body could not be decoded');
}
return $data;
} | [
"private",
"function",
"decodeJsonBody",
"(",
"$",
"body",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"body",
",",
"true",
")",
";",
"if",
"(",
"$",
"data",
"===",
"null",
")",
"{",
"throw",
"new",
"InvalidRequestException",
"(",
"'The request ... | @param string $body
@return array JSON decoded data
@throws InvalidRequestException | [
"@param",
"string",
"$body"
] | train | https://github.com/tompedals/helpscout-dynamic-app/blob/450d660db402a6aced0f541b71b89a0fc44d303a/src/AppRequestFactory.php#L56-L64 |
tompedals/helpscout-dynamic-app | src/AppRequestFactory.php | AppRequestFactory.verifySignature | private function verifySignature($body, $signature)
{
$expectedSignature = base64_encode(hash_hmac('sha1', $body, $this->secretKey, true));
if ($signature !== $expectedSignature) {
throw new InvalidSignatureException('The request signature was invalid');
}
} | php | private function verifySignature($body, $signature)
{
$expectedSignature = base64_encode(hash_hmac('sha1', $body, $this->secretKey, true));
if ($signature !== $expectedSignature) {
throw new InvalidSignatureException('The request signature was invalid');
}
} | [
"private",
"function",
"verifySignature",
"(",
"$",
"body",
",",
"$",
"signature",
")",
"{",
"$",
"expectedSignature",
"=",
"base64_encode",
"(",
"hash_hmac",
"(",
"'sha1'",
",",
"$",
"body",
",",
"$",
"this",
"->",
"secretKey",
",",
"true",
")",
")",
";... | @param string $body
@param string $signature
@throws InvalidSignatureException | [
"@param",
"string",
"$body",
"@param",
"string",
"$signature"
] | train | https://github.com/tompedals/helpscout-dynamic-app/blob/450d660db402a6aced0f541b71b89a0fc44d303a/src/AppRequestFactory.php#L72-L79 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.register | public function register()
{
// This is the initial activation, save the defaults to the db
if(!$this->options->exists())
{
$this->reset();
}
// Only preprocess if this is the currently viewed page
if( $this->page->get_slug() == filter_input(INPUT... | php | public function register()
{
// This is the initial activation, save the defaults to the db
if(!$this->options->exists())
{
$this->reset();
}
// Only preprocess if this is the currently viewed page
if( $this->page->get_slug() == filter_input(INPUT... | [
"public",
"function",
"register",
"(",
")",
"{",
"// This is the initial activation, save the defaults to the db",
"if",
"(",
"!",
"$",
"this",
"->",
"options",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"}",
"// Only prepro... | Register the options page. | [
"Register",
"the",
"options",
"page",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L85-L102 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.create_page | private function create_page()
{
$self = $this;
$page = new \Amarkal\Extensions\WordPress\Admin\AdminPage(array(
'title' => $this->config->sidebar_title,
'icon' => $this->config->sidebar_icon,
'class' => $this->config->sidebar_icon_class,
... | php | private function create_page()
{
$self = $this;
$page = new \Amarkal\Extensions\WordPress\Admin\AdminPage(array(
'title' => $this->config->sidebar_title,
'icon' => $this->config->sidebar_icon,
'class' => $this->config->sidebar_icon_class,
... | [
"private",
"function",
"create_page",
"(",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"$",
"page",
"=",
"new",
"\\",
"Amarkal",
"\\",
"Extensions",
"\\",
"WordPress",
"\\",
"Admin",
"\\",
"AdminPage",
"(",
"array",
"(",
"'title'",
"=>",
"$",
"this",... | Create a new AdminPage.
@return \Amarkal\Extensions\WordPress\Admin\AdminPage | [
"Create",
"a",
"new",
"AdminPage",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L109-L127 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.render | private function render()
{
$this->do_action('afw_options_pre_render');
$layout = new Layout\Layout( $this->config );
$layout->render(true);
add_filter('admin_footer_text', array( __CLASS__, 'footer_credits' ) );
$this->do_action('afw_options_post_render');
} | php | private function render()
{
$this->do_action('afw_options_pre_render');
$layout = new Layout\Layout( $this->config );
$layout->render(true);
add_filter('admin_footer_text', array( __CLASS__, 'footer_credits' ) );
$this->do_action('afw_options_post_render');
} | [
"private",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"do_action",
"(",
"'afw_options_pre_render'",
")",
";",
"$",
"layout",
"=",
"new",
"Layout",
"\\",
"Layout",
"(",
"$",
"this",
"->",
"config",
")",
";",
"$",
"layout",
"->",
"render",
"... | Internally used to render the page.
Called by AdminPage to generate the admin page's content. | [
"Internally",
"used",
"to",
"render",
"the",
"page",
".",
"Called",
"by",
"AdminPage",
"to",
"generate",
"the",
"admin",
"page",
"s",
"content",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L133-L140 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.preprocess | private function preprocess()
{
$this->do_action('afw_options_pre_process');
Notifier::reset();
State::set('errors', array());
$this->update();
$this->do_action('afw_options_post_process');
} | php | private function preprocess()
{
$this->do_action('afw_options_pre_process');
Notifier::reset();
State::set('errors', array());
$this->update();
$this->do_action('afw_options_post_process');
} | [
"private",
"function",
"preprocess",
"(",
")",
"{",
"$",
"this",
"->",
"do_action",
"(",
"'afw_options_pre_process'",
")",
";",
"Notifier",
"::",
"reset",
"(",
")",
";",
"State",
"::",
"set",
"(",
"'errors'",
",",
"array",
"(",
")",
")",
";",
"$",
"thi... | Internally used to update the options page's components. | [
"Internally",
"used",
"to",
"update",
"the",
"options",
"page",
"s",
"components",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L145-L152 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.update | private function update()
{
$errors = array();
switch( State::get('action') )
{
case 'save':
$errors = $this->save();
Notifier::success('Settings saved.');
break;
case 'reset-section':
$section = $this->c... | php | private function update()
{
$errors = array();
switch( State::get('action') )
{
case 'save':
$errors = $this->save();
Notifier::success('Settings saved.');
break;
case 'reset-section':
$section = $this->c... | [
"private",
"function",
"update",
"(",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"switch",
"(",
"State",
"::",
"get",
"(",
"'action'",
")",
")",
"{",
"case",
"'save'",
":",
"$",
"errors",
"=",
"$",
"this",
"->",
"save",
"(",
")",
";",
... | Save/reset/load component values. | [
"Save",
"/",
"reset",
"/",
"load",
"component",
"values",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L157-L181 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.set_errors | private function set_errors( $errors )
{
if( count( $errors ) == 0 )
{
return;
}
$errors_array = array();
foreach( $this->config->get_sections() as $section )
{
foreach( $section->get_fields() as $component )
{
... | php | private function set_errors( $errors )
{
if( count( $errors ) == 0 )
{
return;
}
$errors_array = array();
foreach( $this->config->get_sections() as $section )
{
foreach( $section->get_fields() as $component )
{
... | [
"private",
"function",
"set_errors",
"(",
"$",
"errors",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"errors",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"$",
"errors_array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
... | Set the state with the given errors.
@param array $errors | [
"Set",
"the",
"state",
"with",
"the",
"given",
"errors",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L188-L210 |
askupasoftware/amarkal | Extensions/WordPress/Options/OptionsPage.php | OptionsPage.set_global_variable | private function set_global_variable()
{
$var_name = "";
if( null != $this->config->global_variable )
{
$var_name = $this->config->global_variable;
}
else
{
$var_name = $this->page->get_slug().'_options';
}
$GL... | php | private function set_global_variable()
{
$var_name = "";
if( null != $this->config->global_variable )
{
$var_name = $this->config->global_variable;
}
else
{
$var_name = $this->page->get_slug().'_options';
}
$GL... | [
"private",
"function",
"set_global_variable",
"(",
")",
"{",
"$",
"var_name",
"=",
"\"\"",
";",
"if",
"(",
"null",
"!=",
"$",
"this",
"->",
"config",
"->",
"global_variable",
")",
"{",
"$",
"var_name",
"=",
"$",
"this",
"->",
"config",
"->",
"global_vari... | Set a global variable containing the option values to be used throughout
the program. | [
"Set",
"a",
"global",
"variable",
"containing",
"the",
"option",
"values",
"to",
"be",
"used",
"throughout",
"the",
"program",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Options/OptionsPage.php#L255-L269 |
titon/db | src/Titon/Db/Behavior/FilterBehavior.php | FilterBehavior.filter | public function filter($field, $filter, array $options = []) {
if (!in_array($filter, [self::HTML, self::NEWLINES, self::WHITESPACE, self::XSS])) {
throw new InvalidArgumentException(sprintf('Filter %s does not exist', $filter));
}
$this->_filters[$field][$filter] = $options;
... | php | public function filter($field, $filter, array $options = []) {
if (!in_array($filter, [self::HTML, self::NEWLINES, self::WHITESPACE, self::XSS])) {
throw new InvalidArgumentException(sprintf('Filter %s does not exist', $filter));
}
$this->_filters[$field][$filter] = $options;
... | [
"public",
"function",
"filter",
"(",
"$",
"field",
",",
"$",
"filter",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"filter",
",",
"[",
"self",
"::",
"HTML",
",",
"self",
"::",
"NEWLINES",
",",
"sel... | Define a filter for a specific field.
@param string $field
@param string $filter
@param array $options
@return $this
@throws \Titon\Db\Exception\InvalidArgumentException | [
"Define",
"a",
"filter",
"for",
"a",
"specific",
"field",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/FilterBehavior.php#L44-L52 |
titon/db | src/Titon/Db/Behavior/FilterBehavior.php | FilterBehavior.preSave | public function preSave(Event $event, Query $query, $id, array &$data) {
$filters = $this->getFilters();
foreach ($data as $key => $value) {
if (empty($filters[$key])) {
continue;
}
$filter = $filters[$key];
// HTML escape
if... | php | public function preSave(Event $event, Query $query, $id, array &$data) {
$filters = $this->getFilters();
foreach ($data as $key => $value) {
if (empty($filters[$key])) {
continue;
}
$filter = $filters[$key];
// HTML escape
if... | [
"public",
"function",
"preSave",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
",",
"array",
"&",
"$",
"data",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"getFilters",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"... | Run the filters before each save.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param int|int[] $id
@param array $data
@return bool | [
"Run",
"the",
"filters",
"before",
"each",
"save",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/FilterBehavior.php#L72-L106 |
tbreuss/pvc | src/Config.php | Config.get | public function get(string $name, $default = null)
{
$path = explode('.', $name);
$current = $this->data;
foreach ($path as $field) {
if (isset($current) && isset($current[$field])) {
$current = $current[$field];
} elseif (is_array($current) && isset($... | php | public function get(string $name, $default = null)
{
$path = explode('.', $name);
$current = $this->data;
foreach ($path as $field) {
if (isset($current) && isset($current[$field])) {
$current = $current[$field];
} elseif (is_array($current) && isset($... | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",
")",
";",
"$",
"current",
"=",
"$",
"this",
"->",
"data",
";",
"foreach",
"(",
"$",
... | Get value by using dot notation for nested arrays.
@example $value = $this->get('foo.bar.baz');
@param string $name
@param mixed $default
@return mixed | [
"Get",
"value",
"by",
"using",
"dot",
"notation",
"for",
"nested",
"arrays",
"."
] | train | https://github.com/tbreuss/pvc/blob/ae100351010a8c9f645ccb918f70a26e167de7a7/src/Config.php#L32-L46 |
arsengoian/viper-framework | src/Viper/Core/Routing/Router.php | Router.registerCustomRouteClass | public static function registerCustomRouteClass(string $routeKey, string $routeClass) {
self::checkRegisterAvailability();
if (!class_exists($routeClass))
throw new AppLogicException('Class '.$routeClass.' does not exist');
self::$customRouteClasses[$routeKey] = $routeClass;
} | php | public static function registerCustomRouteClass(string $routeKey, string $routeClass) {
self::checkRegisterAvailability();
if (!class_exists($routeClass))
throw new AppLogicException('Class '.$routeClass.' does not exist');
self::$customRouteClasses[$routeKey] = $routeClass;
} | [
"public",
"static",
"function",
"registerCustomRouteClass",
"(",
"string",
"$",
"routeKey",
",",
"string",
"$",
"routeClass",
")",
"{",
"self",
"::",
"checkRegisterAvailability",
"(",
")",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"routeClass",
")",
")",
... | Can't set custom actions. Only parsable from URL | [
"Can",
"t",
"set",
"custom",
"actions",
".",
"Only",
"parsable",
"from",
"URL"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Routing/Router.php#L59-L64 |
EvanDotPro/EdpGithub | src/EdpGithub/Http/Client.php | Client.request | public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array())
{
$client = $this->getHttpClient($path);
$request = $client->getRequest();
$client->setMethod($httpMethod);
$client->setHeaders($headers);
if ($httpMethod == 'GET') {
... | php | public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array())
{
$client = $this->getHttpClient($path);
$request = $client->getRequest();
$client->setMethod($httpMethod);
$client->setHeaders($headers);
if ($httpMethod == 'GET') {
... | [
"public",
"function",
"request",
"(",
"$",
"path",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"httpMethod",
"=",
"'GET'",
",",
"array",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",... | Send Request
@param string $path
@param array $parameters
@param string $httpMethod
@param array $headers
@return Http\Response | [
"Send",
"Request"
] | train | https://github.com/EvanDotPro/EdpGithub/blob/51f3e33e02edbef011103e3c2c1629d46af011a3/src/EdpGithub/Http/Client.php#L112-L143 |
EvanDotPro/EdpGithub | src/EdpGithub/Http/Client.php | Client.getHttpClient | public function getHttpClient($path)
{
$this->httpClient = new Http\Client();
$this->httpClient->setAdapter($this->getHttpAdapter());
$this->httpClient->setUri($this->options['base_url'] . $path);
return $this->httpClient;
} | php | public function getHttpClient($path)
{
$this->httpClient = new Http\Client();
$this->httpClient->setAdapter($this->getHttpAdapter());
$this->httpClient->setUri($this->options['base_url'] . $path);
return $this->httpClient;
} | [
"public",
"function",
"getHttpClient",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"httpClient",
"=",
"new",
"Http",
"\\",
"Client",
"(",
")",
";",
"$",
"this",
"->",
"httpClient",
"->",
"setAdapter",
"(",
"$",
"this",
"->",
"getHttpAdapter",
"(",
"... | Get Http Client
@param string $path
@return Http\Client | [
"Get",
"Http",
"Client"
] | train | https://github.com/EvanDotPro/EdpGithub/blob/51f3e33e02edbef011103e3c2c1629d46af011a3/src/EdpGithub/Http/Client.php#L151-L158 |
EvanDotPro/EdpGithub | src/EdpGithub/Http/Client.php | Client.getHttpAdapter | public function getHttpAdapter()
{
if (null === $this->httpAdapter) {
$this->httpAdapter = new Http\Client\Adapter\Curl();
$this->httpAdapter->setOptions(array(
'curloptions' => array(
CURLOPT_SSL_VERIFYPEER => false,
),
... | php | public function getHttpAdapter()
{
if (null === $this->httpAdapter) {
$this->httpAdapter = new Http\Client\Adapter\Curl();
$this->httpAdapter->setOptions(array(
'curloptions' => array(
CURLOPT_SSL_VERIFYPEER => false,
),
... | [
"public",
"function",
"getHttpAdapter",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"httpAdapter",
")",
"{",
"$",
"this",
"->",
"httpAdapter",
"=",
"new",
"Http",
"\\",
"Client",
"\\",
"Adapter",
"\\",
"Curl",
"(",
")",
";",
"$",
"thi... | Get Http Adapter
@return Http\Client\Adapter\Curl | [
"Get",
"Http",
"Adapter"
] | train | https://github.com/EvanDotPro/EdpGithub/blob/51f3e33e02edbef011103e3c2c1629d46af011a3/src/EdpGithub/Http/Client.php#L164-L176 |
dandisy/laravel-generator | src/Commands/Publish/GeneratorPublishCommand.php | GeneratorPublishCommand.fillTemplate | private function fillTemplate($templateData)
{
$apiVersion = config('webcore.laravel_generator.api_version', 'v1');
$apiPrefix = config('webcore.laravel_generator.api_prefix', 'api');
$templateData = str_replace('$API_VERSION$', $apiVersion, $templateData);
$templateData = str_repla... | php | private function fillTemplate($templateData)
{
$apiVersion = config('webcore.laravel_generator.api_version', 'v1');
$apiPrefix = config('webcore.laravel_generator.api_prefix', 'api');
$templateData = str_replace('$API_VERSION$', $apiVersion, $templateData);
$templateData = str_repla... | [
"private",
"function",
"fillTemplate",
"(",
"$",
"templateData",
")",
"{",
"$",
"apiVersion",
"=",
"config",
"(",
"'webcore.laravel_generator.api_version'",
",",
"'v1'",
")",
";",
"$",
"apiPrefix",
"=",
"config",
"(",
"'webcore.laravel_generator.api_prefix'",
",",
"... | Replaces dynamic variables of template.
@param string $templateData
@return string | [
"Replaces",
"dynamic",
"variables",
"of",
"template",
"."
] | train | https://github.com/dandisy/laravel-generator/blob/742797c8483bc88b54b6302a516a9a85eeb8579b/src/Commands/Publish/GeneratorPublishCommand.php#L41-L53 |
nodes-php/database | src/Exceptions/SaveFailedException.php | SaveFailedException.setPreviousExceptionMeta | private function setPreviousExceptionMeta()
{
if ($exception = $this->previousException) {
$this->meta['previous_exception'] = [
'message' => $exception->getMessage(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
... | php | private function setPreviousExceptionMeta()
{
if ($exception = $this->previousException) {
$this->meta['previous_exception'] = [
'message' => $exception->getMessage(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
... | [
"private",
"function",
"setPreviousExceptionMeta",
"(",
")",
"{",
"if",
"(",
"$",
"exception",
"=",
"$",
"this",
"->",
"previousException",
")",
"{",
"$",
"this",
"->",
"meta",
"[",
"'previous_exception'",
"]",
"=",
"[",
"'message'",
"=>",
"$",
"exception",
... | setPreviousExceptionMeta
@author Casper Rasmussen <cr@nodes.dk>
@access private
@return void | [
"setPreviousExceptionMeta"
] | train | https://github.com/nodes-php/database/blob/ec58a01a2b966f89efeac58ac9ac633919c04a52/src/Exceptions/SaveFailedException.php#L63-L73 |
dms-org/package.blog | src/Infrastructure/Persistence/BlogOrm.php | BlogOrm.define | protected function define(OrmDefinition $orm)
{
$orm->entities([
BlogCategory::class => BlogCategoryMapper::class,
BlogAuthor::class => BlogAuthorMapper::class,
BlogArticle::class => BlogArticleMapper::class,
BlogArticleComment::class => B... | php | protected function define(OrmDefinition $orm)
{
$orm->entities([
BlogCategory::class => BlogCategoryMapper::class,
BlogAuthor::class => BlogAuthorMapper::class,
BlogArticle::class => BlogArticleMapper::class,
BlogArticleComment::class => B... | [
"protected",
"function",
"define",
"(",
"OrmDefinition",
"$",
"orm",
")",
"{",
"$",
"orm",
"->",
"entities",
"(",
"[",
"BlogCategory",
"::",
"class",
"=>",
"BlogCategoryMapper",
"::",
"class",
",",
"BlogAuthor",
"::",
"class",
"=>",
"BlogAuthorMapper",
"::",
... | Defines the object mappers registered in the orm.
@param OrmDefinition $orm
@return void | [
"Defines",
"the",
"object",
"mappers",
"registered",
"in",
"the",
"orm",
"."
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Infrastructure/Persistence/BlogOrm.php#L35-L43 |
netgen/ngopengraph | classes/ngopengraphbase.php | ngOpenGraphBase.getInstance | static function getInstance( eZContentObjectAttribute $objectAttribute )
{
$datatypeString = $objectAttribute->attribute( 'data_type_string' );
$dataTypeHandlers = self::$ogIni->variable( 'OpenGraph', 'DataTypeHandlers' );
if ( array_key_exists( $datatypeString, $dataTypeHandlers ) )
... | php | static function getInstance( eZContentObjectAttribute $objectAttribute )
{
$datatypeString = $objectAttribute->attribute( 'data_type_string' );
$dataTypeHandlers = self::$ogIni->variable( 'OpenGraph', 'DataTypeHandlers' );
if ( array_key_exists( $datatypeString, $dataTypeHandlers ) )
... | [
"static",
"function",
"getInstance",
"(",
"eZContentObjectAttribute",
"$",
"objectAttribute",
")",
"{",
"$",
"datatypeString",
"=",
"$",
"objectAttribute",
"->",
"attribute",
"(",
"'data_type_string'",
")",
";",
"$",
"dataTypeHandlers",
"=",
"self",
"::",
"$",
"og... | Gets the instance of Open Graph attribute handler for the attribute
@param eZContentObjectAttribute $objectAttribute
@return ngOpenGraphBase | [
"Gets",
"the",
"instance",
"of",
"Open",
"Graph",
"attribute",
"handler",
"for",
"the",
"attribute"
] | train | https://github.com/netgen/ngopengraph/blob/68a99862f240ee74174ea9b888a9a33743142e27/classes/ngopengraphbase.php#L22-L36 |
ufocoder/yii2-SyncSocial | src/actions/DisconnectAction.php | DisconnectAction.run | public function run( $service ) {
return $this->redirectWithMessages(
$this->synchronizer->disconnect( $service ),
Yii::t( 'SyncSocial', 'Service was successfully disconnected' ),
Yii::t( 'SyncSocial', 'There is error in disconnection' )
);
} | php | public function run( $service ) {
return $this->redirectWithMessages(
$this->synchronizer->disconnect( $service ),
Yii::t( 'SyncSocial', 'Service was successfully disconnected' ),
Yii::t( 'SyncSocial', 'There is error in disconnection' )
);
} | [
"public",
"function",
"run",
"(",
"$",
"service",
")",
"{",
"return",
"$",
"this",
"->",
"redirectWithMessages",
"(",
"$",
"this",
"->",
"synchronizer",
"->",
"disconnect",
"(",
"$",
"service",
")",
",",
"Yii",
"::",
"t",
"(",
"'SyncSocial'",
",",
"'Serv... | @param $service
@return \yii\web\Response | [
"@param",
"$service"
] | train | https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/actions/DisconnectAction.php#L18-L25 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.commitChanges | final public function commitChanges()
{
if (null !== $this->changes) {
$this->lastCommittedEventSequenceNumber = $this->changes->lastSequenceNumber();
$this->changes->commit();
}
} | php | final public function commitChanges()
{
if (null !== $this->changes) {
$this->lastCommittedEventSequenceNumber = $this->changes->lastSequenceNumber();
$this->changes->commit();
}
} | [
"final",
"public",
"function",
"commitChanges",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"changes",
")",
"{",
"$",
"this",
"->",
"lastCommittedEventSequenceNumber",
"=",
"$",
"this",
"->",
"changes",
"->",
"lastSequenceNumber",
"(",
")",
... | Clears all recorded events. | [
"Clears",
"all",
"recorded",
"events",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L78-L84 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.applyChange | final protected function applyChange(Serializable $payload)
{
$this->apply($payload);
$this->changes()->addEventFromPayload($payload);
} | php | final protected function applyChange(Serializable $payload)
{
$this->apply($payload);
$this->changes()->addEventFromPayload($payload);
} | [
"final",
"protected",
"function",
"applyChange",
"(",
"Serializable",
"$",
"payload",
")",
"{",
"$",
"this",
"->",
"apply",
"(",
"$",
"payload",
")",
";",
"$",
"this",
"->",
"changes",
"(",
")",
"->",
"addEventFromPayload",
"(",
"$",
"payload",
")",
";",... | Mutate the state of the aggregate by applying a domain event.
Keep track of the change until it has been successfully committed.
@param Serializable $payload | [
"Mutate",
"the",
"state",
"of",
"the",
"aggregate",
"by",
"applying",
"a",
"domain",
"event",
".",
"Keep",
"track",
"of",
"the",
"change",
"until",
"it",
"has",
"been",
"successfully",
"committed",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L92-L96 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.replayChange | final private function replayChange(Event $event)
{
$this->apply($event->payload());
$this->lastCommittedEventSequenceNumber = $event->sequenceNumber();
} | php | final private function replayChange(Event $event)
{
$this->apply($event->payload());
$this->lastCommittedEventSequenceNumber = $event->sequenceNumber();
} | [
"final",
"private",
"function",
"replayChange",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"apply",
"(",
"$",
"event",
"->",
"payload",
"(",
")",
")",
";",
"$",
"this",
"->",
"lastCommittedEventSequenceNumber",
"=",
"$",
"event",
"->",
"seq... | Mutate the state of the aggregate by applying the domain event contained into the message.
Synchronize the aggregate version with the one provided by the message.
@param Event $event | [
"Mutate",
"the",
"state",
"of",
"the",
"aggregate",
"by",
"applying",
"the",
"domain",
"event",
"contained",
"into",
"the",
"message",
".",
"Synchronize",
"the",
"aggregate",
"version",
"with",
"the",
"one",
"provided",
"by",
"the",
"message",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L104-L108 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.apply | final private function apply(Serializable $payload)
{
$method = $this->applyMethod($payload);
$this->$method($payload);
} | php | final private function apply(Serializable $payload)
{
$method = $this->applyMethod($payload);
$this->$method($payload);
} | [
"final",
"private",
"function",
"apply",
"(",
"Serializable",
"$",
"payload",
")",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"applyMethod",
"(",
"$",
"payload",
")",
";",
"$",
"this",
"->",
"$",
"method",
"(",
"$",
"payload",
")",
";",
"}"
] | Mutate the state of the aggregate by applying a domain event.
@param Serializable $payload | [
"Mutate",
"the",
"state",
"of",
"the",
"aggregate",
"by",
"applying",
"a",
"domain",
"event",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L115-L119 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.applyMethod | protected function applyMethod(Serializable $payload)
{
$className = get_class($payload);
return 'apply'.substr($className, strrpos($className, '\\') + 1);
} | php | protected function applyMethod(Serializable $payload)
{
$className = get_class($payload);
return 'apply'.substr($className, strrpos($className, '\\') + 1);
} | [
"protected",
"function",
"applyMethod",
"(",
"Serializable",
"$",
"payload",
")",
"{",
"$",
"className",
"=",
"get_class",
"(",
"$",
"payload",
")",
";",
"return",
"'apply'",
".",
"substr",
"(",
"$",
"className",
",",
"strrpos",
"(",
"$",
"className",
",",... | Returns method to call for applying a given domain event to the aggregate.
This can be overridden to suit your custom naming convention.
@param Serializable $payload
@return string | [
"Returns",
"method",
"to",
"call",
"for",
"applying",
"a",
"given",
"domain",
"event",
"to",
"the",
"aggregate",
".",
"This",
"can",
"be",
"overridden",
"to",
"suit",
"your",
"custom",
"naming",
"convention",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L129-L134 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.changes | final private function changes()
{
if (null === $this->changes) {
$lastCommittedEventSequenceNumber = $this->lastCommittedEventSequenceNumber();
$this->changes = new DefaultEventContainer($this->identifier(), $lastCommittedEventSequenceNumber);
}
return $this->chang... | php | final private function changes()
{
if (null === $this->changes) {
$lastCommittedEventSequenceNumber = $this->lastCommittedEventSequenceNumber();
$this->changes = new DefaultEventContainer($this->identifier(), $lastCommittedEventSequenceNumber);
}
return $this->chang... | [
"final",
"private",
"function",
"changes",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"changes",
")",
"{",
"$",
"lastCommittedEventSequenceNumber",
"=",
"$",
"this",
"->",
"lastCommittedEventSequenceNumber",
"(",
")",
";",
"$",
"this",
"->",... | Return the event container containing the uncommitted changes.
If there are no pending changes to be committed, a new event container
will be initialized.
@return EventContainer | [
"Return",
"the",
"event",
"container",
"containing",
"the",
"uncommitted",
"changes",
".",
"If",
"there",
"are",
"no",
"pending",
"changes",
"to",
"be",
"committed",
"a",
"new",
"event",
"container",
"will",
"be",
"initialized",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L143-L152 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.loadFromHistory | final public static function loadFromHistory(EventStream $eventStream)
{
$aggregate = new static();
while ($eventStream->hasNext()) {
$aggregate->replayChange($eventStream->next());
}
return $aggregate;
} | php | final public static function loadFromHistory(EventStream $eventStream)
{
$aggregate = new static();
while ($eventStream->hasNext()) {
$aggregate->replayChange($eventStream->next());
}
return $aggregate;
} | [
"final",
"public",
"static",
"function",
"loadFromHistory",
"(",
"EventStream",
"$",
"eventStream",
")",
"{",
"$",
"aggregate",
"=",
"new",
"static",
"(",
")",
";",
"while",
"(",
"$",
"eventStream",
"->",
"hasNext",
"(",
")",
")",
"{",
"$",
"aggregate",
... | Roll-out all events to reconstitute the state of the aggregate.
@param EventStream $eventStream
@return static | [
"Roll",
"-",
"out",
"all",
"events",
"to",
"reconstitute",
"the",
"state",
"of",
"the",
"aggregate",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L161-L170 |
rayrutjes/domain-foundation | src/Domain/AggregateRoot/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.sameIdentityAs | final public function sameIdentityAs(AggregateRoot $aggregateRoot)
{
if (!$aggregateRoot instanceof static) {
return false;
}
return $this->identifier()->equals($aggregateRoot->identifier());
} | php | final public function sameIdentityAs(AggregateRoot $aggregateRoot)
{
if (!$aggregateRoot instanceof static) {
return false;
}
return $this->identifier()->equals($aggregateRoot->identifier());
} | [
"final",
"public",
"function",
"sameIdentityAs",
"(",
"AggregateRoot",
"$",
"aggregateRoot",
")",
"{",
"if",
"(",
"!",
"$",
"aggregateRoot",
"instanceof",
"static",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"identifier",
"(",
")",
... | @param AggregateRoot $aggregateRoot
@return mixed | [
"@param",
"AggregateRoot",
"$aggregateRoot"
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Domain/AggregateRoot/EventSourcedAggregateRoot.php#L201-L208 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRelation.php | EntityRelation.addAnnotationsForSource | public function addAnnotationsForSource(DocBlock $docBlock) {
extract(Annotation::getClosureHelpers());
$docBlock->addAnnotation($this->getRelation());
if ($this->type === self::MANY_TO_MANY && $this->sourceSide !== self::INVERSE) { // bei unidirectional brauchen wir natürlich auch einen JoinTable... | php | public function addAnnotationsForSource(DocBlock $docBlock) {
extract(Annotation::getClosureHelpers());
$docBlock->addAnnotation($this->getRelation());
if ($this->type === self::MANY_TO_MANY && $this->sourceSide !== self::INVERSE) { // bei unidirectional brauchen wir natürlich auch einen JoinTable... | [
"public",
"function",
"addAnnotationsForSource",
"(",
"DocBlock",
"$",
"docBlock",
")",
"{",
"extract",
"(",
"Annotation",
"::",
"getClosureHelpers",
"(",
")",
")",
";",
"$",
"docBlock",
"->",
"addAnnotation",
"(",
"$",
"this",
"->",
"getRelation",
"(",
")",
... | Fügt einem DocBlock die passenden Annotations für die Source Seite der Relation hinzu | [
"Fügt",
"einem",
"DocBlock",
"die",
"passenden",
"Annotations",
"für",
"die",
"Source",
"Seite",
"der",
"Relation",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRelation.php#L157-L177 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRelation.php | EntityRelation.setRelationType | public function setRelationType($type, $direction = 'bidirectional', $whoIsOwningSide = 'source') {
// zuerst setzen wir die direction, denn wenn type nicht gesetzt ist, macht die nichts
$this->setDirection($direction);
// dann setzen wir den type, dies setzt dann bei one to many und many to one d... | php | public function setRelationType($type, $direction = 'bidirectional', $whoIsOwningSide = 'source') {
// zuerst setzen wir die direction, denn wenn type nicht gesetzt ist, macht die nichts
$this->setDirection($direction);
// dann setzen wir den type, dies setzt dann bei one to many und many to one d... | [
"public",
"function",
"setRelationType",
"(",
"$",
"type",
",",
"$",
"direction",
"=",
"'bidirectional'",
",",
"$",
"whoIsOwningSide",
"=",
"'source'",
")",
"{",
"// zuerst setzen wir die direction, denn wenn type nicht gesetzt ist, macht die nichts",
"$",
"this",
"->",
"... | Setzt alle Eigenschaften der Relation gleichzeitig
$whoIsOwningSide wird bei MANY_TO_ONE und ONE_TO_MANY ignoriert (denn dort ist es immer automatisch die MANY Seite)
ist $direction nicht bidirectional wird die inverse side der Relation nicht automatisch gesetzt | [
"Setzt",
"alle",
"Eigenschaften",
"der",
"Relation",
"gleichzeitig"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRelation.php#L193-L207 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRelation.php | EntityRelation.setOwningSide | public function setOwningSide($sourceOrTarget) {
Code::value($sourceOrTarget, self::SOURCE, self::TARGET, TRUE);
if ($this->type === self::MANY_TO_MANY || $this->type === self::ONE_TO_ONE) {
if ($sourceOrTarget === self::SOURCE || $sourceOrTarget === TRUE) {
$this->sourceSide = self::OWNING;
... | php | public function setOwningSide($sourceOrTarget) {
Code::value($sourceOrTarget, self::SOURCE, self::TARGET, TRUE);
if ($this->type === self::MANY_TO_MANY || $this->type === self::ONE_TO_ONE) {
if ($sourceOrTarget === self::SOURCE || $sourceOrTarget === TRUE) {
$this->sourceSide = self::OWNING;
... | [
"public",
"function",
"setOwningSide",
"(",
"$",
"sourceOrTarget",
")",
"{",
"Code",
"::",
"value",
"(",
"$",
"sourceOrTarget",
",",
"self",
"::",
"SOURCE",
",",
"self",
"::",
"TARGET",
",",
"TRUE",
")",
";",
"if",
"(",
"$",
"this",
"->",
"type",
"==="... | Setzt die Owning (und ggf. inverse Side)
ist die relation bidirectional (default), so wird die inverse side automatisch mitgesetzt
@param SOURCE|TARGET $sourceOrTarget | [
"Setzt",
"die",
"Owning",
"(",
"und",
"ggf",
".",
"inverse",
"Side",
")"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRelation.php#L215-L232 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRelation.php | EntityRelation.setType | public function setType($type) {
Code::value($type, self::MANY_TO_MANY, self::MANY_TO_ONE, self::ONE_TO_MANY, self::ONE_TO_ONE);
$this->type = $type;
// wir tun immer so, als wären die anderen states schon sinnvoll gesetzt und passen die klasse an unsere ideen an.
if ($this->type === self::MANY_TO_... | php | public function setType($type) {
Code::value($type, self::MANY_TO_MANY, self::MANY_TO_ONE, self::ONE_TO_MANY, self::ONE_TO_ONE);
$this->type = $type;
// wir tun immer so, als wären die anderen states schon sinnvoll gesetzt und passen die klasse an unsere ideen an.
if ($this->type === self::MANY_TO_... | [
"public",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"Code",
"::",
"value",
"(",
"$",
"type",
",",
"self",
"::",
"MANY_TO_MANY",
",",
"self",
"::",
"MANY_TO_ONE",
",",
"self",
"::",
"ONE_TO_MANY",
",",
"self",
"::",
"ONE_TO_ONE",
")",
";",
"$",... | Setzt den (Relation-)Type der Relation (aka (MANY|ONE)_TO_(MANY|ONE) Konstante)
@param const $type | [
"Setzt",
"den",
"(",
"Relation",
"-",
")",
"Type",
"der",
"Relation",
"(",
"aka",
"(",
"MANY|ONE",
")",
"_TO_",
"(",
"MANY|ONE",
")",
"Konstante",
")"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRelation.php#L281-L311 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRelation.php | EntityRelation.shouldUpdateOtherSide | public function shouldUpdateOtherSide() {
if (isset($this->updateOtherSide)) {
return $this->updateOtherSide;
}
return $this->isBidirectional() && $this->getSourceSide() === EntityRelation::OWNING;
} | php | public function shouldUpdateOtherSide() {
if (isset($this->updateOtherSide)) {
return $this->updateOtherSide;
}
return $this->isBidirectional() && $this->getSourceSide() === EntityRelation::OWNING;
} | [
"public",
"function",
"shouldUpdateOtherSide",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"updateOtherSide",
")",
")",
"{",
"return",
"$",
"this",
"->",
"updateOtherSide",
";",
"}",
"return",
"$",
"this",
"->",
"isBidirectional",
"(",
")",
... | Gibt zurück ob die Source-Seite im relation interface die andere Seite mit updaten soll
@return bool | [
"Gibt",
"zurück",
"ob",
"die",
"Source",
"-",
"Seite",
"im",
"relation",
"interface",
"die",
"andere",
"Seite",
"mit",
"updaten",
"soll"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRelation.php#L403-L409 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityRelation.php | EntityRelation.setJoinColumnNullable | public function setJoinColumnNullable($bool) {
$this->nullable = $bool;
$this->getJoinColumn()->setNullable($bool);
return $this;
} | php | public function setJoinColumnNullable($bool) {
$this->nullable = $bool;
$this->getJoinColumn()->setNullable($bool);
return $this;
} | [
"public",
"function",
"setJoinColumnNullable",
"(",
"$",
"bool",
")",
"{",
"$",
"this",
"->",
"nullable",
"=",
"$",
"bool",
";",
"$",
"this",
"->",
"getJoinColumn",
"(",
")",
"->",
"setNullable",
"(",
"$",
"bool",
")",
";",
"return",
"$",
"this",
";",
... | Achtung dies erzeugt die JoinColumn und sollte nur benutzt werdne, wenn die Relation schon korrekt gesetzt ist | [
"Achtung",
"dies",
"erzeugt",
"die",
"JoinColumn",
"und",
"sollte",
"nur",
"benutzt",
"werdne",
"wenn",
"die",
"Relation",
"schon",
"korrekt",
"gesetzt",
"ist"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityRelation.php#L536-L540 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/Alpha.php | Zend_Validate_Alpha.isValid | public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ('' === $valueString) {
$this->_error(self::STRING_EMPTY);
return false;
}
if (null === self::$_filter) {
/**
* @see Zend_F... | php | public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ('' === $valueString) {
$this->_error(self::STRING_EMPTY);
return false;
}
if (null === self::$_filter) {
/**
* @see Zend_F... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"$",
"valueString",
"=",
"(",
"string",
")",
"$",
"value",
";",
"$",
"this",
"->",
"_setValue",
"(",
"$",
"valueString",
")",
";",
"if",
"(",
"''",
"===",
"$",
"valueString",
")",
"{",
"... | Defined by Zend_Validate_Interface
Returns true if and only if $value contains only alphabetic characters
@param string $value
@return boolean | [
"Defined",
"by",
"Zend_Validate_Interface"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/Alpha.php#L114-L141 |
ipunkt/laravel-package-manager | src/Providers/Traits/PackagePath.php | PackagePath.packagePath | private function packagePath(string $relativePath): string
{
$packagePath = rtrim(str_replace('/', DIRECTORY_SEPARATOR, $this->packagePath), DIRECTORY_SEPARATOR);
$relativePath = ltrim(str_replace('/', DIRECTORY_SEPARATOR, $relativePath), DIRECTORY_SEPARATOR);
return realpath($packagePath . DI... | php | private function packagePath(string $relativePath): string
{
$packagePath = rtrim(str_replace('/', DIRECTORY_SEPARATOR, $this->packagePath), DIRECTORY_SEPARATOR);
$relativePath = ltrim(str_replace('/', DIRECTORY_SEPARATOR, $relativePath), DIRECTORY_SEPARATOR);
return realpath($packagePath . DI... | [
"private",
"function",
"packagePath",
"(",
"string",
"$",
"relativePath",
")",
":",
"string",
"{",
"$",
"packagePath",
"=",
"rtrim",
"(",
"str_replace",
"(",
"'/'",
",",
"DIRECTORY_SEPARATOR",
",",
"$",
"this",
"->",
"packagePath",
")",
",",
"DIRECTORY_SEPARAT... | give relative path from package root and return absolute path
@param string $relativePath
@return string | [
"give",
"relative",
"path",
"from",
"package",
"root",
"and",
"return",
"absolute",
"path"
] | train | https://github.com/ipunkt/laravel-package-manager/blob/6ecfc9d933c37927e52c441d5019126be69e5817/src/Providers/Traits/PackagePath.php#L22-L28 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/Digits.php | Zend_Validate_Digits.isValid | public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ('' === $valueString) {
$this->_error(self::STRING_EMPTY);
return false;
}
if (null === self::$_filter) {
/**
* @see Zend_F... | php | public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ('' === $valueString) {
$this->_error(self::STRING_EMPTY);
return false;
}
if (null === self::$_filter) {
/**
* @see Zend_F... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"$",
"valueString",
"=",
"(",
"string",
")",
"$",
"value",
";",
"$",
"this",
"->",
"_setValue",
"(",
"$",
"valueString",
")",
";",
"if",
"(",
"''",
"===",
"$",
"valueString",
")",
"{",
"... | Defined by Zend_Validate_Interface
Returns true if and only if $value only contains digit characters
@param string $value
@return boolean | [
"Defined",
"by",
"Zend_Validate_Interface"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/Digits.php#L73-L98 |
shrink0r/workflux | src/Builder/ArrayStateMachineBuilder.php | ArrayStateMachineBuilder.realizeConfig | private function realizeConfig(array $config): array
{
$states = [];
$transitions = [];
foreach ($config as $name => $state_config) {
$states[] = $this->factory->createState($name, $state_config);
if (!is_array($state_config)) {
continue;
}... | php | private function realizeConfig(array $config): array
{
$states = [];
$transitions = [];
foreach ($config as $name => $state_config) {
$states[] = $this->factory->createState($name, $state_config);
if (!is_array($state_config)) {
continue;
}... | [
"private",
"function",
"realizeConfig",
"(",
"array",
"$",
"config",
")",
":",
"array",
"{",
"$",
"states",
"=",
"[",
"]",
";",
"$",
"transitions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"state_config",
")",
... | @param mixed[] $config
@return mixed[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Builder/ArrayStateMachineBuilder.php#L59-L76 |
silverbusters/silverstripe-simplelistfield | model/fieldtypes/SimpleListFieldDB.php | SimpleListFieldDB.getList | public function getList(){
// define an unique key
$key = $this->name.'_'.md5($this->value);
if( isset(self::$listobj[$key]) ){
return self::$listobj[$key];
}
if($this->value){
self::$listobj[$key] = json_decode($this->value);
}
else{
self::$listobj[$key] = false;
}
return self::$li... | php | public function getList(){
// define an unique key
$key = $this->name.'_'.md5($this->value);
if( isset(self::$listobj[$key]) ){
return self::$listobj[$key];
}
if($this->value){
self::$listobj[$key] = json_decode($this->value);
}
else{
self::$listobj[$key] = false;
}
return self::$li... | [
"public",
"function",
"getList",
"(",
")",
"{",
"// define an unique key",
"$",
"key",
"=",
"$",
"this",
"->",
"name",
".",
"'_'",
".",
"md5",
"(",
"$",
"this",
"->",
"value",
")",
";",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"listobj",
"[",
"$... | Get the list | [
"Get",
"the",
"list"
] | train | https://github.com/silverbusters/silverstripe-simplelistfield/blob/c883e13b1b877d74e266edf2a646661039803440/model/fieldtypes/SimpleListFieldDB.php#L20-L36 |
silverbusters/silverstripe-simplelistfield | model/fieldtypes/SimpleListFieldDB.php | SimpleListFieldDB.Count | public function Count(){
$list = $this->getList();
return ( isset($list->items) && !empty($list->items) ) ? count($list->items) : false;
} | php | public function Count(){
$list = $this->getList();
return ( isset($list->items) && !empty($list->items) ) ? count($list->items) : false;
} | [
"public",
"function",
"Count",
"(",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getList",
"(",
")",
";",
"return",
"(",
"isset",
"(",
"$",
"list",
"->",
"items",
")",
"&&",
"!",
"empty",
"(",
"$",
"list",
"->",
"items",
")",
")",
"?",
"coun... | Count items | [
"Count",
"items"
] | train | https://github.com/silverbusters/silverstripe-simplelistfield/blob/c883e13b1b877d74e266edf2a646661039803440/model/fieldtypes/SimpleListFieldDB.php#L50-L54 |
silverbusters/silverstripe-simplelistfield | model/fieldtypes/SimpleListFieldDB.php | SimpleListFieldDB.getHeading | public function getHeading(){
$list = $this->getList();
if( isset($list->heading) && $list->heading ){
return Convert::html2raw($list->heading);
}
return null;
} | php | public function getHeading(){
$list = $this->getList();
if( isset($list->heading) && $list->heading ){
return Convert::html2raw($list->heading);
}
return null;
} | [
"public",
"function",
"getHeading",
"(",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getList",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"list",
"->",
"heading",
")",
"&&",
"$",
"list",
"->",
"heading",
")",
"{",
"return",
"Convert",
"::",
... | Get list heading | [
"Get",
"list",
"heading"
] | train | https://github.com/silverbusters/silverstripe-simplelistfield/blob/c883e13b1b877d74e266edf2a646661039803440/model/fieldtypes/SimpleListFieldDB.php#L59-L67 |
silverbusters/silverstripe-simplelistfield | model/fieldtypes/SimpleListFieldDB.php | SimpleListFieldDB.getItems | public function getItems(){
$list = $this->getList();
if( isset($list->items) && !empty($list->items) )
{
$arrayList = new ArrayList();
foreach($list->items as $id => $item){
$item->ID = $id;
$arrayList->push( new ArrayData($item) );
}
return $arrayList;
}
return false;
... | php | public function getItems(){
$list = $this->getList();
if( isset($list->items) && !empty($list->items) )
{
$arrayList = new ArrayList();
foreach($list->items as $id => $item){
$item->ID = $id;
$arrayList->push( new ArrayData($item) );
}
return $arrayList;
}
return false;
... | [
"public",
"function",
"getItems",
"(",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getList",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"list",
"->",
"items",
")",
"&&",
"!",
"empty",
"(",
"$",
"list",
"->",
"items",
")",
")",
"{",
"$",
... | Get list items | [
"Get",
"list",
"items"
] | train | https://github.com/silverbusters/silverstripe-simplelistfield/blob/c883e13b1b877d74e266edf2a646661039803440/model/fieldtypes/SimpleListFieldDB.php#L72-L89 |
silverbusters/silverstripe-simplelistfield | model/fieldtypes/SimpleListFieldDB.php | SimpleListFieldDB.forTemplate | public function forTemplate() {
$list = $this->getList();
if( isset($list->enable) && $list->enable )
{
// Get scenario
$scenario = isset($list->scenario) ? $list->scenario : '';
// Get view file to render
$template = $this->template ? $this->template : ( $scenario ? 'SimpleListFieldDB_'.$scena... | php | public function forTemplate() {
$list = $this->getList();
if( isset($list->enable) && $list->enable )
{
// Get scenario
$scenario = isset($list->scenario) ? $list->scenario : '';
// Get view file to render
$template = $this->template ? $this->template : ( $scenario ? 'SimpleListFieldDB_'.$scena... | [
"public",
"function",
"forTemplate",
"(",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getList",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"list",
"->",
"enable",
")",
"&&",
"$",
"list",
"->",
"enable",
")",
"{",
"// Get scenario",
"$",
"scen... | For template | [
"For",
"template"
] | train | https://github.com/silverbusters/silverstripe-simplelistfield/blob/c883e13b1b877d74e266edf2a646661039803440/model/fieldtypes/SimpleListFieldDB.php#L112-L132 |
thiagodp/json | lib/JSON.php | JSON.encode | static function encode( $data, $getterPrefixForObjectMethods = 'get', $ignoreNulls = false ) {
$type = gettype( $data );
$isObject = false;
switch ( $type ) {
case 'string' : return '"' . self::fixString( $data ) . '"';
case 'number' : ; // continue
case 'integer' : ; // continue
case 'float' : ; //... | php | static function encode( $data, $getterPrefixForObjectMethods = 'get', $ignoreNulls = false ) {
$type = gettype( $data );
$isObject = false;
switch ( $type ) {
case 'string' : return '"' . self::fixString( $data ) . '"';
case 'number' : ; // continue
case 'integer' : ; // continue
case 'float' : ; //... | [
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"getterPrefixForObjectMethods",
"=",
"'get'",
",",
"$",
"ignoreNulls",
"=",
"false",
")",
"{",
"$",
"type",
"=",
"gettype",
"(",
"$",
"data",
")",
";",
"$",
"isObject",
"=",
"false",
";",
"swi... | Encodes a variable into JSON format.
@param mixed $data Data to be encoded.
@param string $getterPrefixForObjectMethods Prefix used for getter methods.
OPTIONAL. Defaults to 'get'.
@param bool $ignoreNulls Ignore null values when encoding.
OPTIONAL. Defaults to false.
@return string | [
"Encodes",
"a",
"variable",
"into",
"JSON",
"format",
"."
] | train | https://github.com/thiagodp/json/blob/058e07a47ef28983fceb94f98d7edf08983f08ef/lib/JSON.php#L64-L106 |
thiagodp/json | lib/JSON.php | JSON.decode | static function decode(
$json,
$convertObjectsToArrays = false,
$recursionDepth = 512, // same as PHP default
$options = 0
) {
// Just use PHP's decode function
return json_decode( $json, $convertObjectsToArrays, $recursionDepth, $options );
} | php | static function decode(
$json,
$convertObjectsToArrays = false,
$recursionDepth = 512, // same as PHP default
$options = 0
) {
// Just use PHP's decode function
return json_decode( $json, $convertObjectsToArrays, $recursionDepth, $options );
} | [
"static",
"function",
"decode",
"(",
"$",
"json",
",",
"$",
"convertObjectsToArrays",
"=",
"false",
",",
"$",
"recursionDepth",
"=",
"512",
",",
"// same as PHP default",
"$",
"options",
"=",
"0",
")",
"{",
"// Just use PHP's decode function",
"return",
"json_deco... | Decodes a JSON content into an object or an array.
@see http://php.net/manual/en/function.json-decode.php
@param string $json The JSON content.
@param bool $convertObjectsToArrays When true, converts objects to arrays.
@param int $recursionDepth Recursion depth.
@param int $options Bit mask of JSON option... | [
"Decodes",
"a",
"JSON",
"content",
"into",
"an",
"object",
"or",
"an",
"array",
"."
] | train | https://github.com/thiagodp/json/blob/058e07a47ef28983fceb94f98d7edf08983f08ef/lib/JSON.php#L125-L133 |
webforge-labs/psc-cms | lib/Psc/HTML/FrameworkPage.php | FrameworkPage.addCMSRequireJS | public function addCMSRequireJS($assetModus = 'development') {
if ($assetModus === 'development') {
$this->loadJs('/psc-cms-js/lib/config.js');
$requirejs = '/psc-cms-js/vendor/require.js';
$main = '/js/boot.js';
} else {
$requirejs = '/js-built/require.js';
$main = '/js-built/lib/... | php | public function addCMSRequireJS($assetModus = 'development') {
if ($assetModus === 'development') {
$this->loadJs('/psc-cms-js/lib/config.js');
$requirejs = '/psc-cms-js/vendor/require.js';
$main = '/js/boot.js';
} else {
$requirejs = '/js-built/require.js';
$main = '/js-built/lib/... | [
"public",
"function",
"addCMSRequireJS",
"(",
"$",
"assetModus",
"=",
"'development'",
")",
"{",
"if",
"(",
"$",
"assetModus",
"===",
"'development'",
")",
"{",
"$",
"this",
"->",
"loadJs",
"(",
"'/psc-cms-js/lib/config.js'",
")",
";",
"$",
"requirejs",
"=",
... | Use development as $assetMode to use non-compiled assets
use other values or 'built' to the compiled files and minified js | [
"Use",
"development",
"as",
"$assetMode",
"to",
"use",
"non",
"-",
"compiled",
"assets"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/HTML/FrameworkPage.php#L41-L52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.