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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
236,500 | sebardo/core | CoreBundle/Service/Mailer.php | Mailer.sendTrackingCodeEmailMessage | public function sendTrackingCodeEmailMessage(Transaction $transaction)
{
$templateName = 'PaymentBundle:Email:trackingCode.html.twig';
$toEmail = $transaction->getActor()->getEmail();
$context = array(
'order_number' => $transaction->getTransactionKey(),
'tracking_c... | php | public function sendTrackingCodeEmailMessage(Transaction $transaction)
{
$templateName = 'PaymentBundle:Email:trackingCode.html.twig';
$toEmail = $transaction->getActor()->getEmail();
$context = array(
'order_number' => $transaction->getTransactionKey(),
'tracking_c... | [
"public",
"function",
"sendTrackingCodeEmailMessage",
"(",
"Transaction",
"$",
"transaction",
")",
"{",
"$",
"templateName",
"=",
"'PaymentBundle:Email:trackingCode.html.twig'",
";",
"$",
"toEmail",
"=",
"$",
"transaction",
"->",
"getActor",
"(",
")",
"->",
"getEmail"... | Send the tracking code
@param Transaction $transaction | [
"Send",
"the",
"tracking",
"code"
] | d063334639dd717406c97ea4da9f4b260d0af4f4 | https://github.com/sebardo/core/blob/d063334639dd717406c97ea4da9f4b260d0af4f4/CoreBundle/Service/Mailer.php#L512-L524 |
236,501 | PowerOnSystem/WebFramework | src/Exceptions/PowerOnException.php | PowerOnException.log | public function log( \Monolog\Logger $logger) {
$reflection = new \ReflectionClass($this);
$logger->error($this->getMessage(), [
'type' => $reflection->getShortName(),
'code' => $this->getCode(),
'line' => $this->getLine(),
'file' => $this->getFile()... | php | public function log( \Monolog\Logger $logger) {
$reflection = new \ReflectionClass($this);
$logger->error($this->getMessage(), [
'type' => $reflection->getShortName(),
'code' => $this->getCode(),
'line' => $this->getLine(),
'file' => $this->getFile()... | [
"public",
"function",
"log",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"$",
"logger",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"logger",
"->",
"error",
"(",
"$",
"this",
"->",
"getMessage",
"(",
"... | Guarda un log del error
@param \Monolog\Logger $logger | [
"Guarda",
"un",
"log",
"del",
"error"
] | 3b885a390adc42d6ad93d7900d33d97c66a6c2a9 | https://github.com/PowerOnSystem/WebFramework/blob/3b885a390adc42d6ad93d7900d33d97c66a6c2a9/src/Exceptions/PowerOnException.php#L90-L100 |
236,502 | b01/slib | src/SlibException.php | SlibException.getMessageByCode | public function getMessageByCode(& $code, array $data = null)
{
// If we do not use a reference, then that defeats the purpose of
// making the $errorMap a static property.
$map = &static::getErrorMap();
// When you can't find the code, use a default one.
if (!\array_key_exi... | php | public function getMessageByCode(& $code, array $data = null)
{
// If we do not use a reference, then that defeats the purpose of
// making the $errorMap a static property.
$map = &static::getErrorMap();
// When you can't find the code, use a default one.
if (!\array_key_exi... | [
"public",
"function",
"getMessageByCode",
"(",
"&",
"$",
"code",
",",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"// If we do not use a reference, then that defeats the purpose of",
"// making the $errorMap a static property.",
"$",
"map",
"=",
"&",
"static",
"::",
"g... | Convert error code to human readable text.
@param mixed & $code
@param array $data
@return string | [
"Convert",
"error",
"code",
"to",
"human",
"readable",
"text",
"."
] | 56149adcd85f1493c11651a50dda4612a3705cbb | https://github.com/b01/slib/blob/56149adcd85f1493c11651a50dda4612a3705cbb/src/SlibException.php#L43-L59 |
236,503 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.getParentDsId | public function getParentDsId($dsId)
{
if (!array_key_exists($dsId, $this->parentMap)) {
throw new InvalidArgumentException('Unknown ds_id ', $dsId);
}
return $this->parentMap[$dsId];
} | php | public function getParentDsId($dsId)
{
if (!array_key_exists($dsId, $this->parentMap)) {
throw new InvalidArgumentException('Unknown ds_id ', $dsId);
}
return $this->parentMap[$dsId];
} | [
"public",
"function",
"getParentDsId",
"(",
"$",
"dsId",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"dsId",
",",
"$",
"this",
"->",
"parentMap",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Unknown ds_id '",
",",
"$",
"dsI... | Get parent node by node id.
@param string $dsId
@return string
@throws InvalidArgumentException | [
"Get",
"parent",
"node",
"by",
"node",
"id",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L107-L114 |
236,504 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.getParentNode | public function getParentNode($dsId)
{
$parentDsId = $this->getParentDsId($dsId);
if (null === $parentDsId) {
return null;
}
return $this->dsIdMap[$parentDsId];
} | php | public function getParentNode($dsId)
{
$parentDsId = $this->getParentDsId($dsId);
if (null === $parentDsId) {
return null;
}
return $this->dsIdMap[$parentDsId];
} | [
"public",
"function",
"getParentNode",
"(",
"$",
"dsId",
")",
"{",
"$",
"parentDsId",
"=",
"$",
"this",
"->",
"getParentDsId",
"(",
"$",
"dsId",
")",
";",
"if",
"(",
"null",
"===",
"$",
"parentDsId",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$... | Get parent node by node ds_id.
@param string $dsId
@return ElementtypeStructureNode | [
"Get",
"parent",
"node",
"by",
"node",
"ds_id",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L123-L132 |
236,505 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.getChildrenDsIds | public function getChildrenDsIds($dsId, $level = 1)
{
$childrenDsIds = (array_key_exists($dsId, $this->childrenMap))
? $this->childrenMap[$dsId]
: [];
if (($level > 1) && count($childrenDsIds)) {
$subChildDsIds = [$childrenDsIds];
foreach ($childrenD... | php | public function getChildrenDsIds($dsId, $level = 1)
{
$childrenDsIds = (array_key_exists($dsId, $this->childrenMap))
? $this->childrenMap[$dsId]
: [];
if (($level > 1) && count($childrenDsIds)) {
$subChildDsIds = [$childrenDsIds];
foreach ($childrenD... | [
"public",
"function",
"getChildrenDsIds",
"(",
"$",
"dsId",
",",
"$",
"level",
"=",
"1",
")",
"{",
"$",
"childrenDsIds",
"=",
"(",
"array_key_exists",
"(",
"$",
"dsId",
",",
"$",
"this",
"->",
"childrenMap",
")",
")",
"?",
"$",
"this",
"->",
"childrenM... | Get ds_id of children.
@param string $dsId ds_id of node to fetch children
@param int $level (Optional) recursion depth
@return array | [
"Get",
"ds_id",
"of",
"children",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L192-L209 |
236,506 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.getChildNodes | public function getChildNodes($dsId, $level = 1)
{
$children = [];
$childrenDsIds = $this->getChildrenDsIds($dsId, $level);
foreach ($childrenDsIds as $childDsId) {
$children[] = $this->getNode($childDsId);
}
return $children;
} | php | public function getChildNodes($dsId, $level = 1)
{
$children = [];
$childrenDsIds = $this->getChildrenDsIds($dsId, $level);
foreach ($childrenDsIds as $childDsId) {
$children[] = $this->getNode($childDsId);
}
return $children;
} | [
"public",
"function",
"getChildNodes",
"(",
"$",
"dsId",
",",
"$",
"level",
"=",
"1",
")",
"{",
"$",
"children",
"=",
"[",
"]",
";",
"$",
"childrenDsIds",
"=",
"$",
"this",
"->",
"getChildrenDsIds",
"(",
"$",
"dsId",
",",
"$",
"level",
")",
";",
"f... | Get children nodes.
@param string $dsId ds_id of node to fetch children
@param int $level (Optional) recursion depth
@return ElementtypeStructureNode[] | [
"Get",
"children",
"nodes",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L233-L243 |
236,507 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.hasChildNodes | public function hasChildNodes($dsId = null)
{
if (!$dsId) {
// use root as default
$dsId = $this->rootDsId;
}
$childrenDsIds = $this->getChildrenDsIds($dsId);
$hasChildren = count($childrenDsIds) > 0;
return $hasChildren;
} | php | public function hasChildNodes($dsId = null)
{
if (!$dsId) {
// use root as default
$dsId = $this->rootDsId;
}
$childrenDsIds = $this->getChildrenDsIds($dsId);
$hasChildren = count($childrenDsIds) > 0;
return $hasChildren;
} | [
"public",
"function",
"hasChildNodes",
"(",
"$",
"dsId",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"dsId",
")",
"{",
"// use root as default",
"$",
"dsId",
"=",
"$",
"this",
"->",
"rootDsId",
";",
"}",
"$",
"childrenDsIds",
"=",
"$",
"this",
"->",
... | Has node children?
@param string $dsId (Optional) ds_id of node to check childrens
@return bool | [
"Has",
"node",
"children?"
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L266-L277 |
236,508 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.getDsIdsByFieldType | public function getDsIdsByFieldType($fieldType)
{
$result = [];
foreach ($this->dsIdMap as $dsId => $node) {
/* @var $node ElementtypeStructureNode */
if ($fieldType === $node->getType()) {
$result[] = $dsId;
}
}
return $result;
... | php | public function getDsIdsByFieldType($fieldType)
{
$result = [];
foreach ($this->dsIdMap as $dsId => $node) {
/* @var $node ElementtypeStructureNode */
if ($fieldType === $node->getType()) {
$result[] = $dsId;
}
}
return $result;
... | [
"public",
"function",
"getDsIdsByFieldType",
"(",
"$",
"fieldType",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dsIdMap",
"as",
"$",
"dsId",
"=>",
"$",
"node",
")",
"{",
"/* @var $node ElementtypeStructureNode */",
"if",
... | Get the ds_ids of all fields in this structure tree of a specific type.
@param string $fieldType
@return array | [
"Get",
"the",
"ds_ids",
"of",
"all",
"fields",
"in",
"this",
"structure",
"tree",
"of",
"a",
"specific",
"type",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L319-L330 |
236,509 | phlexible/phlexible | src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php | ElementtypeStructure.getNamesByFieldType | public function getNamesByFieldType($fieldType)
{
$result = [];
foreach ($this->dsIdMap as $node) {
/* @var $node ElementtypeStructureNode */
if ($fieldType === $node->getType()) {
$result[] = $node->getName();
}
}
return $result;
... | php | public function getNamesByFieldType($fieldType)
{
$result = [];
foreach ($this->dsIdMap as $node) {
/* @var $node ElementtypeStructureNode */
if ($fieldType === $node->getType()) {
$result[] = $node->getName();
}
}
return $result;
... | [
"public",
"function",
"getNamesByFieldType",
"(",
"$",
"fieldType",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dsIdMap",
"as",
"$",
"node",
")",
"{",
"/* @var $node ElementtypeStructureNode */",
"if",
"(",
"$",
"fieldTyp... | Get the working titles of all fields in this structure tree of a specific type.
@param string $fieldType
@return array | [
"Get",
"the",
"working",
"titles",
"of",
"all",
"fields",
"in",
"this",
"structure",
"tree",
"of",
"a",
"specific",
"type",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Model/ElementtypeStructure.php#L339-L350 |
236,510 | sebardo/ecommerce | EcommerceBundle/Controller/PaymentServiceProviderController.php | PaymentServiceProviderController.indexAction | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$paymentServiceProviders = $em->getRepository('EcommerceBundle:PaymentServiceProvider')->findAll();
return array(
'paymentServiceProviders' => $paymentServiceProviders,
);
} | php | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$paymentServiceProviders = $em->getRepository('EcommerceBundle:PaymentServiceProvider')->findAll();
return array(
'paymentServiceProviders' => $paymentServiceProviders,
);
} | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"paymentServiceProviders",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'EcommerceBundle:PaymentServiceProvi... | Lists all PaymentServiceProvider entities.
@Route("/")
@Method("GET")
@Template() | [
"Lists",
"all",
"PaymentServiceProvider",
"entities",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/PaymentServiceProviderController.php#L27-L36 |
236,511 | sebardo/ecommerce | EcommerceBundle/Controller/PaymentServiceProviderController.php | PaymentServiceProviderController.newAction | public function newAction(Request $request)
{
$paymentServiceProvider = new PaymentServiceProvider();
$form = $this->createForm('EcommerceBundle\Form\PaymentServiceProviderType', $paymentServiceProvider);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) ... | php | public function newAction(Request $request)
{
$paymentServiceProvider = new PaymentServiceProvider();
$form = $this->createForm('EcommerceBundle\Form\PaymentServiceProviderType', $paymentServiceProvider);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) ... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"paymentServiceProvider",
"=",
"new",
"PaymentServiceProvider",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"'EcommerceBundle\\Form\\PaymentServiceProviderTy... | Creates a new PaymentServiceProvider entity.
@Route("/new")
@Method({"GET", "POST"})
@Template() | [
"Creates",
"a",
"new",
"PaymentServiceProvider",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/PaymentServiceProviderController.php#L66-L86 |
236,512 | sebardo/ecommerce | EcommerceBundle/Controller/PaymentServiceProviderController.php | PaymentServiceProviderController.showAction | public function showAction(PaymentServiceProvider $paymentServiceProvider)
{
$deleteForm = $this->createDeleteForm($paymentServiceProvider);
return array(
'entity' => $paymentServiceProvider,
'delete_form' => $deleteForm->createView(),
);
} | php | public function showAction(PaymentServiceProvider $paymentServiceProvider)
{
$deleteForm = $this->createDeleteForm($paymentServiceProvider);
return array(
'entity' => $paymentServiceProvider,
'delete_form' => $deleteForm->createView(),
);
} | [
"public",
"function",
"showAction",
"(",
"PaymentServiceProvider",
"$",
"paymentServiceProvider",
")",
"{",
"$",
"deleteForm",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"paymentServiceProvider",
")",
";",
"return",
"array",
"(",
"'entity'",
"=>",
"$",
... | Finds and displays a PaymentServiceProvider entity.
@Route("/{id}")
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"PaymentServiceProvider",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/PaymentServiceProviderController.php#L95-L103 |
236,513 | sebardo/ecommerce | EcommerceBundle/Controller/PaymentServiceProviderController.php | PaymentServiceProviderController.editAction | public function editAction(Request $request, PaymentServiceProvider $paymentServiceProvider)
{
$deleteForm = $this->createDeleteForm($paymentServiceProvider);
$editForm = $this->createForm('EcommerceBundle\Form\PaymentServiceProviderType', $paymentServiceProvider);
$editForm->handleRequest($... | php | public function editAction(Request $request, PaymentServiceProvider $paymentServiceProvider)
{
$deleteForm = $this->createDeleteForm($paymentServiceProvider);
$editForm = $this->createForm('EcommerceBundle\Form\PaymentServiceProviderType', $paymentServiceProvider);
$editForm->handleRequest($... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
",",
"PaymentServiceProvider",
"$",
"paymentServiceProvider",
")",
"{",
"$",
"deleteForm",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"paymentServiceProvider",
")",
";",
"$",
"editForm"... | Displays a form to edit an existing PaymentServiceProvider entity.
@Route("/{id}/edit")
@Method({"GET", "POST"})
@Template() | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"PaymentServiceProvider",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/PaymentServiceProviderController.php#L112-L131 |
236,514 | sebardo/ecommerce | EcommerceBundle/Controller/PaymentServiceProviderController.php | PaymentServiceProviderController.deleteAction | public function deleteAction(Request $request, PaymentServiceProvider $paymentServiceProvider)
{
$form = $this->createDeleteForm($paymentServiceProvider);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
... | php | public function deleteAction(Request $request, PaymentServiceProvider $paymentServiceProvider)
{
$form = $this->createDeleteForm($paymentServiceProvider);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"PaymentServiceProvider",
"$",
"paymentServiceProvider",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"paymentServiceProvider",
")",
";",
"$",
"form",
"->"... | Deletes a PaymentServiceProvider entity.
@Route("/{id}")
@Method("DELETE")
@Template() | [
"Deletes",
"a",
"PaymentServiceProvider",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/PaymentServiceProviderController.php#L140-L152 |
236,515 | sebardo/ecommerce | EcommerceBundle/Controller/PaymentServiceProviderController.php | PaymentServiceProviderController.createDeleteForm | private function createDeleteForm(PaymentServiceProvider $paymentServiceProvider)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('ecommerce_paymentserviceprovider_delete', array('id' => $paymentServiceProvider->getId())))
->setMethod('DELETE')
->getFor... | php | private function createDeleteForm(PaymentServiceProvider $paymentServiceProvider)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('ecommerce_paymentserviceprovider_delete', array('id' => $paymentServiceProvider->getId())))
->setMethod('DELETE')
->getFor... | [
"private",
"function",
"createDeleteForm",
"(",
"PaymentServiceProvider",
"$",
"paymentServiceProvider",
")",
"{",
"return",
"$",
"this",
"->",
"createFormBuilder",
"(",
")",
"->",
"setAction",
"(",
"$",
"this",
"->",
"generateUrl",
"(",
"'ecommerce_paymentserviceprov... | Creates a form to delete a PaymentServiceProvider entity.
@param PaymentServiceProvider $paymentServiceProvider The PaymentServiceProvider entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"delete",
"a",
"PaymentServiceProvider",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/PaymentServiceProviderController.php#L161-L168 |
236,516 | jmpantoja/planb-utils | src/Beautifier/Beautifier.php | Beautifier.parse | public function parse(string $template, array $values, ?Enviroment $enviroment = null): string
{
$parser = ParserFactory::factory($enviroment);
return $parser->parse($template, $values);
} | php | public function parse(string $template, array $values, ?Enviroment $enviroment = null): string
{
$parser = ParserFactory::factory($enviroment);
return $parser->parse($template, $values);
} | [
"public",
"function",
"parse",
"(",
"string",
"$",
"template",
",",
"array",
"$",
"values",
",",
"?",
"Enviroment",
"$",
"enviroment",
"=",
"null",
")",
":",
"string",
"{",
"$",
"parser",
"=",
"ParserFactory",
"::",
"factory",
"(",
"$",
"enviroment",
")"... | Parsea una plantilla
@param string $template
@param mixed[] $values
@param null|\PlanB\Beautifier\Enviroment $enviroment
@return string | [
"Parsea",
"una",
"plantilla"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Beautifier.php#L50-L55 |
236,517 | jmpantoja/planb-utils | src/Beautifier/Beautifier.php | Beautifier.dump | public function dump($value, ?Enviroment $enviroment = null): string
{
$format = FormatFactory::factory($value);
return $this->format($format, $enviroment);
} | php | public function dump($value, ?Enviroment $enviroment = null): string
{
$format = FormatFactory::factory($value);
return $this->format($format, $enviroment);
} | [
"public",
"function",
"dump",
"(",
"$",
"value",
",",
"?",
"Enviroment",
"$",
"enviroment",
"=",
"null",
")",
":",
"string",
"{",
"$",
"format",
"=",
"FormatFactory",
"::",
"factory",
"(",
"$",
"value",
")",
";",
"return",
"$",
"this",
"->",
"format",
... | Devuelve la representacion de una variable
@param mixed $value
@param null|\PlanB\Beautifier\Enviroment $enviroment
@return string | [
"Devuelve",
"la",
"representacion",
"de",
"una",
"variable"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Beautifier.php#L66-L72 |
236,518 | SymBB/symbb | src/Symbb/Core/BBCodeBundle/DependencyInjection/BBCodeManager.php | BBCodeManager.getBBCodes | public function getBBCodes($setId = 1)
{
$set = $this->getSet($setId);
$bbcodes = $set->getCodes();
return $bbcodes;
} | php | public function getBBCodes($setId = 1)
{
$set = $this->getSet($setId);
$bbcodes = $set->getCodes();
return $bbcodes;
} | [
"public",
"function",
"getBBCodes",
"(",
"$",
"setId",
"=",
"1",
")",
"{",
"$",
"set",
"=",
"$",
"this",
"->",
"getSet",
"(",
"$",
"setId",
")",
";",
"$",
"bbcodes",
"=",
"$",
"set",
"->",
"getCodes",
"(",
")",
";",
"return",
"$",
"bbcodes",
";",... | get a list of grouped BBCodes
@return \Symbb\Core\BBCodeBundle\Entity\BBCode[] | [
"get",
"a",
"list",
"of",
"grouped",
"BBCodes"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/BBCodeBundle/DependencyInjection/BBCodeManager.php#L179-L184 |
236,519 | jianfengye/hades | src/Hades/Dao/Connection.php | Connection.pdo | public function pdo()
{
if (!empty($this->pdo)) {
return $this->pdo;
}
$dns = "{$this->driver}:";
if (!empty($this->database)) {
$dns .= "dbname={$this->database};";
}
if (!empty($this->hostname)) {
$dns .= "host={$this->hostname};... | php | public function pdo()
{
if (!empty($this->pdo)) {
return $this->pdo;
}
$dns = "{$this->driver}:";
if (!empty($this->database)) {
$dns .= "dbname={$this->database};";
}
if (!empty($this->hostname)) {
$dns .= "host={$this->hostname};... | [
"public",
"function",
"pdo",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"pdo",
")",
")",
"{",
"return",
"$",
"this",
"->",
"pdo",
";",
"}",
"$",
"dns",
"=",
"\"{$this->driver}:\"",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"t... | get raw pdo | [
"get",
"raw",
"pdo"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Dao/Connection.php#L48-L67 |
236,520 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.getLastInsertID | public function getLastInsertID() {
if (count($this->rows) > 0) {
$end = end($this->rows);
if ($end->toRow() && $end->toRow()->getPrimary()) {
return (int) $end->toRow()->getPrimary();
} else if ($end->toRow() === NULL) {
return NULL;
} else {
throw new RepositoryException("Table \"" . self::T... | php | public function getLastInsertID() {
if (count($this->rows) > 0) {
$end = end($this->rows);
if ($end->toRow() && $end->toRow()->getPrimary()) {
return (int) $end->toRow()->getPrimary();
} else if ($end->toRow() === NULL) {
return NULL;
} else {
throw new RepositoryException("Table \"" . self::T... | [
"public",
"function",
"getLastInsertID",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"rows",
")",
">",
"0",
")",
"{",
"$",
"end",
"=",
"end",
"(",
"$",
"this",
"->",
"rows",
")",
";",
"if",
"(",
"$",
"end",
"->",
"toRow",
"(",
... | Return last insert ID
@return int|null
@throws RepositoryException | [
"Return",
"last",
"insert",
"ID"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L120-L133 |
236,521 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.get | public function get($key) {
if (isset($this->rows[(int) $key])) {
return $this->rows[(int) $key];
} else {
/** @var ActiveRow|false $item */
$item = $this->buildSql()->get((int) $key);
if ($item) {
return $this->createEntity($item);
} else {
return NULL;
}
}
} | php | public function get($key) {
if (isset($this->rows[(int) $key])) {
return $this->rows[(int) $key];
} else {
/** @var ActiveRow|false $item */
$item = $this->buildSql()->get((int) $key);
if ($item) {
return $this->createEntity($item);
} else {
return NULL;
}
}
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"rows",
"[",
"(",
"int",
")",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"rows",
"[",
"(",
"int",
")",
"$",
"key",
"]",
";... | Find item by primary key
@param int $key
@return Entity|null | [
"Find",
"item",
"by",
"primary",
"key"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L140-L152 |
236,522 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.limit | public function limit($limit, $offset = NULL) {
if ($this->selection)
$this->selection->limit($limit, $offset);
else
throw new RepositoryException("Before using the function limit(...) call read(...).");
return $this;
} | php | public function limit($limit, $offset = NULL) {
if ($this->selection)
$this->selection->limit($limit, $offset);
else
throw new RepositoryException("Before using the function limit(...) call read(...).");
return $this;
} | [
"public",
"function",
"limit",
"(",
"$",
"limit",
",",
"$",
"offset",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"selection",
")",
"$",
"this",
"->",
"selection",
"->",
"limit",
"(",
"$",
"limit",
",",
"$",
"offset",
")",
";",
"else",
"... | Sets limit clause, more calls rewrite old values.
@param int $limit
@param int $offset
@return BaseRepository
@throws RepositoryException | [
"Sets",
"limit",
"clause",
"more",
"calls",
"rewrite",
"old",
"values",
"."
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L187-L193 |
236,523 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.fetchPairs | public function fetchPairs($key, $value = NULL) {
$return = array();
foreach ($this as $row) {
$return[$row->$key] = $value ? $row->$value : $row->$key;
}
return $return;
} | php | public function fetchPairs($key, $value = NULL) {
$return = array();
foreach ($this as $row) {
$return[$row->$key] = $value ? $row->$value : $row->$key;
}
return $return;
} | [
"public",
"function",
"fetchPairs",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"NULL",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"row",
")",
"{",
"$",
"return",
"[",
"$",
"row",
"->",
"$",
"key"... | Returns all rows as associative array.
@param string
@param string $value name used for an array value or NULL for the whole row
@return array | [
"Returns",
"all",
"rows",
"as",
"associative",
"array",
"."
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L309-L315 |
236,524 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.fetchAll | public function fetchAll() {
if ($this->selection) {
/** @var ActiveRow $entity */
foreach ($this->selection as $entity) {
$this->createEntity($entity);
}
}
return $this->rows;
} | php | public function fetchAll() {
if ($this->selection) {
/** @var ActiveRow $entity */
foreach ($this->selection as $entity) {
$this->createEntity($entity);
}
}
return $this->rows;
} | [
"public",
"function",
"fetchAll",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"selection",
")",
"{",
"/** @var ActiveRow $entity */",
"foreach",
"(",
"$",
"this",
"->",
"selection",
"as",
"$",
"entity",
")",
"{",
"$",
"this",
"->",
"createEntity",
"(",
... | Returns all rows
@return array|NULL | [
"Returns",
"all",
"rows"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L321-L330 |
236,525 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.hasNonSaveEntity | protected function hasNonSaveEntity() {
foreach($this->rows as $row) {
if ($row->toRow() === NULL) {
return TRUE;
} else {
$reflection = $row->getColumns();
$record = array();
foreach ($reflection as $property) {
$name = $property['name'];
if ($row->toRow()->$name != $row->$name) {
... | php | protected function hasNonSaveEntity() {
foreach($this->rows as $row) {
if ($row->toRow() === NULL) {
return TRUE;
} else {
$reflection = $row->getColumns();
$record = array();
foreach ($reflection as $property) {
$name = $property['name'];
if ($row->toRow()->$name != $row->$name) {
... | [
"protected",
"function",
"hasNonSaveEntity",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"row",
"->",
"toRow",
"(",
")",
"===",
"NULL",
")",
"{",
"return",
"TRUE",
";",
"}",
"else",
"{",
"... | Zjisti, zda-li repozitar obsahuje nejake entity k ulozeni
@return bool | [
"Zjisti",
"zda",
"-",
"li",
"repozitar",
"obsahuje",
"nejake",
"entity",
"k",
"ulozeni"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L353-L369 |
236,526 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.read | public function read(Paginator $paginator = NULL) {
if ($this->hasNonSaveEntity() === FALSE) {
$this->rows = array();
}
$this->selection = $this->buildSql($paginator);
return $this;
} | php | public function read(Paginator $paginator = NULL) {
if ($this->hasNonSaveEntity() === FALSE) {
$this->rows = array();
}
$this->selection = $this->buildSql($paginator);
return $this;
} | [
"public",
"function",
"read",
"(",
"Paginator",
"$",
"paginator",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasNonSaveEntity",
"(",
")",
"===",
"FALSE",
")",
"{",
"$",
"this",
"->",
"rows",
"=",
"array",
"(",
")",
";",
"}",
"$",
"this",... | Create new Selection
@param Paginator $paginator
@return BaseRepository | [
"Create",
"new",
"Selection"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L381-L387 |
236,527 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.push | public function push(Entity $entity) {
$entity->setEntityManager($this->entityManager);
if ($entity->toRow()) {
$this->rows[$entity->getPrimary()] = $entity;
} else {
$this->rows[] = $entity;
}
} | php | public function push(Entity $entity) {
$entity->setEntityManager($this->entityManager);
if ($entity->toRow()) {
$this->rows[$entity->getPrimary()] = $entity;
} else {
$this->rows[] = $entity;
}
} | [
"public",
"function",
"push",
"(",
"Entity",
"$",
"entity",
")",
"{",
"$",
"entity",
"->",
"setEntityManager",
"(",
"$",
"this",
"->",
"entityManager",
")",
";",
"if",
"(",
"$",
"entity",
"->",
"toRow",
"(",
")",
")",
"{",
"$",
"this",
"->",
"rows",
... | Push entity to array
@param Entity $entity | [
"Push",
"entity",
"to",
"array"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L392-L399 |
236,528 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.updateActiveRow | private function updateActiveRow(Entity $entity) {
$reflection = $entity->getColumns();
$record = array();
foreach ($reflection as $property) {
$name = $property['name'];
if ($entity->toRow()->$name != $entity->$name) {
$record[$name] = $entity->$name;
}
}
if (count($record) > 0) {
$entity->to... | php | private function updateActiveRow(Entity $entity) {
$reflection = $entity->getColumns();
$record = array();
foreach ($reflection as $property) {
$name = $property['name'];
if ($entity->toRow()->$name != $entity->$name) {
$record[$name] = $entity->$name;
}
}
if (count($record) > 0) {
$entity->to... | [
"private",
"function",
"updateActiveRow",
"(",
"Entity",
"$",
"entity",
")",
"{",
"$",
"reflection",
"=",
"$",
"entity",
"->",
"getColumns",
"(",
")",
";",
"$",
"record",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"reflection",
"as",
"$",
"prope... | Update ActiveRow in current Entity
@param Entity $entity | [
"Update",
"ActiveRow",
"in",
"current",
"Entity"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L495-L508 |
236,529 | ViPErCZ/composer_slimORM | src/BaseRepository.php | BaseRepository.checkLoop | private function checkLoop(Entity $entity) {
foreach($this->protectLoop as $loop) {
if (EntityReflexion::getTable($loop) == EntityReflexion::getTable($entity) && $entity->getPrimary() == $loop->getPrimary()) {
return true;
}
}
return false;
} | php | private function checkLoop(Entity $entity) {
foreach($this->protectLoop as $loop) {
if (EntityReflexion::getTable($loop) == EntityReflexion::getTable($entity) && $entity->getPrimary() == $loop->getPrimary()) {
return true;
}
}
return false;
} | [
"private",
"function",
"checkLoop",
"(",
"Entity",
"$",
"entity",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"protectLoop",
"as",
"$",
"loop",
")",
"{",
"if",
"(",
"EntityReflexion",
"::",
"getTable",
"(",
"$",
"loop",
")",
"==",
"EntityReflexion",
"::... | Check loop protection
@param Entity $entity
@return bool | [
"Check",
"loop",
"protection"
] | 2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf | https://github.com/ViPErCZ/composer_slimORM/blob/2206f4ab4557e2b21b2ae4e2ded7cb5ca3d829bf/src/BaseRepository.php#L733-L740 |
236,530 | jivoo/core | src/Log/ErrorHandler.php | ErrorHandler.toString | public static function toString($type)
{
if (! isset(self::$strings[$type])) {
return $type;
}
return self::$strings[$type];
} | php | public static function toString($type)
{
if (! isset(self::$strings[$type])) {
return $type;
}
return self::$strings[$type];
} | [
"public",
"static",
"function",
"toString",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"strings",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"type",
";",
"}",
"return",
"self",
"::",
"$",
"strings",
"["... | Convert PHP error code to string.
@param int $type
Error code.
@return string Error code as a string. | [
"Convert",
"PHP",
"error",
"code",
"to",
"string",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Log/ErrorHandler.php#L174-L180 |
236,531 | jivoo/core | src/Log/ErrorHandler.php | ErrorHandler.handle | public function handle($type, $message, $file, $line)
{
if (self::$catch & $type > 0) {
self::$error = $message;
return;
}
switch ($type) {
case E_USER_NOTICE:
case E_USER_DEPRECATED:
case E_USER_WARNING:
case E_USER_ERR... | php | public function handle($type, $message, $file, $line)
{
if (self::$catch & $type > 0) {
self::$error = $message;
return;
}
switch ($type) {
case E_USER_NOTICE:
case E_USER_DEPRECATED:
case E_USER_WARNING:
case E_USER_ERR... | [
"public",
"function",
"handle",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"catch",
"&",
"$",
"type",
">",
"0",
")",
"{",
"self",
"::",
"$",
"error",
"=",
"$",
"message",
... | Handle error.
@param int $type
Error type.
@param string $message
Error message.
@param string $file
File.
@param int $line
Line.
@throws ErrorException To convert errors (E_USER_ERROR, E_ERROR, and
E_RECOVERABLE_ERROR) to exceptions. | [
"Handle",
"error",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Log/ErrorHandler.php#L196-L228 |
236,532 | jivoo/core | src/Log/ErrorHandler.php | ErrorHandler.detect | public static function detect($callable, $mask = -1)
{
$error = null;
set_error_handler(function ($type, $message, $file, $line) use ($error) {
$error = new ErrorException($message, 0, $type, $file, $line);
}, $mask);
$callable();
restore_error_handler();
... | php | public static function detect($callable, $mask = -1)
{
$error = null;
set_error_handler(function ($type, $message, $file, $line) use ($error) {
$error = new ErrorException($message, 0, $type, $file, $line);
}, $mask);
$callable();
restore_error_handler();
... | [
"public",
"static",
"function",
"detect",
"(",
"$",
"callable",
",",
"$",
"mask",
"=",
"-",
"1",
")",
"{",
"$",
"error",
"=",
"null",
";",
"set_error_handler",
"(",
"function",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"lin... | Detect one or more PHP error messages and return the last one.
@param callable $callable
Function to catch error in.
@param int $mask
Error type mask, e.g. `E_ERROR | E_WARNING` to detect
errors or warnings. Default is -1 which catches everything.
@return string|null Last error message or null if no error was triggere... | [
"Detect",
"one",
"or",
"more",
"PHP",
"error",
"messages",
"and",
"return",
"the",
"last",
"one",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Log/ErrorHandler.php#L266-L275 |
236,533 | erikkubica/netlime-theme-assets | ThemeAssets.php | ThemeAssets.registerAssets | protected function registerAssets()
{
do_action("before_theme_register_assets");
$assets = $this->getConfig("assets");
add_action("wp_enqueue_scripts", function () use ($assets) {
foreach ($assets as $id => $asset) :
$file = strpos($asset["file"], "//") === fals... | php | protected function registerAssets()
{
do_action("before_theme_register_assets");
$assets = $this->getConfig("assets");
add_action("wp_enqueue_scripts", function () use ($assets) {
foreach ($assets as $id => $asset) :
$file = strpos($asset["file"], "//") === fals... | [
"protected",
"function",
"registerAssets",
"(",
")",
"{",
"do_action",
"(",
"\"before_theme_register_assets\"",
")",
";",
"$",
"assets",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"\"assets\"",
")",
";",
"add_action",
"(",
"\"wp_enqueue_scripts\"",
",",
"function",... | Register css and js from config | [
"Register",
"css",
"and",
"js",
"from",
"config"
] | 71e43537cbf3fb774424933252ff17275799e86f | https://github.com/erikkubica/netlime-theme-assets/blob/71e43537cbf3fb774424933252ff17275799e86f/ThemeAssets.php#L16-L34 |
236,534 | asbsoft/yii2-common_2_170212 | base/UniModule.php | UniModule.inform | public function inform($cmd, $params = [])
{
switch ($cmd) {
case 'label': // module's short name for menu
if (!empty($this->params['label'])) {
$label = $this->params['label'];
// try to translate label
$tcCat = TranslationsBuilder::getB... | php | public function inform($cmd, $params = [])
{
switch ($cmd) {
case 'label': // module's short name for menu
if (!empty($this->params['label'])) {
$label = $this->params['label'];
// try to translate label
$tcCat = TranslationsBuilder::getB... | [
"public",
"function",
"inform",
"(",
"$",
"cmd",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"switch",
"(",
"$",
"cmd",
")",
"{",
"case",
"'label'",
":",
"// module's short name for menu",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"params",
"... | Get some module info
@param string $cmd
@param array $params
@return mix|false|null | [
"Get",
"some",
"module",
"info"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/base/UniModule.php#L48-L78 |
236,535 | artkonekt/sylius-sync-bundle | Model/Remote/Image/Image.php | Image.getData | public function getData()
{
if (!$this->data && $this->getLocation()) {
$this->data = file_get_contents($this->getLocation());
}
return $this->data;
} | php | public function getData()
{
if (!$this->data && $this->getLocation()) {
$this->data = file_get_contents($this->getLocation());
}
return $this->data;
} | [
"public",
"function",
"getData",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"data",
"&&",
"$",
"this",
"->",
"getLocation",
"(",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"getLocation",
"(",
... | Returns the image's data
@return string | [
"Returns",
"the",
"image",
"s",
"data"
] | fe2864c648971fc058994d8554549061a3a2a0c0 | https://github.com/artkonekt/sylius-sync-bundle/blob/fe2864c648971fc058994d8554549061a3a2a0c0/Model/Remote/Image/Image.php#L67-L74 |
236,536 | comodojo/rpcserver | src/Comodojo/RpcServer/Component/Errors.php | Errors.delete | final public function delete($code) {
if ( array_key_exists($code, $this->rpc_errors) ) {
unset($this->rpc_errors[$code]);
$this->logger->debug("Deleted error $code");
return true;
} else {
$this->logger->warning("Cannot delete error $code: entry not... | php | final public function delete($code) {
if ( array_key_exists($code, $this->rpc_errors) ) {
unset($this->rpc_errors[$code]);
$this->logger->debug("Deleted error $code");
return true;
} else {
$this->logger->warning("Cannot delete error $code: entry not... | [
"final",
"public",
"function",
"delete",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"rpc_errors",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"rpc_errors",
"[",
"$",
"code",
"]",
")",
";... | Delete an error
@param int $code
@return bool | [
"Delete",
"an",
"error"
] | 6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c | https://github.com/comodojo/rpcserver/blob/6b4766f1554f6fe6b06199c0c1fb97e1b5a8bb1c/src/Comodojo/RpcServer/Component/Errors.php#L85-L103 |
236,537 | xjtuana-dev/cas-proxy-client-php | src/ClientV1.php | ClientV1.getLoginUrl | protected function getLoginUrl(string $redirect_url = '') {
if (empty($redirect_url)) {
$redirect_url = $this->getClientUrl();
}
return $this->getServerUrl() . self::LOGIN_PATH . '?redirect_url=' . $redirect_url;
} | php | protected function getLoginUrl(string $redirect_url = '') {
if (empty($redirect_url)) {
$redirect_url = $this->getClientUrl();
}
return $this->getServerUrl() . self::LOGIN_PATH . '?redirect_url=' . $redirect_url;
} | [
"protected",
"function",
"getLoginUrl",
"(",
"string",
"$",
"redirect_url",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"redirect_url",
")",
")",
"{",
"$",
"redirect_url",
"=",
"$",
"this",
"->",
"getClientUrl",
"(",
")",
";",
"}",
"return",
"$"... | Get the url of login
@return string | [
"Get",
"the",
"url",
"of",
"login"
] | fc0db0f3408416ad3b6f8b271bad2cfd143d648c | https://github.com/xjtuana-dev/cas-proxy-client-php/blob/fc0db0f3408416ad3b6f8b271bad2cfd143d648c/src/ClientV1.php#L27-L32 |
236,538 | xjtuana-dev/cas-proxy-client-php | src/ClientV1.php | ClientV1.login | public function login(string $redirect_url = '') {
if ( null === $guid = $this->getGuidFromQuery() ) {
header( 'Location: ' . $this->getLoginUrl($redirect_url) );
exit();
} else {
return $this->verify($guid);
}
} | php | public function login(string $redirect_url = '') {
if ( null === $guid = $this->getGuidFromQuery() ) {
header( 'Location: ' . $this->getLoginUrl($redirect_url) );
exit();
} else {
return $this->verify($guid);
}
} | [
"public",
"function",
"login",
"(",
"string",
"$",
"redirect_url",
"=",
"''",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"guid",
"=",
"$",
"this",
"->",
"getGuidFromQuery",
"(",
")",
")",
"{",
"header",
"(",
"'Location: '",
".",
"$",
"this",
"->",
"get... | Login and return the username
@param $redirect_url string 从CAS登录后跳转的URL,用于接收guid ($redirect_url?guid=...)
@return string 返回登录用户名 | [
"Login",
"and",
"return",
"the",
"username"
] | fc0db0f3408416ad3b6f8b271bad2cfd143d648c | https://github.com/xjtuana-dev/cas-proxy-client-php/blob/fc0db0f3408416ad3b6f8b271bad2cfd143d648c/src/ClientV1.php#L110-L117 |
236,539 | easy-system/es-system | src/Listener/ConfigureCacheListener.php | ConfigureCacheListener.configureFactory | public function configureFactory(SystemEvent $event)
{
$systemConfig = $this->getConfig();
$initialConfig = $systemConfig->getInitialConfig();
if (isset($initialConfig['cache'])) {
$cacheConfig = (array) $initialConfig['cache'];
CacheFactory::setConfig($cacheConfig)... | php | public function configureFactory(SystemEvent $event)
{
$systemConfig = $this->getConfig();
$initialConfig = $systemConfig->getInitialConfig();
if (isset($initialConfig['cache'])) {
$cacheConfig = (array) $initialConfig['cache'];
CacheFactory::setConfig($cacheConfig)... | [
"public",
"function",
"configureFactory",
"(",
"SystemEvent",
"$",
"event",
")",
"{",
"$",
"systemConfig",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"$",
"initialConfig",
"=",
"$",
"systemConfig",
"->",
"getInitialConfig",
"(",
")",
";",
"if",
"(... | Configures the cache factory.
@param \Es\System\SystemEvent $event The system event | [
"Configures",
"the",
"cache",
"factory",
"."
] | 750632b7a57f8c65d98c61cd0c29d2da3a9a04cc | https://github.com/easy-system/es-system/blob/750632b7a57f8c65d98c61cd0c29d2da3a9a04cc/src/Listener/ConfigureCacheListener.php#L70-L79 |
236,540 | easy-system/es-system | src/Listener/ConfigureCacheListener.php | ConfigureCacheListener.configureNamespace | public function configureNamespace(SystemEvent $event)
{
$systemConfig = $this->getConfig();
$cache = $this->getCache();
if ($cache->get('hash') !== $systemConfig->getInitialConfigHash()) {
$cache->clearNamespace();
$cache->set('hash', $systemConfig->getInitialConfig... | php | public function configureNamespace(SystemEvent $event)
{
$systemConfig = $this->getConfig();
$cache = $this->getCache();
if ($cache->get('hash') !== $systemConfig->getInitialConfigHash()) {
$cache->clearNamespace();
$cache->set('hash', $systemConfig->getInitialConfig... | [
"public",
"function",
"configureNamespace",
"(",
"SystemEvent",
"$",
"event",
")",
"{",
"$",
"systemConfig",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"$",
"cache",
"=",
"$",
"this",
"->",
"getCache",
"(",
")",
";",
"if",
"(",
"$",
"cache",
... | Configures the namespace registered in the cache for system.
@param \Es\System\SystemEvent $event The system event | [
"Configures",
"the",
"namespace",
"registered",
"in",
"the",
"cache",
"for",
"system",
"."
] | 750632b7a57f8c65d98c61cd0c29d2da3a9a04cc | https://github.com/easy-system/es-system/blob/750632b7a57f8c65d98c61cd0c29d2da3a9a04cc/src/Listener/ConfigureCacheListener.php#L86-L95 |
236,541 | webriq/core | module/Customize/src/Grid/Customize/Model/Rule/Model.php | Model.findBySelector | public function findBySelector( $selector, $media = '', $rootId = null )
{
$rootId = ( (int) $rootId ) ?: null;
$rule = $this->getMapper()
->findBySelector( $selector, $media, $rootId );
if ( empty( $rule ) )
{
$rule = $this->getMapper()
... | php | public function findBySelector( $selector, $media = '', $rootId = null )
{
$rootId = ( (int) $rootId ) ?: null;
$rule = $this->getMapper()
->findBySelector( $selector, $media, $rootId );
if ( empty( $rule ) )
{
$rule = $this->getMapper()
... | [
"public",
"function",
"findBySelector",
"(",
"$",
"selector",
",",
"$",
"media",
"=",
"''",
",",
"$",
"rootId",
"=",
"null",
")",
"{",
"$",
"rootId",
"=",
"(",
"(",
"int",
")",
"$",
"rootId",
")",
"?",
":",
"null",
";",
"$",
"rule",
"=",
"$",
"... | Get rule by selector & media
@param string $selector
@param string $media [optional]
@param null|int $rootId [optional]
@return \Customize\Model\Rule\Structure | [
"Get",
"rule",
"by",
"selector",
"&",
"media"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/Rule/Model.php#L60-L77 |
236,542 | veonik/VeonikBlogBundle | src/Controller/CommentController.php | CommentController.indexAction | public function indexAction($postid)
{
$post = $this->getPost($postid);
$entities = $post->getComments()->toArray();
usort($entities, function (Comment $a, Comment $b) {
return $a->getDateCreated() < $b->getDateCreated();
});
return array(
'post' ... | php | public function indexAction($postid)
{
$post = $this->getPost($postid);
$entities = $post->getComments()->toArray();
usort($entities, function (Comment $a, Comment $b) {
return $a->getDateCreated() < $b->getDateCreated();
});
return array(
'post' ... | [
"public",
"function",
"indexAction",
"(",
"$",
"postid",
")",
"{",
"$",
"post",
"=",
"$",
"this",
"->",
"getPost",
"(",
"$",
"postid",
")",
";",
"$",
"entities",
"=",
"$",
"post",
"->",
"getComments",
"(",
")",
"->",
"toArray",
"(",
")",
";",
"usor... | Lists all of a post's comments.
@Route("s", name="post_comments")
@Template() | [
"Lists",
"all",
"of",
"a",
"post",
"s",
"comments",
"."
] | 52cca6b37feadd77fa564600b4db0e8e196099dd | https://github.com/veonik/VeonikBlogBundle/blob/52cca6b37feadd77fa564600b4db0e8e196099dd/src/Controller/CommentController.php#L35-L48 |
236,543 | veonik/VeonikBlogBundle | src/Controller/CommentController.php | CommentController.newAction | public function newAction($postid)
{
$post = $this->getPost($postid);
$entity = new Comment();
$form = $this->createForm(new CommentType(), $entity);
return array(
'entity' => $entity,
'post' => $post,
'form' => $form->createView(),
... | php | public function newAction($postid)
{
$post = $this->getPost($postid);
$entity = new Comment();
$form = $this->createForm(new CommentType(), $entity);
return array(
'entity' => $entity,
'post' => $post,
'form' => $form->createView(),
... | [
"public",
"function",
"newAction",
"(",
"$",
"postid",
")",
"{",
"$",
"post",
"=",
"$",
"this",
"->",
"getPost",
"(",
"$",
"postid",
")",
";",
"$",
"entity",
"=",
"new",
"Comment",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
... | Displays a form to create a new Comment entity.
@Route("/new", name="post_comment_new")
@Secure("ROLE_COMMENT_WRITE")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Comment",
"entity",
"."
] | 52cca6b37feadd77fa564600b4db0e8e196099dd | https://github.com/veonik/VeonikBlogBundle/blob/52cca6b37feadd77fa564600b4db0e8e196099dd/src/Controller/CommentController.php#L57-L69 |
236,544 | veonik/VeonikBlogBundle | src/Controller/CommentController.php | CommentController.createAction | public function createAction(Request $request, $postid)
{
$post = $this->getPost($postid);
$entity = new Comment();
$entity->setPost($post);
$entity->setAuthor($this->getCurrentAuthor());
$form = $this->createForm(new CommentType(), $entity);
$form->bind($request);... | php | public function createAction(Request $request, $postid)
{
$post = $this->getPost($postid);
$entity = new Comment();
$entity->setPost($post);
$entity->setAuthor($this->getCurrentAuthor());
$form = $this->createForm(new CommentType(), $entity);
$form->bind($request);... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
",",
"$",
"postid",
")",
"{",
"$",
"post",
"=",
"$",
"this",
"->",
"getPost",
"(",
"$",
"postid",
")",
";",
"$",
"entity",
"=",
"new",
"Comment",
"(",
")",
";",
"$",
"entity",
"-... | Creates a new Comment entity.
@Route("/create", name="post_comment_create")
@Secure("ROLE_COMMENT_WRITE")
@Method("POST")
@Template("VeonikBlogBundle:Comment:new.html.twig") | [
"Creates",
"a",
"new",
"Comment",
"entity",
"."
] | 52cca6b37feadd77fa564600b4db0e8e196099dd | https://github.com/veonik/VeonikBlogBundle/blob/52cca6b37feadd77fa564600b4db0e8e196099dd/src/Controller/CommentController.php#L79-L104 |
236,545 | bishopb/vanilla | applications/dashboard/controllers/class.searchcontroller.php | SearchController.Index | public function Index($Page = '') {
$this->AddJsFile('search.js');
$this->Title(T('Search'));
SaveToConfig('Garden.Format.EmbedSize', '160x90', FALSE);
Gdn_Theme::Section('SearchResults');
list($Offset, $Limit) = OffsetLimit($Page, C('Garden.Search.PerPage', 20));
$this->SetDat... | php | public function Index($Page = '') {
$this->AddJsFile('search.js');
$this->Title(T('Search'));
SaveToConfig('Garden.Format.EmbedSize', '160x90', FALSE);
Gdn_Theme::Section('SearchResults');
list($Offset, $Limit) = OffsetLimit($Page, C('Garden.Search.PerPage', 20));
$this->SetDat... | [
"public",
"function",
"Index",
"(",
"$",
"Page",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"AddJsFile",
"(",
"'search.js'",
")",
";",
"$",
"this",
"->",
"Title",
"(",
"T",
"(",
"'Search'",
")",
")",
";",
"SaveToConfig",
"(",
"'Garden.Format.EmbedSize'",
... | Default search functionality.
@since 2.0.0
@access public
@param int $Page Page number. | [
"Default",
"search",
"functionality",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.searchcontroller.php#L76-L140 |
236,546 | marando/phpSOFA | src/Marando/IAU/iauFalp03.php | iauFalp03.Falp03 | public static function Falp03($t) {
$a;
/* Mean anomaly of the Sun (IERS Conventions 2003). */
$a = fmod(1287104.793048 +
$t * ( 129596581.0481 +
$t * ( - 0.5532 +
$t * ( 0.000136 +
$t * ( - 0.00001149 ) ) ) ), TURNAS) * DAS2R;... | php | public static function Falp03($t) {
$a;
/* Mean anomaly of the Sun (IERS Conventions 2003). */
$a = fmod(1287104.793048 +
$t * ( 129596581.0481 +
$t * ( - 0.5532 +
$t * ( 0.000136 +
$t * ( - 0.00001149 ) ) ) ), TURNAS) * DAS2R;... | [
"public",
"static",
"function",
"Falp03",
"(",
"$",
"t",
")",
"{",
"$",
"a",
";",
"/* Mean anomaly of the Sun (IERS Conventions 2003). */",
"$",
"a",
"=",
"fmod",
"(",
"1287104.793048",
"+",
"$",
"t",
"*",
"(",
"129596581.0481",
"+",
"$",
"t",
"*",
"(",
"-... | - - - - - - - - - -
i a u F a l p 0 3
- - - - - - - - - -
Fundamental argument, IERS Conventions (2003):
mean anomaly of the Sun.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: canonical model.
Given:
t double TDB, Julia... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"F",
"a",
"l",
"p",
"0",
"3",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauFalp03.php#L48-L59 |
236,547 | rozaverta/cmf | core/Traits/GetTrait.php | GetTrait.choice | public function choice( array $keys, $default = false )
{
foreach( $keys as $key )
{
if( $this->offsetExists($key) )
{
return $this->items[$key];
}
}
return $default;
} | php | public function choice( array $keys, $default = false )
{
foreach( $keys as $key )
{
if( $this->offsetExists($key) )
{
return $this->items[$key];
}
}
return $default;
} | [
"public",
"function",
"choice",
"(",
"array",
"$",
"keys",
",",
"$",
"default",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"key",
")",
")",
"{",
"return... | Get an item from the collection by keys.
@param array $keys
@param bool $default default value
@return mixed | [
"Get",
"an",
"item",
"from",
"the",
"collection",
"by",
"keys",
"."
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Traits/GetTrait.php#L42-L53 |
236,548 | marando/phpSOFA | src/Marando/IAU/iauPmpx.php | iauPmpx.Pmpx | public static function Pmpx($rc, $dc, $pr, $pd, $px, $rv, $pmt, array $pob,
array &$pco) {
/* Km/s to au/year */
$VF = DAYSEC * DJM / DAU;
/* Light time for 1 au, Julian years */
$AULTY = AULT / DAYSEC / DJY;
$i;
$sr;
$cr;
$sd;
$cd;
$x;
$y;
$z;
$p = [];
... | php | public static function Pmpx($rc, $dc, $pr, $pd, $px, $rv, $pmt, array $pob,
array &$pco) {
/* Km/s to au/year */
$VF = DAYSEC * DJM / DAU;
/* Light time for 1 au, Julian years */
$AULTY = AULT / DAYSEC / DJY;
$i;
$sr;
$cr;
$sd;
$cd;
$x;
$y;
$z;
$p = [];
... | [
"public",
"static",
"function",
"Pmpx",
"(",
"$",
"rc",
",",
"$",
"dc",
",",
"$",
"pr",
",",
"$",
"pd",
",",
"$",
"px",
",",
"$",
"rv",
",",
"$",
"pmt",
",",
"array",
"$",
"pob",
",",
"array",
"&",
"$",
"pco",
")",
"{",
"/* Km/s to au/year */",... | - - - - - - - -
i a u P m p x
- - - - - - - -
Proper motion and parallax.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: support function.
Given:
rc,dc double ICRS RA,Dec at catalog epoch (radians)
pr double RA pro... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"P",
"m",
"p",
"x",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauPmpx.php#L61-L112 |
236,549 | squire-assistant/dependency-injection | Loader/YamlFileLoader.php | YamlFileLoader.parseImports | private function parseImports(array $content, $file)
{
if (!isset($content['imports'])) {
return;
}
if (!is_array($content['imports'])) {
throw new InvalidArgumentException(sprintf('The "imports" key should contain an array in %s. Check your YAML syntax.', $file));
... | php | private function parseImports(array $content, $file)
{
if (!isset($content['imports'])) {
return;
}
if (!is_array($content['imports'])) {
throw new InvalidArgumentException(sprintf('The "imports" key should contain an array in %s. Check your YAML syntax.', $file));
... | [
"private",
"function",
"parseImports",
"(",
"array",
"$",
"content",
",",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"content",
"[",
"'imports'",
"]",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"content"... | Parses all imports.
@param array $content
@param string $file | [
"Parses",
"all",
"imports",
"."
] | c61d77bf8814369344fd71b015d7238322126041 | https://github.com/squire-assistant/dependency-injection/blob/c61d77bf8814369344fd71b015d7238322126041/Loader/YamlFileLoader.php#L113-L132 |
236,550 | squire-assistant/dependency-injection | Loader/YamlFileLoader.php | YamlFileLoader.parseCallable | private function parseCallable($callable, $parameter, $id, $file)
{
if (is_string($callable)) {
if ('' !== $callable && '@' === $callable[0]) {
throw new InvalidArgumentException(sprintf('The value of the "%s" option for the "%s" service must be the id of the service without the ... | php | private function parseCallable($callable, $parameter, $id, $file)
{
if (is_string($callable)) {
if ('' !== $callable && '@' === $callable[0]) {
throw new InvalidArgumentException(sprintf('The value of the "%s" option for the "%s" service must be the id of the service without the ... | [
"private",
"function",
"parseCallable",
"(",
"$",
"callable",
",",
"$",
"parameter",
",",
"$",
"id",
",",
"$",
"file",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"callable",
")",
")",
"{",
"if",
"(",
"''",
"!==",
"$",
"callable",
"&&",
"'@'",
"===... | Parses a callable.
@param string|array $callable A callable
@param string $parameter A parameter (e.g. 'factory' or 'configurator')
@param string $id A service identifier
@param string $file A parsed file
@throws InvalidArgumentException When errors are occuried
@return string|array A ... | [
"Parses",
"a",
"callable",
"."
] | c61d77bf8814369344fd71b015d7238322126041 | https://github.com/squire-assistant/dependency-injection/blob/c61d77bf8814369344fd71b015d7238322126041/Loader/YamlFileLoader.php#L341-L366 |
236,551 | JumpGateio/Database | src/JumpGate/Database/Console/Commands/Conversions/Conversion.php | Conversion.clearData | protected function clearData($table, $clearLinks = false)
{
if ($this->option('clear')) {
$this->db->statement('SET FOREIGN_KEY_CHECKS=0;');
$this->db->table($table)->truncate();
if ($clearLinks) {
$this->db->table('table_links')->where('new_table', $tab... | php | protected function clearData($table, $clearLinks = false)
{
if ($this->option('clear')) {
$this->db->statement('SET FOREIGN_KEY_CHECKS=0;');
$this->db->table($table)->truncate();
if ($clearLinks) {
$this->db->table('table_links')->where('new_table', $tab... | [
"protected",
"function",
"clearData",
"(",
"$",
"table",
",",
"$",
"clearLinks",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
"'clear'",
")",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"statement",
"(",
"'SET FOREIGN_KEY_CHECKS=0;'"... | If set, truncate the database table.
@param string $table
@param boolean $clearLinks | [
"If",
"set",
"truncate",
"the",
"database",
"table",
"."
] | 0d857a1fa85a66dfe380ab153feaa3b167339822 | https://github.com/JumpGateio/Database/blob/0d857a1fa85a66dfe380ab153feaa3b167339822/src/JumpGate/Database/Console/Commands/Conversions/Conversion.php#L58-L71 |
236,552 | JumpGateio/Database | src/JumpGate/Database/Console/Commands/Conversions/Conversion.php | Conversion.getProperty | protected function getProperty($object, $key)
{
if (isset($object->{$key}) &&
(
(is_int($object->{$key}) && $object->{$key} != 0) ||
(is_string($object->{$key}) && $object->{$key} != '')
)
) {
return $object->{$key};
}
... | php | protected function getProperty($object, $key)
{
if (isset($object->{$key}) &&
(
(is_int($object->{$key}) && $object->{$key} != 0) ||
(is_string($object->{$key}) && $object->{$key} != '')
)
) {
return $object->{$key};
}
... | [
"protected",
"function",
"getProperty",
"(",
"$",
"object",
",",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"{",
"$",
"key",
"}",
")",
"&&",
"(",
"(",
"is_int",
"(",
"$",
"object",
"->",
"{",
"$",
"key",
"}",
")",
"&&",... | Get a property from an object. Return the value if it exists.
@param $object
@param $key
@return null | [
"Get",
"a",
"property",
"from",
"an",
"object",
".",
"Return",
"the",
"value",
"if",
"it",
"exists",
"."
] | 0d857a1fa85a66dfe380ab153feaa3b167339822 | https://github.com/JumpGateio/Database/blob/0d857a1fa85a66dfe380ab153feaa3b167339822/src/JumpGate/Database/Console/Commands/Conversions/Conversion.php#L81-L93 |
236,553 | JumpGateio/Database | src/JumpGate/Database/Console/Commands/Conversions/Conversion.php | Conversion.getModifiedDate | protected function getModifiedDate($object)
{
if (! isset($object->modified)) {
return date('Y-m-d h:i:s');
}
return $object->modified === '0000-00-00 00:00:00'
? date('Y-m-d h:i:s')
: $object->modified;
} | php | protected function getModifiedDate($object)
{
if (! isset($object->modified)) {
return date('Y-m-d h:i:s');
}
return $object->modified === '0000-00-00 00:00:00'
? date('Y-m-d h:i:s')
: $object->modified;
} | [
"protected",
"function",
"getModifiedDate",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"object",
"->",
"modified",
")",
")",
"{",
"return",
"date",
"(",
"'Y-m-d h:i:s'",
")",
";",
"}",
"return",
"$",
"object",
"->",
"modified",
"=... | When a record has a modified date, make sure one is set.
@param $object
@return mixed | [
"When",
"a",
"record",
"has",
"a",
"modified",
"date",
"make",
"sure",
"one",
"is",
"set",
"."
] | 0d857a1fa85a66dfe380ab153feaa3b167339822 | https://github.com/JumpGateio/Database/blob/0d857a1fa85a66dfe380ab153feaa3b167339822/src/JumpGate/Database/Console/Commands/Conversions/Conversion.php#L119-L128 |
236,554 | JumpGateio/Database | src/JumpGate/Database/Console/Commands/Conversions/Conversion.php | Conversion.findLink | protected function findLink($originalTable, $originalId)
{
$link = $this->db->table('table_links')
->where('original_table', $originalTable)
->where('original_id', $originalId)
->first();
if (is_null($link)) {
$t... | php | protected function findLink($originalTable, $originalId)
{
$link = $this->db->table('table_links')
->where('original_table', $originalTable)
->where('original_id', $originalId)
->first();
if (is_null($link)) {
$t... | [
"protected",
"function",
"findLink",
"(",
"$",
"originalTable",
",",
"$",
"originalId",
")",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"db",
"->",
"table",
"(",
"'table_links'",
")",
"->",
"where",
"(",
"'original_table'",
",",
"$",
"originalTable",
")",
... | Find a new table id based on the old table and id.
@param string $originalTable
@param integer $originalId
@return mixed | [
"Find",
"a",
"new",
"table",
"id",
"based",
"on",
"the",
"old",
"table",
"and",
"id",
"."
] | 0d857a1fa85a66dfe380ab153feaa3b167339822 | https://github.com/JumpGateio/Database/blob/0d857a1fa85a66dfe380ab153feaa3b167339822/src/JumpGate/Database/Console/Commands/Conversions/Conversion.php#L138-L152 |
236,555 | ItinerisLtd/preflight-command | src/CheckerCollectionFactory.php | CheckerCollectionFactory.make | public static function make(): CheckerCollection
{
$checkerCollection = new CheckerCollection();
do_action(self::REGISTER_HOOK, $checkerCollection);
do_action(self::BOOT_HOOK, $checkerCollection);
return $checkerCollection;
} | php | public static function make(): CheckerCollection
{
$checkerCollection = new CheckerCollection();
do_action(self::REGISTER_HOOK, $checkerCollection);
do_action(self::BOOT_HOOK, $checkerCollection);
return $checkerCollection;
} | [
"public",
"static",
"function",
"make",
"(",
")",
":",
"CheckerCollection",
"{",
"$",
"checkerCollection",
"=",
"new",
"CheckerCollection",
"(",
")",
";",
"do_action",
"(",
"self",
"::",
"REGISTER_HOOK",
",",
"$",
"checkerCollection",
")",
";",
"do_action",
"(... | Instantiate a CheckerCollection instance.
Run the register hook to allow built-in and third-party checkers to be registered.
Run the boot hook to allow messaging registered checkers.
@return CheckerCollection | [
"Instantiate",
"a",
"CheckerCollection",
"instance",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/CheckerCollectionFactory.php#L19-L27 |
236,556 | harvestcloud/CoreBundle | Entity/Posting.php | Posting.updateAccountBalance | public function updateAccountBalance()
{
$this->getAccount()->setBalance($this->getAccount()->getBalance()+$this->getAmount());
$this->setBalanceAfterwards($this->getAccount()->getBalance());
} | php | public function updateAccountBalance()
{
$this->getAccount()->setBalance($this->getAccount()->getBalance()+$this->getAmount());
$this->setBalanceAfterwards($this->getAccount()->getBalance());
} | [
"public",
"function",
"updateAccountBalance",
"(",
")",
"{",
"$",
"this",
"->",
"getAccount",
"(",
")",
"->",
"setBalance",
"(",
"$",
"this",
"->",
"getAccount",
"(",
")",
"->",
"getBalance",
"(",
")",
"+",
"$",
"this",
"->",
"getAmount",
"(",
")",
")"... | Update Account balance
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2012-05-21 | [
"Update",
"Account",
"balance"
] | f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/Entity/Posting.php#L196-L200 |
236,557 | sebastianmonzel/webfiles-framework-php | source/core/datastore/MAbstractDatastore.php | MAbstractDatastore.storeWebfilesFromStream | public function storeWebfilesFromStream(MWebfileStream $webfileStream)
{
if ($this->isReadOnly()) {
throw new MDatastoreException("cannot modify data on read-only datastore.");
}
$webfiles = $webfileStream->getWebfiles();
foreach ($webfiles as $webfile) {
... | php | public function storeWebfilesFromStream(MWebfileStream $webfileStream)
{
if ($this->isReadOnly()) {
throw new MDatastoreException("cannot modify data on read-only datastore.");
}
$webfiles = $webfileStream->getWebfiles();
foreach ($webfiles as $webfile) {
... | [
"public",
"function",
"storeWebfilesFromStream",
"(",
"MWebfileStream",
"$",
"webfileStream",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isReadOnly",
"(",
")",
")",
"{",
"throw",
"new",
"MDatastoreException",
"(",
"\"cannot modify data on read-only datastore.\"",
")",
... | Stores all webfiles from a given webfilestream in the actual datastore
@param MWebfileStream $webfileStream
@throws MDatastoreException | [
"Stores",
"all",
"webfiles",
"from",
"a",
"given",
"webfilestream",
"in",
"the",
"actual",
"datastore"
] | 5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d | https://github.com/sebastianmonzel/webfiles-framework-php/blob/5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d/source/core/datastore/MAbstractDatastore.php#L130-L141 |
236,558 | monolyth-php/formulaic | src/Element/Identify.php | Identify.id | public function id() : string
{
$id = $this->name();
if ($this->prefix) {
$id = implode('-', $this->prefix)."-$id";
}
$id = preg_replace('/[\W]+/', '-', $id);
return trim(preg_replace('/[-]+/', '-', $id), '-');
} | php | public function id() : string
{
$id = $this->name();
if ($this->prefix) {
$id = implode('-', $this->prefix)."-$id";
}
$id = preg_replace('/[\W]+/', '-', $id);
return trim(preg_replace('/[-]+/', '-', $id), '-');
} | [
"public",
"function",
"id",
"(",
")",
":",
"string",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"name",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"prefix",
")",
"{",
"$",
"id",
"=",
"implode",
"(",
"'-'",
",",
"$",
"this",
"->",
"prefix",
")"... | Returns the ID generated for the element.
@return string | [
"Returns",
"the",
"ID",
"generated",
"for",
"the",
"element",
"."
] | 4bf7853a0c29cc17957f1b26c79f633867742c14 | https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Element/Identify.php#L32-L40 |
236,559 | webservices-nl/utils | src/StringUtils.php | StringUtils.stringEndsWith | public static function stringEndsWith($haystack, $needle)
{
if (!is_string($haystack) || !is_string($needle)) {
throw new \InvalidArgumentException('Not a string');
}
return (strrpos($haystack, $needle) + strlen($needle)) === strlen($haystack);
} | php | public static function stringEndsWith($haystack, $needle)
{
if (!is_string($haystack) || !is_string($needle)) {
throw new \InvalidArgumentException('Not a string');
}
return (strrpos($haystack, $needle) + strlen($needle)) === strlen($haystack);
} | [
"public",
"static",
"function",
"stringEndsWith",
"(",
"$",
"haystack",
",",
"$",
"needle",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"haystack",
")",
"||",
"!",
"is_string",
"(",
"$",
"needle",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgum... | Determine if a string ends with a particular sequence.
@param string $haystack
@param string $needle
@throws \InvalidArgumentException
@return bool | [
"Determine",
"if",
"a",
"string",
"ends",
"with",
"a",
"particular",
"sequence",
"."
] | 052f41ff725808b19d529e640f890ce7c863e100 | https://github.com/webservices-nl/utils/blob/052f41ff725808b19d529e640f890ce7c863e100/src/StringUtils.php#L40-L47 |
236,560 | webservices-nl/utils | src/StringUtils.php | StringUtils.stringStartsWith | public static function stringStartsWith($haystack, $needle)
{
if (!is_string($haystack) || !is_string($needle)) {
throw new \InvalidArgumentException('Not a string');
}
return strpos($haystack, $needle) === 0;
} | php | public static function stringStartsWith($haystack, $needle)
{
if (!is_string($haystack) || !is_string($needle)) {
throw new \InvalidArgumentException('Not a string');
}
return strpos($haystack, $needle) === 0;
} | [
"public",
"static",
"function",
"stringStartsWith",
"(",
"$",
"haystack",
",",
"$",
"needle",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"haystack",
")",
"||",
"!",
"is_string",
"(",
"$",
"needle",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArg... | Determine if a string starts with a particular sequence.
@param string $haystack
@param string $needle
@throws \InvalidArgumentException
@return bool | [
"Determine",
"if",
"a",
"string",
"starts",
"with",
"a",
"particular",
"sequence",
"."
] | 052f41ff725808b19d529e640f890ce7c863e100 | https://github.com/webservices-nl/utils/blob/052f41ff725808b19d529e640f890ce7c863e100/src/StringUtils.php#L59-L66 |
236,561 | webservices-nl/utils | src/StringUtils.php | StringUtils.removePrefix | public static function removePrefix($haystack, $prefix)
{
if (!is_string($haystack) || !is_string($prefix)) {
throw new \InvalidArgumentException('Not a string');
}
if (strpos($haystack, $prefix) === 0) {
$haystack = substr($haystack, strlen($prefix));
}
... | php | public static function removePrefix($haystack, $prefix)
{
if (!is_string($haystack) || !is_string($prefix)) {
throw new \InvalidArgumentException('Not a string');
}
if (strpos($haystack, $prefix) === 0) {
$haystack = substr($haystack, strlen($prefix));
}
... | [
"public",
"static",
"function",
"removePrefix",
"(",
"$",
"haystack",
",",
"$",
"prefix",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"haystack",
")",
"||",
"!",
"is_string",
"(",
"$",
"prefix",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumen... | Remove the prefix from the provided string.
@param string $haystack
@param string $prefix
@throws \InvalidArgumentException
@return string | [
"Remove",
"the",
"prefix",
"from",
"the",
"provided",
"string",
"."
] | 052f41ff725808b19d529e640f890ce7c863e100 | https://github.com/webservices-nl/utils/blob/052f41ff725808b19d529e640f890ce7c863e100/src/StringUtils.php#L78-L89 |
236,562 | webservices-nl/utils | src/StringUtils.php | StringUtils.toUnderscore | public static function toUnderscore($string)
{
if (!is_string($string)) {
throw new \InvalidArgumentException('Not a string');
}
$transCoder = Transcoder::create('ASCII');
$string = $transCoder->transcode(trim($string));
$words = explode(' ', $string);
r... | php | public static function toUnderscore($string)
{
if (!is_string($string)) {
throw new \InvalidArgumentException('Not a string');
}
$transCoder = Transcoder::create('ASCII');
$string = $transCoder->transcode(trim($string));
$words = explode(' ', $string);
r... | [
"public",
"static",
"function",
"toUnderscore",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Not a string'",
")",
";",
"}",
"$",
"transCoder",
"=",
... | Converts a string to underscore version.
Also tries to filter out higher UTF-8 chars.
@param string $string
@throws \Ddeboer\Transcoder\Exception\UnsupportedEncodingException
@throws \Ddeboer\Transcoder\Exception\ExtensionMissingException
@throws \InvalidArgumentException
@return string | [
"Converts",
"a",
"string",
"to",
"underscore",
"version",
".",
"Also",
"tries",
"to",
"filter",
"out",
"higher",
"UTF",
"-",
"8",
"chars",
"."
] | 052f41ff725808b19d529e640f890ce7c863e100 | https://github.com/webservices-nl/utils/blob/052f41ff725808b19d529e640f890ce7c863e100/src/StringUtils.php#L158-L169 |
236,563 | amercier/rectangular-mozaic | src/Assert.php | Assert.assertIntegerBetween | public static function assertIntegerBetween(int $min, int $max, int $value, string $name)
{
if ($value < $min || $value > $max) {
throw new InvalidArgumentException("Expecting {$name} to be between {$min} and {$max}, got {$value}");
}
} | php | public static function assertIntegerBetween(int $min, int $max, int $value, string $name)
{
if ($value < $min || $value > $max) {
throw new InvalidArgumentException("Expecting {$name} to be between {$min} and {$max}, got {$value}");
}
} | [
"public",
"static",
"function",
"assertIntegerBetween",
"(",
"int",
"$",
"min",
",",
"int",
"$",
"max",
",",
"int",
"$",
"value",
",",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"value",
"<",
"$",
"min",
"||",
"$",
"value",
">",
"$",
"max",
... | Assert an integer is between two known values
@param int $min Minimun acceptable value.
@param int $max Maximum acceptable value.
@param int $value Value to test.
@param string $name Name of the argument.
@return void
@throws InvalidArgumentException if `$value` is lower than `$min` or higher than `$max`. | [
"Assert",
"an",
"integer",
"is",
"between",
"two",
"known",
"values"
] | d026a82c1bc73979308235a7a440665e92ee8525 | https://github.com/amercier/rectangular-mozaic/blob/d026a82c1bc73979308235a7a440665e92ee8525/src/Assert.php#L52-L57 |
236,564 | dlabas/DlcBase | src/DlcBase/Controller/AbstractActionController.php | AbstractActionController.getClassNameWithoutNamespace | public function getClassNameWithoutNamespace()
{
if ($this->classNameWithoutNamespace === null) {
$class = explode('\\', get_class($this));
$this->classNameWithoutNamespace = substr(end($class), 0, -10);
}
return $this->classNameWithoutNamespace;
} | php | public function getClassNameWithoutNamespace()
{
if ($this->classNameWithoutNamespace === null) {
$class = explode('\\', get_class($this));
$this->classNameWithoutNamespace = substr(end($class), 0, -10);
}
return $this->classNameWithoutNamespace;
} | [
"public",
"function",
"getClassNameWithoutNamespace",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"classNameWithoutNamespace",
"===",
"null",
")",
"{",
"$",
"class",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_class",
"(",
"$",
"this",
")",
")",
";",
"$",
... | Getter for the class name without it's namespace
@return string | [
"Getter",
"for",
"the",
"class",
"name",
"without",
"it",
"s",
"namespace"
] | 0f6b1056a670c68fffa0055901e209cc45621599 | https://github.com/dlabas/DlcBase/blob/0f6b1056a670c68fffa0055901e209cc45621599/src/DlcBase/Controller/AbstractActionController.php#L75-L82 |
236,565 | dlabas/DlcBase | src/DlcBase/Controller/AbstractActionController.php | AbstractActionController.getRouteIdentifierPrefix | public function getRouteIdentifierPrefix()
{
if ($this->routeIdentifierPrefix === null) {
$this->routeIdentifierPrefix = strtolower($this->getModuleNamespace() . '/' . $this->getClassNameWithoutNamespace());
}
return $this->routeIdentifierPrefix;
} | php | public function getRouteIdentifierPrefix()
{
if ($this->routeIdentifierPrefix === null) {
$this->routeIdentifierPrefix = strtolower($this->getModuleNamespace() . '/' . $this->getClassNameWithoutNamespace());
}
return $this->routeIdentifierPrefix;
} | [
"public",
"function",
"getRouteIdentifierPrefix",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"routeIdentifierPrefix",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"routeIdentifierPrefix",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"getModuleNamespace",
"(",
"... | Returns the prefix for the route identifier | [
"Returns",
"the",
"prefix",
"for",
"the",
"route",
"identifier"
] | 0f6b1056a670c68fffa0055901e209cc45621599 | https://github.com/dlabas/DlcBase/blob/0f6b1056a670c68fffa0055901e209cc45621599/src/DlcBase/Controller/AbstractActionController.php#L113-L119 |
236,566 | phossa2/libs | src/Phossa2/Route/Collector/Collector.php | Collector.checkDuplication | protected function checkDuplication(
RouteInterface $route,
/*# string */ $routeKey,
/*# string */ $method
) {
if (isset($this->routes[$routeKey][$method])) {
throw new LogicException(
Message::get(
Message::RTE_ROUTE_DUPLICATED,
... | php | protected function checkDuplication(
RouteInterface $route,
/*# string */ $routeKey,
/*# string */ $method
) {
if (isset($this->routes[$routeKey][$method])) {
throw new LogicException(
Message::get(
Message::RTE_ROUTE_DUPLICATED,
... | [
"protected",
"function",
"checkDuplication",
"(",
"RouteInterface",
"$",
"route",
",",
"/*# string */",
"$",
"routeKey",
",",
"/*# string */",
"$",
"method",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"routeKey",
"]",
"[",
"$... | Same route pattern and method ?
@param RouteInterface $route
@param string $routeKey
@param string $method
@throws LogicException if duplication found
@access protected | [
"Same",
"route",
"pattern",
"and",
"method",
"?"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Route/Collector/Collector.php#L113-L128 |
236,567 | subcosm/observatory | src/ObservableTrait.php | ObservableTrait.notify | protected function notify(ObservationContainerInterface $container): ? ObservationContainerInterface
{
foreach ( $this->observers as $current ) {
$current->update($container);
}
return $container;
} | php | protected function notify(ObservationContainerInterface $container): ? ObservationContainerInterface
{
foreach ( $this->observers as $current ) {
$current->update($container);
}
return $container;
} | [
"protected",
"function",
"notify",
"(",
"ObservationContainerInterface",
"$",
"container",
")",
":",
"?",
"ObservationContainerInterface",
"{",
"foreach",
"(",
"$",
"this",
"->",
"observers",
"as",
"$",
"current",
")",
"{",
"$",
"current",
"->",
"update",
"(",
... | notifies all observers using a observation container implementation.
@param ObservationContainerInterface $container
@return ObservationContainerInterface|null | [
"notifies",
"all",
"observers",
"using",
"a",
"observation",
"container",
"implementation",
"."
] | 7c8c4eb0193fff9a2f40c33b2d3eb344314852e9 | https://github.com/subcosm/observatory/blob/7c8c4eb0193fff9a2f40c33b2d3eb344314852e9/src/ObservableTrait.php#L67-L74 |
236,568 | rafflesargentina/l5-user-action | src/Providers/RouteServiceProvider.php | RouteServiceProvider.mapWebRoutes | protected function mapWebRoutes()
{
Route::group([
'middleware' => config($this->package.'.web_routes_middleware') ?: 'web',
'namespace' => $this->namespace,
'prefix' => $this->prefix,
], function ($router) {
require __DIR__.'/../Routes/web.php';
... | php | protected function mapWebRoutes()
{
Route::group([
'middleware' => config($this->package.'.web_routes_middleware') ?: 'web',
'namespace' => $this->namespace,
'prefix' => $this->prefix,
], function ($router) {
require __DIR__.'/../Routes/web.php';
... | [
"protected",
"function",
"mapWebRoutes",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'middleware'",
"=>",
"config",
"(",
"$",
"this",
"->",
"package",
".",
"'.web_routes_middleware'",
")",
"?",
":",
"'web'",
",",
"'namespace'",
"=>",
"$",
"this",
"->... | Define the "web" routes for the module.
These routes all receive session state, CSRF protection, etc.
@return void | [
"Define",
"the",
"web",
"routes",
"for",
"the",
"module",
"."
] | eb13dd46bf8b45e498104bd14527afa0625f7ee1 | https://github.com/rafflesargentina/l5-user-action/blob/eb13dd46bf8b45e498104bd14527afa0625f7ee1/src/Providers/RouteServiceProvider.php#L70-L79 |
236,569 | GrupaZero/core | src/Gzero/Core/Validators/AbstractValidator.php | AbstractValidator.validate | public function validate($context = 'default', array $data = [])
{
if (!empty($data)) {
$this->setData($data);
}
$this->setContext($context);
$rules = $this->buildRulesArray();
$validator = $this->factory->make($this->filterArray($rules, $this->data), $rules);
... | php | public function validate($context = 'default', array $data = [])
{
if (!empty($data)) {
$this->setData($data);
}
$this->setContext($context);
$rules = $this->buildRulesArray();
$validator = $this->factory->make($this->filterArray($rules, $this->data), $rules);
... | [
"public",
"function",
"validate",
"(",
"$",
"context",
"=",
"'default'",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"setData",
"(",
"$",
"data",
")",
";",
"}"... | Validate passed data
@param string $context Validation context
@param array $data Data to validate
@throws InvalidArgumentException
@throws ValidationException
@return array | [
"Validate",
"passed",
"data"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Validators/AbstractValidator.php#L57-L70 |
236,570 | GrupaZero/core | src/Gzero/Core/Validators/AbstractValidator.php | AbstractValidator.buildRulesArray | protected function buildRulesArray()
{
if (method_exists($this, $this->context)) {
$rules = $this->{$this->context}();
} elseif (isset($this->rules[$this->context])) {
$rules = $this->rules[$this->context];
} else {
throw new InvalidArgumentException("Unde... | php | protected function buildRulesArray()
{
if (method_exists($this, $this->context)) {
$rules = $this->{$this->context}();
} elseif (isset($this->rules[$this->context])) {
$rules = $this->rules[$this->context];
} else {
throw new InvalidArgumentException("Unde... | [
"protected",
"function",
"buildRulesArray",
"(",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"context",
")",
")",
"{",
"$",
"rules",
"=",
"$",
"this",
"->",
"{",
"$",
"this",
"->",
"context",
"}",
"(",
")",
";",
... | Build rules array
@throws InvalidArgumentException
@return array | [
"Build",
"rules",
"array"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Validators/AbstractValidator.php#L131-L141 |
236,571 | GrupaZero/core | src/Gzero/Core/Validators/AbstractValidator.php | AbstractValidator.filterArray | protected function filterArray($rules, $rawAttributes)
{
$attributes = [];
foreach (array_keys($rules) as $filedName) {
$value = array_get($rawAttributes, $filedName, 'not found in array'); // Default value !== null
if ($value !== 'not found in array') { // Only if field spec... | php | protected function filterArray($rules, $rawAttributes)
{
$attributes = [];
foreach (array_keys($rules) as $filedName) {
$value = array_get($rawAttributes, $filedName, 'not found in array'); // Default value !== null
if ($value !== 'not found in array') { // Only if field spec... | [
"protected",
"function",
"filterArray",
"(",
"$",
"rules",
",",
"$",
"rawAttributes",
")",
"{",
"$",
"attributes",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"rules",
")",
"as",
"$",
"filedName",
")",
"{",
"$",
"value",
"=",
"array_get... | Filter array with data to validate
@param array $rules Rules array
@param array $rawAttributes Array with data passed to validation
@return array | [
"Filter",
"array",
"with",
"data",
"to",
"validate"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Validators/AbstractValidator.php#L151-L168 |
236,572 | milkyway-multimedia/ss-zen-forms | src/Traits/RequestHandlerDecorator.php | RequestHandlerDecorator.handleRequest | public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
return $this->original()->handleRequest($request, $model);
} | php | public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
return $this->original()->handleRequest($request, $model);
} | [
"public",
"function",
"handleRequest",
"(",
"SS_HTTPRequest",
"$",
"request",
",",
"DataModel",
"$",
"model",
")",
"{",
"return",
"$",
"this",
"->",
"original",
"(",
")",
"->",
"handleRequest",
"(",
"$",
"request",
",",
"$",
"model",
")",
";",
"}"
] | Iterate until we reach the original object
A bit hacky but if it works, it works
@param SS_HTTPRequest $request
@param DataModel $model
@return array|\RequestHandler|\SS_HTTPResponse|string | [
"Iterate",
"until",
"we",
"reach",
"the",
"original",
"object",
"A",
"bit",
"hacky",
"but",
"if",
"it",
"works",
"it",
"works"
] | 24098390d88fff016a6e6299fd2fda50f11be064 | https://github.com/milkyway-multimedia/ss-zen-forms/blob/24098390d88fff016a6e6299fd2fda50f11be064/src/Traits/RequestHandlerDecorator.php#L24-L26 |
236,573 | cosmow/riak | lib/CosmoW/Riak/Database.php | Database.getSlaveOkay | public function getSlaveOkay()
{
if (version_compare(phpversion('mongo'), '1.3.0', '<')) {
return $this->riak->getSlaveOkay();
}
$readPref = $this->getReadPreference();
return \RiakClient::RP_PRIMARY !== $readPref['type'];
} | php | public function getSlaveOkay()
{
if (version_compare(phpversion('mongo'), '1.3.0', '<')) {
return $this->riak->getSlaveOkay();
}
$readPref = $this->getReadPreference();
return \RiakClient::RP_PRIMARY !== $readPref['type'];
} | [
"public",
"function",
"getSlaveOkay",
"(",
")",
"{",
"if",
"(",
"version_compare",
"(",
"phpversion",
"(",
"'mongo'",
")",
",",
"'1.3.0'",
",",
"'<'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"riak",
"->",
"getSlaveOkay",
"(",
")",
";",
"}",
"$",
... | Get whether secondary read queries are allowed for this database.
This method wraps getSlaveOkay() for driver versions before 1.3.0. For
newer drivers, this method considers any read preference other than
PRIMARY as a true "slaveOkay" value.
@see http://php.net/manual/en/mongodb.getreadpreference.php
@see http://php.... | [
"Get",
"whether",
"secondary",
"read",
"queries",
"are",
"allowed",
"for",
"this",
"database",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Database.php#L372-L381 |
236,574 | cosmow/riak | lib/CosmoW/Riak/Database.php | Database.setSlaveOkay | public function setSlaveOkay($ok = true)
{
if (version_compare(phpversion('mongo'), '1.3.0', '<')) {
return $this->riak->setSlaveOkay($ok);
}
$prevSlaveOkay = $this->getSlaveOkay();
if ($ok) {
// Preserve existing tags for non-primary read preferences
... | php | public function setSlaveOkay($ok = true)
{
if (version_compare(phpversion('mongo'), '1.3.0', '<')) {
return $this->riak->setSlaveOkay($ok);
}
$prevSlaveOkay = $this->getSlaveOkay();
if ($ok) {
// Preserve existing tags for non-primary read preferences
... | [
"public",
"function",
"setSlaveOkay",
"(",
"$",
"ok",
"=",
"true",
")",
"{",
"if",
"(",
"version_compare",
"(",
"phpversion",
"(",
"'mongo'",
")",
",",
"'1.3.0'",
",",
"'<'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"riak",
"->",
"setSlaveOkay",
"("... | Set whether secondary read queries are allowed for this database.
This method wraps setSlaveOkay() for driver versions before 1.3.0. For
newer drivers, this method wraps setReadPreference() and specifies
SECONDARY_PREFERRED.
@see http://php.net/manual/en/mongodb.setreadpreference.php
@see http://php.net/manual/en/mon... | [
"Set",
"whether",
"secondary",
"read",
"queries",
"are",
"allowed",
"for",
"this",
"database",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Database.php#L395-L413 |
236,575 | gossi/trixionary | src/model/Base/LineageQuery.php | LineageQuery.filterByAncestorId | public function filterByAncestorId($ancestorId = null, $comparison = null)
{
if (is_array($ancestorId)) {
$useMinMax = false;
if (isset($ancestorId['min'])) {
$this->addUsingAlias(LineageTableMap::COL_ANCESTOR_ID, $ancestorId['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByAncestorId($ancestorId = null, $comparison = null)
{
if (is_array($ancestorId)) {
$useMinMax = false;
if (isset($ancestorId['min'])) {
$this->addUsingAlias(LineageTableMap::COL_ANCESTOR_ID, $ancestorId['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByAncestorId",
"(",
"$",
"ancestorId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"ancestorId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the ancestor_id column
Example usage:
<code>
$query->filterByAncestorId(1234); // WHERE ancestor_id = 1234
$query->filterByAncestorId(array(12, 34)); // WHERE ancestor_id IN (12, 34)
$query->filterByAncestorId(array('min' => 12)); // WHERE ancestor_id > 12
</code>
@see filterByAncestor()
@p... | [
"Filter",
"the",
"query",
"on",
"the",
"ancestor_id",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/LineageQuery.php#L354-L375 |
236,576 | gossi/trixionary | src/model/Base/LineageQuery.php | LineageQuery.useAncestorQuery | public function useAncestorQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAncestor($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Ancestor', '\gossi\trixionary\model\SkillQuery');
} | php | public function useAncestorQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAncestor($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Ancestor', '\gossi\trixionary\model\SkillQuery');
} | [
"public",
"function",
"useAncestorQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinAncestor",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
... | Use the Ancestor relation Skill object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \gossi\trixionary\model\SkillQuery A secondary... | [
"Use",
"the",
"Ancestor",
"relation",
"Skill",
"object"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/LineageQuery.php#L565-L570 |
236,577 | chriscollins/general-utils | lib/ChrisCollins/GeneralUtils/Tree/TreeNode.php | TreeNode.buildTreeAndGetRoots | public static function buildTreeAndGetRoots(array $objects)
{
$nodeClass = get_called_class(); // Use late static binding so new nodes are created as the calling subclass.
// Build a TreeNode for each object.
$nodes = array();
foreach ($objects as $object) {
$nodes[] = n... | php | public static function buildTreeAndGetRoots(array $objects)
{
$nodeClass = get_called_class(); // Use late static binding so new nodes are created as the calling subclass.
// Build a TreeNode for each object.
$nodes = array();
foreach ($objects as $object) {
$nodes[] = n... | [
"public",
"static",
"function",
"buildTreeAndGetRoots",
"(",
"array",
"$",
"objects",
")",
"{",
"$",
"nodeClass",
"=",
"get_called_class",
"(",
")",
";",
"// Use late static binding so new nodes are created as the calling subclass.",
"// Build a TreeNode for each object.",
"$",... | Build a tree from an array of TreeNodeObjectInterface objects.
@param array $objects An array of TreeNodeObjectInterface objects to make into a tree.
@return array An array of TreeNodes, each representing a root (i.e. a node for which no parent was found). | [
"Build",
"a",
"tree",
"from",
"an",
"array",
"of",
"TreeNodeObjectInterface",
"objects",
"."
] | 3fef519f3dd97bf15aa16ff528152ae663e027ac | https://github.com/chriscollins/general-utils/blob/3fef519f3dd97bf15aa16ff528152ae663e027ac/lib/ChrisCollins/GeneralUtils/Tree/TreeNode.php#L136-L169 |
236,578 | nice-php/twig | src/Twig/AssetExtension.php | AssetExtension.getAssetUrl | public function getAssetUrl($path)
{
if (false !== strpos($path, '://') || 0 === strpos($path, '//')) {
return $path;
}
if (!$this->container->has('request')) {
return $path;
}
if ('/' !== substr($path, 0, 1)) {
$path = '/' . $path;
... | php | public function getAssetUrl($path)
{
if (false !== strpos($path, '://') || 0 === strpos($path, '//')) {
return $path;
}
if (!$this->container->has('request')) {
return $path;
}
if ('/' !== substr($path, 0, 1)) {
$path = '/' . $path;
... | [
"public",
"function",
"getAssetUrl",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"false",
"!==",
"strpos",
"(",
"$",
"path",
",",
"'://'",
")",
"||",
"0",
"===",
"strpos",
"(",
"$",
"path",
",",
"'//'",
")",
")",
"{",
"return",
"$",
"path",
";",
"}",
... | Returns the public path of an asset
@param string $path
@return string | [
"Returns",
"the",
"public",
"path",
"of",
"an",
"asset"
] | a7a634795bebcae250d0e83de1e070b0261d85e1 | https://github.com/nice-php/twig/blob/a7a634795bebcae250d0e83de1e070b0261d85e1/src/Twig/AssetExtension.php#L50-L68 |
236,579 | cstabor/screw | src/Screw/Base64UrlSafe.php | Base64UrlSafe.encode | public static function encode($data, $pad = null) {
$str = str_replace(array('+', '/'), array('-', '_'), base64_encode($data));
if (!$pad) {
$str = rtrim($str, '=');
}
return $str;
} | php | public static function encode($data, $pad = null) {
$str = str_replace(array('+', '/'), array('-', '_'), base64_encode($data));
if (!$pad) {
$str = rtrim($str, '=');
}
return $str;
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"pad",
"=",
"null",
")",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"array",
"(",
"'+'",
",",
"'/'",
")",
",",
"array",
"(",
"'-'",
",",
"'_'",
")",
",",
"base64_encode",
"(",
"... | encode a string
@param string $data
@param string $pad
@return string | [
"encode",
"a",
"string"
] | c160c2b740bd1e0e72535fddf1c15cab99558669 | https://github.com/cstabor/screw/blob/c160c2b740bd1e0e72535fddf1c15cab99558669/src/Screw/Base64UrlSafe.php#L22-L28 |
236,580 | n0m4dz/laracasa | Zend/Gdata/YouTube/ActivityEntry.php | Zend_Gdata_YouTube_ActivityEntry.getActivityType | public function getActivityType()
{
$categories = $this->getCategory();
foreach($categories as $category) {
if ($category->getScheme() == self::ACTIVITY_CATEGORY_SCHEME) {
return $category->getTerm();
}
}
return null;
} | php | public function getActivityType()
{
$categories = $this->getCategory();
foreach($categories as $category) {
if ($category->getScheme() == self::ACTIVITY_CATEGORY_SCHEME) {
return $category->getTerm();
}
}
return null;
} | [
"public",
"function",
"getActivityType",
"(",
")",
"{",
"$",
"categories",
"=",
"$",
"this",
"->",
"getCategory",
"(",
")",
";",
"foreach",
"(",
"$",
"categories",
"as",
"$",
"category",
")",
"{",
"if",
"(",
"$",
"category",
"->",
"getScheme",
"(",
")"... | Return the activity type that was performed.
Convenience method that inspects category where scheme is
http://gdata.youtube.com/schemas/2007/userevents.cat.
@return string|null The activity category if found. | [
"Return",
"the",
"activity",
"type",
"that",
"was",
"performed",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/YouTube/ActivityEntry.php#L211-L220 |
236,581 | prototypemvc/prototypemvc | Core/Bootstrap.php | Bootstrap._callControllerMethod | protected function _callControllerMethod() {
// Make sure the controller we are calling exists
if (!isset($this->_controller) || !is_object($this->_controller)) {
$this->_error("Controller does not exist: " . $this->_url_controller);
return false;
}
// Make sure... | php | protected function _callControllerMethod() {
// Make sure the controller we are calling exists
if (!isset($this->_controller) || !is_object($this->_controller)) {
$this->_error("Controller does not exist: " . $this->_url_controller);
return false;
}
// Make sure... | [
"protected",
"function",
"_callControllerMethod",
"(",
")",
"{",
"// Make sure the controller we are calling exists",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_controller",
")",
"||",
"!",
"is_object",
"(",
"$",
"this",
"->",
"_controller",
")",
")",
"{... | If a method is passed in the GET url paremter | [
"If",
"a",
"method",
"is",
"passed",
"in",
"the",
"GET",
"url",
"paremter"
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Bootstrap.php#L86-L101 |
236,582 | chipaau/support | src/Support/JsonApi/Core/SchemaContainer.php | SchemaContainer.getSchemaByType | public function getSchemaByType($modelClass)
{
if (array_key_exists($modelClass, $this->schemaInstances) === true) {
return $this->schemaInstances[$modelClass];
}
if ($this->hasSchemaForModelClass($modelClass) === false) {
throw new InvalidArgumentException("Schema w... | php | public function getSchemaByType($modelClass)
{
if (array_key_exists($modelClass, $this->schemaInstances) === true) {
return $this->schemaInstances[$modelClass];
}
if ($this->hasSchemaForModelClass($modelClass) === false) {
throw new InvalidArgumentException("Schema w... | [
"public",
"function",
"getSchemaByType",
"(",
"$",
"modelClass",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"modelClass",
",",
"$",
"this",
"->",
"schemaInstances",
")",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"schemaInstances",
"[",
... | Get schema provider by resource type.
@param string $modelClass
@return SchemaProviderInterface | [
"Get",
"schema",
"provider",
"by",
"resource",
"type",
"."
] | 2fe3673ed2330bd064d37b2f0bac3e02ca110bef | https://github.com/chipaau/support/blob/2fe3673ed2330bd064d37b2f0bac3e02ca110bef/src/Support/JsonApi/Core/SchemaContainer.php#L100-L116 |
236,583 | mvccore/ext-form | src/MvcCore/Ext/Forms/Field/Getters.php | Getters.& | public function & HasValidator ($validatorNameOrInstance) {
if (is_string($validatorNameOrInstance)) {
$validatorClassName = $validatorNameOrInstance;
} else if ($validatorNameOrInstance instanceof \MvcCore\Ext\Forms\IValidator) {
$validatorClassName = get_class($validatorNameOrInstance);
} else {
return... | php | public function & HasValidator ($validatorNameOrInstance) {
if (is_string($validatorNameOrInstance)) {
$validatorClassName = $validatorNameOrInstance;
} else if ($validatorNameOrInstance instanceof \MvcCore\Ext\Forms\IValidator) {
$validatorClassName = get_class($validatorNameOrInstance);
} else {
return... | [
"public",
"function",
"&",
"HasValidator",
"(",
"$",
"validatorNameOrInstance",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"validatorNameOrInstance",
")",
")",
"{",
"$",
"validatorClassName",
"=",
"$",
"validatorNameOrInstance",
";",
"}",
"else",
"if",
"(",
"... | Get `TRUE`, if field has configured in it's validators array
given validator class ending name or validator instance.
@param string|\MvcCore\Ext\Forms\IValidator $validatorNameOrInstance
@return bool | [
"Get",
"TRUE",
"if",
"field",
"has",
"configured",
"in",
"it",
"s",
"validators",
"array",
"given",
"validator",
"class",
"ending",
"name",
"or",
"validator",
"instance",
"."
] | 8d81a3c7326236702f37dc4b9d968907b3230b9f | https://github.com/mvccore/ext-form/blob/8d81a3c7326236702f37dc4b9d968907b3230b9f/src/MvcCore/Ext/Forms/Field/Getters.php#L128-L144 |
236,584 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/ActionTable.php | PHP_ParserGenerator_ActionTable.acttab_action | function acttab_action($lookahead, $action)
{
if ($this->nLookahead === 0) {
$this->aLookahead = array();
$this->mxLookahead = $lookahead;
$this->mnLookahead = $lookahead;
$this->mnAction = $action;
} else {
if ($this->mxLookahead < $lookah... | php | function acttab_action($lookahead, $action)
{
if ($this->nLookahead === 0) {
$this->aLookahead = array();
$this->mxLookahead = $lookahead;
$this->mnLookahead = $lookahead;
$this->mnAction = $action;
} else {
if ($this->mxLookahead < $lookah... | [
"function",
"acttab_action",
"(",
"$",
"lookahead",
",",
"$",
"action",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"nLookahead",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"aLookahead",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"mxLookahead",
"=",
... | Add a new action to the current transaction set
@param int $lookahead
@param int $action
@return void | [
"Add",
"a",
"new",
"action",
"to",
"the",
"current",
"transaction",
"set"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/ActionTable.php#L137-L157 |
236,585 | mtoolkit/mtoolkit-view | src/MImage.php | MImage.scaled | public function scaled( $width, $height, $aspectRatioMode = AspectRatioMode::IGNORE_ASPECT_RATIO )
{
switch( $aspectRatioMode )
{
case AspectRatioMode::IGNORE_ASPECT_RATIO:
break;
case AspectRatioMode::KEEP_ASPECT_RATIO:
$height = ($width * $th... | php | public function scaled( $width, $height, $aspectRatioMode = AspectRatioMode::IGNORE_ASPECT_RATIO )
{
switch( $aspectRatioMode )
{
case AspectRatioMode::IGNORE_ASPECT_RATIO:
break;
case AspectRatioMode::KEEP_ASPECT_RATIO:
$height = ($width * $th... | [
"public",
"function",
"scaled",
"(",
"$",
"width",
",",
"$",
"height",
",",
"$",
"aspectRatioMode",
"=",
"AspectRatioMode",
"::",
"IGNORE_ASPECT_RATIO",
")",
"{",
"switch",
"(",
"$",
"aspectRatioMode",
")",
"{",
"case",
"AspectRatioMode",
"::",
"IGNORE_ASPECT_RA... | Returns a copy of the image scaled to a rectangle with the given width
and height according to the given aspectRatioMode and transformMode.
If either the width or the height is zero or negative,
this function returns a null image.
@param int $width
@param int $height
@param int|AspectRatioMode $aspectRatioMode
@return... | [
"Returns",
"a",
"copy",
"of",
"the",
"image",
"scaled",
"to",
"a",
"rectangle",
"with",
"the",
"given",
"width",
"and",
"height",
"according",
"to",
"the",
"given",
"aspectRatioMode",
"and",
"transformMode",
".",
"If",
"either",
"the",
"width",
"or",
"the",
... | ab2c66600992028d7726cbc736cbce274f731f65 | https://github.com/mtoolkit/mtoolkit-view/blob/ab2c66600992028d7726cbc736cbce274f731f65/src/MImage.php#L194-L218 |
236,586 | mtoolkit/mtoolkit-view | src/MImage.php | MImage.valid | public function valid( $x, $y )
{
return ($x > 0 && $x < $this->getWidth() && $y > 0 && $y < $this->getHeight());
} | php | public function valid( $x, $y )
{
return ($x > 0 && $x < $this->getWidth() && $y > 0 && $y < $this->getHeight());
} | [
"public",
"function",
"valid",
"(",
"$",
"x",
",",
"$",
"y",
")",
"{",
"return",
"(",
"$",
"x",
">",
"0",
"&&",
"$",
"x",
"<",
"$",
"this",
"->",
"getWidth",
"(",
")",
"&&",
"$",
"y",
">",
"0",
"&&",
"$",
"y",
"<",
"$",
"this",
"->",
"get... | Returns true if pos is a valid coordinate pair within the image;
otherwise returns false.
@param int $x
@param int $y
@return boolean | [
"Returns",
"true",
"if",
"pos",
"is",
"a",
"valid",
"coordinate",
"pair",
"within",
"the",
"image",
";",
"otherwise",
"returns",
"false",
"."
] | ab2c66600992028d7726cbc736cbce274f731f65 | https://github.com/mtoolkit/mtoolkit-view/blob/ab2c66600992028d7726cbc736cbce274f731f65/src/MImage.php#L359-L362 |
236,587 | PHPComponent/AtomicFile | src/AtomicFileWriter.php | AtomicFileWriter.rollbackOpeningFile | private function rollbackOpeningFile($temp_file = null)
{
flock($this->getFile(), LOCK_UN);
fclose($this->getFile());
if(is_resource($temp_file))
{
fclose($temp_file);
unlink($this->getTempFilePath());
}
} | php | private function rollbackOpeningFile($temp_file = null)
{
flock($this->getFile(), LOCK_UN);
fclose($this->getFile());
if(is_resource($temp_file))
{
fclose($temp_file);
unlink($this->getTempFilePath());
}
} | [
"private",
"function",
"rollbackOpeningFile",
"(",
"$",
"temp_file",
"=",
"null",
")",
"{",
"flock",
"(",
"$",
"this",
"->",
"getFile",
"(",
")",
",",
"LOCK_UN",
")",
";",
"fclose",
"(",
"$",
"this",
"->",
"getFile",
"(",
")",
")",
";",
"if",
"(",
... | Used only when failed to open temp file in OpenFile
@param resource|null $temp_file
@return void | [
"Used",
"only",
"when",
"failed",
"to",
"open",
"temp",
"file",
"in",
"OpenFile"
] | 9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8 | https://github.com/PHPComponent/AtomicFile/blob/9ca88297bdbdeb3bcbecdcbe884e4f412bb2cfe8/src/AtomicFileWriter.php#L192-L201 |
236,588 | strackovski/semtools | src/Classifiers/uClassify/UclassifyReader.php | UclassifyReader.classifierExists | private function classifierExists($classifier)
{
if (strpos($classifier, '/') !== false) {
$classifierArray = array_map('strtolower', explode('/', $classifier));
$testArray = array_change_key_case($this->classifiers);
// Remap classifiers list to lowercase before validat... | php | private function classifierExists($classifier)
{
if (strpos($classifier, '/') !== false) {
$classifierArray = array_map('strtolower', explode('/', $classifier));
$testArray = array_change_key_case($this->classifiers);
// Remap classifiers list to lowercase before validat... | [
"private",
"function",
"classifierExists",
"(",
"$",
"classifier",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"classifier",
",",
"'/'",
")",
"!==",
"false",
")",
"{",
"$",
"classifierArray",
"=",
"array_map",
"(",
"'strtolower'",
",",
"explode",
"(",
"'/'",
... | Verify if the requested classifier exists
@param string $classifier Classifier name, including provider namespace: namespace/classifier
@return array|bool Array with namespace and classifier if it exists, false if it doesn't
@throws \Exception | [
"Verify",
"if",
"the",
"requested",
"classifier",
"exists"
] | 6a11eff4eaa18e2939b08382bca5d60d9864a4fa | https://github.com/strackovski/semtools/blob/6a11eff4eaa18e2939b08382bca5d60d9864a4fa/src/Classifiers/uClassify/UclassifyReader.php#L181-L204 |
236,589 | aberdnikov/meerkat-core | classes/Kodoc.php | Kodoc.classes | public static function classes(array $list = null) {
if ($list === null) {
$list = Kohana::list_files('classes');
}
$namespaces = Kohana::$config->load('userguide.namespaces');
Debug::stop($namespaces);
$namespaces = \Arr::map(function ($names... | php | public static function classes(array $list = null) {
if ($list === null) {
$list = Kohana::list_files('classes');
}
$namespaces = Kohana::$config->load('userguide.namespaces');
Debug::stop($namespaces);
$namespaces = \Arr::map(function ($names... | [
"public",
"static",
"function",
"classes",
"(",
"array",
"$",
"list",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"list",
"===",
"null",
")",
"{",
"$",
"list",
"=",
"Kohana",
"::",
"list_files",
"(",
"'classes'",
")",
";",
"}",
"$",
"namespaces",
"=",
"... | Returns an array of all the classes available, built by listing all files in the classes folder.
@param array array of files, obtained using Kohana::list_files
@return array an array of all the class names | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"classes",
"available",
"built",
"by",
"listing",
"all",
"files",
"in",
"the",
"classes",
"folder",
"."
] | 9aab1555919d76f1920198c64e21fd3faf9b5f5d | https://github.com/aberdnikov/meerkat-core/blob/9aab1555919d76f1920198c64e21fd3faf9b5f5d/classes/Kodoc.php#L11-L54 |
236,590 | mickeyhead7/mickeyhead7-rsvp | src/Resource/Item.php | Item.getIncluded | public function getIncluded()
{
$data = [];
$include_params = $this->getIncludeParams();
if (!$include_params) {
return $include_params;
}
foreach ($include_params->getData() as $key => $params) {
$method = 'include' . ucfirst($key);
$tra... | php | public function getIncluded()
{
$data = [];
$include_params = $this->getIncludeParams();
if (!$include_params) {
return $include_params;
}
foreach ($include_params->getData() as $key => $params) {
$method = 'include' . ucfirst($key);
$tra... | [
"public",
"function",
"getIncluded",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"include_params",
"=",
"$",
"this",
"->",
"getIncludeParams",
"(",
")",
";",
"if",
"(",
"!",
"$",
"include_params",
")",
"{",
"return",
"$",
"include_params",
";"... | Get the includes to be parsed
@param Item $item
@return array | [
"Get",
"the",
"includes",
"to",
"be",
"parsed"
] | 36a780acd8b26bc9f313d7d2ebe44250f1aa6731 | https://github.com/mickeyhead7/mickeyhead7-rsvp/blob/36a780acd8b26bc9f313d7d2ebe44250f1aa6731/src/Resource/Item.php#L14-L35 |
236,591 | sios13/simox | src/Model.php | Model.getColumns | private function getColumns()
{
$columns = array();
/**
* Use call_user_func to make sure only public vars are returned
*/
$vars = call_user_func('get_object_vars', $this);
foreach ( $vars as $key => $value )
{
$colum... | php | private function getColumns()
{
$columns = array();
/**
* Use call_user_func to make sure only public vars are returned
*/
$vars = call_user_func('get_object_vars', $this);
foreach ( $vars as $key => $value )
{
$colum... | [
"private",
"function",
"getColumns",
"(",
")",
"{",
"$",
"columns",
"=",
"array",
"(",
")",
";",
"/**\r\n * Use call_user_func to make sure only public vars are returned\r\n */",
"$",
"vars",
"=",
"call_user_func",
"(",
"'get_object_vars'",
",",
"$",
"this... | Helper function, returns an array describing the model columns | [
"Helper",
"function",
"returns",
"an",
"array",
"describing",
"the",
"model",
"columns"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Model.php#L46-L63 |
236,592 | sios13/simox | src/Model.php | Model.getAttributes | private function getAttributes()
{
$attributes = array();
foreach ( $this->_columns as $column )
{
$attributes[$column["name"]] = $this->{$column["name"]};
}
return $attributes;
} | php | private function getAttributes()
{
$attributes = array();
foreach ( $this->_columns as $column )
{
$attributes[$column["name"]] = $this->{$column["name"]};
}
return $attributes;
} | [
"private",
"function",
"getAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_columns",
"as",
"$",
"column",
")",
"{",
"$",
"attributes",
"[",
"$",
"column",
"[",
"\"name\"",
"]",
"]",
"="... | Helper function, returns the model attributes as an array | [
"Helper",
"function",
"returns",
"the",
"model",
"attributes",
"as",
"an",
"array"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Model.php#L68-L78 |
236,593 | sios13/simox | src/Model.php | Model.createModel | private static function createModel( $row )
{
$table_name = get_called_class();
$model = new $table_name();
$model->setExists( true );
foreach ( $row as $key => $value )
{
if ( !is_int($key) )
{
$m... | php | private static function createModel( $row )
{
$table_name = get_called_class();
$model = new $table_name();
$model->setExists( true );
foreach ( $row as $key => $value )
{
if ( !is_int($key) )
{
$m... | [
"private",
"static",
"function",
"createModel",
"(",
"$",
"row",
")",
"{",
"$",
"table_name",
"=",
"get_called_class",
"(",
")",
";",
"$",
"model",
"=",
"new",
"$",
"table_name",
"(",
")",
";",
"$",
"model",
"->",
"setExists",
"(",
"true",
")",
";",
... | Helper function to create and initialize a model | [
"Helper",
"function",
"to",
"create",
"and",
"initialize",
"a",
"model"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Model.php#L83-L101 |
236,594 | sios13/simox | src/Model.php | Model.findFirst | public static function findFirst( $sub_sql = null, $params = null )
{
$params["find_first"] = true;
return self::find( $sub_sql, $params );
} | php | public static function findFirst( $sub_sql = null, $params = null )
{
$params["find_first"] = true;
return self::find( $sub_sql, $params );
} | [
"public",
"static",
"function",
"findFirst",
"(",
"$",
"sub_sql",
"=",
"null",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"params",
"[",
"\"find_first\"",
"]",
"=",
"true",
";",
"return",
"self",
"::",
"find",
"(",
"$",
"sub_sql",
",",
"$",
"par... | Returns only the first model | [
"Returns",
"only",
"the",
"first",
"model"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Model.php#L173-L178 |
236,595 | sios13/simox | src/Model.php | Model.save | public function save()
{
$di = DI::getDefault();
$database = $di->getService( "database" );
/**
* Decide if we should update or insert
* (if we know the record exists in the database...)
*/
if ( $this->_exists_in_db )
{
/**... | php | public function save()
{
$di = DI::getDefault();
$database = $di->getService( "database" );
/**
* Decide if we should update or insert
* (if we know the record exists in the database...)
*/
if ( $this->_exists_in_db )
{
/**... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"di",
"=",
"DI",
"::",
"getDefault",
"(",
")",
";",
"$",
"database",
"=",
"$",
"di",
"->",
"getService",
"(",
"\"database\"",
")",
";",
"/**\r\n * Decide if we should update or insert\r\n * (if we k... | Inserts or updates the database table | [
"Inserts",
"or",
"updates",
"the",
"database",
"table"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Model.php#L183-L238 |
236,596 | infotech-ru/yii-document-generator | src/Service/GeneratorService.php | GeneratorService.setRenderersConfig | public function setRenderersConfig(array $renderers)
{
foreach ($renderers as $name => $class) {
$renderer = new $class;
if (!$renderer instanceof RendererInterface) {
throw new GeneratorServiceException(
'Configured class of renderer must implemen... | php | public function setRenderersConfig(array $renderers)
{
foreach ($renderers as $name => $class) {
$renderer = new $class;
if (!$renderer instanceof RendererInterface) {
throw new GeneratorServiceException(
'Configured class of renderer must implemen... | [
"public",
"function",
"setRenderersConfig",
"(",
"array",
"$",
"renderers",
")",
"{",
"foreach",
"(",
"$",
"renderers",
"as",
"$",
"name",
"=>",
"$",
"class",
")",
"{",
"$",
"renderer",
"=",
"new",
"$",
"class",
";",
"if",
"(",
"!",
"$",
"renderer",
... | Instantiate and registering document renderers
@param array $renderers Renderers configuration map [name => fully qualified class name]
@throws GeneratorServiceException if map contains name of class that is not implementing RendererInterface
@throws GeneratorServiceException if map contains renderer name that already... | [
"Instantiate",
"and",
"registering",
"document",
"renderers"
] | 70e418a84c34930662f2f6a8e12687e2c8492849 | https://github.com/infotech-ru/yii-document-generator/blob/70e418a84c34930662f2f6a8e12687e2c8492849/src/Service/GeneratorService.php#L55-L67 |
236,597 | infotech-ru/yii-document-generator | src/Service/GeneratorService.php | GeneratorService.setDocumentTypesConfig | public function setDocumentTypesConfig(array $documentTypes)
{
foreach ($documentTypes as $name => $class) {
$documentType = new $class;
if (!$documentType instanceof AbstractDocumentType) {
throw new GeneratorServiceException(
'Configured class of... | php | public function setDocumentTypesConfig(array $documentTypes)
{
foreach ($documentTypes as $name => $class) {
$documentType = new $class;
if (!$documentType instanceof AbstractDocumentType) {
throw new GeneratorServiceException(
'Configured class of... | [
"public",
"function",
"setDocumentTypesConfig",
"(",
"array",
"$",
"documentTypes",
")",
"{",
"foreach",
"(",
"$",
"documentTypes",
"as",
"$",
"name",
"=>",
"$",
"class",
")",
"{",
"$",
"documentType",
"=",
"new",
"$",
"class",
";",
"if",
"(",
"!",
"$",
... | Instantiate and registering document types
@param array $documentTypes Document types configuration map [name => fully qualified class name]
@throws GeneratorServiceException if map contains name of class that is not descendant of AbstractDocumentType
@throws GeneratorServiceException if map contains type name that al... | [
"Instantiate",
"and",
"registering",
"document",
"types"
] | 70e418a84c34930662f2f6a8e12687e2c8492849 | https://github.com/infotech-ru/yii-document-generator/blob/70e418a84c34930662f2f6a8e12687e2c8492849/src/Service/GeneratorService.php#L76-L88 |
236,598 | gossi/trixionary | src/model/Base/ObjectQuery.php | ObjectQuery.filterByFixed | public function filterByFixed($fixed = null, $comparison = null)
{
if (is_string($fixed)) {
$fixed = in_array(strtolower($fixed), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ObjectTableMap::COL_FIXED, $fixed, $comparison);
} | php | public function filterByFixed($fixed = null, $comparison = null)
{
if (is_string($fixed)) {
$fixed = in_array(strtolower($fixed), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ObjectTableMap::COL_FIXED, $fixed, $comparison);
} | [
"public",
"function",
"filterByFixed",
"(",
"$",
"fixed",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"fixed",
")",
")",
"{",
"$",
"fixed",
"=",
"in_array",
"(",
"strtolower",
"(",
"$",
"fixed",
")",
... | Filter the query on the fixed column
Example usage:
<code>
$query->filterByFixed(true); // WHERE fixed = true
$query->filterByFixed('yes'); // WHERE fixed = true
</code>
@param boolean|string $fixed The value to use as filter.
Non-boolean arguments are converted using the following rules:
* 1, '1', 'true', 'on',... | [
"Filter",
"the",
"query",
"on",
"the",
"fixed",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ObjectQuery.php#L382-L389 |
236,599 | gossi/trixionary | src/model/Base/ObjectQuery.php | ObjectQuery.filterBySportId | public function filterBySportId($sportId = null, $comparison = null)
{
if (is_array($sportId)) {
$useMinMax = false;
if (isset($sportId['min'])) {
$this->addUsingAlias(ObjectTableMap::COL_SPORT_ID, $sportId['min'], Criteria::GREATER_EQUAL);
$useMinMax ... | php | public function filterBySportId($sportId = null, $comparison = null)
{
if (is_array($sportId)) {
$useMinMax = false;
if (isset($sportId['min'])) {
$this->addUsingAlias(ObjectTableMap::COL_SPORT_ID, $sportId['min'], Criteria::GREATER_EQUAL);
$useMinMax ... | [
"public",
"function",
"filterBySportId",
"(",
"$",
"sportId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"sportId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
... | Filter the query on the sport_id column
Example usage:
<code>
$query->filterBySportId(1234); // WHERE sport_id = 1234
$query->filterBySportId(array(12, 34)); // WHERE sport_id IN (12, 34)
$query->filterBySportId(array('min' => 12)); // WHERE sport_id > 12
</code>
@see filterBySport()
@param mixed $sportId ... | [
"Filter",
"the",
"query",
"on",
"the",
"sport_id",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ObjectQuery.php#L440-L461 |
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.