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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
198,400 | horntell/php-sdk | src/Horntell/Http/Request.php | Request.send | public function send($method, $endpoint, $data = [])
{
try
{
$request = $this->client->createRequest($method, $endpoint, ['body' => json_encode($data)]);
return new Response($this->client->send($request));
}
catch(GuzzleExceptions\RequestException $e)
{
// pass the exception to a helper method,
/... | php | public function send($method, $endpoint, $data = [])
{
try
{
$request = $this->client->createRequest($method, $endpoint, ['body' => json_encode($data)]);
return new Response($this->client->send($request));
}
catch(GuzzleExceptions\RequestException $e)
{
// pass the exception to a helper method,
/... | [
"public",
"function",
"send",
"(",
"$",
"method",
",",
"$",
"endpoint",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"client",
"->",
"createRequest",
"(",
"$",
"method",
",",
"$",
"endpoint",
",",
... | Wraps HTTP call into a good mould
@param string $method
@param string $endpoint
@param array $data
@return Horntell\Http\Response
@throws Horntell\Errors\* | [
"Wraps",
"HTTP",
"call",
"into",
"a",
"good",
"mould"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Http/Request.php#L46-L60 |
198,401 | horntell/php-sdk | src/Horntell/Http/Request.php | Request.handleError | private function handleError($e)
{
// if there's no response attached to the exception,
// we will assume that the request was never sent and
// thus will throw a network error
if( ! $e->hasResponse())
{
throw new Errors\NetworkError;
}
// if there's a response attached to the exception,
// we will... | php | private function handleError($e)
{
// if there's no response attached to the exception,
// we will assume that the request was never sent and
// thus will throw a network error
if( ! $e->hasResponse())
{
throw new Errors\NetworkError;
}
// if there's a response attached to the exception,
// we will... | [
"private",
"function",
"handleError",
"(",
"$",
"e",
")",
"{",
"// if there's no response attached to the exception,",
"// we will assume that the request was never sent and",
"// thus will throw a network error",
"if",
"(",
"!",
"$",
"e",
"->",
"hasResponse",
"(",
")",
")",
... | Handles the error by throwing proper exception
@param GuzzleHttp\Exception\RequestException $e
@return null
@throws Horntell\Errors\NetworkError If original exception has no response attached to it
@throws Horntell\Errors\InvalidRequestException If HTTP Status Code is 400
@throws Horntell\Errors\AuthenticationExcepti... | [
"Handles",
"the",
"error",
"by",
"throwing",
"proper",
"exception"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Http/Request.php#L74-L118 |
198,402 | horntell/php-sdk | src/Horntell/Http/Request.php | Request.handleUnknownError | private function handleUnknownError($e)
{
$response = $e->getResponse();
$body = $response->json();
// switching on the first number of status code
// we are using floor to round off to the lower end
// eg. floor(404 / 100) == 4
switch(floor($response->getStatusCode() / 100))
{
// client error (4xx)
... | php | private function handleUnknownError($e)
{
$response = $e->getResponse();
$body = $response->json();
// switching on the first number of status code
// we are using floor to round off to the lower end
// eg. floor(404 / 100) == 4
switch(floor($response->getStatusCode() / 100))
{
// client error (4xx)
... | [
"private",
"function",
"handleUnknownError",
"(",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"$",
"e",
"->",
"getResponse",
"(",
")",
";",
"$",
"body",
"=",
"$",
"response",
"->",
"json",
"(",
")",
";",
"// switching on the first number of status code",
"// w... | Handles unknown errors by checking the kind of HTTP status code
@param GuzzleHttp\Exception\RequestException $e
@return null
@throws Horntell\Errors\InvalidRequestError If HTTP Status Code is 4xx
@throws Horntell\Errors\ServiceError If HTTP Status Code is 5xx
@throws Horntell\Errors\Error If HTTP Status Code is other... | [
"Handles",
"unknown",
"errors",
"by",
"checking",
"the",
"kind",
"of",
"HTTP",
"status",
"code"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Http/Request.php#L129-L153 |
198,403 | pixelpolishers/makedocs | src/MakeDocs/Generator/PageManager.php | PageManager.getSourceFile | public function getSourceFile($page)
{
$path = realpath($this->generator->getInputDirectory() . '/' . $page . '.xml');
return new SourceFile($page, $path);
} | php | public function getSourceFile($page)
{
$path = realpath($this->generator->getInputDirectory() . '/' . $page . '.xml');
return new SourceFile($page, $path);
} | [
"public",
"function",
"getSourceFile",
"(",
"$",
"page",
")",
"{",
"$",
"path",
"=",
"realpath",
"(",
"$",
"this",
"->",
"generator",
"->",
"getInputDirectory",
"(",
")",
".",
"'/'",
".",
"$",
"page",
".",
"'.xml'",
")",
";",
"return",
"new",
"SourceFi... | Loads a source file.
@param string $page The page to load.
@return SourceFile | [
"Loads",
"a",
"source",
"file",
"."
] | 1fa243b52565b5de417ef2dbdfbcae9896b6b483 | https://github.com/pixelpolishers/makedocs/blob/1fa243b52565b5de417ef2dbdfbcae9896b6b483/src/MakeDocs/Generator/PageManager.php#L67-L72 |
198,404 | congraphcms/core | Traits/ValidatorTrait.php | ValidatorTrait.validateParams | protected function validateParams(array &$params, $rules = null, $clean = false)
{
if( ! is_null($rules) )
{
// init laravel validator
$validator = $this->newValidator($params, $rules, $clean);
$this->setValidator($validator);
}
$validator = $this->getValidator();
$rules = $validator->getRules();
... | php | protected function validateParams(array &$params, $rules = null, $clean = false)
{
if( ! is_null($rules) )
{
// init laravel validator
$validator = $this->newValidator($params, $rules, $clean);
$this->setValidator($validator);
}
$validator = $this->getValidator();
$rules = $validator->getRules();
... | [
"protected",
"function",
"validateParams",
"(",
"array",
"&",
"$",
"params",
",",
"$",
"rules",
"=",
"null",
",",
"$",
"clean",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"rules",
")",
")",
"{",
"// init laravel validator",
"$",
"vali... | Validate params by given rules
@param $params array - input parameters
@param $rules array - rules for validator
@param $clean boolean - whether to unset params that are not in rules
@return boolean | [
"Validate",
"params",
"by",
"given",
"rules"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/ValidatorTrait.php#L59-L87 |
198,405 | WellCommerce/ClientBundle | Twig/Extension/ClientAddressFormatterExtension.php | ClientAddressFormatterExtension.formatShippingAddress | public function formatShippingAddress(ClientShippingAddressInterface $address, $lineSeparator = self::LINES_SEPARATOR)
{
$lines = [];
$lines[] = sprintf('%s %s', $address->getFirstName(), $address->getLastName());
if ('' !== $address->getCompanyName()) {
$lines[] = $address->ge... | php | public function formatShippingAddress(ClientShippingAddressInterface $address, $lineSeparator = self::LINES_SEPARATOR)
{
$lines = [];
$lines[] = sprintf('%s %s', $address->getFirstName(), $address->getLastName());
if ('' !== $address->getCompanyName()) {
$lines[] = $address->ge... | [
"public",
"function",
"formatShippingAddress",
"(",
"ClientShippingAddressInterface",
"$",
"address",
",",
"$",
"lineSeparator",
"=",
"self",
"::",
"LINES_SEPARATOR",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"sprintf",
"(",
"'... | Formats the shipping address
@param ClientShippingAddressInterface $address
@param string $lineSeparator
@return string | [
"Formats",
"the",
"shipping",
"address"
] | b19aa5c962e67972f79338d2f341b30fa1ee879e | https://github.com/WellCommerce/ClientBundle/blob/b19aa5c962e67972f79338d2f341b30fa1ee879e/Twig/Extension/ClientAddressFormatterExtension.php#L74-L86 |
198,406 | WellCommerce/ClientBundle | Twig/Extension/ClientAddressFormatterExtension.php | ClientAddressFormatterExtension.formatContactDetails | public function formatContactDetails(ClientContactDetailsInterface $details, $lineSeparator = self::LINES_SEPARATOR)
{
$lines = [];
$lines[] = sprintf('%s %s', $details->getFirstName(), $details->getLastName());
$lines[] = sprintf('%s %s', $details->getPhone(), $details->getSecondaryPhone(... | php | public function formatContactDetails(ClientContactDetailsInterface $details, $lineSeparator = self::LINES_SEPARATOR)
{
$lines = [];
$lines[] = sprintf('%s %s', $details->getFirstName(), $details->getLastName());
$lines[] = sprintf('%s %s', $details->getPhone(), $details->getSecondaryPhone(... | [
"public",
"function",
"formatContactDetails",
"(",
"ClientContactDetailsInterface",
"$",
"details",
",",
"$",
"lineSeparator",
"=",
"self",
"::",
"LINES_SEPARATOR",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"sprintf",
"(",
"'%s... | Formats the contact details
@param ClientContactDetailsInterface $details
@param string $lineSeparator
@return string | [
"Formats",
"the",
"contact",
"details"
] | b19aa5c962e67972f79338d2f341b30fa1ee879e | https://github.com/WellCommerce/ClientBundle/blob/b19aa5c962e67972f79338d2f341b30fa1ee879e/Twig/Extension/ClientAddressFormatterExtension.php#L96-L104 |
198,407 | raphievila/xtags | src/xTags.php | xTags.frm | public function frm($txt, $att = '', $a = '', $m = '', $e = '')
{
$attList = array();
if (!empty($a)) {
$attList['action'] = $a;
}
if (!empty($m)) {
$attList['method'] = $m;
}
if (!empty($e)) {
$attList['enctype'] = $e;
}
... | php | public function frm($txt, $att = '', $a = '', $m = '', $e = '')
{
$attList = array();
if (!empty($a)) {
$attList['action'] = $a;
}
if (!empty($m)) {
$attList['method'] = $m;
}
if (!empty($e)) {
$attList['enctype'] = $e;
}
... | [
"public",
"function",
"frm",
"(",
"$",
"txt",
",",
"$",
"att",
"=",
"''",
",",
"$",
"a",
"=",
"''",
",",
"$",
"m",
"=",
"''",
",",
"$",
"e",
"=",
"''",
")",
"{",
"$",
"attList",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
... | complex tags predefined to simplify coding | [
"complex",
"tags",
"predefined",
"to",
"simplify",
"coding"
] | cd05cc4d8811662becffb0dd1abce30d8436f2c7 | https://github.com/raphievila/xtags/blob/cd05cc4d8811662becffb0dd1abce30d8436f2c7/src/xTags.php#L213-L228 |
198,408 | TitaPHP/framework | src/TitaPHP/Foundation/Application.php | Application.setConfig | public function setConfig( $param, $value )
{
$dn = new DotNotation($this->configs);
$dn->set($param, $value);
$this->configs = $dn->getValues();
} | php | public function setConfig( $param, $value )
{
$dn = new DotNotation($this->configs);
$dn->set($param, $value);
$this->configs = $dn->getValues();
} | [
"public",
"function",
"setConfig",
"(",
"$",
"param",
",",
"$",
"value",
")",
"{",
"$",
"dn",
"=",
"new",
"DotNotation",
"(",
"$",
"this",
"->",
"configs",
")",
";",
"$",
"dn",
"->",
"set",
"(",
"$",
"param",
",",
"$",
"value",
")",
";",
"$",
"... | Set configuration parameter.
@param string $param
@param string $value
@return void | [
"Set",
"configuration",
"parameter",
"."
] | 72283a45733a49c1d9c1fc0eba22ff13a802295c | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Foundation/Application.php#L127-L132 |
198,409 | TitaPHP/framework | src/TitaPHP/Foundation/Application.php | Application.getConfig | public function getConfig( $param, $defaultValue = null )
{
$dn = new DotNotation($this->configs);
return $dn->get($param, $defaultValue);
} | php | public function getConfig( $param, $defaultValue = null )
{
$dn = new DotNotation($this->configs);
return $dn->get($param, $defaultValue);
} | [
"public",
"function",
"getConfig",
"(",
"$",
"param",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"$",
"dn",
"=",
"new",
"DotNotation",
"(",
"$",
"this",
"->",
"configs",
")",
";",
"return",
"$",
"dn",
"->",
"get",
"(",
"$",
"param",
",",
"$",... | Get Configuration Value.
@param string $param
@param null $defaultValue
@return mixed | [
"Get",
"Configuration",
"Value",
"."
] | 72283a45733a49c1d9c1fc0eba22ff13a802295c | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Foundation/Application.php#L143-L147 |
198,410 | TitaPHP/framework | src/TitaPHP/Foundation/Application.php | Application.loadProviders | protected function loadProviders($providers)
{
foreach ((array) $providers as $provider) {
$provider = $this->container->get($provider);
if (!$provider instanceof ServiceProviderInterface) {
$providerName = get_class($provider);
throw new \Exception(
"$providerName does not implement required \\T... | php | protected function loadProviders($providers)
{
foreach ((array) $providers as $provider) {
$provider = $this->container->get($provider);
if (!$provider instanceof ServiceProviderInterface) {
$providerName = get_class($provider);
throw new \Exception(
"$providerName does not implement required \\T... | [
"protected",
"function",
"loadProviders",
"(",
"$",
"providers",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"providers",
"as",
"$",
"provider",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"$",
"provider",
")... | Register Providers into the Application.
@param array $providers
@return void
@throws \Exception | [
"Register",
"Providers",
"into",
"the",
"Application",
"."
] | 72283a45733a49c1d9c1fc0eba22ff13a802295c | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Foundation/Application.php#L178-L192 |
198,411 | TitaPHP/framework | src/TitaPHP/Foundation/Application.php | Application.loadEvents | protected function loadEvents($appEvents)
{
foreach ((array) $appEvents as $appEventType => $events) {
foreach ($events as $event) {
$this->eventDispatcher->addListener($appEventType, $this->container->get($event));
}
}
} | php | protected function loadEvents($appEvents)
{
foreach ((array) $appEvents as $appEventType => $events) {
foreach ($events as $event) {
$this->eventDispatcher->addListener($appEventType, $this->container->get($event));
}
}
} | [
"protected",
"function",
"loadEvents",
"(",
"$",
"appEvents",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"appEvents",
"as",
"$",
"appEventType",
"=>",
"$",
"events",
")",
"{",
"foreach",
"(",
"$",
"events",
"as",
"$",
"event",
")",
"{",
"$",
"... | Register Event Listeners.
@param array $appEvents
@return void | [
"Register",
"Event",
"Listeners",
"."
] | 72283a45733a49c1d9c1fc0eba22ff13a802295c | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Foundation/Application.php#L200-L207 |
198,412 | phossa/phossa-config | src/Phossa/Config/Parameter.php | Parameter.getSuperGlobalValue | protected function getSuperGlobalValue(/*# string */ $name)
{
$pos = strpos($name, $this->field_splitter);
if (false !== $pos) {
$pref = substr($name, 0, $pos);
$suff = substr($name, $pos + 1);
if (isset($GLOBALS[$pref][$suff])) {
return $GLOBALS[$... | php | protected function getSuperGlobalValue(/*# string */ $name)
{
$pos = strpos($name, $this->field_splitter);
if (false !== $pos) {
$pref = substr($name, 0, $pos);
$suff = substr($name, $pos + 1);
if (isset($GLOBALS[$pref][$suff])) {
return $GLOBALS[$... | [
"protected",
"function",
"getSuperGlobalValue",
"(",
"/*# string */",
"$",
"name",
")",
"{",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"field_splitter",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"pos",
")",
"{",
"$",
"pref",
... | Get super global value
@param string $name something like '_SERVER.HTTP_HOST'
@return string|array
@access protected | [
"Get",
"super",
"global",
"value"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Parameter.php#L165-L181 |
198,413 | phossa/phossa-config | src/Phossa/Config/Parameter.php | Parameter.exceptionIfNotString | protected function exceptionIfNotString($key)
{
if (!is_string($key)) {
throw new InvalidArgumentException(
Message::get(Message::CONFIG_KEY_INVALID, $key),
Message::CONFIG_KEY_INVALID
);
}
} | php | protected function exceptionIfNotString($key)
{
if (!is_string($key)) {
throw new InvalidArgumentException(
Message::get(Message::CONFIG_KEY_INVALID, $key),
Message::CONFIG_KEY_INVALID
);
}
} | [
"protected",
"function",
"exceptionIfNotString",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"Message",
"::",
"get",
"(",
"Message",
"::",
"CONFIG_KEY_INVALID",
",",... | Throw exception if not a string
@param string $key
@throws InvalidArgumentException if $key not a string
@access public | [
"Throw",
"exception",
"if",
"not",
"a",
"string"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Parameter.php#L190-L198 |
198,414 | agentmedia/phine-core | src/Core/Logic/Routing/FrontendRouter.php | FrontendRouter.GatherParams | static function GatherParams($url)
{
$reader = new StringReader($url);
$param = '';
$params = array();
$start = false;
while (false !== ($ch = $reader->ReadChar())) {
if ($ch == '{') {
$start = true;
}
else if ($ch == '}' &&... | php | static function GatherParams($url)
{
$reader = new StringReader($url);
$param = '';
$params = array();
$start = false;
while (false !== ($ch = $reader->ReadChar())) {
if ($ch == '{') {
$start = true;
}
else if ($ch == '}' &&... | [
"static",
"function",
"GatherParams",
"(",
"$",
"url",
")",
"{",
"$",
"reader",
"=",
"new",
"StringReader",
"(",
"$",
"url",
")",
";",
"$",
"param",
"=",
"''",
";",
"$",
"params",
"=",
"array",
"(",
")",
";",
"$",
"start",
"=",
"false",
";",
"whi... | Gathers the obligatory parameters from the url
@param string $url The page url
@return string[] Array of parameter names | [
"Gathers",
"the",
"obligatory",
"parameters",
"from",
"the",
"url"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/FrontendRouter.php#L26-L46 |
198,415 | agentmedia/phine-core | src/Core/Logic/Routing/FrontendRouter.php | FrontendRouter.PageUrl | static function PageUrl(Page $page, array $params = array(), $fragment = '')
{
$siteUrl = $page->GetSite()->GetUrl();
$pageUrl = $page->GetUrl();
if ($pageUrl == 'index.html') {
$url = $siteUrl;
}
else {
$url = Path::Combine($siteUrl, $pageUrl);
... | php | static function PageUrl(Page $page, array $params = array(), $fragment = '')
{
$siteUrl = $page->GetSite()->GetUrl();
$pageUrl = $page->GetUrl();
if ($pageUrl == 'index.html') {
$url = $siteUrl;
}
else {
$url = Path::Combine($siteUrl, $pageUrl);
... | [
"static",
"function",
"PageUrl",
"(",
"Page",
"$",
"page",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"fragment",
"=",
"''",
")",
"{",
"$",
"siteUrl",
"=",
"$",
"page",
"->",
"GetSite",
"(",
")",
"->",
"GetUrl",
"(",
")",
";",... | Returns the url of a page with parameters and fragment
@param Page $page The page
@param array $params All parameters
@return string Return the page url | [
"Returns",
"the",
"url",
"of",
"a",
"page",
"with",
"parameters",
"and",
"fragment"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/FrontendRouter.php#L54-L70 |
198,416 | agentmedia/phine-core | src/Core/Logic/Routing/FrontendRouter.php | FrontendRouter.Url | static function Url(PageUrl $pageUrl, array $additionalParameters = array())
{
$list = new PageParamListProvider($pageUrl);
$params = $list->ToArray();
foreach ($additionalParameters as $key => $value) {
$params[$key] = $value;
}
return self::PageUrl($pageUrl->Get... | php | static function Url(PageUrl $pageUrl, array $additionalParameters = array())
{
$list = new PageParamListProvider($pageUrl);
$params = $list->ToArray();
foreach ($additionalParameters as $key => $value) {
$params[$key] = $value;
}
return self::PageUrl($pageUrl->Get... | [
"static",
"function",
"Url",
"(",
"PageUrl",
"$",
"pageUrl",
",",
"array",
"$",
"additionalParameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"list",
"=",
"new",
"PageParamListProvider",
"(",
"$",
"pageUrl",
")",
";",
"$",
"params",
"=",
"$",
"list",
... | Gets the url for a page url entity
@param PageUrl $pageUrl The page url as stored in the database
@param array $additionalParameters Additional parameters; will override stored parameters with same keys
@return string Returns the page url | [
"Gets",
"the",
"url",
"for",
"a",
"page",
"url",
"entity"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/FrontendRouter.php#L78-L86 |
198,417 | agentmedia/phine-core | src/Core/Logic/Routing/FrontendRouter.php | FrontendRouter.AttachObligatoryParams | private static function AttachObligatoryParams($url, array $oblParams, array $params)
{
foreach ($oblParams as $oblParam) {
$value = '';
if (!array_key_exists($oblParam, $params)) {
$value = Request::GetData($oblParam);
}
else {
... | php | private static function AttachObligatoryParams($url, array $oblParams, array $params)
{
foreach ($oblParams as $oblParam) {
$value = '';
if (!array_key_exists($oblParam, $params)) {
$value = Request::GetData($oblParam);
}
else {
... | [
"private",
"static",
"function",
"AttachObligatoryParams",
"(",
"$",
"url",
",",
"array",
"$",
"oblParams",
",",
"array",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"oblParams",
"as",
"$",
"oblParam",
")",
"{",
"$",
"value",
"=",
"''",
";",
"if",
"(... | Attaches obligatory parameters
@param string $url The url pattern as given by the associated page property
@param array $oblParams The names of the obligatory parameters
@param array $params All given parameters for appending
@return string Returns the url with obligatory paramters attached
@throws \LogicException Rais... | [
"Attaches",
"obligatory",
"parameters"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/FrontendRouter.php#L96-L112 |
198,418 | agentmedia/phine-core | src/Core/Logic/Routing/FrontendRouter.php | FrontendRouter.AttachMoreParams | private static function AttachMoreParams($url, array $oblParams, array $params)
{
$moreParams = array();
foreach ($params as $key => $value) {
if (!in_array($key, $oblParams)) {
$moreParams[$key] = $value;
}
}
if (count($moreParams)) {
... | php | private static function AttachMoreParams($url, array $oblParams, array $params)
{
$moreParams = array();
foreach ($params as $key => $value) {
if (!in_array($key, $oblParams)) {
$moreParams[$key] = $value;
}
}
if (count($moreParams)) {
... | [
"private",
"static",
"function",
"AttachMoreParams",
"(",
"$",
"url",
",",
"array",
"$",
"oblParams",
",",
"array",
"$",
"params",
")",
"{",
"$",
"moreParams",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"... | Attaches none oblique url paramters
@param string $url The url with obligatory parameters already attached
@param array $oblParams The names of the obligatory parameters
@param array $params All url parameters
@return string Returns the url with all paramteters attached | [
"Attaches",
"none",
"oblique",
"url",
"paramters"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/FrontendRouter.php#L121-L133 |
198,419 | agentmedia/phine-core | src/Core/Logic/Routing/FrontendRouter.php | FrontendRouter.Page404 | static function Page404(Site $site)
{
$sql = Access::SqlBuilder();
$tblPage = Page::Schema()->Table();
$where = $sql->Equals($tblPage->Field('Type'), $sql->Value((string) PageType::NotFound()))
->And_($sql->Equals($tblPage->Field('Site'), $sql->Value($site->GetID())));
... | php | static function Page404(Site $site)
{
$sql = Access::SqlBuilder();
$tblPage = Page::Schema()->Table();
$where = $sql->Equals($tblPage->Field('Type'), $sql->Value((string) PageType::NotFound()))
->And_($sql->Equals($tblPage->Field('Site'), $sql->Value($site->GetID())));
... | [
"static",
"function",
"Page404",
"(",
"Site",
"$",
"site",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tblPage",
"=",
"Page",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"where",
"=",
"$",
"sql",... | Finds the 404 page for a site
@param Site $site The site whise 404 page is searched for
@return Page The 404 page | [
"Finds",
"the",
"404",
"page",
"for",
"a",
"site"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/FrontendRouter.php#L140-L148 |
198,420 | phossa/phossa-config | src/Phossa/Config/Reference/ReferenceTrait.php | ReferenceTrait.getPattern | protected function getPattern()/*# : string */
{
if (is_null($this->reference_pattern)) {
if ('' === $this->reference_start ||
is_null($this->reference_end)) {
$this->reference_pattern = '';
} else {
$this->reference_pattern = '~(' .
... | php | protected function getPattern()/*# : string */
{
if (is_null($this->reference_pattern)) {
if ('' === $this->reference_start ||
is_null($this->reference_end)) {
$this->reference_pattern = '';
} else {
$this->reference_pattern = '~(' .
... | [
"protected",
"function",
"getPattern",
"(",
")",
"/*# : string */",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"reference_pattern",
")",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"this",
"->",
"reference_start",
"||",
"is_null",
"(",
"$",
"this",
"-... | Get the reference pattern
@return string
@access protected | [
"Get",
"the",
"reference",
"pattern"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Reference/ReferenceTrait.php#L181-L195 |
198,421 | phossa/phossa-config | src/Phossa/Config/Reference/ReferenceTrait.php | ReferenceTrait.deReferenceArray | protected function deReferenceArray(
array &$dataArray,
/*# bool */ $clearCache = false
) {
// reference feature disabled
if ('' === $this->getPattern()) {
return;
}
// clear old cache
if ($clearCache) {
$this->loop_detect = [];
... | php | protected function deReferenceArray(
array &$dataArray,
/*# bool */ $clearCache = false
) {
// reference feature disabled
if ('' === $this->getPattern()) {
return;
}
// clear old cache
if ($clearCache) {
$this->loop_detect = [];
... | [
"protected",
"function",
"deReferenceArray",
"(",
"array",
"&",
"$",
"dataArray",
",",
"/*# bool */",
"$",
"clearCache",
"=",
"false",
")",
"{",
"// reference feature disabled",
"if",
"(",
"''",
"===",
"$",
"this",
"->",
"getPattern",
"(",
")",
")",
"{",
"re... | Derefence all references in an array
@param array &$dataArray
@param bool $clearCache clear dereference cache
@throws LogicException if malformed reference found
@access protected | [
"Derefence",
"all",
"references",
"in",
"an",
"array"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Reference/ReferenceTrait.php#L231-L268 |
198,422 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.BundleFolder | static function BundleFolder($bundleName)
{
$packageBundles = self::PackageBundles();
if (isset($packageBundles[$bundleName])) {
return $packageBundles[$bundleName];
}
return Path::Combine(self::AppBundlesFolder(), $bundleName);
} | php | static function BundleFolder($bundleName)
{
$packageBundles = self::PackageBundles();
if (isset($packageBundles[$bundleName])) {
return $packageBundles[$bundleName];
}
return Path::Combine(self::AppBundlesFolder(), $bundleName);
} | [
"static",
"function",
"BundleFolder",
"(",
"$",
"bundleName",
")",
"{",
"$",
"packageBundles",
"=",
"self",
"::",
"PackageBundles",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"packageBundles",
"[",
"$",
"bundleName",
"]",
")",
")",
"{",
"return",
"$",
... | Gets the folder for the bundle
@param string $bundleName The name of the bundle
@return string Returns the bundle directory path | [
"Gets",
"the",
"folder",
"for",
"the",
"bundle"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L27-L34 |
198,423 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.Modules | static function Modules($bundleName, ModuleLocation $location)
{
$result = array();
$modulesFolder = Path::Combine(self::BundleFolder($bundleName), 'Modules');
$folder = Path::Combine($modulesFolder, (string)$location);
if (!Folder::Exists($folder)) {
return $result;
... | php | static function Modules($bundleName, ModuleLocation $location)
{
$result = array();
$modulesFolder = Path::Combine(self::BundleFolder($bundleName), 'Modules');
$folder = Path::Combine($modulesFolder, (string)$location);
if (!Folder::Exists($folder)) {
return $result;
... | [
"static",
"function",
"Modules",
"(",
"$",
"bundleName",
",",
"ModuleLocation",
"$",
"location",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"modulesFolder",
"=",
"Path",
"::",
"Combine",
"(",
"self",
"::",
"BundleFolder",
"(",
"$",
"bundl... | Gets all modules in a bundle
@param string $bundleName
@param ModuleLocation $location Backend or frontend
@return string[] Returns the module names | [
"Gets",
"all",
"modules",
"in",
"a",
"bundle"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L100-L114 |
198,424 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.BundleTranslationsFile | static function BundleTranslationsFile(ModuleBase $module, $lang)
{
$moduleTransFolder = self::ModuleTranslationsFolder($module);
$bundleTransFolder = Path::Directory($moduleTransFolder);
$file = Path::Combine($bundleTransFolder, $lang);
return Path::AddExtension($file, 'php');
} | php | static function BundleTranslationsFile(ModuleBase $module, $lang)
{
$moduleTransFolder = self::ModuleTranslationsFolder($module);
$bundleTransFolder = Path::Directory($moduleTransFolder);
$file = Path::Combine($bundleTransFolder, $lang);
return Path::AddExtension($file, 'php');
} | [
"static",
"function",
"BundleTranslationsFile",
"(",
"ModuleBase",
"$",
"module",
",",
"$",
"lang",
")",
"{",
"$",
"moduleTransFolder",
"=",
"self",
"::",
"ModuleTranslationsFolder",
"(",
"$",
"module",
")",
";",
"$",
"bundleTransFolder",
"=",
"Path",
"::",
"D... | Gets the bundle translations file
@param ModuleBase $module
@param string $lang
@return string Returns the bundle translations file | [
"Gets",
"the",
"bundle",
"translations",
"file"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L182-L188 |
198,425 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.ModuleTranslationsFolder | static function ModuleTranslationsFolder(ModuleBase $module)
{
$class = new \ReflectionClass($module);
$classFile = Str::Replace('\\', '/', $class->getFileName());
return Str::Replace('/Modules/', '/Translations/', Path::RemoveExtension($classFile));
} | php | static function ModuleTranslationsFolder(ModuleBase $module)
{
$class = new \ReflectionClass($module);
$classFile = Str::Replace('\\', '/', $class->getFileName());
return Str::Replace('/Modules/', '/Translations/', Path::RemoveExtension($classFile));
} | [
"static",
"function",
"ModuleTranslationsFolder",
"(",
"ModuleBase",
"$",
"module",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"module",
")",
";",
"$",
"classFile",
"=",
"Str",
"::",
"Replace",
"(",
"'\\\\'",
",",
"'/'",
",",
... | Gets the translations folder for a module
@param ModuleBase $module
@return string Returns the folder of the module translationss | [
"Gets",
"the",
"translations",
"folder",
"for",
"a",
"module"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L194-L199 |
198,426 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.ModuleTranslationsFile | static function ModuleTranslationsFile(ModuleBase $module, $lang)
{
$folder = self::ModuleTranslationsFolder($module);
$file = Path::Combine($folder, $lang);
return Path::AddExtension($file, 'php');
} | php | static function ModuleTranslationsFile(ModuleBase $module, $lang)
{
$folder = self::ModuleTranslationsFolder($module);
$file = Path::Combine($folder, $lang);
return Path::AddExtension($file, 'php');
} | [
"static",
"function",
"ModuleTranslationsFile",
"(",
"ModuleBase",
"$",
"module",
",",
"$",
"lang",
")",
"{",
"$",
"folder",
"=",
"self",
"::",
"ModuleTranslationsFolder",
"(",
"$",
"module",
")",
";",
"$",
"file",
"=",
"Path",
"::",
"Combine",
"(",
"$",
... | Gets the translations file for a module
@param ModuleBase $module The module
@param string $lang The desired language
@return string Returns the file with specific translations for a module | [
"Gets",
"the",
"translations",
"file",
"for",
"a",
"module"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L207-L212 |
198,427 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.ModuleCustomTemplatesFolder | static function ModuleCustomTemplatesFolder(TemplateModule $module)
{
$parentFolder = Path::Combine(PHINE_PATH, 'App/Phine/ModuleTemplates');
$bundleFolder = Path::Combine($parentFolder, $module->MyBundle());
return Path::Combine($bundleFolder, $module->MyName());
} | php | static function ModuleCustomTemplatesFolder(TemplateModule $module)
{
$parentFolder = Path::Combine(PHINE_PATH, 'App/Phine/ModuleTemplates');
$bundleFolder = Path::Combine($parentFolder, $module->MyBundle());
return Path::Combine($bundleFolder, $module->MyName());
} | [
"static",
"function",
"ModuleCustomTemplatesFolder",
"(",
"TemplateModule",
"$",
"module",
")",
"{",
"$",
"parentFolder",
"=",
"Path",
"::",
"Combine",
"(",
"PHINE_PATH",
",",
"'App/Phine/ModuleTemplates'",
")",
";",
"$",
"bundleFolder",
"=",
"Path",
"::",
"Combin... | Gets the folder for
@param TemplateModule $module
@return string | [
"Gets",
"the",
"folder",
"for"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L220-L225 |
198,428 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.LayoutTemplate | static function LayoutTemplate(Layout $layout)
{
$folder = Path::Combine(PHINE_PATH, 'App/Phine/LayoutTemplates');
$file = Path::Combine($folder, $layout->GetName());
return Path::AddExtension($file, 'phtml');
} | php | static function LayoutTemplate(Layout $layout)
{
$folder = Path::Combine(PHINE_PATH, 'App/Phine/LayoutTemplates');
$file = Path::Combine($folder, $layout->GetName());
return Path::AddExtension($file, 'phtml');
} | [
"static",
"function",
"LayoutTemplate",
"(",
"Layout",
"$",
"layout",
")",
"{",
"$",
"folder",
"=",
"Path",
"::",
"Combine",
"(",
"PHINE_PATH",
",",
"'App/Phine/LayoutTemplates'",
")",
";",
"$",
"file",
"=",
"Path",
"::",
"Combine",
"(",
"$",
"folder",
","... | The template file for a page layout
@param Layout $layout The page layout
@return string Returns the layout template path | [
"The",
"template",
"file",
"for",
"a",
"page",
"layout"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L232-L237 |
198,429 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.SitemapCacheFile | static function SitemapCacheFile(Site $site)
{
$cacheFolder = Path::Combine(PHINE_PATH, 'App/Phine/Cache/Sitemap');
$filename = Path::AddExtension($site->GetID(), 'xml');
return Path::Combine($cacheFolder, $filename);
} | php | static function SitemapCacheFile(Site $site)
{
$cacheFolder = Path::Combine(PHINE_PATH, 'App/Phine/Cache/Sitemap');
$filename = Path::AddExtension($site->GetID(), 'xml');
return Path::Combine($cacheFolder, $filename);
} | [
"static",
"function",
"SitemapCacheFile",
"(",
"Site",
"$",
"site",
")",
"{",
"$",
"cacheFolder",
"=",
"Path",
"::",
"Combine",
"(",
"PHINE_PATH",
",",
"'App/Phine/Cache/Sitemap'",
")",
";",
"$",
"filename",
"=",
"Path",
"::",
"AddExtension",
"(",
"$",
"site... | The name of the cache file of the
@param Site $site The site
@return string Returns the full file path of the sitemap cache file | [
"The",
"name",
"of",
"the",
"cache",
"file",
"of",
"the"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L337-L342 |
198,430 | agentmedia/phine-core | src/Core/Logic/Util/PathUtil.php | PathUtil.ContentCacheFile | static function ContentCacheFile(FrontendModule $module)
{
$file = $module->Content()->GetID();
$cacheKey = $module->CacheKey();
if ($cacheKey)
{
if (!ctype_alnum($cacheKey))
{
throw new \Exception(Trans('Core.CacheKey.Error.NotAlphaNumeric'));... | php | static function ContentCacheFile(FrontendModule $module)
{
$file = $module->Content()->GetID();
$cacheKey = $module->CacheKey();
if ($cacheKey)
{
if (!ctype_alnum($cacheKey))
{
throw new \Exception(Trans('Core.CacheKey.Error.NotAlphaNumeric'));... | [
"static",
"function",
"ContentCacheFile",
"(",
"FrontendModule",
"$",
"module",
")",
"{",
"$",
"file",
"=",
"$",
"module",
"->",
"Content",
"(",
")",
"->",
"GetID",
"(",
")",
";",
"$",
"cacheKey",
"=",
"$",
"module",
"->",
"CacheKey",
"(",
")",
";",
... | The name of the cache file
@param FrontendModule $module
@return string The name of the cache file, it needn't exist yet
@throws \Exception Raises an error in case the cache key is not alphanumeric | [
"The",
"name",
"of",
"the",
"cache",
"file"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/PathUtil.php#L349-L363 |
198,431 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.process | public function process($file) {
ob_start();
extract($this -> viewmodel -> getVariables(), EXTR_REFS);
include($file);
$this -> output = ob_get_clean();
return $this;
} | php | public function process($file) {
ob_start();
extract($this -> viewmodel -> getVariables(), EXTR_REFS);
include($file);
$this -> output = ob_get_clean();
return $this;
} | [
"public",
"function",
"process",
"(",
"$",
"file",
")",
"{",
"ob_start",
"(",
")",
";",
"extract",
"(",
"$",
"this",
"->",
"viewmodel",
"->",
"getVariables",
"(",
")",
",",
"EXTR_REFS",
")",
";",
"include",
"(",
"$",
"file",
")",
";",
"$",
"this",
... | Converts template code to output string
@param string $file
@return sFire\MVC\View | [
"Converts",
"template",
"code",
"to",
"output",
"string"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L74-L82 |
198,432 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.escapeJs | public function escapeJs($string, $encoding = 'utf-8') {
$current = Escape :: getEncoding();
Escape :: setEncoding($encoding);
$result = Escape :: js($string);
Escape :: setEncoding($current);
return $result;
} | php | public function escapeJs($string, $encoding = 'utf-8') {
$current = Escape :: getEncoding();
Escape :: setEncoding($encoding);
$result = Escape :: js($string);
Escape :: setEncoding($current);
return $result;
} | [
"public",
"function",
"escapeJs",
"(",
"$",
"string",
",",
"$",
"encoding",
"=",
"'utf-8'",
")",
"{",
"$",
"current",
"=",
"Escape",
"::",
"getEncoding",
"(",
")",
";",
"Escape",
"::",
"setEncoding",
"(",
"$",
"encoding",
")",
";",
"$",
"result",
"=",
... | Escape a string for the Javascript context.
@param string $string
@return string | [
"Escape",
"a",
"string",
"for",
"the",
"Javascript",
"context",
"."
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L131-L139 |
198,433 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.escapeCss | public function escapeCss($string, $encoding = 'utf-8') {
$current = Escape :: getEncoding();
Escape :: setEncoding($encoding);
$result = Escape :: css($string);
Escape :: setEncoding($current);
return $result;
} | php | public function escapeCss($string, $encoding = 'utf-8') {
$current = Escape :: getEncoding();
Escape :: setEncoding($encoding);
$result = Escape :: css($string);
Escape :: setEncoding($current);
return $result;
} | [
"public",
"function",
"escapeCss",
"(",
"$",
"string",
",",
"$",
"encoding",
"=",
"'utf-8'",
")",
"{",
"$",
"current",
"=",
"Escape",
"::",
"getEncoding",
"(",
")",
";",
"Escape",
"::",
"setEncoding",
"(",
"$",
"encoding",
")",
";",
"$",
"result",
"=",... | Escape a string for the CSS context.
@param string $string
@return string | [
"Escape",
"a",
"string",
"for",
"the",
"CSS",
"context",
"."
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L147-L155 |
198,434 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.partial | protected function partial($file) {
$viewmodel = new ViewModel($file);
$viewmodel -> assign($this -> viewmodel -> getVariables());
ViewContainer :: output($viewmodel);
} | php | protected function partial($file) {
$viewmodel = new ViewModel($file);
$viewmodel -> assign($this -> viewmodel -> getVariables());
ViewContainer :: output($viewmodel);
} | [
"protected",
"function",
"partial",
"(",
"$",
"file",
")",
"{",
"$",
"viewmodel",
"=",
"new",
"ViewModel",
"(",
"$",
"file",
")",
";",
"$",
"viewmodel",
"->",
"assign",
"(",
"$",
"this",
"->",
"viewmodel",
"->",
"getVariables",
"(",
")",
")",
";",
"V... | Calls the parse function
@param string $template
@return | [
"Calls",
"the",
"parse",
"function"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L198-L204 |
198,435 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.form | protected function form($type, $name = null, $value = null) {
$form = new Form();
return $form -> {$type}($name, $value);
} | php | protected function form($type, $name = null, $value = null) {
$form = new Form();
return $form -> {$type}($name, $value);
} | [
"protected",
"function",
"form",
"(",
"$",
"type",
",",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"form",
"=",
"new",
"Form",
"(",
")",
";",
"return",
"$",
"form",
"->",
"{",
"$",
"type",
"}",
"(",
"$",
"name",
... | Calls the url function of the sFire\Routing\Router
@param string $identifier
@return string | [
"Calls",
"the",
"url",
"function",
"of",
"the",
"sFire",
"\\",
"Routing",
"\\",
"Router"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L222-L226 |
198,436 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.translate | protected function translate($key, $params = null, $language = null) {
return Translation :: translate($key, $params, $language, $this -> getViewmodel());
} | php | protected function translate($key, $params = null, $language = null) {
return Translation :: translate($key, $params, $language, $this -> getViewmodel());
} | [
"protected",
"function",
"translate",
"(",
"$",
"key",
",",
"$",
"params",
"=",
"null",
",",
"$",
"language",
"=",
"null",
")",
"{",
"return",
"Translation",
"::",
"translate",
"(",
"$",
"key",
",",
"$",
"params",
",",
"$",
"language",
",",
"$",
"thi... | Calls the translate function of the sFire\Translation\Translate
@param string $key
@return string | [
"Calls",
"the",
"translate",
"function",
"of",
"the",
"sFire",
"\\",
"Translation",
"\\",
"Translate"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L234-L236 |
198,437 | Kris-Kuiper/sFire-Framework | src/MVC/View.php | View.template | protected function template($action, $params = null) {
if(false === is_string($action)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($action)), E_USER_ERROR);
}
if(null !== $params && false === is_array($params)) {
return... | php | protected function template($action, $params = null) {
if(false === is_string($action)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($action)), E_USER_ERROR);
}
if(null !== $params && false === is_array($params)) {
return... | [
"protected",
"function",
"template",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"action",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be... | Execute user defined template function
@param string $action
@param array $params
@return mixed | [
"Execute",
"user",
"defined",
"template",
"function"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/View.php#L245-L262 |
198,438 | Wedeto/Auth | src/ACL/Entity.php | Entity.getPolicy | public function getPolicy(Role $role, string $action)
{
$rules = $this->getRules();
$pref_policy = $this->getACL()->getPreferredPolicy();
$inherit = true;
$ancestor_distance = null;
$ancestor_policy = null;
foreach ($rules as $rule)
{
// NOINHERIT... | php | public function getPolicy(Role $role, string $action)
{
$rules = $this->getRules();
$pref_policy = $this->getACL()->getPreferredPolicy();
$inherit = true;
$ancestor_distance = null;
$ancestor_policy = null;
foreach ($rules as $rule)
{
// NOINHERIT... | [
"public",
"function",
"getPolicy",
"(",
"Role",
"$",
"role",
",",
"string",
"$",
"action",
")",
"{",
"$",
"rules",
"=",
"$",
"this",
"->",
"getRules",
"(",
")",
";",
"$",
"pref_policy",
"=",
"$",
"this",
"->",
"getACL",
"(",
")",
"->",
"getPreferredP... | Find the policy to the Role performing the action on this Entity.
@param $role Role The Role wanting to perform an action
@param $action string The action Role wishes to perform
@return integer The policy, either Rule::ALLOW or Rule::DENY. | [
"Find",
"the",
"policy",
"to",
"the",
"Role",
"performing",
"the",
"action",
"on",
"this",
"Entity",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/Entity.php#L99-L173 |
198,439 | Linkvalue-Interne/MobileNotif | src/Client/ApnsClient.php | ApnsClient.setUp | public function setUp(array $params)
{
if (empty($params['endpoint'])) {
throw new \RuntimeException('Parameter "endpoint" cannot be empty.');
}
if (empty($params['ssl_pem_path'])) {
throw new \RuntimeException('Parameter "ssl_pem_path" cannot be empty.');
}
... | php | public function setUp(array $params)
{
if (empty($params['endpoint'])) {
throw new \RuntimeException('Parameter "endpoint" cannot be empty.');
}
if (empty($params['ssl_pem_path'])) {
throw new \RuntimeException('Parameter "ssl_pem_path" cannot be empty.');
}
... | [
"public",
"function",
"setUp",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"'endpoint'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Parameter \"endpoint\" cannot be empty.'",
")",
";",
"}",
... | Set up parameters.
@param array $params
@throws \RuntimeException | [
"Set",
"up",
"parameters",
"."
] | e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6 | https://github.com/Linkvalue-Interne/MobileNotif/blob/e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6/src/Client/ApnsClient.php#L49-L64 |
198,440 | Linkvalue-Interne/MobileNotif | src/Client/ApnsClient.php | ApnsClient.getStreamSocketClient | private function getStreamSocketClient()
{
$stream_socket_client = stream_socket_client(
$this->params['endpoint'],
$errno,
$errstr,
30,
STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT,
$this->getStreamContext()
);
if ... | php | private function getStreamSocketClient()
{
$stream_socket_client = stream_socket_client(
$this->params['endpoint'],
$errno,
$errstr,
30,
STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT,
$this->getStreamContext()
);
if ... | [
"private",
"function",
"getStreamSocketClient",
"(",
")",
"{",
"$",
"stream_socket_client",
"=",
"stream_socket_client",
"(",
"$",
"this",
"->",
"params",
"[",
"'endpoint'",
"]",
",",
"$",
"errno",
",",
"$",
"errstr",
",",
"30",
",",
"STREAM_CLIENT_CONNECT",
"... | Get the Stream socket client.
Connect to the APNS server and open a client socket to it.
@return resource Socket to the APNS server.
@throws PushException if connection to APNS server failed. | [
"Get",
"the",
"Stream",
"socket",
"client",
"."
] | e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6 | https://github.com/Linkvalue-Interne/MobileNotif/blob/e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6/src/Client/ApnsClient.php#L110-L126 |
198,441 | Linkvalue-Interne/MobileNotif | src/Client/ApnsClient.php | ApnsClient.getStreamContext | private function getStreamContext()
{
$context = array(
'ssl' => array(
'local_cert' => $this->params['ssl_pem_path'],
),
);
// Handle Certificate Bundle passphrase
if (!empty($this->params['ssl_passphrase'])) {
$context['ssl']['pa... | php | private function getStreamContext()
{
$context = array(
'ssl' => array(
'local_cert' => $this->params['ssl_pem_path'],
),
);
// Handle Certificate Bundle passphrase
if (!empty($this->params['ssl_passphrase'])) {
$context['ssl']['pa... | [
"private",
"function",
"getStreamContext",
"(",
")",
"{",
"$",
"context",
"=",
"array",
"(",
"'ssl'",
"=>",
"array",
"(",
"'local_cert'",
"=>",
"$",
"this",
"->",
"params",
"[",
"'ssl_pem_path'",
"]",
",",
")",
",",
")",
";",
"// Handle Certificate Bundle pa... | Get secured stream context from SSL certificate.
@return resource | [
"Get",
"secured",
"stream",
"context",
"from",
"SSL",
"certificate",
"."
] | e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6 | https://github.com/Linkvalue-Interne/MobileNotif/blob/e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6/src/Client/ApnsClient.php#L133-L147 |
198,442 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/FormFilterer.php | FormFilterer.hiddenFormFields | public function hiddenFormFields()
{
$fields = $this->getParameter('fields');
if (empty($fields))
return '';
$html_array = ArrayUtils::htmlArrayFlatten($fields);
foreach ($html_array as $name => $value) {
$name = htmlentities($name, ENT_QUOTES);
... | php | public function hiddenFormFields()
{
$fields = $this->getParameter('fields');
if (empty($fields))
return '';
$html_array = ArrayUtils::htmlArrayFlatten($fields);
foreach ($html_array as $name => $value) {
$name = htmlentities($name, ENT_QUOTES);
... | [
"public",
"function",
"hiddenFormFields",
"(",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'fields'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
")",
"return",
"''",
";",
"$",
"html_array",
"=",
"ArrayUtils",
"::"... | Returns all the fields passed into 'fields' as hidden fields to submit
Expected Param:
fields array A PHP array that needs to be converted to hidden fields
@return string | [
"Returns",
"all",
"the",
"fields",
"passed",
"into",
"fields",
"as",
"hidden",
"fields",
"to",
"submit"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/FormFilterer.php#L42-L59 |
198,443 | Hnto/nuki | src/Handlers/Http/Input/Request.php | Request.protocol | public function protocol($version = false) : string {
if ($version === false) {
$protocol = 'http';
if ($this->server()->get('HTTPS')) {
$protocol = 'https';
}
return $protocol;
}
return $this->server()->get('SERVER_PROTOCOL');
} | php | public function protocol($version = false) : string {
if ($version === false) {
$protocol = 'http';
if ($this->server()->get('HTTPS')) {
$protocol = 'https';
}
return $protocol;
}
return $this->server()->get('SERVER_PROTOCOL');
} | [
"public",
"function",
"protocol",
"(",
"$",
"version",
"=",
"false",
")",
":",
"string",
"{",
"if",
"(",
"$",
"version",
"===",
"false",
")",
"{",
"$",
"protocol",
"=",
"'http'",
";",
"if",
"(",
"$",
"this",
"->",
"server",
"(",
")",
"->",
"get",
... | Get used server protocal
@param bool $version
@return string | [
"Get",
"used",
"server",
"protocal"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Http/Input/Request.php#L186-L197 |
198,444 | Hnto/nuki | src/Handlers/Http/Input/Request.php | Request.incoming | public function incoming(Application $app) {
$route = $app->getService('router')
->findHttpRoute($this);
/** Route is a callback execution */
if (!empty($route->offsetGet('action'))) {
//Route is a callback execution
$app::getContainer()->offsetSet(
... | php | public function incoming(Application $app) {
$route = $app->getService('router')
->findHttpRoute($this);
/** Route is a callback execution */
if (!empty($route->offsetGet('action'))) {
//Route is a callback execution
$app::getContainer()->offsetSet(
... | [
"public",
"function",
"incoming",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"route",
"=",
"$",
"app",
"->",
"getService",
"(",
"'router'",
")",
"->",
"findHttpRoute",
"(",
"$",
"this",
")",
";",
"/** Route is a callback execution */",
"if",
"(",
"!",
... | Initialize incoming request
Determine if route contains callback or
service execution
- set callback
- set active unit
- set active service
- set active process
- register service
@param Application $app
@return void
@throws Base | [
"Initialize",
"incoming",
"request",
"Determine",
"if",
"route",
"contains",
"callback",
"or",
"service",
"execution"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Http/Input/Request.php#L325-L369 |
198,445 | Hnto/nuki | src/Handlers/Http/Input/Request.php | Request.buildProcess | private function buildProcess(string $process, string $fullServiceName) {
$methods = array_flip(get_class_methods($fullServiceName));
if (!array_key_exists(($process), $methods)) {
throw new \Nuki\Exceptions\Base('No available process is found for the provided service');
}
retur... | php | private function buildProcess(string $process, string $fullServiceName) {
$methods = array_flip(get_class_methods($fullServiceName));
if (!array_key_exists(($process), $methods)) {
throw new \Nuki\Exceptions\Base('No available process is found for the provided service');
}
retur... | [
"private",
"function",
"buildProcess",
"(",
"string",
"$",
"process",
",",
"string",
"$",
"fullServiceName",
")",
"{",
"$",
"methods",
"=",
"array_flip",
"(",
"get_class_methods",
"(",
"$",
"fullServiceName",
")",
")",
";",
"if",
"(",
"!",
"array_key_exists",
... | Build process name
@param string $process
@param string $fullServiceName
@return string
@throws \Nuki\Exceptions\Base | [
"Build",
"process",
"name"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Http/Input/Request.php#L379-L388 |
198,446 | modulusphp/utility | Events.php | Events.triggerGroup | public function triggerGroup(?array $events = [], ?array $args = null)
{
foreach($events as $callback) {
if (is_callable($callback)) {
call_user_func_array($callback, isset($args) ? $args : []);
}
else if (is_string($callback)) {
$call = new $callback;
call_user_func_arra... | php | public function triggerGroup(?array $events = [], ?array $args = null)
{
foreach($events as $callback) {
if (is_callable($callback)) {
call_user_func_array($callback, isset($args) ? $args : []);
}
else if (is_string($callback)) {
$call = new $callback;
call_user_func_arra... | [
"public",
"function",
"triggerGroup",
"(",
"?",
"array",
"$",
"events",
"=",
"[",
"]",
",",
"?",
"array",
"$",
"args",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"events",
"as",
"$",
"callback",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"callb... | Trigger a grouped event
@param mixed ?array
@param mixed ?array
@return void | [
"Trigger",
"a",
"grouped",
"event"
] | c1e127539b13d3ec8381e41c64b881e0701807f5 | https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/Events.php#L69-L80 |
198,447 | gplcart/cli | controllers/commands/City.php | City.cmdGetCity | public function cmdGetCity()
{
$result = $this->getListCity();
$this->outputFormat($result);
$this->outputFormatTableCity($result);
$this->output();
} | php | public function cmdGetCity()
{
$result = $this->getListCity();
$this->outputFormat($result);
$this->outputFormatTableCity($result);
$this->output();
} | [
"public",
"function",
"cmdGetCity",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getListCity",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableCity",
"(",
"$",
"result",
")"... | Callback for "city-get" command | [
"Callback",
"for",
"city",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L40-L46 |
198,448 | gplcart/cli | controllers/commands/City.php | City.cmdDeleteCity | public function cmdDeleteCity()
{
$id = $this->getParam(0);
if (empty($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
$options = null;
if ($this->getParam('state')) {
$options = array('state_id' => $id);
} else if ($this->get... | php | public function cmdDeleteCity()
{
$id = $this->getParam(0);
if (empty($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
$options = null;
if ($this->getParam('state')) {
$options = array('state_id' => $id);
} else if ($this->get... | [
"public",
"function",
"cmdDeleteCity",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"errorAndExit",
"(",
"$",
"this",
"->",
"text",
"(",
... | Callback for "city-delete" command | [
"Callback",
"for",
"city",
"-",
"delete",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L51-L85 |
198,449 | gplcart/cli | controllers/commands/City.php | City.cmdUpdateCity | public function cmdUpdateCity()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | php | public function cmdUpdateCity()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | [
"public",
"function",
"cmdUpdateCity",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
"$",... | Callback for "city-update" command | [
"Callback",
"for",
"city",
"-",
"update",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L104-L122 |
198,450 | gplcart/cli | controllers/commands/City.php | City.getListCity | protected function getListCity()
{
$id = $this->getParam(0);
if (!isset($id)) {
return $this->city->getList(array('limit' => $this->getLimit()));
}
if ($this->getParam('state')) {
return $this->city->getList(array('state_id' => $id, 'limit' => $this->getLimi... | php | protected function getListCity()
{
$id = $this->getParam(0);
if (!isset($id)) {
return $this->city->getList(array('limit' => $this->getLimit()));
}
if ($this->getParam('state')) {
return $this->city->getList(array('state_id' => $id, 'limit' => $this->getLimi... | [
"protected",
"function",
"getListCity",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"city",
"->",
"getList",
"(",
"array",
... | Returns an array of cities
@return array | [
"Returns",
"an",
"array",
"of",
"cities"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L128-L155 |
198,451 | gplcart/cli | controllers/commands/City.php | City.addCity | protected function addCity()
{
if (!$this->isError()) {
$id = $this->city->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | php | protected function addCity()
{
if (!$this->isError()) {
$id = $this->city->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | [
"protected",
"function",
"addCity",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isError",
"(",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"city",
"->",
"add",
"(",
"$",
"this",
"->",
"getSubmitted",
"(",
")",
")",
";",
"if",
"(",
... | Add a new city | [
"Add",
"a",
"new",
"city"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L191-L200 |
198,452 | gplcart/cli | controllers/commands/City.php | City.submitAddCity | protected function submitAddCity()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('city');
$this->addCity();
} | php | protected function submitAddCity()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('city');
$this->addCity();
} | [
"protected",
"function",
"submitAddCity",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"validateComponent",
"(",
"'city'",
")",
";",
"$",
"this",
"->",
"addCit... | Add a new city at once | [
"Add",
"a",
"new",
"city",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L216-L221 |
198,453 | gplcart/cli | controllers/commands/City.php | City.wizardAddCity | protected function wizardAddCity()
{
$this->validatePrompt('name', $this->text('Name'), 'city');
$this->validatePrompt('state_id', $this->text('Country state'), 'city');
$this->validatePrompt('country', $this->text('Country'), 'city');
$this->validatePrompt('zone_id', $this->text('Zo... | php | protected function wizardAddCity()
{
$this->validatePrompt('name', $this->text('Name'), 'city');
$this->validatePrompt('state_id', $this->text('Country state'), 'city');
$this->validatePrompt('country', $this->text('Country'), 'city');
$this->validatePrompt('zone_id', $this->text('Zo... | [
"protected",
"function",
"wizardAddCity",
"(",
")",
"{",
"$",
"this",
"->",
"validatePrompt",
"(",
"'name'",
",",
"$",
"this",
"->",
"text",
"(",
"'Name'",
")",
",",
"'city'",
")",
";",
"$",
"this",
"->",
"validatePrompt",
"(",
"'state_id'",
",",
"$",
... | Add a new city step by step | [
"Add",
"a",
"new",
"city",
"step",
"by",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/City.php#L226-L236 |
198,454 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS.php | Wrapper_FS.commit | public static function commit($protocol)
{
if (isset(self::$_partitions[$protocol])) {
$partition = self::$_partitions[$protocol];
/* @var $partition Wrapper_FS_Partition */
$partition->commit();
$result = true;
} else {
$result = false;
}
return $result;
} | php | public static function commit($protocol)
{
if (isset(self::$_partitions[$protocol])) {
$partition = self::$_partitions[$protocol];
/* @var $partition Wrapper_FS_Partition */
$partition->commit();
$result = true;
} else {
$result = false;
}
return $result;
} | [
"public",
"static",
"function",
"commit",
"(",
"$",
"protocol",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"_partitions",
"[",
"$",
"protocol",
"]",
")",
")",
"{",
"$",
"partition",
"=",
"self",
"::",
"$",
"_partitions",
"[",
"$",
"protoco... | Commit all changes to real FS
@param string $protocol Protocol name
@return boolean | [
"Commit",
"all",
"changes",
"to",
"real",
"FS"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS.php#L355-L368 |
198,455 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS.php | Wrapper_FS.getPartition | protected static function getPartition($url)
{
$urlParts = explode("://", $url);
$protocol = array_shift($urlParts);
return self::$_partitions[$protocol];
} | php | protected static function getPartition($url)
{
$urlParts = explode("://", $url);
$protocol = array_shift($urlParts);
return self::$_partitions[$protocol];
} | [
"protected",
"static",
"function",
"getPartition",
"(",
"$",
"url",
")",
"{",
"$",
"urlParts",
"=",
"explode",
"(",
"\"://\"",
",",
"$",
"url",
")",
";",
"$",
"protocol",
"=",
"array_shift",
"(",
"$",
"urlParts",
")",
";",
"return",
"self",
"::",
"$",
... | Return partition by file url
@param string $url Url
@return Wrapper_FS_Partition | [
"Return",
"partition",
"by",
"file",
"url"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS.php#L391-L397 |
198,456 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS.php | Wrapper_FS.getRelativePath | public static function getRelativePath($url)
{
$urlParts = explode("://", $url);
array_shift($urlParts);
$urlPath = implode("://", $urlParts);
return Entity::fixPath($urlPath);
} | php | public static function getRelativePath($url)
{
$urlParts = explode("://", $url);
array_shift($urlParts);
$urlPath = implode("://", $urlParts);
return Entity::fixPath($urlPath);
} | [
"public",
"static",
"function",
"getRelativePath",
"(",
"$",
"url",
")",
"{",
"$",
"urlParts",
"=",
"explode",
"(",
"\"://\"",
",",
"$",
"url",
")",
";",
"array_shift",
"(",
"$",
"urlParts",
")",
";",
"$",
"urlPath",
"=",
"implode",
"(",
"\"://\"",
","... | Return urlPath of url
@param string $url Url
@return string | [
"Return",
"urlPath",
"of",
"url"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS.php#L406-L413 |
198,457 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.create | public function create($options = [])
{
$capsule = $this->_database->getCapsule();
if (empty($options) || !is_array($options)) {
throw new \Exception('Create options must not be empty and must be an instance of an array!');
}
// filter out options not given in fillable a... | php | public function create($options = [])
{
$capsule = $this->_database->getCapsule();
if (empty($options) || !is_array($options)) {
throw new \Exception('Create options must not be empty and must be an instance of an array!');
}
// filter out options not given in fillable a... | [
"public",
"function",
"create",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"capsule",
"=",
"$",
"this",
"->",
"_database",
"->",
"getCapsule",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"options",
")",
"||",
"!",
"is_array",
"(",
"$",
"... | Creates a new table row.
@return bool | [
"Creates",
"a",
"new",
"table",
"row",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L79-L97 |
198,458 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.find | public function find($id)
{
$capsule = $this->_database->getCapsule();
$this->_model = $capsule->table($this->table)->where('id', '=', $id);
return $this->_model->first();
} | php | public function find($id)
{
$capsule = $this->_database->getCapsule();
$this->_model = $capsule->table($this->table)->where('id', '=', $id);
return $this->_model->first();
} | [
"public",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"$",
"capsule",
"=",
"$",
"this",
"->",
"_database",
"->",
"getCapsule",
"(",
")",
";",
"$",
"this",
"->",
"_model",
"=",
"$",
"capsule",
"->",
"table",
"(",
"$",
"this",
"->",
"table",
")",
... | Finds an item by it's id.
@param int $id
@return stdClass | [
"Finds",
"an",
"item",
"by",
"it",
"s",
"id",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L120-L127 |
198,459 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.where | public function where($column, $operator, $value)
{
$capsule = $this->_database->getCapsule();
if (empty($column)) {
throw new \Exception('You must provide the column to look up!');
}
if (empty($operator)) {
throw new \Exception('You must provide an operator!... | php | public function where($column, $operator, $value)
{
$capsule = $this->_database->getCapsule();
if (empty($column)) {
throw new \Exception('You must provide the column to look up!');
}
if (empty($operator)) {
throw new \Exception('You must provide an operator!... | [
"public",
"function",
"where",
"(",
"$",
"column",
",",
"$",
"operator",
",",
"$",
"value",
")",
"{",
"$",
"capsule",
"=",
"$",
"this",
"->",
"_database",
"->",
"getCapsule",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"column",
")",
")",
"{",
"... | Searches for something in the database.
@param string $column - The column to search
@param string $operator - The operator for searching with
@param string $value - The value you're looking for
@return \Illuminate\Database\Query\Builder | [
"Searches",
"for",
"something",
"in",
"the",
"database",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L138-L155 |
198,460 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.count | public function count()
{
if (is_array($this->_model)) {
return count($this->_model);
} else {
return $this->_model->count();
}
} | php | public function count()
{
if (is_array($this->_model)) {
return count($this->_model);
} else {
return $this->_model->count();
}
} | [
"public",
"function",
"count",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_model",
")",
")",
"{",
"return",
"count",
"(",
"$",
"this",
"->",
"_model",
")",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"_model",
"->",
"c... | Gets the number of results.
@return int | [
"Gets",
"the",
"number",
"of",
"results",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L162-L169 |
198,461 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.all | public function all($order = 'ASC')
{
$capsule = $this->_database->getCapsule();
$this->_model = $capsule->table($this->table)->orderBy('id', $order)->get();
return $this->_model;
} | php | public function all($order = 'ASC')
{
$capsule = $this->_database->getCapsule();
$this->_model = $capsule->table($this->table)->orderBy('id', $order)->get();
return $this->_model;
} | [
"public",
"function",
"all",
"(",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"$",
"capsule",
"=",
"$",
"this",
"->",
"_database",
"->",
"getCapsule",
"(",
")",
";",
"$",
"this",
"->",
"_model",
"=",
"$",
"capsule",
"->",
"table",
"(",
"$",
"this",
"->",... | Gets all results from the database.
@param string $order - The order of the results
@return \Illuminate\Database\Query\Builder | [
"Gets",
"all",
"results",
"from",
"the",
"database",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L178-L185 |
198,462 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.select | public function select($capsule = null, $limit = null, $offset = null, $columns = [])
{
if (is_null($capsule)) {
$capsule = $this->_database->getCapsule()->table($this->table);
}
if (empty($columns)) {
$columns = '*';
} else {
$cstring = '';
... | php | public function select($capsule = null, $limit = null, $offset = null, $columns = [])
{
if (is_null($capsule)) {
$capsule = $this->_database->getCapsule()->table($this->table);
}
if (empty($columns)) {
$columns = '*';
} else {
$cstring = '';
... | [
"public",
"function",
"select",
"(",
"$",
"capsule",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
",",
"$",
"columns",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"capsule",
")",
")",
"{",
"$",
"cap... | Selects from the database table via custom SQL command.
@param \Illuminate\Database\Query\Builder $capsule - Capsule instance
@param int $limit - Selection limit
@param int $offset - Selection offset
@param array $columns - C... | [
"Selects",
"from",
"the",
"database",
"table",
"via",
"custom",
"SQL",
"command",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L197-L222 |
198,463 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.paginate | public function paginate($limit)
{
$capsule = $this->_database->getCapsule();
$this->_model = $capsule->table($this->table);
$paginator = new Pagination();
$paginator->setLimit($limit)->setModel($this, $this->_model);
return $paginator->paginate();
} | php | public function paginate($limit)
{
$capsule = $this->_database->getCapsule();
$this->_model = $capsule->table($this->table);
$paginator = new Pagination();
$paginator->setLimit($limit)->setModel($this, $this->_model);
return $paginator->paginate();
} | [
"public",
"function",
"paginate",
"(",
"$",
"limit",
")",
"{",
"$",
"capsule",
"=",
"$",
"this",
"->",
"_database",
"->",
"getCapsule",
"(",
")",
";",
"$",
"this",
"->",
"_model",
"=",
"$",
"capsule",
"->",
"table",
"(",
"$",
"this",
"->",
"table",
... | Does like all, but creates pagination for results.
@param int $limit - The number of results to limit by
@return \Scara\Pagination\Pagination | [
"Does",
"like",
"all",
"but",
"creates",
"pagination",
"for",
"results",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L231-L239 |
198,464 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.save | public function save($options)
{
$gcc = get_called_class();
$class = $gcc::init();
$cap = $this->_database->getCapsule();
$params = (array) $options;
$this->filter($params);
return $cap->table($this->table)->update($params);
} | php | public function save($options)
{
$gcc = get_called_class();
$class = $gcc::init();
$cap = $this->_database->getCapsule();
$params = (array) $options;
$this->filter($params);
return $cap->table($this->table)->update($params);
} | [
"public",
"function",
"save",
"(",
"$",
"options",
")",
"{",
"$",
"gcc",
"=",
"get_called_class",
"(",
")",
";",
"$",
"class",
"=",
"$",
"gcc",
"::",
"init",
"(",
")",
";",
"$",
"cap",
"=",
"$",
"this",
"->",
"_database",
"->",
"getCapsule",
"(",
... | Saves changes to a model.
@param mixed $options
@return bool | [
"Saves",
"changes",
"to",
"a",
"model",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L248-L257 |
198,465 | ScaraMVC/Framework | src/Scara/Http/Model.php | Model.filter | private function filter(&$options)
{
foreach ($options as $key => $value) {
if (!in_array($key, $this->fillable)) {
unset($options[$key]);
}
}
} | php | private function filter(&$options)
{
foreach ($options as $key => $value) {
if (!in_array($key, $this->fillable)) {
unset($options[$key]);
}
}
} | [
"private",
"function",
"filter",
"(",
"&",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"fillable",
")",
")",
"{",
... | Filters out options that are not included in a model's fillable array.
@param array &$options - Options array reference
@return void | [
"Filters",
"out",
"options",
"that",
"are",
"not",
"included",
"in",
"a",
"model",
"s",
"fillable",
"array",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Http/Model.php#L278-L285 |
198,466 | DreadLabs/VantomasWebsite | src/Disqus/Resource.php | Resource.parseResourceSignature | protected function parseResourceSignature()
{
list($topic, $actionAndFormat) = explode('/', $this->signature);
list($action, $format) = explode('.', $actionAndFormat);
$this->topic = ucfirst($topic);
$this->action = ucfirst($action);
$this->format = $format;
} | php | protected function parseResourceSignature()
{
list($topic, $actionAndFormat) = explode('/', $this->signature);
list($action, $format) = explode('.', $actionAndFormat);
$this->topic = ucfirst($topic);
$this->action = ucfirst($action);
$this->format = $format;
} | [
"protected",
"function",
"parseResourceSignature",
"(",
")",
"{",
"list",
"(",
"$",
"topic",
",",
"$",
"actionAndFormat",
")",
"=",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"signature",
")",
";",
"list",
"(",
"$",
"action",
",",
"$",
"format",
")... | parses a resource signature
The format must be something like foo/bar.json
@return void | [
"parses",
"a",
"resource",
"signature"
] | 7f85f2b45bdf5ed9fa9d320c805c416bf99cd668 | https://github.com/DreadLabs/VantomasWebsite/blob/7f85f2b45bdf5ed9fa9d320c805c416bf99cd668/src/Disqus/Resource.php#L106-L114 |
198,467 | DreadLabs/VantomasWebsite | src/Disqus/Resource.php | Resource.initializeConcreteResource | protected function initializeConcreteResource()
{
$this->concreteResource = $this->resourceResolver->resolve($this->topic, $this->action);
} | php | protected function initializeConcreteResource()
{
$this->concreteResource = $this->resourceResolver->resolve($this->topic, $this->action);
} | [
"protected",
"function",
"initializeConcreteResource",
"(",
")",
"{",
"$",
"this",
"->",
"concreteResource",
"=",
"$",
"this",
"->",
"resourceResolver",
"->",
"resolve",
"(",
"$",
"this",
"->",
"topic",
",",
"$",
"this",
"->",
"action",
")",
";",
"}"
] | initializes a concrete resource implementation
@return void | [
"initializes",
"a",
"concrete",
"resource",
"implementation"
] | 7f85f2b45bdf5ed9fa9d320c805c416bf99cd668 | https://github.com/DreadLabs/VantomasWebsite/blob/7f85f2b45bdf5ed9fa9d320c805c416bf99cd668/src/Disqus/Resource.php#L121-L124 |
198,468 | EXSyst/IO | StringSourceState.php | StringSourceState.restore | public function restore()
{
$this->offsetRef = $this->offset;
$this->lineRef = $this->line;
$this->rowRef = $this->row;
} | php | public function restore()
{
$this->offsetRef = $this->offset;
$this->lineRef = $this->line;
$this->rowRef = $this->row;
} | [
"public",
"function",
"restore",
"(",
")",
"{",
"$",
"this",
"->",
"offsetRef",
"=",
"$",
"this",
"->",
"offset",
";",
"$",
"this",
"->",
"lineRef",
"=",
"$",
"this",
"->",
"line",
";",
"$",
"this",
"->",
"rowRef",
"=",
"$",
"this",
"->",
"row",
... | Restores the source to which this state belongs to this state. | [
"Restores",
"the",
"source",
"to",
"which",
"this",
"state",
"belongs",
"to",
"this",
"state",
"."
] | 4c30ba79b09d2cc41d0a7cd340255a87cac54326 | https://github.com/EXSyst/IO/blob/4c30ba79b09d2cc41d0a7cd340255a87cac54326/StringSourceState.php#L48-L53 |
198,469 | Facebook-Anonymous-Publisher/wordfilter | src/Replace/Chinese.php | Chinese.replace | public static function replace(array $words, $replacement, $text)
{
$self = new self;
$length = $self->wordsLength($words);
$blocks = array_unique($length);
$min = end($blocks);
$chars = $self->splitText($text);
$index = $self->index($chars);
$pinyins = ... | php | public static function replace(array $words, $replacement, $text)
{
$self = new self;
$length = $self->wordsLength($words);
$blocks = array_unique($length);
$min = end($blocks);
$chars = $self->splitText($text);
$index = $self->index($chars);
$pinyins = ... | [
"public",
"static",
"function",
"replace",
"(",
"array",
"$",
"words",
",",
"$",
"replacement",
",",
"$",
"text",
")",
"{",
"$",
"self",
"=",
"new",
"self",
";",
"$",
"length",
"=",
"$",
"self",
"->",
"wordsLength",
"(",
"$",
"words",
")",
";",
"$"... | Replace words with replacements in a text.
@param array $words
@param string $replacement
@param string $text
@return string | [
"Replace",
"words",
"with",
"replacements",
"in",
"a",
"text",
"."
] | 0a2ce766a509650ac622eeaa809391ebf304885e | https://github.com/Facebook-Anonymous-Publisher/wordfilter/blob/0a2ce766a509650ac622eeaa809391ebf304885e/src/Replace/Chinese.php#L46-L85 |
198,470 | Facebook-Anonymous-Publisher/wordfilter | src/Replace/Chinese.php | Chinese.wordsLength | protected function wordsLength(array $words)
{
$length = [];
foreach ($words as $word) {
$pinyin = $this->pinyin->sentence($word);
$length[md5($pinyin)] = ($pinyin === $word)
? 1
: mb_strlen($word);
}
arsort($length);
... | php | protected function wordsLength(array $words)
{
$length = [];
foreach ($words as $word) {
$pinyin = $this->pinyin->sentence($word);
$length[md5($pinyin)] = ($pinyin === $word)
? 1
: mb_strlen($word);
}
arsort($length);
... | [
"protected",
"function",
"wordsLength",
"(",
"array",
"$",
"words",
")",
"{",
"$",
"length",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"words",
"as",
"$",
"word",
")",
"{",
"$",
"pinyin",
"=",
"$",
"this",
"->",
"pinyin",
"->",
"sentence",
"(",
"$",... | Get echo word length and use md5 as key.
@param array $words
@return array | [
"Get",
"echo",
"word",
"length",
"and",
"use",
"md5",
"as",
"key",
"."
] | 0a2ce766a509650ac622eeaa809391ebf304885e | https://github.com/Facebook-Anonymous-Publisher/wordfilter/blob/0a2ce766a509650ac622eeaa809391ebf304885e/src/Replace/Chinese.php#L94-L109 |
198,471 | Facebook-Anonymous-Publisher/wordfilter | src/Replace/Chinese.php | Chinese.splitText | protected function splitText($text)
{
$punctuations = preg_quote(implode('', $this->punctuations), '/');
$text = preg_replace('/([^\p{Han}\s'.$punctuations.']+)/u', "\t\t\t$1\t\t", $text);
$array = [];
foreach (preg_split('/\t\t/u', $text, -1, PREG_SPLIT_NO_EMPTY) as $item) {
... | php | protected function splitText($text)
{
$punctuations = preg_quote(implode('', $this->punctuations), '/');
$text = preg_replace('/([^\p{Han}\s'.$punctuations.']+)/u', "\t\t\t$1\t\t", $text);
$array = [];
foreach (preg_split('/\t\t/u', $text, -1, PREG_SPLIT_NO_EMPTY) as $item) {
... | [
"protected",
"function",
"splitText",
"(",
"$",
"text",
")",
"{",
"$",
"punctuations",
"=",
"preg_quote",
"(",
"implode",
"(",
"''",
",",
"$",
"this",
"->",
"punctuations",
")",
",",
"'/'",
")",
";",
"$",
"text",
"=",
"preg_replace",
"(",
"'/([^\\p{Han}\... | Spilt text to array.
@param string $text
@return array | [
"Spilt",
"text",
"to",
"array",
"."
] | 0a2ce766a509650ac622eeaa809391ebf304885e | https://github.com/Facebook-Anonymous-Publisher/wordfilter/blob/0a2ce766a509650ac622eeaa809391ebf304885e/src/Replace/Chinese.php#L118-L133 |
198,472 | Facebook-Anonymous-Publisher/wordfilter | src/Replace/Chinese.php | Chinese.index | protected function index(array $chars)
{
$index = [];
foreach ($chars as $key => $char) {
if (preg_match('/[\p{Han}\w]+/u', $char)) {
$index[] = $key;
}
}
return $index;
} | php | protected function index(array $chars)
{
$index = [];
foreach ($chars as $key => $char) {
if (preg_match('/[\p{Han}\w]+/u', $char)) {
$index[] = $key;
}
}
return $index;
} | [
"protected",
"function",
"index",
"(",
"array",
"$",
"chars",
")",
"{",
"$",
"index",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"chars",
"as",
"$",
"key",
"=>",
"$",
"char",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/[\\p{Han}\\w]+/u'",
",",
"$",
"c... | Build words index.
@param array $chars
@return array | [
"Build",
"words",
"index",
"."
] | 0a2ce766a509650ac622eeaa809391ebf304885e | https://github.com/Facebook-Anonymous-Publisher/wordfilter/blob/0a2ce766a509650ac622eeaa809391ebf304885e/src/Replace/Chinese.php#L160-L171 |
198,473 | ekyna/Table | Http/ParametersHelper.php | ParametersHelper.setData | public function setData(array $data = [])
{
$this->default = empty($data);
$this->data = array_replace([
static::VISIBLE_COLUMNS => [],
static::MAX_PER_PAGE => null,
static::CONFIG => null,
static::PAGE_NUM => null,
stat... | php | public function setData(array $data = [])
{
$this->default = empty($data);
$this->data = array_replace([
static::VISIBLE_COLUMNS => [],
static::MAX_PER_PAGE => null,
static::CONFIG => null,
static::PAGE_NUM => null,
stat... | [
"public",
"function",
"setData",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"default",
"=",
"empty",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"data",
"=",
"array_replace",
"(",
"[",
"static",
"::",
"VISIBLE_COLUMNS",... | Sets the data.
@param array $data | [
"Sets",
"the",
"data",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Http/ParametersHelper.php#L74-L94 |
198,474 | ekyna/Table | Http/ParametersHelper.php | ParametersHelper.getSortHref | public function getSortHref(ColumnInterface $column)
{
$parameter = $this->getSortName();
$dir = ($column->getSortDirection() === ColumnSort::ASC ? ColumnSort::DESC : ColumnSort::ASC);
return '?' . $parameter . '[by]=' . $column->getName() . '&' . $parameter . '[dir]=' . $dir;
} | php | public function getSortHref(ColumnInterface $column)
{
$parameter = $this->getSortName();
$dir = ($column->getSortDirection() === ColumnSort::ASC ? ColumnSort::DESC : ColumnSort::ASC);
return '?' . $parameter . '[by]=' . $column->getName() . '&' . $parameter . '[dir]=' . $dir;
} | [
"public",
"function",
"getSortHref",
"(",
"ColumnInterface",
"$",
"column",
")",
"{",
"$",
"parameter",
"=",
"$",
"this",
"->",
"getSortName",
"(",
")",
";",
"$",
"dir",
"=",
"(",
"$",
"column",
"->",
"getSortDirection",
"(",
")",
"===",
"ColumnSort",
":... | Returns the sort column href.
@param ColumnInterface $column
@return string | [
"Returns",
"the",
"sort",
"column",
"href",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Http/ParametersHelper.php#L213-L219 |
198,475 | ekyna/Table | Http/ParametersHelper.php | ParametersHelper.getIdentifiersName | public function getIdentifiersName()
{
$name = $this->tableName . '[' . static::IDENTIFIERS . ']';
if ($this->selectionMode == Config::SELECTION_MULTIPLE) {
$name .= '[]';
}
return $name;
} | php | public function getIdentifiersName()
{
$name = $this->tableName . '[' . static::IDENTIFIERS . ']';
if ($this->selectionMode == Config::SELECTION_MULTIPLE) {
$name .= '[]';
}
return $name;
} | [
"public",
"function",
"getIdentifiersName",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"tableName",
".",
"'['",
".",
"static",
"::",
"IDENTIFIERS",
".",
"']'",
";",
"if",
"(",
"$",
"this",
"->",
"selectionMode",
"==",
"Config",
"::",
"SELECTION_... | Returns the identifiers parameter name.
@return string | [
"Returns",
"the",
"identifiers",
"parameter",
"name",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Http/ParametersHelper.php#L290-L299 |
198,476 | ekyna/Table | Http/ParametersHelper.php | ParametersHelper.getProfileValue | private function getProfileValue($name)
{
if (isset($this->data[static::PROFILE][$name])) {
return $this->data[static::PROFILE][$name];
}
return null;
} | php | private function getProfileValue($name)
{
if (isset($this->data[static::PROFILE][$name])) {
return $this->data[static::PROFILE][$name];
}
return null;
} | [
"private",
"function",
"getProfileValue",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"static",
"::",
"PROFILE",
"]",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
"[",
"static",... | Returns the profile parameter value.
@param string $name The profile parameter name
@return string|null | [
"Returns",
"the",
"profile",
"parameter",
"value",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Http/ParametersHelper.php#L551-L558 |
198,477 | locomotivemtl/charcoal-config | src/Charcoal/Config/AbstractConfig.php | AbstractConfig.offsetExists | public function offsetExists($key)
{
if (is_numeric($key)) {
throw new InvalidArgumentException(
'Entity array access only supports non-numeric keys'
);
}
if ($this->separator && strstr($key, $this->separator)) {
return $this->hasWithSepar... | php | public function offsetExists($key)
{
if (is_numeric($key)) {
throw new InvalidArgumentException(
'Entity array access only supports non-numeric keys'
);
}
if ($this->separator && strstr($key, $this->separator)) {
return $this->hasWithSepar... | [
"public",
"function",
"offsetExists",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Entity array access only supports non-numeric keys'",
")",
";",
"}",
"if",
"(",
"$",
"t... | Determines if this store contains the specified key and if its value is not NULL.
Routine:
- If the data key is {@see SeparatorAwareTrait::$separator nested},
the data-tree is traversed until the endpoint is found, if any;
- If the data key does NOT exist on the store, a lookup is performed
on each delegate store unti... | [
"Determines",
"if",
"this",
"store",
"contains",
"the",
"specified",
"key",
"and",
"if",
"its",
"value",
"is",
"not",
"NULL",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/AbstractConfig.php#L135-L164 |
198,478 | locomotivemtl/charcoal-config | src/Charcoal/Config/AbstractConfig.php | AbstractConfig.offsetReplace | public function offsetReplace($key, $value)
{
if (is_numeric($key)) {
throw new InvalidArgumentException(
'Entity array access only supports non-numeric keys'
);
}
$key = $this->camelize($key);
/** @internal Edge Case: "_" → "" */
if ... | php | public function offsetReplace($key, $value)
{
if (is_numeric($key)) {
throw new InvalidArgumentException(
'Entity array access only supports non-numeric keys'
);
}
$key = $this->camelize($key);
/** @internal Edge Case: "_" → "" */
if ... | [
"public",
"function",
"offsetReplace",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Entity array access only supports non-numeric keys'",
")",
";",
"}",
... | Replaces the value from the specified key.
Routine:
- When the value in the Config and the new value are both arrays,
the method will replace their respective value recursively.
- Then or otherwise, the new value is {@see self::offsetSet() assigned} to the Config.
@uses self::offsetSet()
@uses array_replace_recur... | [
"Replaces",
"the",
"value",
"from",
"the",
"specified",
"key",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/AbstractConfig.php#L271-L294 |
198,479 | locomotivemtl/charcoal-config | src/Charcoal/Config/AbstractConfig.php | AbstractConfig.addFile | public function addFile($path)
{
$config = $this->loadFile($path);
if (is_array($config)) {
$this->merge($config);
}
return $this;
} | php | public function addFile($path)
{
$config = $this->loadFile($path);
if (is_array($config)) {
$this->merge($config);
}
return $this;
} | [
"public",
"function",
"addFile",
"(",
"$",
"path",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"loadFile",
"(",
"$",
"path",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"config",
")",
")",
"{",
"$",
"this",
"->",
"merge",
"(",
"$",
"config",
... | Adds a configuration file to the configset.
Natively supported file formats: INI, JSON, PHP.
@uses FileAwareTrait::loadFile()
@param string $path The file to load and add.
@return self | [
"Adds",
"a",
"configuration",
"file",
"to",
"the",
"configset",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/AbstractConfig.php#L305-L312 |
198,480 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/ClassUtility/CommentObject/PhpDocCommentObject.php | PhpDocCommentObject.ltrim | public static function ltrim ( $docComment ) {
$regexp = array(
'|^[\s\t]*(/\*\*)|um' => '\\1',
'|^[\s\t]*([ ]\*/)|um' => '\\1',
'|^[\s\t]*([ ]\*[ ]*)|um' => '\\1',
);
$patterns = array_keys($regexp);
... | php | public static function ltrim ( $docComment ) {
$regexp = array(
'|^[\s\t]*(/\*\*)|um' => '\\1',
'|^[\s\t]*([ ]\*/)|um' => '\\1',
'|^[\s\t]*([ ]\*[ ]*)|um' => '\\1',
);
$patterns = array_keys($regexp);
... | [
"public",
"static",
"function",
"ltrim",
"(",
"$",
"docComment",
")",
"{",
"$",
"regexp",
"=",
"array",
"(",
"'|^[\\s\\t]*(/\\*\\*)|um'",
"=>",
"'\\\\1'",
",",
"'|^[\\s\\t]*([ ]\\*/)|um'",
"=>",
"'\\\\1'",
",",
"'|^[\\s\\t]*([ ]\\*[ ]*)|um'",
"=>",
"'\\\\1'",
",",
... | Trim spaces and tabs on the left
@param string $docComment
@return string Trimmed DocComment | [
"Trim",
"spaces",
"and",
"tabs",
"on",
"the",
"left"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/ClassUtility/CommentObject/PhpDocCommentObject.php#L44-L55 |
198,481 | benjamindulau/AnoDataGrid | src/Ano/DataGrid/Twig/Extension/DataGridExtension.php | DataGridExtension.renderColumnBody | public function renderColumnBody(ColumnView $view, array $variables = array())
{
return $this->render($view, 'column_' . $view->get('type'), $variables);
} | php | public function renderColumnBody(ColumnView $view, array $variables = array())
{
return $this->render($view, 'column_' . $view->get('type'), $variables);
} | [
"public",
"function",
"renderColumnBody",
"(",
"ColumnView",
"$",
"view",
",",
"array",
"$",
"variables",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"render",
"(",
"$",
"view",
",",
"'column_'",
".",
"$",
"view",
"->",
"get",
"(",
... | Renders column body.
@param ColumnView $view The view to render
@param array $variables An array of variables
@return string The html markup | [
"Renders",
"column",
"body",
"."
] | 69b31803929b04e9d6e807bb2213b9b3477d0367 | https://github.com/benjamindulau/AnoDataGrid/blob/69b31803929b04e9d6e807bb2213b9b3477d0367/src/Ano/DataGrid/Twig/Extension/DataGridExtension.php#L96-L99 |
198,482 | benjamindulau/AnoDataGrid | src/Ano/DataGrid/Twig/Extension/DataGridExtension.php | DataGridExtension.getBlocks | protected function getBlocks(DataGridView $view)
{
if (!$this->blocks->contains($view)) {
$templates = $this->resources;
if (isset($this->themes[$view])) {
$templates = array_merge($templates, $this->themes[$view]);
}
$blocks = array();
... | php | protected function getBlocks(DataGridView $view)
{
if (!$this->blocks->contains($view)) {
$templates = $this->resources;
if (isset($this->themes[$view])) {
$templates = array_merge($templates, $this->themes[$view]);
}
$blocks = array();
... | [
"protected",
"function",
"getBlocks",
"(",
"DataGridView",
"$",
"view",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"blocks",
"->",
"contains",
"(",
"$",
"view",
")",
")",
"{",
"$",
"templates",
"=",
"$",
"this",
"->",
"resources",
";",
"if",
"(",
... | Returns the blocks used to render the view.
Templates are looked for in the resources in the following order:
* resources from the themes (and its parents)
* resources from the themes of parent views (up to the root view)
* default resources
@param DataGridView $view The view
@return array An array of Twig_TemplateI... | [
"Returns",
"the",
"blocks",
"used",
"to",
"render",
"the",
"view",
"."
] | 69b31803929b04e9d6e807bb2213b9b3477d0367 | https://github.com/benjamindulau/AnoDataGrid/blob/69b31803929b04e9d6e807bb2213b9b3477d0367/src/Ano/DataGrid/Twig/Extension/DataGridExtension.php#L220-L249 |
198,483 | Subscribo/omnipay-subscribo-shared | src/Shared/CreditCard.php | CreditCard.getShippingContactDifferences | public function getShippingContactDifferences($mode = self::MODE_FILTER_EMPTY_WHEN_STRING_VALUES)
{
$difference = [];
foreach ($this->getContactParameterNames() as $parameterName)
{
$billingGetter = 'getBilling'.ucfirst($parameterName);
$shippingGetter = 'getShipping'... | php | public function getShippingContactDifferences($mode = self::MODE_FILTER_EMPTY_WHEN_STRING_VALUES)
{
$difference = [];
foreach ($this->getContactParameterNames() as $parameterName)
{
$billingGetter = 'getBilling'.ucfirst($parameterName);
$shippingGetter = 'getShipping'... | [
"public",
"function",
"getShippingContactDifferences",
"(",
"$",
"mode",
"=",
"self",
"::",
"MODE_FILTER_EMPTY_WHEN_STRING_VALUES",
")",
"{",
"$",
"difference",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getContactParameterNames",
"(",
")",
"as",
"$... | Returns those shipping contact parameters which are different for shipping and billing
Keys are camel cased parameter names without shipping prefix, values are shipping contact parameter values
@param string $mode Filtering mode (if any): By default this methods filters out values, which are empty when converted to st... | [
"Returns",
"those",
"shipping",
"contact",
"parameters",
"which",
"are",
"different",
"for",
"shipping",
"and",
"billing",
"Keys",
"are",
"camel",
"cased",
"parameter",
"names",
"without",
"shipping",
"prefix",
"values",
"are",
"shipping",
"contact",
"parameter",
... | aa9fa115ef8324b50fe5c91d3593d5632f53b669 | https://github.com/Subscribo/omnipay-subscribo-shared/blob/aa9fa115ef8324b50fe5c91d3593d5632f53b669/src/Shared/CreditCard.php#L42-L64 |
198,484 | squareproton/Bond | lib/underscore.php | __.chain | public function chain($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
$__ = (isset($this) && isset($this->_chained) && $this->_chained) ? $this : __($item);
$__->_chained = true;
return $__;
} | php | public function chain($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
$__ = (isset($this) && isset($this->_chained) && $this->_chained) ? $this : __($item);
$__->_chained = true;
return $__;
} | [
"public",
"function",
"chain",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"__",
"=",
"(",
"isset",
"(",
"$",
"this",
")",
"&&"... | Are we in a chain? | [
"Are",
"we",
"in",
"a",
"chain?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L24-L30 |
198,485 | squareproton/Bond | lib/underscore.php | __.each | public function each($collection=null, $iterator=null) {
list($collection, $iterator) = self::_wrapArgs(func_get_args(), 2);
if(is_null($collection)) return self::_wrap(null);
$collection = (array) self::_collection($collection);
if(count($collection) === 0) return self::_wrap(null);
... | php | public function each($collection=null, $iterator=null) {
list($collection, $iterator) = self::_wrapArgs(func_get_args(), 2);
if(is_null($collection)) return self::_wrap(null);
$collection = (array) self::_collection($collection);
if(count($collection) === 0) return self::_wrap(null);
... | [
"public",
"function",
"each",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"iterator",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"iterator",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
... | Invoke the iterator on each item in the collection | [
"Invoke",
"the",
"iterator",
"on",
"each",
"item",
"in",
"the",
"collection"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L40-L52 |
198,486 | squareproton/Bond | lib/underscore.php | __.invoke | public function invoke($collection=null, $function_name=null, $arguments=null) {
$args = self::_wrapArgs(func_get_args(), 2);
$__ = new self;
list($collection, $function_name) = $__->first($args, 2);
$arguments = $__->rest(func_get_args(), 2);
// If passed an array or string, return an array
... | php | public function invoke($collection=null, $function_name=null, $arguments=null) {
$args = self::_wrapArgs(func_get_args(), 2);
$__ = new self;
list($collection, $function_name) = $__->first($args, 2);
$arguments = $__->rest(func_get_args(), 2);
// If passed an array or string, return an array
... | [
"public",
"function",
"invoke",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"function_name",
"=",
"null",
",",
"$",
"arguments",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";"... | Invoke the named function over each item in the collection, optionally passing arguments to the function | [
"Invoke",
"the",
"named",
"function",
"over",
"each",
"item",
"in",
"the",
"collection",
"optionally",
"passing",
"arguments",
"to",
"the",
"function"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L137-L150 |
198,487 | squareproton/Bond | lib/underscore.php | __.size | public function size($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
$collection = self::_collection($collection);
return self::_wrap(count((array) $collection));
} | php | public function size($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
$collection = self::_collection($collection);
return self::_wrap(count((array) $collection));
} | [
"public",
"function",
"size",
"(",
"$",
"collection",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"collection",
"=",
"self",
"::",
"_collection",
... | How many items are in this collection? | [
"How",
"many",
"items",
"are",
"in",
"this",
"collection?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L232-L238 |
198,488 | squareproton/Bond | lib/underscore.php | __.initial | public function initial($collection=null, $n=null) {
list($collection, $n) = self::_wrapArgs(func_get_args(), 2);
$collection = (array) self::_collection($collection);
if(is_null($n)) $n = 1;
$first_index = count($collection) - $n;
$__ = new self;
return self::_wrap($__->first($collect... | php | public function initial($collection=null, $n=null) {
list($collection, $n) = self::_wrapArgs(func_get_args(), 2);
$collection = (array) self::_collection($collection);
if(is_null($n)) $n = 1;
$first_index = count($collection) - $n;
$__ = new self;
return self::_wrap($__->first($collect... | [
"public",
"function",
"initial",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"n",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"n",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";",
"$... | Return everything but the last array element. Passing n excludes the last n elements. | [
"Return",
"everything",
"but",
"the",
"last",
"array",
"element",
".",
"Passing",
"n",
"excludes",
"the",
"last",
"n",
"elements",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L268-L277 |
198,489 | squareproton/Bond | lib/underscore.php | __.compact | public function compact($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
$collection = self::_collection($collection);
$__ = new self;
return self::_wrap($__->select($collection, function($val) {
return (bool) $val;
}));
} | php | public function compact($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
$collection = self::_collection($collection);
$__ = new self;
return self::_wrap($__->select($collection, function($val) {
return (bool) $val;
}));
} | [
"public",
"function",
"compact",
"(",
"$",
"collection",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"collection",
"=",
"self",
"::",
"_collection"... | Return a copy of the array with falsy values removed | [
"Return",
"a",
"copy",
"of",
"the",
"array",
"with",
"falsy",
"values",
"removed"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L297-L306 |
198,490 | squareproton/Bond | lib/underscore.php | __.flatten | public function flatten($collection=null, $shallow=null) {
list($collection, $shallow) = self::_wrapArgs(func_get_args(), 2);
$collection = self::_collection($collection);
$return = array();
if(count($collection) > 0) {
foreach($collection as $item) {
if(is_array($item)) {
... | php | public function flatten($collection=null, $shallow=null) {
list($collection, $shallow) = self::_wrapArgs(func_get_args(), 2);
$collection = self::_collection($collection);
$return = array();
if(count($collection) > 0) {
foreach($collection as $item) {
if(is_array($item)) {
... | [
"public",
"function",
"flatten",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"shallow",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"shallow",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",... | Flattens a multidimensional array | [
"Flattens",
"a",
"multidimensional",
"array"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L310-L326 |
198,491 | squareproton/Bond | lib/underscore.php | __.without | public function without($collection=null, $val=null) {
$args = self::_wrapArgs(func_get_args(), 1);
$collection = $args[0];
$collection = self::_collection($collection);
$num_args = count($args);
if($num_args === 1) return self::_wrap($collection);
if(count($collection) === 0) return self::... | php | public function without($collection=null, $val=null) {
$args = self::_wrapArgs(func_get_args(), 1);
$collection = $args[0];
$collection = self::_collection($collection);
$num_args = count($args);
if($num_args === 1) return self::_wrap($collection);
if(count($collection) === 0) return self::... | [
"public",
"function",
"without",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"val",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"collection",
"=",
"$",
"args",
"[",... | Returns a copy of the array with all instances of val removed | [
"Returns",
"a",
"copy",
"of",
"the",
"array",
"with",
"all",
"instances",
"of",
"val",
"removed"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L330-L350 |
198,492 | squareproton/Bond | lib/underscore.php | __.intersection | public function intersection($array=null) {
$arrays = self::_wrapArgs(func_get_args(), 1);
if(count($arrays) === 1) return self::_wrap($array);
$__ = new self;
$return = $__->first($arrays);
foreach($__->rest($arrays) as $next) {
if(!$__->isArray($next)) $next = str_split((string) $n... | php | public function intersection($array=null) {
$arrays = self::_wrapArgs(func_get_args(), 1);
if(count($arrays) === 1) return self::_wrap($array);
$__ = new self;
$return = $__->first($arrays);
foreach($__->rest($arrays) as $next) {
if(!$__->isArray($next)) $next = str_split((string) $n... | [
"public",
"function",
"intersection",
"(",
"$",
"array",
"=",
"null",
")",
"{",
"$",
"arrays",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arrays",
")",
"===",
"1",
")",
"return... | Returns an array containing the intersection of all the arrays | [
"Returns",
"an",
"array",
"containing",
"the",
"intersection",
"of",
"all",
"the",
"arrays"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L378-L392 |
198,493 | squareproton/Bond | lib/underscore.php | __.union | public function union($array=null) {
$arrays = self::_wrapArgs(func_get_args(), 1);
if(count($arrays) === 1) return self::_wrap($array);
$__ = new self;
return self::_wrap($__->flatten(array_values(array_unique(call_user_func_array('array_merge', $arrays)))));
} | php | public function union($array=null) {
$arrays = self::_wrapArgs(func_get_args(), 1);
if(count($arrays) === 1) return self::_wrap($array);
$__ = new self;
return self::_wrap($__->flatten(array_values(array_unique(call_user_func_array('array_merge', $arrays)))));
} | [
"public",
"function",
"union",
"(",
"$",
"array",
"=",
"null",
")",
"{",
"$",
"arrays",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arrays",
")",
"===",
"1",
")",
"return",
"s... | Merge together multiple arrays | [
"Merge",
"together",
"multiple",
"arrays"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L396-L403 |
198,494 | squareproton/Bond | lib/underscore.php | __.difference | public function difference($array_one=null, $array_two=null) {
$arrays = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(array_values(call_user_func_array('array_diff', $arrays)));
} | php | public function difference($array_one=null, $array_two=null) {
$arrays = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(array_values(call_user_func_array('array_diff', $arrays)));
} | [
"public",
"function",
"difference",
"(",
"$",
"array_one",
"=",
"null",
",",
"$",
"array_two",
"=",
"null",
")",
"{",
"$",
"arrays",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
... | Get the difference between two arrays | [
"Get",
"the",
"difference",
"between",
"two",
"arrays"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L407-L411 |
198,495 | squareproton/Bond | lib/underscore.php | __.indexOf | public function indexOf($collection=null, $item=null) {
list($collection, $item) = self::_wrapArgs(func_get_args(), 2);
$collection = self::_collection($collection);
$key = array_search($item, $collection, true);
return self::_wrap((is_bool($key)) ? -1 : $key);
} | php | public function indexOf($collection=null, $item=null) {
list($collection, $item) = self::_wrapArgs(func_get_args(), 2);
$collection = self::_collection($collection);
$key = array_search($item, $collection, true);
return self::_wrap((is_bool($key)) ? -1 : $key);
} | [
"public",
"function",
"indexOf",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";"... | Get the index of the first match | [
"Get",
"the",
"index",
"of",
"the",
"first",
"match"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L415-L422 |
198,496 | squareproton/Bond | lib/underscore.php | __.lastIndexOf | public function lastIndexOf($collection=null, $item=null) {
list($collection, $item) = self::_wrapArgs(func_get_args(), 2);
$collection = self::_collection($collection);
krsort($collection);
$__ = new self;
return self::_wrap($__->indexOf($collection, $item));
} | php | public function lastIndexOf($collection=null, $item=null) {
list($collection, $item) = self::_wrapArgs(func_get_args(), 2);
$collection = self::_collection($collection);
krsort($collection);
$__ = new self;
return self::_wrap($__->indexOf($collection, $item));
} | [
"public",
"function",
"lastIndexOf",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
... | Get the index of the last match | [
"Get",
"the",
"index",
"of",
"the",
"last",
"match"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L426-L434 |
198,497 | squareproton/Bond | lib/underscore.php | __.max | public function max($collection=null, $iterator=null) {
list($collection, $iterator) = self::_wrapArgs(func_get_args(), 2);
if(is_null($iterator)) return self::_wrap(max($collection));
$results = array();
foreach($collection as $k=>$item) {
$results[$k] = $iterator($item);
}
arso... | php | public function max($collection=null, $iterator=null) {
list($collection, $iterator) = self::_wrapArgs(func_get_args(), 2);
if(is_null($iterator)) return self::_wrap(max($collection));
$results = array();
foreach($collection as $k=>$item) {
$results[$k] = $iterator($item);
}
arso... | [
"public",
"function",
"max",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"iterator",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"iterator",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
... | Get the max value in the collection | [
"Get",
"the",
"max",
"value",
"in",
"the",
"collection"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L493-L506 |
198,498 | squareproton/Bond | lib/underscore.php | __.sortedIndex | public function sortedIndex($collection=null, $value=null, $iterator=null) {
list($collection, $value, $iterator) = self::_wrapArgs(func_get_args(), 3);
$collection = (array) self::_collection($collection);
$__ = new self;
$calculated_value = (!is_null($iterator)) ? $iterator($value) : $value;... | php | public function sortedIndex($collection=null, $value=null, $iterator=null) {
list($collection, $value, $iterator) = self::_wrapArgs(func_get_args(), 3);
$collection = (array) self::_collection($collection);
$__ = new self;
$calculated_value = (!is_null($iterator)) ? $iterator($value) : $value;... | [
"public",
"function",
"sortedIndex",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"$",
"iterator",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"value",
",",
"$",
"iterator",
")",
"=",
"self",
"::",
... | Returns the index at which the value should be inserted into the sorted collection | [
"Returns",
"the",
"index",
"at",
"which",
"the",
"value",
"should",
"be",
"inserted",
"into",
"the",
"sorted",
"collection"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L558-L577 |
198,499 | squareproton/Bond | lib/underscore.php | __.shuffle | public function shuffle($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
$collection = (array) self::_collection($collection);
shuffle($collection);
return self::_wrap($collection);
} | php | public function shuffle($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
$collection = (array) self::_collection($collection);
shuffle($collection);
return self::_wrap($collection);
} | [
"public",
"function",
"shuffle",
"(",
"$",
"collection",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"collection",
"=",
"(",
"array",
")",
"self"... | Shuffle the array | [
"Shuffle",
"the",
"array"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L580-L587 |
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.