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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
195,800 | Giftbit/lightrail-client-php | lib/LightrailShopperTokenFactory.php | LightrailShopperTokenFactory.generate | public static function generate($contact, $options = array())
{
if (!isset(Lightrail::$apiKey) || empty(Lightrail::$apiKey)) {
throw new Exceptions\BadParameterException("Lightrail.apiKey is empty or not set.");
}
if (!isset(Lightrail::$sharedSecret) || empty(Lightrail::$sharedSe... | php | public static function generate($contact, $options = array())
{
if (!isset(Lightrail::$apiKey) || empty(Lightrail::$apiKey)) {
throw new Exceptions\BadParameterException("Lightrail.apiKey is empty or not set.");
}
if (!isset(Lightrail::$sharedSecret) || empty(Lightrail::$sharedSe... | [
"public",
"static",
"function",
"generate",
"(",
"$",
"contact",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"Lightrail",
"::",
"$",
"apiKey",
")",
"||",
"empty",
"(",
"Lightrail",
"::",
"$",
"apiKey",
")",
... | Generate a shopper token that can be used to make Lightrail calls
restricted to that particular shopper. The shopper can be defined by the
contactId, userSuppliedId, or shopperId.
eg: `generateShopperToken(array("shopperId" => "user-12345"));`
eg: `generateShopperToken(array("shopperId" => "user-12345"), array("valid... | [
"Generate",
"a",
"shopper",
"token",
"that",
"can",
"be",
"used",
"to",
"make",
"Lightrail",
"calls",
"restricted",
"to",
"that",
"particular",
"shopper",
".",
"The",
"shopper",
"can",
"be",
"defined",
"by",
"the",
"contactId",
"userSuppliedId",
"or",
"shopper... | 7302aca93e52a6264f7b0e3941428e28804fd7f0 | https://github.com/Giftbit/lightrail-client-php/blob/7302aca93e52a6264f7b0e3941428e28804fd7f0/lib/LightrailShopperTokenFactory.php#L20-L77 |
195,801 | tonis-io-legacy/web | src/AppFactory.php | AppFactory.prepareServices | private function prepareServices()
{
$services = new Container;
$services->set(Router::class, new Router, true);
$services->set(Dispatcher::class, new Dispatcher, true);
$services->set(PackageManager::class, new PackageManager, true);
$services->set(EventManager::class, new ... | php | private function prepareServices()
{
$services = new Container;
$services->set(Router::class, new Router, true);
$services->set(Dispatcher::class, new Dispatcher, true);
$services->set(PackageManager::class, new PackageManager, true);
$services->set(EventManager::class, new ... | [
"private",
"function",
"prepareServices",
"(",
")",
"{",
"$",
"services",
"=",
"new",
"Container",
";",
"$",
"services",
"->",
"set",
"(",
"Router",
"::",
"class",
",",
"new",
"Router",
",",
"true",
")",
";",
"$",
"services",
"->",
"set",
"(",
"Dispatc... | Prepares services required by Tonis. We'll put them in the DIC so that they're
available to other factories if necessary.
@return Container | [
"Prepares",
"services",
"required",
"by",
"Tonis",
".",
"We",
"ll",
"put",
"them",
"in",
"the",
"DIC",
"so",
"that",
"they",
"re",
"available",
"to",
"other",
"factories",
"if",
"necessary",
"."
] | 730bec77457afeb91ce4ca9fbbf85c469c2fb8bc | https://github.com/tonis-io-legacy/web/blob/730bec77457afeb91ce4ca9fbbf85c469c2fb8bc/src/AppFactory.php#L91-L102 |
195,802 | libreworks/microformats | src/AddressFormatter.php | AddressFormatter.format | public function format(Address $address)
{
$fields = [
'p-street-address' => $address->getStreet(),
'p-extended-address' => $address->getExtended(),
'p-post-office-box' => $address->getPobox(),
'p-locality' => $address->getLocality(),
'p-region' =>... | php | public function format(Address $address)
{
$fields = [
'p-street-address' => $address->getStreet(),
'p-extended-address' => $address->getExtended(),
'p-post-office-box' => $address->getPobox(),
'p-locality' => $address->getLocality(),
'p-region' =>... | [
"public",
"function",
"format",
"(",
"Address",
"$",
"address",
")",
"{",
"$",
"fields",
"=",
"[",
"'p-street-address'",
"=>",
"$",
"address",
"->",
"getStreet",
"(",
")",
",",
"'p-extended-address'",
"=>",
"$",
"address",
"->",
"getExtended",
"(",
")",
",... | Formats an address.
@param \Libreworks\Microformats\Address $address
@return string The HTML markup | [
"Formats",
"an",
"address",
"."
] | f208650cb83e8711f5f35878cfa285b7cb505d3d | https://github.com/libreworks/microformats/blob/f208650cb83e8711f5f35878cfa285b7cb505d3d/src/AddressFormatter.php#L51-L73 |
195,803 | KDF5000/EasyThink | src/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php | PHPRPC_Date.addMilliseconds | function addMilliseconds($milliseconds) {
if (!is_int($milliseconds)) return false;
if ($milliseconds == 0) return true;
$millisecond = $this->millisecond + $milliseconds;
$milliseconds = $millisecond % 1000;
if ($milliseconds < 0) {
$milliseconds += 1000;
}
... | php | function addMilliseconds($milliseconds) {
if (!is_int($milliseconds)) return false;
if ($milliseconds == 0) return true;
$millisecond = $this->millisecond + $milliseconds;
$milliseconds = $millisecond % 1000;
if ($milliseconds < 0) {
$milliseconds += 1000;
}
... | [
"function",
"addMilliseconds",
"(",
"$",
"milliseconds",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"milliseconds",
")",
")",
"return",
"false",
";",
"if",
"(",
"$",
"milliseconds",
"==",
"0",
")",
"return",
"true",
";",
"$",
"millisecond",
"=",
"$"... | public instance methods | [
"public",
"instance",
"methods"
] | 86efc9c8a0d504e01e2fea55868227fdc8928841 | https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php#L74-L91 |
195,804 | KDF5000/EasyThink | src/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php | PHPRPC_Date.dayOfWeek | function dayOfWeek() {
$num = func_num_args();
if ($num == 3) {
$args = func_get_args();
$y = $args[0];
$m = $args[1];
$d = $args[2];
}
else {
$y = $this->year;
$m = $this->month;
$d = $this->day;
... | php | function dayOfWeek() {
$num = func_num_args();
if ($num == 3) {
$args = func_get_args();
$y = $args[0];
$m = $args[1];
$d = $args[2];
}
else {
$y = $this->year;
$m = $this->month;
$d = $this->day;
... | [
"function",
"dayOfWeek",
"(",
")",
"{",
"$",
"num",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"$",
"num",
"==",
"3",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"y",
"=",
"$",
"args",
"[",
"0",
"]",
";",
"$",
"m",
... | public instance & static methods | [
"public",
"instance",
"&",
"static",
"methods"
] | 86efc9c8a0d504e01e2fea55868227fdc8928841 | https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php#L382-L397 |
195,805 | koolkode/context | src/CompiledContainer.php | CompiledContainer.callFactoryMethod | protected function callFactoryMethod($typeName, $factory, $methodName, array $resolvers = NULL, InjectionPointInterface $point = NULL)
{
$ref = new \ReflectionMethod(get_class($factory), $methodName);
foreach($ref->getParameters() as $param)
{
if(Configuration::class === $this->getParamType($param))
{
... | php | protected function callFactoryMethod($typeName, $factory, $methodName, array $resolvers = NULL, InjectionPointInterface $point = NULL)
{
$ref = new \ReflectionMethod(get_class($factory), $methodName);
foreach($ref->getParameters() as $param)
{
if(Configuration::class === $this->getParamType($param))
{
... | [
"protected",
"function",
"callFactoryMethod",
"(",
"$",
"typeName",
",",
"$",
"factory",
",",
"$",
"methodName",
",",
"array",
"$",
"resolvers",
"=",
"NULL",
",",
"InjectionPointInterface",
"$",
"point",
"=",
"NULL",
")",
"{",
"$",
"ref",
"=",
"new",
"\\",... | Create an object instance by calling a factory method on an object.
@param string $typeName The bound type name of the target type.
@param object $factory The factory instance to be used.
@param string $methodName The name of the factory method to be called.
@param array<string, mixed> $resolvers Param resolvers appli... | [
"Create",
"an",
"object",
"instance",
"by",
"calling",
"a",
"factory",
"method",
"on",
"an",
"object",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/CompiledContainer.php#L194-L223 |
195,806 | koolkode/context | src/CompiledContainer.php | CompiledContainer.reviveMarker | protected function reviveMarker($typeName, array $params = NULL)
{
static $refs = [];
if(empty($refs[$typeName]))
{
$refs[$typeName] = new \ReflectionClass($typeName);
}
$marker = $refs[$typeName]->newInstanceWithoutConstructor();
foreach((array)$params as $k => $v)
{
$marker->$k = $v;
}... | php | protected function reviveMarker($typeName, array $params = NULL)
{
static $refs = [];
if(empty($refs[$typeName]))
{
$refs[$typeName] = new \ReflectionClass($typeName);
}
$marker = $refs[$typeName]->newInstanceWithoutConstructor();
foreach((array)$params as $k => $v)
{
$marker->$k = $v;
}... | [
"protected",
"function",
"reviveMarker",
"(",
"$",
"typeName",
",",
"array",
"$",
"params",
"=",
"NULL",
")",
"{",
"static",
"$",
"refs",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"refs",
"[",
"$",
"typeName",
"]",
")",
")",
"{",
"$",
"re... | Revives a marker instance by creating it without constructor invocation.
@param string $typeName
@param array<string, mixed> $params
@return Marker | [
"Revives",
"a",
"marker",
"instance",
"by",
"creating",
"it",
"without",
"constructor",
"invocation",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/CompiledContainer.php#L232-L249 |
195,807 | kambalabs/KmbDomain | src/KmbDomain/Service/GroupParameterFactory.php | GroupParameterFactory.createFromImportedData | public function createFromImportedData($name, $data)
{
if (!is_array($data)) {
return new GroupParameter($name, [$data]);
} elseif (!$this->isAssociativeArray($data)) {
return new GroupParameter($name, $data);
}
$parameter = new GroupParameter($name);
... | php | public function createFromImportedData($name, $data)
{
if (!is_array($data)) {
return new GroupParameter($name, [$data]);
} elseif (!$this->isAssociativeArray($data)) {
return new GroupParameter($name, $data);
}
$parameter = new GroupParameter($name);
... | [
"public",
"function",
"createFromImportedData",
"(",
"$",
"name",
",",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"return",
"new",
"GroupParameter",
"(",
"$",
"name",
",",
"[",
"$",
"data",
"]",
")",
";",
"}... | Create GroupParameter instance from imported data.
@param string $name
@param array $data
@return GroupParameter | [
"Create",
"GroupParameter",
"instance",
"from",
"imported",
"data",
"."
] | b1631bd936c6c6798076b51dfaebd706e1bdc8c2 | https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Service/GroupParameterFactory.php#L35-L47 |
195,808 | kambalabs/KmbDomain | src/KmbDomain/Service/GroupParameterFactory.php | GroupParameterFactory.createRequiredFromTemplates | public function createRequiredFromTemplates($templates)
{
$parameters = [];
if (!empty($templates)) {
foreach ($templates as $template) {
if ($template->required) {
$parameters[] = $this->createFromTemplate($template);
}
}
... | php | public function createRequiredFromTemplates($templates)
{
$parameters = [];
if (!empty($templates)) {
foreach ($templates as $template) {
if ($template->required) {
$parameters[] = $this->createFromTemplate($template);
}
}
... | [
"public",
"function",
"createRequiredFromTemplates",
"(",
"$",
"templates",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"templates",
")",
")",
"{",
"foreach",
"(",
"$",
"templates",
"as",
"$",
"template",
")",
"{... | Create GroupParameter instances from all given required templates.
@param \stdClass[] $templates
@return GroupParameter[] | [
"Create",
"GroupParameter",
"instances",
"from",
"all",
"given",
"required",
"templates",
"."
] | b1631bd936c6c6798076b51dfaebd706e1bdc8c2 | https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Service/GroupParameterFactory.php#L60-L71 |
195,809 | kambalabs/KmbDomain | src/KmbDomain/Service/GroupParameterFactory.php | GroupParameterFactory.createFromTemplate | public function createFromTemplate($template)
{
$parameter = new GroupParameter();
$parameter->setName($template->name);
$parameter->setTemplate($template);
if ($template->type == GroupParameterType::HASHTABLE && isset($template->entries)) {
$parameter->setChildren($this-... | php | public function createFromTemplate($template)
{
$parameter = new GroupParameter();
$parameter->setName($template->name);
$parameter->setTemplate($template);
if ($template->type == GroupParameterType::HASHTABLE && isset($template->entries)) {
$parameter->setChildren($this-... | [
"public",
"function",
"createFromTemplate",
"(",
"$",
"template",
")",
"{",
"$",
"parameter",
"=",
"new",
"GroupParameter",
"(",
")",
";",
"$",
"parameter",
"->",
"setName",
"(",
"$",
"template",
"->",
"name",
")",
";",
"$",
"parameter",
"->",
"setTemplate... | Create GroupParameter instance from given template.
@param \stdClass $template
@return GroupParameter | [
"Create",
"GroupParameter",
"instance",
"from",
"given",
"template",
"."
] | b1631bd936c6c6798076b51dfaebd706e1bdc8c2 | https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Service/GroupParameterFactory.php#L79-L95 |
195,810 | phossa/phossa-config | src/Phossa/Config/Loader/Loader.php | Loader.setRootDir | protected function setRootDir(/*# string */ $rootDir)
{
// validate root directory
if (!is_string($rootDir) || !is_dir($rootDir) || !is_readable($rootDir))
{
throw new InvalidArgumentException(
Message::get(Message::CONFIG_DIR_INVALID, $rootDir),
M... | php | protected function setRootDir(/*# string */ $rootDir)
{
// validate root directory
if (!is_string($rootDir) || !is_dir($rootDir) || !is_readable($rootDir))
{
throw new InvalidArgumentException(
Message::get(Message::CONFIG_DIR_INVALID, $rootDir),
M... | [
"protected",
"function",
"setRootDir",
"(",
"/*# string */",
"$",
"rootDir",
")",
"{",
"// validate root directory",
"if",
"(",
"!",
"is_string",
"(",
"$",
"rootDir",
")",
"||",
"!",
"is_dir",
"(",
"$",
"rootDir",
")",
"||",
"!",
"is_readable",
"(",
"$",
"... | Set root directory
@param string $rootDir
@return self
@throws InvalidArgumentException if dir is bad
@access protected | [
"Set",
"root",
"directory"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Loader/Loader.php#L121-L134 |
195,811 | Linkvalue-Interne/MobileNotif | src/Model/Message.php | Message.addToken | public function addToken($token)
{
if (!in_array($token, $this->tokens)) {
$this->tokens[] = $token;
}
return $this;
} | php | public function addToken($token)
{
if (!in_array($token, $this->tokens)) {
$this->tokens[] = $token;
}
return $this;
} | [
"public",
"function",
"addToken",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"token",
",",
"$",
"this",
"->",
"tokens",
")",
")",
"{",
"$",
"this",
"->",
"tokens",
"[",
"]",
"=",
"$",
"token",
";",
"}",
"return",
"$",
"t... | Add a token device.
@param string $token
@return self | [
"Add",
"a",
"token",
"device",
"."
] | e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6 | https://github.com/Linkvalue-Interne/MobileNotif/blob/e6e4c4219f3bbb0aee32e90e5fdfc8c6a7ed53f6/src/Model/Message.php#L84-L91 |
195,812 | agentmedia/phine-core | src/Core/Logic/Tree/PageContentTreeProvider.php | PageContentTreeProvider.TopMost | function TopMost()
{
$sql = Access::SqlBuilder();
$tbl = PageContent::Schema()->Table();
$where = $sql->Equals($tbl->Field('Page'), $sql->Value($this->page->GetID()))->
And_($sql->Equals($tbl->Field('Area'), $sql->Value($this->area->GetID())))->
And_($sql->IsN... | php | function TopMost()
{
$sql = Access::SqlBuilder();
$tbl = PageContent::Schema()->Table();
$where = $sql->Equals($tbl->Field('Page'), $sql->Value($this->page->GetID()))->
And_($sql->Equals($tbl->Field('Area'), $sql->Value($this->area->GetID())))->
And_($sql->IsN... | [
"function",
"TopMost",
"(",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tbl",
"=",
"PageContent",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"where",
"=",
"$",
"sql",
"->",
"Equals",
"(",
"$",
... | Returns the root and first content element in a page and area
@return PageContent Returns the first and root content | [
"Returns",
"the",
"root",
"and",
"first",
"content",
"element",
"in",
"a",
"page",
"and",
"area"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Tree/PageContentTreeProvider.php#L38-L48 |
195,813 | JuniorZavaleta/MySqlCsvExporter | src/CsvExport.php | CsvGenerator.setCredentials | public function setCredentials($credentials)
{
if (function_exists('env')) {
$host = env('DB_HOST');
$dbname = env('DB_DATABASE');
$username = env('DB_USERNAME');
$password = env('DB_PASSWORD');
} else {
$host = $credentials['host'];
... | php | public function setCredentials($credentials)
{
if (function_exists('env')) {
$host = env('DB_HOST');
$dbname = env('DB_DATABASE');
$username = env('DB_USERNAME');
$password = env('DB_PASSWORD');
} else {
$host = $credentials['host'];
... | [
"public",
"function",
"setCredentials",
"(",
"$",
"credentials",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'env'",
")",
")",
"{",
"$",
"host",
"=",
"env",
"(",
"'DB_HOST'",
")",
";",
"$",
"dbname",
"=",
"env",
"(",
"'DB_DATABASE'",
")",
";",
"$",
... | Set the credentials to connect with mysql
@param array $credentials | [
"Set",
"the",
"credentials",
"to",
"connect",
"with",
"mysql"
] | 88e67a035e2eaf3a617b0595309fe680bb62a6cb | https://github.com/JuniorZavaleta/MySqlCsvExporter/blob/88e67a035e2eaf3a617b0595309fe680bb62a6cb/src/CsvExport.php#L87-L106 |
195,814 | JuniorZavaleta/MySqlCsvExporter | src/CsvExport.php | CsvGenerator.setTitles | public function setTitles($titles)
{
$titles = is_array($titles) ? $titles : func_get_args();
if (count($titles) > 0) {
$this->titles = '"'.implode('", "',$titles).'"';
}
} | php | public function setTitles($titles)
{
$titles = is_array($titles) ? $titles : func_get_args();
if (count($titles) > 0) {
$this->titles = '"'.implode('", "',$titles).'"';
}
} | [
"public",
"function",
"setTitles",
"(",
"$",
"titles",
")",
"{",
"$",
"titles",
"=",
"is_array",
"(",
"$",
"titles",
")",
"?",
"$",
"titles",
":",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"titles",
")",
">",
"0",
")",
"{",
"$... | Set the titles for the csv
@param mixed $titles | [
"Set",
"the",
"titles",
"for",
"the",
"csv"
] | 88e67a035e2eaf3a617b0595309fe680bb62a6cb | https://github.com/JuniorZavaleta/MySqlCsvExporter/blob/88e67a035e2eaf3a617b0595309fe680bb62a6cb/src/CsvExport.php#L112-L119 |
195,815 | JuniorZavaleta/MySqlCsvExporter | src/CsvExport.php | CsvGenerator.setColumns | public function setColumns($columns)
{
$columns = is_array($columns) ? $columns : func_get_args();
if (count($columns) > 0) {
$this->columns = implode(', ', $columns);
}
} | php | public function setColumns($columns)
{
$columns = is_array($columns) ? $columns : func_get_args();
if (count($columns) > 0) {
$this->columns = implode(', ', $columns);
}
} | [
"public",
"function",
"setColumns",
"(",
"$",
"columns",
")",
"{",
"$",
"columns",
"=",
"is_array",
"(",
"$",
"columns",
")",
"?",
"$",
"columns",
":",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"columns",
")",
">",
"0",
")",
"{"... | Set the columns to export
@param mixed $columns | [
"Set",
"the",
"columns",
"to",
"export"
] | 88e67a035e2eaf3a617b0595309fe680bb62a6cb | https://github.com/JuniorZavaleta/MySqlCsvExporter/blob/88e67a035e2eaf3a617b0595309fe680bb62a6cb/src/CsvExport.php#L125-L132 |
195,816 | JuniorZavaleta/MySqlCsvExporter | src/CsvExport.php | CsvGenerator.join | public function join($table, $key_one, $operator, $key_two = null)
{
if (is_null($key_two)) {
$key_two = $operator;
$operator = '=';
}
$this->joins .= " JOIN {$table} ON {$key_one} {$operator} {$key_two} ";
return $this;
} | php | public function join($table, $key_one, $operator, $key_two = null)
{
if (is_null($key_two)) {
$key_two = $operator;
$operator = '=';
}
$this->joins .= " JOIN {$table} ON {$key_one} {$operator} {$key_two} ";
return $this;
} | [
"public",
"function",
"join",
"(",
"$",
"table",
",",
"$",
"key_one",
",",
"$",
"operator",
",",
"$",
"key_two",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key_two",
")",
")",
"{",
"$",
"key_two",
"=",
"$",
"operator",
";",
"$",
"ope... | Add a join to the query
@param string $table table to join
@param string $key_one first key
@param mixed $operator operator or second key
@param string $key_two second key if operator exists
@return CsvGenerator | [
"Add",
"a",
"join",
"to",
"the",
"query"
] | 88e67a035e2eaf3a617b0595309fe680bb62a6cb | https://github.com/JuniorZavaleta/MySqlCsvExporter/blob/88e67a035e2eaf3a617b0595309fe680bb62a6cb/src/CsvExport.php#L151-L161 |
195,817 | JuniorZavaleta/MySqlCsvExporter | src/CsvExport.php | CsvGenerator.where | public function where($field, $value, $not = false)
{
$reserverd_word = $this->with_where ? 'AND' : 'WHERE';
$operator = $not ? '!=' : '=';
$this->query .= "{$reserverd_word} {$field} {$operator} '{$value}'";
$this->with_where = true;
return $this;
} | php | public function where($field, $value, $not = false)
{
$reserverd_word = $this->with_where ? 'AND' : 'WHERE';
$operator = $not ? '!=' : '=';
$this->query .= "{$reserverd_word} {$field} {$operator} '{$value}'";
$this->with_where = true;
return $this;
} | [
"public",
"function",
"where",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"not",
"=",
"false",
")",
"{",
"$",
"reserverd_word",
"=",
"$",
"this",
"->",
"with_where",
"?",
"'AND'",
":",
"'WHERE'",
";",
"$",
"operator",
"=",
"$",
"not",
"?",
"'!... | Add a condition to the initial query
@param string $field column name
@param mixed $value value to filter
@param bool $not negation flag
@return CsvGenerator | [
"Add",
"a",
"condition",
"to",
"the",
"initial",
"query"
] | 88e67a035e2eaf3a617b0595309fe680bb62a6cb | https://github.com/JuniorZavaleta/MySqlCsvExporter/blob/88e67a035e2eaf3a617b0595309fe680bb62a6cb/src/CsvExport.php#L170-L178 |
195,818 | JuniorZavaleta/MySqlCsvExporter | src/CsvExport.php | CsvGenerator.execute | public function execute()
{
$this->columns = $this->columns ?: '*';
$query = "SELECT {$this->columns} FROM $this->table ";
if ($this->joins) {
$query .= $this->joins;
}
$query .= $this->query;
if (is_null($this->filename)) {
$this->filename ... | php | public function execute()
{
$this->columns = $this->columns ?: '*';
$query = "SELECT {$this->columns} FROM $this->table ";
if ($this->joins) {
$query .= $this->joins;
}
$query .= $this->query;
if (is_null($this->filename)) {
$this->filename ... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"this",
"->",
"columns",
"=",
"$",
"this",
"->",
"columns",
"?",
":",
"'*'",
";",
"$",
"query",
"=",
"\"SELECT {$this->columns} FROM $this->table \"",
";",
"if",
"(",
"$",
"this",
"->",
"joins",
")",
"... | Function for generate csv and return the filename
@return string filename of csv generated | [
"Function",
"for",
"generate",
"csv",
"and",
"return",
"the",
"filename"
] | 88e67a035e2eaf3a617b0595309fe680bb62a6cb | https://github.com/JuniorZavaleta/MySqlCsvExporter/blob/88e67a035e2eaf3a617b0595309fe680bb62a6cb/src/CsvExport.php#L217-L249 |
195,819 | geoffadams/bedrest-core | library/BedRest/Rest/Dispatcher.php | Dispatcher.dispatch | public function dispatch(Request $request)
{
// determine resource
$resourceParts = explode('/', $request->getResource());
$resourceName = $resourceParts[0];
$subResourceName = false;
if (count($resourceParts) > 1) {
$subResourceName = $resourceParts[1];
}... | php | public function dispatch(Request $request)
{
// determine resource
$resourceParts = explode('/', $request->getResource());
$resourceName = $resourceParts[0];
$subResourceName = false;
if (count($resourceParts) > 1) {
$subResourceName = $resourceParts[1];
}... | [
"public",
"function",
"dispatch",
"(",
"Request",
"$",
"request",
")",
"{",
"// determine resource",
"$",
"resourceParts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"request",
"->",
"getResource",
"(",
")",
")",
";",
"$",
"resourceName",
"=",
"$",
"resourceParts... | Processes a REST request, returning a Response object.
@param \BedRest\Rest\Request\Request $request
@throws \BedRest\Rest\Exception
@return \BedRest\Rest\Response\Response | [
"Processes",
"a",
"REST",
"request",
"returning",
"a",
"Response",
"object",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Rest/Dispatcher.php#L149-L185 |
195,820 | geoffadams/bedrest-core | library/BedRest/Rest/Dispatcher.php | Dispatcher.registerListeners | protected function registerListeners($service)
{
$serviceMetadata = $this->serviceMetadataFactory->getMetadataFor(get_class($service));
foreach ($serviceMetadata->getAllListeners() as $event => $listeners) {
foreach ($listeners as $listener) {
$this->eventManager->addLis... | php | protected function registerListeners($service)
{
$serviceMetadata = $this->serviceMetadataFactory->getMetadataFor(get_class($service));
foreach ($serviceMetadata->getAllListeners() as $event => $listeners) {
foreach ($listeners as $listener) {
$this->eventManager->addLis... | [
"protected",
"function",
"registerListeners",
"(",
"$",
"service",
")",
"{",
"$",
"serviceMetadata",
"=",
"$",
"this",
"->",
"serviceMetadataFactory",
"->",
"getMetadataFor",
"(",
"get_class",
"(",
"$",
"service",
")",
")",
";",
"foreach",
"(",
"$",
"serviceMe... | Registers listeners for the supplied service instance. Listeners are obtained from ServiceMetadata for
the class of the instance.
@param object $service | [
"Registers",
"listeners",
"for",
"the",
"supplied",
"service",
"instance",
".",
"Listeners",
"are",
"obtained",
"from",
"ServiceMetadata",
"for",
"the",
"class",
"of",
"the",
"instance",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Rest/Dispatcher.php#L193-L202 |
195,821 | ARCANESOFT/Auth | src/Seeds/Foundation/PermissionTableSeeder.php | PermissionTableSeeder.getUsersPermissions | private function getUsersPermissions()
{
return [
[
'name' => 'Users - List all users',
'description' => 'Allow to list all users.',
'slug' => UsersPolicy::PERMISSION_LIST,
],
[
'name' =>... | php | private function getUsersPermissions()
{
return [
[
'name' => 'Users - List all users',
'description' => 'Allow to list all users.',
'slug' => UsersPolicy::PERMISSION_LIST,
],
[
'name' =>... | [
"private",
"function",
"getUsersPermissions",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Users - List all users'",
",",
"'description'",
"=>",
"'Allow to list all users.'",
",",
"'slug'",
"=>",
"UsersPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
"[",
... | Get user's permissions seeds.
@return array | [
"Get",
"user",
"s",
"permissions",
"seeds",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/Foundation/PermissionTableSeeder.php#L72-L101 |
195,822 | ARCANESOFT/Auth | src/Seeds/Foundation/PermissionTableSeeder.php | PermissionTableSeeder.getRolesPermissions | private function getRolesPermissions()
{
return [
[
'name' => 'Roles - List all roles',
'description' => 'Allow to list all roles.',
'slug' => RolesPolicy::PERMISSION_LIST,
],
[
'name' =>... | php | private function getRolesPermissions()
{
return [
[
'name' => 'Roles - List all roles',
'description' => 'Allow to list all roles.',
'slug' => RolesPolicy::PERMISSION_LIST,
],
[
'name' =>... | [
"private",
"function",
"getRolesPermissions",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Roles - List all roles'",
",",
"'description'",
"=>",
"'Allow to list all roles.'",
",",
"'slug'",
"=>",
"RolesPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
"[",
... | Get role's permissions seeds.
@return array | [
"Get",
"role",
"s",
"permissions",
"seeds",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/Foundation/PermissionTableSeeder.php#L108-L137 |
195,823 | stevenliebregt/crispysystem | src/Routing/Router.php | Router.getRouteByName | public static function getRouteByName(string $name) : Route
{
foreach (static::$routes as $routes) {
/** @var Route $route */
foreach ($routes as $route) {
if ($route->getName() === $name) {
return $route;
}
}
}
... | php | public static function getRouteByName(string $name) : Route
{
foreach (static::$routes as $routes) {
/** @var Route $route */
foreach ($routes as $route) {
if ($route->getName() === $name) {
return $route;
}
}
}
... | [
"public",
"static",
"function",
"getRouteByName",
"(",
"string",
"$",
"name",
")",
":",
"Route",
"{",
"foreach",
"(",
"static",
"::",
"$",
"routes",
"as",
"$",
"routes",
")",
"{",
"/** @var Route $route */",
"foreach",
"(",
"$",
"routes",
"as",
"$",
"route... | Tries to fetch a route by name, returns null if it doesn't exist
@param string $name
@return null|Route
@since 1.0.0 | [
"Tries",
"to",
"fetch",
"a",
"route",
"by",
"name",
"returns",
"null",
"if",
"it",
"doesn",
"t",
"exist"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Routing/Router.php#L178-L190 |
195,824 | siriusSupreme/sirius-container | src/Container.php | Container.getAlias | public function getAlias($abstract)
{
if (! isset($this->aliases[$abstract])) {
return $abstract;
}
if ($this->aliases[$abstract] === $abstract) {
throw new LogicException("[{$abstract}] is aliased to itself.");
}
return $this->getAlias($this->aliase... | php | public function getAlias($abstract)
{
if (! isset($this->aliases[$abstract])) {
return $abstract;
}
if ($this->aliases[$abstract] === $abstract) {
throw new LogicException("[{$abstract}] is aliased to itself.");
}
return $this->getAlias($this->aliase... | [
"public",
"function",
"getAlias",
"(",
"$",
"abstract",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"abstract",
"]",
")",
")",
"{",
"return",
"$",
"abstract",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"aliases",
... | Get the alias for an abstract if available.
@param string $abstract
@return string
@throws \LogicException | [
"Get",
"the",
"alias",
"for",
"an",
"abstract",
"if",
"available",
"."
] | a9ca7770c5ddfca7b109bc87bac40f00bea3ef0a | https://github.com/siriusSupreme/sirius-container/blob/a9ca7770c5ddfca7b109bc87bac40f00bea3ef0a/src/Container.php#L1071-L1082 |
195,825 | ezra-obiwale/dSCore | src/Core/Request.php | Request.initServer | private function initServer() {
$this->http = new Object();
$this->server = new Object();
foreach ($_SERVER as $key => $val) {
$key = str_replace('request_', '', strtolower($key));
if (substr($key, 0, 5) === 'http_') {
$this->http->{Util::_toCamel(substr(... | php | private function initServer() {
$this->http = new Object();
$this->server = new Object();
foreach ($_SERVER as $key => $val) {
$key = str_replace('request_', '', strtolower($key));
if (substr($key, 0, 5) === 'http_') {
$this->http->{Util::_toCamel(substr(... | [
"private",
"function",
"initServer",
"(",
")",
"{",
"$",
"this",
"->",
"http",
"=",
"new",
"Object",
"(",
")",
";",
"$",
"this",
"->",
"server",
"=",
"new",
"Object",
"(",
")",
";",
"foreach",
"(",
"$",
"_SERVER",
"as",
"$",
"key",
"=>",
"$",
"va... | initializes server values | [
"initializes",
"server",
"values"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Request.php#L76-L92 |
195,826 | ezra-obiwale/dSCore | src/Core/Request.php | Request.isAjax | public function isAjax() {
return (isset($this->http->xRequestedWith) && $this->http->xRequestedWith = 'XMLHttpRequest' ||
isset($this->http->requestedWith) && $this->http->requestedWith = 'XMLHttpRequest');
} | php | public function isAjax() {
return (isset($this->http->xRequestedWith) && $this->http->xRequestedWith = 'XMLHttpRequest' ||
isset($this->http->requestedWith) && $this->http->requestedWith = 'XMLHttpRequest');
} | [
"public",
"function",
"isAjax",
"(",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"http",
"->",
"xRequestedWith",
")",
"&&",
"$",
"this",
"->",
"http",
"->",
"xRequestedWith",
"=",
"'XMLHttpRequest'",
"||",
"isset",
"(",
"$",
"this",
"->",
... | Checks if the request is an ajax
@return boolean | [
"Checks",
"if",
"the",
"request",
"is",
"an",
"ajax"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Request.php#L106-L109 |
195,827 | Tapakan/Path | src/Path.php | Path.getInstance | public static function getInstance($id = 'default')
{
if (!isset(static::$instances[$id])) {
static::$instances[$id] = new self();
}
return static::$instances[$id];
} | php | public static function getInstance($id = 'default')
{
if (!isset(static::$instances[$id])) {
static::$instances[$id] = new self();
}
return static::$instances[$id];
} | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"id",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"instances",
"[",
"$",
"id",
"]",
")",
")",
"{",
"static",
"::",
"$",
"instances",
"[",
"$",
"id",
"]",
... | If identifier exists it will be return instance,
if not new instance will create.
@param mixed $id Identifier of instance.
@return Path | [
"If",
"identifier",
"exists",
"it",
"will",
"be",
"return",
"instance",
"if",
"not",
"new",
"instance",
"will",
"create",
"."
] | 07e39d605de3f4b81a3e9314c3b211371a0a3fda | https://github.com/Tapakan/Path/blob/07e39d605de3f4b81a3e9314c3b211371a0a3fda/src/Path.php#L48-L55 |
195,828 | Tapakan/Path | src/Path.php | Path.path | public function path($path)
{
$path = strtolower(trim($path));
$first = substr($path, 0, 1);
if ($first == '@' && isset($this->aliases[$path])) {
$path = $this->aliases[$path];
} elseif ($first == '/') {
$path = preg_replace('/\\//', $th... | php | public function path($path)
{
$path = strtolower(trim($path));
$first = substr($path, 0, 1);
if ($first == '@' && isset($this->aliases[$path])) {
$path = $this->aliases[$path];
} elseif ($first == '/') {
$path = preg_replace('/\\//', $th... | [
"public",
"function",
"path",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"strtolower",
"(",
"trim",
"(",
"$",
"path",
")",
")",
";",
"$",
"first",
"=",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"1",
")",
";",
"if",
"(",
"$",
"first",
"=="... | Translate path alias into a actual path or build path.
Return absolute path.
@param string $path Path to the file
@return mixed|string | [
"Translate",
"path",
"alias",
"into",
"a",
"actual",
"path",
"or",
"build",
"path",
".",
"Return",
"absolute",
"path",
"."
] | 07e39d605de3f4b81a3e9314c3b211371a0a3fda | https://github.com/Tapakan/Path/blob/07e39d605de3f4b81a3e9314c3b211371a0a3fda/src/Path.php#L96-L113 |
195,829 | Kris-Kuiper/sFire-Framework | src/Utils/NameConvert.php | NameConvert.toCamelcase | public static function toCamelcase($string, $capitalizeFirstCharacter = false) {
if(false === is_string($string)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($string)), E_USER_ERROR);
}
if(false === is_bool($capitalizeFirstChara... | php | public static function toCamelcase($string, $capitalizeFirstCharacter = false) {
if(false === is_string($string)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($string)), E_USER_ERROR);
}
if(false === is_bool($capitalizeFirstChara... | [
"public",
"static",
"function",
"toCamelcase",
"(",
"$",
"string",
",",
"$",
"capitalizeFirstCharacter",
"=",
"false",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Ar... | Converts string underscores to camelCase
@param string $string
@param boolean $capitalizeFirstCharacter
@return string | [
"Converts",
"string",
"underscores",
"to",
"camelCase"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/NameConvert.php#L20-L37 |
195,830 | Kris-Kuiper/sFire-Framework | src/Utils/NameConvert.php | NameConvert.toSnakecase | public static function toSnakecase($string) {
if(false === is_string($string)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($string)), E_USER_ERROR);
}
return ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $stri... | php | public static function toSnakecase($string) {
if(false === is_string($string)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($string)), E_USER_ERROR);
}
return ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $stri... | [
"public",
"static",
"function",
"toSnakecase",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" giv... | Converts string camelcase to snakecase
@param string $string
@return string | [
"Converts",
"string",
"camelcase",
"to",
"snakecase"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Utils/NameConvert.php#L45-L52 |
195,831 | codeblanche/Web | src/Web/Request/Request.php | Request.resolveValue | protected function resolveValue($name, &$source = null, $sanitize = true, $array = false)
{
$result = $array ? array() : null;
if (empty($name)) {
$result = $source;
}
elseif (isset($source[$name])) {
$result = $source[$name];
}
if (!$sanitiz... | php | protected function resolveValue($name, &$source = null, $sanitize = true, $array = false)
{
$result = $array ? array() : null;
if (empty($name)) {
$result = $source;
}
elseif (isset($source[$name])) {
$result = $source[$name];
}
if (!$sanitiz... | [
"protected",
"function",
"resolveValue",
"(",
"$",
"name",
",",
"&",
"$",
"source",
"=",
"null",
",",
"$",
"sanitize",
"=",
"true",
",",
"$",
"array",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"$",
"array",
"?",
"array",
"(",
")",
":",
"null",
... | Resolve a value from the given collection.
@param string $name
@param array $source
@param bool $sanitize
@param bool $array
@return mixed | [
"Resolve",
"a",
"value",
"from",
"the",
"given",
"collection",
"."
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L79-L116 |
195,832 | codeblanche/Web | src/Web/Request/Request.php | Request.setRequestOrder | public function setRequestOrder($requestOrder)
{
if (!is_string($requestOrder)) {
throw new InvalidArgumentException('Expected requestOrder to be a string');
}
if (empty($requestOrder)) {
throw new InvalidArgumentException('An empty string is not a valid requestOrder... | php | public function setRequestOrder($requestOrder)
{
if (!is_string($requestOrder)) {
throw new InvalidArgumentException('Expected requestOrder to be a string');
}
if (empty($requestOrder)) {
throw new InvalidArgumentException('An empty string is not a valid requestOrder... | [
"public",
"function",
"setRequestOrder",
"(",
"$",
"requestOrder",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"requestOrder",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Expected requestOrder to be a string'",
")",
";",
"}",
"if",
"("... | Set the request order.
@param string $requestOrder The order in which to check request collections for a value. [G = GET, P = POST, C = COOKIE, S = SESSION, E = ENV, H = SERVER]
@throws InvalidArgumentException | [
"Set",
"the",
"request",
"order",
"."
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L125-L136 |
195,833 | codeblanche/Web | src/Web/Request/Request.php | Request.value | public function value($name)
{
if (empty($this->requestOrder)) {
throw new RuntimeException('Unable to determine the request order');
}
$result = null;
foreach ($this->requestOrder as $token) {
$method = $this->resolveRequestOrderMethod($token);
... | php | public function value($name)
{
if (empty($this->requestOrder)) {
throw new RuntimeException('Unable to determine the request order');
}
$result = null;
foreach ($this->requestOrder as $token) {
$method = $this->resolveRequestOrderMethod($token);
... | [
"public",
"function",
"value",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"requestOrder",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'Unable to determine the request order'",
")",
";",
"}",
"$",
"result",
"=",
"nu... | Retrieve a value using the configured request order
@param string $name
@return mixed
@throws RuntimeException | [
"Retrieve",
"a",
"value",
"using",
"the",
"configured",
"request",
"order"
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L146-L169 |
195,834 | codeblanche/Web | src/Web/Request/Request.php | Request.files | public function files($name, $sanitize = true)
{
return $this->resolveValue($name, $_FILES, $sanitize, true);
} | php | public function files($name, $sanitize = true)
{
return $this->resolveValue($name, $_FILES, $sanitize, true);
} | [
"public",
"function",
"files",
"(",
"$",
"name",
",",
"$",
"sanitize",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"resolveValue",
"(",
"$",
"name",
",",
"$",
"_FILES",
",",
"$",
"sanitize",
",",
"true",
")",
";",
"}"
] | Retrieve the the date associated with a file upload
@param string $name
@param bool $sanitize
@return array | [
"Retrieve",
"the",
"the",
"date",
"associated",
"with",
"a",
"file",
"upload"
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L222-L225 |
195,835 | codeblanche/Web | src/Web/Request/Request.php | Request.put | public function put($source = 'php://input', $sanitize = true)
{
if (is_null($source)) {
$source = 'php://input';
}
$source = @fopen($source, 'r');
if (!is_resource($source)) {
throw new InvalidArgumentException('Expected parameter 1 to be an open-able resou... | php | public function put($source = 'php://input', $sanitize = true)
{
if (is_null($source)) {
$source = 'php://input';
}
$source = @fopen($source, 'r');
if (!is_resource($source)) {
throw new InvalidArgumentException('Expected parameter 1 to be an open-able resou... | [
"public",
"function",
"put",
"(",
"$",
"source",
"=",
"'php://input'",
",",
"$",
"sanitize",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"source",
")",
")",
"{",
"$",
"source",
"=",
"'php://input'",
";",
"}",
"$",
"source",
"=",
"@",
"fo... | Retrieve date from the input stream
@param string $source (Default: 'php://input')
@param bool $sanitize
@throws \InvalidArgumentException
@return mixed | [
"Retrieve",
"date",
"from",
"the",
"input",
"stream"
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L236-L257 |
195,836 | codeblanche/Web | src/Web/Request/Request.php | Request.domain | public function domain($maxLevels = 0)
{
$parts = explode('.', $this->uri()->getHost());
return implode('.', array_slice($parts, -1 * $maxLevels));
} | php | public function domain($maxLevels = 0)
{
$parts = explode('.', $this->uri()->getHost());
return implode('.', array_slice($parts, -1 * $maxLevels));
} | [
"public",
"function",
"domain",
"(",
"$",
"maxLevels",
"=",
"0",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"uri",
"(",
")",
"->",
"getHost",
"(",
")",
")",
";",
"return",
"implode",
"(",
"'.'",
",",
"array_slice",
... | Retrieve the current domain
@param int $maxLevels Trim the domain to max levels
@return string | [
"Retrieve",
"the",
"current",
"domain"
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L313-L318 |
195,837 | codeblanche/Web | src/Web/Request/Request.php | Request.protocol | public function protocol($raw = false)
{
if ($raw) {
return $this->server('SERVER_PROTOCOL');
}
$parts = explode('/', $this->server('SERVER_PROTOCOL'));
return strtolower(array_shift($parts)) . $this->server('HTTPS') === 'on' ? 's' : '';
} | php | public function protocol($raw = false)
{
if ($raw) {
return $this->server('SERVER_PROTOCOL');
}
$parts = explode('/', $this->server('SERVER_PROTOCOL'));
return strtolower(array_shift($parts)) . $this->server('HTTPS') === 'on' ? 's' : '';
} | [
"public",
"function",
"protocol",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"raw",
")",
"{",
"return",
"$",
"this",
"->",
"server",
"(",
"'SERVER_PROTOCOL'",
")",
";",
"}",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"this",
... | Retrieve the requests protocol
@param bool $raw Also return protocol version if available
@return string | [
"Retrieve",
"the",
"requests",
"protocol"
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Request/Request.php#L327-L336 |
195,838 | n2n/n2n-io | src/app/n2n/io/IoUtils.php | IoUtils.determineFileUploadMaxSize | public static function determineFileUploadMaxSize() {
static $maxSize = -1;
if ($maxSize < 0) {
// Start with post_max_size.
$maxSize = self::parsePhpIniSize(ini_get('post_max_size'));
// If upload_max_size is less, then reduce. Except if upload_max_size is
// zero, which indicates no limit.... | php | public static function determineFileUploadMaxSize() {
static $maxSize = -1;
if ($maxSize < 0) {
// Start with post_max_size.
$maxSize = self::parsePhpIniSize(ini_get('post_max_size'));
// If upload_max_size is less, then reduce. Except if upload_max_size is
// zero, which indicates no limit.... | [
"public",
"static",
"function",
"determineFileUploadMaxSize",
"(",
")",
"{",
"static",
"$",
"maxSize",
"=",
"-",
"1",
";",
"if",
"(",
"$",
"maxSize",
"<",
"0",
")",
"{",
"// Start with post_max_size.\r",
"$",
"maxSize",
"=",
"self",
"::",
"parsePhpIniSize",
... | Returns a file size limit in bytes based on the PHP upload_max_filesize
and post_max_size
@return int | [
"Returns",
"a",
"file",
"size",
"limit",
"in",
"bytes",
"based",
"on",
"the",
"PHP",
"upload_max_filesize",
"and",
"post_max_size"
] | ff642e195f0c0db1273b6c067eff1192cf2cd987 | https://github.com/n2n/n2n-io/blob/ff642e195f0c0db1273b6c067eff1192cf2cd987/src/app/n2n/io/IoUtils.php#L635-L650 |
195,839 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.getView | public function getView()
{
// If we don't have a prefix, just return the view.
if (is_null($this->prefix)) {
return $this->getBaseView();
}
// Set up modifiable variables.
$view = $this->concatViewAndPrefix($this->prefix, $this->view);
$prefixes = cl... | php | public function getView()
{
// If we don't have a prefix, just return the view.
if (is_null($this->prefix)) {
return $this->getBaseView();
}
// Set up modifiable variables.
$view = $this->concatViewAndPrefix($this->prefix, $this->view);
$prefixes = cl... | [
"public",
"function",
"getView",
"(",
")",
"{",
"// If we don't have a prefix, just return the view.",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"prefix",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getBaseView",
"(",
")",
";",
"}",
"// Set up modifiable va... | Find the most reasonable view available.
@return null | [
"Find",
"the",
"most",
"reasonable",
"view",
"available",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L75-L114 |
195,840 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.parseController | protected function parseController($class)
{
$controller = new ReflectionClass($class);
$this->fullController = $controller->name;
$class = $controller->getShortName();
$this->controller = strtolower(str_replace('Controller', '', $class));
} | php | protected function parseController($class)
{
$controller = new ReflectionClass($class);
$this->fullController = $controller->name;
$class = $controller->getShortName();
$this->controller = strtolower(str_replace('Controller', '', $class));
} | [
"protected",
"function",
"parseController",
"(",
"$",
"class",
")",
"{",
"$",
"controller",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"this",
"->",
"fullController",
"=",
"$",
"controller",
"->",
"name",
";",
"$",
"class",
"=",
"$"... | Get a properly formatted controller name.
@param string $class
@return string | [
"Get",
"a",
"properly",
"formatted",
"controller",
"name",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L150-L156 |
195,841 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.parseAction | protected function parseAction($action)
{
if ($action === $this->fullController) {
return $this->action = null;
}
$this->action = strtolower(
preg_replace(['/^get/', '/^post/', '/^put/', '/^patch/', '/^delete/'], '', $action)
);
} | php | protected function parseAction($action)
{
if ($action === $this->fullController) {
return $this->action = null;
}
$this->action = strtolower(
preg_replace(['/^get/', '/^post/', '/^put/', '/^patch/', '/^delete/'], '', $action)
);
} | [
"protected",
"function",
"parseAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"$",
"action",
"===",
"$",
"this",
"->",
"fullController",
")",
"{",
"return",
"$",
"this",
"->",
"action",
"=",
"null",
";",
"}",
"$",
"this",
"->",
"action",
"=",
"str... | Get a properly formatted action name.
@param string $action
@return string | [
"Get",
"a",
"properly",
"formatted",
"action",
"name",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L165-L174 |
195,842 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.getPrefixes | protected function getPrefixes()
{
$router = app(\Illuminate\Routing\Router::class);
$this->prefixes = collect(
explode('/', $router->getCurrentRoute()->getPrefix())
);
// Remove the last prefix if it matches the controller.
$this->prefixes = $this->removeContro... | php | protected function getPrefixes()
{
$router = app(\Illuminate\Routing\Router::class);
$this->prefixes = collect(
explode('/', $router->getCurrentRoute()->getPrefix())
);
// Remove the last prefix if it matches the controller.
$this->prefixes = $this->removeContro... | [
"protected",
"function",
"getPrefixes",
"(",
")",
"{",
"$",
"router",
"=",
"app",
"(",
"\\",
"Illuminate",
"\\",
"Routing",
"\\",
"Router",
"::",
"class",
")",
";",
"$",
"this",
"->",
"prefixes",
"=",
"collect",
"(",
"explode",
"(",
"'/'",
",",
"$",
... | Search for any prefixes attached to this route.
@return string | [
"Search",
"for",
"any",
"prefixes",
"attached",
"to",
"this",
"route",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L181-L195 |
195,843 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.setView | protected function setView()
{
$views = [
$this->controller,
$this->action,
];
$this->view = implode('.', array_filter($views));
} | php | protected function setView()
{
$views = [
$this->controller,
$this->action,
];
$this->view = implode('.', array_filter($views));
} | [
"protected",
"function",
"setView",
"(",
")",
"{",
"$",
"views",
"=",
"[",
"$",
"this",
"->",
"controller",
",",
"$",
"this",
"->",
"action",
",",
"]",
";",
"$",
"this",
"->",
"view",
"=",
"implode",
"(",
"'.'",
",",
"array_filter",
"(",
"$",
"view... | Combine the controller and action to create a proper view string. | [
"Combine",
"the",
"controller",
"and",
"action",
"to",
"create",
"a",
"proper",
"view",
"string",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L216-L224 |
195,844 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.getBaseView | private function getBaseView()
{
$this->attempted($this->view);
return view()->exists($this->view) ? $this->view : null;
} | php | private function getBaseView()
{
$this->attempted($this->view);
return view()->exists($this->view) ? $this->view : null;
} | [
"private",
"function",
"getBaseView",
"(",
")",
"{",
"$",
"this",
"->",
"attempted",
"(",
"$",
"this",
"->",
"view",
")",
";",
"return",
"view",
"(",
")",
"->",
"exists",
"(",
"$",
"this",
"->",
"view",
")",
"?",
"$",
"this",
"->",
"view",
":",
"... | Return the base view if it exists.
@return null|string | [
"Return",
"the",
"base",
"view",
"if",
"it",
"exists",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L231-L236 |
195,845 | NukaCode/core | src/NukaCode/Core/View/Models/ViewModel.php | ViewModel.checkConfig | public function checkConfig()
{
$views = [
$this->fullController,
$this->action,
];
$this->configIndex = implode('.', array_filter($views));
return array_get(config('view-routing'), $this->configIndex);
} | php | public function checkConfig()
{
$views = [
$this->fullController,
$this->action,
];
$this->configIndex = implode('.', array_filter($views));
return array_get(config('view-routing'), $this->configIndex);
} | [
"public",
"function",
"checkConfig",
"(",
")",
"{",
"$",
"views",
"=",
"[",
"$",
"this",
"->",
"fullController",
",",
"$",
"this",
"->",
"action",
",",
"]",
";",
"$",
"this",
"->",
"configIndex",
"=",
"implode",
"(",
"'.'",
",",
"array_filter",
"(",
... | Check the view routing config for the controller and method.
@return null|string | [
"Check",
"the",
"view",
"routing",
"config",
"for",
"the",
"controller",
"and",
"method",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/Models/ViewModel.php#L243-L253 |
195,846 | jenskooij/cloudcontrol | src/util/GlobalFunctions.php | GlobalFunctions.sanitizeOutput | public static function sanitizeOutput($buffer)
{
if (!isset($_GET['unsanitized'])) {
$search = array(
'/\>[^\S ]+/s', // strip whitespaces after tags, except space
'/[^\S ]+\</s', // strip whitespaces before tags, except space
'/(\s)+/s', ... | php | public static function sanitizeOutput($buffer)
{
if (!isset($_GET['unsanitized'])) {
$search = array(
'/\>[^\S ]+/s', // strip whitespaces after tags, except space
'/[^\S ]+\</s', // strip whitespaces before tags, except space
'/(\s)+/s', ... | [
"public",
"static",
"function",
"sanitizeOutput",
"(",
"$",
"buffer",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"'unsanitized'",
"]",
")",
")",
"{",
"$",
"search",
"=",
"array",
"(",
"'/\\>[^\\S ]+/s'",
",",
"// strip whitespaces after tags, ... | Minify the html for the outputbuffer
@param $buffer
@return mixed | [
"Minify",
"the",
"html",
"for",
"the",
"outputbuffer"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/GlobalFunctions.php#L61-L84 |
195,847 | gregorybesson/PlaygroundTemplateHint | src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php | PhpRendererHint.resolver | public function resolver($name = null)
{
if (null === $this->__templateResolver) {
$this->setResolver(new TemplatePathStack());
}
if (null !== $name) {
$viewPath = $this->__templateResolver->resolve($name, $this);
//echo $viewPath. "<br>";
return $t... | php | public function resolver($name = null)
{
if (null === $this->__templateResolver) {
$this->setResolver(new TemplatePathStack());
}
if (null !== $name) {
$viewPath = $this->__templateResolver->resolve($name, $this);
//echo $viewPath. "<br>";
return $t... | [
"public",
"function",
"resolver",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"__templateResolver",
")",
"{",
"$",
"this",
"->",
"setResolver",
"(",
"new",
"TemplatePathStack",
"(",
")",
")",
";",
"}",
"if",
... | Retrieve template name or template resolver
@param null|string $name
@return string|Resolver | [
"Retrieve",
"template",
"name",
"or",
"template",
"resolver"
] | dc4a342c86469d18976635a0b3c32d1fb651fc4f | https://github.com/gregorybesson/PlaygroundTemplateHint/blob/dc4a342c86469d18976635a0b3c32d1fb651fc4f/src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php#L145-L158 |
195,848 | gregorybesson/PlaygroundTemplateHint | src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php | PhpRendererHint.setVars | public function setVars($variables)
{
if (!is_array($variables) && !$variables instanceof ArrayAccess) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or ArrayAccess object; received "%s"',
(is_object($variables) ? get_class($variables) : g... | php | public function setVars($variables)
{
if (!is_array($variables) && !$variables instanceof ArrayAccess) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or ArrayAccess object; received "%s"',
(is_object($variables) ? get_class($variables) : g... | [
"public",
"function",
"setVars",
"(",
"$",
"variables",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"variables",
")",
"&&",
"!",
"$",
"variables",
"instanceof",
"ArrayAccess",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
... | Set variable storage
Expects either an array, or an object implementing ArrayAccess.
@param array|ArrayAccess $variables
@return PhpRenderer
@throws Exception\InvalidArgumentException | [
"Set",
"variable",
"storage"
] | dc4a342c86469d18976635a0b3c32d1fb651fc4f | https://github.com/gregorybesson/PlaygroundTemplateHint/blob/dc4a342c86469d18976635a0b3c32d1fb651fc4f/src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php#L169-L189 |
195,849 | gregorybesson/PlaygroundTemplateHint | src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php | PhpRendererHint.vars | public function vars($key = null)
{
if (null === $this->__vars) {
$this->setVars(new Variables());
}
if (null === $key) {
return $this->__vars;
}
return $this->__vars[$key];
} | php | public function vars($key = null)
{
if (null === $this->__vars) {
$this->setVars(new Variables());
}
if (null === $key) {
return $this->__vars;
}
return $this->__vars[$key];
} | [
"public",
"function",
"vars",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"__vars",
")",
"{",
"$",
"this",
"->",
"setVars",
"(",
"new",
"Variables",
"(",
")",
")",
";",
"}",
"if",
"(",
"null",
"===",
"$"... | Get a single variable, or all variables
@param mixed $key
@return mixed | [
"Get",
"a",
"single",
"variable",
"or",
"all",
"variables"
] | dc4a342c86469d18976635a0b3c32d1fb651fc4f | https://github.com/gregorybesson/PlaygroundTemplateHint/blob/dc4a342c86469d18976635a0b3c32d1fb651fc4f/src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php#L197-L207 |
195,850 | gregorybesson/PlaygroundTemplateHint | src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php | PhpRendererHint.get | public function get($key)
{
if (null === $this->__vars) {
$this->setVars(new Variables());
}
return $this->__vars[$key];
} | php | public function get($key)
{
if (null === $this->__vars) {
$this->setVars(new Variables());
}
return $this->__vars[$key];
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"__vars",
")",
"{",
"$",
"this",
"->",
"setVars",
"(",
"new",
"Variables",
"(",
")",
")",
";",
"}",
"return",
"$",
"this",
"->",
"__vars",
"[",
... | Get a single variable
@param mixed $key
@return mixed | [
"Get",
"a",
"single",
"variable"
] | dc4a342c86469d18976635a0b3c32d1fb651fc4f | https://github.com/gregorybesson/PlaygroundTemplateHint/blob/dc4a342c86469d18976635a0b3c32d1fb651fc4f/src/PlaygroundTemplateHint/View/Renderer/PhpRendererHint.php#L215-L222 |
195,851 | arendjantetteroo/guzzle-addons-mozilla | src/AJT/MozillaAddons/MozillaAddonsClient.php | MozillaAddonsClient.factory | public static function factory($config = array())
{
$default = array(
'base_url' => 'https://addons.mozilla.org/nl/firefox/addon/',
'debug' => false
);
$required = array('base_url', 'app_name');
$config = Collection::fromConfig($config, $default, $required);
... | php | public static function factory($config = array())
{
$default = array(
'base_url' => 'https://addons.mozilla.org/nl/firefox/addon/',
'debug' => false
);
$required = array('base_url', 'app_name');
$config = Collection::fromConfig($config, $default, $required);
... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'base_url'",
"=>",
"'https://addons.mozilla.org/nl/firefox/addon/'",
",",
"'debug'",
"=>",
"false",
")",
";",
"$",
"required",
... | Factory method to create a new MozillaAddonsClient
The following array keys and values are available options:
- base_url: Base URL of web service
@param array|Collection $config Configuration data
@return MozillaAddonsClient | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"MozillaAddonsClient"
] | 7ec7dc464e421ac4c5cbb94a3d4453e30b13e888 | https://github.com/arendjantetteroo/guzzle-addons-mozilla/blob/7ec7dc464e421ac4c5cbb94a3d4453e30b13e888/src/AJT/MozillaAddons/MozillaAddonsClient.php#L40-L58 |
195,852 | Torann/skosh-generator | src/Event.php | Event.insert | public static function insert($name, $callback, $once = false)
{
if (static::bound($name))
{
array_unshift(
static::$events[$name],
[$once ? 'once' : 'always' => $callback]
);
}
else {
static::bind($name, $callback, ... | php | public static function insert($name, $callback, $once = false)
{
if (static::bound($name))
{
array_unshift(
static::$events[$name],
[$once ? 'once' : 'always' => $callback]
);
}
else {
static::bind($name, $callback, ... | [
"public",
"static",
"function",
"insert",
"(",
"$",
"name",
",",
"$",
"callback",
",",
"$",
"once",
"=",
"false",
")",
"{",
"if",
"(",
"static",
"::",
"bound",
"(",
"$",
"name",
")",
")",
"{",
"array_unshift",
"(",
"static",
"::",
"$",
"events",
"[... | Identical to the append method, except the event handler is
added to the start of the queue.
@param string $name The name of the event.
@param mixed $callback The callback function.
@param bool $once Only fire the callback once.
@return void | [
"Identical",
"to",
"the",
"append",
"method",
"except",
"the",
"event",
"handler",
"is",
"added",
"to",
"the",
"start",
"of",
"the",
"queue",
"."
] | ea60e037d92398d7c146eb2349735d5692e3c48c | https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Event.php#L52-L64 |
195,853 | Torann/skosh-generator | src/Event.php | Event.fire | public static function fire($name, $data = [], $stop = false)
{
if (static::bound($name))
{
static::$fired[$name] = true;
foreach (static::$events[$name] as $key => $value)
{
list($type, $callback) = each($value);
// Call back is ... | php | public static function fire($name, $data = [], $stop = false)
{
if (static::bound($name))
{
static::$fired[$name] = true;
foreach (static::$events[$name] as $key => $value)
{
list($type, $callback) = each($value);
// Call back is ... | [
"public",
"static",
"function",
"fire",
"(",
"$",
"name",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"stop",
"=",
"false",
")",
"{",
"if",
"(",
"static",
"::",
"bound",
"(",
"$",
"name",
")",
")",
"{",
"static",
"::",
"$",
"fired",
"[",
"$",
... | Trigger all callback functions for an event.
The method returns an array containing the responses from all
of the event handlers (even empty responses).
Returns NULL if the event has no handlers.
@param string $name The name of the event.
@param array $data The data passed to the event handlers.
@param bool $s... | [
"Trigger",
"all",
"callback",
"functions",
"for",
"an",
"event",
"."
] | ea60e037d92398d7c146eb2349735d5692e3c48c | https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Event.php#L79-L108 |
195,854 | Vectrex/vxPHP | src/Database/Adapter/Pgsql.php | Pgsql.setDefaultConnectionAttributes | protected function setDefaultConnectionAttributes() {
$config = Application::getInstance()->getConfig();
$options = [
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_STRINGIFY_FETCHES => false
... | php | protected function setDefaultConnectionAttributes() {
$config = Application::getInstance()->getConfig();
$options = [
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_STRINGIFY_FETCHES => false
... | [
"protected",
"function",
"setDefaultConnectionAttributes",
"(",
")",
"{",
"$",
"config",
"=",
"Application",
"::",
"getInstance",
"(",
")",
"->",
"getConfig",
"(",
")",
";",
"$",
"options",
"=",
"[",
"\\",
"PDO",
"::",
"ATTR_ERRMODE",
"=>",
"\\",
"PDO",
":... | set initial attributes for database connection | [
"set",
"initial",
"attributes",
"for",
"database",
"connection"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Database/Adapter/Pgsql.php#L151-L171 |
195,855 | itcreator/custom-cmf | Module/Component/src/Cmf/Component/Grid/Table/Rows/A.php | A.current | public function current()
{
return isset($this->rows[$this->rowsCounter]) ? $this->rows[$this->rowsCounter] : false;
} | php | public function current()
{
return isset($this->rows[$this->rowsCounter]) ? $this->rows[$this->rowsCounter] : false;
} | [
"public",
"function",
"current",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"rows",
"[",
"$",
"this",
"->",
"rowsCounter",
"]",
")",
"?",
"$",
"this",
"->",
"rows",
"[",
"$",
"this",
"->",
"rowsCounter",
"]",
":",
"false",
";",
"}"
] | This method return current row
@return \Cmf\Component\Grid\Table\Row\A | [
"This",
"method",
"return",
"current",
"row"
] | 42fc0535dfa0f641856f06673f6ab596b2020c40 | https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Component/src/Cmf/Component/Grid/Table/Rows/A.php#L78-L81 |
195,856 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Iterator/PagingIterator.php | PagingIterator.appendPage | private function appendPage()
{
$result = $this->executeNextSdkCommand();
$iterator = $this->commands->parseResult($result, $this->hydrationMode, $this->refresh, $this->readOnly, $this->primers);
$this->getInnerIterator()->append($iterator);
if ($result instanceof SdkResultIterat... | php | private function appendPage()
{
$result = $this->executeNextSdkCommand();
$iterator = $this->commands->parseResult($result, $this->hydrationMode, $this->refresh, $this->readOnly, $this->primers);
$this->getInnerIterator()->append($iterator);
if ($result instanceof SdkResultIterat... | [
"private",
"function",
"appendPage",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"executeNextSdkCommand",
"(",
")",
";",
"$",
"iterator",
"=",
"$",
"this",
"->",
"commands",
"->",
"parseResult",
"(",
"$",
"result",
",",
"$",
"this",
"->",
"hy... | Get a result page and populate the inner iterator.
@return void | [
"Get",
"a",
"result",
"page",
"and",
"populate",
"the",
"inner",
"iterator",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Iterator/PagingIterator.php#L96-L118 |
195,857 | Kris-Kuiper/sFire-Framework | src/Handler/ErrorHandler.php | ErrorHandler.setOptions | public function setOptions($options = []) {
if(false === is_array($options)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($options)), E_USER_ERROR);
}
$this -> options = array_merge($this -> options, $options);
} | php | public function setOptions($options = []) {
if(false === is_array($options)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($options)), E_USER_ERROR);
}
$this -> options = array_merge($this -> options, $options);
} | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"options",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"... | Set debug options
@param array $options | [
"Set",
"debug",
"options"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Handler/ErrorHandler.php#L124-L131 |
195,858 | Kris-Kuiper/sFire-Framework | src/Handler/ErrorHandler.php | ErrorHandler.action | private function action() {
$options = (object) $this -> options;
if(true === $options -> write) {
$this -> writeToFile();
}
if(true == $options -> display) {
return $this -> displayError();
}
exit();
} | php | private function action() {
$options = (object) $this -> options;
if(true === $options -> write) {
$this -> writeToFile();
}
if(true == $options -> display) {
return $this -> displayError();
}
exit();
} | [
"private",
"function",
"action",
"(",
")",
"{",
"$",
"options",
"=",
"(",
"object",
")",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"true",
"===",
"$",
"options",
"->",
"write",
")",
"{",
"$",
"this",
"->",
"writeToFile",
"(",
")",
";",
"}",
"... | Determines what to do with the error | [
"Determines",
"what",
"to",
"do",
"with",
"the",
"error"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Handler/ErrorHandler.php#L137-L150 |
195,859 | Kris-Kuiper/sFire-Framework | src/Handler/ErrorHandler.php | ErrorHandler.writeToFile | private function writeToFile() {
$logger = $this -> getLogger();
$logger -> setDirectory(Path :: get('log-error'));
$error = $this -> error -> toJson($this -> options['types']);
if(false === $error) {
$this -> error -> setContext(null);
$this -> error -> setBacktrace(null);
}
$error ... | php | private function writeToFile() {
$logger = $this -> getLogger();
$logger -> setDirectory(Path :: get('log-error'));
$error = $this -> error -> toJson($this -> options['types']);
if(false === $error) {
$this -> error -> setContext(null);
$this -> error -> setBacktrace(null);
}
$error ... | [
"private",
"function",
"writeToFile",
"(",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"logger",
"->",
"setDirectory",
"(",
"Path",
"::",
"get",
"(",
"'log-error'",
")",
")",
";",
"$",
"error",
"=",
"$",
"this",
... | Writes current error to log file | [
"Writes",
"current",
"error",
"to",
"log",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Handler/ErrorHandler.php#L156-L171 |
195,860 | Kris-Kuiper/sFire-Framework | src/Handler/ErrorHandler.php | ErrorHandler.displayError | private function displayError() {
if(count($this -> options['ip']) === 0 || true === in_array(Request :: getIp(), $this -> options['ip'])) {
$error = [
'type' => $this -> error -> getType(),
'text' => $this -> error -> getMessage(),
'file' => $this -> error -> getFile(),
'line' => ... | php | private function displayError() {
if(count($this -> options['ip']) === 0 || true === in_array(Request :: getIp(), $this -> options['ip'])) {
$error = [
'type' => $this -> error -> getType(),
'text' => $this -> error -> getMessage(),
'file' => $this -> error -> getFile(),
'line' => ... | [
"private",
"function",
"displayError",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"options",
"[",
"'ip'",
"]",
")",
"===",
"0",
"||",
"true",
"===",
"in_array",
"(",
"Request",
"::",
"getIp",
"(",
")",
",",
"$",
"this",
"->",
"optio... | Prints the error to client | [
"Prints",
"the",
"error",
"to",
"client"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Handler/ErrorHandler.php#L177-L192 |
195,861 | Kris-Kuiper/sFire-Framework | src/Handler/ErrorHandler.php | ErrorHandler.formatBacktrace | private function formatBacktrace() {
$backtrace = $this -> error -> getBacktrace();
if(null !== $backtrace) {
array_shift($backtrace);
array_shift($backtrace);
foreach($backtrace as $index => $stack) {
foreach(['type', 'args'] as $type) {
if(true === isset($backtrace[$index][$... | php | private function formatBacktrace() {
$backtrace = $this -> error -> getBacktrace();
if(null !== $backtrace) {
array_shift($backtrace);
array_shift($backtrace);
foreach($backtrace as $index => $stack) {
foreach(['type', 'args'] as $type) {
if(true === isset($backtrace[$index][$... | [
"private",
"function",
"formatBacktrace",
"(",
")",
"{",
"$",
"backtrace",
"=",
"$",
"this",
"->",
"error",
"->",
"getBacktrace",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"backtrace",
")",
"{",
"array_shift",
"(",
"$",
"backtrace",
")",
";",
"arra... | Formats the backtrace
@return array | [
"Formats",
"the",
"backtrace"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Handler/ErrorHandler.php#L199-L220 |
195,862 | ScaraMVC/Framework | src/Scara/Html/HtmlBuilder.php | HtmlBuilder.stylesheet | public function stylesheet($file)
{
$dirtypes = ['css', 'stylesheets', 'styles'];
$asset = '';
if ($this->_generator->isValidUrl($file)) {
$asset = $file;
} else {
foreach ($dirtypes as $dir) {
$ext = substr($file, strrpos($file, '.') + 1);
... | php | public function stylesheet($file)
{
$dirtypes = ['css', 'stylesheets', 'styles'];
$asset = '';
if ($this->_generator->isValidUrl($file)) {
$asset = $file;
} else {
foreach ($dirtypes as $dir) {
$ext = substr($file, strrpos($file, '.') + 1);
... | [
"public",
"function",
"stylesheet",
"(",
"$",
"file",
")",
"{",
"$",
"dirtypes",
"=",
"[",
"'css'",
",",
"'stylesheets'",
",",
"'styles'",
"]",
";",
"$",
"asset",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"_generator",
"->",
"isValidUrl",
"(",
"$... | Returns a stylesheet HTML tag with given filename.
@param string $file
@return string | [
"Returns",
"a",
"stylesheet",
"HTML",
"tag",
"with",
"given",
"filename",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Html/HtmlBuilder.php#L47-L70 |
195,863 | ScaraMVC/Framework | src/Scara/Html/HtmlBuilder.php | HtmlBuilder.link | public function link($url, $content = '', $options = [], $safe = false)
{
if (is_null($content)) {
$content = $url;
}
return '<a href="'.$this->_generator->generateUrl($url).'"'.self::attributes($options).'>'.self::encode($content, $safe).'</a>';
} | php | public function link($url, $content = '', $options = [], $safe = false)
{
if (is_null($content)) {
$content = $url;
}
return '<a href="'.$this->_generator->generateUrl($url).'"'.self::attributes($options).'>'.self::encode($content, $safe).'</a>';
} | [
"public",
"function",
"link",
"(",
"$",
"url",
",",
"$",
"content",
"=",
"''",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"safe",
"=",
"false",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"content",
")",
")",
"{",
"$",
"content",
"=",
"$",
"... | Generates an anchor tag.
@param string $url
@param string $content
@param array $options
@param bool $safe
@return mixed | [
"Generates",
"an",
"anchor",
"tag",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Html/HtmlBuilder.php#L126-L133 |
195,864 | ScaraMVC/Framework | src/Scara/Html/HtmlBuilder.php | HtmlBuilder.image | public function image($url, $alt = null, $options = [])
{
$options['alt'] = $alt;
return '<img src="'.$this->_generator->asset($url).'"'.self::attributes($options).'>';
} | php | public function image($url, $alt = null, $options = [])
{
$options['alt'] = $alt;
return '<img src="'.$this->_generator->asset($url).'"'.self::attributes($options).'>';
} | [
"public",
"function",
"image",
"(",
"$",
"url",
",",
"$",
"alt",
"=",
"null",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"[",
"'alt'",
"]",
"=",
"$",
"alt",
";",
"return",
"'<img src=\"'",
".",
"$",
"this",
"->",
"_generator",
... | Creates an image element.
@param string $url
@param string $alt
@param array $options
@return string | [
"Creates",
"an",
"image",
"element",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Html/HtmlBuilder.php#L170-L175 |
195,865 | narrowspark/collection | src/Collection/Collection.php | Collection.whereInStrict | public function whereInStrict(string $key, $values): Collection
{
return $this->whereIn($key, $values, true);
} | php | public function whereInStrict(string $key, $values): Collection
{
return $this->whereIn($key, $values, true);
} | [
"public",
"function",
"whereInStrict",
"(",
"string",
"$",
"key",
",",
"$",
"values",
")",
":",
"Collection",
"{",
"return",
"$",
"this",
"->",
"whereIn",
"(",
"$",
"key",
",",
"$",
"values",
",",
"true",
")",
";",
"}"
] | Filter items by the given key value pair using strict comparison.
@param string $key
@param mixed $values
@return static | [
"Filter",
"items",
"by",
"the",
"given",
"key",
"value",
"pair",
"using",
"strict",
"comparison",
"."
] | c6ae76b2a7330e9673409d78fe5e61d2e167a8b8 | https://github.com/narrowspark/collection/blob/c6ae76b2a7330e9673409d78fe5e61d2e167a8b8/src/Collection/Collection.php#L475-L478 |
195,866 | narrowspark/collection | src/Collection/Collection.php | Collection.arsort | public function arsort(int $option = SORT_REGULAR): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
uasort($items, function ($a, $b) use ($option) {
if ($a[1] === $b[1]) {
retu... | php | public function arsort(int $option = SORT_REGULAR): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
uasort($items, function ($a, $b) use ($option) {
if ($a[1] === $b[1]) {
retu... | [
"public",
"function",
"arsort",
"(",
"int",
"$",
"option",
"=",
"SORT_REGULAR",
")",
":",
"Collection",
"{",
"$",
"index",
"=",
"0",
";",
"$",
"items",
"=",
"$",
"this",
"->",
"items",
";",
"foreach",
"(",
"$",
"items",
"as",
"&",
"$",
"item",
")",... | Sort an array in reverse order and maintain index association.
@param int $option
@return static | [
"Sort",
"an",
"array",
"in",
"reverse",
"order",
"and",
"maintain",
"index",
"association",
"."
] | c6ae76b2a7330e9673409d78fe5e61d2e167a8b8 | https://github.com/narrowspark/collection/blob/c6ae76b2a7330e9673409d78fe5e61d2e167a8b8/src/Collection/Collection.php#L1064-L1091 |
195,867 | narrowspark/collection | src/Collection/Collection.php | Collection.natcasesort | public function natcasesort(): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
uasort($items, function ($a, $b) {
$result = strnatcasecmp($a[1], $b[1]);
return $result === 0 ? $a[... | php | public function natcasesort(): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
uasort($items, function ($a, $b) {
$result = strnatcasecmp($a[1], $b[1]);
return $result === 0 ? $a[... | [
"public",
"function",
"natcasesort",
"(",
")",
":",
"Collection",
"{",
"$",
"index",
"=",
"0",
";",
"$",
"items",
"=",
"$",
"this",
"->",
"items",
";",
"foreach",
"(",
"$",
"items",
"as",
"&",
"$",
"item",
")",
"{",
"$",
"item",
"=",
"[",
"$",
... | Sort an array using a case insensitive "natural order" algorithm.
@return static | [
"Sort",
"an",
"array",
"using",
"a",
"case",
"insensitive",
"natural",
"order",
"algorithm",
"."
] | c6ae76b2a7330e9673409d78fe5e61d2e167a8b8 | https://github.com/narrowspark/collection/blob/c6ae76b2a7330e9673409d78fe5e61d2e167a8b8/src/Collection/Collection.php#L1134-L1154 |
195,868 | narrowspark/collection | src/Collection/Collection.php | Collection.natsort | public function natsort(): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
uasort($items, function ($a, $b) {
$result = strnatcmp($a[1], $b[1]);
return $result === 0 ? $a[0] - $b[... | php | public function natsort(): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
uasort($items, function ($a, $b) {
$result = strnatcmp($a[1], $b[1]);
return $result === 0 ? $a[0] - $b[... | [
"public",
"function",
"natsort",
"(",
")",
":",
"Collection",
"{",
"$",
"index",
"=",
"0",
";",
"$",
"items",
"=",
"$",
"this",
"->",
"items",
";",
"foreach",
"(",
"$",
"items",
"as",
"&",
"$",
"item",
")",
"{",
"$",
"item",
"=",
"[",
"$",
"ind... | Sort an array using a "natural order" algorithm.
@return static | [
"Sort",
"an",
"array",
"using",
"a",
"natural",
"order",
"algorithm",
"."
] | c6ae76b2a7330e9673409d78fe5e61d2e167a8b8 | https://github.com/narrowspark/collection/blob/c6ae76b2a7330e9673409d78fe5e61d2e167a8b8/src/Collection/Collection.php#L1161-L1181 |
195,869 | narrowspark/collection | src/Collection/Collection.php | Collection.uksort | public function uksort(callable $callback): Collection
{
$items = $this->items;
$keys = array_combine(array_keys($items), range(1, count($items)));
uksort($items, function ($a, $b) use ($callback, $keys) {
$result = call_user_func($callback, $a, $b);
return $result ... | php | public function uksort(callable $callback): Collection
{
$items = $this->items;
$keys = array_combine(array_keys($items), range(1, count($items)));
uksort($items, function ($a, $b) use ($callback, $keys) {
$result = call_user_func($callback, $a, $b);
return $result ... | [
"public",
"function",
"uksort",
"(",
"callable",
"$",
"callback",
")",
":",
"Collection",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"items",
";",
"$",
"keys",
"=",
"array_combine",
"(",
"array_keys",
"(",
"$",
"items",
")",
",",
"range",
"(",
"1",
"... | Sort an array by keys using a user-defined comparison function.
@param callable $callback
@return static | [
"Sort",
"an",
"array",
"by",
"keys",
"using",
"a",
"user",
"-",
"defined",
"comparison",
"function",
"."
] | c6ae76b2a7330e9673409d78fe5e61d2e167a8b8 | https://github.com/narrowspark/collection/blob/c6ae76b2a7330e9673409d78fe5e61d2e167a8b8/src/Collection/Collection.php#L1219-L1231 |
195,870 | narrowspark/collection | src/Collection/Collection.php | Collection.usort | public function usort(callable $callback): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
usort($items, function ($a, $b) use ($callback) {
$result = call_user_func($callback, $a[1], $b[1]);
... | php | public function usort(callable $callback): Collection
{
$index = 0;
$items = $this->items;
foreach ($items as &$item) {
$item = [$index++, $item];
}
usort($items, function ($a, $b) use ($callback) {
$result = call_user_func($callback, $a[1], $b[1]);
... | [
"public",
"function",
"usort",
"(",
"callable",
"$",
"callback",
")",
":",
"Collection",
"{",
"$",
"index",
"=",
"0",
";",
"$",
"items",
"=",
"$",
"this",
"->",
"items",
";",
"foreach",
"(",
"$",
"items",
"as",
"&",
"$",
"item",
")",
"{",
"$",
"i... | Sort an array by values using a user-defined comparison function.
@param callable $callback
@return static | [
"Sort",
"an",
"array",
"by",
"values",
"using",
"a",
"user",
"-",
"defined",
"comparison",
"function",
"."
] | c6ae76b2a7330e9673409d78fe5e61d2e167a8b8 | https://github.com/narrowspark/collection/blob/c6ae76b2a7330e9673409d78fe5e61d2e167a8b8/src/Collection/Collection.php#L1240-L1260 |
195,871 | phpguard/listen | src/PhpGuard/Listen/Adapter/InotifyAdapter.php | InotifyAdapter.initialize | public function initialize(Listener $listener)
{
$this->tracker->initialize($listener);
$this->wathedPaths = $listener->getPaths();
} | php | public function initialize(Listener $listener)
{
$this->tracker->initialize($listener);
$this->wathedPaths = $listener->getPaths();
} | [
"public",
"function",
"initialize",
"(",
"Listener",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"tracker",
"->",
"initialize",
"(",
"$",
"listener",
")",
";",
"$",
"this",
"->",
"wathedPaths",
"=",
"$",
"listener",
"->",
"getPaths",
"(",
")",
";",
"... | Initialize new listener
@param Listener $listener
@return mixed | [
"Initialize",
"new",
"listener"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/InotifyAdapter.php#L52-L56 |
195,872 | phpguard/listen | src/PhpGuard/Listen/Adapter/InotifyAdapter.php | InotifyAdapter.evaluate | public function evaluate()
{
$this->tracker->clearChangeSet();
$this->modified = array();
$inEvents = inotify_read($this->inotify);
$inEvents = is_array($inEvents) ? $inEvents:array();
foreach($inEvents as $inEvent){
$this->translateEvent($inEvent);
}
... | php | public function evaluate()
{
$this->tracker->clearChangeSet();
$this->modified = array();
$inEvents = inotify_read($this->inotify);
$inEvents = is_array($inEvents) ? $inEvents:array();
foreach($inEvents as $inEvent){
$this->translateEvent($inEvent);
}
... | [
"public",
"function",
"evaluate",
"(",
")",
"{",
"$",
"this",
"->",
"tracker",
"->",
"clearChangeSet",
"(",
")",
";",
"$",
"this",
"->",
"modified",
"=",
"array",
"(",
")",
";",
"$",
"inEvents",
"=",
"inotify_read",
"(",
"$",
"this",
"->",
"inotify",
... | Evaluate Filesystem changes
@return mixed | [
"Evaluate",
"Filesystem",
"changes"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Adapter/InotifyAdapter.php#L63-L75 |
195,873 | jamset/process-load-manager | src/LoadManager/Lm.php | Lm.manage | public function manage()
{
$this->initLoop();
/**
* @var \ZMQContext
*/
$this->context = new Context($this->loop);
$this->initStreams();
$this->pmReplySocket = $this->context->getSocket(\ZMQ::SOCKET_REP);
$this->dtoContainer = new DtoContainer();
... | php | public function manage()
{
$this->initLoop();
/**
* @var \ZMQContext
*/
$this->context = new Context($this->loop);
$this->initStreams();
$this->pmReplySocket = $this->context->getSocket(\ZMQ::SOCKET_REP);
$this->dtoContainer = new DtoContainer();
... | [
"public",
"function",
"manage",
"(",
")",
"{",
"$",
"this",
"->",
"initLoop",
"(",
")",
";",
"/**\n * @var \\ZMQContext\n */",
"$",
"this",
"->",
"context",
"=",
"new",
"Context",
"(",
"$",
"this",
"->",
"loop",
")",
";",
"$",
"this",
"->",... | Send periodic signals about CPU and memory status; total and per PID | [
"Send",
"periodic",
"signals",
"about",
"CPU",
"and",
"memory",
"status",
";",
"total",
"and",
"per",
"PID"
] | cffed6ff73bf66617565707ec4f2c9251a497cc6 | https://github.com/jamset/process-load-manager/blob/cffed6ff73bf66617565707ec4f2c9251a497cc6/src/LoadManager/Lm.php#L275-L298 |
195,874 | OpenConext-Attic/OpenConext-engineblock-metadata | src/X509/X509CertificateFactory.php | X509CertificateFactory.fromFile | public function fromFile($filePath)
{
$pemString = file_get_contents($filePath);
if (!$pemString) {
throw new RuntimeException("Unable to read file at path '$filePath'.");
}
try {
$certificate = $this->fromString($pemString);
} catch (Exception $e) {... | php | public function fromFile($filePath)
{
$pemString = file_get_contents($filePath);
if (!$pemString) {
throw new RuntimeException("Unable to read file at path '$filePath'.");
}
try {
$certificate = $this->fromString($pemString);
} catch (Exception $e) {... | [
"public",
"function",
"fromFile",
"(",
"$",
"filePath",
")",
"{",
"$",
"pemString",
"=",
"file_get_contents",
"(",
"$",
"filePath",
")",
";",
"if",
"(",
"!",
"$",
"pemString",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unable to read file at path '$... | Create a certificate from a file path.
@param string $filePath
@return X509Certificate
@throws RuntimeException | [
"Create",
"a",
"certificate",
"from",
"a",
"file",
"path",
"."
] | 236e2f52ef9cf28e71404544a1c4388f63ee535d | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/X509/X509CertificateFactory.php#L20-L34 |
195,875 | OpenConext-Attic/OpenConext-engineblock-metadata | src/X509/X509CertificateFactory.php | X509CertificateFactory.formatKey | private function formatKey($certData)
{
return X509Certificate::PEM_HEADER .
PHP_EOL .
// Chunk it in 64 character bytes
chunk_split($certData, 64, PHP_EOL) .
X509Certificate::PEM_FOOTER .
PHP_EOL;
} | php | private function formatKey($certData)
{
return X509Certificate::PEM_HEADER .
PHP_EOL .
// Chunk it in 64 character bytes
chunk_split($certData, 64, PHP_EOL) .
X509Certificate::PEM_FOOTER .
PHP_EOL;
} | [
"private",
"function",
"formatKey",
"(",
"$",
"certData",
")",
"{",
"return",
"X509Certificate",
"::",
"PEM_HEADER",
".",
"PHP_EOL",
".",
"// Chunk it in 64 character bytes",
"chunk_split",
"(",
"$",
"certData",
",",
"64",
",",
"PHP_EOL",
")",
".",
"X509Certificat... | Given the 'certData' string, turn it back into a proper PEM encoded certificate.
@param string $certData
@return string | [
"Given",
"the",
"certData",
"string",
"turn",
"it",
"back",
"into",
"a",
"proper",
"PEM",
"encoded",
"certificate",
"."
] | 236e2f52ef9cf28e71404544a1c4388f63ee535d | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/X509/X509CertificateFactory.php#L88-L96 |
195,876 | Montage-Inc/php-montage | src/Schema.php | Schema.detail | public function detail()
{
$url = $this->montage->url('schema-detail', $this->name);
return $this->montage->request('get', $url);
} | php | public function detail()
{
$url = $this->montage->url('schema-detail', $this->name);
return $this->montage->request('get', $url);
} | [
"public",
"function",
"detail",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"montage",
"->",
"url",
"(",
"'schema-detail'",
",",
"$",
"this",
"->",
"name",
")",
";",
"return",
"$",
"this",
"->",
"montage",
"->",
"request",
"(",
"'get'",
",",
... | Returns the details of a specific Montage schema.
@return mixed | [
"Returns",
"the",
"details",
"of",
"a",
"specific",
"Montage",
"schema",
"."
] | bcd526985447a31c7e5b74555058e167242b23ed | https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Schema.php#L40-L44 |
195,877 | zodream/database | src/Query/Components/SelectBuilder.php | SelectBuilder.parseSubSelect | protected function parseSubSelect($query) {
if ($query instanceof self) {
$query->columns = [$query->columns[0]];
return [$query->toSql(), $query->getBindings()];
} elseif (is_string($query)) {
return [$query, []];
} else {
throw new \InvalidArgum... | php | protected function parseSubSelect($query) {
if ($query instanceof self) {
$query->columns = [$query->columns[0]];
return [$query->toSql(), $query->getBindings()];
} elseif (is_string($query)) {
return [$query, []];
} else {
throw new \InvalidArgum... | [
"protected",
"function",
"parseSubSelect",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"instanceof",
"self",
")",
"{",
"$",
"query",
"->",
"columns",
"=",
"[",
"$",
"query",
"->",
"columns",
"[",
"0",
"]",
"]",
";",
"return",
"[",
"$",
"q... | Parse the sub-select query into SQL and bindings.
@param mixed $query
@return array | [
"Parse",
"the",
"sub",
"-",
"select",
"query",
"into",
"SQL",
"and",
"bindings",
"."
] | 03712219c057799d07350a3a2650c55bcc92c28e | https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Query/Components/SelectBuilder.php#L83-L93 |
195,878 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.loadLateLoadProperty | private function loadLateLoadProperty()
{
// can only lateLateLoad a property if it is the sole primary key
$pks = $this->pgClass->getPrimaryKeys();
$this->lateLoadProperty = ( count( $pks ) === 1 )
? $pks->pop()->name
: null
;
} | php | private function loadLateLoadProperty()
{
// can only lateLateLoad a property if it is the sole primary key
$pks = $this->pgClass->getPrimaryKeys();
$this->lateLoadProperty = ( count( $pks ) === 1 )
? $pks->pop()->name
: null
;
} | [
"private",
"function",
"loadLateLoadProperty",
"(",
")",
"{",
"// can only lateLateLoad a property if it is the sole primary key",
"$",
"pks",
"=",
"$",
"this",
"->",
"pgClass",
"->",
"getPrimaryKeys",
"(",
")",
";",
"$",
"this",
"->",
"lateLoadProperty",
"=",
"(",
... | Determine the lateLoadProperty
@return void | [
"Determine",
"the",
"lateLoadProperty"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L226-L236 |
195,879 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.getIsZombieFunction | private function getIsZombieFunction()
{
// get primary key reference columns
$zombieTests = $this->pgClass->getAttributes()->filter(
function ($e) {
return $e->isZombie();
}
)->map(
function ($zombieCol) {
return sprintf(
... | php | private function getIsZombieFunction()
{
// get primary key reference columns
$zombieTests = $this->pgClass->getAttributes()->filter(
function ($e) {
return $e->isZombie();
}
)->map(
function ($zombieCol) {
return sprintf(
... | [
"private",
"function",
"getIsZombieFunction",
"(",
")",
"{",
"// get primary key reference columns",
"$",
"zombieTests",
"=",
"$",
"this",
"->",
"pgClass",
"->",
"getAttributes",
"(",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"e",
")",
"{",
"return",
"$"... | Produce the isZombie method | [
"Produce",
"the",
"isZombie",
"method"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L514-L550 |
195,880 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.getSqlInterfaceFunction | private function getSqlInterfaceFunction()
{
if( count($this->keyProperties) !== 1 ) {
$content = " throw new \LogicException('Normality can\\'t (yet) handle tables without a primary key or multi-column primary keys.\\n".
"Please extend the generator or overload {$this->pgCl... | php | private function getSqlInterfaceFunction()
{
if( count($this->keyProperties) !== 1 ) {
$content = " throw new \LogicException('Normality can\\'t (yet) handle tables without a primary key or multi-column primary keys.\\n".
"Please extend the generator or overload {$this->pgCl... | [
"private",
"function",
"getSqlInterfaceFunction",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"keyProperties",
")",
"!==",
"1",
")",
"{",
"$",
"content",
"=",
"\" throw new \\LogicException('Normality can\\\\'t (yet) handle tables without a primary key o... | Produce the static entity function data
@return array $lines | [
"Produce",
"the",
"static",
"entity",
"function",
"data"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L556-L626 |
195,881 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.generateGetSetLinksCallback | private function generateGetSetLinksCallback( &$get, &$set, $name, $link )
{
foreach( $link->foreignEntities as $foreignEntity ) {
$nameForeignEntity = $this->getSetAlias( "{$foreignEntity}s", 'data' );
$this->additionalProperties[] = $nameForeignEntity;
$this->class-... | php | private function generateGetSetLinksCallback( &$get, &$set, $name, $link )
{
foreach( $link->foreignEntities as $foreignEntity ) {
$nameForeignEntity = $this->getSetAlias( "{$foreignEntity}s", 'data' );
$this->additionalProperties[] = $nameForeignEntity;
$this->class-... | [
"private",
"function",
"generateGetSetLinksCallback",
"(",
"&",
"$",
"get",
",",
"&",
"$",
"set",
",",
"$",
"name",
",",
"$",
"link",
")",
"{",
"foreach",
"(",
"$",
"link",
"->",
"foreignEntities",
"as",
"$",
"foreignEntity",
")",
"{",
"$",
"nameForeignE... | many to many references to foreign entities
@param array $get
@param array $set
@param $reference See, Relation->getLinks() | [
"many",
"to",
"many",
"references",
"to",
"foreign",
"entities"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L772-L821 |
195,882 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.generateGetSetReferenceCallback | private function generateGetSetReferenceCallback( &$get, &$set, $reference )
{
// we not on the ignore list?
if( !( $property = $this->getSetAlias( $reference, 'reference' ) ) ) {
return;
}
$this->additionalProperties[] = $property;
// DEPRECIATED Symfony2 comp... | php | private function generateGetSetReferenceCallback( &$get, &$set, $reference )
{
// we not on the ignore list?
if( !( $property = $this->getSetAlias( $reference, 'reference' ) ) ) {
return;
}
$this->additionalProperties[] = $property;
// DEPRECIATED Symfony2 comp... | [
"private",
"function",
"generateGetSetReferenceCallback",
"(",
"&",
"$",
"get",
",",
"&",
"$",
"set",
",",
"$",
"reference",
")",
"{",
"// we not on the ignore list?",
"if",
"(",
"!",
"(",
"$",
"property",
"=",
"$",
"this",
"->",
"getSetAlias",
"(",
"$",
"... | References to foreign entities in a 1->1 or 1->many way.
Think, Contact -> ContactUser or Contact -> Addresses
@param array $get
@param array $set
@param $reference See, Relation->getReferences() | [
"References",
"to",
"foreign",
"entities",
"in",
"a",
"1",
"-",
">",
"1",
"or",
"1",
"-",
">",
"many",
"way",
".",
"Think",
"Contact",
"-",
">",
"ContactUser",
"or",
"Contact",
"-",
">",
"Addresses"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L831-L874 |
195,883 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.generateGetSetBoolCallback | private function generateGetSetBoolCallback( &$get, &$set, $columnName )
{
$this->class->classComponents[] = new FunctionDeclaration(
"getset.{$columnName}.get",
$this->generateGetCallbackForBool( $columnName )
);
$this->class->classComponents[] = new FunctionDeclar... | php | private function generateGetSetBoolCallback( &$get, &$set, $columnName )
{
$this->class->classComponents[] = new FunctionDeclaration(
"getset.{$columnName}.get",
$this->generateGetCallbackForBool( $columnName )
);
$this->class->classComponents[] = new FunctionDeclar... | [
"private",
"function",
"generateGetSetBoolCallback",
"(",
"&",
"$",
"get",
",",
"&",
"$",
"set",
",",
"$",
"columnName",
")",
"{",
"$",
"this",
"->",
"class",
"->",
"classComponents",
"[",
"]",
"=",
"new",
"FunctionDeclaration",
"(",
"\"getset.{$columnName}.ge... | Bool columns.
@param array $get
@param array $set
@param string $columnName
@param string $entity | [
"Bool",
"columns",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L884-L897 |
195,884 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.getSymfonyCompatibleGettersAndSetters | private function getSymfonyCompatibleGettersAndSetters()
{
return array();
if( !$this->symfonyFormGetters ) {
return array();
}
// build output
$output = explode( "\n", <<<PHP
/**
* Symfony2 compatible getters and setters.
* These are __not__ to be used by Bond... | php | private function getSymfonyCompatibleGettersAndSetters()
{
return array();
if( !$this->symfonyFormGetters ) {
return array();
}
// build output
$output = explode( "\n", <<<PHP
/**
* Symfony2 compatible getters and setters.
* These are __not__ to be used by Bond... | [
"private",
"function",
"getSymfonyCompatibleGettersAndSetters",
"(",
")",
"{",
"return",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"symfonyFormGetters",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"// build output",
"$",
"output",
"=",
... | Build normality compatible getters and setters | [
"Build",
"normality",
"compatible",
"getters",
"and",
"setters"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L1185-L1214 |
195,885 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.addSymfonyFormCompatibleGetter | private function addSymfonyFormCompatibleGetter( $name )
{
$fnName = "get".\Bond\pascal_case($name);
$fnBody = sprintf(
"function %s() { return \$this->get('%s'); }",
$fnName,
addslashes( $name )
);
$this->class->classComponents[] = new FunctionD... | php | private function addSymfonyFormCompatibleGetter( $name )
{
$fnName = "get".\Bond\pascal_case($name);
$fnBody = sprintf(
"function %s() { return \$this->get('%s'); }",
$fnName,
addslashes( $name )
);
$this->class->classComponents[] = new FunctionD... | [
"private",
"function",
"addSymfonyFormCompatibleGetter",
"(",
"$",
"name",
")",
"{",
"$",
"fnName",
"=",
"\"get\"",
".",
"\\",
"Bond",
"\\",
"pascal_case",
"(",
"$",
"name",
")",
";",
"$",
"fnBody",
"=",
"sprintf",
"(",
"\"function %s() { return \\$this->get('%s... | Build a symfony2 form compatible getter
@param propertyName $name | [
"Build",
"a",
"symfony2",
"form",
"compatible",
"getter"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L1220-L1232 |
195,886 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.getFormChoiceTextFunction | private function getFormChoiceTextFunction()
{
// default function only works for tables with a lone primary key
$columns = $this->pgClass->getAttributes();
// find columns tagged 'form-choicetext'
$columnsSelected = array();
foreach( $columns as $column) {
$tag... | php | private function getFormChoiceTextFunction()
{
// default function only works for tables with a lone primary key
$columns = $this->pgClass->getAttributes();
// find columns tagged 'form-choicetext'
$columnsSelected = array();
foreach( $columns as $column) {
$tag... | [
"private",
"function",
"getFormChoiceTextFunction",
"(",
")",
"{",
"// default function only works for tables with a lone primary key",
"$",
"columns",
"=",
"$",
"this",
"->",
"pgClass",
"->",
"getAttributes",
"(",
")",
";",
"// find columns tagged 'form-choicetext'",
"$",
... | Form choice text function
@return array $lines | [
"Form",
"choice",
"text",
"function"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L1256-L1297 |
195,887 | squareproton/Bond | src/Bond/Normality/Builder/Entity.php | Entity.getSymfonyValidatorConstraints | private function getSymfonyValidatorConstraints()
{
$constraints = array();
$this->loadUnsettableProperties();
foreach ( $this->dataTypes as $column => $type ) {
// skip inherited columns
if( $type->isInherited() ) {
continue;
}
... | php | private function getSymfonyValidatorConstraints()
{
$constraints = array();
$this->loadUnsettableProperties();
foreach ( $this->dataTypes as $column => $type ) {
// skip inherited columns
if( $type->isInherited() ) {
continue;
}
... | [
"private",
"function",
"getSymfonyValidatorConstraints",
"(",
")",
"{",
"$",
"constraints",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"loadUnsettableProperties",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"dataTypes",
"as",
"$",
"column",
"=>",
... | Get Symfony validator contraints
@return string | [
"Get",
"Symfony",
"validator",
"contraints"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Entity.php#L1333-L1409 |
195,888 | ekyna/Table | Bridge/Doctrine/ORM/Type/Filter/EntityType.php | EntityType.getOperators | private function getOperators($dataClass, $propertyPath)
{
$metadata = $this->registry->getManagerForClass($dataClass)->getClassMetadata($dataClass);
if (false === strpos($propertyPath, '.')) {
if ($metadata->hasAssociation($propertyPath)) {
if ($metadata->isCollectionVa... | php | private function getOperators($dataClass, $propertyPath)
{
$metadata = $this->registry->getManagerForClass($dataClass)->getClassMetadata($dataClass);
if (false === strpos($propertyPath, '.')) {
if ($metadata->hasAssociation($propertyPath)) {
if ($metadata->isCollectionVa... | [
"private",
"function",
"getOperators",
"(",
"$",
"dataClass",
",",
"$",
"propertyPath",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"registry",
"->",
"getManagerForClass",
"(",
"$",
"dataClass",
")",
"->",
"getClassMetadata",
"(",
"$",
"dataClass",
")... | Returns the operators according to association type targeted by the property path.
@param $dataClass
@param $propertyPath
@return array | [
"Returns",
"the",
"operators",
"according",
"to",
"association",
"type",
"targeted",
"by",
"the",
"property",
"path",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Type/Filter/EntityType.php#L180-L211 |
195,889 | spoom-php/core | src/extension/Exception.php | Exception.log | public static function log( \Throwable $throwable, LoggerInterface $instance, array $context = [] ): \Throwable {
// extend data
$context = Collection::cast( $context, [] );
$context[ 'exception' ] = $throwable;
$context[ 'backtrace' ] = false;
$severity = $throwable instanceof Hel... | php | public static function log( \Throwable $throwable, LoggerInterface $instance, array $context = [] ): \Throwable {
// extend data
$context = Collection::cast( $context, [] );
$context[ 'exception' ] = $throwable;
$context[ 'backtrace' ] = false;
$severity = $throwable instanceof Hel... | [
"public",
"static",
"function",
"log",
"(",
"\\",
"Throwable",
"$",
"throwable",
",",
"LoggerInterface",
"$",
"instance",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"\\",
"Throwable",
"{",
"// extend data",
"$",
"context",
"=",
"Collection",
":... | Logger the `\Throwable` with the proper severity and message
@param \Throwable $throwable
@param LoggerInterface $instance
@param array $context
@return \Throwable The input `\Throwable` | [
"Logger",
"the",
"\\",
"Throwable",
"with",
"the",
"proper",
"severity",
"and",
"message"
] | ea7184213352fa2fad7636927a019e5798734e04 | https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Exception.php#L44-L56 |
195,890 | niridoy/LaraveIinstaller | src/Controllers/FinalController.php | FinalController.finish | public function finish(InstalledFileManager $fileManager, FinalInstallManager $finalInstall, EnvironmentManager $environment)
{
$finalMessages = $finalInstall->runFinal();
$finalStatusMessage = $fileManager->update();
$finalEnvFile = $environment->getEnvContent();
return view('vendo... | php | public function finish(InstalledFileManager $fileManager, FinalInstallManager $finalInstall, EnvironmentManager $environment)
{
$finalMessages = $finalInstall->runFinal();
$finalStatusMessage = $fileManager->update();
$finalEnvFile = $environment->getEnvContent();
return view('vendo... | [
"public",
"function",
"finish",
"(",
"InstalledFileManager",
"$",
"fileManager",
",",
"FinalInstallManager",
"$",
"finalInstall",
",",
"EnvironmentManager",
"$",
"environment",
")",
"{",
"$",
"finalMessages",
"=",
"$",
"finalInstall",
"->",
"runFinal",
"(",
")",
"... | Update installed file and display finished view.
@param InstalledFileManager $fileManager
@return \Illuminate\View\View | [
"Update",
"installed",
"file",
"and",
"display",
"finished",
"view",
"."
] | 8339cf45bf393be57fb4e6c63179a6865028f076 | https://github.com/niridoy/LaraveIinstaller/blob/8339cf45bf393be57fb4e6c63179a6865028f076/src/Controllers/FinalController.php#L18-L25 |
195,891 | CroudTech/laravel-repositories | src/Fractal.php | Fractal.item | public function item($item, $transformer, $model_name = '')
{
$resource = new Item($item, $transformer, $model_name);
return $this->manager->createData($resource)->toArray();
} | php | public function item($item, $transformer, $model_name = '')
{
$resource = new Item($item, $transformer, $model_name);
return $this->manager->createData($resource)->toArray();
} | [
"public",
"function",
"item",
"(",
"$",
"item",
",",
"$",
"transformer",
",",
"$",
"model_name",
"=",
"''",
")",
"{",
"$",
"resource",
"=",
"new",
"Item",
"(",
"$",
"item",
",",
"$",
"transformer",
",",
"$",
"model_name",
")",
";",
"return",
"$",
"... | Fractal transform a single item
@param object $item $item object
@param string $transformer Namespaced Transformer
@param string $model_name Model Name
@return array | [
"Fractal",
"transform",
"a",
"single",
"item"
] | 3146285be911728fe7b00cf27d2494ad22b773dc | https://github.com/CroudTech/laravel-repositories/blob/3146285be911728fe7b00cf27d2494ad22b773dc/src/Fractal.php#L44-L48 |
195,892 | Kris-Kuiper/sFire-Framework | src/Cookie/Cookie.php | Cookie.pull | public static function pull($key, $default = NULL) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(true === isset(static :: $data[$key])) {
$default = static :: ge... | php | public static function pull($key, $default = NULL) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(true === isset(static :: $data[$key])) {
$default = static :: ge... | [
"public",
"static",
"function",
"pull",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"NULL",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be... | Retrieve and delete an item
@param string $key
@param default $mixed
@return mixed | [
"Retrieve",
"and",
"delete",
"an",
"item"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cookie/Cookie.php#L101-L114 |
195,893 | Kris-Kuiper/sFire-Framework | src/Cookie/Cookie.php | Cookie.get | public static function get($key, $default = null) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(true === isset(static :: $data[$key])) {
return static :: $data[$key];... | php | public static function get($key, $default = null) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(true === isset(static :: $data[$key])) {
return static :: $data[$key];... | [
"public",
"static",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be ... | Retrieve data based on key
@param string $key
@param mixed $default
@return mixed | [
"Retrieve",
"data",
"based",
"on",
"key"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cookie/Cookie.php#L150-L169 |
195,894 | Kris-Kuiper/sFire-Framework | src/Cookie/Cookie.php | Cookie.all | public static function all() {
$cookies = [];
foreach(static :: $data as $key => $value) {
if(rtrim(base64_encode(base64_decode($key, true)), '=') === $key) {
$cookies[base64_decode($key)] = Hash :: decrypt(static :: $data[$key], Application :: get('salt'));
}
else {
$cookies[$key] = $... | php | public static function all() {
$cookies = [];
foreach(static :: $data as $key => $value) {
if(rtrim(base64_encode(base64_decode($key, true)), '=') === $key) {
$cookies[base64_decode($key)] = Hash :: decrypt(static :: $data[$key], Application :: get('salt'));
}
else {
$cookies[$key] = $... | [
"public",
"static",
"function",
"all",
"(",
")",
"{",
"$",
"cookies",
"=",
"[",
"]",
";",
"foreach",
"(",
"static",
"::",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"rtrim",
"(",
"base64_encode",
"(",
"base64_decode",
"... | Get all data from current session Cookie
@return array | [
"Get",
"all",
"data",
"from",
"current",
"session",
"Cookie"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cookie/Cookie.php#L176-L191 |
195,895 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/http/RequestContext.php | RequestContext.setAttribute | public function setAttribute($key, $val)
{
if(is_null($val) && array_key_exists($key, $this->attributes))
unset($this->attributes[$key]);
else
$this->attributes[$key] = $val;
} | php | public function setAttribute($key, $val)
{
if(is_null($val) && array_key_exists($key, $this->attributes))
unset($this->attributes[$key]);
else
$this->attributes[$key] = $val;
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"val",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"val",
")",
"&&",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"attributes",
")",
")",
"unset",
"(",
"$",
"this",
"->"... | Used to set attributes of the RequestContext
@param string $key The name of the attribute
@param mixed $val The value for the attribute
@return void | [
"Used",
"to",
"set",
"attributes",
"of",
"the",
"RequestContext"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/http/RequestContext.php#L149-L155 |
195,896 | Wedeto/DB | src/Schema/Column/Column.php | Column.validate | public function validate($value, &$filtered = null)
{
if (!$this->validator->validate($value, $filtered))
throw new ValidationException($this->validator->getErrorMessage($value));
return true;
} | php | public function validate($value, &$filtered = null)
{
if (!$this->validator->validate($value, $filtered))
throw new ValidationException($this->validator->getErrorMessage($value));
return true;
} | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"&",
"$",
"filtered",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"$",
"value",
",",
"$",
"filtered",
")",
")",
"throw",
"new",
"ValidationExc... | Validate the value for this column.
@param mixed $value The value to set
@param mixed &$filtered The corrected, filtered value
@return bool True when validates. False is never returned.
@throws ValidationException when validation fails. | [
"Validate",
"the",
"value",
"for",
"this",
"column",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Schema/Column/Column.php#L218-L224 |
195,897 | Wedeto/DB | src/Schema/Column/Column.php | Column.parseArray | public static function parseArray(array $data)
{
$type = strtoupper($data['data_type']);
if (!defined(static::class . '::' . $type))
throw new InvalidValueException("Invalid column type: $type");
return array(
'name' => $data['column_name'],
'... | php | public static function parseArray(array $data)
{
$type = strtoupper($data['data_type']);
if (!defined(static::class . '::' . $type))
throw new InvalidValueException("Invalid column type: $type");
return array(
'name' => $data['column_name'],
'... | [
"public",
"static",
"function",
"parseArray",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"type",
"=",
"strtoupper",
"(",
"$",
"data",
"[",
"'data_type'",
"]",
")",
";",
"if",
"(",
"!",
"defined",
"(",
"static",
"::",
"class",
".",
"'::'",
".",
"$",
... | Parse deserialized array into valid arguments for column properties.
@param array $data The unserialized array
@param array A normalized array containing all fields | [
"Parse",
"deserialized",
"array",
"into",
"valid",
"arguments",
"for",
"column",
"properties",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Schema/Column/Column.php#L272-L289 |
195,898 | Wedeto/DB | src/Schema/Column/Column.php | Column.unserialize | public function unserialize($data)
{
$data = unserialize($data);
$args = self::parseArray($data);
$this->__construct($args['name']);
foreach ($args as $property => $value)
{
if (!empty($value))
$this->set($property, $value);
}
... | php | public function unserialize($data)
{
$data = unserialize($data);
$args = self::parseArray($data);
$this->__construct($args['name']);
foreach ($args as $property => $value)
{
if (!empty($value))
$this->set($property, $value);
}
... | [
"public",
"function",
"unserialize",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"unserialize",
"(",
"$",
"data",
")",
";",
"$",
"args",
"=",
"self",
"::",
"parseArray",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"__construct",
"(",
"$",
"arg... | Restore the column from its serialize form
@param string $data The serialized data | [
"Restore",
"the",
"column",
"from",
"its",
"serialize",
"form"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Schema/Column/Column.php#L311-L324 |
195,899 | Wedeto/DB | src/Schema/Column/Column.php | Column.factory | public static function factory(array $data)
{
$type = ucfirst(strtolower($data['data_type']));
$args = self::parseArray($data);
// Execute hook to allow for additional column types or modifications
$classname = __NAMESPACE__ . "\\" . ucfirst(strtolower($args['type']));
$para... | php | public static function factory(array $data)
{
$type = ucfirst(strtolower($data['data_type']));
$args = self::parseArray($data);
// Execute hook to allow for additional column types or modifications
$classname = __NAMESPACE__ . "\\" . ucfirst(strtolower($args['type']));
$para... | [
"public",
"static",
"function",
"factory",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"type",
"=",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"data",
"[",
"'data_type'",
"]",
")",
")",
";",
"$",
"args",
"=",
"self",
"::",
"parseArray",
"(",
"$",
"data",
... | Create a column instance from an array.
@param array $data The column specification containing name. type,
maximum length, numeric scale and precision, default
value, nullability and such.
@return Column An instantiated column object | [
"Create",
"a",
"column",
"instance",
"from",
"an",
"array",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Schema/Column/Column.php#L333-L362 |
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.