id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,100 | Erebot/API | src/Event/Match/TextAbstract.php | TextAbstract.setPrefixRequirement | public function setPrefixRequirement($requirePrefix = false)
{
if ($requirePrefix !== null && !is_bool($requirePrefix)) {
throw new \Erebot\InvalidValueException(
'$requirePrefix must be a boolean or null'
);
}
$this->requirePrefix = $requirePrefix;
... | php | public function setPrefixRequirement($requirePrefix = false)
{
if ($requirePrefix !== null && !is_bool($requirePrefix)) {
throw new \Erebot\InvalidValueException(
'$requirePrefix must be a boolean or null'
);
}
$this->requirePrefix = $requirePrefix;
... | [
"public",
"function",
"setPrefixRequirement",
"(",
"$",
"requirePrefix",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"requirePrefix",
"!==",
"null",
"&&",
"!",
"is_bool",
"(",
"$",
"requirePrefix",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"InvalidV... | Sets the constraint on prefix requirement.
\param bool|null $requirePrefix
(optional) Whether a prefix will be required (\b true),
allowed (\b null) or disallowed (\b false).
The default is to prohibit the use of a prefix.
\throw Erebot::InvalidValueException
The given value for $requirePrefix is invalid. | [
"Sets",
"the",
"constraint",
"on",
"prefix",
"requirement",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Event/Match/TextAbstract.php#L111-L120 |
225,101 | yawik/behat | src/SummaryFormContext.php | SummaryFormContext.iSaveWorkflow | public function iSaveWorkflow()
{
$locator = '#workflowSettings-buttons-submit';
$element = $this->minkContext->getSession()->getPage()->find('css',$locator);
$element->click();
} | php | public function iSaveWorkflow()
{
$locator = '#workflowSettings-buttons-submit';
$element = $this->minkContext->getSession()->getPage()->find('css',$locator);
$element->click();
} | [
"public",
"function",
"iSaveWorkflow",
"(",
")",
"{",
"$",
"locator",
"=",
"'#workflowSettings-buttons-submit'",
";",
"$",
"element",
"=",
"$",
"this",
"->",
"minkContext",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"find",
"(",
"'css'",
... | Saving organization workflow | [
"Saving",
"organization",
"workflow"
] | 9e776b8aa8a069da13e35d717f7bb35c2f96b277 | https://github.com/yawik/behat/blob/9e776b8aa8a069da13e35d717f7bb35c2f96b277/src/SummaryFormContext.php#L94-L99 |
225,102 | UCSLabs/form | Parser/LessVariablesParser.php | LessVariablesParser.flatten | public function flatten($data, $originalNames = array())
{
$ret = array();
$it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($data));
foreach ($it as $name => $value) {
if (!is_array($value)) {
if (isset($originalNames[$name])) {
... | php | public function flatten($data, $originalNames = array())
{
$ret = array();
$it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($data));
foreach ($it as $name => $value) {
if (!is_array($value)) {
if (isset($originalNames[$name])) {
... | [
"public",
"function",
"flatten",
"(",
"$",
"data",
",",
"$",
"originalNames",
"=",
"array",
"(",
")",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"it",
"=",
"new",
"\\",
"RecursiveIteratorIterator",
"(",
"new",
"\\",
"RecursiveArrayIterator",... | Flattent the given data | [
"Flattent",
"the",
"given",
"data"
] | ce2f609c4ee48ab8fbd10924685d2531c18652da | https://github.com/UCSLabs/form/blob/ce2f609c4ee48ab8fbd10924685d2531c18652da/Parser/LessVariablesParser.php#L178-L194 |
225,103 | UCSLabs/form | Parser/LessVariablesParser.php | LessVariablesParser.extractField | private function extractField($blocks)
{
$fieldData = array();
$pattern = "/([a-zA-Z]+) *(.+)/";
foreach ($blocks as $block) {
$match = preg_match($pattern, $block, $matches);
// A full double string match found
if (count($matches) == 3) {
... | php | private function extractField($blocks)
{
$fieldData = array();
$pattern = "/([a-zA-Z]+) *(.+)/";
foreach ($blocks as $block) {
$match = preg_match($pattern, $block, $matches);
// A full double string match found
if (count($matches) == 3) {
... | [
"private",
"function",
"extractField",
"(",
"$",
"blocks",
")",
"{",
"$",
"fieldData",
"=",
"array",
"(",
")",
";",
"$",
"pattern",
"=",
"\"/([a-zA-Z]+) *(.+)/\"",
";",
"foreach",
"(",
"$",
"blocks",
"as",
"$",
"block",
")",
"{",
"$",
"match",
"=",
"pr... | This is the main function supposed to parse and return fields
properly | [
"This",
"is",
"the",
"main",
"function",
"supposed",
"to",
"parse",
"and",
"return",
"fields",
"properly"
] | ce2f609c4ee48ab8fbd10924685d2531c18652da | https://github.com/UCSLabs/form/blob/ce2f609c4ee48ab8fbd10924685d2531c18652da/Parser/LessVariablesParser.php#L200-L221 |
225,104 | SetBased/php-abc-form | src/Validator/LengthValidator.php | LengthValidator.validate | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value==='' || $value===null || $value===false)
{
return true;
}
// Objects and arrays are not valid.
if (!is_scalar($value))
{
return false;
}
... | php | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value==='' || $value===null || $value===false)
{
return true;
}
// Objects and arrays are not valid.
if (!is_scalar($value))
{
return false;
}
... | [
"public",
"function",
"validate",
"(",
"Control",
"$",
"control",
")",
":",
"bool",
"{",
"$",
"value",
"=",
"$",
"control",
"->",
"getSubmittedValue",
"(",
")",
";",
"// An empty value is valid.",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
... | Returns true if the length of the value of a form control is within the specified range. Otherwise returns false.
Note:
* Empty values are considered valid.
@param Control $control The form control.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"the",
"length",
"of",
"the",
"value",
"of",
"a",
"form",
"control",
"is",
"within",
"the",
"specified",
"range",
".",
"Otherwise",
"returns",
"false",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/LengthValidator.php#L59-L78 |
225,105 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderFile.php | AppenderFile.openFile | protected function openFile() {
$file = $this->getTargetFile();
// Create the target folder if needed
if(!is_file($file)) {
$dir = dirname($file);
if(!is_dir($dir)) {
$success = \n2n\io\IoUtils::mkdirs($dir, 0777, true);
if ($success === false) {
$this->warn("Failed creating target ... | php | protected function openFile() {
$file = $this->getTargetFile();
// Create the target folder if needed
if(!is_file($file)) {
$dir = dirname($file);
if(!is_dir($dir)) {
$success = \n2n\io\IoUtils::mkdirs($dir, 0777, true);
if ($success === false) {
$this->warn("Failed creating target ... | [
"protected",
"function",
"openFile",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getTargetFile",
"(",
")",
";",
"// Create the target folder if needed\r",
"if",
"(",
"!",
"is_file",
"(",
"$",
"file",
")",
")",
"{",
"$",
"dir",
"=",
"dirname",
"(... | Acquires the target file resource, creates the destination folder if
necessary. Writes layout header to file.
@return boolean FALSE if opening failed | [
"Acquires",
"the",
"target",
"file",
"resource",
"creates",
"the",
"destination",
"folder",
"if",
"necessary",
".",
"Writes",
"layout",
"header",
"to",
"file",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderFile.php#L82-L115 |
225,106 | n2n/n2n-log4php | src/app/n2n/log4php/appender/daily/DailyFile.php | DailyFile.append | public function append(\n2n\log4php\logging\LoggingEvent $event) {
$eventDate = $this->getDate($event->getTimestamp());
// Initial setting of current date
if (!isset($this->currentDate)) {
$this->currentDate = $eventDate;
}
// Check if rollover is needed
else if ($this->currentDate !== $e... | php | public function append(\n2n\log4php\logging\LoggingEvent $event) {
$eventDate = $this->getDate($event->getTimestamp());
// Initial setting of current date
if (!isset($this->currentDate)) {
$this->currentDate = $eventDate;
}
// Check if rollover is needed
else if ($this->currentDate !== $e... | [
"public",
"function",
"append",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
"\\",
"LoggingEvent",
"$",
"event",
")",
"{",
"$",
"eventDate",
"=",
"$",
"this",
"->",
"getDate",
"(",
"$",
"event",
"->",
"getTimestamp",
"(",
")",
")",
";",
"// Init... | Appends a logging event.
If the target file changes because of passage of time (e.g. at midnight)
the current file is closed. A new file, with the new date, will be
opened by the write() method. | [
"Appends",
"a",
"logging",
"event",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/daily/DailyFile.php#L78-L102 |
225,107 | czogori/Dami | src/Dami/Migration.php | Migration.migrate | public function migrate($version = null, $message = null, $up = true)
{
return $this->execute($version, $message, $up);
} | php | public function migrate($version = null, $message = null, $up = true)
{
return $this->execute($version, $message, $up);
} | [
"public",
"function",
"migrate",
"(",
"$",
"version",
"=",
"null",
",",
"$",
"message",
"=",
"null",
",",
"$",
"up",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"version",
",",
"$",
"message",
",",
"$",
"up",
")",
";"... | Migrate the schema to the given version.
@return integer Number of migrations. | [
"Migrate",
"the",
"schema",
"to",
"the",
"given",
"version",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration.php#L32-L35 |
225,108 | czogori/Dami | src/Dami/Migration.php | Migration.execute | private function execute($version = null, $message = null, $up = true)
{
$files = $this->migrationFiles->get($version, $up);
if (null === $files) {
return 0;
}
$this->schemaManipulation->execute('BEGIN');
try {
foreach ($files as $file) {
... | php | private function execute($version = null, $message = null, $up = true)
{
$files = $this->migrationFiles->get($version, $up);
if (null === $files) {
return 0;
}
$this->schemaManipulation->execute('BEGIN');
try {
foreach ($files as $file) {
... | [
"private",
"function",
"execute",
"(",
"$",
"version",
"=",
"null",
",",
"$",
"message",
"=",
"null",
",",
"$",
"up",
"=",
"true",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"migrationFiles",
"->",
"get",
"(",
"$",
"version",
",",
"$",
"up",
... | Execute migrate.
@param string $version The version of migration to rollback or migrate.
@return integer Number of executed migrations. | [
"Execute",
"migrate",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration.php#L66-L106 |
225,109 | railken/amethyst-data-builder | src/DataBuilders/CommonDataBuilder.php | CommonDataBuilder.extract | public function extract(Collection $resources, Closure $callback)
{
foreach ($resources as $resource) {
$callback($resource, [$this->inflector->singularize($this->getVariableName()) => $resource]);
}
} | php | public function extract(Collection $resources, Closure $callback)
{
foreach ($resources as $resource) {
$callback($resource, [$this->inflector->singularize($this->getVariableName()) => $resource]);
}
} | [
"public",
"function",
"extract",
"(",
"Collection",
"$",
"resources",
",",
"Closure",
"$",
"callback",
")",
"{",
"foreach",
"(",
"$",
"resources",
"as",
"$",
"resource",
")",
"{",
"$",
"callback",
"(",
"$",
"resource",
",",
"[",
"$",
"this",
"->",
"inf... | Extract a single resource.
@param Collection $resources
@param \Closure $callback | [
"Extract",
"a",
"single",
"resource",
"."
] | 55334227b6b7f14cf755b02e7cd36a11db00f454 | https://github.com/railken/amethyst-data-builder/blob/55334227b6b7f14cf755b02e7cd36a11db00f454/src/DataBuilders/CommonDataBuilder.php#L73-L78 |
225,110 | railken/amethyst-data-builder | src/DataBuilders/CommonDataBuilder.php | CommonDataBuilder.parse | public function parse(Collection $resources): Collection
{
return new Collection([$this->inflector->pluralize($this->getVariableName()) => $resources]);
} | php | public function parse(Collection $resources): Collection
{
return new Collection([$this->inflector->pluralize($this->getVariableName()) => $resources]);
} | [
"public",
"function",
"parse",
"(",
"Collection",
"$",
"resources",
")",
":",
"Collection",
"{",
"return",
"new",
"Collection",
"(",
"[",
"$",
"this",
"->",
"inflector",
"->",
"pluralize",
"(",
"$",
"this",
"->",
"getVariableName",
"(",
")",
")",
"=>",
"... | Parse collection of resources.
@param Collection $resources
@return Collection | [
"Parse",
"collection",
"of",
"resources",
"."
] | 55334227b6b7f14cf755b02e7cd36a11db00f454 | https://github.com/railken/amethyst-data-builder/blob/55334227b6b7f14cf755b02e7cd36a11db00f454/src/DataBuilders/CommonDataBuilder.php#L87-L90 |
225,111 | SetBased/php-abc-form | src/Form.php | Form.csrfCheck | public function csrfCheck()
{
// Return immediately if CSRF check is disabled.
if (!$this->csrfCheck) return;
$control = $this->hiddenFieldSet->getFormControlByName('ses_csrf_token');
// If CSRF tokens (from session and from submitted form) don't match: possible CSRF attack.
$ses_csrf_token1 = A... | php | public function csrfCheck()
{
// Return immediately if CSRF check is disabled.
if (!$this->csrfCheck) return;
$control = $this->hiddenFieldSet->getFormControlByName('ses_csrf_token');
// If CSRF tokens (from session and from submitted form) don't match: possible CSRF attack.
$ses_csrf_token1 = A... | [
"public",
"function",
"csrfCheck",
"(",
")",
"{",
"// Return immediately if CSRF check is disabled.",
"if",
"(",
"!",
"$",
"this",
"->",
"csrfCheck",
")",
"return",
";",
"$",
"control",
"=",
"$",
"this",
"->",
"hiddenFieldSet",
"->",
"getFormControlByName",
"(",
... | Defends against CSRF attacks using State Full Double Submit Cookie.
@throws RuntimeException | [
"Defends",
"against",
"CSRF",
"attacks",
"using",
"State",
"Full",
"Double",
"Submit",
"Cookie",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Form.php#L88-L102 |
225,112 | swayok/peskyorm-laravel | src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php | KeyValueTableHelpers.getMainForeignKeyColumnName | public function getMainForeignKeyColumnName() {
/** @var KeyValueTableInterface $this */
if (empty($this->_detectedMainForeignKeyColumnName)) {
foreach ($this->getTableStructure()->getRelations() as $relationConfig) {
if ($relationConfig->getType() === Relation::BELONGS_TO) {... | php | public function getMainForeignKeyColumnName() {
/** @var KeyValueTableInterface $this */
if (empty($this->_detectedMainForeignKeyColumnName)) {
foreach ($this->getTableStructure()->getRelations() as $relationConfig) {
if ($relationConfig->getType() === Relation::BELONGS_TO) {... | [
"public",
"function",
"getMainForeignKeyColumnName",
"(",
")",
"{",
"/** @var KeyValueTableInterface $this */",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_detectedMainForeignKeyColumnName",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getTableStructure",
"(",... | Override if you wish to provide key manually
@return string|null - null returned when there is no foreign key
@throws \UnexpectedValueException
@throws \InvalidArgumentException
@throws \BadMethodCallException | [
"Override",
"if",
"you",
"wish",
"to",
"provide",
"key",
"manually"
] | ae5a285790eade3435f9fcbb6c376b755a5c3956 | https://github.com/swayok/peskyorm-laravel/blob/ae5a285790eade3435f9fcbb6c376b755a5c3956/src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php#L37-L53 |
225,113 | swayok/peskyorm-laravel | src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php | KeyValueTableHelpers.makeDataForRecord | static public function makeDataForRecord($key, $value, $foreignKeyValue = null) {
$record = [
static::getKeysColumnName() => $key,
static::getValuesColumnName() => static::encodeValue($value),
];
if ($foreignKeyValue !== null && ($foreignKeyColumn = static::getInstance()-... | php | static public function makeDataForRecord($key, $value, $foreignKeyValue = null) {
$record = [
static::getKeysColumnName() => $key,
static::getValuesColumnName() => static::encodeValue($value),
];
if ($foreignKeyValue !== null && ($foreignKeyColumn = static::getInstance()-... | [
"static",
"public",
"function",
"makeDataForRecord",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"foreignKeyValue",
"=",
"null",
")",
"{",
"$",
"record",
"=",
"[",
"static",
"::",
"getKeysColumnName",
"(",
")",
"=>",
"$",
"key",
",",
"static",
"::",
... | Make array that represents DB record and can be saved to DB
@param string $key
@param mixed $value
@param mixed $foreignKeyValue
@return array | [
"Make",
"array",
"that",
"represents",
"DB",
"record",
"and",
"can",
"be",
"saved",
"to",
"DB"
] | ae5a285790eade3435f9fcbb6c376b755a5c3956 | https://github.com/swayok/peskyorm-laravel/blob/ae5a285790eade3435f9fcbb6c376b755a5c3956/src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php#L77-L86 |
225,114 | swayok/peskyorm-laravel | src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php | KeyValueTableHelpers.convertToDataForRecords | static public function convertToDataForRecords(array $settingsAssoc, $foreignKeyValue = null, $additionalConstantValues = []) {
$records = [];
foreach ($settingsAssoc as $key => $value) {
$records[] = array_merge(
$additionalConstantValues,
static::makeDataFor... | php | static public function convertToDataForRecords(array $settingsAssoc, $foreignKeyValue = null, $additionalConstantValues = []) {
$records = [];
foreach ($settingsAssoc as $key => $value) {
$records[] = array_merge(
$additionalConstantValues,
static::makeDataFor... | [
"static",
"public",
"function",
"convertToDataForRecords",
"(",
"array",
"$",
"settingsAssoc",
",",
"$",
"foreignKeyValue",
"=",
"null",
",",
"$",
"additionalConstantValues",
"=",
"[",
"]",
")",
"{",
"$",
"records",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
... | Convert associative array to arrays that represent DB record and are ready for saving to DB
@param array $settingsAssoc - associative array of settings
@param mixed $foreignKeyValue
@param array $additionalConstantValues - contains constant values for all records (for example: admin id)
@return array | [
"Convert",
"associative",
"array",
"to",
"arrays",
"that",
"represent",
"DB",
"record",
"and",
"are",
"ready",
"for",
"saving",
"to",
"DB"
] | ae5a285790eade3435f9fcbb6c376b755a5c3956 | https://github.com/swayok/peskyorm-laravel/blob/ae5a285790eade3435f9fcbb6c376b755a5c3956/src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php#L107-L116 |
225,115 | swayok/peskyorm-laravel | src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php | KeyValueTableHelpers.decodeValues | static public function decodeValues(array $settingsAssoc) {
foreach ($settingsAssoc as $key => &$value) {
$value = static::decodeValue($value);
}
return $settingsAssoc;
} | php | static public function decodeValues(array $settingsAssoc) {
foreach ($settingsAssoc as $key => &$value) {
$value = static::decodeValue($value);
}
return $settingsAssoc;
} | [
"static",
"public",
"function",
"decodeValues",
"(",
"array",
"$",
"settingsAssoc",
")",
"{",
"foreach",
"(",
"$",
"settingsAssoc",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"static",
"::",
"decodeValue",
"(",
"$",
"value",
... | Decode values for passed settings associative array
@param array $settingsAssoc
@return mixed | [
"Decode",
"values",
"for",
"passed",
"settings",
"associative",
"array"
] | ae5a285790eade3435f9fcbb6c376b755a5c3956 | https://github.com/swayok/peskyorm-laravel/blob/ae5a285790eade3435f9fcbb6c376b755a5c3956/src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php#L123-L128 |
225,116 | swayok/peskyorm-laravel | src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php | KeyValueTableHelpers.updateOrCreateRecord | static public function updateOrCreateRecord(array $data) {
if (empty($data[static::getKeysColumnName()])) {
throw new \InvalidArgumentException(
'$record argument does not contain value for key \'' . static::getKeysColumnName() . '\' or its value is empty'
);
} el... | php | static public function updateOrCreateRecord(array $data) {
if (empty($data[static::getKeysColumnName()])) {
throw new \InvalidArgumentException(
'$record argument does not contain value for key \'' . static::getKeysColumnName() . '\' or its value is empty'
);
} el... | [
"static",
"public",
"function",
"updateOrCreateRecord",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"static",
"::",
"getKeysColumnName",
"(",
")",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"("... | Update existing value or create new one
@param array $data - must contain: key, foreign_key, value
@return Record
@throws \PeskyORM\Exception\RecordNotFoundException
@throws \UnexpectedValueException
@throws \PeskyORM\Exception\OrmException
@throws \PeskyORM\Exception\InvalidTableColumnConfigException
@throws \PeskyORM... | [
"Update",
"existing",
"value",
"or",
"create",
"new",
"one"
] | ae5a285790eade3435f9fcbb6c376b755a5c3956 | https://github.com/swayok/peskyorm-laravel/blob/ae5a285790eade3435f9fcbb6c376b755a5c3956/src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php#L170-L205 |
225,117 | swayok/peskyorm-laravel | src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php | KeyValueTableHelpers.updateOrCreateRecords | static public function updateOrCreateRecords(array $records) {
$table = static::getInstance();
$alreadyInTransaction = $table::inTransaction();
if (!$alreadyInTransaction) {
$table::beginTransaction();
}
try {
foreach ($records as $record) {
... | php | static public function updateOrCreateRecords(array $records) {
$table = static::getInstance();
$alreadyInTransaction = $table::inTransaction();
if (!$alreadyInTransaction) {
$table::beginTransaction();
}
try {
foreach ($records as $record) {
... | [
"static",
"public",
"function",
"updateOrCreateRecords",
"(",
"array",
"$",
"records",
")",
"{",
"$",
"table",
"=",
"static",
"::",
"getInstance",
"(",
")",
";",
"$",
"alreadyInTransaction",
"=",
"$",
"table",
"::",
"inTransaction",
"(",
")",
";",
"if",
"(... | Update existing values and create new
@param array $records
@return bool | [
"Update",
"existing",
"values",
"and",
"create",
"new"
] | ae5a285790eade3435f9fcbb6c376b755a5c3956 | https://github.com/swayok/peskyorm-laravel/blob/ae5a285790eade3435f9fcbb6c376b755a5c3956/src/PeskyORMLaravel/Db/KeyValueTableUtils/KeyValueTableHelpers.php#L212-L239 |
225,118 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Common/EncodingResponse.php | EncodingResponse.getErrorMessage | public function getErrorMessage()
{
$errorValue = null;
if ($this->hasError()) {
$errorValue = (string) $this->xmlElement->errors->error;
}
return $errorValue;
} | php | public function getErrorMessage()
{
$errorValue = null;
if ($this->hasError()) {
$errorValue = (string) $this->xmlElement->errors->error;
}
return $errorValue;
} | [
"public",
"function",
"getErrorMessage",
"(",
")",
"{",
"$",
"errorValue",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"hasError",
"(",
")",
")",
"{",
"$",
"errorValue",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"xmlElement",
"->",
"errors",
"-... | Returns the error message
@return string Error message | [
"Returns",
"the",
"error",
"message"
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Common/EncodingResponse.php#L68-L75 |
225,119 | DrNixx/yii2-onix | src/collections/AbstractSortedSet.php | AbstractSortedSet.offsetGet | public function offsetGet($element)
{
try {
return (bool) $this->map->find($element);
} catch (\OutOfBoundsException $e) {
return false;
}
} | php | public function offsetGet($element)
{
try {
return (bool) $this->map->find($element);
} catch (\OutOfBoundsException $e) {
return false;
}
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"element",
")",
"{",
"try",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"map",
"->",
"find",
"(",
"$",
"element",
")",
";",
"}",
"catch",
"(",
"\\",
"OutOfBoundsException",
"$",
"e",
")",
"{",
"r... | Get the value for an element
@param mixed $element The element
@return mixed The found value | [
"Get",
"the",
"value",
"for",
"an",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/AbstractSortedSet.php#L193-L200 |
225,120 | SlayerBirden/dataflow | src/Pipe/Map.php | Map.pass | public function pass(DataBagInterface $dataBag): DataBagInterface
{
$dataBag[$this->field] = ($this->callback)($dataBag[$this->field] ?? null, $dataBag);
return $dataBag;
} | php | public function pass(DataBagInterface $dataBag): DataBagInterface
{
$dataBag[$this->field] = ($this->callback)($dataBag[$this->field] ?? null, $dataBag);
return $dataBag;
} | [
"public",
"function",
"pass",
"(",
"DataBagInterface",
"$",
"dataBag",
")",
":",
"DataBagInterface",
"{",
"$",
"dataBag",
"[",
"$",
"this",
"->",
"field",
"]",
"=",
"(",
"$",
"this",
"->",
"callback",
")",
"(",
"$",
"dataBag",
"[",
"$",
"this",
"->",
... | Mapping handler.
Proceeds to transform an entry to a new value using callback function.
{@inheritdoc} | [
"Mapping",
"handler",
".",
"Proceeds",
"to",
"transform",
"an",
"entry",
"to",
"a",
"new",
"value",
"using",
"callback",
"function",
"."
] | a9cb826b106e882e43523d39fea319adc4893e00 | https://github.com/SlayerBirden/dataflow/blob/a9cb826b106e882e43523d39fea319adc4893e00/src/Pipe/Map.php#L39-L44 |
225,121 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerAppender.php | LoggerAppender.warn | protected function warn($message) {
$id = get_class($this) . (empty($this->name) ? '' : ":{$this->name}");
throw new \n2n\log4php\LoggerException("log4php: [$id]: $message", E_USER_WARNING);
} | php | protected function warn($message) {
$id = get_class($this) . (empty($this->name) ? '' : ":{$this->name}");
throw new \n2n\log4php\LoggerException("log4php: [$id]: $message", E_USER_WARNING);
} | [
"protected",
"function",
"warn",
"(",
"$",
"message",
")",
"{",
"$",
"id",
"=",
"get_class",
"(",
"$",
"this",
")",
".",
"(",
"empty",
"(",
"$",
"this",
"->",
"name",
")",
"?",
"''",
":",
"\":{$this->name}\"",
")",
";",
"throw",
"new",
"\\",
"n2n",... | Triggers a warning for this logger with the given message. | [
"Triggers",
"a",
"warning",
"for",
"this",
"logger",
"with",
"the",
"given",
"message",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerAppender.php#L282-L285 |
225,122 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/EncodingClient.php | EncodingClient.factory | public static function factory($config = array())
{
$config = self::getConfigCollection($config);
$client = new EncodingClient($config->get('base_url'), $config->get('userid'), $config->get('userkey'));
$client->setConfig($config);
// Add the XML service description to the client
... | php | public static function factory($config = array())
{
$config = self::getConfigCollection($config);
$client = new EncodingClient($config->get('base_url'), $config->get('userid'), $config->get('userkey'));
$client->setConfig($config);
// Add the XML service description to the client
... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"$",
"config",
"=",
"self",
"::",
"getConfigCollection",
"(",
"$",
"config",
")",
";",
"$",
"client",
"=",
"new",
"EncodingClient",
"(",
"$",
"config",
"->... | Create new EncodingClient Instance
@param array|Collection $config
Configuration data. Array keys:
base_url - http(s)://manage.encoding.com
userid - API User Id
userkey - API Key
@return EncodingClient | [
"Create",
"new",
"EncodingClient",
"Instance"
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/EncodingClient.php#L38-L51 |
225,123 | stubbles/stubbles-input | src/main/php/broker/RequestBroker.php | RequestBroker.buildInTypes | public static function buildInTypes(): array
{
if (null === self::$buildInParamBroker) {
self::$buildInParamBroker = [
'array' => new param\ArrayParamBroker(),
'bool' => new param\BoolParamBroker(),
'customdatespan' =... | php | public static function buildInTypes(): array
{
if (null === self::$buildInParamBroker) {
self::$buildInParamBroker = [
'array' => new param\ArrayParamBroker(),
'bool' => new param\BoolParamBroker(),
'customdatespan' =... | [
"public",
"static",
"function",
"buildInTypes",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"buildInParamBroker",
")",
"{",
"self",
"::",
"$",
"buildInParamBroker",
"=",
"[",
"'array'",
"=>",
"new",
"param",
"\\",
"ArrayParamB... | returns list of build in param brokers
@return \stubbles\input\broker\param\ParamBroker[] | [
"returns",
"list",
"of",
"build",
"in",
"param",
"brokers"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/RequestBroker.php#L38-L64 |
225,124 | stubbles/stubbles-input | src/main/php/broker/RequestBroker.php | RequestBroker.procure | public function procure(Request $request, $object, string $group = null)
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Parameter $object must be an object instance');
}
foreach (self::targetMethodsOf($object, $group) as $targetMethod) {
$targetMet... | php | public function procure(Request $request, $object, string $group = null)
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Parameter $object must be an object instance');
}
foreach (self::targetMethodsOf($object, $group) as $targetMethod) {
$targetMet... | [
"public",
"function",
"procure",
"(",
"Request",
"$",
"request",
",",
"$",
"object",
",",
"string",
"$",
"group",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"... | fills given object with values from request
@param \stubbles\input\Request $request
@param object $object the object instance to fill with values
@param string $group restrict procurement to given group
@return object
@throws \InvalidArgumentException | [
"fills",
"given",
"object",
"with",
"values",
"from",
"request"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/RequestBroker.php#L96-L111 |
225,125 | stubbles/stubbles-input | src/main/php/broker/RequestBroker.php | RequestBroker.paramBroker | public function paramBroker($type): ParamBroker
{
if (isset($this->paramBrokers[$type])) {
return $this->paramBrokers[$type];
}
throw new \RuntimeException('No param broker found for ' . $type);
} | php | public function paramBroker($type): ParamBroker
{
if (isset($this->paramBrokers[$type])) {
return $this->paramBrokers[$type];
}
throw new \RuntimeException('No param broker found for ' . $type);
} | [
"public",
"function",
"paramBroker",
"(",
"$",
"type",
")",
":",
"ParamBroker",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"paramBrokers",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"paramBrokers",
"[",
"$",
"type",
"]",... | returns param broker for requested type
@param string $type
@return \stubbles\input\broker\param\ParamBroker
@throws \RuntimeException | [
"returns",
"param",
"broker",
"for",
"requested",
"type"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/RequestBroker.php#L120-L127 |
225,126 | stubbles/stubbles-input | src/main/php/broker/RequestBroker.php | RequestBroker.targetMethodsOf | public static function targetMethodsOf($object, string $group = null): Sequence
{
return methodsOf($object, \ReflectionMethod::IS_PUBLIC)->filter(
function(\ReflectionMethod $method) use ($group)
{
if ($method->isStatic() || $method->isConstructor() || $me... | php | public static function targetMethodsOf($object, string $group = null): Sequence
{
return methodsOf($object, \ReflectionMethod::IS_PUBLIC)->filter(
function(\ReflectionMethod $method) use ($group)
{
if ($method->isStatic() || $method->isConstructor() || $me... | [
"public",
"static",
"function",
"targetMethodsOf",
"(",
"$",
"object",
",",
"string",
"$",
"group",
"=",
"null",
")",
":",
"Sequence",
"{",
"return",
"methodsOf",
"(",
"$",
"object",
",",
"\\",
"ReflectionMethod",
"::",
"IS_PUBLIC",
")",
"->",
"filter",
"(... | returns all methods of given instance which are applicable for brokerage
@param object|string|\ReflectionClass $object
@param string $group optional restrict list to given group
@return \stubbles\input\broker\TargetMethod[] | [
"returns",
"all",
"methods",
"of",
"given",
"instance",
"which",
"are",
"applicable",
"for",
"brokerage"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/RequestBroker.php#L136-L164 |
225,127 | SetBased/php-abc-form | src/Cleaner/RemoveWhitespaceCleaner.php | RemoveWhitespaceCleaner.clean | public function clean($value)
{
if ($value==='' || $value===null || $value===false)
{
return null;
}
$tmp = AmbiguityCleaner::get()->clean($value);
$tmp = str_replace([' ', "\t", "\n"], '', $tmp);
if ($tmp==='') $tmp = null;
return $tmp;
} | php | public function clean($value)
{
if ($value==='' || $value===null || $value===false)
{
return null;
}
$tmp = AmbiguityCleaner::get()->clean($value);
$tmp = str_replace([' ', "\t", "\n"], '', $tmp);
if ($tmp==='') $tmp = null;
return $tmp;
} | [
"public",
"function",
"clean",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"$",
"tmp",
"=",
"AmbiguityCleaner",
"::"... | Returns a submitted value with all whitespace removed.
@param string|null $value The submitted value.
@return string|null
@since 1.0.0
@api | [
"Returns",
"a",
"submitted",
"value",
"with",
"all",
"whitespace",
"removed",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Cleaner/RemoveWhitespaceCleaner.php#L43-L56 |
225,128 | the-support-group/validation-adaptor | src/ValidationAdaptor.php | ValidationAdaptor.getMappedMethod | public function getMappedMethod($method)
{
// Check if the method called is provided in the mapping.
if (!array_key_exists($method, self::$validatorMapping)) {
throw new Exception(sprintf(
'Mapping for method "%s" not found, make sure it exists in the mapping file.',
... | php | public function getMappedMethod($method)
{
// Check if the method called is provided in the mapping.
if (!array_key_exists($method, self::$validatorMapping)) {
throw new Exception(sprintf(
'Mapping for method "%s" not found, make sure it exists in the mapping file.',
... | [
"public",
"function",
"getMappedMethod",
"(",
"$",
"method",
")",
"{",
"// Check if the method called is provided in the mapping.",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"method",
",",
"self",
"::",
"$",
"validatorMapping",
")",
")",
"{",
"throw",
"new",
"... | Get mapped method.
@param string $method The validation method to map.
@return string | [
"Get",
"mapped",
"method",
"."
] | 23c2a5d4cd7f1a914b4e32f064e703558f4dd23b | https://github.com/the-support-group/validation-adaptor/blob/23c2a5d4cd7f1a914b4e32f064e703558f4dd23b/src/ValidationAdaptor.php#L77-L88 |
225,129 | UCSLabs/Referenceable | ReferenceGeneratorCollection.php | ReferenceGeneratorCollection.add | public function add(ReferenceGeneratorInterface $generator)
{
$this->generators[] = $generator;
usort($this->generators,array($this,'compareGenerators'));
} | php | public function add(ReferenceGeneratorInterface $generator)
{
$this->generators[] = $generator;
usort($this->generators,array($this,'compareGenerators'));
} | [
"public",
"function",
"add",
"(",
"ReferenceGeneratorInterface",
"$",
"generator",
")",
"{",
"$",
"this",
"->",
"generators",
"[",
"]",
"=",
"$",
"generator",
";",
"usort",
"(",
"$",
"this",
"->",
"generators",
",",
"array",
"(",
"$",
"this",
",",
"'comp... | Adds a generator.
@param string $name The generator name
@param ReferenceGeneratorInterface $generator A ReferenceGeneratorInterface instance
@api | [
"Adds",
"a",
"generator",
"."
] | 72cef440197898605237805293109be1e4a79d67 | https://github.com/UCSLabs/Referenceable/blob/72cef440197898605237805293109be1e4a79d67/ReferenceGeneratorCollection.php#L74-L78 |
225,130 | UCSLabs/Referenceable | ReferenceGeneratorCollection.php | ReferenceGeneratorCollection.get | public function get($index)
{
if( $index >= count($this->generators) || $index < 0 )
return null;
return $this->generators[$index];
} | php | public function get($index)
{
if( $index >= count($this->generators) || $index < 0 )
return null;
return $this->generators[$index];
} | [
"public",
"function",
"get",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"index",
">=",
"count",
"(",
"$",
"this",
"->",
"generators",
")",
"||",
"$",
"index",
"<",
"0",
")",
"return",
"null",
";",
"return",
"$",
"this",
"->",
"generators",
"[",
... | Gets a generator by name.
@param integer $index get the generator at the given index
@return ReferenceGeneratorInterface|null A ReferenceGeneratorInterface
instance or null when not found | [
"Gets",
"a",
"generator",
"by",
"name",
"."
] | 72cef440197898605237805293109be1e4a79d67 | https://github.com/UCSLabs/Referenceable/blob/72cef440197898605237805293109be1e4a79d67/ReferenceGeneratorCollection.php#L98-L104 |
225,131 | UCSLabs/Referenceable | ReferenceGeneratorCollection.php | ReferenceGeneratorCollection.remove | public function remove($index)
{
if( $index >= count($this->generators) || $index < 0 )
return;
unset($this->generators[$index]);
$this->generators = array_values($this->generators);
} | php | public function remove($index)
{
if( $index >= count($this->generators) || $index < 0 )
return;
unset($this->generators[$index]);
$this->generators = array_values($this->generators);
} | [
"public",
"function",
"remove",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"index",
">=",
"count",
"(",
"$",
"this",
"->",
"generators",
")",
"||",
"$",
"index",
"<",
"0",
")",
"return",
";",
"unset",
"(",
"$",
"this",
"->",
"generators",
"[",
... | Removes a generator or an array of generators by name from the collection
@param string|array $name The generator name or an array of generator names | [
"Removes",
"a",
"generator",
"or",
"an",
"array",
"of",
"generators",
"by",
"name",
"from",
"the",
"collection"
] | 72cef440197898605237805293109be1e4a79d67 | https://github.com/UCSLabs/Referenceable/blob/72cef440197898605237805293109be1e4a79d67/ReferenceGeneratorCollection.php#L111-L118 |
225,132 | UCSLabs/Referenceable | ReferenceGeneratorCollection.php | ReferenceGeneratorCollection.addCollection | public function addCollection(ReferenceGeneratorCollection $collection)
{
// we need to remove all generators with the same names first because
// just replacing them
// would not place the new generator at the end of the merged array
foreach ($collection->all() as $generator) {
... | php | public function addCollection(ReferenceGeneratorCollection $collection)
{
// we need to remove all generators with the same names first because
// just replacing them
// would not place the new generator at the end of the merged array
foreach ($collection->all() as $generator) {
... | [
"public",
"function",
"addCollection",
"(",
"ReferenceGeneratorCollection",
"$",
"collection",
")",
"{",
"// we need to remove all generators with the same names first because ",
"// just replacing them",
"// would not place the new generator at the end of the merged array",
"foreach",
"("... | Adds a generator collection at the end of the current set by appending all
generators of the added collection.
@param ReferenceGeneratorCollection $collection
A ReferenceGeneratorCollection instance
@api | [
"Adds",
"a",
"generator",
"collection",
"at",
"the",
"end",
"of",
"the",
"current",
"set",
"by",
"appending",
"all",
"generators",
"of",
"the",
"added",
"collection",
"."
] | 72cef440197898605237805293109be1e4a79d67 | https://github.com/UCSLabs/Referenceable/blob/72cef440197898605237805293109be1e4a79d67/ReferenceGeneratorCollection.php#L129-L139 |
225,133 | yawik/behat | src/MailContext.php | MailContext.beforeScenario | public function beforeScenario(BeforeScenarioScope $scope)
{
$core = $scope->getEnvironment()->getContext(CoreContext::class);
/* @var FileTransport $transport */
$transport = $core->getServiceManager()->get('Core/MailService')->getTransport();
$path = $transport->getOptions()->getPa... | php | public function beforeScenario(BeforeScenarioScope $scope)
{
$core = $scope->getEnvironment()->getContext(CoreContext::class);
/* @var FileTransport $transport */
$transport = $core->getServiceManager()->get('Core/MailService')->getTransport();
$path = $transport->getOptions()->getPa... | [
"public",
"function",
"beforeScenario",
"(",
"BeforeScenarioScope",
"$",
"scope",
")",
"{",
"$",
"core",
"=",
"$",
"scope",
"->",
"getEnvironment",
"(",
")",
"->",
"getContext",
"(",
"CoreContext",
"::",
"class",
")",
";",
"/* @var FileTransport $transport */",
... | Cleans all files before start test
@BeforeScenario @mail
@param BeforeScenarioScope $scope | [
"Cleans",
"all",
"files",
"before",
"start",
"test"
] | 9e776b8aa8a069da13e35d717f7bb35c2f96b277 | https://github.com/yawik/behat/blob/9e776b8aa8a069da13e35d717f7bb35c2f96b277/src/MailContext.php#L47-L58 |
225,134 | GFG/dto-context | src/DTOContext/Context/Base.php | Base.prepareExport | protected function prepareExport($data)
{
return [
'name' => $this->getName(),
'info' => $this->info,
'hash' => $this->getHash(),
'data_wrapper' => get_class($this->getDatawrapper()),
'data' => $data
];
} | php | protected function prepareExport($data)
{
return [
'name' => $this->getName(),
'info' => $this->info,
'hash' => $this->getHash(),
'data_wrapper' => get_class($this->getDatawrapper()),
'data' => $data
];
} | [
"protected",
"function",
"prepareExport",
"(",
"$",
"data",
")",
"{",
"return",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"'info'",
"=>",
"$",
"this",
"->",
"info",
",",
"'hash'",
"=>",
"$",
"this",
"->",
"getHash",
"(",
")",
... | Prepare the info to be exported
@param array
@return array | [
"Prepare",
"the",
"info",
"to",
"be",
"exported"
] | c1a47273d3dc2704bfd3f90c2560726688d54558 | https://github.com/GFG/dto-context/blob/c1a47273d3dc2704bfd3f90c2560726688d54558/src/DTOContext/Context/Base.php#L188-L197 |
225,135 | Finesse/MiniDB | src/Database.php | Database.table | public function table($table, string $alias = null): Query
{
return $this->builder()->table($table, $alias);
} | php | public function table($table, string $alias = null): Query
{
return $this->builder()->table($table, $alias);
} | [
"public",
"function",
"table",
"(",
"$",
"table",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"Query",
"{",
"return",
"$",
"this",
"->",
"builder",
"(",
")",
"->",
"table",
"(",
"$",
"table",
",",
"$",
"alias",
")",
";",
"}"
] | Makes a query builder instance with a selected table.
@param string|\Closure|Query|StatementInterface $table Not prefixed table name without quotes
@param string|null $alias Table alias. Warning! Alias is not allowed in insert, update and delete queries in some
of the DBMSs.
@return Query
@throws InvalidArgumentExcept... | [
"Makes",
"a",
"query",
"builder",
"instance",
"with",
"a",
"selected",
"table",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Database.php#L125-L128 |
225,136 | Finesse/MiniDB | src/Database.php | Database.withTablePrefix | public function withTablePrefix(string $prefix): self
{
return new static($this->connection, $this->grammar, new TablePrefixer($prefix));
} | php | public function withTablePrefix(string $prefix): self
{
return new static($this->connection, $this->grammar, new TablePrefixer($prefix));
} | [
"public",
"function",
"withTablePrefix",
"(",
"string",
"$",
"prefix",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"grammar",
",",
"new",
"TablePrefixer",
"(",
"$",
"prefix",
")",
")",
... | Makes a self copy with the same dependencies instances but with another table prefix.
@param string $prefix Table prefix
@return static | [
"Makes",
"a",
"self",
"copy",
"with",
"the",
"same",
"dependencies",
"instances",
"but",
"with",
"another",
"table",
"prefix",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Database.php#L160-L163 |
225,137 | Finesse/MiniDB | src/Database.php | Database.withTablesPrefixed | public function withTablesPrefixed(string $prefix): self
{
return new static(
$this->connection,
$this->grammar,
new TablePrefixer($prefix.$this->tablePrefixer->tablePrefix)
);
} | php | public function withTablesPrefixed(string $prefix): self
{
return new static(
$this->connection,
$this->grammar,
new TablePrefixer($prefix.$this->tablePrefixer->tablePrefix)
);
} | [
"public",
"function",
"withTablesPrefixed",
"(",
"string",
"$",
"prefix",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"grammar",
",",
"new",
"TablePrefixer",
"(",
"$",
"prefix",
".",
"$"... | Makes a self copy with the same dependencies instances but with added table prefix.
The table prefix is not replaced, it is prefixed. For example, if an instance table prefix is `demo_`, calling
this method with the argument `test_` will make an instance with `test_demo_` table prefix.
@param string $prefix Table pre... | [
"Makes",
"a",
"self",
"copy",
"with",
"the",
"same",
"dependencies",
"instances",
"but",
"with",
"added",
"table",
"prefix",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Database.php#L174-L181 |
225,138 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerHierarchy.php | LoggerHierarchy.isDisabled | public function isDisabled(\n2n\log4php\LoggerLevel $level) {
return ($this->threshold->toInt() > $level->toInt());
} | php | public function isDisabled(\n2n\log4php\LoggerLevel $level) {
return ($this->threshold->toInt() > $level->toInt());
} | [
"public",
"function",
"isDisabled",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"$",
"level",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"threshold",
"->",
"toInt",
"(",
")",
">",
"$",
"level",
"->",
"toInt",
"(",
")",
")",
";",
"}"
] | Returns true if the hierarchy is disabled for given log level and false
otherwise.
@return boolean | [
"Returns",
"true",
"if",
"the",
"hierarchy",
"is",
"disabled",
"for",
"given",
"log",
"level",
"and",
"false",
"otherwise",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerHierarchy.php#L177-L179 |
225,139 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerHierarchy.php | LoggerHierarchy.resetConfiguration | public function resetConfiguration() {
$root = $this->getRootLogger();
$root->setLevel(\n2n\log4php\LoggerLevel::getLevelDebug());
$this->setThreshold(\n2n\log4php\LoggerLevel::getLevelAll());
$this->shutDown();
foreach($this->loggers as $logger) {
$logger->setLevel(null);
$logger->setAdd... | php | public function resetConfiguration() {
$root = $this->getRootLogger();
$root->setLevel(\n2n\log4php\LoggerLevel::getLevelDebug());
$this->setThreshold(\n2n\log4php\LoggerLevel::getLevelAll());
$this->shutDown();
foreach($this->loggers as $logger) {
$logger->setLevel(null);
$logger->setAdd... | [
"public",
"function",
"resetConfiguration",
"(",
")",
"{",
"$",
"root",
"=",
"$",
"this",
"->",
"getRootLogger",
"(",
")",
";",
"$",
"root",
"->",
"setLevel",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"::",
"getLevelDebug",
"(",
")",
")",
... | Reset all values contained in this hierarchy instance to their
default.
This removes all appenders from all loggers, sets
the level of all non-root loggers to <i>null</i>,
sets their additivity flag to <i>true</i> and sets the level
of the root logger to {@link LOGGER_LEVEL_DEBUG}.
<p>Existing loggers are not removed... | [
"Reset",
"all",
"values",
"contained",
"in",
"this",
"hierarchy",
"instance",
"to",
"their",
"default",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerHierarchy.php#L195-L210 |
225,140 | DrNixx/yii2-onix | src/collections/AbstractMap.php | AbstractMap.hashKey | protected function hashKey($key)
{
if ($key instanceof \DateTime) {
return md5('_' . $key->format('c'));
} elseif (is_object($key)) {
return spl_object_hash($key);
} elseif (false === $key) {
return md5('_false');
} elseif (true === $key) {
... | php | protected function hashKey($key)
{
if ($key instanceof \DateTime) {
return md5('_' . $key->format('c'));
} elseif (is_object($key)) {
return spl_object_hash($key);
} elseif (false === $key) {
return md5('_false');
} elseif (true === $key) {
... | [
"protected",
"function",
"hashKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"instanceof",
"\\",
"DateTime",
")",
"{",
"return",
"md5",
"(",
"'_'",
".",
"$",
"key",
"->",
"format",
"(",
"'c'",
")",
")",
";",
"}",
"elseif",
"(",
"is_object"... | Hash a key.
@param mixed $key Key to be hashed.
@return string|int Hashed key. | [
"Hash",
"a",
"key",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/AbstractMap.php#L65-L87 |
225,141 | OPCVM360/sdk-php | Services/OPCVM360.php | Services_OPCVM360.buildQuery | public static function buildQuery($queryData)
{
$query = '';
// Loop through all of the $query_data
foreach ($queryData as $key => $value) {
// If the value is an array, we will end up recursing
if (is_array($value)) {
// Loop through the values
... | php | public static function buildQuery($queryData)
{
$query = '';
// Loop through all of the $query_data
foreach ($queryData as $key => $value) {
// If the value is an array, we will end up recursing
if (is_array($value)) {
// Loop through the values
... | [
"public",
"static",
"function",
"buildQuery",
"(",
"$",
"queryData",
")",
"{",
"$",
"query",
"=",
"''",
";",
"// Loop through all of the $query_data",
"foreach",
"(",
"$",
"queryData",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"// If the value is an array,... | Build a query string from query data
:param array $queryData: An associative array of keys and values. The
values can be a simple type or a list, in which case the list is
converted to multiple query parameters with the same key.
:param string $queryStringStyle: Determine how to build the url
- strict: Build a standar... | [
"Build",
"a",
"query",
"string",
"from",
"query",
"data"
] | f21c0eec3a917c31a73a66e32978a1179a864549 | https://github.com/OPCVM360/sdk-php/blob/f21c0eec3a917c31a73a66e32978a1179a864549/Services/OPCVM360.php#L83-L110 |
225,142 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php | XmlAbstractCommand.process | protected function process()
{
// Uses the response object by default
$this->result = $this->getRequest()->getResponse();
$contentType = $this->result->getContentType();
if (stripos($contentType, 'xml') === false) {
throw new \Exception('The Response is not in a valid X... | php | protected function process()
{
// Uses the response object by default
$this->result = $this->getRequest()->getResponse();
$contentType = $this->result->getContentType();
if (stripos($contentType, 'xml') === false) {
throw new \Exception('The Response is not in a valid X... | [
"protected",
"function",
"process",
"(",
")",
"{",
"// Uses the response object by default",
"$",
"this",
"->",
"result",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getResponse",
"(",
")",
";",
"$",
"contentType",
"=",
"$",
"this",
"->",
"result"... | Create the result of the command after the request has been completed.
We expect the response to be an XML, so this method converts the repons
to a SimpleXMLElement object. Also, exceptions are thrown accordingly. | [
"Create",
"the",
"result",
"of",
"the",
"command",
"after",
"the",
"request",
"has",
"been",
"completed",
".",
"We",
"expect",
"the",
"response",
"to",
"be",
"an",
"XML",
"so",
"this",
"method",
"converts",
"the",
"repons",
"to",
"a",
"SimpleXMLElement",
"... | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php#L29-L44 |
225,143 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php | XmlAbstractCommand.build | protected function build()
{
$this->rawXml = $this->buildXML();
$this->client->setDefaultOption('headers', array(
'Content-Type' => 'application/x-www-form-urlencoded'
));
$this->request = $this->client->post(null, null, array(
"xml" => ($this->rawXml->saveX... | php | protected function build()
{
$this->rawXml = $this->buildXML();
$this->client->setDefaultOption('headers', array(
'Content-Type' => 'application/x-www-form-urlencoded'
));
$this->request = $this->client->post(null, null, array(
"xml" => ($this->rawXml->saveX... | [
"protected",
"function",
"build",
"(",
")",
"{",
"$",
"this",
"->",
"rawXml",
"=",
"$",
"this",
"->",
"buildXML",
"(",
")",
";",
"$",
"this",
"->",
"client",
"->",
"setDefaultOption",
"(",
"'headers'",
",",
"array",
"(",
"'Content-Type'",
"=>",
"'applica... | Prepares the request to the API. | [
"Prepares",
"the",
"request",
"to",
"the",
"API",
"."
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php#L49-L60 |
225,144 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php | XmlAbstractCommand.buildXML | public function buildXML()
{
$xml = new EncodingRequest();
$request = $xml->setDomQuery($this->client->getConfig('userid'), $this->client->getConfig('userkey'), $this->getName());
foreach ($this->getOperation()->getParams() as $name => $arg) {
if ($this->get($name) === true) {... | php | public function buildXML()
{
$xml = new EncodingRequest();
$request = $xml->setDomQuery($this->client->getConfig('userid'), $this->client->getConfig('userkey'), $this->getName());
foreach ($this->getOperation()->getParams() as $name => $arg) {
if ($this->get($name) === true) {... | [
"public",
"function",
"buildXML",
"(",
")",
"{",
"$",
"xml",
"=",
"new",
"EncodingRequest",
"(",
")",
";",
"$",
"request",
"=",
"$",
"xml",
"->",
"setDomQuery",
"(",
"$",
"this",
"->",
"client",
"->",
"getConfig",
"(",
"'userid'",
")",
",",
"$",
"thi... | Builds the XML for the request body.
@return EncodingRequest XML in DOMDocument format | [
"Builds",
"the",
"XML",
"for",
"the",
"request",
"body",
"."
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php#L67-L123 |
225,145 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php | XmlAbstractCommand.getResponseBody | public function getResponseBody($encodeEntities = true)
{
$body = (string) $this->getResponse()->getBody();
if ($encodeEntities) {
return htmlentities($body);
}
return $body;
} | php | public function getResponseBody($encodeEntities = true)
{
$body = (string) $this->getResponse()->getBody();
if ($encodeEntities) {
return htmlentities($body);
}
return $body;
} | [
"public",
"function",
"getResponseBody",
"(",
"$",
"encodeEntities",
"=",
"true",
")",
"{",
"$",
"body",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"getBody",
"(",
")",
";",
"if",
"(",
"$",
"encodeEntities",
")",
"{",
... | Returns the response body, by default with
encoded HTML entities as string.
@param boolean $encodeEntities
Encode the HTML entities on the body
@return string Response body | [
"Returns",
"the",
"response",
"body",
"by",
"default",
"with",
"encoded",
"HTML",
"entities",
"as",
"string",
"."
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Command/XmlAbstractCommand.php#L170-L179 |
225,146 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerConfigurable.php | LoggerConfigurable.setBoolean | protected function setBoolean($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toBooleanEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a boolean value. Property no... | php | protected function setBoolean($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toBooleanEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a boolean value. Property no... | [
"protected",
"function",
"setBoolean",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"$",
"property",
"=",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"option",
"\\",
"OptionConverter",
"::",
"toBooleanEx",
"(",
"$",
"value",
... | Setter function for boolean type. | [
"Setter",
"function",
"for",
"boolean",
"type",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerConfigurable.php#L34-L41 |
225,147 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerConfigurable.php | LoggerConfigurable.setLevel | protected function setLevel($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toLevelEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a level value. Property not chan... | php | protected function setLevel($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toLevelEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a level value. Property not chan... | [
"protected",
"function",
"setLevel",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"$",
"property",
"=",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"option",
"\\",
"OptionConverter",
"::",
"toLevelEx",
"(",
"$",
"value",
")... | Setter function for LoggerLevel values. | [
"Setter",
"function",
"for",
"LoggerLevel",
"values",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerConfigurable.php#L54-L61 |
225,148 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerConfigurable.php | LoggerConfigurable.setFileSize | protected function setFileSize($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toFileSizeEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a file size value. Proper... | php | protected function setFileSize($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toFileSizeEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a file size value. Proper... | [
"protected",
"function",
"setFileSize",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"$",
"property",
"=",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"option",
"\\",
"OptionConverter",
"::",
"toFileSizeEx",
"(",
"$",
"value"... | Setter for file size. | [
"Setter",
"for",
"file",
"size",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerConfigurable.php#L74-L81 |
225,149 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerConfigurable.php | LoggerConfigurable.setNumeric | protected function setNumeric($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toNumericEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a number. Property not chang... | php | protected function setNumeric($property, $value) {
try {
$this->$property = \n2n\log4php\option\OptionConverter::toNumericEx($value);
} catch (\Exception $ex) {
$value = var_export($value, true);
$this->warn("Invalid value given for '$property' property: [$value]. Expected a number. Property not chang... | [
"protected",
"function",
"setNumeric",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"$",
"property",
"=",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"option",
"\\",
"OptionConverter",
"::",
"toNumericEx",
"(",
"$",
"value",
... | Setter function for numeric type. | [
"Setter",
"function",
"for",
"numeric",
"type",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerConfigurable.php#L84-L91 |
225,150 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerConfigurable.php | LoggerConfigurable.setString | protected function setString($property, $value, $nullable = false) {
if ($value === null) {
if($nullable) {
$this->$property= null;
} else {
$this->warn("Null value given for '$property' property. Expected a string. Property not changed.");
}
} else {
try {
$value = \n2n\log4php\opt... | php | protected function setString($property, $value, $nullable = false) {
if ($value === null) {
if($nullable) {
$this->$property= null;
} else {
$this->warn("Null value given for '$property' property. Expected a string. Property not changed.");
}
} else {
try {
$value = \n2n\log4php\opt... | [
"protected",
"function",
"setString",
"(",
"$",
"property",
",",
"$",
"value",
",",
"$",
"nullable",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"nullable",
")",
"{",
"$",
"this",
"->",
"$",
"property",... | Setter function for string type. | [
"Setter",
"function",
"for",
"string",
"type",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerConfigurable.php#L94-L110 |
225,151 | cmsgears/module-forms | common/models/forms/GenericForm.php | GenericForm.processFormSubmit | public function processFormSubmit( $form ) {
$date = DateUtil::getDateTime();
$attributes = parent::getFormAttributes();
$fields = $attributes[ 'fields' ];
$attribs = [];
$user = Yii::$app->user->getIdentity();
$formSubmit = new FormSubmit();
$formSubmit->formId = $form->id;
$formSubmit->submi... | php | public function processFormSubmit( $form ) {
$date = DateUtil::getDateTime();
$attributes = parent::getFormAttributes();
$fields = $attributes[ 'fields' ];
$attribs = [];
$user = Yii::$app->user->getIdentity();
$formSubmit = new FormSubmit();
$formSubmit->formId = $form->id;
$formSubmit->submi... | [
"public",
"function",
"processFormSubmit",
"(",
"$",
"form",
")",
"{",
"$",
"date",
"=",
"DateUtil",
"::",
"getDateTime",
"(",
")",
";",
"$",
"attributes",
"=",
"parent",
"::",
"getFormAttributes",
"(",
")",
";",
"$",
"fields",
"=",
"$",
"attributes",
"[... | Process the submitted form and save all the form fields except captcha field.
@throws \yii\web\ForbiddenHttpException
@param \cmsgears\core\common\models\resources\Form $form
@return void | [
"Process",
"the",
"submitted",
"form",
"and",
"save",
"all",
"the",
"form",
"fields",
"except",
"captcha",
"field",
"."
] | 84cbb26e8ecb945410bb2604b84440d5ed841308 | https://github.com/cmsgears/module-forms/blob/84cbb26e8ecb945410bb2604b84440d5ed841308/common/models/forms/GenericForm.php#L77-L186 |
225,152 | Positibe/CoreBundle | Repository/FilterRepository.php | FilterRepository.filterLike | public static function filterLike(QueryBuilder $queryBuilder, &$criteria, $field, $alias = 'o')
{
if (isset($criteria[$field])) {
if (!empty($criteria[$field])) {
$queryBuilder->andWhere(sprintf('%s.%s LIKE :%s', $alias, $field, $field))->setParameter(
$field,... | php | public static function filterLike(QueryBuilder $queryBuilder, &$criteria, $field, $alias = 'o')
{
if (isset($criteria[$field])) {
if (!empty($criteria[$field])) {
$queryBuilder->andWhere(sprintf('%s.%s LIKE :%s', $alias, $field, $field))->setParameter(
$field,... | [
"public",
"static",
"function",
"filterLike",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"&",
"$",
"criteria",
",",
"$",
"field",
",",
"$",
"alias",
"=",
"'o'",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"criteria",
"[",
"$",
"field",
"]",
")",
")",... | Filter a field with LIKE sql function
@param QueryBuilder $queryBuilder
@param $criteria
@param $field
@param string $alias
@return mixed | [
"Filter",
"a",
"field",
"with",
"LIKE",
"sql",
"function"
] | b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54 | https://github.com/Positibe/CoreBundle/blob/b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54/Repository/FilterRepository.php#L33-L46 |
225,153 | Positibe/CoreBundle | Repository/FilterRepository.php | FilterRepository.filterEnumByName | public static function filterEnumByName(
QueryBuilder $queryBuilder,
&$criteria,
$field,
$enumTypeName,
$isJoined = false,
$alias = 'o'
) {
if (isset($criteria[$field])) {
if (!empty($criteria[$field])) {
if (!$isJoined) {
... | php | public static function filterEnumByName(
QueryBuilder $queryBuilder,
&$criteria,
$field,
$enumTypeName,
$isJoined = false,
$alias = 'o'
) {
if (isset($criteria[$field])) {
if (!empty($criteria[$field])) {
if (!$isJoined) {
... | [
"public",
"static",
"function",
"filterEnumByName",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"&",
"$",
"criteria",
",",
"$",
"field",
",",
"$",
"enumTypeName",
",",
"$",
"isJoined",
"=",
"false",
",",
"$",
"alias",
"=",
"'o'",
")",
"{",
"if",
"(",
... | Filter an enumerator field from PositibeEnumBundle
@param QueryBuilder $queryBuilder
@param $criteria
@param $field
@param $enumTypeName
@param bool|false $isJoined
@param string $alias
@return mixed | [
"Filter",
"an",
"enumerator",
"field",
"from",
"PositibeEnumBundle"
] | b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54 | https://github.com/Positibe/CoreBundle/blob/b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54/Repository/FilterRepository.php#L95-L118 |
225,154 | Positibe/CoreBundle | Repository/FilterRepository.php | FilterRepository.filterRangeDate | public static function filterRangeDate(
QueryBuilder $queryBuilder,
&$criteria,
$field,
$fieldFrom,
$fieldTo,
$alias = 'o'
) {
if (isset($criteria[$fieldFrom]) || isset($criteria[$fieldTo]) && $criteria[$fieldTo] != '') {
if (!empty($criteria[$fiel... | php | public static function filterRangeDate(
QueryBuilder $queryBuilder,
&$criteria,
$field,
$fieldFrom,
$fieldTo,
$alias = 'o'
) {
if (isset($criteria[$fieldFrom]) || isset($criteria[$fieldTo]) && $criteria[$fieldTo] != '') {
if (!empty($criteria[$fiel... | [
"public",
"static",
"function",
"filterRangeDate",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"&",
"$",
"criteria",
",",
"$",
"field",
",",
"$",
"fieldFrom",
",",
"$",
"fieldTo",
",",
"$",
"alias",
"=",
"'o'",
")",
"{",
"if",
"(",
"isset",
"(",
"$"... | Filter a datetime field by a range
@param QueryBuilder $queryBuilder
@param $criteria
@param $field
@param $fieldFrom
@param $fieldTo
@param string $alias
@return mixed | [
"Filter",
"a",
"datetime",
"field",
"by",
"a",
"range"
] | b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54 | https://github.com/Positibe/CoreBundle/blob/b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54/Repository/FilterRepository.php#L131-L157 |
225,155 | Positibe/CoreBundle | Repository/FilterRepository.php | FilterRepository.filterToOneField | public static function filterToOneField(
QueryBuilder $queryBuilder,
&$criteria,
$field,
$toOneField,
$isJoined = false,
$alias = 'o',
$aliasField = null
) {
if (isset($criteria[$field])) {
if (!empty($criteria[$field])) {
i... | php | public static function filterToOneField(
QueryBuilder $queryBuilder,
&$criteria,
$field,
$toOneField,
$isJoined = false,
$alias = 'o',
$aliasField = null
) {
if (isset($criteria[$field])) {
if (!empty($criteria[$field])) {
i... | [
"public",
"static",
"function",
"filterToOneField",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"&",
"$",
"criteria",
",",
"$",
"field",
",",
"$",
"toOneField",
",",
"$",
"isJoined",
"=",
"false",
",",
"$",
"alias",
"=",
"'o'",
",",
"$",
"aliasField",
... | Filter a field thar has its to one relation with LIKE %x%
e.g.
FilterRepository::filterToOneField($queryBuilder, $criteria, 'name', 'collection');
FilterRepository::filterToOneField($queryBuilder, $criteria, 'name', 'collection', true, 'col'); //If collection was already joined
FilterRepository::filterToOneField($quer... | [
"Filter",
"a",
"field",
"thar",
"has",
"its",
"to",
"one",
"relation",
"with",
"LIKE",
"%x%"
] | b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54 | https://github.com/Positibe/CoreBundle/blob/b39d702ebc7e60c41b04e07a3c74ca94ee2b8a54/Repository/FilterRepository.php#L176-L199 |
225,156 | SetBased/php-abc-form | src/Control/RadiosControl.php | RadiosControl.mergeValuesBase | public function mergeValuesBase(array $values): void
{
if (array_key_exists($this->name, $values))
{
$this->setValuesBase($values);
}
} | php | public function mergeValuesBase(array $values): void
{
if (array_key_exists($this->name, $values))
{
$this->setValuesBase($values);
}
} | [
"public",
"function",
"mergeValuesBase",
"(",
"array",
"$",
"values",
")",
":",
"void",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"this",
"->",
"name",
",",
"$",
"values",
")",
")",
"{",
"$",
"this",
"->",
"setValuesBase",
"(",
"$",
"values",
")",
... | Sets the value of the checked radio button.
@param array $values | [
"Sets",
"the",
"value",
"of",
"the",
"checked",
"radio",
"button",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/RadiosControl.php#L175-L181 |
225,157 | SetBased/php-abc-form | src/Control/RadiosControl.php | RadiosControl.labelAttributes | private function labelAttributes(array $option): array
{
$attributes = [];
if (is_array($this->labelAttributesMap))
{
foreach ($this->labelAttributesMap as $key => $name)
{
if (isset($option[$key])) $attributes[$name] = $option[$key];
}
}
return $attributes;
} | php | private function labelAttributes(array $option): array
{
$attributes = [];
if (is_array($this->labelAttributesMap))
{
foreach ($this->labelAttributesMap as $key => $name)
{
if (isset($option[$key])) $attributes[$name] = $option[$key];
}
}
return $attributes;
} | [
"private",
"function",
"labelAttributes",
"(",
"array",
"$",
"option",
")",
":",
"array",
"{",
"$",
"attributes",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"labelAttributesMap",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",... | Returns the attributes for the label element.
@param array $option The option.
@return array | [
"Returns",
"the",
"attributes",
"for",
"the",
"label",
"element",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/RadiosControl.php#L427-L440 |
225,158 | SetBased/php-abc-table-detail | src/TableRow/DateTimeTableRow.php | DateTimeTableRow.addRow | public static function addRow(DetailTable $table, $header, ?string $value, ?string $format = null): void
{
$date = \DateTime::createFromFormat('Y-m-d H:i:s', $value);
if ($date)
{
// The $value is a valid datetime.
$table->addRow($header,
['class' => 'date',
... | php | public static function addRow(DetailTable $table, $header, ?string $value, ?string $format = null): void
{
$date = \DateTime::createFromFormat('Y-m-d H:i:s', $value);
if ($date)
{
// The $value is a valid datetime.
$table->addRow($header,
['class' => 'date',
... | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"string",
"$",
"value",
",",
"?",
"string",
"$",
"format",
"=",
"null",
")",
":",
"void",
"{",
"$",
"date",
"=",
"\\",
"DateTime",
"::",
"create... | Adds a row with a datetime value to a detail table.
@param DetailTable $table The detail table.
@param string|int|null $header The header text of this table row.
@param string|null $value The datetime in Y-m-d H:i:s format.
@param string|null $format The format specifier for formatting the content of thi... | [
"Adds",
"a",
"row",
"with",
"a",
"datetime",
"value",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/DateTimeTableRow.php#L30-L47 |
225,159 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Service/WebServiceClient.php | WebServiceClient.call | public function call($webServiceName, $inputData=null,
$version=null)
{
if (is_null($version)) {
$version = $this->getVersion();
}
//Create unique token to identify the call
$token = uniqid("CALL_");
if ($this->isSymfony()) {
... | php | public function call($webServiceName, $inputData=null,
$version=null)
{
if (is_null($version)) {
$version = $this->getVersion();
}
//Create unique token to identify the call
$token = uniqid("CALL_");
if ($this->isSymfony()) {
... | [
"public",
"function",
"call",
"(",
"$",
"webServiceName",
",",
"$",
"inputData",
"=",
"null",
",",
"$",
"version",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"version",
")",
")",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"getVersion",
... | Call a webService
If the webService is local, make the call without
doing any HTTP call | [
"Call",
"a",
"webService"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Service/WebServiceClient.php#L122-L179 |
225,160 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Service/WebServiceClient.php | WebServiceClient.checkType | protected function checkType($value, $type, $allowedClassNames, $errorCode)
{
//We only accept object of array
if ($type && $value && gettype($value) != $type)
throw new WebServiceException("Should be a $type"
.", but it's a " . gettype($value), $... | php | protected function checkType($value, $type, $allowedClassNames, $errorCode)
{
//We only accept object of array
if ($type && $value && gettype($value) != $type)
throw new WebServiceException("Should be a $type"
.", but it's a " . gettype($value), $... | [
"protected",
"function",
"checkType",
"(",
"$",
"value",
",",
"$",
"type",
",",
"$",
"allowedClassNames",
",",
"$",
"errorCode",
")",
"{",
"//We only accept object of array",
"if",
"(",
"$",
"type",
"&&",
"$",
"value",
"&&",
"gettype",
"(",
"$",
"value",
"... | Check json schema type validity using symfony2 Validation system
return the error message if any or false
@param string $value value to check
@param string $type type to check | [
"Check",
"json",
"schema",
"type",
"validity",
"using",
"symfony2",
"Validation",
"system",
"return",
"the",
"error",
"message",
"if",
"any",
"or",
"false"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Service/WebServiceClient.php#L366-L413 |
225,161 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Service/WebServiceClient.php | WebServiceClient.translateException | protected function translateException($store)
{
if(!$this->isSymfony() || !$this->symfonyContainer) return null;
$translator = $this->getSymfonyTranslator();
$translatedMessage = $translator->trans($store->getCode(), array(), 'messages', $translator->getLocale());
if($translatedMess... | php | protected function translateException($store)
{
if(!$this->isSymfony() || !$this->symfonyContainer) return null;
$translator = $this->getSymfonyTranslator();
$translatedMessage = $translator->trans($store->getCode(), array(), 'messages', $translator->getLocale());
if($translatedMess... | [
"protected",
"function",
"translateException",
"(",
"$",
"store",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isSymfony",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"symfonyContainer",
")",
"return",
"null",
";",
"$",
"translator",
"=",
"$",
"this",
"->... | Uses the exception code to try to found a translation for the exception, if found
will override the message on the exception, if not found will leave the message as it it
@param \Exception $e
@return void | [
"Uses",
"the",
"exception",
"code",
"to",
"try",
"to",
"found",
"a",
"translation",
"for",
"the",
"exception",
"if",
"found",
"will",
"override",
"the",
"message",
"on",
"the",
"exception",
"if",
"not",
"found",
"will",
"leave",
"the",
"message",
"as",
"it... | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Service/WebServiceClient.php#L456-L465 |
225,162 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderPool.php | AppenderPool.add | public static function add(\n2n\log4php\LoggerAppender $appender) {
$name = $appender->getName();
if(empty($name)) {
throw new \n2n\log4php\LoggerException('log4php: Cannot add unnamed appender to pool.', E_USER_WARNING);
return;
}
if (isset(self::$appenders[$name])) {
throw new \n2n\log4php\Logg... | php | public static function add(\n2n\log4php\LoggerAppender $appender) {
$name = $appender->getName();
if(empty($name)) {
throw new \n2n\log4php\LoggerException('log4php: Cannot add unnamed appender to pool.', E_USER_WARNING);
return;
}
if (isset(self::$appenders[$name])) {
throw new \n2n\log4php\Logg... | [
"public",
"static",
"function",
"add",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerAppender",
"$",
"appender",
")",
"{",
"$",
"name",
"=",
"$",
"appender",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"th... | Adds an appender to the pool.
The appender must be named for this operation.
@param \n2n\log4php\LoggerAppender $appender | [
"Adds",
"an",
"appender",
"to",
"the",
"pool",
".",
"The",
"appender",
"must",
"be",
"named",
"for",
"this",
"operation",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderPool.php#L43-L56 |
225,163 | railken/amethyst-file | src/Http/Controllers/Admin/FilesController.php | FilesController.upload | public function upload($id, Request $request)
{
$entity = $this->getQuery()->where('id', $id)->first();
if (!$entity) {
return $this->response([], Response::HTTP_NOT_FOUND);
}
$manager = $this->getManager();
if ($request->file('file') === null) {
re... | php | public function upload($id, Request $request)
{
$entity = $this->getQuery()->where('id', $id)->first();
if (!$entity) {
return $this->response([], Response::HTTP_NOT_FOUND);
}
$manager = $this->getManager();
if ($request->file('file') === null) {
re... | [
"public",
"function",
"upload",
"(",
"$",
"id",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
"->",
"where",
"(",
"'id'",
",",
"$",
"id",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"!"... | The attributes that are fillable.
@param mixed $id
@param Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"The",
"attributes",
"that",
"are",
"fillable",
"."
] | 732916420373fd2ad1a80393d86f8a4d26e47768 | https://github.com/railken/amethyst-file/blob/732916420373fd2ad1a80393d86f8a4d26e47768/src/Http/Controllers/Admin/FilesController.php#L37-L61 |
225,164 | stubbles/stubbles-input | src/main/php/Filter.php | Filter.error | protected function error($error, array $details = []): array
{
$error = ParamError::fromData($error, $details);
return [null, [$error->id() => $error]];
} | php | protected function error($error, array $details = []): array
{
$error = ParamError::fromData($error, $details);
return [null, [$error->id() => $error]];
} | [
"protected",
"function",
"error",
"(",
"$",
"error",
",",
"array",
"$",
"details",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"error",
"=",
"ParamError",
"::",
"fromData",
"(",
"$",
"error",
",",
"$",
"details",
")",
";",
"return",
"[",
"null",
",... | helper function to return null and one error
@return array | [
"helper",
"function",
"to",
"return",
"null",
"and",
"one",
"error"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/Filter.php#L76-L80 |
225,165 | czogori/Dami | src/Dami/Migration/SchemaTable.php | SchemaTable.migrateToVersion | public function migrateToVersion($version, $up = true)
{
$this->createIfNotExists();
$currentVersion = $this->getCurrentVersion();
if ($up) {
$this->up($version);
} else {
$this->down($version);
}
} | php | public function migrateToVersion($version, $up = true)
{
$this->createIfNotExists();
$currentVersion = $this->getCurrentVersion();
if ($up) {
$this->up($version);
} else {
$this->down($version);
}
} | [
"public",
"function",
"migrateToVersion",
"(",
"$",
"version",
",",
"$",
"up",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"createIfNotExists",
"(",
")",
";",
"$",
"currentVersion",
"=",
"$",
"this",
"->",
"getCurrentVersion",
"(",
")",
";",
"if",
"(",
"... | Migrare to given version.
@param string $version Version of migration.
@return void | [
"Migrare",
"to",
"given",
"version",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/SchemaTable.php#L43-L52 |
225,166 | czogori/Dami | src/Dami/Migration/SchemaTable.php | SchemaTable.getVersions | public function getVersions()
{
$this->createIfNotExists();
$sql = 'SELECT version FROM schema_migration ORDER BY version DESC';
$versions = array();
foreach ($this->connection->query($sql) as $row) {
$versions[] = $row['version'];
}
return $versions;
... | php | public function getVersions()
{
$this->createIfNotExists();
$sql = 'SELECT version FROM schema_migration ORDER BY version DESC';
$versions = array();
foreach ($this->connection->query($sql) as $row) {
$versions[] = $row['version'];
}
return $versions;
... | [
"public",
"function",
"getVersions",
"(",
")",
"{",
"$",
"this",
"->",
"createIfNotExists",
"(",
")",
";",
"$",
"sql",
"=",
"'SELECT version FROM schema_migration ORDER BY version DESC'",
";",
"$",
"versions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
... | Get all versions of migrations.
@return array Versions of migrations. | [
"Get",
"all",
"versions",
"of",
"migrations",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/SchemaTable.php#L59-L69 |
225,167 | czogori/Dami | src/Dami/Migration/SchemaTable.php | SchemaTable.createIfNotExists | private function createIfNotExists()
{
$table = new Table('schema_migration');
if ($this->info->isTableExists($table)) {
return;
}
$primaryKey = new PrimaryKey(array('version'));
$primaryKey->disableAutoIncrement();
$table->addConstraint($primaryKey);
... | php | private function createIfNotExists()
{
$table = new Table('schema_migration');
if ($this->info->isTableExists($table)) {
return;
}
$primaryKey = new PrimaryKey(array('version'));
$primaryKey->disableAutoIncrement();
$table->addConstraint($primaryKey);
... | [
"private",
"function",
"createIfNotExists",
"(",
")",
"{",
"$",
"table",
"=",
"new",
"Table",
"(",
"'schema_migration'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"info",
"->",
"isTableExists",
"(",
"$",
"table",
")",
")",
"{",
"return",
";",
"}",
"$",
... | Create schema table if not exists.
@return void | [
"Create",
"schema",
"table",
"if",
"not",
"exists",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/SchemaTable.php#L126-L140 |
225,168 | stubbles/stubbles-input | src/main/php/valuereader/MissingValueReader.php | MissingValueReader.reportError | private function reportError(string $errorId = null)
{
$reportError = $this->reportError;
$reportError((null === $errorId) ? ($this->defaultErrorId) : ($errorId));
} | php | private function reportError(string $errorId = null)
{
$reportError = $this->reportError;
$reportError((null === $errorId) ? ($this->defaultErrorId) : ($errorId));
} | [
"private",
"function",
"reportError",
"(",
"string",
"$",
"errorId",
"=",
"null",
")",
"{",
"$",
"reportError",
"=",
"$",
"this",
"->",
"reportError",
";",
"$",
"reportError",
"(",
"(",
"null",
"===",
"$",
"errorId",
")",
"?",
"(",
"$",
"this",
"->",
... | reports the error
@param string $errorId optional | [
"reports",
"the",
"error"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/valuereader/MissingValueReader.php#L56-L60 |
225,169 | DrNixx/yii2-onix | src/collections/TreeSet.php | TreeSet.offsetSet | public function offsetSet($element, $value)
{
$map = $this->getMap();
if ($value) {
$map[$element] = true;
} else {
unset($map[$element]);
}
} | php | public function offsetSet($element, $value)
{
$map = $this->getMap();
if ($value) {
$map[$element] = true;
} else {
unset($map[$element]);
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"element",
",",
"$",
"value",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getMap",
"(",
")",
";",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"map",
"[",
"$",
"element",
"]",
"=",
"true",
";",
"}",
... | Set the value for an element
@param mixed $element The element
@param mixed $value The value
@return void | [
"Set",
"the",
"value",
"for",
"an",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeSet.php#L75-L83 |
225,170 | DrNixx/yii2-onix | src/collections/TreeSet.php | TreeSet.containsAll | public function containsAll($elements)
{
foreach ($elements as $element) {
if (false === $this->contains($element)) {
return false;
}
}
return true;
} | php | public function containsAll($elements)
{
foreach ($elements as $element) {
if (false === $this->contains($element)) {
return false;
}
}
return true;
} | [
"public",
"function",
"containsAll",
"(",
"$",
"elements",
")",
"{",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"contains",
"(",
"$",
"element",
")",
")",
"{",
"return",
"false",
";"... | Returns `true` if the set contains all of the specified elements.
@param CollectionInterface|array $elements Elements to test.
@return bool `true` if the set contains all of the specified elements, otherwise `false`.
@see contains | [
"Returns",
"true",
"if",
"the",
"set",
"contains",
"all",
"of",
"the",
"specified",
"elements",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeSet.php#L163-L172 |
225,171 | DrNixx/yii2-onix | src/collections/TreeSet.php | TreeSet.retainAll | public function retainAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
}
$this->clear()->addAll($elements);
return $this;
} | php | public function retainAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
}
$this->clear()->addAll($elements);
return $this;
} | [
"public",
"function",
"retainAll",
"(",
"$",
"elements",
")",
"{",
"if",
"(",
"$",
"elements",
"instanceof",
"CollectionInterface",
")",
"{",
"$",
"elements",
"=",
"$",
"elements",
"->",
"toArray",
"(",
")",
";",
"}",
"$",
"this",
"->",
"clear",
"(",
"... | Retains only the elements in the set that are contained in the specified
collection.
In other words, removes from the set all of its elements that are not
contained in the specified collection.
This is an optional operation.
@param CollectionInterface|array $elements Elements to be retained in the set.
@return SetIn... | [
"Retains",
"only",
"the",
"elements",
"in",
"the",
"set",
"that",
"are",
"contained",
"in",
"the",
"specified",
"collection",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeSet.php#L232-L240 |
225,172 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/StoreBundle/Store/Base/BaseStore.php | BaseStore.getViolations | public function getViolations($ignoredVioltations=null)
{
if (!$this->isValidated())
throw new StoreException("You must call validate() method before.",
StoreException::STORE_002);
if (!is_array($ignoredVioltations)) {
return $this->violations;
}
... | php | public function getViolations($ignoredVioltations=null)
{
if (!$this->isValidated())
throw new StoreException("You must call validate() method before.",
StoreException::STORE_002);
if (!is_array($ignoredVioltations)) {
return $this->violations;
}
... | [
"public",
"function",
"getViolations",
"(",
"$",
"ignoredVioltations",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidated",
"(",
")",
")",
"throw",
"new",
"StoreException",
"(",
"\"You must call validate() method before.\"",
",",
"StoreExceptio... | Return validation violations
need to run validate() bedore | [
"Return",
"validation",
"violations"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/StoreBundle/Store/Base/BaseStore.php#L134-L155 |
225,173 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/StoreBundle/Store/Base/BaseStore.php | BaseStore.serialize | public function serialize($includePrivate=false, $includeInternal=true, $removeNullValues=false,
$dateAsISO8601=false)
{
$answer = array();
$schema = $this->_jsonSchema;
foreach ($schema['definition'] as $property => $definition) {
$method = 'get' .... | php | public function serialize($includePrivate=false, $includeInternal=true, $removeNullValues=false,
$dateAsISO8601=false)
{
$answer = array();
$schema = $this->_jsonSchema;
foreach ($schema['definition'] as $property => $definition) {
$method = 'get' .... | [
"public",
"function",
"serialize",
"(",
"$",
"includePrivate",
"=",
"false",
",",
"$",
"includeInternal",
"=",
"true",
",",
"$",
"removeNullValues",
"=",
"false",
",",
"$",
"dateAsISO8601",
"=",
"false",
")",
"{",
"$",
"answer",
"=",
"array",
"(",
")",
"... | Serilize the Store
if removeNullValues is True, non mandatory null values are removed from serialized store | [
"Serilize",
"the",
"Store"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/StoreBundle/Store/Base/BaseStore.php#L181-L240 |
225,174 | railken/amethyst-file | src/Models/File.php | File.getFullUrl | public function getFullUrl(string $name = '')
{
if (!isset($this->media[0])) {
return null;
}
return $this->media[0]->disk === 's3'
? $this->media[0]->getTemporaryUrl(new \DateTime('+1 hour'))
: $this->media[0]->getFullUrl($name);
} | php | public function getFullUrl(string $name = '')
{
if (!isset($this->media[0])) {
return null;
}
return $this->media[0]->disk === 's3'
? $this->media[0]->getTemporaryUrl(new \DateTime('+1 hour'))
: $this->media[0]->getFullUrl($name);
} | [
"public",
"function",
"getFullUrl",
"(",
"string",
"$",
"name",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"media",
"[",
"0",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"media",
"[",
... | Get the full url to a original media file.
@param string $name
@return string | [
"Get",
"the",
"full",
"url",
"to",
"a",
"original",
"media",
"file",
"."
] | 732916420373fd2ad1a80393d86f8a4d26e47768 | https://github.com/railken/amethyst-file/blob/732916420373fd2ad1a80393d86f8a4d26e47768/src/Models/File.php#L57-L66 |
225,175 | railken/amethyst-file | src/Models/File.php | File.downloadable | public function downloadable()
{
$media = $this->media[0];
if ($media->disk === 's3') {
return $media->getTemporaryUrl(new \DateTime('+1 hour'));
}
if (in_array($media->disk, ['local', 'public'], true)) {
return $media->getPath();
}
return $... | php | public function downloadable()
{
$media = $this->media[0];
if ($media->disk === 's3') {
return $media->getTemporaryUrl(new \DateTime('+1 hour'));
}
if (in_array($media->disk, ['local', 'public'], true)) {
return $media->getPath();
}
return $... | [
"public",
"function",
"downloadable",
"(",
")",
"{",
"$",
"media",
"=",
"$",
"this",
"->",
"media",
"[",
"0",
"]",
";",
"if",
"(",
"$",
"media",
"->",
"disk",
"===",
"'s3'",
")",
"{",
"return",
"$",
"media",
"->",
"getTemporaryUrl",
"(",
"new",
"\\... | Get url downloadable.
@return string | [
"Get",
"url",
"downloadable",
"."
] | 732916420373fd2ad1a80393d86f8a4d26e47768 | https://github.com/railken/amethyst-file/blob/732916420373fd2ad1a80393d86f8a4d26e47768/src/Models/File.php#L73-L86 |
225,176 | stubbles/stubbles-input | src/main/php/Params.php | Params.value | public function value(string $paramName): Value
{
return Value::of($this->params[$paramName] ?? null);
} | php | public function value(string $paramName): Value
{
return Value::of($this->params[$paramName] ?? null);
} | [
"public",
"function",
"value",
"(",
"string",
"$",
"paramName",
")",
":",
"Value",
"{",
"return",
"Value",
"::",
"of",
"(",
"$",
"this",
"->",
"params",
"[",
"$",
"paramName",
"]",
"??",
"null",
")",
";",
"}"
] | returns raw value of parameter or null if not set
@param string $paramName
@return \stubbles\values\Value | [
"returns",
"raw",
"value",
"of",
"parameter",
"or",
"null",
"if",
"not",
"set"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/Params.php#L62-L65 |
225,177 | stubbles/stubbles-input | src/main/php/Params.php | Params.errors | public function errors(): ParamErrors
{
if (null === $this->errors) {
$this->errors = new ParamErrors();
}
return $this->errors;
} | php | public function errors(): ParamErrors
{
if (null === $this->errors) {
$this->errors = new ParamErrors();
}
return $this->errors;
} | [
"public",
"function",
"errors",
"(",
")",
":",
"ParamErrors",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"errors",
")",
"{",
"$",
"this",
"->",
"errors",
"=",
"new",
"ParamErrors",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"errors",
"... | returns error collection for request parameters
@return \stubbles\input\errors\ParamErrors | [
"returns",
"error",
"collection",
"for",
"request",
"parameters"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/Params.php#L82-L89 |
225,178 | SetBased/php-abc-form | src/Validator/HttpValidator.php | HttpValidator.validate | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value==='' || $value===null || $value===false)
{
return true;
}
// Objects and arrays are not a valid http URL.
if (!is_scalar($value))
{
return fal... | php | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value==='' || $value===null || $value===false)
{
return true;
}
// Objects and arrays are not a valid http URL.
if (!is_scalar($value))
{
return fal... | [
"public",
"function",
"validate",
"(",
"Control",
"$",
"control",
")",
":",
"bool",
"{",
"$",
"value",
"=",
"$",
"control",
"->",
"getSubmittedValue",
"(",
")",
";",
"// An empty value is valid.",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
... | Returns true if the value of the form control is a valid http URL.
Note:
* Empty values are considered valid.
* This validator will test if the URL actually exists.
@param Control $control The form control.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"the",
"value",
"of",
"the",
"form",
"control",
"is",
"a",
"valid",
"http",
"URL",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/HttpValidator.php#L28-L74 |
225,179 | RevisionTen/cqrs | Services/MessageBus.php | MessageBus.dispatch | public function dispatch(Message $message): void
{
$this->messages[] = $message;
// Add message to debug log.
$context = $message->context ?? [];
$this->logger->debug($message->message, $context);
} | php | public function dispatch(Message $message): void
{
$this->messages[] = $message;
// Add message to debug log.
$context = $message->context ?? [];
$this->logger->debug($message->message, $context);
} | [
"public",
"function",
"dispatch",
"(",
"Message",
"$",
"message",
")",
":",
"void",
"{",
"$",
"this",
"->",
"messages",
"[",
"]",
"=",
"$",
"message",
";",
"// Add message to debug log.",
"$",
"context",
"=",
"$",
"message",
"->",
"context",
"??",
"[",
"... | Dispatches a Message to the Message Bus.
@param Message $message | [
"Dispatches",
"a",
"Message",
"to",
"the",
"Message",
"Bus",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/MessageBus.php#L38-L45 |
225,180 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.getAuthorizationUrl | public function getAuthorizationUrl($scopes = [])
{
$this->provider;
$authorizationUrl = $this->provider->getAuthorizationUrl([
'scope' => join(' ', $scopes)
]);
$_SESSION['oauth2_lockme_state'] = $this->provider->getState();
return $authorizationUrl;
} | php | public function getAuthorizationUrl($scopes = [])
{
$this->provider;
$authorizationUrl = $this->provider->getAuthorizationUrl([
'scope' => join(' ', $scopes)
]);
$_SESSION['oauth2_lockme_state'] = $this->provider->getState();
return $authorizationUrl;
} | [
"public",
"function",
"getAuthorizationUrl",
"(",
"$",
"scopes",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"provider",
";",
"$",
"authorizationUrl",
"=",
"$",
"this",
"->",
"provider",
"->",
"getAuthorizationUrl",
"(",
"[",
"'scope'",
"=>",
"join",
"(",
... | Generate authorization URL
@param array $scopes Array of requested scopes
@return string Redirect URL | [
"Generate",
"authorization",
"URL"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L38-L46 |
225,181 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.getTokenForCode | public function getTokenForCode($code, $state)
{
if ($state != $_SESSION['oauth2_lockme_state']) {
unset($_SESSION['oauth2_lockme_state']);
throw new \Exception("Wrong state");
}
unset($_SESSION['oauth2_lockme_state']);
$this->accessToken = $this->provider->g... | php | public function getTokenForCode($code, $state)
{
if ($state != $_SESSION['oauth2_lockme_state']) {
unset($_SESSION['oauth2_lockme_state']);
throw new \Exception("Wrong state");
}
unset($_SESSION['oauth2_lockme_state']);
$this->accessToken = $this->provider->g... | [
"public",
"function",
"getTokenForCode",
"(",
"$",
"code",
",",
"$",
"state",
")",
"{",
"if",
"(",
"$",
"state",
"!=",
"$",
"_SESSION",
"[",
"'oauth2_lockme_state'",
"]",
")",
"{",
"unset",
"(",
"$",
"_SESSION",
"[",
"'oauth2_lockme_state'",
"]",
")",
";... | Get Access token from AuthCode
@param string $code AuthCode
@param string $state State code
@return AccessToken Access Token
@throws \Exception | [
"Get",
"Access",
"token",
"from",
"AuthCode"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L55-L67 |
225,182 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.refreshToken | public function refreshToken($accessToken = null)
{
$accessToken = $accessToken ?: $this->accessToken;
$this->accessToken = $this->provider->getAccessToken('refresh_token', [
'refresh_token' => $accessToken->getRefreshToken()
]);
return $this->accessToken;
} | php | public function refreshToken($accessToken = null)
{
$accessToken = $accessToken ?: $this->accessToken;
$this->accessToken = $this->provider->getAccessToken('refresh_token', [
'refresh_token' => $accessToken->getRefreshToken()
]);
return $this->accessToken;
} | [
"public",
"function",
"refreshToken",
"(",
"$",
"accessToken",
"=",
"null",
")",
"{",
"$",
"accessToken",
"=",
"$",
"accessToken",
"?",
":",
"$",
"this",
"->",
"accessToken",
";",
"$",
"this",
"->",
"accessToken",
"=",
"$",
"this",
"->",
"provider",
"->"... | Refresh access token
@param AccessToken|null $accessToken Access token
@return AccessToken Refreshed token | [
"Refresh",
"access",
"token"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L74-L81 |
225,183 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.setDefaultAccessToken | public function setDefaultAccessToken($token)
{
if (is_string($token)) {
$this->accessToken = new AccessToken(json_decode($token, true));
} elseif ($token instanceof AccessToken) {
$this->accessToken = $token;
} else {
throw new \Exception("Incorrect acces... | php | public function setDefaultAccessToken($token)
{
if (is_string($token)) {
$this->accessToken = new AccessToken(json_decode($token, true));
} elseif ($token instanceof AccessToken) {
$this->accessToken = $token;
} else {
throw new \Exception("Incorrect acces... | [
"public",
"function",
"setDefaultAccessToken",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"token",
")",
")",
"{",
"$",
"this",
"->",
"accessToken",
"=",
"new",
"AccessToken",
"(",
"json_decode",
"(",
"$",
"token",
",",
"true",
")",
... | Create default access token
@param string|AccessToken $token Default access token
@return AccessToken
@throws \Exception | [
"Create",
"default",
"access",
"token"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L89-L102 |
225,184 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.Reservation | public function Reservation($roomId, $id, $accessToken = null)
{
return $this->provider->executeRequest("GET", "/room/{$roomId}/reservation/{$id}", $accessToken ?: $this->accessToken);
} | php | public function Reservation($roomId, $id, $accessToken = null)
{
return $this->provider->executeRequest("GET", "/room/{$roomId}/reservation/{$id}", $accessToken ?: $this->accessToken);
} | [
"public",
"function",
"Reservation",
"(",
"$",
"roomId",
",",
"$",
"id",
",",
"$",
"accessToken",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"provider",
"->",
"executeRequest",
"(",
"\"GET\"",
",",
"\"/room/{$roomId}/reservation/{$id}\"",
",",
"$",
... | Get reservation data
@param int $roomId Room ID
@param string $id Reservation ID
@param string|AccessToken|null $accessToken Access token
@return array | [
"Get",
"reservation",
"data"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L131-L134 |
225,185 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.AddReservation | public function AddReservation($data, $accessToken = null)
{
if (!$data['roomid']) {
throw new \Exception("No room ID");
}
if (!$data["date"]) {
throw new \Exception("No date");
}
if (!$data["hour"]) {
throw new \Exception("No hour");
... | php | public function AddReservation($data, $accessToken = null)
{
if (!$data['roomid']) {
throw new \Exception("No room ID");
}
if (!$data["date"]) {
throw new \Exception("No date");
}
if (!$data["hour"]) {
throw new \Exception("No hour");
... | [
"public",
"function",
"AddReservation",
"(",
"$",
"data",
",",
"$",
"accessToken",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"data",
"[",
"'roomid'",
"]",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"No room ID\"",
")",
";",
"}",
"if",
"(",... | Add new reservation
@param array $data Reservation data
@param string|AccessToken|null $accessToken Access token
@return int
@throws \Exception | [
"Add",
"new",
"reservation"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L143-L155 |
225,186 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.GetMessage | public function GetMessage($messageId, $accessToken = null)
{
return $this->provider->executeRequest("GET", "/message/{$messageId}", $accessToken ?: $this->accessToken);
} | php | public function GetMessage($messageId, $accessToken = null)
{
return $this->provider->executeRequest("GET", "/message/{$messageId}", $accessToken ?: $this->accessToken);
} | [
"public",
"function",
"GetMessage",
"(",
"$",
"messageId",
",",
"$",
"accessToken",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"provider",
"->",
"executeRequest",
"(",
"\"GET\"",
",",
"\"/message/{$messageId}\"",
",",
"$",
"accessToken",
"?",
":",
"... | Get callback message details
@param int $messageId Message ID
@param null $accessToken
@return array | [
"Get",
"callback",
"message",
"details"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L221-L224 |
225,187 | Lustmored/lockme-sdk | src/Lockme.php | Lockme.MarkMessageRead | public function MarkMessageRead($messageId, $accessToken = null)
{
return $this->provider->executeRequest("POST", "/message/{$messageId}", $accessToken ?: $this->accessToken);
} | php | public function MarkMessageRead($messageId, $accessToken = null)
{
return $this->provider->executeRequest("POST", "/message/{$messageId}", $accessToken ?: $this->accessToken);
} | [
"public",
"function",
"MarkMessageRead",
"(",
"$",
"messageId",
",",
"$",
"accessToken",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"provider",
"->",
"executeRequest",
"(",
"\"POST\"",
",",
"\"/message/{$messageId}\"",
",",
"$",
"accessToken",
"?",
":... | Mark callback message as read
@param int $messageId Message ID
@param null $accessToken
@return bool | [
"Mark",
"callback",
"message",
"as",
"read"
] | e8c604e85153cb74f0bccde54f702fb6f9006fd0 | https://github.com/Lustmored/lockme-sdk/blob/e8c604e85153cb74f0bccde54f702fb6f9006fd0/src/Lockme.php#L232-L235 |
225,188 | SetBased/php-abc-table-overview | src/TableColumn/DualTableColumn.php | DualTableColumn.sortOrder1 | public function sortOrder1(int $sortOrder, bool $descendingFlag = false): void
{
$this->sortDirection = ($descendingFlag) ? 'desc' : 'asc';
$this->sortOrder = $sortOrder;
} | php | public function sortOrder1(int $sortOrder, bool $descendingFlag = false): void
{
$this->sortDirection = ($descendingFlag) ? 'desc' : 'asc';
$this->sortOrder = $sortOrder;
} | [
"public",
"function",
"sortOrder1",
"(",
"int",
"$",
"sortOrder",
",",
"bool",
"$",
"descendingFlag",
"=",
"false",
")",
":",
"void",
"{",
"$",
"this",
"->",
"sortDirection",
"=",
"(",
"$",
"descendingFlag",
")",
"?",
"'desc'",
":",
"'asc'",
";",
"$",
... | Sets the sorting order of the first table column.
@param int $sortOrder The sorting order.
@param bool $descendingFlag If set the data is sorted descending, otherwise ascending. | [
"Sets",
"the",
"sorting",
"order",
"of",
"the",
"first",
"table",
"column",
"."
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/TableColumn/DualTableColumn.php#L175-L179 |
225,189 | SetBased/php-abc-table-overview | src/TableColumn/DualTableColumn.php | DualTableColumn.sortOrder2 | public function sortOrder2(int $sortOrder, bool $descendingFlag = false): void
{
$this->sortDirection2 = ($descendingFlag) ? 'desc' : 'asc';
$this->sortOrder2 = $sortOrder;
} | php | public function sortOrder2(int $sortOrder, bool $descendingFlag = false): void
{
$this->sortDirection2 = ($descendingFlag) ? 'desc' : 'asc';
$this->sortOrder2 = $sortOrder;
} | [
"public",
"function",
"sortOrder2",
"(",
"int",
"$",
"sortOrder",
",",
"bool",
"$",
"descendingFlag",
"=",
"false",
")",
":",
"void",
"{",
"$",
"this",
"->",
"sortDirection2",
"=",
"(",
"$",
"descendingFlag",
")",
"?",
"'desc'",
":",
"'asc'",
";",
"$",
... | Sets the sorting order of second table column.
@param int $sortOrder The sorting order.
@param bool $descendingFlag If set the data is sorted descending, otherwise ascending. | [
"Sets",
"the",
"sorting",
"order",
"of",
"second",
"table",
"column",
"."
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/TableColumn/DualTableColumn.php#L188-L192 |
225,190 | RevisionTen/cqrs | Services/CommandBus.php | CommandBus.dispatch | public function dispatch(CommandInterface $command, bool $qeueEvents = false): void
{
try {
if ($command instanceof CommandInterface) {
// Reset aggregates.
$this->aggregates = [];
/**
* Get Handler for Command.
*... | php | public function dispatch(CommandInterface $command, bool $qeueEvents = false): void
{
try {
if ($command instanceof CommandInterface) {
// Reset aggregates.
$this->aggregates = [];
/**
* Get Handler for Command.
*... | [
"public",
"function",
"dispatch",
"(",
"CommandInterface",
"$",
"command",
",",
"bool",
"$",
"qeueEvents",
"=",
"false",
")",
":",
"void",
"{",
"try",
"{",
"if",
"(",
"$",
"command",
"instanceof",
"CommandInterface",
")",
"{",
"// Reset aggregates.",
"$",
"t... | This function is used to dispatch a provided Command.
@param CommandInterface $command
@param bool $qeueEvents | [
"This",
"function",
"is",
"used",
"to",
"dispatch",
"a",
"provided",
"Command",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/CommandBus.php#L55-L101 |
225,191 | sopinetchat/SopinetChatBundle | Entity/Chat.php | Chat.getDevices | public function getDevices()
{
$devices = array();
foreach ($this->getChatMembers() as $chatMember) {
/* @var $chatMember User */
// Devices to Array
$devicesObject = $chatMember->getDevices();
foreach ($devicesObject as $do) {
$devices... | php | public function getDevices()
{
$devices = array();
foreach ($this->getChatMembers() as $chatMember) {
/* @var $chatMember User */
// Devices to Array
$devicesObject = $chatMember->getDevices();
foreach ($devicesObject as $do) {
$devices... | [
"public",
"function",
"getDevices",
"(",
")",
"{",
"$",
"devices",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getChatMembers",
"(",
")",
"as",
"$",
"chatMember",
")",
"{",
"/* @var $chatMember User */",
"// Devices to Array",
"$",
"devi... | Devuelve los dispositivos de todos los usuarios
vinculados al Chat
@return array|bool | [
"Devuelve",
"los",
"dispositivos",
"de",
"todos",
"los",
"usuarios",
"vinculados",
"al",
"Chat"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Entity/Chat.php#L304-L317 |
225,192 | php-toolkit/str-utils | src/Token.php | Token.verify | public static function verify(string $hash, string $password): bool
{
return \hash_equals($hash, \crypt($password, $hash));
} | php | public static function verify(string $hash, string $password): bool
{
return \hash_equals($hash, \crypt($password, $hash));
} | [
"public",
"static",
"function",
"verify",
"(",
"string",
"$",
"hash",
",",
"string",
"$",
"password",
")",
":",
"bool",
"{",
"return",
"\\",
"hash_equals",
"(",
"$",
"hash",
",",
"\\",
"crypt",
"(",
"$",
"password",
",",
"$",
"hash",
")",
")",
";",
... | this will be used to compare a password against a hash
@param string $hash
@param string $password the user input
@return bool | [
"this",
"will",
"be",
"used",
"to",
"compare",
"a",
"password",
"against",
"a",
"hash"
] | 2e0b081c7c86e4fb92d1dca63bd8c0449cb6b278 | https://github.com/php-toolkit/str-utils/blob/2e0b081c7c86e4fb92d1dca63bd8c0449cb6b278/src/Token.php#L103-L106 |
225,193 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.info | public function info($message, $throwable = null) {
$this->log(\n2n\log4php\LoggerLevel::getLevelInfo(), $message, $throwable);
} | php | public function info($message, $throwable = null) {
$this->log(\n2n\log4php\LoggerLevel::getLevelInfo(), $message, $throwable);
} | [
"public",
"function",
"info",
"(",
"$",
"message",
",",
"$",
"throwable",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"::",
"getLevelInfo",
"(",
")",
",",
"$",
"message",
",",
"$",
"throwab... | Log a message object with the INFO Level.
@param mixed $message message
@param Exception $throwable Optional throwable information to include
in the logging event. | [
"Log",
"a",
"message",
"object",
"with",
"the",
"INFO",
"Level",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L127-L129 |
225,194 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.error | public function error($message, $throwable = null) {
$this->log(\n2n\log4php\LoggerLevel::getLevelError(), $message, $throwable);
} | php | public function error($message, $throwable = null) {
$this->log(\n2n\log4php\LoggerLevel::getLevelError(), $message, $throwable);
} | [
"public",
"function",
"error",
"(",
"$",
"message",
",",
"$",
"throwable",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"::",
"getLevelError",
"(",
")",
",",
"$",
"message",
",",
"$",
"throw... | Log a message object with the ERROR level.
@param mixed $message message
@param Exception $throwable Optional throwable information to include
in the logging event. | [
"Log",
"a",
"message",
"object",
"with",
"the",
"ERROR",
"level",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L149-L151 |
225,195 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.fatal | public function fatal($message, $throwable = null) {
$this->log(\n2n\log4php\LoggerLevel::getLevelFatal(), $message, $throwable);
} | php | public function fatal($message, $throwable = null) {
$this->log(\n2n\log4php\LoggerLevel::getLevelFatal(), $message, $throwable);
} | [
"public",
"function",
"fatal",
"(",
"$",
"message",
",",
"$",
"throwable",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"::",
"getLevelFatal",
"(",
")",
",",
"$",
"message",
",",
"$",
"throw... | Log a message object with the FATAL level.
@param mixed $message message
@param Exception $throwable Optional throwable information to include
in the logging event. | [
"Log",
"a",
"message",
"object",
"with",
"the",
"FATAL",
"level",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L160-L162 |
225,196 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.log | public function log(\n2n\log4php\LoggerLevel $level, $message, $throwable = null) {
if($this->isEnabledFor($level)) {
$event = new \n2n\log4php\logging\LoggingEvent($this->fqcn, $this, $level, $message, null, $throwable);
$this->callAppenders($event);
}
// Forward the event upstream if additivity i... | php | public function log(\n2n\log4php\LoggerLevel $level, $message, $throwable = null) {
if($this->isEnabledFor($level)) {
$event = new \n2n\log4php\logging\LoggingEvent($this->fqcn, $this, $level, $message, null, $throwable);
$this->callAppenders($event);
}
// Forward the event upstream if additivity i... | [
"public",
"function",
"log",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"$",
"level",
",",
"$",
"message",
",",
"$",
"throwable",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEnabledFor",
"(",
"$",
"level",
")",
")",
"{",
"$... | Log a message using the provided logging level.
@param \n2n\log4php\LoggerLevel $level The logging level.
@param mixed $message Message to log.
@param Exception $throwable Optional throwable information to include
in the logging event. | [
"Log",
"a",
"message",
"using",
"the",
"provided",
"logging",
"level",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L172-L188 |
225,197 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.logEvent | public function logEvent(\n2n\log4php\logging\LoggingEvent $event) {
if($this->isEnabledFor($event->getLevel())) {
$this->callAppenders($event);
}
// Forward the event upstream if additivity is turned on
if(isset($this->parent) && $this->getAdditivity()) {
$this->parent->logEvent($event);
}
... | php | public function logEvent(\n2n\log4php\logging\LoggingEvent $event) {
if($this->isEnabledFor($event->getLevel())) {
$this->callAppenders($event);
}
// Forward the event upstream if additivity is turned on
if(isset($this->parent) && $this->getAdditivity()) {
$this->parent->logEvent($event);
}
... | [
"public",
"function",
"logEvent",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
"\\",
"LoggingEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEnabledFor",
"(",
"$",
"event",
"->",
"getLevel",
"(",
")",
")",
")",
"{",
"$",
"this... | Logs an already prepared logging event object.
@param \n2n\log4php\logging\LoggingEvent $event | [
"Logs",
"an",
"already",
"prepared",
"logging",
"event",
"object",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L194-L203 |
225,198 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.forcedLog | public function forcedLog($fqcn, $throwable, \n2n\log4php\LoggerLevel $level, $message) {
$event = new \n2n\log4php\logging\LoggingEvent($fqcn, $this, $level, $message, null, $throwable);
$this->callAppenders($event);
// Forward the event upstream if additivity is turned on
if(isset($this->parent) && $t... | php | public function forcedLog($fqcn, $throwable, \n2n\log4php\LoggerLevel $level, $message) {
$event = new \n2n\log4php\logging\LoggingEvent($fqcn, $this, $level, $message, null, $throwable);
$this->callAppenders($event);
// Forward the event upstream if additivity is turned on
if(isset($this->parent) && $t... | [
"public",
"function",
"forcedLog",
"(",
"$",
"fqcn",
",",
"$",
"throwable",
",",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"$",
"level",
",",
"$",
"message",
")",
"{",
"$",
"event",
"=",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
... | This method creates a new logging event and logs the event without
further checks.
It should not be called directly. Use {@link trace()}, {@link debug()},
{@link info()}, {@link warn()}, {@link error()} and {@link fatal()}
wrappers.
@param string $fqcn Fully qualified class name of the Logger
@param Exception $throwa... | [
"This",
"method",
"creates",
"a",
"new",
"logging",
"event",
"and",
"logs",
"the",
"event",
"without",
"further",
"checks",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L232-L240 |
225,199 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.isAttached | public function isAttached(\n2n\log4php\LoggerAppender $appender) {
return isset($this->appenders[$appender->getName()]);
} | php | public function isAttached(\n2n\log4php\LoggerAppender $appender) {
return isset($this->appenders[$appender->getName()]);
} | [
"public",
"function",
"isAttached",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerAppender",
"$",
"appender",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"appenders",
"[",
"$",
"appender",
"->",
"getName",
"(",
")",
"]",
")",
";",
"}"
] | Checks whether an appender is attached to this logger instance.
@param \n2n\log4php\LoggerAppender $appender
@return boolean | [
"Checks",
"whether",
"an",
"appender",
"is",
"attached",
"to",
"this",
"logger",
"instance",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L419-L421 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.