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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
202,400 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.initialize | public function initialize()
{
if ($this->initialized) {
throw new Exception('The Reflection Service can only be initialized once.', 1232044696);
}
$frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterfa... | php | public function initialize()
{
if ($this->initialized) {
throw new Exception('The Reflection Service can only be initialized once.', 1232044696);
}
$frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterfa... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The Reflection Service can only be initialized once.'",
",",
"1232044696",
")",
";",
"}",
"$",
"frameworkConfiguration",
"... | Initializes this service
@throws Exception | [
"Initializes",
"this",
"service"
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L187-L196 |
202,401 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.getClassTagsValues | public function getClassTagsValues($className)
{
if (!isset($this->reflectedClassNames[$className])) {
$this->reflectClass($className);
}
if (!isset($this->classTagsValues[$className])) {
return [];
}
return isset($this->classTagsValues[$className]) ? ... | php | public function getClassTagsValues($className)
{
if (!isset($this->reflectedClassNames[$className])) {
$this->reflectClass($className);
}
if (!isset($this->classTagsValues[$className])) {
return [];
}
return isset($this->classTagsValues[$className]) ? ... | [
"public",
"function",
"getClassTagsValues",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"reflectedClassNames",
"[",
"$",
"className",
"]",
")",
")",
"{",
"$",
"this",
"->",
"reflectClass",
"(",
"$",
"className",
")",... | Returns all tags and their values the specified class is tagged with
@param string $className Name of the class
@return array An array of tags and their values or an empty array if no tags were found | [
"Returns",
"all",
"tags",
"and",
"their",
"values",
"the",
"specified",
"class",
"is",
"tagged",
"with"
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L225-L234 |
202,402 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.getClassTagValues | public function getClassTagValues($className, $tag)
{
if (!isset($this->reflectedClassNames[$className])) {
$this->reflectClass($className);
}
if (!isset($this->classTagsValues[$className])) {
return [];
}
return isset($this->classTagsValues[$className... | php | public function getClassTagValues($className, $tag)
{
if (!isset($this->reflectedClassNames[$className])) {
$this->reflectClass($className);
}
if (!isset($this->classTagsValues[$className])) {
return [];
}
return isset($this->classTagsValues[$className... | [
"public",
"function",
"getClassTagValues",
"(",
"$",
"className",
",",
"$",
"tag",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"reflectedClassNames",
"[",
"$",
"className",
"]",
")",
")",
"{",
"$",
"this",
"->",
"reflectClass",
"(",
"$",... | Returns the values of the specified class tag
@param string $className Name of the class containing the property
@param string $tag Tag to return the values of
@return array An array of values or an empty array if the tag was not found | [
"Returns",
"the",
"values",
"of",
"the",
"specified",
"class",
"tag"
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L243-L252 |
202,403 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.isClassTaggedWith | public function isClassTaggedWith($className, $tag)
{
if ($this->initialized === false) {
return false;
}
if (!isset($this->reflectedClassNames[$className])) {
$this->reflectClass($className);
}
if (!isset($this->classTagsValues[$className])) {
... | php | public function isClassTaggedWith($className, $tag)
{
if ($this->initialized === false) {
return false;
}
if (!isset($this->reflectedClassNames[$className])) {
$this->reflectClass($className);
}
if (!isset($this->classTagsValues[$className])) {
... | [
"public",
"function",
"isClassTaggedWith",
"(",
"$",
"className",
",",
"$",
"tag",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"reflect... | Tells if the specified class is tagged with the given tag
@param string $className Name of the class
@param string $tag Tag to check for
@return bool TRUE if the class is tagged with $tag, otherwise FALSE | [
"Tells",
"if",
"the",
"specified",
"class",
"is",
"tagged",
"with",
"the",
"given",
"tag"
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L401-L413 |
202,404 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.getMethodReflection | protected function getMethodReflection($className, $methodName)
{
$this->dataCacheNeedsUpdate = true;
if (!isset($this->methodReflections[$className][$methodName])) {
$this->methodReflections[$className][$methodName] = new MethodReflection($className, $methodName);
}
retu... | php | protected function getMethodReflection($className, $methodName)
{
$this->dataCacheNeedsUpdate = true;
if (!isset($this->methodReflections[$className][$methodName])) {
$this->methodReflections[$className][$methodName] = new MethodReflection($className, $methodName);
}
retu... | [
"protected",
"function",
"getMethodReflection",
"(",
"$",
"className",
",",
"$",
"methodName",
")",
"{",
"$",
"this",
"->",
"dataCacheNeedsUpdate",
"=",
"true",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"methodReflections",
"[",
"$",
"className",... | Returns the Reflection of a method.
@param string $className Name of the class containing the method
@param string $methodName Name of the method to return the Reflection for
@return MethodReflection the method Reflection object | [
"Returns",
"the",
"Reflection",
"of",
"a",
"method",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L568-L575 |
202,405 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.loadFromCache | protected function loadFromCache()
{
$data = $this->dataCache->get($this->cacheIdentifier);
if ($data !== false) {
foreach ($data as $propertyName => $propertyValue) {
$this->{$propertyName} = $propertyValue;
}
}
} | php | protected function loadFromCache()
{
$data = $this->dataCache->get($this->cacheIdentifier);
if ($data !== false) {
foreach ($data as $propertyName => $propertyValue) {
$this->{$propertyName} = $propertyValue;
}
}
} | [
"protected",
"function",
"loadFromCache",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"dataCache",
"->",
"get",
"(",
"$",
"this",
"->",
"cacheIdentifier",
")",
";",
"if",
"(",
"$",
"data",
"!==",
"false",
")",
"{",
"foreach",
"(",
"$",
"data"... | Tries to load the reflection data from this service's cache. | [
"Tries",
"to",
"load",
"the",
"reflection",
"data",
"from",
"this",
"service",
"s",
"cache",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L580-L588 |
202,406 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.saveToCache | protected function saveToCache()
{
if (!is_object($this->dataCache)) {
throw new Exception('A cache must be injected before initializing the Reflection Service.', 1232044697);
}
$data = [];
$propertyNames = [
'reflectedClassNames',
'classPropertyNa... | php | protected function saveToCache()
{
if (!is_object($this->dataCache)) {
throw new Exception('A cache must be injected before initializing the Reflection Service.', 1232044697);
}
$data = [];
$propertyNames = [
'reflectedClassNames',
'classPropertyNa... | [
"protected",
"function",
"saveToCache",
"(",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"this",
"->",
"dataCache",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'A cache must be injected before initializing the Reflection Service.'",
",",
"1232044697",
")"... | Exports the internal reflection data into the ReflectionData cache.
@throws Exception | [
"Exports",
"the",
"internal",
"reflection",
"data",
"into",
"the",
"ReflectionData",
"cache",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L595-L617 |
202,407 | geoffadams/bedrest-core | library/BedRest/Service/Mapping/ServiceMetadata.php | ServiceMetadata.addListener | public function addListener($event, $method)
{
if (!isset($this->listeners[$event])) {
$this->listeners[$event] = array();
}
$this->listeners[$event][] = $method;
} | php | public function addListener($event, $method)
{
if (!isset($this->listeners[$event])) {
$this->listeners[$event] = array();
}
$this->listeners[$event][] = $method;
} | [
"public",
"function",
"addListener",
"(",
"$",
"event",
",",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
")",
"{",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
"="... | Adds a listener for the specified event.
@param string $event
@param string $method | [
"Adds",
"a",
"listener",
"for",
"the",
"specified",
"event",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Service/Mapping/ServiceMetadata.php#L76-L83 |
202,408 | t3v/t3v_core | Classes/Validation/Validator/AbstractValidator.php | AbstractValidator.addErrorToProperty | protected function addErrorToProperty(string $property, string $key, string $extensionName) {
$errorMessage = LocalizationUtility::translate($key, $extensionName);
$error = $this->objectManager->get(Error::class, $errorMessage, time());
$this->result->forProperty($property)->addError($error);
} | php | protected function addErrorToProperty(string $property, string $key, string $extensionName) {
$errorMessage = LocalizationUtility::translate($key, $extensionName);
$error = $this->objectManager->get(Error::class, $errorMessage, time());
$this->result->forProperty($property)->addError($error);
} | [
"protected",
"function",
"addErrorToProperty",
"(",
"string",
"$",
"property",
",",
"string",
"$",
"key",
",",
"string",
"$",
"extensionName",
")",
"{",
"$",
"errorMessage",
"=",
"LocalizationUtility",
"::",
"translate",
"(",
"$",
"key",
",",
"$",
"extensionNa... | Adds an error to a property.
@param string $property The property
@param string $key The key to reference the error
@param string $extensionName The extension name | [
"Adds",
"an",
"error",
"to",
"a",
"property",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Validation/Validator/AbstractValidator.php#L30-L35 |
202,409 | Vectrex/vxPHP | src/Template/Filter/AnchorHref.php | AnchorHref.filterHrefWithPath | private function filterHrefWithPath($matches) {
static $script;
static $observeRewrite;
static $config;
static $assetsPath;
if(is_null($config)) {
$application = Application::getInstance();
$config = $application->getConfig();
$observeRewrite = $application->getRouter()->getServerSideRewrite();
... | php | private function filterHrefWithPath($matches) {
static $script;
static $observeRewrite;
static $config;
static $assetsPath;
if(is_null($config)) {
$application = Application::getInstance();
$config = $application->getConfig();
$observeRewrite = $application->getRouter()->getServerSideRewrite();
... | [
"private",
"function",
"filterHrefWithPath",
"(",
"$",
"matches",
")",
"{",
"static",
"$",
"script",
";",
"static",
"$",
"observeRewrite",
";",
"static",
"$",
"config",
";",
"static",
"$",
"assetsPath",
";",
"if",
"(",
"is_null",
"(",
"$",
"config",
")",
... | callback to turn href shortcuts into site conform valid URLs
tries to build a path reflecting the position of the page in a nested menu
$foo/bar?baz=1 becomes /level1/level2/foo/bar?baz=1 or index.php/level1/level2/foo/bar?baz=1
@param array $matches
@return string | [
"callback",
"to",
"turn",
"href",
"shortcuts",
"into",
"site",
"conform",
"valid",
"URLs",
"tries",
"to",
"build",
"a",
"path",
"reflecting",
"the",
"position",
"of",
"the",
"page",
"in",
"a",
"nested",
"menu"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Template/Filter/AnchorHref.php#L57-L137 |
202,410 | Vectrex/vxPHP | src/Template/Filter/AnchorHref.php | AnchorHref.filterHref | private function filterHref($matches) {
static $script;
static $observeRewrite;
if(is_null($script)) {
$script = trim(Request::createFromGlobals()->getScriptName(), '/');
}
if(is_null($observeRewrite)) {
$observeRewrite = Application::getInstance()->getRouter()->getServerSideRewrite();
}
... | php | private function filterHref($matches) {
static $script;
static $observeRewrite;
if(is_null($script)) {
$script = trim(Request::createFromGlobals()->getScriptName(), '/');
}
if(is_null($observeRewrite)) {
$observeRewrite = Application::getInstance()->getRouter()->getServerSideRewrite();
}
... | [
"private",
"function",
"filterHref",
"(",
"$",
"matches",
")",
"{",
"static",
"$",
"script",
";",
"static",
"$",
"observeRewrite",
";",
"if",
"(",
"is_null",
"(",
"$",
"script",
")",
")",
"{",
"$",
"script",
"=",
"trim",
"(",
"Request",
"::",
"createFr... | callback to turn href shortcuts into site conform valid URLs
$/foo/bar?baz=1 becomes /foo/bar?baz=1 or index.php/foo/bar?baz=1
@param array $matches
@return string | [
"callback",
"to",
"turn",
"href",
"shortcuts",
"into",
"site",
"conform",
"valid",
"URLs"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Template/Filter/AnchorHref.php#L147-L180 |
202,411 | FlexModel/FlexModelBundle | Twig/FlexModelExtension.php | FlexModelExtension.optionLabelFilter | public function optionLabelFilter($value, $objectName, $fieldName)
{
$fieldConfiguration = $this->flexModel->getField($objectName, $fieldName);
$label = "";
if (is_array($fieldConfiguration)) {
if (isset($fieldConfiguration['options'])) {
if (is_array($value)) {
... | php | public function optionLabelFilter($value, $objectName, $fieldName)
{
$fieldConfiguration = $this->flexModel->getField($objectName, $fieldName);
$label = "";
if (is_array($fieldConfiguration)) {
if (isset($fieldConfiguration['options'])) {
if (is_array($value)) {
... | [
"public",
"function",
"optionLabelFilter",
"(",
"$",
"value",
",",
"$",
"objectName",
",",
"$",
"fieldName",
")",
"{",
"$",
"fieldConfiguration",
"=",
"$",
"this",
"->",
"flexModel",
"->",
"getField",
"(",
"$",
"objectName",
",",
"$",
"fieldName",
")",
";"... | Gets the option label based on the object and field name.
@param string $value
@param string $objectName
@param string $fieldName
@return string $label | [
"Gets",
"the",
"option",
"label",
"based",
"on",
"the",
"object",
"and",
"field",
"name",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Twig/FlexModelExtension.php#L56-L77 |
202,412 | FlexModel/FlexModelBundle | Twig/FlexModelExtension.php | FlexModelExtension.getLabelForValue | private function getLabelForValue($fieldConfiguration, $value)
{
$label = "";
foreach ($fieldConfiguration['options'] as $option) {
if ($option['value'] == $value) {
$label = $option['label'];
}
}
return $label;
} | php | private function getLabelForValue($fieldConfiguration, $value)
{
$label = "";
foreach ($fieldConfiguration['options'] as $option) {
if ($option['value'] == $value) {
$label = $option['label'];
}
}
return $label;
} | [
"private",
"function",
"getLabelForValue",
"(",
"$",
"fieldConfiguration",
",",
"$",
"value",
")",
"{",
"$",
"label",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"fieldConfiguration",
"[",
"'options'",
"]",
"as",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"opti... | Gets the label for the set value.
@param mixed $fieldConfiguration
@param string $value
@return string $label | [
"Gets",
"the",
"label",
"for",
"the",
"set",
"value",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Twig/FlexModelExtension.php#L87-L97 |
202,413 | FlexModel/FlexModelBundle | Twig/FlexModelExtension.php | FlexModelExtension.fieldLabelFilter | public function fieldLabelFilter($value, $objectName, $fieldName)
{
$fieldConfiguration = $this->flexModel->getField($objectName, $fieldName);
$label = "";
if (is_array($fieldConfiguration)) {
$label = $fieldConfiguration['label'];
}
return $label;
} | php | public function fieldLabelFilter($value, $objectName, $fieldName)
{
$fieldConfiguration = $this->flexModel->getField($objectName, $fieldName);
$label = "";
if (is_array($fieldConfiguration)) {
$label = $fieldConfiguration['label'];
}
return $label;
} | [
"public",
"function",
"fieldLabelFilter",
"(",
"$",
"value",
",",
"$",
"objectName",
",",
"$",
"fieldName",
")",
"{",
"$",
"fieldConfiguration",
"=",
"$",
"this",
"->",
"flexModel",
"->",
"getField",
"(",
"$",
"objectName",
",",
"$",
"fieldName",
")",
";",... | Gets the field label based on the object and field name.
@param string $objectName
@param string $fieldName
@return string $label | [
"Gets",
"the",
"field",
"label",
"based",
"on",
"the",
"object",
"and",
"field",
"name",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Twig/FlexModelExtension.php#L107-L117 |
202,414 | rutger-speksnijder/restphp | src/RestPHP/Request/RequestFactory.php | RequestFactory.build | public function build($type)
{
if (!isset($this->types[$type])) {
throw new \Exception("Unknown request type.");
}
return new $this->types[$type]();
} | php | public function build($type)
{
if (!isset($this->types[$type])) {
throw new \Exception("Unknown request type.");
}
return new $this->types[$type]();
} | [
"public",
"function",
"build",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Unknown request type.\"",
")",
";",
"}",
"return",
... | Builds the request object.
@param string $type The type of request to build.
@throws Exception Throws an exception for unknown request types.
@return \RestPHP\Request The created object. | [
"Builds",
"the",
"request",
"object",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Request/RequestFactory.php#L51-L57 |
202,415 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processQuery | protected function processQuery(Query $query, $context): Query
{
$queryProperties = [];
// Table
$queryProperties['table'] = $this->processTable($query->table, $context);
// Select
foreach ($query->select as $alias => $select) {
$queryProperties['select'][$alias... | php | protected function processQuery(Query $query, $context): Query
{
$queryProperties = [];
// Table
$queryProperties['table'] = $this->processTable($query->table, $context);
// Select
foreach ($query->select as $alias => $select) {
$queryProperties['select'][$alias... | [
"protected",
"function",
"processQuery",
"(",
"Query",
"$",
"query",
",",
"$",
"context",
")",
":",
"Query",
"{",
"$",
"queryProperties",
"=",
"[",
"]",
";",
"// Table",
"$",
"queryProperties",
"[",
"'table'",
"]",
"=",
"$",
"this",
"->",
"processTable",
... | Processes a Query object. DOES NOT change the given query or it's components by the link but may return it.
@param Query $query
@param mixed $context The processing context
@return Query | [
"Processes",
"a",
"Query",
"object",
".",
"DOES",
"NOT",
"change",
"the",
"given",
"query",
"or",
"it",
"s",
"components",
"by",
"the",
"link",
"but",
"may",
"return",
"it",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L67-L129 |
202,416 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processTable | protected function processTable($table, $context)
{
if (is_string($table)) {
return $this->processTableName($table, $context);
} else {
return $this->processSubQuery($table, $context);
}
} | php | protected function processTable($table, $context)
{
if (is_string($table)) {
return $this->processTableName($table, $context);
} else {
return $this->processSubQuery($table, $context);
}
} | [
"protected",
"function",
"processTable",
"(",
"$",
"table",
",",
"$",
"context",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"table",
")",
")",
"{",
"return",
"$",
"this",
"->",
"processTableName",
"(",
"$",
"table",
",",
"$",
"context",
")",
";",
"}... | Processes a table name or table subquery
@param Query|StatementInterface|string $table
@param mixed $context The processing context
@return Query|StatementInterface|string | [
"Processes",
"a",
"table",
"name",
"or",
"table",
"subquery"
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L138-L145 |
202,417 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processSelect | protected function processSelect($select, $context)
{
if ($select instanceof Aggregate) {
$column = $this->processColumnOrSubQuery($select->column, $context);
if ($column === $select->column) {
return $select;
} else {
return new Aggregate(... | php | protected function processSelect($select, $context)
{
if ($select instanceof Aggregate) {
$column = $this->processColumnOrSubQuery($select->column, $context);
if ($column === $select->column) {
return $select;
} else {
return new Aggregate(... | [
"protected",
"function",
"processSelect",
"(",
"$",
"select",
",",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"select",
"instanceof",
"Aggregate",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"processColumnOrSubQuery",
"(",
"$",
"select",
"->",
"column"... | Processes a single select column.
@param string|Aggregate|Query|StatementInterface $select
@param mixed $context The processing context
@return string|Aggregate|Query|StatementInterface | [
"Processes",
"a",
"single",
"select",
"column",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L165-L177 |
202,418 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processColumnOrSubQuery | protected function processColumnOrSubQuery($column, $context)
{
if (is_string($column)) {
return $this->processColumnName($column, $context);
}
return $this->processSubQuery($column, $context);
} | php | protected function processColumnOrSubQuery($column, $context)
{
if (is_string($column)) {
return $this->processColumnName($column, $context);
}
return $this->processSubQuery($column, $context);
} | [
"protected",
"function",
"processColumnOrSubQuery",
"(",
"$",
"column",
",",
"$",
"context",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"column",
")",
")",
"{",
"return",
"$",
"this",
"->",
"processColumnName",
"(",
"$",
"column",
",",
"$",
"context",
"... | Processes a "column or subquery" value.
@param string|Query|StatementInterface $column
@param mixed $context The processing context
@return string|Query|StatementInterface | [
"Processes",
"a",
"column",
"or",
"subquery",
"value",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L186-L193 |
202,419 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processSubQuery | protected function processSubQuery($subQuery, $context)
{
if ($subQuery instanceof Query) {
return $this->processQuery($subQuery, $context);
}
return $subQuery;
} | php | protected function processSubQuery($subQuery, $context)
{
if ($subQuery instanceof Query) {
return $this->processQuery($subQuery, $context);
}
return $subQuery;
} | [
"protected",
"function",
"processSubQuery",
"(",
"$",
"subQuery",
",",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"subQuery",
"instanceof",
"Query",
")",
"{",
"return",
"$",
"this",
"->",
"processQuery",
"(",
"$",
"subQuery",
",",
"$",
"context",
")",
";"... | Processes a subquery. Not-subquery values are just passed through.
@param Query|StatementInterface $subQuery
@param mixed $context The processing context
@return Query|StatementInterface | [
"Processes",
"a",
"subquery",
".",
"Not",
"-",
"subquery",
"values",
"are",
"just",
"passed",
"through",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L226-L233 |
202,420 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processInsert | protected function processInsert($row, $context)
{
if ($row instanceof InsertFromSelect) {
return $this->processInsertFromSelect($row, $context);
}
$newRow = [];
foreach ($row as $column => $value) {
$column = $this->processColumnName($column, $context);
... | php | protected function processInsert($row, $context)
{
if ($row instanceof InsertFromSelect) {
return $this->processInsertFromSelect($row, $context);
}
$newRow = [];
foreach ($row as $column => $value) {
$column = $this->processColumnName($column, $context);
... | [
"protected",
"function",
"processInsert",
"(",
"$",
"row",
",",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"row",
"instanceof",
"InsertFromSelect",
")",
"{",
"return",
"$",
"this",
"->",
"processInsertFromSelect",
"(",
"$",
"row",
",",
"$",
"context",
")",
... | Processes a single insert statement.
@param mixed[]|Query[]|StatementInterface[]|InsertFromSelect $row
@param mixed $context The processing context
@return mixed[]|Query[]|StatementInterface[]|InsertFromSelect | [
"Processes",
"a",
"single",
"insert",
"statement",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L242-L255 |
202,421 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processInsertFromSelect | protected function processInsertFromSelect(InsertFromSelect $row, $context): InsertFromSelect
{
if ($row->columns === null) {
$columns = null;
} else {
$columns = [];
foreach ($row->columns as $index => $column) {
$columns[$index] = $this->processC... | php | protected function processInsertFromSelect(InsertFromSelect $row, $context): InsertFromSelect
{
if ($row->columns === null) {
$columns = null;
} else {
$columns = [];
foreach ($row->columns as $index => $column) {
$columns[$index] = $this->processC... | [
"protected",
"function",
"processInsertFromSelect",
"(",
"InsertFromSelect",
"$",
"row",
",",
"$",
"context",
")",
":",
"InsertFromSelect",
"{",
"if",
"(",
"$",
"row",
"->",
"columns",
"===",
"null",
")",
"{",
"$",
"columns",
"=",
"null",
";",
"}",
"else",... | Processes a single "insert from select" statement.
@param InsertFromSelect $row
@param mixed $context The processing context
@return InsertFromSelect | [
"Processes",
"a",
"single",
"insert",
"from",
"select",
"statement",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L264-L281 |
202,422 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processJoin | protected function processJoin(Join $join, $context): Join
{
$table = $this->processTable($join->table, $context);
$criteria = [];
foreach ($join->criteria as $index => $criterion) {
$criteria[$index] = $this->processCriterion($criterion, $context);
}
if ($table ... | php | protected function processJoin(Join $join, $context): Join
{
$table = $this->processTable($join->table, $context);
$criteria = [];
foreach ($join->criteria as $index => $criterion) {
$criteria[$index] = $this->processCriterion($criterion, $context);
}
if ($table ... | [
"protected",
"function",
"processJoin",
"(",
"Join",
"$",
"join",
",",
"$",
"context",
")",
":",
"Join",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"processTable",
"(",
"$",
"join",
"->",
"table",
",",
"$",
"context",
")",
";",
"$",
"criteria",
"=",
... | Processes a single join.
@param Join $join
@param mixed $context The processing context
@return Join | [
"Processes",
"a",
"single",
"join",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L290-L303 |
202,423 | Finesse/QueryScribe | src/PostProcessors/AbstractProcessor.php | AbstractProcessor.processOrder | protected function processOrder($order, $context)
{
if ($order instanceof Order || $order instanceof OrderByIsNull) {
$column = $this->processColumnOrSubQuery($order->column, $context);
if ($column === $order->column) {
return $order;
} elseif ($order ins... | php | protected function processOrder($order, $context)
{
if ($order instanceof Order || $order instanceof OrderByIsNull) {
$column = $this->processColumnOrSubQuery($order->column, $context);
if ($column === $order->column) {
return $order;
} elseif ($order ins... | [
"protected",
"function",
"processOrder",
"(",
"$",
"order",
",",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"order",
"instanceof",
"Order",
"||",
"$",
"order",
"instanceof",
"OrderByIsNull",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"processColumnOrS... | Processes a single order statement.
@param Order|OrderByIsNull|ExplicitOrder|string $order
@param mixed $context The processing context
@return Order|string | [
"Processes",
"a",
"single",
"order",
"statement",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/PostProcessors/AbstractProcessor.php#L409-L439 |
202,424 | bseddon/XPath20 | Iterator/ChildNodeIterator.php | ChildNodeIterator.skip | private function skip( $nav )
{
if ( $this->excludeComments && $nav->getNodeType() == XML_COMMENT_NODE )
{
$this->commentsSkipped++;
}
return ( $this->excludeComments && $nav->getNodeType() == XML_COMMENT_NODE ) ||
( $this->excludeWhitespace && $nav->IsWhitespaceNode() );
} | php | private function skip( $nav )
{
if ( $this->excludeComments && $nav->getNodeType() == XML_COMMENT_NODE )
{
$this->commentsSkipped++;
}
return ( $this->excludeComments && $nav->getNodeType() == XML_COMMENT_NODE ) ||
( $this->excludeWhitespace && $nav->IsWhitespaceNode() );
} | [
"private",
"function",
"skip",
"(",
"$",
"nav",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"excludeComments",
"&&",
"$",
"nav",
"->",
"getNodeType",
"(",
")",
"==",
"XML_COMMENT_NODE",
")",
"{",
"$",
"this",
"->",
"commentsSkipped",
"++",
";",
"}",
"retur... | Check whether to skip this node
@param XPathNavigator $nav
@return boolean | [
"Check",
"whether",
"to",
"skip",
"this",
"node"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Iterator/ChildNodeIterator.php#L112-L120 |
202,425 | eureka-framework/component-http | src/Http/Data.php | Data.get | public function get($name = null, $default = null)
{
$value = null;
if (null === $name) {
$value = $this->data;
} elseif (isset($this->data[$name])) {
$value = $this->data[$name];
} elseif (null !== $default) {
$value = $default;
} else {
... | php | public function get($name = null, $default = null)
{
$value = null;
if (null === $name) {
$value = $this->data;
} elseif (isset($this->data[$name])) {
$value = $this->data[$name];
} elseif (null !== $default) {
$value = $default;
} else {
... | [
"public",
"function",
"get",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"null",
"===",
"$",
"name",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"data",
";",
"}",
"... | Get request data.
@param string $name
@param mixed $default
@return mixed Value
@throws \Exception | [
"Get",
"request",
"data",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Data.php#L53-L68 |
202,426 | kitpages/KitpagesChainBundle | Step/StepAbstract.php | StepAbstract.getRenderedParameter | public function getRenderedParameter($key, $escaper = null)
{
$subject = $this->getParameter($key);
preg_match_all('/{{([a-zA-Z0-9\.\-\_]+)}}/', $subject, $matches);
$parameterList = $matches[1];
foreach ($parameterList as $parameterKey) {
$val = $this->getParameter($para... | php | public function getRenderedParameter($key, $escaper = null)
{
$subject = $this->getParameter($key);
preg_match_all('/{{([a-zA-Z0-9\.\-\_]+)}}/', $subject, $matches);
$parameterList = $matches[1];
foreach ($parameterList as $parameterKey) {
$val = $this->getParameter($para... | [
"public",
"function",
"getRenderedParameter",
"(",
"$",
"key",
",",
"$",
"escaper",
"=",
"null",
")",
"{",
"$",
"subject",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"$",
"key",
")",
";",
"preg_match_all",
"(",
"'/{{([a-zA-Z0-9\\.\\-\\_]+)}}/'",
",",
"$",
... | used to transform a value in a parameter.
ex :
$parameterList['foo'] = 'ls {{fileName}} {{bar}}';
$parameterList['fileName'] = '/tmp/titi';
// $parameterList['bar'] is undefined
=> $this->getRenderedParameter('foo', function ($str) { strtoupper($str); } );
Result : ls /TMP/TITI
@param $key
@param callable $escaper
@... | [
"used",
"to",
"transform",
"a",
"value",
"in",
"a",
"parameter",
"."
] | f884d1875b6a6b6b9c66e161884cc3a2c1edc0e6 | https://github.com/kitpages/KitpagesChainBundle/blob/f884d1875b6a6b6b9c66e161884cc3a2c1edc0e6/Step/StepAbstract.php#L54-L71 |
202,427 | Innmind/Math | src/Polynom/Polynom.php | Polynom.withDegree | public function withDegree(Integer $degree, Number $coeff): self
{
$degrees = $this->degrees->put(
$degree->value(),
new Degree($degree, $coeff)
);
return new self(
$this->intercept,
...$degrees->values()
);
} | php | public function withDegree(Integer $degree, Number $coeff): self
{
$degrees = $this->degrees->put(
$degree->value(),
new Degree($degree, $coeff)
);
return new self(
$this->intercept,
...$degrees->values()
);
} | [
"public",
"function",
"withDegree",
"(",
"Integer",
"$",
"degree",
",",
"Number",
"$",
"coeff",
")",
":",
"self",
"{",
"$",
"degrees",
"=",
"$",
"this",
"->",
"degrees",
"->",
"put",
"(",
"$",
"degree",
"->",
"value",
"(",
")",
",",
"new",
"Degree",
... | Create a new polynom with this added degree
@param Integer $degree
@param Number $coeff
@return self | [
"Create",
"a",
"new",
"polynom",
"with",
"this",
"added",
"degree"
] | ac9ad4dd1852c145e90f5edc0f38a873b125a50b | https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Polynom/Polynom.php#L44-L55 |
202,428 | Innmind/Math | src/Polynom/Polynom.php | Polynom.derived | public function derived(Number $x, Number $limit = null): Number
{
$limit = $limit ?? Tangent::limit();
return divide(
subtract(
$this(add($x, $limit)),
$this($x)
),
$limit
);
} | php | public function derived(Number $x, Number $limit = null): Number
{
$limit = $limit ?? Tangent::limit();
return divide(
subtract(
$this(add($x, $limit)),
$this($x)
),
$limit
);
} | [
"public",
"function",
"derived",
"(",
"Number",
"$",
"x",
",",
"Number",
"$",
"limit",
"=",
"null",
")",
":",
"Number",
"{",
"$",
"limit",
"=",
"$",
"limit",
"??",
"Tangent",
"::",
"limit",
"(",
")",
";",
"return",
"divide",
"(",
"subtract",
"(",
"... | Compute the derived number of x
@param Number $x
@param Number|null $limit Value that tend to 0 (default to 0.000000000001)
@return Number | [
"Compute",
"the",
"derived",
"number",
"of",
"x"
] | ac9ad4dd1852c145e90f5edc0f38a873b125a50b | https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Polynom/Polynom.php#L121-L132 |
202,429 | TiMESPLiNTER/gphpio | src/RPi.php | RPi.getGPIOPins | public function getGPIOPins()
{
if(true === in_array($this->revision, ['a01041', 'a21041', 'a22042'], true)) {
// Pi 2 revs
return range(2, 27);
}
if(true === in_array($this->revision, ['a02082', 'a22082', 'a32082'], true)) {
// Pi 3 revs
return range(2, 27);
}
// Pi 1 revs
return [0, 1, 4, 7... | php | public function getGPIOPins()
{
if(true === in_array($this->revision, ['a01041', 'a21041', 'a22042'], true)) {
// Pi 2 revs
return range(2, 27);
}
if(true === in_array($this->revision, ['a02082', 'a22082', 'a32082'], true)) {
// Pi 3 revs
return range(2, 27);
}
// Pi 1 revs
return [0, 1, 4, 7... | [
"public",
"function",
"getGPIOPins",
"(",
")",
"{",
"if",
"(",
"true",
"===",
"in_array",
"(",
"$",
"this",
"->",
"revision",
",",
"[",
"'a01041'",
",",
"'a21041'",
",",
"'a22042'",
"]",
",",
"true",
")",
")",
"{",
"// Pi 2 revs",
"return",
"range",
"(... | Get the valid GPIO pin map
@return array | [
"Get",
"the",
"valid",
"GPIO",
"pin",
"map"
] | afde198a37dcf9f1558313cfcd29b813e6d746a8 | https://github.com/TiMESPLiNTER/gphpio/blob/afde198a37dcf9f1558313cfcd29b813e6d746a8/src/RPi.php#L64-L78 |
202,430 | TiMESPLiNTER/gphpio | src/RPi.php | RPi.getName | public function getName()
{
if(false === isset(self::$modelNameMap[$this->revision])) {
return 'unknown';
}
return self::$modelNameMap[$this->revision];
} | php | public function getName()
{
if(false === isset(self::$modelNameMap[$this->revision])) {
return 'unknown';
}
return self::$modelNameMap[$this->revision];
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"isset",
"(",
"self",
"::",
"$",
"modelNameMap",
"[",
"$",
"this",
"->",
"revision",
"]",
")",
")",
"{",
"return",
"'unknown'",
";",
"}",
"return",
"self",
"::",
"$",
"modelNa... | Get the revision name
@return string | [
"Get",
"the",
"revision",
"name"
] | afde198a37dcf9f1558313cfcd29b813e6d746a8 | https://github.com/TiMESPLiNTER/gphpio/blob/afde198a37dcf9f1558313cfcd29b813e6d746a8/src/RPi.php#L85-L92 |
202,431 | linuxjuggler/lumen-make | src/Commands/ModelMakeCommand.php | ModelMakeCommand.createFactory | protected function createFactory()
{
$factory = Str::studly(class_basename($this->argument('name')));
$this->call('make:factory', [
'name' => "{$factory}Factory",
'--model' => $this->argument('name'),
]);
} | php | protected function createFactory()
{
$factory = Str::studly(class_basename($this->argument('name')));
$this->call('make:factory', [
'name' => "{$factory}Factory",
'--model' => $this->argument('name'),
]);
} | [
"protected",
"function",
"createFactory",
"(",
")",
"{",
"$",
"factory",
"=",
"Str",
"::",
"studly",
"(",
"class_basename",
"(",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
")",
")",
";",
"$",
"this",
"->",
"call",
"(",
"'make:factory'",
",",
"[... | Create a model factory for the model. | [
"Create",
"a",
"model",
"factory",
"for",
"the",
"model",
"."
] | 80e794f78957ea56770a1b27c0f7160d0b7ea76d | https://github.com/linuxjuggler/lumen-make/blob/80e794f78957ea56770a1b27c0f7160d0b7ea76d/src/Commands/ModelMakeCommand.php#L64-L72 |
202,432 | itcreator/custom-cmf | Module/Captcha/src/Cmf/Captcha/Captcha.php | Captcha.generateCode | public function generateCode()
{
$this->digits[0] = rand(0, 9);
$this->digits[1] = rand(0, 9);
$this->digits[2] = rand(0, 9);
$this->digits[3] = rand(0, 9);
$this->digits[4] = rand(0, 9);
$this->value = $this->digits[0] * 10000 + $this->digits[1] * 1000;
$this... | php | public function generateCode()
{
$this->digits[0] = rand(0, 9);
$this->digits[1] = rand(0, 9);
$this->digits[2] = rand(0, 9);
$this->digits[3] = rand(0, 9);
$this->digits[4] = rand(0, 9);
$this->value = $this->digits[0] * 10000 + $this->digits[1] * 1000;
$this... | [
"public",
"function",
"generateCode",
"(",
")",
"{",
"$",
"this",
"->",
"digits",
"[",
"0",
"]",
"=",
"rand",
"(",
"0",
",",
"9",
")",
";",
"$",
"this",
"->",
"digits",
"[",
"1",
"]",
"=",
"rand",
"(",
"0",
",",
"9",
")",
";",
"$",
"this",
... | generate captcha value
@return Captcha | [
"generate",
"captcha",
"value"
] | 42fc0535dfa0f641856f06673f6ab596b2020c40 | https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Captcha/src/Cmf/Captcha/Captcha.php#L40-L53 |
202,433 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Abstracts/AbstractEndpoint.php | AbstractEndpoint.configureRequest | protected function configureRequest(RequestInterface $Request)
{
if ($Request->getStatus() >= Curl::STATUS_SENT){
$Request->reset();
}
if (isset($this->properties[self::PROPERTY_HTTP_METHOD]) &&
$this->properties[self::PROPERTY_HTTP_METHOD] !== ''){
$Reque... | php | protected function configureRequest(RequestInterface $Request)
{
if ($Request->getStatus() >= Curl::STATUS_SENT){
$Request->reset();
}
if (isset($this->properties[self::PROPERTY_HTTP_METHOD]) &&
$this->properties[self::PROPERTY_HTTP_METHOD] !== ''){
$Reque... | [
"protected",
"function",
"configureRequest",
"(",
"RequestInterface",
"$",
"Request",
")",
"{",
"if",
"(",
"$",
"Request",
"->",
"getStatus",
"(",
")",
">=",
"Curl",
"::",
"STATUS_SENT",
")",
"{",
"$",
"Request",
"->",
"reset",
"(",
")",
";",
"}",
"if",
... | Verifies URL and Data are setup, then sets them on the Request Object
@param RequestInterface $Request
@return RequestInterface | [
"Verifies",
"URL",
"and",
"Data",
"are",
"setup",
"then",
"sets",
"them",
"on",
"the",
"Request",
"Object"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L285-L308 |
202,434 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Abstracts/AbstractEndpoint.php | AbstractEndpoint.configureResponse | protected function configureResponse(ResponseInterface $Response){
$Response->setRequest($this->Request);
$Response->extract();
return $Response;
} | php | protected function configureResponse(ResponseInterface $Response){
$Response->setRequest($this->Request);
$Response->extract();
return $Response;
} | [
"protected",
"function",
"configureResponse",
"(",
"ResponseInterface",
"$",
"Response",
")",
"{",
"$",
"Response",
"->",
"setRequest",
"(",
"$",
"this",
"->",
"Request",
")",
";",
"$",
"Response",
"->",
"extract",
"(",
")",
";",
"return",
"$",
"Response",
... | Configure the Response Object after sending of the Request
@param ResponseInterface $Response
@return ResponseInterface | [
"Configure",
"the",
"Response",
"Object",
"after",
"sending",
"of",
"the",
"Request"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L315-L319 |
202,435 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Abstracts/AbstractEndpoint.php | AbstractEndpoint.verifyUrl | private function verifyUrl($url)
{
if (strpos($url, static::$_URL_VAR_CHARACTER) !== false) {
throw new InvalidUrl(array(get_class($this), $url));
}
return true;
} | php | private function verifyUrl($url)
{
if (strpos($url, static::$_URL_VAR_CHARACTER) !== false) {
throw new InvalidUrl(array(get_class($this), $url));
}
return true;
} | [
"private",
"function",
"verifyUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"url",
",",
"static",
"::",
"$",
"_URL_VAR_CHARACTER",
")",
"!==",
"false",
")",
"{",
"throw",
"new",
"InvalidUrl",
"(",
"array",
"(",
"get_class",
"(",
"$",
... | Verify if URL is configured properly
@param string $url
@return bool
@throws InvalidUrl | [
"Verify",
"if",
"URL",
"is",
"configured",
"properly"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L389-L395 |
202,436 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Abstracts/AbstractEndpoint.php | AbstractEndpoint.requiresOptions | protected function requiresOptions()
{
$url = $this->getEndPointUrl();
$variables = $this->extractUrlVariables($url);
return !empty($variables);
} | php | protected function requiresOptions()
{
$url = $this->getEndPointUrl();
$variables = $this->extractUrlVariables($url);
return !empty($variables);
} | [
"protected",
"function",
"requiresOptions",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getEndPointUrl",
"(",
")",
";",
"$",
"variables",
"=",
"$",
"this",
"->",
"extractUrlVariables",
"(",
"$",
"url",
")",
";",
"return",
"!",
"empty",
"(",
"$"... | Checks if Endpoint URL requires Options
@return bool|array | [
"Checks",
"if",
"Endpoint",
"URL",
"requires",
"Options"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L402-L407 |
202,437 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Abstracts/AbstractEndpoint.php | AbstractEndpoint.extractUrlVariables | protected function extractUrlVariables($url){
$variables = array();
$pattern = "/(\\".static::$_URL_VAR_CHARACTER.".*?[^\\/]*)/";
if (preg_match($pattern,$url,$matches)){
array_shift($matches);
foreach($matches as $match){
$variables[] = $match[0];
... | php | protected function extractUrlVariables($url){
$variables = array();
$pattern = "/(\\".static::$_URL_VAR_CHARACTER.".*?[^\\/]*)/";
if (preg_match($pattern,$url,$matches)){
array_shift($matches);
foreach($matches as $match){
$variables[] = $match[0];
... | [
"protected",
"function",
"extractUrlVariables",
"(",
"$",
"url",
")",
"{",
"$",
"variables",
"=",
"array",
"(",
")",
";",
"$",
"pattern",
"=",
"\"/(\\\\\"",
".",
"static",
"::",
"$",
"_URL_VAR_CHARACTER",
".",
"\".*?[^\\\\/]*)/\"",
";",
"if",
"(",
"preg_matc... | Helper method for extracting variables via Regex from a passed in URL
@param $url
@return array | [
"Helper",
"method",
"for",
"extracting",
"variables",
"via",
"Regex",
"from",
"a",
"passed",
"in",
"URL"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L414-L424 |
202,438 | Innmind/Math | src/Matrix/Vector.php | Vector.lead | public function lead(): Number
{
return $this->reduce(
new Integer(0),
static function(Number $lead, Number $number): Number {
if (!$lead->equals(new Integer(0))) {
return $lead;
}
return $number;
}
... | php | public function lead(): Number
{
return $this->reduce(
new Integer(0),
static function(Number $lead, Number $number): Number {
if (!$lead->equals(new Integer(0))) {
return $lead;
}
return $number;
}
... | [
"public",
"function",
"lead",
"(",
")",
":",
"Number",
"{",
"return",
"$",
"this",
"->",
"reduce",
"(",
"new",
"Integer",
"(",
"0",
")",
",",
"static",
"function",
"(",
"Number",
"$",
"lead",
",",
"Number",
"$",
"number",
")",
":",
"Number",
"{",
"... | First non zero number found | [
"First",
"non",
"zero",
"number",
"found"
] | ac9ad4dd1852c145e90f5edc0f38a873b125a50b | https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Matrix/Vector.php#L212-L224 |
202,439 | bseddon/XPath20 | XPath2Parser.php | XPath2Parser.log | public function log( $message )
{
if ( ! $this->enableLogging ) return;
if ( ! isset( $this->log ) ) $this->log = \lyquidity\XPath2\lyquidity\Log::getInstance();
$this->log->info( $message );
} | php | public function log( $message )
{
if ( ! $this->enableLogging ) return;
if ( ! isset( $this->log ) ) $this->log = \lyquidity\XPath2\lyquidity\Log::getInstance();
$this->log->info( $message );
} | [
"public",
"function",
"log",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enableLogging",
")",
"return",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"log",
")",
")",
"$",
"this",
"->",
"log",
"=",
"\\",
"lyquidity"... | Log a message to the current log target
@param string $message | [
"Log",
"a",
"message",
"to",
"the",
"current",
"log",
"target"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/XPath2Parser.php#L188-L193 |
202,440 | bseddon/XPath20 | XPath2Parser.php | XPath2Parser.yyExpecting | protected function yyExpecting ( $state )
{
$token = 0;
$n = 0;
$len = 0;
$ok = array_fill( 0, count( XPath2Parser::$yyName ), false );
if ( ( $n = XPath2Parser::$yySindex[ $state ] ) != 0 )
{
for ( $token = $n < 0 ? -$n : 0; ( $token < count( XPath2Parser::$yyName ) && ( $n + $token < count( ... | php | protected function yyExpecting ( $state )
{
$token = 0;
$n = 0;
$len = 0;
$ok = array_fill( 0, count( XPath2Parser::$yyName ), false );
if ( ( $n = XPath2Parser::$yySindex[ $state ] ) != 0 )
{
for ( $token = $n < 0 ? -$n : 0; ( $token < count( XPath2Parser::$yyName ) && ( $n + $token < count( ... | [
"protected",
"function",
"yyExpecting",
"(",
"$",
"state",
")",
"{",
"$",
"token",
"=",
"0",
";",
"$",
"n",
"=",
"0",
";",
"$",
"len",
"=",
"0",
";",
"$",
"ok",
"=",
"array_fill",
"(",
"0",
",",
"count",
"(",
"XPath2Parser",
"::",
"$",
"yyName",
... | computes list of expected tokens on error by tracing the tables.
@param int $state for which to compute the list.
@return array list of token names. | [
"computes",
"list",
"of",
"expected",
"tokens",
"on",
"error",
"by",
"tracing",
"the",
"tables",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/XPath2Parser.php#L491-L529 |
202,441 | itkg/core | src/Itkg/Core/Cache/Adapter/FileSystem.php | FileSystem.get | public function get(CacheableInterface $item)
{
$targetFile = $this->getTargetFile($item->getHashKey());
$return = false;
if (file_exists($targetFile)) {
if ($item->getTtl() > 0 && ((filemtime($targetFile) + $item->getTtl()) < time())) {
$this->remove($item);
... | php | public function get(CacheableInterface $item)
{
$targetFile = $this->getTargetFile($item->getHashKey());
$return = false;
if (file_exists($targetFile)) {
if ($item->getTtl() > 0 && ((filemtime($targetFile) + $item->getTtl()) < time())) {
$this->remove($item);
... | [
"public",
"function",
"get",
"(",
"CacheableInterface",
"$",
"item",
")",
"{",
"$",
"targetFile",
"=",
"$",
"this",
"->",
"getTargetFile",
"(",
"$",
"item",
"->",
"getHashKey",
"(",
")",
")",
";",
"$",
"return",
"=",
"false",
";",
"if",
"(",
"file_exis... | Get value from cache
Must return false when cache is expired or invalid
@param \Itkg\Core\CacheableInterface $item
@return mixed | [
"Get",
"value",
"from",
"cache",
"Must",
"return",
"false",
"when",
"cache",
"is",
"expired",
"or",
"invalid"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Cache/Adapter/FileSystem.php#L106-L120 |
202,442 | rawphp/RawMigrator | lib/Migrator.php | Migrator.init | public function init( $config = NULL )
{
parent::init( $config );
if ( !isset( $config[ 'migration_path' ] ) )
{
throw new \InvalidArgumentException( 'Missing migration_path parameter' );
}
foreach ( $config as $key => $value )
{
... | php | public function init( $config = NULL )
{
parent::init( $config );
if ( !isset( $config[ 'migration_path' ] ) )
{
throw new \InvalidArgumentException( 'Missing migration_path parameter' );
}
foreach ( $config as $key => $value )
{
... | [
"public",
"function",
"init",
"(",
"$",
"config",
"=",
"NULL",
")",
"{",
"parent",
"::",
"init",
"(",
"$",
"config",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'migration_path'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidA... | Initialises the migrator.
@param array $config configuration array
@action ON_INIT_ACTION
@throws \InvalidArgumentException if a configuration is missing | [
"Initialises",
"the",
"migrator",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L95-L155 |
202,443 | rawphp/RawMigrator | lib/Migrator.php | Migrator.createMigration | public function createMigration( )
{
$date = new \DateTime();
$tStamp = substr( $date->format( 'U' ), 2 );
if ( self::STYLE_CAMEL_CASE !== $this->migrationClassStyle )
{
$parts = preg_split('/(?=[A-Z])/', $this->migrationClass, -1, PREG_SPLIT_NO_EMPTY);
... | php | public function createMigration( )
{
$date = new \DateTime();
$tStamp = substr( $date->format( 'U' ), 2 );
if ( self::STYLE_CAMEL_CASE !== $this->migrationClassStyle )
{
$parts = preg_split('/(?=[A-Z])/', $this->migrationClass, -1, PREG_SPLIT_NO_EMPTY);
... | [
"public",
"function",
"createMigration",
"(",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"tStamp",
"=",
"substr",
"(",
"$",
"date",
"->",
"format",
"(",
"'U'",
")",
",",
"2",
")",
";",
"if",
"(",
"self",
"::",
"STYLE... | Creates a new migration class file.
@filter ON_CREATE_MIGRATION_FILTER
@action ON_CREATE_MIGRATION_ACTION
@return bool TRUE on success, FALSE on failure
@throws MigrationException if configuration is missing | [
"Creates",
"a",
"new",
"migration",
"class",
"file",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L168-L203 |
202,444 | rawphp/RawMigrator | lib/Migrator.php | Migrator.getMigrationTemplate | public function getMigrationTemplate( $name )
{
$template = '<?php' . PHP_EOL . PHP_EOL;
if ( '' !== $this->migrationNamespace )
{
$template .= 'namespace ' . $this->migrationNamespace . ';' . PHP_EOL . PHP_EOL;
}
$template .= 'use RawPHP\RawMigr... | php | public function getMigrationTemplate( $name )
{
$template = '<?php' . PHP_EOL . PHP_EOL;
if ( '' !== $this->migrationNamespace )
{
$template .= 'namespace ' . $this->migrationNamespace . ';' . PHP_EOL . PHP_EOL;
}
$template .= 'use RawPHP\RawMigr... | [
"public",
"function",
"getMigrationTemplate",
"(",
"$",
"name",
")",
"{",
"$",
"template",
"=",
"'<?php'",
".",
"PHP_EOL",
".",
"PHP_EOL",
";",
"if",
"(",
"''",
"!==",
"$",
"this",
"->",
"migrationNamespace",
")",
"{",
"$",
"template",
".=",
"'namespace '"... | Creates the migration template file code.
@param string $name new migration class name
@filter ON_GET_MIGRATION_TEMPLATE_FILTER
@return string class template | [
"Creates",
"the",
"migration",
"template",
"file",
"code",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L214-L275 |
202,445 | rawphp/RawMigrator | lib/Migrator.php | Migrator.createMigrationTable | public function createMigrationTable( )
{
if ( empty( $this->migrationTable ) )
{
throw new RawException( 'Migration table name must be set' );
}
$result = NULL;
$table = array(
'migration_id' => 'INTEGER(11) PRIMARY KEY AUT... | php | public function createMigrationTable( )
{
if ( empty( $this->migrationTable ) )
{
throw new RawException( 'Migration table name must be set' );
}
$result = NULL;
$table = array(
'migration_id' => 'INTEGER(11) PRIMARY KEY AUT... | [
"public",
"function",
"createMigrationTable",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"migrationTable",
")",
")",
"{",
"throw",
"new",
"RawException",
"(",
"'Migration table name must be set'",
")",
";",
"}",
"$",
"result",
"=",
"NULL",
";... | Creates the migration database table if it doesn't exist.
@action ON_CREATE_MIGRATION_TABLE_ACTION
@return bool TRUE on success, FALSE on failure
@throws RawException if migration table is not set | [
"Creates",
"the",
"migration",
"database",
"table",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L286-L309 |
202,446 | rawphp/RawMigrator | lib/Migrator.php | Migrator.getMigrations | public function getMigrations( )
{
$migrations = array();
$dir = opendir( $this->migrationPath );
while ( ( $file = readdir( $dir ) ) !== FALSE )
{
if ( '.' !== $file && '..' !== $file )
{
$migrations[] = str_replace( '.php', ... | php | public function getMigrations( )
{
$migrations = array();
$dir = opendir( $this->migrationPath );
while ( ( $file = readdir( $dir ) ) !== FALSE )
{
if ( '.' !== $file && '..' !== $file )
{
$migrations[] = str_replace( '.php', ... | [
"public",
"function",
"getMigrations",
"(",
")",
"{",
"$",
"migrations",
"=",
"array",
"(",
")",
";",
"$",
"dir",
"=",
"opendir",
"(",
"$",
"this",
"->",
"migrationPath",
")",
";",
"while",
"(",
"(",
"$",
"file",
"=",
"readdir",
"(",
"$",
"dir",
")... | Returns a list of migration files.
@filter ON_GET_MIGRATIONS_FILTER
@return array list of available migrations | [
"Returns",
"a",
"list",
"of",
"migration",
"files",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L318-L337 |
202,447 | rawphp/RawMigrator | lib/Migrator.php | Migrator.getNewMigrations | public function getNewMigrations( )
{
// check if migration table exists
$exists = $this->db->tableExists( $this->migrationTable );
if ( !$exists )
{
$this->createMigrationTable( );
}
$query = "SELECT * FROM $this->migrationTable";
... | php | public function getNewMigrations( )
{
// check if migration table exists
$exists = $this->db->tableExists( $this->migrationTable );
if ( !$exists )
{
$this->createMigrationTable( );
}
$query = "SELECT * FROM $this->migrationTable";
... | [
"public",
"function",
"getNewMigrations",
"(",
")",
"{",
"// check if migration table exists",
"$",
"exists",
"=",
"$",
"this",
"->",
"db",
"->",
"tableExists",
"(",
"$",
"this",
"->",
"migrationTable",
")",
";",
"if",
"(",
"!",
"$",
"exists",
")",
"{",
"$... | Returns a list of new migrations.
@filter ON_GET_NEW_MIGRATIONS_FILTER
@return array list of migrations | [
"Returns",
"a",
"list",
"of",
"new",
"migrations",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L346-L397 |
202,448 | rawphp/RawMigrator | lib/Migrator.php | Migrator.getAppliedMigrations | public function getAppliedMigrations( )
{
$query = "SELECT * FROM $this->migrationTable";
$applied = $this->db->query( $query );
$list = array();
foreach( $applied as $mig )
{
$list[] = $mig[ 'migration_name' ];
}
... | php | public function getAppliedMigrations( )
{
$query = "SELECT * FROM $this->migrationTable";
$applied = $this->db->query( $query );
$list = array();
foreach( $applied as $mig )
{
$list[] = $mig[ 'migration_name' ];
}
... | [
"public",
"function",
"getAppliedMigrations",
"(",
")",
"{",
"$",
"query",
"=",
"\"SELECT * FROM $this->migrationTable\"",
";",
"$",
"applied",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"$",
"query",
")",
";",
"$",
"list",
"=",
"array",
"(",
")",
... | Returns a list of applied migrations.
@filter ON_GET_APPLIED_MIGRATIONS_FILTER
@return array list of applied migrations | [
"Returns",
"a",
"list",
"of",
"applied",
"migrations",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L406-L422 |
202,449 | rawphp/RawMigrator | lib/Migrator.php | Migrator.migrateUp | public function migrateUp( $levels = NULL )
{
if ( NULL !== $levels )
{
$this->levels = $levels;
}
$newMigrations = $this->getNewMigrations( );
$i = 0;
if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $newMigrat... | php | public function migrateUp( $levels = NULL )
{
if ( NULL !== $levels )
{
$this->levels = $levels;
}
$newMigrations = $this->getNewMigrations( );
$i = 0;
if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $newMigrat... | [
"public",
"function",
"migrateUp",
"(",
"$",
"levels",
"=",
"NULL",
")",
"{",
"if",
"(",
"NULL",
"!==",
"$",
"levels",
")",
"{",
"$",
"this",
"->",
"levels",
"=",
"$",
"levels",
";",
"}",
"$",
"newMigrations",
"=",
"$",
"this",
"->",
"getNewMigration... | Runs the UP migration.
@param mixed $levels optional migration levels size
@action ON_MIGRATE_UP_ACTION
@throws MigrationException on failed transaction | [
"Runs",
"the",
"UP",
"migration",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L433-L530 |
202,450 | rawphp/RawMigrator | lib/Migrator.php | Migrator.migrateDown | public function migrateDown( $levels = NULL )
{
if ( NULL !== $levels )
{
$this->levels = $levels;
}
$migrations = $this->getAppliedMigrations( );
$i = 0;
if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $migrat... | php | public function migrateDown( $levels = NULL )
{
if ( NULL !== $levels )
{
$this->levels = $levels;
}
$migrations = $this->getAppliedMigrations( );
$i = 0;
if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $migrat... | [
"public",
"function",
"migrateDown",
"(",
"$",
"levels",
"=",
"NULL",
")",
"{",
"if",
"(",
"NULL",
"!==",
"$",
"levels",
")",
"{",
"$",
"this",
"->",
"levels",
"=",
"$",
"levels",
";",
"}",
"$",
"migrations",
"=",
"$",
"this",
"->",
"getAppliedMigrat... | Runs the DOWN migration.
@param mixed $levels optional migration levels size
@action ON_MIGRATE_DOWN_ACTION
@throws MigrationException on failed transaction | [
"Runs",
"the",
"DOWN",
"migration",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L541-L624 |
202,451 | rawphp/RawMigrator | lib/Migrator.php | Migrator._addMigrationRecord | private function _addMigrationRecord( $class )
{
$name = $this->db->prepareString( $class );
$tm = new \DateTime();
$tm = $tm->getTimestamp();
// update migrations table with the new applied migration
$query = "INSERT INTO $this->migrationTable
... | php | private function _addMigrationRecord( $class )
{
$name = $this->db->prepareString( $class );
$tm = new \DateTime();
$tm = $tm->getTimestamp();
// update migrations table with the new applied migration
$query = "INSERT INTO $this->migrationTable
... | [
"private",
"function",
"_addMigrationRecord",
"(",
"$",
"class",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"db",
"->",
"prepareString",
"(",
"$",
"class",
")",
";",
"$",
"tm",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"tm",
"=",
"$",
... | Inserts an applied migration into the database.
@param string $class migration name
@return bool TRUE on success, FALSE on failure | [
"Inserts",
"an",
"applied",
"migration",
"into",
"the",
"database",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L633-L660 |
202,452 | rawphp/RawMigrator | lib/Migrator.php | Migrator._deleteMigrationRecord | private function _deleteMigrationRecord( $class )
{
$name = $this->db->prepareString( $class );
$query = "DELETE FROM $this->migrationTable WHERE migration_name = '$name'";
$this->db->lockTables( $this->migrationTable );
$result = $this->db->execute( $query... | php | private function _deleteMigrationRecord( $class )
{
$name = $this->db->prepareString( $class );
$query = "DELETE FROM $this->migrationTable WHERE migration_name = '$name'";
$this->db->lockTables( $this->migrationTable );
$result = $this->db->execute( $query... | [
"private",
"function",
"_deleteMigrationRecord",
"(",
"$",
"class",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"db",
"->",
"prepareString",
"(",
"$",
"class",
")",
";",
"$",
"query",
"=",
"\"DELETE FROM $this->migrationTable WHERE migration_name = '$name'\"",
... | Deletes a migration entry from the database.
@param string $class migration name
@return bool TRUE on success, FALSE on failure | [
"Deletes",
"a",
"migration",
"entry",
"from",
"the",
"database",
"."
] | bbf5e354d7ff532552fd6865b38e4c1a3b6f3757 | https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L669-L687 |
202,453 | CascadeEnergy/distributed-locking | src/DistributedLocking/LockSet/DefaultLockSet.php | DefaultLockSet.lock | public function lock($lockName)
{
$lockHandle = $this->lockProvider->lock($lockName);
if ($lockHandle === false) {
return false;
}
$this->lockList[$lockName] = $lockHandle;
return true;
} | php | public function lock($lockName)
{
$lockHandle = $this->lockProvider->lock($lockName);
if ($lockHandle === false) {
return false;
}
$this->lockList[$lockName] = $lockHandle;
return true;
} | [
"public",
"function",
"lock",
"(",
"$",
"lockName",
")",
"{",
"$",
"lockHandle",
"=",
"$",
"this",
"->",
"lockProvider",
"->",
"lock",
"(",
"$",
"lockName",
")",
";",
"if",
"(",
"$",
"lockHandle",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}"... | Attempts to acquire a single lock by name, and adds it to the lock set.
@param string $lockName The name of the lock to acquire
@return bool True if the lock was acquired, false otherwise | [
"Attempts",
"to",
"acquire",
"a",
"single",
"lock",
"by",
"name",
"and",
"adds",
"it",
"to",
"the",
"lock",
"set",
"."
] | 866e5aa41398ec33f7113b42663437005caf498a | https://github.com/CascadeEnergy/distributed-locking/blob/866e5aa41398ec33f7113b42663437005caf498a/src/DistributedLocking/LockSet/DefaultLockSet.php#L42-L52 |
202,454 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Payload.php | Payload.toArray | public function toArray()
{
$results = [];
foreach ($this->claims as $claim) {
$results[$claim->getName()] = $claim->getValue();
}
return $results;
} | php | public function toArray()
{
$results = [];
foreach ($this->claims as $claim) {
$results[$claim->getName()] = $claim->getValue();
}
return $results;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"claims",
"as",
"$",
"claim",
")",
"{",
"$",
"results",
"[",
"$",
"claim",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"claim",
... | Get the array of claims.
@return array | [
"Get",
"the",
"array",
"of",
"claims",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Payload.php#L47-L55 |
202,455 | melisplatform/melis-calendar | src/Service/MelisCalendarService.php | MelisCalendarService.addCalendarEvent | public function addCalendarEvent($postValues){
$responseData = array();
$calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
$melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth');
$userAuthDatas = $melisCoreAuth->getStorage()->read();
$userId = ... | php | public function addCalendarEvent($postValues){
$responseData = array();
$calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
$melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth');
$userAuthDatas = $melisCoreAuth->getStorage()->read();
$userId = ... | [
"public",
"function",
"addCalendarEvent",
"(",
"$",
"postValues",
")",
"{",
"$",
"responseData",
"=",
"array",
"(",
")",
";",
"$",
"calendarTable",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCalendarTable'",
")",
";",
"... | Adding and Updating Calendar Event
@param array $postValues
if the action is adding new Event, the postValues containing
cal_event_title
cal_date_start
if the action is updating the Event title, the postValues containing
cal_id
cal_event_title
cal_date_start
@return Array | [
"Adding",
"and",
"Updating",
"Calendar",
"Event"
] | 1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223 | https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Service/MelisCalendarService.php#L48-L101 |
202,456 | melisplatform/melis-calendar | src/Service/MelisCalendarService.php | MelisCalendarService.deleteCalendarEvent | public function deleteCalendarEvent($postValues)
{
$calId = null;
$calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
$resultEvent = $calendarTable->getEntryById($postValues['cal_id']);
if (!empty($resultEvent)){
$event = $resultEvent->current();
... | php | public function deleteCalendarEvent($postValues)
{
$calId = null;
$calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
$resultEvent = $calendarTable->getEntryById($postValues['cal_id']);
if (!empty($resultEvent)){
$event = $resultEvent->current();
... | [
"public",
"function",
"deleteCalendarEvent",
"(",
"$",
"postValues",
")",
"{",
"$",
"calId",
"=",
"null",
";",
"$",
"calendarTable",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'MelisCalendarTable'",
")",
";",
"$",
"resultEvent"... | Deleting Calendar Item Event
@param Array $postValues, this containing the calendar id $postValues['cal_id']
@return Int|null if the deletion is failed | [
"Deleting",
"Calendar",
"Item",
"Event"
] | 1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223 | https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Service/MelisCalendarService.php#L146-L162 |
202,457 | ciims/ciims-modules-api | components/ApiAccessControlFilter.php | ApiAccessControlFilter.accessDenied | protected function accessDenied($user,$message=NULL)
{
http_response_code(403);
Yii::app()->controller->renderOutput(array(), 403, $message);
} | php | protected function accessDenied($user,$message=NULL)
{
http_response_code(403);
Yii::app()->controller->renderOutput(array(), 403, $message);
} | [
"protected",
"function",
"accessDenied",
"(",
"$",
"user",
",",
"$",
"message",
"=",
"NULL",
")",
"{",
"http_response_code",
"(",
"403",
")",
";",
"Yii",
"::",
"app",
"(",
")",
"->",
"controller",
"->",
"renderOutput",
"(",
"array",
"(",
")",
",",
"403... | Denies the access of the user.
This method is invoked when access check fails.
@param IWebUser $user the current user
@param string $message the error message to be displayed | [
"Denies",
"the",
"access",
"of",
"the",
"user",
".",
"This",
"method",
"is",
"invoked",
"when",
"access",
"check",
"fails",
"."
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiAccessControlFilter.php#L93-L97 |
202,458 | codemojo-dr/startkit-php-sdk | src/CodeMojo/Client/Services/LoyaltyService.php | LoyaltyService.addLoyaltyPoints | public function addLoyaltyPoints($user_id, $transaction_value, $platform = null, $service = null, $expires_in_days = null, $transaction_id = null, $meta = null, $tag = null, $frozen = false){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_LOYALTY . Endpoints::LOY... | php | public function addLoyaltyPoints($user_id, $transaction_value, $platform = null, $service = null, $expires_in_days = null, $transaction_id = null, $meta = null, $tag = null, $frozen = false){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_LOYALTY . Endpoints::LOY... | [
"public",
"function",
"addLoyaltyPoints",
"(",
"$",
"user_id",
",",
"$",
"transaction_value",
",",
"$",
"platform",
"=",
"null",
",",
"$",
"service",
"=",
"null",
",",
"$",
"expires_in_days",
"=",
"null",
",",
"$",
"transaction_id",
"=",
"null",
",",
"$",
... | Add loyalty points to users wallet
@param $user_id
@param $transaction_value
@param null $platform
@param null $service
@param null $expires_in_days
@param null $transaction_id
@param null $meta
@param null $tag
@param bool $frozen
@return bool
@throws \CodeMojo\Client\Http\InvalidArgumentException
@throws \CodeMojo\OA... | [
"Add",
"loyalty",
"points",
"to",
"users",
"wallet"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Services/LoyaltyService.php#L59-L72 |
202,459 | Wedeto/DB | src/Query/UnionClause.php | UnionClause.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
$q = $this->getQuery();
$t = $this->getType();
$scope = $params->getSubScope($this->sub_scope_number);
$this->sub_scope_number = $scope->getScopeID();
return 'UNION ' . $t . ' (' . $params->getDriver()->... | php | public function toSQL(Parameters $params, bool $inner_clause)
{
$q = $this->getQuery();
$t = $this->getType();
$scope = $params->getSubScope($this->sub_scope_number);
$this->sub_scope_number = $scope->getScopeID();
return 'UNION ' . $t . ' (' . $params->getDriver()->... | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
";",
"$",
"t",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
"$",
"scope",
"=... | Write a UNION clause as SQL query synta
@param Parameters $params The query parameters: tables and placeholder values
@param bool $inner_clause Unused
@return string The generated SQL | [
"Write",
"a",
"UNION",
"clause",
"as",
"SQL",
"query",
"synta"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/UnionClause.php#L79-L87 |
202,460 | Revys/revy | src/App/EntityBase.php | EntityBase.getRules | public static function getRules()
{
$rules = static::rules();
if (RevyAdmin::isTranslationMode()) {
$object = new static();
foreach ($rules as $field => $rule) {
if ($object->isTranslatableField($field)) {
unset($rules[$field]);
... | php | public static function getRules()
{
$rules = static::rules();
if (RevyAdmin::isTranslationMode()) {
$object = new static();
foreach ($rules as $field => $rule) {
if ($object->isTranslatableField($field)) {
unset($rules[$field]);
... | [
"public",
"static",
"function",
"getRules",
"(",
")",
"{",
"$",
"rules",
"=",
"static",
"::",
"rules",
"(",
")",
";",
"if",
"(",
"RevyAdmin",
"::",
"isTranslationMode",
"(",
")",
")",
"{",
"$",
"object",
"=",
"new",
"static",
"(",
")",
";",
"foreach"... | Validation default rules
Prepare rules | [
"Validation",
"default",
"rules"
] | b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1 | https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/EntityBase.php#L177-L195 |
202,461 | congraphcms/core | Traits/ErrorManagerTrait.php | ErrorManagerTrait.resolveErrorKey | protected function resolveErrorKey($messages = [])
{
// if there is no error key defined leave messages as they were
if(empty($this->errorKey))
{
return $messages;
}
// keys are divided on every .
$keys = explode('.', $this->errorKey);
// we need to reverse this array for sorting
$keys = array_rev... | php | protected function resolveErrorKey($messages = [])
{
// if there is no error key defined leave messages as they were
if(empty($this->errorKey))
{
return $messages;
}
// keys are divided on every .
$keys = explode('.', $this->errorKey);
// we need to reverse this array for sorting
$keys = array_rev... | [
"protected",
"function",
"resolveErrorKey",
"(",
"$",
"messages",
"=",
"[",
"]",
")",
"{",
"// if there is no error key defined leave messages as they were",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"errorKey",
")",
")",
"{",
"return",
"$",
"messages",
";",
"... | Nest messages according to error key
@param array $messages
@return array | [
"Nest",
"messages",
"according",
"to",
"error",
"key"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/ErrorManagerTrait.php#L68-L87 |
202,462 | congraphcms/core | Traits/ErrorManagerTrait.php | ErrorManagerTrait.addErrors | public function addErrors($messages = [])
{
// check if messages are an array
if(! is_array($messages) && ! $messages instanceof MessageProvider)
{
$messages = (array) $messages;
}
return $this->errors->merge($this->resolveErrorKey($messages));
} | php | public function addErrors($messages = [])
{
// check if messages are an array
if(! is_array($messages) && ! $messages instanceof MessageProvider)
{
$messages = (array) $messages;
}
return $this->errors->merge($this->resolveErrorKey($messages));
} | [
"public",
"function",
"addErrors",
"(",
"$",
"messages",
"=",
"[",
"]",
")",
"{",
"// check if messages are an array",
"if",
"(",
"!",
"is_array",
"(",
"$",
"messages",
")",
"&&",
"!",
"$",
"messages",
"instanceof",
"MessageProvider",
")",
"{",
"$",
"message... | Add messages to error message bag
@param array $messages (optional)
@return boolean | [
"Add",
"messages",
"to",
"error",
"message",
"bag"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/ErrorManagerTrait.php#L96-L105 |
202,463 | vukbgit/PHPCraft.Subject | src/Traits/Messages.php | Messages.injectMessages | public function injectMessages(Message $messages)
{
$this->messages = $messages;
$this->messages->setCookie($this->cookies);
} | php | public function injectMessages(Message $messages)
{
$this->messages = $messages;
$this->messages->setCookie($this->cookies);
} | [
"public",
"function",
"injectMessages",
"(",
"Message",
"$",
"messages",
")",
"{",
"$",
"this",
"->",
"messages",
"=",
"$",
"messages",
";",
"$",
"this",
"->",
"messages",
"->",
"setCookie",
"(",
"$",
"this",
"->",
"cookies",
")",
";",
"}"
] | Injects messages manager instance
@param PHPCraft\Message\Message $messages messages manager instance | [
"Injects",
"messages",
"manager",
"instance"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Messages.php#L53-L57 |
202,464 | juliendidier/BuzzProfilerBundle | Buzz/Client/DebugClient.php | DebugClient.formatBytes | private function formatBytes($bytes, $precision = 2)
{
$unit = array('B','KB','MB','GB','TB','PB','EB');
if (!$bytes) {
return "0 B";
}
return @round(
$bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision
).' '.$unit[$i];
} | php | private function formatBytes($bytes, $precision = 2)
{
$unit = array('B','KB','MB','GB','TB','PB','EB');
if (!$bytes) {
return "0 B";
}
return @round(
$bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision
).' '.$unit[$i];
} | [
"private",
"function",
"formatBytes",
"(",
"$",
"bytes",
",",
"$",
"precision",
"=",
"2",
")",
"{",
"$",
"unit",
"=",
"array",
"(",
"'B'",
",",
"'KB'",
",",
"'MB'",
",",
"'GB'",
",",
"'TB'",
",",
"'PB'",
",",
"'EB'",
")",
";",
"if",
"(",
"!",
"... | formats a bigint into a human readable size
@param int $size
@param int $precision
@return string | [
"formats",
"a",
"bigint",
"into",
"a",
"human",
"readable",
"size"
] | 7d06f1230630bce8d8514e7af3995d852aa34e14 | https://github.com/juliendidier/BuzzProfilerBundle/blob/7d06f1230630bce8d8514e7af3995d852aa34e14/Buzz/Client/DebugClient.php#L79-L90 |
202,465 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php | BatchContext.removeAll | public function removeAll()
{
foreach ($this->handles as $transaction) {
$ch = $this->handles[$transaction];
curl_multi_remove_handle($this->multi, $ch);
curl_close($ch);
unset($this->handles[$transaction]);
}
} | php | public function removeAll()
{
foreach ($this->handles as $transaction) {
$ch = $this->handles[$transaction];
curl_multi_remove_handle($this->multi, $ch);
curl_close($ch);
unset($this->handles[$transaction]);
}
} | [
"public",
"function",
"removeAll",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"handles",
"as",
"$",
"transaction",
")",
"{",
"$",
"ch",
"=",
"$",
"this",
"->",
"handles",
"[",
"$",
"transaction",
"]",
";",
"curl_multi_remove_handle",
"(",
"$",
"... | Closes all of the requests associated with the underlying multi handle. | [
"Closes",
"all",
"of",
"the",
"requests",
"associated",
"with",
"the",
"underlying",
"multi",
"handle",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L45-L53 |
202,466 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php | BatchContext.findTransaction | public function findTransaction($handle)
{
foreach ($this->handles as $transaction) {
if ($this->handles[$transaction] === $handle) {
return $transaction;
}
}
throw new AdapterException('No curl handle was found');
} | php | public function findTransaction($handle)
{
foreach ($this->handles as $transaction) {
if ($this->handles[$transaction] === $handle) {
return $transaction;
}
}
throw new AdapterException('No curl handle was found');
} | [
"public",
"function",
"findTransaction",
"(",
"$",
"handle",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"handles",
"as",
"$",
"transaction",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"handles",
"[",
"$",
"transaction",
"]",
"===",
"$",
"handle",
")",
... | Find a transaction for a given curl handle
@param resource $handle Curl handle
@return TransactionInterface
@throws AdapterException if a transaction is not found | [
"Find",
"a",
"transaction",
"for",
"a",
"given",
"curl",
"handle"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L63-L72 |
202,467 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php | BatchContext.nextPending | public function nextPending()
{
if (!$this->hasPending()) {
return null;
}
$current = $this->pending->current();
$this->pending->next();
return $current;
} | php | public function nextPending()
{
if (!$this->hasPending()) {
return null;
}
$current = $this->pending->current();
$this->pending->next();
return $current;
} | [
"public",
"function",
"nextPending",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPending",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"current",
"=",
"$",
"this",
"->",
"pending",
"->",
"current",
"(",
")",
";",
"$",
"this",
"... | Pop the next transaction from the transaction queue
@return TransactionInterface|null | [
"Pop",
"the",
"next",
"transaction",
"from",
"the",
"transaction",
"queue"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L99-L109 |
202,468 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php | BatchContext.addTransaction | public function addTransaction(TransactionInterface $transaction, $handle)
{
if (isset($this->handles[$transaction])) {
throw new AdapterException('Transaction already registered');
}
$code = curl_multi_add_handle($this->multi, $handle);
if ($code != CURLM_OK) {
... | php | public function addTransaction(TransactionInterface $transaction, $handle)
{
if (isset($this->handles[$transaction])) {
throw new AdapterException('Transaction already registered');
}
$code = curl_multi_add_handle($this->multi, $handle);
if ($code != CURLM_OK) {
... | [
"public",
"function",
"addTransaction",
"(",
"TransactionInterface",
"$",
"transaction",
",",
"$",
"handle",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"handles",
"[",
"$",
"transaction",
"]",
")",
")",
"{",
"throw",
"new",
"AdapterException",
"... | Add a transaction to the multi handle
@param TransactionInterface $transaction Transaction to add
@param resource $handle Resource to use with the handle
@throws AdapterException If the handle is already registered | [
"Add",
"a",
"transaction",
"to",
"the",
"multi",
"handle"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L139-L151 |
202,469 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php | BatchContext.removeTransaction | public function removeTransaction(TransactionInterface $transaction)
{
if (!isset($this->handles[$transaction])) {
throw new AdapterException('Transaction not registered');
}
$handle = $this->handles[$transaction];
$this->handles->detach($transaction);
$info = cu... | php | public function removeTransaction(TransactionInterface $transaction)
{
if (!isset($this->handles[$transaction])) {
throw new AdapterException('Transaction not registered');
}
$handle = $this->handles[$transaction];
$this->handles->detach($transaction);
$info = cu... | [
"public",
"function",
"removeTransaction",
"(",
"TransactionInterface",
"$",
"transaction",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"handles",
"[",
"$",
"transaction",
"]",
")",
")",
"{",
"throw",
"new",
"AdapterException",
"(",
"'Transact... | Remove a transaction and associated handle from the context
@param TransactionInterface $transaction Transaction to remove
@return array Returns the curl_getinfo array
@throws AdapterException if the transaction is not found | [
"Remove",
"a",
"transaction",
"and",
"associated",
"handle",
"from",
"the",
"context"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L161-L178 |
202,470 | Wedeto/Log | src/Writer/MemLogWriter.php | MemLogWriter.write | public function write(string $level, string $message, array $context)
{
$levnum = Logger::getLevelNumeric($level);
if ($levnum < $this->min_level)
return;
$lvl = sprintf("%10s", $level);
$message = $this->format($lvl, $message, $context);
$this->log[] = $message;... | php | public function write(string $level, string $message, array $context)
{
$levnum = Logger::getLevelNumeric($level);
if ($levnum < $this->min_level)
return;
$lvl = sprintf("%10s", $level);
$message = $this->format($lvl, $message, $context);
$this->log[] = $message;... | [
"public",
"function",
"write",
"(",
"string",
"$",
"level",
",",
"string",
"$",
"message",
",",
"array",
"$",
"context",
")",
"{",
"$",
"levnum",
"=",
"Logger",
"::",
"getLevelNumeric",
"(",
"$",
"level",
")",
";",
"if",
"(",
"$",
"levnum",
"<",
"$",... | Log a line to the memory log, if its level is high enough
@param string $level The level of the message
@param string $message The message
@param array $context The variables to fill in the message | [
"Log",
"a",
"line",
"to",
"the",
"memory",
"log",
"if",
"its",
"level",
"is",
"high",
"enough"
] | 88252c5052089fdcc5dae466d1ad5889bb2b735f | https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Writer/MemLogWriter.php#L59-L68 |
202,471 | SCLInternet/SclZfGenericMapper | src/SclZfGenericMapper/ZendDbMapper.php | ZendDbMapper.getSelect | protected function getSelect($table = null)
{
$this->initialize();
$select = $this->getSlaveSql()->select();
$select->from($table ?: $this->getTableName());
return $select;
} | php | protected function getSelect($table = null)
{
$this->initialize();
$select = $this->getSlaveSql()->select();
$select->from($table ?: $this->getTableName());
return $select;
} | [
"protected",
"function",
"getSelect",
"(",
"$",
"table",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"$",
"select",
"=",
"$",
"this",
"->",
"getSlaveSql",
"(",
")",
"->",
"select",
"(",
")",
";",
"$",
"select",
"->",
"fro... | The version allows read-write access.
@param string $table
@return \Zend\Db\Sql\Select | [
"The",
"version",
"allows",
"read",
"-",
"write",
"access",
"."
] | c61c61546bfbc07e9c9a4b425e8e02fd7182d80b | https://github.com/SCLInternet/SclZfGenericMapper/blob/c61c61546bfbc07e9c9a4b425e8e02fd7182d80b/src/SclZfGenericMapper/ZendDbMapper.php#L132-L141 |
202,472 | melisplatform/melis-composerdeploy | src/Service/MelisComposerService.php | MelisComposerService.runCommand | private function runCommand($cmd, $package = null, $args, $noAddtlArguments = false)
{
$translator = $this->getServiceLocator()->get('translator');
$docPath = str_replace(['\\', 'public/../'], '', $this->getDocumentRoot());
$docPath = trim(substr($docPath, 0, strlen($docPath) - 1)); // remov... | php | private function runCommand($cmd, $package = null, $args, $noAddtlArguments = false)
{
$translator = $this->getServiceLocator()->get('translator');
$docPath = str_replace(['\\', 'public/../'], '', $this->getDocumentRoot());
$docPath = trim(substr($docPath, 0, strlen($docPath) - 1)); // remov... | [
"private",
"function",
"runCommand",
"(",
"$",
"cmd",
",",
"$",
"package",
"=",
"null",
",",
"$",
"args",
",",
"$",
"noAddtlArguments",
"=",
"false",
")",
"{",
"$",
"translator",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
... | This calls the composer CLI to execute a command
@param $cmd
@param null $package
@param $args
@param bool $noAddtlArguments
@return string|\Symfony\Component\Console\Output\StreamOutput
@throws \Exception | [
"This",
"calls",
"the",
"composer",
"CLI",
"to",
"execute",
"a",
"command"
] | 6712bd74be419003048909821a07bafe4ca7ce52 | https://github.com/melisplatform/melis-composerdeploy/blob/6712bd74be419003048909821a07bafe4ca7ce52/src/Service/MelisComposerService.php#L102-L160 |
202,473 | melisplatform/melis-composerdeploy | src/Service/MelisComposerService.php | MelisComposerService.setDocumentRoot | public function setDocumentRoot($documentRoot)
{
if ($documentRoot) {
$this->documentRoot = $documentRoot;
} else {
$this->documentRoot = $this->getDefaultDocRoot();
}
} | php | public function setDocumentRoot($documentRoot)
{
if ($documentRoot) {
$this->documentRoot = $documentRoot;
} else {
$this->documentRoot = $this->getDefaultDocRoot();
}
} | [
"public",
"function",
"setDocumentRoot",
"(",
"$",
"documentRoot",
")",
"{",
"if",
"(",
"$",
"documentRoot",
")",
"{",
"$",
"this",
"->",
"documentRoot",
"=",
"$",
"documentRoot",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"documentRoot",
"=",
"$",
"this"... | Sets the path of the platform, if nothing is set, then it will use the default path of this platform
@param $documentRoot | [
"Sets",
"the",
"path",
"of",
"the",
"platform",
"if",
"nothing",
"is",
"set",
"then",
"it",
"will",
"use",
"the",
"default",
"path",
"of",
"this",
"platform"
] | 6712bd74be419003048909821a07bafe4ca7ce52 | https://github.com/melisplatform/melis-composerdeploy/blob/6712bd74be419003048909821a07bafe4ca7ce52/src/Service/MelisComposerService.php#L201-L208 |
202,474 | melisplatform/melis-composerdeploy | src/Service/MelisComposerService.php | MelisComposerService.availableCommands | private function availableCommands()
{
return [
self::INSTALL,
self::UPDATE,
self::DUMP_AUTOLOAD,
self::DOWNLOAD,
self::REMOVE,
];
} | php | private function availableCommands()
{
return [
self::INSTALL,
self::UPDATE,
self::DUMP_AUTOLOAD,
self::DOWNLOAD,
self::REMOVE,
];
} | [
"private",
"function",
"availableCommands",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"INSTALL",
",",
"self",
"::",
"UPDATE",
",",
"self",
"::",
"DUMP_AUTOLOAD",
",",
"self",
"::",
"DOWNLOAD",
",",
"self",
"::",
"REMOVE",
",",
"]",
";",
"}"
] | Sets the limitation to what commands that can be executed
@return array | [
"Sets",
"the",
"limitation",
"to",
"what",
"commands",
"that",
"can",
"be",
"executed"
] | 6712bd74be419003048909821a07bafe4ca7ce52 | https://github.com/melisplatform/melis-composerdeploy/blob/6712bd74be419003048909821a07bafe4ca7ce52/src/Service/MelisComposerService.php#L225-L234 |
202,475 | FlexModel/FlexModelBundle | EventListener/ObjectUploadSubscriber.php | ObjectUploadSubscriber.preFlush | public function preFlush(PreFlushEventArgs $args)
{
$objectManager = $args->getEntityManager();
$unitOfWork = $objectManager->getUnitOfWork();
$entityMap = $unitOfWork->getIdentityMap();
foreach ($entityMap as $objectClass => $objects) {
if (in_array(UploadObjectInterfac... | php | public function preFlush(PreFlushEventArgs $args)
{
$objectManager = $args->getEntityManager();
$unitOfWork = $objectManager->getUnitOfWork();
$entityMap = $unitOfWork->getIdentityMap();
foreach ($entityMap as $objectClass => $objects) {
if (in_array(UploadObjectInterfac... | [
"public",
"function",
"preFlush",
"(",
"PreFlushEventArgs",
"$",
"args",
")",
"{",
"$",
"objectManager",
"=",
"$",
"args",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"unitOfWork",
"=",
"$",
"objectManager",
"->",
"getUnitOfWork",
"(",
")",
";",
"$",
"en... | Prepares upload file references for all objects implementing the UploadObjectInterface.
@param PreFlushEventArgs $args | [
"Prepares",
"upload",
"file",
"references",
"for",
"all",
"objects",
"implementing",
"the",
"UploadObjectInterface",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L74-L87 |
202,476 | FlexModel/FlexModelBundle | EventListener/ObjectUploadSubscriber.php | ObjectUploadSubscriber.prePersist | public function prePersist(LifecycleEventArgs $args)
{
$object = $args->getObject();
if ($object instanceof UploadObjectInterface) {
$this->prepareUploadFileReferences($object);
}
} | php | public function prePersist(LifecycleEventArgs $args)
{
$object = $args->getObject();
if ($object instanceof UploadObjectInterface) {
$this->prepareUploadFileReferences($object);
}
} | [
"public",
"function",
"prePersist",
"(",
"LifecycleEventArgs",
"$",
"args",
")",
"{",
"$",
"object",
"=",
"$",
"args",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"$",
"object",
"instanceof",
"UploadObjectInterface",
")",
"{",
"$",
"this",
"->",
"prepareU... | Prepares upload file references for a new object implementing the UploadObjectInterface.
@param LifecycleEventArgs $args | [
"Prepares",
"upload",
"file",
"references",
"for",
"a",
"new",
"object",
"implementing",
"the",
"UploadObjectInterface",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L94-L100 |
202,477 | FlexModel/FlexModelBundle | EventListener/ObjectUploadSubscriber.php | ObjectUploadSubscriber.postPersist | public function postPersist(LifecycleEventArgs $args)
{
$object = $args->getObject();
if ($object instanceof UploadObjectInterface) {
$this->storeFileUploads($object);
}
} | php | public function postPersist(LifecycleEventArgs $args)
{
$object = $args->getObject();
if ($object instanceof UploadObjectInterface) {
$this->storeFileUploads($object);
}
} | [
"public",
"function",
"postPersist",
"(",
"LifecycleEventArgs",
"$",
"args",
")",
"{",
"$",
"object",
"=",
"$",
"args",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"$",
"object",
"instanceof",
"UploadObjectInterface",
")",
"{",
"$",
"this",
"->",
"storeFi... | Stores the file uploads.
@param LifecycleEventArgs $args | [
"Stores",
"the",
"file",
"uploads",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L107-L113 |
202,478 | FlexModel/FlexModelBundle | EventListener/ObjectUploadSubscriber.php | ObjectUploadSubscriber.prepareUploadFileReferences | private function prepareUploadFileReferences(UploadObjectInterface $object)
{
$object->setFileUploadPath($this->fileUploadPath);
$reflectionClass = new ReflectionClass($object);
$objectName = $reflectionClass->getShortName();
$fileUploads = $object->getFileUploads();
$fileF... | php | private function prepareUploadFileReferences(UploadObjectInterface $object)
{
$object->setFileUploadPath($this->fileUploadPath);
$reflectionClass = new ReflectionClass($object);
$objectName = $reflectionClass->getShortName();
$fileUploads = $object->getFileUploads();
$fileF... | [
"private",
"function",
"prepareUploadFileReferences",
"(",
"UploadObjectInterface",
"$",
"object",
")",
"{",
"$",
"object",
"->",
"setFileUploadPath",
"(",
"$",
"this",
"->",
"fileUploadPath",
")",
";",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"... | Sets the new file references to the uploaded files on the object and schedules the previous file reference for deletion.
@param UploadObjectInterface $object | [
"Sets",
"the",
"new",
"file",
"references",
"to",
"the",
"uploaded",
"files",
"on",
"the",
"object",
"and",
"schedules",
"the",
"previous",
"file",
"reference",
"for",
"deletion",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L139-L165 |
202,479 | FlexModel/FlexModelBundle | EventListener/ObjectUploadSubscriber.php | ObjectUploadSubscriber.storeFileUploads | private function storeFileUploads(UploadObjectInterface $object)
{
$reflectionClass = new ReflectionClass($object);
$objectName = $reflectionClass->getShortName();
$fileUploads = $object->getFileUploads();
$fileFieldConfigurations = $this->flexModel->getFieldsByDatatype($objectName,... | php | private function storeFileUploads(UploadObjectInterface $object)
{
$reflectionClass = new ReflectionClass($object);
$objectName = $reflectionClass->getShortName();
$fileUploads = $object->getFileUploads();
$fileFieldConfigurations = $this->flexModel->getFieldsByDatatype($objectName,... | [
"private",
"function",
"storeFileUploads",
"(",
"UploadObjectInterface",
"$",
"object",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"object",
")",
";",
"$",
"objectName",
"=",
"$",
"reflectionClass",
"->",
"getShortName",
"(",
")",... | Stores the uploaded files to the specified file system location.
@param UploadObjectInterface $object | [
"Stores",
"the",
"uploaded",
"files",
"to",
"the",
"specified",
"file",
"system",
"location",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L172-L191 |
202,480 | gplcart/twocheckout | Main.php | Main.setOrderCompletePage | protected function setOrderCompletePage(array $order, $model, $controller)
{
$this->order = $model;
$this->data_order = $order;
$this->controller = $controller;
if ($order['payment'] === 'twocheckout') {
$this->submitPayment();
$this->completePayment();
... | php | protected function setOrderCompletePage(array $order, $model, $controller)
{
$this->order = $model;
$this->data_order = $order;
$this->controller = $controller;
if ($order['payment'] === 'twocheckout') {
$this->submitPayment();
$this->completePayment();
... | [
"protected",
"function",
"setOrderCompletePage",
"(",
"array",
"$",
"order",
",",
"$",
"model",
",",
"$",
"controller",
")",
"{",
"$",
"this",
"->",
"order",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"data_order",
"=",
"$",
"order",
";",
"$",
"this",
... | Set order complete page
@param array $order
@param \gplcart\core\models\Order $model
@param \gplcart\core\controllers\frontend\Controller $controller | [
"Set",
"order",
"complete",
"page"
] | b1578f866ac29d37720e1d616b8b4783832d5107 | https://github.com/gplcart/twocheckout/blob/b1578f866ac29d37720e1d616b8b4783832d5107/Main.php#L164-L174 |
202,481 | gplcart/twocheckout | Main.php | Main.completePayment | protected function completePayment()
{
if ($this->controller->isQuery('paid')) {
$gateway = $this->getGateway();
$this->response = $gateway->completePurchase($this->getPurchaseParams())->send();
$this->processResponse();
}
} | php | protected function completePayment()
{
if ($this->controller->isQuery('paid')) {
$gateway = $this->getGateway();
$this->response = $gateway->completePurchase($this->getPurchaseParams())->send();
$this->processResponse();
}
} | [
"protected",
"function",
"completePayment",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"controller",
"->",
"isQuery",
"(",
"'paid'",
")",
")",
"{",
"$",
"gateway",
"=",
"$",
"this",
"->",
"getGateway",
"(",
")",
";",
"$",
"this",
"->",
"response",
... | Performs actions when purchase is completed | [
"Performs",
"actions",
"when",
"purchase",
"is",
"completed"
] | b1578f866ac29d37720e1d616b8b4783832d5107 | https://github.com/gplcart/twocheckout/blob/b1578f866ac29d37720e1d616b8b4783832d5107/Main.php#L218-L225 |
202,482 | zodream/database | src/Query/Components/RecordBuilder.php | RecordBuilder.replace | public function replace(array $data) {
$addFields = implode('`,`', array_keys($data));
return $this->command()
->insertOrReplace("`{$addFields}`", Str::repeat('?', $data),
array_values($data));
} | php | public function replace(array $data) {
$addFields = implode('`,`', array_keys($data));
return $this->command()
->insertOrReplace("`{$addFields}`", Str::repeat('?', $data),
array_values($data));
} | [
"public",
"function",
"replace",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"addFields",
"=",
"implode",
"(",
"'`,`'",
",",
"array_keys",
"(",
"$",
"data",
")",
")",
";",
"return",
"$",
"this",
"->",
"command",
"(",
")",
"->",
"insertOrReplace",
"(",
... | INSERT OR REPLACE
@param array $data
@return mixed | [
"INSERT",
"OR",
"REPLACE"
] | 03712219c057799d07350a3a2650c55bcc92c28e | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Query/Components/RecordBuilder.php#L106-L111 |
202,483 | agentmedia/phine-core | src/Core/Logic/Module/AjaxBackendForm.php | AjaxBackendForm.SetJSFieldValue | protected function SetJSFieldValue($field, $value)
{
$jsField = Str::ToJavascript($field, false);
$jsValue = Str::ToJavascript($value, false);
echo "<script>$($jsField).val($jsValue);</script>";
} | php | protected function SetJSFieldValue($field, $value)
{
$jsField = Str::ToJavascript($field, false);
$jsValue = Str::ToJavascript($value, false);
echo "<script>$($jsField).val($jsValue);</script>";
} | [
"protected",
"function",
"SetJSFieldValue",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"jsField",
"=",
"Str",
"::",
"ToJavascript",
"(",
"$",
"field",
",",
"false",
")",
";",
"$",
"jsValue",
"=",
"Str",
"::",
"ToJavascript",
"(",
"$",
"value"... | Sets a field value as typical action of a modal form call
@param string $field The field specifier; typically starting with '#'
@param string $value The value | [
"Sets",
"a",
"field",
"value",
"as",
"typical",
"action",
"of",
"a",
"modal",
"form",
"call"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/AjaxBackendForm.php#L28-L33 |
202,484 | agentmedia/phine-core | src/Core/Logic/Module/AjaxBackendForm.php | AjaxBackendForm.SetJSHtml | protected function SetJSHtml($element, $html)
{
$jsElement = Str::ToJavascript($element, false);
$jsHtml = Str::ToJavascript($html, false);
echo "<script>$($jsElement).html($jsHtml);</script>";
} | php | protected function SetJSHtml($element, $html)
{
$jsElement = Str::ToJavascript($element, false);
$jsHtml = Str::ToJavascript($html, false);
echo "<script>$($jsElement).html($jsHtml);</script>";
} | [
"protected",
"function",
"SetJSHtml",
"(",
"$",
"element",
",",
"$",
"html",
")",
"{",
"$",
"jsElement",
"=",
"Str",
"::",
"ToJavascript",
"(",
"$",
"element",
",",
"false",
")",
";",
"$",
"jsHtml",
"=",
"Str",
"::",
"ToJavascript",
"(",
"$",
"html",
... | Sets element html content as a typical action of a modal form call
@param string $element The element specifier; typically starting with '#'
@param string $html The html string | [
"Sets",
"element",
"html",
"content",
"as",
"a",
"typical",
"action",
"of",
"a",
"modal",
"form",
"call"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/AjaxBackendForm.php#L40-L45 |
202,485 | Dev4Media/ngnfeed-ebay | src/D4m/NgnFeed/Ebay/Model/Entity.php | Entity.add | private function add($field, $args)
{
if ($this->hasField($field) && null !== $args[0]) {
$this->virtualFieldsCollection[$field][] = $args[0];
} else if ( null === $args[0]){
throw new \InvalidArgumentException("The argument given is null ");
} else {
thro... | php | private function add($field, $args)
{
if ($this->hasField($field) && null !== $args[0]) {
$this->virtualFieldsCollection[$field][] = $args[0];
} else if ( null === $args[0]){
throw new \InvalidArgumentException("The argument given is null ");
} else {
thro... | [
"private",
"function",
"add",
"(",
"$",
"field",
",",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasField",
"(",
"$",
"field",
")",
"&&",
"null",
"!==",
"$",
"args",
"[",
"0",
"]",
")",
"{",
"$",
"this",
"->",
"virtualFieldsCollection",
... | Add an object to a collection
@param string $field
@param array $args
@throws \BadMethodCallException
@throws \InvalidArgumentException | [
"Add",
"an",
"object",
"to",
"a",
"collection"
] | fb9652e30c7e4823a4e4dd571f41c8839953e72c | https://github.com/Dev4Media/ngnfeed-ebay/blob/fb9652e30c7e4823a4e4dd571f41c8839953e72c/src/D4m/NgnFeed/Ebay/Model/Entity.php#L34-L43 |
202,486 | goncalomb/asbestos | src/classes/Http/Response.php | Response.setContentType | public function setContentType($type, $statusCode=null)
{
if (isset(static::$_types[$type])) {
$type = static::$_types[$type];
}
$this->setHeader('Content-Type', $type);
if ($statusCode) {
$this->_statusCode = $statusCode;
}
} | php | public function setContentType($type, $statusCode=null)
{
if (isset(static::$_types[$type])) {
$type = static::$_types[$type];
}
$this->setHeader('Content-Type', $type);
if ($statusCode) {
$this->_statusCode = $statusCode;
}
} | [
"public",
"function",
"setContentType",
"(",
"$",
"type",
",",
"$",
"statusCode",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"_types",
"[",
"$",
"type",
"]",
")",
")",
"{",
"$",
"type",
"=",
"static",
"::",
"$",
"_types",
... | Set the response content type header and status code.
@param string $type Response content type.
@param int $statusCode Response status code. | [
"Set",
"the",
"response",
"content",
"type",
"header",
"and",
"status",
"code",
"."
] | 14a875b6c125cfeefe4eb1c3c524500eb8a51d04 | https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Http/Response.php#L79-L88 |
202,487 | goncalomb/asbestos | src/classes/Http/Response.php | Response.send | public function send()
{
if (headers_sent()) {
return false;
}
// set headers
foreach ($this->getHeaders() as $h) {
header($h[0] . ': ' . $h[1], false, $this->_statusCode);
}
// set status code
if (function_exists('http_response_code'))... | php | public function send()
{
if (headers_sent()) {
return false;
}
// set headers
foreach ($this->getHeaders() as $h) {
header($h[0] . ': ' . $h[1], false, $this->_statusCode);
}
// set status code
if (function_exists('http_response_code'))... | [
"public",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// set headers",
"foreach",
"(",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"as",
"$",
"h",
")",
"{",
"header",
"(",
"$",
"h",... | Send the response using the normal PHP functions. | [
"Send",
"the",
"response",
"using",
"the",
"normal",
"PHP",
"functions",
"."
] | 14a875b6c125cfeefe4eb1c3c524500eb8a51d04 | https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Http/Response.php#L93-L109 |
202,488 | nicmart/DomainSpecificQuery | src/Lucene/LuceneQuery.php | LuceneQuery.convertExpressionsToStrings | public function convertExpressionsToStrings()
{
$this->setMainQuery((string) $this->getMainQuery());
$this->setFilterQueries(array_map(
function($expr) { return (string) $expr; },
$this->getFilterQueries()
));
return $this;
} | php | public function convertExpressionsToStrings()
{
$this->setMainQuery((string) $this->getMainQuery());
$this->setFilterQueries(array_map(
function($expr) { return (string) $expr; },
$this->getFilterQueries()
));
return $this;
} | [
"public",
"function",
"convertExpressionsToStrings",
"(",
")",
"{",
"$",
"this",
"->",
"setMainQuery",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"getMainQuery",
"(",
")",
")",
";",
"$",
"this",
"->",
"setFilterQueries",
"(",
"array_map",
"(",
"function",
... | Convert all expressions to strings.
@return $this | [
"Convert",
"all",
"expressions",
"to",
"strings",
"."
] | 7c01fe94337afdfae5884809e8b5487127a63ac3 | https://github.com/nicmart/DomainSpecificQuery/blob/7c01fe94337afdfae5884809e8b5487127a63ac3/src/Lucene/LuceneQuery.php#L124-L134 |
202,489 | ekyna/Resource | Event/EventQueue.php | EventQueue.enqueue | protected function enqueue($eventName, $resourceOrEvent)
{
if (!$this->isOpened()) {
throw new RuntimeException("The event queue is closed.");
}
if (!preg_match('~^[a-z_]+\.[a-z_]+\.[a-z_]+$~', $eventName)) {
throw new InvalidArgumentException("Unexpected event name ... | php | protected function enqueue($eventName, $resourceOrEvent)
{
if (!$this->isOpened()) {
throw new RuntimeException("The event queue is closed.");
}
if (!preg_match('~^[a-z_]+\.[a-z_]+\.[a-z_]+$~', $eventName)) {
throw new InvalidArgumentException("Unexpected event name ... | [
"protected",
"function",
"enqueue",
"(",
"$",
"eventName",
",",
"$",
"resourceOrEvent",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isOpened",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"The event queue is closed.\"",
")",
";",
"}",
"... | Schedules a resource event of the given type.
@param string $eventName
@param ResourceInterface|ResourceEventInterface $resourceOrEvent
@throws \Ekyna\Component\Resource\Exception\ResourceExceptionInterface | [
"Schedules",
"a",
"resource",
"event",
"of",
"the",
"given",
"type",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Event/EventQueue.php#L111-L147 |
202,490 | ekyna/Resource | Event/EventQueue.php | EventQueue.getQueueSortingCallback | protected function getQueueSortingCallback()
{
// [$resourceId => $parentId]
$parentMap = $this->registry->getParentMap();
// [$resourceId => $priority]
$priorityMap = $this->registry->getEventPriorityMap();
/**
* Returns whether or not $a is a child of $b.
... | php | protected function getQueueSortingCallback()
{
// [$resourceId => $parentId]
$parentMap = $this->registry->getParentMap();
// [$resourceId => $priority]
$priorityMap = $this->registry->getEventPriorityMap();
/**
* Returns whether or not $a is a child of $b.
... | [
"protected",
"function",
"getQueueSortingCallback",
"(",
")",
"{",
"// [$resourceId => $parentId]",
"$",
"parentMap",
"=",
"$",
"this",
"->",
"registry",
"->",
"getParentMap",
"(",
")",
";",
"// [$resourceId => $priority]",
"$",
"priorityMap",
"=",
"$",
"this",
"->"... | Returns the queue sorting callback.
@return \Closure | [
"Returns",
"the",
"queue",
"sorting",
"callback",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Event/EventQueue.php#L183-L247 |
202,491 | antbank/ab-reader | src/Adapter/PopplerAdapter.php | PopplerAdapter.read | public function read(string $file): string
{
$destFile = tempnam(sys_get_temp_dir(), 'pdf_to_text_');
$command = sprintf(
'pdftotext -layout %s %s',
escapeshellarg(realpath($file)),
escapeshellarg($destFile)
);
$return = 0;
$output = syst... | php | public function read(string $file): string
{
$destFile = tempnam(sys_get_temp_dir(), 'pdf_to_text_');
$command = sprintf(
'pdftotext -layout %s %s',
escapeshellarg(realpath($file)),
escapeshellarg($destFile)
);
$return = 0;
$output = syst... | [
"public",
"function",
"read",
"(",
"string",
"$",
"file",
")",
":",
"string",
"{",
"$",
"destFile",
"=",
"tempnam",
"(",
"sys_get_temp_dir",
"(",
")",
",",
"'pdf_to_text_'",
")",
";",
"$",
"command",
"=",
"sprintf",
"(",
"'pdftotext -layout %s %s'",
",",
"... | Read a file and returns text content
@param string $file File path to read
@return string File content
@throws \Exception | [
"Read",
"a",
"file",
"and",
"returns",
"text",
"content"
] | e8b8d4cae4caa7f0a9248ba7b052d387d2118463 | https://github.com/antbank/ab-reader/blob/e8b8d4cae4caa7f0a9248ba7b052d387d2118463/src/Adapter/PopplerAdapter.php#L14-L37 |
202,492 | TiMESPLiNTER/tsFramework | src/ch/timesplinter/logger/FileLogger.php | FileLogger.writeMessage | protected function writeMessage($level, $msg, $vars = null) {
// Because of date('u')-PHP-bug (always 00000)
$mtimeParts = explode(' ', microtime());
$repl = array(
Logger::PATTERN_CLASS => $this->classContext,
Logger::PATTERN_CLASSNAME => StringUtils::afterLast($this->classContext, '\\'),
Log... | php | protected function writeMessage($level, $msg, $vars = null) {
// Because of date('u')-PHP-bug (always 00000)
$mtimeParts = explode(' ', microtime());
$repl = array(
Logger::PATTERN_CLASS => $this->classContext,
Logger::PATTERN_CLASSNAME => StringUtils::afterLast($this->classContext, '\\'),
Log... | [
"protected",
"function",
"writeMessage",
"(",
"$",
"level",
",",
"$",
"msg",
",",
"$",
"vars",
"=",
"null",
")",
"{",
"// Because of date('u')-PHP-bug (always 00000)",
"$",
"mtimeParts",
"=",
"explode",
"(",
"' '",
",",
"microtime",
"(",
")",
")",
";",
"$",
... | Writes the message with the given pattern into the defined log-file
@param type $level
@param type $msg
@param type $vars | [
"Writes",
"the",
"message",
"with",
"the",
"given",
"pattern",
"into",
"the",
"defined",
"log",
"-",
"file"
] | b3b9fd98f6d456a9e571015877ecca203786fd0c | https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/logger/FileLogger.php#L72-L85 |
202,493 | redkite-labs/ThemeEngineBundle | Core/Rendering/Listener/BasePageRenderingListener.php | BasePageRenderingListener.renderSlot | protected function renderSlot(Response $response, SlotContent $slotContent)
{
if (null === $slotContent->getSlotName()) {
throw new \RuntimeException('No slot has been defined for the event ' . get_class($this));
}
$isReplacing = $slotContent->isReplacing();
if (null === ... | php | protected function renderSlot(Response $response, SlotContent $slotContent)
{
if (null === $slotContent->getSlotName()) {
throw new \RuntimeException('No slot has been defined for the event ' . get_class($this));
}
$isReplacing = $slotContent->isReplacing();
if (null === ... | [
"protected",
"function",
"renderSlot",
"(",
"Response",
"$",
"response",
",",
"SlotContent",
"$",
"slotContent",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"slotContent",
"->",
"getSlotName",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
... | Renders the current slot
@param Response $response
@param SlotContent $slotContent
@return \Symfony\Component\HttpFoundation\Response
@throws \RuntimeException | [
"Renders",
"the",
"current",
"slot"
] | 427409110f2d4f8f39d8802c17d5dd4115cbdf2b | https://github.com/redkite-labs/ThemeEngineBundle/blob/427409110f2d4f8f39d8802c17d5dd4115cbdf2b/Core/Rendering/Listener/BasePageRenderingListener.php#L83-L105 |
202,494 | redkite-labs/ThemeEngineBundle | Core/Rendering/Listener/BasePageRenderingListener.php | BasePageRenderingListener.injectContent | protected function injectContent(SlotContent $slotContent, $content)
{
$regex = $this->getPattern($slotContent->getSlotName());
if (false == preg_match($regex, $content, $match)) {
return;
}
$newContent = $match[1] . PHP_EOL . $slotContent->getContent();
return p... | php | protected function injectContent(SlotContent $slotContent, $content)
{
$regex = $this->getPattern($slotContent->getSlotName());
if (false == preg_match($regex, $content, $match)) {
return;
}
$newContent = $match[1] . PHP_EOL . $slotContent->getContent();
return p... | [
"protected",
"function",
"injectContent",
"(",
"SlotContent",
"$",
"slotContent",
",",
"$",
"content",
")",
"{",
"$",
"regex",
"=",
"$",
"this",
"->",
"getPattern",
"(",
"$",
"slotContent",
"->",
"getSlotName",
"(",
")",
")",
";",
"if",
"(",
"false",
"==... | Injects the content at the end of the given content
@param SlotContent $slotContent
@param string $content The content to inject
@return string | [
"Injects",
"the",
"content",
"at",
"the",
"end",
"of",
"the",
"given",
"content"
] | 427409110f2d4f8f39d8802c17d5dd4115cbdf2b | https://github.com/redkite-labs/ThemeEngineBundle/blob/427409110f2d4f8f39d8802c17d5dd4115cbdf2b/Core/Rendering/Listener/BasePageRenderingListener.php#L128-L137 |
202,495 | ekyna/Table | Bridge/Twig/TwigRenderer.php | TwigRenderer.renderCell | public function renderCell(CellView $cell)
{
$name = $cell->vars['block_prefix'] . '_cell';
return trim($this->template->renderBlock($name, $cell->vars));
} | php | public function renderCell(CellView $cell)
{
$name = $cell->vars['block_prefix'] . '_cell';
return trim($this->template->renderBlock($name, $cell->vars));
} | [
"public",
"function",
"renderCell",
"(",
"CellView",
"$",
"cell",
")",
"{",
"$",
"name",
"=",
"$",
"cell",
"->",
"vars",
"[",
"'block_prefix'",
"]",
".",
"'_cell'",
";",
"return",
"trim",
"(",
"$",
"this",
"->",
"template",
"->",
"renderBlock",
"(",
"$... | Renders a cell.
@param CellView $cell
@return string | [
"Renders",
"a",
"cell",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Twig/TwigRenderer.php#L88-L93 |
202,496 | ekyna/Table | Bridge/Twig/TwigRenderer.php | TwigRenderer.renderPager | public function renderPager(TableView $view, $viewName = 'twitter_bootstrap3', array $options = [])
{
if (!$view->pager) {
return '';
}
$pageParam = $view->ui['page_name'];
$options = array_merge([
'pageParameter' => '[' . $pageParam . ']',
'prox... | php | public function renderPager(TableView $view, $viewName = 'twitter_bootstrap3', array $options = [])
{
if (!$view->pager) {
return '';
}
$pageParam = $view->ui['page_name'];
$options = array_merge([
'pageParameter' => '[' . $pageParam . ']',
'prox... | [
"public",
"function",
"renderPager",
"(",
"TableView",
"$",
"view",
",",
"$",
"viewName",
"=",
"'twitter_bootstrap3'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"view",
"->",
"pager",
")",
"{",
"return",
"''",
";",
"... | Renders pager.
@param TableView $view
@param string $viewName
@param array $options
@return string | [
"Renders",
"pager",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Twig/TwigRenderer.php#L104-L125 |
202,497 | joegreen88/zf1-component-validate | src/Zend/Validate/EmailAddress.php | Zend_Validate_EmailAddress.setOptions | public function setOptions(array $options = array())
{
if (array_key_exists('messages', $options)) {
$this->setMessages($options['messages']);
}
if (array_key_exists('hostname', $options)) {
if (array_key_exists('allow', $options)) {
$this->setHostnam... | php | public function setOptions(array $options = array())
{
if (array_key_exists('messages', $options)) {
$this->setMessages($options['messages']);
}
if (array_key_exists('hostname', $options)) {
if (array_key_exists('allow', $options)) {
$this->setHostnam... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'messages'",
",",
"$",
"options",
")",
")",
"{",
"$",
"this",
"->",
"setMessages",
"(",
"$",
"options",
"[",
"'mess... | Set options for the email validator
@param array $options
@return Zend_Validate_EmailAddress fluid interface | [
"Set",
"options",
"for",
"the",
"email",
"validator"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/EmailAddress.php#L176-L205 |
202,498 | joegreen88/zf1-component-validate | src/Zend/Validate/EmailAddress.php | Zend_Validate_EmailAddress.setValidateMx | public function setValidateMx($mx)
{
if ((bool) $mx && !$this->validateMxSupported()) {
throw new Zend_Validate_Exception('MX checking not available on this system');
}
$this->_options['mx'] = (bool) $mx;
return $this;
} | php | public function setValidateMx($mx)
{
if ((bool) $mx && !$this->validateMxSupported()) {
throw new Zend_Validate_Exception('MX checking not available on this system');
}
$this->_options['mx'] = (bool) $mx;
return $this;
} | [
"public",
"function",
"setValidateMx",
"(",
"$",
"mx",
")",
"{",
"if",
"(",
"(",
"bool",
")",
"$",
"mx",
"&&",
"!",
"$",
"this",
"->",
"validateMxSupported",
"(",
")",
")",
"{",
"throw",
"new",
"Zend_Validate_Exception",
"(",
"'MX checking not available on t... | Set whether we check for a valid MX record via DNS
This only applies when DNS hostnames are validated
@param boolean $mx Set allowed to true to validate for MX records, and false to not validate them
@return Zend_Validate_EmailAddress Fluid Interface | [
"Set",
"whether",
"we",
"check",
"for",
"a",
"valid",
"MX",
"record",
"via",
"DNS"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/EmailAddress.php#L288-L297 |
202,499 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.setLimit | private function setLimit($limit = self::NO_LIMIT)
{
if (! is_int($limit)) {
throw new Exceptions\InvalidIntegerType(gettype($limit));
}
// A limit of 0 or less is useless, fallback to no limit
if ($limit !== self::NO_LIMIT && $limit <= 0) {
throw new Excepti... | php | private function setLimit($limit = self::NO_LIMIT)
{
if (! is_int($limit)) {
throw new Exceptions\InvalidIntegerType(gettype($limit));
}
// A limit of 0 or less is useless, fallback to no limit
if ($limit !== self::NO_LIMIT && $limit <= 0) {
throw new Excepti... | [
"private",
"function",
"setLimit",
"(",
"$",
"limit",
"=",
"self",
"::",
"NO_LIMIT",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"limit",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"InvalidIntegerType",
"(",
"gettype",
"(",
"$",
"limit",
")",... | Stores the limit.
@param int $limit
@throws Exceptions\InvalidIntegerType
@throws Exceptions\PositiveIntegerRequired | [
"Stores",
"the",
"limit",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L94-L106 |
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.