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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,000 | leedave/resource-mysql | src/Mysql.php | Mysql.loadByPrepStmt | public function loadByPrepStmt(
array $arrWhat = ['*'],
array $arrWhere = [],
array $arrOrder = ['`id` ASC'],
array $arrLimit = []
) : array
{
$arrStmt = [];
$strWhere = "";
if (count($arrWhere) > 0) {
$arrWhereNames = [];
foreac... | php | public function loadByPrepStmt(
array $arrWhat = ['*'],
array $arrWhere = [],
array $arrOrder = ['`id` ASC'],
array $arrLimit = []
) : array
{
$arrStmt = [];
$strWhere = "";
if (count($arrWhere) > 0) {
$arrWhereNames = [];
foreac... | [
"public",
"function",
"loadByPrepStmt",
"(",
"array",
"$",
"arrWhat",
"=",
"[",
"'*'",
"]",
",",
"array",
"$",
"arrWhere",
"=",
"[",
"]",
",",
"array",
"$",
"arrOrder",
"=",
"[",
"'`id` ASC'",
"]",
",",
"array",
"$",
"arrLimit",
"=",
"[",
"]",
")",
... | Get Rows from Table using a Prepared Statement
@param array $arrWhat
@param array $arrWhere associative ["name" => "Dave"] OR ["name" => ["operator" => "like", "value" => "Dave"]]
@param array $arrOrder
@param array $arrLimit
@return array | [
"Get",
"Rows",
"from",
"Table",
"using",
"a",
"Prepared",
"Statement"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Mysql.php#L395-L444 |
10,001 | leedave/resource-mysql | src/Mysql.php | Mysql.getJsonRows | public function getJsonRows(
array $arrWhat = ['*'],
array $arrWhere = [],
array $arrOrder = ['`id` ASC'],
array $arrLimit = []
) : string
{
$rows = $this->loadByPrepStmt($arrWhat, $arrWhere, $arrOrder, $arrLimit);
$json = json_encode($rows, JSON_UNESCAPED_UNIC... | php | public function getJsonRows(
array $arrWhat = ['*'],
array $arrWhere = [],
array $arrOrder = ['`id` ASC'],
array $arrLimit = []
) : string
{
$rows = $this->loadByPrepStmt($arrWhat, $arrWhere, $arrOrder, $arrLimit);
$json = json_encode($rows, JSON_UNESCAPED_UNIC... | [
"public",
"function",
"getJsonRows",
"(",
"array",
"$",
"arrWhat",
"=",
"[",
"'*'",
"]",
",",
"array",
"$",
"arrWhere",
"=",
"[",
"]",
",",
"array",
"$",
"arrOrder",
"=",
"[",
"'`id` ASC'",
"]",
",",
"array",
"$",
"arrLimit",
"=",
"[",
"]",
")",
":... | Extension to LoadByPrepStmt, this will return result as JSON instead of array
@param array $arrWhat
@param array $arrWhere
@param array $arrOrder
@param array $arrLimit
@return string JSON | [
"Extension",
"to",
"LoadByPrepStmt",
"this",
"will",
"return",
"result",
"as",
"JSON",
"instead",
"of",
"array"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Mysql.php#L454-L464 |
10,002 | leedave/resource-mysql | src/Mysql.php | Mysql.load | public function load(int $id)
{
$sql = "SELECT * FROM `".$this->tableName."` "
. "WHERE `".$this->primaryKey."` = '".$id."'"
. "LIMIT 0,1;";
$stmt = $this->db->query($sql);
try {
$row = $stmt->fetch(PDO::FETCH_ASSOC);
} catch (Exception $e... | php | public function load(int $id)
{
$sql = "SELECT * FROM `".$this->tableName."` "
. "WHERE `".$this->primaryKey."` = '".$id."'"
. "LIMIT 0,1;";
$stmt = $this->db->query($sql);
try {
$row = $stmt->fetch(PDO::FETCH_ASSOC);
} catch (Exception $e... | [
"public",
"function",
"load",
"(",
"int",
"$",
"id",
")",
"{",
"$",
"sql",
"=",
"\"SELECT * FROM `\"",
".",
"$",
"this",
"->",
"tableName",
".",
"\"` \"",
".",
"\"WHERE `\"",
".",
"$",
"this",
"->",
"primaryKey",
".",
"\"` = '\"",
".",
"$",
"id",
".",
... | Load specific entry from DB
@param int $id primary key
@return void | [
"Load",
"specific",
"entry",
"from",
"DB"
] | 68305dac50b1b956f08f41267d0b2912850d8232 | https://github.com/leedave/resource-mysql/blob/68305dac50b1b956f08f41267d0b2912850d8232/src/Mysql.php#L471-L489 |
10,003 | dave-redfern/somnambulist-doctrine-enum-bridge | src/EnumerationBridge.php | EnumerationBridge.registerEnumTypes | public static function registerEnumTypes(array $types = [])
{
foreach ($types as $name => $callbacks) {
[$constructor, $serializer] = (is_array($callbacks) ? $callbacks : [$callbacks, null]);
static::registerEnumType($name, $constructor, $serializer);
}
} | php | public static function registerEnumTypes(array $types = [])
{
foreach ($types as $name => $callbacks) {
[$constructor, $serializer] = (is_array($callbacks) ? $callbacks : [$callbacks, null]);
static::registerEnumType($name, $constructor, $serializer);
}
} | [
"public",
"static",
"function",
"registerEnumTypes",
"(",
"array",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"types",
"as",
"$",
"name",
"=>",
"$",
"callbacks",
")",
"{",
"[",
"$",
"constructor",
",",
"$",
"serializer",
"]",
"=",
"(... | Register a set of types with the provided constructor and serializer callables
@param array $types An Array of name => constructor or alias => [ constructor, serializer ]
@throws InvalidArgumentException
@throws DBALException | [
"Register",
"a",
"set",
"of",
"types",
"with",
"the",
"provided",
"constructor",
"and",
"serializer",
"callables"
] | 479763bdd9abd4f1e6a9d2d1b3ba0d8d28815e52 | https://github.com/dave-redfern/somnambulist-doctrine-enum-bridge/blob/479763bdd9abd4f1e6a9d2d1b3ba0d8d28815e52/src/EnumerationBridge.php#L67-L74 |
10,004 | dave-redfern/somnambulist-doctrine-enum-bridge | src/EnumerationBridge.php | EnumerationBridge.registerEnumType | public static function registerEnumType($name, callable $constructor, callable $serializer = null)
{
if (static::hasType($name)) {
return;
}
$serializer = $serializer ?? function ($value) { return ($value === null) ? null : (string)$value; };
// Register and customize t... | php | public static function registerEnumType($name, callable $constructor, callable $serializer = null)
{
if (static::hasType($name)) {
return;
}
$serializer = $serializer ?? function ($value) { return ($value === null) ? null : (string)$value; };
// Register and customize t... | [
"public",
"static",
"function",
"registerEnumType",
"(",
"$",
"name",
",",
"callable",
"$",
"constructor",
",",
"callable",
"$",
"serializer",
"=",
"null",
")",
"{",
"if",
"(",
"static",
"::",
"hasType",
"(",
"$",
"name",
")",
")",
"{",
"return",
";",
... | Registers an enumerable handler
@param string $name
@param callable $constructor Receives: value, enum name, platform
@param callable $serializer Receives: value, enum name, platform
@throws InvalidArgumentException
@throws DBALException | [
"Registers",
"an",
"enumerable",
"handler"
] | 479763bdd9abd4f1e6a9d2d1b3ba0d8d28815e52 | https://github.com/dave-redfern/somnambulist-doctrine-enum-bridge/blob/479763bdd9abd4f1e6a9d2d1b3ba0d8d28815e52/src/EnumerationBridge.php#L86-L102 |
10,005 | elcodi/Template | Command/TemplatesLoadCommand.php | TemplatesLoadCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$formatter = $this->getHelper('formatter');
$templates = $this
->templateManager
->loadTemplates();
foreach ($templates as $template) {
$formattedLine = $formatter->formatSection... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$formatter = $this->getHelper('formatter');
$templates = $this
->templateManager
->loadTemplates();
foreach ($templates as $template) {
$formattedLine = $formatter->formatSection... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"formatter",
"=",
"$",
"this",
"->",
"getHelper",
"(",
"'formatter'",
")",
";",
"$",
"templates",
"=",
"$",
"this",
"->",
"templa... | This command loads all the templates installed
@param InputInterface $input The input interface
@param OutputInterface $output The output interface
@return void | [
"This",
"command",
"loads",
"all",
"the",
"templates",
"installed"
] | ffc19d5a0ac385364f04f93414e1192aaae120e2 | https://github.com/elcodi/Template/blob/ffc19d5a0ac385364f04f93414e1192aaae120e2/Command/TemplatesLoadCommand.php#L68-L83 |
10,006 | TechPromux/TechPromuxBaseBundle | Manager/BaseManager.php | BaseManager.throwException | public function throwException($message = '', $type = 'default')
{
switch ($type) {
case 'access-denied':
throw new AccessDeniedException($message);
case 'not-found':
throw new NotFoundHttpException($message);
case 'runtime':
... | php | public function throwException($message = '', $type = 'default')
{
switch ($type) {
case 'access-denied':
throw new AccessDeniedException($message);
case 'not-found':
throw new NotFoundHttpException($message);
case 'runtime':
... | [
"public",
"function",
"throwException",
"(",
"$",
"message",
"=",
"''",
",",
"$",
"type",
"=",
"'default'",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'access-denied'",
":",
"throw",
"new",
"AccessDeniedException",
"(",
"$",
"message",
")",
... | Throw an Exception
@param string $type
@param string $message
@throws \RuntimeException
@throws NotFoundHttpException
@throws AccessDeniedException
@throws \Exception | [
"Throw",
"an",
"Exception"
] | 2569b84cf5c024fd908a13a0f129def19050acd2 | https://github.com/TechPromux/TechPromuxBaseBundle/blob/2569b84cf5c024fd908a13a0f129def19050acd2/Manager/BaseManager.php#L55-L67 |
10,007 | TechPromux/TechPromuxBaseBundle | Manager/BaseManager.php | BaseManager.addNamedParameter | protected function addNamedParameter($name, $value, $queryBuilder, $type = null)
{
$bound_suffix = '_' . (microtime(true) * 10000) . '_' . random_int(1000, 9999) . '_' . count($queryBuilder->getParameters());
$placeHolder = ":" . $name . $bound_suffix;
$queryBuilder->setParameter(substr($pla... | php | protected function addNamedParameter($name, $value, $queryBuilder, $type = null)
{
$bound_suffix = '_' . (microtime(true) * 10000) . '_' . random_int(1000, 9999) . '_' . count($queryBuilder->getParameters());
$placeHolder = ":" . $name . $bound_suffix;
$queryBuilder->setParameter(substr($pla... | [
"protected",
"function",
"addNamedParameter",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"queryBuilder",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"bound_suffix",
"=",
"'_'",
".",
"(",
"microtime",
"(",
"true",
")",
"*",
"10000",
")",
".",
"'... | Add a new parameter to queryBuilder
@param string $name
@param mixed $value
@param QueryBuilder $queryBuilder
@param mixed $type
@return string | [
"Add",
"a",
"new",
"parameter",
"to",
"queryBuilder"
] | 2569b84cf5c024fd908a13a0f129def19050acd2 | https://github.com/TechPromux/TechPromuxBaseBundle/blob/2569b84cf5c024fd908a13a0f129def19050acd2/Manager/BaseManager.php#L107-L113 |
10,008 | TechPromux/TechPromuxBaseBundle | Manager/BaseManager.php | BaseManager.getResultFromQueryBuilder | protected function getResultFromQueryBuilder(\Doctrine\ORM\QueryBuilder $queryBuilder)
{
$query = $queryBuilder->getQuery();
$result = $query->getResult();
return $result;
} | php | protected function getResultFromQueryBuilder(\Doctrine\ORM\QueryBuilder $queryBuilder)
{
$query = $queryBuilder->getQuery();
$result = $query->getResult();
return $result;
} | [
"protected",
"function",
"getResultFromQueryBuilder",
"(",
"\\",
"Doctrine",
"\\",
"ORM",
"\\",
"QueryBuilder",
"$",
"queryBuilder",
")",
"{",
"$",
"query",
"=",
"$",
"queryBuilder",
"->",
"getQuery",
"(",
")",
";",
"$",
"result",
"=",
"$",
"query",
"->",
... | Get result from execution of queryBuilder
@param QueryBuilder $queryBuilder
@return ArrayCollection | [
"Get",
"result",
"from",
"execution",
"of",
"queryBuilder"
] | 2569b84cf5c024fd908a13a0f129def19050acd2 | https://github.com/TechPromux/TechPromuxBaseBundle/blob/2569b84cf5c024fd908a13a0f129def19050acd2/Manager/BaseManager.php#L122-L130 |
10,009 | TechPromux/TechPromuxBaseBundle | Manager/BaseManager.php | BaseManager.getOneOrNullResultFromQueryBuilder | protected function getOneOrNullResultFromQueryBuilder(QueryBuilder $queryBuilder)
{
$query = $queryBuilder->getQuery();
$result = $query->getOneOrNullResult();
return $result;
} | php | protected function getOneOrNullResultFromQueryBuilder(QueryBuilder $queryBuilder)
{
$query = $queryBuilder->getQuery();
$result = $query->getOneOrNullResult();
return $result;
} | [
"protected",
"function",
"getOneOrNullResultFromQueryBuilder",
"(",
"QueryBuilder",
"$",
"queryBuilder",
")",
"{",
"$",
"query",
"=",
"$",
"queryBuilder",
"->",
"getQuery",
"(",
")",
";",
"$",
"result",
"=",
"$",
"query",
"->",
"getOneOrNullResult",
"(",
")",
... | Get one result from execution of queryBuilder
@param QueryBuilder $queryBuilder
@return mixed; | [
"Get",
"one",
"result",
"from",
"execution",
"of",
"queryBuilder"
] | 2569b84cf5c024fd908a13a0f129def19050acd2 | https://github.com/TechPromux/TechPromuxBaseBundle/blob/2569b84cf5c024fd908a13a0f129def19050acd2/Manager/BaseManager.php#L139-L146 |
10,010 | ekyna/CartBundle | Controller/CartController.php | CartController.informationsAction | public function informationsAction(Request $request)
{
if (null !== $redirect = $this->validateStep('information')) {
return $redirect;
}
$cart = $this->getCart();
/** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
$user = $this->getUser();
i... | php | public function informationsAction(Request $request)
{
if (null !== $redirect = $this->validateStep('information')) {
return $redirect;
}
$cart = $this->getCart();
/** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
$user = $this->getUser();
i... | [
"public",
"function",
"informationsAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"redirect",
"=",
"$",
"this",
"->",
"validateStep",
"(",
"'information'",
")",
")",
"{",
"return",
"$",
"redirect",
";",
"}",
"$",
"cart"... | Informations action.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|Response | [
"Informations",
"action",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L64-L106 |
10,011 | ekyna/CartBundle | Controller/CartController.php | CartController.shipmentAction | public function shipmentAction(Request $request)
{
if (null !== $redirect = $this->validateStep('shipment')) {
return $redirect;
}
$cart = $this->getCart();
// Go to payment page if no shipment required
if (!$cart->requiresShipment()) {
return $this-... | php | public function shipmentAction(Request $request)
{
if (null !== $redirect = $this->validateStep('shipment')) {
return $redirect;
}
$cart = $this->getCart();
// Go to payment page if no shipment required
if (!$cart->requiresShipment()) {
return $this-... | [
"public",
"function",
"shipmentAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"redirect",
"=",
"$",
"this",
"->",
"validateStep",
"(",
"'shipment'",
")",
")",
"{",
"return",
"$",
"redirect",
";",
"}",
"$",
"cart",
"="... | Shipment action.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|Response | [
"Shipment",
"action",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L114-L147 |
10,012 | ekyna/CartBundle | Controller/CartController.php | CartController.paymentAction | public function paymentAction(Request $request)
{
if (null !== $redirect = $this->validateStep('payment')) {
return $redirect;
}
$cart = $this->getCart();
$amount = $this
->get('ekyna_order.order.calculator')
->calculateOrderRemainingTotal($cart)... | php | public function paymentAction(Request $request)
{
if (null !== $redirect = $this->validateStep('payment')) {
return $redirect;
}
$cart = $this->getCart();
$amount = $this
->get('ekyna_order.order.calculator')
->calculateOrderRemainingTotal($cart)... | [
"public",
"function",
"paymentAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"redirect",
"=",
"$",
"this",
"->",
"validateStep",
"(",
"'payment'",
")",
")",
"{",
"return",
"$",
"redirect",
";",
"}",
"$",
"cart",
"=",
... | Payment action.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|Response | [
"Payment",
"action",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L155-L191 |
10,013 | ekyna/CartBundle | Controller/CartController.php | CartController.confirmationAction | public function confirmationAction(Request $request)
{
/** @var \Ekyna\Component\Sale\Order\OrderInterface $order */
$order = $this->get('ekyna_order.order.repository')->findOneByKey(
$request->attributes->get('orderKey')
);
if (null === $order) {
throw new N... | php | public function confirmationAction(Request $request)
{
/** @var \Ekyna\Component\Sale\Order\OrderInterface $order */
$order = $this->get('ekyna_order.order.repository')->findOneByKey(
$request->attributes->get('orderKey')
);
if (null === $order) {
throw new N... | [
"public",
"function",
"confirmationAction",
"(",
"Request",
"$",
"request",
")",
"{",
"/** @var \\Ekyna\\Component\\Sale\\Order\\OrderInterface $order */",
"$",
"order",
"=",
"$",
"this",
"->",
"get",
"(",
"'ekyna_order.order.repository'",
")",
"->",
"findOneByKey",
"(",
... | Confirmation action.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|Response | [
"Confirmation",
"action",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L199-L232 |
10,014 | ekyna/CartBundle | Controller/CartController.php | CartController.resetAction | public function resetAction(Request $request)
{
$cart = $this->getCart();
$event = new OrderEvent($cart);
$this->get('ekyna_order.order.operator')->delete($event, true);
if (!$event->hasErrors()) {
$this->addFlash('ekyna_cart.message.reset');
} else {
... | php | public function resetAction(Request $request)
{
$cart = $this->getCart();
$event = new OrderEvent($cart);
$this->get('ekyna_order.order.operator')->delete($event, true);
if (!$event->hasErrors()) {
$this->addFlash('ekyna_cart.message.reset');
} else {
... | [
"public",
"function",
"resetAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"cart",
"=",
"$",
"this",
"->",
"getCart",
"(",
")",
";",
"$",
"event",
"=",
"new",
"OrderEvent",
"(",
"$",
"cart",
")",
";",
"$",
"this",
"->",
"get",
"(",
"'ekyna... | Reset action.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Reset",
"action",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L240-L252 |
10,015 | ekyna/CartBundle | Controller/CartController.php | CartController.removeItemAction | public function removeItemAction(Request $request)
{
$cart = $this->getCart();
$item = $this->getDoctrine()
->getRepository('EkynaOrderBundle:OrderItem')
->findOneBy([
'id' => $request->attributes->get('itemId'),
'orderId' => $cart->getId(),
... | php | public function removeItemAction(Request $request)
{
$cart = $this->getCart();
$item = $this->getDoctrine()
->getRepository('EkynaOrderBundle:OrderItem')
->findOneBy([
'id' => $request->attributes->get('itemId'),
'orderId' => $cart->getId(),
... | [
"public",
"function",
"removeItemAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"cart",
"=",
"$",
"this",
"->",
"getCart",
"(",
")",
";",
"$",
"item",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"'EkynaOrderBundl... | Remove item action.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|Response
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | [
"Remove",
"item",
"action",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L261-L295 |
10,016 | ekyna/CartBundle | Controller/CartController.php | CartController.validateStep | protected function validateStep($step)
{
$stepGroups = [
'information' => ['ekyna_cart_index', ['Default', 'Cart']],
'shipment' => ['ekyna_cart_informations', ['Default', 'Cart', 'Information']],
'payment' => ['ekyna_cart_shipment', ['Default', 'Cart', '... | php | protected function validateStep($step)
{
$stepGroups = [
'information' => ['ekyna_cart_index', ['Default', 'Cart']],
'shipment' => ['ekyna_cart_informations', ['Default', 'Cart', 'Information']],
'payment' => ['ekyna_cart_shipment', ['Default', 'Cart', '... | [
"protected",
"function",
"validateStep",
"(",
"$",
"step",
")",
"{",
"$",
"stepGroups",
"=",
"[",
"'information'",
"=>",
"[",
"'ekyna_cart_index'",
",",
"[",
"'Default'",
",",
"'Cart'",
"]",
"]",
",",
"'shipment'",
"=>",
"[",
"'ekyna_cart_informations'",
",",
... | Validates the cart for the given step name.
@param string $step
@return null|\Symfony\Component\HttpFoundation\RedirectResponse | [
"Validates",
"the",
"cart",
"for",
"the",
"given",
"step",
"name",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L303-L321 |
10,017 | ekyna/CartBundle | Controller/CartController.php | CartController.securityCheck | protected function securityCheck(Request $request)
{
if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
$request->getSession()->set('_ekyna.login_success.target_path', 'ekyna_cart_informations');
return $this->redirect($this->generateUrl('f... | php | protected function securityCheck(Request $request)
{
if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
$request->getSession()->set('_ekyna.login_success.target_path', 'ekyna_cart_informations');
return $this->redirect($this->generateUrl('f... | [
"protected",
"function",
"securityCheck",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"get",
"(",
"'security.authorization_checker'",
")",
"->",
"isGranted",
"(",
"'IS_AUTHENTICATED_REMEMBERED'",
")",
")",
"{",
"$",
"request",
... | Check that user is logged.
@param Request $request
@return null|\Symfony\Component\HttpFoundation\RedirectResponse | [
"Check",
"that",
"user",
"is",
"logged",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L329-L336 |
10,018 | ekyna/CartBundle | Controller/CartController.php | CartController.redirectAfterContentChange | protected function redirectAfterContentChange(Request $request)
{
if (null !== $referer = $request->headers->get('referer', null)) {
return $this->redirect($referer);
}
return $this->redirect($this->generateUrl('ekyna_cart_index'));
} | php | protected function redirectAfterContentChange(Request $request)
{
if (null !== $referer = $request->headers->get('referer', null)) {
return $this->redirect($referer);
}
return $this->redirect($this->generateUrl('ekyna_cart_index'));
} | [
"protected",
"function",
"redirectAfterContentChange",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"referer",
"=",
"$",
"request",
"->",
"headers",
"->",
"get",
"(",
"'referer'",
",",
"null",
")",
")",
"{",
"return",
"$",
"th... | Redirects after order content changed.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Redirects",
"after",
"order",
"content",
"changed",
"."
] | c486af3d027873c81c7b61ef71980e8062c3dddd | https://github.com/ekyna/CartBundle/blob/c486af3d027873c81c7b61ef71980e8062c3dddd/Controller/CartController.php#L344-L351 |
10,019 | las93/attila | Attila/core/Model.php | Model.find | public function find($oEntityCriteria)
{
$this->_checkEntity($oEntityCriteria);
$aEntity = get_object_vars(LibEntity::getRealEntity($oEntityCriteria));
$sPrimaryKeyName = LibEntity::getPrimaryKeyName($oEntityCriteria);
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
... | php | public function find($oEntityCriteria)
{
$this->_checkEntity($oEntityCriteria);
$aEntity = get_object_vars(LibEntity::getRealEntity($oEntityCriteria));
$sPrimaryKeyName = LibEntity::getPrimaryKeyName($oEntityCriteria);
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
... | [
"public",
"function",
"find",
"(",
"$",
"oEntityCriteria",
")",
"{",
"$",
"this",
"->",
"_checkEntity",
"(",
"$",
"oEntityCriteria",
")",
";",
"$",
"aEntity",
"=",
"get_object_vars",
"(",
"LibEntity",
"::",
"getRealEntity",
"(",
"$",
"oEntityCriteria",
")",
... | classic method to find an entity
@access public
@param object $oEntityCriteria
@return array | [
"classic",
"method",
"to",
"find",
"an",
"entity"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L130-L154 |
10,020 | las93/attila | Attila/core/Model.php | Model.findOneBy | public function findOneBy(array $aArguments)
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
->where($aArguments)
->limit(1)
->load(fa... | php | public function findOneBy(array $aArguments)
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
->where($aArguments)
->limit(1)
->load(fa... | [
"public",
"function",
"findOneBy",
"(",
"array",
"$",
"aArguments",
")",
"{",
"$",
"sEntityNamespace",
"=",
"preg_replace",
"(",
"'/^(.*)Model\\\\\\\\.+$/'",
",",
"'$1Entity\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"aResults",
"=",
"$",
"this",
... | return an entity that it is found with the arguments
@access public
@param array $aArguments
@return object
@example $oModel->findOneBy(array('id' => 12); | [
"return",
"an",
"entity",
"that",
"it",
"is",
"found",
"with",
"the",
"arguments"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L292-L307 |
10,021 | las93/attila | Attila/core/Model.php | Model.findOrderBy | public function findOrderBy(array $aArguments)
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
->orderBy($aArguments)
->load(false, $sEntityName... | php | public function findOrderBy(array $aArguments)
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
->orderBy($aArguments)
->load(false, $sEntityName... | [
"public",
"function",
"findOrderBy",
"(",
"array",
"$",
"aArguments",
")",
"{",
"$",
"sEntityNamespace",
"=",
"preg_replace",
"(",
"'/^(.*)Model\\\\\\\\.+$/'",
",",
"'$1Entity\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"aResults",
"=",
"$",
"this",... | return list of entities that they are found with the arguments
@access public
@param array $aArguments
@return array
@example $oModel->findOrderBy(array('id DESC'); | [
"return",
"list",
"of",
"entities",
"that",
"they",
"are",
"found",
"with",
"the",
"arguments"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L373-L392 |
10,022 | las93/attila | Attila/core/Model.php | Model.getLastRow | public function getLastRow()
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
->orderBy(array(LibEntity::getPrimaryKeyName($this->entity) => 'DESC'))
->li... | php | public function getLastRow()
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$aResults = $this->orm
->select(array('*'))
->from($this->_sTableName)
->orderBy(array(LibEntity::getPrimaryKeyName($this->entity) => 'DESC'))
->li... | [
"public",
"function",
"getLastRow",
"(",
")",
"{",
"$",
"sEntityNamespace",
"=",
"preg_replace",
"(",
"'/^(.*)Model\\\\\\\\.+$/'",
",",
"'$1Entity\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"aResults",
"=",
"$",
"this",
"->",
"orm",
"->",
"select... | get last row
@access public
@return object | [
"get",
"last",
"row"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L516-L530 |
10,023 | las93/attila | Attila/core/Model.php | Model.insertAndGet | public function insertAndGet($oEntity)
{
$iResult = $this->insert($oEntity);
if ($iResult) { return $this->getLastRow(); }
return $iResult;
} | php | public function insertAndGet($oEntity)
{
$iResult = $this->insert($oEntity);
if ($iResult) { return $this->getLastRow(); }
return $iResult;
} | [
"public",
"function",
"insertAndGet",
"(",
"$",
"oEntity",
")",
"{",
"$",
"iResult",
"=",
"$",
"this",
"->",
"insert",
"(",
"$",
"oEntity",
")",
";",
"if",
"(",
"$",
"iResult",
")",
"{",
"return",
"$",
"this",
"->",
"getLastRow",
"(",
")",
";",
"}"... | save Entity and get it
@access public
@param object $oEntity
@return int|object | [
"save",
"Entity",
"and",
"get",
"it"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L539-L546 |
10,024 | las93/attila | Attila/core/Model.php | Model.updateAndGet | public function updateAndGet($oEntity)
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$mResult = $this->update($oEntity);
if ($result) {
$aEntity = get_object_vars(LibEntity::getRealEntity($oEntity));
$mPrimaryKey = LibEntity::getPrimaryKeyName($aEnt... | php | public function updateAndGet($oEntity)
{
$sEntityNamespace = preg_replace('/^(.*)Model\\\\.+$/', '$1Entity\\', get_called_class());
$mResult = $this->update($oEntity);
if ($result) {
$aEntity = get_object_vars(LibEntity::getRealEntity($oEntity));
$mPrimaryKey = LibEntity::getPrimaryKeyName($aEnt... | [
"public",
"function",
"updateAndGet",
"(",
"$",
"oEntity",
")",
"{",
"$",
"sEntityNamespace",
"=",
"preg_replace",
"(",
"'/^(.*)Model\\\\\\\\.+$/'",
",",
"'$1Entity\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"mResult",
"=",
"$",
"this",
"->",
"up... | update Entity and get it
@access public
@param object $oEntityCriteria
@return mixed | [
"update",
"Entity",
"and",
"get",
"it"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L555-L582 |
10,025 | las93/attila | Attila/core/Model.php | Model.delete | public function delete($oEntityCriteria)
{
$this->_checkEntity($oEntityCriteria);
$aEntity = LibEntity::getAllEntity($oEntityCriteria, true);
$this->orm
->delete($this->_sTableName)
->where($aEntity)
->save();
return $this;
} | php | public function delete($oEntityCriteria)
{
$this->_checkEntity($oEntityCriteria);
$aEntity = LibEntity::getAllEntity($oEntityCriteria, true);
$this->orm
->delete($this->_sTableName)
->where($aEntity)
->save();
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"oEntityCriteria",
")",
"{",
"$",
"this",
"->",
"_checkEntity",
"(",
"$",
"oEntityCriteria",
")",
";",
"$",
"aEntity",
"=",
"LibEntity",
"::",
"getAllEntity",
"(",
"$",
"oEntityCriteria",
",",
"true",
")",
";",
"$"... | classic method to delete one entities
@access public
@param object $oEntityCriteria
@return object | [
"classic",
"method",
"to",
"delete",
"one",
"entities"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L591-L603 |
10,026 | las93/attila | Attila/core/Model.php | Model.truncate | public function truncate()
{
$aClass = explode('\\', get_called_class());
$sClassName = $aClass[count($aClass) - 1];
$this->orm
->truncate($sClassName)
->save();
return $this;
} | php | public function truncate()
{
$aClass = explode('\\', get_called_class());
$sClassName = $aClass[count($aClass) - 1];
$this->orm
->truncate($sClassName)
->save();
return $this;
} | [
"public",
"function",
"truncate",
"(",
")",
"{",
"$",
"aClass",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"sClassName",
"=",
"$",
"aClass",
"[",
"count",
"(",
"$",
"aClass",
")",
"-",
"1",
"]",
";",
"$",
"this... | classic method to truncate a table
@access public
@return object | [
"classic",
"method",
"to",
"truncate",
"a",
"table"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L611-L621 |
10,027 | las93/attila | Attila/core/Model.php | Model._checkEntity | private function _checkEntity($oEntityCriteria)
{
$sClassName = get_called_class();
$sClassName = str_replace('Model', 'Entity', $sClassName);
if (!is_object($oEntityCriteria) || !$oEntityCriteria instanceof $sClassName) {
throw new \Exception('You must passed '.$sClassName.' like Entity!');
}
} | php | private function _checkEntity($oEntityCriteria)
{
$sClassName = get_called_class();
$sClassName = str_replace('Model', 'Entity', $sClassName);
if (!is_object($oEntityCriteria) || !$oEntityCriteria instanceof $sClassName) {
throw new \Exception('You must passed '.$sClassName.' like Entity!');
}
} | [
"private",
"function",
"_checkEntity",
"(",
"$",
"oEntityCriteria",
")",
"{",
"$",
"sClassName",
"=",
"get_called_class",
"(",
")",
";",
"$",
"sClassName",
"=",
"str_replace",
"(",
"'Model'",
",",
"'Entity'",
",",
"$",
"sClassName",
")",
";",
"if",
"(",
"!... | check if the entity passed is good
@access private
@param object $oEntityCriteria
@return void | [
"check",
"if",
"the",
"entity",
"passed",
"is",
"good"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L643-L652 |
10,028 | las93/attila | Attila/core/Model.php | Model._applyFilter | private function _applyFilter($oResult)
{
$oResult = $this->_cFilterCallback($oResult);
foreach($this->_aHasOne as $sKey => $aParam) {
$oResult->hasOne($aParam[0], $aParam[1], $aParam[2], $aParam[3], $aParam[4]);
}
foreach($this->_aHasMany as $sKey => $aParam) {
... | php | private function _applyFilter($oResult)
{
$oResult = $this->_cFilterCallback($oResult);
foreach($this->_aHasOne as $sKey => $aParam) {
$oResult->hasOne($aParam[0], $aParam[1], $aParam[2], $aParam[3], $aParam[4]);
}
foreach($this->_aHasMany as $sKey => $aParam) {
... | [
"private",
"function",
"_applyFilter",
"(",
"$",
"oResult",
")",
"{",
"$",
"oResult",
"=",
"$",
"this",
"->",
"_cFilterCallback",
"(",
"$",
"oResult",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aHasOne",
"as",
"$",
"sKey",
"=>",
"$",
"aParam",
")",... | apply the filter on the result and add the join
@access private
@param object $oResult result to apply filter
@return object | [
"apply",
"the",
"filter",
"on",
"the",
"result",
"and",
"add",
"the",
"join"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L661-L676 |
10,029 | las93/attila | Attila/core/Model.php | Model.belongsTo | public function belongsTo($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sNamespaceEntity, array $aOptions = array())
{
$this->_aHasOne[$sEntityJoinName] = array($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sNamespaceEntity);
} | php | public function belongsTo($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sNamespaceEntity, array $aOptions = array())
{
$this->_aHasOne[$sEntityJoinName] = array($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sNamespaceEntity);
} | [
"public",
"function",
"belongsTo",
"(",
"$",
"sPrimaryKeyName",
",",
"$",
"sEntityJoinName",
",",
"$",
"sForeignKeyName",
",",
"$",
"sNamespaceEntity",
",",
"array",
"$",
"aOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_aHasOne",
"[",
"$"... | create a join in many to one
@access public
@param string $sPrimaryKeyName
@param string $sEntityJoinName
@param string $sForeignKeyName
@param string $sNamespaceEntity
@param array $aOptions
@return object | [
"create",
"a",
"join",
"in",
"many",
"to",
"one"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L702-L705 |
10,030 | las93/attila | Attila/core/Model.php | Model.hasManyToMany | public function hasManyToMany($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sNamespaceEntity, $sManyToManyKeyName, $sManyToManyTableName, array $aOptions = array())
{
$this->_ahasMany[$sEntityJoinName] = function($mParameters = null) use ($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sManyToMany... | php | public function hasManyToMany($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sNamespaceEntity, $sManyToManyKeyName, $sManyToManyTableName, array $aOptions = array())
{
$this->_ahasMany[$sEntityJoinName] = function($mParameters = null) use ($sPrimaryKeyName, $sEntityJoinName, $sForeignKeyName, $sManyToMany... | [
"public",
"function",
"hasManyToMany",
"(",
"$",
"sPrimaryKeyName",
",",
"$",
"sEntityJoinName",
",",
"$",
"sForeignKeyName",
",",
"$",
"sNamespaceEntity",
",",
"$",
"sManyToManyKeyName",
",",
"$",
"sManyToManyTableName",
",",
"array",
"$",
"aOptions",
"=",
"array... | create a join in many to many
@access public
@param string $sPrimaryKeyName
@param string $sEntityJoinName
@param string $sForeignKeyName
@param string $sNamespaceEntity
@param unknown $sManyToManyKeyName
@param unknown $sManyToManyTableName
@param array $aOptions
@return object | [
"create",
"a",
"join",
"in",
"many",
"to",
"many"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/core/Model.php#L720-L772 |
10,031 | octris/parser | libs/Parser/Grammar.php | Grammar.addRule | public function addRule($id, array $rule, $initial = false)
{
if (isset($this->rules[$id])) {
throw new \Exception('Rule is already defined!');
}
// { validate
$iterator = new \RecursiveIteratorIterator(
new \RecursiveArrayIterator($rule),
true
... | php | public function addRule($id, array $rule, $initial = false)
{
if (isset($this->rules[$id])) {
throw new \Exception('Rule is already defined!');
}
// { validate
$iterator = new \RecursiveIteratorIterator(
new \RecursiveArrayIterator($rule),
true
... | [
"public",
"function",
"addRule",
"(",
"$",
"id",
",",
"array",
"$",
"rule",
",",
"$",
"initial",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"rules",
"[",
"$",
"id",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
... | Add a rule to the grammar.
@param int|string $id Token identifier to apply the rule for.
@param array $rule Grammar rule.
@param bool $initial Whether to set the rule as initial. | [
"Add",
"a",
"rule",
"to",
"the",
"grammar",
"."
] | 17d155586fdfbb4f6fd973c48d8758114084e000 | https://github.com/octris/parser/blob/17d155586fdfbb4f6fd973c48d8758114084e000/libs/Parser/Grammar.php#L71-L111 |
10,032 | octris/parser | libs/Parser/Grammar.php | Grammar.addEvent | public function addEvent($id, callable $cb)
{
if (!isset($this->events[$id])) {
$this->events[$id] = [];
}
$this->events[$id][] = $cb;
} | php | public function addEvent($id, callable $cb)
{
if (!isset($this->events[$id])) {
$this->events[$id] = [];
}
$this->events[$id][] = $cb;
} | [
"public",
"function",
"addEvent",
"(",
"$",
"id",
",",
"callable",
"$",
"cb",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"events",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"this",
"->",
"events",
"[",
"$",
"id",
"]",
"=",
"[",... | Add an event for a token.
@param int $id Token identifier.
@param callable $cb Callback to call if the token occurs. | [
"Add",
"an",
"event",
"for",
"a",
"token",
"."
] | 17d155586fdfbb4f6fd973c48d8758114084e000 | https://github.com/octris/parser/blob/17d155586fdfbb4f6fd973c48d8758114084e000/libs/Parser/Grammar.php#L119-L126 |
10,033 | octris/parser | libs/Parser/Grammar.php | Grammar.getEBNF | public function getEBNF()
{
$glue = array(
'$concatenation' => array('', ' , ', ''),
'$alternation' => array('( ', ' | ', ' )'),
'$repeat' => array('{ ', '', ' }'),
'$option' => array('[ ', '', ' ]')
);
$render = function ($rul... | php | public function getEBNF()
{
$glue = array(
'$concatenation' => array('', ' , ', ''),
'$alternation' => array('( ', ' | ', ' )'),
'$repeat' => array('{ ', '', ' }'),
'$option' => array('[ ', '', ' ]')
);
$render = function ($rul... | [
"public",
"function",
"getEBNF",
"(",
")",
"{",
"$",
"glue",
"=",
"array",
"(",
"'$concatenation'",
"=>",
"array",
"(",
"''",
",",
"' , '",
",",
"''",
")",
",",
"'$alternation'",
"=>",
"array",
"(",
"'( '",
",",
"' | '",
",",
"' )'",
")",
",",
"'$rep... | Return the EBNF for the defined grammar.
@return string The EBNF. | [
"Return",
"the",
"EBNF",
"for",
"the",
"defined",
"grammar",
"."
] | 17d155586fdfbb4f6fd973c48d8758114084e000 | https://github.com/octris/parser/blob/17d155586fdfbb4f6fd973c48d8758114084e000/libs/Parser/Grammar.php#L164-L198 |
10,034 | watoki/cfg | src/watoki/cfg/cli/CreateUserConfigurationCommand.php | CreateUserConfigurationCommand.doExecute | public function doExecute(Console $console) {
if (file_exists($this->targetFile)) {
$console->out->writeLine('Already exists');
return;
}
$creator = new Creator();
$creator->createStub($this->baseClass, $this->targetFile);
$console->out->writeLine('Create... | php | public function doExecute(Console $console) {
if (file_exists($this->targetFile)) {
$console->out->writeLine('Already exists');
return;
}
$creator = new Creator();
$creator->createStub($this->baseClass, $this->targetFile);
$console->out->writeLine('Create... | [
"public",
"function",
"doExecute",
"(",
"Console",
"$",
"console",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"targetFile",
")",
")",
"{",
"$",
"console",
"->",
"out",
"->",
"writeLine",
"(",
"'Already exists'",
")",
";",
"return",
";",
... | Creates a user configuration class to overwrite a default configuration | [
"Creates",
"a",
"user",
"configuration",
"class",
"to",
"overwrite",
"a",
"default",
"configuration"
] | 06daffb046ff0a0de02fc29196efc3b414a31ed7 | https://github.com/watoki/cfg/blob/06daffb046ff0a0de02fc29196efc3b414a31ed7/src/watoki/cfg/cli/CreateUserConfigurationCommand.php#L32-L41 |
10,035 | sebastianmonzel/webfiles-framework-php | source/core/datasystem/database/MDatabaseConnection.php | MDatabaseConnection.getInstance | static public function getInstance($instanceName)
{
if (!isset(self::$instanceArray[$instanceName])) {
self::$instanceArray[$instanceName] = new MDatabaseConnection();
}
return self::$instanceArray[$instanceName];
} | php | static public function getInstance($instanceName)
{
if (!isset(self::$instanceArray[$instanceName])) {
self::$instanceArray[$instanceName] = new MDatabaseConnection();
}
return self::$instanceArray[$instanceName];
} | [
"static",
"public",
"function",
"getInstance",
"(",
"$",
"instanceName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instanceArray",
"[",
"$",
"instanceName",
"]",
")",
")",
"{",
"self",
"::",
"$",
"instanceArray",
"[",
"$",
"instanceName... | multiton to administrate the instances of the connection
and global accessing
@param String $instanceName
@return object | [
"multiton",
"to",
"administrate",
"the",
"instances",
"of",
"the",
"connection",
"and",
"global",
"accessing"
] | 5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d | https://github.com/sebastianmonzel/webfiles-framework-php/blob/5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d/source/core/datasystem/database/MDatabaseConnection.php#L72-L78 |
10,036 | sebastianmonzel/webfiles-framework-php | source/core/datasystem/database/MDatabaseConnection.php | MDatabaseConnection.connect | public function connect()
{
$this->connection = @new \mysqli(
$this->host,
$this->username,
$this->password,
$this->databaseName
);
if (!$this->connection->connect_errno) {
$this->connection->autocommit(1);
return true;... | php | public function connect()
{
$this->connection = @new \mysqli(
$this->host,
$this->username,
$this->password,
$this->databaseName
);
if (!$this->connection->connect_errno) {
$this->connection->autocommit(1);
return true;... | [
"public",
"function",
"connect",
"(",
")",
"{",
"$",
"this",
"->",
"connection",
"=",
"@",
"new",
"\\",
"mysqli",
"(",
"$",
"this",
"->",
"host",
",",
"$",
"this",
"->",
"username",
",",
"$",
"this",
"->",
"password",
",",
"$",
"this",
"->",
"datab... | connects to the database server | [
"connects",
"to",
"the",
"database",
"server"
] | 5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d | https://github.com/sebastianmonzel/webfiles-framework-php/blob/5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d/source/core/datasystem/database/MDatabaseConnection.php#L83-L98 |
10,037 | sebastianmonzel/webfiles-framework-php | source/core/datasystem/database/MDatabaseConnection.php | MDatabaseConnection.query | public function query($sqlCommand)
{
$result = $this->connection->query($sqlCommand);
if ($this->getError() != null ) {
throw new MWebfilesFrameworkException("Error orrured on executing sql: " . $this->getError() .", SQL: " . $sqlCommand);
}
return $result;
} | php | public function query($sqlCommand)
{
$result = $this->connection->query($sqlCommand);
if ($this->getError() != null ) {
throw new MWebfilesFrameworkException("Error orrured on executing sql: " . $this->getError() .", SQL: " . $sqlCommand);
}
return $result;
} | [
"public",
"function",
"query",
"(",
"$",
"sqlCommand",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"connection",
"->",
"query",
"(",
"$",
"sqlCommand",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getError",
"(",
")",
"!=",
"null",
")",
"{",
"thro... | queries the database with the specified sql command
@param $sqlCommand
@return bool|\mysqli_result
@internal param String $p_sSqlCommand | [
"queries",
"the",
"database",
"with",
"the",
"specified",
"sql",
"command"
] | 5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d | https://github.com/sebastianmonzel/webfiles-framework-php/blob/5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d/source/core/datasystem/database/MDatabaseConnection.php#L115-L123 |
10,038 | bishopb/vanilla | applications/skeleton/controllers/class.skeletoncontroller.php | SkeletonController.Initialize | public function Initialize() {
// There are 4 delivery types used by Render().
// DELIVERY_TYPE_ALL is the default and indicates an entire page view.
if ($this->DeliveryType() == DELIVERY_TYPE_ALL)
$this->Head = new HeadModule($this);
// Call Gdn_Controller's Initialize() as w... | php | public function Initialize() {
// There are 4 delivery types used by Render().
// DELIVERY_TYPE_ALL is the default and indicates an entire page view.
if ($this->DeliveryType() == DELIVERY_TYPE_ALL)
$this->Head = new HeadModule($this);
// Call Gdn_Controller's Initialize() as w... | [
"public",
"function",
"Initialize",
"(",
")",
"{",
"// There are 4 delivery types used by Render().",
"// DELIVERY_TYPE_ALL is the default and indicates an entire page view.",
"if",
"(",
"$",
"this",
"->",
"DeliveryType",
"(",
")",
"==",
"DELIVERY_TYPE_ALL",
")",
"$",
"this",... | This is a good place to include JS, CSS, and modules used by all methods of this controller.
Always called by dispatcher before controller's requested method.
@since 1.0
@access public | [
"This",
"is",
"a",
"good",
"place",
"to",
"include",
"JS",
"CSS",
"and",
"modules",
"used",
"by",
"all",
"methods",
"of",
"this",
"controller",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/skeleton/controllers/class.skeletoncontroller.php#L41-L49 |
10,039 | tonjoo/tiga-framework | src/MessageBag.php | MessageBag.offsetGet | public function offsetGet($offset)
{
if (!isset($this->container[$offset])) {
$this->container[$offset] = new self();
}
return $this->container[$offset];
} | php | public function offsetGet($offset)
{
if (!isset($this->container[$offset])) {
$this->container[$offset] = new self();
}
return $this->container[$offset];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"container",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"$",
"offset",
"]",
"=",
"new",
"self",
"(... | Get value from array.
@param string|int $offset
@return mixed | [
"Get",
"value",
"from",
"array",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/MessageBag.php#L61-L68 |
10,040 | agentmedia/phine-forms | src/Forms/Modules/Backend/SelectForm.php | SelectForm.InitForm | protected function InitForm()
{
$this->select = $this->LoadElement();
$this->AddNameField();
$this->AddValueField();
$this->AddLabelField();
$this->AddOptionsField();
$this->AddDisableFrontendValidationField();
$this->AddRequiredField();
... | php | protected function InitForm()
{
$this->select = $this->LoadElement();
$this->AddNameField();
$this->AddValueField();
$this->AddLabelField();
$this->AddOptionsField();
$this->AddDisableFrontendValidationField();
$this->AddRequiredField();
... | [
"protected",
"function",
"InitForm",
"(",
")",
"{",
"$",
"this",
"->",
"select",
"=",
"$",
"this",
"->",
"LoadElement",
"(",
")",
";",
"$",
"this",
"->",
"AddNameField",
"(",
")",
";",
"$",
"this",
"->",
"AddValueField",
"(",
")",
";",
"$",
"this",
... | Initializes the form by adding all necessary elements | [
"Initializes",
"the",
"form",
"by",
"adding",
"all",
"necessary",
"elements"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Backend/SelectForm.php#L48-L63 |
10,041 | agentmedia/phine-forms | src/Forms/Modules/Backend/SelectForm.php | SelectForm.SaveElement | protected function SaveElement()
{
$this->select->SetLabel($this->Value('Label'));
$this->select->SetName($this->Value('Name'));
$this->select->SetValue($this->Value('Value'));
$this->select->SetDisableFrontendValidation((bool)$this->Value('DisableFrontendValidation'));
$this... | php | protected function SaveElement()
{
$this->select->SetLabel($this->Value('Label'));
$this->select->SetName($this->Value('Name'));
$this->select->SetValue($this->Value('Value'));
$this->select->SetDisableFrontendValidation((bool)$this->Value('DisableFrontendValidation'));
$this... | [
"protected",
"function",
"SaveElement",
"(",
")",
"{",
"$",
"this",
"->",
"select",
"->",
"SetLabel",
"(",
"$",
"this",
"->",
"Value",
"(",
"'Label'",
")",
")",
";",
"$",
"this",
"->",
"select",
"->",
"SetName",
"(",
"$",
"this",
"->",
"Value",
"(",
... | Stores the select content's base properties
@return ContentSelect Returns the select content element | [
"Stores",
"the",
"select",
"content",
"s",
"base",
"properties"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Backend/SelectForm.php#L149-L157 |
10,042 | arnold-almeida/UIKit | src/Almeida/UIKit/Elements/Link/Generators/BootstrapLink.php | Bootstrap.hyperlink | public function hyperlink($label, $url, $options=array())
{
$defaults = array(
'class' => 'btn btn-info'
);
$options = array_merge($defaults, $options);
return parent::hyperlink($label, $url, $options);
} | php | public function hyperlink($label, $url, $options=array())
{
$defaults = array(
'class' => 'btn btn-info'
);
$options = array_merge($defaults, $options);
return parent::hyperlink($label, $url, $options);
} | [
"public",
"function",
"hyperlink",
"(",
"$",
"label",
",",
"$",
"url",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"defaults",
"=",
"array",
"(",
"'class'",
"=>",
"'btn btn-info'",
")",
";",
"$",
"options",
"=",
"array_merge",
"(",
"$... | Returns a Bootstrap flavoured hypelink | [
"Returns",
"a",
"Bootstrap",
"flavoured",
"hypelink"
] | cc52f46df011ec2f3676245c90c376da20c40e41 | https://github.com/arnold-almeida/UIKit/blob/cc52f46df011ec2f3676245c90c376da20c40e41/src/Almeida/UIKit/Elements/Link/Generators/BootstrapLink.php#L20-L27 |
10,043 | bytic/view | src/ViewFinder/ViewFinder.php | ViewFinder.findRelativePathView | protected function findRelativePathView($name)
{
$caller = Backtrace::getViewOrigin();
return $this->findInPaths($name, [dirname($caller)]);
} | php | protected function findRelativePathView($name)
{
$caller = Backtrace::getViewOrigin();
return $this->findInPaths($name, [dirname($caller)]);
} | [
"protected",
"function",
"findRelativePathView",
"(",
"$",
"name",
")",
"{",
"$",
"caller",
"=",
"Backtrace",
"::",
"getViewOrigin",
"(",
")",
";",
"return",
"$",
"this",
"->",
"findInPaths",
"(",
"$",
"name",
",",
"[",
"dirname",
"(",
"$",
"caller",
")"... | Get the path to a template with a relative path.
@param string $name
@return string | [
"Get",
"the",
"path",
"to",
"a",
"template",
"with",
"a",
"relative",
"path",
"."
] | afdc509edc626b9aed0ffa4514199fb16759453c | https://github.com/bytic/view/blob/afdc509edc626b9aed0ffa4514199fb16759453c/src/ViewFinder/ViewFinder.php#L50-L54 |
10,044 | emaphp/eMapper | lib/eMapper/Fluent/Query/AbstractQuery.php | AbstractQuery.innerJoin | public function innerJoin($table, $alias_or_cond, $cond = null) {
if (is_null($cond))
$this->joins[] = new JoinClause(JoinClause::INNER_JOIN, $table, null, $alias_or_cond);
else
$this->joins[] = new JoinClause(JoinClause::INNER_JOIN, $table, $alias_or_cond, $cond);
return $this;
} | php | public function innerJoin($table, $alias_or_cond, $cond = null) {
if (is_null($cond))
$this->joins[] = new JoinClause(JoinClause::INNER_JOIN, $table, null, $alias_or_cond);
else
$this->joins[] = new JoinClause(JoinClause::INNER_JOIN, $table, $alias_or_cond, $cond);
return $this;
} | [
"public",
"function",
"innerJoin",
"(",
"$",
"table",
",",
"$",
"alias_or_cond",
",",
"$",
"cond",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"cond",
")",
")",
"$",
"this",
"->",
"joins",
"[",
"]",
"=",
"new",
"JoinClause",
"(",
"JoinCl... | Appends an inner join to join list
@param string $table
@param string | \eMapper\SQL\Predicate\SQLPredicate $alias_or_cond
@param string | \eMapper\SQL\Predicate\SQLPredicate $cond
@return \eMapper\Fluent\Query\AbstractQuery | [
"Appends",
"an",
"inner",
"join",
"to",
"join",
"list"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/AbstractQuery.php#L118-L124 |
10,045 | emaphp/eMapper | lib/eMapper/Fluent/Query/AbstractQuery.php | AbstractQuery.leftJoin | public function leftJoin($table, $alias_or_cond, $cond = null) {
if (is_null($cond))
$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, null, $alias_or_cond);
else
$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, $alias_or_cond, $cond);
return $this;
} | php | public function leftJoin($table, $alias_or_cond, $cond = null) {
if (is_null($cond))
$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, null, $alias_or_cond);
else
$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, $alias_or_cond, $cond);
return $this;
} | [
"public",
"function",
"leftJoin",
"(",
"$",
"table",
",",
"$",
"alias_or_cond",
",",
"$",
"cond",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"cond",
")",
")",
"$",
"this",
"->",
"joins",
"[",
"]",
"=",
"new",
"JoinClause",
"(",
"JoinCla... | Appends a left join to join list
@param string $table
@param string | \eMapper\SQL\Predicate\SQLPredicate $alias_or_cond
@param string | \eMapper\SQL\Predicate\SQLPredicate $cond
@return \eMapper\Fluent\Query\AbstractQuery | [
"Appends",
"a",
"left",
"join",
"to",
"join",
"list"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/AbstractQuery.php#L133-L139 |
10,046 | emaphp/eMapper | lib/eMapper/Fluent/Query/AbstractQuery.php | AbstractQuery.fullOuterJoin | public function fullOuterJoin($table, $alias_or_cond, $cond = null) {
if (is_null($cond))
$this->joins[] = new JoinClause(JoinClause::FULL_OUTER_JOIN, $table, null, $alias_or_cond);
else
$this->joins[] = new JoinClause(JoinClause::FULL_OUTER_JOIN, $table, $alias_or_cond, $cond);
return $this;
} | php | public function fullOuterJoin($table, $alias_or_cond, $cond = null) {
if (is_null($cond))
$this->joins[] = new JoinClause(JoinClause::FULL_OUTER_JOIN, $table, null, $alias_or_cond);
else
$this->joins[] = new JoinClause(JoinClause::FULL_OUTER_JOIN, $table, $alias_or_cond, $cond);
return $this;
} | [
"public",
"function",
"fullOuterJoin",
"(",
"$",
"table",
",",
"$",
"alias_or_cond",
",",
"$",
"cond",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"cond",
")",
")",
"$",
"this",
"->",
"joins",
"[",
"]",
"=",
"new",
"JoinClause",
"(",
"Jo... | Appends a full outer join to join list
@param string $table
@param string | \eMapper\SQL\Predicate\SQLPredicate $alias_or_cond
@param string | \eMapper\SQL\Predicate\SQLPredicate $cond
@return \eMapper\Fluent\Query\AbstractQuery | [
"Appends",
"a",
"full",
"outer",
"join",
"to",
"join",
"list"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/AbstractQuery.php#L148-L154 |
10,047 | emaphp/eMapper | lib/eMapper/Fluent/Query/AbstractQuery.php | AbstractQuery.updateSchema | protected function updateSchema(Schema $schema) {
foreach($schema->getJoins() as $join) {
$assoc = $join->getAssociation();
$parent = $join->getParent();
if (is_null($parent))
$assoc->appendJoin($this, $this->alias, $join->getAlias(), true);
else {
$alias = $schema->getJoin($parent)->getAlias();
... | php | protected function updateSchema(Schema $schema) {
foreach($schema->getJoins() as $join) {
$assoc = $join->getAssociation();
$parent = $join->getParent();
if (is_null($parent))
$assoc->appendJoin($this, $this->alias, $join->getAlias(), true);
else {
$alias = $schema->getJoin($parent)->getAlias();
... | [
"protected",
"function",
"updateSchema",
"(",
"Schema",
"$",
"schema",
")",
"{",
"foreach",
"(",
"$",
"schema",
"->",
"getJoins",
"(",
")",
"as",
"$",
"join",
")",
"{",
"$",
"assoc",
"=",
"$",
"join",
"->",
"getAssociation",
"(",
")",
";",
"$",
"pare... | Updates query schema
@param \eMapper\Query\Schema $schema | [
"Updates",
"query",
"schema"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/AbstractQuery.php#L160-L171 |
10,048 | emaphp/eMapper | lib/eMapper/Fluent/Query/AbstractQuery.php | AbstractQuery.exec | public function exec() {
list($query, $args) = $this->build();
if (empty($this->config))
return call_user_func([$this->fluent->getMapper(), 'sql'], $query, $args);
return call_user_func([$this->fluent->getMapper()->merge($this->config), 'sql'], $query, $args);
} | php | public function exec() {
list($query, $args) = $this->build();
if (empty($this->config))
return call_user_func([$this->fluent->getMapper(), 'sql'], $query, $args);
return call_user_func([$this->fluent->getMapper()->merge($this->config), 'sql'], $query, $args);
} | [
"public",
"function",
"exec",
"(",
")",
"{",
"list",
"(",
"$",
"query",
",",
"$",
"args",
")",
"=",
"$",
"this",
"->",
"build",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"config",
")",
")",
"return",
"call_user_func",
"(",
"[",
... | Executes the resulting query against current database
@return mixed | [
"Executes",
"the",
"resulting",
"query",
"against",
"current",
"database"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Fluent/Query/AbstractQuery.php#L181-L186 |
10,049 | samurai-fw/samurai | src/Samurai/Component/Task/Processor.php | Processor.get | public function get($name)
{
$names = explode(self::SEPARATOR, $name);
$method = array_pop($names);
if ($names) {
$class_name = 'Task\\' . join('\\', array_map('ucfirst', $names)) . 'TaskList';
} else {
$class_name = 'Task\\TaskList';
}
$class_... | php | public function get($name)
{
$names = explode(self::SEPARATOR, $name);
$method = array_pop($names);
if ($names) {
$class_name = 'Task\\' . join('\\', array_map('ucfirst', $names)) . 'TaskList';
} else {
$class_name = 'Task\\TaskList';
}
$class_... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"names",
"=",
"explode",
"(",
"self",
"::",
"SEPARATOR",
",",
"$",
"name",
")",
";",
"$",
"method",
"=",
"array_pop",
"(",
"$",
"names",
")",
";",
"if",
"(",
"$",
"names",
")",
"{",
... | get task.
format:
namespace:some:do
@access public
@param string $name
@return Task | [
"get",
"task",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Task/Processor.php#L81-L101 |
10,050 | samurai-fw/samurai | src/Samurai/Component/Task/Processor.php | Processor.find | public function find($name = null)
{
$tasks = [];
foreach ($this->application->getAppPaths() as $path) {
$files = $this->finder->path($path['dir'] . DS . 'Task')->recursive()->name('*TaskList.php')->find();
foreach ($files as $file) {
$task_path = substr($fil... | php | public function find($name = null)
{
$tasks = [];
foreach ($this->application->getAppPaths() as $path) {
$files = $this->finder->path($path['dir'] . DS . 'Task')->recursive()->name('*TaskList.php')->find();
foreach ($files as $file) {
$task_path = substr($fil... | [
"public",
"function",
"find",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"tasks",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"application",
"->",
"getAppPaths",
"(",
")",
"as",
"$",
"path",
")",
"{",
"$",
"files",
"=",
"$",
"this",... | find task.
@param string $name | [
"find",
"task",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Task/Processor.php#L109-L141 |
10,051 | samurai-fw/samurai | src/Samurai/Component/Task/Processor.php | Processor.execute | public function execute($name, $option = [])
{
if (is_string($name)) {
$names = explode(self::SEPARATOR, $name);
$method = array_pop($names);
$task = $this->get($name);
}
$task->execute($option);
} | php | public function execute($name, $option = [])
{
if (is_string($name)) {
$names = explode(self::SEPARATOR, $name);
$method = array_pop($names);
$task = $this->get($name);
}
$task->execute($option);
} | [
"public",
"function",
"execute",
"(",
"$",
"name",
",",
"$",
"option",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"$",
"names",
"=",
"explode",
"(",
"self",
"::",
"SEPARATOR",
",",
"$",
"name",
")",
";",
"... | call task.
@access public
@param mixed $name
@param array|Samurai\Samurai\Component\Task\Option $option | [
"call",
"task",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Task/Processor.php#L151-L160 |
10,052 | tadcka/Mapper | src/Tadcka/Mapper/Source/Source.php | Source.supportData | private function supportData()
{
$dataClass = $this->type->getDataClass();
return $this->data instanceof $dataClass || $dataClass === get_class($this->data);
} | php | private function supportData()
{
$dataClass = $this->type->getDataClass();
return $this->data instanceof $dataClass || $dataClass === get_class($this->data);
} | [
"private",
"function",
"supportData",
"(",
")",
"{",
"$",
"dataClass",
"=",
"$",
"this",
"->",
"type",
"->",
"getDataClass",
"(",
")",
";",
"return",
"$",
"this",
"->",
"data",
"instanceof",
"$",
"dataClass",
"||",
"$",
"dataClass",
"===",
"get_class",
"... | Check if mapper type support data.
@return bool | [
"Check",
"if",
"mapper",
"type",
"support",
"data",
"."
] | 6853a2be08dcd35a1013c0a4aba9b71a727ff7da | https://github.com/tadcka/Mapper/blob/6853a2be08dcd35a1013c0a4aba9b71a727ff7da/src/Tadcka/Mapper/Source/Source.php#L145-L150 |
10,053 | the-kbA-team/typecast | src/TypeCastObject.php | TypeCastObject.cast | public function cast($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException(sprintf('Expected an object, but got %s!', gettype($object)));
}
foreach ($this->map as $name => $type) {
if (isset($object->{$name})) {
try {
... | php | public function cast($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException(sprintf('Expected an object, but got %s!', gettype($object)));
}
foreach ($this->map as $name => $type) {
if (isset($object->{$name})) {
try {
... | [
"public",
"function",
"cast",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Expected an object, but got %s!'",
",",
"gettype",
"(",
"$",
... | Cast the public values of the given object to the typecast information
defined in this class.
@param object $object The raw data to be typecasted.
@return object The same data structure as the input, but casted to the
typecasting information defined in this
class.
@throws \InvalidArgumentException in case the given va... | [
"Cast",
"the",
"public",
"values",
"of",
"the",
"given",
"object",
"to",
"the",
"typecast",
"information",
"defined",
"in",
"this",
"class",
"."
] | 89939ad0dbf92f6ef09c48764347f473d51e8786 | https://github.com/the-kbA-team/typecast/blob/89939ad0dbf92f6ef09c48764347f473d51e8786/src/TypeCastObject.php#L70-L94 |
10,054 | ongr-archive/ContentBundle | Twig/CategoryExtension.php | CategoryExtension.renderCategoryTree | public function renderCategoryTree(
\Twig_Environment $environment,
$tree,
$selectedCategory = null,
$currentCategory = null,
$template = null
) {
if (count($tree)) {
if ($template === null) {
$template = $this->getTemplate();
}... | php | public function renderCategoryTree(
\Twig_Environment $environment,
$tree,
$selectedCategory = null,
$currentCategory = null,
$template = null
) {
if (count($tree)) {
if ($template === null) {
$template = $this->getTemplate();
}... | [
"public",
"function",
"renderCategoryTree",
"(",
"\\",
"Twig_Environment",
"$",
"environment",
",",
"$",
"tree",
",",
"$",
"selectedCategory",
"=",
"null",
",",
"$",
"currentCategory",
"=",
"null",
",",
"$",
"template",
"=",
"null",
")",
"{",
"if",
"(",
"c... | Renders category tree.
@param \Twig_Environment $environment
@param array|\ArrayIterator $tree
@param string|null $selectedCategory
@param string|null $currentCategory
@param string|null $template
@return null|string | [
"Renders",
"category",
"tree",
"."
] | 453a02c0c89c16f66dc9caed000243534dbeffa5 | https://github.com/ongr-archive/ContentBundle/blob/453a02c0c89c16f66dc9caed000243534dbeffa5/Twig/CategoryExtension.php#L153-L176 |
10,055 | kevindierkx/elicit | src/ApiManager.php | ApiManager.setupConnectionFactory | protected function setupConnectionFactory(ConnectionResolverInterface $connectionResolver)
{
Model::setConnectionResolver($connectionResolver);
$this->connectionFactory = new ConnectionFactory($connectionResolver);
} | php | protected function setupConnectionFactory(ConnectionResolverInterface $connectionResolver)
{
Model::setConnectionResolver($connectionResolver);
$this->connectionFactory = new ConnectionFactory($connectionResolver);
} | [
"protected",
"function",
"setupConnectionFactory",
"(",
"ConnectionResolverInterface",
"$",
"connectionResolver",
")",
"{",
"Model",
"::",
"setConnectionResolver",
"(",
"$",
"connectionResolver",
")",
";",
"$",
"this",
"->",
"connectionFactory",
"=",
"new",
"ConnectionF... | Build the connection factory instance.
@param ConnectionResolverInterface $connectionResolver | [
"Build",
"the",
"connection",
"factory",
"instance",
"."
] | c277942f5f5f63b175bc37e9d392faa946888f65 | https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/ApiManager.php#L40-L45 |
10,056 | bellisq/type-map | src/DI/Storage/TypeDefinition.php | TypeDefinition.isSingleton | public function isSingleton($type): bool
{
assert(isset($this->types[$type]));
return $this->types[$type];
} | php | public function isSingleton($type): bool
{
assert(isset($this->types[$type]));
return $this->types[$type];
} | [
"public",
"function",
"isSingleton",
"(",
"$",
"type",
")",
":",
"bool",
"{",
"assert",
"(",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"type",
"]",
")",
")",
";",
"return",
"$",
"this",
"->",
"types",
"[",
"$",
"type",
"]",
";",
"}"
] | Only `DI\Provider` can call this function.
So, `DI\Provider` is responsible to the assertion.
@param $type
@return bool | [
"Only",
"DI",
"\\",
"Provider",
"can",
"call",
"this",
"function",
".",
"So",
"DI",
"\\",
"Provider",
"is",
"responsible",
"to",
"the",
"assertion",
"."
] | 8a453cc3b0820a85d4f8a6ec2dd967ea800fa6f3 | https://github.com/bellisq/type-map/blob/8a453cc3b0820a85d4f8a6ec2dd967ea800fa6f3/src/DI/Storage/TypeDefinition.php#L52-L56 |
10,057 | guru-digital/ss-gdm-extensions | code/Extensions/SSGuru_ContentController.php | SSGuru_ContentController.Content | public function Content()
{
$content = $this->owner->Content;
// Internal links.
$matches = array();
preg_match_all('/<a.*href="\[file_link,id=([0-9]+)\].*".*>.*<\/a>/U', $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
$file = DataObject::get_... | php | public function Content()
{
$content = $this->owner->Content;
// Internal links.
$matches = array();
preg_match_all('/<a.*href="\[file_link,id=([0-9]+)\].*".*>.*<\/a>/U', $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
$file = DataObject::get_... | [
"public",
"function",
"Content",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"owner",
"->",
"Content",
";",
"// Internal links.",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"preg_match_all",
"(",
"'/<a.*href=\"\\[file_link,id=([0-9]+)\\].*\".*>.*<\\/a... | Give external links the external class, and affix size and type prefixes to files.
@return String | [
"Give",
"external",
"links",
"the",
"external",
"class",
"and",
"affix",
"size",
"and",
"type",
"prefixes",
"to",
"files",
"."
] | 0ccb29ea11b6d3b9d1f488c8eccad1a0de085c67 | https://github.com/guru-digital/ss-gdm-extensions/blob/0ccb29ea11b6d3b9d1f488c8eccad1a0de085c67/code/Extensions/SSGuru_ContentController.php#L66-L89 |
10,058 | guru-digital/ss-gdm-extensions | code/Extensions/SSGuru_ContentController.php | SSGuru_ContentController.results | public function results($data, $form, $request)
{
$result = null;
$results = $form->getResults();
$query = $form->getSearchQuery();
// Add context summaries based on the queries.
foreach ($results as $result) {
$contextualTitle = new Text();
... | php | public function results($data, $form, $request)
{
$result = null;
$results = $form->getResults();
$query = $form->getSearchQuery();
// Add context summaries based on the queries.
foreach ($results as $result) {
$contextualTitle = new Text();
... | [
"public",
"function",
"results",
"(",
"$",
"data",
",",
"$",
"form",
",",
"$",
"request",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"results",
"=",
"$",
"form",
"->",
"getResults",
"(",
")",
";",
"$",
"query",
"=",
"$",
"form",
"->",
"getSe... | Overrides the ContentControllerSearchExtension and adds snippets to results.
@param array $data
@param SearchForm $form
@param SS_HTTPRequest $request
@return HTMLText | [
"Overrides",
"the",
"ContentControllerSearchExtension",
"and",
"adds",
"snippets",
"to",
"results",
"."
] | 0ccb29ea11b6d3b9d1f488c8eccad1a0de085c67 | https://github.com/guru-digital/ss-gdm-extensions/blob/0ccb29ea11b6d3b9d1f488c8eccad1a0de085c67/code/Extensions/SSGuru_ContentController.php#L99-L157 |
10,059 | aleksip/patternengine-php-tpl | src/aleksip/PatternEngine/Tpl/Loaders/StringLoader.php | StringLoader.render | public function render($options = array())
{
$string = $options['string'];
$data = $options['data'];
return $this->renderTpl($string, $data);
} | php | public function render($options = array())
{
$string = $options['string'];
$data = $options['data'];
return $this->renderTpl($string, $data);
} | [
"public",
"function",
"render",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"string",
"=",
"$",
"options",
"[",
"'string'",
"]",
";",
"$",
"data",
"=",
"$",
"options",
"[",
"'data'",
"]",
";",
"return",
"$",
"this",
"->",
"renderTpl... | Render a string.
@param array $options Options
@return string The rendered result | [
"Render",
"a",
"string",
"."
] | 08b56cff240481855a012f85eb94b10ddb994d59 | https://github.com/aleksip/patternengine-php-tpl/blob/08b56cff240481855a012f85eb94b10ddb994d59/src/aleksip/PatternEngine/Tpl/Loaders/StringLoader.php#L17-L23 |
10,060 | easy-system/es-http | src/Uploading/MoveStrategy.php | MoveStrategy.setTargetDirectory | public function setTargetDirectory($dir)
{
if (! is_string($dir) || empty($dir)) {
throw new InvalidArgumentException(sprintf(
'Invalid target directory provided; must be a non-empty '
. 'string, "%s" received.',
is_object($dir) ? get_class($dir) :... | php | public function setTargetDirectory($dir)
{
if (! is_string($dir) || empty($dir)) {
throw new InvalidArgumentException(sprintf(
'Invalid target directory provided; must be a non-empty '
. 'string, "%s" received.',
is_object($dir) ? get_class($dir) :... | [
"public",
"function",
"setTargetDirectory",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"dir",
")",
"||",
"empty",
"(",
"$",
"dir",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid target direc... | Sets the target directory to move.
If the upload options contains the "target_directory" key, this method
will be called automatically.
@param string $dir The target directory to move
@throws \InvalidArgumentException If the provided directory is not
non-empty string | [
"Sets",
"the",
"target",
"directory",
"to",
"move",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/MoveStrategy.php#L69-L79 |
10,061 | easy-system/es-http | src/Uploading/MoveStrategy.php | MoveStrategy.setFilePermissions | public function setFilePermissions($permissions)
{
if (! is_int($permissions)) {
throw new InvalidArgumentException(sprintf(
'Invalid file permissins provided; must be an '
. 'integer, "%s" received.',
is_object($permissions) ? get_class($permissio... | php | public function setFilePermissions($permissions)
{
if (! is_int($permissions)) {
throw new InvalidArgumentException(sprintf(
'Invalid file permissins provided; must be an '
. 'integer, "%s" received.',
is_object($permissions) ? get_class($permissio... | [
"public",
"function",
"setFilePermissions",
"(",
"$",
"permissions",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"permissions",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid file permissins provided; must be an '",
".",
... | Sets the file permissions.
If the upload options contains the "file_permissions" key, this method
will be called automatically.
@param int $permissions The permissions of files in the new location
@throws \InvalidArgumentException
- If specified permissions are non integer
- If specified permissions are not readabl... | [
"Sets",
"the",
"file",
"permissions",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/MoveStrategy.php#L106-L138 |
10,062 | psiphp/content-type | bridge/doctrine-phpcr-odm/src/NodeTypeRegistrator.php | NodeTypeRegistrator.registerNodeTypes | public function registerNodeTypes(SessionInterface $session)
{
$cnd = sprintf(
'<%s=\'https://github.com/symfony-cmf/content-type\'>',
$this->encoder->getPrefix(),
$this->encoder->getUri()
);
$nodeTypeManager = $session->getWorkspace()->getNodeTypeManager... | php | public function registerNodeTypes(SessionInterface $session)
{
$cnd = sprintf(
'<%s=\'https://github.com/symfony-cmf/content-type\'>',
$this->encoder->getPrefix(),
$this->encoder->getUri()
);
$nodeTypeManager = $session->getWorkspace()->getNodeTypeManager... | [
"public",
"function",
"registerNodeTypes",
"(",
"SessionInterface",
"$",
"session",
")",
"{",
"$",
"cnd",
"=",
"sprintf",
"(",
"'<%s=\\'https://github.com/symfony-cmf/content-type\\'>'",
",",
"$",
"this",
"->",
"encoder",
"->",
"getPrefix",
"(",
")",
",",
"$",
"th... | Register the content-type node types with the given PHPCR session. | [
"Register",
"the",
"content",
"-",
"type",
"node",
"types",
"with",
"the",
"given",
"PHPCR",
"session",
"."
] | 331f36f45eb45763859375bf80e2604bfe3e2940 | https://github.com/psiphp/content-type/blob/331f36f45eb45763859375bf80e2604bfe3e2940/bridge/doctrine-phpcr-odm/src/NodeTypeRegistrator.php#L24-L34 |
10,063 | fortrabbit/datafilter | src/DataFilter/Util.php | Util.flatten | public static function flatten($data, $flat = array(), $prefix = '')
{
foreach ($data as $key => $value) {
// is array -> flatten deeped
if (is_array($value)) {
$flat = self::flatten($value, $flat, $prefix. $key. self::$FLATTEN_SEPARATOR);
}
/... | php | public static function flatten($data, $flat = array(), $prefix = '')
{
foreach ($data as $key => $value) {
// is array -> flatten deeped
if (is_array($value)) {
$flat = self::flatten($value, $flat, $prefix. $key. self::$FLATTEN_SEPARATOR);
}
/... | [
"public",
"static",
"function",
"flatten",
"(",
"$",
"data",
",",
"$",
"flat",
"=",
"array",
"(",
")",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"// is array -> flatten deepe... | Flattens input data
@param string $str Input string
@param array $args Variables to be replaced
@return array | [
"Flattens",
"input",
"data"
] | fca1c2cbd299f3762b251134d8a62038fb7defe3 | https://github.com/fortrabbit/datafilter/blob/fca1c2cbd299f3762b251134d8a62038fb7defe3/src/DataFilter/Util.php#L50-L64 |
10,064 | Innmind/RestBundle | EventListener/CapabilitiesResponseListener.php | CapabilitiesResponseListener.buildResponse | public function buildResponse(GetResponseForControllerResultEvent $event)
{
$request = $event->getRequest();
if (
!$request->attributes->has(RouteKeys::ACTION) ||
$request->attributes->get(RouteKeys::ACTION) !== 'capabilities'
) {
return;
}
... | php | public function buildResponse(GetResponseForControllerResultEvent $event)
{
$request = $event->getRequest();
if (
!$request->attributes->has(RouteKeys::ACTION) ||
$request->attributes->get(RouteKeys::ACTION) !== 'capabilities'
) {
return;
}
... | [
"public",
"function",
"buildResponse",
"(",
"GetResponseForControllerResultEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"request",
"->",
"attributes",
"->",
"has",
"(",
"RouteKeys"... | Build the response to expose all routes of the API
@param GetResponseForControllerResultEvent $event
@return void | [
"Build",
"the",
"response",
"to",
"expose",
"all",
"routes",
"of",
"the",
"API"
] | 46de57d9b45dfbfcf98867be3c601fba57f2edc2 | https://github.com/Innmind/RestBundle/blob/46de57d9b45dfbfcf98867be3c601fba57f2edc2/EventListener/CapabilitiesResponseListener.php#L43-L76 |
10,065 | osflab/controller | Response/Type.php | Type.setType | public function setType(string $type):self
{
if (!isset($this->types[$type])) {
Checkers::notice('Unknown response type [' . $type . ']');
} else {
$this->type = $type;
}
return $this;
} | php | public function setType(string $type):self
{
if (!isset($this->types[$type])) {
Checkers::notice('Unknown response type [' . $type . ']');
} else {
$this->type = $type;
}
return $this;
} | [
"public",
"function",
"setType",
"(",
"string",
"$",
"type",
")",
":",
"self",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"type",
"]",
")",
")",
"{",
"Checkers",
"::",
"notice",
"(",
"'Unknown response type ['",
".",
"$"... | Content-Type
@param string $type
@return $this | [
"Content",
"-",
"Type"
] | d59344fc204a74995224e3da39b9debd78fdb974 | https://github.com/osflab/controller/blob/d59344fc204a74995224e3da39b9debd78fdb974/Response/Type.php#L36-L44 |
10,066 | osflab/controller | Response/Type.php | Type.setDisposition | public function setDisposition(string $dispositionType, $filename = null, $name = null)
{
if (!in_array($dispositionType, $this->dispositions)) {
Checkers::notice('Unknown response type [' . $type . ']');
} else {
$this->disposition['type'] = $dispositionType;
}
... | php | public function setDisposition(string $dispositionType, $filename = null, $name = null)
{
if (!in_array($dispositionType, $this->dispositions)) {
Checkers::notice('Unknown response type [' . $type . ']');
} else {
$this->disposition['type'] = $dispositionType;
}
... | [
"public",
"function",
"setDisposition",
"(",
"string",
"$",
"dispositionType",
",",
"$",
"filename",
"=",
"null",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"dispositionType",
",",
"$",
"this",
"->",
"dispositions",
")... | Content-Disposition
@param string $dispositionType
@param string $filename
@param string $name
@return $this | [
"Content",
"-",
"Disposition"
] | d59344fc204a74995224e3da39b9debd78fdb974 | https://github.com/osflab/controller/blob/d59344fc204a74995224e3da39b9debd78fdb974/Response/Type.php#L117-L131 |
10,067 | bytic/database | src/Adapters/MySQLi.php | MySQLi.connect | public function connect($host = false, $user = false, $password = false, $database = false, $newLink = false)
{
$this->connection = mysqli_connect($host, $user, $password, $newLink);
if ($this->connection) {
if ($this->selectDatabase($database)) {
$this->query("SET CHARA... | php | public function connect($host = false, $user = false, $password = false, $database = false, $newLink = false)
{
$this->connection = mysqli_connect($host, $user, $password, $newLink);
if ($this->connection) {
if ($this->selectDatabase($database)) {
$this->query("SET CHARA... | [
"public",
"function",
"connect",
"(",
"$",
"host",
"=",
"false",
",",
"$",
"user",
"=",
"false",
",",
"$",
"password",
"=",
"false",
",",
"$",
"database",
"=",
"false",
",",
"$",
"newLink",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"connection",
"... | Connects to MySQL server
@param string|boolean $host
@param string|boolean $user
@param string|boolean $password
@param string|boolean $database
@param bool $newLink
@return resource | [
"Connects",
"to",
"MySQL",
"server"
] | 186a7f1ae4fe2d8fa79acc34c06cfacd91488fa4 | https://github.com/bytic/database/blob/186a7f1ae4fe2d8fa79acc34c06cfacd91488fa4/src/Adapters/MySQLi.php#L24-L43 |
10,068 | Smile-SA/EzToolsBundle | Command/ContentTypeGroup/GenerateCommand.php | GenerateCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
/** @var $repository Repository */
$repository = $this->getContainer()->get('ezpublish.api.repository');
/** @var $questionHelper QuestionHelper */
$questionHelper = $this->getHelper('question');
$... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
/** @var $repository Repository */
$repository = $this->getContainer()->get('ezpublish.api.repository');
/** @var $questionHelper QuestionHelper */
$questionHelper = $this->getHelper('question');
$... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"/** @var $repository Repository */",
"$",
"repository",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'ezpublish.api.r... | Execute ContentTypeGroup generate command
@param InputInterface $input
@param OutputInterface $output
@return int|null|void | [
"Execute",
"ContentTypeGroup",
"generate",
"command"
] | 5f384f552a83dd723fb4dca468ac0a2e56442be8 | https://github.com/Smile-SA/EzToolsBundle/blob/5f384f552a83dd723fb4dca468ac0a2e56442be8/Command/ContentTypeGroup/GenerateCommand.php#L35-L74 |
10,069 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Customers.php | Customers.updateBillingInfo | public function updateBillingInfo($code = null, $data = [])
{
$payload = [];
if (! $code) {
$code = $this->data->code;
}
if (! empty($data)) {
$payload['credit_card'] = $data;
} elseif (isset($this->data->billing_info)) {
$payload = $this... | php | public function updateBillingInfo($code = null, $data = [])
{
$payload = [];
if (! $code) {
$code = $this->data->code;
}
if (! empty($data)) {
$payload['credit_card'] = $data;
} elseif (isset($this->data->billing_info)) {
$payload = $this... | [
"public",
"function",
"updateBillingInfo",
"(",
"$",
"code",
"=",
"null",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"payload",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"code",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"data",
"->",
... | Update Billing info
@param string $code
@param array $data
@return $this | [
"Update",
"Billing",
"info"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Customers.php#L112-L129 |
10,070 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Customers.php | Customers.setBirthdate | public function setBirthdate($birthdate)
{
$date = DateTime::createFromFormat('Y-m-d', $birthdate);
$this->data->birthdate_day = $date->format('d');
$this->data->birthdate_month = $date->format('m');
$this->data->birthdate_year = $date->format('Y');
return $this;
} | php | public function setBirthdate($birthdate)
{
$date = DateTime::createFromFormat('Y-m-d', $birthdate);
$this->data->birthdate_day = $date->format('d');
$this->data->birthdate_month = $date->format('m');
$this->data->birthdate_year = $date->format('Y');
return $this;
} | [
"public",
"function",
"setBirthdate",
"(",
"$",
"birthdate",
")",
"{",
"$",
"date",
"=",
"DateTime",
"::",
"createFromFormat",
"(",
"'Y-m-d'",
",",
"$",
"birthdate",
")",
";",
"$",
"this",
"->",
"data",
"->",
"birthdate_day",
"=",
"$",
"date",
"->",
"for... | Set customer birthday
@param string $birthdate
@return $this | [
"Set",
"customer",
"birthday"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Customers.php#L203-L212 |
10,071 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Customers.php | Customers.setBillingInfo | public function setBillingInfo($holderName, $number, $expirationMonth, $expirationYear)
{
$this->client->addQueryString('new_vault', true);
$this->data->billing_info = new stdClass;
$creditCard = $this->data->billing_info->credit_card = new stdClass;
$creditCard->holder_name = $hol... | php | public function setBillingInfo($holderName, $number, $expirationMonth, $expirationYear)
{
$this->client->addQueryString('new_vault', true);
$this->data->billing_info = new stdClass;
$creditCard = $this->data->billing_info->credit_card = new stdClass;
$creditCard->holder_name = $hol... | [
"public",
"function",
"setBillingInfo",
"(",
"$",
"holderName",
",",
"$",
"number",
",",
"$",
"expirationMonth",
",",
"$",
"expirationYear",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"addQueryString",
"(",
"'new_vault'",
",",
"true",
")",
";",
"$",
"thi... | Set customer billing info
@param string $holderName
@param string $number
@param string $expirationMonth
@param string $expirationYear
@return $this | [
"Set",
"customer",
"billing",
"info"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Customers.php#L237-L250 |
10,072 | TangoMan75/JWTBundle | Model/JWT.php | JWT.get | public function get($key)
{
// return $this->claims['data'][$key] ?? null;
if (isset($this->claims['data'][$key])) {
return $this->claims['data'][$key];
} else {
return null;
}
} | php | public function get($key)
{
// return $this->claims['data'][$key] ?? null;
if (isset($this->claims['data'][$key])) {
return $this->claims['data'][$key];
} else {
return null;
}
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"// return $this->claims['data'][$key] ?? null;",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"claims",
"[",
"'data'",
"]",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"... | Get token private claim
@return array | [
"Get",
"token",
"private",
"claim"
] | f201ad96c19ad28f0150c7cd05216e9fffb806ba | https://github.com/TangoMan75/JWTBundle/blob/f201ad96c19ad28f0150c7cd05216e9fffb806ba/Model/JWT.php#L66-L75 |
10,073 | TangoMan75/JWTBundle | Model/JWT.php | JWT.setPeriod | public function setPeriod(\DateTime $start = null, \DateTime $end = null)
{
$this->claims['nbf'] = $start->getTimestamp();
$this->claims['exp'] = $end->getTimestamp();
return $this;
} | php | public function setPeriod(\DateTime $start = null, \DateTime $end = null)
{
$this->claims['nbf'] = $start->getTimestamp();
$this->claims['exp'] = $end->getTimestamp();
return $this;
} | [
"public",
"function",
"setPeriod",
"(",
"\\",
"DateTime",
"$",
"start",
"=",
"null",
",",
"\\",
"DateTime",
"$",
"end",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"claims",
"[",
"'nbf'",
"]",
"=",
"$",
"start",
"->",
"getTimestamp",
"(",
")",
";",
"... | Sets token expiration period
@param \DateTime|null $start
@param \DateTime|null $end
@return JWT | [
"Sets",
"token",
"expiration",
"period"
] | f201ad96c19ad28f0150c7cd05216e9fffb806ba | https://github.com/TangoMan75/JWTBundle/blob/f201ad96c19ad28f0150c7cd05216e9fffb806ba/Model/JWT.php#L114-L120 |
10,074 | FuturaSoft/Pabana | src/Database/ConnectionCollection.php | ConnectionCollection.add | public static function add($connection, $setAsDefault = false)
{
$connectionName = $connection->getName();
self::$connectionList[$connectionName] = $connection;
if ($setAsDefault === true) {
self::setDefault($connectionName);
}
} | php | public static function add($connection, $setAsDefault = false)
{
$connectionName = $connection->getName();
self::$connectionList[$connectionName] = $connection;
if ($setAsDefault === true) {
self::setDefault($connectionName);
}
} | [
"public",
"static",
"function",
"add",
"(",
"$",
"connection",
",",
"$",
"setAsDefault",
"=",
"false",
")",
"{",
"$",
"connectionName",
"=",
"$",
"connection",
"->",
"getName",
"(",
")",
";",
"self",
"::",
"$",
"connectionList",
"[",
"$",
"connectionName",... | Add a connection to collection
Store Connection to collection and defined it by default if would
@since 1.0
@param \Pabana\Database\Connection $connection Object defined a connection and its parameters.
@param bool $setAsDefault If defined connection will be defined as default connection.
@return void | [
"Add",
"a",
"connection",
"to",
"collection"
] | b3a95eeb976042ac2a393cc10755a7adbc164c24 | https://github.com/FuturaSoft/Pabana/blob/b3a95eeb976042ac2a393cc10755a7adbc164c24/src/Database/ConnectionCollection.php#L46-L53 |
10,075 | FuturaSoft/Pabana | src/Database/ConnectionCollection.php | ConnectionCollection.get | public static function get($connectionName)
{
if (self::exists($connectionName) === true) {
return self::$connectionList[$connectionName];
} else {
throw new Exception('Datasource "' . $connectionName . '" isn\'t defined in DatasourceCollection');
return false;
... | php | public static function get($connectionName)
{
if (self::exists($connectionName) === true) {
return self::$connectionList[$connectionName];
} else {
throw new Exception('Datasource "' . $connectionName . '" isn\'t defined in DatasourceCollection');
return false;
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"connectionName",
")",
"{",
"if",
"(",
"self",
"::",
"exists",
"(",
"$",
"connectionName",
")",
"===",
"true",
")",
"{",
"return",
"self",
"::",
"$",
"connectionList",
"[",
"$",
"connectionName",
"]",
";",... | Get connection by his name
@since 1.0
@param string $connectionName Connection who will get.
@return bool|\Pabana\Database\Connection Return Connection object if exist or return false. | [
"Get",
"connection",
"by",
"his",
"name"
] | b3a95eeb976042ac2a393cc10755a7adbc164c24 | https://github.com/FuturaSoft/Pabana/blob/b3a95eeb976042ac2a393cc10755a7adbc164c24/src/Database/ConnectionCollection.php#L89-L97 |
10,076 | FuturaSoft/Pabana | src/Database/ConnectionCollection.php | ConnectionCollection.getDefault | public static function getDefault()
{
if (self::existsDefault()) {
$defaultConnectionName = self::$defaultConnectionName;
return self::$connectionList[$defaultConnectionName];
} else {
throw new Exception('Datasource "' . $defaultConnectionName . '" isn\'t defined... | php | public static function getDefault()
{
if (self::existsDefault()) {
$defaultConnectionName = self::$defaultConnectionName;
return self::$connectionList[$defaultConnectionName];
} else {
throw new Exception('Datasource "' . $defaultConnectionName . '" isn\'t defined... | [
"public",
"static",
"function",
"getDefault",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"existsDefault",
"(",
")",
")",
"{",
"$",
"defaultConnectionName",
"=",
"self",
"::",
"$",
"defaultConnectionName",
";",
"return",
"self",
"::",
"$",
"connectionList",
"[",... | Get default connection
@since 1.0
@return bool|\Pabana\Database\Connection Return default Connection object if exist or return false. | [
"Get",
"default",
"connection"
] | b3a95eeb976042ac2a393cc10755a7adbc164c24 | https://github.com/FuturaSoft/Pabana/blob/b3a95eeb976042ac2a393cc10755a7adbc164c24/src/Database/ConnectionCollection.php#L105-L114 |
10,077 | FuturaSoft/Pabana | src/Database/ConnectionCollection.php | ConnectionCollection.setDefault | public static function setDefault($connectionName, $force = true)
{
if ($force === false && self::existsDefault() === true) {
throw new Exception('A default Datasource is already defined.');
return false;
} else {
self::$defaultConnectionName = $connectionName;
... | php | public static function setDefault($connectionName, $force = true)
{
if ($force === false && self::existsDefault() === true) {
throw new Exception('A default Datasource is already defined.');
return false;
} else {
self::$defaultConnectionName = $connectionName;
... | [
"public",
"static",
"function",
"setDefault",
"(",
"$",
"connectionName",
",",
"$",
"force",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"force",
"===",
"false",
"&&",
"self",
"::",
"existsDefault",
"(",
")",
"===",
"true",
")",
"{",
"throw",
"new",
"Except... | Set default connection
Set default connection name and can force it set
@since 1.0
@param string $connectionName Connection name who will be set by default.
@param bool $force Force change of default connection.
@return bool Return true if success or false if error. | [
"Set",
"default",
"connection"
] | b3a95eeb976042ac2a393cc10755a7adbc164c24 | https://github.com/FuturaSoft/Pabana/blob/b3a95eeb976042ac2a393cc10755a7adbc164c24/src/Database/ConnectionCollection.php#L137-L146 |
10,078 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findAssociationCategoryByID | public function findAssociationCategoryByID($id)
{
$categories = $this->findAssociationCategories()->getCategories();
$categories->rewind();
while ($categories->valid()) {
$category = $categories->current();
if ($category->getID() == $id) {
return $c... | php | public function findAssociationCategoryByID($id)
{
$categories = $this->findAssociationCategories()->getCategories();
$categories->rewind();
while ($categories->valid()) {
$category = $categories->current();
if ($category->getID() == $id) {
return $c... | [
"public",
"function",
"findAssociationCategoryByID",
"(",
"$",
"id",
")",
"{",
"$",
"categories",
"=",
"$",
"this",
"->",
"findAssociationCategories",
"(",
")",
"->",
"getCategories",
"(",
")",
";",
"$",
"categories",
"->",
"rewind",
"(",
")",
";",
"while",
... | return a association category
@param string category id
@return Category | [
"return",
"a",
"association",
"category"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L30-L44 |
10,079 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findAssociationCategories | public function findAssociationCategories()
{
$xmlQuery = $this->metaApiService->getAssociationCategories();
$categories = new Categories();
$mapper = new \RGU\Dvoconnector\Mapper\AssociationCategories($xmlQuery);
$mapper->mapToAbstractEntity($categories);
return $categori... | php | public function findAssociationCategories()
{
$xmlQuery = $this->metaApiService->getAssociationCategories();
$categories = new Categories();
$mapper = new \RGU\Dvoconnector\Mapper\AssociationCategories($xmlQuery);
$mapper->mapToAbstractEntity($categories);
return $categori... | [
"public",
"function",
"findAssociationCategories",
"(",
")",
"{",
"$",
"xmlQuery",
"=",
"$",
"this",
"->",
"metaApiService",
"->",
"getAssociationCategories",
"(",
")",
";",
"$",
"categories",
"=",
"new",
"Categories",
"(",
")",
";",
"$",
"mapper",
"=",
"new... | return all association categories
@return Categories | [
"return",
"all",
"association",
"categories"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L52-L62 |
10,080 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findAssociationRepertoireByID | public function findAssociationRepertoireByID($id)
{
$repertoires = $this->findAssociationRepertoires()->getRepertoires();
$repertoires->rewind();
while ($repertoires->valid()) {
$repertoire = $repertoires->current();
if ($repertoire->getID() == $id) {
... | php | public function findAssociationRepertoireByID($id)
{
$repertoires = $this->findAssociationRepertoires()->getRepertoires();
$repertoires->rewind();
while ($repertoires->valid()) {
$repertoire = $repertoires->current();
if ($repertoire->getID() == $id) {
... | [
"public",
"function",
"findAssociationRepertoireByID",
"(",
"$",
"id",
")",
"{",
"$",
"repertoires",
"=",
"$",
"this",
"->",
"findAssociationRepertoires",
"(",
")",
"->",
"getRepertoires",
"(",
")",
";",
"$",
"repertoires",
"->",
"rewind",
"(",
")",
";",
"wh... | return a association repertoire
@param string repertoire id
@return Repertoire | [
"return",
"a",
"association",
"repertoire"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L71-L85 |
10,081 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findAssociationRepertoires | public function findAssociationRepertoires()
{
$xmlQuery = $this->metaApiService->getAssociationRepertoires();
$repertoires = new Repertoires();
$mapper = new \RGU\Dvoconnector\Mapper\AssociationRepertoires($xmlQuery);
$mapper->mapToAbstractEntity($repertoires);
return $re... | php | public function findAssociationRepertoires()
{
$xmlQuery = $this->metaApiService->getAssociationRepertoires();
$repertoires = new Repertoires();
$mapper = new \RGU\Dvoconnector\Mapper\AssociationRepertoires($xmlQuery);
$mapper->mapToAbstractEntity($repertoires);
return $re... | [
"public",
"function",
"findAssociationRepertoires",
"(",
")",
"{",
"$",
"xmlQuery",
"=",
"$",
"this",
"->",
"metaApiService",
"->",
"getAssociationRepertoires",
"(",
")",
";",
"$",
"repertoires",
"=",
"new",
"Repertoires",
"(",
")",
";",
"$",
"mapper",
"=",
... | return all association repertoires
@return Repertoires | [
"return",
"all",
"association",
"repertoires"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L93-L103 |
10,082 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findAssociationPerformancelevelByID | public function findAssociationPerformancelevelByID($id)
{
$performancelevels = $this->findAssociationPerformancelevels()->getPerformancelevels();
$performancelevels->rewind();
while ($performancelevels->valid()) {
$performancelevel = $performancelevels->current();
... | php | public function findAssociationPerformancelevelByID($id)
{
$performancelevels = $this->findAssociationPerformancelevels()->getPerformancelevels();
$performancelevels->rewind();
while ($performancelevels->valid()) {
$performancelevel = $performancelevels->current();
... | [
"public",
"function",
"findAssociationPerformancelevelByID",
"(",
"$",
"id",
")",
"{",
"$",
"performancelevels",
"=",
"$",
"this",
"->",
"findAssociationPerformancelevels",
"(",
")",
"->",
"getPerformancelevels",
"(",
")",
";",
"$",
"performancelevels",
"->",
"rewin... | return a association performancelevel
@param string performancelevel id
@return Performancelevel | [
"return",
"a",
"association",
"performancelevel"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L112-L126 |
10,083 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findAssociationPerformancelevels | public function findAssociationPerformancelevels()
{
$xmlQuery = $this->metaApiService->getAssociationPerformancelevels();
$performancelevels = new Performancelevels();
$mapper = new \RGU\Dvoconnector\Mapper\AssociationPerformancelevels($xmlQuery);
$mapper->mapToAbstractEntity($per... | php | public function findAssociationPerformancelevels()
{
$xmlQuery = $this->metaApiService->getAssociationPerformancelevels();
$performancelevels = new Performancelevels();
$mapper = new \RGU\Dvoconnector\Mapper\AssociationPerformancelevels($xmlQuery);
$mapper->mapToAbstractEntity($per... | [
"public",
"function",
"findAssociationPerformancelevels",
"(",
")",
"{",
"$",
"xmlQuery",
"=",
"$",
"this",
"->",
"metaApiService",
"->",
"getAssociationPerformancelevels",
"(",
")",
";",
"$",
"performancelevels",
"=",
"new",
"Performancelevels",
"(",
")",
";",
"$... | return all association performancelevels
@return Performancelevels | [
"return",
"all",
"association",
"performancelevels"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L134-L144 |
10,084 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findEventTypeByID | public function findEventTypeByID($id)
{
$eventTypes = $this->findEventTypes()->getTypes();
$eventTypes->rewind();
while ($eventTypes->valid()) {
$eventType = $eventTypes->current();
if ($eventType->getID() == $id) {
return $eventType;
}
... | php | public function findEventTypeByID($id)
{
$eventTypes = $this->findEventTypes()->getTypes();
$eventTypes->rewind();
while ($eventTypes->valid()) {
$eventType = $eventTypes->current();
if ($eventType->getID() == $id) {
return $eventType;
}
... | [
"public",
"function",
"findEventTypeByID",
"(",
"$",
"id",
")",
"{",
"$",
"eventTypes",
"=",
"$",
"this",
"->",
"findEventTypes",
"(",
")",
"->",
"getTypes",
"(",
")",
";",
"$",
"eventTypes",
"->",
"rewind",
"(",
")",
";",
"while",
"(",
"$",
"eventType... | return a event type
@param string event type id
@return Event | [
"return",
"a",
"event",
"type"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L153-L167 |
10,085 | codebobbly/dvoconnector | Classes/Domain/Repository/MetaRepository.php | MetaRepository.findEventTypes | public function findEventTypes()
{
$xmlQuery = $this->metaApiService->getEventTypes();
$types = new Types();
$mapper = new \RGU\Dvoconnector\Mapper\EventTypes($xmlQuery);
$mapper->mapToAbstractEntity($types);
return $types;
} | php | public function findEventTypes()
{
$xmlQuery = $this->metaApiService->getEventTypes();
$types = new Types();
$mapper = new \RGU\Dvoconnector\Mapper\EventTypes($xmlQuery);
$mapper->mapToAbstractEntity($types);
return $types;
} | [
"public",
"function",
"findEventTypes",
"(",
")",
"{",
"$",
"xmlQuery",
"=",
"$",
"this",
"->",
"metaApiService",
"->",
"getEventTypes",
"(",
")",
";",
"$",
"types",
"=",
"new",
"Types",
"(",
")",
";",
"$",
"mapper",
"=",
"new",
"\\",
"RGU",
"\\",
"D... | return all event types
@return Events | [
"return",
"all",
"event",
"types"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Repository/MetaRepository.php#L175-L185 |
10,086 | laradic/service-provider | src/_ServiceProvider.php | _ServiceProvider.defaultConfigStrategy | protected function defaultConfigStrategy($path, $key)
{
$config = $this->app->make('config')->get($key, []);
$this->app->make('config')->set($key, array_replace_recursive(require $path, $config));
} | php | protected function defaultConfigStrategy($path, $key)
{
$config = $this->app->make('config')->get($key, []);
$this->app->make('config')->set($key, array_replace_recursive(require $path, $config));
} | [
"protected",
"function",
"defaultConfigStrategy",
"(",
"$",
"path",
",",
"$",
"key",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'config'",
")",
"->",
"get",
"(",
"$",
"key",
",",
"[",
"]",
")",
";",
"$",
"this",
"... | The default config merge function, instead of using the laravel mergeConfigRom it.
@param $path
@param $key | [
"The",
"default",
"config",
"merge",
"function",
"instead",
"of",
"using",
"the",
"laravel",
"mergeConfigRom",
"it",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/_ServiceProvider.php#L605-L609 |
10,087 | laradic/service-provider | src/_ServiceProvider.php | _ServiceProvider.tryRegisterProviders | protected function tryRegisterProviders($on)
{
if ($on === $this->registerProvidersOn && $this->registerProvidersMethod === self::METHOD_REGISTER) {
// FIRST register all given providers
foreach ($this->providers as $provider) {
$this->app->register($provider);
... | php | protected function tryRegisterProviders($on)
{
if ($on === $this->registerProvidersOn && $this->registerProvidersMethod === self::METHOD_REGISTER) {
// FIRST register all given providers
foreach ($this->providers as $provider) {
$this->app->register($provider);
... | [
"protected",
"function",
"tryRegisterProviders",
"(",
"$",
"on",
")",
"{",
"if",
"(",
"$",
"on",
"===",
"$",
"this",
"->",
"registerProvidersOn",
"&&",
"$",
"this",
"->",
"registerProvidersMethod",
"===",
"self",
"::",
"METHOD_REGISTER",
")",
"{",
"// FIRST re... | tryRegisterProviders method.
@param $on | [
"tryRegisterProviders",
"method",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/_ServiceProvider.php#L650-L671 |
10,088 | laradic/service-provider | src/_ServiceProvider.php | _ServiceProvider.routeMiddleware | protected function routeMiddleware($key, $middleware = null, $force = false)
{
if ($this->app->runningInConsole() && $force === false) {
return $this->getRouter();
}
if (is_array($key)) {
foreach ($key as $k => $m) {
$this->routeMiddleware($k, $m);
... | php | protected function routeMiddleware($key, $middleware = null, $force = false)
{
if ($this->app->runningInConsole() && $force === false) {
return $this->getRouter();
}
if (is_array($key)) {
foreach ($key as $k => $m) {
$this->routeMiddleware($k, $m);
... | [
"protected",
"function",
"routeMiddleware",
"(",
"$",
"key",
",",
"$",
"middleware",
"=",
"null",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"runningInConsole",
"(",
")",
"&&",
"$",
"force",
"===",
"false",
... | Add a route middleware. Will not be added when running in console.
@param $key
@param null $middleware
@param bool $force
@return \Illuminate\Contracts\Routing\Registrar|\Illuminate\Routing\Router | [
"Add",
"a",
"route",
"middleware",
".",
"Will",
"not",
"be",
"added",
"when",
"running",
"in",
"console",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/_ServiceProvider.php#L770-L784 |
10,089 | laradic/service-provider | src/_ServiceProvider.php | _ServiceProvider.getResolvedPaths | protected function getResolvedPaths()
{
if (null === $this->resolvedPaths) {
$this->resolveDirectories();
// Collect all path properties and put them into $paths associatively using propertyName => propertyValue
$paths = [];
collect(array_keys(get_class_vars(g... | php | protected function getResolvedPaths()
{
if (null === $this->resolvedPaths) {
$this->resolveDirectories();
// Collect all path properties and put them into $paths associatively using propertyName => propertyValue
$paths = [];
collect(array_keys(get_class_vars(g... | [
"protected",
"function",
"getResolvedPaths",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"resolvedPaths",
")",
"{",
"$",
"this",
"->",
"resolveDirectories",
"(",
")",
";",
"// Collect all path properties and put them into $paths associatively using prope... | resolvePaths method.
@todo
@return array | [
"resolvePaths",
"method",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/_ServiceProvider.php#L883-L904 |
10,090 | laradic/service-provider | src/_ServiceProvider.php | _ServiceProvider.findCommandsFiles | protected function findCommandsFiles($directory)
{
$glob = glob($directory.'/*');
if ($glob === false) {
return [];
}
// To get the appropriate files, we'll simply glob the directory and filter
// out any "files" that are not truly files so we do not end up with... | php | protected function findCommandsFiles($directory)
{
$glob = glob($directory.'/*');
if ($glob === false) {
return [];
}
// To get the appropriate files, we'll simply glob the directory and filter
// out any "files" that are not truly files so we do not end up with... | [
"protected",
"function",
"findCommandsFiles",
"(",
"$",
"directory",
")",
"{",
"$",
"glob",
"=",
"glob",
"(",
"$",
"directory",
".",
"'/*'",
")",
";",
"if",
"(",
"$",
"glob",
"===",
"false",
")",
"{",
"return",
"[",
"]",
";",
"}",
"// To get the approp... | findCommandsFiles method.
@param $directory
@return array | [
"findCommandsFiles",
"method",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/_ServiceProvider.php#L955-L969 |
10,091 | onesimus-systems/oslogger | src/Adaptors/AbstractAdaptor.php | AbstractAdaptor.isHandling | public function isHandling($level)
{
$min = $this->minimumLevel;
$max = $this->maximumLevel;
$lev = Logger::$levels[$level];
return ($min >= $lev && $lev >= $max);
} | php | public function isHandling($level)
{
$min = $this->minimumLevel;
$max = $this->maximumLevel;
$lev = Logger::$levels[$level];
return ($min >= $lev && $lev >= $max);
} | [
"public",
"function",
"isHandling",
"(",
"$",
"level",
")",
"{",
"$",
"min",
"=",
"$",
"this",
"->",
"minimumLevel",
";",
"$",
"max",
"=",
"$",
"this",
"->",
"maximumLevel",
";",
"$",
"lev",
"=",
"Logger",
"::",
"$",
"levels",
"[",
"$",
"level",
"]... | Checks if the log level is handled with this adaptor
@param string $level Log level
@return boolean | [
"Checks",
"if",
"the",
"log",
"level",
"is",
"handled",
"with",
"this",
"adaptor"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/Adaptors/AbstractAdaptor.php#L41-L48 |
10,092 | onesimus-systems/oslogger | src/Adaptors/AbstractAdaptor.php | AbstractAdaptor.setLevel | public function setLevel($min = null, $max = null)
{
// Null for default allows easier calling to set
// a maximum level only
if (!$min || !Logger::isLogLevel($min)) {
$min = LogLevel::DEBUG;
}
if (!$max || !Logger::isLogLevel($max)) {
$max = LogLevel... | php | public function setLevel($min = null, $max = null)
{
// Null for default allows easier calling to set
// a maximum level only
if (!$min || !Logger::isLogLevel($min)) {
$min = LogLevel::DEBUG;
}
if (!$max || !Logger::isLogLevel($max)) {
$max = LogLevel... | [
"public",
"function",
"setLevel",
"(",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
")",
"{",
"// Null for default allows easier calling to set",
"// a maximum level only",
"if",
"(",
"!",
"$",
"min",
"||",
"!",
"Logger",
"::",
"isLogLevel",
"(",
"$"... | Sets the minimum log level handled by this adaptor
@param string $level Log level | [
"Sets",
"the",
"minimum",
"log",
"level",
"handled",
"by",
"this",
"adaptor"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/Adaptors/AbstractAdaptor.php#L55-L69 |
10,093 | flowcode/ceibo | src/flowcode/ceibo/EntityManager.php | EntityManager.findRelation | public function findRelation($entity, $relationName, $orderColumn = null, $orderType = null) {
$this->load();
$mapper = MapperBuilder::buildFromClassName($this->mapping, get_class($entity));
$relation = $mapper->getRelation($relationName);
$relationMapper = MapperBuilder::buildFromName($... | php | public function findRelation($entity, $relationName, $orderColumn = null, $orderType = null) {
$this->load();
$mapper = MapperBuilder::buildFromClassName($this->mapping, get_class($entity));
$relation = $mapper->getRelation($relationName);
$relationMapper = MapperBuilder::buildFromName($... | [
"public",
"function",
"findRelation",
"(",
"$",
"entity",
",",
"$",
"relationName",
",",
"$",
"orderColumn",
"=",
"null",
",",
"$",
"orderType",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"$",
"mapper",
"=",
"MapperBuilder",
"::",... | Find by table relation.
@param type $entity
@param string $relationName
@param string $orderColumn
@param string $orderType
@return Collection | [
"Find",
"by",
"table",
"relation",
"."
] | ba264dc681a9d803885fd35d10b0e37776f66659 | https://github.com/flowcode/ceibo/blob/ba264dc681a9d803885fd35d10b0e37776f66659/src/flowcode/ceibo/EntityManager.php#L329-L358 |
10,094 | flowcode/ceibo | src/flowcode/ceibo/EntityManager.php | EntityManager.findByGenericFilter | public function findByGenericFilter($name, $filter = null, $page = 1, $orderColumn = null, $orderType = null) {
$this->load();
$mapper = MapperBuilder::buildFromName($this->mapping, $name);
$selectQuery = "";
$whereQuery = "";
$orderQuery = "";
$selectQuery .= "SELECT *... | php | public function findByGenericFilter($name, $filter = null, $page = 1, $orderColumn = null, $orderType = null) {
$this->load();
$mapper = MapperBuilder::buildFromName($this->mapping, $name);
$selectQuery = "";
$whereQuery = "";
$orderQuery = "";
$selectQuery .= "SELECT *... | [
"public",
"function",
"findByGenericFilter",
"(",
"$",
"name",
",",
"$",
"filter",
"=",
"null",
",",
"$",
"page",
"=",
"1",
",",
"$",
"orderColumn",
"=",
"null",
",",
"$",
"orderType",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";"... | Finds entitys by its generic filter defined in the configured mapping.
@param type $name
@param type $filter
@param type $page
@param type $orderColumn
@param type $orderType
@return Pager | [
"Finds",
"entitys",
"by",
"its",
"generic",
"filter",
"defined",
"in",
"the",
"configured",
"mapping",
"."
] | ba264dc681a9d803885fd35d10b0e37776f66659 | https://github.com/flowcode/ceibo/blob/ba264dc681a9d803885fd35d10b0e37776f66659/src/flowcode/ceibo/EntityManager.php#L419-L472 |
10,095 | blast-project/ResourceBundle | src/Doctrine/ORM/NamingStrategy/UnderscoredBundlePrefixStrategy.php | UnderscoredBundlePrefixStrategy.getTableNamePrefix | private function getTableNamePrefix($className)
{
$name = ltrim($className, '\\');
foreach ($this->namingMap as $prefix => $namespace) {
if (strpos($name, $namespace) === 0) {
return $prefix . '_';
}
}
return '';
} | php | private function getTableNamePrefix($className)
{
$name = ltrim($className, '\\');
foreach ($this->namingMap as $prefix => $namespace) {
if (strpos($name, $namespace) === 0) {
return $prefix . '_';
}
}
return '';
} | [
"private",
"function",
"getTableNamePrefix",
"(",
"$",
"className",
")",
"{",
"$",
"name",
"=",
"ltrim",
"(",
"$",
"className",
",",
"'\\\\'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"namingMap",
"as",
"$",
"prefix",
"=>",
"$",
"namespace",
")",
"... | Get prefix for table from naming map.
@param string $className
@return string | [
"Get",
"prefix",
"for",
"table",
"from",
"naming",
"map",
"."
] | 3bf895a73f991619d8f08c29fa6761b5511cad99 | https://github.com/blast-project/ResourceBundle/blob/3bf895a73f991619d8f08c29fa6761b5511cad99/src/Doctrine/ORM/NamingStrategy/UnderscoredBundlePrefixStrategy.php#L147-L157 |
10,096 | FlexPress/component-templating | src/FlexPress/Components/Templating/Functions/ThePageTitle.php | ThePageTitle.getFunctionBody | public function getFunctionBody()
{
global $page, $paged;
wp_title('|', true, 'right');
// Add the blog name.
bloginfo('name');
// Add the blog description for the home/front page.
$site_description = get_bloginfo('description', 'display');
if ($site_desc... | php | public function getFunctionBody()
{
global $page, $paged;
wp_title('|', true, 'right');
// Add the blog name.
bloginfo('name');
// Add the blog description for the home/front page.
$site_description = get_bloginfo('description', 'display');
if ($site_desc... | [
"public",
"function",
"getFunctionBody",
"(",
")",
"{",
"global",
"$",
"page",
",",
"$",
"paged",
";",
"wp_title",
"(",
"'|'",
",",
"true",
",",
"'right'",
")",
";",
"// Add the blog name.",
"bloginfo",
"(",
"'name'",
")",
";",
"// Add the blog description for... | The function that is executed when called in a template
@return mixed
@author Tim Perry | [
"The",
"function",
"that",
"is",
"executed",
"when",
"called",
"in",
"a",
"template"
] | 58d1cdd3cae3bfff41d987f8c8a493e6a6efd9cb | https://github.com/FlexPress/component-templating/blob/58d1cdd3cae3bfff41d987f8c8a493e6a6efd9cb/src/FlexPress/Components/Templating/Functions/ThePageTitle.php#L27-L49 |
10,097 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination.instance | public static function instance($name = null)
{
if ($name !== null)
{
if ( ! array_key_exists($name, static::$_instances))
{
return false;
}
return static::$_instances[$name];
}
if (static::$_instance === null)
{
static::$_instance = static::forge();
}
return static::$_instance;
} | php | public static function instance($name = null)
{
if ($name !== null)
{
if ( ! array_key_exists($name, static::$_instances))
{
return false;
}
return static::$_instances[$name];
}
if (static::$_instance === null)
{
static::$_instance = static::forge();
}
return static::$_instance;
} | [
"public",
"static",
"function",
"instance",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"!==",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"static",
"::",
"$",
"_instances",
")",
")",
"{",
"retu... | retrieve an existing pagination instance
@return \Pagination a existing pagination instance | [
"retrieve",
"an",
"existing",
"pagination",
"instance"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L99-L117 |
10,098 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination.render | public function render($raw = false)
{
// no links if we only have one page
if ($this->config['total_pages'] == 1)
{
return $raw ? array() : '';
}
$this->raw_results = array();
$html = str_replace(
'{pagination}',
$this->first().$this->previous().$this->pages_render().$this->next().$this->last()... | php | public function render($raw = false)
{
// no links if we only have one page
if ($this->config['total_pages'] == 1)
{
return $raw ? array() : '';
}
$this->raw_results = array();
$html = str_replace(
'{pagination}',
$this->first().$this->previous().$this->pages_render().$this->next().$this->last()... | [
"public",
"function",
"render",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"// no links if we only have one page",
"if",
"(",
"$",
"this",
"->",
"config",
"[",
"'total_pages'",
"]",
"==",
"1",
")",
"{",
"return",
"$",
"raw",
"?",
"array",
"(",
")",
":",
... | Creates the pagination markup
@return mixed HTML Markup for page number links, or an array of raw pagination data | [
"Creates",
"the",
"pagination",
"markup"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L267-L284 |
10,099 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination.pages_render | public function pages_render()
{
// no links if we only have one page
if ($this->config['total_pages'] == 1)
{
return '';
}
$html = '';
// calculate start- and end page numbers
$start = $this->config['calculated_page'] - floor($this->config['num_links'] * $this->config['link_offset']);
$end = $thi... | php | public function pages_render()
{
// no links if we only have one page
if ($this->config['total_pages'] == 1)
{
return '';
}
$html = '';
// calculate start- and end page numbers
$start = $this->config['calculated_page'] - floor($this->config['num_links'] * $this->config['link_offset']);
$end = $thi... | [
"public",
"function",
"pages_render",
"(",
")",
"{",
"// no links if we only have one page",
"if",
"(",
"$",
"this",
"->",
"config",
"[",
"'total_pages'",
"]",
"==",
"1",
")",
"{",
"return",
"''",
";",
"}",
"$",
"html",
"=",
"''",
";",
"// calculate start- a... | generate the HTML for the page links only
@return string Markup for the pagination block | [
"generate",
"the",
"HTML",
"for",
"the",
"page",
"links",
"only"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L291-L349 |
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.