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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
240,900 | xcitestudios/php-network | src/Email/EmailSerializable.php | EmailSerializable.setSender | public function setSender(ContactInterface $sender = null)
{
if ($sender !== null && !($sender instanceof Contact)) {
throw new InvalidArgumentException(
sprintf(
'%s expects an instance of %s.',
__FUNCTION__, Contact::class
... | php | public function setSender(ContactInterface $sender = null)
{
if ($sender !== null && !($sender instanceof Contact)) {
throw new InvalidArgumentException(
sprintf(
'%s expects an instance of %s.',
__FUNCTION__, Contact::class
... | [
"public",
"function",
"setSender",
"(",
"ContactInterface",
"$",
"sender",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"sender",
"!==",
"null",
"&&",
"!",
"(",
"$",
"sender",
"instanceof",
"Contact",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(... | Sets the sender.
Optional OR Required. Optional where From is one person. Required where From is multiple people.
@param Contact|null $sender
@throws InvalidArgumentException
@return static | [
"Sets",
"the",
"sender",
".",
"Optional",
"OR",
"Required",
".",
"Optional",
"where",
"From",
"is",
"one",
"person",
".",
"Required",
"where",
"From",
"is",
"multiple",
"people",
"."
] | 4278b7bd5b5cf64ceb08005f6bce18be79b76cd3 | https://github.com/xcitestudios/php-network/blob/4278b7bd5b5cf64ceb08005f6bce18be79b76cd3/src/Email/EmailSerializable.php#L139-L152 |
240,901 | xcitestudios/php-network | src/Email/EmailSerializable.php | EmailSerializable.setBodyParts | public function setBodyParts(array $bodyParts)
{
$collection = new EmailBodyPartCollection();
foreach ($bodyParts as $k => $v) {
$collection->add($v);
}
$this->bodyParts = $collection;
return $this;
} | php | public function setBodyParts(array $bodyParts)
{
$collection = new EmailBodyPartCollection();
foreach ($bodyParts as $k => $v) {
$collection->add($v);
}
$this->bodyParts = $collection;
return $this;
} | [
"public",
"function",
"setBodyParts",
"(",
"array",
"$",
"bodyParts",
")",
"{",
"$",
"collection",
"=",
"new",
"EmailBodyPartCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"bodyParts",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"collection",
"->",
... | Set the body of the email. For a single content-type email, just put one in this array.
It is presumed if you add multiple items to this array then it must be multipart.
For multipart/alternative (multiple versions of the body such as text / html) add in
one body part of type multipart/alternative which has multiple b... | [
"Set",
"the",
"body",
"of",
"the",
"email",
".",
"For",
"a",
"single",
"content",
"-",
"type",
"email",
"just",
"put",
"one",
"in",
"this",
"array",
".",
"It",
"is",
"presumed",
"if",
"you",
"add",
"multiple",
"items",
"to",
"this",
"array",
"then",
... | 4278b7bd5b5cf64ceb08005f6bce18be79b76cd3 | https://github.com/xcitestudios/php-network/blob/4278b7bd5b5cf64ceb08005f6bce18be79b76cd3/src/Email/EmailSerializable.php#L347-L358 |
240,902 | nirix/radium | src/Http/Controller.php | Controller.respondTo | public function respondTo($func)
{
$route = Router::currentRoute();
$response = $func($route['extension'], $this);
if ($response === null) {
return $this->show404();
}
return $response;
} | php | public function respondTo($func)
{
$route = Router::currentRoute();
$response = $func($route['extension'], $this);
if ($response === null) {
return $this->show404();
}
return $response;
} | [
"public",
"function",
"respondTo",
"(",
"$",
"func",
")",
"{",
"$",
"route",
"=",
"Router",
"::",
"currentRoute",
"(",
")",
";",
"$",
"response",
"=",
"$",
"func",
"(",
"$",
"route",
"[",
"'extension'",
"]",
",",
"$",
"this",
")",
";",
"if",
"(",
... | Easily respond to different request formats.
@param callable $func
@return object | [
"Easily",
"respond",
"to",
"different",
"request",
"formats",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Http/Controller.php#L160-L170 |
240,903 | nirix/radium | src/Http/Controller.php | Controller.show404 | public function show404()
{
$this->executeAction = false;
return new Response(function($resp){
$resp->status = 404;
$resp->body = $this->renderView($this->notFoundView, [
'_layout' => $this->layout
]);
});
} | php | public function show404()
{
$this->executeAction = false;
return new Response(function($resp){
$resp->status = 404;
$resp->body = $this->renderView($this->notFoundView, [
'_layout' => $this->layout
]);
});
} | [
"public",
"function",
"show404",
"(",
")",
"{",
"$",
"this",
"->",
"executeAction",
"=",
"false",
";",
"return",
"new",
"Response",
"(",
"function",
"(",
"$",
"resp",
")",
"{",
"$",
"resp",
"->",
"status",
"=",
"404",
";",
"$",
"resp",
"->",
"body",
... | Sets the response to a 404 Not Found | [
"Sets",
"the",
"response",
"to",
"a",
"404",
"Not",
"Found"
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Http/Controller.php#L175-L184 |
240,904 | nirix/radium | src/Http/Controller.php | Controller.addFilter | protected function addFilter($when, $action, $callback)
{
if (!is_callable($callback) && !is_array($callback)) {
$callback = [$this, $callback];
}
if (is_array($action)) {
foreach ($action as $method) {
$this->addFilter($when, $method, $callback);
... | php | protected function addFilter($when, $action, $callback)
{
if (!is_callable($callback) && !is_array($callback)) {
$callback = [$this, $callback];
}
if (is_array($action)) {
foreach ($action as $method) {
$this->addFilter($when, $method, $callback);
... | [
"protected",
"function",
"addFilter",
"(",
"$",
"when",
",",
"$",
"action",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
"&&",
"!",
"is_array",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"callback",
"=",
... | Adds the filter to the event dispatcher.
@param string $when Either 'before' or 'after'
@param string $action
@param mixed $callback | [
"Adds",
"the",
"filter",
"to",
"the",
"event",
"dispatcher",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Http/Controller.php#L222-L235 |
240,905 | onesimus-systems/oslogger | src/Logger.php | Logger.addAdaptor | public function addAdaptor(AbstractAdaptor $adaptor)
{
// The key will be the adaptor's name or the next numerical
// count if a name is blank
$adaptorName = $adaptor->getName() ?: $this->adaptorCount;
$this->adaptors[$adaptorName] = $adaptor;
$this->adaptorCount++;
} | php | public function addAdaptor(AbstractAdaptor $adaptor)
{
// The key will be the adaptor's name or the next numerical
// count if a name is blank
$adaptorName = $adaptor->getName() ?: $this->adaptorCount;
$this->adaptors[$adaptorName] = $adaptor;
$this->adaptorCount++;
} | [
"public",
"function",
"addAdaptor",
"(",
"AbstractAdaptor",
"$",
"adaptor",
")",
"{",
"// The key will be the adaptor's name or the next numerical",
"// count if a name is blank",
"$",
"adaptorName",
"=",
"$",
"adaptor",
"->",
"getName",
"(",
")",
"?",
":",
"$",
"this",... | Add an adaptor to write logs
@param AbstractAdaptor $adaptor Adaptor to add to list | [
"Add",
"an",
"adaptor",
"to",
"write",
"logs"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/Logger.php#L64-L71 |
240,906 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferController.php | StockTransferController.showAction | public function showAction(StockTransfer $stocktransfer)
{
$editForm = $this->createForm(new StockTransferType(), $stocktransfer, array(
'action' => $this->generateUrl('stock_transfers_update', array('id' => $stocktransfer->getid())),
'method' => 'PUT',
));
$deleteFor... | php | public function showAction(StockTransfer $stocktransfer)
{
$editForm = $this->createForm(new StockTransferType(), $stocktransfer, array(
'action' => $this->generateUrl('stock_transfers_update', array('id' => $stocktransfer->getid())),
'method' => 'PUT',
));
$deleteFor... | [
"public",
"function",
"showAction",
"(",
"StockTransfer",
"$",
"stocktransfer",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockTransferType",
"(",
")",
",",
"$",
"stocktransfer",
",",
"array",
"(",
"'action'",
"=>",
"$",
... | Finds and displays a StockTransfer entity.
@Route("/{id}/show", name="stock_transfers_show", requirements={"id"="\d+"})
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"StockTransfer",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferController.php#L49-L64 |
240,907 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferController.php | StockTransferController.newAction | public function newAction()
{
$stocktransfer = new StockTransfer();
$nextCode = $this->get('flower.stock.service.stock_transfer')->getNextCode();
$stocktransfer->setCode($nextCode);
$stocktransfer->setUser($this->getUser());
$form = $this->createForm(new StockTransferType()... | php | public function newAction()
{
$stocktransfer = new StockTransfer();
$nextCode = $this->get('flower.stock.service.stock_transfer')->getNextCode();
$stocktransfer->setCode($nextCode);
$stocktransfer->setUser($this->getUser());
$form = $this->createForm(new StockTransferType()... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"stocktransfer",
"=",
"new",
"StockTransfer",
"(",
")",
";",
"$",
"nextCode",
"=",
"$",
"this",
"->",
"get",
"(",
"'flower.stock.service.stock_transfer'",
")",
"->",
"getNextCode",
"(",
")",
";",
"$",
... | Displays a form to create a new StockTransfer entity.
@Route("/new", name="stock_transfers_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"StockTransfer",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferController.php#L73-L87 |
240,908 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferController.php | StockTransferController.createAction | public function createAction(Request $request)
{
$stocktransfer = new StockTransfer();
$stocktransfer->setUser($this->getUser());
$form = $this->createForm(new StockTransferType(), $stocktransfer);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine(... | php | public function createAction(Request $request)
{
$stocktransfer = new StockTransfer();
$stocktransfer->setUser($this->getUser());
$form = $this->createForm(new StockTransferType(), $stocktransfer);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine(... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"stocktransfer",
"=",
"new",
"StockTransfer",
"(",
")",
";",
"$",
"stocktransfer",
"->",
"setUser",
"(",
"$",
"this",
"->",
"getUser",
"(",
")",
")",
";",
"$",
"form",
... | Creates a new StockTransfer entity.
@Route("/create", name="stock_transfers_create")
@Method("POST")
@Template("FlowerStockBundle:StockTransfer:new.html.twig") | [
"Creates",
"a",
"new",
"StockTransfer",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferController.php#L96-L113 |
240,909 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/StockTransferController.php | StockTransferController.updateAction | public function updateAction(StockTransfer $stocktransfer, Request $request)
{
$editForm = $this->createForm(new StockTransferType(), $stocktransfer, array(
'action' => $this->generateUrl('stock_transfers_update', array('id' => $stocktransfer->getid())),
'method' => 'PUT',
))... | php | public function updateAction(StockTransfer $stocktransfer, Request $request)
{
$editForm = $this->createForm(new StockTransferType(), $stocktransfer, array(
'action' => $this->generateUrl('stock_transfers_update', array('id' => $stocktransfer->getid())),
'method' => 'PUT',
))... | [
"public",
"function",
"updateAction",
"(",
"StockTransfer",
"$",
"stocktransfer",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"StockTransferType",
"(",
")",
",",
"$",
"stocktransfer",
",",
"arr... | Edits an existing StockTransfer entity.
@Route("/{id}/update", name="stock_transfers_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowerStockBundle:StockTransfer:edit.html.twig") | [
"Edits",
"an",
"existing",
"StockTransfer",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/StockTransferController.php#L144-L162 |
240,910 | asbsoft/yii2module-users_0_170112 | controllers/AdminController.php | AdminController.actionChangeStatus | public function actionChangeStatus($id, $value)
{
$model = $this->findModel($id);
if (empty($model)) {
Yii::$app->session->setFlash('error', Yii::t($this->tcModule, 'User {id} not found.', ['id' => $id]));
} else {
$model->status = $value;
$model->pageSize... | php | public function actionChangeStatus($id, $value)
{
$model = $this->findModel($id);
if (empty($model)) {
Yii::$app->session->setFlash('error', Yii::t($this->tcModule, 'User {id} not found.', ['id' => $id]));
} else {
$model->status = $value;
$model->pageSize... | [
"public",
"function",
"actionChangeStatus",
"(",
"$",
"id",
",",
"$",
"value",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"model",
")",
")",
"{",
"Yii",
"::",
"$",
"app",
... | Change status of user.
@param integer $id
@param integer $value
@return mixed | [
"Change",
"status",
"of",
"user",
"."
] | 3906fdde2d5fdd54637f2b5246d52fe91ec5f648 | https://github.com/asbsoft/yii2module-users_0_170112/blob/3906fdde2d5fdd54637f2b5246d52fe91ec5f648/controllers/AdminController.php#L202-L229 |
240,911 | flowcode/ceibo | src/flowcode/ceibo/domain/Mapper.php | Mapper.getRelation | public function getRelation($relationName) {
$relationInstance = null;
if (isset($this->relations[$relationName])) {
$relationInstance = $this->relations[$relationName];
}
return $relationInstance;
} | php | public function getRelation($relationName) {
$relationInstance = null;
if (isset($this->relations[$relationName])) {
$relationInstance = $this->relations[$relationName];
}
return $relationInstance;
} | [
"public",
"function",
"getRelation",
"(",
"$",
"relationName",
")",
"{",
"$",
"relationInstance",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"relations",
"[",
"$",
"relationName",
"]",
")",
")",
"{",
"$",
"relationInstance",
"=",
"$",
... | Get a relation bby its name.
@param string $relationName
@return Relation | [
"Get",
"a",
"relation",
"bby",
"its",
"name",
"."
] | ba264dc681a9d803885fd35d10b0e37776f66659 | https://github.com/flowcode/ceibo/blob/ba264dc681a9d803885fd35d10b0e37776f66659/src/flowcode/ceibo/domain/Mapper.php#L101-L107 |
240,912 | flowcode/ceibo | src/flowcode/ceibo/domain/Mapper.php | Mapper.getFilter | public function getFilter($filtername) {
$filter = null;
if (!is_null($this->filters) && isset($this->filters[$filtername])) {
$filter = $this->filters[$filtername];
}
return $filter;
} | php | public function getFilter($filtername) {
$filter = null;
if (!is_null($this->filters) && isset($this->filters[$filtername])) {
$filter = $this->filters[$filtername];
}
return $filter;
} | [
"public",
"function",
"getFilter",
"(",
"$",
"filtername",
")",
"{",
"$",
"filter",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"filters",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"filters",
"[",
"$",
"filtername",
"]",
... | Return the filter or null.
@param String $filtername
@return Filter $filter. | [
"Return",
"the",
"filter",
"or",
"null",
"."
] | ba264dc681a9d803885fd35d10b0e37776f66659 | https://github.com/flowcode/ceibo/blob/ba264dc681a9d803885fd35d10b0e37776f66659/src/flowcode/ceibo/domain/Mapper.php#L122-L128 |
240,913 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.getEntityNameFromClassName | public static function getEntityNameFromClassName(string $className)
{
$entityName = constant(sprintf(self::ENTITY_NAME_CONST_FORMAT, $className));
if ($entityName === AbstractEntity::ENTITY_NAME or !is_string($entityName)) {
throw new NoEntityNameException($className);
}
... | php | public static function getEntityNameFromClassName(string $className)
{
$entityName = constant(sprintf(self::ENTITY_NAME_CONST_FORMAT, $className));
if ($entityName === AbstractEntity::ENTITY_NAME or !is_string($entityName)) {
throw new NoEntityNameException($className);
}
... | [
"public",
"static",
"function",
"getEntityNameFromClassName",
"(",
"string",
"$",
"className",
")",
"{",
"$",
"entityName",
"=",
"constant",
"(",
"sprintf",
"(",
"self",
"::",
"ENTITY_NAME_CONST_FORMAT",
",",
"$",
"className",
")",
")",
";",
"if",
"(",
"$",
... | Gets an entity name from an entity class name if it provides an ENTITY_NAME constant
@param string $className
@return string | [
"Gets",
"an",
"entity",
"name",
"from",
"an",
"entity",
"class",
"name",
"if",
"it",
"provides",
"an",
"ENTITY_NAME",
"constant"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L83-L92 |
240,914 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.loadRegistries | public function loadRegistries()
{
$registries = $this->registryFactory->getDefaultRegistries();
foreach ($registries as $registry) {
$this->addRegistry($registry);
}
} | php | public function loadRegistries()
{
$registries = $this->registryFactory->getDefaultRegistries();
foreach ($registries as $registry) {
$this->addRegistry($registry);
}
} | [
"public",
"function",
"loadRegistries",
"(",
")",
"{",
"$",
"registries",
"=",
"$",
"this",
"->",
"registryFactory",
"->",
"getDefaultRegistries",
"(",
")",
";",
"foreach",
"(",
"$",
"registries",
"as",
"$",
"registry",
")",
"{",
"$",
"this",
"->",
"addReg... | Loads the registries | [
"Loads",
"the",
"registries"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L144-L151 |
240,915 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.getEntityName | public function getEntityName()
{
if (is_null($this->entityName)) {
$this->entityName = self::getEntityNameFromClassName($this->getEntityClass());
}
return $this->entityName;
} | php | public function getEntityName()
{
if (is_null($this->entityName)) {
$this->entityName = self::getEntityNameFromClassName($this->getEntityClass());
}
return $this->entityName;
} | [
"public",
"function",
"getEntityName",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"entityName",
")",
")",
"{",
"$",
"this",
"->",
"entityName",
"=",
"self",
"::",
"getEntityNameFromClassName",
"(",
"$",
"this",
"->",
"getEntityClass",
"("... | Gets the entity name
@return string | [
"Gets",
"the",
"entity",
"name"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L158-L165 |
240,916 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.findById | public function findById(int $id)
{
$entity = null;
for ($i = 0; $i < count($this->registries); $i++) {
/** @var RegistryInterface $registry */
$registry = $this->registries[ $i ];
$entity = $registry->findByKey($id);
if ($entity instanceof AbstractE... | php | public function findById(int $id)
{
$entity = null;
for ($i = 0; $i < count($this->registries); $i++) {
/** @var RegistryInterface $registry */
$registry = $this->registries[ $i ];
$entity = $registry->findByKey($id);
if ($entity instanceof AbstractE... | [
"public",
"function",
"findById",
"(",
"int",
"$",
"id",
")",
"{",
"$",
"entity",
"=",
"null",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"registries",
")",
";",
"$",
"i",
"++",
")",
"{",
"/** @v... | Finds an entity by its id
@param int $id
@return AbstractEntity|null | [
"Finds",
"an",
"entity",
"by",
"its",
"id"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L237-L253 |
240,917 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.findByIds | public function findByIds(array $ids)
{
$entities = [];
for ($i = 0; $i < count($this->registries); $i++) {
/** @var RegistryInterface $registry */
$registry = $this->registries[ $i ];
$found = $registry->findByKeys($ids);
$entities = array_merge($ent... | php | public function findByIds(array $ids)
{
$entities = [];
for ($i = 0; $i < count($this->registries); $i++) {
/** @var RegistryInterface $registry */
$registry = $this->registries[ $i ];
$found = $registry->findByKeys($ids);
$entities = array_merge($ent... | [
"public",
"function",
"findByIds",
"(",
"array",
"$",
"ids",
")",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"registries",
")",
";",
"$",
"i",
"++",
")",
"{",... | Finds a list of entities by their ids
@param array $ids
@return array | [
"Finds",
"a",
"list",
"of",
"entities",
"by",
"their",
"ids"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L262-L280 |
240,918 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.findOneBy | public function findOneBy(array $criteria = [], array $orders = [], $offset = null): ?AbstractEntity
{
$array = $this->findBy($criteria, $orders, 1, $offset);
return array_shift($array);
} | php | public function findOneBy(array $criteria = [], array $orders = [], $offset = null): ?AbstractEntity
{
$array = $this->findBy($criteria, $orders, 1, $offset);
return array_shift($array);
} | [
"public",
"function",
"findOneBy",
"(",
"array",
"$",
"criteria",
"=",
"[",
"]",
",",
"array",
"$",
"orders",
"=",
"[",
"]",
",",
"$",
"offset",
"=",
"null",
")",
":",
"?",
"AbstractEntity",
"{",
"$",
"array",
"=",
"$",
"this",
"->",
"findBy",
"(",... | Finds one entity from criteria
@param array $criteria
@param array $orders
@param null $offset
@return AbstractEntity | [
"Finds",
"one",
"entity",
"from",
"criteria"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L323-L328 |
240,919 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.matching | public function matching(Criteria $criteria): array
{
$queryBuilder = $this->entityManager->createQueryBuilder()
->select('e.id')
->from($this->getEntityName(), 'e');
$queryBuilder->addCriteria($criteria);
$ids = $queryBuilder->getQuery()->getResult(ColumnHydrator::... | php | public function matching(Criteria $criteria): array
{
$queryBuilder = $this->entityManager->createQueryBuilder()
->select('e.id')
->from($this->getEntityName(), 'e');
$queryBuilder->addCriteria($criteria);
$ids = $queryBuilder->getQuery()->getResult(ColumnHydrator::... | [
"public",
"function",
"matching",
"(",
"Criteria",
"$",
"criteria",
")",
":",
"array",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"createQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'e.id'",
")",
"->",
"from",
"(",
"$",
"t... | Gets all entities matching query criteria
@param Criteria $criteria
@return array | [
"Gets",
"all",
"entities",
"matching",
"query",
"criteria"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L337-L352 |
240,920 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.getEntityRepository | public function getEntityRepository()
{
$repository = $this->entityManager->getRepository($this->getEntityName());
if (!($repository instanceof EntityRepository)) {
throw new InvalidEntityNameException($this->getEntityName(), $this->getEntityClass());
}
return $reposito... | php | public function getEntityRepository()
{
$repository = $this->entityManager->getRepository($this->getEntityName());
if (!($repository instanceof EntityRepository)) {
throw new InvalidEntityNameException($this->getEntityName(), $this->getEntityClass());
}
return $reposito... | [
"public",
"function",
"getEntityRepository",
"(",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"getEntityName",
"(",
")",
")",
";",
"if",
"(",
"!",
"(",
"$",
"repository",
"instanceof"... | Gets the doctrine's entity repository for the entity
@return \Doctrine\ORM\EntityRepository | [
"Gets",
"the",
"doctrine",
"s",
"entity",
"repository",
"for",
"the",
"entity"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L359-L368 |
240,921 | Thuata/FrameworkBundle | Repository/AbstractRepository.php | AbstractRepository.updateRegistries | private function updateRegistries($entities, $from)
{
if (count($entities) >= 0) {
for ($j = $from; $j >= 0; $j--) {
/** @var RegistryInterface $registry */
$registry = $this->registries[ $j ];
/** @var AbstractEntity $entity */
for... | php | private function updateRegistries($entities, $from)
{
if (count($entities) >= 0) {
for ($j = $from; $j >= 0; $j--) {
/** @var RegistryInterface $registry */
$registry = $this->registries[ $j ];
/** @var AbstractEntity $entity */
for... | [
"private",
"function",
"updateRegistries",
"(",
"$",
"entities",
",",
"$",
"from",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"entities",
")",
">=",
"0",
")",
"{",
"for",
"(",
"$",
"j",
"=",
"$",
"from",
";",
"$",
"j",
">=",
"0",
";",
"$",
"j",
... | Updates the registries
@param array $entities
@param int $from | [
"Updates",
"the",
"registries"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/AbstractRepository.php#L376-L388 |
240,922 | arnold-almeida/UIKit | src/Almeida/UIKit/Lib/Base.php | Base.render | public function render()
{
$args = func_get_args();
foreach ($args as $arg) {
if(isset($this->output[$arg])) {
return $this->output[$arg];
}
throw new Exception("{$arg} is not set!", 1);
}
} | php | public function render()
{
$args = func_get_args();
foreach ($args as $arg) {
if(isset($this->output[$arg])) {
return $this->output[$arg];
}
throw new Exception("{$arg} is not set!", 1);
}
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"arg",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"output",
"[",
"$",
"arg",
"]",
")",
")",
"{",... | Render compiled HTML | [
"Render",
"compiled",
"HTML"
] | cc52f46df011ec2f3676245c90c376da20c40e41 | https://github.com/arnold-almeida/UIKit/blob/cc52f46df011ec2f3676245c90c376da20c40e41/src/Almeida/UIKit/Lib/Base.php#L65-L76 |
240,923 | popy-dev/popy-calendar | src/Parser/ResultMapper/Chain.php | Chain.addMapper | public function addMapper(ResultMapperInterface $mapper)
{
if ($mapper instanceof self) {
return $this->addMappers($mapper->mappers);
}
$this->mappers[] = $mapper;
return $this;
} | php | public function addMapper(ResultMapperInterface $mapper)
{
if ($mapper instanceof self) {
return $this->addMappers($mapper->mappers);
}
$this->mappers[] = $mapper;
return $this;
} | [
"public",
"function",
"addMapper",
"(",
"ResultMapperInterface",
"$",
"mapper",
")",
"{",
"if",
"(",
"$",
"mapper",
"instanceof",
"self",
")",
"{",
"return",
"$",
"this",
"->",
"addMappers",
"(",
"$",
"mapper",
"->",
"mappers",
")",
";",
"}",
"$",
"this"... | Adds a Mapper to the chain.
@param ResultMapperInterface $mapper | [
"Adds",
"a",
"Mapper",
"to",
"the",
"chain",
"."
] | 989048be18451c813cfce926229c6aaddd1b0639 | https://github.com/popy-dev/popy-calendar/blob/989048be18451c813cfce926229c6aaddd1b0639/src/Parser/ResultMapper/Chain.php#L36-L45 |
240,924 | zerospam/sdk-framework | src/Request/Api/HasNullableFields.php | HasNullableFields.isValueChanged | public function isValueChanged($field)
{
if (!$this->IsNullable($field)) {
return false;
}
return isset($this->nullableChanged[$field]);
} | php | public function isValueChanged($field)
{
if (!$this->IsNullable($field)) {
return false;
}
return isset($this->nullableChanged[$field]);
} | [
"public",
"function",
"isValueChanged",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"IsNullable",
"(",
"$",
"field",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
"->",
"nullableChanged",
"[",
"$... | Check if the given field is nullable and if it should be included in the request
@param $field
@return bool
@internal param $value | [
"Check",
"if",
"the",
"given",
"field",
"is",
"nullable",
"and",
"if",
"it",
"should",
"be",
"included",
"in",
"the",
"request"
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Request/Api/HasNullableFields.php#L40-L47 |
240,925 | zerospam/sdk-framework | src/Request/Api/HasNullableFields.php | HasNullableFields.nullableChanged | protected function nullableChanged($field = null)
{
if (!$field) {
$function = debug_backtrace()[1]['function'];
$field = lcfirst(substr($function, 3));
}
$this->nullableChanged[$field] = true;
} | php | protected function nullableChanged($field = null)
{
if (!$field) {
$function = debug_backtrace()[1]['function'];
$field = lcfirst(substr($function, 3));
}
$this->nullableChanged[$field] = true;
} | [
"protected",
"function",
"nullableChanged",
"(",
"$",
"field",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"field",
")",
"{",
"$",
"function",
"=",
"debug_backtrace",
"(",
")",
"[",
"1",
"]",
"[",
"'function'",
"]",
";",
"$",
"field",
"=",
"lcfirst",... | Trigger the fact the nullable changed
@param null $field | [
"Trigger",
"the",
"fact",
"the",
"nullable",
"changed"
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Request/Api/HasNullableFields.php#L54-L62 |
240,926 | vinala/kernel | src/Database/Database.php | Database.newConnection | public function newConnection($host, $database, $user, $password)
{
return self::$driver->connect($host, $database, $user, $password);
} | php | public function newConnection($host, $database, $user, $password)
{
return self::$driver->connect($host, $database, $user, $password);
} | [
"public",
"function",
"newConnection",
"(",
"$",
"host",
",",
"$",
"database",
",",
"$",
"user",
",",
"$",
"password",
")",
"{",
"return",
"self",
"::",
"$",
"driver",
"->",
"connect",
"(",
"$",
"host",
",",
"$",
"database",
",",
"$",
"user",
",",
... | Connect to another driver database server.
@param string, string, string, string
@return PDO | [
"Connect",
"to",
"another",
"driver",
"database",
"server",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Database.php#L109-L112 |
240,927 | gibboncms/gibbon | src/Filesystems/FileCache.php | FileCache.persist | public function persist()
{
$parts = explode('/', $this->file);
array_pop($parts);
$dir = implode('/', $parts);
if (!is_dir($dir)) {
mkdir($dir, 493, true);
}
return file_put_contents($this->file, serialize($this->data));
} | php | public function persist()
{
$parts = explode('/', $this->file);
array_pop($parts);
$dir = implode('/', $parts);
if (!is_dir($dir)) {
mkdir($dir, 493, true);
}
return file_put_contents($this->file, serialize($this->data));
} | [
"public",
"function",
"persist",
"(",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"file",
")",
";",
"array_pop",
"(",
"$",
"parts",
")",
";",
"$",
"dir",
"=",
"implode",
"(",
"'/'",
",",
"$",
"parts",
")",
";",
"... | Persist the cache data
@return bool | [
"Persist",
"the",
"cache",
"data"
] | 2905e90b2902149b3358b385264e98b97cf4fc00 | https://github.com/gibboncms/gibbon/blob/2905e90b2902149b3358b385264e98b97cf4fc00/src/Filesystems/FileCache.php#L92-L104 |
240,928 | gibboncms/gibbon | src/Filesystems/FileCache.php | FileCache.rebuild | public function rebuild()
{
if (file_exists($this->file)) {
try {
$this->data = unserialize(file_get_contents($this->file));
return true;
} catch (\Exception $e) {
// Try just used to suppress the exception. If the cache is corrupted we... | php | public function rebuild()
{
if (file_exists($this->file)) {
try {
$this->data = unserialize(file_get_contents($this->file));
return true;
} catch (\Exception $e) {
// Try just used to suppress the exception. If the cache is corrupted we... | [
"public",
"function",
"rebuild",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"data",
"=",
"unserialize",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"file",
")",
")",
... | Try to unserialize the existing cache, if it's corrupted, it's lost, let it go.
@return bool | [
"Try",
"to",
"unserialize",
"the",
"existing",
"cache",
"if",
"it",
"s",
"corrupted",
"it",
"s",
"lost",
"let",
"it",
"go",
"."
] | 2905e90b2902149b3358b385264e98b97cf4fc00 | https://github.com/gibboncms/gibbon/blob/2905e90b2902149b3358b385264e98b97cf4fc00/src/Filesystems/FileCache.php#L111-L125 |
240,929 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Asset/IconsBuilder.php | IconsBuilder.build | public function build($basePath)
{
$cache = new PuliResourceCollectionCache($this->cacheDir.'gui-icons.css', $this->debug);
$resources = $this->resourceFinder->findByType('phlexible/icons');
if (!$cache->isFresh($resources)) {
$content = $this->buildIcons($resources, $basePath)... | php | public function build($basePath)
{
$cache = new PuliResourceCollectionCache($this->cacheDir.'gui-icons.css', $this->debug);
$resources = $this->resourceFinder->findByType('phlexible/icons');
if (!$cache->isFresh($resources)) {
$content = $this->buildIcons($resources, $basePath)... | [
"public",
"function",
"build",
"(",
"$",
"basePath",
")",
"{",
"$",
"cache",
"=",
"new",
"PuliResourceCollectionCache",
"(",
"$",
"this",
"->",
"cacheDir",
".",
"'gui-icons.css'",
",",
"$",
"this",
"->",
"debug",
")",
";",
"$",
"resources",
"=",
"$",
"th... | Get all Stylesheets for the given section.
@param string $basePath
@return Asset | [
"Get",
"all",
"Stylesheets",
"for",
"the",
"given",
"section",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Asset/IconsBuilder.php#L72-L89 |
240,930 | budkit/budkit-framework | src/Budkit/Parameter/Factory.php | Factory.getParameterListAsObject | public function getParameterListAsObject($name, $delimiter = ";")
{
$parameter = $this->getValidParameterOfType($name, "string");
$list = preg_split('/\s*(?:,*("[^"]+"),*|,*(\'[^\']+\'),*|,+)\s*/', $parameter, null,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
//if emptypara... | php | public function getParameterListAsObject($name, $delimiter = ";")
{
$parameter = $this->getValidParameterOfType($name, "string");
$list = preg_split('/\s*(?:,*("[^"]+"),*|,*(\'[^\']+\'),*|,+)\s*/', $parameter, null,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
//if emptypara... | [
"public",
"function",
"getParameterListAsObject",
"(",
"$",
"name",
",",
"$",
"delimiter",
"=",
"\";\"",
")",
"{",
"$",
"parameter",
"=",
"$",
"this",
"->",
"getValidParameterOfType",
"(",
"$",
"name",
",",
"\"string\"",
")",
";",
"$",
"list",
"=",
"preg_s... | Get a comma seperated list of params as a Parameter object;
e.g key1=value1;q=0.31,key2=value2....
@param $name | [
"Get",
"a",
"comma",
"seperated",
"list",
"of",
"params",
"as",
"a",
"Parameter",
"object",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Parameter/Factory.php#L56-L97 |
240,931 | strident/Trident | src/Trident/Component/Debug/Toolbar/Toolbar.php | Toolbar.removeExtension | public function removeExtension($name)
{
if (isset($this->extensions[$name])) {
unset($this->extensions[$name]);
}
return $this;
} | php | public function removeExtension($name)
{
if (isset($this->extensions[$name])) {
unset($this->extensions[$name]);
}
return $this;
} | [
"public",
"function",
"removeExtension",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"extensions",
"[",
"$",
"name",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"extensions",
"[",
"$",
"name",
"]",
")",
";",
"... | Remove an extension.
@param string $name
@return Toolbar | [
"Remove",
"an",
"extension",
"."
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Component/Debug/Toolbar/Toolbar.php#L82-L89 |
240,932 | iRAP-software/package-core-libs | src/Core.php | Core.javascriptRedirectUser | public static function javascriptRedirectUser($url, $numSeconds = 0)
{
$htmlString = '';
$htmlString .=
"<script type='text/javascript'>" .
"var redirectTime=" . $numSeconds * 1000 . ";" . PHP_EOL .
"var redirectURL='" . $url . "';" . PHP_EOL... | php | public static function javascriptRedirectUser($url, $numSeconds = 0)
{
$htmlString = '';
$htmlString .=
"<script type='text/javascript'>" .
"var redirectTime=" . $numSeconds * 1000 . ";" . PHP_EOL .
"var redirectURL='" . $url . "';" . PHP_EOL... | [
"public",
"static",
"function",
"javascriptRedirectUser",
"(",
"$",
"url",
",",
"$",
"numSeconds",
"=",
"0",
")",
"{",
"$",
"htmlString",
"=",
"''",
";",
"$",
"htmlString",
".=",
"\"<script type='text/javascript'>\"",
".",
"\"var redirectTime=\"",
".",
"$",
"num... | Allows us to re-direct the user using javascript when headers have
already been submitted.
@param string url that we want to re-direct the user to.
@param int numSeconds - optional integer specifying the number of
seconds to delay.
@return htmlString - the html to print out in order to redirect the user. | [
"Allows",
"us",
"to",
"re",
"-",
"direct",
"the",
"user",
"using",
"javascript",
"when",
"headers",
"have",
"already",
"been",
"submitted",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L116-L128 |
240,933 | iRAP-software/package-core-libs | src/Core.php | Core.setCliTitle | public static function setCliTitle($nameingPrefix)
{
$succeeded = false;
$num_running = self::getNumProcRunning($nameingPrefix);
if (function_exists('cli_set_process_title'))
{
cli_set_process_title($nameingPrefix . $num_running);
$succeeded = true;
... | php | public static function setCliTitle($nameingPrefix)
{
$succeeded = false;
$num_running = self::getNumProcRunning($nameingPrefix);
if (function_exists('cli_set_process_title'))
{
cli_set_process_title($nameingPrefix . $num_running);
$succeeded = true;
... | [
"public",
"static",
"function",
"setCliTitle",
"(",
"$",
"nameingPrefix",
")",
"{",
"$",
"succeeded",
"=",
"false",
";",
"$",
"num_running",
"=",
"self",
"::",
"getNumProcRunning",
"(",
"$",
"nameingPrefix",
")",
";",
"if",
"(",
"function_exists",
"(",
"'cli... | Sets the title of the process and will append the appropriate number of
already existing processes with the same title.
WARNING - this will fail and return FALSE if you are on Windows
@param string $nameingPrefix - the name to give the process.
@return boolean - true if successfully set the title, false if not. | [
"Sets",
"the",
"title",
"of",
"the",
"process",
"and",
"will",
"append",
"the",
"appropriate",
"number",
"of",
"already",
"existing",
"processes",
"with",
"the",
"same",
"title",
".",
"WARNING",
"-",
"this",
"will",
"fail",
"and",
"return",
"FALSE",
"if",
... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L138-L150 |
240,934 | iRAP-software/package-core-libs | src/Core.php | Core.sendApiRequest | public static function sendApiRequest($url, array $parameters, $requestType="POST", $headers=array())
{
$allowedRequestTypes = array("GET", "POST", "PUT", "PATCH", "DELETE");
$requestTypeUpper = strtoupper($requestType);
if (!in_array($requestTypeUpper, $allowedRequestTypes))
... | php | public static function sendApiRequest($url, array $parameters, $requestType="POST", $headers=array())
{
$allowedRequestTypes = array("GET", "POST", "PUT", "PATCH", "DELETE");
$requestTypeUpper = strtoupper($requestType);
if (!in_array($requestTypeUpper, $allowedRequestTypes))
... | [
"public",
"static",
"function",
"sendApiRequest",
"(",
"$",
"url",
",",
"array",
"$",
"parameters",
",",
"$",
"requestType",
"=",
"\"POST\"",
",",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"$",
"allowedRequestTypes",
"=",
"array",
"(",
"\"GET\"",
... | Sends an api request through the use of CURL
@param string url - the url where the api is located.
@param array parameters - name value pairs for sending to the api server
@param string $requestType - the request type. One of GET, POST, PUT, PATCH or DELETE
@param array $headers - name/value pairs for headers. Useful f... | [
"Sends",
"an",
"api",
"request",
"through",
"the",
"use",
"of",
"CURL"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L190-L275 |
240,935 | iRAP-software/package-core-libs | src/Core.php | Core.sendGetRequest | public static function sendGetRequest($url, array $parameters=array(), $arrayForm=false)
{
if (count($parameters) > 0)
{
$query_string = http_build_query($parameters, '', '&');
$url .= $query_string;
}
# Get cURL resource
$curl = curl_init();
... | php | public static function sendGetRequest($url, array $parameters=array(), $arrayForm=false)
{
if (count($parameters) > 0)
{
$query_string = http_build_query($parameters, '', '&');
$url .= $query_string;
}
# Get cURL resource
$curl = curl_init();
... | [
"public",
"static",
"function",
"sendGetRequest",
"(",
"$",
"url",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"arrayForm",
"=",
"false",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
">",
"0",
")",
"{",
"$",
"qu... | Sends a GET request to a RESTful API through cURL.
@param string url - the url where the api is located.
@param array parameters - optional array of name value pairs for sending to
the RESTful API.
@param bool arrayForm - optional - set to true to return an array instead of
a stdClass object.
@return stdObject - json... | [
"Sends",
"a",
"GET",
"request",
"to",
"a",
"RESTful",
"API",
"through",
"cURL",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L289-L324 |
240,936 | iRAP-software/package-core-libs | src/Core.php | Core.fetchArgs | public static function fetchArgs(array $reqArgs, array $optionalArgs)
{
$values = self::fetchReqArgs($reqArgs);
$values = array_merge($values, self::fetchOptionalArgs($optionalArgs));
return $values;
} | php | public static function fetchArgs(array $reqArgs, array $optionalArgs)
{
$values = self::fetchReqArgs($reqArgs);
$values = array_merge($values, self::fetchOptionalArgs($optionalArgs));
return $values;
} | [
"public",
"static",
"function",
"fetchArgs",
"(",
"array",
"$",
"reqArgs",
",",
"array",
"$",
"optionalArgs",
")",
"{",
"$",
"values",
"=",
"self",
"::",
"fetchReqArgs",
"(",
"$",
"reqArgs",
")",
";",
"$",
"values",
"=",
"array_merge",
"(",
"$",
"values"... | Retrieves the specified arguments from REQUEST. This will throw an
exception if a required argument is not present, but not if an optional
argument is not.
@param array reqArgs - required arguments that must exist
@param array optionalArgs - arguments that should be retrieved if exist
@return values - map of argument... | [
"Retrieves",
"the",
"specified",
"arguments",
"from",
"REQUEST",
".",
"This",
"will",
"throw",
"an",
"exception",
"if",
"a",
"required",
"argument",
"is",
"not",
"present",
"but",
"not",
"if",
"an",
"optional",
"argument",
"is",
"not",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L525-L530 |
240,937 | iRAP-software/package-core-libs | src/Core.php | Core.getCurrentUrl | public static function getCurrentUrl()
{
$pageURL = 'http';
if (isset($_SERVER["HTTPS"]))
{
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{
$pageURL .= $_SERVER["SERVER_NAME"] . ":" .
... | php | public static function getCurrentUrl()
{
$pageURL = 'http';
if (isset($_SERVER["HTTPS"]))
{
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{
$pageURL .= $_SERVER["SERVER_NAME"] . ":" .
... | [
"public",
"static",
"function",
"getCurrentUrl",
"(",
")",
"{",
"$",
"pageURL",
"=",
"'http'",
";",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"\"HTTPS\"",
"]",
")",
")",
"{",
"$",
"pageURL",
".=",
"\"s\"",
";",
"}",
"$",
"pageURL",
".=",
"\"://\"... | Builds url of the current page, excluding any ?=&stuff,
@param void
@return pageURL - full page url of the current page
e.g. https://www.google.com/some-page | [
"Builds",
"url",
"of",
"the",
"current",
"page",
"excluding",
"any",
"?",
"=",
"&stuff"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L539-L561 |
240,938 | iRAP-software/package-core-libs | src/Core.php | Core.versionGuard | public static function versionGuard($reqVersion, $errMsg='')
{
if (version_compare(PHP_VERSION, $reqVersion) == -1)
{
if ($errMsg == '')
{
$errMsg = 'Required PHP version: ' . $reqVersion .
', current Version: ' . PHP_VERSION;... | php | public static function versionGuard($reqVersion, $errMsg='')
{
if (version_compare(PHP_VERSION, $reqVersion) == -1)
{
if ($errMsg == '')
{
$errMsg = 'Required PHP version: ' . $reqVersion .
', current Version: ' . PHP_VERSION;... | [
"public",
"static",
"function",
"versionGuard",
"(",
"$",
"reqVersion",
",",
"$",
"errMsg",
"=",
"''",
")",
"{",
"if",
"(",
"version_compare",
"(",
"PHP_VERSION",
",",
"$",
"reqVersion",
")",
"==",
"-",
"1",
")",
"{",
"if",
"(",
"$",
"errMsg",
"==",
... | Implement a version guard. This will throw an exception if we do not
have the required version of PHP that is specified.
@param String $reqVersion - required version of php, e.g '5.4.0'
@throws an exception if we do not meet the required php
version. | [
"Implement",
"a",
"version",
"guard",
".",
"This",
"will",
"throw",
"an",
"exception",
"if",
"we",
"do",
"not",
"have",
"the",
"required",
"version",
"of",
"PHP",
"that",
"is",
"specified",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L744-L756 |
240,939 | iRAP-software/package-core-libs | src/Core.php | Core.isPortOpen | public static function isPortOpen($host, $port, $protocol)
{
$protocol = strtolower($protocol);
if ($protocol != 'tcp' && $protocol != 'udp')
{
$errMsg = 'Unrecognized protocol [' . $protocol . '] ' .
'please specify [tcp] or [udp]';
th... | php | public static function isPortOpen($host, $port, $protocol)
{
$protocol = strtolower($protocol);
if ($protocol != 'tcp' && $protocol != 'udp')
{
$errMsg = 'Unrecognized protocol [' . $protocol . '] ' .
'please specify [tcp] or [udp]';
th... | [
"public",
"static",
"function",
"isPortOpen",
"(",
"$",
"host",
",",
"$",
"port",
",",
"$",
"protocol",
")",
"{",
"$",
"protocol",
"=",
"strtolower",
"(",
"$",
"protocol",
")",
";",
"if",
"(",
"$",
"protocol",
"!=",
"'tcp'",
"&&",
"$",
"protocol",
"!... | Checks to see if the specified port is open.
@param string $host - the host to check against.
@param int $port - the port to check
@return $isOpen - true if port is open, false if not. | [
"Checks",
"to",
"see",
"if",
"the",
"specified",
"port",
"is",
"open",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L804-L837 |
240,940 | iRAP-software/package-core-libs | src/Core.php | Core.generateConfig | public static function generateConfig($settings, $variableName, $filePath)
{
$varStr = var_export($settings, true);
$output =
'<?php' . PHP_EOL .
'$' . $variableName . ' = ' . $varStr . ';';
# file_put_contents returns num bytes written or boolean f... | php | public static function generateConfig($settings, $variableName, $filePath)
{
$varStr = var_export($settings, true);
$output =
'<?php' . PHP_EOL .
'$' . $variableName . ' = ' . $varStr . ';';
# file_put_contents returns num bytes written or boolean f... | [
"public",
"static",
"function",
"generateConfig",
"(",
"$",
"settings",
",",
"$",
"variableName",
",",
"$",
"filePath",
")",
"{",
"$",
"varStr",
"=",
"var_export",
"(",
"$",
"settings",
",",
"true",
")",
";",
"$",
"output",
"=",
"'<?php'",
".",
"PHP_EOL"... | Generate a php config file to have the setting provided. This is useful
if we want to be able to update our config file through code, such as a
web ui to upadate settings. Platforms like wordpress allow updating the
settings, but do this through a database.
@param mixed $settings - array or variable that we want ... | [
"Generate",
"a",
"php",
"config",
"file",
"to",
"have",
"the",
"setting",
"provided",
".",
"This",
"is",
"useful",
"if",
"we",
"want",
"to",
"be",
"able",
"to",
"update",
"our",
"config",
"file",
"through",
"code",
"such",
"as",
"a",
"web",
"ui",
"to",... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L910-L926 |
240,941 | iRAP-software/package-core-libs | src/Core.php | Core.generatePasswordHash | public static function generatePasswordHash($rawPassword, $cost=11)
{
$cost = intval($cost);
$cost = self::clampValue($cost, $max=31, $min=4);
# has to be 2 digits, eg. 04
if ($cost < 10)
{
$cost = "0" . $cost;
}
$options = array(... | php | public static function generatePasswordHash($rawPassword, $cost=11)
{
$cost = intval($cost);
$cost = self::clampValue($cost, $max=31, $min=4);
# has to be 2 digits, eg. 04
if ($cost < 10)
{
$cost = "0" . $cost;
}
$options = array(... | [
"public",
"static",
"function",
"generatePasswordHash",
"(",
"$",
"rawPassword",
",",
"$",
"cost",
"=",
"11",
")",
"{",
"$",
"cost",
"=",
"intval",
"(",
"$",
"cost",
")",
";",
"$",
"cost",
"=",
"self",
"::",
"clampValue",
"(",
"$",
"cost",
",",
"$",
... | Converts a raw password into a hash using PHP 5.5's new hashing method
@param String $rawPassword - the password we wish to hash
@param int $cost - The two digit cost parameter is the base-2 logarithm
of the iteration count for the underlying
Blowfish-based hashing algorithmeter and must be in
range 04-31
@return strin... | [
"Converts",
"a",
"raw",
"password",
"into",
"a",
"hash",
"using",
"PHP",
"5",
".",
"5",
"s",
"new",
"hashing",
"method"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L938-L953 |
240,942 | iRAP-software/package-core-libs | src/Core.php | Core.isValidSignedRequest | public static function isValidSignedRequest(array $data, string $signature)
{
$generated_signature = SiteSpecific::generateSignature($data);
return ($generated_signature == $signature);
} | php | public static function isValidSignedRequest(array $data, string $signature)
{
$generated_signature = SiteSpecific::generateSignature($data);
return ($generated_signature == $signature);
} | [
"public",
"static",
"function",
"isValidSignedRequest",
"(",
"array",
"$",
"data",
",",
"string",
"$",
"signature",
")",
"{",
"$",
"generated_signature",
"=",
"SiteSpecific",
"::",
"generateSignature",
"(",
"$",
"data",
")",
";",
"return",
"(",
"$",
"generated... | Check if the provided data has the correct signature.
@param array $data - the data we recieved that was signed. The signature MUST NOT be in this
array.
@param string $signature - the signature that came with the data. This is what we will check
if is valid for the data recieved.
@return bool - true if the signature i... | [
"Check",
"if",
"the",
"provided",
"data",
"has",
"the",
"correct",
"signature",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/Core.php#L1003-L1007 |
240,943 | osflab/view | Helper/Bootstrap/ButtonGroup.php | ButtonGroup.button | public function button(
$label = null,
$url = null,
$status = null,
$icon = null,
$block = false,
$disabled = false,
$flat = false,
$size = Button::SIZE_NORMAL)
{
$button = new Button($la... | php | public function button(
$label = null,
$url = null,
$status = null,
$icon = null,
$block = false,
$disabled = false,
$flat = false,
$size = Button::SIZE_NORMAL)
{
$button = new Button($la... | [
"public",
"function",
"button",
"(",
"$",
"label",
"=",
"null",
",",
"$",
"url",
"=",
"null",
",",
"$",
"status",
"=",
"null",
",",
"$",
"icon",
"=",
"null",
",",
"$",
"block",
"=",
"false",
",",
"$",
"disabled",
"=",
"false",
",",
"$",
"flat",
... | Create a new button
@param string $label
@param string $url
@param string $status
@param string $icon
@param bool $block
@param bool $disabled
@param bool $flat
@param string $size
@return $this | [
"Create",
"a",
"new",
"button"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/ButtonGroup.php#L66-L78 |
240,944 | bfansports/CloudProcessingEngine-SDK | src/SA/CpeSdk/CpeLogger.php | CpeLogger.logOut | public function logOut(
$type,
$source,
$message,
$logKey = null,
$printOut = true)
{
$log = [
"time" => date("Y-m-d H:i:s", time()),
"source" => $source,
"type" => $type,
"message" => $message
];
... | php | public function logOut(
$type,
$source,
$message,
$logKey = null,
$printOut = true)
{
$log = [
"time" => date("Y-m-d H:i:s", time()),
"source" => $source,
"type" => $type,
"message" => $message
];
... | [
"public",
"function",
"logOut",
"(",
"$",
"type",
",",
"$",
"source",
",",
"$",
"message",
",",
"$",
"logKey",
"=",
"null",
",",
"$",
"printOut",
"=",
"true",
")",
"{",
"$",
"log",
"=",
"[",
"\"time\"",
"=>",
"date",
"(",
"\"Y-m-d H:i:s\"",
",",
"t... | Log message to syslog and log file. Will print | [
"Log",
"message",
"to",
"syslog",
"and",
"log",
"file",
".",
"Will",
"print"
] | 8714d088a16c6dd4735df68e17256cc41bba2cfb | https://github.com/bfansports/CloudProcessingEngine-SDK/blob/8714d088a16c6dd4735df68e17256cc41bba2cfb/src/SA/CpeSdk/CpeLogger.php#L44-L105 |
240,945 | bfansports/CloudProcessingEngine-SDK | src/SA/CpeSdk/CpeLogger.php | CpeLogger.printToFile | private function printToFile($log)
{
if (!is_string($log['message']))
$log['message'] = json_encode($log['message']);
$toPrint = $log['time'] . " [" . $log['type'] . "] [" . $log['source'] . "] ";
// If there is a workflow ID. We append it.
if (isset($log['logKey... | php | private function printToFile($log)
{
if (!is_string($log['message']))
$log['message'] = json_encode($log['message']);
$toPrint = $log['time'] . " [" . $log['type'] . "] [" . $log['source'] . "] ";
// If there is a workflow ID. We append it.
if (isset($log['logKey... | [
"private",
"function",
"printToFile",
"(",
"$",
"log",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"log",
"[",
"'message'",
"]",
")",
")",
"$",
"log",
"[",
"'message'",
"]",
"=",
"json_encode",
"(",
"$",
"log",
"[",
"'message'",
"]",
")",
";",... | Write log in file | [
"Write",
"log",
"in",
"file"
] | 8714d088a16c6dd4735df68e17256cc41bba2cfb | https://github.com/bfansports/CloudProcessingEngine-SDK/blob/8714d088a16c6dd4735df68e17256cc41bba2cfb/src/SA/CpeSdk/CpeLogger.php#L108-L129 |
240,946 | novuso/system | src/Type/Enum.php | Enum.fromString | final public static function fromString(string $string): Enum
{
$parts = explode('::', $string);
return self::fromName(end($parts));
} | php | final public static function fromString(string $string): Enum
{
$parts = explode('::', $string);
return self::fromName(end($parts));
} | [
"final",
"public",
"static",
"function",
"fromString",
"(",
"string",
"$",
"string",
")",
":",
"Enum",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'::'",
",",
"$",
"string",
")",
";",
"return",
"self",
"::",
"fromName",
"(",
"end",
"(",
"$",
"parts",
")... | Creates instance from a string representation
@param string $string The string representation
@return Enum
@throws DomainException When the string is invalid | [
"Creates",
"instance",
"from",
"a",
"string",
"representation"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L113-L118 |
240,947 | novuso/system | src/Type/Enum.php | Enum.fromName | final public static function fromName(string $name): Enum
{
$constName = sprintf('%s::%s', static::class, $name);
if (!defined($constName)) {
$message = sprintf('%s is not a member constant of enum %s', $name, static::class);
throw new DomainException($message);
}
... | php | final public static function fromName(string $name): Enum
{
$constName = sprintf('%s::%s', static::class, $name);
if (!defined($constName)) {
$message = sprintf('%s is not a member constant of enum %s', $name, static::class);
throw new DomainException($message);
}
... | [
"final",
"public",
"static",
"function",
"fromName",
"(",
"string",
"$",
"name",
")",
":",
"Enum",
"{",
"$",
"constName",
"=",
"sprintf",
"(",
"'%s::%s'",
",",
"static",
"::",
"class",
",",
"$",
"name",
")",
";",
"if",
"(",
"!",
"defined",
"(",
"$",
... | Creates instance from an enum constant name
@param string $name The enum constant name
@return Enum
@throws DomainException When the name is invalid | [
"Creates",
"instance",
"from",
"an",
"enum",
"constant",
"name"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L129-L139 |
240,948 | novuso/system | src/Type/Enum.php | Enum.fromOrdinal | final public static function fromOrdinal(int $ordinal): Enum
{
$constants = self::getMembers();
$item = array_slice($constants, $ordinal, 1, true);
if (!$item) {
$end = count($constants) - 1;
$message = sprintf('Enum ordinal (%d) out of range [0, %d]', $ordinal, $end... | php | final public static function fromOrdinal(int $ordinal): Enum
{
$constants = self::getMembers();
$item = array_slice($constants, $ordinal, 1, true);
if (!$item) {
$end = count($constants) - 1;
$message = sprintf('Enum ordinal (%d) out of range [0, %d]', $ordinal, $end... | [
"final",
"public",
"static",
"function",
"fromOrdinal",
"(",
"int",
"$",
"ordinal",
")",
":",
"Enum",
"{",
"$",
"constants",
"=",
"self",
"::",
"getMembers",
"(",
")",
";",
"$",
"item",
"=",
"array_slice",
"(",
"$",
"constants",
",",
"$",
"ordinal",
",... | Creates instance from an enum ordinal position
@param int $ordinal The enum ordinal position
@return Enum
@throws DomainException When the ordinal is invalid | [
"Creates",
"instance",
"from",
"an",
"enum",
"ordinal",
"position"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L150-L162 |
240,949 | novuso/system | src/Type/Enum.php | Enum.getMembers | final public static function getMembers(): array
{
if (!isset(self::$constants[static::class])) {
$reflection = new ReflectionClass(static::class);
$constants = self::sortConstants($reflection);
self::guardConstants($constants);
self::$constants[static::class]... | php | final public static function getMembers(): array
{
if (!isset(self::$constants[static::class])) {
$reflection = new ReflectionClass(static::class);
$constants = self::sortConstants($reflection);
self::guardConstants($constants);
self::$constants[static::class]... | [
"final",
"public",
"static",
"function",
"getMembers",
"(",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"constants",
"[",
"static",
"::",
"class",
"]",
")",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
... | Retrieves enum member names and values
@return array
@throws DomainException When more than one constant has the same value | [
"Retrieves",
"enum",
"member",
"names",
"and",
"values"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L171-L181 |
240,950 | novuso/system | src/Type/Enum.php | Enum.name | final public function name(): string
{
if ($this->name === null) {
$constants = self::getMembers();
$this->name = array_search($this->value, $constants, true);
}
return $this->name;
} | php | final public function name(): string
{
if ($this->name === null) {
$constants = self::getMembers();
$this->name = array_search($this->value, $constants, true);
}
return $this->name;
} | [
"final",
"public",
"function",
"name",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"name",
"===",
"null",
")",
"{",
"$",
"constants",
"=",
"self",
"::",
"getMembers",
"(",
")",
";",
"$",
"this",
"->",
"name",
"=",
"array_search",
"(... | Retrieves the enum constant name
@return string | [
"Retrieves",
"the",
"enum",
"constant",
"name"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L198-L206 |
240,951 | novuso/system | src/Type/Enum.php | Enum.ordinal | final public function ordinal(): int
{
if ($this->ordinal === null) {
$ordinal = 0;
foreach (self::getMembers() as $constValue) {
if ($this->value === $constValue) {
break;
}
$ordinal++;
}
$th... | php | final public function ordinal(): int
{
if ($this->ordinal === null) {
$ordinal = 0;
foreach (self::getMembers() as $constValue) {
if ($this->value === $constValue) {
break;
}
$ordinal++;
}
$th... | [
"final",
"public",
"function",
"ordinal",
"(",
")",
":",
"int",
"{",
"if",
"(",
"$",
"this",
"->",
"ordinal",
"===",
"null",
")",
"{",
"$",
"ordinal",
"=",
"0",
";",
"foreach",
"(",
"self",
"::",
"getMembers",
"(",
")",
"as",
"$",
"constValue",
")"... | Retrieves the enum ordinal position
@return int | [
"Retrieves",
"the",
"enum",
"ordinal",
"position"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L213-L227 |
240,952 | novuso/system | src/Type/Enum.php | Enum.guardConstants | final private static function guardConstants(array $constants): void
{
$duplicates = [];
foreach ($constants as $value) {
$names = array_keys($constants, $value, $strict = true);
if (count($names) > 1) {
$duplicates[VarPrinter::toString($value)] = $names;
... | php | final private static function guardConstants(array $constants): void
{
$duplicates = [];
foreach ($constants as $value) {
$names = array_keys($constants, $value, $strict = true);
if (count($names) > 1) {
$duplicates[VarPrinter::toString($value)] = $names;
... | [
"final",
"private",
"static",
"function",
"guardConstants",
"(",
"array",
"$",
"constants",
")",
":",
"void",
"{",
"$",
"duplicates",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"constants",
"as",
"$",
"value",
")",
"{",
"$",
"names",
"=",
"array_keys",
"... | Validates enum constants
@param array $constants The enum constants
@return void
@throws DomainException When more than one constant has the same value | [
"Validates",
"enum",
"constants"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L332-L348 |
240,953 | novuso/system | src/Type/Enum.php | Enum.sortConstants | final private static function sortConstants(ReflectionClass $reflection): array
{
$constants = [];
while ($reflection && __CLASS__ !== $reflection->getName()) {
$scope = [];
foreach ($reflection->getReflectionConstants() as $const) {
if ($const->isPublic()) {
... | php | final private static function sortConstants(ReflectionClass $reflection): array
{
$constants = [];
while ($reflection && __CLASS__ !== $reflection->getName()) {
$scope = [];
foreach ($reflection->getReflectionConstants() as $const) {
if ($const->isPublic()) {
... | [
"final",
"private",
"static",
"function",
"sortConstants",
"(",
"ReflectionClass",
"$",
"reflection",
")",
":",
"array",
"{",
"$",
"constants",
"=",
"[",
"]",
";",
"while",
"(",
"$",
"reflection",
"&&",
"__CLASS__",
"!==",
"$",
"reflection",
"->",
"getName",... | Sorts member constants
@param ReflectionClass $reflection The reflection instance
@return array | [
"Sorts",
"member",
"constants"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Type/Enum.php#L357-L373 |
240,954 | ntentan/utils | src/Validator.php | Validator.getValidation | private function getValidation(string $name): validator\Validation
{
if (!isset($this->validations[$name])) {
if (isset($this->validationRegister[$name])) {
$class = $this->validationRegister[$name];
} else {
throw new exceptions\ValidatorException("Va... | php | private function getValidation(string $name): validator\Validation
{
if (!isset($this->validations[$name])) {
if (isset($this->validationRegister[$name])) {
$class = $this->validationRegister[$name];
} else {
throw new exceptions\ValidatorException("Va... | [
"private",
"function",
"getValidation",
"(",
"string",
"$",
"name",
")",
":",
"validator",
"\\",
"Validation",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"validations",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
... | Get an instance of a validation class.
@param string $name
@return validator\Validation
@throws exceptions\ValidatorException | [
"Get",
"an",
"instance",
"of",
"a",
"validation",
"class",
"."
] | 151f3582ee6007ea77a38d2b6c590289331e19a1 | https://github.com/ntentan/utils/blob/151f3582ee6007ea77a38d2b6c590289331e19a1/src/Validator.php#L87-L100 |
240,955 | ntentan/utils | src/Validator.php | Validator.registerValidation | protected function registerValidation(string $name, string $class, $data = null)
{
$this->validationRegister[$name] = $class;
$this->validationData[$name] = $data;
} | php | protected function registerValidation(string $name, string $class, $data = null)
{
$this->validationRegister[$name] = $class;
$this->validationData[$name] = $data;
} | [
"protected",
"function",
"registerValidation",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"class",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"validationRegister",
"[",
"$",
"name",
"]",
"=",
"$",
"class",
";",
"$",
"this",
"->",
... | Register a validation type.
@param string $name The name of the validation to be used in validation descriptions.
@param string $class The name of the validation class to load.
@param mixed $data Any extra validation data that would be necessary for the validation. | [
"Register",
"a",
"validation",
"type",
"."
] | 151f3582ee6007ea77a38d2b6c590289331e19a1 | https://github.com/ntentan/utils/blob/151f3582ee6007ea77a38d2b6c590289331e19a1/src/Validator.php#L109-L113 |
240,956 | ntentan/utils | src/Validator.php | Validator.getFieldInfo | private function getFieldInfo($key, $value): array
{
$name = null;
$options = [];
if (is_numeric($key) && is_string($value)) {
$name = $value;
} else if (is_numeric($key) && is_array($value)) {
$name = array_shift($value);
$options = $value;
... | php | private function getFieldInfo($key, $value): array
{
$name = null;
$options = [];
if (is_numeric($key) && is_string($value)) {
$name = $value;
} else if (is_numeric($key) && is_array($value)) {
$name = array_shift($value);
$options = $value;
... | [
"private",
"function",
"getFieldInfo",
"(",
"$",
"key",
",",
"$",
"value",
")",
":",
"array",
"{",
"$",
"name",
"=",
"null",
";",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
"&&",
"is_string",
"(",
"$",
"val... | Build a uniform field info array for various types of validations.
@param mixed $key
@param mixed $value
@return array | [
"Build",
"a",
"uniform",
"field",
"info",
"array",
"for",
"various",
"types",
"of",
"validations",
"."
] | 151f3582ee6007ea77a38d2b6c590289331e19a1 | https://github.com/ntentan/utils/blob/151f3582ee6007ea77a38d2b6c590289331e19a1/src/Validator.php#L142-L156 |
240,957 | ntentan/utils | src/Validator.php | Validator.validate | public function validate(array $data) : bool
{
$passed = true;
$this->invalidFields = [];
$rules = $this->getRules();
foreach ($rules as $validation => $fields) {
foreach ($fields as $key => $value) {
$field = $this->getFieldInfo($key, $value);
... | php | public function validate(array $data) : bool
{
$passed = true;
$this->invalidFields = [];
$rules = $this->getRules();
foreach ($rules as $validation => $fields) {
foreach ($fields as $key => $value) {
$field = $this->getFieldInfo($key, $value);
... | [
"public",
"function",
"validate",
"(",
"array",
"$",
"data",
")",
":",
"bool",
"{",
"$",
"passed",
"=",
"true",
";",
"$",
"this",
"->",
"invalidFields",
"=",
"[",
"]",
";",
"$",
"rules",
"=",
"$",
"this",
"->",
"getRules",
"(",
")",
";",
"foreach",... | Validate data according to validation rules that have been set into
this validator.
@param array $data The data to be validated
@return bool
@throws exceptions\ValidatorException | [
"Validate",
"data",
"according",
"to",
"validation",
"rules",
"that",
"have",
"been",
"set",
"into",
"this",
"validator",
"."
] | 151f3582ee6007ea77a38d2b6c590289331e19a1 | https://github.com/ntentan/utils/blob/151f3582ee6007ea77a38d2b6c590289331e19a1/src/Validator.php#L176-L193 |
240,958 | lutsen/lagan-core | src/Lagan.php | Lagan.universalCreate | protected function universalCreate() {
$bean = \R::dispense($this->type);
$bean->created = \R::isoDateTime();
return $bean;
} | php | protected function universalCreate() {
$bean = \R::dispense($this->type);
$bean->created = \R::isoDateTime();
return $bean;
} | [
"protected",
"function",
"universalCreate",
"(",
")",
"{",
"$",
"bean",
"=",
"\\",
"R",
"::",
"dispense",
"(",
"$",
"this",
"->",
"type",
")",
";",
"$",
"bean",
"->",
"created",
"=",
"\\",
"R",
"::",
"isoDateTime",
"(",
")",
";",
"return",
"$",
"be... | Dispenses a Redbean bean ans sets it's creation date.
@return bean | [
"Dispenses",
"a",
"Redbean",
"bean",
"ans",
"sets",
"it",
"s",
"creation",
"date",
"."
] | 257244219a046293f506de68e54f0c16c35d8217 | https://github.com/lutsen/lagan-core/blob/257244219a046293f506de68e54f0c16c35d8217/src/Lagan.php#L30-L37 |
240,959 | lutsen/lagan-core | src/Lagan.php | Lagan.set | public function set($data, $bean) {
// Add all properties to bean
foreach ( $this->properties as $property ) {
$value = false; // We need to clear possible previous $value
// Define property controller
$c = new $property['type'];
// New input for the property
if (
isset( $data[ $property['nam... | php | public function set($data, $bean) {
// Add all properties to bean
foreach ( $this->properties as $property ) {
$value = false; // We need to clear possible previous $value
// Define property controller
$c = new $property['type'];
// New input for the property
if (
isset( $data[ $property['nam... | [
"public",
"function",
"set",
"(",
"$",
"data",
",",
"$",
"bean",
")",
"{",
"// Add all properties to bean",
"foreach",
"(",
"$",
"this",
"->",
"properties",
"as",
"$",
"property",
")",
"{",
"$",
"value",
"=",
"false",
";",
"// We need to clear possible previou... | Set values for a bean. Used by Create and Update.
Checks for each property if a "set" method exists for it's type.
If so, it executes it.
@param array $data The raw data, usually from the Slim $request->getParsedBody()
@param bean $bean
@return bean Bean with values based on $data. | [
"Set",
"values",
"for",
"a",
"bean",
".",
"Used",
"by",
"Create",
"and",
"Update",
".",
"Checks",
"for",
"each",
"property",
"if",
"a",
"set",
"method",
"exists",
"for",
"it",
"s",
"type",
".",
"If",
"so",
"it",
"executes",
"it",
"."
] | 257244219a046293f506de68e54f0c16c35d8217 | https://github.com/lutsen/lagan-core/blob/257244219a046293f506de68e54f0c16c35d8217/src/Lagan.php#L50-L133 |
240,960 | MacFJA/value-provider | src/ChainProvider.php | ChainProvider.tryGetValue | protected static function tryGetValue($provider, $object, $propertyName, &$error)
{
try {
return call_user_func(array($provider, 'getValue'), $object, $propertyName);
} catch (\InvalidArgumentException $e) {
$error = $e;
return null;
}
} | php | protected static function tryGetValue($provider, $object, $propertyName, &$error)
{
try {
return call_user_func(array($provider, 'getValue'), $object, $propertyName);
} catch (\InvalidArgumentException $e) {
$error = $e;
return null;
}
} | [
"protected",
"static",
"function",
"tryGetValue",
"(",
"$",
"provider",
",",
"$",
"object",
",",
"$",
"propertyName",
",",
"&",
"$",
"error",
")",
"{",
"try",
"{",
"return",
"call_user_func",
"(",
"array",
"(",
"$",
"provider",
",",
"'getValue'",
")",
",... | Try to get the value of an object property with a specific provider
@param string|object $provider The provider class(name) to use
@param object $object The object to read
@param string $propertyName The name of the property to read
@param \... | [
"Try",
"to",
"get",
"the",
"value",
"of",
"an",
"object",
"property",
"with",
"a",
"specific",
"provider"
] | eab0d8a52062e21fa91041f9fb6df38fd9c0dd28 | https://github.com/MacFJA/value-provider/blob/eab0d8a52062e21fa91041f9fb6df38fd9c0dd28/src/ChainProvider.php#L119-L127 |
240,961 | MacFJA/value-provider | src/ChainProvider.php | ChainProvider.trySetValue | protected static function trySetValue($provider, &$object, $propertyName, $value, &$error)
{
try {
return call_user_func(array($provider, 'setValue'), $object, $propertyName, $value);
} catch (\InvalidArgumentException $e) {
$error = $e;
return null;
}
... | php | protected static function trySetValue($provider, &$object, $propertyName, $value, &$error)
{
try {
return call_user_func(array($provider, 'setValue'), $object, $propertyName, $value);
} catch (\InvalidArgumentException $e) {
$error = $e;
return null;
}
... | [
"protected",
"static",
"function",
"trySetValue",
"(",
"$",
"provider",
",",
"&",
"$",
"object",
",",
"$",
"propertyName",
",",
"$",
"value",
",",
"&",
"$",
"error",
")",
"{",
"try",
"{",
"return",
"call_user_func",
"(",
"array",
"(",
"$",
"provider",
... | Try to set the value of an object property with a specific provider
@param string|object $provider The provider class(name) to use
@param object $object The object to write
@param string $propertyName The name of the property to write
@param... | [
"Try",
"to",
"set",
"the",
"value",
"of",
"an",
"object",
"property",
"with",
"a",
"specific",
"provider"
] | eab0d8a52062e21fa91041f9fb6df38fd9c0dd28 | https://github.com/MacFJA/value-provider/blob/eab0d8a52062e21fa91041f9fb6df38fd9c0dd28/src/ChainProvider.php#L142-L150 |
240,962 | dlds/yii2-rels | components/Behavior.php | Behavior.canGetProperty | public function canGetProperty($name, $checkVars = true)
{
if (!in_array($name, $this->attrs)) {
return parent::canGetProperty($name, $checkVars);
}
return true;
} | php | public function canGetProperty($name, $checkVars = true)
{
if (!in_array($name, $this->attrs)) {
return parent::canGetProperty($name, $checkVars);
}
return true;
} | [
"public",
"function",
"canGetProperty",
"(",
"$",
"name",
",",
"$",
"checkVars",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"attrs",
")",
")",
"{",
"return",
"parent",
"::",
"canGetProperty",
"(",
"$"... | Indicates whether a property can be read.
@param string $name the property name
@param boolean $checkVars whether to treat member variables as properties | [
"Indicates",
"whether",
"a",
"property",
"can",
"be",
"read",
"."
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Behavior.php#L71-L78 |
240,963 | dlds/yii2-rels | components/Behavior.php | Behavior.events | public function events()
{
return [
\yii\db\ActiveRecord::EVENT_BEFORE_VALIDATE => 'handleValidate',
\yii\db\ActiveRecord::EVENT_AFTER_INSERT => 'handleAfterSave',
\yii\db\ActiveRecord::EVENT_AFTER_UPDATE => 'handleAfterSave',
];
} | php | public function events()
{
return [
\yii\db\ActiveRecord::EVENT_BEFORE_VALIDATE => 'handleValidate',
\yii\db\ActiveRecord::EVENT_AFTER_INSERT => 'handleAfterSave',
\yii\db\ActiveRecord::EVENT_AFTER_UPDATE => 'handleAfterSave',
];
} | [
"public",
"function",
"events",
"(",
")",
"{",
"return",
"[",
"\\",
"yii",
"\\",
"db",
"\\",
"ActiveRecord",
"::",
"EVENT_BEFORE_VALIDATE",
"=>",
"'handleValidate'",
",",
"\\",
"yii",
"\\",
"db",
"\\",
"ActiveRecord",
"::",
"EVENT_AFTER_INSERT",
"=>",
"'handle... | Validates interpreter together with owner | [
"Validates",
"interpreter",
"together",
"with",
"owner"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Behavior.php#L83-L90 |
240,964 | dlds/yii2-rels | components/Behavior.php | Behavior.interpreter | public function interpreter(array $restriction = [])
{
if (null === $this->_interpreter) {
$this->_interpreter = new Interpreter($this->owner, $this->config, $this->allowCache, $this->attrActive);
}
$this->_interpreter->setRestriction($restriction);
return $this->_inter... | php | public function interpreter(array $restriction = [])
{
if (null === $this->_interpreter) {
$this->_interpreter = new Interpreter($this->owner, $this->config, $this->allowCache, $this->attrActive);
}
$this->_interpreter->setRestriction($restriction);
return $this->_inter... | [
"public",
"function",
"interpreter",
"(",
"array",
"$",
"restriction",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_interpreter",
")",
"{",
"$",
"this",
"->",
"_interpreter",
"=",
"new",
"Interpreter",
"(",
"$",
"this",
"->",... | Retrieves instance to multilang interperter | [
"Retrieves",
"instance",
"to",
"multilang",
"interperter"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Behavior.php#L188-L197 |
240,965 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.getUserFeed | public function getUserFeed($userName = null, $location = null)
{
if ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('feed');
if ($userName !== null) {
$location->setUser($userName);
}
$uri = $location->getQueryUrl();
... | php | public function getUserFeed($userName = null, $location = null)
{
if ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('feed');
if ($userName !== null) {
$location->setUser($userName);
}
$uri = $location->getQueryUrl();
... | [
"public",
"function",
"getUserFeed",
"(",
"$",
"userName",
"=",
"null",
",",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"location",
"instanceof",
"Zend_Gdata_Photos_UserQuery",
")",
"{",
"$",
"location",
"->",
"setType",
"(",
"'feed'",
")",
";... | Retrieve a UserFeed containing AlbumEntries, PhotoEntries and
TagEntries associated with a given user.
@param string $userName The userName of interest
@param mixed $location (optional) The location for the feed, as a URL
or Query. If not provided, a default URL will be used instead.
@return Zend_Gdata_Photos_UserFeed... | [
"Retrieve",
"a",
"UserFeed",
"containing",
"AlbumEntries",
"PhotoEntries",
"and",
"TagEntries",
"associated",
"with",
"a",
"given",
"user",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L150-L176 |
240,966 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.getAlbumFeed | public function getAlbumFeed($location = null)
{
if ($location === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gda... | php | public function getAlbumFeed($location = null)
{
if ($location === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gda... | [
"public",
"function",
"getAlbumFeed",
"(",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"location",
"===",
"null",
")",
"{",
"require_once",
"'Zend/Gdata/App/InvalidArgumentException.php'",
";",
"throw",
"new",
"Zend_Gdata_App_InvalidArgumentException",
"("... | Retreive AlbumFeed object containing multiple PhotoEntry or TagEntry
objects.
@param mixed $location (optional) The location for the feed, as a URL or Query.
@return Zend_Gdata_Photos_AlbumFeed
@throws Zend_Gdata_App_Exception
@throws Zend_Gdata_App_HttpException | [
"Retreive",
"AlbumFeed",
"object",
"containing",
"multiple",
"PhotoEntry",
"or",
"TagEntry",
"objects",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L187-L202 |
240,967 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.getPhotoFeed | public function getPhotoFeed($location = null)
{
if ($location === null) {
$uri = self::PICASA_BASE_FEED_URI . '/' .
self::DEFAULT_PROJECTION . '/' .
self::COMMUNITY_SEARCH_PATH;
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
$l... | php | public function getPhotoFeed($location = null)
{
if ($location === null) {
$uri = self::PICASA_BASE_FEED_URI . '/' .
self::DEFAULT_PROJECTION . '/' .
self::COMMUNITY_SEARCH_PATH;
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
$l... | [
"public",
"function",
"getPhotoFeed",
"(",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"location",
"===",
"null",
")",
"{",
"$",
"uri",
"=",
"self",
"::",
"PICASA_BASE_FEED_URI",
".",
"'/'",
".",
"self",
"::",
"DEFAULT_PROJECTION",
".",
"'/'"... | Retreive PhotoFeed object containing comments and tags associated
with a given photo.
@param mixed $location (optional) The location for the feed, as a URL
or Query. If not specified, the community search feed will
be returned instead.
@return Zend_Gdata_Photos_PhotoFeed
@throws Zend_Gdata_App_Exception
@throws Zend_G... | [
"Retreive",
"PhotoFeed",
"object",
"containing",
"comments",
"and",
"tags",
"associated",
"with",
"a",
"given",
"photo",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L215-L230 |
240,968 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.getUserEntry | public function getUserEntry($location)
{
if ($location === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Phot... | php | public function getUserEntry($location)
{
if ($location === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Phot... | [
"public",
"function",
"getUserEntry",
"(",
"$",
"location",
")",
"{",
"if",
"(",
"$",
"location",
"===",
"null",
")",
"{",
"require_once",
"'Zend/Gdata/App/InvalidArgumentException.php'",
";",
"throw",
"new",
"Zend_Gdata_App_InvalidArgumentException",
"(",
"'Location mu... | Retreive a single UserEntry object.
@param mixed $location The location for the feed, as a URL or Query.
@return Zend_Gdata_Photos_UserEntry
@throws Zend_Gdata_App_Exception
@throws Zend_Gdata_App_HttpException | [
"Retreive",
"a",
"single",
"UserEntry",
"object",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L240-L255 |
240,969 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.insertAlbumEntry | public function insertAlbumEntry($album, $uri = null)
{
if ($uri === null) {
$uri = self::PICASA_BASE_FEED_URI . '/' .
self::DEFAULT_PROJECTION . '/' . self::USER_PATH . '/' .
self::DEFAULT_USER;
}
$newEntry = $this->insertEntry($album, $uri, 'Zend... | php | public function insertAlbumEntry($album, $uri = null)
{
if ($uri === null) {
$uri = self::PICASA_BASE_FEED_URI . '/' .
self::DEFAULT_PROJECTION . '/' . self::USER_PATH . '/' .
self::DEFAULT_USER;
}
$newEntry = $this->insertEntry($album, $uri, 'Zend... | [
"public",
"function",
"insertAlbumEntry",
"(",
"$",
"album",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"uri",
"===",
"null",
")",
"{",
"$",
"uri",
"=",
"self",
"::",
"PICASA_BASE_FEED_URI",
".",
"'/'",
".",
"self",
"::",
"DEFAULT_PROJECTI... | Create a new album from a AlbumEntry.
@param Zend_Gdata_Photos_AlbumEntry $album The album entry to
insert.
@param string $url (optional) The URI that the album should be
uploaded to. If null, the default album creation URI for
this domain will be used.
@return Zend_Gdata_Photos_AlbumEntry The inserted album entry as
... | [
"Create",
"a",
"new",
"album",
"from",
"a",
"AlbumEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L370-L379 |
240,970 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.insertPhotoEntry | public function insertPhotoEntry($photo, $uri = null)
{
if ($uri instanceof Zend_Gdata_Photos_AlbumEntry) {
$uri = $uri->getLink(self::FEED_LINK_PATH)->href;
}
if ($uri === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_... | php | public function insertPhotoEntry($photo, $uri = null)
{
if ($uri instanceof Zend_Gdata_Photos_AlbumEntry) {
$uri = $uri->getLink(self::FEED_LINK_PATH)->href;
}
if ($uri === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_... | [
"public",
"function",
"insertPhotoEntry",
"(",
"$",
"photo",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"uri",
"instanceof",
"Zend_Gdata_Photos_AlbumEntry",
")",
"{",
"$",
"uri",
"=",
"$",
"uri",
"->",
"getLink",
"(",
"self",
"::",
"FEED_LIN... | Create a new photo from a PhotoEntry.
@param Zend_Gdata_Photos_PhotoEntry $photo The photo to insert.
@param string $url The URI that the photo should be uploaded
to. Alternatively, an AlbumEntry can be provided and the
photo will be added to that album.
@return Zend_Gdata_Photos_PhotoEntry The inserted photo entry
as... | [
"Create",
"a",
"new",
"photo",
"from",
"a",
"PhotoEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L393-L405 |
240,971 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.insertTagEntry | public function insertTagEntry($tag, $uri = null)
{
if ($uri instanceof Zend_Gdata_Photos_PhotoEntry) {
$uri = $uri->getLink(self::FEED_LINK_PATH)->href;
}
if ($uri === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdat... | php | public function insertTagEntry($tag, $uri = null)
{
if ($uri instanceof Zend_Gdata_Photos_PhotoEntry) {
$uri = $uri->getLink(self::FEED_LINK_PATH)->href;
}
if ($uri === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdat... | [
"public",
"function",
"insertTagEntry",
"(",
"$",
"tag",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"uri",
"instanceof",
"Zend_Gdata_Photos_PhotoEntry",
")",
"{",
"$",
"uri",
"=",
"$",
"uri",
"->",
"getLink",
"(",
"self",
"::",
"FEED_LINK_PA... | Create a new tag from a TagEntry.
@param Zend_Gdata_Photos_TagEntry $tag The tag entry to insert.
@param string $url The URI where the tag should be
uploaded to. Alternatively, a PhotoEntry can be provided and
the tag will be added to that photo.
@return Zend_Gdata_Photos_TagEntry The inserted tag entry as returned
by... | [
"Create",
"a",
"new",
"tag",
"from",
"a",
"TagEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L419-L431 |
240,972 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.insertCommentEntry | public function insertCommentEntry($comment, $uri = null)
{
if ($uri instanceof Zend_Gdata_Photos_PhotoEntry) {
$uri = $uri->getLink(self::FEED_LINK_PATH)->href;
}
if ($uri === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Z... | php | public function insertCommentEntry($comment, $uri = null)
{
if ($uri instanceof Zend_Gdata_Photos_PhotoEntry) {
$uri = $uri->getLink(self::FEED_LINK_PATH)->href;
}
if ($uri === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Z... | [
"public",
"function",
"insertCommentEntry",
"(",
"$",
"comment",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"uri",
"instanceof",
"Zend_Gdata_Photos_PhotoEntry",
")",
"{",
"$",
"uri",
"=",
"$",
"uri",
"->",
"getLink",
"(",
"self",
"::",
"FEED... | Create a new comment from a CommentEntry.
@param Zend_Gdata_Photos_CommentEntry $comment The comment entry to
insert.
@param string $url The URI where the comment should be uploaded to.
Alternatively, a PhotoEntry can be provided and
the comment will be added to that photo.
@return Zend_Gdata_Photos_CommentEntry The i... | [
"Create",
"a",
"new",
"comment",
"from",
"a",
"CommentEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L446-L458 |
240,973 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.deleteAlbumEntry | public function deleteAlbumEntry($album, $catch)
{
if ($catch) {
try {
$this->delete($album);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_AlbumEntry($e->ge... | php | public function deleteAlbumEntry($album, $catch)
{
if ($catch) {
try {
$this->delete($album);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_AlbumEntry($e->ge... | [
"public",
"function",
"deleteAlbumEntry",
"(",
"$",
"album",
",",
"$",
"catch",
")",
"{",
"if",
"(",
"$",
"catch",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"delete",
"(",
"$",
"album",
")",
";",
"}",
"catch",
"(",
"Zend_Gdata_App_HttpException",
"$",
... | Delete an AlbumEntry.
@param Zend_Gdata_Photos_AlbumEntry $album The album entry to
delete.
@param boolean $catch Whether to catch an exception when
modified and re-delete or throw
@return void.
@throws Zend_Gdata_App_Exception
@throws Zend_Gdata_App_HttpException | [
"Delete",
"an",
"AlbumEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L471-L487 |
240,974 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.deletePhotoEntry | public function deletePhotoEntry($photo, $catch)
{
if ($catch) {
try {
$this->delete($photo);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_PhotoEntry($e->ge... | php | public function deletePhotoEntry($photo, $catch)
{
if ($catch) {
try {
$this->delete($photo);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_PhotoEntry($e->ge... | [
"public",
"function",
"deletePhotoEntry",
"(",
"$",
"photo",
",",
"$",
"catch",
")",
"{",
"if",
"(",
"$",
"catch",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"delete",
"(",
"$",
"photo",
")",
";",
"}",
"catch",
"(",
"Zend_Gdata_App_HttpException",
"$",
... | Delete a PhotoEntry.
@param Zend_Gdata_Photos_PhotoEntry $photo The photo entry to
delete.
@param boolean $catch Whether to catch an exception when
modified and re-delete or throw
@return void.
@throws Zend_Gdata_App_Exception
@throws Zend_Gdata_App_HttpException | [
"Delete",
"a",
"PhotoEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L500-L516 |
240,975 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.deleteCommentEntry | public function deleteCommentEntry($comment, $catch)
{
if ($catch) {
try {
$this->delete($comment);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_CommentEntr... | php | public function deleteCommentEntry($comment, $catch)
{
if ($catch) {
try {
$this->delete($comment);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_CommentEntr... | [
"public",
"function",
"deleteCommentEntry",
"(",
"$",
"comment",
",",
"$",
"catch",
")",
"{",
"if",
"(",
"$",
"catch",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"delete",
"(",
"$",
"comment",
")",
";",
"}",
"catch",
"(",
"Zend_Gdata_App_HttpException",
... | Delete a CommentEntry.
@param Zend_Gdata_Photos_CommentEntry $comment The comment entry to
delete.
@param boolean $catch Whether to catch an exception when
modified and re-delete or throw
@return void.
@throws Zend_Gdata_App_Exception
@throws Zend_Gdata_App_HttpException | [
"Delete",
"a",
"CommentEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L529-L545 |
240,976 | n0m4dz/laracasa | Zend/Gdata/Photos.php | Zend_Gdata_Photos.deleteTagEntry | public function deleteTagEntry($tag, $catch)
{
if ($catch) {
try {
$this->delete($tag);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_TagEntry($e->getRespons... | php | public function deleteTagEntry($tag, $catch)
{
if ($catch) {
try {
$this->delete($tag);
} catch (Zend_Gdata_App_HttpException $e) {
if ($e->getResponse()->getStatus() === 409) {
$entry = new Zend_Gdata_Photos_TagEntry($e->getRespons... | [
"public",
"function",
"deleteTagEntry",
"(",
"$",
"tag",
",",
"$",
"catch",
")",
"{",
"if",
"(",
"$",
"catch",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"delete",
"(",
"$",
"tag",
")",
";",
"}",
"catch",
"(",
"Zend_Gdata_App_HttpException",
"$",
"e",
... | Delete a TagEntry.
@param Zend_Gdata_Photos_TagEntry $tag The tag entry to
delete.
@param boolean $catch Whether to catch an exception when
modified and re-delete or throw
@return void.
@throws Zend_Gdata_App_Exception
@throws Zend_Gdata_App_HttpException | [
"Delete",
"a",
"TagEntry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Photos.php#L558-L574 |
240,977 | edunola13/enolaphp-framework | src/Cron/Models/En_CronRequest.php | En_CronRequest.getParam | public function getParam($index){
if(isset($this->params[$index])){
return $this->params[$index];
}else{
return NULL;
}
} | php | public function getParam($index){
if(isset($this->params[$index])){
return $this->params[$index];
}else{
return NULL;
}
} | [
"public",
"function",
"getParam",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"params",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"params",
"[",
"$",
"index",
"]",
";",
"}",
"else",
"{",
"r... | Devuelve un parametro en base a un indice - solo parametros no utilizados por el framework
@param string $index
@return null o string | [
"Devuelve",
"un",
"parametro",
"en",
"base",
"a",
"un",
"indice",
"-",
"solo",
"parametros",
"no",
"utilizados",
"por",
"el",
"framework"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Cron/Models/En_CronRequest.php#L49-L55 |
240,978 | edunola13/enolaphp-framework | src/Cron/Models/En_CronRequest.php | En_CronRequest.getParamClean | public function getParamClean($index){
if(isset($this->params[$index])){
return $this->params[$index];
}else{
return NULL;
}
} | php | public function getParamClean($index){
if(isset($this->params[$index])){
return $this->params[$index];
}else{
return NULL;
}
} | [
"public",
"function",
"getParamClean",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"params",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"params",
"[",
"$",
"index",
"]",
";",
"}",
"else",
"{",... | Devuelve un parametro limpiado en base a un indice - solo parametros no utilizados por el framework
@param string $index
@return null o string | [
"Devuelve",
"un",
"parametro",
"limpiado",
"en",
"base",
"a",
"un",
"indice",
"-",
"solo",
"parametros",
"no",
"utilizados",
"por",
"el",
"framework"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Cron/Models/En_CronRequest.php#L61-L67 |
240,979 | edunola13/enolaphp-framework | src/Cron/Models/En_CronRequest.php | En_CronRequest.getParamAll | public function getParamAll($index){
if(isset($this->allParams[$index])){
return Security::clean_vars($this->allParams[$index]);
}
else{
return NULL;
}
} | php | public function getParamAll($index){
if(isset($this->allParams[$index])){
return Security::clean_vars($this->allParams[$index]);
}
else{
return NULL;
}
} | [
"public",
"function",
"getParamAll",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"allParams",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"Security",
"::",
"clean_vars",
"(",
"$",
"this",
"->",
"allParams",
"[",
"$",... | Devuelve un parametro en base a un indice - incluye todos los parametros
@param string $index
@return null o string | [
"Devuelve",
"un",
"parametro",
"en",
"base",
"a",
"un",
"indice",
"-",
"incluye",
"todos",
"los",
"parametros"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Cron/Models/En_CronRequest.php#L73-L80 |
240,980 | edunola13/enolaphp-framework | src/Cron/Models/En_CronRequest.php | En_CronRequest.getParamAllClean | public function getParamAllClean($index){
if(isset($this->allParams[$index])){
return Security::clean_vars($this->allParams[$index]);
}
else{
return NULL;
}
} | php | public function getParamAllClean($index){
if(isset($this->allParams[$index])){
return Security::clean_vars($this->allParams[$index]);
}
else{
return NULL;
}
} | [
"public",
"function",
"getParamAllClean",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"allParams",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"Security",
"::",
"clean_vars",
"(",
"$",
"this",
"->",
"allParams",
"[",
... | Devuelve un parametro limpiado en base a un indice - incluye todos los parametros
@param string $index
@return null o string | [
"Devuelve",
"un",
"parametro",
"limpiado",
"en",
"base",
"a",
"un",
"indice",
"-",
"incluye",
"todos",
"los",
"parametros"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/Cron/Models/En_CronRequest.php#L86-L93 |
240,981 | gplcart/xss | helpers/Filter.php | Filter.build | protected function build($m)
{
$string = $m[1];
if (substr($string, 0, 1) != '<') {
// We matched a lone ">" character.
return '>';
} elseif (strlen($string) == 1) {
// We matched a lone "<" character.
return '<';
}
if (... | php | protected function build($m)
{
$string = $m[1];
if (substr($string, 0, 1) != '<') {
// We matched a lone ">" character.
return '>';
} elseif (strlen($string) == 1) {
// We matched a lone "<" character.
return '<';
}
if (... | [
"protected",
"function",
"build",
"(",
"$",
"m",
")",
"{",
"$",
"string",
"=",
"$",
"m",
"[",
"1",
"]",
";",
"if",
"(",
"substr",
"(",
"$",
"string",
",",
"0",
",",
"1",
")",
"!=",
"'<'",
")",
"{",
"// We matched a lone \">\" character.",
"return",
... | Build a filtered tag
@param array $m
@return string | [
"Build",
"a",
"filtered",
"tag"
] | 85c98028b28da188a0a4e415df32b0c3e3761524 | https://github.com/gplcart/xss/blob/85c98028b28da188a0a4e415df32b0c3e3761524/helpers/Filter.php#L124-L172 |
240,982 | soloproyectos-php/array | src/arr/arguments/ArrArgumentsDescriptor.php | ArrArgumentsDescriptor.match | public function match($var)
{
$ret = false;
foreach ($this->_types as $type) {
if (array_search($type, array("*", "mixed")) !== false) {
$ret = true;
} elseif (array_search($type, array("number", "numeric")) !== false) {
$ret = is_numeric($var... | php | public function match($var)
{
$ret = false;
foreach ($this->_types as $type) {
if (array_search($type, array("*", "mixed")) !== false) {
$ret = true;
} elseif (array_search($type, array("number", "numeric")) !== false) {
$ret = is_numeric($var... | [
"public",
"function",
"match",
"(",
"$",
"var",
")",
"{",
"$",
"ret",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"_types",
"as",
"$",
"type",
")",
"{",
"if",
"(",
"array_search",
"(",
"$",
"type",
",",
"array",
"(",
"\"*\"",
",",
"\"mi... | Does the variable match with this descriptor?
@param mixed $var Arbitrary variable
@return boolean | [
"Does",
"the",
"variable",
"match",
"with",
"this",
"descriptor?"
] | de38c800f3388005cbd37e70ab055f22609a5eae | https://github.com/soloproyectos-php/array/blob/de38c800f3388005cbd37e70ab055f22609a5eae/src/arr/arguments/ArrArgumentsDescriptor.php#L82-L115 |
240,983 | arvici/framework | src/Arvici/Heart/Router/Middleware.php | Middleware.execute | public function execute()
{
if (is_string($this->callback)) {
// Will call the controller here
$parts = explode('::', $this->callback);
$className = $parts[0];
$classMethod = $parts[1];
if (! class_exists($className)) {
throw new R... | php | public function execute()
{
if (is_string($this->callback)) {
// Will call the controller here
$parts = explode('::', $this->callback);
$className = $parts[0];
$classMethod = $parts[1];
if (! class_exists($className)) {
throw new R... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"callback",
")",
")",
"{",
"// Will call the controller here",
"$",
"parts",
"=",
"explode",
"(",
"'::'",
",",
"$",
"this",
"->",
"callback",
")",
";",
"$",
... | Execute Callback in middleware, capture the output of it.
@return bool can we continue?
@throws RouterException | [
"Execute",
"Callback",
"in",
"middleware",
"capture",
"the",
"output",
"of",
"it",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Router/Middleware.php#L105-L143 |
240,984 | samsonos/social_network | Network.php | Network.prepare | public function prepare()
{
$class = get_class($this);
// Check table
if (!isset($this->dbTable)) {
return e('Cannot load "'.$class.'" module - no $dbTable is configured');
}
// Social system specific configuration check
if ($class != __CLASS__) {
... | php | public function prepare()
{
$class = get_class($this);
// Check table
if (!isset($this->dbTable)) {
return e('Cannot load "'.$class.'" module - no $dbTable is configured');
}
// Social system specific configuration check
if ($class != __CLASS__) {
... | [
"public",
"function",
"prepare",
"(",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"// Check table",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dbTable",
")",
")",
"{",
"return",
"e",
"(",
"'Cannot load \"'",
".",
"$",... | Prepare module data | [
"Prepare",
"module",
"data"
] | 3700cf526fa58692d89247141e3f0f04bb5ec759 | https://github.com/samsonos/social_network/blob/3700cf526fa58692d89247141e3f0f04bb5ec759/Network.php#L76-L99 |
240,985 | samsonos/social_network | Network.php | Network.init | public function init(array $params = array())
{
// Try to load token from session
if (isset($_SESSION[self::SESSION_PREFIX.'_'.$this->id])) {
$this->token = $_SESSION[self::SESSION_PREFIX.'_'.$this->id];
}
parent::init($params);
} | php | public function init(array $params = array())
{
// Try to load token from session
if (isset($_SESSION[self::SESSION_PREFIX.'_'.$this->id])) {
$this->token = $_SESSION[self::SESSION_PREFIX.'_'.$this->id];
}
parent::init($params);
} | [
"public",
"function",
"init",
"(",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"// Try to load token from session",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"SESSION_PREFIX",
".",
"'_'",
".",
"$",
"this",
"->",
"id",
"]"... | Social network initialization | [
"Social",
"network",
"initialization"
] | 3700cf526fa58692d89247141e3f0f04bb5ec759 | https://github.com/samsonos/social_network/blob/3700cf526fa58692d89247141e3f0f04bb5ec759/Network.php#L102-L110 |
240,986 | samsonos/social_network | Network.php | Network.setUser | protected function setUser(array $userData, & $user = null)
{
// Generic birthdate parsing
$user->birthday = date('Y-m-d H:i:s', strtotime($user->birthday));
// If no external user is passed set as current user
if (isset($user)) {
$this->user = & $user;
}
} | php | protected function setUser(array $userData, & $user = null)
{
// Generic birthdate parsing
$user->birthday = date('Y-m-d H:i:s', strtotime($user->birthday));
// If no external user is passed set as current user
if (isset($user)) {
$this->user = & $user;
}
} | [
"protected",
"function",
"setUser",
"(",
"array",
"$",
"userData",
",",
"&",
"$",
"user",
"=",
"null",
")",
"{",
"// Generic birthdate parsing",
"$",
"user",
"->",
"birthday",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"strtotime",
"(",
"$",
"user",
"->",
"bi... | Fill object User
@param array $userData Answer of social network
@param mixed $user Pointer to user object for filling | [
"Fill",
"object",
"User"
] | 3700cf526fa58692d89247141e3f0f04bb5ec759 | https://github.com/samsonos/social_network/blob/3700cf526fa58692d89247141e3f0f04bb5ec759/Network.php#L118-L127 |
240,987 | samsonos/social_network | Network.php | Network.& | protected function & storeUserData(&$user = null)
{
// If no user is passed - create it
if (!isset($user)) {
$user = new $this->dbTable(false);
}
// Store social data for user
$user[$this->dbIdField] = $this->user->socialID;
$user[$this->dbNameFie... | php | protected function & storeUserData(&$user = null)
{
// If no user is passed - create it
if (!isset($user)) {
$user = new $this->dbTable(false);
}
// Store social data for user
$user[$this->dbIdField] = $this->user->socialID;
$user[$this->dbNameFie... | [
"protected",
"function",
"&",
"storeUserData",
"(",
"&",
"$",
"user",
"=",
"null",
")",
"{",
"// If no user is passed - create it",
"if",
"(",
"!",
"isset",
"(",
"$",
"user",
")",
")",
"{",
"$",
"user",
"=",
"new",
"$",
"this",
"->",
"dbTable",
"(",
"f... | Store current social user data in database
@param \samson\activerecord\dbRecord $user
@return \samson\activerecord\dbRecord Stored user database record | [
"Store",
"current",
"social",
"user",
"data",
"in",
"database"
] | 3700cf526fa58692d89247141e3f0f04bb5ec759 | https://github.com/samsonos/social_network/blob/3700cf526fa58692d89247141e3f0f04bb5ec759/Network.php#L184-L211 |
240,988 | samsonos/social_network | Network.php | Network.& | public function & friends($count = null, $offset = null)
{
$result = array();
// If we have authorized via one of social modules
if (isset($this->active)) {
// Call friends method on active social module
$result = & $this->active->friends($count, $offset);
}
... | php | public function & friends($count = null, $offset = null)
{
$result = array();
// If we have authorized via one of social modules
if (isset($this->active)) {
// Call friends method on active social module
$result = & $this->active->friends($count, $offset);
}
... | [
"public",
"function",
"&",
"friends",
"(",
"$",
"count",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// If we have authorized via one of social modules",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
... | Get user fiends list
@param integer $count Friends count
@param integer $offset Friends offset
@return User[] Collection of user friends objects | [
"Get",
"user",
"fiends",
"list"
] | 3700cf526fa58692d89247141e3f0f04bb5ec759 | https://github.com/samsonos/social_network/blob/3700cf526fa58692d89247141e3f0f04bb5ec759/Network.php#L265-L276 |
240,989 | bishopb/vanilla | applications/dashboard/models/class.spammodel.php | SpamModel.IsSpam | public static function IsSpam($RecordType, $Data, $Options = array()) {
if (self::$Disabled)
return FALSE;
// Set some information about the user in the data.
if ($RecordType == 'Registration') {
TouchValue('Username', $Data, $Data['Name']);
} else {
TouchValue(... | php | public static function IsSpam($RecordType, $Data, $Options = array()) {
if (self::$Disabled)
return FALSE;
// Set some information about the user in the data.
if ($RecordType == 'Registration') {
TouchValue('Username', $Data, $Data['Name']);
} else {
TouchValue(... | [
"public",
"static",
"function",
"IsSpam",
"(",
"$",
"RecordType",
",",
"$",
"Data",
",",
"$",
"Options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"Disabled",
")",
"return",
"FALSE",
";",
"// Set some information about the user in the d... | Check whether or not the record is spam.
@param string $RecordType By default, this should be one of the following:
- Comment: A comment.
- Discussion: A discussion.
- User: A user registration.
@param array $Data The record data.
@param array $Options Options for fine-tuning this method call.
- Log: Log the record if ... | [
"Check",
"whether",
"or",
"not",
"the",
"record",
"is",
"spam",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.spammodel.php#L33-L91 |
240,990 | gourmet/common | Lib/Navigation.php | Navigation.clear | public static function clear($path = null) {
if (empty($path)) {
self::$_items = array();
return;
}
if (Hash::check(self::$_items, $path)) {
self::$_items = Hash::insert(self::$_items, $path, array());
}
} | php | public static function clear($path = null) {
if (empty($path)) {
self::$_items = array();
return;
}
if (Hash::check(self::$_items, $path)) {
self::$_items = Hash::insert(self::$_items, $path, array());
}
} | [
"public",
"static",
"function",
"clear",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"self",
"::",
"$",
"_items",
"=",
"array",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"Hash",
"::",
"check... | Clear all menus.
@return void | [
"Clear",
"all",
"menus",
"."
] | 53ad4e919c51606dc81f2c716267d01ee768ade5 | https://github.com/gourmet/common/blob/53ad4e919c51606dc81f2c716267d01ee768ade5/Lib/Navigation.php#L94-L103 |
240,991 | gourmet/common | Lib/Navigation.php | Navigation.order | public static function order($items) {
if (empty($items)) {
return array();
}
$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
asort($_items);
foreach (array_keys($_items) as $key) {
$_items[$key] = $items[$key];
}
return $items;
} | php | public static function order($items) {
if (empty($items)) {
return array();
}
$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
asort($_items);
foreach (array_keys($_items) as $key) {
$_items[$key] = $items[$key];
}
return $items;
} | [
"public",
"static",
"function",
"order",
"(",
"$",
"items",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"items",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"_items",
"=",
"array_combine",
"(",
"array_keys",
"(",
"$",
"items",
")",
",",
... | Orders items by weight.
@param array $items
@return array | [
"Orders",
"items",
"by",
"weight",
"."
] | 53ad4e919c51606dc81f2c716267d01ee768ade5 | https://github.com/gourmet/common/blob/53ad4e919c51606dc81f2c716267d01ee768ade5/Lib/Navigation.php#L142-L155 |
240,992 | synga-nl/inheritance-finder | src/InheritanceFinder.php | InheritanceFinder.findMultiple | public function findMultiple($classes = [], $interfaces = [], $traits = []) {
$this->init();
$classes = $this->normalizeArray($classes);
$interfaces = $this->normalizeArray($interfaces);
$traits = $this->normalizeArray($traits);
$foundClasses = [];
if ($classes ... | php | public function findMultiple($classes = [], $interfaces = [], $traits = []) {
$this->init();
$classes = $this->normalizeArray($classes);
$interfaces = $this->normalizeArray($interfaces);
$traits = $this->normalizeArray($traits);
$foundClasses = [];
if ($classes ... | [
"public",
"function",
"findMultiple",
"(",
"$",
"classes",
"=",
"[",
"]",
",",
"$",
"interfaces",
"=",
"[",
"]",
",",
"$",
"traits",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"$",
"classes",
"=",
"$",
"this",
"->",
"nor... | Can find multiple classes at once.
@param array $classes
@param array $interfaces
@param array $traits
@return PhpClass[] | [
"Can",
"find",
"multiple",
"classes",
"at",
"once",
"."
] | 52669ac662b58dfeb6142b2e1bffbfba6f17d4b0 | https://github.com/synga-nl/inheritance-finder/blob/52669ac662b58dfeb6142b2e1bffbfba6f17d4b0/src/InheritanceFinder.php#L126-L154 |
240,993 | synga-nl/inheritance-finder | src/InheritanceFinder.php | InheritanceFinder.findImplementsOrTraitUse | protected function findImplementsOrTraitUse($fullQualifiedNamespace, $type) {
$fullQualifiedNamespace = $this->trimNamespace($fullQualifiedNamespace);
$phpClasses = [];
$method = 'get' . ucfirst($type);
foreach ($this->localCache as $phpClass) {
$implementsOrTrait = $phpCl... | php | protected function findImplementsOrTraitUse($fullQualifiedNamespace, $type) {
$fullQualifiedNamespace = $this->trimNamespace($fullQualifiedNamespace);
$phpClasses = [];
$method = 'get' . ucfirst($type);
foreach ($this->localCache as $phpClass) {
$implementsOrTrait = $phpCl... | [
"protected",
"function",
"findImplementsOrTraitUse",
"(",
"$",
"fullQualifiedNamespace",
",",
"$",
"type",
")",
"{",
"$",
"fullQualifiedNamespace",
"=",
"$",
"this",
"->",
"trimNamespace",
"(",
"$",
"fullQualifiedNamespace",
")",
";",
"$",
"phpClasses",
"=",
"[",
... | Can find implements or detect trait use
@param $fullQualifiedNamespace
@param $type
@return PhpClass[] | [
"Can",
"find",
"implements",
"or",
"detect",
"trait",
"use"
] | 52669ac662b58dfeb6142b2e1bffbfba6f17d4b0 | https://github.com/synga-nl/inheritance-finder/blob/52669ac662b58dfeb6142b2e1bffbfba6f17d4b0/src/InheritanceFinder.php#L163-L179 |
240,994 | synga-nl/inheritance-finder | src/InheritanceFinder.php | InheritanceFinder.arrayUniqueObject | protected function arrayUniqueObject($phpClasses) {
$hashes = [];
foreach ($phpClasses as $key => $phpClass) {
$hashes[$key] = spl_object_hash($phpClass);
}
$hashes = array_unique($hashes);
$uniqueArray = [];
foreach ($hashes as $key => $hash) {
... | php | protected function arrayUniqueObject($phpClasses) {
$hashes = [];
foreach ($phpClasses as $key => $phpClass) {
$hashes[$key] = spl_object_hash($phpClass);
}
$hashes = array_unique($hashes);
$uniqueArray = [];
foreach ($hashes as $key => $hash) {
... | [
"protected",
"function",
"arrayUniqueObject",
"(",
"$",
"phpClasses",
")",
"{",
"$",
"hashes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"phpClasses",
"as",
"$",
"key",
"=>",
"$",
"phpClass",
")",
"{",
"$",
"hashes",
"[",
"$",
"key",
"]",
"=",
"spl_ob... | Makes an array of object unique using the spl_object_hash function
@param $phpClasses
@return array | [
"Makes",
"an",
"array",
"of",
"object",
"unique",
"using",
"the",
"spl_object_hash",
"function"
] | 52669ac662b58dfeb6142b2e1bffbfba6f17d4b0 | https://github.com/synga-nl/inheritance-finder/blob/52669ac662b58dfeb6142b2e1bffbfba6f17d4b0/src/InheritanceFinder.php#L187-L203 |
240,995 | digitalicagroup/slack-hook-framework | lib/SlackHookFramework/AbstractArray.php | AbstractArray.getValue | public function getValue($key) {
if (isset ( $this->a [$key] )) {
return $this->a [$key];
} else {
return NULL;
}
} | php | public function getValue($key) {
if (isset ( $this->a [$key] )) {
return $this->a [$key];
} else {
return NULL;
}
} | [
"public",
"function",
"getValue",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"a",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"a",
"[",
"$",
"key",
"]",
";",
"}",
"else",
"{",
"return",
"NULL"... | Getter method for a specific value referenced by the given key.
@param string $key | [
"Getter",
"method",
"for",
"a",
"specific",
"value",
"referenced",
"by",
"the",
"given",
"key",
"."
] | b2357275d6042e49cb082e375716effd4c001ee0 | https://github.com/digitalicagroup/slack-hook-framework/blob/b2357275d6042e49cb082e375716effd4c001ee0/lib/SlackHookFramework/AbstractArray.php#L67-L73 |
240,996 | SocietyCMS/Core | Utilities/Localization/Generators/LangJsGenerator.php | LangJsGenerator.getMessagesFromSourcePath | protected function getMessagesFromSourcePath($path, $namespace)
{
$messages = [];
if (! $this->file->exists($path)) {
throw new \Exception("${path} doesn't exists!");
}
foreach ($this->file->allFiles($path) as $file) {
$pathName = $file->getRelativePathName();... | php | protected function getMessagesFromSourcePath($path, $namespace)
{
$messages = [];
if (! $this->file->exists($path)) {
throw new \Exception("${path} doesn't exists!");
}
foreach ($this->file->allFiles($path) as $file) {
$pathName = $file->getRelativePathName();... | [
"protected",
"function",
"getMessagesFromSourcePath",
"(",
"$",
"path",
",",
"$",
"namespace",
")",
"{",
"$",
"messages",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
"->",
"exists",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
... | Return language messages for a path.
@param $path
@return array
@throws \Exception | [
"Return",
"language",
"messages",
"for",
"a",
"path",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Utilities/Localization/Generators/LangJsGenerator.php#L88-L109 |
240,997 | SocietyCMS/Core | Utilities/Localization/Generators/LangJsGenerator.php | LangJsGenerator.prepareTarget | protected function prepareTarget($target)
{
$dirname = dirname($target);
if (! $this->file->exists($dirname)) {
$this->file->makeDirectory($dirname);
}
} | php | protected function prepareTarget($target)
{
$dirname = dirname($target);
if (! $this->file->exists($dirname)) {
$this->file->makeDirectory($dirname);
}
} | [
"protected",
"function",
"prepareTarget",
"(",
"$",
"target",
")",
"{",
"$",
"dirname",
"=",
"dirname",
"(",
"$",
"target",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
"->",
"exists",
"(",
"$",
"dirname",
")",
")",
"{",
"$",
"this",
"->",
... | Prepare the target directoy.
@param string $target The target directory. | [
"Prepare",
"the",
"target",
"directoy",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Utilities/Localization/Generators/LangJsGenerator.php#L116-L122 |
240,998 | apioo/psx-oauth2 | src/Authorization/AuthorizationCode.php | AuthorizationCode.redirect | public static function redirect(Url $url, $clientId, $redirectUri = null, $scope = null, $state = null)
{
$parameters = $url->getParameters();
$parameters['response_type'] = 'code';
$parameters['client_id'] = $clientId;
if (isset($redirectUri)) {
$parameters['redirec... | php | public static function redirect(Url $url, $clientId, $redirectUri = null, $scope = null, $state = null)
{
$parameters = $url->getParameters();
$parameters['response_type'] = 'code';
$parameters['client_id'] = $clientId;
if (isset($redirectUri)) {
$parameters['redirec... | [
"public",
"static",
"function",
"redirect",
"(",
"Url",
"$",
"url",
",",
"$",
"clientId",
",",
"$",
"redirectUri",
"=",
"null",
",",
"$",
"scope",
"=",
"null",
",",
"$",
"state",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"$",
"url",
"->",
"get... | Helper method to start the flow by redirecting the user to the
authentication server. The getAccessToken method must be used when the
server redirects the user back to the redirect uri
@param \PSX\Uri\Url $url
@param string $clientId
@param string $redirectUri
@param string $scope
@param string $state | [
"Helper",
"method",
"to",
"start",
"the",
"flow",
"by",
"redirecting",
"the",
"user",
"to",
"the",
"authentication",
"server",
".",
"The",
"getAccessToken",
"method",
"must",
"be",
"used",
"when",
"the",
"server",
"redirects",
"the",
"user",
"back",
"to",
"t... | 60c6eb824393bfc49f9f60ae06b56543c8eab548 | https://github.com/apioo/psx-oauth2/blob/60c6eb824393bfc49f9f60ae06b56543c8eab548/src/Authorization/AuthorizationCode.php#L83-L102 |
240,999 | mszewcz/php-light-framework | src/Text/CharCount.php | CharCount.count | public static function count(string $text = '', bool $includeSpaces = false): int
{
if (\trim($text) === '') {
return 0;
}
$text = StripTags::strip($text);
$text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5);
$text = \preg_replace('/\s+/', $inc... | php | public static function count(string $text = '', bool $includeSpaces = false): int
{
if (\trim($text) === '') {
return 0;
}
$text = StripTags::strip($text);
$text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5);
$text = \preg_replace('/\s+/', $inc... | [
"public",
"static",
"function",
"count",
"(",
"string",
"$",
"text",
"=",
"''",
",",
"bool",
"$",
"includeSpaces",
"=",
"false",
")",
":",
"int",
"{",
"if",
"(",
"\\",
"trim",
"(",
"$",
"text",
")",
"===",
"''",
")",
"{",
"return",
"0",
";",
"}",... | Counts characters. Strips HTML tags. Treats multiple spaces as one.
@param string $text
@param bool $includeSpaces
@return int | [
"Counts",
"characters",
".",
"Strips",
"HTML",
"tags",
".",
"Treats",
"multiple",
"spaces",
"as",
"one",
"."
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Text/CharCount.php#L28-L39 |
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.