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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
189,300 | lazyjsonmapper/lazyjsonmapper | src/Property/PropertyMapCompiler.php | PropertyMapCompiler._importClassMap | private function _importClassMap(
$strictImportClassName)
{
// Begin via reflection to resolve the EXACT name of the class they want
// to import, so that we can trust its name completely.
try {
// NOTE: The strict, global "\"-name is necessary here, to guarantee
... | php | private function _importClassMap(
$strictImportClassName)
{
// Begin via reflection to resolve the EXACT name of the class they want
// to import, so that we can trust its name completely.
try {
// NOTE: The strict, global "\"-name is necessary here, to guarantee
... | [
"private",
"function",
"_importClassMap",
"(",
"$",
"strictImportClassName",
")",
"{",
"// Begin via reflection to resolve the EXACT name of the class they want",
"// to import, so that we can trust its name completely.",
"try",
"{",
"// NOTE: The strict, global \"\\\"-name is necessary here... | Import another class map into the current class.
@param string $strictImportClassName The strict, global path to the
class, with leading backslash `\`.
To save time, we assume the caller
has already verified that it is a
valid `LazyJsonMapper` class.
@throws BadPropertyDefinitionException
@throws BadPropertyMapExcept... | [
"Import",
"another",
"class",
"map",
"into",
"the",
"current",
"class",
"."
] | 51e093b50f4de15d2d64548b3ca743713eed6ee9 | https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L1064-L1216 |
189,301 | lazyjsonmapper/lazyjsonmapper | src/Property/PropertyMapCompiler.php | PropertyMapCompiler._subcompile | private function _subcompile(
$className)
{
// Sub-compile the target class. If this DOESN'T throw, we know that the
// target class successfully exists in the compilation cache afterwards.
// NOTE: If it throws, we know that IT has already rolled back all its
// changes itse... | php | private function _subcompile(
$className)
{
// Sub-compile the target class. If this DOESN'T throw, we know that the
// target class successfully exists in the compilation cache afterwards.
// NOTE: If it throws, we know that IT has already rolled back all its
// changes itse... | [
"private",
"function",
"_subcompile",
"(",
"$",
"className",
")",
"{",
"// Sub-compile the target class. If this DOESN'T throw, we know that the",
"// target class successfully exists in the compilation cache afterwards.",
"// NOTE: If it throws, we know that IT has already rolled back all its",... | Used internally when this compiler needs to run a sub-compilation.
Performs the sub-compile. And if it was successful (meaning it had no
auto-rollbacks due to ITS `compile()` call failing), then we'll merge its
compiler state with our own so that we preserve important state details.
@param string $className The full ... | [
"Used",
"internally",
"when",
"this",
"compiler",
"needs",
"to",
"run",
"a",
"sub",
"-",
"compilation",
"."
] | 51e093b50f4de15d2d64548b3ca743713eed6ee9 | https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L1234-L1273 |
189,302 | lazyjsonmapper/lazyjsonmapper | src/Magic/FunctionTranslation.php | FunctionTranslation.splitFunctionName | public static function splitFunctionName(
$functionName)
{
// Split the input on the FIRST encountered NON-LOWERCAZE ("a-z")
// character. And allow empty splits (that's important). Because of the
// fact that it splits on non-lowercase character types, it means that
// if th... | php | public static function splitFunctionName(
$functionName)
{
// Split the input on the FIRST encountered NON-LOWERCAZE ("a-z")
// character. And allow empty splits (that's important). Because of the
// fact that it splits on non-lowercase character types, it means that
// if th... | [
"public",
"static",
"function",
"splitFunctionName",
"(",
"$",
"functionName",
")",
"{",
"// Split the input on the FIRST encountered NON-LOWERCAZE (\"a-z\")",
"// character. And allow empty splits (that's important). Because of the",
"// fact that it splits on non-lowercase character types, i... | Split a function name into its function-type and FuncCase components.
This helper function takes care of splitting a full function name, such
as `getSomeVariable`, into `get` (its function type) and `SomeVariable`
(the valid input format for the FunctionTranslation constructor).
Call it from your own code before cons... | [
"Split",
"a",
"function",
"name",
"into",
"its",
"function",
"-",
"type",
"and",
"FuncCase",
"components",
"."
] | 51e093b50f4de15d2d64548b3ca743713eed6ee9 | https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Magic/FunctionTranslation.php#L165-L206 |
189,303 | lazyjsonmapper/lazyjsonmapper | src/Magic/FunctionTranslation.php | FunctionTranslation._funcCaseToProperties | protected function _funcCaseToProperties(
$funcCase)
{
// This algorithm is the exact inverse of PropertyTranslation.
// Read that class for more information.
// There's nothing to do if the input is empty...
if (!strlen($funcCase)) {
return false;
}
... | php | protected function _funcCaseToProperties(
$funcCase)
{
// This algorithm is the exact inverse of PropertyTranslation.
// Read that class for more information.
// There's nothing to do if the input is empty...
if (!strlen($funcCase)) {
return false;
}
... | [
"protected",
"function",
"_funcCaseToProperties",
"(",
"$",
"funcCase",
")",
"{",
"// This algorithm is the exact inverse of PropertyTranslation.",
"// Read that class for more information.",
"// There's nothing to do if the input is empty...",
"if",
"(",
"!",
"strlen",
"(",
"$",
"... | Converts a FunctionCase name to snake and camel properties.
See input/output examples in class documentation above.
@param string $funcCase
@return array|bool Associative array with `snake` & `camel` elements if
successful, otherwise `FALSE`. | [
"Converts",
"a",
"FunctionCase",
"name",
"to",
"snake",
"and",
"camel",
"properties",
"."
] | 51e093b50f4de15d2d64548b3ca743713eed6ee9 | https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Magic/FunctionTranslation.php#L218-L313 |
189,304 | gregoriohc/laravel-trello | src/Wrapper.php | Wrapper.manager | public function manager()
{
if (!isset($this->manager)) {
$this->manager = new Manager($this->client);
}
return $this->manager;
} | php | public function manager()
{
if (!isset($this->manager)) {
$this->manager = new Manager($this->client);
}
return $this->manager;
} | [
"public",
"function",
"manager",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"manager",
")",
")",
"{",
"$",
"this",
"->",
"manager",
"=",
"new",
"Manager",
"(",
"$",
"this",
"->",
"client",
")",
";",
"}",
"return",
"$",
"this"... | Returns trello manager instance
@return \Trello\Manager | [
"Returns",
"trello",
"manager",
"instance"
] | 14e3c32d7b67d717ed8b539eb43fe7942452bc5a | https://github.com/gregoriohc/laravel-trello/blob/14e3c32d7b67d717ed8b539eb43fe7942452bc5a/src/Wrapper.php#L59-L66 |
189,305 | etsy/phpunit-extensions | src/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php | ArrayHasKeyValuePair.toString | public function toString(): string
{
return 'has the key ' . $this->exporter->export($this->key) .
' with the value ' . $this->exporter->export($this->value);
} | php | public function toString(): string
{
return 'has the key ' . $this->exporter->export($this->key) .
' with the value ' . $this->exporter->export($this->value);
} | [
"public",
"function",
"toString",
"(",
")",
":",
"string",
"{",
"return",
"'has the key '",
".",
"$",
"this",
"->",
"exporter",
"->",
"export",
"(",
"$",
"this",
"->",
"key",
")",
".",
"' with the value '",
".",
"$",
"this",
"->",
"exporter",
"->",
"expo... | Returns a string representation of the constraint.
@return string | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"constraint",
"."
] | e82d23e794bd76499f938dcd0c90b09d6a63b405 | https://github.com/etsy/phpunit-extensions/blob/e82d23e794bd76499f938dcd0c90b09d6a63b405/src/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php#L56-L60 |
189,306 | phalcon-ext/mailer | src/Manager.php | Manager.createMessageFromView | public function createMessageFromView($view, $params = [], $viewsDir = null)
{
$message = $this->createMessage();
$message->content($this->renderView($view, $params, $viewsDir), $message::CONTENT_TYPE_HTML);
return $message;
} | php | public function createMessageFromView($view, $params = [], $viewsDir = null)
{
$message = $this->createMessage();
$message->content($this->renderView($view, $params, $viewsDir), $message::CONTENT_TYPE_HTML);
return $message;
} | [
"public",
"function",
"createMessageFromView",
"(",
"$",
"view",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"viewsDir",
"=",
"null",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"createMessage",
"(",
")",
";",
"$",
"message",
"->",
"content",
... | Create a new Message instance.
For the body of the message uses the result of render of view
Events:
- mailer:beforeCreateMessage
- mailer:afterCreateMessage
@param string $view
@param array $params optional
@param null|string $viewsDir optional
@return \Phalcon\Ext\Mailer\Message
@see \Phalcon\Ext\Mailer\Manager::... | [
"Create",
"a",
"new",
"Message",
"instance",
".",
"For",
"the",
"body",
"of",
"the",
"message",
"uses",
"the",
"result",
"of",
"render",
"of",
"view"
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Manager.php#L112-L118 |
189,307 | phalcon-ext/mailer | src/Manager.php | Manager.registerSwiftTransport | protected function registerSwiftTransport()
{
switch ($driver = $this->getConfig('driver')) {
case 'smtp':
$this->transport = $this->registerTransportSmtp();
break;
case 'mail':
$this->transport = $this->registerTransportMail();
... | php | protected function registerSwiftTransport()
{
switch ($driver = $this->getConfig('driver')) {
case 'smtp':
$this->transport = $this->registerTransportSmtp();
break;
case 'mail':
$this->transport = $this->registerTransportMail();
... | [
"protected",
"function",
"registerSwiftTransport",
"(",
")",
"{",
"switch",
"(",
"$",
"driver",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'driver'",
")",
")",
"{",
"case",
"'smtp'",
":",
"$",
"this",
"->",
"transport",
"=",
"$",
"this",
"->",
"registerT... | Create a new Driver-mail of SwiftTransport instance.
Supported driver-mail:
- smtp
- sendmail
- mail | [
"Create",
"a",
"new",
"Driver",
"-",
"mail",
"of",
"SwiftTransport",
"instance",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Manager.php#L178-L196 |
189,308 | phalcon-ext/mailer | src/Manager.php | Manager.registerTransportSmtp | protected function registerTransportSmtp()
{
$config = $this->getConfig();
/** @var $transport \Swift_SmtpTransport: */
$transport = $this->getDI()->get('\Swift_SmtpTransport');
if (isset($config['encryption'])) {
$transport->setEncryption($config['encryption']);
... | php | protected function registerTransportSmtp()
{
$config = $this->getConfig();
/** @var $transport \Swift_SmtpTransport: */
$transport = $this->getDI()->get('\Swift_SmtpTransport');
if (isset($config['encryption'])) {
$transport->setEncryption($config['encryption']);
... | [
"protected",
"function",
"registerTransportSmtp",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"/** @var $transport \\Swift_SmtpTransport: */",
"$",
"transport",
"=",
"$",
"this",
"->",
"getDI",
"(",
")",
"->",
"get",
"(",
... | Create a new SmtpTransport instance.
@return \Swift_SmtpTransport
@see \Swift_SmtpTransport | [
"Create",
"a",
"new",
"SmtpTransport",
"instance",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Manager.php#L205-L252 |
189,309 | etsy/phpunit-extensions | src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php | Builder.setDefault | public function setDefault($default) {
$entry_builder =
new EntryBuilder();
$entry_builder
->with($this->anything())
->will($default);
$this->default_entry = $entry_builder->build();
return $this;
} | php | public function setDefault($default) {
$entry_builder =
new EntryBuilder();
$entry_builder
->with($this->anything())
->will($default);
$this->default_entry = $entry_builder->build();
return $this;
} | [
"public",
"function",
"setDefault",
"(",
"$",
"default",
")",
"{",
"$",
"entry_builder",
"=",
"new",
"EntryBuilder",
"(",
")",
";",
"$",
"entry_builder",
"->",
"with",
"(",
"$",
"this",
"->",
"anything",
"(",
")",
")",
"->",
"will",
"(",
"$",
"default"... | Sets the default return value.
@param PHPUnit_Extensions_MockObject_Stub|mixed $default the default
return value.
@return Builder | [
"Sets",
"the",
"default",
"return",
"value",
"."
] | e82d23e794bd76499f938dcd0c90b09d6a63b405 | https://github.com/etsy/phpunit-extensions/blob/e82d23e794bd76499f938dcd0c90b09d6a63b405/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php#L34-L44 |
189,310 | phalcon-ext/mailer | src/Message.php | Message.replyTo | public function replyTo($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setReplyTo($email, $name);
return $this;
} | php | public function replyTo($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setReplyTo($email, $name);
return $this;
} | [
"public",
"function",
"replyTo",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"normalizeEmail",
"(",
"$",
"email",
")",
";",
"$",
"this",
"->",
"getSwiftMessage",
"(",
")",
"->",
"setReplyTo",
"(",... | Set the reply-to address of this message.
You may pass an array of addresses if replies will go to multiple people.
Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be
associated with the address.
@param string|array $email
@... | [
"Set",
"the",
"reply",
"-",
"to",
"address",
"of",
"this",
"message",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L110-L116 |
189,311 | phalcon-ext/mailer | src/Message.php | Message.to | public function to($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setTo($email, $name);
return $this;
} | php | public function to($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setTo($email, $name);
return $this;
} | [
"public",
"function",
"to",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"normalizeEmail",
"(",
"$",
"email",
")",
";",
"$",
"this",
"->",
"getSwiftMessage",
"(",
")",
"->",
"setTo",
"(",
"$",
... | Set the to addresses of this message.
If multiple recipients will receive the message an array should be used.
Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be
associated with the address.
@param string|array $email
@param... | [
"Set",
"the",
"to",
"addresses",
"of",
"this",
"message",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L146-L152 |
189,312 | phalcon-ext/mailer | src/Message.php | Message.cc | public function cc($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setCc($email, $name);
return $this;
} | php | public function cc($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setCc($email, $name);
return $this;
} | [
"public",
"function",
"cc",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"normalizeEmail",
"(",
"$",
"email",
")",
";",
"$",
"this",
"->",
"getSwiftMessage",
"(",
")",
"->",
"setCc",
"(",
"$",
... | Set the Cc addresses of this message.
If multiple recipients will receive the message an array should be used.
Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be
associated with the address.
@param string|array $email
@param... | [
"Set",
"the",
"Cc",
"addresses",
"of",
"this",
"message",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L182-L188 |
189,313 | phalcon-ext/mailer | src/Message.php | Message.bcc | public function bcc($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setBcc($email, $name);
return $this;
} | php | public function bcc($email, $name = null)
{
$email = $this->normalizeEmail($email);
$this->getSwiftMessage()->setBcc($email, $name);
return $this;
} | [
"public",
"function",
"bcc",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"normalizeEmail",
"(",
"$",
"email",
")",
";",
"$",
"this",
"->",
"getSwiftMessage",
"(",
")",
"->",
"setBcc",
"(",
"$",
... | Set the Bcc addresses of this message.
If multiple recipients will receive the message an array should be used.
Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be
associated with the address.
@param string|array $email
@para... | [
"Set",
"the",
"Bcc",
"addresses",
"of",
"this",
"message",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L218-L224 |
189,314 | phalcon-ext/mailer | src/Message.php | Message.contentAlternative | public function contentAlternative($content, $contentType = null, $charset = null)
{
$this->getSwiftMessage()->addPart($content, $contentType, $charset);
return $this;
} | php | public function contentAlternative($content, $contentType = null, $charset = null)
{
$this->getSwiftMessage()->addPart($content, $contentType, $charset);
return $this;
} | [
"public",
"function",
"contentAlternative",
"(",
"$",
"content",
",",
"$",
"contentType",
"=",
"null",
",",
"$",
"charset",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getSwiftMessage",
"(",
")",
"->",
"addPart",
"(",
"$",
"content",
",",
"$",
"contentTyp... | Add optionally an alternative body
@param string $content
@param string $contentType optional
@param string $charset optional
@return $this | [
"Add",
"optionally",
"an",
"alternative",
"body"
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L338-L343 |
189,315 | phalcon-ext/mailer | src/Message.php | Message.createAttachmentViaPath | protected function createAttachmentViaPath($file)
{
/** @var $byteStream \Swift_ByteStream_FileByteStream */
$byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);
/** @var $image \Swift_Attachment */
$attachment = $this->getManager()->getDI()-... | php | protected function createAttachmentViaPath($file)
{
/** @var $byteStream \Swift_ByteStream_FileByteStream */
$byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);
/** @var $image \Swift_Attachment */
$attachment = $this->getManager()->getDI()-... | [
"protected",
"function",
"createAttachmentViaPath",
"(",
"$",
"file",
")",
"{",
"/** @var $byteStream \\Swift_ByteStream_FileByteStream */",
"$",
"byteStream",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"getDI",
"(",
")",
"->",
"get",
"(",
"'\\Swift_ByteS... | Create a Swift new Attachment from a filesystem path.
@param string $file
@return \Swift_Attachment
@see \Swift_Attachment::fromPath() | [
"Create",
"a",
"Swift",
"new",
"Attachment",
"from",
"a",
"filesystem",
"path",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L718-L728 |
189,316 | phalcon-ext/mailer | src/Message.php | Message.createEmbedViaPath | protected function createEmbedViaPath($file)
{
/** @var $byteStream \Swift_ByteStream_FileByteStream */
$byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);
/** @var $image \Swift_Image */
$image = $this->getManager()->getDI()->get('\Swift_Im... | php | protected function createEmbedViaPath($file)
{
/** @var $byteStream \Swift_ByteStream_FileByteStream */
$byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);
/** @var $image \Swift_Image */
$image = $this->getManager()->getDI()->get('\Swift_Im... | [
"protected",
"function",
"createEmbedViaPath",
"(",
"$",
"file",
")",
"{",
"/** @var $byteStream \\Swift_ByteStream_FileByteStream */",
"$",
"byteStream",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"getDI",
"(",
")",
"->",
"get",
"(",
"'\\Swift_ByteStream... | Create a Swift new Image from a filesystem path.
@param string $file
@return \Swift_Image
@see \Swift_Image::fromPath() | [
"Create",
"a",
"Swift",
"new",
"Image",
"from",
"a",
"filesystem",
"path",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L754-L764 |
189,317 | phalcon-ext/mailer | src/Message.php | Message.createEmbedViaData | protected function createEmbedViaData($data, $filename = null, $contentType = null)
{
return $this->getManager()->getDI()->get('\Swift_Image', [$data, $filename, $contentType]);
} | php | protected function createEmbedViaData($data, $filename = null, $contentType = null)
{
return $this->getManager()->getDI()->get('\Swift_Image', [$data, $filename, $contentType]);
} | [
"protected",
"function",
"createEmbedViaData",
"(",
"$",
"data",
",",
"$",
"filename",
"=",
"null",
",",
"$",
"contentType",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"getDI",
"(",
")",
"->",
"get",
"(",
"'\\Swif... | Create a Swift new Image.
@param string $data
@param string|null $filename
@param string|null $contentType
@return \Swift_Image
@see \Swift_Image::newInstance() | [
"Create",
"a",
"Swift",
"new",
"Image",
"."
] | 5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a | https://github.com/phalcon-ext/mailer/blob/5c29a53e6eda80cc2bf6db0bce8740a243fc2d2a/src/Message.php#L777-L780 |
189,318 | etsy/phpunit-extensions | src/PHPUnit/Extensions/Assert/More.php | More.assertHasItems | public static function assertHasItems($expected, $actual, $message='') {
Assert::assertThat(
$actual,
new HasItems($expected),
$message);
} | php | public static function assertHasItems($expected, $actual, $message='') {
Assert::assertThat(
$actual,
new HasItems($expected),
$message);
} | [
"public",
"static",
"function",
"assertHasItems",
"(",
"$",
"expected",
",",
"$",
"actual",
",",
"$",
"message",
"=",
"''",
")",
"{",
"Assert",
"::",
"assertThat",
"(",
"$",
"actual",
",",
"new",
"HasItems",
"(",
"$",
"expected",
")",
",",
"$",
"messag... | Asserts that the actual array contains at least one occurence
of each of the values in the expected array.
@param array $expected
@param array $actual
@param $message | [
"Asserts",
"that",
"the",
"actual",
"array",
"contains",
"at",
"least",
"one",
"occurence",
"of",
"each",
"of",
"the",
"values",
"in",
"the",
"expected",
"array",
"."
] | e82d23e794bd76499f938dcd0c90b09d6a63b405 | https://github.com/etsy/phpunit-extensions/blob/e82d23e794bd76499f938dcd0c90b09d6a63b405/src/PHPUnit/Extensions/Assert/More.php#L27-L32 |
189,319 | etsy/phpunit-extensions | src/PHPUnit/Extensions/Assert/More.php | More.assertArrayEqualsNoOrder | public static function assertArrayEqualsNoOrder(
$expected, $actual, $message='') {
Assert::assertThat(
$actual,
new ArrayEqualsNoOrder($expected),
$message);
} | php | public static function assertArrayEqualsNoOrder(
$expected, $actual, $message='') {
Assert::assertThat(
$actual,
new ArrayEqualsNoOrder($expected),
$message);
} | [
"public",
"static",
"function",
"assertArrayEqualsNoOrder",
"(",
"$",
"expected",
",",
"$",
"actual",
",",
"$",
"message",
"=",
"''",
")",
"{",
"Assert",
"::",
"assertThat",
"(",
"$",
"actual",
",",
"new",
"ArrayEqualsNoOrder",
"(",
"$",
"expected",
")",
"... | Asserts that the two arrays contain the same exact contents,
but are not necessarily the same order.
@param array $expected
@param array $actual
@param string $message | [
"Asserts",
"that",
"the",
"two",
"arrays",
"contain",
"the",
"same",
"exact",
"contents",
"but",
"are",
"not",
"necessarily",
"the",
"same",
"order",
"."
] | e82d23e794bd76499f938dcd0c90b09d6a63b405 | https://github.com/etsy/phpunit-extensions/blob/e82d23e794bd76499f938dcd0c90b09d6a63b405/src/PHPUnit/Extensions/Assert/More.php#L59-L66 |
189,320 | etsy/phpunit-extensions | src/PHPUnit/Extensions/Assert/More.php | More.assertStringMatchIgnoreWhitespace | public static function assertStringMatchIgnoreWhitespace(
$expected, $actual, $message='') {
Assert::assertThat(
$actual,
new StringMatchIgnoreWhitespace($expected),
$message);
} | php | public static function assertStringMatchIgnoreWhitespace(
$expected, $actual, $message='') {
Assert::assertThat(
$actual,
new StringMatchIgnoreWhitespace($expected),
$message);
} | [
"public",
"static",
"function",
"assertStringMatchIgnoreWhitespace",
"(",
"$",
"expected",
",",
"$",
"actual",
",",
"$",
"message",
"=",
"''",
")",
"{",
"Assert",
"::",
"assertThat",
"(",
"$",
"actual",
",",
"new",
"StringMatchIgnoreWhitespace",
"(",
"$",
"exp... | Asserts that the two strings match but that all whitespaces are
not necessarily equal.
@param array $expected
@param array $actual
@param string $message | [
"Asserts",
"that",
"the",
"two",
"strings",
"match",
"but",
"that",
"all",
"whitespaces",
"are",
"not",
"necessarily",
"equal",
"."
] | e82d23e794bd76499f938dcd0c90b09d6a63b405 | https://github.com/etsy/phpunit-extensions/blob/e82d23e794bd76499f938dcd0c90b09d6a63b405/src/PHPUnit/Extensions/Assert/More.php#L76-L82 |
189,321 | ratiw/JsonPDF | src/ratiw/JsonPDF/JsonPDF.php | JsonPDF.deep_merge_recursive | protected function deep_merge_recursive($arrays)
{
$result = array();
foreach ($arrays as $array)
{
foreach ($array as $key => $value)
{
if (is_integer($key))
{
$result[] = $value;
}
... | php | protected function deep_merge_recursive($arrays)
{
$result = array();
foreach ($arrays as $array)
{
foreach ($array as $key => $value)
{
if (is_integer($key))
{
$result[] = $value;
}
... | [
"protected",
"function",
"deep_merge_recursive",
"(",
"$",
"arrays",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"arrays",
"as",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value"... | but also handle embeded objects | [
"but",
"also",
"handle",
"embeded",
"objects"
] | a2334ef8fb3310ac4c8d08335e60e73bdf49808d | https://github.com/ratiw/JsonPDF/blob/a2334ef8fb3310ac4c8d08335e60e73bdf49808d/src/ratiw/JsonPDF/JsonPDF.php#L629-L663 |
189,322 | xfra35/f3-cron | lib/cron.php | Cron.binary | function binary($path) {
if (function_exists('exec')) {
exec($path.' -v 2>&1',$out,$ret);
if ($ret==0 && preg_match('/cli/',@$out[0],$out))
$this->binary=$path;
}
return $this->binary;
} | php | function binary($path) {
if (function_exists('exec')) {
exec($path.' -v 2>&1',$out,$ret);
if ($ret==0 && preg_match('/cli/',@$out[0],$out))
$this->binary=$path;
}
return $this->binary;
} | [
"function",
"binary",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'exec'",
")",
")",
"{",
"exec",
"(",
"$",
"path",
".",
"' -v 2>&1'",
",",
"$",
"out",
",",
"$",
"ret",
")",
";",
"if",
"(",
"$",
"ret",
"==",
"0",
"&&",
"preg... | Set binary path after checking that it can be executed and is CLI
@param string $path
@return string | [
"Set",
"binary",
"path",
"after",
"checking",
"that",
"it",
"can",
"be",
"executed",
"and",
"is",
"CLI"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L54-L61 |
189,323 | xfra35/f3-cron | lib/cron.php | Cron.set | function set($job,$handler,$expr) {
if (!preg_match('/^[\w\-]+$/',$job))
user_error(sprintf(self::E_Invalid,$job),E_USER_ERROR);
$this->jobs[$job]=array($handler,$expr);
} | php | function set($job,$handler,$expr) {
if (!preg_match('/^[\w\-]+$/',$job))
user_error(sprintf(self::E_Invalid,$job),E_USER_ERROR);
$this->jobs[$job]=array($handler,$expr);
} | [
"function",
"set",
"(",
"$",
"job",
",",
"$",
"handler",
",",
"$",
"expr",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[\\w\\-]+$/'",
",",
"$",
"job",
")",
")",
"user_error",
"(",
"sprintf",
"(",
"self",
"::",
"E_Invalid",
",",
"$",
"job",
")"... | Schedule a job
@param string $job
@param string $handler
@param string $expr | [
"Schedule",
"a",
"job"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L69-L73 |
189,324 | xfra35/f3-cron | lib/cron.php | Cron.isDue | function isDue($job,$time) {
if (!isset($this->jobs[$job]) || !$parts=$this->parseExpr($this->jobs[$job][1]))
return FALSE;
foreach($this->parseTimestamp($time) as $i=>$k)
if (!in_array($k,$parts[$i]))
return FALSE;
return TRUE;
} | php | function isDue($job,$time) {
if (!isset($this->jobs[$job]) || !$parts=$this->parseExpr($this->jobs[$job][1]))
return FALSE;
foreach($this->parseTimestamp($time) as $i=>$k)
if (!in_array($k,$parts[$i]))
return FALSE;
return TRUE;
} | [
"function",
"isDue",
"(",
"$",
"job",
",",
"$",
"time",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"jobs",
"[",
"$",
"job",
"]",
")",
"||",
"!",
"$",
"parts",
"=",
"$",
"this",
"->",
"parseExpr",
"(",
"$",
"this",
"->",
"jobs"... | Returns TRUE if the requested job is due at the given time
@param string $job
@param int $time
@return bool | [
"Returns",
"TRUE",
"if",
"the",
"requested",
"job",
"is",
"due",
"at",
"the",
"given",
"time"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L90-L97 |
189,325 | xfra35/f3-cron | lib/cron.php | Cron.execute | function execute($job,$async=TRUE) {
if (!isset($this->jobs[$job]))
user_error(sprintf(self::E_NotFound,$job),E_USER_ERROR);
$f3=\Base::instance();
if (is_string($func=$this->jobs[$job][0]))
$func=$f3->grab($func);
if (!is_callable($func))
user_error(s... | php | function execute($job,$async=TRUE) {
if (!isset($this->jobs[$job]))
user_error(sprintf(self::E_NotFound,$job),E_USER_ERROR);
$f3=\Base::instance();
if (is_string($func=$this->jobs[$job][0]))
$func=$f3->grab($func);
if (!is_callable($func))
user_error(s... | [
"function",
"execute",
"(",
"$",
"job",
",",
"$",
"async",
"=",
"TRUE",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"jobs",
"[",
"$",
"job",
"]",
")",
")",
"user_error",
"(",
"sprintf",
"(",
"self",
"::",
"E_NotFound",
",",
"$",
... | Execute a job
@param string $job
@param bool $async
@return bool TRUE = job has been executed / FALSE = job has been delegated to a background process | [
"Execute",
"a",
"job"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L105-L135 |
189,326 | xfra35/f3-cron | lib/cron.php | Cron.run | function run($time=NULL,$async=TRUE) {
if (!isset($time))
$time=time();
$exec=array();
foreach(array_keys($this->jobs) as $job)
if ($this->isDue($job,$time))
$exec[$job]=$this->execute($job,$async);
return $exec;
} | php | function run($time=NULL,$async=TRUE) {
if (!isset($time))
$time=time();
$exec=array();
foreach(array_keys($this->jobs) as $job)
if ($this->isDue($job,$time))
$exec[$job]=$this->execute($job,$async);
return $exec;
} | [
"function",
"run",
"(",
"$",
"time",
"=",
"NULL",
",",
"$",
"async",
"=",
"TRUE",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"time",
")",
")",
"$",
"time",
"=",
"time",
"(",
")",
";",
"$",
"exec",
"=",
"array",
"(",
")",
";",
"foreach",
"... | Run scheduler, i.e executes all due jobs at a given time
@param int $time
@param bool $async
@return array List of executed jobs | [
"Run",
"scheduler",
"i",
".",
"e",
"executes",
"all",
"due",
"jobs",
"at",
"a",
"given",
"time"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L143-L151 |
189,327 | xfra35/f3-cron | lib/cron.php | Cron.route | function route($f3,$params) {
if (PHP_SAPI!='cli' && !$this->web)
$f3->error(404);
$exec=isset($params['job'])?
array($params['job']=>$this->execute($params['job'],FALSE)):
$this->run();
if (!$this->silent) {
if (PHP_SAPI!='cli')
he... | php | function route($f3,$params) {
if (PHP_SAPI!='cli' && !$this->web)
$f3->error(404);
$exec=isset($params['job'])?
array($params['job']=>$this->execute($params['job'],FALSE)):
$this->run();
if (!$this->silent) {
if (PHP_SAPI!='cli')
he... | [
"function",
"route",
"(",
"$",
"f3",
",",
"$",
"params",
")",
"{",
"if",
"(",
"PHP_SAPI",
"!=",
"'cli'",
"&&",
"!",
"$",
"this",
"->",
"web",
")",
"$",
"f3",
"->",
"error",
"(",
"404",
")",
";",
"$",
"exec",
"=",
"isset",
"(",
"$",
"params",
... | Route controller code
@param \Base $f3
@param array $params | [
"Route",
"controller",
"code"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L158-L172 |
189,328 | xfra35/f3-cron | lib/cron.php | Cron.parseTimestamp | function parseTimestamp($time) {
return array(
(int)date('i',$time),//minute
(int)date('H',$time),//hour
(int)date('d',$time),//day of month
(int)date('m',$time),//month
(int)date('w',$time),//day of week
);
} | php | function parseTimestamp($time) {
return array(
(int)date('i',$time),//minute
(int)date('H',$time),//hour
(int)date('d',$time),//day of month
(int)date('m',$time),//month
(int)date('w',$time),//day of week
);
} | [
"function",
"parseTimestamp",
"(",
"$",
"time",
")",
"{",
"return",
"array",
"(",
"(",
"int",
")",
"date",
"(",
"'i'",
",",
"$",
"time",
")",
",",
"//minute",
"(",
"int",
")",
"date",
"(",
"'H'",
",",
"$",
"time",
")",
",",
"//hour",
"(",
"int",
... | Parse a timestamp
@param int $time
@return array | [
"Parse",
"a",
"timestamp"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L179-L187 |
189,329 | xfra35/f3-cron | lib/cron.php | Cron.parseExpr | function parseExpr($expr) {
$parts=array();
if (preg_match('/^@(\w+)$/',$expr,$m)) {
if (!isset($this->presets[$m[1]]))
return FALSE;
$expr=$this->presets[$m[1]];
}
$expr=preg_split('/\s+/',$expr,-1,PREG_SPLIT_NO_EMPTY);
$ranges=array(
... | php | function parseExpr($expr) {
$parts=array();
if (preg_match('/^@(\w+)$/',$expr,$m)) {
if (!isset($this->presets[$m[1]]))
return FALSE;
$expr=$this->presets[$m[1]];
}
$expr=preg_split('/\s+/',$expr,-1,PREG_SPLIT_NO_EMPTY);
$ranges=array(
... | [
"function",
"parseExpr",
"(",
"$",
"expr",
")",
"{",
"$",
"parts",
"=",
"array",
"(",
")",
";",
"if",
"(",
"preg_match",
"(",
"'/^@(\\w+)$/'",
",",
"$",
"expr",
",",
"$",
"m",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pre... | Parse a cron expression
@param string $expr
@return array|FALSE | [
"Parse",
"a",
"cron",
"expression"
] | eba0a5574a8c35623307dd27135a67d76e4da12e | https://github.com/xfra35/f3-cron/blob/eba0a5574a8c35623307dd27135a67d76e4da12e/lib/cron.php#L194-L221 |
189,330 | yii2mod/yii2-star-rating | StarRating.php | StarRating.configureClientOptions | protected function configureClientOptions()
{
$assetBundle = StarRatingAsset::register($this->view);
if (!isset($this->clientOptions['score'])) {
$this->clientOptions['score'] = $this->hasModel() ? Html::getAttributeValue($this->model, $this->attribute) : $this->value;
}
... | php | protected function configureClientOptions()
{
$assetBundle = StarRatingAsset::register($this->view);
if (!isset($this->clientOptions['score'])) {
$this->clientOptions['score'] = $this->hasModel() ? Html::getAttributeValue($this->model, $this->attribute) : $this->value;
}
... | [
"protected",
"function",
"configureClientOptions",
"(",
")",
"{",
"$",
"assetBundle",
"=",
"StarRatingAsset",
"::",
"register",
"(",
"$",
"this",
"->",
"view",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"clientOptions",
"[",
"'score'",
"]",... | Configure client options | [
"Configure",
"client",
"options"
] | 50e33bb270fd115dad788de6d125bf1cd64fe065 | https://github.com/yii2mod/yii2-star-rating/blob/50e33bb270fd115dad788de6d125bf1cd64fe065/StarRating.php#L64-L79 |
189,331 | hochstrasserio/wirecard | src/Response/WirecardResponse.php | WirecardResponse.parseQuery | private static function parseQuery($str, $urlEncoding = true)
{
$result = [];
if ($str === '') {
return $result;
}
if ($urlEncoding === true) {
$decoder = function ($value) {
return rawurldecode(str_replace('+', ' ', $value));
};
... | php | private static function parseQuery($str, $urlEncoding = true)
{
$result = [];
if ($str === '') {
return $result;
}
if ($urlEncoding === true) {
$decoder = function ($value) {
return rawurldecode(str_replace('+', ' ', $value));
};
... | [
"private",
"static",
"function",
"parseQuery",
"(",
"$",
"str",
",",
"$",
"urlEncoding",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"str",
"===",
"''",
")",
"{",
"return",
"$",
"result",
";",
"}",
"if",
"(",
"$",
... | Parse a query string into an associative array.
If multiple values are found for the same key, the value of that key
value pair will become an array. This function does not parse nested
PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will
be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).
@param ... | [
"Parse",
"a",
"query",
"string",
"into",
"an",
"associative",
"array",
"."
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Response/WirecardResponse.php#L62-L93 |
189,332 | hochstrasserio/wirecard | src/Request/AbstractWirecardRequest.php | AbstractWirecardRequest.createHttpRequest | function createHttpRequest()
{
$headers = [
'User-Agent' => $this->getContext()->getUserAgent(),
'Content-Type' => 'application/x-www-form-urlencoded'
];
$body = $this->buildQuery($this->getRequestParameters());
return $this->getContext()->getMessageFactory(... | php | function createHttpRequest()
{
$headers = [
'User-Agent' => $this->getContext()->getUserAgent(),
'Content-Type' => 'application/x-www-form-urlencoded'
];
$body = $this->buildQuery($this->getRequestParameters());
return $this->getContext()->getMessageFactory(... | [
"function",
"createHttpRequest",
"(",
")",
"{",
"$",
"headers",
"=",
"[",
"'User-Agent'",
"=>",
"$",
"this",
"->",
"getContext",
"(",
")",
"->",
"getUserAgent",
"(",
")",
",",
"'Content-Type'",
"=>",
"'application/x-www-form-urlencoded'",
"]",
";",
"$",
"body"... | Converts the request to a PSR-7 RequestInterface
@return \Psr\Http\Message\RequestInterface | [
"Converts",
"the",
"request",
"to",
"a",
"PSR",
"-",
"7",
"RequestInterface"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Request/AbstractWirecardRequest.php#L53-L77 |
189,333 | hochstrasserio/wirecard | src/Request/AbstractWirecardRequest.php | AbstractWirecardRequest.createResponse | function createResponse(\Psr\Http\Message\ResponseInterface $response)
{
return WirecardResponse::fromHttpResponse(
$response,
$this->resultClass
);
} | php | function createResponse(\Psr\Http\Message\ResponseInterface $response)
{
return WirecardResponse::fromHttpResponse(
$response,
$this->resultClass
);
} | [
"function",
"createResponse",
"(",
"\\",
"Psr",
"\\",
"Http",
"\\",
"Message",
"\\",
"ResponseInterface",
"$",
"response",
")",
"{",
"return",
"WirecardResponse",
"::",
"fromHttpResponse",
"(",
"$",
"response",
",",
"$",
"this",
"->",
"resultClass",
")",
";",
... | Converts the PSR-7 ResponseInterface to a Wirecard Response
@param \Psr\Http\Message\ResponseInterface $response
@return WirecardResponse | [
"Converts",
"the",
"PSR",
"-",
"7",
"ResponseInterface",
"to",
"a",
"Wirecard",
"Response"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Request/AbstractWirecardRequest.php#L85-L91 |
189,334 | hochstrasserio/wirecard | src/Request/AbstractWirecardRequest.php | AbstractWirecardRequest.getRawParameters | protected function getRawParameters()
{
$params = $this->parameters;
$context = $this->getContext();
if (empty($params['customerId'])) {
$params['customerId'] = $context->getCustomerId();
}
if ($context->getShopId() and empty($params['shopId'])) {
$p... | php | protected function getRawParameters()
{
$params = $this->parameters;
$context = $this->getContext();
if (empty($params['customerId'])) {
$params['customerId'] = $context->getCustomerId();
}
if ($context->getShopId() and empty($params['shopId'])) {
$p... | [
"protected",
"function",
"getRawParameters",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"parameters",
";",
"$",
"context",
"=",
"$",
"this",
"->",
"getContext",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"'customerId'",
"]",... | Returns the request parameters without calculated fingerprint
Override this method in your subclasses to modify parameters before they are
passed to the PSR-7 request message. | [
"Returns",
"the",
"request",
"parameters",
"without",
"calculated",
"fingerprint"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Request/AbstractWirecardRequest.php#L137-L151 |
189,335 | hochstrasserio/wirecard | src/Request/AbstractWirecardRequest.php | AbstractWirecardRequest.assertParametersAreValid | protected function assertParametersAreValid(array $parameters, array $requiredParameters)
{
foreach ($requiredParameters as $parameter) {
if (empty($parameters[$parameter])) {
throw RequiredParameterMissingException::withParameter($parameter);
}
}
} | php | protected function assertParametersAreValid(array $parameters, array $requiredParameters)
{
foreach ($requiredParameters as $parameter) {
if (empty($parameters[$parameter])) {
throw RequiredParameterMissingException::withParameter($parameter);
}
}
} | [
"protected",
"function",
"assertParametersAreValid",
"(",
"array",
"$",
"parameters",
",",
"array",
"$",
"requiredParameters",
")",
"{",
"foreach",
"(",
"$",
"requiredParameters",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"parameters",
"[... | Validates that all required parameters are set, otherwise throws an exception
@param array $parameters
@param array $requiredParameters List of required parameters
@throws RequiredParameterMissingException | [
"Validates",
"that",
"all",
"required",
"parameters",
"are",
"set",
"otherwise",
"throws",
"an",
"exception"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Request/AbstractWirecardRequest.php#L176-L183 |
189,336 | hochstrasserio/wirecard | src/Request/AbstractWirecardRequest.php | AbstractWirecardRequest.buildQuery | protected function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986)
{
if (!$params) {
return '';
}
if ($encoding === false) {
$encoder = function ($str) { return $str; };
} elseif ($encoding == PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode'... | php | protected function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986)
{
if (!$params) {
return '';
}
if ($encoding === false) {
$encoder = function ($str) { return $str; };
} elseif ($encoding == PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode'... | [
"protected",
"function",
"buildQuery",
"(",
"array",
"$",
"params",
",",
"$",
"encoding",
"=",
"PHP_QUERY_RFC3986",
")",
"{",
"if",
"(",
"!",
"$",
"params",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"$",
"encoding",
"===",
"false",
")",
"{",
"$"... | Build a query string from an array of key value pairs.
This function can use the return value of parseQuery() to build a query
string. This function does not modify the provided keys when an array is
encountered (like http_build_query would).
@param array $params Query string parameters.
@param int|false $encod... | [
"Build",
"a",
"query",
"string",
"from",
"an",
"array",
"of",
"key",
"value",
"pairs",
"."
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Request/AbstractWirecardRequest.php#L220-L254 |
189,337 | hochstrasserio/wirecard | src/Helper/WirecardHelper.php | WirecardHelper.send | function send(WirecardRequestInterface $wirecardRequest)
{
$wirecardRequest->setContext($this->getContext());
$httpRequest = $wirecardRequest->createHttpRequest();
$httpResponse = call_user_func($this->client, $httpRequest);
return $wirecardRequest->createResponse($httpResponse);
... | php | function send(WirecardRequestInterface $wirecardRequest)
{
$wirecardRequest->setContext($this->getContext());
$httpRequest = $wirecardRequest->createHttpRequest();
$httpResponse = call_user_func($this->client, $httpRequest);
return $wirecardRequest->createResponse($httpResponse);
... | [
"function",
"send",
"(",
"WirecardRequestInterface",
"$",
"wirecardRequest",
")",
"{",
"$",
"wirecardRequest",
"->",
"setContext",
"(",
"$",
"this",
"->",
"getContext",
"(",
")",
")",
";",
"$",
"httpRequest",
"=",
"$",
"wirecardRequest",
"->",
"createHttpRequest... | Synchronously sends the request with the configured client
@return WirecardResponseInterface | [
"Synchronously",
"sends",
"the",
"request",
"with",
"the",
"configured",
"client"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Helper/WirecardHelper.php#L43-L51 |
189,338 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.lookup | public function lookup($asin)
{
$params = $this->buildRequestParams('ItemLookup', array(
'ItemId' => $asin,
));
return $this->returnData(
$this->performSoapRequest("ItemLookup", $params)
);
} | php | public function lookup($asin)
{
$params = $this->buildRequestParams('ItemLookup', array(
'ItemId' => $asin,
));
return $this->returnData(
$this->performSoapRequest("ItemLookup", $params)
);
} | [
"public",
"function",
"lookup",
"(",
"$",
"asin",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"buildRequestParams",
"(",
"'ItemLookup'",
",",
"array",
"(",
"'ItemId'",
"=>",
"$",
"asin",
",",
")",
")",
";",
"return",
"$",
"this",
"->",
"returnData... | execute ItemLookup request
@param string $asin
@return array|object return type depends on setting
@see returnType() | [
"execute",
"ItemLookup",
"request"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L130-L139 |
189,339 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.similarityLookup | public function similarityLookup($asin)
{
$params = $this->buildRequestParams('SimilarityLookup', array(
'ItemId' => $asin
));
return $this->returnData(
$this->performSoapRequest("SimilarityLookup", $params)
);
} | php | public function similarityLookup($asin)
{
$params = $this->buildRequestParams('SimilarityLookup', array(
'ItemId' => $asin
));
return $this->returnData(
$this->performSoapRequest("SimilarityLookup", $params)
);
} | [
"public",
"function",
"similarityLookup",
"(",
"$",
"asin",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"buildRequestParams",
"(",
"'SimilarityLookup'",
",",
"array",
"(",
"'ItemId'",
"=>",
"$",
"asin",
")",
")",
";",
"return",
"$",
"this",
"->",
"r... | Implementation of SimilarityLookup
This allows to fetch information about product related to the parameter product
@param string $asin | [
"Implementation",
"of",
"SimilarityLookup",
"This",
"allows",
"to",
"fetch",
"information",
"about",
"product",
"related",
"to",
"the",
"parameter",
"product"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L166-L175 |
189,340 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.buildRequestParams | protected function buildRequestParams($function, array $params)
{
$associateTag = array();
if(false === empty($this->requestConfig['associateTag']))
{
$associateTag = array('AssociateTag' => $this->requestConfig['associateTag']);
}
return array_merge(
$associateTag,
array(
... | php | protected function buildRequestParams($function, array $params)
{
$associateTag = array();
if(false === empty($this->requestConfig['associateTag']))
{
$associateTag = array('AssociateTag' => $this->requestConfig['associateTag']);
}
return array_merge(
$associateTag,
array(
... | [
"protected",
"function",
"buildRequestParams",
"(",
"$",
"function",
",",
"array",
"$",
"params",
")",
"{",
"$",
"associateTag",
"=",
"array",
"(",
")",
";",
"if",
"(",
"false",
"===",
"empty",
"(",
"$",
"this",
"->",
"requestConfig",
"[",
"'associateTag'"... | Builds the request parameters
@param string $function
@param array $params
@return array | [
"Builds",
"the",
"request",
"parameters"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L185-L204 |
189,341 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.prepareResponseGroup | protected function prepareResponseGroup()
{
if (false === strstr($this->responseConfig['responseGroup'], ','))
return $this->responseConfig['responseGroup'];
return explode(',', $this->responseConfig['responseGroup']);
} | php | protected function prepareResponseGroup()
{
if (false === strstr($this->responseConfig['responseGroup'], ','))
return $this->responseConfig['responseGroup'];
return explode(',', $this->responseConfig['responseGroup']);
} | [
"protected",
"function",
"prepareResponseGroup",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"strstr",
"(",
"$",
"this",
"->",
"responseConfig",
"[",
"'responseGroup'",
"]",
",",
"','",
")",
")",
"return",
"$",
"this",
"->",
"responseConfig",
"[",
"'responseGr... | Prepares the responsegroups and returns them as array
@return array|prepared responsegroups | [
"Prepares",
"the",
"responsegroups",
"and",
"returns",
"them",
"as",
"array"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L211-L217 |
189,342 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.buildSoapHeader | protected function buildSoapHeader($function)
{
$timeStamp = $this->getTimestamp();
$signature = $this->buildSignature($function . $timeStamp);
return array(
new SoapHeader(
'http://security.amazonaws.com/doc/2007-01-01/',
'AWSAccessKeyId',
$this->requestConfig['accessKey']
... | php | protected function buildSoapHeader($function)
{
$timeStamp = $this->getTimestamp();
$signature = $this->buildSignature($function . $timeStamp);
return array(
new SoapHeader(
'http://security.amazonaws.com/doc/2007-01-01/',
'AWSAccessKeyId',
$this->requestConfig['accessKey']
... | [
"protected",
"function",
"buildSoapHeader",
"(",
"$",
"function",
")",
"{",
"$",
"timeStamp",
"=",
"$",
"this",
"->",
"getTimestamp",
"(",
")",
";",
"$",
"signature",
"=",
"$",
"this",
"->",
"buildSignature",
"(",
"$",
"function",
".",
"$",
"timeStamp",
... | Provides some necessary soap headers
@param string $function
@return array Each element is a concrete SoapHeader object | [
"Provides",
"some",
"necessary",
"soap",
"headers"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L254-L276 |
189,343 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.objectToArray | protected function objectToArray($object)
{
$out = array();
foreach ($object as $key => $value)
{
switch (true)
{
case is_object($value):
$out[$key] = $this->objectToArray($value);
break;
case is_array($value):
$out[$key] = $this->objectToArray($val... | php | protected function objectToArray($object)
{
$out = array();
foreach ($object as $key => $value)
{
switch (true)
{
case is_object($value):
$out[$key] = $this->objectToArray($value);
break;
case is_array($value):
$out[$key] = $this->objectToArray($val... | [
"protected",
"function",
"objectToArray",
"(",
"$",
"object",
")",
"{",
"$",
"out",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"object",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"is_object",
"(... | Transforms the responseobject to an array
@param object $object
@return array An arrayrepresentation of the given object | [
"Transforms",
"the",
"responseobject",
"to",
"an",
"array"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L351-L373 |
189,344 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.optionalParameters | public function optionalParameters($params = null)
{
if (null === $params)
{
return $this->responseConfig['optionalParameters'];
}
if (false === is_array($params))
{
throw new InvalidArgumentException(sprintf(
"%s is no valid parameter: Use an array with Key => Value Pairs", $... | php | public function optionalParameters($params = null)
{
if (null === $params)
{
return $this->responseConfig['optionalParameters'];
}
if (false === is_array($params))
{
throw new InvalidArgumentException(sprintf(
"%s is no valid parameter: Use an array with Key => Value Pairs", $... | [
"public",
"function",
"optionalParameters",
"(",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"params",
")",
"{",
"return",
"$",
"this",
"->",
"responseConfig",
"[",
"'optionalParameters'",
"]",
";",
"}",
"if",
"(",
"false",
"==="... | set or get optional parameters
if the argument params is null it will reutrn the current parameters,
otherwise it will set the params and return itself.
@param array $params the optional parameters
@return array|AmazonECS depends on params argument | [
"set",
"or",
"get",
"optional",
"parameters"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L385-L402 |
189,345 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.country | public function country($country = null)
{
if (null === $country)
{
return $this->responseConfig['country'];
}
if (false === in_array(strtolower($country), $this->possibleLocations))
{
throw new InvalidArgumentException(sprintf(
"Invalid Country-Code: %s! Possible Country-Code... | php | public function country($country = null)
{
if (null === $country)
{
return $this->responseConfig['country'];
}
if (false === in_array(strtolower($country), $this->possibleLocations))
{
throw new InvalidArgumentException(sprintf(
"Invalid Country-Code: %s! Possible Country-Code... | [
"public",
"function",
"country",
"(",
"$",
"country",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"country",
")",
"{",
"return",
"$",
"this",
"->",
"responseConfig",
"[",
"'country'",
"]",
";",
"}",
"if",
"(",
"false",
"===",
"in_array",
"(... | Set or get the country
if the country argument is null it will return the current
country, otherwise it will set the country and return itself.
@param string|null $country
@return string|AmazonECS depends on country argument | [
"Set",
"or",
"get",
"the",
"country"
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L414-L433 |
189,346 | Exeu/Amazon-ECS-PHP-Library | lib/AmazonECS.class.php | AmazonECS.page | public function page($page)
{
if (false === is_numeric($page) || $page <= 0)
{
throw new InvalidArgumentException(sprintf(
'%s is an invalid page value. It has to be numeric and positive',
$page
));
}
$this->responseConfig['optionalParameters'] = array_merge(
$this->... | php | public function page($page)
{
if (false === is_numeric($page) || $page <= 0)
{
throw new InvalidArgumentException(sprintf(
'%s is an invalid page value. It has to be numeric and positive',
$page
));
}
$this->responseConfig['optionalParameters'] = array_merge(
$this->... | [
"public",
"function",
"page",
"(",
"$",
"page",
")",
"{",
"if",
"(",
"false",
"===",
"is_numeric",
"(",
"$",
"page",
")",
"||",
"$",
"page",
"<=",
"0",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'%s is an invalid page value... | Setting the resultpage to a specified value.
Allows to browse resultsets which have more than one page.
@param integer $page
@return AmazonECS | [
"Setting",
"the",
"resultpage",
"to",
"a",
"specified",
"value",
".",
"Allows",
"to",
"browse",
"resultsets",
"which",
"have",
"more",
"than",
"one",
"page",
"."
] | 39307f6cf77abc3ba99e96fa013bf3448fed4ef7 | https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/39307f6cf77abc3ba99e96fa013bf3448fed4ef7/lib/AmazonECS.class.php#L529-L545 |
189,347 | hochstrasserio/wirecard | src/Request/AbstractPaymentRequest.php | AbstractPaymentRequest.setBasket | function setBasket(Basket $basket)
{
foreach ($basket->toArray() as $param => $value) {
$this->addParam($param, $value);
}
return $this;
} | php | function setBasket(Basket $basket)
{
foreach ($basket->toArray() as $param => $value) {
$this->addParam($param, $value);
}
return $this;
} | [
"function",
"setBasket",
"(",
"Basket",
"$",
"basket",
")",
"{",
"foreach",
"(",
"$",
"basket",
"->",
"toArray",
"(",
")",
"as",
"$",
"param",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addParam",
"(",
"$",
"param",
",",
"$",
"value",
")",
... | Adds the basket to the payment, required for some payment methods
@param Basket $basket
@return InitPaymentRequest | [
"Adds",
"the",
"basket",
"to",
"the",
"payment",
"required",
"for",
"some",
"payment",
"methods"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Request/AbstractPaymentRequest.php#L306-L313 |
189,348 | hochstrasserio/wirecard | src/Fingerprint.php | Fingerprint.fromResponseParameters | public static function fromResponseParameters(array $parameters, Context $context = null)
{
if (empty($parameters['responseFingerprintOrder'])) {
throw new \UnexpectedValueException('The responseFingerprintOrder parameter is missing');
}
$self = static::fromParameters($parameter... | php | public static function fromResponseParameters(array $parameters, Context $context = null)
{
if (empty($parameters['responseFingerprintOrder'])) {
throw new \UnexpectedValueException('The responseFingerprintOrder parameter is missing');
}
$self = static::fromParameters($parameter... | [
"public",
"static",
"function",
"fromResponseParameters",
"(",
"array",
"$",
"parameters",
",",
"Context",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"parameters",
"[",
"'responseFingerprintOrder'",
"]",
")",
")",
"{",
"throw",
"new... | Create a fingerprint based on received response paramaters
@param array $parameters
@param Context $context
@return Fingerprint | [
"Create",
"a",
"fingerprint",
"based",
"on",
"received",
"response",
"paramaters"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Fingerprint.php#L44-L58 |
189,349 | hochstrasserio/wirecard | src/Fingerprint.php | Fingerprint.setContext | public function setContext(Context $context)
{
$this->context = $context;
if (empty($this->parameters['secret'])) {
$this->parameters['secret'] = $context->getSecret();
}
return $this;
} | php | public function setContext(Context $context)
{
$this->context = $context;
if (empty($this->parameters['secret'])) {
$this->parameters['secret'] = $context->getSecret();
}
return $this;
} | [
"public",
"function",
"setContext",
"(",
"Context",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"$",
"context",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"parameters",
"[",
"'secret'",
"]",
")",
")",
"{",
"$",
"this",
"->",
... | Sets the context for fingerprint calculation
@param Context $context
@return Fingerprint | [
"Sets",
"the",
"context",
"for",
"fingerprint",
"calculation"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Fingerprint.php#L66-L75 |
189,350 | hochstrasserio/wirecard | src/Model/Common/Basket.php | Basket.addItem | function addItem(BasketItem $item)
{
$basketItems = $this->getParam('basketItems') ?: 0;
$basketItems++;
$this->items[$basketItems] = $item;
$this->addParam('basketItems', $basketItems);
foreach ($item->toArray() as $param => $value) {
$this->addParam('basketIte... | php | function addItem(BasketItem $item)
{
$basketItems = $this->getParam('basketItems') ?: 0;
$basketItems++;
$this->items[$basketItems] = $item;
$this->addParam('basketItems', $basketItems);
foreach ($item->toArray() as $param => $value) {
$this->addParam('basketIte... | [
"function",
"addItem",
"(",
"BasketItem",
"$",
"item",
")",
"{",
"$",
"basketItems",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'basketItems'",
")",
"?",
":",
"0",
";",
"$",
"basketItems",
"++",
";",
"$",
"this",
"->",
"items",
"[",
"$",
"basketItems",
... | Adds an item to the basket
@param BasketItem $item
@return Basket | [
"Adds",
"an",
"item",
"to",
"the",
"basket"
] | 5ec13ab590886715ab732d3002e979225043ff04 | https://github.com/hochstrasserio/wirecard/blob/5ec13ab590886715ab732d3002e979225043ff04/src/Model/Common/Basket.php#L59-L72 |
189,351 | malahierba-lab/chile-rut | src/ChileRut.php | ChileRut.check | public function check($rut) {
$cleanedRut = $this->clean($rut);
if (! $cleanedRut)
return false;
list($numero, $digitoVerificador) = explode('-', $cleanedRut);
//Validamos requisitos mínimos
if ((($digitoVerificador != 'K') && (! is_numeric($digitoVerificador))) || (count(str_split($numero)) > ... | php | public function check($rut) {
$cleanedRut = $this->clean($rut);
if (! $cleanedRut)
return false;
list($numero, $digitoVerificador) = explode('-', $cleanedRut);
//Validamos requisitos mínimos
if ((($digitoVerificador != 'K') && (! is_numeric($digitoVerificador))) || (count(str_split($numero)) > ... | [
"public",
"function",
"check",
"(",
"$",
"rut",
")",
"{",
"$",
"cleanedRut",
"=",
"$",
"this",
"->",
"clean",
"(",
"$",
"rut",
")",
";",
"if",
"(",
"!",
"$",
"cleanedRut",
")",
"return",
"false",
";",
"list",
"(",
"$",
"numero",
",",
"$",
"digito... | Valida un RUT
Retorna verdadero/falso para un rut que se le entregue.
Se consideran válidas las siguientes formas de escribir el rut:
* xx.xxx.xxx-y (con separación de miles y con guión antes del dígito verificador)
* xxxxxxxx-y (sin separación de miles y con guión antes del dígito verificador)
* xxxxxxxxy (sin sepa... | [
"Valida",
"un",
"RUT"
] | d080af6d017fc62f8e3dd268d91f98fbeed4949f | https://github.com/malahierba-lab/chile-rut/blob/d080af6d017fc62f8e3dd268d91f98fbeed4949f/src/ChileRut.php#L26-L53 |
189,352 | malahierba-lab/chile-rut | src/ChileRut.php | ChileRut.clean | public function clean($originalRut, $incluyeDigitoVerificador = true) {
//Eliminamos espacios al principio y final
$originalRut = trim($originalRut);
//En caso de existir, eliminamos ceros ("0") a la izquierda
$originalRut = ltrim($originalRut, '0');
$input = str_split($originalRut);
$cleanedRut = '';... | php | public function clean($originalRut, $incluyeDigitoVerificador = true) {
//Eliminamos espacios al principio y final
$originalRut = trim($originalRut);
//En caso de existir, eliminamos ceros ("0") a la izquierda
$originalRut = ltrim($originalRut, '0');
$input = str_split($originalRut);
$cleanedRut = '';... | [
"public",
"function",
"clean",
"(",
"$",
"originalRut",
",",
"$",
"incluyeDigitoVerificador",
"=",
"true",
")",
"{",
"//Eliminamos espacios al principio y final",
"$",
"originalRut",
"=",
"trim",
"(",
"$",
"originalRut",
")",
";",
"//En caso de existir, eliminamos ceros... | Formatea un RUT
Estandariza un rut al formato 11222333-K desde cualquier
entrada valida como rut Ej.: 11.222.333-k, 11222333k, etc.
Si la entrada no parece válida retorna FALSE
Si se desea formatear un rut que no incluye dígito verificador,
se debe establecer el segundo parámetro a false.
@access public
@param st... | [
"Formatea",
"un",
"RUT"
] | d080af6d017fc62f8e3dd268d91f98fbeed4949f | https://github.com/malahierba-lab/chile-rut/blob/d080af6d017fc62f8e3dd268d91f98fbeed4949f/src/ChileRut.php#L71-L101 |
189,353 | view-components/view-components | src/Base/Html/AutoSubmittingInputTrait.php | AutoSubmittingInputTrait.setAutoSubmitting | public function setAutoSubmitting($value)
{
if ($this->autoSubmitting !== (bool)$value) {
$this->autoSubmitting = (bool)$value;
$this->onAutoSubmittingValueChange();
}
return $this;
} | php | public function setAutoSubmitting($value)
{
if ($this->autoSubmitting !== (bool)$value) {
$this->autoSubmitting = (bool)$value;
$this->onAutoSubmittingValueChange();
}
return $this;
} | [
"public",
"function",
"setAutoSubmitting",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autoSubmitting",
"!==",
"(",
"bool",
")",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"autoSubmitting",
"=",
"(",
"bool",
")",
"$",
"value",
";",
"$... | Sets auto-submitting option value.
If auto-submitting turned on, form will be submitted automatically on input value change.
@param bool $value
@return $this | [
"Sets",
"auto",
"-",
"submitting",
"option",
"value",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Base/Html/AutoSubmittingInputTrait.php#L21-L28 |
189,354 | view-components/view-components | src/Base/Html/AutoSubmittingInputTrait.php | AutoSubmittingInputTrait.enableAutoSubmitting | public function enableAutoSubmitting()
{
if ($this->autoSubmitting === false) {
$this->autoSubmitting = true;
$this->onAutoSubmittingValueChange();
}
return $this;
} | php | public function enableAutoSubmitting()
{
if ($this->autoSubmitting === false) {
$this->autoSubmitting = true;
$this->onAutoSubmittingValueChange();
}
return $this;
} | [
"public",
"function",
"enableAutoSubmitting",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autoSubmitting",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"autoSubmitting",
"=",
"true",
";",
"$",
"this",
"->",
"onAutoSubmittingValueChange",
"(",
")",
";",
"... | Enables auto-submitting.
@return $this | [
"Enables",
"auto",
"-",
"submitting",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Base/Html/AutoSubmittingInputTrait.php#L58-L65 |
189,355 | view-components/view-components | src/Base/Html/AutoSubmittingInputTrait.php | AutoSubmittingInputTrait.disableAutoSubmitting | public function disableAutoSubmitting()
{
if ($this->autoSubmitting === true) {
$this->autoSubmitting = false;
$this->onAutoSubmittingValueChange();
}
return $this;
} | php | public function disableAutoSubmitting()
{
if ($this->autoSubmitting === true) {
$this->autoSubmitting = false;
$this->onAutoSubmittingValueChange();
}
return $this;
} | [
"public",
"function",
"disableAutoSubmitting",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autoSubmitting",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"autoSubmitting",
"=",
"false",
";",
"$",
"this",
"->",
"onAutoSubmittingValueChange",
"(",
")",
";",
... | Disables auto-submitting.
@return $this | [
"Disables",
"auto",
"-",
"submitting",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Base/Html/AutoSubmittingInputTrait.php#L72-L79 |
189,356 | view-components/view-components | src/Data/ProcessorResolver/ProcessorResolver.php | ProcessorResolver.getProcessor | public function getProcessor(OperationInterface $operation)
{
$operationClass = get_class($operation);
if (!array_key_exists($operationClass, $this->processors)) {
throw new ProcessorNotFoundException(
$operationClass,
get_class($this)
);
... | php | public function getProcessor(OperationInterface $operation)
{
$operationClass = get_class($operation);
if (!array_key_exists($operationClass, $this->processors)) {
throw new ProcessorNotFoundException(
$operationClass,
get_class($this)
);
... | [
"public",
"function",
"getProcessor",
"(",
"OperationInterface",
"$",
"operation",
")",
"{",
"$",
"operationClass",
"=",
"get_class",
"(",
"$",
"operation",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"operationClass",
",",
"$",
"this",
"->",
"pr... | Returns operation processor instance.
@param OperationInterface $operation
@return ProcessorInterface | [
"Returns",
"operation",
"processor",
"instance",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/ProcessorResolver/ProcessorResolver.php#L44-L55 |
189,357 | view-components/view-components | src/Data/DbTable/Query.php | Query.getSql | public function getSql()
{
$where = (count($this->conditions) === 0)
? ''
: 'WHERE ' . implode(' and ', $this->conditions);
$sql = "SELECT $this->select FROM $this->table $where $this->order $this->limit $this->offset";
return $sql;
} | php | public function getSql()
{
$where = (count($this->conditions) === 0)
? ''
: 'WHERE ' . implode(' and ', $this->conditions);
$sql = "SELECT $this->select FROM $this->table $where $this->order $this->limit $this->offset";
return $sql;
} | [
"public",
"function",
"getSql",
"(",
")",
"{",
"$",
"where",
"=",
"(",
"count",
"(",
"$",
"this",
"->",
"conditions",
")",
"===",
"0",
")",
"?",
"''",
":",
"'WHERE '",
".",
"implode",
"(",
"' and '",
",",
"$",
"this",
"->",
"conditions",
")",
";",
... | Returns generated SQL.
@return string | [
"Returns",
"generated",
"SQL",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/DbTable/Query.php#L48-L55 |
189,358 | view-components/view-components | src/Data/DbTable/Query.php | Query.getPdoStatement | protected function getPdoStatement()
{
$statement = $this->connection->prepare($this->getSql());
if ($this->dataRowClass !== null) {
$statement->setFetchMode(PDO::FETCH_CLASS, $this->dataRowClass);
} else {
$statement->setFetchMode(PDO::FETCH_OBJ);
}
r... | php | protected function getPdoStatement()
{
$statement = $this->connection->prepare($this->getSql());
if ($this->dataRowClass !== null) {
$statement->setFetchMode(PDO::FETCH_CLASS, $this->dataRowClass);
} else {
$statement->setFetchMode(PDO::FETCH_OBJ);
}
r... | [
"protected",
"function",
"getPdoStatement",
"(",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"$",
"this",
"->",
"getSql",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"dataRowClass",
"!==",
"null",
")",
... | Prepares a PDOStatement for execution and returns it.
@return PDOStatement | [
"Prepares",
"a",
"PDOStatement",
"for",
"execution",
"and",
"returns",
"it",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/DbTable/Query.php#L62-L71 |
189,359 | view-components/view-components | src/Data/DbTable/Query.php | Query.execute | public function execute()
{
$statement = $this->getPdoStatement();
$result = $statement->execute($this->bindings);
if (!$result) {
$errorInfo = $statement->errorInfo();
throw new RuntimeException(
$errorInfo[1],
$errorInfo[2]
... | php | public function execute()
{
$statement = $this->getPdoStatement();
$result = $statement->execute($this->bindings);
if (!$result) {
$errorInfo = $statement->errorInfo();
throw new RuntimeException(
$errorInfo[1],
$errorInfo[2]
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"getPdoStatement",
"(",
")",
";",
"$",
"result",
"=",
"$",
"statement",
"->",
"execute",
"(",
"$",
"this",
"->",
"bindings",
")",
";",
"if",
"(",
"!",
"$",
"r... | Executes query.
@return PDOStatement | [
"Executes",
"query",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/DbTable/Query.php#L78-L90 |
189,360 | view-components/view-components | src/Data/DbTable/Query.php | Query.count | public function count()
{
$query = clone $this;
$query->select = 'count(*)';
return (int)$query->execute()->fetch(PDO::FETCH_NUM)[0];
} | php | public function count()
{
$query = clone $this;
$query->select = 'count(*)';
return (int)$query->execute()->fetch(PDO::FETCH_NUM)[0];
} | [
"public",
"function",
"count",
"(",
")",
"{",
"$",
"query",
"=",
"clone",
"$",
"this",
";",
"$",
"query",
"->",
"select",
"=",
"'count(*)'",
";",
"return",
"(",
"int",
")",
"$",
"query",
"->",
"execute",
"(",
")",
"->",
"fetch",
"(",
"PDO",
"::",
... | Returns records count.
Executes separate SQL query to count records.
@return int | [
"Returns",
"records",
"count",
".",
"Executes",
"separate",
"SQL",
"query",
"to",
"count",
"records",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/DbTable/Query.php#L98-L103 |
189,361 | view-components/view-components | src/Common/UriFunctions.php | UriFunctions.modifyQuery | public static function modifyQuery($uri, array $newQueryParams)
{
if ($uri === null) {
$uri = static::getCurrentRequestUri();
}
$query = parse_url($uri, PHP_URL_QUERY);
$queryParams = [];
parse_str($query, $queryParams);
$newQuery = http_build_query(arr... | php | public static function modifyQuery($uri, array $newQueryParams)
{
if ($uri === null) {
$uri = static::getCurrentRequestUri();
}
$query = parse_url($uri, PHP_URL_QUERY);
$queryParams = [];
parse_str($query, $queryParams);
$newQuery = http_build_query(arr... | [
"public",
"static",
"function",
"modifyQuery",
"(",
"$",
"uri",
",",
"array",
"$",
"newQueryParams",
")",
"{",
"if",
"(",
"$",
"uri",
"===",
"null",
")",
"{",
"$",
"uri",
"=",
"static",
"::",
"getCurrentRequestUri",
"(",
")",
";",
"}",
"$",
"query",
... | Modifies query string and returns updated request part of the URI.
@param string|null $uri
@param array $newQueryParams
@return string | [
"Modifies",
"query",
"string",
"and",
"returns",
"updated",
"request",
"part",
"of",
"the",
"URI",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Common/UriFunctions.php#L16-L33 |
189,362 | view-components/view-components | src/Common/UriFunctions.php | UriFunctions.replaceFragment | public static function replaceFragment($uri, $newFragment = '')
{
if ($uri === null) {
$uri = static::getCurrentRequestUri();
}
$oldFragment = parse_url($uri, PHP_URL_FRAGMENT);
return $oldFragment
? str_replace('#' . $oldFragment, '#' . $newFragment, $uri)
... | php | public static function replaceFragment($uri, $newFragment = '')
{
if ($uri === null) {
$uri = static::getCurrentRequestUri();
}
$oldFragment = parse_url($uri, PHP_URL_FRAGMENT);
return $oldFragment
? str_replace('#' . $oldFragment, '#' . $newFragment, $uri)
... | [
"public",
"static",
"function",
"replaceFragment",
"(",
"$",
"uri",
",",
"$",
"newFragment",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"uri",
"===",
"null",
")",
"{",
"$",
"uri",
"=",
"static",
"::",
"getCurrentRequestUri",
"(",
")",
";",
"}",
"$",
"oldFr... | Replaces fragment part and return updated request part of the URI.
@param string|null $uri
@param string $newFragment
@return string | [
"Replaces",
"fragment",
"part",
"and",
"return",
"updated",
"request",
"part",
"of",
"the",
"URI",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Common/UriFunctions.php#L42-L51 |
189,363 | view-components/view-components | src/Resource/ResourceManager.php | ResourceManager.js | public function js($aliasOrUrl)
{
$url = $this->getJsUrl($aliasOrUrl);
if (!$this->included->isIncluded($url)) {
$this->included->markAsIncluded($url);
$type = 'text/javascript';
return new Tag('script', ['src' => $url, 'type' => $type]);
} else {
... | php | public function js($aliasOrUrl)
{
$url = $this->getJsUrl($aliasOrUrl);
if (!$this->included->isIncluded($url)) {
$this->included->markAsIncluded($url);
$type = 'text/javascript';
return new Tag('script', ['src' => $url, 'type' => $type]);
} else {
... | [
"public",
"function",
"js",
"(",
"$",
"aliasOrUrl",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getJsUrl",
"(",
"$",
"aliasOrUrl",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"included",
"->",
"isIncluded",
"(",
"$",
"url",
")",
")",
"{",
"$"... | Returns component that renders html script tag for including specified javascript resource
or component that renders empty string if resource was already included.
@param string $aliasOrUrl script URL or alias
@return Tag|DataView | [
"Returns",
"component",
"that",
"renders",
"html",
"script",
"tag",
"for",
"including",
"specified",
"javascript",
"resource",
"or",
"component",
"that",
"renders",
"empty",
"string",
"if",
"resource",
"was",
"already",
"included",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Resource/ResourceManager.php#L40-L50 |
189,364 | view-components/view-components | src/Resource/ResourceManager.php | ResourceManager.css | public function css($aliasOrUrl, array $attributes = [])
{
$url = $this->getCssUrl($aliasOrUrl);
if (!$this->included->isIncluded($url)) {
$this->included->markAsIncluded($url);
return new Tag('link', array_merge([
'type' => 'text/css',
'rel' =... | php | public function css($aliasOrUrl, array $attributes = [])
{
$url = $this->getCssUrl($aliasOrUrl);
if (!$this->included->isIncluded($url)) {
$this->included->markAsIncluded($url);
return new Tag('link', array_merge([
'type' => 'text/css',
'rel' =... | [
"public",
"function",
"css",
"(",
"$",
"aliasOrUrl",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getCssUrl",
"(",
"$",
"aliasOrUrl",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"included",
"->",
... | Returns component that includes CSS resource to html page or
component that renders empty string if resource was already included.
@param string $aliasOrUrl CSS URL or alias
@param array $attributes
@return Tag|DataView | [
"Returns",
"component",
"that",
"includes",
"CSS",
"resource",
"to",
"html",
"page",
"or",
"component",
"that",
"renders",
"empty",
"string",
"if",
"resource",
"was",
"already",
"included",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Resource/ResourceManager.php#L60-L74 |
189,365 | view-components/view-components | src/Resource/ResourceManager.php | ResourceManager.inlineJs | public function inlineJs($jsCode, $uniqueId = null)
{
if ($uniqueId !== null) {
if ($this->included->isIncluded($uniqueId)) {
return new DataView();
} else {
$this->included->markAsIncluded($uniqueId);
}
}
return new TagWith... | php | public function inlineJs($jsCode, $uniqueId = null)
{
if ($uniqueId !== null) {
if ($this->included->isIncluded($uniqueId)) {
return new DataView();
} else {
$this->included->markAsIncluded($uniqueId);
}
}
return new TagWith... | [
"public",
"function",
"inlineJs",
"(",
"$",
"jsCode",
",",
"$",
"uniqueId",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"uniqueId",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"included",
"->",
"isIncluded",
"(",
"$",
"uniqueId",
")",
")",
"{... | Returns component that renders 'script' tag with js code.
@param string $jsCode
@param string|null $uniqueId specify unique id for inline code to avoid embedding it twice
@return DataView|TagWithText | [
"Returns",
"component",
"that",
"renders",
"script",
"tag",
"with",
"js",
"code",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Resource/ResourceManager.php#L155-L165 |
189,366 | view-components/view-components | src/Resource/ResourceManager.php | ResourceManager.inlineCss | public function inlineCss($cssCode, $uniqueId = null)
{
if ($uniqueId !== null) {
if ($this->included->isIncluded($uniqueId)) {
return new DataView();
} else {
$this->included->markAsIncluded($uniqueId);
}
}
return new TagWi... | php | public function inlineCss($cssCode, $uniqueId = null)
{
if ($uniqueId !== null) {
if ($this->included->isIncluded($uniqueId)) {
return new DataView();
} else {
$this->included->markAsIncluded($uniqueId);
}
}
return new TagWi... | [
"public",
"function",
"inlineCss",
"(",
"$",
"cssCode",
",",
"$",
"uniqueId",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"uniqueId",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"included",
"->",
"isIncluded",
"(",
"$",
"uniqueId",
")",
")",
... | Returns component that renders 'style' tag with css code.
@param string $cssCode
@param string|null $uniqueId specify unique id for inline code to avoid embedding it twice
@return DataView|TagWithText | [
"Returns",
"component",
"that",
"renders",
"style",
"tag",
"with",
"css",
"code",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Resource/ResourceManager.php#L174-L184 |
189,367 | view-components/view-components | src/Data/Processor/CustomProcessor.php | CustomProcessor.process | public function process($src, OperationInterface $operation)
{
$callable = $operation->getCallback();
$arguments = array_merge([$src], $operation->getArguments());
$res = call_user_func_array($callable, $arguments);
return $res ?: $src;
} | php | public function process($src, OperationInterface $operation)
{
$callable = $operation->getCallback();
$arguments = array_merge([$src], $operation->getArguments());
$res = call_user_func_array($callable, $arguments);
return $res ?: $src;
} | [
"public",
"function",
"process",
"(",
"$",
"src",
",",
"OperationInterface",
"$",
"operation",
")",
"{",
"$",
"callable",
"=",
"$",
"operation",
"->",
"getCallback",
"(",
")",
";",
"$",
"arguments",
"=",
"array_merge",
"(",
"[",
"$",
"src",
"]",
",",
"... | Applies operation to data source and returns modified data source.
@param $src
@param OperationInterface|CustomOperation $operation
@return mixed modified data source | [
"Applies",
"operation",
"to",
"data",
"source",
"and",
"returns",
"modified",
"data",
"source",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/Processor/CustomProcessor.php#L17-L23 |
189,368 | view-components/view-components | src/Rendering/HasTemplateTrait.php | HasTemplateTrait.resolveTemplate | public function resolveTemplate()
{
if (strpos($this->template, '*') !== false) {
return str_replace('*', $this->getTheme(), $this->template);
}
return $this->template;
} | php | public function resolveTemplate()
{
if (strpos($this->template, '*') !== false) {
return str_replace('*', $this->getTheme(), $this->template);
}
return $this->template;
} | [
"public",
"function",
"resolveTemplate",
"(",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"this",
"->",
"template",
",",
"'*'",
")",
"!==",
"false",
")",
"{",
"return",
"str_replace",
"(",
"'*'",
",",
"$",
"this",
"->",
"getTheme",
"(",
")",
",",
"$",
... | Returns template name considering used theme.
@return string | [
"Returns",
"template",
"name",
"considering",
"used",
"theme",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Rendering/HasTemplateTrait.php#L55-L61 |
189,369 | view-components/view-components | src/Component/Control/PageSizeSelectControl.php | PageSizeSelectControl.setPaginationControl | public function setPaginationControl(PaginationControl $paginationControl = null)
{
$this->paginationControl = $paginationControl;
$paginationControl && $this->updatePagination();
return $this;
} | php | public function setPaginationControl(PaginationControl $paginationControl = null)
{
$this->paginationControl = $paginationControl;
$paginationControl && $this->updatePagination();
return $this;
} | [
"public",
"function",
"setPaginationControl",
"(",
"PaginationControl",
"$",
"paginationControl",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"paginationControl",
"=",
"$",
"paginationControl",
";",
"$",
"paginationControl",
"&&",
"$",
"this",
"->",
"updatePagination"... | Sets pagination control affected by page size select control.
@param null|PaginationControl $paginationControl
@return PageSizeSelectControl | [
"Sets",
"pagination",
"control",
"affected",
"by",
"page",
"size",
"select",
"control",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Control/PageSizeSelectControl.php#L107-L112 |
189,370 | view-components/view-components | src/Rendering/SimpleRenderer.php | SimpleRenderer.render | public function render($template, array $viewData = [])
{
$filePath = $this->finder->getTemplatePath($template);
if ($filePath == false) {
throw new InvalidArgumentException("Can't load template '$template'");
}
ob_start();
extract($viewData);
include($fil... | php | public function render($template, array $viewData = [])
{
$filePath = $this->finder->getTemplatePath($template);
if ($filePath == false) {
throw new InvalidArgumentException("Can't load template '$template'");
}
ob_start();
extract($viewData);
include($fil... | [
"public",
"function",
"render",
"(",
"$",
"template",
",",
"array",
"$",
"viewData",
"=",
"[",
"]",
")",
"{",
"$",
"filePath",
"=",
"$",
"this",
"->",
"finder",
"->",
"getTemplatePath",
"(",
"$",
"template",
")",
";",
"if",
"(",
"$",
"filePath",
"=="... | Renders template and returns output.
@param string $template template name
@param array $viewData
@return string | [
"Renders",
"template",
"and",
"returns",
"output",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Rendering/SimpleRenderer.php#L35-L47 |
189,371 | view-components/view-components | src/Data/ArrayDataAggregateTrait.php | ArrayDataAggregateTrait.mergeData | public function mergeData($data, $overridePrevious = true)
{
$oldData = $this->getData();
if ($oldData === null) {
$oldData = [];
}
if (is_object($data)) {
$data = get_object_vars($data);
}
$this->setData($overridePrevious ? array_merge($oldDat... | php | public function mergeData($data, $overridePrevious = true)
{
$oldData = $this->getData();
if ($oldData === null) {
$oldData = [];
}
if (is_object($data)) {
$data = get_object_vars($data);
}
$this->setData($overridePrevious ? array_merge($oldDat... | [
"public",
"function",
"mergeData",
"(",
"$",
"data",
",",
"$",
"overridePrevious",
"=",
"true",
")",
"{",
"$",
"oldData",
"=",
"$",
"this",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"$",
"oldData",
"===",
"null",
")",
"{",
"$",
"oldData",
"=",
"["... | Merges new data if possible.
@param array|object $data
@param bool $overridePrevious
@return $this | [
"Merges",
"new",
"data",
"if",
"possible",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/ArrayDataAggregateTrait.php#L15-L26 |
189,372 | view-components/view-components | src/Component/ViewAggregate.php | ViewAggregate.setView | public function setView(ViewComponentInterface $view = null)
{
if ($view === $this->view) {
return $this;
}
$this->view && $this->view->detach();
$view && $view->attachTo($this);
$this->view = $view;
return $this;
} | php | public function setView(ViewComponentInterface $view = null)
{
if ($view === $this->view) {
return $this;
}
$this->view && $this->view->detach();
$view && $view->attachTo($this);
$this->view = $view;
return $this;
} | [
"public",
"function",
"setView",
"(",
"ViewComponentInterface",
"$",
"view",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"view",
"===",
"$",
"this",
"->",
"view",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"view",
"&&",
"$",
"this",
"... | Sets view component.
@param ViewComponentInterface $view
@return $this | [
"Sets",
"view",
"component",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/ViewAggregate.php#L48-L57 |
189,373 | view-components/view-components | src/Resource/AliasRegistry.php | AliasRegistry.get | public function get($name, $default = null)
{
if (array_key_exists($name, $this->aliases)) {
return $this->aliases[$name];
} else {
return $default;
}
} | php | public function get($name, $default = null)
{
if (array_key_exists($name, $this->aliases)) {
return $this->aliases[$name];
} else {
return $default;
}
} | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"aliases",
")",
")",
"{",
"return",
"$",
"this",
"->",
"aliases",
"[",
"$",
"name",
... | Returns aliased value or default value if requested alias does not exists.
@param string $name
@param string|null $default
@return string|null | [
"Returns",
"aliased",
"value",
"or",
"default",
"value",
"if",
"requested",
"alias",
"does",
"not",
"exists",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Resource/AliasRegistry.php#L52-L59 |
189,374 | view-components/view-components | src/Component/TemplateView.php | TemplateView.getRenderer | public function getRenderer()
{
if ($this->renderer === null) {
$this->renderer = Services::renderer();
}
return $this->renderer;
} | php | public function getRenderer()
{
if ($this->renderer === null) {
$this->renderer = Services::renderer();
}
return $this->renderer;
} | [
"public",
"function",
"getRenderer",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"renderer",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"renderer",
"=",
"Services",
"::",
"renderer",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"renderer",
";",... | Returns renderer instance used to render template.
@return RendererInterface | [
"Returns",
"renderer",
"instance",
"used",
"to",
"render",
"template",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/TemplateView.php#L57-L63 |
189,375 | view-components/view-components | src/Data/ProcessingService/ArrayProcessingService.php | ArrayProcessingService.makeRowObjects | private function makeRowObjects($src)
{
$newSrc = [];
foreach ($src as $row) {
$newSrc[] = is_array($row) ? (object)$row : $row;
}
return $newSrc;
} | php | private function makeRowObjects($src)
{
$newSrc = [];
foreach ($src as $row) {
$newSrc[] = is_array($row) ? (object)$row : $row;
}
return $newSrc;
} | [
"private",
"function",
"makeRowObjects",
"(",
"$",
"src",
")",
"{",
"$",
"newSrc",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"src",
"as",
"$",
"row",
")",
"{",
"$",
"newSrc",
"[",
"]",
"=",
"is_array",
"(",
"$",
"row",
")",
"?",
"(",
"object",
"... | Makes array of objects from array of arrays.
@param $src
@return array | [
"Makes",
"array",
"of",
"objects",
"from",
"array",
"of",
"arrays",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Data/ProcessingService/ArrayProcessingService.php#L45-L52 |
189,376 | view-components/view-components | src/Base/Html/TagTrait.php | TagTrait.renderAttributes | public static function renderAttributes(array $attributes)
{
$html = [];
foreach ($attributes as $key => $value) {
$escaped = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
$html[] = is_numeric($key) ?
($escaped . '="' . $escaped . '""')
:
... | php | public static function renderAttributes(array $attributes)
{
$html = [];
foreach ($attributes as $key => $value) {
$escaped = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
$html[] = is_numeric($key) ?
($escaped . '="' . $escaped . '""')
:
... | [
"public",
"static",
"function",
"renderAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"html",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"escaped",
"=",
"htmlentities",
"(",... | Renders HTML tag attributes.
@param array $attributes
@return string | [
"Renders",
"HTML",
"tag",
"attributes",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Base/Html/TagTrait.php#L51-L62 |
189,377 | view-components/view-components | src/Service/Bootstrap.php | Bootstrap.getContainer | public static function getContainer()
{
if (!self::$container) {
self::$container = new ServiceContainer();
self::provideServices();
}
return self::$container;
} | php | public static function getContainer()
{
if (!self::$container) {
self::$container = new ServiceContainer();
self::provideServices();
}
return self::$container;
} | [
"public",
"static",
"function",
"getContainer",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"container",
")",
"{",
"self",
"::",
"$",
"container",
"=",
"new",
"ServiceContainer",
"(",
")",
";",
"self",
"::",
"provideServices",
"(",
")",
";",
"}",... | Returns service container used with presentation framework.
@return ServiceContainer | [
"Returns",
"service",
"container",
"used",
"with",
"presentation",
"framework",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Service/Bootstrap.php#L31-L38 |
189,378 | view-components/view-components | src/Service/Bootstrap.php | Bootstrap.registerServiceProvider | public static function registerServiceProvider($serviceProvider)
{
if (is_callable($serviceProvider)) {
$serviceProvider = new CustomServiceProvider($serviceProvider);
} elseif (!is_a($serviceProvider, ServiceProviderInterface::class, true)) {
throw new BootstrapException(
... | php | public static function registerServiceProvider($serviceProvider)
{
if (is_callable($serviceProvider)) {
$serviceProvider = new CustomServiceProvider($serviceProvider);
} elseif (!is_a($serviceProvider, ServiceProviderInterface::class, true)) {
throw new BootstrapException(
... | [
"public",
"static",
"function",
"registerServiceProvider",
"(",
"$",
"serviceProvider",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"serviceProvider",
")",
")",
"{",
"$",
"serviceProvider",
"=",
"new",
"CustomServiceProvider",
"(",
"$",
"serviceProvider",
")",
... | Registers service provider.
This method can be used before or after service container initialization.
@param string|callable $serviceProvider service provider class or callable | [
"Registers",
"service",
"provider",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Service/Bootstrap.php#L47-L63 |
189,379 | view-components/view-components | src/Service/ServiceContainer.php | ServiceContainer.set | public function set($id, callable $callback)
{
if ($this->has($id)) {
throw new Exception\AlreadyExistsException;
}
$this->callbacks[$id] = $callback;
} | php | public function set($id, callable $callback)
{
if ($this->has($id)) {
throw new Exception\AlreadyExistsException;
}
$this->callbacks[$id] = $callback;
} | [
"public",
"function",
"set",
"(",
"$",
"id",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"AlreadyExistsException",
";",
"}",
"$",
"this",
"->",
"... | Defines service.
@param $id
@param callable $callback accepts container as first argument | [
"Defines",
"service",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Service/ServiceContainer.php#L23-L29 |
189,380 | view-components/view-components | src/Service/ServiceContainer.php | ServiceContainer.get | public function get($id)
{
if (!$this->has($id)) {
throw new Exception\NotFoundException;
}
if (!$this->isReady($id)) {
$this->instantiate($id);
}
return $this->instances[$id];
} | php | public function get($id)
{
if (!$this->has($id)) {
throw new Exception\NotFoundException;
}
if (!$this->isReady($id)) {
$this->instantiate($id);
}
return $this->instances[$id];
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"NotFoundException",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"isReady",
"(",
... | Returns specified service.
Throws exception if requested service not exists.
@param string $id
@return mixed | [
"Returns",
"specified",
"service",
".",
"Throws",
"exception",
"if",
"requested",
"service",
"not",
"exists",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Service/ServiceContainer.php#L49-L58 |
189,381 | view-components/view-components | src/Service/ServiceContainer.php | ServiceContainer.extend | public function extend($id, callable $callback)
{
if (!$this->has($id)) {
throw new Exception\NotFoundException;
}
$oldCallback = $this->callbacks[$id];
$this->callbacks[$id] = function () use ($oldCallback, $callback, $id) {
if (!$this->isReady($id)) {
... | php | public function extend($id, callable $callback)
{
if (!$this->has($id)) {
throw new Exception\NotFoundException;
}
$oldCallback = $this->callbacks[$id];
$this->callbacks[$id] = function () use ($oldCallback, $callback, $id) {
if (!$this->isReady($id)) {
... | [
"public",
"function",
"extend",
"(",
"$",
"id",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"NotFoundException",
";",
"}",
"$",
"oldCallback",... | Extends existing service.
@param string $id
@param callable $callback accepts extended service instance as first argument and container as second
@return $this | [
"Extends",
"existing",
"service",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Service/ServiceContainer.php#L67-L90 |
189,382 | view-components/view-components | src/Service/ServiceContainer.php | ServiceContainer.instantiate | protected function instantiate($id)
{
$this->instances[$id] = call_user_func($this->callbacks[$id], $this);
} | php | protected function instantiate($id)
{
$this->instances[$id] = call_user_func($this->callbacks[$id], $this);
} | [
"protected",
"function",
"instantiate",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"instances",
"[",
"$",
"id",
"]",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"id",
"]",
",",
"$",
"this",
")",
";",
"}"
] | Instantiates specified service.
@param string $id | [
"Instantiates",
"specified",
"service",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Service/ServiceContainer.php#L97-L100 |
189,383 | view-components/view-components | src/Customization/Configurable/Customization.php | Customization.apply | public function apply(ComponentInterface $component)
{
/**
* isRootOfCustomizations property used in TargetSelector
* @see TargetSelector::checkRootCondition
*/
$component->isRootOfCustomizations = true;
parent::apply($component);
unset($component->isRootOf... | php | public function apply(ComponentInterface $component)
{
/**
* isRootOfCustomizations property used in TargetSelector
* @see TargetSelector::checkRootCondition
*/
$component->isRootOfCustomizations = true;
parent::apply($component);
unset($component->isRootOf... | [
"public",
"function",
"apply",
"(",
"ComponentInterface",
"$",
"component",
")",
"{",
"/**\n * isRootOfCustomizations property used in TargetSelector\n * @see TargetSelector::checkRootCondition\n */",
"$",
"component",
"->",
"isRootOfCustomizations",
"=",
"true"... | Applies customization to target component and its children.
@param ComponentInterface $component | [
"Applies",
"customization",
"to",
"target",
"component",
"and",
"its",
"children",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Customization/Configurable/Customization.php#L40-L49 |
189,384 | view-components/view-components | src/Rendering/TemplateFinder.php | TemplateFinder.registerPath | public function registerPath($path, $highPriority = true)
{
if ($highPriority) {
array_unshift($this->paths, $path);
} else {
array_push($this->paths, $path);
}
return $this;
} | php | public function registerPath($path, $highPriority = true)
{
if ($highPriority) {
array_unshift($this->paths, $path);
} else {
array_push($this->paths, $path);
}
return $this;
} | [
"public",
"function",
"registerPath",
"(",
"$",
"path",
",",
"$",
"highPriority",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"highPriority",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"paths",
",",
"$",
"path",
")",
";",
"}",
"else",
"{",
"array_... | Registers path to views.
@param string $path
@param bool $highPriority
@return $this | [
"Registers",
"path",
"to",
"views",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Rendering/TemplateFinder.php#L31-L39 |
189,385 | view-components/view-components | src/Rendering/TemplateFinder.php | TemplateFinder.getTemplatePath | public function getTemplatePath($templateName)
{
$fileName = "$templateName.php";
foreach ($this->paths as $path) {
$fullPath = $path . DIRECTORY_SEPARATOR . $fileName;
if (is_file($fullPath)) {
return $fullPath;
}
}
return false;
... | php | public function getTemplatePath($templateName)
{
$fileName = "$templateName.php";
foreach ($this->paths as $path) {
$fullPath = $path . DIRECTORY_SEPARATOR . $fileName;
if (is_file($fullPath)) {
return $fullPath;
}
}
return false;
... | [
"public",
"function",
"getTemplatePath",
"(",
"$",
"templateName",
")",
"{",
"$",
"fileName",
"=",
"\"$templateName.php\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"paths",
"as",
"$",
"path",
")",
"{",
"$",
"fullPath",
"=",
"$",
"path",
".",
"DIRECTORY_SEP... | Returns full path to template file.
@param string $templateName
@return bool|string full path or false | [
"Returns",
"full",
"path",
"to",
"template",
"file",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Rendering/TemplateFinder.php#L47-L57 |
189,386 | view-components/view-components | src/Component/ManagedList.php | ManagedList.setDataProvider | public function setDataProvider(DataProviderInterface $dataProvider = null)
{
$this->setData($dataProvider);
$this->isOperationsApplied = false;
return $this;
} | php | public function setDataProvider(DataProviderInterface $dataProvider = null)
{
$this->setData($dataProvider);
$this->isOperationsApplied = false;
return $this;
} | [
"public",
"function",
"setDataProvider",
"(",
"DataProviderInterface",
"$",
"dataProvider",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setData",
"(",
"$",
"dataProvider",
")",
";",
"$",
"this",
"->",
"isOperationsApplied",
"=",
"false",
";",
"return",
"$",
"... | Sets data provider.
@param DataProviderInterface|null $dataProvider
@return $this | [
"Sets",
"data",
"provider",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/ManagedList.php#L192-L197 |
189,387 | view-components/view-components | src/Component/ManagedList.php | ManagedList.prepare | protected function prepare()
{
/** @var CollectionView $collection */
$collection = $this->getComponent('collection_view');
$collection->setData($this->getDataProvider());
if ($collection->getDataInjector() === null) {
$collection->setDataInjector($this->makeDataInjector(... | php | protected function prepare()
{
/** @var CollectionView $collection */
$collection = $this->getComponent('collection_view');
$collection->setData($this->getDataProvider());
if ($collection->getDataInjector() === null) {
$collection->setDataInjector($this->makeDataInjector(... | [
"protected",
"function",
"prepare",
"(",
")",
"{",
"/** @var CollectionView $collection */",
"$",
"collection",
"=",
"$",
"this",
"->",
"getComponent",
"(",
"'collection_view'",
")",
";",
"$",
"collection",
"->",
"setData",
"(",
"$",
"this",
"->",
"getDataProvider... | Prepares component for rendering. | [
"Prepares",
"component",
"for",
"rendering",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/ManagedList.php#L223-L233 |
189,388 | view-components/view-components | src/Component/ManagedList.php | ManagedList.hideSubmitButtonIfNotUsed | protected function hideSubmitButtonIfNotUsed()
{
$submit = $this->getComponent(static::SUBMIT_BUTTON_ID);
if (!$submit) {
return;
}
/**
* @see \ViewComponents\ViewComponents\Base\Control\ControlInterface::isManualFormSubmitRequired
*/
if (!$this
... | php | protected function hideSubmitButtonIfNotUsed()
{
$submit = $this->getComponent(static::SUBMIT_BUTTON_ID);
if (!$submit) {
return;
}
/**
* @see \ViewComponents\ViewComponents\Base\Control\ControlInterface::isManualFormSubmitRequired
*/
if (!$this
... | [
"protected",
"function",
"hideSubmitButtonIfNotUsed",
"(",
")",
"{",
"$",
"submit",
"=",
"$",
"this",
"->",
"getComponent",
"(",
"static",
"::",
"SUBMIT_BUTTON_ID",
")",
";",
"if",
"(",
"!",
"$",
"submit",
")",
"{",
"return",
";",
"}",
"/**\n * @see ... | Hides 'submit_button' component if it's not required by another components. | [
"Hides",
"submit_button",
"component",
"if",
"it",
"s",
"not",
"required",
"by",
"another",
"components",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/ManagedList.php#L238-L256 |
189,389 | view-components/view-components | src/Component/ManagedList.php | ManagedList.applyOperations | protected function applyOperations()
{
if (!$this->isOperationsApplied) {
$this->isOperationsApplied = true;
foreach ($this->getControls() as $control) {
$this->getDataProvider()->operations()->add($control->getOperation());
}
}
} | php | protected function applyOperations()
{
if (!$this->isOperationsApplied) {
$this->isOperationsApplied = true;
foreach ($this->getControls() as $control) {
$this->getDataProvider()->operations()->add($control->getOperation());
}
}
} | [
"protected",
"function",
"applyOperations",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isOperationsApplied",
")",
"{",
"$",
"this",
"->",
"isOperationsApplied",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"getControls",
"(",
")",
"as",
"... | Applies operations provided by controls to data provider. | [
"Applies",
"operations",
"provided",
"by",
"controls",
"to",
"data",
"provider",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/ManagedList.php#L261-L269 |
189,390 | view-components/view-components | src/Component/Layout.php | Layout.setTemplate | public function setTemplate($template)
{
if (is_string($template)) {
$template = new TemplateView($template);
}
$template->mergeData([
'layout' => $this
]);
$this->addChild(new Part($template, 'template'));
return $this;
} | php | public function setTemplate($template)
{
if (is_string($template)) {
$template = new TemplateView($template);
}
$template->mergeData([
'layout' => $this
]);
$this->addChild(new Part($template, 'template'));
return $this;
} | [
"public",
"function",
"setTemplate",
"(",
"$",
"template",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"template",
")",
")",
"{",
"$",
"template",
"=",
"new",
"TemplateView",
"(",
"$",
"template",
")",
";",
"}",
"$",
"template",
"->",
"mergeData",
"(",... | Sets layout template.
@param TemplateView|string $template
@return $this | [
"Sets",
"layout",
"template",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Layout.php#L54-L64 |
189,391 | view-components/view-components | src/Component/Layout.php | Layout.section | public function section($name, $createIfNotExists = true)
{
$section = $this->getComponent('section-' . $name);
if (!$section && $createIfNotExists) {
$section = new Section($name);
$section->attachToCompound($this);
}
return $section;
} | php | public function section($name, $createIfNotExists = true)
{
$section = $this->getComponent('section-' . $name);
if (!$section && $createIfNotExists) {
$section = new Section($name);
$section->attachToCompound($this);
}
return $section;
} | [
"public",
"function",
"section",
"(",
"$",
"name",
",",
"$",
"createIfNotExists",
"=",
"true",
")",
"{",
"$",
"section",
"=",
"$",
"this",
"->",
"getComponent",
"(",
"'section-'",
".",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"section",
"&&",
"$",... | Returns section with specified name.
@param string $name
@param bool $createIfNotExists
@return Section|null | [
"Returns",
"section",
"with",
"specified",
"name",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Layout.php#L83-L91 |
189,392 | view-components/view-components | src/Component/Layout.php | Layout.placeToSections | public function placeToSections(array $componentsBySections)
{
foreach ($componentsBySections as $section => $children) {
if (!is_array($children)) {
throw new InvalidArgumentException(
'Wrong argument format for Layout::placeToSections. Array of components fo... | php | public function placeToSections(array $componentsBySections)
{
foreach ($componentsBySections as $section => $children) {
if (!is_array($children)) {
throw new InvalidArgumentException(
'Wrong argument format for Layout::placeToSections. Array of components fo... | [
"public",
"function",
"placeToSections",
"(",
"array",
"$",
"componentsBySections",
")",
"{",
"foreach",
"(",
"$",
"componentsBySections",
"as",
"$",
"section",
"=>",
"$",
"children",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"children",
")",
")",
"{... | Places components to layout sections.
@param array <string, ComponentInterface[]> $componentsBySections
@return $this | [
"Places",
"components",
"to",
"layout",
"sections",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Layout.php#L114-L125 |
189,393 | view-components/view-components | src/Component/Layout.php | Layout.render | public function render()
{
$this->moveChildrenToMainSection();
$this->getTemplate()
->mergeData($this->getData())
->mergeData(['layout' => $this]);
return parent::render();
} | php | public function render()
{
$this->moveChildrenToMainSection();
$this->getTemplate()
->mergeData($this->getData())
->mergeData(['layout' => $this]);
return parent::render();
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"moveChildrenToMainSection",
"(",
")",
";",
"$",
"this",
"->",
"getTemplate",
"(",
")",
"->",
"mergeData",
"(",
"$",
"this",
"->",
"getData",
"(",
")",
")",
"->",
"mergeData",
"(",
"[",
... | Renders layout.
@return string rendered layout | [
"Renders",
"layout",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Layout.php#L157-L164 |
189,394 | view-components/view-components | src/Component/Layout.php | Layout.getResourceManager | protected function getResourceManager()
{
if ($this->resourceManager === null) {
$this->resourceManager = Services::resourceManager();
}
return $this->resourceManager;
} | php | protected function getResourceManager()
{
if ($this->resourceManager === null) {
$this->resourceManager = Services::resourceManager();
}
return $this->resourceManager;
} | [
"protected",
"function",
"getResourceManager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resourceManager",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"resourceManager",
"=",
"Services",
"::",
"resourceManager",
"(",
")",
";",
"}",
"return",
"$",
"this... | Returns resource manager instance used by component.
@return ResourceManager | [
"Returns",
"resource",
"manager",
"instance",
"used",
"by",
"component",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Layout.php#L203-L209 |
189,395 | view-components/view-components | src/Component/Layout/Section.php | Section.css | public function css($name, $attributes = [])
{
$this->getLayout()->css($name, $attributes)->attachTo($this);
return $this;
} | php | public function css($name, $attributes = [])
{
$this->getLayout()->css($name, $attributes)->attachTo($this);
return $this;
} | [
"public",
"function",
"css",
"(",
"$",
"name",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"getLayout",
"(",
")",
"->",
"css",
"(",
"$",
"name",
",",
"$",
"attributes",
")",
"->",
"attachTo",
"(",
"$",
"this",
")",
";",
... | Includes CSS resource. Prevents including same resource twice.
@param string $name resource Url or alias name
@param array $attributes
@return $this | [
"Includes",
"CSS",
"resource",
".",
"Prevents",
"including",
"same",
"resource",
"twice",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Layout/Section.php#L53-L57 |
189,396 | view-components/view-components | src/Component/Compound.php | Compound.removeComponent | public function removeComponent($id)
{
/** @var PartInterface $component */
$component = $this->getComponents()->findByProperty('id', $id, true);
if ($component) {
$this->getComponents()->remove($component);
}
return $this;
} | php | public function removeComponent($id)
{
/** @var PartInterface $component */
$component = $this->getComponents()->findByProperty('id', $id, true);
if ($component) {
$this->getComponents()->remove($component);
}
return $this;
} | [
"public",
"function",
"removeComponent",
"(",
"$",
"id",
")",
"{",
"/** @var PartInterface $component */",
"$",
"component",
"=",
"$",
"this",
"->",
"getComponents",
"(",
")",
"->",
"findByProperty",
"(",
"'id'",
",",
"$",
"id",
",",
"true",
")",
";",
"if",
... | Removes component from compound.
@param string $id
@return $this | [
"Removes",
"component",
"from",
"compound",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Compound.php#L128-L136 |
189,397 | view-components/view-components | src/Customization/Configurable/OperationProcessor.php | OperationProcessor.apply | public function apply(ComponentInterface $component, $operations)
{
if (is_string($operations) || $operations instanceof Closure) {
$operations = [$operations];
}
foreach ($operations as $operation) {
if (is_string($operation)) {
list($key, $value) = e... | php | public function apply(ComponentInterface $component, $operations)
{
if (is_string($operations) || $operations instanceof Closure) {
$operations = [$operations];
}
foreach ($operations as $operation) {
if (is_string($operation)) {
list($key, $value) = e... | [
"public",
"function",
"apply",
"(",
"ComponentInterface",
"$",
"component",
",",
"$",
"operations",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"operations",
")",
"||",
"$",
"operations",
"instanceof",
"Closure",
")",
"{",
"$",
"operations",
"=",
"[",
"$",... | Applies operations to target component.
@param ComponentInterface $component
@param $operations | [
"Applies",
"operations",
"to",
"target",
"component",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Customization/Configurable/OperationProcessor.php#L37-L52 |
189,398 | view-components/view-components | src/Component/Debug/SymfonyVarDump.php | SymfonyVarDump.render | public function render()
{
$cloner = new VarCloner();
$dumper = ('cli' === PHP_SAPI ? new CliDumper : new HtmlDumper);
$output = fopen('php://memory', 'r+b');
$dumper->dump($cloner->cloneVar($this->getData()), $output);
return stream_get_contents($output, -1, 0);
} | php | public function render()
{
$cloner = new VarCloner();
$dumper = ('cli' === PHP_SAPI ? new CliDumper : new HtmlDumper);
$output = fopen('php://memory', 'r+b');
$dumper->dump($cloner->cloneVar($this->getData()), $output);
return stream_get_contents($output, -1, 0);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"cloner",
"=",
"new",
"VarCloner",
"(",
")",
";",
"$",
"dumper",
"=",
"(",
"'cli'",
"===",
"PHP_SAPI",
"?",
"new",
"CliDumper",
":",
"new",
"HtmlDumper",
")",
";",
"$",
"output",
"=",
"fopen",
"(",
... | Renders data.
@return string | [
"Renders",
"data",
"."
] | 0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb | https://github.com/view-components/view-components/blob/0c6faa969e70b0f6d16fa6a24bd12da1ac30d3eb/src/Component/Debug/SymfonyVarDump.php#L40-L47 |
189,399 | bupy7/yii2-dynamic-fields | DynaFields.php | DynaFields.field | protected function field($form, $model, $attribute, $button)
{
$field = $form->field($model, $attribute, $this->fieldOptions);
$field = call_user_func_array([$field, $this->inputMethod], $this->inputMethodArgs);
return str_replace('{button}', $button, $field);
} | php | protected function field($form, $model, $attribute, $button)
{
$field = $form->field($model, $attribute, $this->fieldOptions);
$field = call_user_func_array([$field, $this->inputMethod], $this->inputMethodArgs);
return str_replace('{button}', $button, $field);
} | [
"protected",
"function",
"field",
"(",
"$",
"form",
",",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"button",
")",
"{",
"$",
"field",
"=",
"$",
"form",
"->",
"field",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"this",
"->",
"fieldOptio... | Render field of \yii\widgets\ActiveForm.
@param \yii\widgets\ActiveForm $form
@param \yii\base\Model $model The data model.
@param string $attribute Attribute name.
@param string $button Action button of field.
@return string | [
"Render",
"field",
"of",
"\\",
"yii",
"\\",
"widgets",
"\\",
"ActiveForm",
"."
] | 90100d5a7fa3c42ca1fbd5e532a59c5e5ed0d0f6 | https://github.com/bupy7/yii2-dynamic-fields/blob/90100d5a7fa3c42ca1fbd5e532a59c5e5ed0d0f6/DynaFields.php#L178-L183 |
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.