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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9,400 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.array_combine_list | public static function array_combine_list(array $keys, array $rows)
{
$output = array();
foreach ($rows as $row)
{
if (count($row) !== count($keys))
{
$msg = "array_combine_list: Number of values in one of the rows is " .
... | php | public static function array_combine_list(array $keys, array $rows)
{
$output = array();
foreach ($rows as $row)
{
if (count($row) !== count($keys))
{
$msg = "array_combine_list: Number of values in one of the rows is " .
... | [
"public",
"static",
"function",
"array_combine_list",
"(",
"array",
"$",
"keys",
",",
"array",
"$",
"rows",
")",
"{",
"$",
"output",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"row",
")",
"{",
"if",
"(",
"count",
"(",
"$",... | Wrapper around array_combine that works on a list of arrays for the
values instead of being given a single array for the values. The result is a
list of arrays who's keys are provided by the keys parameter and the values are the
corresponding values in the rows' arrays.
@param array $keys - list of keys to set for the... | [
"Wrapper",
"around",
"array_combine",
"that",
"works",
"on",
"a",
"list",
"of",
"arrays",
"for",
"the",
"values",
"instead",
"of",
"being",
"given",
"a",
"single",
"array",
"for",
"the",
"values",
".",
"The",
"result",
"is",
"a",
"list",
"of",
"arrays",
... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L391-L409 |
9,401 | netherphp/database | src/Nether/Database.php | Database.QueryOld | public function QueryOld($fmt,$parm=null) {
/*//
@depreciated obviously
@return Nether\Database\Query;
builds a query using pdo's bound parameter stuff.
//*/
//echo "<p>{$fmt}</p>";
// if given a Database\Query object and an object for the parameters then
// fetch the named args in the query and find their... | php | public function QueryOld($fmt,$parm=null) {
/*//
@depreciated obviously
@return Nether\Database\Query;
builds a query using pdo's bound parameter stuff.
//*/
//echo "<p>{$fmt}</p>";
// if given a Database\Query object and an object for the parameters then
// fetch the named args in the query and find their... | [
"public",
"function",
"QueryOld",
"(",
"$",
"fmt",
",",
"$",
"parm",
"=",
"null",
")",
"{",
"/*//\n\t@depreciated obviously\n\t@return Nether\\Database\\Query;\n\tbuilds a query using pdo's bound parameter stuff.\n\t//*/",
"//echo \"<p>{$fmt}</p>\";",
"// if given a Database\\Query obj... | by better things. | [
"by",
"better",
"things",
"."
] | bcbf7d6079b6ff4e022ee600699be9ac38cd6e9d | https://github.com/netherphp/database/blob/bcbf7d6079b6ff4e022ee600699be9ac38cd6e9d/src/Nether/Database.php#L606-L651 |
9,402 | phergie/phergie-irc-plugin-react-eventfilter | src/AndFilter.php | AndFilter.filter | public function filter(EventInterface $event)
{
$output = null;
foreach ($this->filters as $filter) {
$result = $filter->filter($event);
if ($result === false) {
return false;
}
if ($result === true) {
$output = true;
... | php | public function filter(EventInterface $event)
{
$output = null;
foreach ($this->filters as $filter) {
$result = $filter->filter($event);
if ($result === false) {
return false;
}
if ($result === true) {
$output = true;
... | [
"public",
"function",
"filter",
"(",
"EventInterface",
"$",
"event",
")",
"{",
"$",
"output",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"as",
"$",
"filter",
")",
"{",
"$",
"result",
"=",
"$",
"filter",
"->",
"filter",
"(",
"$",
... | Filters events that pass all contained filters.
@param \Phergie\Irc\Event\EventInterface $event
@return boolean|null TRUE if the event passes all contained filters, FALSE
if it fails any filter, or NULL if all filters return NULL. | [
"Filters",
"events",
"that",
"pass",
"all",
"contained",
"filters",
"."
] | 8fdde571a23ab1379d62a48e9de4570845c0e9dd | https://github.com/phergie/phergie-irc-plugin-react-eventfilter/blob/8fdde571a23ab1379d62a48e9de4570845c0e9dd/src/AndFilter.php#L30-L43 |
9,403 | crater-framework/crater-php-framework | Cli/Migrate.php | Migrate.newMigration | public function newMigration()
{
$fileName = (isset($this->arguments[1])) ? $this->arguments[1] : null;
$this->migrateManager->newMigration($fileName);
} | php | public function newMigration()
{
$fileName = (isset($this->arguments[1])) ? $this->arguments[1] : null;
$this->migrateManager->newMigration($fileName);
} | [
"public",
"function",
"newMigration",
"(",
")",
"{",
"$",
"fileName",
"=",
"(",
"isset",
"(",
"$",
"this",
"->",
"arguments",
"[",
"1",
"]",
")",
")",
"?",
"$",
"this",
"->",
"arguments",
"[",
"1",
"]",
":",
"null",
";",
"$",
"this",
"->",
"migra... | Generate new migration file | [
"Generate",
"new",
"migration",
"file"
] | ff7a4f69f8ee7beb37adee348b67d1be84c51ff1 | https://github.com/crater-framework/crater-php-framework/blob/ff7a4f69f8ee7beb37adee348b67d1be84c51ff1/Cli/Migrate.php#L55-L59 |
9,404 | crater-framework/crater-php-framework | Cli/Migrate.php | Migrate.getVersion | private function getVersion()
{
$select = new QueryBuilder();
$versionRow = $select
->query("SELECT value FROM {$this->table} WHERE param = 'migration_version'")
->fetchRow();
if (!isset($versionRow['value'])) die("Error: Please init the Crater Migration");
r... | php | private function getVersion()
{
$select = new QueryBuilder();
$versionRow = $select
->query("SELECT value FROM {$this->table} WHERE param = 'migration_version'")
->fetchRow();
if (!isset($versionRow['value'])) die("Error: Please init the Crater Migration");
r... | [
"private",
"function",
"getVersion",
"(",
")",
"{",
"$",
"select",
"=",
"new",
"QueryBuilder",
"(",
")",
";",
"$",
"versionRow",
"=",
"$",
"select",
"->",
"query",
"(",
"\"SELECT value FROM {$this->table} WHERE param = 'migration_version'\"",
")",
"->",
"fetchRow",
... | Get current version of database | [
"Get",
"current",
"version",
"of",
"database"
] | ff7a4f69f8ee7beb37adee348b67d1be84c51ff1 | https://github.com/crater-framework/crater-php-framework/blob/ff7a4f69f8ee7beb37adee348b67d1be84c51ff1/Cli/Migrate.php#L92-L101 |
9,405 | crater-framework/crater-php-framework | Cli/Migrate.php | Migrate.getMigrationsFiles | private function getMigrationsFiles()
{
$migrationPath = $this->migrateManager->storagePath;
$files = array();
if ($handle = opendir($migrationPath)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && is_file($migrationPath ... | php | private function getMigrationsFiles()
{
$migrationPath = $this->migrateManager->storagePath;
$files = array();
if ($handle = opendir($migrationPath)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && is_file($migrationPath ... | [
"private",
"function",
"getMigrationsFiles",
"(",
")",
"{",
"$",
"migrationPath",
"=",
"$",
"this",
"->",
"migrateManager",
"->",
"storagePath",
";",
"$",
"files",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"handle",
"=",
"opendir",
"(",
"$",
"migratio... | Get all migration files
@return array
@throws Exception | [
"Get",
"all",
"migration",
"files"
] | ff7a4f69f8ee7beb37adee348b67d1be84c51ff1 | https://github.com/crater-framework/crater-php-framework/blob/ff7a4f69f8ee7beb37adee348b67d1be84c51ff1/Cli/Migrate.php#L124-L144 |
9,406 | crater-framework/crater-php-framework | Cli/Migrate.php | Migrate.apply | public function apply()
{
$files = $this->getMigrationsFiles();
$lastMigration = null;
asort($files);
foreach ($files as $key => $value) {
if ($key <= $this->getVersion()) continue;
include $this->migrateManager->storagePath . '/' . $value;
$cla... | php | public function apply()
{
$files = $this->getMigrationsFiles();
$lastMigration = null;
asort($files);
foreach ($files as $key => $value) {
if ($key <= $this->getVersion()) continue;
include $this->migrateManager->storagePath . '/' . $value;
$cla... | [
"public",
"function",
"apply",
"(",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getMigrationsFiles",
"(",
")",
";",
"$",
"lastMigration",
"=",
"null",
";",
"asort",
"(",
"$",
"files",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"... | Install all the migration files
@throws Exception | [
"Install",
"all",
"the",
"migration",
"files"
] | ff7a4f69f8ee7beb37adee348b67d1be84c51ff1 | https://github.com/crater-framework/crater-php-framework/blob/ff7a4f69f8ee7beb37adee348b67d1be84c51ff1/Cli/Migrate.php#L151-L176 |
9,407 | crater-framework/crater-php-framework | Cli/Migrate.php | Migrate.rollback | public function rollback($version)
{
$files = $this->getMigrationsFiles();
$lastMigration = null;
arsort($files);
foreach ($files as $key => $value) {
if ($key < $version) continue;
include $this->migrateManager->storagePath . '/' . $value;
$clas... | php | public function rollback($version)
{
$files = $this->getMigrationsFiles();
$lastMigration = null;
arsort($files);
foreach ($files as $key => $value) {
if ($key < $version) continue;
include $this->migrateManager->storagePath . '/' . $value;
$clas... | [
"public",
"function",
"rollback",
"(",
"$",
"version",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getMigrationsFiles",
"(",
")",
";",
"$",
"lastMigration",
"=",
"null",
";",
"arsort",
"(",
"$",
"files",
")",
";",
"foreach",
"(",
"$",
"files",
"... | Return to a specific version
@param string $version Version number
@throws Exception | [
"Return",
"to",
"a",
"specific",
"version"
] | ff7a4f69f8ee7beb37adee348b67d1be84c51ff1 | https://github.com/crater-framework/crater-php-framework/blob/ff7a4f69f8ee7beb37adee348b67d1be84c51ff1/Cli/Migrate.php#L184-L207 |
9,408 | zepi/turbo-base | Zepi/Web/AccessControl/src/Manager/GroupManager.php | GroupManager.add | public function add(EntityInterface $group)
{
if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
}
// If the name of the group already is used w... | php | public function add(EntityInterface $group)
{
if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
}
// If the name of the group already is used w... | [
"public",
"function",
"add",
"(",
"EntityInterface",
"$",
"group",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"group",
",",
"self",
"::",
"ACCESS_ENTITY_TYPE",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The given entity ('",
".",
"get_class",
"(",... | Adds the given group to the access entities
@param \Zepi\DataSource\Core\Entity\EntityInterface $group
@return false|\Zepi\Web\AccessControl\Entity\Group
@throws \Zepi\Web\AccessControl\Exception The given entity is not compatible with this data source.
@throws \Zepi\Web\AccessControl\Exception Cannot add the group. ... | [
"Adds",
"the",
"given",
"group",
"to",
"the",
"access",
"entities"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/Manager/GroupManager.php#L86-L105 |
9,409 | zepi/turbo-base | Zepi/Web/AccessControl/src/Manager/GroupManager.php | GroupManager.update | public function update(EntityInterface $group)
{
if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
}
// If the uuid does not exists we cannot u... | php | public function update(EntityInterface $group)
{
if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
}
// If the uuid does not exists we cannot u... | [
"public",
"function",
"update",
"(",
"EntityInterface",
"$",
"group",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"group",
",",
"self",
"::",
"ACCESS_ENTITY_TYPE",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The given entity ('",
".",
"get_class",
"... | Updates the given Group
@param \Zepi\DataSource\Core\Entity\EntityInterface $group
@return boolean
@throws \Zepi\Web\AccessControl\Exception The given entity is not compatible with this data source.
@throws \Zepi\Web\AccessControl\Exception Cannot update the group. The group does not exist. | [
"Updates",
"the",
"given",
"Group"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/Manager/GroupManager.php#L116-L129 |
9,410 | zepi/turbo-base | Zepi/Web/AccessControl/src/Manager/GroupManager.php | GroupManager.delete | public function delete(EntityInterface $group)
{
if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
}
// If the uuid does not exists we cannot d... | php | public function delete(EntityInterface $group)
{
if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
}
// If the uuid does not exists we cannot d... | [
"public",
"function",
"delete",
"(",
"EntityInterface",
"$",
"group",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"group",
",",
"self",
"::",
"ACCESS_ENTITY_TYPE",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The given entity ('",
".",
"get_class",
"... | Deletes the group with the given uuid
@param \Zepi\DataSource\Core\Entity\EntityInterface $group
@return boolean
@throws \Zepi\Web\AccessControl\Exception The given entity is not compatible with this data source.
@throws \Zepi\Web\AccessControl\Exception Cannot delete the group. Group does not exist. | [
"Deletes",
"the",
"group",
"with",
"the",
"given",
"uuid"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/Manager/GroupManager.php#L140-L153 |
9,411 | zepi/turbo-base | Zepi/Web/AccessControl/src/Manager/GroupManager.php | GroupManager.hasGroupForName | public function hasGroupForName($name)
{
if ($this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $name)) {
return true;
}
return false;
} | php | public function hasGroupForName($name)
{
if ($this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $name)) {
return true;
}
return false;
} | [
"public",
"function",
"hasGroupForName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"accessControlManager",
"->",
"hasAccessEntityForName",
"(",
"self",
"::",
"ACCESS_ENTITY_TYPE",
",",
"$",
"name",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Returns true if the given name of the group exists as access entity
@access public
@param string $name
@return boolean | [
"Returns",
"true",
"if",
"the",
"given",
"name",
"of",
"the",
"group",
"exists",
"as",
"access",
"entity"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/Manager/GroupManager.php#L178-L185 |
9,412 | zepi/turbo-base | Zepi/Web/AccessControl/src/Manager/GroupManager.php | GroupManager.getGroupForUuid | public function getGroupForUuid($uuid)
{
if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $uuid)) {
return false;
}
// Get the access entity
$accessEntity = $this->accessControlManager->getAccessEntityForUuid(self::ACCESS_ENTITY_... | php | public function getGroupForUuid($uuid)
{
if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $uuid)) {
return false;
}
// Get the access entity
$accessEntity = $this->accessControlManager->getAccessEntityForUuid(self::ACCESS_ENTITY_... | [
"public",
"function",
"getGroupForUuid",
"(",
"$",
"uuid",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"accessControlManager",
"->",
"hasAccessEntityForUuid",
"(",
"self",
"::",
"ACCESS_ENTITY_TYPE",
",",
"$",
"uuid",
")",
")",
"{",
"return",
"false",
";",
... | Returns the group object for the given uuid
@access public
@param string $uuid
@return boolean | [
"Returns",
"the",
"group",
"object",
"for",
"the",
"given",
"uuid"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/Manager/GroupManager.php#L194-L208 |
9,413 | zepi/turbo-base | Zepi/Web/AccessControl/src/Manager/GroupManager.php | GroupManager.getGroupForName | public function getGroupForName($name)
{
if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $name)) {
return false;
}
// Get the access entity
$accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_... | php | public function getGroupForName($name)
{
if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $name)) {
return false;
}
// Get the access entity
$accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_... | [
"public",
"function",
"getGroupForName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"accessControlManager",
"->",
"hasAccessEntityForName",
"(",
"self",
"::",
"ACCESS_ENTITY_TYPE",
",",
"$",
"name",
")",
")",
"{",
"return",
"false",
";",
... | Returns the Group object for the given name
@access public
@param string $name
@return boolean | [
"Returns",
"the",
"Group",
"object",
"for",
"the",
"given",
"name"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/Manager/GroupManager.php#L217-L231 |
9,414 | damien-carcel/UserBundle | src/Manager/UserManager.php | UserManager.setRole | public function setRole(UserInterface $user, array $selectedRole)
{
$choices = $this->rolesManager->getChoices();
if (!isset($choices[$selectedRole['roles']])) {
throw new InvalidArgumentException(
sprintf('Impossible to set role %s', $selectedRole['roles'])
... | php | public function setRole(UserInterface $user, array $selectedRole)
{
$choices = $this->rolesManager->getChoices();
if (!isset($choices[$selectedRole['roles']])) {
throw new InvalidArgumentException(
sprintf('Impossible to set role %s', $selectedRole['roles'])
... | [
"public",
"function",
"setRole",
"(",
"UserInterface",
"$",
"user",
",",
"array",
"$",
"selectedRole",
")",
"{",
"$",
"choices",
"=",
"$",
"this",
"->",
"rolesManager",
"->",
"getChoices",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"choices",
"[... | Sets a user role.
New role is provided as an key-value array:
[
'roles' => 'ROLE_TO_SET',
]
@param UserInterface $user
@param array $selectedRole | [
"Sets",
"a",
"user",
"role",
"."
] | 22989aa3580184bb3317520281372415cd80ab4d | https://github.com/damien-carcel/UserBundle/blob/22989aa3580184bb3317520281372415cd80ab4d/src/Manager/UserManager.php#L81-L94 |
9,415 | acacha/ebre_escool_model | src/Traits/Periodable.php | Periodable.scopeActiveOn | public function scopeActiveOn($query, $period)
{
return $query->whereHas('periods', function($query) use ($period){
$query->where('academic_periods_id', $period);
});
} | php | public function scopeActiveOn($query, $period)
{
return $query->whereHas('periods', function($query) use ($period){
$query->where('academic_periods_id', $period);
});
} | [
"public",
"function",
"scopeActiveOn",
"(",
"$",
"query",
",",
"$",
"period",
")",
"{",
"return",
"$",
"query",
"->",
"whereHas",
"(",
"'periods'",
",",
"function",
"(",
"$",
"query",
")",
"use",
"(",
"$",
"period",
")",
"{",
"$",
"query",
"->",
"whe... | Only studies active for given period.
@param \Illuminate\Database\Eloquent\Builder $query
@param $period
@return mixed | [
"Only",
"studies",
"active",
"for",
"given",
"period",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Traits/Periodable.php#L32-L37 |
9,416 | encorephp/error | src/ServiceProvider.php | ServiceProvider.register | public function register()
{
$displayer = new BasicDisplayer;
$handler = new Handler($displayer);
$this->container->bind('error', $handler);
} | php | public function register()
{
$displayer = new BasicDisplayer;
$handler = new Handler($displayer);
$this->container->bind('error', $handler);
} | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"displayer",
"=",
"new",
"BasicDisplayer",
";",
"$",
"handler",
"=",
"new",
"Handler",
"(",
"$",
"displayer",
")",
";",
"$",
"this",
"->",
"container",
"->",
"bind",
"(",
"'error'",
",",
"$",
"handl... | Register the error handler into the container.
@return void | [
"Register",
"the",
"error",
"handler",
"into",
"the",
"container",
"."
] | 1e411efa4389412fa2727973a60841bdefb0102b | https://github.com/encorephp/error/blob/1e411efa4389412fa2727973a60841bdefb0102b/src/ServiceProvider.php#L15-L20 |
9,417 | PentagonalProject/SlimService | src/Hook.php | Hook.uniqueId | final private function uniqueId($function)
{
if (is_string($function)) {
return $function;
}
if (is_object($function)) {
// Closures are currently implemented as objects
$function = [ $function, '' ];
} elseif (!is_array($function)) {
... | php | final private function uniqueId($function)
{
if (is_string($function)) {
return $function;
}
if (is_object($function)) {
// Closures are currently implemented as objects
$function = [ $function, '' ];
} elseif (!is_array($function)) {
... | [
"final",
"private",
"function",
"uniqueId",
"(",
"$",
"function",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"function",
")",
")",
"{",
"return",
"$",
"function",
";",
"}",
"if",
"(",
"is_object",
"(",
"$",
"function",
")",
")",
"{",
"// Closures are ... | Create Unique ID if function is not string
@param callable $function function to call
@access private
@return string|bool|null | [
"Create",
"Unique",
"ID",
"if",
"function",
"is",
"not",
"string"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L81-L104 |
9,418 | PentagonalProject/SlimService | src/Hook.php | Hook.exists | public function exists($hookName, $functionToCheck = false)
{
$hookName = $this->sanitizeKeyName($hookName);
if (! $hookName || ! isset($this->filters[$hookName])) {
return false;
}
// Don't reset the internal array pointer
$has = empty($this->filters[$hookNam... | php | public function exists($hookName, $functionToCheck = false)
{
$hookName = $this->sanitizeKeyName($hookName);
if (! $hookName || ! isset($this->filters[$hookName])) {
return false;
}
// Don't reset the internal array pointer
$has = empty($this->filters[$hookNam... | [
"public",
"function",
"exists",
"(",
"$",
"hookName",
",",
"$",
"functionToCheck",
"=",
"false",
")",
"{",
"$",
"hookName",
"=",
"$",
"this",
"->",
"sanitizeKeyName",
"(",
"$",
"hookName",
")",
";",
"if",
"(",
"!",
"$",
"hookName",
"||",
"!",
"isset",
... | Check if hook name exists
@param string $hookName Hook name
@param string|mixed $functionToCheck Specially Functions on Hook
@return boolean|int | [
"Check",
"if",
"hook",
"name",
"exists"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L185-L225 |
9,419 | PentagonalProject/SlimService | src/Hook.php | Hook.call | public function call($hookName, $arg = '') : bool
{
$hookName = $this->sanitizeKeyName($hookName);
if (! $hookName) {
return false;
}
if (! isset($this->actions[$hookName])) {
$this->actions[$hookName] = 1;
} else {
$this->actions[$hookNam... | php | public function call($hookName, $arg = '') : bool
{
$hookName = $this->sanitizeKeyName($hookName);
if (! $hookName) {
return false;
}
if (! isset($this->actions[$hookName])) {
$this->actions[$hookName] = 1;
} else {
$this->actions[$hookNam... | [
"public",
"function",
"call",
"(",
"$",
"hookName",
",",
"$",
"arg",
"=",
"''",
")",
":",
"bool",
"{",
"$",
"hookName",
"=",
"$",
"this",
"->",
"sanitizeKeyName",
"(",
"$",
"hookName",
")",
";",
"if",
"(",
"!",
"$",
"hookName",
")",
"{",
"return",
... | Call hook from existing declared hook record
@param string $hookName Hook Name
@param string $arg the arguments for next parameter
@return boolean | [
"Call",
"hook",
"from",
"existing",
"declared",
"hook",
"record"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L291-L344 |
9,420 | PentagonalProject/SlimService | src/Hook.php | Hook.replace | public function replace(
$hookName,
$functionToReplace,
$callable,
$priority = 10,
$acceptedArguments = 1,
$create = true
) :bool {
$hookName = $this->sanitizeKeyName($hookName);
if (!$hookName) {
throw new InvalidArgumentException(
... | php | public function replace(
$hookName,
$functionToReplace,
$callable,
$priority = 10,
$acceptedArguments = 1,
$create = true
) :bool {
$hookName = $this->sanitizeKeyName($hookName);
if (!$hookName) {
throw new InvalidArgumentException(
... | [
"public",
"function",
"replace",
"(",
"$",
"hookName",
",",
"$",
"functionToReplace",
",",
"$",
"callable",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"acceptedArguments",
"=",
"1",
",",
"$",
"create",
"=",
"true",
")",
":",
"bool",
"{",
"$",
"hookName... | Replace Hooks Function, this will replace all existing hooks
@param string $hookName Hook Name
@param string $functionToReplace Function to replace
@param Callable $callable Callable
@param integer $priority priority
@param integer $acceptedArguments num count of accepted args / p... | [
"Replace",
"Hooks",
"Function",
"this",
"will",
"replace",
"all",
"existing",
"hooks"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L360-L390 |
9,421 | PentagonalProject/SlimService | src/Hook.php | Hook.count | public function count($hookName) : int
{
$hookName = $this->sanitizeKeyName($hookName);
if (!$hookName || ! isset($this->filters[$hookName])) {
return 0;
}
return count($this->filters[$hookName]);
} | php | public function count($hookName) : int
{
$hookName = $this->sanitizeKeyName($hookName);
if (!$hookName || ! isset($this->filters[$hookName])) {
return 0;
}
return count($this->filters[$hookName]);
} | [
"public",
"function",
"count",
"(",
"$",
"hookName",
")",
":",
"int",
"{",
"$",
"hookName",
"=",
"$",
"this",
"->",
"sanitizeKeyName",
"(",
"$",
"hookName",
")",
";",
"if",
"(",
"!",
"$",
"hookName",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
"fil... | Count all existences Hook
@param string $hookName Hook name
@return integer Hooks Count | [
"Count",
"all",
"existences",
"Hook"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L464-L471 |
9,422 | PentagonalProject/SlimService | src/Hook.php | Hook.hasDoing | public function hasDoing($hookName = null) : bool
{
if (null === $hookName) {
return ! empty($this->current);
}
$hookName = $this->sanitizeKeyName($hookName);
return $hookName && isset($this->current[$hookName]);
} | php | public function hasDoing($hookName = null) : bool
{
if (null === $hookName) {
return ! empty($this->current);
}
$hookName = $this->sanitizeKeyName($hookName);
return $hookName && isset($this->current[$hookName]);
} | [
"public",
"function",
"hasDoing",
"(",
"$",
"hookName",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"null",
"===",
"$",
"hookName",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"current",
")",
";",
"}",
"$",
"hookName",
"=",
"$",
... | Check if hook has doing
@param string $hookName Hook name
@return boolean true if has doing | [
"Check",
"if",
"hook",
"has",
"doing"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L480-L488 |
9,423 | PentagonalProject/SlimService | src/Hook.php | Hook.hasCalled | public function hasCalled($hookName) : int
{
$hookName = $this->sanitizeKeyName($hookName);
if (!$hookName || ! isset($this->actions[$hookName])) {
return 0;
}
return $this->actions[$hookName];
} | php | public function hasCalled($hookName) : int
{
$hookName = $this->sanitizeKeyName($hookName);
if (!$hookName || ! isset($this->actions[$hookName])) {
return 0;
}
return $this->actions[$hookName];
} | [
"public",
"function",
"hasCalled",
"(",
"$",
"hookName",
")",
":",
"int",
"{",
"$",
"hookName",
"=",
"$",
"this",
"->",
"sanitizeKeyName",
"(",
"$",
"hookName",
")",
";",
"if",
"(",
"!",
"$",
"hookName",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
... | Check if action hook as execute
@param string $hookName Hook Name
@return integer Count of hook action if has did action | [
"Check",
"if",
"action",
"hook",
"as",
"execute"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/Hook.php#L497-L505 |
9,424 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionProjectcreate | public function actionProjectcreate()
{
$model = new Project();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['projectview', 'id' => $model->id]);
} else {
return $this->render('projectcreate', [
'model' => ... | php | public function actionProjectcreate()
{
$model = new Project();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['projectview', 'id' => $model->id]);
} else {
return $this->render('projectcreate', [
'model' => ... | [
"public",
"function",
"actionProjectcreate",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Project",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
")",
")",
"&&",
"$",
"model",
... | Creates a new Projects model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"Projects",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L54-L65 |
9,425 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionProjectupdate | public
function actionProjectupdate()
{
$id = \Yii::$app->request->get('id');
if (!isset($id)) {
return new NotFoundHttpException('The requested project does not exist.');
}
$model = $this->findProjectmodel($id);
if (!$model instanceof Project) {
... | php | public
function actionProjectupdate()
{
$id = \Yii::$app->request->get('id');
if (!isset($id)) {
return new NotFoundHttpException('The requested project does not exist.');
}
$model = $this->findProjectmodel($id);
if (!$model instanceof Project) {
... | [
"public",
"function",
"actionProjectupdate",
"(",
")",
"{",
"$",
"id",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"get",
"(",
"'id'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
")",
"{",
"return",
"new",
"NotFoundHttpEx... | Updates an existing Projects model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Projects",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L102-L121 |
9,426 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTaskcreate | public function actionTaskcreate($projectid = null, $parenttask = null)
{
if (!isset($projectid)) {
$projectid = $this->getRequestParam('projectid');
}
$model = new Task();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redi... | php | public function actionTaskcreate($projectid = null, $parenttask = null)
{
if (!isset($projectid)) {
$projectid = $this->getRequestParam('projectid');
}
$model = new Task();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redi... | [
"public",
"function",
"actionTaskcreate",
"(",
"$",
"projectid",
"=",
"null",
",",
"$",
"parenttask",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"projectid",
")",
")",
"{",
"$",
"projectid",
"=",
"$",
"this",
"->",
"getRequestParam",
"("... | Creates a new Tasks model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"Tasks",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L170-L187 |
9,427 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTaskview | public function actionTaskview()
{
$id = $this->getRequestParam('id');
$model = Project::getTaskModel($id);
if (!isset($model)) {
throw new NotFoundHttpException('The Task "' . $id . '" not found.');
}
return $this->render('taskview', [
'model' => $m... | php | public function actionTaskview()
{
$id = $this->getRequestParam('id');
$model = Project::getTaskModel($id);
if (!isset($model)) {
throw new NotFoundHttpException('The Task "' . $id . '" not found.');
}
return $this->render('taskview', [
'model' => $m... | [
"public",
"function",
"actionTaskview",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getRequestParam",
"(",
"'id'",
")",
";",
"$",
"model",
"=",
"Project",
"::",
"getTaskModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"mo... | Displays a single Task model.
@return mixed
@throws NotFoundHttpException | [
"Displays",
"a",
"single",
"Task",
"model",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L194-L206 |
9,428 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTaskUpdate | public function actionTaskUpdate($id)
{
$model = Project::getTaskModel($id);
if (!isset($model)) {
throw new NotFoundHttpException('The Task "' . $id . '" not found.');
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(... | php | public function actionTaskUpdate($id)
{
$model = Project::getTaskModel($id);
if (!isset($model)) {
throw new NotFoundHttpException('The Task "' . $id . '" not found.');
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(... | [
"public",
"function",
"actionTaskUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"Project",
"::",
"getTaskModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"model",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
... | Updates an existing Task model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
@throws NotFoundHttpException | [
"Updates",
"an",
"existing",
"Task",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L215-L228 |
9,429 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTaskdelete | public function actionTaskdelete($id)
{
$task = Project::getTaskModel($id);
$projectid = $task->projectID;
$task->delete();
return $this->redirect(['tasklist', 'projectid' => $projectid]);
} | php | public function actionTaskdelete($id)
{
$task = Project::getTaskModel($id);
$projectid = $task->projectID;
$task->delete();
return $this->redirect(['tasklist', 'projectid' => $projectid]);
} | [
"public",
"function",
"actionTaskdelete",
"(",
"$",
"id",
")",
"{",
"$",
"task",
"=",
"Project",
"::",
"getTaskModel",
"(",
"$",
"id",
")",
";",
"$",
"projectid",
"=",
"$",
"task",
"->",
"projectID",
";",
"$",
"task",
"->",
"delete",
"(",
")",
";",
... | Deletes an existing Tasks model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Deletes",
"an",
"existing",
"Tasks",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L236-L244 |
9,430 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTasknotecreate | public function actionTasknotecreate($projectid, $taskid)
{
$model = new TaskNote();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(Url::toRoute(['tasknoteview', 'projectid' => $projectid, 'taskid' => $taskid, 'id' => $model->id,]));
} e... | php | public function actionTasknotecreate($projectid, $taskid)
{
$model = new TaskNote();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(Url::toRoute(['tasknoteview', 'projectid' => $projectid, 'taskid' => $taskid, 'id' => $model->id,]));
} e... | [
"public",
"function",
"actionTasknotecreate",
"(",
"$",
"projectid",
",",
"$",
"taskid",
")",
"{",
"$",
"model",
"=",
"new",
"TaskNote",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post"... | Creates a new TaskNote model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"TaskNote",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L269-L280 |
9,431 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTasknoteview | public function actionTasknoteview($id)
{
$model = Task::getTaskNoteModel($id);
if (!isset($model)) {
throw new NotFoundHttpException('The Task "' . $id . '" not found.');
}
return $this->render('tasknoteview', [
'model' => Task::getTaskNoteModel($id), 'tas... | php | public function actionTasknoteview($id)
{
$model = Task::getTaskNoteModel($id);
if (!isset($model)) {
throw new NotFoundHttpException('The Task "' . $id . '" not found.');
}
return $this->render('tasknoteview', [
'model' => Task::getTaskNoteModel($id), 'tas... | [
"public",
"function",
"actionTasknoteview",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"Task",
"::",
"getTaskNoteModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"model",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"("... | Displays a single TaskComment model.
@param integer $id
@return mixed
@throws NotFoundHttpException | [
"Displays",
"a",
"single",
"TaskComment",
"model",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L288-L301 |
9,432 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTasknoteupdate | public function actionTasknoteupdate($id)
{
$model = Task::getTaskNoteModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['tasknoteview', 'id' => $model->id]);
} else {
return $this->render('tasknoteupdate', [
... | php | public function actionTasknoteupdate($id)
{
$model = Task::getTaskNoteModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['tasknoteview', 'id' => $model->id]);
} else {
return $this->render('tasknoteupdate', [
... | [
"public",
"function",
"actionTasknoteupdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"Task",
"::",
"getTaskNoteModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",... | Updates an existing TaskComment model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"TaskComment",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L309-L320 |
9,433 | cubiclab/project-cube | controllers/DefaultController.php | DefaultController.actionTasknotedelete | public function actionTasknotedelete($taskid, $id)
{
Task::getTaskNoteModel($id)->delete();
return $this->redirect(['tasknotelist', 'taskid' => $taskid]);
} | php | public function actionTasknotedelete($taskid, $id)
{
Task::getTaskNoteModel($id)->delete();
return $this->redirect(['tasknotelist', 'taskid' => $taskid]);
} | [
"public",
"function",
"actionTasknotedelete",
"(",
"$",
"taskid",
",",
"$",
"id",
")",
"{",
"Task",
"::",
"getTaskNoteModel",
"(",
"$",
"id",
")",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"this",
"->",
"redirect",
"(",
"[",
"'tasknotelist'",
",",
... | Deletes an existing TaskComment model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Deletes",
"an",
"existing",
"TaskComment",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/DefaultController.php#L328-L333 |
9,434 | BuildrPHP/Test-Tools | src/Traits/ReflectionUtilities.php | ReflectionUtilities.getPropertyValue | public function getPropertyValue($className, $propertyName, $concreteClass = NULL, $options = []) {
$callConstructor = (isset($options['callConstructor'])) ? (bool) $options['callConstructor'] : FALSE;
$reflector = new ReflectionClass($className);
//This is a default property
if($concre... | php | public function getPropertyValue($className, $propertyName, $concreteClass = NULL, $options = []) {
$callConstructor = (isset($options['callConstructor'])) ? (bool) $options['callConstructor'] : FALSE;
$reflector = new ReflectionClass($className);
//This is a default property
if($concre... | [
"public",
"function",
"getPropertyValue",
"(",
"$",
"className",
",",
"$",
"propertyName",
",",
"$",
"concreteClass",
"=",
"NULL",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"callConstructor",
"=",
"(",
"isset",
"(",
"$",
"options",
"[",
"'callCo... | Read a property value from a given class or concrete object. This function can handle automatic creation
of new instances of the given class.
If no concrete object provided and the 'callConstructor' option is FALSE reads the property default value
from the class.
If a concrete object is provided returns the property ... | [
"Read",
"a",
"property",
"value",
"from",
"a",
"given",
"class",
"or",
"concrete",
"object",
".",
"This",
"function",
"can",
"handle",
"automatic",
"creation",
"of",
"new",
"instances",
"of",
"the",
"given",
"class",
"."
] | 55978eb4447d6f063cc9b85501349636ca3fa67a | https://github.com/BuildrPHP/Test-Tools/blob/55978eb4447d6f063cc9b85501349636ca3fa67a/src/Traits/ReflectionUtilities.php#L45-L81 |
9,435 | BuildrPHP/Test-Tools | src/Traits/ReflectionUtilities.php | ReflectionUtilities.getStaticPropertyValue | public function getStaticPropertyValue($object, $propertyName) {
$className = $object;
if(is_object($className)) {
$className = get_class($object);
}
$reflector = new ReflectionClass($className);
$properties = $reflector->getStaticProperties();
return (isse... | php | public function getStaticPropertyValue($object, $propertyName) {
$className = $object;
if(is_object($className)) {
$className = get_class($object);
}
$reflector = new ReflectionClass($className);
$properties = $reflector->getStaticProperties();
return (isse... | [
"public",
"function",
"getStaticPropertyValue",
"(",
"$",
"object",
",",
"$",
"propertyName",
")",
"{",
"$",
"className",
"=",
"$",
"object",
";",
"if",
"(",
"is_object",
"(",
"$",
"className",
")",
")",
"{",
"$",
"className",
"=",
"get_class",
"(",
"$",... | Returns a static property from the given class. You can pass this function an object or
a FQCN as string.
@param object|string $object A concrete class or a FQCN
@param string $propertyName The property name
@return NULL|mixed | [
"Returns",
"a",
"static",
"property",
"from",
"the",
"given",
"class",
".",
"You",
"can",
"pass",
"this",
"function",
"an",
"object",
"or",
"a",
"FQCN",
"as",
"string",
"."
] | 55978eb4447d6f063cc9b85501349636ca3fa67a | https://github.com/BuildrPHP/Test-Tools/blob/55978eb4447d6f063cc9b85501349636ca3fa67a/src/Traits/ReflectionUtilities.php#L92-L103 |
9,436 | BuildrPHP/Test-Tools | src/Traits/ReflectionUtilities.php | ReflectionUtilities.setProperty | public function setProperty($object, $property, $value) {
$objectReflector = new ReflectionObject($object);
if(!$objectReflector->hasProperty($property)) {
throw new Exception('Property cannot be set! This property not exist inside the given object!');
}
$propertyReflector ... | php | public function setProperty($object, $property, $value) {
$objectReflector = new ReflectionObject($object);
if(!$objectReflector->hasProperty($property)) {
throw new Exception('Property cannot be set! This property not exist inside the given object!');
}
$propertyReflector ... | [
"public",
"function",
"setProperty",
"(",
"$",
"object",
",",
"$",
"property",
",",
"$",
"value",
")",
"{",
"$",
"objectReflector",
"=",
"new",
"ReflectionObject",
"(",
"$",
"object",
")",
";",
"if",
"(",
"!",
"$",
"objectReflector",
"->",
"hasProperty",
... | Set a property value on the given object. If the property is not found in the given object
an Exception will be thrown.
@param object $object A concrete object
@param string $property The property name
@param mixed $value The property new value
@return bool
@throws \BuildR\Foundation\Exception\Exception | [
"Set",
"a",
"property",
"value",
"on",
"the",
"given",
"object",
".",
"If",
"the",
"property",
"is",
"not",
"found",
"in",
"the",
"given",
"object",
"an",
"Exception",
"will",
"be",
"thrown",
"."
] | 55978eb4447d6f063cc9b85501349636ca3fa67a | https://github.com/BuildrPHP/Test-Tools/blob/55978eb4447d6f063cc9b85501349636ca3fa67a/src/Traits/ReflectionUtilities.php#L117-L129 |
9,437 | codebobbly/dvoconnector | Classes/Controller/FunctionaryStaticController.php | FunctionaryStaticController.singleFunctionaryAction | public function singleFunctionaryAction()
{
$this->checkStaticTemplateIsIncluded();
$this->checkSettings();
$this->slotExtendedAssignMultiple([
self::VIEW_VARIABLE_ASSOCIATION_ID => $this->settings[self::SETTINGS_ASSOCIATION_ID],
self::VIEW_VARIABLE_FUNCTIONARY_ID =>... | php | public function singleFunctionaryAction()
{
$this->checkStaticTemplateIsIncluded();
$this->checkSettings();
$this->slotExtendedAssignMultiple([
self::VIEW_VARIABLE_ASSOCIATION_ID => $this->settings[self::SETTINGS_ASSOCIATION_ID],
self::VIEW_VARIABLE_FUNCTIONARY_ID =>... | [
"public",
"function",
"singleFunctionaryAction",
"(",
")",
"{",
"$",
"this",
"->",
"checkStaticTemplateIsIncluded",
"(",
")",
";",
"$",
"this",
"->",
"checkSettings",
"(",
")",
";",
"$",
"this",
"->",
"slotExtendedAssignMultiple",
"(",
"[",
"self",
"::",
"VIEW... | single functionary action.
@return string | [
"single",
"functionary",
"action",
"."
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Controller/FunctionaryStaticController.php#L30-L41 |
9,438 | pinnackl/Sophwork | dist/Sophwork/app/app/SophworkApp.php | SophworkApp.get | public function get($route, $toController, $alias = null)
{
$route = [
'route' => $route,
'toController' => $toController,
'alias' => $alias,
'isDynamic' => preg_match("/{([^{}?&]+)}/", $route),
];
if (!is_null($alias))
$this->routes['GET'][$alias] = $route;
else
$this->routes['GET'][] = $ro... | php | public function get($route, $toController, $alias = null)
{
$route = [
'route' => $route,
'toController' => $toController,
'alias' => $alias,
'isDynamic' => preg_match("/{([^{}?&]+)}/", $route),
];
if (!is_null($alias))
$this->routes['GET'][$alias] = $route;
else
$this->routes['GET'][] = $ro... | [
"public",
"function",
"get",
"(",
"$",
"route",
",",
"$",
"toController",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"route",
"=",
"[",
"'route'",
"=>",
"$",
"route",
",",
"'toController'",
"=>",
"$",
"toController",
",",
"'alias'",
"=>",
"$",
"a... | GET route method
@param [type] $route [description]
@param [type] $toController [description] | [
"GET",
"route",
"method"
] | 53f55905fd06ccb87669c2824152a2a642902f78 | https://github.com/pinnackl/Sophwork/blob/53f55905fd06ccb87669c2824152a2a642902f78/dist/Sophwork/app/app/SophworkApp.php#L96-L109 |
9,439 | pinnackl/Sophwork | dist/Sophwork/app/app/SophworkApp.php | SophworkApp.post | public function post($route, $toController, $alias = null)
{
$route = [
'route' => $route,
'toController' => $toController,
'alias' => $alias,
'isDynamic' => preg_match("/{([^{}?&]+)}/", $route),
];
$this->routes['POST'][] = $route;
} | php | public function post($route, $toController, $alias = null)
{
$route = [
'route' => $route,
'toController' => $toController,
'alias' => $alias,
'isDynamic' => preg_match("/{([^{}?&]+)}/", $route),
];
$this->routes['POST'][] = $route;
} | [
"public",
"function",
"post",
"(",
"$",
"route",
",",
"$",
"toController",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"route",
"=",
"[",
"'route'",
"=>",
"$",
"route",
",",
"'toController'",
"=>",
"$",
"toController",
",",
"'alias'",
"=>",
"$",
"... | POST route method
@param [type] $route [description]
@param [type] $toController [description] | [
"POST",
"route",
"method"
] | 53f55905fd06ccb87669c2824152a2a642902f78 | https://github.com/pinnackl/Sophwork/blob/53f55905fd06ccb87669c2824152a2a642902f78/dist/Sophwork/app/app/SophworkApp.php#L116-L125 |
9,440 | damien-carcel/UserBundle | src/EventSubscriber/MailerSubscriber.php | MailerSubscriber.getUserEmail | public function getUserEmail(GenericEvent $event)
{
$user = $event->getSubject();
if (!$user instanceof UserInterface) {
throw new \InvalidArgumentException('MailerSubscriber event is expected to contain an instance of User');
}
$this->mailAddress = $user->getEmail();
... | php | public function getUserEmail(GenericEvent $event)
{
$user = $event->getSubject();
if (!$user instanceof UserInterface) {
throw new \InvalidArgumentException('MailerSubscriber event is expected to contain an instance of User');
}
$this->mailAddress = $user->getEmail();
... | [
"public",
"function",
"getUserEmail",
"(",
"GenericEvent",
"$",
"event",
")",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getSubject",
"(",
")",
";",
"if",
"(",
"!",
"$",
"user",
"instanceof",
"UserInterface",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgu... | Gets the username and mail address of the user to be removed.
@param GenericEvent $event | [
"Gets",
"the",
"username",
"and",
"mail",
"address",
"of",
"the",
"user",
"to",
"be",
"removed",
"."
] | 22989aa3580184bb3317520281372415cd80ab4d | https://github.com/damien-carcel/UserBundle/blob/22989aa3580184bb3317520281372415cd80ab4d/src/EventSubscriber/MailerSubscriber.php#L60-L70 |
9,441 | coviu/coviu-php-sdk | src/Request.php | Request.request | public static function request($endpoint)
{
return (new Request(NULL, NULL, NULL))->host($endpoint)->get()->path('')->accept('application/json');
} | php | public static function request($endpoint)
{
return (new Request(NULL, NULL, NULL))->host($endpoint)->get()->path('')->accept('application/json');
} | [
"public",
"static",
"function",
"request",
"(",
"$",
"endpoint",
")",
"{",
"return",
"(",
"new",
"Request",
"(",
"NULL",
",",
"NULL",
",",
"NULL",
")",
")",
"->",
"host",
"(",
"$",
"endpoint",
")",
"->",
"get",
"(",
")",
"->",
"path",
"(",
"''",
... | Construct an new Request by providing an endpoint. | [
"Construct",
"an",
"new",
"Request",
"by",
"providing",
"an",
"endpoint",
"."
] | 606c35a36fa0500e27c4c4ca6b037da0d3d0cb3f | https://github.com/coviu/coviu-php-sdk/blob/606c35a36fa0500e27c4c4ca6b037da0d3d0cb3f/src/Request.php#L132-L135 |
9,442 | coviu/coviu-php-sdk | src/Request.php | Request.render | public function render()
{
if ($this->isSentinel()){
return [];
}
$result = $this->tail->render();
$result[$this->key] = $this->value;
return $result;
} | php | public function render()
{
if ($this->isSentinel()){
return [];
}
$result = $this->tail->render();
$result[$this->key] = $this->value;
return $result;
} | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSentinel",
"(",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"result",
"=",
"$",
"this",
"->",
"tail",
"->",
"render",
"(",
")",
";",
"$",
"result",
"[",
"$",
... | Traverse the Request, calculating the final value for each request parameter. | [
"Traverse",
"the",
"Request",
"calculating",
"the",
"final",
"value",
"for",
"each",
"request",
"parameter",
"."
] | 606c35a36fa0500e27c4c4ca6b037da0d3d0cb3f | https://github.com/coviu/coviu-php-sdk/blob/606c35a36fa0500e27c4c4ca6b037da0d3d0cb3f/src/Request.php#L247-L255 |
9,443 | kherge-abandoned/Wisdom | src/lib/KevinGH/Wisdom/Loader/Loader.php | Loader.doReplace | public function doReplace($data)
{
$data = preg_replace_callback(
'/#([^\s\r#]+)#/',
function ($matches) {
if (defined($matches[1])) {
return constant($matches[1]);
}
return $matches[0];
},
$... | php | public function doReplace($data)
{
$data = preg_replace_callback(
'/#([^\s\r#]+)#/',
function ($matches) {
if (defined($matches[1])) {
return constant($matches[1]);
}
return $matches[0];
},
$... | [
"public",
"function",
"doReplace",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"preg_replace_callback",
"(",
"'/#([^\\s\\r#]+)#/'",
",",
"function",
"(",
"$",
"matches",
")",
"{",
"if",
"(",
"defined",
"(",
"$",
"matches",
"[",
"1",
"]",
")",
")",
"{... | Performs the replacement on the raw data.
@param string $data The raw data.
@return string The replaced data. | [
"Performs",
"the",
"replacement",
"on",
"the",
"raw",
"data",
"."
] | eb5b1dadde0729f2ccd1b241c2cecebc778e22f3 | https://github.com/kherge-abandoned/Wisdom/blob/eb5b1dadde0729f2ccd1b241c2cecebc778e22f3/src/lib/KevinGH/Wisdom/Loader/Loader.php#L45-L76 |
9,444 | mizmoz/config | src/Environment.php | Environment.create | public static function create(
string $projectRoot, $default = self::ENV_PRODUCTION, array $allowed = []
): EnvironmentInterface
{
if (! $allowed) {
$allowed = [
self::ENV_PRODUCTION,
self::ENV_STAGING,
self::ENV_TESTING,
... | php | public static function create(
string $projectRoot, $default = self::ENV_PRODUCTION, array $allowed = []
): EnvironmentInterface
{
if (! $allowed) {
$allowed = [
self::ENV_PRODUCTION,
self::ENV_STAGING,
self::ENV_TESTING,
... | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"projectRoot",
",",
"$",
"default",
"=",
"self",
"::",
"ENV_PRODUCTION",
",",
"array",
"$",
"allowed",
"=",
"[",
"]",
")",
":",
"EnvironmentInterface",
"{",
"if",
"(",
"!",
"$",
"allowed",
")"... | Create the environment using the default params and by searching the .environment file.
@param string $projectRoot
@param string $default
@param array $allowed
@return EnvironmentInterface | [
"Create",
"the",
"environment",
"using",
"the",
"default",
"params",
"and",
"by",
"searching",
"the",
".",
"environment",
"file",
"."
] | 777f66de31603fc65a88416a7b502c1a2fe6d62b | https://github.com/mizmoz/config/blob/777f66de31603fc65a88416a7b502c1a2fe6d62b/src/Environment.php#L47-L78 |
9,445 | mizmoz/config | src/Environment.php | Environment.get | public static function get(string $projectRoot, $default = self::ENV_PRODUCTION, array $allowed = []): string
{
return (static::create($projectRoot, $default, $allowed))->name();
} | php | public static function get(string $projectRoot, $default = self::ENV_PRODUCTION, array $allowed = []): string
{
return (static::create($projectRoot, $default, $allowed))->name();
} | [
"public",
"static",
"function",
"get",
"(",
"string",
"$",
"projectRoot",
",",
"$",
"default",
"=",
"self",
"::",
"ENV_PRODUCTION",
",",
"array",
"$",
"allowed",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"(",
"static",
"::",
"create",
"(",
"$",... | Get the environment
@param string $projectRoot
@param string $default
@param array $allowed
@return string | [
"Get",
"the",
"environment"
] | 777f66de31603fc65a88416a7b502c1a2fe6d62b | https://github.com/mizmoz/config/blob/777f66de31603fc65a88416a7b502c1a2fe6d62b/src/Environment.php#L88-L91 |
9,446 | kodi-app/kodi-security | src/KodiSecurity/Model/Authentication/AuthenticationInterface.php | AuthenticationInterface.hashPassword | protected function hashPassword($pw, $salt=false) {
// Salt generálás
if (!$salt) {
$salt = bin2hex(openssl_random_pseudo_bytes(self::HASH_SALT_LENGTH));
}
$hash = $this->generatePbkdf2(self::HASH_ALGORITHM, $pw, $salt, self::HASH_COST, 32);
$r = new \stdClass();
... | php | protected function hashPassword($pw, $salt=false) {
// Salt generálás
if (!$salt) {
$salt = bin2hex(openssl_random_pseudo_bytes(self::HASH_SALT_LENGTH));
}
$hash = $this->generatePbkdf2(self::HASH_ALGORITHM, $pw, $salt, self::HASH_COST, 32);
$r = new \stdClass();
... | [
"protected",
"function",
"hashPassword",
"(",
"$",
"pw",
",",
"$",
"salt",
"=",
"false",
")",
"{",
"// Salt generálás",
"if",
"(",
"!",
"$",
"salt",
")",
"{",
"$",
"salt",
"=",
"bin2hex",
"(",
"openssl_random_pseudo_bytes",
"(",
"self",
"::",
"HASH_SALT_LE... | Hash password.
@param string $pw
@param string|bool $salt
@return \stdClass | [
"Hash",
"password",
"."
] | d4c577383c83bf948a84921ee6cce5ed0d651522 | https://github.com/kodi-app/kodi-security/blob/d4c577383c83bf948a84921ee6cce5ed0d651522/src/KodiSecurity/Model/Authentication/AuthenticationInterface.php#L73-L84 |
9,447 | kodi-app/kodi-security | src/KodiSecurity/Model/Authentication/AuthenticationInterface.php | AuthenticationInterface.generatePbkdf2 | protected function generatePbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)
{
$algorithm = strtolower($algorithm);
if(!in_array($algorithm, hash_algos(), true))
trigger_error('PBKDF2 ERROR: Invalid hash algorithm.', E_USER_ERROR);
if($count <= 0 || $... | php | protected function generatePbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)
{
$algorithm = strtolower($algorithm);
if(!in_array($algorithm, hash_algos(), true))
trigger_error('PBKDF2 ERROR: Invalid hash algorithm.', E_USER_ERROR);
if($count <= 0 || $... | [
"protected",
"function",
"generatePbkdf2",
"(",
"$",
"algorithm",
",",
"$",
"password",
",",
"$",
"salt",
",",
"$",
"count",
",",
"$",
"key_length",
",",
"$",
"raw_output",
"=",
"false",
")",
"{",
"$",
"algorithm",
"=",
"strtolower",
"(",
"$",
"algorithm... | Checks password correctness based on PBKDF2
@param string $algorithm Hashing algorithm
@param string $password The raw password
@param string $salt Salt
@param int $count Number of hash
@param int $key_length Key length
@param bool $raw_output
@return bool|mixed|string | [
"Checks",
"password",
"correctness",
"based",
"on",
"PBKDF2"
] | d4c577383c83bf948a84921ee6cce5ed0d651522 | https://github.com/kodi-app/kodi-security/blob/d4c577383c83bf948a84921ee6cce5ed0d651522/src/KodiSecurity/Model/Authentication/AuthenticationInterface.php#L97-L133 |
9,448 | easy-system/es-http | src/AbstractStream.php | AbstractStream.make | public static function make($resource = '', $mode = 'w+b')
{
switch (gettype($resource)) {
case 'resource':
return (new static(false))->setResource($resource, $mode);
case 'string':
$stream = fopen('php://temp', $mode);
if ($resource !=... | php | public static function make($resource = '', $mode = 'w+b')
{
switch (gettype($resource)) {
case 'resource':
return (new static(false))->setResource($resource, $mode);
case 'string':
$stream = fopen('php://temp', $mode);
if ($resource !=... | [
"public",
"static",
"function",
"make",
"(",
"$",
"resource",
"=",
"''",
",",
"$",
"mode",
"=",
"'w+b'",
")",
"{",
"switch",
"(",
"gettype",
"(",
"$",
"resource",
")",
")",
"{",
"case",
"'resource'",
":",
"return",
"(",
"new",
"static",
"(",
"false",... | Makes new stream instance of current stream class.
@param string|object|resource $resource Optional;
- the string as a body of new resource
- or an object which can be converted to a string (the instance of
AbstractStream returns without changes)
- or the resource to wrap
@param string $mode Optional; "w+b" by defaul... | [
"Makes",
"new",
"stream",
"instance",
"of",
"current",
"stream",
"class",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L61-L89 |
9,449 | easy-system/es-http | src/AbstractStream.php | AbstractStream.fopen | public static function fopen($resource = 'php://temp', $mode = 'w+b')
{
static::register();
$context = stream_context_create(
[static::PROTOCOL => ['resource' => $resource]]
);
set_error_handler(function () {
throw new Exception('Failed to open stream.');
... | php | public static function fopen($resource = 'php://temp', $mode = 'w+b')
{
static::register();
$context = stream_context_create(
[static::PROTOCOL => ['resource' => $resource]]
);
set_error_handler(function () {
throw new Exception('Failed to open stream.');
... | [
"public",
"static",
"function",
"fopen",
"(",
"$",
"resource",
"=",
"'php://temp'",
",",
"$",
"mode",
"=",
"'w+b'",
")",
"{",
"static",
"::",
"register",
"(",
")",
";",
"$",
"context",
"=",
"stream_context_create",
"(",
"[",
"static",
"::",
"PROTOCOL",
"... | Makes new resource from instance of current stream class.
@param string|resource $resource Optional; "php://temp" by default. The
resource wrapper reference as
"scheme://target" or resource to wrap
@param string $mode Optional; "w+b" by default. The type of
access to the stream if the access type
is not s... | [
"Makes",
"new",
"resource",
"from",
"instance",
"of",
"current",
"stream",
"class",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L106-L129 |
9,450 | easy-system/es-http | src/AbstractStream.php | AbstractStream.register | public static function register($flags = null)
{
$protocol = static::PROTOCOL;
if (static::isRegistered()) {
return true;
}
if (null === $flags) {
$flags = STREAM_IS_URL;
}
return stream_wrapper_register($protocol, static::class, $flags);
... | php | public static function register($flags = null)
{
$protocol = static::PROTOCOL;
if (static::isRegistered()) {
return true;
}
if (null === $flags) {
$flags = STREAM_IS_URL;
}
return stream_wrapper_register($protocol, static::class, $flags);
... | [
"public",
"static",
"function",
"register",
"(",
"$",
"flags",
"=",
"null",
")",
"{",
"$",
"protocol",
"=",
"static",
"::",
"PROTOCOL",
";",
"if",
"(",
"static",
"::",
"isRegistered",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"null",... | Register the current class as wrapper for class-specified protocol.
@param int $flags Optional; null by default means "STREAM_IS_URL". The
specification of protocol type - URL protocol or local
@return bool Returns true on success, false otherwise | [
"Register",
"the",
"current",
"class",
"as",
"wrapper",
"for",
"class",
"-",
"specified",
"protocol",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L139-L151 |
9,451 | easy-system/es-http | src/AbstractStream.php | AbstractStream.open | public function open($path = null, $mode = null, $options = null, &$openedPath = null)
{
$context = [];
if (is_resource($this->context)) {
$context = stream_context_get_options($this->context);
}
$resource = 'php://temp';
if (isset($context[static::PROTOCOL]['reso... | php | public function open($path = null, $mode = null, $options = null, &$openedPath = null)
{
$context = [];
if (is_resource($this->context)) {
$context = stream_context_get_options($this->context);
}
$resource = 'php://temp';
if (isset($context[static::PROTOCOL]['reso... | [
"public",
"function",
"open",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"mode",
"=",
"null",
",",
"$",
"options",
"=",
"null",
",",
"&",
"$",
"openedPath",
"=",
"null",
")",
"{",
"$",
"context",
"=",
"[",
"]",
";",
"if",
"(",
"is_resource",
"(",
... | Opens an stream.
Uses by PHP to open an stream for specified protocol.
@param string $path Not used. The path as "scheme://target"
@param string $mode Not used. The type of access to the stream
@param int $options Not used. Holds additional flags set by the
streams API
@param string $openedPath& N... | [
"Opens",
"an",
"stream",
".",
"Uses",
"by",
"PHP",
"to",
"open",
"an",
"stream",
"for",
"specified",
"protocol",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L186-L206 |
9,452 | easy-system/es-http | src/AbstractStream.php | AbstractStream.copy | public function copy($source)
{
if (! $this->resource) {
throw new RuntimeException('No resource available; cannot copy.');
}
$resource = null;
if ($source instanceof self) {
$resource = $source->getResource();
} elseif (is_resource($source)) {
... | php | public function copy($source)
{
if (! $this->resource) {
throw new RuntimeException('No resource available; cannot copy.');
}
$resource = null;
if ($source instanceof self) {
$resource = $source->getResource();
} elseif (is_resource($source)) {
... | [
"public",
"function",
"copy",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"resource",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'No resource available; cannot copy.'",
")",
";",
"}",
"$",
"resource",
"=",
"null",
";",
"if",
... | Copies the contents of source.
If the source is seekable, copies content from beginning. Otherwise
copies data from current position.
@param string|resource|AbstractStream $source The source to copy
@throws \RuntimeException If the internal resource is not
available
@throws \InvalidArgumentException
- If in... | [
"Copies",
"the",
"contents",
"of",
"source",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L223-L269 |
9,453 | easy-system/es-http | src/AbstractStream.php | AbstractStream.setResource | public function setResource($resource = 'php://temp', $mode = 'w+b')
{
if (is_resource($this->resource)) {
throw new DomainException('The resource is already set.');
}
if (is_resource($resource)) {
$this->resource = $resource;
} elseif (is_string($resource)) ... | php | public function setResource($resource = 'php://temp', $mode = 'w+b')
{
if (is_resource($this->resource)) {
throw new DomainException('The resource is already set.');
}
if (is_resource($resource)) {
$this->resource = $resource;
} elseif (is_string($resource)) ... | [
"public",
"function",
"setResource",
"(",
"$",
"resource",
"=",
"'php://temp'",
",",
"$",
"mode",
"=",
"'w+b'",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"resource",
")",
")",
"{",
"throw",
"new",
"DomainException",
"(",
"'The resource is... | Sets the resource to wrapper.
@param string|resource $resource Optional; "php://temp" by default. The
resource wrapper reference as
"scheme://target" or resource to wrap
@param string $mode Optional; "w+b" by default. The type of
access to the stream if the access type
is not specified for a resource
@th... | [
"Sets",
"the",
"resource",
"to",
"wrapper",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L287-L317 |
9,454 | easy-system/es-http | src/AbstractStream.php | AbstractStream.stat | public function stat()
{
$stat = null;
if (is_resource($this->resource)) {
$stat = fstat($this->resource);
}
return $stat;
} | php | public function stat()
{
$stat = null;
if (is_resource($this->resource)) {
$stat = fstat($this->resource);
}
return $stat;
} | [
"public",
"function",
"stat",
"(",
")",
"{",
"$",
"stat",
"=",
"null",
";",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"resource",
")",
")",
"{",
"$",
"stat",
"=",
"fstat",
"(",
"$",
"this",
"->",
"resource",
")",
";",
"}",
"return",
"$",
... | Retrieve information about a resource.
@return array|null The statistics of the opened resource if any or null | [
"Retrieve",
"information",
"about",
"a",
"resource",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/AbstractStream.php#L334-L341 |
9,455 | GrupaZero/core | src/Gzero/Core/Query/OrderBy.php | OrderBy.apply | public function apply(Builder $query, string $tableAlias = null, string $customName = null)
{
if ($this->hasBeenApplied()) {
return;
}
$name = $this->buildDbName($tableAlias, $customName);
$query->orderBy($name, $this->direction);
$this->setApplied(true);
} | php | public function apply(Builder $query, string $tableAlias = null, string $customName = null)
{
if ($this->hasBeenApplied()) {
return;
}
$name = $this->buildDbName($tableAlias, $customName);
$query->orderBy($name, $this->direction);
$this->setApplied(true);
} | [
"public",
"function",
"apply",
"(",
"Builder",
"$",
"query",
",",
"string",
"$",
"tableAlias",
"=",
"null",
",",
"string",
"$",
"customName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasBeenApplied",
"(",
")",
")",
"{",
"return",
";",
"}... | Applies orderBy on Eloquent query builder
@param Builder $query Eloquent query builder
@param string|null $tableAlias SQL table alias
@param string|null $customName Override field name
@return void | [
"Applies",
"orderBy",
"on",
"Eloquent",
"query",
"builder"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Query/OrderBy.php#L92-L102 |
9,456 | rseyferth/activerecord | lib/SQLBuilder.php | SQLBuilder.bindValues | public function bindValues()
{
$ret = array();
if ($this->data)
$ret = array_values($this->data);
if ($this->getWhereValues())
$ret = array_merge($ret,$this->getWhereValues());
return \ChickenTools\Arry::flatten($ret);
} | php | public function bindValues()
{
$ret = array();
if ($this->data)
$ret = array_values($this->data);
if ($this->getWhereValues())
$ret = array_merge($ret,$this->getWhereValues());
return \ChickenTools\Arry::flatten($ret);
} | [
"public",
"function",
"bindValues",
"(",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
")",
"$",
"ret",
"=",
"array_values",
"(",
"$",
"this",
"->",
"data",
")",
";",
"if",
"(",
"$",
"this",
"->",
"get... | Returns the bind values.
@return array | [
"Returns",
"the",
"bind",
"values",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/SQLBuilder.php#L80-L91 |
9,457 | rseyferth/activerecord | lib/SQLBuilder.php | SQLBuilder.reverseOrder | public static function reverseOrder($order)
{
if (!trim($order))
return $order;
$parts = explode(',',$order);
for ($i=0,$n=count($parts); $i<$n; ++$i)
{
$v = strtolower($parts[$i]);
if (strpos($v,' asc') !== false)
$parts[$i] = preg_replace('/asc/i','DESC',$parts[$i]);
elseif (strpos($v,' de... | php | public static function reverseOrder($order)
{
if (!trim($order))
return $order;
$parts = explode(',',$order);
for ($i=0,$n=count($parts); $i<$n; ++$i)
{
$v = strtolower($parts[$i]);
if (strpos($v,' asc') !== false)
$parts[$i] = preg_replace('/asc/i','DESC',$parts[$i]);
elseif (strpos($v,' de... | [
"public",
"static",
"function",
"reverseOrder",
"(",
"$",
"order",
")",
"{",
"if",
"(",
"!",
"trim",
"(",
"$",
"order",
")",
")",
"return",
"$",
"order",
";",
"$",
"parts",
"=",
"explode",
"(",
"','",
",",
"$",
"order",
")",
";",
"for",
"(",
"$",... | Reverses an order clause. | [
"Reverses",
"an",
"order",
"clause",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/SQLBuilder.php#L185-L204 |
9,458 | rseyferth/activerecord | lib/SQLBuilder.php | SQLBuilder.createHashFromUnderscoredString | public static function createHashFromUnderscoredString($name, &$values=array(), &$map=null)
{
throw new \Exception("This should be refactored!!!", 1);
$parts = preg_split('/(_and_|_or_)/i',$name);
$hash = array();
for ($i=0,$n=count($parts); $i<$n; ++$i)
{
// map to correct name if $map was supplied
... | php | public static function createHashFromUnderscoredString($name, &$values=array(), &$map=null)
{
throw new \Exception("This should be refactored!!!", 1);
$parts = preg_split('/(_and_|_or_)/i',$name);
$hash = array();
for ($i=0,$n=count($parts); $i<$n; ++$i)
{
// map to correct name if $map was supplied
... | [
"public",
"static",
"function",
"createHashFromUnderscoredString",
"(",
"$",
"name",
",",
"&",
"$",
"values",
"=",
"array",
"(",
")",
",",
"&",
"$",
"map",
"=",
"null",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"This should be refactored!!!\"",
","... | Like create_conditions_from_underscored_string but returns a hash of name => value array instead.
@param string $name A string containing attribute names connected with _and_ or _or_
@param $args Array of values for each attribute in $name
@param $map A hash of "mapped_column_name" => "real_column_name"
@return array ... | [
"Like",
"create_conditions_from_underscored_string",
"but",
"returns",
"a",
"hash",
"of",
"name",
"=",
">",
"value",
"array",
"instead",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/SQLBuilder.php#L265-L279 |
9,459 | rseyferth/activerecord | lib/SQLBuilder.php | SQLBuilder.prependTableNameToFields | private function prependTableNameToFields($hash=array())
{
$new = array();
$table = $this->connection->quoteName($this->table);
foreach ($hash as $key => $value)
{
$k = $this->connection->quoteName($key);
$new[$table.'.'.$k] = $value;
}
return $new;
} | php | private function prependTableNameToFields($hash=array())
{
$new = array();
$table = $this->connection->quoteName($this->table);
foreach ($hash as $key => $value)
{
$k = $this->connection->quoteName($key);
$new[$table.'.'.$k] = $value;
}
return $new;
} | [
"private",
"function",
"prependTableNameToFields",
"(",
"$",
"hash",
"=",
"array",
"(",
")",
")",
"{",
"$",
"new",
"=",
"array",
"(",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"connection",
"->",
"quoteName",
"(",
"$",
"this",
"->",
"table",
")... | prepends table name to hash of field names to get around ambiguous fields when SQL builder
has joins
@param array $hash
@return array $new | [
"prepends",
"table",
"name",
"to",
"hash",
"of",
"field",
"names",
"to",
"get",
"around",
"ambiguous",
"fields",
"when",
"SQL",
"builder",
"has",
"joins"
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/SQLBuilder.php#L288-L300 |
9,460 | clusterpoint/php-client-api | command_classes.php | CPS_SearchRequest.setQuery | public function setQuery($value)
{
if (is_array($value)) {
$this->setParam('query', CPS_QueryArray($value));
} else {
$this->setParam('query', $value);
}
} | php | public function setQuery($value)
{
if (is_array($value)) {
$this->setParam('query', CPS_QueryArray($value));
} else {
$this->setParam('query', $value);
}
} | [
"public",
"function",
"setQuery",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"setParam",
"(",
"'query'",
",",
"CPS_QueryArray",
"(",
"$",
"value",
")",
")",
";",
"}",
"else",
"{",
"$",
... | Sets the search query.
Example usage:
<code>$r->setQuery('(' . CPS_Term('predefined_term', '/generated_fields/type/') . CPS_QueryTerm($user_supplied_terms, '/searchable_fields/text') . ')');</code>
or
<code>$r->setQuery(array('tags' => array('title' => 'Title', 'text' => 'Text')));</code>
or
<code>$r->setQuery(array('... | [
"Sets",
"the",
"search",
"query",
"."
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/command_classes.php#L275-L282 |
9,461 | clusterpoint/php-client-api | command_classes.php | CPS_SearchRequest.setList | public function setList($array)
{
$listString = '';
foreach ($array as $key => $value) {
$listString .= CPS_Term($value, $key);
}
$this->setParam('list', $listString);
} | php | public function setList($array)
{
$listString = '';
foreach ($array as $key => $value) {
$listString .= CPS_Term($value, $key);
}
$this->setParam('list', $listString);
} | [
"public",
"function",
"setList",
"(",
"$",
"array",
")",
"{",
"$",
"listString",
"=",
"''",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"listString",
".=",
"CPS_Term",
"(",
"$",
"value",
",",
"$",
"key",
... | Defines which tags of the search results should be listed in the response
@param array $array an associative array with tag xpaths as keys and listing options (yes, no, snippet or highlight) as values | [
"Defines",
"which",
"tags",
"of",
"the",
"search",
"results",
"should",
"be",
"listed",
"in",
"the",
"response"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/command_classes.php#L344-L351 |
9,462 | clusterpoint/php-client-api | command_classes.php | CPS_SearchRequest.setOrdering | public function setOrdering($order)
{
if (is_array($order)) {
$order = implode('', $order);
}
$this->setParam('ordering', $order);
} | php | public function setOrdering($order)
{
if (is_array($order)) {
$order = implode('', $order);
}
$this->setParam('ordering', $order);
} | [
"public",
"function",
"setOrdering",
"(",
"$",
"order",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"order",
")",
")",
"{",
"$",
"order",
"=",
"implode",
"(",
"''",
",",
"$",
"order",
")",
";",
"}",
"$",
"this",
"->",
"setParam",
"(",
"'ordering'",
... | Defines the order in which results should be returned.
@param string|array $order either a single sorting string or an array of those. Could be conveniently generated with ordering macros,
e.g. $q->setOrdering(array(CPS_NumericOrdering('user_count', 'desc'), CPS_RelevanceOrdering())) will sort the documents in descendi... | [
"Defines",
"the",
"order",
"in",
"which",
"results",
"should",
"be",
"returned",
"."
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/command_classes.php#L360-L366 |
9,463 | clusterpoint/php-client-api | command_classes.php | CPS_SearchResponse.getDocuments | public function getDocuments($type = DOC_TYPE_SIMPLEXML)
{
if (isset($this->_simpleXml->cursor_id)) return $this->getCursor($type);
return parent::getRawDocuments($type);
} | php | public function getDocuments($type = DOC_TYPE_SIMPLEXML)
{
if (isset($this->_simpleXml->cursor_id)) return $this->getCursor($type);
return parent::getRawDocuments($type);
} | [
"public",
"function",
"getDocuments",
"(",
"$",
"type",
"=",
"DOC_TYPE_SIMPLEXML",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_simpleXml",
"->",
"cursor_id",
")",
")",
"return",
"$",
"this",
"->",
"getCursor",
"(",
"$",
"type",
")",
";",
"r... | Returns the documents from the response as an associative array, where keys are document IDs and values area document contents
@param int $type defines which datatype the returned documents will be in. Default is DOC_TYPE_SIMPLEXML, other possible values are DOC_TYPE_ARRAY and DOC_TYPE_STDCLASS
@return array | [
"Returns",
"the",
"documents",
"from",
"the",
"response",
"as",
"an",
"associative",
"array",
"where",
"keys",
"are",
"document",
"IDs",
"and",
"values",
"area",
"document",
"contents"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/command_classes.php#L410-L414 |
9,464 | clusterpoint/php-client-api | command_classes.php | CPS_AlternativesResponse.getWordCount | public function getWordCount($word)
{
if (is_null($this->_localWords)) {
$this->_localWords = $this->getRawWordCounts();
}
return isset($this->_localWords[$word]) ? $this->_localWords[$word] : 0;
} | php | public function getWordCount($word)
{
if (is_null($this->_localWords)) {
$this->_localWords = $this->getRawWordCounts();
}
return isset($this->_localWords[$word]) ? $this->_localWords[$word] : 0;
} | [
"public",
"function",
"getWordCount",
"(",
"$",
"word",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_localWords",
")",
")",
"{",
"$",
"this",
"->",
"_localWords",
"=",
"$",
"this",
"->",
"getRawWordCounts",
"(",
")",
";",
"}",
"return",
... | Gets the occurence count of a particular word from the original query
@param string $word
@return int | [
"Gets",
"the",
"occurence",
"count",
"of",
"a",
"particular",
"word",
"from",
"the",
"original",
"query"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/command_classes.php#L1015-L1021 |
9,465 | pokap/pool-dbm | src/Pok/PoolDBM/Mapping/ClassMetadata.php | ClassMetadata.getIdentifierReference | public function getIdentifierReference($manager)
{
if (!isset($this->identifierReferences[$manager])) {
$rule = new \stdClass();
$rule->referenceField = $this->identifierField;
$rule->field = $this->identifierField;
return $rule;
}
r... | php | public function getIdentifierReference($manager)
{
if (!isset($this->identifierReferences[$manager])) {
$rule = new \stdClass();
$rule->referenceField = $this->identifierField;
$rule->field = $this->identifierField;
return $rule;
}
r... | [
"public",
"function",
"getIdentifierReference",
"(",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"identifierReferences",
"[",
"$",
"manager",
"]",
")",
")",
"{",
"$",
"rule",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
... | Returns field idendifier given by manager.
If manager not specific, returns identifier field of model reference.
@param string $manager
@return \stdClass | [
"Returns",
"field",
"idendifier",
"given",
"by",
"manager",
".",
"If",
"manager",
"not",
"specific",
"returns",
"identifier",
"field",
"of",
"model",
"reference",
"."
] | cce32d7cb5f13f42c358c8140b2f97ddf1d9435a | https://github.com/pokap/pool-dbm/blob/cce32d7cb5f13f42c358c8140b2f97ddf1d9435a/src/Pok/PoolDBM/Mapping/ClassMetadata.php#L167-L178 |
9,466 | pokap/pool-dbm | src/Pok/PoolDBM/Mapping/ClassMetadata.php | ClassMetadata.addModel | public function addModel($field, $modelName, array $subFields = array(), $repository_method = null)
{
$mapping = new ModelDefinition($modelName, $field, $subFields);
$mapping->setRepositoryMethod($repository_method);
$this->fieldMappings[$field] = $mapping;
return $mapping;
} | php | public function addModel($field, $modelName, array $subFields = array(), $repository_method = null)
{
$mapping = new ModelDefinition($modelName, $field, $subFields);
$mapping->setRepositoryMethod($repository_method);
$this->fieldMappings[$field] = $mapping;
return $mapping;
} | [
"public",
"function",
"addModel",
"(",
"$",
"field",
",",
"$",
"modelName",
",",
"array",
"$",
"subFields",
"=",
"array",
"(",
")",
",",
"$",
"repository_method",
"=",
"null",
")",
"{",
"$",
"mapping",
"=",
"new",
"ModelDefinition",
"(",
"$",
"modelName"... | Map fields per model.
@param string $field Manager name
@param string $modelName
@param array $subFields (optional)
@param string $repository_method (optional)
@return ModelDefinition | [
"Map",
"fields",
"per",
"model",
"."
] | cce32d7cb5f13f42c358c8140b2f97ddf1d9435a | https://github.com/pokap/pool-dbm/blob/cce32d7cb5f13f42c358c8140b2f97ddf1d9435a/src/Pok/PoolDBM/Mapping/ClassMetadata.php#L253-L261 |
9,467 | pokap/pool-dbm | src/Pok/PoolDBM/Mapping/ClassMetadata.php | ClassMetadata.addAssociation | public function addAssociation($isCollection, $field, $targetMultiModel, array $compatible = array(), array $references = array())
{
$mapping = new AssociationDefinition($field, $targetMultiModel, $isCollection);
$mapping->setCompatible($compatible);
$mapping->setReferences($references);
... | php | public function addAssociation($isCollection, $field, $targetMultiModel, array $compatible = array(), array $references = array())
{
$mapping = new AssociationDefinition($field, $targetMultiModel, $isCollection);
$mapping->setCompatible($compatible);
$mapping->setReferences($references);
... | [
"public",
"function",
"addAssociation",
"(",
"$",
"isCollection",
",",
"$",
"field",
",",
"$",
"targetMultiModel",
",",
"array",
"$",
"compatible",
"=",
"array",
"(",
")",
",",
"array",
"$",
"references",
"=",
"array",
"(",
")",
")",
"{",
"$",
"mapping",... | Adding associtation mapping between multi-model.
@param boolean $isCollection
@param string $field
@param string $targetMultiModel
@param array $compatible (optional)
@param array $references (optional)
@return AssociationDefinition | [
"Adding",
"associtation",
"mapping",
"between",
"multi",
"-",
"model",
"."
] | cce32d7cb5f13f42c358c8140b2f97ddf1d9435a | https://github.com/pokap/pool-dbm/blob/cce32d7cb5f13f42c358c8140b2f97ddf1d9435a/src/Pok/PoolDBM/Mapping/ClassMetadata.php#L294-L303 |
9,468 | pokap/pool-dbm | src/Pok/PoolDBM/Mapping/ClassMetadata.php | ClassMetadata.getAssociationReferenceNames | public function getAssociationReferenceNames()
{
$referenceNames = array();
foreach ($this->associationMappings as $assoc) {
$referenceNames[] = $assoc->getReferenceField($this->getManagerIdentifier()) ?: $assoc->getField();
}
return $referenceNames;
} | php | public function getAssociationReferenceNames()
{
$referenceNames = array();
foreach ($this->associationMappings as $assoc) {
$referenceNames[] = $assoc->getReferenceField($this->getManagerIdentifier()) ?: $assoc->getField();
}
return $referenceNames;
} | [
"public",
"function",
"getAssociationReferenceNames",
"(",
")",
"{",
"$",
"referenceNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"associationMappings",
"as",
"$",
"assoc",
")",
"{",
"$",
"referenceNames",
"[",
"]",
"=",
"$",
"ass... | Returns list of association field per reference model.
@eturn array | [
"Returns",
"list",
"of",
"association",
"field",
"per",
"reference",
"model",
"."
] | cce32d7cb5f13f42c358c8140b2f97ddf1d9435a | https://github.com/pokap/pool-dbm/blob/cce32d7cb5f13f42c358c8140b2f97ddf1d9435a/src/Pok/PoolDBM/Mapping/ClassMetadata.php#L448-L456 |
9,469 | sgtlambda/jvwp | src/admin/metaboxes/fields/Field.php | Field.getValue | public function getValue ($post_ID)
{
if ($post_ID === self::SITE)
return get_option($this->identifier, $this->default);
else {
$value = get_post_meta($post_ID, $this->identifier, true);
return $value === '' ? $this->default : $value;
}
} | php | public function getValue ($post_ID)
{
if ($post_ID === self::SITE)
return get_option($this->identifier, $this->default);
else {
$value = get_post_meta($post_ID, $this->identifier, true);
return $value === '' ? $this->default : $value;
}
} | [
"public",
"function",
"getValue",
"(",
"$",
"post_ID",
")",
"{",
"if",
"(",
"$",
"post_ID",
"===",
"self",
"::",
"SITE",
")",
"return",
"get_option",
"(",
"$",
"this",
"->",
"identifier",
",",
"$",
"this",
"->",
"default",
")",
";",
"else",
"{",
"$",... | Gets the value of this field for a given post
@param int|string $post_ID The post ID or <pre>Field::SITE</pre> if it is a global option
@return string | [
"Gets",
"the",
"value",
"of",
"this",
"field",
"for",
"a",
"given",
"post"
] | 85dba59281216ccb9cff580d26063d304350bbe0 | https://github.com/sgtlambda/jvwp/blob/85dba59281216ccb9cff580d26063d304350bbe0/src/admin/metaboxes/fields/Field.php#L38-L46 |
9,470 | sgtlambda/jvwp | src/admin/metaboxes/fields/Field.php | Field.display | public function display ($post)
{
echo '<div class="wrap-meta-field type-' . $this->getType() . '">';
$this->outputLabel();
$identifier = $post instanceof WP_Post ? $post->ID : $post;
$this->output($this->getValue($identifier));
echo '</div>';
} | php | public function display ($post)
{
echo '<div class="wrap-meta-field type-' . $this->getType() . '">';
$this->outputLabel();
$identifier = $post instanceof WP_Post ? $post->ID : $post;
$this->output($this->getValue($identifier));
echo '</div>';
} | [
"public",
"function",
"display",
"(",
"$",
"post",
")",
"{",
"echo",
"'<div class=\"wrap-meta-field type-'",
".",
"$",
"this",
"->",
"getType",
"(",
")",
".",
"'\">'",
";",
"$",
"this",
"->",
"outputLabel",
"(",
")",
";",
"$",
"identifier",
"=",
"$",
"po... | Displays the field control for a given post
@param WP_Post $post | [
"Displays",
"the",
"field",
"control",
"for",
"a",
"given",
"post"
] | 85dba59281216ccb9cff580d26063d304350bbe0 | https://github.com/sgtlambda/jvwp/blob/85dba59281216ccb9cff580d26063d304350bbe0/src/admin/metaboxes/fields/Field.php#L65-L72 |
9,471 | sgtlambda/jvwp | src/admin/metaboxes/fields/Field.php | Field.save | public function save ($post_ID)
{
if (!$this->doSave())
return;
if ($post_ID === self::SITE)
update_option($this->identifier, $this->getPostValue());
else
update_post_meta($post_ID, $this->identifier, $this->getPostValue());
} | php | public function save ($post_ID)
{
if (!$this->doSave())
return;
if ($post_ID === self::SITE)
update_option($this->identifier, $this->getPostValue());
else
update_post_meta($post_ID, $this->identifier, $this->getPostValue());
} | [
"public",
"function",
"save",
"(",
"$",
"post_ID",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"doSave",
"(",
")",
")",
"return",
";",
"if",
"(",
"$",
"post_ID",
"===",
"self",
"::",
"SITE",
")",
"update_option",
"(",
"$",
"this",
"->",
"identifie... | Saves the updated meta value to the database
@param int|string $post_ID The post ID or <pre>Field::SITE</pre> if it is a global option | [
"Saves",
"the",
"updated",
"meta",
"value",
"to",
"the",
"database"
] | 85dba59281216ccb9cff580d26063d304350bbe0 | https://github.com/sgtlambda/jvwp/blob/85dba59281216ccb9cff580d26063d304350bbe0/src/admin/metaboxes/fields/Field.php#L79-L87 |
9,472 | joomlatools/joomlatools-platform-categories | plugins/content/categories/categories.php | PlgContentCategories.onContentBeforeDelete | public function onContentBeforeDelete($context, $data)
{
// Skip plugin if we are deleting something other than categories
if ($context != 'com_categories.category')
{
return true;
}
// Check if this function is enabled.
if (!$this->params->def('check_categories', 1))
{
return true;
}
$extens... | php | public function onContentBeforeDelete($context, $data)
{
// Skip plugin if we are deleting something other than categories
if ($context != 'com_categories.category')
{
return true;
}
// Check if this function is enabled.
if (!$this->params->def('check_categories', 1))
{
return true;
}
$extens... | [
"public",
"function",
"onContentBeforeDelete",
"(",
"$",
"context",
",",
"$",
"data",
")",
"{",
"// Skip plugin if we are deleting something other than categories",
"if",
"(",
"$",
"context",
"!=",
"'com_categories.category'",
")",
"{",
"return",
"true",
";",
"}",
"//... | Don't allow categories to be deleted if they contain items or subcategories with items
@param string $context The context for the content passed to the plugin.
@param object $data The data relating to the content that was deleted.
@return boolean
@since 1.6 | [
"Don",
"t",
"allow",
"categories",
"to",
"be",
"deleted",
"if",
"they",
"contain",
"items",
"or",
"subcategories",
"with",
"items"
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/content/categories/categories.php#L29-L98 |
9,473 | joomlatools/joomlatools-platform-categories | plugins/content/categories/categories.php | PlgContentCategories._countItemsInCategory | private function _countItemsInCategory($table, $catid)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Count the items in this category
$query->select('COUNT(id)')
->from($table)
->where('catid = ' . $catid);
$db->setQuery($query);
try
{
$count = $db->loadResult();
}
catch (Ru... | php | private function _countItemsInCategory($table, $catid)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Count the items in this category
$query->select('COUNT(id)')
->from($table)
->where('catid = ' . $catid);
$db->setQuery($query);
try
{
$count = $db->loadResult();
}
catch (Ru... | [
"private",
"function",
"_countItemsInCategory",
"(",
"$",
"table",
",",
"$",
"catid",
")",
"{",
"$",
"db",
"=",
"JFactory",
"::",
"getDbo",
"(",
")",
";",
"$",
"query",
"=",
"$",
"db",
"->",
"getQuery",
"(",
"true",
")",
";",
"// Count the items in this ... | Get count of items in a category
@param string $table table name of component table (column is catid)
@param integer $catid id of the category to check
@return mixed count of items found or false if db error
@since 1.6 | [
"Get",
"count",
"of",
"items",
"in",
"a",
"category"
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/content/categories/categories.php#L110-L133 |
9,474 | joomlatools/joomlatools-platform-categories | plugins/content/categories/categories.php | PlgContentCategories._countItemsInChildren | private function _countItemsInChildren($table, $catid, $data)
{
$db = JFactory::getDbo();
// Create subquery for list of child categories
$childCategoryTree = $data->getTree();
// First element in tree is the current category, so we can skip that one
unset($childCategoryTree[0]);
$childCategoryIds = arra... | php | private function _countItemsInChildren($table, $catid, $data)
{
$db = JFactory::getDbo();
// Create subquery for list of child categories
$childCategoryTree = $data->getTree();
// First element in tree is the current category, so we can skip that one
unset($childCategoryTree[0]);
$childCategoryIds = arra... | [
"private",
"function",
"_countItemsInChildren",
"(",
"$",
"table",
",",
"$",
"catid",
",",
"$",
"data",
")",
"{",
"$",
"db",
"=",
"JFactory",
"::",
"getDbo",
"(",
")",
";",
"// Create subquery for list of child categories",
"$",
"childCategoryTree",
"=",
"$",
... | Get count of items in a category's child categories
@param string $table table name of component table (column is catid)
@param integer $catid id of the category to check
@param object $data The data relating to the content that was deleted.
@return mixed count of items found or false if db error
@s... | [
"Get",
"count",
"of",
"items",
"in",
"a",
"category",
"s",
"child",
"categories"
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/plugins/content/categories/categories.php#L146-L190 |
9,475 | easy-system/es-router | src/Router.php | Router.add | public function add($name, RouteInterface $route)
{
$this->routes[(string) $name] = $route;
return $this;
} | php | public function add($name, RouteInterface $route)
{
$this->routes[(string) $name] = $route;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"RouteInterface",
"$",
"route",
")",
"{",
"$",
"this",
"->",
"routes",
"[",
"(",
"string",
")",
"$",
"name",
"]",
"=",
"$",
"route",
";",
"return",
"$",
"this",
";",
"}"
] | Adds the route.
@param string $name The route name
@param RouteInterface $route The instance of route
@return self | [
"Adds",
"the",
"route",
"."
] | 79d56967839d5e2e9543349190edd3539dab6211 | https://github.com/easy-system/es-router/blob/79d56967839d5e2e9543349190edd3539dab6211/src/Router.php#L91-L96 |
9,476 | easy-system/es-router | src/Router.php | Router.remove | public function remove($name)
{
if (isset($this->routes[$name])) {
unset($this->routes[$name]);
}
return $this;
} | php | public function remove($name)
{
if (isset($this->routes[$name])) {
unset($this->routes[$name]);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"name",
"]",
")",
";",
"}",
"return",
... | Removes the route.
@param string $name The route name
@return self | [
"Removes",
"the",
"route",
"."
] | 79d56967839d5e2e9543349190edd3539dab6211 | https://github.com/easy-system/es-router/blob/79d56967839d5e2e9543349190edd3539dab6211/src/Router.php#L117-L124 |
9,477 | easy-system/es-router | src/Router.php | Router.get | public function get($name)
{
if (! isset($this->routes[$name])) {
throw new InvalidArgumentException(
sprintf('The route with given name "%s" not exists.', $name)
);
}
return $this->routes[$name];
} | php | public function get($name)
{
if (! isset($this->routes[$name])) {
throw new InvalidArgumentException(
sprintf('The route with given name "%s" not exists.', $name)
);
}
return $this->routes[$name];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The route with given name \"%s\" no... | Gets the route.
@param string $name The route name
@throws \InvalidArgumentException If the route with given name not exists
@return RouteInterface The route | [
"Gets",
"the",
"route",
"."
] | 79d56967839d5e2e9543349190edd3539dab6211 | https://github.com/easy-system/es-router/blob/79d56967839d5e2e9543349190edd3539dab6211/src/Router.php#L135-L144 |
9,478 | easy-system/es-router | src/Router.php | Router.merge | public function merge(RouterInterface $source = null)
{
if (null == $source) {
return [
$this->routes,
$this->defaultParams,
];
}
list($routes, $params) = $source->merge();
$this->routes = array_merge($this->routes, $rou... | php | public function merge(RouterInterface $source = null)
{
if (null == $source) {
return [
$this->routes,
$this->defaultParams,
];
}
list($routes, $params) = $source->merge();
$this->routes = array_merge($this->routes, $rou... | [
"public",
"function",
"merge",
"(",
"RouterInterface",
"$",
"source",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"source",
")",
"{",
"return",
"[",
"$",
"this",
"->",
"routes",
",",
"$",
"this",
"->",
"defaultParams",
",",
"]",
";",
"}",
... | Merges with other router.
@param RouterInterface $source The data source
@return null|array If the source was passed returns
null, source data otherwise | [
"Merges",
"with",
"other",
"router",
"."
] | 79d56967839d5e2e9543349190edd3539dab6211 | https://github.com/easy-system/es-router/blob/79d56967839d5e2e9543349190edd3539dab6211/src/Router.php#L253-L265 |
9,479 | phonetworks/pho-lib-graphql-parser | src/Pho/Lib/GraphQL/Parser/Definitions/AbstractDefinition.php | AbstractDefinition._retrieveAll | protected function _retrieveAll(string $internally, string $graphql, string $class): array
{
if(isset($this->$internally)) {
return $this->$internally;
}
$sought = $this->def[$graphql];
if(!is_array($sought)) {
$this->$internally = [];
return [];
... | php | protected function _retrieveAll(string $internally, string $graphql, string $class): array
{
if(isset($this->$internally)) {
return $this->$internally;
}
$sought = $this->def[$graphql];
if(!is_array($sought)) {
$this->$internally = [];
return [];
... | [
"protected",
"function",
"_retrieveAll",
"(",
"string",
"$",
"internally",
",",
"string",
"$",
"graphql",
",",
"string",
"$",
"class",
")",
":",
"array",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"$",
"internally",
")",
")",
"{",
"return",
"$",
... | A helper method to retrieve an array of a specific type from the given GraphQL definition.
@param string $internally What the object in question is called internally.
@param string $graphql What the object in question is called in GraphQL definition AST.
@param string $class What class the object in question is associ... | [
"A",
"helper",
"method",
"to",
"retrieve",
"an",
"array",
"of",
"a",
"specific",
"type",
"from",
"the",
"given",
"GraphQL",
"definition",
"."
] | d13ec938bce8b7703d77c8365c175bac7178dd73 | https://github.com/phonetworks/pho-lib-graphql-parser/blob/d13ec938bce8b7703d77c8365c175bac7178dd73/src/Pho/Lib/GraphQL/Parser/Definitions/AbstractDefinition.php#L54-L69 |
9,480 | phonetworks/pho-lib-graphql-parser | src/Pho/Lib/GraphQL/Parser/Definitions/AbstractDefinition.php | AbstractDefinition._retrieveOne | protected function _retrieveOne(string $internally, string $graphql, string $class, int $n) // : mixed
{
if(isset($this->$internally[$n])) {
return $this->$internally[$n];
}
if(isset($this->def[$graphql][$n])) {
$class = "\\".__NAMESPACE__."\\".$class;
ret... | php | protected function _retrieveOne(string $internally, string $graphql, string $class, int $n) // : mixed
{
if(isset($this->$internally[$n])) {
return $this->$internally[$n];
}
if(isset($this->def[$graphql][$n])) {
$class = "\\".__NAMESPACE__."\\".$class;
ret... | [
"protected",
"function",
"_retrieveOne",
"(",
"string",
"$",
"internally",
",",
"string",
"$",
"graphql",
",",
"string",
"$",
"class",
",",
"int",
"$",
"n",
")",
"// : mixed",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"$",
"internally",
"[",
"$"... | A helper method to retrieve a single object of a specific type, at given position,
from the given GraphQL definition.
@param string $internally What the object in question is called internally.
@param string $graphql What the object in question is called in GraphQL definition AST.
@param string $class What class the o... | [
"A",
"helper",
"method",
"to",
"retrieve",
"a",
"single",
"object",
"of",
"a",
"specific",
"type",
"at",
"given",
"position",
"from",
"the",
"given",
"GraphQL",
"definition",
"."
] | d13ec938bce8b7703d77c8365c175bac7178dd73 | https://github.com/phonetworks/pho-lib-graphql-parser/blob/d13ec938bce8b7703d77c8365c175bac7178dd73/src/Pho/Lib/GraphQL/Parser/Definitions/AbstractDefinition.php#L82-L92 |
9,481 | tsommie/eloquent-search | src/EloquentSearchTrait.php | EloquentSearchTrait.scopeSearch | public function scopeSearch($query, $keyword)
{
$columns = $this->searchColumns();
foreach ($columns as $column) {
if ($columns === reset($columns)) {
$query->where($column, 'like', "%{$keyword}%");
}
$query->orWhere($column, 'like', "%{$keywo... | php | public function scopeSearch($query, $keyword)
{
$columns = $this->searchColumns();
foreach ($columns as $column) {
if ($columns === reset($columns)) {
$query->where($column, 'like', "%{$keyword}%");
}
$query->orWhere($column, 'like', "%{$keywo... | [
"public",
"function",
"scopeSearch",
"(",
"$",
"query",
",",
"$",
"keyword",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"searchColumns",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"columns",
... | Scope a query to search for a keyword.
@param \Illuminate\Database\Eloquent\Builder $query
@param string $keyword
@return \Illuminate\Database\Eloquent\Builder | [
"Scope",
"a",
"query",
"to",
"search",
"for",
"a",
"keyword",
"."
] | 91d4e859227f04dfc324c2c89cc0a31f08bbfd74 | https://github.com/tsommie/eloquent-search/blob/91d4e859227f04dfc324c2c89cc0a31f08bbfd74/src/EloquentSearchTrait.php#L20-L36 |
9,482 | jeromeklam/freefw | src/FreeFW/Tools/PBXString.php | PBXString.parse | public static function parse($p_string, $p_data = array(), $p_regex = null)
{
if (! is_array($p_data)) {
if (is_object($p_data) && method_exists($p_data, '__toArray')) {
$datas = $p_data->__toArray();
}
} else {
$datas = $p_data;
}
... | php | public static function parse($p_string, $p_data = array(), $p_regex = null)
{
if (! is_array($p_data)) {
if (is_object($p_data) && method_exists($p_data, '__toArray')) {
$datas = $p_data->__toArray();
}
} else {
$datas = $p_data;
}
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"p_string",
",",
"$",
"p_data",
"=",
"array",
"(",
")",
",",
"$",
"p_regex",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"p_data",
")",
")",
"{",
"if",
"(",
"is_object",
"(",
"$"... | Parse et remplace suivant les marqueur
@param string $p_string
@param array $p_data
@param string $p_regex
@return string | [
"Parse",
"et",
"remplace",
"suivant",
"les",
"marqueur"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Tools/PBXString.php#L34-L63 |
9,483 | jeromeklam/freefw | src/FreeFW/Tools/PBXString.php | PBXString.toCamelCase | public static function toCamelCase($p_str, $p_first = false, $p_glue = '_')
{
if (trim($p_str) == '') {
return $p_str;
}
if ($p_first) {
$p_str[0] = strtoupper($p_str[0]);
}
return preg_replace_callback(
"|{$p_glue}([a-z])|",
fu... | php | public static function toCamelCase($p_str, $p_first = false, $p_glue = '_')
{
if (trim($p_str) == '') {
return $p_str;
}
if ($p_first) {
$p_str[0] = strtoupper($p_str[0]);
}
return preg_replace_callback(
"|{$p_glue}([a-z])|",
fu... | [
"public",
"static",
"function",
"toCamelCase",
"(",
"$",
"p_str",
",",
"$",
"p_first",
"=",
"false",
",",
"$",
"p_glue",
"=",
"'_'",
")",
"{",
"if",
"(",
"trim",
"(",
"$",
"p_str",
")",
"==",
"''",
")",
"{",
"return",
"$",
"p_str",
";",
"}",
"if"... | Conversion en CamelCase
@param string $p_str
@param boolean $p_first
@param string $p_glue
@return string | [
"Conversion",
"en",
"CamelCase"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Tools/PBXString.php#L74-L89 |
9,484 | jeromeklam/freefw | src/FreeFW/Tools/PBXString.php | PBXString.removeComments | public static function removeComments($output)
{
$lines = explode("\n", $output);
$output = "";
// try to keep mem. use down
$linecount = count($lines);
$in_comment = false;
for ($i=0; $i<$linecount; $i++) {
if (preg_match("/^\/\*/", $lines[$i])) {
... | php | public static function removeComments($output)
{
$lines = explode("\n", $output);
$output = "";
// try to keep mem. use down
$linecount = count($lines);
$in_comment = false;
for ($i=0; $i<$linecount; $i++) {
if (preg_match("/^\/\*/", $lines[$i])) {
... | [
"public",
"static",
"function",
"removeComments",
"(",
"$",
"output",
")",
"{",
"$",
"lines",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"output",
")",
";",
"$",
"output",
"=",
"\"\"",
";",
"// try to keep mem. use down",
"$",
"linecount",
"=",
"count",
"("... | Remove comments from string
@param string $output
@return string | [
"Remove",
"comments",
"from",
"string"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Tools/PBXString.php#L148-L168 |
9,485 | jeromeklam/freefw | src/FreeFW/Tools/PBXString.php | PBXString.jsonToList | public static function jsonToList($p_json)
{
$str = '';
$arr = json_decode($p_json, true);
foreach ($arr as $key => $value) {
if ($str == '') {
$str = $str . $key . '=' . $value;
} else {
$str = $str . ', ' . $key . '=' . $value;
... | php | public static function jsonToList($p_json)
{
$str = '';
$arr = json_decode($p_json, true);
foreach ($arr as $key => $value) {
if ($str == '') {
$str = $str . $key . '=' . $value;
} else {
$str = $str . ', ' . $key . '=' . $value;
... | [
"public",
"static",
"function",
"jsonToList",
"(",
"$",
"p_json",
")",
"{",
"$",
"str",
"=",
"''",
";",
"$",
"arr",
"=",
"json_decode",
"(",
"$",
"p_json",
",",
"true",
")",
";",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"key",
"=>",
"$",
"value",
"... | Transforme un json en liste
@return string | [
"Transforme",
"un",
"json",
"en",
"liste"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Tools/PBXString.php#L224-L237 |
9,486 | jeromeklam/freefw | src/FreeFW/Tools/PBXString.php | PBXString.hidePart | public static function hidePart($p_string, $p_replace = 'X', $p_left = 4, $p_right = 4)
{
$len = strlen($p_string);
$str = substr($p_string, 0, $p_left) .
str_pad('', $len - $p_left - $p_right, $p_replace) .
substr($p_string, $len - $p_right);
return $str;
} | php | public static function hidePart($p_string, $p_replace = 'X', $p_left = 4, $p_right = 4)
{
$len = strlen($p_string);
$str = substr($p_string, 0, $p_left) .
str_pad('', $len - $p_left - $p_right, $p_replace) .
substr($p_string, $len - $p_right);
return $str;
} | [
"public",
"static",
"function",
"hidePart",
"(",
"$",
"p_string",
",",
"$",
"p_replace",
"=",
"'X'",
",",
"$",
"p_left",
"=",
"4",
",",
"$",
"p_right",
"=",
"4",
")",
"{",
"$",
"len",
"=",
"strlen",
"(",
"$",
"p_string",
")",
";",
"$",
"str",
"="... | Hide part of string with a caracter
@param string $p_string
@param string $p_replace
@param number $p_left
@param number $p_right
@return string | [
"Hide",
"part",
"of",
"string",
"with",
"a",
"caracter"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Tools/PBXString.php#L321-L328 |
9,487 | mothepro/MoCompiler | src/Constants.php | Constants.run | public function run($require = false) {
foreach($this->const as $name => $val)
define(self::nameEncode($name, self::NAMESPACE_SEPERATOR), self::encode($val) );
foreach($this->ini as $name => $val)
ini_set(self::nameEncode($name, self::INI_SEPERATOR), self::encode($val) );
$GLOBALS["constants"] = $this... | php | public function run($require = false) {
foreach($this->const as $name => $val)
define(self::nameEncode($name, self::NAMESPACE_SEPERATOR), self::encode($val) );
foreach($this->ini as $name => $val)
ini_set(self::nameEncode($name, self::INI_SEPERATOR), self::encode($val) );
$GLOBALS["constants"] = $this... | [
"public",
"function",
"run",
"(",
"$",
"require",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"const",
"as",
"$",
"name",
"=>",
"$",
"val",
")",
"define",
"(",
"self",
"::",
"nameEncode",
"(",
"$",
"name",
",",
"self",
"::",
"NAMESPA... | Adds the constants for the current app
@param boolean $require Whether to require the files | [
"Adds",
"the",
"constants",
"for",
"the",
"current",
"app"
] | bedc26fe9f11fbd87bc062175deba95051c7b9b0 | https://github.com/mothepro/MoCompiler/blob/bedc26fe9f11fbd87bc062175deba95051c7b9b0/src/Constants.php#L170-L182 |
9,488 | gibboncms/liana-core | src/Liana.php | Liana.prepareForConsoleCommand | public function prepareForConsoleCommand()
{
$this->withFacades();
$this->make('cache');
$this->make('queue');
$this->configure('database');
$this->register('Illuminate\Queue\ConsoleServiceProvider');
} | php | public function prepareForConsoleCommand()
{
$this->withFacades();
$this->make('cache');
$this->make('queue');
$this->configure('database');
$this->register('Illuminate\Queue\ConsoleServiceProvider');
} | [
"public",
"function",
"prepareForConsoleCommand",
"(",
")",
"{",
"$",
"this",
"->",
"withFacades",
"(",
")",
";",
"$",
"this",
"->",
"make",
"(",
"'cache'",
")",
";",
"$",
"this",
"->",
"make",
"(",
"'queue'",
")",
";",
"$",
"this",
"->",
"configure",
... | Prepare the application to execute a console command.
Removed migration and seeding providers
@return void | [
"Prepare",
"the",
"application",
"to",
"execute",
"a",
"console",
"command",
".",
"Removed",
"migration",
"and",
"seeding",
"providers"
] | f76af9ecd5bf35ca5c55ff4f638008c2fd41ecaf | https://github.com/gibboncms/liana-core/blob/f76af9ecd5bf35ca5c55ff4f638008c2fd41ecaf/src/Liana.php#L34-L44 |
9,489 | jivoo/core | src/Parse/ParseInput.php | ParseInput.pop | public function pop()
{
if (isset($this->input[$this->pos])) {
return $this->input[$this->pos ++];
}
return null;
} | php | public function pop()
{
if (isset($this->input[$this->pos])) {
return $this->input[$this->pos ++];
}
return null;
} | [
"public",
"function",
"pop",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"input",
"[",
"$",
"this",
"->",
"pos",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"[",
"$",
"this",
"->",
"pos",
"++",
"]",
";",
"}",
"ret... | Return the current element and advance the sequence position.
@return mxied|null The element or null if end of sequence. | [
"Return",
"the",
"current",
"element",
"and",
"advance",
"the",
"sequence",
"position",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Parse/ParseInput.php#L73-L79 |
9,490 | lrc-se/bth-anax-repository | src/Repository/RepositoryManager.php | RepositoryManager.createRepository | public function createRepository($model, $config)
{
$defaults = [
'type' => 'db-soft',
'key' => 'id',
'deleted' => 'deleted'
];
$config = array_merge($defaults, $config);
switch ($config['type']) {
case 'db':
$r... | php | public function createRepository($model, $config)
{
$defaults = [
'type' => 'db-soft',
'key' => 'id',
'deleted' => 'deleted'
];
$config = array_merge($defaults, $config);
switch ($config['type']) {
case 'db':
$r... | [
"public",
"function",
"createRepository",
"(",
"$",
"model",
",",
"$",
"config",
")",
"{",
"$",
"defaults",
"=",
"[",
"'type'",
"=>",
"'db-soft'",
",",
"'key'",
"=>",
"'id'",
",",
"'deleted'",
"=>",
"'deleted'",
"]",
";",
"$",
"config",
"=",
"array_merge... | Create a new repository and add it to the manager.
@param string $model Model class.
@param array $config Repository configuration.
@return ManagedRepository The created repository.
@throws RepositoryException If the requested repository type is not implemented. | [
"Create",
"a",
"new",
"repository",
"and",
"add",
"it",
"to",
"the",
"manager",
"."
] | 344a0795fbfadf34ea768719dc5cf2f1d90154df | https://github.com/lrc-se/bth-anax-repository/blob/344a0795fbfadf34ea768719dc5cf2f1d90154df/src/Repository/RepositoryManager.php#L26-L48 |
9,491 | lrc-se/bth-anax-repository | src/Repository/RepositoryManager.php | RepositoryManager.addRepository | public function addRepository($repository)
{
$class = $repository->getModelClass();
if ($this->getByClass($class)) {
throw new RepositoryException("The manager already contains a repository for the model class '$class'");
}
$repository->setManager($this);
... | php | public function addRepository($repository)
{
$class = $repository->getModelClass();
if ($this->getByClass($class)) {
throw new RepositoryException("The manager already contains a repository for the model class '$class'");
}
$repository->setManager($this);
... | [
"public",
"function",
"addRepository",
"(",
"$",
"repository",
")",
"{",
"$",
"class",
"=",
"$",
"repository",
"->",
"getModelClass",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getByClass",
"(",
"$",
"class",
")",
")",
"{",
"throw",
"new",
"Reposito... | Register a repository with the manager.
@param ManagedRepository $repository Manageable repository.
@throws RepositoryException If the manager already contains a repository for the same model class. | [
"Register",
"a",
"repository",
"with",
"the",
"manager",
"."
] | 344a0795fbfadf34ea768719dc5cf2f1d90154df | https://github.com/lrc-se/bth-anax-repository/blob/344a0795fbfadf34ea768719dc5cf2f1d90154df/src/Repository/RepositoryManager.php#L58-L67 |
9,492 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListEntry.php | Zend_Gdata_Spreadsheets_ListEntry.getCustomByName | public function getCustomByName($name = null)
{
if ($name === null) {
return $this->_customByName;
} else {
if (array_key_exists($name, $this->customByName)) {
return $this->_customByName[$name];
} else {
return null;
}
... | php | public function getCustomByName($name = null)
{
if ($name === null) {
return $this->_customByName;
} else {
if (array_key_exists($name, $this->customByName)) {
return $this->_customByName[$name];
} else {
return null;
}
... | [
"public",
"function",
"getCustomByName",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_customByName",
";",
"}",
"else",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
"... | Gets a single row element contained by this list entry using its name.
@param string $name The name of a custom element to return. If null
or not defined, an array containing all custom elements
indexed by name will be returned.
@return mixed If a name is specified, the
Zend_Gdata_Spreadsheets_Extension_Custom element ... | [
"Gets",
"a",
"single",
"row",
"element",
"contained",
"by",
"this",
"list",
"entry",
"using",
"its",
"name",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListEntry.php#L117-L128 |
9,493 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListEntry.php | Zend_Gdata_Spreadsheets_ListEntry.setCustom | public function setCustom($custom)
{
$this->_custom = array();
foreach ($custom as $c) {
$this->addCustom($c);
}
return $this;
} | php | public function setCustom($custom)
{
$this->_custom = array();
foreach ($custom as $c) {
$this->addCustom($c);
}
return $this;
} | [
"public",
"function",
"setCustom",
"(",
"$",
"custom",
")",
"{",
"$",
"this",
"->",
"_custom",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"custom",
"as",
"$",
"c",
")",
"{",
"$",
"this",
"->",
"addCustom",
"(",
"$",
"c",
")",
";",
"}",
"... | Sets the row elements contained by this list entry. If any
custom row elements were previously stored, they will be overwritten.
@param array $custom The custom row elements to be contained in this
list entry.
@return Zend_Gdata_Spreadsheets_ListEntry Provides a fluent interface. | [
"Sets",
"the",
"row",
"elements",
"contained",
"by",
"this",
"list",
"entry",
".",
"If",
"any",
"custom",
"row",
"elements",
"were",
"previously",
"stored",
"they",
"will",
"be",
"overwritten",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListEntry.php#L137-L144 |
9,494 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListEntry.php | Zend_Gdata_Spreadsheets_ListEntry.addCustom | public function addCustom($custom)
{
$this->_custom[] = $custom;
$this->_customByName[$custom->getColumnName()] = $custom;
return $this;
} | php | public function addCustom($custom)
{
$this->_custom[] = $custom;
$this->_customByName[$custom->getColumnName()] = $custom;
return $this;
} | [
"public",
"function",
"addCustom",
"(",
"$",
"custom",
")",
"{",
"$",
"this",
"->",
"_custom",
"[",
"]",
"=",
"$",
"custom",
";",
"$",
"this",
"->",
"_customByName",
"[",
"$",
"custom",
"->",
"getColumnName",
"(",
")",
"]",
"=",
"$",
"custom",
";",
... | Add an individual custom row element to this list entry.
@param Zend_Gdata_Spreadsheets_Extension_Custom $custom The custom
element to be added.
@return Zend_Gdata_Spreadsheets_ListEntry Provides a fluent interface. | [
"Add",
"an",
"individual",
"custom",
"row",
"element",
"to",
"this",
"list",
"entry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListEntry.php#L152-L157 |
9,495 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListEntry.php | Zend_Gdata_Spreadsheets_ListEntry.removeCustom | public function removeCustom($index)
{
if (array_key_exists($index, $this->_custom)) {
$element = $this->_custom[$index];
// Remove element
unset($this->_custom[$index]);
// Re-index the array
$this->_custom = array_values($this->_custom);
... | php | public function removeCustom($index)
{
if (array_key_exists($index, $this->_custom)) {
$element = $this->_custom[$index];
// Remove element
unset($this->_custom[$index]);
// Re-index the array
$this->_custom = array_values($this->_custom);
... | [
"public",
"function",
"removeCustom",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"_custom",
")",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"_custom",
"[",
"$",
"index",
"]",
";",
"... | Remove an individual row element from this list entry by index. This
will cause the array to be re-indexed.
@param int $index The index of the custom element to be deleted.
@return Zend_Gdata_Spreadsheets_ListEntry Provides a fluent interface.
@throws Zend_Gdata_App_InvalidArgumentException | [
"Remove",
"an",
"individual",
"row",
"element",
"from",
"this",
"list",
"entry",
"by",
"index",
".",
"This",
"will",
"cause",
"the",
"array",
"to",
"be",
"re",
"-",
"indexed",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListEntry.php#L166-L183 |
9,496 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListEntry.php | Zend_Gdata_Spreadsheets_ListEntry.removeCustomByName | public function removeCustomByName($name)
{
if (array_key_exists($name, $this->_customByName)) {
$element = $this->_customByName[$name];
// Remove element
unset($this->_customByName[$name]);
// Be sure to delete from both arrays!
$key = array_searc... | php | public function removeCustomByName($name)
{
if (array_key_exists($name, $this->_customByName)) {
$element = $this->_customByName[$name];
// Remove element
unset($this->_customByName[$name]);
// Be sure to delete from both arrays!
$key = array_searc... | [
"public",
"function",
"removeCustomByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_customByName",
")",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"_customByName",
"[",
"$",
"name",
... | Remove an individual row element from this list entry by name.
@param string $name The name of the custom element to be deleted.
@return Zend_Gdata_Spreadsheets_ListEntry Provides a fluent interface.
@throws Zend_Gdata_App_InvalidArgumentException | [
"Remove",
"an",
"individual",
"row",
"element",
"from",
"this",
"list",
"entry",
"by",
"name",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListEntry.php#L191-L206 |
9,497 | GustavoGutierrez/insight | framework/Base/Plugin.php | Plugin.embedJs | public function embedJs($src, $opts = array(), $in_admin = false) {
$js = new Script($src, $opts, $in_admin);
if ($js->getInAdmin()) {
array_push($this->scripts_admin, $js);
} else {
array_push($this->scripts_frontend, $js);
}
} | php | public function embedJs($src, $opts = array(), $in_admin = false) {
$js = new Script($src, $opts, $in_admin);
if ($js->getInAdmin()) {
array_push($this->scripts_admin, $js);
} else {
array_push($this->scripts_frontend, $js);
}
} | [
"public",
"function",
"embedJs",
"(",
"$",
"src",
",",
"$",
"opts",
"=",
"array",
"(",
")",
",",
"$",
"in_admin",
"=",
"false",
")",
"{",
"$",
"js",
"=",
"new",
"Script",
"(",
"$",
"src",
",",
"$",
"opts",
",",
"$",
"in_admin",
")",
";",
"if",
... | Permite agregar un js a la pila de scripts para ser cargado en el punto espesificado
@param string $src nombre o ruta del archivo js que se encuentra en assets/js
@param array $opts Opciones de configuracion necesarias para cargar el js
@param boolean $in_admin Indica si el js sera cargado en el administrador
... | [
"Permite",
"agregar",
"un",
"js",
"a",
"la",
"pila",
"de",
"scripts",
"para",
"ser",
"cargado",
"en",
"el",
"punto",
"espesificado"
] | 6b70e4e139fcc1cc0bd6e75e847ec59488ecc897 | https://github.com/GustavoGutierrez/insight/blob/6b70e4e139fcc1cc0bd6e75e847ec59488ecc897/framework/Base/Plugin.php#L69-L77 |
9,498 | GustavoGutierrez/insight | framework/Base/Plugin.php | Plugin.embedCss | public function embedCss($src, $opts = array(), $in_admin = false) {
$css = new Style($src, $opts, $in_admin);
if ($css->getInAdmin()) {
array_push($this->styles_admin, $css);
} else {
array_push($this->styles_frontend, $css);
}
} | php | public function embedCss($src, $opts = array(), $in_admin = false) {
$css = new Style($src, $opts, $in_admin);
if ($css->getInAdmin()) {
array_push($this->styles_admin, $css);
} else {
array_push($this->styles_frontend, $css);
}
} | [
"public",
"function",
"embedCss",
"(",
"$",
"src",
",",
"$",
"opts",
"=",
"array",
"(",
")",
",",
"$",
"in_admin",
"=",
"false",
")",
"{",
"$",
"css",
"=",
"new",
"Style",
"(",
"$",
"src",
",",
"$",
"opts",
",",
"$",
"in_admin",
")",
";",
"if",... | Permite agregar un css a la pila de styles para ser cargado en el punto espesificado
@param string $src nombre o ruta del archivo css que se encuentra en assets/css
@param array $opts Opciones de configuracion necesarias para cargar el css
@param boolean $in_admin Indica si el css sera cargado en el administr... | [
"Permite",
"agregar",
"un",
"css",
"a",
"la",
"pila",
"de",
"styles",
"para",
"ser",
"cargado",
"en",
"el",
"punto",
"espesificado"
] | 6b70e4e139fcc1cc0bd6e75e847ec59488ecc897 | https://github.com/GustavoGutierrez/insight/blob/6b70e4e139fcc1cc0bd6e75e847ec59488ecc897/framework/Base/Plugin.php#L87-L95 |
9,499 | GustavoGutierrez/insight | framework/Base/Plugin.php | Plugin.get_plugin_name | protected function get_plugin_name() {
$path = $this->get_path();
$array = explode('/', $path);
unset($array[count($array) - 1]);
unset($array[count($array) - 1]);
return end($array) . '/' . DIRECTORY_APP_NAME;
} | php | protected function get_plugin_name() {
$path = $this->get_path();
$array = explode('/', $path);
unset($array[count($array) - 1]);
unset($array[count($array) - 1]);
return end($array) . '/' . DIRECTORY_APP_NAME;
} | [
"protected",
"function",
"get_plugin_name",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"get_path",
"(",
")",
";",
"$",
"array",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"unset",
"(",
"$",
"array",
"[",
"count",
"(",
"$",
"... | get folder name of plugin builder_complex_app
@return string folder plugin parent name | [
"get",
"folder",
"name",
"of",
"plugin",
"builder_complex_app"
] | 6b70e4e139fcc1cc0bd6e75e847ec59488ecc897 | https://github.com/GustavoGutierrez/insight/blob/6b70e4e139fcc1cc0bd6e75e847ec59488ecc897/framework/Base/Plugin.php#L101-L107 |
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.