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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,400 | webriq/core | module/Paragraph/src/Grid/Paragraph/Controller/ChangeLayoutController.php | ChangeLayoutController.getLayoutId | protected function getLayoutId()
{
$paragraph = $this->findParagraph();
if ( empty( $paragraph ) )
{
/* @var $structure \Core\Model\SubDomain\Structure */
$structure = $this->getServiceLocator()
->get( 'Grid\Core\Model\SubDomain\Model' )... | php | protected function getLayoutId()
{
$paragraph = $this->findParagraph();
if ( empty( $paragraph ) )
{
/* @var $structure \Core\Model\SubDomain\Structure */
$structure = $this->getServiceLocator()
->get( 'Grid\Core\Model\SubDomain\Model' )... | [
"protected",
"function",
"getLayoutId",
"(",
")",
"{",
"$",
"paragraph",
"=",
"$",
"this",
"->",
"findParagraph",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"paragraph",
")",
")",
"{",
"/* @var $structure \\Core\\Model\\SubDomain\\Structure */",
"$",
"structur... | Get actual layout ID
@return int | [
"Get",
"actual",
"layout",
"ID"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/ChangeLayoutController.php#L145-L162 |
1,401 | webriq/core | module/Paragraph/src/Grid/Paragraph/Controller/ChangeLayoutController.php | ChangeLayoutController.localAction | public function localAction()
{
$success = null;
$request = $this->getRequest();
$data = $request->getPost();
$form = $this->getServiceLocator()
->get( 'Form' )
->create( 'Grid\Paragraph\ChangeLayout\Local', array(
... | php | public function localAction()
{
$success = null;
$request = $this->getRequest();
$data = $request->getPost();
$form = $this->getServiceLocator()
->get( 'Form' )
->create( 'Grid\Paragraph\ChangeLayout\Local', array(
... | [
"public",
"function",
"localAction",
"(",
")",
"{",
"$",
"success",
"=",
"null",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"data",
"=",
"$",
"request",
"->",
"getPost",
"(",
")",
";",
"$",
"form",
"=",
"$",
"t... | Change to local layout | [
"Change",
"to",
"local",
"layout"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/ChangeLayoutController.php#L199-L275 |
1,402 | webriq/core | module/Paragraph/src/Grid/Paragraph/Controller/ChangeLayoutController.php | ChangeLayoutController.importAction | public function importAction()
{
$success = null;
$request = $this->getRequest();
$data = $request->getPost();
$form = $this->getServiceLocator()
->get( 'Form' )
->create( 'Grid\Paragraph\ChangeLayout\Import', array(
... | php | public function importAction()
{
$success = null;
$request = $this->getRequest();
$data = $request->getPost();
$form = $this->getServiceLocator()
->get( 'Form' )
->create( 'Grid\Paragraph\ChangeLayout\Import', array(
... | [
"public",
"function",
"importAction",
"(",
")",
"{",
"$",
"success",
"=",
"null",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"data",
"=",
"$",
"request",
"->",
"getPost",
"(",
")",
";",
"$",
"form",
"=",
"$",
"... | Import layout & change to it | [
"Import",
"layout",
"&",
"change",
"to",
"it"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/ChangeLayoutController.php#L280-L348 |
1,403 | sebardo/ecommerce | EcommerceBundle/Controller/ContractController.php | ContractController.actorlistJsonAction | public function actorlistJsonAction($id)
{
$em = $this->getDoctrine()->getManager();
$actor = $em->getRepository('CoreBundle:Actor')->find($id);
if (!$actor) {
throw $this->createNotFoundException('Unable to find Actor entity.');
}
/** @var \AdminBundle... | php | public function actorlistJsonAction($id)
{
$em = $this->getDoctrine()->getManager();
$actor = $em->getRepository('CoreBundle:Actor')->find($id);
if (!$actor) {
throw $this->createNotFoundException('Unable to find Actor entity.');
}
/** @var \AdminBundle... | [
"public",
"function",
"actorlistJsonAction",
"(",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"actor",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'CoreBundle:Actor'",
")",
"... | Returns a list of Brand entities in JSON format.
@return JsonResponse
@Route("/{id}/list.{_format}", requirements={ "_format" = "json" }, defaults={ "_format" = "json" })
@Method("GET") | [
"Returns",
"a",
"list",
"of",
"Brand",
"entities",
"in",
"JSON",
"format",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/ContractController.php#L71-L88 |
1,404 | sebardo/ecommerce | EcommerceBundle/Controller/ContractController.php | ContractController.createAction | public function createAction(Request $request)
{
$entity = new Contract();
$form = $this->createCreateForm($entity);
$planForm = $this->createForm(new PlanType(), new Plan(), array(
'action' => $this->generateUrl('ecommerce_plan_new'),
'method' => 'POST',
));
... | php | public function createAction(Request $request)
{
$entity = new Contract();
$form = $this->createCreateForm($entity);
$planForm = $this->createForm(new PlanType(), new Plan(), array(
'action' => $this->generateUrl('ecommerce_plan_new'),
'method' => 'POST',
));
... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"entity",
"=",
"new",
"Contract",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"entity",
")",
";",
"$",
"planForm",
"=",
"$",
"t... | Creates a new Contract entity.
@Route("/")
@Method("POST")
@Template("EcommerceBundle:Contract:new.html.twig") | [
"Creates",
"a",
"new",
"Contract",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/ContractController.php#L97-L167 |
1,405 | sebardo/ecommerce | EcommerceBundle/Controller/ContractController.php | ContractController.createCreateForm | private function createCreateForm(Contract $entity)
{
$form = $this->createForm(new ContractType(), $entity, array(
'action' => $this->generateUrl('ecommerce_contract_create'),
'method' => 'POST',
));
// $form->add('submit', 'submit', array('label' => 'Create'));
... | php | private function createCreateForm(Contract $entity)
{
$form = $this->createForm(new ContractType(), $entity, array(
'action' => $this->generateUrl('ecommerce_contract_create'),
'method' => 'POST',
));
// $form->add('submit', 'submit', array('label' => 'Create'));
... | [
"private",
"function",
"createCreateForm",
"(",
"Contract",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ContractType",
"(",
")",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"g... | Creates a form to create a Contract entity.
@param Contract $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"Contract",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/ContractController.php#L176-L186 |
1,406 | sebardo/ecommerce | EcommerceBundle/Controller/ContractController.php | ContractController.newAction | public function newAction()
{
$entity = new Contract();
$form = $this->createCreateForm($entity);
$planForm = $this->createForm(new PlanType(), new Plan(), array(
'action' => $this->generateUrl('ecommerce_plan_new'),
'method' => 'POST',
));
... | php | public function newAction()
{
$entity = new Contract();
$form = $this->createCreateForm($entity);
$planForm = $this->createForm(new PlanType(), new Plan(), array(
'action' => $this->generateUrl('ecommerce_plan_new'),
'method' => 'POST',
));
... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"entity",
"=",
"new",
"Contract",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"entity",
")",
";",
"$",
"planForm",
"=",
"$",
"this",
"->",
"createForm",
"(",... | Displays a form to create a new Contract entity.
@Route("/new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Contract",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/ContractController.php#L195-L210 |
1,407 | sebardo/ecommerce | EcommerceBundle/Controller/ContractController.php | ContractController.showAction | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('EcommerceBundle:Contract')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Contract entity.');
}
$deleteForm = $this->crea... | php | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('EcommerceBundle:Contract')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Contract entity.');
}
$deleteForm = $this->crea... | [
"public",
"function",
"showAction",
"(",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"entity",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'EcommerceBundle:Contract'",
")",
"... | Finds and displays a Contract entity.
@Route("/{id}")
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"Contract",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/ContractController.php#L219-L243 |
1,408 | sebardo/ecommerce | EcommerceBundle/Controller/ContractController.php | ContractController.createEditForm | private function createEditForm(Contract $entity)
{
$form = $this->createForm(new ContractType(), $entity, array(
'action' => $this->generateUrl('ecommerce_contract_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
// $form->add('submit', 'submit', arr... | php | private function createEditForm(Contract $entity)
{
$form = $this->createForm(new ContractType(), $entity, array(
'action' => $this->generateUrl('ecommerce_contract_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
// $form->add('submit', 'submit', arr... | [
"private",
"function",
"createEditForm",
"(",
"Contract",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ContractType",
"(",
")",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"gen... | Creates a form to edit a Contract entity.
@param Contract $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"Contract",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/ContractController.php#L279-L289 |
1,409 | crysalead/env | src/Env.php | Env.offsetGet | public function offsetGet($offset)
{
if (!array_key_exists($offset, $this->_data)) {
return false;
}
return $this->_data[$offset];
} | php | public function offsetGet($offset)
{
if (!array_key_exists($offset, $this->_data)) {
return false;
}
return $this->_data[$offset];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"offset",
",",
"$",
"this",
"->",
"_data",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"_data",
"[",
"$",
"o... | Returns the value at specified offset or `false` if not exists.
@param string $offset The offset to retrieve.
@return mixed The value at offset. | [
"Returns",
"the",
"value",
"at",
"specified",
"offset",
"or",
"false",
"if",
"not",
"exists",
"."
] | f81b0e10dfdc56d75e8a032297976a86ceb29110 | https://github.com/crysalead/env/blob/f81b0e10dfdc56d75e8a032297976a86ceb29110/src/Env.php#L28-L34 |
1,410 | crysalead/env | src/Env.php | Env.set | public function set($collection, $value = null)
{
if (func_num_args() === 1) {
return parent::merge($collection, true);
}
$this->_data[$collection] = $value;
return $this;
} | php | public function set($collection, $value = null)
{
if (func_num_args() === 1) {
return parent::merge($collection, true);
}
$this->_data[$collection] = $value;
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"collection",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"1",
")",
"{",
"return",
"parent",
"::",
"merge",
"(",
"$",
"collection",
",",
"true",
")",
";",
"}",
"$",
... | Sets an array of variables.
@param string $collection The key.
@param mixed $value The value.
@param self | [
"Sets",
"an",
"array",
"of",
"variables",
"."
] | f81b0e10dfdc56d75e8a032297976a86ceb29110 | https://github.com/crysalead/env/blob/f81b0e10dfdc56d75e8a032297976a86ceb29110/src/Env.php#L43-L50 |
1,411 | crysalead/env | src/Env.php | Env.normalize | public static function normalize($env)
{
$env += ['PHP_SAPI' => PHP_SAPI];
if (isset($env['SCRIPT_URI'])) {
$env['HTTPS'] = strpos($env['SCRIPT_URI'], 'https://') === 0;
} elseif (isset($env['HTTPS'])) {
$env['HTTPS'] = (!empty($env['HTTPS']) && $env['HTTPS'] !== 'of... | php | public static function normalize($env)
{
$env += ['PHP_SAPI' => PHP_SAPI];
if (isset($env['SCRIPT_URI'])) {
$env['HTTPS'] = strpos($env['SCRIPT_URI'], 'https://') === 0;
} elseif (isset($env['HTTPS'])) {
$env['HTTPS'] = (!empty($env['HTTPS']) && $env['HTTPS'] !== 'of... | [
"public",
"static",
"function",
"normalize",
"(",
"$",
"env",
")",
"{",
"$",
"env",
"+=",
"[",
"'PHP_SAPI'",
"=>",
"PHP_SAPI",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"env",
"[",
"'SCRIPT_URI'",
"]",
")",
")",
"{",
"$",
"env",
"[",
"'HTTPS'",
"]",
... | Normalizes a couple of well known PHP environment variables.
@param array $env Some `$_SERVER` environment variables array.
@return The normalized variables. | [
"Normalizes",
"a",
"couple",
"of",
"well",
"known",
"PHP",
"environment",
"variables",
"."
] | f81b0e10dfdc56d75e8a032297976a86ceb29110 | https://github.com/crysalead/env/blob/f81b0e10dfdc56d75e8a032297976a86ceb29110/src/Env.php#L68-L104 |
1,412 | rseyferth/activerecord | lib/Serialization.php | Serialization.to_a | final public function to_a()
{
foreach ($this->attributes as &$value)
{
if ($value instanceof \DateTime)
$value = $value->format(self::$DATETIME_FORMAT);
}
return $this->attributes;
} | php | final public function to_a()
{
foreach ($this->attributes as &$value)
{
if ($value instanceof \DateTime)
$value = $value->format(self::$DATETIME_FORMAT);
}
return $this->attributes;
} | [
"final",
"public",
"function",
"to_a",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"attributes",
"as",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"\\",
"DateTime",
")",
"$",
"value",
"=",
"$",
"value",
"->",
"format",
... | Returns the attributes array.
@return array | [
"Returns",
"the",
"attributes",
"array",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Serialization.php#L215-L223 |
1,413 | samsonos/cms_app_gallery | src/Application.php | Application.tabBuilder | public function tabBuilder(\samsoncms\app\material\form\Form & $form)
{
// If we have related structures
if (count($form->navigationIDs)) {
// Get all gallery additional field for material form structures
$galleryFields = $this->query->entity(\samsoncms\api\Field::class)
... | php | public function tabBuilder(\samsoncms\app\material\form\Form & $form)
{
// If we have related structures
if (count($form->navigationIDs)) {
// Get all gallery additional field for material form structures
$galleryFields = $this->query->entity(\samsoncms\api\Field::class)
... | [
"public",
"function",
"tabBuilder",
"(",
"\\",
"samsoncms",
"\\",
"app",
"\\",
"material",
"\\",
"form",
"\\",
"Form",
"&",
"$",
"form",
")",
"{",
"// If we have related structures",
"if",
"(",
"count",
"(",
"$",
"form",
"->",
"navigationIDs",
")",
")",
"{... | Render all gallery additional fields as material form tabs
@param \samsoncms\app\material\form\Form $form Material form insctance | [
"Render",
"all",
"gallery",
"additional",
"fields",
"as",
"material",
"form",
"tabs"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L57-L73 |
1,414 | samsonos/cms_app_gallery | src/Application.php | Application.__async_getCount | public function __async_getCount($materialFieldId)
{
// @var array $result Result of asynchronous controller
$response = array('status' => 1);
// Getting quantity from DB by param materialFieldId
$response['count'] = $this->query
->entity(CMS::MATERIAL_IMAGES_RELATION_ENT... | php | public function __async_getCount($materialFieldId)
{
// @var array $result Result of asynchronous controller
$response = array('status' => 1);
// Getting quantity from DB by param materialFieldId
$response['count'] = $this->query
->entity(CMS::MATERIAL_IMAGES_RELATION_ENT... | [
"public",
"function",
"__async_getCount",
"(",
"$",
"materialFieldId",
")",
"{",
"// @var array $result Result of asynchronous controller",
"$",
"response",
"=",
"array",
"(",
"'status'",
"=>",
"1",
")",
";",
"// Getting quantity from DB by param materialFieldId",
"$",
"res... | Controller for getting quantity image in gallery.
@param integer $materialFieldId identefier Table MaterialField
@return array Async response array with additional param count. | [
"Controller",
"for",
"getting",
"quantity",
"image",
"in",
"gallery",
"."
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L142-L153 |
1,415 | samsonos/cms_app_gallery | src/Application.php | Application.__async_updateAlt | public function __async_updateAlt($imageId)
{
// @var array $result Result of asynchronous controller
$result = array('status' => false);
// @var \samson\activerecord\gallery $image Image to insert into editor
$image = null;
//get data from ajax
$data = json_decode(fi... | php | public function __async_updateAlt($imageId)
{
// @var array $result Result of asynchronous controller
$result = array('status' => false);
// @var \samson\activerecord\gallery $image Image to insert into editor
$image = null;
//get data from ajax
$data = json_decode(fi... | [
"public",
"function",
"__async_updateAlt",
"(",
"$",
"imageId",
")",
"{",
"// @var array $result Result of asynchronous controller",
"$",
"result",
"=",
"array",
"(",
"'status'",
"=>",
"false",
")",
";",
"// @var \\samson\\activerecord\\gallery $image Image to insert into edito... | Controller for update material image properties alt from gallery.
@param int $imageId Gallery image identifier
@return array async response | [
"Controller",
"for",
"update",
"material",
"image",
"properties",
"alt",
"from",
"gallery",
"."
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L161-L189 |
1,416 | samsonos/cms_app_gallery | src/Application.php | Application.verifyExtensionFile | private function verifyExtensionFile()
{
$supported_image = array(
'gif',
'jpg',
'jpeg',
'png'
);
$fileName = $_SERVER['HTTP_X_FILE_NAME'];
$ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
if (in_array($ext, $suppor... | php | private function verifyExtensionFile()
{
$supported_image = array(
'gif',
'jpg',
'jpeg',
'png'
);
$fileName = $_SERVER['HTTP_X_FILE_NAME'];
$ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
if (in_array($ext, $suppor... | [
"private",
"function",
"verifyExtensionFile",
"(",
")",
"{",
"$",
"supported_image",
"=",
"array",
"(",
"'gif'",
",",
"'jpg'",
",",
"'jpeg'",
",",
"'png'",
")",
";",
"$",
"fileName",
"=",
"$",
"_SERVER",
"[",
"'HTTP_X_FILE_NAME'",
"]",
";",
"$",
"ext",
"... | method for verify extension file
@return boolean true - file is image, false - file not image | [
"method",
"for",
"verify",
"extension",
"file"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L251-L267 |
1,417 | samsonos/cms_app_gallery | src/Application.php | Application.__async_priority | public function __async_priority()
{
$result = array('status' => true);
// If we have changed priority of images
if (isset($_POST['ids'])) {
// For each received image id
for ($i = 0; $i < count($_POST['ids']); $i++) {
/** @var \samson\activerecord\ga... | php | public function __async_priority()
{
$result = array('status' => true);
// If we have changed priority of images
if (isset($_POST['ids'])) {
// For each received image id
for ($i = 0; $i < count($_POST['ids']); $i++) {
/** @var \samson\activerecord\ga... | [
"public",
"function",
"__async_priority",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'status'",
"=>",
"true",
")",
";",
"// If we have changed priority of images",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"'ids'",
"]",
")",
")",
"{",
"// For each r... | Function to save image priority
@return array Async response array | [
"Function",
"to",
"save",
"image",
"priority"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L273-L298 |
1,418 | samsonos/cms_app_gallery | src/Application.php | Application.__async_show_edit | public function __async_show_edit($imageId)
{
/** @var array $result Result of asynchronous controller */
$result = array('status' => false);
/** @var \samson\activerecord\gallery $image Image to insert into editor */
$image = null;
if ($this->query->entity(CMS::MATERIAL_IMAG... | php | public function __async_show_edit($imageId)
{
/** @var array $result Result of asynchronous controller */
$result = array('status' => false);
/** @var \samson\activerecord\gallery $image Image to insert into editor */
$image = null;
if ($this->query->entity(CMS::MATERIAL_IMAG... | [
"public",
"function",
"__async_show_edit",
"(",
"$",
"imageId",
")",
"{",
"/** @var array $result Result of asynchronous controller */",
"$",
"result",
"=",
"array",
"(",
"'status'",
"=>",
"false",
")",
";",
"/** @var \\samson\\activerecord\\gallery $image Image to insert into ... | Asynchronous function to get image editor
@param int $imageId Image identifier to insert into editor
@return array Result array | [
"Asynchronous",
"function",
"to",
"get",
"image",
"editor"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L305-L326 |
1,419 | samsonos/cms_app_gallery | src/Application.php | Application.__async_edit | public function __async_edit($imageId)
{
/** @var array $result Result of asynchronous controller */
$result = array('status' => false);
/** @var \samson\activerecord\gallery $image Image to insert into editor */
$image = null;
/** @var resource $imageResource Copy of edit im... | php | public function __async_edit($imageId)
{
/** @var array $result Result of asynchronous controller */
$result = array('status' => false);
/** @var \samson\activerecord\gallery $image Image to insert into editor */
$image = null;
/** @var resource $imageResource Copy of edit im... | [
"public",
"function",
"__async_edit",
"(",
"$",
"imageId",
")",
"{",
"/** @var array $result Result of asynchronous controller */",
"$",
"result",
"=",
"array",
"(",
"'status'",
"=>",
"false",
")",
";",
"/** @var \\samson\\activerecord\\gallery $image Image to insert into edito... | Applies all changes with the image and save it
@param int $imageId Edit image identifier
@return array | [
"Applies",
"all",
"changes",
"with",
"the",
"image",
"and",
"save",
"it"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L333-L375 |
1,420 | samsonos/cms_app_gallery | src/Application.php | Application.getHTML | public function getHTML($materialFieldId)
{
// Get all material images
$items_html = '';
/** @var array $images List of gallery images */
$images = null;
// there are gallery images
if ($this->query->entity(CMS::MATERIAL_IMAGES_RELATION_ENTITY)->where('materialFieldId... | php | public function getHTML($materialFieldId)
{
// Get all material images
$items_html = '';
/** @var array $images List of gallery images */
$images = null;
// there are gallery images
if ($this->query->entity(CMS::MATERIAL_IMAGES_RELATION_ENTITY)->where('materialFieldId... | [
"public",
"function",
"getHTML",
"(",
"$",
"materialFieldId",
")",
"{",
"// Get all material images",
"$",
"items_html",
"=",
"''",
";",
"/** @var array $images List of gallery images */",
"$",
"images",
"=",
"null",
";",
"// there are gallery images",
"if",
"(",
"$",
... | Render gallery images list
@param string $materialFieldId Material identifier
@return string html representation of image list | [
"Render",
"gallery",
"images",
"list"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L382-L422 |
1,421 | samsonos/cms_app_gallery | src/Application.php | Application.humanFileSize | public function humanFileSize($bytes, $decimals = 2)
{
/** @var string $sizeLetters Size shortcuts */
$sizeLetters = 'BKBMBGBTBPB';
$factor = (int)(floor((strlen($bytes) - 1) / 3));
$sizeLetter = ($factor <= 0) ? substr($sizeLetters, 0, 1) : substr($sizeLetters, $factor * 2 - 1, 2);
... | php | public function humanFileSize($bytes, $decimals = 2)
{
/** @var string $sizeLetters Size shortcuts */
$sizeLetters = 'BKBMBGBTBPB';
$factor = (int)(floor((strlen($bytes) - 1) / 3));
$sizeLetter = ($factor <= 0) ? substr($sizeLetters, 0, 1) : substr($sizeLetters, $factor * 2 - 1, 2);
... | [
"public",
"function",
"humanFileSize",
"(",
"$",
"bytes",
",",
"$",
"decimals",
"=",
"2",
")",
"{",
"/** @var string $sizeLetters Size shortcuts */",
"$",
"sizeLetters",
"=",
"'BKBMBGBTBPB'",
";",
"$",
"factor",
"=",
"(",
"int",
")",
"(",
"floor",
"(",
"(",
... | Function to form image size
@param int $bytes Bytes count
@param int $decimals Decimal part of number(count of numbers)
@return string Generated image size | [
"Function",
"to",
"form",
"image",
"size"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L430-L437 |
1,422 | samsonos/cms_app_gallery | src/Application.php | Application.imageExists | private function imageExists($imagePath, $imageSrc = null)
{
// If image name is sewhere parameter
if (isset($imageSrc)) {
// Form path to the image
$imageFullPath = $this->formImagePath($imagePath, $imageSrc);
} else {
// Path was already set
... | php | private function imageExists($imagePath, $imageSrc = null)
{
// If image name is sewhere parameter
if (isset($imageSrc)) {
// Form path to the image
$imageFullPath = $this->formImagePath($imagePath, $imageSrc);
} else {
// Path was already set
... | [
"private",
"function",
"imageExists",
"(",
"$",
"imagePath",
",",
"$",
"imageSrc",
"=",
"null",
")",
"{",
"// If image name is sewhere parameter",
"if",
"(",
"isset",
"(",
"$",
"imageSrc",
")",
")",
"{",
"// Form path to the image",
"$",
"imageFullPath",
"=",
"$... | Checks if image exists, supports old database structure
@param string $imagePath Path to image(Full or not)
@param string $imageSrc Image name, if it wasn't in $imagePath
@return bool | [
"Checks",
"if",
"image",
"exists",
"supports",
"old",
"database",
"structure"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L445-L458 |
1,423 | samsonos/cms_app_gallery | src/Application.php | Application.formImagePath | private function formImagePath($imagePath, $imageSrc)
{
// Get old-way image path, remove full path to check file
if (empty($imagePath)) {
$path = $imageSrc;
} else { // Use new CORRECT way
$path = $imagePath . $imageSrc;
}
// form relative path to th... | php | private function formImagePath($imagePath, $imageSrc)
{
// Get old-way image path, remove full path to check file
if (empty($imagePath)) {
$path = $imageSrc;
} else { // Use new CORRECT way
$path = $imagePath . $imageSrc;
}
// form relative path to th... | [
"private",
"function",
"formImagePath",
"(",
"$",
"imagePath",
",",
"$",
"imageSrc",
")",
"{",
"// Get old-way image path, remove full path to check file",
"if",
"(",
"empty",
"(",
"$",
"imagePath",
")",
")",
"{",
"$",
"path",
"=",
"$",
"imageSrc",
";",
"}",
"... | Function to form image path correctly, also supports old database structure
@param string $imagePath Path to the image
@param string $imageSrc Image name
@return string Full path to image | [
"Function",
"to",
"form",
"image",
"path",
"correctly",
"also",
"supports",
"old",
"database",
"structure"
] | 3a2bb3a6c025640a84f9fee9156364533a127a4e | https://github.com/samsonos/cms_app_gallery/blob/3a2bb3a6c025640a84f9fee9156364533a127a4e/src/Application.php#L466-L487 |
1,424 | php-rest-server/core | src/Core/General/Param.php | Param.get | public function get($name, $default = null)
{
if (isset($this->dataContainer[$name])) {
return $this->dataContainer[$name];
}
return $default;
} | php | public function get($name, $default = null)
{
if (isset($this->dataContainer[$name])) {
return $this->dataContainer[$name];
}
return $default;
} | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"dataContainer",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"dataContainer",
"[",
"$",
... | Get value by key. If value does not exists then return default value
@param string $name
@param mixed $default
@return mixed|null | [
"Get",
"value",
"by",
"key",
".",
"If",
"value",
"does",
"not",
"exists",
"then",
"return",
"default",
"value"
] | 4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888 | https://github.com/php-rest-server/core/blob/4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888/src/Core/General/Param.php#L47-L54 |
1,425 | ellipsephp/http | src/Handlers/SimpleHtmlExceptionRequestHandler.php | SimpleHtmlExceptionRequestHandler.handle | public function handle(ServerRequestInterface $request): ResponseInterface
{
$path = realpath(__DIR__ . '/../../templates');
$engine = new Engine($path);
$contents = $engine->render('simple');
$response = $this->factory
->createResponse(500)
->withHeader('C... | php | public function handle(ServerRequestInterface $request): ResponseInterface
{
$path = realpath(__DIR__ . '/../../templates');
$engine = new Engine($path);
$contents = $engine->render('simple');
$response = $this->factory
->createResponse(500)
->withHeader('C... | [
"public",
"function",
"handle",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"$",
"path",
"=",
"realpath",
"(",
"__DIR__",
".",
"'/../../templates'",
")",
";",
"$",
"engine",
"=",
"new",
"Engine",
"(",
"$",
"path",
")",
... | Return a simple html response for the exception.
@param \Psr\Http\Message\ServerRequestInterface $request
@return \Psr\Http\Message\ResponseInterface | [
"Return",
"a",
"simple",
"html",
"response",
"for",
"the",
"exception",
"."
] | 20a2b0ae1d3a149a905b93ae0993203eb7d414e1 | https://github.com/ellipsephp/http/blob/20a2b0ae1d3a149a905b93ae0993203eb7d414e1/src/Handlers/SimpleHtmlExceptionRequestHandler.php#L39-L54 |
1,426 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.version | public static function version($version = null, $name = 'default', $type = 'app', $all = false)
{
// get the current version from the config
$all or $current = \Config::get('migrations.version.'.$type.'.'.$name);
// any migrations defined?
if ( ! empty($current))
{
// get the timestamp of the last instal... | php | public static function version($version = null, $name = 'default', $type = 'app', $all = false)
{
// get the current version from the config
$all or $current = \Config::get('migrations.version.'.$type.'.'.$name);
// any migrations defined?
if ( ! empty($current))
{
// get the timestamp of the last instal... | [
"public",
"static",
"function",
"version",
"(",
"$",
"version",
"=",
"null",
",",
"$",
"name",
"=",
"'default'",
",",
"$",
"type",
"=",
"'app'",
",",
"$",
"all",
"=",
"false",
")",
"{",
"// get the current version from the config",
"$",
"all",
"or",
"$",
... | migrate to a specific version, range of versions, or all
@param mixed version to migrate to (up or down!)
@param string name of the package, module or app
@param string type of migration (package, module or app)
@param bool if true, also run out-of-sequence migrations
@throws UnexpectedValueException
@return ... | [
"migrate",
"to",
"a",
"specific",
"version",
"range",
"of",
"versions",
"or",
"all"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L104-L142 |
1,427 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.current | public static function current($name = 'default', $type = 'app')
{
// get the current version from the config
$current = \Config::get('migrations.version.'.$type.'.'.$name);
// any migrations defined?
if ( ! empty($current))
{
// get the timestamp of the last installed migration
if (preg_match('/^(.*?... | php | public static function current($name = 'default', $type = 'app')
{
// get the current version from the config
$current = \Config::get('migrations.version.'.$type.'.'.$name);
// any migrations defined?
if ( ! empty($current))
{
// get the timestamp of the last installed migration
if (preg_match('/^(.*?... | [
"public",
"static",
"function",
"current",
"(",
"$",
"name",
"=",
"'default'",
",",
"$",
"type",
"=",
"'app'",
")",
"{",
"// get the current version from the config",
"$",
"current",
"=",
"\\",
"Config",
"::",
"get",
"(",
"'migrations.version.'",
".",
"$",
"ty... | migrate to the version defined in the config file
@param string name of the package, module or app
@param string type of migration (package, module or app)
@return array | [
"migrate",
"to",
"the",
"version",
"defined",
"in",
"the",
"config",
"file"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L167-L185 |
1,428 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.up | public static function up($version = null, $name = 'default', $type = 'app')
{
// get the current version info from the config
$current = \Config::get('migrations.version.'.$type.'.'.$name);
// get the last migration installed
$current = empty($current) ? null : end($current);
// get the available migratio... | php | public static function up($version = null, $name = 'default', $type = 'app')
{
// get the current version info from the config
$current = \Config::get('migrations.version.'.$type.'.'.$name);
// get the last migration installed
$current = empty($current) ? null : end($current);
// get the available migratio... | [
"public",
"static",
"function",
"up",
"(",
"$",
"version",
"=",
"null",
",",
"$",
"name",
"=",
"'default'",
",",
"$",
"type",
"=",
"'app'",
")",
"{",
"// get the current version info from the config",
"$",
"current",
"=",
"\\",
"Config",
"::",
"get",
"(",
... | migrate up to the next version
@param mixed version to migrate up to
@param string name of the package, module or app
@param string type of migration (package, module or app)
@return array | [
"migrate",
"up",
"to",
"the",
"next",
"version"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L196-L219 |
1,429 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.run | protected static function run($migrations, $name, $type, $method = 'up')
{
// storage for installed migrations
$done = array();
static::$connection === null or \DBUtil::set_connection(static::$connection);
// Loop through the runnable migrations and run them
foreach ($migrations as $ver => $migration)
{
... | php | protected static function run($migrations, $name, $type, $method = 'up')
{
// storage for installed migrations
$done = array();
static::$connection === null or \DBUtil::set_connection(static::$connection);
// Loop through the runnable migrations and run them
foreach ($migrations as $ver => $migration)
{
... | [
"protected",
"static",
"function",
"run",
"(",
"$",
"migrations",
",",
"$",
"name",
",",
"$",
"type",
",",
"$",
"method",
"=",
"'up'",
")",
"{",
"// storage for installed migrations",
"$",
"done",
"=",
"array",
"(",
")",
";",
"static",
"::",
"$",
"connec... | run the action migrations found
@param array list of files to migrate
@param string name of the package, module or app
@param string type of migration (package, module or app)
@param string method to call on the migration
@return array | [
"run",
"the",
"action",
"migrations",
"found"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L277-L305 |
1,430 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.write_install | protected static function write_install($name, $type, $file)
{
// add the migration just run
\DB::insert(static::$table)->set(array(
'name' => $name,
'type' => $type,
'migration' => $file,
))->execute(static::$connection);
// add the file to the list of run migrations
static::$migrations[$type][$na... | php | protected static function write_install($name, $type, $file)
{
// add the migration just run
\DB::insert(static::$table)->set(array(
'name' => $name,
'type' => $type,
'migration' => $file,
))->execute(static::$connection);
// add the file to the list of run migrations
static::$migrations[$type][$na... | [
"protected",
"static",
"function",
"write_install",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"file",
")",
"{",
"// add the migration just run",
"\\",
"DB",
"::",
"insert",
"(",
"static",
"::",
"$",
"table",
")",
"->",
"set",
"(",
"array",
"(",
"'nam... | add an installed migration to the database
@param string name of the package, module or app
@param string type of migration (package, module or app)
@param string name of the migration file just run
@return void | [
"add",
"an",
"installed",
"migration",
"to",
"the",
"database"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L317-L335 |
1,431 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.write_revert | protected static function write_revert($name, $type, $file)
{
// remove the migration just run
\DB::delete(static::$table)
->where('name', $name)
->where('type', $type)
->where('migration', $file)
->execute(static::$connection);
// remove the file from the list of run migrations
if (($key = array_s... | php | protected static function write_revert($name, $type, $file)
{
// remove the migration just run
\DB::delete(static::$table)
->where('name', $name)
->where('type', $type)
->where('migration', $file)
->execute(static::$connection);
// remove the file from the list of run migrations
if (($key = array_s... | [
"protected",
"static",
"function",
"write_revert",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"file",
")",
"{",
"// remove the migration just run",
"\\",
"DB",
"::",
"delete",
"(",
"static",
"::",
"$",
"table",
")",
"->",
"where",
"(",
"'name'",
",",
... | remove a reverted migration from the database
@param string name of the package, module or app
@param string type of migration (package, module or app)
@param string name of the migration file just run
@return void | [
"remove",
"a",
"reverted",
"migration",
"from",
"the",
"database"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L346-L367 |
1,432 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate._find_app | protected static function _find_app($name = null)
{
$found = array();
$files = new \GlobIterator(APPPATH.\Config::get('migrations.folder').'*_*.php');
foreach($files as $file)
{
$found[] = $file->getPathname();
}
return $found;
} | php | protected static function _find_app($name = null)
{
$found = array();
$files = new \GlobIterator(APPPATH.\Config::get('migrations.folder').'*_*.php');
foreach($files as $file)
{
$found[] = $file->getPathname();
}
return $found;
} | [
"protected",
"static",
"function",
"_find_app",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"found",
"=",
"array",
"(",
")",
";",
"$",
"files",
"=",
"new",
"\\",
"GlobIterator",
"(",
"APPPATH",
".",
"\\",
"Config",
"::",
"get",
"(",
"'migrations.fold... | finds migrations for the given app
@param string name of the app (not used at the moment)
@return array | [
"finds",
"migrations",
"for",
"the",
"given",
"app"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L483-L494 |
1,433 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/migrate.php | Migrate.table_version_check | protected static function table_version_check()
{
// set connection
static::$connection === null or \DBUtil::set_connection(static::$connection);
// if table does not exist
if ( ! \DBUtil::table_exists(static::$table))
{
// create table
\DBUtil::create_table(static::$table, static::$table_definition);... | php | protected static function table_version_check()
{
// set connection
static::$connection === null or \DBUtil::set_connection(static::$connection);
// if table does not exist
if ( ! \DBUtil::table_exists(static::$table))
{
// create table
\DBUtil::create_table(static::$table, static::$table_definition);... | [
"protected",
"static",
"function",
"table_version_check",
"(",
")",
"{",
"// set connection",
"static",
"::",
"$",
"connection",
"===",
"null",
"or",
"\\",
"DBUtil",
"::",
"set_connection",
"(",
"static",
"::",
"$",
"connection",
")",
";",
"// if table does not ex... | installs or upgrades the migration table to the current schema
@return void
@deprecated Remove upgrade check in 1.4 | [
"installs",
"or",
"upgrades",
"the",
"migration",
"table",
"to",
"the",
"current",
"schema"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/migrate.php#L589-L665 |
1,434 | SerafimArts/Gist | src/Gist/AbstractSerialize.php | AbstractSerialize.getName | protected function getName($name)
{
$renames = $this->getRenames();
if (isset($renames[$name])) {
return $renames[$name];
}
return $name;
} | php | protected function getName($name)
{
$renames = $this->getRenames();
if (isset($renames[$name])) {
return $renames[$name];
}
return $name;
} | [
"protected",
"function",
"getName",
"(",
"$",
"name",
")",
"{",
"$",
"renames",
"=",
"$",
"this",
"->",
"getRenames",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"renames",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"renames",
"[",
"$"... | Return property name
@param $name
@return mixed | [
"Return",
"property",
"name"
] | 5d0610c033b3840a42a42bcfc2de5277a7cab30d | https://github.com/SerafimArts/Gist/blob/5d0610c033b3840a42a42bcfc2de5277a7cab30d/src/Gist/AbstractSerialize.php#L93-L101 |
1,435 | movicon/movicon-db | src/db/DbRecord.php | DbRecord.save | public function save()
{
if ($this->_isSaved) {
$this->update($this->id);
} else {
$this->id = $this->insert();
$this->_isSaved = true;
}
} | php | public function save()
{
if ($this->_isSaved) {
$this->update($this->id);
} else {
$this->id = $this->insert();
$this->_isSaved = true;
}
} | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_isSaved",
")",
"{",
"$",
"this",
"->",
"update",
"(",
"$",
"this",
"->",
"id",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"this",
"->",
"insert",
... | Saves this record.
@return void | [
"Saves",
"this",
"record",
"."
] | 505023932d6cd82462bb0e89b9057175c4b14e38 | https://github.com/movicon/movicon-db/blob/505023932d6cd82462bb0e89b9057175c4b14e38/src/db/DbRecord.php#L53-L61 |
1,436 | mszewcz/php-json-schema-validator | src/Validators/NumericValidators/ExclusiveMinimumValidator.php | ExclusiveMinimumValidator.validate | public function validate($subject): bool
{
if (\is_numeric($this->schema['exclusiveMinimum'])) {
if ($subject <= $this->schema['exclusiveMinimum']) {
return false;
}
}
return true;
} | php | public function validate($subject): bool
{
if (\is_numeric($this->schema['exclusiveMinimum'])) {
if ($subject <= $this->schema['exclusiveMinimum']) {
return false;
}
}
return true;
} | [
"public",
"function",
"validate",
"(",
"$",
"subject",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"is_numeric",
"(",
"$",
"this",
"->",
"schema",
"[",
"'exclusiveMinimum'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"subject",
"<=",
"$",
"this",
"->",
"schema"... | Validates subject against exclusiveMinimum
@param $subject
@return bool | [
"Validates",
"subject",
"against",
"exclusiveMinimum"
] | f7768bfe07ce6508bb1ff36163560a5e5791de7d | https://github.com/mszewcz/php-json-schema-validator/blob/f7768bfe07ce6508bb1ff36163560a5e5791de7d/src/Validators/NumericValidators/ExclusiveMinimumValidator.php#L47-L55 |
1,437 | Gelembjuk/locale | src/Gelembjuk/Locale/Languages.php | Languages.getAllLanguages | public function getAllLanguages() {
if (is_array($this->alllanguages)) {
return $this->alllanguages;
}
// find languages file in a locales path
$langfile = $this->localespath.'languages.txt';
if (!file_exists($langfile)) {
// if no in locales then use default from this package
$langfile = dirn... | php | public function getAllLanguages() {
if (is_array($this->alllanguages)) {
return $this->alllanguages;
}
// find languages file in a locales path
$langfile = $this->localespath.'languages.txt';
if (!file_exists($langfile)) {
// if no in locales then use default from this package
$langfile = dirn... | [
"public",
"function",
"getAllLanguages",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"alllanguages",
")",
")",
"{",
"return",
"$",
"this",
"->",
"alllanguages",
";",
"}",
"// find languages file in a locales path",
"$",
"langfile",
"=",
"$",
... | Returns all languages with all attributes installed on the system
@return array | [
"Returns",
"all",
"languages",
"with",
"all",
"attributes",
"installed",
"on",
"the",
"system"
] | 4d59f6518bf765c3653f3d2583e6e262ff8bfb29 | https://github.com/Gelembjuk/locale/blob/4d59f6518bf765c3653f3d2583e6e262ff8bfb29/src/Gelembjuk/Locale/Languages.php#L68-L141 |
1,438 | Gelembjuk/locale | src/Gelembjuk/Locale/Languages.php | Languages.getLanguagesFromList | public function getLanguagesFromList($list) {
$alllanguages = $this->getAllLanguages();
$languages = array();
foreach ($alllanguages as $code=>$lang) {
if (in_array($code,$list)) {
$languages[$code] = $lang;
}
}
return $languages;
} | php | public function getLanguagesFromList($list) {
$alllanguages = $this->getAllLanguages();
$languages = array();
foreach ($alllanguages as $code=>$lang) {
if (in_array($code,$list)) {
$languages[$code] = $lang;
}
}
return $languages;
} | [
"public",
"function",
"getLanguagesFromList",
"(",
"$",
"list",
")",
"{",
"$",
"alllanguages",
"=",
"$",
"this",
"->",
"getAllLanguages",
"(",
")",
";",
"$",
"languages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"alllanguages",
"as",
"$",
"code"... | Return languages listed in the argument array. Is used for case when it is needed to get list of specified languages
@return array | [
"Return",
"languages",
"listed",
"in",
"the",
"argument",
"array",
".",
"Is",
"used",
"for",
"case",
"when",
"it",
"is",
"needed",
"to",
"get",
"list",
"of",
"specified",
"languages"
] | 4d59f6518bf765c3653f3d2583e6e262ff8bfb29 | https://github.com/Gelembjuk/locale/blob/4d59f6518bf765c3653f3d2583e6e262ff8bfb29/src/Gelembjuk/Locale/Languages.php#L186-L198 |
1,439 | Gelembjuk/locale | src/Gelembjuk/Locale/Languages.php | Languages.getHTMLSelect | public function getHTMLSelect($attributes = '',$currentlang = '',$orignames = false) {
$html = '<select '.$attributes.'>';
foreach ($this->getUsedLanguages() as $code=>$lang) {
$html .= '<option value="'.$code.'" ';
if ($currentlang == $code) {
$html .= 'selected';
}
$html .= '>';
... | php | public function getHTMLSelect($attributes = '',$currentlang = '',$orignames = false) {
$html = '<select '.$attributes.'>';
foreach ($this->getUsedLanguages() as $code=>$lang) {
$html .= '<option value="'.$code.'" ';
if ($currentlang == $code) {
$html .= 'selected';
}
$html .= '>';
... | [
"public",
"function",
"getHTMLSelect",
"(",
"$",
"attributes",
"=",
"''",
",",
"$",
"currentlang",
"=",
"''",
",",
"$",
"orignames",
"=",
"false",
")",
"{",
"$",
"html",
"=",
"'<select '",
".",
"$",
"attributes",
".",
"'>'",
";",
"foreach",
"(",
"$",
... | Build HTML select consruction with used languages
Can be used on a web site to show a Language change dropbox
@param string $attributes for a select box
@param string $currentlang Current selected language code (locale)
@param boolean $orignames If true then original manes of languages ill be used as titles in a dropb... | [
"Build",
"HTML",
"select",
"consruction",
"with",
"used",
"languages",
"Can",
"be",
"used",
"on",
"a",
"web",
"site",
"to",
"show",
"a",
"Language",
"change",
"dropbox"
] | 4d59f6518bf765c3653f3d2583e6e262ff8bfb29 | https://github.com/Gelembjuk/locale/blob/4d59f6518bf765c3653f3d2583e6e262ff8bfb29/src/Gelembjuk/Locale/Languages.php#L223-L245 |
1,440 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/query/builder/join.php | Database_Query_Builder_Join.or_on | public function or_on($c1, $op, $c2)
{
$this->_on[] = array($c1, $op, $c2, 'OR');
return $this;
} | php | public function or_on($c1, $op, $c2)
{
$this->_on[] = array($c1, $op, $c2, 'OR');
return $this;
} | [
"public",
"function",
"or_on",
"(",
"$",
"c1",
",",
"$",
"op",
",",
"$",
"c2",
")",
"{",
"$",
"this",
"->",
"_on",
"[",
"]",
"=",
"array",
"(",
"$",
"c1",
",",
"$",
"op",
",",
"$",
"c2",
",",
"'OR'",
")",
";",
"return",
"$",
"this",
";",
... | Adds a new OR condition for joining.
@param mixed $c1 column name or array($column, $alias) or object
@param string $op logic operator
@param mixed $c2 column name or array($column, $alias) or object
@return $this | [
"Adds",
"a",
"new",
"OR",
"condition",
"for",
"joining",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/query/builder/join.php#L59-L64 |
1,441 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/query/builder/join.php | Database_Query_Builder_Join.on | public function on($c1, $op, $c2)
{
$this->_on[] = array($c1, $op, $c2, 'AND');
return $this;
} | php | public function on($c1, $op, $c2)
{
$this->_on[] = array($c1, $op, $c2, 'AND');
return $this;
} | [
"public",
"function",
"on",
"(",
"$",
"c1",
",",
"$",
"op",
",",
"$",
"c2",
")",
"{",
"$",
"this",
"->",
"_on",
"[",
"]",
"=",
"array",
"(",
"$",
"c1",
",",
"$",
"op",
",",
"$",
"c2",
",",
"'AND'",
")",
";",
"return",
"$",
"this",
";",
"}... | Adds a new AND condition for joining.
@param mixed $c1 column name or array($column, $alias) or object
@param string $op logic operator
@param mixed $c2 column name or array($column, $alias) or object
@return $this | [
"Adds",
"a",
"new",
"AND",
"condition",
"for",
"joining",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/query/builder/join.php#L75-L80 |
1,442 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/query/builder/join.php | Database_Query_Builder_Join.compile | public function compile($db = null)
{
if ( ! $db instanceof \Database_Connection)
{
// Get the database instance
$db = \Database_Connection::instance($db);
}
if ($this->_type)
{
$sql = strtoupper($this->_type).' JOIN';
}
else
{
$sql = 'JOIN';
}
// Quote the table name that is being jo... | php | public function compile($db = null)
{
if ( ! $db instanceof \Database_Connection)
{
// Get the database instance
$db = \Database_Connection::instance($db);
}
if ($this->_type)
{
$sql = strtoupper($this->_type).' JOIN';
}
else
{
$sql = 'JOIN';
}
// Quote the table name that is being jo... | [
"public",
"function",
"compile",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"db",
"instanceof",
"\\",
"Database_Connection",
")",
"{",
"// Get the database instance",
"$",
"db",
"=",
"\\",
"Database_Connection",
"::",
"instance",
"(",
"$",
... | Compile the SQL partial for a JOIN statement and return it.
@param mixed $db Database_Connection instance or instance name
@return string | [
"Compile",
"the",
"SQL",
"partial",
"for",
"a",
"JOIN",
"statement",
"and",
"return",
"it",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/query/builder/join.php#L103-L150 |
1,443 | trendwerk/dev-mail | class-tp-dev-mail.php | TP_Dev_Mail.send_to | function send_to( $mail ) {
$mail['subject'] .= ' [' . $mail['to'] . ']';
if( 'staging' == WP_ENV )
$mail['to'] = get_option( 'admin_email' );
else if( defined( 'TP_DEV_MAIL' ) )
$mail['to'] = TP_DEV_MAIL;
else
$mail['to'] = '';
return $mail;
} | php | function send_to( $mail ) {
$mail['subject'] .= ' [' . $mail['to'] . ']';
if( 'staging' == WP_ENV )
$mail['to'] = get_option( 'admin_email' );
else if( defined( 'TP_DEV_MAIL' ) )
$mail['to'] = TP_DEV_MAIL;
else
$mail['to'] = '';
return $mail;
} | [
"function",
"send_to",
"(",
"$",
"mail",
")",
"{",
"$",
"mail",
"[",
"'subject'",
"]",
".=",
"' ['",
".",
"$",
"mail",
"[",
"'to'",
"]",
".",
"']'",
";",
"if",
"(",
"'staging'",
"==",
"WP_ENV",
")",
"$",
"mail",
"[",
"'to'",
"]",
"=",
"get_option... | Don't send e-mails in development and staging environments | [
"Don",
"t",
"send",
"e",
"-",
"mails",
"in",
"development",
"and",
"staging",
"environments"
] | b5465d11ab305222ca2545344e5873711026a9e3 | https://github.com/trendwerk/dev-mail/blob/b5465d11ab305222ca2545344e5873711026a9e3/class-tp-dev-mail.php#L24-L35 |
1,444 | Stratadox/Deserializer | src/IllegalInputKey.php | IllegalInputKey.illegal | public static function illegal(
object $collection,
string $key
): CannotDeserialize {
return new IllegalInputKey(withMessage(
'Invalid collection deserialization input: Unexpected key `%s` for the `%s` class.',
$key,
classOfThe($collection)
));
... | php | public static function illegal(
object $collection,
string $key
): CannotDeserialize {
return new IllegalInputKey(withMessage(
'Invalid collection deserialization input: Unexpected key `%s` for the `%s` class.',
$key,
classOfThe($collection)
));
... | [
"public",
"static",
"function",
"illegal",
"(",
"object",
"$",
"collection",
",",
"string",
"$",
"key",
")",
":",
"CannotDeserialize",
"{",
"return",
"new",
"IllegalInputKey",
"(",
"withMessage",
"(",
"'Invalid collection deserialization input: Unexpected key `%s` for the... | Produces a deserialization exception to throw when a collection input key
is not considered valid.
@param object $collection The collection that was assigned the illegal
input key.
@param string $key The input key that was considered invalid.
@return CannotDeserialize The deserialization exception to throw. | [
"Produces",
"a",
"deserialization",
"exception",
"to",
"throw",
"when",
"a",
"collection",
"input",
"key",
"is",
"not",
"considered",
"valid",
"."
] | 26f282837f310cc7eb1aec01579edde04c84a80c | https://github.com/Stratadox/Deserializer/blob/26f282837f310cc7eb1aec01579edde04c84a80c/src/IllegalInputKey.php#L27-L36 |
1,445 | FlexPress/component-popular-posts | src/FlexPress/Components/PopularPosts/Helper.php | Helper.sortByScore | protected function sortByScore($a, $b)
{
if ($a->score == $b->score) {
return 0;
}
return ($a->score > $b->score) ? -1 : 1;
} | php | protected function sortByScore($a, $b)
{
if ($a->score == $b->score) {
return 0;
}
return ($a->score > $b->score) ? -1 : 1;
} | [
"protected",
"function",
"sortByScore",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"if",
"(",
"$",
"a",
"->",
"score",
"==",
"$",
"b",
"->",
"score",
")",
"{",
"return",
"0",
";",
"}",
"return",
"(",
"$",
"a",
"->",
"score",
">",
"$",
"b",
"->",... | Sorting function, uses the score of a object to determine the order of the array
@param $a
@param $b
@return int
@author Tim Perry | [
"Sorting",
"function",
"uses",
"the",
"score",
"of",
"a",
"object",
"to",
"determine",
"the",
"order",
"of",
"the",
"array"
] | b187c66ee28a2afe72ad10aad87c75090d490c4e | https://github.com/FlexPress/component-popular-posts/blob/b187c66ee28a2afe72ad10aad87c75090d490c4e/src/FlexPress/Components/PopularPosts/Helper.php#L67-L76 |
1,446 | nano7/Foundation | src/Translation/TranslationServiceProvider.php | TranslationServiceProvider.registerTraslator | protected function registerTraslator()
{
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale. So, we'll grab the a... | php | protected function registerTraslator()
{
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale. So, we'll grab the a... | [
"protected",
"function",
"registerTraslator",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'translator'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"loader",
"=",
"$",
"app",
"[",
"'translation.loader'",
"]",
";",
"// When regis... | Register translator.
@return void | [
"Register",
"translator",
"."
] | 8328423f81c69b8fabc04b4f6b1f3ba712695374 | https://github.com/nano7/Foundation/blob/8328423f81c69b8fabc04b4f6b1f3ba712695374/src/Translation/TranslationServiceProvider.php#L44-L60 |
1,447 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/arr.php | Arr.keyval_to_assoc | public static function keyval_to_assoc($array, $key_field, $val_field)
{
if ( ! is_array($array) and ! $array instanceof \Iterator)
{
throw new \InvalidArgumentException('The first parameter must be an array.');
}
$output = array();
foreach ($array as $key => $value)
{
$output[] = array(
$key_fi... | php | public static function keyval_to_assoc($array, $key_field, $val_field)
{
if ( ! is_array($array) and ! $array instanceof \Iterator)
{
throw new \InvalidArgumentException('The first parameter must be an array.');
}
$output = array();
foreach ($array as $key => $value)
{
$output[] = array(
$key_fi... | [
"public",
"static",
"function",
"keyval_to_assoc",
"(",
"$",
"array",
",",
"$",
"key_field",
",",
"$",
"val_field",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
"and",
"!",
"$",
"array",
"instanceof",
"\\",
"Iterator",
")",
"{",
"throw... | Converts an array of key => values into a multi-dimensional associative array with the provided field names
@param array $array the array to convert
@param string $key_field the field name of the key field
@param string $val_field the field name of the value field
@return array
@throws \InvalidArgum... | [
"Converts",
"an",
"array",
"of",
"key",
"=",
">",
"values",
"into",
"a",
"multi",
"-",
"dimensional",
"associative",
"array",
"with",
"the",
"provided",
"field",
"names"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/arr.php#L261-L278 |
1,448 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/arr.php | Arr.is_assoc | public static function is_assoc($arr)
{
if ( ! is_array($arr))
{
throw new \InvalidArgumentException('The parameter must be an array.');
}
$counter = 0;
foreach ($arr as $key => $unused)
{
if ( ! is_int($key) or $key !== $counter++)
{
return true;
}
}
return false;
} | php | public static function is_assoc($arr)
{
if ( ! is_array($arr))
{
throw new \InvalidArgumentException('The parameter must be an array.');
}
$counter = 0;
foreach ($arr as $key => $unused)
{
if ( ! is_int($key) or $key !== $counter++)
{
return true;
}
}
return false;
} | [
"public",
"static",
"function",
"is_assoc",
"(",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The parameter must be an array.'",
")",
";",
"}",
"$",
"counter",
"=... | Checks if the given array is an assoc array.
@param array $arr the array to check
@return bool true if its an assoc array, false if not | [
"Checks",
"if",
"the",
"given",
"array",
"is",
"an",
"assoc",
"array",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/arr.php#L314-L330 |
1,449 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/arr.php | Arr.multisort | public static function multisort($array, $conditions, $ignore_case = false)
{
$temp = array();
$keys = array_keys($conditions);
foreach($keys as $key)
{
$temp[$key] = static::pluck($array, $key, true);
is_array($conditions[$key]) or $conditions[$key] = array($conditions[$key]);
}
$args = array();
... | php | public static function multisort($array, $conditions, $ignore_case = false)
{
$temp = array();
$keys = array_keys($conditions);
foreach($keys as $key)
{
$temp[$key] = static::pluck($array, $key, true);
is_array($conditions[$key]) or $conditions[$key] = array($conditions[$key]);
}
$args = array();
... | [
"public",
"static",
"function",
"multisort",
"(",
"$",
"array",
",",
"$",
"conditions",
",",
"$",
"ignore_case",
"=",
"false",
")",
"{",
"$",
"temp",
"=",
"array",
"(",
")",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"conditions",
")",
";",
"fore... | Sorts an array on multitiple values, with deep sorting support.
@param array $array collection of arrays/objects to sort
@param array $conditions sorting conditions
@param bool @ignore_case wether to sort case insensitive | [
"Sorts",
"an",
"array",
"on",
"multitiple",
"values",
"with",
"deep",
"sorting",
"support",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/arr.php#L748-L773 |
1,450 | gplcart/installer | controllers/Upload.php | Upload.setBreadcrumbEditUpload | protected function setBreadcrumbEditUpload()
{
$breadcrumbs = array();
$breadcrumbs[] = array(
'text' => $this->text('Dashboard'),
'url' => $this->url('admin')
);
$breadcrumbs[] = array(
'text' => $this->text('Modules'),
'url' => $thi... | php | protected function setBreadcrumbEditUpload()
{
$breadcrumbs = array();
$breadcrumbs[] = array(
'text' => $this->text('Dashboard'),
'url' => $this->url('admin')
);
$breadcrumbs[] = array(
'text' => $this->text('Modules'),
'url' => $thi... | [
"protected",
"function",
"setBreadcrumbEditUpload",
"(",
")",
"{",
"$",
"breadcrumbs",
"=",
"array",
"(",
")",
";",
"$",
"breadcrumbs",
"[",
"]",
"=",
"array",
"(",
"'text'",
"=>",
"$",
"this",
"->",
"text",
"(",
"'Dashboard'",
")",
",",
"'url'",
"=>",
... | Set breadcrumbs on the module upload page | [
"Set",
"breadcrumbs",
"on",
"the",
"module",
"upload",
"page"
] | a0cc7525268c176c910953f422365e86e5e0dac7 | https://github.com/gplcart/installer/blob/a0cc7525268c176c910953f422365e86e5e0dac7/controllers/Upload.php#L78-L93 |
1,451 | gplcart/installer | controllers/Upload.php | Upload.validateUpload | protected function validateUpload()
{
$file = $this->request->file('file');
if (empty($file)) {
$this->setError('file', $this->text('Nothing to install'));
return false;
}
$result = $this->file_transfer->upload($file, 'zip', gplcart_file_private_module('inst... | php | protected function validateUpload()
{
$file = $this->request->file('file');
if (empty($file)) {
$this->setError('file', $this->text('Nothing to install'));
return false;
}
$result = $this->file_transfer->upload($file, 'zip', gplcart_file_private_module('inst... | [
"protected",
"function",
"validateUpload",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"request",
"->",
"file",
"(",
"'file'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"setError",
"(",
"'file'",
",",... | Validate a submitted data | [
"Validate",
"a",
"submitted",
"data"
] | a0cc7525268c176c910953f422365e86e5e0dac7 | https://github.com/gplcart/installer/blob/a0cc7525268c176c910953f422365e86e5e0dac7/controllers/Upload.php#L108-L126 |
1,452 | gplcart/installer | controllers/Upload.php | Upload.installModuleUpload | protected function installModuleUpload()
{
$this->controlAccess('file_upload');
$this->controlAccess('module_installer_upload');
$file = $this->getSubmitted('file');
$result = $this->install->fromZip($file);
if ($result !== true) {
$this->redirect('', $result, '... | php | protected function installModuleUpload()
{
$this->controlAccess('file_upload');
$this->controlAccess('module_installer_upload');
$file = $this->getSubmitted('file');
$result = $this->install->fromZip($file);
if ($result !== true) {
$this->redirect('', $result, '... | [
"protected",
"function",
"installModuleUpload",
"(",
")",
"{",
"$",
"this",
"->",
"controlAccess",
"(",
"'file_upload'",
")",
";",
"$",
"this",
"->",
"controlAccess",
"(",
"'module_installer_upload'",
")",
";",
"$",
"file",
"=",
"$",
"this",
"->",
"getSubmitte... | Install uploaded module | [
"Install",
"uploaded",
"module"
] | a0cc7525268c176c910953f422365e86e5e0dac7 | https://github.com/gplcart/installer/blob/a0cc7525268c176c910953f422365e86e5e0dac7/controllers/Upload.php#L131-L150 |
1,453 | jaeger-app/rest-server | src/Rest/AbstractServer.php | AbstractServer.getVersion | public function getVersion($version_key)
{
if(is_null($this->version))
{
//determine the version
$headers = \getallheaders();
if(isset($headers[$version_key]) && is_numeric($headers[$version_key]) && in_array($headers[$version_key], $this->api_versions))
... | php | public function getVersion($version_key)
{
if(is_null($this->version))
{
//determine the version
$headers = \getallheaders();
if(isset($headers[$version_key]) && is_numeric($headers[$version_key]) && in_array($headers[$version_key], $this->api_versions))
... | [
"public",
"function",
"getVersion",
"(",
"$",
"version_key",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"version",
")",
")",
"{",
"//determine the version",
"$",
"headers",
"=",
"\\",
"getallheaders",
"(",
")",
";",
"if",
"(",
"isset",
"(",
... | Creates the version of the API we're expected to use
@param string $version_key
@return string | [
"Creates",
"the",
"version",
"of",
"the",
"API",
"we",
"re",
"expected",
"to",
"use"
] | fb99bd1d935b7c1f5cbaf335a178727cb7945690 | https://github.com/jaeger-app/rest-server/blob/fb99bd1d935b7c1f5cbaf335a178727cb7945690/src/Rest/AbstractServer.php#L66-L85 |
1,454 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.init | protected function init()
{
$uri = $this->token;
// check scheme
if (($pos = strpos($uri, ':')) !== false) {
$this->scheme = substr($uri, 0, $pos);
$rest = substr($uri, $pos + 1);
} else {
$rest = $uri;
}
// check fragment
i... | php | protected function init()
{
$uri = $this->token;
// check scheme
if (($pos = strpos($uri, ':')) !== false) {
$this->scheme = substr($uri, 0, $pos);
$rest = substr($uri, $pos + 1);
} else {
$rest = $uri;
}
// check fragment
i... | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"token",
";",
"// check scheme",
"if",
"(",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"uri",
",",
"':'",
")",
")",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
... | Constructs a URI by parsing the given string.
This constructor parses the given string exactly as specified by the grammar in RFC 2396, Appendix A, except for the following deviations:
- An empty authority component is permitted as long as it is followed by a non-empty path, a query component, or a fragment component... | [
"Constructs",
"a",
"URI",
"by",
"parsing",
"the",
"given",
"string",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L86-L122 |
1,455 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.resolve | public function resolve(Uri $uri)
{
static $resolve = array();
return (isset($resolve[$hash = $this->hashCode() . $uri->hashCode()])) ? $resolve[$hash] : ($resolve[$hash] = $this->createResolve($uri));
} | php | public function resolve(Uri $uri)
{
static $resolve = array();
return (isset($resolve[$hash = $this->hashCode() . $uri->hashCode()])) ? $resolve[$hash] : ($resolve[$hash] = $this->createResolve($uri));
} | [
"public",
"function",
"resolve",
"(",
"Uri",
"$",
"uri",
")",
"{",
"static",
"$",
"resolve",
"=",
"array",
"(",
")",
";",
"return",
"(",
"isset",
"(",
"$",
"resolve",
"[",
"$",
"hash",
"=",
"$",
"this",
"->",
"hashCode",
"(",
")",
".",
"$",
"uri"... | Resolves the given URI against this URI.
If the given URI is already absolute, or if this URI is opaque, then the given URI is returned.
If the given URI's fragment component is defined, its path component is empty, and its scheme,
authority, and query components are undefined, then a URI with the given fragment but ... | [
"Resolves",
"the",
"given",
"URI",
"against",
"this",
"URI",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L153-L158 |
1,456 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.normalize | public function normalize()
{
if ($this->isOpaque() || !$this->path) {
return clone $this;
} else {
$uri = clone $this;
$uri->path = self::normalizePath($this->path);
return $uri;
}
} | php | public function normalize()
{
if ($this->isOpaque() || !$this->path) {
return clone $this;
} else {
$uri = clone $this;
$uri->path = self::normalizePath($this->path);
return $uri;
}
} | [
"public",
"function",
"normalize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isOpaque",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"path",
")",
"{",
"return",
"clone",
"$",
"this",
";",
"}",
"else",
"{",
"$",
"uri",
"=",
"clone",
"$",
"this",
... | Normalizes this URI's path.
If this URI is opaque, or if its path is already in normal form, then this URI is returned.
Otherwise a new URI is constructed that is identical to this URI except that its path is computed
by normalizing this URI's path in a manner consistent with RFC 2396, section 5.2, step 6, sub-steps c... | [
"Normalizes",
"this",
"URI",
"s",
"path",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L213-L223 |
1,457 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.buildStr | protected function buildStr()
{
$uri = ($this->scheme != null) ? ($this->scheme . ':') : '';
if ($this->isOpaque()) {
$uri .= $this->schemeSpecificPart;
} else {
$uri .= $this->buildAuthorityStr();
if ($this->path !== null) {
$uri .= $thi... | php | protected function buildStr()
{
$uri = ($this->scheme != null) ? ($this->scheme . ':') : '';
if ($this->isOpaque()) {
$uri .= $this->schemeSpecificPart;
} else {
$uri .= $this->buildAuthorityStr();
if ($this->path !== null) {
$uri .= $thi... | [
"protected",
"function",
"buildStr",
"(",
")",
"{",
"$",
"uri",
"=",
"(",
"$",
"this",
"->",
"scheme",
"!=",
"null",
")",
"?",
"(",
"$",
"this",
"->",
"scheme",
".",
"':'",
")",
":",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"isOpaque",
"(",
")"... | Returns the content of this URI as a string.
This URI was created by normalization, resolution, or relativization,
and so a string is constructed from this URI's components
according to the rules specified in RFC 2396, section 5.2, step 7.
@return string | [
"Returns",
"the",
"content",
"of",
"this",
"URI",
"as",
"a",
"string",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L485-L505 |
1,458 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.setAuthority | protected function setAuthority($authority)
{
$aparts = [];
if (preg_match('/^(([^\@]+)\@)?(.*?)(\:(.+))?$/S', $authority, $aparts)) {
$this->authority = $authority;
$this->hash = null;
if (isset($aparts[2]) && $aparts[2]) {
$this->userInfo = $ap... | php | protected function setAuthority($authority)
{
$aparts = [];
if (preg_match('/^(([^\@]+)\@)?(.*?)(\:(.+))?$/S', $authority, $aparts)) {
$this->authority = $authority;
$this->hash = null;
if (isset($aparts[2]) && $aparts[2]) {
$this->userInfo = $ap... | [
"protected",
"function",
"setAuthority",
"(",
"$",
"authority",
")",
"{",
"$",
"aparts",
"=",
"[",
"]",
";",
"if",
"(",
"preg_match",
"(",
"'/^(([^\\@]+)\\@)?(.*?)(\\:(.+))?$/S'",
",",
"$",
"authority",
",",
"$",
"aparts",
")",
")",
"{",
"$",
"this",
"->",... | Set authority component of this URI.
@param string $authority The decoded authority component of this URI, or null if the authority is undefined.
@throws \DomainException
@return Uri | [
"Set",
"authority",
"component",
"of",
"this",
"URI",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L524-L546 |
1,459 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.getRelated | public function getRelated(Uri $baseUri)
{
$path = $baseUri->getPath();
if (substr($this->getPath(), 0, strlen($path)) == $path) {
$class = get_called_class();
$uri = new $class('');
$uri->fragment = $this->fragment;
$uri->path = substr($this->getPath(... | php | public function getRelated(Uri $baseUri)
{
$path = $baseUri->getPath();
if (substr($this->getPath(), 0, strlen($path)) == $path) {
$class = get_called_class();
$uri = new $class('');
$uri->fragment = $this->fragment;
$uri->path = substr($this->getPath(... | [
"public",
"function",
"getRelated",
"(",
"Uri",
"$",
"baseUri",
")",
"{",
"$",
"path",
"=",
"$",
"baseUri",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"this",
"->",
"getPath",
"(",
")",
",",
"0",
",",
"strlen",
"(",
"$",
"path... | Get new uri instance related to provided base
Current: http://user:password@example.com/path/path2?k=v#fragment
Base: /path/
Return: path2?k=v#fragment
@param Uri $baseUri Base uri
@return $this | [
"Get",
"new",
"uri",
"instance",
"related",
"to",
"provided",
"base"
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L638-L650 |
1,460 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.buildAuthorityStr | protected function buildAuthorityStr()
{
if ($this->host != null) {
$authority = '//';
if ($this->userInfo != null) {
$authority .= $this->userInfo . '@';
}
$flag = (strpos($this->host, ':') !== false) && !(substr($this->host, 0,
... | php | protected function buildAuthorityStr()
{
if ($this->host != null) {
$authority = '//';
if ($this->userInfo != null) {
$authority .= $this->userInfo . '@';
}
$flag = (strpos($this->host, ':') !== false) && !(substr($this->host, 0,
... | [
"protected",
"function",
"buildAuthorityStr",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"!=",
"null",
")",
"{",
"$",
"authority",
"=",
"'//'",
";",
"if",
"(",
"$",
"this",
"->",
"userInfo",
"!=",
"null",
")",
"{",
"$",
"authority",
".=",
... | Returns the authority parts string of url
@see buildStr()
@return string | [
"Returns",
"the",
"authority",
"parts",
"string",
"of",
"url"
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L701-L728 |
1,461 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.withHost | public function withHost($host)
{
$url = clone $this;
$url->host = $host;
$url->hash = null;
return $url;
} | php | public function withHost($host)
{
$url = clone $this;
$url->host = $host;
$url->hash = null;
return $url;
} | [
"public",
"function",
"withHost",
"(",
"$",
"host",
")",
"{",
"$",
"url",
"=",
"clone",
"$",
"this",
";",
"$",
"url",
"->",
"host",
"=",
"$",
"host",
";",
"$",
"url",
"->",
"hash",
"=",
"null",
";",
"return",
"$",
"url",
";",
"}"
] | Create a new instance with the specified host.
This method MUST retain the state of the current instance, and return
a new instance that contains the specified host.
An empty host value is equivalent to removing the host.
@param string $host Hostname to use with the new instance.
@return self A new instance with the... | [
"Create",
"a",
"new",
"instance",
"with",
"the",
"specified",
"host",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L788-L796 |
1,462 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.withPort | public function withPort($port)
{
$url = clone $this;
$url->port = $port;
$url->hash = null;
return $url;
} | php | public function withPort($port)
{
$url = clone $this;
$url->port = $port;
$url->hash = null;
return $url;
} | [
"public",
"function",
"withPort",
"(",
"$",
"port",
")",
"{",
"$",
"url",
"=",
"clone",
"$",
"this",
";",
"$",
"url",
"->",
"port",
"=",
"$",
"port",
";",
"$",
"url",
"->",
"hash",
"=",
"null",
";",
"return",
"$",
"url",
";",
"}"
] | Create a new instance with the specified port.
This method MUST retain the state of the current instance, and return
a new instance that contains the specified port.
Implementations MUST raise an exception for ports outside the
established TCP and UDP port ranges.
A null value provided for the port is equivalent to ... | [
"Create",
"a",
"new",
"instance",
"with",
"the",
"specified",
"port",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L815-L822 |
1,463 | webmaniacs-net/lib-uri | lib/Uri.php | Uri.withQuery | public function withQuery($query)
{
$url = clone $this;
$url->query = $query;
$url->hash = null;
return $url;
} | php | public function withQuery($query)
{
$url = clone $this;
$url->query = $query;
$url->hash = null;
return $url;
} | [
"public",
"function",
"withQuery",
"(",
"$",
"query",
")",
"{",
"$",
"url",
"=",
"clone",
"$",
"this",
";",
"$",
"url",
"->",
"query",
"=",
"$",
"query",
";",
"$",
"url",
"->",
"hash",
"=",
"null",
";",
"return",
"$",
"url",
";",
"}"
] | Create a new instance with the specified query string.
This method MUST retain the state of the current instance, and return
a new instance that contains the specified query string.
If the query string is prefixed by "?", that character MUST be removed.
Additionally, the query string SHOULD be parseable by parse_str(... | [
"Create",
"a",
"new",
"instance",
"with",
"the",
"specified",
"query",
"string",
"."
] | 19c8293ba54ba37e6e0a43b41c0f8e597e28a922 | https://github.com/webmaniacs-net/lib-uri/blob/19c8293ba54ba37e6e0a43b41c0f8e597e28a922/lib/Uri.php#L863-L870 |
1,464 | osflab/container | PluginManager.php | PluginManager.registerApplicationPlugin | public static function registerApplicationPlugin(ApplicationPlugin $plugin, $priority = self::PRIORITY_NORMAL)
{
if ($priority != self::PRIORITY_HIGH
&& $priority != self::PRIORITY_NORMAL
&& $priority != self::PRIORITY_LOW) {
throw new ArchException('Bad plugin ... | php | public static function registerApplicationPlugin(ApplicationPlugin $plugin, $priority = self::PRIORITY_NORMAL)
{
if ($priority != self::PRIORITY_HIGH
&& $priority != self::PRIORITY_NORMAL
&& $priority != self::PRIORITY_LOW) {
throw new ArchException('Bad plugin ... | [
"public",
"static",
"function",
"registerApplicationPlugin",
"(",
"ApplicationPlugin",
"$",
"plugin",
",",
"$",
"priority",
"=",
"self",
"::",
"PRIORITY_NORMAL",
")",
"{",
"if",
"(",
"$",
"priority",
"!=",
"self",
"::",
"PRIORITY_HIGH",
"&&",
"$",
"priority",
... | Register a MVC plugin
@param PluginAbstract $plugin
@param integer $priority
@throws ArchException | [
"Register",
"a",
"MVC",
"plugin"
] | 415b374260ad377df00f8b3683b99f08bb4d25b6 | https://github.com/osflab/container/blob/415b374260ad377df00f8b3683b99f08bb4d25b6/PluginManager.php#L46-L59 |
1,465 | osflab/container | PluginManager.php | PluginManager.getApplicationPlugin | public static function getApplicationPlugin($pluginClass)
{
return isset(self::$plugins[$pluginClass]) ? self::$plugins[$pluginClass] : null;
} | php | public static function getApplicationPlugin($pluginClass)
{
return isset(self::$plugins[$pluginClass]) ? self::$plugins[$pluginClass] : null;
} | [
"public",
"static",
"function",
"getApplicationPlugin",
"(",
"$",
"pluginClass",
")",
"{",
"return",
"isset",
"(",
"self",
"::",
"$",
"plugins",
"[",
"$",
"pluginClass",
"]",
")",
"?",
"self",
"::",
"$",
"plugins",
"[",
"$",
"pluginClass",
"]",
":",
"nul... | Get a registered plugin by class name
@param string $pluginClass
@return \Osf\Application\PluginAbstract | [
"Get",
"a",
"registered",
"plugin",
"by",
"class",
"name"
] | 415b374260ad377df00f8b3683b99f08bb4d25b6 | https://github.com/osflab/container/blob/415b374260ad377df00f8b3683b99f08bb4d25b6/PluginManager.php#L66-L69 |
1,466 | osflab/container | PluginManager.php | PluginManager.handleApplicationPlugins | public static function handleApplicationPlugins($step)
{
foreach (self::$pluginsOrder as $plugins) {
foreach ($plugins as $pluginClass) {
self::$plugins[$pluginClass]->$step();
}
}
} | php | public static function handleApplicationPlugins($step)
{
foreach (self::$pluginsOrder as $plugins) {
foreach ($plugins as $pluginClass) {
self::$plugins[$pluginClass]->$step();
}
}
} | [
"public",
"static",
"function",
"handleApplicationPlugins",
"(",
"$",
"step",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"pluginsOrder",
"as",
"$",
"plugins",
")",
"{",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"pluginClass",
")",
"{",
"self",
"::",
"... | Used in Application core, please do not touch
@param string $step | [
"Used",
"in",
"Application",
"core",
"please",
"do",
"not",
"touch"
] | 415b374260ad377df00f8b3683b99f08bb4d25b6 | https://github.com/osflab/container/blob/415b374260ad377df00f8b3683b99f08bb4d25b6/PluginManager.php#L75-L82 |
1,467 | prestaconcept/PrestaCMSMediaBundle | Model/Carousel/Repository.php | Repository.findLimited | public function findLimited($limit = 0)
{
$queryBuilder = $this->createQueryBuilder('c')
->where('c.enabled = :enabled')
->orderBy('c.position')
->setParameters(array(
'enabled' => true,
));
if ($limit != 0) {
$queryBuilder... | php | public function findLimited($limit = 0)
{
$queryBuilder = $this->createQueryBuilder('c')
->where('c.enabled = :enabled')
->orderBy('c.position')
->setParameters(array(
'enabled' => true,
));
if ($limit != 0) {
$queryBuilder... | [
"public",
"function",
"findLimited",
"(",
"$",
"limit",
"=",
"0",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'c'",
")",
"->",
"where",
"(",
"'c.enabled = :enabled'",
")",
"->",
"orderBy",
"(",
"'c.position'",
")",
"-... | Return a list of carousel items
@param integer $limit
@return ArrayCollection | [
"Return",
"a",
"list",
"of",
"carousel",
"items"
] | e442d2bae2d1624f7ff234d003f82b5e1c6c4555 | https://github.com/prestaconcept/PrestaCMSMediaBundle/blob/e442d2bae2d1624f7ff234d003f82b5e1c6c4555/Model/Carousel/Repository.php#L25-L39 |
1,468 | imsamurai/cakephp-task-plugin | View/Helper/TaskHelper.php | TaskHelper.codeString | public function codeString(array $task, $full = true) {
return $this->_isCli || (!$task['code_string']) ? $task['code_string'] : $this->Html->tag('span', $this->_text($task['code_string'], $full ? 0 : Configure::read('Task.truncateCode'), true), array(
'class' => 'label label-' . ($task['code_string'] == 'OK' ? ... | php | public function codeString(array $task, $full = true) {
return $this->_isCli || (!$task['code_string']) ? $task['code_string'] : $this->Html->tag('span', $this->_text($task['code_string'], $full ? 0 : Configure::read('Task.truncateCode'), true), array(
'class' => 'label label-' . ($task['code_string'] == 'OK' ? ... | [
"public",
"function",
"codeString",
"(",
"array",
"$",
"task",
",",
"$",
"full",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"_isCli",
"||",
"(",
"!",
"$",
"task",
"[",
"'code_string'",
"]",
")",
"?",
"$",
"task",
"[",
"'code_string'",
"]",
... | String return code
@param array $task
@param bool $full
@return string | [
"String",
"return",
"code"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/View/Helper/TaskHelper.php#L252-L256 |
1,469 | imsamurai/cakephp-task-plugin | View/Helper/TaskHelper.php | TaskHelper.waiting | public function waiting(array $tasks, $full = true) {
$formattedTasks = $this->_formatWaiting($tasks, true);
$tasksCount = count($formattedTasks);
if ($tasksCount === 0) {
return $this->_none();
}
if ($this->_isCli) {
return implode(', ', $formattedTasks);
} elseif ($full) {
return implode(', ', $... | php | public function waiting(array $tasks, $full = true) {
$formattedTasks = $this->_formatWaiting($tasks, true);
$tasksCount = count($formattedTasks);
if ($tasksCount === 0) {
return $this->_none();
}
if ($this->_isCli) {
return implode(', ', $formattedTasks);
} elseif ($full) {
return implode(', ', $... | [
"public",
"function",
"waiting",
"(",
"array",
"$",
"tasks",
",",
"$",
"full",
"=",
"true",
")",
"{",
"$",
"formattedTasks",
"=",
"$",
"this",
"->",
"_formatWaiting",
"(",
"$",
"tasks",
",",
"true",
")",
";",
"$",
"tasksCount",
"=",
"count",
"(",
"$"... | Waiting for tasks
@param array $tasks
@param bool $full
@return string | [
"Waiting",
"for",
"tasks"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/View/Helper/TaskHelper.php#L354-L372 |
1,470 | imsamurai/cakephp-task-plugin | View/Helper/TaskHelper.php | TaskHelper.statistics | public function statistics(array $statistics) {
if ($this->_isCli) {
return $this->_none('Not allowed in cli');
}
if (!$this->settings['chartEnabled']) {
return $this->_none('Please install <b>imsamurai/cakephp-google-chart</b> plugin to view graph');
}
if (empty($statistics)) {
return $this->_none()... | php | public function statistics(array $statistics) {
if ($this->_isCli) {
return $this->_none('Not allowed in cli');
}
if (!$this->settings['chartEnabled']) {
return $this->_none('Please install <b>imsamurai/cakephp-google-chart</b> plugin to view graph');
}
if (empty($statistics)) {
return $this->_none()... | [
"public",
"function",
"statistics",
"(",
"array",
"$",
"statistics",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_isCli",
")",
"{",
"return",
"$",
"this",
"->",
"_none",
"(",
"'Not allowed in cli'",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"set... | Make statistics graph
@param array $statistics
@return string | [
"Make",
"statistics",
"graph"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/View/Helper/TaskHelper.php#L380-L427 |
1,471 | imsamurai/cakephp-task-plugin | View/Helper/TaskHelper.php | TaskHelper._formatWaiting | protected function _formatWaiting(array $tasks, $plain) {
$dependsOnTaskFormatted = array();
foreach ($tasks as $task) {
if (!in_array((int)$task['status'], array(TaskType::DEFFERED, TaskType::RUNNING, TaskType::STOPPING, TaskType::UNSTARTED))) {
continue;
}
$dependsOnTaskFormatted[] = $plain ? $task['... | php | protected function _formatWaiting(array $tasks, $plain) {
$dependsOnTaskFormatted = array();
foreach ($tasks as $task) {
if (!in_array((int)$task['status'], array(TaskType::DEFFERED, TaskType::RUNNING, TaskType::STOPPING, TaskType::UNSTARTED))) {
continue;
}
$dependsOnTaskFormatted[] = $plain ? $task['... | [
"protected",
"function",
"_formatWaiting",
"(",
"array",
"$",
"tasks",
",",
"$",
"plain",
")",
"{",
"$",
"dependsOnTaskFormatted",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"tasks",
"as",
"$",
"task",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
... | Waiting tasks formatter
@param array $tasks
@param bool $plain
@return array | [
"Waiting",
"tasks",
"formatter"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/View/Helper/TaskHelper.php#L436-L445 |
1,472 | imsamurai/cakephp-task-plugin | View/Helper/TaskHelper.php | TaskHelper._dateDiff | protected function _dateDiff($start = null, $stop = null) {
if ($start) {
$endDate = $stop instanceof DateTime ? $stop : new DateTime($stop ? $stop : 'now');
$startDate = $start instanceof DateTime ? $start : new DateTime($start);
$diff = $startDate->diff($endDate)->format(Configure::read('Task.dateDiffForma... | php | protected function _dateDiff($start = null, $stop = null) {
if ($start) {
$endDate = $stop instanceof DateTime ? $stop : new DateTime($stop ? $stop : 'now');
$startDate = $start instanceof DateTime ? $start : new DateTime($start);
$diff = $startDate->diff($endDate)->format(Configure::read('Task.dateDiffForma... | [
"protected",
"function",
"_dateDiff",
"(",
"$",
"start",
"=",
"null",
",",
"$",
"stop",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"start",
")",
"{",
"$",
"endDate",
"=",
"$",
"stop",
"instanceof",
"DateTime",
"?",
"$",
"stop",
":",
"new",
"DateTime",
... | Date diff formatter
@param DateTime|string $start
@param DateTime|string $stop
@return string | [
"Date",
"diff",
"formatter"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/View/Helper/TaskHelper.php#L465-L474 |
1,473 | jianfengye/hades | src/Hades/Route/Manager.php | Manager.get | public static function get($uri, $callback, $params = [])
{
if (is_string($callback)) {
$callback = self::str2closure($callback);
}
$middlewares = array_merge(self::middlewaresByParams($params), self::middlewaresByParams(self::$group_params));
self::$routes[] = new Rout... | php | public static function get($uri, $callback, $params = [])
{
if (is_string($callback)) {
$callback = self::str2closure($callback);
}
$middlewares = array_merge(self::middlewaresByParams($params), self::middlewaresByParams(self::$group_params));
self::$routes[] = new Rout... | [
"public",
"static",
"function",
"get",
"(",
"$",
"uri",
",",
"$",
"callback",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"callback",
"=",
"self",
"::",
"str2closure",
"(",
"$",
"... | set get route | [
"set",
"get",
"route"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Route/Manager.php#L27-L36 |
1,474 | jianfengye/hades | src/Hades/Route/Manager.php | Manager.str2closure | private static function str2closure($controllerAction)
{
list($controller, $action) = explode('@', $controllerAction);
return function($request) use ($controller, $action) {
$c = new $controller;
return call_user_func([$c, $action], $request);
};
} | php | private static function str2closure($controllerAction)
{
list($controller, $action) = explode('@', $controllerAction);
return function($request) use ($controller, $action) {
$c = new $controller;
return call_user_func([$c, $action], $request);
};
} | [
"private",
"static",
"function",
"str2closure",
"(",
"$",
"controllerAction",
")",
"{",
"list",
"(",
"$",
"controller",
",",
"$",
"action",
")",
"=",
"explode",
"(",
"'@'",
",",
"$",
"controllerAction",
")",
";",
"return",
"function",
"(",
"$",
"request",
... | convert string to closure | [
"convert",
"string",
"to",
"closure"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Route/Manager.php#L81-L88 |
1,475 | donghaichen/session | src/Flash.php | Flash.get | public function get($key, $default = null)
{
if(isset($this->data[$key]))
{
return $this->data[$key];
}
return isset($this->session[$key]) ? $this->session[$key] : $default;
} | php | public function get($key, $default = null)
{
if(isset($this->data[$key]))
{
return $this->data[$key];
}
return isset($this->session[$key]) ? $this->session[$key] : $default;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
";",... | Retrive a value
@access public
@param string $key Key
@param mixed $default (optional) Default value
@return \Clovers\Session\Flash | [
"Retrive",
"a",
"value"
] | 704e506f06fdc9641f80ebde60e092027447624f | https://github.com/donghaichen/session/blob/704e506f06fdc9641f80ebde60e092027447624f/src/Flash.php#L47-L55 |
1,476 | donghaichen/session | src/Flash.php | Flash.load | public function load($key, Clovers $callback)
{
if(!$this->has($key))
{
$this->set($key, $callback($key));
}
return $this->get($key);
} | php | public function load($key, Clovers $callback)
{
if(!$this->has($key))
{
$this->set($key, $callback($key));
}
return $this->get($key);
} | [
"public",
"function",
"load",
"(",
"$",
"key",
",",
"Clovers",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"callback",
"(",
"$",
"ke... | Retrive the value associated with the specified key or associate
the specified key with the value returned by invoking the callback.
@access public
@param string $key Key
@param \Clovers $callback Callback
@return mixed | [
"Retrive",
"the",
"value",
"associated",
"with",
"the",
"specified",
"key",
"or",
"associate",
"the",
"specified",
"key",
"with",
"the",
"value",
"returned",
"by",
"invoking",
"the",
"callback",
"."
] | 704e506f06fdc9641f80ebde60e092027447624f | https://github.com/donghaichen/session/blob/704e506f06fdc9641f80ebde60e092027447624f/src/Flash.php#L69-L77 |
1,477 | HustleWorks/chute | src/ImageUploader.php | ImageUploader.handle | public function handle($framework_file, ImageConfiguration $config, array $optional_data = [])
{
/* Create ImageFile object for processing */
$image_file = $this->prepareImageFile($framework_file);
/* run validation on upload */
$response = $this->validator->validate($image_file, $c... | php | public function handle($framework_file, ImageConfiguration $config, array $optional_data = [])
{
/* Create ImageFile object for processing */
$image_file = $this->prepareImageFile($framework_file);
/* run validation on upload */
$response = $this->validator->validate($image_file, $c... | [
"public",
"function",
"handle",
"(",
"$",
"framework_file",
",",
"ImageConfiguration",
"$",
"config",
",",
"array",
"$",
"optional_data",
"=",
"[",
"]",
")",
"{",
"/* Create ImageFile object for processing */",
"$",
"image_file",
"=",
"$",
"this",
"->",
"prepareIm... | Handle Image Upload
@param mixed $framework_file
@param ImageConfiguration $config
@param array $optional_data
@return ServiceResponse | [
"Handle",
"Image",
"Upload"
] | ede5a83dd74925e734b9b0063502c7e4b9085cb2 | https://github.com/HustleWorks/chute/blob/ede5a83dd74925e734b9b0063502c7e4b9085cb2/src/ImageUploader.php#L56-L94 |
1,478 | tacone/datasource | src/AbstractEloquentDataSource.php | AbstractEloquentDataSource.createChild | protected function createChild($key)
{
$relation = $this->getValueOrRelationForKey($key);
// if this is not a relation, then it's the actual value
// returned by a method (like for example computed attributes)
// so we just return it as the value
if (!$relation instanceof Re... | php | protected function createChild($key)
{
$relation = $this->getValueOrRelationForKey($key);
// if this is not a relation, then it's the actual value
// returned by a method (like for example computed attributes)
// so we just return it as the value
if (!$relation instanceof Re... | [
"protected",
"function",
"createChild",
"(",
"$",
"key",
")",
"{",
"$",
"relation",
"=",
"$",
"this",
"->",
"getValueOrRelationForKey",
"(",
"$",
"key",
")",
";",
"// if this is not a relation, then it's the actual value",
"// returned by a method (like for example computed... | Caches a relation for later use.
Creates a new model in case of empty values.
We need to invoke this method for every field
we want to save later, no exception
@param $key
@param $model
@return mixed | [
"Caches",
"a",
"relation",
"for",
"later",
"use",
".",
"Creates",
"a",
"new",
"model",
"in",
"case",
"of",
"empty",
"values",
"."
] | 9cf4423764ba14e9bbd9fa7d5cdbed27d70001f3 | https://github.com/tacone/datasource/blob/9cf4423764ba14e9bbd9fa7d5cdbed27d70001f3/src/AbstractEloquentDataSource.php#L57-L82 |
1,479 | snowiow/cocurl | src/Client.php | Client.clans | public function clans($param, $members = false)
{
if (is_array($param)) {
return $this->_clansByFilter($param);
} else if ($members) {
return $this->_clansMembersOnly($param);
}
return $this->_clanById($param);
} | php | public function clans($param, $members = false)
{
if (is_array($param)) {
return $this->_clansByFilter($param);
} else if ($members) {
return $this->_clansMembersOnly($param);
}
return $this->_clanById($param);
} | [
"public",
"function",
"clans",
"(",
"$",
"param",
",",
"$",
"members",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"param",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_clansByFilter",
"(",
"$",
"param",
")",
";",
"}",
"else",
"if",
... | Search for clans by different approaches.
@param array|string $param if array it represents the possible filters,
which can be send to the coc api. If it is a string it represents the clan tag
which is send
@return array|Clan if searched with filters, it returns an array with clans,
who match the filter. If searched by... | [
"Search",
"for",
"clans",
"by",
"different",
"approaches",
"."
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Client.php#L121-L129 |
1,480 | snowiow/cocurl | src/Client.php | Client._clansMembersOnly | private function _clansMembersOnly(string $param): array
{
$curlClient = curl_init(
self::BASE_URL .
self::CLANS_URL .
'/' .
\urlencode($param) .
'/members'
);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
... | php | private function _clansMembersOnly(string $param): array
{
$curlClient = curl_init(
self::BASE_URL .
self::CLANS_URL .
'/' .
\urlencode($param) .
'/members'
);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
... | [
"private",
"function",
"_clansMembersOnly",
"(",
"string",
"$",
"param",
")",
":",
"array",
"{",
"$",
"curlClient",
"=",
"curl_init",
"(",
"self",
"::",
"BASE_URL",
".",
"self",
"::",
"CLANS_URL",
".",
"'/'",
".",
"\\",
"urlencode",
"(",
"$",
"param",
")... | Search for clan members only of a specific clan
@param string $param the clan tag
@return array array of player who are members of the clan, hwich matches the
clan tag | [
"Search",
"for",
"clan",
"members",
"only",
"of",
"a",
"specific",
"clan"
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Client.php#L137-L154 |
1,481 | snowiow/cocurl | src/Client.php | Client._clanById | private function _clanById(string $param): Clan
{
$curlClient = curl_init(
self::BASE_URL .
self::CLANS_URL .
'/' .
\urlencode($param)
);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
curl_setopt($curlClient, CURLOPT... | php | private function _clanById(string $param): Clan
{
$curlClient = curl_init(
self::BASE_URL .
self::CLANS_URL .
'/' .
\urlencode($param)
);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
curl_setopt($curlClient, CURLOPT... | [
"private",
"function",
"_clanById",
"(",
"string",
"$",
"param",
")",
":",
"Clan",
"{",
"$",
"curlClient",
"=",
"curl_init",
"(",
"self",
"::",
"BASE_URL",
".",
"self",
"::",
"CLANS_URL",
".",
"'/'",
".",
"\\",
"urlencode",
"(",
"$",
"param",
")",
")",... | Retrieves the clan, who matches the given id
@param string $param the clan tag
@return Clan a Clan object, containing the searched clan | [
"Retrieves",
"the",
"clan",
"who",
"matches",
"the",
"given",
"id"
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Client.php#L161-L173 |
1,482 | snowiow/cocurl | src/Client.php | Client._clansByFilter | private function _clansByFilter(array $params): array
{
$url = self::BASE_URL . self::CLANS_URL . '?';
$url .= http_build_query($params);
$curlClient = curl_init($url);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
curl_setopt($curlClient, CURLOPT_RETURNTR... | php | private function _clansByFilter(array $params): array
{
$url = self::BASE_URL . self::CLANS_URL . '?';
$url .= http_build_query($params);
$curlClient = curl_init($url);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
curl_setopt($curlClient, CURLOPT_RETURNTR... | [
"private",
"function",
"_clansByFilter",
"(",
"array",
"$",
"params",
")",
":",
"array",
"{",
"$",
"url",
"=",
"self",
"::",
"BASE_URL",
".",
"self",
"::",
"CLANS_URL",
".",
"'?'",
";",
"$",
"url",
".=",
"http_build_query",
"(",
"$",
"params",
")",
";"... | Retrieves a list of clans, who matches a set of filters
@param array $params an array of filters. Keys are the names of filters, like
they are defined in the coc api, values are the filter values
@return array an array of clans who match the filters | [
"Retrieves",
"a",
"list",
"of",
"clans",
"who",
"matches",
"a",
"set",
"of",
"filters"
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Client.php#L181-L195 |
1,483 | snowiow/cocurl | src/Client.php | Client._locationsById | private function _locationsById(int $id): Location
{
$curlClient = curl_init(self::BASE_URL . self::LOCATIONS_URL . '/' . $id);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
curl_setopt($curlClient, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($c... | php | private function _locationsById(int $id): Location
{
$curlClient = curl_init(self::BASE_URL . self::LOCATIONS_URL . '/' . $id);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);
curl_setopt($curlClient, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($c... | [
"private",
"function",
"_locationsById",
"(",
"int",
"$",
"id",
")",
":",
"Location",
"{",
"$",
"curlClient",
"=",
"curl_init",
"(",
"self",
"::",
"BASE_URL",
".",
"self",
"::",
"LOCATIONS_URL",
".",
"'/'",
".",
"$",
"id",
")",
";",
"curl_setopt",
"(",
... | Returns a location with the given id
@param int $id the unique identifier of the location
@return The Location with the given id | [
"Returns",
"a",
"location",
"with",
"the",
"given",
"id"
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Client.php#L202-L209 |
1,484 | snowiow/cocurl | src/Client.php | Client._locationsByIdAndRank | private function _locationsByIdAndRank(int $id, $rank)
{
$curlClient = curl_init(
self::BASE_URL .
self::LOCATIONS_URL .
'/' .
$id .
'/rankings/' .
$rank
);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader... | php | private function _locationsByIdAndRank(int $id, $rank)
{
$curlClient = curl_init(
self::BASE_URL .
self::LOCATIONS_URL .
'/' .
$id .
'/rankings/' .
$rank
);
curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader... | [
"private",
"function",
"_locationsByIdAndRank",
"(",
"int",
"$",
"id",
",",
"$",
"rank",
")",
"{",
"$",
"curlClient",
"=",
"curl_init",
"(",
"self",
"::",
"BASE_URL",
".",
"self",
"::",
"LOCATIONS_URL",
".",
"'/'",
".",
"$",
"id",
".",
"'/rankings/'",
".... | Based on a Location, retrieve the local rankings
@param int $id the unique identifier of the location
@param string|RankingId $rank the kind of ranking you want to retrieve.
Based on Clans and based on players is supported at the moment.
@return The clans/player who are located at the location id | [
"Based",
"on",
"a",
"Location",
"retrieve",
"the",
"local",
"rankings"
] | 583df05bd3c8f24fd99f294da9906a3e4b1a9c7b | https://github.com/snowiow/cocurl/blob/583df05bd3c8f24fd99f294da9906a3e4b1a9c7b/src/Client.php#L218-L240 |
1,485 | affinitidev/silex-config | Source/Loader/Concrete/YamlLoader.php | YamlLoader.load | public function load($resource, $type = null)
{
$path = $this->locator->locate($resource);
if (!stream_is_local($path)) {
throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $path));
}
if (!file_exists($path)) {
throw new \... | php | public function load($resource, $type = null)
{
$path = $this->locator->locate($resource);
if (!stream_is_local($path)) {
throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $path));
}
if (!file_exists($path)) {
throw new \... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"locator",
"->",
"locate",
"(",
"$",
"resource",
")",
";",
"if",
"(",
"!",
"stream_is_local",
"(",
"$",
"path",
")",
... | Loads and parses the given Yaml file into a PHP array.
@param string $resource
@param string $type | [
"Loads",
"and",
"parses",
"the",
"given",
"Yaml",
"file",
"into",
"a",
"PHP",
"array",
"."
] | 6c9cd170b26a6d30f31334ccfaca203304ad8f72 | https://github.com/affinitidev/silex-config/blob/6c9cd170b26a6d30f31334ccfaca203304ad8f72/Source/Loader/Concrete/YamlLoader.php#L30-L45 |
1,486 | bugotech/http | src/Exceptions/HttpException.php | HttpException.getResponse | public function getResponse()
{
$response = redirect()->to($this->getRedirectUrl());
$response->withInput($this->request->input());
$response->withErrors($this->getErrors(), 'default');
$response->setCharset(config('app.charset', 'UTF-8'));
return $response;
} | php | public function getResponse()
{
$response = redirect()->to($this->getRedirectUrl());
$response->withInput($this->request->input());
$response->withErrors($this->getErrors(), 'default');
$response->setCharset(config('app.charset', 'UTF-8'));
return $response;
} | [
"public",
"function",
"getResponse",
"(",
")",
"{",
"$",
"response",
"=",
"redirect",
"(",
")",
"->",
"to",
"(",
"$",
"this",
"->",
"getRedirectUrl",
"(",
")",
")",
";",
"$",
"response",
"->",
"withInput",
"(",
"$",
"this",
"->",
"request",
"->",
"in... | Get the underlying response instance.
@return \Symfony\Component\HttpFoundation\Response | [
"Get",
"the",
"underlying",
"response",
"instance",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Exceptions/HttpException.php#L44-L52 |
1,487 | bugotech/http | src/Exceptions/HttpException.php | HttpException.getErrors | protected function getErrors()
{
$arr = ['error' => $this->getMessage()];
if (count($this->attrs) > 0) {
$arr['attrs'] = $this->getAttrs();
}
if (count($this->attrsCustom) > 0) {
$arr['attrscustom'] = $this->getAttrsCustom();
}
return $arr;
... | php | protected function getErrors()
{
$arr = ['error' => $this->getMessage()];
if (count($this->attrs) > 0) {
$arr['attrs'] = $this->getAttrs();
}
if (count($this->attrsCustom) > 0) {
$arr['attrscustom'] = $this->getAttrsCustom();
}
return $arr;
... | [
"protected",
"function",
"getErrors",
"(",
")",
"{",
"$",
"arr",
"=",
"[",
"'error'",
"=>",
"$",
"this",
"->",
"getMessage",
"(",
")",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"attrs",
")",
">",
"0",
")",
"{",
"$",
"arr",
"[",
"'at... | Array de erros.
@return array | [
"Array",
"de",
"erros",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Exceptions/HttpException.php#L59-L72 |
1,488 | Puzzlout/FrameworkMvcLegacy | src/Helpers/WebIdeAjaxHelper.php | WebIdeAjaxHelper.GetSolutionDirectoryList | public function GetSolutionDirectoryList(\Puzzlout\Framework\Core\Application $app) {
$Cacher = \Puzzlout\Framework\Core\Cache\BaseCache::Init($app->config);
//$Cacher->Remove(CacheKeys::SOLUTION_FOLDERS);
if (!$Cacher->KeyExists(CacheKeys::SOLUTION_FOLDERS)) {
$SolutionPathListArray... | php | public function GetSolutionDirectoryList(\Puzzlout\Framework\Core\Application $app) {
$Cacher = \Puzzlout\Framework\Core\Cache\BaseCache::Init($app->config);
//$Cacher->Remove(CacheKeys::SOLUTION_FOLDERS);
if (!$Cacher->KeyExists(CacheKeys::SOLUTION_FOLDERS)) {
$SolutionPathListArray... | [
"public",
"function",
"GetSolutionDirectoryList",
"(",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Core",
"\\",
"Application",
"$",
"app",
")",
"{",
"$",
"Cacher",
"=",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Core",
"\\",
"Cache",
"\\",
"BaseCache",
"::"... | Retrieves the solution directory list. It caches the result if not already
done so that it retrieves it faster the next occurrences.
@param \Puzzlout\Framework\Core\Application $app The current application instance.
@return array(of String) | [
"Retrieves",
"the",
"solution",
"directory",
"list",
".",
"It",
"caches",
"the",
"result",
"if",
"not",
"already",
"done",
"so",
"that",
"it",
"retrieves",
"it",
"faster",
"the",
"next",
"occurrences",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Helpers/WebIdeAjaxHelper.php#L35-L46 |
1,489 | Puzzlout/FrameworkMvcLegacy | src/Helpers/WebIdeAjaxHelper.php | WebIdeAjaxHelper.IsFolderMatchingFilter | public function IsFolderMatchingFilter($path, $regexFilter) {
return \Puzzlout\Framework\Helpers\RegexHelper::Init($path)->IsMatch($regexFilter);
} | php | public function IsFolderMatchingFilter($path, $regexFilter) {
return \Puzzlout\Framework\Helpers\RegexHelper::Init($path)->IsMatch($regexFilter);
} | [
"public",
"function",
"IsFolderMatchingFilter",
"(",
"$",
"path",
",",
"$",
"regexFilter",
")",
"{",
"return",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Helpers",
"\\",
"RegexHelper",
"::",
"Init",
"(",
"$",
"path",
")",
"->",
"IsMatch",
"(",
"$",
"regex... | Test to the path against the filter.
@param string $path The folder path
@param string $regexFilter The regex to test the path | [
"Test",
"to",
"the",
"path",
"against",
"the",
"filter",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Helpers/WebIdeAjaxHelper.php#L85-L87 |
1,490 | Puzzlout/FrameworkMvcLegacy | src/Helpers/WebIdeAjaxHelper.php | WebIdeAjaxHelper.AddFolderPathToListItems | public function AddFolderPathToListItems($key, $path) {
array_push($this->ListItemArray, \Puzzlout\Framework\BO\ListItem::Init($key, $path));
} | php | public function AddFolderPathToListItems($key, $path) {
array_push($this->ListItemArray, \Puzzlout\Framework\BO\ListItem::Init($key, $path));
} | [
"public",
"function",
"AddFolderPathToListItems",
"(",
"$",
"key",
",",
"$",
"path",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"ListItemArray",
",",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"BO",
"\\",
"ListItem",
"::",
"Init",
"(",
"$",
"key",
"... | Add a ListItem object to the field ListItemArray.
@param type $key
@param string $path The folder path | [
"Add",
"a",
"ListItem",
"object",
"to",
"the",
"field",
"ListItemArray",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Helpers/WebIdeAjaxHelper.php#L95-L97 |
1,491 | tenside/core | src/Task/Composer/AbstractComposerCommandTask.php | AbstractComposerCommandTask.fixCommandDefinition | protected function fixCommandDefinition(BaseCommand $command)
{
$definition = $command->getDefinition();
if (!$definition->hasOption('verbose')) {
$definition->addOption(
new InputOption(
'verbose',
'v|vv|vvv',
... | php | protected function fixCommandDefinition(BaseCommand $command)
{
$definition = $command->getDefinition();
if (!$definition->hasOption('verbose')) {
$definition->addOption(
new InputOption(
'verbose',
'v|vv|vvv',
... | [
"protected",
"function",
"fixCommandDefinition",
"(",
"BaseCommand",
"$",
"command",
")",
"{",
"$",
"definition",
"=",
"$",
"command",
"->",
"getDefinition",
"(",
")",
";",
"if",
"(",
"!",
"$",
"definition",
"->",
"hasOption",
"(",
"'verbose'",
")",
")",
"... | Add missing definition options to the command usually defined by the application.
See also composer/composer in src/Composer/Console/Application.php
@param BaseCommand $command The command to fix.
@return void | [
"Add",
"missing",
"definition",
"options",
"to",
"the",
"command",
"usually",
"defined",
"by",
"the",
"application",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/AbstractComposerCommandTask.php#L60-L104 |
1,492 | tenside/core | src/Task/Composer/AbstractComposerCommandTask.php | AbstractComposerCommandTask.attachComposerFactory | protected function attachComposerFactory(BaseCommand $command)
{
if (!method_exists($command, 'setComposerFactory')) {
throw new \InvalidArgumentException('The passed command does not implement method setComposerFactory()');
}
/** @var WrappedCommandTrait $command */
$co... | php | protected function attachComposerFactory(BaseCommand $command)
{
if (!method_exists($command, 'setComposerFactory')) {
throw new \InvalidArgumentException('The passed command does not implement method setComposerFactory()');
}
/** @var WrappedCommandTrait $command */
$co... | [
"protected",
"function",
"attachComposerFactory",
"(",
"BaseCommand",
"$",
"command",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"command",
",",
"'setComposerFactory'",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The passed co... | Attach the composer factory to the command.
@param BaseCommand $command The command to patch.
@return BaseCommand
@throws \InvalidArgumentException When no setComposerFactory method is declared. | [
"Attach",
"the",
"composer",
"factory",
"to",
"the",
"command",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/AbstractComposerCommandTask.php#L115-L129 |
1,493 | tenside/core | src/Task/Composer/AbstractComposerCommandTask.php | AbstractComposerCommandTask.executeCommand | protected function executeCommand(BaseCommand $command, InputInterface $input, OutputInterface $output)
{
try {
if (0 !== ($statusCode = $command->run($input, $output))) {
throw new \RuntimeException('Error: command exit code was ' . $statusCode);
}
} catch (\... | php | protected function executeCommand(BaseCommand $command, InputInterface $input, OutputInterface $output)
{
try {
if (0 !== ($statusCode = $command->run($input, $output))) {
throw new \RuntimeException('Error: command exit code was ' . $statusCode);
}
} catch (\... | [
"protected",
"function",
"executeCommand",
"(",
"BaseCommand",
"$",
"command",
",",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"try",
"{",
"if",
"(",
"0",
"!==",
"(",
"$",
"statusCode",
"=",
"$",
"command",
"->",
"run"... | Execute the command and throw exceptions on errors.
@param BaseCommand $command The command to execute.
@param InputInterface $input The input to use.
@param OutputInterface $output The output to use.
@return void
@throws \RuntimeException On exceptions or when the command has an non zero exit code. | [
"Execute",
"the",
"command",
"and",
"throw",
"exceptions",
"on",
"errors",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Task/Composer/AbstractComposerCommandTask.php#L144-L153 |
1,494 | cundd/test-flight | src/Event/EventDispatcher.php | EventDispatcher.register | public function register(string $eventCode, callable $listener)
{
$this->assertValidEventCode($eventCode);
if (false === isset($this->eventListeners[$eventCode])) {
$this->eventListeners[$eventCode] = [];
}
$this->eventListeners[$eventCode][] = $listener;
return ... | php | public function register(string $eventCode, callable $listener)
{
$this->assertValidEventCode($eventCode);
if (false === isset($this->eventListeners[$eventCode])) {
$this->eventListeners[$eventCode] = [];
}
$this->eventListeners[$eventCode][] = $listener;
return ... | [
"public",
"function",
"register",
"(",
"string",
"$",
"eventCode",
",",
"callable",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"assertValidEventCode",
"(",
"$",
"eventCode",
")",
";",
"if",
"(",
"false",
"===",
"isset",
"(",
"$",
"this",
"->",
"eventL... | Register a listener for the given event code
@param string $eventCode
@param callable $listener
@return $this | [
"Register",
"a",
"listener",
"for",
"the",
"given",
"event",
"code"
] | 9d8424dfb586f823f9dad2dcb81ff3986e255d56 | https://github.com/cundd/test-flight/blob/9d8424dfb586f823f9dad2dcb81ff3986e255d56/src/Event/EventDispatcher.php#L24-L33 |
1,495 | cundd/test-flight | src/Event/EventDispatcher.php | EventDispatcher.dispatch | public function dispatch(string $eventCode, EventInterface $event)
{
$this->assertValidEventCode($eventCode);
if (true === isset($this->eventListeners[$eventCode])) {
foreach ($this->eventListeners[$eventCode] as $listener) {
$listener($event);
}
}
... | php | public function dispatch(string $eventCode, EventInterface $event)
{
$this->assertValidEventCode($eventCode);
if (true === isset($this->eventListeners[$eventCode])) {
foreach ($this->eventListeners[$eventCode] as $listener) {
$listener($event);
}
}
... | [
"public",
"function",
"dispatch",
"(",
"string",
"$",
"eventCode",
",",
"EventInterface",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"assertValidEventCode",
"(",
"$",
"eventCode",
")",
";",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"even... | Invoke all event listeners for the given event code
@param string $eventCode
@param EventInterface $event
@return $this | [
"Invoke",
"all",
"event",
"listeners",
"for",
"the",
"given",
"event",
"code"
] | 9d8424dfb586f823f9dad2dcb81ff3986e255d56 | https://github.com/cundd/test-flight/blob/9d8424dfb586f823f9dad2dcb81ff3986e255d56/src/Event/EventDispatcher.php#L42-L52 |
1,496 | themichaelhall/bluemvc-twig | src/TwigViewRenderer.php | TwigViewRenderer.setStrictVariables | public function setStrictVariables(bool $isEnabled = true): self
{
if ($isEnabled) {
$this->twigEnvironment->enableStrictVariables();
} else {
$this->twigEnvironment->disableStrictVariables();
}
return $this;
} | php | public function setStrictVariables(bool $isEnabled = true): self
{
if ($isEnabled) {
$this->twigEnvironment->enableStrictVariables();
} else {
$this->twigEnvironment->disableStrictVariables();
}
return $this;
} | [
"public",
"function",
"setStrictVariables",
"(",
"bool",
"$",
"isEnabled",
"=",
"true",
")",
":",
"self",
"{",
"if",
"(",
"$",
"isEnabled",
")",
"{",
"$",
"this",
"->",
"twigEnvironment",
"->",
"enableStrictVariables",
"(",
")",
";",
"}",
"else",
"{",
"$... | Sets whether strict variables should be enabled.
@since 1.1.0
@param bool $isEnabled True if strict variables should be enabled, false otherwise.
@return self The Twig view renderer. | [
"Sets",
"whether",
"strict",
"variables",
"should",
"be",
"enabled",
"."
] | 75ccddcb3645e703d3f98d94c819fe912c6cd55f | https://github.com/themichaelhall/bluemvc-twig/blob/75ccddcb3645e703d3f98d94c819fe912c6cd55f/src/TwigViewRenderer.php#L117-L126 |
1,497 | PentagonalProject/SlimService | src/Configurator.php | Configurator.remove | public function remove($key)
{
if (!is_string($key) && !is_numeric($key)) {
throw new InvalidArgumentException(
'Invalid key name given! Key config to remove must be as a string!'
);
}
if (!$this->exist($key)) {
return;
}
... | php | public function remove($key)
{
if (!is_string($key) && !is_numeric($key)) {
throw new InvalidArgumentException(
'Invalid key name given! Key config to remove must be as a string!'
);
}
if (!$this->exist($key)) {
return;
}
... | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
"&&",
"!",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Invalid key name given! Key config to re... | Remove Key from nested selector
@param string $key | [
"Remove",
"Key",
"from",
"nested",
"selector"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Configurator.php#L250-L317 |
1,498 | rozaverta/cmf | core/Filesystem/Resource.php | Resource.ready | public function ready()
{
if( $this->ready )
{
return $this;
}
$this->raw = @ file_get_contents($this->pathname);
if( !$this->raw )
{
throw new AccessFileException($this->pathname,"Cannot ready resource '{$this->name}'");
}
try {
$data = Json::parse($this->raw, true);
if( ! is_array($data... | php | public function ready()
{
if( $this->ready )
{
return $this;
}
$this->raw = @ file_get_contents($this->pathname);
if( !$this->raw )
{
throw new AccessFileException($this->pathname,"Cannot ready resource '{$this->name}'");
}
try {
$data = Json::parse($this->raw, true);
if( ! is_array($data... | [
"public",
"function",
"ready",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ready",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"raw",
"=",
"@",
"file_get_contents",
"(",
"$",
"this",
"->",
"pathname",
")",
";",
"if",
"(",
"!",... | Load resource content data
@return $this
@throws AccessFileException
@throws ReadFileException | [
"Load",
"resource",
"content",
"data"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Filesystem/Resource.php#L126-L159 |
1,499 | rozaverta/cmf | core/Filesystem/Resource.php | Resource.hasType | public function hasType( string $type ): bool
{
if( substr($type, 0, 2) !== "#/" )
{
$type = "#/{$type}";
}
return $this->getType() === $type;
} | php | public function hasType( string $type ): bool
{
if( substr($type, 0, 2) !== "#/" )
{
$type = "#/{$type}";
}
return $this->getType() === $type;
} | [
"public",
"function",
"hasType",
"(",
"string",
"$",
"type",
")",
":",
"bool",
"{",
"if",
"(",
"substr",
"(",
"$",
"type",
",",
"0",
",",
"2",
")",
"!==",
"\"#/\"",
")",
"{",
"$",
"type",
"=",
"\"#/{$type}\"",
";",
"}",
"return",
"$",
"this",
"->... | Compare resource type
@param string $type
@return bool | [
"Compare",
"resource",
"type"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Filesystem/Resource.php#L177-L184 |
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.