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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
194,600 | pazuzu156/Gravatar | src/Pazuzu156/Gravatar/Gravatar.php | Gravatar.setEmail | public function setEmail($email)
{
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$this->_options['email'] = $email;
$this->_options['hash'] = strtolower(md5(trim($this->_options['email'])));
} else {
throw new \Exception('The email is in an invalid format!');
... | php | public function setEmail($email)
{
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$this->_options['email'] = $email;
$this->_options['hash'] = strtolower(md5(trim($this->_options['email'])));
} else {
throw new \Exception('The email is in an invalid format!');
... | [
"public",
"function",
"setEmail",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"email",
",",
"FILTER_VALIDATE_EMAIL",
")",
")",
"{",
"$",
"this",
"->",
"_options",
"[",
"'email'",
"]",
"=",
"$",
"email",
";",
"$",
"this",
"->",
"_o... | Sets the email you want to use for image generation.
@param string $email - The email to use
@throws \Exception
@return \Pazuzu156\Gravatar\Gravatar | [
"Sets",
"the",
"email",
"you",
"want",
"to",
"use",
"for",
"image",
"generation",
"."
] | 7ec5c03f8ada81ec15034c671f2750456c89b6d5 | https://github.com/pazuzu156/Gravatar/blob/7ec5c03f8ada81ec15034c671f2750456c89b6d5/src/Pazuzu156/Gravatar/Gravatar.php#L110-L120 |
194,601 | pazuzu156/Gravatar | src/Pazuzu156/Gravatar/Gravatar.php | Gravatar.generateUrl | public function generateUrl($type, $email, array $attr = [])
{
if (!empty($email)) {
$this->setEmail($email);
}
if (isset($attr['size'])) {
$this->setSize($attr['size']);
}
if (isset($attr['imgset'])) {
$this->setImageSet($attr['imgset'])... | php | public function generateUrl($type, $email, array $attr = [])
{
if (!empty($email)) {
$this->setEmail($email);
}
if (isset($attr['size'])) {
$this->setSize($attr['size']);
}
if (isset($attr['imgset'])) {
$this->setImageSet($attr['imgset'])... | [
"public",
"function",
"generateUrl",
"(",
"$",
"type",
",",
"$",
"email",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"$",
"this",
"->",
"setEmail",
"(",
"$",
"email",
")",
";",... | Generates the Gravatar URL.
@param string $type - [avatar|profile] Get the requested user item
@param string $email - The user's email
@param array $attr - Extra attributes to set for the image request
@throws \Exception
@return string | [
"Generates",
"the",
"Gravatar",
"URL",
"."
] | 7ec5c03f8ada81ec15034c671f2750456c89b6d5 | https://github.com/pazuzu156/Gravatar/blob/7ec5c03f8ada81ec15034c671f2750456c89b6d5/src/Pazuzu156/Gravatar/Gravatar.php#L225-L266 |
194,602 | modulusphp/support | Filesystem.php | Filesystem.chmod | public static function chmod($path, $mode = null)
{
if ($mode) {
return chmod($path, $mode);
}
return substr(sprintf('%o', fileperms($path)), -4);
} | php | public static function chmod($path, $mode = null)
{
if ($mode) {
return chmod($path, $mode);
}
return substr(sprintf('%o', fileperms($path)), -4);
} | [
"public",
"static",
"function",
"chmod",
"(",
"$",
"path",
",",
"$",
"mode",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"mode",
")",
"{",
"return",
"chmod",
"(",
"$",
"path",
",",
"$",
"mode",
")",
";",
"}",
"return",
"substr",
"(",
"sprintf",
"(",
... | Get or set UNIX mode of a file or directory.
@param string $path
@param int $mode
@return mixed | [
"Get",
"or",
"set",
"UNIX",
"mode",
"of",
"a",
"file",
"or",
"directory",
"."
] | b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab | https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/Filesystem.php#L86-L93 |
194,603 | modulusphp/support | Filesystem.php | Filesystem.copy | public static function copy(string $source, string $destination)
{
if (is_dir($source)) {
@mkdir($destination);
$directory = dir($source);
while (false !== ($readdirectory = $directory->read())) {
if ($readdirectory == '.' || $readdirectory == '..') {
continue;
}
... | php | public static function copy(string $source, string $destination)
{
if (is_dir($source)) {
@mkdir($destination);
$directory = dir($source);
while (false !== ($readdirectory = $directory->read())) {
if ($readdirectory == '.' || $readdirectory == '..') {
continue;
}
... | [
"public",
"static",
"function",
"copy",
"(",
"string",
"$",
"source",
",",
"string",
"$",
"destination",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"source",
")",
")",
"{",
"@",
"mkdir",
"(",
"$",
"destination",
")",
";",
"$",
"directory",
"=",
"dir",
... | Copy file or folder
@param string $source
@param string $destination
@return void | [
"Copy",
"file",
"or",
"folder"
] | b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab | https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/Filesystem.php#L294-L319 |
194,604 | black-lamp/blcms-cart | frontend/components/user/UserMailer.php | UserMailer.sendRecoveryMessage | public function sendRecoveryMessage($user, $token)
{
$mailVars = [
'{token}' => $token->url
];
/**
* @var $mailTemplate Template
*/
$mailTemplate = \Yii::$app->get('emailTemplates')
->getTemplate('recovery', Language::getCurrent()->id);
... | php | public function sendRecoveryMessage($user, $token)
{
$mailVars = [
'{token}' => $token->url
];
/**
* @var $mailTemplate Template
*/
$mailTemplate = \Yii::$app->get('emailTemplates')
->getTemplate('recovery', Language::getCurrent()->id);
... | [
"public",
"function",
"sendRecoveryMessage",
"(",
"$",
"user",
",",
"$",
"token",
")",
"{",
"$",
"mailVars",
"=",
"[",
"'{token}'",
"=>",
"$",
"token",
"->",
"url",
"]",
";",
"/**\n * @var $mailTemplate Template\n */",
"$",
"mailTemplate",
"=",
"... | Sends an email to a user with recovery link.
@param User $user
@param Token $token
@return bool | [
"Sends",
"an",
"email",
"to",
"a",
"user",
"with",
"recovery",
"link",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/frontend/components/user/UserMailer.php#L211-L230 |
194,605 | swaros/golib | src/Content/Dom/XmlSimple.php | XmlSimple.getNodeContent | public function getNodeContent($xPath){
if ($this->content->xpath($xPath) !== null){
return (string)trim(end($this->content->xpath($xPath)));
}
return false;
} | php | public function getNodeContent($xPath){
if ($this->content->xpath($xPath) !== null){
return (string)trim(end($this->content->xpath($xPath)));
}
return false;
} | [
"public",
"function",
"getNodeContent",
"(",
"$",
"xPath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"content",
"->",
"xpath",
"(",
"$",
"xPath",
")",
"!==",
"null",
")",
"{",
"return",
"(",
"string",
")",
"trim",
"(",
"end",
"(",
"$",
"this",
"->",
... | get the content or false of node.
in case of fasle there is no node exists
@param type $xPath
@return string/boolean | [
"get",
"the",
"content",
"or",
"false",
"of",
"node",
".",
"in",
"case",
"of",
"fasle",
"there",
"is",
"no",
"node",
"exists"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Content/Dom/XmlSimple.php#L31-L36 |
194,606 | swaros/golib | src/Content/Dom/XmlSimple.php | XmlSimple.getNodeAttribute | public function getNodeAttribute($xPath,$atrName){
$res = $this->content->xpath($xPath);
if ($res !== null){
foreach ($res as $set){
return (string)$set[$atrName];
}
}
return NULL;
} | php | public function getNodeAttribute($xPath,$atrName){
$res = $this->content->xpath($xPath);
if ($res !== null){
foreach ($res as $set){
return (string)$set[$atrName];
}
}
return NULL;
} | [
"public",
"function",
"getNodeAttribute",
"(",
"$",
"xPath",
",",
"$",
"atrName",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"content",
"->",
"xpath",
"(",
"$",
"xPath",
")",
";",
"if",
"(",
"$",
"res",
"!==",
"null",
")",
"{",
"foreach",
"(",
... | reads an spcific attribute from node
@param type $xPath
@param type $atrName
@return string | [
"reads",
"an",
"spcific",
"attribute",
"from",
"node"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Content/Dom/XmlSimple.php#L95-L105 |
194,607 | swaros/golib | src/Content/Dom/XmlSimple.php | XmlSimple.getNodeAttributeBool | public function getNodeAttributeBool($xPath,$atrName,$failReturn = false){
$val = $this->getNodeAttribute($xPath, $atrName);
// string sets true/false
if (strtolower($val) === 'false'){
return false;
}
if (strtolower($val) === 'true'){
return true;
... | php | public function getNodeAttributeBool($xPath,$atrName,$failReturn = false){
$val = $this->getNodeAttribute($xPath, $atrName);
// string sets true/false
if (strtolower($val) === 'false'){
return false;
}
if (strtolower($val) === 'true'){
return true;
... | [
"public",
"function",
"getNodeAttributeBool",
"(",
"$",
"xPath",
",",
"$",
"atrName",
",",
"$",
"failReturn",
"=",
"false",
")",
"{",
"$",
"val",
"=",
"$",
"this",
"->",
"getNodeAttribute",
"(",
"$",
"xPath",
",",
"$",
"atrName",
")",
";",
"// string set... | return node attribut value in boolean
@param type $xPath
@param type $atrName
@param type $failReturn
@return boolean | [
"return",
"node",
"attribut",
"value",
"in",
"boolean"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Content/Dom/XmlSimple.php#L169-L183 |
194,608 | PenoaksDev/Milky-Framework | src/Milky/Pagination/UrlWindowPresenterTrait.php | UrlWindowPresenterTrait.getLinks | protected function getLinks()
{
$html = '';
if (is_array($this->window['first'])) {
$html .= $this->getUrlLinks($this->window['first']);
}
if (is_array($this->window['slider'])) {
$html .= $this->getDots();
$html .= $this->getUrlLinks($this->window['slider']);
}
if (is_array($this->window['last... | php | protected function getLinks()
{
$html = '';
if (is_array($this->window['first'])) {
$html .= $this->getUrlLinks($this->window['first']);
}
if (is_array($this->window['slider'])) {
$html .= $this->getDots();
$html .= $this->getUrlLinks($this->window['slider']);
}
if (is_array($this->window['last... | [
"protected",
"function",
"getLinks",
"(",
")",
"{",
"$",
"html",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"window",
"[",
"'first'",
"]",
")",
")",
"{",
"$",
"html",
".=",
"$",
"this",
"->",
"getUrlLinks",
"(",
"$",
"this",
"... | Render the actual link slider.
@return string | [
"Render",
"the",
"actual",
"link",
"slider",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Pagination/UrlWindowPresenterTrait.php#L10-L29 |
194,609 | honey-comb/resources | src/Http/Controllers/Admin/HCResourceGrabPropertyController.php | HCResourceGrabPropertyController.index | public function index(): View
{
$config = [
'title' => trans('HCResource::resource_grab_property.page_title'),
'url' => route('admin.api.resource.grab.property'),
'form' => route('admin.api.form-manager', ['resource.grab.property']),
'headers' => $this->getTab... | php | public function index(): View
{
$config = [
'title' => trans('HCResource::resource_grab_property.page_title'),
'url' => route('admin.api.resource.grab.property'),
'form' => route('admin.api.form-manager', ['resource.grab.property']),
'headers' => $this->getTab... | [
"public",
"function",
"index",
"(",
")",
":",
"View",
"{",
"$",
"config",
"=",
"[",
"'title'",
"=>",
"trans",
"(",
"'HCResource::resource_grab_property.page_title'",
")",
",",
"'url'",
"=>",
"route",
"(",
"'admin.api.resource.grab.property'",
")",
",",
"'form'",
... | Admin panel page view
@return View | [
"Admin",
"panel",
"page",
"view"
] | 9b82eb2fd99be99edfdc4e76803d95caf981e14b | https://github.com/honey-comb/resources/blob/9b82eb2fd99be99edfdc4e76803d95caf981e14b/src/Http/Controllers/Admin/HCResourceGrabPropertyController.php#L55-L66 |
194,610 | honey-comb/resources | src/Http/Controllers/Admin/HCResourceGrabPropertyController.php | HCResourceGrabPropertyController.getOptions | public function getOptions(HCResourceGrabPropertyRequest $request): JsonResponse
{
return response()->json(
$this->service->getRepository()->getOptions($request)
);
} | php | public function getOptions(HCResourceGrabPropertyRequest $request): JsonResponse
{
return response()->json(
$this->service->getRepository()->getOptions($request)
);
} | [
"public",
"function",
"getOptions",
"(",
"HCResourceGrabPropertyRequest",
"$",
"request",
")",
":",
"JsonResponse",
"{",
"return",
"response",
"(",
")",
"->",
"json",
"(",
"$",
"this",
"->",
"service",
"->",
"getRepository",
"(",
")",
"->",
"getOptions",
"(",
... | Create data list
@param HCResourceGrabPropertyRequest $request
@return JsonResponse | [
"Create",
"data",
"list"
] | 9b82eb2fd99be99edfdc4e76803d95caf981e14b | https://github.com/honey-comb/resources/blob/9b82eb2fd99be99edfdc4e76803d95caf981e14b/src/Http/Controllers/Admin/HCResourceGrabPropertyController.php#L108-L113 |
194,611 | rollerworks/search-core | SearchFactoryBuilder.php | SearchFactoryBuilder.addTypeExtensions | public function addTypeExtensions(array $typeExtensions)
{
foreach ($typeExtensions as $typeExtension) {
$this->typeExtensions[$typeExtension->getExtendedType()][] = $typeExtension;
}
return $this;
} | php | public function addTypeExtensions(array $typeExtensions)
{
foreach ($typeExtensions as $typeExtension) {
$this->typeExtensions[$typeExtension->getExtendedType()][] = $typeExtension;
}
return $this;
} | [
"public",
"function",
"addTypeExtensions",
"(",
"array",
"$",
"typeExtensions",
")",
"{",
"foreach",
"(",
"$",
"typeExtensions",
"as",
"$",
"typeExtension",
")",
"{",
"$",
"this",
"->",
"typeExtensions",
"[",
"$",
"typeExtension",
"->",
"getExtendedType",
"(",
... | Adds a list of field type extension to the factory.
@param FieldTypeExtension[] $typeExtensions
@return static The builder | [
"Adds",
"a",
"list",
"of",
"field",
"type",
"extension",
"to",
"the",
"factory",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/SearchFactoryBuilder.php#L149-L156 |
194,612 | rollerworks/search-core | SearchFactoryBuilder.php | SearchFactoryBuilder.getSearchFactory | public function getSearchFactory(): SearchFactory
{
$extensions = $this->extensions;
if (\count($this->types) > 0 || \count($this->typeExtensions) > 0) {
$extensions[] = new PreloadedExtension($this->types, $this->typeExtensions);
}
$resolvedTypeFactory = $this->resolve... | php | public function getSearchFactory(): SearchFactory
{
$extensions = $this->extensions;
if (\count($this->types) > 0 || \count($this->typeExtensions) > 0) {
$extensions[] = new PreloadedExtension($this->types, $this->typeExtensions);
}
$resolvedTypeFactory = $this->resolve... | [
"public",
"function",
"getSearchFactory",
"(",
")",
":",
"SearchFactory",
"{",
"$",
"extensions",
"=",
"$",
"this",
"->",
"extensions",
";",
"if",
"(",
"\\",
"count",
"(",
"$",
"this",
"->",
"types",
")",
">",
"0",
"||",
"\\",
"count",
"(",
"$",
"thi... | Builds and returns the factory. | [
"Builds",
"and",
"returns",
"the",
"factory",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/SearchFactoryBuilder.php#L161-L173 |
194,613 | Vectrex/vxPHP | src/Image/ImageModifier.php | ImageModifier.watermark | public function watermark() {
$args = func_get_args();
if(!count($args)) {
throw new ImageModifierException('Insufficient arguments for watermarking.');
}
if(!file_exists(realpath($args[0]))) {
throw new ImageModifierException('Watermark file not found.');
}
$todo = new \stdClass();
$todo... | php | public function watermark() {
$args = func_get_args();
if(!count($args)) {
throw new ImageModifierException('Insufficient arguments for watermarking.');
}
if(!file_exists(realpath($args[0]))) {
throw new ImageModifierException('Watermark file not found.');
}
$todo = new \stdClass();
$todo... | [
"public",
"function",
"watermark",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"!",
"count",
"(",
"$",
"args",
")",
")",
"{",
"throw",
"new",
"ImageModifierException",
"(",
"'Insufficient arguments for watermarking.'",
")",
";... | adds a watermark-"command" to queue
@param string $filename
@throws ImageModifierException | [
"adds",
"a",
"watermark",
"-",
"command",
"to",
"queue"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Image/ImageModifier.php#L275-L294 |
194,614 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getVarcharSQLDeclarationSnippet | protected function getVarcharSQLDeclarationSnippet($length, $fixed)
{
if (!is_int($length) || (is_int($length) && ($length <= 0))) {
throw PlatformException::invalidVarcharLength();
}
if (!is_bool($fixed)) {
throw PlatformException::invalidVarcharFixedFlag();
... | php | protected function getVarcharSQLDeclarationSnippet($length, $fixed)
{
if (!is_int($length) || (is_int($length) && ($length <= 0))) {
throw PlatformException::invalidVarcharLength();
}
if (!is_bool($fixed)) {
throw PlatformException::invalidVarcharFixedFlag();
... | [
"protected",
"function",
"getVarcharSQLDeclarationSnippet",
"(",
"$",
"length",
",",
"$",
"fixed",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"length",
")",
"||",
"(",
"is_int",
"(",
"$",
"length",
")",
"&&",
"(",
"$",
"length",
"<=",
"0",
")",
")... | Gets the varchar SQL declaration snippet.
@param integer $length The varchar length.
@param boolean $fixed TRUE if the varchar is fixed else FALSE.
@throws \Fridge\DBAL\Exception\PlatformException If the length is not a positive integer or if the fixed flag
is not a boolean.
@return string The varchar SQL declarati... | [
"Gets",
"the",
"varchar",
"SQL",
"declaration",
"snippet",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1028-L1043 |
194,615 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getTransactionIsolationSQLDeclaration | protected function getTransactionIsolationSQLDeclaration($isolation)
{
if (!$this->supportTransactionIsolations()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
$availableIsolations = array(
Connection::TRANSACTION_READ_COMMITTED,
Connectio... | php | protected function getTransactionIsolationSQLDeclaration($isolation)
{
if (!$this->supportTransactionIsolations()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
$availableIsolations = array(
Connection::TRANSACTION_READ_COMMITTED,
Connectio... | [
"protected",
"function",
"getTransactionIsolationSQLDeclaration",
"(",
"$",
"isolation",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportTransactionIsolations",
"(",
")",
")",
"{",
"throw",
"PlatformException",
"::",
"methodNotSupported",
"(",
"__METHOD__",
")"... | Gets the transaction isolation SQL declaration.
@param string $isolation The transaction isolation.
@throws \Fridge\DBAL\Exception\PlatformException If the transactions isolcation is not supported.
@throws \Fridge\DBAL\Exception\PlatformException If the isolation does not exist.
@return string The transaction isolat... | [
"Gets",
"the",
"transaction",
"isolation",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1055-L1073 |
194,616 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getColumnsSQLDeclaration | protected function getColumnsSQLDeclaration(array $columns)
{
$columnsDeclaration = array();
foreach ($columns as $column) {
$columnsDeclaration[] = $this->getColumnSQLDeclaration($column);
}
return implode(', ', $columnsDeclaration);
} | php | protected function getColumnsSQLDeclaration(array $columns)
{
$columnsDeclaration = array();
foreach ($columns as $column) {
$columnsDeclaration[] = $this->getColumnSQLDeclaration($column);
}
return implode(', ', $columnsDeclaration);
} | [
"protected",
"function",
"getColumnsSQLDeclaration",
"(",
"array",
"$",
"columns",
")",
"{",
"$",
"columnsDeclaration",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"$",
"columnsDeclaration",
"[",
"]",
"=",
"$... | Gets the columns SQL declaration.
@param array $columns The columns (An array of `Fridge\DBAL\Schema\Column`).
@return string The columns SQL declaration. | [
"Gets",
"the",
"columns",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1082-L1091 |
194,617 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getColumnSQLDeclaration | protected function getColumnSQLDeclaration(Column $column)
{
$columnDeclaration = $column->getName().' '.$column->getType()->getSQLDeclaration($this, $column->toArray());
if ($column->isNotNull()) {
$columnDeclaration .= ' NOT NULL';
}
if ($column->getDefault() !== null... | php | protected function getColumnSQLDeclaration(Column $column)
{
$columnDeclaration = $column->getName().' '.$column->getType()->getSQLDeclaration($this, $column->toArray());
if ($column->isNotNull()) {
$columnDeclaration .= ' NOT NULL';
}
if ($column->getDefault() !== null... | [
"protected",
"function",
"getColumnSQLDeclaration",
"(",
"Column",
"$",
"column",
")",
"{",
"$",
"columnDeclaration",
"=",
"$",
"column",
"->",
"getName",
"(",
")",
".",
"' '",
".",
"$",
"column",
"->",
"getType",
"(",
")",
"->",
"getSQLDeclaration",
"(",
... | Gets the column SQL declaration.
@param \Fridge\DBAL\Schema\Column $column The column.
@return string The column SQL declaration. | [
"Gets",
"the",
"column",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1100-L1121 |
194,618 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getPrimaryKeySQLDeclaration | protected function getPrimaryKeySQLDeclaration(PrimaryKey $primaryKey)
{
if (!$this->supportPrimaryKeys()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
return 'CONSTRAINT '.$primaryKey->getName().' PRIMARY KEY ('.implode(', ', $primaryKey->getColumnNames()).')';
... | php | protected function getPrimaryKeySQLDeclaration(PrimaryKey $primaryKey)
{
if (!$this->supportPrimaryKeys()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
return 'CONSTRAINT '.$primaryKey->getName().' PRIMARY KEY ('.implode(', ', $primaryKey->getColumnNames()).')';
... | [
"protected",
"function",
"getPrimaryKeySQLDeclaration",
"(",
"PrimaryKey",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportPrimaryKeys",
"(",
")",
")",
"{",
"throw",
"PlatformException",
"::",
"methodNotSupported",
"(",
"__METHOD__",
")",
... | Gets the primary key SQL declaration.
@param \Fridge\DBAL\Schema\PrimaryKey $primaryKey The primary key.
@throws \Fridge\DBAL\Exception\PlatformException If the platform does not support primary key.
@return string The primary key SQL declaration. | [
"Gets",
"the",
"primary",
"key",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1132-L1139 |
194,619 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getForeignKeySQLDeclaration | protected function getForeignKeySQLDeclaration(ForeignKey $foreignKey)
{
if (!$this->supportForeignKeys()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
return 'CONSTRAINT '.$foreignKey->getName().
' FOREIGN KEY'.
' ('.implode(', ', $... | php | protected function getForeignKeySQLDeclaration(ForeignKey $foreignKey)
{
if (!$this->supportForeignKeys()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
return 'CONSTRAINT '.$foreignKey->getName().
' FOREIGN KEY'.
' ('.implode(', ', $... | [
"protected",
"function",
"getForeignKeySQLDeclaration",
"(",
"ForeignKey",
"$",
"foreignKey",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportForeignKeys",
"(",
")",
")",
"{",
"throw",
"PlatformException",
"::",
"methodNotSupported",
"(",
"__METHOD__",
")",
... | Gets the foreign key SQL declaration.
@param \Fridge\DBAL\Schema\ForeignKey $foreignKey The foreign key.
@throws \Fridge\DBAL\Exception\PlatformException If the platform does not support foreign key.
@return string The foreign key SQL declaration. | [
"Gets",
"the",
"foreign",
"key",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1150-L1163 |
194,620 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getIndexSQLDeclaration | protected function getIndexSQLDeclaration(Index $index)
{
if (!$this->supportIndexes()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
if (!$index->isUnique()) {
return 'INDEX '.$index->getName().' ('.implode(', ', $index->getColumnNames()).')';
... | php | protected function getIndexSQLDeclaration(Index $index)
{
if (!$this->supportIndexes()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
if (!$index->isUnique()) {
return 'INDEX '.$index->getName().' ('.implode(', ', $index->getColumnNames()).')';
... | [
"protected",
"function",
"getIndexSQLDeclaration",
"(",
"Index",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportIndexes",
"(",
")",
")",
"{",
"throw",
"PlatformException",
"::",
"methodNotSupported",
"(",
"__METHOD__",
")",
";",
"}",
"if"... | Gets the index SQL declaration.
@param \Fridge\DBAl\Schema\Index $index The index.
@throws \Fridge\DBAL\Exception\PlatformException If the platform does not support index.
@return string The index SQL declaration. | [
"Gets",
"the",
"index",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1174-L1185 |
194,621 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getCheckSQLDeclaration | protected function getCheckSQLDeclaration(Check $check)
{
if (!$this->supportChecks()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
return 'CONSTRAINT '.$check->getName().' CHECK ('.$check->getDefinition().')';
} | php | protected function getCheckSQLDeclaration(Check $check)
{
if (!$this->supportChecks()) {
throw PlatformException::methodNotSupported(__METHOD__);
}
return 'CONSTRAINT '.$check->getName().' CHECK ('.$check->getDefinition().')';
} | [
"protected",
"function",
"getCheckSQLDeclaration",
"(",
"Check",
"$",
"check",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportChecks",
"(",
")",
")",
"{",
"throw",
"PlatformException",
"::",
"methodNotSupported",
"(",
"__METHOD__",
")",
";",
"}",
"retu... | Gets the check constraint SQL declaration.
@param \Fridge\DBAL\Schema\Check $check The check constraint.
@throws \Fridge\DBAL\Exception\PlatformException If the platform does not support check.
@return string The check constraint SQL declaration. | [
"Gets",
"the",
"check",
"constraint",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1196-L1203 |
194,622 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getCreateColumnCommentsSQLQueries | protected function getCreateColumnCommentsSQLQueries(array $columns, $table)
{
$queries = array();
foreach ($columns as $column) {
if ($this->hasCustomType($column->getType()->getName()) || ($column->getComment() !== null)) {
$queries[] = $this->getCreateColumnCommentSQL... | php | protected function getCreateColumnCommentsSQLQueries(array $columns, $table)
{
$queries = array();
foreach ($columns as $column) {
if ($this->hasCustomType($column->getType()->getName()) || ($column->getComment() !== null)) {
$queries[] = $this->getCreateColumnCommentSQL... | [
"protected",
"function",
"getCreateColumnCommentsSQLQueries",
"(",
"array",
"$",
"columns",
",",
"$",
"table",
")",
"{",
"$",
"queries",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"this",
... | Gets the create column comments SQL queries.
@param array $columns The columns (An array of `Fridge\DBAL\Schema\Column`).
@param string $table The table name.
@return array The create column comments SQL queries. | [
"Gets",
"the",
"create",
"column",
"comments",
"SQL",
"queries",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1213-L1224 |
194,623 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getCreateColumnCommentSQLQuery | protected function getCreateColumnCommentSQLQuery(Column $column, $table)
{
return 'COMMENT ON COLUMN '.$table.'.'.$column->getName().' IS '.$this->getColumnCommentSQLDeclaration($column);
} | php | protected function getCreateColumnCommentSQLQuery(Column $column, $table)
{
return 'COMMENT ON COLUMN '.$table.'.'.$column->getName().' IS '.$this->getColumnCommentSQLDeclaration($column);
} | [
"protected",
"function",
"getCreateColumnCommentSQLQuery",
"(",
"Column",
"$",
"column",
",",
"$",
"table",
")",
"{",
"return",
"'COMMENT ON COLUMN '",
".",
"$",
"table",
".",
"'.'",
".",
"$",
"column",
"->",
"getName",
"(",
")",
".",
"' IS '",
".",
"$",
"... | Gets the create column comment SQL query.
@param \Fridge\DBAL\Schema\Column $column The column.
@param string $table The table name.
@return string The create column comment SQL query. | [
"Gets",
"the",
"create",
"column",
"comment",
"SQL",
"query",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1234-L1237 |
194,624 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getColumnCommentSQLDeclaration | protected function getColumnCommentSQLDeclaration(Column $column)
{
$comment = $column->getComment();
if ($this->hasCustomType($column->getType()->getName())) {
$comment .= '(FridgeType::'.strtoupper($column->getType()->getName()).')';
}
return $this->quote($comment);
... | php | protected function getColumnCommentSQLDeclaration(Column $column)
{
$comment = $column->getComment();
if ($this->hasCustomType($column->getType()->getName())) {
$comment .= '(FridgeType::'.strtoupper($column->getType()->getName()).')';
}
return $this->quote($comment);
... | [
"protected",
"function",
"getColumnCommentSQLDeclaration",
"(",
"Column",
"$",
"column",
")",
"{",
"$",
"comment",
"=",
"$",
"column",
"->",
"getComment",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasCustomType",
"(",
"$",
"column",
"->",
"getType",
"(... | Gets the column comment SQL declaration.
@param \Fridge\DBAL\Schema\Column $column The column.
@return string The column comment SQL declaration. | [
"Gets",
"the",
"column",
"comment",
"SQL",
"declaration",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1246-L1255 |
194,625 | fridge-project/dbal | src/Fridge/DBAL/Platform/AbstractPlatform.php | AbstractPlatform.getAlterTableSQLQuery | protected function getAlterTableSQLQuery($table, $action, $expression = null)
{
$alterTable = 'ALTER TABLE '.$table.' '.$action;
return $expression !== null ? $alterTable.' '.$expression : $alterTable;
} | php | protected function getAlterTableSQLQuery($table, $action, $expression = null)
{
$alterTable = 'ALTER TABLE '.$table.' '.$action;
return $expression !== null ? $alterTable.' '.$expression : $alterTable;
} | [
"protected",
"function",
"getAlterTableSQLQuery",
"(",
"$",
"table",
",",
"$",
"action",
",",
"$",
"expression",
"=",
"null",
")",
"{",
"$",
"alterTable",
"=",
"'ALTER TABLE '",
".",
"$",
"table",
".",
"' '",
".",
"$",
"action",
";",
"return",
"$",
"expr... | Gets an alter table SQL query.
@param string $table The table name.
@param string $action The alter table action (ADD, DROP, ...).
@param string $expression The alter table expression.
@return string The alter table query. | [
"Gets",
"an",
"alter",
"table",
"SQL",
"query",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Platform/AbstractPlatform.php#L1266-L1271 |
194,626 | lightwerk/SurfTasks | Classes/Lightwerk/SurfTasks/Task/LockFile/CreateTask.php | CreateTask.rollback | public function rollback(Node $node, Application $application, Deployment $deployment, array $options = [])
{
$this->removeFile(
rtrim($application->getReleasesPath(), '/').'/'.$this->getTargetPath($options),
$node,
$deployment,
$options
);
$t... | php | public function rollback(Node $node, Application $application, Deployment $deployment, array $options = [])
{
$this->removeFile(
rtrim($application->getReleasesPath(), '/').'/'.$this->getTargetPath($options),
$node,
$deployment,
$options
);
$t... | [
"public",
"function",
"rollback",
"(",
"Node",
"$",
"node",
",",
"Application",
"$",
"application",
",",
"Deployment",
"$",
"deployment",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"removeFile",
"(",
"rtrim",
"(",
"$",
"a... | Rollback this task.
@param \TYPO3\Surf\Domain\Model\Node $node
@param \TYPO3\Surf\Domain\Model\Application $application
@param \TYPO3\Surf\Domain\Model\Deployment $deployment
@param array $options | [
"Rollback",
"this",
"task",
"."
] | 8a6e4c85e42c762ad6515778c3fc7e19052cd9d1 | https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/LockFile/CreateTask.php#L84-L99 |
194,627 | fulgurio/LightCMSBundle | Controller/AdminMediaController.php | AdminMediaController.createMedia | private function createMedia(Media $media)
{
$request = $this->getRequest();
$thumbSizes = $this->container->getParameter('fulgurio_light_cms.thumbs');
$form = $this->createForm(new AdminMediaType($this->container), $media);
$formHandler = new AdminMediaHandler();
$formHandle... | php | private function createMedia(Media $media)
{
$request = $this->getRequest();
$thumbSizes = $this->container->getParameter('fulgurio_light_cms.thumbs');
$form = $this->createForm(new AdminMediaType($this->container), $media);
$formHandler = new AdminMediaHandler();
$formHandle... | [
"private",
"function",
"createMedia",
"(",
"Media",
"$",
"media",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"thumbSizes",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'fulgurio_light_cms.thumbs'",... | Create form for media entity, use for edit or add a media
@param Media $media
@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response | [
"Create",
"form",
"for",
"media",
"entity",
"use",
"for",
"edit",
"or",
"add",
"a",
"media"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminMediaController.php#L101-L148 |
194,628 | fulgurio/LightCMSBundle | Controller/AdminMediaController.php | AdminMediaController.removeAction | public function removeAction($mediaId)
{
$media = $this->getMedia($mediaId);
$request = $this->getRequest();
if ($request->request->get('confirm') === 'yes' || $request->get('confirm') === 'yes')
{
$this->get('fulgurio_light_cms.media_library')->remove($media);
... | php | public function removeAction($mediaId)
{
$media = $this->getMedia($mediaId);
$request = $this->getRequest();
if ($request->request->get('confirm') === 'yes' || $request->get('confirm') === 'yes')
{
$this->get('fulgurio_light_cms.media_library')->remove($media);
... | [
"public",
"function",
"removeAction",
"(",
"$",
"mediaId",
")",
"{",
"$",
"media",
"=",
"$",
"this",
"->",
"getMedia",
"(",
"$",
"mediaId",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"$",
"request",
"-... | Remove media, with confirm form
@param number $mediaId | [
"Remove",
"media",
"with",
"confirm",
"form"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminMediaController.php#L155-L176 |
194,629 | fulgurio/LightCMSBundle | Controller/AdminMediaController.php | AdminMediaController.wysiwygMediaAction | public function wysiwygMediaAction()
{
$form = $this->createForm(new AdminMediaType($this->container), new Media());
return $this->render(
'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig',
array(
'form' => $form->createView(),
'wysiwyg'... | php | public function wysiwygMediaAction()
{
$form = $this->createForm(new AdminMediaType($this->container), new Media());
return $this->render(
'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig',
array(
'form' => $form->createView(),
'wysiwyg'... | [
"public",
"function",
"wysiwygMediaAction",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"AdminMediaType",
"(",
"$",
"this",
"->",
"container",
")",
",",
"new",
"Media",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
... | Wysiwyg media popup
@return \Symfony\Component\HttpFoundation\Response | [
"Wysiwyg",
"media",
"popup"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminMediaController.php#L183-L193 |
194,630 | fulgurio/LightCMSBundle | Controller/AdminMediaController.php | AdminMediaController.wysiwygLinkAction | public function wysiwygLinkAction()
{
$form = $this->createForm(new AdminMediaType($this->container), new Media());
return $this->render(
'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig',
array(
'form' => $form->createView(),
... | php | public function wysiwygLinkAction()
{
$form = $this->createForm(new AdminMediaType($this->container), new Media());
return $this->render(
'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig',
array(
'form' => $form->createView(),
... | [
"public",
"function",
"wysiwygLinkAction",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"AdminMediaType",
"(",
"$",
"this",
"->",
"container",
")",
",",
"new",
"Media",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
... | Wysiwyg link popup
@return \Symfony\Component\HttpFoundation\Response | [
"Wysiwyg",
"link",
"popup"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminMediaController.php#L200-L211 |
194,631 | fulgurio/LightCMSBundle | Controller/AdminMediaController.php | AdminMediaController.getWysiwyg | private function getWysiwyg()
{
$wysiwygName = $this->container->getParameter('fulgurio_light_cms.wysiwyg');
if ($wysiwygName && $this->container->hasParameter($wysiwygName))
{
return $this->container->getParameter($wysiwygName);
}
else
{
retur... | php | private function getWysiwyg()
{
$wysiwygName = $this->container->getParameter('fulgurio_light_cms.wysiwyg');
if ($wysiwygName && $this->container->hasParameter($wysiwygName))
{
return $this->container->getParameter($wysiwygName);
}
else
{
retur... | [
"private",
"function",
"getWysiwyg",
"(",
")",
"{",
"$",
"wysiwygName",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'fulgurio_light_cms.wysiwyg'",
")",
";",
"if",
"(",
"$",
"wysiwygName",
"&&",
"$",
"this",
"->",
"container",
"->",
"hasP... | Get specified wysiwig with configuration if set
@return \Symfony\Component\DependencyInjection\mixed|NULL | [
"Get",
"specified",
"wysiwig",
"with",
"configuration",
"if",
"set"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminMediaController.php#L218-L229 |
194,632 | fulgurio/LightCMSBundle | Controller/AdminMediaController.php | AdminMediaController.jsonResponse | private function jsonResponse($data)
{
$response = new Response(json_encode($data));
$response->headers->set('Content-Type', 'application/json');
return $response;
} | php | private function jsonResponse($data)
{
$response = new Response(json_encode($data));
$response->headers->set('Content-Type', 'application/json');
return $response;
} | [
"private",
"function",
"jsonResponse",
"(",
"$",
"data",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
"json_encode",
"(",
"$",
"data",
")",
")",
";",
"$",
"response",
"->",
"headers",
"->",
"set",
"(",
"'Content-Type'",
",",
"'application/json'"... | Return a JSON response
@param void $data
@return \Symfony\Component\HttpFoundation\Response | [
"Return",
"a",
"JSON",
"response"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminMediaController.php#L257-L262 |
194,633 | Nicklas766/Comment | src/Comment/Modules/Question.php | Question.getPopularTags | public function getPopularTags()
{
$question = $this->findAll();
$tagsMultiArray = array_map(function ($question) {
return explode(',', $question->tags);
}, $question);
// Merge multi array, count values, sort high to low
$tagArr = array_count_values(call_user_f... | php | public function getPopularTags()
{
$question = $this->findAll();
$tagsMultiArray = array_map(function ($question) {
return explode(',', $question->tags);
}, $question);
// Merge multi array, count values, sort high to low
$tagArr = array_count_values(call_user_f... | [
"public",
"function",
"getPopularTags",
"(",
")",
"{",
"$",
"question",
"=",
"$",
"this",
"->",
"findAll",
"(",
")",
";",
"$",
"tagsMultiArray",
"=",
"array_map",
"(",
"function",
"(",
"$",
"question",
")",
"{",
"return",
"explode",
"(",
"','",
",",
"$... | Returns array of tags, keys are name, value is the integer of how many.
@return array | [
"Returns",
"array",
"of",
"tags",
"keys",
"are",
"name",
"value",
"is",
"the",
"integer",
"of",
"how",
"many",
"."
] | 1483eaf1ebb120b8bd6c2a1552c084b3a288ff25 | https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/Question.php#L90-L102 |
194,634 | swaros/golib | src/Types/PropsFactory.php | PropsFactory.getKey | private function getKey ( $key = NULL ) {
if ($key === NULL) {
$key = $this->__keyName;
return $this->getClassKey() . '_' . $this->$key;
}
return $this->getClassKey() . '_' . $key;
} | php | private function getKey ( $key = NULL ) {
if ($key === NULL) {
$key = $this->__keyName;
return $this->getClassKey() . '_' . $this->$key;
}
return $this->getClassKey() . '_' . $key;
} | [
"private",
"function",
"getKey",
"(",
"$",
"key",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"NULL",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"__keyName",
";",
"return",
"$",
"this",
"->",
"getClassKey",
"(",
")",
".",
"'_'",
".",
... | returns the key for scope cache
@param string $key
@return string | [
"returns",
"the",
"key",
"for",
"scope",
"cache"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/PropsFactory.php#L43-L49 |
194,635 | swaros/golib | src/Types/PropsFactory.php | PropsFactory.applyData | public function applyData ( $data = NULL ) {
parent::applyData( $data );
if ($data != null) {
self::$propData[$this->getKey()] = $this;
self::$keyCache[$this->getClassKey()] = $this->__keyName;
$key = $this->__keyName;
self::$__ids[$this->getClassKey()][$t... | php | public function applyData ( $data = NULL ) {
parent::applyData( $data );
if ($data != null) {
self::$propData[$this->getKey()] = $this;
self::$keyCache[$this->getClassKey()] = $this->__keyName;
$key = $this->__keyName;
self::$__ids[$this->getClassKey()][$t... | [
"public",
"function",
"applyData",
"(",
"$",
"data",
"=",
"NULL",
")",
"{",
"parent",
"::",
"applyData",
"(",
"$",
"data",
")",
";",
"if",
"(",
"$",
"data",
"!=",
"null",
")",
"{",
"self",
"::",
"$",
"propData",
"[",
"$",
"this",
"->",
"getKey",
... | ovewrite parent becasue of catching all
props
@param array $data | [
"ovewrite",
"parent",
"becasue",
"of",
"catching",
"all",
"props"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/PropsFactory.php#L64-L72 |
194,636 | swaros/golib | src/Types/PropsFactory.php | PropsFactory.getProps | public function getProps ( $id ) {
if (isset( self::$propData[$this->getKey( $id )] )) {
return self::$propData[$this->getKey( $id )];
}
return NULL;
} | php | public function getProps ( $id ) {
if (isset( self::$propData[$this->getKey( $id )] )) {
return self::$propData[$this->getKey( $id )];
}
return NULL;
} | [
"public",
"function",
"getProps",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"propData",
"[",
"$",
"this",
"->",
"getKey",
"(",
"$",
"id",
")",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"propData",
"[",
"$",
"t... | returns the content by the
id if these already builded. if not is returns NULL
@param mixed $id
@return self | [
"returns",
"the",
"content",
"by",
"the",
"id",
"if",
"these",
"already",
"builded",
".",
"if",
"not",
"is",
"returns",
"NULL"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/PropsFactory.php#L103-L108 |
194,637 | swaros/golib | src/Types/PropsFactory.php | PropsFactory.fetch | public function fetch ( $id ) {
if (isset( self::$propData[$this->getKey( $id )] )) {
return self::$propData[$this->getKey( $id )];
}
return false;
} | php | public function fetch ( $id ) {
if (isset( self::$propData[$this->getKey( $id )] )) {
return self::$propData[$this->getKey( $id )];
}
return false;
} | [
"public",
"function",
"fetch",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"propData",
"[",
"$",
"this",
"->",
"getKey",
"(",
"$",
"id",
")",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"propData",
"[",
"$",
"this... | fetch data if exists so the current object
is exchanges
@param mixed $id
@return self | [
"fetch",
"data",
"if",
"exists",
"so",
"the",
"current",
"object",
"is",
"exchanges"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/PropsFactory.php#L117-L122 |
194,638 | swaros/golib | src/Types/PropsFactory.php | PropsFactory.copyProps | private function copyProps ( self $source ) {
foreach ($source as $keyName => $data) {
if (substr( $keyName, 0, 2 ) !== '__') {
$this->$keyName = $data;
}
}
} | php | private function copyProps ( self $source ) {
foreach ($source as $keyName => $data) {
if (substr( $keyName, 0, 2 ) !== '__') {
$this->$keyName = $data;
}
}
} | [
"private",
"function",
"copyProps",
"(",
"self",
"$",
"source",
")",
"{",
"foreach",
"(",
"$",
"source",
"as",
"$",
"keyName",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"keyName",
",",
"0",
",",
"2",
")",
"!==",
"'__'",
")",
"{"... | copy propertie to self
@param self $source | [
"copy",
"propertie",
"to",
"self"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/PropsFactory.php#L128-L134 |
194,639 | rmatil/SAX | lib/Sax/Sax.php | Sax.preprocess | public function preprocess( $pSaxReferenceString, array $pSaxAnalysisStrings) {
$this->referenceSuffixTree = new SuffixTree( $pSaxReferenceString );
foreach ( $pSaxAnalysisStrings as $anaString ) {
$anaTree = new SuffixTree($anaString);
$this->annotateSurpriseValues( $this->refe... | php | public function preprocess( $pSaxReferenceString, array $pSaxAnalysisStrings) {
$this->referenceSuffixTree = new SuffixTree( $pSaxReferenceString );
foreach ( $pSaxAnalysisStrings as $anaString ) {
$anaTree = new SuffixTree($anaString);
$this->annotateSurpriseValues( $this->refe... | [
"public",
"function",
"preprocess",
"(",
"$",
"pSaxReferenceString",
",",
"array",
"$",
"pSaxAnalysisStrings",
")",
"{",
"$",
"this",
"->",
"referenceSuffixTree",
"=",
"new",
"SuffixTree",
"(",
"$",
"pSaxReferenceString",
")",
";",
"foreach",
"(",
"$",
"pSaxAnal... | Creates the suffix trees for the given reference string
and the strings under analysis. Annotates the occurences
of each substring in the corresponding node of the tree.
@param string $pSaxReferenceString Discretized reference string (i.e. sax word)
@param array $pSaxAnalysisStrings Array of discretized string repr... | [
"Creates",
"the",
"suffix",
"trees",
"for",
"the",
"given",
"reference",
"string",
"and",
"the",
"strings",
"under",
"analysis",
".",
"Annotates",
"the",
"occurences",
"of",
"each",
"substring",
"in",
"the",
"corresponding",
"node",
"of",
"the",
"tree",
"."
] | f42cb97300c9f8e87c66644ccc236309db2396e2 | https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/Sax.php#L157-L167 |
194,640 | rmatil/SAX | lib/Sax/Sax.php | Sax.computeStatistics | public function computeStatistics( array $pTimeSeries ) {
$statistics = array('min' => 0,
'max' => 0,
'stdDev' => 0,
'mean' => 0,
'sum' => 0,
'siz... | php | public function computeStatistics( array $pTimeSeries ) {
$statistics = array('min' => 0,
'max' => 0,
'stdDev' => 0,
'mean' => 0,
'sum' => 0,
'siz... | [
"public",
"function",
"computeStatistics",
"(",
"array",
"$",
"pTimeSeries",
")",
"{",
"$",
"statistics",
"=",
"array",
"(",
"'min'",
"=>",
"0",
",",
"'max'",
"=>",
"0",
",",
"'stdDev'",
"=>",
"0",
",",
"'mean'",
"=>",
"0",
",",
"'sum'",
"=>",
"0",
"... | Calculates the minimum, maximum, standard deviation, mean, sum and the size
of the given time series. It must contain the key 'count' for each entry.
@param array $pTimeSeries Time series to calculate the described attributes
@return array An array containing the attributes described above | [
"Calculates",
"the",
"minimum",
"maximum",
"standard",
"deviation",
"mean",
"sum",
"and",
"the",
"size",
"of",
"the",
"given",
"time",
"series",
".",
"It",
"must",
"contain",
"the",
"key",
"count",
"for",
"each",
"entry",
"."
] | f42cb97300c9f8e87c66644ccc236309db2396e2 | https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/Sax.php#L253-L286 |
194,641 | rmatil/SAX | lib/Sax/Sax.php | Sax.discretizeTimeSeries | public function discretizeTimeSeries( array $pTimeSeries, $pFeatureWindowLength = 1 ) {
$nrOfBreakpoints = $this->alphabetSize - 1;
$breakpoints = $this->breakpoints[$nrOfBreakpoints];
$saxWord = "";
// discretize reference time series
for ( $i=0; $i < count( $pTime... | php | public function discretizeTimeSeries( array $pTimeSeries, $pFeatureWindowLength = 1 ) {
$nrOfBreakpoints = $this->alphabetSize - 1;
$breakpoints = $this->breakpoints[$nrOfBreakpoints];
$saxWord = "";
// discretize reference time series
for ( $i=0; $i < count( $pTime... | [
"public",
"function",
"discretizeTimeSeries",
"(",
"array",
"$",
"pTimeSeries",
",",
"$",
"pFeatureWindowLength",
"=",
"1",
")",
"{",
"$",
"nrOfBreakpoints",
"=",
"$",
"this",
"->",
"alphabetSize",
"-",
"1",
";",
"$",
"breakpoints",
"=",
"$",
"this",
"->",
... | Discretizes a given time series to a "sax word", i.e. a sequence
of characters indicating the amplitude of the time series.
@param array $pTimeSeries Time series to discretize
@param integer $pFeatureWindowLength Amount of datapoints which will used as a single
datapoint (by computing the mean), default is ... | [
"Discretizes",
"a",
"given",
"time",
"series",
"to",
"a",
"sax",
"word",
"i",
".",
"e",
".",
"a",
"sequence",
"of",
"characters",
"indicating",
"the",
"amplitude",
"of",
"the",
"time",
"series",
"."
] | f42cb97300c9f8e87c66644ccc236309db2396e2 | https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/Sax.php#L340-L370 |
194,642 | rmatil/SAX | lib/Sax/Sax.php | Sax.annotateSurpriseValues | public function annotateSurpriseValues( &$pReferenceTree , &$pAnalysisTree) {
$this->annotateNode( $pReferenceTree, $pAnalysisTree, $pAnalysisTree->nodes[$pAnalysisTree->root], "" );
} | php | public function annotateSurpriseValues( &$pReferenceTree , &$pAnalysisTree) {
$this->annotateNode( $pReferenceTree, $pAnalysisTree, $pAnalysisTree->nodes[$pAnalysisTree->root], "" );
} | [
"public",
"function",
"annotateSurpriseValues",
"(",
"&",
"$",
"pReferenceTree",
",",
"&",
"$",
"pAnalysisTree",
")",
"{",
"$",
"this",
"->",
"annotateNode",
"(",
"$",
"pReferenceTree",
",",
"$",
"pAnalysisTree",
",",
"$",
"pAnalysisTree",
"->",
"nodes",
"[",
... | Annotates surprise values at each node of the analysis tree
in context of the reference tree
@param SuffixTree $pReferenceTree Suffix tree of the reference time series
@param SuffixTree $pAnalysisTree Suffix tree of the time series under analysis | [
"Annotates",
"surprise",
"values",
"at",
"each",
"node",
"of",
"the",
"analysis",
"tree",
"in",
"context",
"of",
"the",
"reference",
"tree"
] | f42cb97300c9f8e87c66644ccc236309db2396e2 | https://github.com/rmatil/SAX/blob/f42cb97300c9f8e87c66644ccc236309db2396e2/lib/Sax/Sax.php#L379-L381 |
194,643 | bartonlp/site-class | includes/database-engines/ErrorClass.class.php | ErrorClass.init | public static function init($args=null) {
if(is_null(self::$instance)) {
self::$instance = new ErrorClass($args);
}
return self::$instance;
} | php | public static function init($args=null) {
if(is_null(self::$instance)) {
self::$instance = new ErrorClass($args);
}
return self::$instance;
} | [
"public",
"static",
"function",
"init",
"(",
"$",
"args",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"ErrorClass",
"(",
"$",
"args",
")",
";",
"}",
"r... | args can be array|object. noEmailErrs, development, noHtml, noOutput, errType | [
"args",
"can",
"be",
"array|object",
".",
"noEmailErrs",
"development",
"noHtml",
"noOutput",
"errType"
] | 9095b101701ef0ae12ea9a2b4587a18072d04438 | https://github.com/bartonlp/site-class/blob/9095b101701ef0ae12ea9a2b4587a18072d04438/includes/database-engines/ErrorClass.class.php#L239-L244 |
194,644 | taktwerk/tw-yii2-rest | CreateQueryHelper.php | CreateQueryHelper.createQuery | public static function createQuery($modelClass, $ignore=[])
{
$model = $modelClass::find();
$wheres = ['and'];
$filter_fields = self::getQueryParams($ignore);
$condition_transform_functions = self::conditionTransformFunctions();
foreach($filter_fields as $key => $value){
... | php | public static function createQuery($modelClass, $ignore=[])
{
$model = $modelClass::find();
$wheres = ['and'];
$filter_fields = self::getQueryParams($ignore);
$condition_transform_functions = self::conditionTransformFunctions();
foreach($filter_fields as $key => $value){
... | [
"public",
"static",
"function",
"createQuery",
"(",
"$",
"modelClass",
",",
"$",
"ignore",
"=",
"[",
"]",
")",
"{",
"$",
"model",
"=",
"$",
"modelClass",
"::",
"find",
"(",
")",
";",
"$",
"wheres",
"=",
"[",
"'and'",
"]",
";",
"$",
"filter_fields",
... | Create the query to check for relations and filtering
@param $modelClass
@param array $ignore
@return mixed | [
"Create",
"the",
"query",
"to",
"check",
"for",
"relations",
"and",
"filtering"
] | dd2102f134c3f4851c464473b95d430f310a895b | https://github.com/taktwerk/tw-yii2-rest/blob/dd2102f134c3f4851c464473b95d430f310a895b/CreateQueryHelper.php#L31-L74 |
194,645 | taktwerk/tw-yii2-rest | CreateQueryHelper.php | CreateQueryHelper.addOrderSort | public static function addOrderSort($sort, $table, &$query)
{
if (!empty($sort)) {
$sorts = explode(',', $sort);
foreach ($sorts as $sort) {
if (!strpos($sort, '.')) {
preg_match('/\w+\s+(DESC|ASC)/', $sort, $sort_field);
$type ... | php | public static function addOrderSort($sort, $table, &$query)
{
if (!empty($sort)) {
$sorts = explode(',', $sort);
foreach ($sorts as $sort) {
if (!strpos($sort, '.')) {
preg_match('/\w+\s+(DESC|ASC)/', $sort, $sort_field);
$type ... | [
"public",
"static",
"function",
"addOrderSort",
"(",
"$",
"sort",
",",
"$",
"table",
",",
"&",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"sort",
")",
")",
"{",
"$",
"sorts",
"=",
"explode",
"(",
"','",
",",
"$",
"sort",
")",
";... | Add a sort if there is a sort oder requested.
@param $sort
@param $table
@param $query | [
"Add",
"a",
"sort",
"if",
"there",
"is",
"a",
"sort",
"oder",
"requested",
"."
] | dd2102f134c3f4851c464473b95d430f310a895b | https://github.com/taktwerk/tw-yii2-rest/blob/dd2102f134c3f4851c464473b95d430f310a895b/CreateQueryHelper.php#L83-L106 |
194,646 | taktwerk/tw-yii2-rest | CreateQueryHelper.php | CreateQueryHelper.addGroup | public static function addGroup($group, $table, &$query)
{
if(!empty($group)) {
$groups = explode(',', $group);
foreach($groups as $group) {
if (!strpos($group, '.')) {
$query->groupBy($table . '.' . $group);
} else {
... | php | public static function addGroup($group, $table, &$query)
{
if(!empty($group)) {
$groups = explode(',', $group);
foreach($groups as $group) {
if (!strpos($group, '.')) {
$query->groupBy($table . '.' . $group);
} else {
... | [
"public",
"static",
"function",
"addGroup",
"(",
"$",
"group",
",",
"$",
"table",
",",
"&",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"group",
")",
")",
"{",
"$",
"groups",
"=",
"explode",
"(",
"','",
",",
"$",
"group",
")",
";... | Add a group by functionality to the query builder | [
"Add",
"a",
"group",
"by",
"functionality",
"to",
"the",
"query",
"builder"
] | dd2102f134c3f4851c464473b95d430f310a895b | https://github.com/taktwerk/tw-yii2-rest/blob/dd2102f134c3f4851c464473b95d430f310a895b/CreateQueryHelper.php#L208-L220 |
194,647 | kambalabs/KmbPmProxy | src/KmbPmProxy/Service/Environment.php | Environment.save | public function save(Model\EnvironmentInterface $environment, Model\EnvironmentInterface $cloneFrom = null)
{
$content = $this->getEnvironmentHydrator()->extract($environment);
if ($cloneFrom != null) {
$content['cloneFrom'] = strval($cloneFrom->getNormalizedName());
}
$t... | php | public function save(Model\EnvironmentInterface $environment, Model\EnvironmentInterface $cloneFrom = null)
{
$content = $this->getEnvironmentHydrator()->extract($environment);
if ($cloneFrom != null) {
$content['cloneFrom'] = strval($cloneFrom->getNormalizedName());
}
$t... | [
"public",
"function",
"save",
"(",
"Model",
"\\",
"EnvironmentInterface",
"$",
"environment",
",",
"Model",
"\\",
"EnvironmentInterface",
"$",
"cloneFrom",
"=",
"null",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getEnvironmentHydrator",
"(",
")",
"->",... | Create or update an environment on the Puppet Master
@param Model\EnvironmentInterface $environment
@param Model\EnvironmentInterface $cloneFrom
@return Environment
@throws RuntimeException | [
"Create",
"or",
"update",
"an",
"environment",
"on",
"the",
"Puppet",
"Master"
] | b4c664ae8b6f29e4e8768461ed99e1b0b80bde18 | https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Service/Environment.php#L44-L62 |
194,648 | kambalabs/KmbPmProxy | src/KmbPmProxy/Service/Environment.php | Environment.remove | public function remove(Model\EnvironmentInterface $environment)
{
$this->pmProxyClient->delete('/environments/' . $environment->getNormalizedName());
if ($environment->hasChildren()) {
foreach ($environment->getChildren() as $child) {
/** @var Model\EnvironmentInterface $... | php | public function remove(Model\EnvironmentInterface $environment)
{
$this->pmProxyClient->delete('/environments/' . $environment->getNormalizedName());
if ($environment->hasChildren()) {
foreach ($environment->getChildren() as $child) {
/** @var Model\EnvironmentInterface $... | [
"public",
"function",
"remove",
"(",
"Model",
"\\",
"EnvironmentInterface",
"$",
"environment",
")",
"{",
"$",
"this",
"->",
"pmProxyClient",
"->",
"delete",
"(",
"'/environments/'",
".",
"$",
"environment",
"->",
"getNormalizedName",
"(",
")",
")",
";",
"if",... | Remove an environment on the Puppet Master
@param Model\EnvironmentInterface $environment
@return Environment | [
"Remove",
"an",
"environment",
"on",
"the",
"Puppet",
"Master"
] | b4c664ae8b6f29e4e8768461ed99e1b0b80bde18 | https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Service/Environment.php#L70-L80 |
194,649 | SysControllers/Admin | src/app/Repositories/Admin/BaseRepo.php | BaseRepo.findIdUrl | public function findIdUrl($id, $url)
{
return $this->getModel()->where('id', $id)->where('slug_url', $url)->first();
} | php | public function findIdUrl($id, $url)
{
return $this->getModel()->where('id', $id)->where('slug_url', $url)->first();
} | [
"public",
"function",
"findIdUrl",
"(",
"$",
"id",
",",
"$",
"url",
")",
"{",
"return",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"where",
"(",
"'id'",
",",
"$",
"id",
")",
"->",
"where",
"(",
"'slug_url'",
",",
"$",
"url",
")",
"->",
"first... | BUSCAR POR ID Y URL | [
"BUSCAR",
"POR",
"ID",
"Y",
"URL"
] | 8f1df46aca422b87f2f522fbba610dcfa0c5f7f3 | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/src/app/Repositories/Admin/BaseRepo.php#L10-L13 |
194,650 | SysControllers/Admin | src/app/Repositories/Admin/BaseRepo.php | BaseRepo.orderByPagination | public function orderByPagination($field, $order, $value)
{
return $this->getModel()->orderBy($field, $order)->paginate($value);
} | php | public function orderByPagination($field, $order, $value)
{
return $this->getModel()->orderBy($field, $order)->paginate($value);
} | [
"public",
"function",
"orderByPagination",
"(",
"$",
"field",
",",
"$",
"order",
",",
"$",
"value",
")",
"{",
"return",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"orderBy",
"(",
"$",
"field",
",",
"$",
"order",
")",
"->",
"paginate",
"(",
"$",
... | ORDERNAR Y PAGINAR | [
"ORDERNAR",
"Y",
"PAGINAR"
] | 8f1df46aca422b87f2f522fbba610dcfa0c5f7f3 | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/src/app/Repositories/Admin/BaseRepo.php#L51-L54 |
194,651 | SysControllers/Admin | src/app/Repositories/Admin/BaseRepo.php | BaseRepo.findAndPaginateDeletes | public function findAndPaginateDeletes(Request $request)
{
return $this->getModel()
->onlyTrashed()
->titulo($request->get('titulo'))
->orderBy('deleted_at', 'desc')
->paginate();
} | php | public function findAndPaginateDeletes(Request $request)
{
return $this->getModel()
->onlyTrashed()
->titulo($request->get('titulo'))
->orderBy('deleted_at', 'desc')
->paginate();
} | [
"public",
"function",
"findAndPaginateDeletes",
"(",
"Request",
"$",
"request",
")",
"{",
"return",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"onlyTrashed",
"(",
")",
"->",
"titulo",
"(",
"$",
"request",
"->",
"get",
"(",
"'titulo'",
")",
")",
"->",... | BUSQUEDAS DE REGISTROS ELIMINADOS | [
"BUSQUEDAS",
"DE",
"REGISTROS",
"ELIMINADOS"
] | 8f1df46aca422b87f2f522fbba610dcfa0c5f7f3 | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/src/app/Repositories/Admin/BaseRepo.php#L96-L103 |
194,652 | the-eater/odango.php | src/AniDbTitles.php | AniDbTitles.construct | static function construct()
{
$aniDbTitles = new AniDbTitles();
$aniDbTitles->db = Registry::getDatabase();
$aniDbTitles->model = $aniDbTitles->db->factory('@' . $aniDbTitles->table);
return $aniDbTitles;
} | php | static function construct()
{
$aniDbTitles = new AniDbTitles();
$aniDbTitles->db = Registry::getDatabase();
$aniDbTitles->model = $aniDbTitles->db->factory('@' . $aniDbTitles->table);
return $aniDbTitles;
} | [
"static",
"function",
"construct",
"(",
")",
"{",
"$",
"aniDbTitles",
"=",
"new",
"AniDbTitles",
"(",
")",
";",
"$",
"aniDbTitles",
"->",
"db",
"=",
"Registry",
"::",
"getDatabase",
"(",
")",
";",
"$",
"aniDbTitles",
"->",
"model",
"=",
"$",
"aniDbTitles... | Creates a new AniDbTitles instance
@param array $dbInfo Array consisting of dsn, username and password, used to connect to the database where the anidbtitles are stored
@param string $table The table to store and access the cached anidb titles
@return AniDbTitles The created AniDbTitles instance | [
"Creates",
"a",
"new",
"AniDbTitles",
"instance"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/AniDbTitles.php#L23-L31 |
194,653 | the-eater/odango.php | src/AniDbTitles.php | AniDbTitles.syncDatabase | public function syncDatabase()
{
$tmpname = '/tmp/odango.php.cache';
if (!file_exists($tmpname)) {
$curl = new Curl();
$curl->setOpt(CURLOPT_ENCODING, "gzip");
$curl->download($this->titleDumpUrl, $tmpname);
$curl->close();
}
$this->db->exec('START TRANSACTION');
$this->d... | php | public function syncDatabase()
{
$tmpname = '/tmp/odango.php.cache';
if (!file_exists($tmpname)) {
$curl = new Curl();
$curl->setOpt(CURLOPT_ENCODING, "gzip");
$curl->download($this->titleDumpUrl, $tmpname);
$curl->close();
}
$this->db->exec('START TRANSACTION');
$this->d... | [
"public",
"function",
"syncDatabase",
"(",
")",
"{",
"$",
"tmpname",
"=",
"'/tmp/odango.php.cache'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"tmpname",
")",
")",
"{",
"$",
"curl",
"=",
"new",
"Curl",
"(",
")",
";",
"$",
"curl",
"->",
"setOpt",
... | Syncs the database with the up-to-date anidb title dump | [
"Syncs",
"the",
"database",
"with",
"the",
"up",
"-",
"to",
"-",
"date",
"anidb",
"title",
"dump"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/AniDbTitles.php#L36-L76 |
194,654 | the-eater/odango.php | src/AniDbTitles.php | AniDbTitles.getAlternativeTitles | public function getAlternativeTitles($title)
{
$builder = $this->db->builder();
return $builder
->select('search.title')
->from([$this->table . ' as main'])
->join($this->table . ' as search', 'main."aniDbId" = search."aniDbId"')
->where('main.title = :title')
->queryColumn([ 't... | php | public function getAlternativeTitles($title)
{
$builder = $this->db->builder();
return $builder
->select('search.title')
->from([$this->table . ' as main'])
->join($this->table . ' as search', 'main."aniDbId" = search."aniDbId"')
->where('main.title = :title')
->queryColumn([ 't... | [
"public",
"function",
"getAlternativeTitles",
"(",
"$",
"title",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"db",
"->",
"builder",
"(",
")",
";",
"return",
"$",
"builder",
"->",
"select",
"(",
"'search.title'",
")",
"->",
"from",
"(",
"[",
"$",
... | Gets all alternative titles for the title given
@param string $title The title to get alternative titles for
@return array Array consisting of alternative titles for given title | [
"Gets",
"all",
"alternative",
"titles",
"for",
"the",
"title",
"given"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/AniDbTitles.php#L83-L94 |
194,655 | eureka-framework/component-http | src/Http/Http.php | Http.add | public function add($name, $value = null)
{
if (empty($name)) {
return $this;
}
$params = (!is_array($name) ? array($name => $value) : $name);
$query = $this->query(true);
foreach ($params as $key => $val) {
if (empty($val)) {
unset(... | php | public function add($name, $value = null)
{
if (empty($name)) {
return $this;
}
$params = (!is_array($name) ? array($name => $value) : $name);
$query = $this->query(true);
foreach ($params as $key => $val) {
if (empty($val)) {
unset(... | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"params",
"=",
"(",
"!",
"is_array",
"(",
"$",
"name",
")",
"?... | Add, replace or remove parameters from query url.
@param mixed $name Array of parameter, or parameter name.
@param mixed $value Null if first parameter is array, else parameter value.
@return self | [
"Add",
"replace",
"or",
"remove",
"parameters",
"from",
"query",
"url",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Http.php#L41-L63 |
194,656 | eureka-framework/component-http | src/Http/Http.php | Http.init | public function init($url = null)
{
$url = (empty($url) ? Server::getInstance()->getCurrentUri() : $url);
$this->url = parse_url($url);
return $this;
} | php | public function init($url = null)
{
$url = (empty($url) ? Server::getInstance()->getCurrentUri() : $url);
$this->url = parse_url($url);
return $this;
} | [
"public",
"function",
"init",
"(",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"(",
"empty",
"(",
"$",
"url",
")",
"?",
"Server",
"::",
"getInstance",
"(",
")",
"->",
"getCurrentUri",
"(",
")",
":",
"$",
"url",
")",
";",
"$",
"this",
"-... | Initialize object properties.
@param string $url Url to parse. If null, get current url.
@return self | [
"Initialize",
"object",
"properties",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Http.php#L71-L77 |
194,657 | eureka-framework/component-http | src/Http/Http.php | Http.query | public function query($array = false)
{
$query = (!empty($this->url['query']) ? $this->url['query'] : '');
if ($array) {
parse_str($query, $query);
return $query;
} else {
return $query;
}
} | php | public function query($array = false)
{
$query = (!empty($this->url['query']) ? $this->url['query'] : '');
if ($array) {
parse_str($query, $query);
return $query;
} else {
return $query;
}
} | [
"public",
"function",
"query",
"(",
"$",
"array",
"=",
"false",
")",
"{",
"$",
"query",
"=",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"url",
"[",
"'query'",
"]",
")",
"?",
"$",
"this",
"->",
"url",
"[",
"'query'",
"]",
":",
"''",
")",
";",
... | Return query url.
@param bool $array If return array or string
@return mixed Query Url | [
"Return",
"query",
"url",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Http.php#L85-L96 |
194,658 | eureka-framework/component-http | src/Http/Http.php | Http.setPath | public function setPath($path, $type = 'replace', $replace = '')
{
$oldPath = (!empty($this->url['path']) ? $this->url['path'] : '');
switch ($type) {
case 'add':
$path = $oldPath . $path;
break;
case 'remove':
$path = str_repl... | php | public function setPath($path, $type = 'replace', $replace = '')
{
$oldPath = (!empty($this->url['path']) ? $this->url['path'] : '');
switch ($type) {
case 'add':
$path = $oldPath . $path;
break;
case 'remove':
$path = str_repl... | [
"public",
"function",
"setPath",
"(",
"$",
"path",
",",
"$",
"type",
"=",
"'replace'",
",",
"$",
"replace",
"=",
"''",
")",
"{",
"$",
"oldPath",
"=",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"url",
"[",
"'path'",
"]",
")",
"?",
"$",
"this",
"... | Add or replace path
@param string $path
@param string $type
@param string $replace
@return self | [
"Add",
"or",
"replace",
"path"
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Http.php#L106-L126 |
194,659 | eureka-framework/component-http | src/Http/Http.php | Http.uri | public function uri()
{
$uri = (!empty($this->url['scheme']) ? $this->url['scheme'] . '://' : Server::getInstance()->get('scheme', ''));
$uri .= (!empty($this->url['user']) ? $this->url['user'] . ':' . $this->url['pass'] . '@' : '');
$uri .= (!empty($this->url['host']) ? $this->url['host'] :... | php | public function uri()
{
$uri = (!empty($this->url['scheme']) ? $this->url['scheme'] . '://' : Server::getInstance()->get('scheme', ''));
$uri .= (!empty($this->url['user']) ? $this->url['user'] . ':' . $this->url['pass'] . '@' : '');
$uri .= (!empty($this->url['host']) ? $this->url['host'] :... | [
"public",
"function",
"uri",
"(",
")",
"{",
"$",
"uri",
"=",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"url",
"[",
"'scheme'",
"]",
")",
"?",
"$",
"this",
"->",
"url",
"[",
"'scheme'",
"]",
".",
"'://'",
":",
"Server",
"::",
"getInstance",
"(",
... | Get formatted uri.
@return string Current uri. | [
"Get",
"formatted",
"uri",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Http.php#L133-L144 |
194,660 | bytic/orm | src/AbstractModels/RecordManager.php | RecordManager.getUrlPK | public function getUrlPK()
{
if ($this->urlPK == null) {
$this->urlPK = $this->getPrimaryKey();
}
return $this->urlPK;
} | php | public function getUrlPK()
{
if ($this->urlPK == null) {
$this->urlPK = $this->getPrimaryKey();
}
return $this->urlPK;
} | [
"public",
"function",
"getUrlPK",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"urlPK",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"urlPK",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"urlPK",
";",
"}... | The name of the field used as a foreign key in other tables
@return string | [
"The",
"name",
"of",
"the",
"field",
"used",
"as",
"a",
"foreign",
"key",
"in",
"other",
"tables"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/AbstractModels/RecordManager.php#L413-L420 |
194,661 | LpFactory/NestedSetRoutingBundle | DependencyInjection/LpFactoryNestedSetRoutingExtension.php | LpFactoryNestedSetRoutingExtension.loadConfiguration | protected function loadConfiguration(array $config, ContainerBuilder $container)
{
// Load page nested routes
$routeConfigurationChain = $container->findDefinition('lp_factory.route_configuration.chain');
foreach ($config['routes'] as $alias => $routeConfiguration) {
$routeConfig... | php | protected function loadConfiguration(array $config, ContainerBuilder $container)
{
// Load page nested routes
$routeConfigurationChain = $container->findDefinition('lp_factory.route_configuration.chain');
foreach ($config['routes'] as $alias => $routeConfiguration) {
$routeConfig... | [
"protected",
"function",
"loadConfiguration",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Load page nested routes",
"$",
"routeConfigurationChain",
"=",
"$",
"container",
"->",
"findDefinition",
"(",
"'lp_factory.route_configurati... | Load configuration in container
@param array $config
@param ContainerBuilder $container | [
"Load",
"configuration",
"in",
"container"
] | dc07227a6764e657b7b321827a18127ec18ba214 | https://github.com/LpFactory/NestedSetRoutingBundle/blob/dc07227a6764e657b7b321827a18127ec18ba214/DependencyInjection/LpFactoryNestedSetRoutingExtension.php#L49-L71 |
194,662 | t3v/t3v_core | Classes/Service/QueryResultService.php | QueryResultService.filterByLanguagePresets | public function filterByLanguagePresets($queryResult, array $presets) {
$result = $queryResult;
if (!empty($presets)) {
$sysLanguageUid = $this->languageService->getSysLanguageUid();
$preset = intval($presets[$sysLanguageUid]);
if (isset($preset)) {
$result = [];
for... | php | public function filterByLanguagePresets($queryResult, array $presets) {
$result = $queryResult;
if (!empty($presets)) {
$sysLanguageUid = $this->languageService->getSysLanguageUid();
$preset = intval($presets[$sysLanguageUid]);
if (isset($preset)) {
$result = [];
for... | [
"public",
"function",
"filterByLanguagePresets",
"(",
"$",
"queryResult",
",",
"array",
"$",
"presets",
")",
"{",
"$",
"result",
"=",
"$",
"queryResult",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"presets",
")",
")",
"{",
"$",
"sysLanguageUid",
"=",
"$",
... | Filters a query result by language presets.
@param object $queryResult The query result
@param array $presets The language presets
@return object The filtered query result | [
"Filters",
"a",
"query",
"result",
"by",
"language",
"presets",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Service/QueryResultService.php#L38-L59 |
194,663 | t3v/t3v_core | Classes/Service/QueryResultService.php | QueryResultService.filterBySysLanguage | public function filterBySysLanguage($queryResult, $exceptions = []) {
$result = $queryResult;
if (is_string($exceptions)) {
$exceptions = GeneralUtility::intExplode(',', $exceptions, true);
}
$sysLanguageUid = $this->languageService->getSysLanguageUid();
if (!in_array($sysLanguageUid, $exce... | php | public function filterBySysLanguage($queryResult, $exceptions = []) {
$result = $queryResult;
if (is_string($exceptions)) {
$exceptions = GeneralUtility::intExplode(',', $exceptions, true);
}
$sysLanguageUid = $this->languageService->getSysLanguageUid();
if (!in_array($sysLanguageUid, $exce... | [
"public",
"function",
"filterBySysLanguage",
"(",
"$",
"queryResult",
",",
"$",
"exceptions",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"$",
"queryResult",
";",
"if",
"(",
"is_string",
"(",
"$",
"exceptions",
")",
")",
"{",
"$",
"exceptions",
"=",
"... | Filters a query result by system language.
@param object $queryResult The query result
@param array|string $exceptions The optional UIDs which are ignored as array or as string, seperated by `,`
@return object The filtered query result | [
"Filters",
"a",
"query",
"result",
"by",
"system",
"language",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Service/QueryResultService.php#L68-L90 |
194,664 | AlexyaFramework/Tools | Alexya/Tools/Session/Session.php | Session.deleteByKey | public function deleteByKey($name) : void
{
if(!$this->keyExists($name)) {
return;
}
parent::deleteByKey($name);
unset($_SESSION[$name]);
} | php | public function deleteByKey($name) : void
{
if(!$this->keyExists($name)) {
return;
}
parent::deleteByKey($name);
unset($_SESSION[$name]);
} | [
"public",
"function",
"deleteByKey",
"(",
"$",
"name",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"keyExists",
"(",
"$",
"name",
")",
")",
"{",
"return",
";",
"}",
"parent",
"::",
"deleteByKey",
"(",
"$",
"name",
")",
";",
"unset",
... | Removes a variable from the session.
@param mixed $name Variable name. | [
"Removes",
"a",
"variable",
"from",
"the",
"session",
"."
] | 2ae7c91cde0517579b926dd872eaf7ea324fd1e4 | https://github.com/AlexyaFramework/Tools/blob/2ae7c91cde0517579b926dd872eaf7ea324fd1e4/Alexya/Tools/Session/Session.php#L67-L75 |
194,665 | AlexyaFramework/Tools | Alexya/Tools/Session/Session.php | Session.set | public function set($name, $value) : void
{
$_SESSION[$name] = $value;
parent::set($name, $value);
} | php | public function set($name, $value) : void
{
$_SESSION[$name] = $value;
parent::set($name, $value);
} | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
":",
"void",
"{",
"$",
"_SESSION",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"parent",
"::",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}"
] | Sets a variable.
@param mixed $name Variable name.
@param mixed $value Variable value. | [
"Sets",
"a",
"variable",
"."
] | 2ae7c91cde0517579b926dd872eaf7ea324fd1e4 | https://github.com/AlexyaFramework/Tools/blob/2ae7c91cde0517579b926dd872eaf7ea324fd1e4/Alexya/Tools/Session/Session.php#L83-L88 |
194,666 | koolkode/context | src/AbstractContainer.php | AbstractContainer.initialize | public function initialize($object)
{
if($object instanceof ScopedProxyInterface)
{
return $object;
}
if($object instanceof ContainerAwareInterface)
{
$object->setContainer($this);
}
foreach($this->initializers as $initializer)
{
$object = $initializer->initializeObject($object, $this) ?:... | php | public function initialize($object)
{
if($object instanceof ScopedProxyInterface)
{
return $object;
}
if($object instanceof ContainerAwareInterface)
{
$object->setContainer($this);
}
foreach($this->initializers as $initializer)
{
$object = $initializer->initializeObject($object, $this) ?:... | [
"public",
"function",
"initialize",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"ScopedProxyInterface",
")",
"{",
"return",
"$",
"object",
";",
"}",
"if",
"(",
"$",
"object",
"instanceof",
"ContainerAwareInterface",
")",
"{",
"$",
... | Initialize the object by injection the DI container into aware objects and invoking
all container initializers passing the target object.
@param object $object The object to be initialized.
@return object The object instance that has been passed into the initializer. | [
"Initialize",
"the",
"object",
"by",
"injection",
"the",
"DI",
"container",
"into",
"aware",
"objects",
"and",
"invoking",
"all",
"container",
"initializers",
"passing",
"the",
"target",
"object",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/AbstractContainer.php#L178-L196 |
194,667 | koolkode/context | src/AbstractContainer.php | AbstractContainer.registerScope | public function registerScope(ScopeManagerInterface $scope)
{
if(isset($this->scopes[$scope->getScope()]))
{
throw new DuplicateScopeException(sprintf('Scope "%s" is already registered', $scope->getScope()));
}
$this->scopes[$scope->getScope()] = $scope;
$scope->correlate($this);
return $scope;... | php | public function registerScope(ScopeManagerInterface $scope)
{
if(isset($this->scopes[$scope->getScope()]))
{
throw new DuplicateScopeException(sprintf('Scope "%s" is already registered', $scope->getScope()));
}
$this->scopes[$scope->getScope()] = $scope;
$scope->correlate($this);
return $scope;... | [
"public",
"function",
"registerScope",
"(",
"ScopeManagerInterface",
"$",
"scope",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"scopes",
"[",
"$",
"scope",
"->",
"getScope",
"(",
")",
"]",
")",
")",
"{",
"throw",
"new",
"DuplicateScopeException",... | Register and correalate a scope with this DI container instance.
@param ScopeManagerInterface $scope The scope to be registered.
@return ScopeManagerInterface The registered scope.
@throws DuplicateScopeException When the scope is already registered with the container. | [
"Register",
"and",
"correalate",
"a",
"scope",
"with",
"this",
"DI",
"container",
"instance",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/AbstractContainer.php#L281-L293 |
194,668 | koolkode/context | src/AbstractContainer.php | AbstractContainer.invokeBindingInitializers | protected function invokeBindingInitializers($typeName, $object, $initializers = NULL)
{
foreach((array)$initializers as $initializer)
{
if(is_array($initializer))
{
$ref = new \ReflectionMethod(is_object($initializer[0]) ? get_class($initializer[0]) : $initializer[0], $initializer[1]);
}
else
{... | php | protected function invokeBindingInitializers($typeName, $object, $initializers = NULL)
{
foreach((array)$initializers as $initializer)
{
if(is_array($initializer))
{
$ref = new \ReflectionMethod(is_object($initializer[0]) ? get_class($initializer[0]) : $initializer[0], $initializer[1]);
}
else
{... | [
"protected",
"function",
"invokeBindingInitializers",
"(",
"$",
"typeName",
",",
"$",
"object",
",",
"$",
"initializers",
"=",
"NULL",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"initializers",
"as",
"$",
"initializer",
")",
"{",
"if",
"(",
"is_arra... | Invoke all passed initializers for the given object.
@param object $object The object to be initialized.
@param string $initializers Initializers to be called.
@return object Returns the passed object instance. | [
"Invoke",
"all",
"passed",
"initializers",
"for",
"the",
"given",
"object",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/AbstractContainer.php#L722-L760 |
194,669 | koolkode/context | src/AbstractContainer.php | AbstractContainer.getCallableName | protected function getCallableName(\ReflectionFunctionAbstract $ref)
{
if($ref instanceof \ReflectionMethod)
{
return $ref->getDeclaringClass()->name . '->' . $ref->name . '()';
}
if($ref->isClosure())
{
return '*closure*';
}
return $ref->getName() . '()';
} | php | protected function getCallableName(\ReflectionFunctionAbstract $ref)
{
if($ref instanceof \ReflectionMethod)
{
return $ref->getDeclaringClass()->name . '->' . $ref->name . '()';
}
if($ref->isClosure())
{
return '*closure*';
}
return $ref->getName() . '()';
} | [
"protected",
"function",
"getCallableName",
"(",
"\\",
"ReflectionFunctionAbstract",
"$",
"ref",
")",
"{",
"if",
"(",
"$",
"ref",
"instanceof",
"\\",
"ReflectionMethod",
")",
"{",
"return",
"$",
"ref",
"->",
"getDeclaringClass",
"(",
")",
"->",
"name",
".",
... | Get a human-readable name from a reflected callable.
@param \ReflectionFunctionAbstract $ref
@return string | [
"Get",
"a",
"human",
"-",
"readable",
"name",
"from",
"a",
"reflected",
"callable",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/AbstractContainer.php#L768-L781 |
194,670 | gplcart/authorize | Main.php | Main.getGateway | protected function getGateway()
{
/* @var $module \gplcart\modules\omnipay_library\Main */
$module = $this->module->getInstance('omnipay_library');
/** @var \Omnipay\AuthorizeNet\SIMGateway $gateway */
$gateway = $module->getGatewayInstance('AuthorizeNet_SIM');
if (!$gatewa... | php | protected function getGateway()
{
/* @var $module \gplcart\modules\omnipay_library\Main */
$module = $this->module->getInstance('omnipay_library');
/** @var \Omnipay\AuthorizeNet\SIMGateway $gateway */
$gateway = $module->getGatewayInstance('AuthorizeNet_SIM');
if (!$gatewa... | [
"protected",
"function",
"getGateway",
"(",
")",
"{",
"/* @var $module \\gplcart\\modules\\omnipay_library\\Main */",
"$",
"module",
"=",
"$",
"this",
"->",
"module",
"->",
"getInstance",
"(",
"'omnipay_library'",
")",
";",
"/** @var \\Omnipay\\AuthorizeNet\\SIMGateway $gatew... | Get gateway instance
@return \Omnipay\AuthorizeNet\SIMGateway
@throws UnexpectedValueException | [
"Get",
"gateway",
"instance"
] | 9118d4626c19f73408b80cfe57c7a686936c9d7a | https://github.com/gplcart/authorize/blob/9118d4626c19f73408b80cfe57c7a686936c9d7a/Main.php#L165-L178 |
194,671 | gplcart/authorize | Main.php | Main.cancelPurchase | protected function cancelPurchase()
{
$this->controller->setMessage($this->controller->text('Payment has been canceled'), 'warning');
$gateway_message = $this->response->getMessage();
if (!empty($gateway_message)) {
$this->controller->setMessage($gateway_message, 'warning');
... | php | protected function cancelPurchase()
{
$this->controller->setMessage($this->controller->text('Payment has been canceled'), 'warning');
$gateway_message = $this->response->getMessage();
if (!empty($gateway_message)) {
$this->controller->setMessage($gateway_message, 'warning');
... | [
"protected",
"function",
"cancelPurchase",
"(",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"setMessage",
"(",
"$",
"this",
"->",
"controller",
"->",
"text",
"(",
"'Payment has been canceled'",
")",
",",
"'warning'",
")",
";",
"$",
"gateway_message",
"=",... | Performs actions when a payment is canceled | [
"Performs",
"actions",
"when",
"a",
"payment",
"is",
"canceled"
] | 9118d4626c19f73408b80cfe57c7a686936c9d7a | https://github.com/gplcart/authorize/blob/9118d4626c19f73408b80cfe57c7a686936c9d7a/Main.php#L200-L207 |
194,672 | gplcart/authorize | Main.php | Main.getPurchaseParams | protected function getPurchaseParams()
{
$url = "checkout/complete/{$this->data_order['order_id']}";
return array(
'currency' => $this->data_order['currency'],
'amount' => $this->data_order['total_formatted_number'],
'returnUrl' => $this->controller->url($url, ar... | php | protected function getPurchaseParams()
{
$url = "checkout/complete/{$this->data_order['order_id']}";
return array(
'currency' => $this->data_order['currency'],
'amount' => $this->data_order['total_formatted_number'],
'returnUrl' => $this->controller->url($url, ar... | [
"protected",
"function",
"getPurchaseParams",
"(",
")",
"{",
"$",
"url",
"=",
"\"checkout/complete/{$this->data_order['order_id']}\"",
";",
"return",
"array",
"(",
"'currency'",
"=>",
"$",
"this",
"->",
"data_order",
"[",
"'currency'",
"]",
",",
"'amount'",
"=>",
... | Returns an array of purchase parameters
@return array | [
"Returns",
"an",
"array",
"of",
"purchase",
"parameters"
] | 9118d4626c19f73408b80cfe57c7a686936c9d7a | https://github.com/gplcart/authorize/blob/9118d4626c19f73408b80cfe57c7a686936c9d7a/Main.php#L234-L244 |
194,673 | gplcart/authorize | Main.php | Main.finishPurchase | protected function finishPurchase()
{
if ($this->response->isSuccessful()) {
$this->updateOrderStatus();
$this->addTransaction();
$this->redirectSuccess();
} else if ($this->response->isRedirect()) {
$this->response->redirect();
} else {
... | php | protected function finishPurchase()
{
if ($this->response->isSuccessful()) {
$this->updateOrderStatus();
$this->addTransaction();
$this->redirectSuccess();
} else if ($this->response->isRedirect()) {
$this->response->redirect();
} else {
... | [
"protected",
"function",
"finishPurchase",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"response",
"->",
"isSuccessful",
"(",
")",
")",
"{",
"$",
"this",
"->",
"updateOrderStatus",
"(",
")",
";",
"$",
"this",
"->",
"addTransaction",
"(",
")",
";",
"$"... | Performs final actions on success payment | [
"Performs",
"final",
"actions",
"on",
"success",
"payment"
] | 9118d4626c19f73408b80cfe57c7a686936c9d7a | https://github.com/gplcart/authorize/blob/9118d4626c19f73408b80cfe57c7a686936c9d7a/Main.php#L249-L260 |
194,674 | geoffadams/bedrest-core | library/BedRest/Content/Negotiation/MediaTypeList.php | MediaTypeList.getBestMatch | public function getBestMatch(array $formats)
{
foreach ($this->items as $item) {
if (in_array($item['media_range'], $formats)) {
return $item['media_range'];
}
}
return false;
} | php | public function getBestMatch(array $formats)
{
foreach ($this->items as $item) {
if (in_array($item['media_range'], $formats)) {
return $item['media_range'];
}
}
return false;
} | [
"public",
"function",
"getBestMatch",
"(",
"array",
"$",
"formats",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"item",
"[",
"'media_range'",
"]",
",",
"$",
"formats",
")",
")",
... | Returns the best format out of a list of supplied formats.
@param array $formats
@return string|boolean | [
"Returns",
"the",
"best",
"format",
"out",
"of",
"a",
"list",
"of",
"supplied",
"formats",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Content/Negotiation/MediaTypeList.php#L83-L92 |
194,675 | praxigento/mobi_mod_pv | Repo/Dao/Sale/Item.php | Item.getItemsByOrderId | public function getItemsByOrderId($orderId)
{
$result = [];
/* aliases and tables */
$asOrder = 'sale';
$asPvItem = 'pv';
$tblOrder = [$asOrder => $this->resource->getTableName(Cfg::ENTITY_MAGE_SALES_ORDER_ITEM)];
$tblPvItem = [$asPvItem => $this->resource->getTableNa... | php | public function getItemsByOrderId($orderId)
{
$result = [];
/* aliases and tables */
$asOrder = 'sale';
$asPvItem = 'pv';
$tblOrder = [$asOrder => $this->resource->getTableName(Cfg::ENTITY_MAGE_SALES_ORDER_ITEM)];
$tblPvItem = [$asPvItem => $this->resource->getTableNa... | [
"public",
"function",
"getItemsByOrderId",
"(",
"$",
"orderId",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"/* aliases and tables */",
"$",
"asOrder",
"=",
"'sale'",
";",
"$",
"asPvItem",
"=",
"'pv'",
";",
"$",
"tblOrder",
"=",
"[",
"$",
"asOrder",
"=>... | Get array of the PvSaleItems entities by Magento order ID.
@param int $orderId
@return Entity[] index is a $saleItemId | [
"Get",
"array",
"of",
"the",
"PvSaleItems",
"entities",
"by",
"Magento",
"order",
"ID",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Repo/Dao/Sale/Item.php#L71-L98 |
194,676 | Vibius/Facade | src/AliasManager.php | AliasManager.registerAutoloader | public function registerAutoloader(){
$aliasManager = $this;
spl_autoload_register(function($class) use($aliasManager) {
$class = strtolower($class);
if( !$aliasManager->checkIfAliasExists($class) ){
if( !$aliasManager->findAlias($class) ){
thr... | php | public function registerAutoloader(){
$aliasManager = $this;
spl_autoload_register(function($class) use($aliasManager) {
$class = strtolower($class);
if( !$aliasManager->checkIfAliasExists($class) ){
if( !$aliasManager->findAlias($class) ){
thr... | [
"public",
"function",
"registerAutoloader",
"(",
")",
"{",
"$",
"aliasManager",
"=",
"$",
"this",
";",
"spl_autoload_register",
"(",
"function",
"(",
"$",
"class",
")",
"use",
"(",
"$",
"aliasManager",
")",
"{",
"$",
"class",
"=",
"strtolower",
"(",
"$",
... | This method is used to register an alias autoloader, as an addition to composer. | [
"This",
"method",
"is",
"used",
"to",
"register",
"an",
"alias",
"autoloader",
"as",
"an",
"addition",
"to",
"composer",
"."
] | 2dac08bae098c436031b70f5a09abc365740aee0 | https://github.com/Vibius/Facade/blob/2dac08bae098c436031b70f5a09abc365740aee0/src/AliasManager.php#L40-L52 |
194,677 | Vibius/Facade | src/AliasManager.php | AliasManager.checkIfAliasExists | public function checkIfAliasExists($name){
if( isset($this->aliases[$name]) ){
return true;
}
$aliasPath = vibius_BASEPATH.$this->aliasCache.$name.".php";
if( file_exists($aliasPath) ){
$this->aliases[$name] = true;
return true;
}
} | php | public function checkIfAliasExists($name){
if( isset($this->aliases[$name]) ){
return true;
}
$aliasPath = vibius_BASEPATH.$this->aliasCache.$name.".php";
if( file_exists($aliasPath) ){
$this->aliases[$name] = true;
return true;
}
} | [
"public",
"function",
"checkIfAliasExists",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"aliasPath",
"=",
"vibius_BASEPATH",
".",
"$",
"this... | This method is used to check if alias exists in the cache
@param string $name Name of the alias to be checked
@return boolean True if alias exists in the cache | [
"This",
"method",
"is",
"used",
"to",
"check",
"if",
"alias",
"exists",
"in",
"the",
"cache"
] | 2dac08bae098c436031b70f5a09abc365740aee0 | https://github.com/Vibius/Facade/blob/2dac08bae098c436031b70f5a09abc365740aee0/src/AliasManager.php#L86-L97 |
194,678 | Vibius/Facade | src/AliasManager.php | AliasManager.findAlias | public function findAlias($class){
$container = Container::open('aliases');
if( $container->exists($class) ){
$instance = $container->get($class);
$config['provider'] = $instance;
if( is_object($instance) ){
Container::open('instances')... | php | public function findAlias($class){
$container = Container::open('aliases');
if( $container->exists($class) ){
$instance = $container->get($class);
$config['provider'] = $instance;
if( is_object($instance) ){
Container::open('instances')... | [
"public",
"function",
"findAlias",
"(",
"$",
"class",
")",
"{",
"$",
"container",
"=",
"Container",
"::",
"open",
"(",
"'aliases'",
")",
";",
"if",
"(",
"$",
"container",
"->",
"exists",
"(",
"$",
"class",
")",
")",
"{",
"$",
"instance",
"=",
"$",
... | This method is used to find a component from composer's psr4, which serves requested alias.
@param string $class Name of the alias to be looked for in psr4 autoloading array.
@return boolean True if alias was found and created. | [
"This",
"method",
"is",
"used",
"to",
"find",
"a",
"component",
"from",
"composer",
"s",
"psr4",
"which",
"serves",
"requested",
"alias",
"."
] | 2dac08bae098c436031b70f5a09abc365740aee0 | https://github.com/Vibius/Facade/blob/2dac08bae098c436031b70f5a09abc365740aee0/src/AliasManager.php#L120-L163 |
194,679 | Vibius/Facade | src/AliasManager.php | AliasManager.getAliasTemplate | public function getAliasTemplate(){
if( !isset($this->template) ){
$this->template = file_get_contents($this->path.'AliasTemplate.php');
}
return $this->template;
} | php | public function getAliasTemplate(){
if( !isset($this->template) ){
$this->template = file_get_contents($this->path.'AliasTemplate.php');
}
return $this->template;
} | [
"public",
"function",
"getAliasTemplate",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"$",
"this",
"->",
"template",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"path",
".",
"'AliasTemplate.php'",
")",... | Method is used to load a template for alias creation. | [
"Method",
"is",
"used",
"to",
"load",
"a",
"template",
"for",
"alias",
"creation",
"."
] | 2dac08bae098c436031b70f5a09abc365740aee0 | https://github.com/Vibius/Facade/blob/2dac08bae098c436031b70f5a09abc365740aee0/src/AliasManager.php#L168-L173 |
194,680 | Vibius/Facade | src/AliasManager.php | AliasManager.createAlias | public function createAlias($name, $config){
$handle = fopen(vibius_BASEPATH.$this->aliasCache.$name.'.php','w+');
if(!$handle){
throw new Exception('Unable to create alias, fopen not successful');
}
$template = $this->getAliasTemplate();
$template = str_replace('{$cl... | php | public function createAlias($name, $config){
$handle = fopen(vibius_BASEPATH.$this->aliasCache.$name.'.php','w+');
if(!$handle){
throw new Exception('Unable to create alias, fopen not successful');
}
$template = $this->getAliasTemplate();
$template = str_replace('{$cl... | [
"public",
"function",
"createAlias",
"(",
"$",
"name",
",",
"$",
"config",
")",
"{",
"$",
"handle",
"=",
"fopen",
"(",
"vibius_BASEPATH",
".",
"$",
"this",
"->",
"aliasCache",
".",
"$",
"name",
".",
"'.php'",
",",
"'w+'",
")",
";",
"if",
"(",
"!",
... | Method is used to create an alias, from specified parameters.
@param string $name Name of the alias to be created
@param string $config Configuration array of created alias | [
"Method",
"is",
"used",
"to",
"create",
"an",
"alias",
"from",
"specified",
"parameters",
"."
] | 2dac08bae098c436031b70f5a09abc365740aee0 | https://github.com/Vibius/Facade/blob/2dac08bae098c436031b70f5a09abc365740aee0/src/AliasManager.php#L180-L193 |
194,681 | dbisso/Hooker | src/Hooker.php | Hooker.hook | public function hook( $hooked_class = null, $hook_prefix = '' ) {
$this->hooked_class = $hooked_class;
$this->hook_prefix = $hook_prefix;
$this->class_reflector = new \ReflectionClass( $this->hooked_class );
$methods = $this->class_reflector->getMethods();
foreach ( $methods as $method ) {
$method_parts ... | php | public function hook( $hooked_class = null, $hook_prefix = '' ) {
$this->hooked_class = $hooked_class;
$this->hook_prefix = $hook_prefix;
$this->class_reflector = new \ReflectionClass( $this->hooked_class );
$methods = $this->class_reflector->getMethods();
foreach ( $methods as $method ) {
$method_parts ... | [
"public",
"function",
"hook",
"(",
"$",
"hooked_class",
"=",
"null",
",",
"$",
"hook_prefix",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"hooked_class",
"=",
"$",
"hooked_class",
";",
"$",
"this",
"->",
"hook_prefix",
"=",
"$",
"hook_prefix",
";",
"$",
"t... | Parses the methods and kicks of the hooking process
@param stdClass $hooked_class The class being hooked
@param string $hook_prefix Optional prefix for custom theme or plugin hooks
@return Hooker Returns the instance of the hooker class | [
"Parses",
"the",
"methods",
"and",
"kicks",
"of",
"the",
"hooking",
"process"
] | ecb6f0115e2d9932f16d004a17bca221918710a9 | https://github.com/dbisso/Hooker/blob/ecb6f0115e2d9932f16d004a17bca221918710a9/src/Hooker.php#L61-L102 |
194,682 | dbisso/Hooker | src/Hooker.php | Hooker.parse_method_name | private function parse_method_name( $name ){
if ( preg_match( '|^(_?[^_]+_)(.*)$|', $name, $matches ) ) {
$hook_type = trim( $matches[1], '_' ); //Methods prefixed with _ are always hooked
$hook_name = $matches[2];
if ( ! in_array( $hook_type , array( 'theme', 'action', 'filter', 'shortcode' ) ) ) {
ret... | php | private function parse_method_name( $name ){
if ( preg_match( '|^(_?[^_]+_)(.*)$|', $name, $matches ) ) {
$hook_type = trim( $matches[1], '_' ); //Methods prefixed with _ are always hooked
$hook_name = $matches[2];
if ( ! in_array( $hook_type , array( 'theme', 'action', 'filter', 'shortcode' ) ) ) {
ret... | [
"private",
"function",
"parse_method_name",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'|^(_?[^_]+_)(.*)$|'",
",",
"$",
"name",
",",
"$",
"matches",
")",
")",
"{",
"$",
"hook_type",
"=",
"trim",
"(",
"$",
"matches",
"[",
"1",
"]",
",",
... | Parse the method name to determine how to handle it
@param string $name Method name
@return mixed Array of hook type (action/filter/theme/shortcode)
or false if not a valid hook method | [
"Parse",
"the",
"method",
"name",
"to",
"determine",
"how",
"to",
"handle",
"it"
] | ecb6f0115e2d9932f16d004a17bca221918710a9 | https://github.com/dbisso/Hooker/blob/ecb6f0115e2d9932f16d004a17bca221918710a9/src/Hooker.php#L110-L123 |
194,683 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Image/AbstractImage.php | AbstractImage.getUserColor | public final function getUserColor( string $name )
{
if ( $this->disposed )
{
return null;
}
if ( ! isset( $this->colors[ $name ] ) )
{
throw new ArgumentError(
'$name',
$name,
'Drawing.Image',
'There is no user color w... | php | public final function getUserColor( string $name )
{
if ( $this->disposed )
{
return null;
}
if ( ! isset( $this->colors[ $name ] ) )
{
throw new ArgumentError(
'$name',
$name,
'Drawing.Image',
'There is no user color w... | [
"public",
"final",
"function",
"getUserColor",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"disposed",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"colors",
"[",
"$",
"name",
"]",
... | Returns the user defined color with defined name.
@param string $name The user defined color name.
@return \Beluga\Drawing\ColorGD
@throws \Beluga\ArgumentError | [
"Returns",
"the",
"user",
"defined",
"color",
"with",
"defined",
"name",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/AbstractImage.php#L153-L173 |
194,684 | anime-db/catalog-bundle | src/Service/Storage/ScanExecutor.php | ScanExecutor.export | public function export(StorageEntity $storage)
{
$output = sprintf($this->output, $storage->getId());
$progress = sprintf($this->progress, $storage->getId());
$this->fs->mkdir([dirname($output), dirname($progress)], 0755);
$this->fs->remove([$output, $progress]);
$this->fs->... | php | public function export(StorageEntity $storage)
{
$output = sprintf($this->output, $storage->getId());
$progress = sprintf($this->progress, $storage->getId());
$this->fs->mkdir([dirname($output), dirname($progress)], 0755);
$this->fs->remove([$output, $progress]);
$this->fs->... | [
"public",
"function",
"export",
"(",
"StorageEntity",
"$",
"storage",
")",
"{",
"$",
"output",
"=",
"sprintf",
"(",
"$",
"this",
"->",
"output",
",",
"$",
"storage",
"->",
"getId",
"(",
")",
")",
";",
"$",
"progress",
"=",
"sprintf",
"(",
"$",
"this"... | Scan storage in background and export progress and output.
@param StorageEntity $storage | [
"Scan",
"storage",
"in",
"background",
"and",
"export",
"progress",
"and",
"output",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Service/Storage/ScanExecutor.php#L62-L78 |
194,685 | geoffadams/bedrest-core | library/BedRest/Service/Mapping/ServiceMetadataFactory.php | ServiceMetadataFactory.getMetadataFor | public function getMetadataFor($className)
{
if (!$this->isService($className)) {
throw Exception::classIsNotMappedService($className);
}
if (!isset($this->loadedMetadata[$className])) {
$this->loadMetadata($className);
}
if ($this->cache) {
... | php | public function getMetadataFor($className)
{
if (!$this->isService($className)) {
throw Exception::classIsNotMappedService($className);
}
if (!isset($this->loadedMetadata[$className])) {
$this->loadMetadata($className);
}
if ($this->cache) {
... | [
"public",
"function",
"getMetadataFor",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isService",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"Exception",
"::",
"classIsNotMappedService",
"(",
"$",
"className",
")",
";",
"}",
"i... | Returns ServiceMetadata for the specified class.
@param string $className
@throws \BedRest\Service\Mapping\Exception
@return \BedRest\Service\Mapping\ServiceMetadata | [
"Returns",
"ServiceMetadata",
"for",
"the",
"specified",
"class",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Service/Mapping/ServiceMetadataFactory.php#L110-L134 |
194,686 | geoffadams/bedrest-core | library/BedRest/Service/Mapping/ServiceMetadataFactory.php | ServiceMetadataFactory.getAllMetadata | public function getAllMetadata()
{
foreach ($this->driver->getAllClassNames() as $className) {
if (!isset($this->loadedMetadata[$className])) {
$this->loadMetadata($className);
}
}
return $this->loadedMetadata;
} | php | public function getAllMetadata()
{
foreach ($this->driver->getAllClassNames() as $className) {
if (!isset($this->loadedMetadata[$className])) {
$this->loadMetadata($className);
}
}
return $this->loadedMetadata;
} | [
"public",
"function",
"getAllMetadata",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"driver",
"->",
"getAllClassNames",
"(",
")",
"as",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"loadedMetadata",
"[",
"$",
"clas... | Returns the entire collection of ServiceMetadata objects for all mapped services.
@return array | [
"Returns",
"the",
"entire",
"collection",
"of",
"ServiceMetadata",
"objects",
"for",
"all",
"mapped",
"services",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Service/Mapping/ServiceMetadataFactory.php#L141-L150 |
194,687 | geoffadams/bedrest-core | library/BedRest/Service/Mapping/ServiceMetadataFactory.php | ServiceMetadataFactory.loadMetadata | protected function loadMetadata($class)
{
// first run, we have no parent
$parent = null;
$parentClasses = $this->getParentClasses($class);
$parentClasses[] = $class;
// iterate through the list of mapped service parent classes
foreach ($parentClasses as $parentClas... | php | protected function loadMetadata($class)
{
// first run, we have no parent
$parent = null;
$parentClasses = $this->getParentClasses($class);
$parentClasses[] = $class;
// iterate through the list of mapped service parent classes
foreach ($parentClasses as $parentClas... | [
"protected",
"function",
"loadMetadata",
"(",
"$",
"class",
")",
"{",
"// first run, we have no parent",
"$",
"parent",
"=",
"null",
";",
"$",
"parentClasses",
"=",
"$",
"this",
"->",
"getParentClasses",
"(",
"$",
"class",
")",
";",
"$",
"parentClasses",
"[",
... | Loads the ServiceMetadata for the supplied class.
@param string $class | [
"Loads",
"the",
"ServiceMetadata",
"for",
"the",
"supplied",
"class",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Service/Mapping/ServiceMetadataFactory.php#L157-L185 |
194,688 | geoffadams/bedrest-core | library/BedRest/Service/Mapping/ServiceMetadataFactory.php | ServiceMetadataFactory.getParentClasses | protected function getParentClasses($className)
{
$parents = array();
foreach (array_reverse(class_parents($className)) as $class) {
if ($this->driver->isService($class)) {
$parents[] = $class;
}
}
return $parents;
} | php | protected function getParentClasses($className)
{
$parents = array();
foreach (array_reverse(class_parents($className)) as $class) {
if ($this->driver->isService($class)) {
$parents[] = $class;
}
}
return $parents;
} | [
"protected",
"function",
"getParentClasses",
"(",
"$",
"className",
")",
"{",
"$",
"parents",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_reverse",
"(",
"class_parents",
"(",
"$",
"className",
")",
")",
"as",
"$",
"class",
")",
"{",
"if",
"(",
... | Returns the list of parent service classes for the specified class.
@param string $className
@return array | [
"Returns",
"the",
"list",
"of",
"parent",
"service",
"classes",
"for",
"the",
"specified",
"class",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Service/Mapping/ServiceMetadataFactory.php#L204-L215 |
194,689 | translationexchange/tml-php-clientsdk | library/Tr8n/Cache/Base.php | Base.version | function version() {
if ($this->version == null) {
$this->version = intval($this->fetch(self::TR8N_VERSION_KEY, Config::instance()->configValue("cache.version", 1)));
}
return $this->version;
} | php | function version() {
if ($this->version == null) {
$this->version = intval($this->fetch(self::TR8N_VERSION_KEY, Config::instance()->configValue("cache.version", 1)));
}
return $this->version;
} | [
"function",
"version",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"version",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"version",
"=",
"intval",
"(",
"$",
"this",
"->",
"fetch",
"(",
"self",
"::",
"TR8N_VERSION_KEY",
",",
"Config",
"::",
"instance... | Returns current cache version
@return integer | [
"Returns",
"current",
"cache",
"version"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Cache/Base.php#L105-L110 |
194,690 | translationexchange/tml-php-clientsdk | library/Tr8n/Cache/Base.php | Base.versionedKey | function versionedKey($key) {
if ($key == self::TR8N_VERSION_KEY) return $key;
return self::TR8N_KEY_PREFIX . $this->version() . "_" . $key;
} | php | function versionedKey($key) {
if ($key == self::TR8N_VERSION_KEY) return $key;
return self::TR8N_KEY_PREFIX . $this->version() . "_" . $key;
} | [
"function",
"versionedKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"self",
"::",
"TR8N_VERSION_KEY",
")",
"return",
"$",
"key",
";",
"return",
"self",
"::",
"TR8N_KEY_PREFIX",
".",
"$",
"this",
"->",
"version",
"(",
")",
".",
"\"_\"",
... | Appends version to a key
@param string $key
@return string | [
"Appends",
"version",
"to",
"a",
"key"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Cache/Base.php#L127-L130 |
194,691 | froq/froq-validation | src/Validation.php | Validation.setFails | public function setFails(array $fails = null): void
{
if (!empty($fails)) {
foreach ($fails as $fieldName => $fail) {
$this->fails[$fieldName] = $fail;
}
}
} | php | public function setFails(array $fails = null): void
{
if (!empty($fails)) {
foreach ($fails as $fieldName => $fail) {
$this->fails[$fieldName] = $fail;
}
}
} | [
"public",
"function",
"setFails",
"(",
"array",
"$",
"fails",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"fails",
")",
")",
"{",
"foreach",
"(",
"$",
"fails",
"as",
"$",
"fieldName",
"=>",
"$",
"fail",
")",
"{",
"$",
... | Set fails.
@param array $fails
@return void | [
"Set",
"fails",
"."
] | 42727e1f3655ec94266bc36dcb328455c4a9ee87 | https://github.com/froq/froq-validation/blob/42727e1f3655ec94266bc36dcb328455c4a9ee87/src/Validation.php#L194-L201 |
194,692 | covex-nn/TwigCallableBridgeBundle | src/Covex/TwigCallableBridgeBundle/DependencyInjection/Configuration.php | Configuration.createExtensionNode | private function createExtensionNode(ArrayNodeDefinition $rootNode, $name, $validator)
{
$rootNode
->children()
/**/->arrayNode($name)
/* */->addDefaultChildrenIfNoneSet(array())
/* */->requiresAtLeastOneElement()
/* */->useAttributeAsKey('name')
/* */->prototype('variable'... | php | private function createExtensionNode(ArrayNodeDefinition $rootNode, $name, $validator)
{
$rootNode
->children()
/**/->arrayNode($name)
/* */->addDefaultChildrenIfNoneSet(array())
/* */->requiresAtLeastOneElement()
/* */->useAttributeAsKey('name')
/* */->prototype('variable'... | [
"private",
"function",
"createExtensionNode",
"(",
"ArrayNodeDefinition",
"$",
"rootNode",
",",
"$",
"name",
",",
"$",
"validator",
")",
"{",
"$",
"rootNode",
"->",
"children",
"(",
")",
"/**/",
"->",
"arrayNode",
"(",
"$",
"name",
")",
"/* */",
"->",
"ad... | Create configuration section
@param ArrayNodeDefinition $rootNode Root node
@param string $name New configuration section name
@param callable $validator Config value validator
@return null | [
"Create",
"configuration",
"section"
] | 2e79f06158182522fd3c6b64c3ac907239a576bf | https://github.com/covex-nn/TwigCallableBridgeBundle/blob/2e79f06158182522fd3c6b64c3ac907239a576bf/src/Covex/TwigCallableBridgeBundle/DependencyInjection/Configuration.php#L47-L63 |
194,693 | clacy-builders/graphics-php | src/Point.php | Point.rotate | public function rotate(Point $center, Angle $angle)
{
$x = $this->x - $center->x;
$y = $this->y - $center->y;
$this->x = $x * $angle->cos - $y * $angle->sin + $center->x;
$this->y = $y * $angle->cos + $x * $angle->sin + $center->y;
return $this;
} | php | public function rotate(Point $center, Angle $angle)
{
$x = $this->x - $center->x;
$y = $this->y - $center->y;
$this->x = $x * $angle->cos - $y * $angle->sin + $center->x;
$this->y = $y * $angle->cos + $x * $angle->sin + $center->y;
return $this;
} | [
"public",
"function",
"rotate",
"(",
"Point",
"$",
"center",
",",
"Angle",
"$",
"angle",
")",
"{",
"$",
"x",
"=",
"$",
"this",
"->",
"x",
"-",
"$",
"center",
"->",
"x",
";",
"$",
"y",
"=",
"$",
"this",
"->",
"y",
"-",
"$",
"center",
"->",
"y"... | Rotates current point clockwise.
@param Point $center
@param Angle $angle
@return Point | [
"Rotates",
"current",
"point",
"clockwise",
"."
] | c56556c9265ea4537efdc14ae89a8f36454812d9 | https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Point.php#L33-L40 |
194,694 | RichardTrujilloTorres/validators | src/Validators/Traits/NumericalComparisonsTrait.php | NumericalComparisonsTrait.min | public function min($limit)
{
$result = $this->compare($limit, '<');
$this->setValid($result);
return $this;
} | php | public function min($limit)
{
$result = $this->compare($limit, '<');
$this->setValid($result);
return $this;
} | [
"public",
"function",
"min",
"(",
"$",
"limit",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"compare",
"(",
"$",
"limit",
",",
"'<'",
")",
";",
"$",
"this",
"->",
"setValid",
"(",
"$",
"result",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the minimum limit.
@param numerical $limit The limit
@return $self | [
"Sets",
"the",
"minimum",
"limit",
"."
] | e29ff479d816c3f8a931bfbefedd0642dc50ea91 | https://github.com/RichardTrujilloTorres/validators/blob/e29ff479d816c3f8a931bfbefedd0642dc50ea91/src/Validators/Traits/NumericalComparisonsTrait.php#L17-L23 |
194,695 | RichardTrujilloTorres/validators | src/Validators/Traits/NumericalComparisonsTrait.php | NumericalComparisonsTrait.max | public function max($limit)
{
$result = $this->compare($limit, '>');
$this->setValid($result);
return $this;
} | php | public function max($limit)
{
$result = $this->compare($limit, '>');
$this->setValid($result);
return $this;
} | [
"public",
"function",
"max",
"(",
"$",
"limit",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"compare",
"(",
"$",
"limit",
",",
"'>'",
")",
";",
"$",
"this",
"->",
"setValid",
"(",
"$",
"result",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the maximum limit.
@param numerical $limit The limit
@return $self | [
"Sets",
"the",
"maximum",
"limit",
"."
] | e29ff479d816c3f8a931bfbefedd0642dc50ea91 | https://github.com/RichardTrujilloTorres/validators/blob/e29ff479d816c3f8a931bfbefedd0642dc50ea91/src/Validators/Traits/NumericalComparisonsTrait.php#L32-L38 |
194,696 | ARCANESOFT/Auth | src/Providers/RouteServiceProvider.php | RouteServiceProvider.mapAdminRoutes | protected function mapAdminRoutes()
{
Routes\Admin\ProfileRoutes::register();
$this->prefix($this->config()->get('arcanesoft.auth.route.prefix', 'authorization'))
->group(function () {
Routes\Admin\StatsRoutes::register();
Routes\Admin\UsersRoutes::reg... | php | protected function mapAdminRoutes()
{
Routes\Admin\ProfileRoutes::register();
$this->prefix($this->config()->get('arcanesoft.auth.route.prefix', 'authorization'))
->group(function () {
Routes\Admin\StatsRoutes::register();
Routes\Admin\UsersRoutes::reg... | [
"protected",
"function",
"mapAdminRoutes",
"(",
")",
"{",
"Routes",
"\\",
"Admin",
"\\",
"ProfileRoutes",
"::",
"register",
"(",
")",
";",
"$",
"this",
"->",
"prefix",
"(",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"get",
"(",
"'arcanesoft.auth.route.pr... | Define the foundation routes for the application. | [
"Define",
"the",
"foundation",
"routes",
"for",
"the",
"application",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Providers/RouteServiceProvider.php#L52-L64 |
194,697 | sndsgd/error | src/Error.php | Error.createMessage | public static function createMessage(string $message): string
{
$lastErrorMessage = error_get_last();
if ($lastErrorMessage !== null) {
$message .= "; ".$lastErrorMessage["message"];
}
return $message;
} | php | public static function createMessage(string $message): string
{
$lastErrorMessage = error_get_last();
if ($lastErrorMessage !== null) {
$message .= "; ".$lastErrorMessage["message"];
}
return $message;
} | [
"public",
"static",
"function",
"createMessage",
"(",
"string",
"$",
"message",
")",
":",
"string",
"{",
"$",
"lastErrorMessage",
"=",
"error_get_last",
"(",
")",
";",
"if",
"(",
"$",
"lastErrorMessage",
"!==",
"null",
")",
"{",
"$",
"message",
".=",
"\"; ... | Append a message with the message from the last encountered error
@param string $message The message to append
@return string | [
"Append",
"a",
"message",
"with",
"the",
"message",
"from",
"the",
"last",
"encountered",
"error"
] | 5393b06cd654f826db2b0eb212ea0ae6f9365e56 | https://github.com/sndsgd/error/blob/5393b06cd654f826db2b0eb212ea0ae6f9365e56/src/Error.php#L13-L20 |
194,698 | dms-org/common.structure | src/DateTime/TimeOfDay.php | TimeOfDay.fromNative | public static function fromNative(\DateTimeInterface $dateTime) : TimeOfDay
{
return new self((int)$dateTime->format('H'), (int)$dateTime->format('i'), (int)$dateTime->format('s'));
} | php | public static function fromNative(\DateTimeInterface $dateTime) : TimeOfDay
{
return new self((int)$dateTime->format('H'), (int)$dateTime->format('i'), (int)$dateTime->format('s'));
} | [
"public",
"static",
"function",
"fromNative",
"(",
"\\",
"DateTimeInterface",
"$",
"dateTime",
")",
":",
"TimeOfDay",
"{",
"return",
"new",
"self",
"(",
"(",
"int",
")",
"$",
"dateTime",
"->",
"format",
"(",
"'H'",
")",
",",
"(",
"int",
")",
"$",
"date... | Creates a time object from the time part of the supplied date time.
@param \DateTimeInterface $dateTime
@return TimeOfDay | [
"Creates",
"a",
"time",
"object",
"from",
"the",
"time",
"part",
"of",
"the",
"supplied",
"date",
"time",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimeOfDay.php#L48-L51 |
194,699 | dms-org/common.structure | src/DateTime/TimeOfDay.php | TimeOfDay.fromFormat | public static function fromFormat(string $format, string $timeString) : TimeOfDay
{
return self::fromNative(\DateTimeImmutable::createFromFormat($format, $timeString));
} | php | public static function fromFormat(string $format, string $timeString) : TimeOfDay
{
return self::fromNative(\DateTimeImmutable::createFromFormat($format, $timeString));
} | [
"public",
"static",
"function",
"fromFormat",
"(",
"string",
"$",
"format",
",",
"string",
"$",
"timeString",
")",
":",
"TimeOfDay",
"{",
"return",
"self",
"::",
"fromNative",
"(",
"\\",
"DateTimeImmutable",
"::",
"createFromFormat",
"(",
"$",
"format",
",",
... | Creates a time object from the supplied format string
@param string $format
@param string $timeString
@return TimeOfDay | [
"Creates",
"a",
"time",
"object",
"from",
"the",
"supplied",
"format",
"string"
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimeOfDay.php#L61-L64 |
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.