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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,900 | ouropencode/dachi | src/Template.php | Template.get | public static function get($template) {
if(self::$twig === null)
self::initialize();
return self::$twig->loadTemplate($template . '.twig');
} | php | public static function get($template) {
if(self::$twig === null)
self::initialize();
return self::$twig->loadTemplate($template . '.twig');
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"template",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"twig",
"===",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"self",
"::",
"$",
"twig",
"->",
"loadTemplate",
"(",
"$",
"template... | Retreive a twig template object
@param string $template The template file
@return Twig_Template | [
"Retreive",
"a",
"twig",
"template",
"object"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L166-L171 |
20,901 | ouropencode/dachi | src/Template.php | Template.display | public static function display($template, $target_id) {
if(self::$twig === null)
self::initialize();
self::$render_actions[] = array(
"type" => "display_tpl",
"template" => $template,
"target_id" => $target_id
);
} | php | public static function display($template, $target_id) {
if(self::$twig === null)
self::initialize();
self::$render_actions[] = array(
"type" => "display_tpl",
"template" => $template,
"target_id" => $target_id
);
} | [
"public",
"static",
"function",
"display",
"(",
"$",
"template",
",",
"$",
"target_id",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"twig",
"===",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"self",
"::",
"$",
"render_actions",
"[",
"]",
"=",... | Append a template render action to the render queue
@param string $template The template file
@param string $target_id The dachi-ui-block to load into
@return null | [
"Append",
"a",
"template",
"render",
"action",
"to",
"the",
"render",
"queue"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L179-L188 |
20,902 | ouropencode/dachi | src/Template.php | Template.render | public static function render() {
$apiMode = Request::isAPI();
if(self::$twig === null)
self::initialize();
$data = Request::getAllData();
if(!$apiMode) {
$data["siteName"] = Configuration::get("dachi.siteName", "Unnamed Dachi Installation");
$data["timezone"] = Configuration::get("dachi.timezone",... | php | public static function render() {
$apiMode = Request::isAPI();
if(self::$twig === null)
self::initialize();
$data = Request::getAllData();
if(!$apiMode) {
$data["siteName"] = Configuration::get("dachi.siteName", "Unnamed Dachi Installation");
$data["timezone"] = Configuration::get("dachi.timezone",... | [
"public",
"static",
"function",
"render",
"(",
")",
"{",
"$",
"apiMode",
"=",
"Request",
"::",
"isAPI",
"(",
")",
";",
"if",
"(",
"self",
"::",
"$",
"twig",
"===",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"$",
"data",
"=",
"Request",... | Render the render queue to the browser
If the request is an ajax request, the render queue and data will be sent to the browser via JSON.
If the request is a standard request, the render queue will be rendered server-side and will be sent to the browser via HTML.
@internal
@see Router
@return null | [
"Render",
"the",
"render",
"queue",
"to",
"the",
"browser"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L200-L255 |
20,903 | ouropencode/dachi | src/Template.php | Template.redirect | public static function redirect($location, $soft = false) {
if(substr($location, 0, 4) !== "http")
$location = Configuration::get("dachi.baseURL") . $location;
self::$render_actions[] = array(
"type" => "redirect",
"location" => $location,
"soft" => $soft
);
} | php | public static function redirect($location, $soft = false) {
if(substr($location, 0, 4) !== "http")
$location = Configuration::get("dachi.baseURL") . $location;
self::$render_actions[] = array(
"type" => "redirect",
"location" => $location,
"soft" => $soft
);
} | [
"public",
"static",
"function",
"redirect",
"(",
"$",
"location",
",",
"$",
"soft",
"=",
"false",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"location",
",",
"0",
",",
"4",
")",
"!==",
"\"http\"",
")",
"$",
"location",
"=",
"Configuration",
"::",
"get"... | Append a redirect action to the render queue.
If $location does not start with "http", the dachi.baseURL configuration value will be prepended
@param string $location The location to redirect to
@return null | [
"Append",
"a",
"redirect",
"action",
"to",
"the",
"render",
"queue",
"."
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L265-L274 |
20,904 | Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.access | public function access($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.access') || $user->superAdmin();
} | php | public function access($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.access') || $user->superAdmin();
} | [
"public",
"function",
"access",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->",
"id",
")",
";",
"return",
"$",
"user",
"->",
"hasPermission",
"(",
"'laralum::users.access'",
")",
"||",
"$",
"user",
"->"... | Determine if the current user can view users module.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"view",
"users",
"module",
"."
] | 788851d4cdf4bff548936faf1b12cf4697d13428 | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L19-L24 |
20,905 | Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.view | public function view($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.view') || $user->superAdmin();
} | php | public function view($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.view') || $user->superAdmin();
} | [
"public",
"function",
"view",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->",
"id",
")",
";",
"return",
"$",
"user",
"->",
"hasPermission",
"(",
"'laralum::users.view'",
")",
"||",
"$",
"user",
"->",
... | Determine if the current user can view users.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"view",
"users",
"."
] | 788851d4cdf4bff548936faf1b12cf4697d13428 | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L33-L38 |
20,906 | Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.create | public function create($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.create') || $user->superAdmin();
} | php | public function create($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.create') || $user->superAdmin();
} | [
"public",
"function",
"create",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->",
"id",
")",
";",
"return",
"$",
"user",
"->",
"hasPermission",
"(",
"'laralum::users.create'",
")",
"||",
"$",
"user",
"->"... | Determine if the current user can create users.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"create",
"users",
"."
] | 788851d4cdf4bff548936faf1b12cf4697d13428 | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L47-L52 |
20,907 | Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.update | public function update($user, User $userToManage)
{
if ($userToManage->id == $user->id || $userToManage->superAdmin()) {
return false;
}
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.update') || $user->superAdmin();
} | php | public function update($user, User $userToManage)
{
if ($userToManage->id == $user->id || $userToManage->superAdmin()) {
return false;
}
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.update') || $user->superAdmin();
} | [
"public",
"function",
"update",
"(",
"$",
"user",
",",
"User",
"$",
"userToManage",
")",
"{",
"if",
"(",
"$",
"userToManage",
"->",
"id",
"==",
"$",
"user",
"->",
"id",
"||",
"$",
"userToManage",
"->",
"superAdmin",
"(",
")",
")",
"{",
"return",
"fal... | Determine if the current user can update users.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"update",
"users",
"."
] | 788851d4cdf4bff548936faf1b12cf4697d13428 | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L61-L70 |
20,908 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.isQueryAllowed | public function isQueryAllowed( ezcDbHandler $db, $query )
{
if ( strstr( $query, 'AUTO_INCREMENT' ) ) // detect AUTO_INCREMENT and return imediately. Will process later.
{
return false;
}
if ( substr( $query, 0, 10 ) == 'DROP TABLE' )
{
$tableName = ... | php | public function isQueryAllowed( ezcDbHandler $db, $query )
{
if ( strstr( $query, 'AUTO_INCREMENT' ) ) // detect AUTO_INCREMENT and return imediately. Will process later.
{
return false;
}
if ( substr( $query, 0, 10 ) == 'DROP TABLE' )
{
$tableName = ... | [
"public",
"function",
"isQueryAllowed",
"(",
"ezcDbHandler",
"$",
"db",
",",
"$",
"query",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"query",
",",
"'AUTO_INCREMENT'",
")",
")",
"// detect AUTO_INCREMENT and return imediately. Will process later.",
"{",
"return",
"fal... | Checks if query allowed.
Perform testing if table exist for DROP TABLE query
to avoid stoping execution while try to drop not existent table.
@param ezcDbHandler $db
@param string $query
@return boolean false if query should not be executed. | [
"Checks",
"if",
"query",
"allowed",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L47-L80 |
20,909 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.generateAdditionalDropSequenceStatements | protected function generateAdditionalDropSequenceStatements( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db )
{
$reader = new ezcDbSchemaOracleReader();
$schema = $reader->loadFromDb( $db )->getSchema();
foreach ( $dbSchemaDiff->removedTables as $table => $true )
{
forea... | php | protected function generateAdditionalDropSequenceStatements( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db )
{
$reader = new ezcDbSchemaOracleReader();
$schema = $reader->loadFromDb( $db )->getSchema();
foreach ( $dbSchemaDiff->removedTables as $table => $true )
{
forea... | [
"protected",
"function",
"generateAdditionalDropSequenceStatements",
"(",
"ezcDbSchemaDiff",
"$",
"dbSchemaDiff",
",",
"ezcDbHandler",
"$",
"db",
")",
"{",
"$",
"reader",
"=",
"new",
"ezcDbSchemaOracleReader",
"(",
")",
";",
"$",
"schema",
"=",
"$",
"reader",
"->"... | Generate additional drop sequence statements
Some sequences might not be dropped automatically, this method generates
additional DROP SEQUENCE queries for those.
Since Oracle only allows sequence identifiers up to 30 characters
sequences for long table / column names may be shortened. In this case
the sequence name d... | [
"Generate",
"additional",
"drop",
"sequence",
"statements"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L252-L272 |
20,910 | novaway/open-graph | src/OpenGraphGeneratorBuilder.php | OpenGraphGeneratorBuilder.build | public function build()
{
$annotationReader = $this->annotationReader;
if (null === $annotationReader) {
$annotationReader = new AnnotationReader();
if (null !== $this->cacheDirectory) {
$cacheDirectory = sprintf('%s/annotations', $this->cacheDirectory);
... | php | public function build()
{
$annotationReader = $this->annotationReader;
if (null === $annotationReader) {
$annotationReader = new AnnotationReader();
if (null !== $this->cacheDirectory) {
$cacheDirectory = sprintf('%s/annotations', $this->cacheDirectory);
... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"annotationReader",
"=",
"$",
"this",
"->",
"annotationReader",
";",
"if",
"(",
"null",
"===",
"$",
"annotationReader",
")",
"{",
"$",
"annotationReader",
"=",
"new",
"AnnotationReader",
"(",
")",
";",
"if... | Create open graph object | [
"Create",
"open",
"graph",
"object"
] | 19817bee4b91cf26ca3fe44883ad58b32328e464 | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/OpenGraphGeneratorBuilder.php#L59-L85 |
20,911 | novaway/open-graph | src/OpenGraphGeneratorBuilder.php | OpenGraphGeneratorBuilder.setCacheDirectory | public function setCacheDirectory($directory)
{
if (!is_dir($directory)) {
$this->createDirectory($directory);
}
if (!is_writable($directory)) {
throw new \InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
}
$this-... | php | public function setCacheDirectory($directory)
{
if (!is_dir($directory)) {
$this->createDirectory($directory);
}
if (!is_writable($directory)) {
throw new \InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
}
$this-... | [
"public",
"function",
"setCacheDirectory",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"this",
"->",
"createDirectory",
"(",
"$",
"directory",
")",
";",
"}",
"if",
"(",
"!",
"is_writable",
"(",
... | Set cache directory
@param string $directory
@return OpenGraphGeneratorBuilder | [
"Set",
"cache",
"directory"
] | 19817bee4b91cf26ca3fe44883ad58b32328e464 | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/OpenGraphGeneratorBuilder.php#L132-L145 |
20,912 | jasny/controller | src/Controller/Session.php | Session.useSession | public function useSession()
{
$this->session = $this->getRequest()->getAttribute('session');
if (!isset($this->session)) {
$this->session =& $_SESSION;
}
} | php | public function useSession()
{
$this->session = $this->getRequest()->getAttribute('session');
if (!isset($this->session)) {
$this->session =& $_SESSION;
}
} | [
"public",
"function",
"useSession",
"(",
")",
"{",
"$",
"this",
"->",
"session",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getAttribute",
"(",
"'session'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"session",
")",
")",
... | Link the session to the session property in the controller | [
"Link",
"the",
"session",
"to",
"the",
"session",
"property",
"in",
"the",
"controller"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Session.php#L36-L43 |
20,913 | sciactive/nymph-server | src/Entity.php | Entity.factoryReference | public static function factoryReference($reference) {
$className = $reference[2];
if (!class_exists($className)) {
throw new Exceptions\EntityClassNotFoundException(
"factoryReference called for a class that can't be found, $className."
);
}
$entity = call_user_func([$className, 'f... | php | public static function factoryReference($reference) {
$className = $reference[2];
if (!class_exists($className)) {
throw new Exceptions\EntityClassNotFoundException(
"factoryReference called for a class that can't be found, $className."
);
}
$entity = call_user_func([$className, 'f... | [
"public",
"static",
"function",
"factoryReference",
"(",
"$",
"reference",
")",
"{",
"$",
"className",
"=",
"$",
"reference",
"[",
"2",
"]",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
... | Create a new sleeping reference instance.
Sleeping references won't retrieve their data from the database until it
is actually used.
@param array $reference The Nymph Entity Reference to use to wake.
@return \Nymph\Entity The new instance. | [
"Create",
"a",
"new",
"sleeping",
"reference",
"instance",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L309-L319 |
20,914 | sciactive/nymph-server | src/Entity.php | Entity.& | public function &__get($name) {
if ($name === 'guid') {
return $this->$name;
}
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return $this->$name;
}
// Unserialize.
if... | php | public function &__get($name) {
if ($name === 'guid') {
return $this->$name;
}
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return $this->$name;
}
// Unserialize.
if... | [
"public",
"function",
"&",
"__get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"'guid'",
")",
"{",
"return",
"$",
"this",
"->",
"$",
"name",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"-... | Retrieve a variable.
You do not need to explicitly call this method. It is called by PHP when
you access the variable normally.
@param string $name The name of the variable.
@return mixed The value of the variable or null if it doesn't exist. | [
"Retrieve",
"a",
"variable",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L330-L401 |
20,915 | sciactive/nymph-server | src/Entity.php | Entity.__isset | public function __isset($name) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'guid'
|| $name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return isset($this->$name);
}
// Unserialize.
if (isset($this->sdata[$nam... | php | public function __isset($name) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'guid'
|| $name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return isset($this->$name);
}
// Unserialize.
if (isset($this->sdata[$nam... | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"$",
"name",
"===",
"'guid'",
"||",
"$",
"name",
"===",
... | Checks whether a variable is set.
You do not need to explicitly call this method. It is called by PHP when
you access the variable normally.
@param string $name The name of the variable.
@return bool
@todo Check that a referenced entity has not been deleted. | [
"Checks",
"whether",
"a",
"variable",
"is",
"set",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L413-L430 |
20,916 | sciactive/nymph-server | src/Entity.php | Entity.entityToReference | private function entityToReference(&$item, $key) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& isset($item->guid) && is_callable([$item, 'toReference'])) {
// This is an entity, so we should ... | php | private function entityToReference(&$item, $key) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& isset($item->guid) && is_callable([$item, 'toReference'])) {
// This is an entity, so we should ... | [
"private",
"function",
"entityToReference",
"(",
"&",
"$",
"item",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"(",
"is_a",
"(",
"$",
... | Check if an item is an entity, and if it is, convert it to a reference.
@param mixed &$item The item to check.
@param mixed $key Unused, but can't be removed because array_walk_recursive
will fail.
@access private | [
"Check",
"if",
"an",
"item",
"is",
"an",
"entity",
"and",
"if",
"it",
"is",
"convert",
"it",
"to",
"a",
"reference",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L605-L619 |
20,917 | sciactive/nymph-server | src/Entity.php | Entity.getDataReference | private function getDataReference($item) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& is_callable([$item, 'toReference'])) {
// Convert entities to references.
return $item->toReferenc... | php | private function getDataReference($item) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& is_callable([$item, 'toReference'])) {
// Convert entities to references.
return $item->toReferenc... | [
"private",
"function",
"getDataReference",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"(",
"is_a",
"(",
"$",
"item",
",",
"'\\Nymph\\Ent... | Convert entities to references and return the result.
@param mixed $item The item to convert.
@return mixed The resulting item. | [
"Convert",
"entities",
"to",
"references",
"and",
"return",
"the",
"result",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L673-L692 |
20,918 | sciactive/nymph-server | src/Entity.php | Entity.referenceSleep | public function referenceSleep($reference) {
if (count($reference) !== 3
|| $reference[0] !== 'nymph_entity_reference'
|| !is_int($reference[1])
|| !is_string($reference[2])) {
throw new Exceptions\InvalidParametersException(
'referenceSleep expects parameter 1 to be a valid ... | php | public function referenceSleep($reference) {
if (count($reference) !== 3
|| $reference[0] !== 'nymph_entity_reference'
|| !is_int($reference[1])
|| !is_string($reference[2])) {
throw new Exceptions\InvalidParametersException(
'referenceSleep expects parameter 1 to be a valid ... | [
"public",
"function",
"referenceSleep",
"(",
"$",
"reference",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"reference",
")",
"!==",
"3",
"||",
"$",
"reference",
"[",
"0",
"]",
"!==",
"'nymph_entity_reference'",
"||",
"!",
"is_int",
"(",
"$",
"reference",
"["... | Set up a sleeping reference.
@param array $reference The reference to use to wake. | [
"Set",
"up",
"a",
"sleeping",
"reference",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L927-L947 |
20,919 | sciactive/nymph-server | src/Entity.php | Entity.referenceWake | private function referenceWake() {
if (!$this->isASleepingReference) {
return true;
}
if (!class_exists($this->sleepingReference[2])) {
throw new Exceptions\EntityClassNotFoundException(
"Tried to wake sleeping reference entity that refers to a class ".
"that can't be found, ... | php | private function referenceWake() {
if (!$this->isASleepingReference) {
return true;
}
if (!class_exists($this->sleepingReference[2])) {
throw new Exceptions\EntityClassNotFoundException(
"Tried to wake sleeping reference entity that refers to a class ".
"that can't be found, ... | [
"private",
"function",
"referenceWake",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"this",
"->",
"sleepingReference",
"[",
"2",
"]",
")",
")"... | Wake from a sleeping reference.
@return bool True on success, false on failure. | [
"Wake",
"from",
"a",
"sleeping",
"reference",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L1000-L1025 |
20,920 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.appendStreamFilters | private function appendStreamFilters( $line )
{
// append the correct decoding filter
switch ( strtolower( $this->headers['Content-Transfer-Encoding'] ) )
{
case 'base64':
stream_filter_append( $this->fp, 'convert.base64-decode' );
break;
... | php | private function appendStreamFilters( $line )
{
// append the correct decoding filter
switch ( strtolower( $this->headers['Content-Transfer-Encoding'] ) )
{
case 'base64':
stream_filter_append( $this->fp, 'convert.base64-decode' );
break;
... | [
"private",
"function",
"appendStreamFilters",
"(",
"$",
"line",
")",
"{",
"// append the correct decoding filter",
"switch",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"headers",
"[",
"'Content-Transfer-Encoding'",
"]",
")",
")",
"{",
"case",
"'base64'",
":",
"str... | Sets the correct stream filters for the attachment.
$line should contain one line of data that should be written to file.
It is used to correctly determine the type of linebreak used in the mail.
@param string $line | [
"Sets",
"the",
"correct",
"stream",
"filters",
"for",
"the",
"attachment",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L190-L215 |
20,921 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.parseBody | public function parseBody( $line )
{
if ( $line !== '' )
{
if ( $this->dataWritten === false )
{
$this->appendStreamFilters( $line );
$this->dataWritten = true;
}
fwrite( $this->fp, $line );
}
} | php | public function parseBody( $line )
{
if ( $line !== '' )
{
if ( $this->dataWritten === false )
{
$this->appendStreamFilters( $line );
$this->dataWritten = true;
}
fwrite( $this->fp, $line );
}
} | [
"public",
"function",
"parseBody",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"line",
"!==",
"''",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataWritten",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"appendStreamFilters",
"(",
"$",
"line",
")",
";... | Parse the body of a message line by line.
This method is called by the parent part on a push basis. When there
are no more lines the parent part will call finish() to retrieve the
mailPart.
The file will be decoded and saved to the given temporary directory within
a directory based on the process ID and the time.
@p... | [
"Parse",
"the",
"body",
"of",
"a",
"message",
"line",
"by",
"line",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L230-L242 |
20,922 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.finish | public function finish()
{
fclose( $this->fp );
$this->fp = null;
// FIXME: DIRTY PGP HACK
// When we have PGP support these lines should be removed. They are here now to hide
// PGP parts since they will show up as file attachments if not.
if ( $this->mainType == "... | php | public function finish()
{
fclose( $this->fp );
$this->fp = null;
// FIXME: DIRTY PGP HACK
// When we have PGP support these lines should be removed. They are here now to hide
// PGP parts since they will show up as file attachments if not.
if ( $this->mainType == "... | [
"public",
"function",
"finish",
"(",
")",
"{",
"fclose",
"(",
"$",
"this",
"->",
"fp",
")",
";",
"$",
"this",
"->",
"fp",
"=",
"null",
";",
"// FIXME: DIRTY PGP HACK",
"// When we have PGP support these lines should be removed. They are here now to hide",
"// PGP parts ... | Return the result of the parsed file part.
This method is called automatically by the parent part.
@return ezcMailFile | [
"Return",
"the",
"result",
"of",
"the",
"parsed",
"file",
"part",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L251-L307 |
20,923 | infusephp/infuse | src/Application.php | Application.map | public function map($method, $route, $handler)
{
$this['router']->map($method, $route, $handler);
return $this;
} | php | public function map($method, $route, $handler)
{
$this['router']->map($method, $route, $handler);
return $this;
} | [
"public",
"function",
"map",
"(",
"$",
"method",
",",
"$",
"route",
",",
"$",
"handler",
")",
"{",
"$",
"this",
"[",
"'router'",
"]",
"->",
"map",
"(",
"$",
"method",
",",
"$",
"route",
",",
"$",
"handler",
")",
";",
"return",
"$",
"this",
";",
... | Adds a handler to the routing table for a given route.
@param string $method HTTP method
@param string $route path pattern
@param mixed $handler route handler
@return self | [
"Adds",
"a",
"handler",
"to",
"the",
"routing",
"table",
"for",
"a",
"given",
"route",
"."
] | 7520b237c69f3d8a07d95d7481b26027ced2ed83 | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L232-L237 |
20,924 | infusephp/infuse | src/Application.php | Application.handleRequest | public function handleRequest(Request $req)
{
// set host name from request if not already set
$config = $this['config'];
if (!$config->get('app.hostname')) {
$config->set('app.hostname', $req->host());
}
$res = new Response();
try {
// determ... | php | public function handleRequest(Request $req)
{
// set host name from request if not already set
$config = $this['config'];
if (!$config->get('app.hostname')) {
$config->set('app.hostname', $req->host());
}
$res = new Response();
try {
// determ... | [
"public",
"function",
"handleRequest",
"(",
"Request",
"$",
"req",
")",
"{",
"// set host name from request if not already set",
"$",
"config",
"=",
"$",
"this",
"[",
"'config'",
"]",
";",
"if",
"(",
"!",
"$",
"config",
"->",
"get",
"(",
"'app.hostname'",
")",... | Builds a response to an incoming request by routing
it through the application.
@param Request $req
@return Response | [
"Builds",
"a",
"response",
"to",
"an",
"incoming",
"request",
"by",
"routing",
"it",
"through",
"the",
"application",
"."
] | 7520b237c69f3d8a07d95d7481b26027ced2ed83 | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L265-L297 |
20,925 | infusephp/infuse | src/Application.php | Application.runMiddleware | public function runMiddleware(Request $req, Response $res)
{
$this->initMiddleware()->rewind();
return $this->nextMiddleware($req, $res);
} | php | public function runMiddleware(Request $req, Response $res)
{
$this->initMiddleware()->rewind();
return $this->nextMiddleware($req, $res);
} | [
"public",
"function",
"runMiddleware",
"(",
"Request",
"$",
"req",
",",
"Response",
"$",
"res",
")",
"{",
"$",
"this",
"->",
"initMiddleware",
"(",
")",
"->",
"rewind",
"(",
")",
";",
"return",
"$",
"this",
"->",
"nextMiddleware",
"(",
"$",
"req",
",",... | Runs the middleware chain.
@param Request $req
@param Response $res
@return Response $res | [
"Runs",
"the",
"middleware",
"chain",
"."
] | 7520b237c69f3d8a07d95d7481b26027ced2ed83 | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L335-L340 |
20,926 | infusephp/infuse | src/Application.php | Application.nextMiddleware | public function nextMiddleware(Request $req, Response $res)
{
$middleware = $this->middleware->current();
// base case - no middleware left
if (!$middleware) {
return $res;
}
// otherwise, call next middleware
$this->middleware->next();
return $... | php | public function nextMiddleware(Request $req, Response $res)
{
$middleware = $this->middleware->current();
// base case - no middleware left
if (!$middleware) {
return $res;
}
// otherwise, call next middleware
$this->middleware->next();
return $... | [
"public",
"function",
"nextMiddleware",
"(",
"Request",
"$",
"req",
",",
"Response",
"$",
"res",
")",
"{",
"$",
"middleware",
"=",
"$",
"this",
"->",
"middleware",
"->",
"current",
"(",
")",
";",
"// base case - no middleware left",
"if",
"(",
"!",
"$",
"m... | Calls the next middleware in the chain.
DO NOT call directly.
@param Request $req
@param Response $res
@return Response | [
"Calls",
"the",
"next",
"middleware",
"in",
"the",
"chain",
".",
"DO",
"NOT",
"call",
"directly",
"."
] | 7520b237c69f3d8a07d95d7481b26027ced2ed83 | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L366-L379 |
20,927 | traderinteractive/filter-dates-php | src/Filter/DateTimeZone.php | DateTimeZone.filter | public static function filter($value, bool $allowNull = false)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof \DateTimeZone) {
return $value;
}
if (!is_string($value) || trim($value) == '') {
t... | php | public static function filter($value, bool $allowNull = false)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof \DateTimeZone) {
return $value;
}
if (!is_string($value) || trim($value) == '') {
t... | [
"public",
"static",
"function",
"filter",
"(",
"$",
"value",
",",
"bool",
"$",
"allowNull",
"=",
"false",
")",
"{",
"if",
"(",
"self",
"::",
"valueIsNullAndValid",
"(",
"$",
"allowNull",
",",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"... | Filters the given value into a \DateTimeZone object.
@param mixed $value The value to be filtered.
@param boolean $allowNull True to allow nulls through, and false (default) if nulls should not be allowed.
@return \DateTimeZone|null
@throws FilterException if the value did not pass validation. | [
"Filters",
"the",
"given",
"value",
"into",
"a",
"\\",
"DateTimeZone",
"object",
"."
] | f9e60f139da3ebb565317c5d62a6fb0c347be4ee | https://github.com/traderinteractive/filter-dates-php/blob/f9e60f139da3ebb565317c5d62a6fb0c347be4ee/src/Filter/DateTimeZone.php#L22-L41 |
20,928 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Helper/Convert.php | Convert.logEntry | public static function logEntry($entry)
{
$parts = explode("|", $entry, 5);
$array = array();
if(count($parts) != 5)
{
$array["timestamp"] = 0;
$array["level"] = TeamSpeak3::LOGLEVEL_ERROR;
$array["channel"] = "ParamParser";
$array["server_id"] = "";
$array["msg"] ... | php | public static function logEntry($entry)
{
$parts = explode("|", $entry, 5);
$array = array();
if(count($parts) != 5)
{
$array["timestamp"] = 0;
$array["level"] = TeamSpeak3::LOGLEVEL_ERROR;
$array["channel"] = "ParamParser";
$array["server_id"] = "";
$array["msg"] ... | [
"public",
"static",
"function",
"logEntry",
"(",
"$",
"entry",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"\"|\"",
",",
"$",
"entry",
",",
"5",
")",
";",
"$",
"array",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parts",
")",
"... | Converts a specified log entry string into an array containing the data.
@param string $entry
@return array | [
"Converts",
"a",
"specified",
"log",
"entry",
"string",
"into",
"an",
"array",
"containing",
"the",
"data",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Convert.php#L258-L285 |
20,929 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.startWithNode | public static function startWithNode(
string $variable = null,
array $labels = []
): self {
$path = new self;
$path->elements = $path->elements->add(
new Node($variable, $labels)
);
$path->lastOperation = Node::class;
return $path;
} | php | public static function startWithNode(
string $variable = null,
array $labels = []
): self {
$path = new self;
$path->elements = $path->elements->add(
new Node($variable, $labels)
);
$path->lastOperation = Node::class;
return $path;
} | [
"public",
"static",
"function",
"startWithNode",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"path",
"=",
"new",
"self",
";",
"$",
"path",
"->",
"elements",
"=",
"$",
"path",
... | Start the path with the given node
@param string $variable
@param array $labels
@return self | [
"Start",
"the",
"path",
"with",
"the",
"given",
"node"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L35-L46 |
20,930 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.linkedTo | public function linkedTo(string $variable = null, array $labels = []): self
{
$path = new self;
$path->elements = $this
->elements
->add(Relationship::both())
->add(new Node($variable, $labels));
$path->lastOperation = Node::class;
return $path;
... | php | public function linkedTo(string $variable = null, array $labels = []): self
{
$path = new self;
$path->elements = $this
->elements
->add(Relationship::both())
->add(new Node($variable, $labels));
$path->lastOperation = Node::class;
return $path;
... | [
"public",
"function",
"linkedTo",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"path",
"=",
"new",
"self",
";",
"$",
"path",
"->",
"elements",
"=",
"$",
"this",
"->",
"elements... | Create a relationship to the given node
@param string $variable
@param array $labels
@return self | [
"Create",
"a",
"relationship",
"to",
"the",
"given",
"node"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L56-L66 |
20,931 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.through | public function through(
string $variable = null,
string $type = null,
string $direction = 'BOTH'
): self {
if ($this->elements->size() < 3) {
throw new LogicException;
}
$direction = \strtolower($direction);
$path = new self;
$path->elem... | php | public function through(
string $variable = null,
string $type = null,
string $direction = 'BOTH'
): self {
if ($this->elements->size() < 3) {
throw new LogicException;
}
$direction = \strtolower($direction);
$path = new self;
$path->elem... | [
"public",
"function",
"through",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"null",
",",
"string",
"$",
"direction",
"=",
"'BOTH'",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"elements",
"->",
"size",
"(",... | Type the last declared relationship in the path
@param string $variable
@param string $type
@param string $direction
@throws LogicException If no relationship in the path
@return self | [
"Type",
"the",
"last",
"declared",
"relationship",
"in",
"the",
"path"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L79-L99 |
20,932 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withADistanceOfAtLeast | public function withADistanceOfAtLeast(int $distance): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements->d... | php | public function withADistanceOfAtLeast(int $distance): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements->d... | [
"public",
"function",
"withADistanceOfAtLeast",
"(",
"int",
"$",
"distance",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"elements",
"->",
"size",
"(",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"LogicException",
";",
"}",
"$",
"path",
"=",
"c... | Define the minimum deepness of the relationship
@param int $distance
@throws LogicException If no relationship in the path
@return self | [
"Define",
"the",
"minimum",
"deepness",
"of",
"the",
"relationship"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L165-L181 |
20,933 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withParameter | public function withParameter(string $key, $value): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withParameter($key, $value);
$pa... | php | public function withParameter(string $key, $value): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withParameter($key, $value);
$pa... | [
"public",
"function",
"withParameter",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"lastOperation",
"===",
"Node",
"::",
"class",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"elements",
"->... | Add the given parameter to the last operation
@param string $key
@param mixed $value
@return self | [
"Add",
"the",
"given",
"parameter",
"to",
"the",
"last",
"operation"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L245-L271 |
20,934 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withProperty | public function withProperty(string $property, string $cypher): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withProperty($property, $cyp... | php | public function withProperty(string $property, string $cypher): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withProperty($property, $cyp... | [
"public",
"function",
"withProperty",
"(",
"string",
"$",
"property",
",",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"lastOperation",
"===",
"Node",
"::",
"class",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
... | Add the given property to the last operation
@param string $property
@param string $cypher
@return self | [
"Add",
"the",
"given",
"property",
"to",
"the",
"last",
"operation"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L281-L307 |
20,935 | Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.parameters | public function parameters(): MapInterface
{
if ($this->parameters) {
return $this->parameters;
}
return $this->parameters = $this->elements->reduce(
new Map('string', Parameter::class),
function(Map $carry, $element): Map {
return $carry-... | php | public function parameters(): MapInterface
{
if ($this->parameters) {
return $this->parameters;
}
return $this->parameters = $this->elements->reduce(
new Map('string', Parameter::class),
function(Map $carry, $element): Map {
return $carry-... | [
"public",
"function",
"parameters",
"(",
")",
":",
"MapInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"parameters",
";",
"}",
"return",
"$",
"this",
"->",
"parameters",
"=",
"$",
"this",
"->",
"eleme... | Return all the parameters of the path
@return MapInterface<string, Parameter> | [
"Return",
"all",
"the",
"parameters",
"of",
"the",
"path"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L314-L326 |
20,936 | OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.executeFFmpegForMedia | private function executeFFmpegForMedia($cmd, $format, $resolution, $media) {
$ffmpeg_start = microtime(true);
$this->getContainer()->get('oktolab_media_ffmpeg')
->executeFFmpegForMedia(
$resolution['encoder'],
$cmd,
$media
)
... | php | private function executeFFmpegForMedia($cmd, $format, $resolution, $media) {
$ffmpeg_start = microtime(true);
$this->getContainer()->get('oktolab_media_ffmpeg')
->executeFFmpegForMedia(
$resolution['encoder'],
$cmd,
$media
)
... | [
"private",
"function",
"executeFFmpegForMedia",
"(",
"$",
"cmd",
",",
"$",
"format",
",",
"$",
"resolution",
",",
"$",
"media",
")",
"{",
"$",
"ffmpeg_start",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"... | creates a media object and runs the ffmpeg command for the given resolution.
the command will be tracked to update the progress from 0 - 100 in realtime.
will move the asset from the cache adapter to the adapter in the resolution if defined.
triggers the finalize episode function once for the whole job | [
"creates",
"a",
"media",
"object",
"and",
"runs",
"the",
"ffmpeg",
"command",
"for",
"the",
"given",
"resolution",
".",
"the",
"command",
"will",
"be",
"tracked",
"to",
"update",
"the",
"progress",
"from",
"0",
"-",
"100",
"in",
"realtime",
".",
"will",
... | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L251-L287 |
20,937 | OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.finalizeEpisode | private function finalizeEpisode($episode) {
$event = new EncodedEpisodeEvent($episode);
$this->getContainer()->get('event_dispatcher')->dispatch(
OktolabMediaEvent::ENCODED_EPISODE,
$event
);
$this->oktolab_media->addFinalizeEpisodeJob(
$episode->get... | php | private function finalizeEpisode($episode) {
$event = new EncodedEpisodeEvent($episode);
$this->getContainer()->get('event_dispatcher')->dispatch(
OktolabMediaEvent::ENCODED_EPISODE,
$event
);
$this->oktolab_media->addFinalizeEpisodeJob(
$episode->get... | [
"private",
"function",
"finalizeEpisode",
"(",
"$",
"episode",
")",
"{",
"$",
"event",
"=",
"new",
"EncodedEpisodeEvent",
"(",
"$",
"episode",
")",
";",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'event_dispatcher'",
")",
"->",
"dispat... | adds finalize job
and dispatches encoded_episode event | [
"adds",
"finalize",
"job",
"and",
"dispatches",
"encoded_episode",
"event"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L312-L324 |
20,938 | OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.createNewCacheAssetForResolution | private function createNewCacheAssetForResolution($episode, $resolution) {
$asset = $this->getContainer()->get('bprs.asset')->createAsset();
$asset->setFilekey(
sprintf('%s.%s',$asset->getFilekey(), $resolution['container'])
);
$asset->setAdapter(
$this->getContai... | php | private function createNewCacheAssetForResolution($episode, $resolution) {
$asset = $this->getContainer()->get('bprs.asset')->createAsset();
$asset->setFilekey(
sprintf('%s.%s',$asset->getFilekey(), $resolution['container'])
);
$asset->setAdapter(
$this->getContai... | [
"private",
"function",
"createNewCacheAssetForResolution",
"(",
"$",
"episode",
",",
"$",
"resolution",
")",
"{",
"$",
"asset",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'bprs.asset'",
")",
"->",
"createAsset",
"(",
")",
";",
"$"... | returns an empty asset to be used in an encoding situation.
the filekey, mimetype and adapter are already set for ffmpeg | [
"returns",
"an",
"empty",
"asset",
"to",
"be",
"used",
"in",
"an",
"encoding",
"situation",
".",
"the",
"filekey",
"mimetype",
"and",
"adapter",
"are",
"already",
"set",
"for",
"ffmpeg"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L330-L344 |
20,939 | ShaoZeMing/laravel-merchant | src/Grid/Exporters/AbstractExporter.php | AbstractExporter.withScope | public function withScope($scope)
{
if ($scope == Grid\Exporter::SCOPE_ALL) {
return $this;
}
list($scope, $args) = explode(':', $scope);
if ($scope == Grid\Exporter::SCOPE_CURRENT_PAGE) {
$this->grid->model()->usePaginate(true);
}
if ($scop... | php | public function withScope($scope)
{
if ($scope == Grid\Exporter::SCOPE_ALL) {
return $this;
}
list($scope, $args) = explode(':', $scope);
if ($scope == Grid\Exporter::SCOPE_CURRENT_PAGE) {
$this->grid->model()->usePaginate(true);
}
if ($scop... | [
"public",
"function",
"withScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"$",
"scope",
"==",
"Grid",
"\\",
"Exporter",
"::",
"SCOPE_ALL",
")",
"{",
"return",
"$",
"this",
";",
"}",
"list",
"(",
"$",
"scope",
",",
"$",
"args",
")",
"=",
"explode",... | Export data with scope.
@param string $scope
@return $this | [
"Export",
"data",
"with",
"scope",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Grid/Exporters/AbstractExporter.php#L78-L96 |
20,940 | NuclearCMS/Hierarchy | src/Repositories/NodeTypeRepository.php | NodeTypeRepository.create | public function create(array $attributes)
{
$model = $this->getModelName();
$nodeType = $model::create($attributes);
$this->builderService->buildTable(
$nodeType->getName(),
$nodeType->getKey()
);
return $nodeType;
} | php | public function create(array $attributes)
{
$model = $this->getModelName();
$nodeType = $model::create($attributes);
$this->builderService->buildTable(
$nodeType->getName(),
$nodeType->getKey()
);
return $nodeType;
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModelName",
"(",
")",
";",
"$",
"nodeType",
"=",
"$",
"model",
"::",
"create",
"(",
"$",
"attributes",
")",
";",
"$",
"this",
"->",
... | Creates a node type
@param array $attributes
@return NodeTypeContract | [
"Creates",
"a",
"node",
"type"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeTypeRepository.php#L14-L26 |
20,941 | NuclearCMS/Hierarchy | src/Repositories/NodeTypeRepository.php | NodeTypeRepository.destroy | public function destroy($id)
{
$model = $this->getModelName();
$nodeType = $model::findOrFail($id);
$this->builderService->destroyTable(
$nodeType->getName(),
$nodeType->getFieldKeys(),
$nodeType->getKey()
);
$nodeType->delete();
... | php | public function destroy($id)
{
$model = $this->getModelName();
$nodeType = $model::findOrFail($id);
$this->builderService->destroyTable(
$nodeType->getName(),
$nodeType->getFieldKeys(),
$nodeType->getKey()
);
$nodeType->delete();
... | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModelName",
"(",
")",
";",
"$",
"nodeType",
"=",
"$",
"model",
"::",
"findOrFail",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"builderService",
"... | Destroys a node type
@param int $id
@return NodeTypeContract | [
"Destroys",
"a",
"node",
"type"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeTypeRepository.php#L34-L49 |
20,942 | NuclearCMS/Hierarchy | src/Repositories/NodeTypeRepository.php | NodeTypeRepository.getNodeTypesByIds | public function getNodeTypesByIds($ids)
{
if (empty($ids))
{
return null;
}
if (is_string($ids))
{
$ids = json_decode($ids, true);
}
if (is_array($ids) && ! empty($ids))
{
$model = $this->getModelName();
... | php | public function getNodeTypesByIds($ids)
{
if (empty($ids))
{
return null;
}
if (is_string($ids))
{
$ids = json_decode($ids, true);
}
if (is_array($ids) && ! empty($ids))
{
$model = $this->getModelName();
... | [
"public",
"function",
"getNodeTypesByIds",
"(",
"$",
"ids",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"ids",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"ids",
")",
")",
"{",
"$",
"ids",
"=",
"json_decode",
"(",
"$"... | Returns node types by ids
@param array|string $ids
@return Collection | [
"Returns",
"node",
"types",
"by",
"ids"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeTypeRepository.php#L57-L83 |
20,943 | Danzabar/config-builder | src/Data/Extensions/YamlTranslator.php | YamlTranslator.validate | public function validate()
{
try
{
Yaml\Yaml::parse($this->data);
} catch(\Exception $e)
{
return false;
}
return true;
} | php | public function validate()
{
try
{
Yaml\Yaml::parse($this->data);
} catch(\Exception $e)
{
return false;
}
return true;
} | [
"public",
"function",
"validate",
"(",
")",
"{",
"try",
"{",
"Yaml",
"\\",
"Yaml",
"::",
"parse",
"(",
"$",
"this",
"->",
"data",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",
"... | Validates a Yaml string
@return Boolean
@author Dan Cox | [
"Validates",
"a",
"Yaml",
"string"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Data/Extensions/YamlTranslator.php#L65-L77 |
20,944 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.configureComposerJson | public function configureComposerJson(Event $event)
{
static::$plugin->getInstanceOf(ComposerConfigurator::class)->configure($event->getComposer(), $event->getIO());
} | php | public function configureComposerJson(Event $event)
{
static::$plugin->getInstanceOf(ComposerConfigurator::class)->configure($event->getComposer(), $event->getIO());
} | [
"public",
"function",
"configureComposerJson",
"(",
"Event",
"$",
"event",
")",
"{",
"static",
"::",
"$",
"plugin",
"->",
"getInstanceOf",
"(",
"ComposerConfigurator",
"::",
"class",
")",
"->",
"configure",
"(",
"$",
"event",
"->",
"getComposer",
"(",
")",
"... | Configure the composer sonfiguration file.
@param \Composer\EventDispatcher\Event $event
@return void | [
"Configure",
"the",
"composer",
"sonfiguration",
"file",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L85-L88 |
20,945 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.setWordPressInstallDirectory | public function setWordPressInstallDirectory(PackageEvent $event)
{
if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
return;
}
$composer = $event->getComposer();
$rootPkg = $composer->getPackage();
if (! $rootPkg) {
retu... | php | public function setWordPressInstallDirectory(PackageEvent $event)
{
if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
return;
}
$composer = $event->getComposer();
$rootPkg = $composer->getPackage();
if (! $rootPkg) {
retu... | [
"public",
"function",
"setWordPressInstallDirectory",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPackageName",
"(",
"$",
"event",
")",
"!=",
"'johnpbloch/wordpress'",
")",
"{",
"return",
";",
"}",
"$",
"composer",
"=",
"$"... | Set the WordPress installation directory.
@param \Composer\EventDispatcher\Event $event
@return void | [
"Set",
"the",
"WordPress",
"installation",
"directory",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L96-L119 |
20,946 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.cleanWordPressInstallation | public function cleanWordPressInstallation(PackageEvent $event)
{
if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
return;
}
static::$plugin->getInstanceOf(WordPressInstallationCleaner::class)->clean($event->getComposer(), $event->getIO());
} | php | public function cleanWordPressInstallation(PackageEvent $event)
{
if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
return;
}
static::$plugin->getInstanceOf(WordPressInstallationCleaner::class)->clean($event->getComposer(), $event->getIO());
} | [
"public",
"function",
"cleanWordPressInstallation",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPackageName",
"(",
"$",
"event",
")",
"!=",
"'johnpbloch/wordpress'",
")",
"{",
"return",
";",
"}",
"static",
"::",
"$",
"plugi... | Clean the WordPress installation.
@param \Composer\Installer\PackageEvent $event
@return void | [
"Clean",
"the",
"WordPress",
"installation",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L127-L134 |
20,947 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.activateWordPressPlugin | public function activateWordPressPlugin(PackageEvent $event)
{
if (! $this->isWordPressPlugin($this->getPackage($event))) {
return;
}
static::$plugin->getInstanceOf(PluginInteractor::class)->activate(
$event->getComposer(),
$event->getIO(),
... | php | public function activateWordPressPlugin(PackageEvent $event)
{
if (! $this->isWordPressPlugin($this->getPackage($event))) {
return;
}
static::$plugin->getInstanceOf(PluginInteractor::class)->activate(
$event->getComposer(),
$event->getIO(),
... | [
"public",
"function",
"activateWordPressPlugin",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWordPressPlugin",
"(",
"$",
"this",
"->",
"getPackage",
"(",
"$",
"event",
")",
")",
")",
"{",
"return",
";",
"}",
"static... | Activate a WordPress plugin.
@param \Composer\Installer\PackageEvent $event
@return void | [
"Activate",
"a",
"WordPress",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L142-L153 |
20,948 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.deactivateWordPressPlugin | public function deactivateWordPressPlugin(PackageEvent $event)
{
if (! $this->isWordPressPlugin($this->getPackage($event))) {
return;
}
static::$plugin->getInstanceOf(PluginInteractor::class)->deactivate(
$event->getComposer(),
$event->getIO(),
... | php | public function deactivateWordPressPlugin(PackageEvent $event)
{
if (! $this->isWordPressPlugin($this->getPackage($event))) {
return;
}
static::$plugin->getInstanceOf(PluginInteractor::class)->deactivate(
$event->getComposer(),
$event->getIO(),
... | [
"public",
"function",
"deactivateWordPressPlugin",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWordPressPlugin",
"(",
"$",
"this",
"->",
"getPackage",
"(",
"$",
"event",
")",
")",
")",
"{",
"return",
";",
"}",
"stat... | Deactivate a WordPress plugin.
@param \Composer\Installer\PackageEvent $event
@return void | [
"Deactivate",
"a",
"WordPress",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L161-L172 |
20,949 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.uninstallWordPressPlugin | public function uninstallWordPressPlugin(PackageEvent $event)
{
if (! $this->isWordPressPlugin($this->getPackage($event))) {
return;
}
static::$plugin->getInstanceOf(PluginInteractor::class)->uninstall(
$event->getComposer(),
$event->getIO(),
... | php | public function uninstallWordPressPlugin(PackageEvent $event)
{
if (! $this->isWordPressPlugin($this->getPackage($event))) {
return;
}
static::$plugin->getInstanceOf(PluginInteractor::class)->uninstall(
$event->getComposer(),
$event->getIO(),
... | [
"public",
"function",
"uninstallWordPressPlugin",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWordPressPlugin",
"(",
"$",
"this",
"->",
"getPackage",
"(",
"$",
"event",
")",
")",
")",
"{",
"return",
";",
"}",
"stati... | Uninstall a WordPress plugin.
@param \Composer\Installer\PackageEvent $event
@return void | [
"Uninstall",
"a",
"WordPress",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L180-L191 |
20,950 | CupOfTea696/WordPress-Composer | src/EventSubscriber.php | EventSubscriber.getPackage | protected function getPackage(PackageEvent $event)
{
$operation = $event->getOperation();
if (method_exists($operation, 'getPackage')) {
return $operation->getPackage();
}
return $operation->getTargetPackage();
} | php | protected function getPackage(PackageEvent $event)
{
$operation = $event->getOperation();
if (method_exists($operation, 'getPackage')) {
return $operation->getPackage();
}
return $operation->getTargetPackage();
} | [
"protected",
"function",
"getPackage",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"$",
"operation",
"=",
"$",
"event",
"->",
"getOperation",
"(",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"operation",
",",
"'getPackage'",
")",
")",
"{",
"return",
... | Get the PackageInterface from a PackageEvent.
@param \Composer\Installer\PackageEvent $event
@return \Composer\Package\PackageInterface | [
"Get",
"the",
"PackageInterface",
"from",
"a",
"PackageEvent",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/EventSubscriber.php#L199-L208 |
20,951 | novaway/open-graph | src/Metadata/Driver/AnnotationDriver.php | AnnotationDriver.loadMetadataForClass | public function loadMetadataForClass(\ReflectionClass $class)
{
$classMetadata = new ClassMetadata($class->name);
$classMetadata->fileResources[] = $class->getFileName();
foreach ($this->reader->getClassAnnotations($class) as $annotation) {
if ($annotation instanceof NamespaceNo... | php | public function loadMetadataForClass(\ReflectionClass $class)
{
$classMetadata = new ClassMetadata($class->name);
$classMetadata->fileResources[] = $class->getFileName();
foreach ($this->reader->getClassAnnotations($class) as $annotation) {
if ($annotation instanceof NamespaceNo... | [
"public",
"function",
"loadMetadataForClass",
"(",
"\\",
"ReflectionClass",
"$",
"class",
")",
"{",
"$",
"classMetadata",
"=",
"new",
"ClassMetadata",
"(",
"$",
"class",
"->",
"name",
")",
";",
"$",
"classMetadata",
"->",
"fileResources",
"[",
"]",
"=",
"$",... | Load metadata class
@param \ReflectionClass $class
@return ClassMetadata | [
"Load",
"metadata",
"class"
] | 19817bee4b91cf26ca3fe44883ad58b32328e464 | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/Metadata/Driver/AnnotationDriver.php#L36-L68 |
20,952 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/ElementsIndexBuilder.php | ElementsIndexBuilder.getIndexKey | protected function getIndexKey($element)
{
$key = $element->getFullyQualifiedStructuralElementName();
// properties should have an additional $ before the property name
if ($element instanceof PropertyInterface) {
list($fqcn, $propertyName) = explode('::', $key);
$ke... | php | protected function getIndexKey($element)
{
$key = $element->getFullyQualifiedStructuralElementName();
// properties should have an additional $ before the property name
if ($element instanceof PropertyInterface) {
list($fqcn, $propertyName) = explode('::', $key);
$ke... | [
"protected",
"function",
"getIndexKey",
"(",
"$",
"element",
")",
"{",
"$",
"key",
"=",
"$",
"element",
"->",
"getFullyQualifiedStructuralElementName",
"(",
")",
";",
"// properties should have an additional $ before the property name",
"if",
"(",
"$",
"element",
"insta... | Retrieves a key for the index for the provided element.
@param DescriptorAbstract $element
@return string | [
"Retrieves",
"a",
"key",
"for",
"the",
"index",
"for",
"the",
"provided",
"element",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/ElementsIndexBuilder.php#L146-L157 |
20,953 | heidelpay/PhpDoc | src/phpDocumentor/Partials/Collection.php | Collection.set | public function set($index, $item)
{
$this->offsetSet($index, $this->parser->text($item));
} | php | public function set($index, $item)
{
$this->offsetSet($index, $this->parser->text($item));
} | [
"public",
"function",
"set",
"(",
"$",
"index",
",",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"offsetSet",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"parser",
"->",
"text",
"(",
"$",
"item",
")",
")",
";",
"}"
] | Sets a new object onto the collection or clear it using null.
@param string|integer $index An index value to recognize this item with.
@param string $item The item to store, generally a Descriptor but may be something else.
@return void | [
"Sets",
"a",
"new",
"object",
"onto",
"the",
"collection",
"or",
"clear",
"it",
"using",
"null",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Partials/Collection.php#L42-L45 |
20,954 | superjimpupcake/Pupcake | src/Pupcake/Event.php | Event.register | public function register()
{
$this->helper_callbacks = array();
$arguments= func_get_args();
if(count($arguments) > 0){
foreach($arguments as $argument){
if($argument instanceof Plugin){ //this is a plugin object
$callback = $argument->getEvent... | php | public function register()
{
$this->helper_callbacks = array();
$arguments= func_get_args();
if(count($arguments) > 0){
foreach($arguments as $argument){
if($argument instanceof Plugin){ //this is a plugin object
$callback = $argument->getEvent... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"helper_callbacks",
"=",
"array",
"(",
")",
";",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arguments",
")",
">",
"0",
")",
"{",
"foreach",... | register an array of plugins objects and allow the plugins to join the process of handling this event | [
"register",
"an",
"array",
"of",
"plugins",
"objects",
"and",
"allow",
"the",
"plugins",
"to",
"join",
"the",
"process",
"of",
"handling",
"this",
"event"
] | 2f962818646e4e1d65f5d008eeb953cb41ebb3e0 | https://github.com/superjimpupcake/Pupcake/blob/2f962818646e4e1d65f5d008eeb953cb41ebb3e0/src/Pupcake/Event.php#L76-L95 |
20,955 | superjimpupcake/Pupcake | src/Pupcake/Event.php | Event.start | public function start()
{
$result = array();
if(count($this->helper_callbacks) > 0){
foreach($this->helper_callbacks as $callback){
$return_value = call_user_func_array($callback, array($this));
$result[] = $return_value;
}
}
re... | php | public function start()
{
$result = array();
if(count($this->helper_callbacks) > 0){
foreach($this->helper_callbacks as $callback){
$return_value = call_user_func_array($callback, array($this));
$result[] = $return_value;
}
}
re... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"helper_callbacks",
")",
">",
"0",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"helper_callbacks",
"as",
"$",
"ca... | start this event | [
"start",
"this",
"event"
] | 2f962818646e4e1d65f5d008eeb953cb41ebb3e0 | https://github.com/superjimpupcake/Pupcake/blob/2f962818646e4e1d65f5d008eeb953cb41ebb3e0/src/Pupcake/Event.php#L118-L128 |
20,956 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php | CurlMulti.executeHandles | private function executeHandles(&$active, &$mrc, $timeout = 1)
{
do {
$mrc = curl_multi_exec($this->multiHandle, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM && $active);
$this->checkCurlResult($mrc);
// @codeCoverageIgnoreStart
// Select the curl handles ... | php | private function executeHandles(&$active, &$mrc, $timeout = 1)
{
do {
$mrc = curl_multi_exec($this->multiHandle, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM && $active);
$this->checkCurlResult($mrc);
// @codeCoverageIgnoreStart
// Select the curl handles ... | [
"private",
"function",
"executeHandles",
"(",
"&",
"$",
"active",
",",
"&",
"$",
"mrc",
",",
"$",
"timeout",
"=",
"1",
")",
"{",
"do",
"{",
"$",
"mrc",
"=",
"curl_multi_exec",
"(",
"$",
"this",
"->",
"multiHandle",
",",
"$",
"active",
")",
";",
"}"... | Execute and select curl handles until there is activity
@param int $active Active value to update
@param int $mrc Multi result value to update
@param int $timeout Select timeout in seconds | [
"Execute",
"and",
"select",
"curl",
"handles",
"until",
"there",
"is",
"activity"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php#L257-L273 |
20,957 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php | CurlMulti.removeErroredRequest | protected function removeErroredRequest(RequestInterface $request, \Exception $e = null, $buffer = true)
{
if ($buffer) {
$this->exceptions[] = array('request' => $request, 'exception' => $e);
}
$this->remove($request);
$this->dispatch(self::MULTI_EXCEPTION, array('excep... | php | protected function removeErroredRequest(RequestInterface $request, \Exception $e = null, $buffer = true)
{
if ($buffer) {
$this->exceptions[] = array('request' => $request, 'exception' => $e);
}
$this->remove($request);
$this->dispatch(self::MULTI_EXCEPTION, array('excep... | [
"protected",
"function",
"removeErroredRequest",
"(",
"RequestInterface",
"$",
"request",
",",
"\\",
"Exception",
"$",
"e",
"=",
"null",
",",
"$",
"buffer",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"buffer",
")",
"{",
"$",
"this",
"->",
"exceptions",
"[",
... | Remove a request that encountered an exception
@param RequestInterface $request Request to remove
@param \Exception $e Exception encountered
@param bool $buffer Set to false to not buffer the exception | [
"Remove",
"a",
"request",
"that",
"encountered",
"an",
"exception"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php#L282-L290 |
20,958 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php | CurlMulti.processResponse | protected function processResponse(RequestInterface $request, CurlHandle $handle, array $curl)
{
// Set the transfer stats on the response
$handle->updateRequestFromTransfer($request);
// Check if a cURL exception occurred, and if so, notify things
$curlException = $this->isCurlExcep... | php | protected function processResponse(RequestInterface $request, CurlHandle $handle, array $curl)
{
// Set the transfer stats on the response
$handle->updateRequestFromTransfer($request);
// Check if a cURL exception occurred, and if so, notify things
$curlException = $this->isCurlExcep... | [
"protected",
"function",
"processResponse",
"(",
"RequestInterface",
"$",
"request",
",",
"CurlHandle",
"$",
"handle",
",",
"array",
"$",
"curl",
")",
"{",
"// Set the transfer stats on the response",
"$",
"handle",
"->",
"updateRequestFromTransfer",
"(",
"$",
"reques... | Check for errors and fix headers of a request based on a curl response
@param RequestInterface $request Request to process
@param CurlHandle $handle Curl handle object
@param array $curl Array returned from curl_multi_info_read
@throws CurlException on Curl error | [
"Check",
"for",
"errors",
"and",
"fix",
"headers",
"of",
"a",
"request",
"based",
"on",
"a",
"curl",
"response"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php#L301-L331 |
20,959 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php | CurlMulti.removeHandle | protected function removeHandle(RequestInterface $request)
{
if (isset($this->handles[$request])) {
$handle = $this->handles[$request];
unset($this->handles[$request]);
unset($this->resourceHash[(int) $handle->getHandle()]);
curl_multi_remove_handle($this->mul... | php | protected function removeHandle(RequestInterface $request)
{
if (isset($this->handles[$request])) {
$handle = $this->handles[$request];
unset($this->handles[$request]);
unset($this->resourceHash[(int) $handle->getHandle()]);
curl_multi_remove_handle($this->mul... | [
"protected",
"function",
"removeHandle",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"handles",
"[",
"$",
"request",
"]",
")",
")",
"{",
"$",
"handle",
"=",
"$",
"this",
"->",
"handles",
"[",
"$",
"r... | Remove a curl handle from the curl multi object
@param RequestInterface $request Request that owns the handle | [
"Remove",
"a",
"curl",
"handle",
"from",
"the",
"curl",
"multi",
"object"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMulti.php#L338-L347 |
20,960 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Command/Project/TransformCommand.php | TransformCommand.getTemplates | protected function getTemplates(InputInterface $input)
{
/** @var ConfigurationHelper $configurationHelper */
$configurationHelper = $this->getHelper('phpdocumentor_configuration');
$templates = $input->getOption('template');
if (!$templates) {
/** @var Template[] $templ... | php | protected function getTemplates(InputInterface $input)
{
/** @var ConfigurationHelper $configurationHelper */
$configurationHelper = $this->getHelper('phpdocumentor_configuration');
$templates = $input->getOption('template');
if (!$templates) {
/** @var Template[] $templ... | [
"protected",
"function",
"getTemplates",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"/** @var ConfigurationHelper $configurationHelper */",
"$",
"configurationHelper",
"=",
"$",
"this",
"->",
"getHelper",
"(",
"'phpdocumentor_configuration'",
")",
";",
"$",
"templates... | Retrieves the templates to be used by analyzing the options and the configuration.
@param InputInterface $input
@return string[] | [
"Retrieves",
"the",
"templates",
"to",
"be",
"used",
"by",
"analyzing",
"the",
"options",
"and",
"the",
"configuration",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Command/Project/TransformCommand.php#L233-L252 |
20,961 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Command/Project/TransformCommand.php | TransformCommand.loadTransformations | public function loadTransformations(Transformer $transformer)
{
/** @var ConfigurationHelper $configurationHelper */
$configurationHelper = $this->getHelper('phpdocumentor_configuration');
$received = array();
$transformations = $configurationHelper->getConfigValueFromPath('transfor... | php | public function loadTransformations(Transformer $transformer)
{
/** @var ConfigurationHelper $configurationHelper */
$configurationHelper = $this->getHelper('phpdocumentor_configuration');
$received = array();
$transformations = $configurationHelper->getConfigValueFromPath('transfor... | [
"public",
"function",
"loadTransformations",
"(",
"Transformer",
"$",
"transformer",
")",
"{",
"/** @var ConfigurationHelper $configurationHelper */",
"$",
"configurationHelper",
"=",
"$",
"this",
"->",
"getHelper",
"(",
"'phpdocumentor_configuration'",
")",
";",
"$",
"re... | Load custom defined transformations.
@param Transformer $transformer
@todo this is an ugly implementation done for speed of development, should be refactored
@return void | [
"Load",
"custom",
"defined",
"transformations",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Command/Project/TransformCommand.php#L263-L283 |
20,962 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Command/Project/TransformCommand.php | TransformCommand.createTransformation | protected function createTransformation(array $transformations)
{
return new Transformation(
isset($transformations['query']) ? $transformations['query'] : '',
$transformations['writer'],
isset($transformations['source']) ? $transformations['source'] : '',
iss... | php | protected function createTransformation(array $transformations)
{
return new Transformation(
isset($transformations['query']) ? $transformations['query'] : '',
$transformations['writer'],
isset($transformations['source']) ? $transformations['source'] : '',
iss... | [
"protected",
"function",
"createTransformation",
"(",
"array",
"$",
"transformations",
")",
"{",
"return",
"new",
"Transformation",
"(",
"isset",
"(",
"$",
"transformations",
"[",
"'query'",
"]",
")",
"?",
"$",
"transformations",
"[",
"'query'",
"]",
":",
"''"... | Create Transformation instance.
@param array $transformations
@return \phpDocumentor\Transformer\Transformation | [
"Create",
"Transformation",
"instance",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Command/Project/TransformCommand.php#L292-L300 |
20,963 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Command/Project/TransformCommand.php | TransformCommand.appendReceivedTransformations | protected function appendReceivedTransformations(Transformer $transformer, $received)
{
if (!empty($received)) {
$template = new Template('__');
foreach ($received as $transformation) {
$template[] = $transformation;
}
$transformer->getTemplate... | php | protected function appendReceivedTransformations(Transformer $transformer, $received)
{
if (!empty($received)) {
$template = new Template('__');
foreach ($received as $transformation) {
$template[] = $transformation;
}
$transformer->getTemplate... | [
"protected",
"function",
"appendReceivedTransformations",
"(",
"Transformer",
"$",
"transformer",
",",
"$",
"received",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"received",
")",
")",
"{",
"$",
"template",
"=",
"new",
"Template",
"(",
"'__'",
")",
";",
... | Append received transformations.
@param Transformer $transformer
@param array $received
@return void | [
"Append",
"received",
"transformations",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Command/Project/TransformCommand.php#L310-L319 |
20,964 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Command/Project/TransformCommand.php | TransformCommand.getProgressBar | protected function getProgressBar(InputInterface $input)
{
$progress = parent::getProgressBar($input);
if (!$progress) {
return null;
}
/** @var Dispatcher $eventDispatcher */
$eventDispatcher = $this->getService('event_dispatcher');
$eventDispatcher->add... | php | protected function getProgressBar(InputInterface $input)
{
$progress = parent::getProgressBar($input);
if (!$progress) {
return null;
}
/** @var Dispatcher $eventDispatcher */
$eventDispatcher = $this->getService('event_dispatcher');
$eventDispatcher->add... | [
"protected",
"function",
"getProgressBar",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"$",
"progress",
"=",
"parent",
"::",
"getProgressBar",
"(",
"$",
"input",
")",
";",
"if",
"(",
"!",
"$",
"progress",
")",
"{",
"return",
"null",
";",
"}",
"/** @va... | Adds the transformer.transformation.post event to advance the progressbar.
@param InputInterface $input
@return HelperInterface|null | [
"Adds",
"the",
"transformer",
".",
"transformation",
".",
"post",
"event",
"to",
"advance",
"the",
"progressbar",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Command/Project/TransformCommand.php#L328-L345 |
20,965 | caffeinated/beverage | src/Filesystem.php | Filesystem.rsearch | public function rsearch($folder, $pattern)
{
$dir = new RecursiveDirectoryIterator($folder);
$iterator = new RecursiveIteratorIterator($dir);
$files = new RegexIterator($iterator, $pattern, RegexIterator::GET_MATCH);
$fileList = [];
foreach ($files as $file) {
... | php | public function rsearch($folder, $pattern)
{
$dir = new RecursiveDirectoryIterator($folder);
$iterator = new RecursiveIteratorIterator($dir);
$files = new RegexIterator($iterator, $pattern, RegexIterator::GET_MATCH);
$fileList = [];
foreach ($files as $file) {
... | [
"public",
"function",
"rsearch",
"(",
"$",
"folder",
",",
"$",
"pattern",
")",
"{",
"$",
"dir",
"=",
"new",
"RecursiveDirectoryIterator",
"(",
"$",
"folder",
")",
";",
"$",
"iterator",
"=",
"new",
"RecursiveIteratorIterator",
"(",
"$",
"dir",
")",
";",
"... | Search the given folder recursively for files using
a regular expression pattern.
@param string $folder
@param string $pattern
@return array | [
"Search",
"the",
"given",
"folder",
"recursively",
"for",
"files",
"using",
"a",
"regular",
"expression",
"pattern",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Filesystem.php#L66-L78 |
20,966 | tystuyfzand/flysystem-seaweedfs | src/Seaweed.php | Seaweed.getUrl | public function getUrl($path) {
$mapping = $this->mapper->get($path);
if (!$mapping) {
return false;
}
try {
$volume = $this->client->lookup($mapping['fid']);
return $this->client->buildVolumeUrl($volume->getPublicUrl(), $mapping['fid']);
} ... | php | public function getUrl($path) {
$mapping = $this->mapper->get($path);
if (!$mapping) {
return false;
}
try {
$volume = $this->client->lookup($mapping['fid']);
return $this->client->buildVolumeUrl($volume->getPublicUrl(), $mapping['fid']);
} ... | [
"public",
"function",
"getUrl",
"(",
"$",
"path",
")",
"{",
"$",
"mapping",
"=",
"$",
"this",
"->",
"mapper",
"->",
"get",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"$",
"mapping",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"$",
"volu... | Get the public URL of a path.
@param $path
@return string|bool | [
"Get",
"the",
"public",
"URL",
"of",
"a",
"path",
"."
] | 992334ba1d8e26fe6bbb9e33feedbf66b4872613 | https://github.com/tystuyfzand/flysystem-seaweedfs/blob/992334ba1d8e26fe6bbb9e33feedbf66b4872613/src/Seaweed.php#L325-L339 |
20,967 | mothership-ec/composer | src/Composer/Util/SpdxLicense.php | SpdxLicense.getLicenseByIdentifier | public function getLicenseByIdentifier($identifier)
{
if (!isset($this->licenses[$identifier])) {
return;
}
$license = $this->licenses[$identifier];
// add URL for the license text (it's not included in the json)
$license[2] = 'http://spdx.org/licenses/' . $iden... | php | public function getLicenseByIdentifier($identifier)
{
if (!isset($this->licenses[$identifier])) {
return;
}
$license = $this->licenses[$identifier];
// add URL for the license text (it's not included in the json)
$license[2] = 'http://spdx.org/licenses/' . $iden... | [
"public",
"function",
"getLicenseByIdentifier",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"licenses",
"[",
"$",
"identifier",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"license",
"=",
"$",
"this",
"->",
"li... | Returns license metadata by license identifier.
@param string $identifier
@return array|null | [
"Returns",
"license",
"metadata",
"by",
"license",
"identifier",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Util/SpdxLicense.php#L54-L66 |
20,968 | mothership-ec/composer | src/Composer/Util/SpdxLicense.php | SpdxLicense.getIdentifierByName | public function getIdentifierByName($name)
{
foreach ($this->licenses as $identifier => $licenseData) {
if ($licenseData[0] === $name) { // key 0 = fullname
return $identifier;
}
}
} | php | public function getIdentifierByName($name)
{
foreach ($this->licenses as $identifier => $licenseData) {
if ($licenseData[0] === $name) { // key 0 = fullname
return $identifier;
}
}
} | [
"public",
"function",
"getIdentifierByName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"licenses",
"as",
"$",
"identifier",
"=>",
"$",
"licenseData",
")",
"{",
"if",
"(",
"$",
"licenseData",
"[",
"0",
"]",
"===",
"$",
"name",
")",
... | Returns the short identifier of a license by full name.
@param string $identifier
@return string | [
"Returns",
"the",
"short",
"identifier",
"of",
"a",
"license",
"by",
"full",
"name",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Util/SpdxLicense.php#L75-L82 |
20,969 | antaresproject/notifications | src/Listener/NotificationsListener.php | NotificationsListener.listen | public function listen()
{
$notifications = $this->repository->findSendable()->toArray();
foreach ($notifications as $notification) {
$this->listenNotificationsEvents($notification);
}
} | php | public function listen()
{
$notifications = $this->repository->findSendable()->toArray();
foreach ($notifications as $notification) {
$this->listenNotificationsEvents($notification);
}
} | [
"public",
"function",
"listen",
"(",
")",
"{",
"$",
"notifications",
"=",
"$",
"this",
"->",
"repository",
"->",
"findSendable",
"(",
")",
"->",
"toArray",
"(",
")",
";",
"foreach",
"(",
"$",
"notifications",
"as",
"$",
"notification",
")",
"{",
"$",
"... | Listening for notifications | [
"Listening",
"for",
"notifications"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Listener/NotificationsListener.php#L62-L69 |
20,970 | antaresproject/notifications | src/Listener/NotificationsListener.php | NotificationsListener.listenNotificationsEvents | protected function listenNotificationsEvents(array $notification)
{
$events = Arr::get($notification, 'event');
if($events === null && isset($notification['classname'])) {
$events = app()->make($notification['classname'])->getEvents();
}
foreach ((array) $events as $eve... | php | protected function listenNotificationsEvents(array $notification)
{
$events = Arr::get($notification, 'event');
if($events === null && isset($notification['classname'])) {
$events = app()->make($notification['classname'])->getEvents();
}
foreach ((array) $events as $eve... | [
"protected",
"function",
"listenNotificationsEvents",
"(",
"array",
"$",
"notification",
")",
"{",
"$",
"events",
"=",
"Arr",
"::",
"get",
"(",
"$",
"notification",
",",
"'event'",
")",
";",
"if",
"(",
"$",
"events",
"===",
"null",
"&&",
"isset",
"(",
"$... | Runs notification events.
@param array $notification | [
"Runs",
"notification",
"events",
"."
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Listener/NotificationsListener.php#L76-L87 |
20,971 | antaresproject/notifications | src/Listener/NotificationsListener.php | NotificationsListener.runNotificationListener | protected function runNotificationListener(string $event, array $notification)
{
app('events')->listen($event, function(array $variables = null, array $recipients = null) use($notification) {
$this->eventDispatcher->run($notification, $variables, $recipients);
});
} | php | protected function runNotificationListener(string $event, array $notification)
{
app('events')->listen($event, function(array $variables = null, array $recipients = null) use($notification) {
$this->eventDispatcher->run($notification, $variables, $recipients);
});
} | [
"protected",
"function",
"runNotificationListener",
"(",
"string",
"$",
"event",
",",
"array",
"$",
"notification",
")",
"{",
"app",
"(",
"'events'",
")",
"->",
"listen",
"(",
"$",
"event",
",",
"function",
"(",
"array",
"$",
"variables",
"=",
"null",
",",... | Runs notification listener.
@param string $event
@param array $notification | [
"Runs",
"notification",
"listener",
"."
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Listener/NotificationsListener.php#L95-L100 |
20,972 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Helper/Char.php | Char.fromHex | public static function fromHex($hex)
{
if(strlen($hex) != 2)
{
throw new Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
return new self(chr(hexdec($hex)));
} | php | public static function fromHex($hex)
{
if(strlen($hex) != 2)
{
throw new Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
return new self(chr(hexdec($hex)));
} | [
"public",
"static",
"function",
"fromHex",
"(",
"$",
"hex",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"hex",
")",
"!=",
"2",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"given parameter '\"",
".",
"$",
"hex",
".",
"\"' is not a valid hexadecimal number\"",
... | Returns the Char based on a given hex value.
@param string $hex
@throws Exception
@return Char | [
"Returns",
"the",
"Char",
"based",
"on",
"a",
"given",
"hex",
"value",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Char.php#L231-L239 |
20,973 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.discoverFields | public function discoverFields() {
if (!empty($this->fields)) {
return; // Already configured.
}
$sm = $this->db()->getSchemaManager();
$columns = $sm->listTableColumns($this->table);
foreach ($columns as $column) {
$this->fields[$column->getName()] = array(
'name' => $column->g... | php | public function discoverFields() {
if (!empty($this->fields)) {
return; // Already configured.
}
$sm = $this->db()->getSchemaManager();
$columns = $sm->listTableColumns($this->table);
foreach ($columns as $column) {
$this->fields[$column->getName()] = array(
'name' => $column->g... | [
"public",
"function",
"discoverFields",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"fields",
")",
")",
"{",
"return",
";",
"// Already configured.",
"}",
"$",
"sm",
"=",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"getSchemaManager",
... | Gets info of the fields from the table. | [
"Gets",
"info",
"of",
"the",
"fields",
"from",
"the",
"table",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L25-L45 |
20,974 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.setField | public function setField($name, $value) {
if (isset($this->fields[$name])) {
$this->isDirty = TRUE;
return $this->record[$name] = $value;
}
throw new \Exception('Not a valid Field for Set ' . $name);
} | php | public function setField($name, $value) {
if (isset($this->fields[$name])) {
$this->isDirty = TRUE;
return $this->record[$name] = $value;
}
throw new \Exception('Not a valid Field for Set ' . $name);
} | [
"public",
"function",
"setField",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"isDirty",
"=",
"TRUE",
";",
"return",
"$",
"this",
... | Sets a field to the record.
@param $name
@param $value
@return mixed
@throws \Exception | [
"Sets",
"a",
"field",
"to",
"the",
"record",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L88-L95 |
20,975 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.getField | public function getField($name) {
if (isset($this->fields[$name])) {
return $this->record[$name];
}
if (isset($this->fetchedRecord[$name])) {
return $this->fetchedRecord[$name];
}
throw new \Exception('Not a valid Field for Get ' . $name);
} | php | public function getField($name) {
if (isset($this->fields[$name])) {
return $this->record[$name];
}
if (isset($this->fetchedRecord[$name])) {
return $this->fetchedRecord[$name];
}
throw new \Exception('Not a valid Field for Get ' . $name);
} | [
"public",
"function",
"getField",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"record",
"[",
"$",
"name",
"]",
";",
"}",
"if",
"(",
"isset"... | Gets a Field from Record.
If the field is not in record will check in fetchedRecord, fetched record may have
some fields from the last query that you will need, like related records.
@param $name
@return mixed
@throws \Exception | [
"Gets",
"a",
"Field",
"from",
"Record",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L107-L117 |
20,976 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.insert | public function insert() {
$this->db()->insert($this->table, $this->record);
$id = $this->db()->lastInsertId();
$this->record[$this->id_name] = $id;
$this->isDirty = FALSE;
return $this;
} | php | public function insert() {
$this->db()->insert($this->table, $this->record);
$id = $this->db()->lastInsertId();
$this->record[$this->id_name] = $id;
$this->isDirty = FALSE;
return $this;
} | [
"public",
"function",
"insert",
"(",
")",
"{",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"insert",
"(",
"$",
"this",
"->",
"table",
",",
"$",
"this",
"->",
"record",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"lastInsertI... | Inserts the record.
@return $this | [
"Inserts",
"the",
"record",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L124-L131 |
20,977 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.update | public function update() {
$this->db()->update($this->table, $this->record, $this->identifier());
$this->isDirty = FALSE;
return $this;
} | php | public function update() {
$this->db()->update($this->table, $this->record, $this->identifier());
$this->isDirty = FALSE;
return $this;
} | [
"public",
"function",
"update",
"(",
")",
"{",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"update",
"(",
"$",
"this",
"->",
"table",
",",
"$",
"this",
"->",
"record",
",",
"$",
"this",
"->",
"identifier",
"(",
")",
")",
";",
"$",
"this",
"->",
"i... | Updates the record.
@return $this | [
"Updates",
"the",
"record",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L138-L143 |
20,978 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.delete | public function delete() {
if ($this->isNew()) {
throw new \Exception('ID is not setted for Delete');
}
$this->db()->delete($this->table, $this->identifier());
$this->isDeleted = TRUE;
return $this;
} | php | public function delete() {
if ($this->isNew()) {
throw new \Exception('ID is not setted for Delete');
}
$this->db()->delete($this->table, $this->identifier());
$this->isDeleted = TRUE;
return $this;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNew",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'ID is not setted for Delete'",
")",
";",
"}",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"delete",
"(",
... | Deletes the record.
@return $this
@throws \Exception | [
"Deletes",
"the",
"record",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L168-L177 |
20,979 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.identifier | public function identifier() {
if (empty($this->record[$this->id_name])) {
return FALSE;
}
return array($this->id_name => $this->record[$this->id_name]);
} | php | public function identifier() {
if (empty($this->record[$this->id_name])) {
return FALSE;
}
return array($this->id_name => $this->record[$this->id_name]);
} | [
"public",
"function",
"identifier",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"record",
"[",
"$",
"this",
"->",
"id_name",
"]",
")",
")",
"{",
"return",
"FALSE",
";",
"}",
"return",
"array",
"(",
"$",
"this",
"->",
"id_name",
"=>",... | Provides the Id in array format column-value.
False if is a new object.
@return array|bool | [
"Provides",
"the",
"Id",
"in",
"array",
"format",
"column",
"-",
"value",
".",
"False",
"if",
"is",
"a",
"new",
"object",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L207-L213 |
20,980 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.getId | public function getId() {
if (empty($this->record[$this->id_name])) {
return FALSE;
}
return $this->record[$this->id_name];
} | php | public function getId() {
if (empty($this->record[$this->id_name])) {
return FALSE;
}
return $this->record[$this->id_name];
} | [
"public",
"function",
"getId",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"record",
"[",
"$",
"this",
"->",
"id_name",
"]",
")",
")",
"{",
"return",
"FALSE",
";",
"}",
"return",
"$",
"this",
"->",
"record",
"[",
"$",
"this",
"->",... | Gets the ID value or false.
@return mixed ID Value or false. | [
"Gets",
"the",
"ID",
"value",
"or",
"false",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L220-L226 |
20,981 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.setRecord | public function setRecord($record) {
$this->resetObject();
$newRecord = array();
foreach ($this->fields as $field_name => $field) {
if (!empty($record[$field_name])) {
$newRecord[$field_name] = $record[$field_name];
}
else {
$newRecord[$field_name] = ''; //Adds the field bu... | php | public function setRecord($record) {
$this->resetObject();
$newRecord = array();
foreach ($this->fields as $field_name => $field) {
if (!empty($record[$field_name])) {
$newRecord[$field_name] = $record[$field_name];
}
else {
$newRecord[$field_name] = ''; //Adds the field bu... | [
"public",
"function",
"setRecord",
"(",
"$",
"record",
")",
"{",
"$",
"this",
"->",
"resetObject",
"(",
")",
";",
"$",
"newRecord",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field_name",
"=>",
"$",
"field",... | Sets the internal record with a new record.
@param $record
@return \Towel\Model\BaseModel | [
"Sets",
"the",
"internal",
"record",
"with",
"a",
"new",
"record",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L244-L259 |
20,982 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.mergeRecord | public function mergeRecord($record) {
if ($this->isNew()) {
throw new \Exception('Can not merge, is new');
}
foreach ($this->fields as $field_name => $field) {
if (!empty($record[$field_name])) {
$this->record[$field_name] = $record[$field_name];
}
$this->isDirty = TRUE;
... | php | public function mergeRecord($record) {
if ($this->isNew()) {
throw new \Exception('Can not merge, is new');
}
foreach ($this->fields as $field_name => $field) {
if (!empty($record[$field_name])) {
$this->record[$field_name] = $record[$field_name];
}
$this->isDirty = TRUE;
... | [
"public",
"function",
"mergeRecord",
"(",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNew",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Can not merge, is new'",
")",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"fields",... | Update partial values of the record and keep the current
non modified values.
@param $record
@return $this
@throws \Exception | [
"Update",
"partial",
"values",
"of",
"the",
"record",
"and",
"keep",
"the",
"current",
"non",
"modified",
"values",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L270-L282 |
20,983 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.fetchOne | public function fetchOne($sql, $params = array()) {
$result = $this->db()->fetchAssoc($sql, $params);
if (!empty($result)) {
$this->setRecord($result);
return $this;
}
return FALSE;
} | php | public function fetchOne($sql, $params = array()) {
$result = $this->db()->fetchAssoc($sql, $params);
if (!empty($result)) {
$this->setRecord($result);
return $this;
}
return FALSE;
} | [
"public",
"function",
"fetchOne",
"(",
"$",
"sql",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"fetchAssoc",
"(",
"$",
"sql",
",",
"$",
"params",
")",
";",
"if",
"(",
"!",
... | Fetchs one record with the given query.
If success sets the record in the current object and return $this.
If fails return false.
@param $sql
@param $params
@return The current instance with the record setted internally. | [
"Fetchs",
"one",
"record",
"with",
"the",
"given",
"query",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L304-L314 |
20,984 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.hydrate | public function hydrate(PDOStatement $results) {
if (method_exists($this, 'preHydrate')) {
$results = $this->preHydrate($results);
}
$return = array();
if ($results) {
$arrayResults = $results->fetchAll();
foreach ($arrayResults as $arrayResult) {
$className = get_class($thi... | php | public function hydrate(PDOStatement $results) {
if (method_exists($this, 'preHydrate')) {
$results = $this->preHydrate($results);
}
$return = array();
if ($results) {
$arrayResults = $results->fetchAll();
foreach ($arrayResults as $arrayResult) {
$className = get_class($thi... | [
"public",
"function",
"hydrate",
"(",
"PDOStatement",
"$",
"results",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"'preHydrate'",
")",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"preHydrate",
"(",
"$",
"results",
")",
";",
"}",
... | Default Hydrate.
Use preHydrate and postHydrate methods to change the default behavior.
You can override this method too if you need.
@param PDOStatement $results
@return Array of Model Objects | [
"Default",
"Hydrate",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L400-L422 |
20,985 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.findRelatedModel | public function findRelatedModel($modelName, $field, $id = NULL) {
$relatedModel = $this->getInstance($modelName);
if ($this->isNew() && $id === NULL) {
throw new \Exception('No id for related');
}
if ($id === NULL) {
$id = $this->getField($field);
}
$result = $relatedModel->findB... | php | public function findRelatedModel($modelName, $field, $id = NULL) {
$relatedModel = $this->getInstance($modelName);
if ($this->isNew() && $id === NULL) {
throw new \Exception('No id for related');
}
if ($id === NULL) {
$id = $this->getField($field);
}
$result = $relatedModel->findB... | [
"public",
"function",
"findRelatedModel",
"(",
"$",
"modelName",
",",
"$",
"field",
",",
"$",
"id",
"=",
"NULL",
")",
"{",
"$",
"relatedModel",
"=",
"$",
"this",
"->",
"getInstance",
"(",
"$",
"modelName",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isN... | Finds a related model instance by the given field name and the id value.
Use it in a 1 to N relation, with an object instance of the N side to the get 1 related model.
@param $modelName : The related model name.
@param $field : The field that must be used to relate.
@param $id : Optional, the ID the related model, if... | [
"Finds",
"a",
"related",
"model",
"instance",
"by",
"the",
"given",
"field",
"name",
"and",
"the",
"id",
"value",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L437-L451 |
20,986 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.findRelatedModels | public function findRelatedModels($modelName, $field, $id = NULL) {
$relatedModel = $this->getInstance($modelName);
if ($this->isNew() && $id === NULL) {
throw new \Exception('No id for related');
}
if ($id === NULL) {
$id = $this->getId();
}
$result = $relatedModel->findByField($... | php | public function findRelatedModels($modelName, $field, $id = NULL) {
$relatedModel = $this->getInstance($modelName);
if ($this->isNew() && $id === NULL) {
throw new \Exception('No id for related');
}
if ($id === NULL) {
$id = $this->getId();
}
$result = $relatedModel->findByField($... | [
"public",
"function",
"findRelatedModels",
"(",
"$",
"modelName",
",",
"$",
"field",
",",
"$",
"id",
"=",
"NULL",
")",
"{",
"$",
"relatedModel",
"=",
"$",
"this",
"->",
"getInstance",
"(",
"$",
"modelName",
")",
";",
"if",
"(",
"$",
"this",
"->",
"is... | Finds related models instances using the field name and the id value.
Use it in a 1 to N relation, with an object instance of the 1 side to the get N related models.
@param $modelName : The related model name.
@param $field : The field that must be used to relate.
@param $id : Optional, the ID the related model, if i... | [
"Finds",
"related",
"models",
"instances",
"using",
"the",
"field",
"name",
"and",
"the",
"id",
"value",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L466-L480 |
20,987 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.plain | static public function plain($objects) {
$data = array();
foreach ($objects as $object) {
$data[] = $object->getRecord();
}
return $data;
} | php | static public function plain($objects) {
$data = array();
foreach ($objects as $object) {
$data[] = $object->getRecord();
}
return $data;
} | [
"static",
"public",
"function",
"plain",
"(",
"$",
"objects",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"objects",
"as",
"$",
"object",
")",
"{",
"$",
"data",
"[",
"]",
"=",
"$",
"object",
"->",
"getRecord",
"(",
")... | Convert the array of objects into a plain array.
@param $objects
@return array | [
"Convert",
"the",
"array",
"of",
"objects",
"into",
"a",
"plain",
"array",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L516-L523 |
20,988 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.createQuery | public function createQuery() {
$query = $this->db()->createQueryBuilder();
$query->select('t.*')
->from($this->table, 't');
return $query;
} | php | public function createQuery() {
$query = $this->db()->createQueryBuilder();
$query->select('t.*')
->from($this->table, 't');
return $query;
} | [
"public",
"function",
"createQuery",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"db",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
";",
"$",
"query",
"->",
"select",
"(",
"'t.*'",
")",
"->",
"from",
"(",
"$",
"this",
"->",
"table",
","... | Creates a QueryBuilder with the table selected.
@return \Doctrine\DBAL\Query\QueryBuilder | [
"Creates",
"a",
"QueryBuilder",
"with",
"the",
"table",
"selected",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L530-L536 |
20,989 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.findAllPaged | public function findAllPaged($page = 0, $limit = 20) {
$results = $this->findAllWithoutFetchPaged($page, $limit);
$return = $this->hydrate($results);
return $return;
} | php | public function findAllPaged($page = 0, $limit = 20) {
$results = $this->findAllWithoutFetchPaged($page, $limit);
$return = $this->hydrate($results);
return $return;
} | [
"public",
"function",
"findAllPaged",
"(",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",
"20",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"findAllWithoutFetchPaged",
"(",
"$",
"page",
",",
"$",
"limit",
")",
";",
"$",
"return",
"=",
"$",
"t... | Finds all records of a table paged.
@param int $page
@param int $limit
@return mixed : Array with results. | [
"Finds",
"all",
"records",
"of",
"a",
"table",
"paged",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L556-L561 |
20,990 | 42mate/towel | src/Towel/Model/BaseModel.php | BaseModel.findAllWithoutFetchPaged | public function findAllWithoutFetchPaged($page = 0, $limit = 20) {
$offset = $page * $limit;
$results = $this->createQuery()
->setFirstResult($offset)
->setMaxResults($limit)
->execute();
return $results;
} | php | public function findAllWithoutFetchPaged($page = 0, $limit = 20) {
$offset = $page * $limit;
$results = $this->createQuery()
->setFirstResult($offset)
->setMaxResults($limit)
->execute();
return $results;
} | [
"public",
"function",
"findAllWithoutFetchPaged",
"(",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",
"20",
")",
"{",
"$",
"offset",
"=",
"$",
"page",
"*",
"$",
"limit",
";",
"$",
"results",
"=",
"$",
"this",
"->",
"createQuery",
"(",
")",
"->",
"s... | Finds all records of a table.
@param int $page
@param int $limit
@return mixed : PDOStatement with results. | [
"Finds",
"all",
"records",
"of",
"a",
"table",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Model/BaseModel.php#L572-L579 |
20,991 | ShaoZeMing/laravel-merchant | src/Form.php | Form.redirectAfterUpdate | protected function redirectAfterUpdate()
{
merchant_toastr(trans('merchant.update_succeeded'));
$url = Input::get(Builder::PREVIOUS_URL_KEY) ?: $this->resource(-1);
return redirect($url);
} | php | protected function redirectAfterUpdate()
{
merchant_toastr(trans('merchant.update_succeeded'));
$url = Input::get(Builder::PREVIOUS_URL_KEY) ?: $this->resource(-1);
return redirect($url);
} | [
"protected",
"function",
"redirectAfterUpdate",
"(",
")",
"{",
"merchant_toastr",
"(",
"trans",
"(",
"'merchant.update_succeeded'",
")",
")",
";",
"$",
"url",
"=",
"Input",
"::",
"get",
"(",
"Builder",
"::",
"PREVIOUS_URL_KEY",
")",
"?",
":",
"$",
"this",
"-... | Get RedirectResponse after update.
@return \Illuminate\Http\RedirectResponse | [
"Get",
"RedirectResponse",
"after",
"update",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form.php#L559-L566 |
20,992 | Humanized/yii2-location | controllers/AdminController.php | AdminController.actionIndex | public function actionIndex()
{
$model = new Location();
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
$model = new Location(); //reset model
}
$searchModel = new LocationSearch(['pagination' => TRUE]);
$dataProvider = $searchModel->search(\Y... | php | public function actionIndex()
{
$model = new Location();
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
$model = new Location(); //reset model
}
$searchModel = new LocationSearch(['pagination' => TRUE]);
$dataProvider = $searchModel->search(\Y... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Location",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
")",
")",
"&&",
"$",
"model",
... | Lists all Location models.
@return mixed | [
"Lists",
"all",
"Location",
"models",
"."
] | 48ac12ceab741fc4c82ac8e979415a11bf9175f2 | https://github.com/Humanized/yii2-location/blob/48ac12ceab741fc4c82ac8e979415a11bf9175f2/controllers/AdminController.php#L38-L53 |
20,993 | raideer/twitch-api | src/Resources/Resource.php | Resource.resolveOptions | public function resolveOptions($options, $defaults, $required = [], $allowedTypes = [])
{
$resolver = new OptionsResolver();
$resolver->setDefaults($defaults);
if (!empty($required)) {
$resolver->setRequired($required);
}
if (!empty($allowedTypes)) {
foreach ($allow... | php | public function resolveOptions($options, $defaults, $required = [], $allowedTypes = [])
{
$resolver = new OptionsResolver();
$resolver->setDefaults($defaults);
if (!empty($required)) {
$resolver->setRequired($required);
}
if (!empty($allowedTypes)) {
foreach ($allow... | [
"public",
"function",
"resolveOptions",
"(",
"$",
"options",
",",
"$",
"defaults",
",",
"$",
"required",
"=",
"[",
"]",
",",
"$",
"allowedTypes",
"=",
"[",
"]",
")",
"{",
"$",
"resolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"resolver",
... | Helper function for resolving parameters.
@param array $options Passed params
@param array $defaults Default values
@param array $required Required fields
@param array $allowedTypes Allowed field values
@return array | [
"Helper",
"function",
"for",
"resolving",
"parameters",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Resource.php#L45-L61 |
20,994 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Shipping/Shipping.php | Shipping.setSeller | public function setSeller(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Seller $seller = null)
{
$this->seller = $seller;
return $this;
} | php | public function setSeller(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Seller $seller = null)
{
$this->seller = $seller;
return $this;
} | [
"public",
"function",
"setSeller",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Seller",
"$",
"seller",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"seller",
"=",
"$",
"se... | Set seller.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Seller $seller
@return Shipping | [
"Set",
"seller",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Shipping/Shipping.php#L685-L690 |
20,995 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Shipping/Shipping.php | Shipping.addProduct | public function addProduct(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Product\Product $product)
{
$this->products[] = $product;
return $this;
} | php | public function addProduct(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Product\Product $product)
{
$this->products[] = $product;
return $this;
} | [
"public",
"function",
"addProduct",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Product",
"\\",
"Product",
"$",
"product",
")",
"{",
"$",
"this",
"->",
"products",
"[",
"... | Add product.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Product\Product $product
@return Shipping | [
"Add",
"product",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Shipping/Shipping.php#L709-L714 |
20,996 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Shipping/Shipping.php | Shipping.removeProduct | public function removeProduct(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Product\Product $product)
{
return $this->products->removeElement($product);
} | php | public function removeProduct(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Product\Product $product)
{
return $this->products->removeElement($product);
} | [
"public",
"function",
"removeProduct",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Product",
"\\",
"Product",
"$",
"product",
")",
"{",
"return",
"$",
"this",
"->",
"produc... | Remove product.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Product\Product $product
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"product",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Shipping/Shipping.php#L723-L726 |
20,997 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Shipping/Shipping.php | Shipping.addTransport | public function addTransport(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport)
{
$this->transports[] = $transport;
return $this;
} | php | public function addTransport(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport)
{
$this->transports[] = $transport;
return $this;
} | [
"public",
"function",
"addTransport",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Transport",
"\\",
"Transport",
"$",
"transport",
")",
"{",
"$",
"this",
"->",
"transports",
... | Add transport.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport
@return Shipping | [
"Add",
"transport",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Shipping/Shipping.php#L745-L750 |
20,998 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Shipping/Shipping.php | Shipping.removeTransport | public function removeTransport(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport)
{
return $this->transports->removeElement($transport);
} | php | public function removeTransport(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport)
{
return $this->transports->removeElement($transport);
} | [
"public",
"function",
"removeTransport",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Transport",
"\\",
"Transport",
"$",
"transport",
")",
"{",
"return",
"$",
"this",
"->",
... | Remove transport.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Transport\Transport $transport
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"transport",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Shipping/Shipping.php#L759-L762 |
20,999 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Shipping/Shipping.php | Shipping.addInvoice | public function addInvoice(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Invoice\Invoice $invoice)
{
$this->invoices[] = $invoice;
return $this;
} | php | public function addInvoice(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Invoice\Invoice $invoice)
{
$this->invoices[] = $invoice;
return $this;
} | [
"public",
"function",
"addInvoice",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Invoice",
"\\",
"Invoice",
"$",
"invoice",
")",
"{",
"$",
"this",
"->",
"invoices",
"[",
"... | Add invoice.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Invoice\Invoice $invoice
@return Shipping | [
"Add",
"invoice",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Shipping/Shipping.php#L781-L786 |
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.