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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
199,000 | oziks/XHProfServiceProvider | src/Oziks/Lib/XHProfRun.php | XHProfRun.end | public function end()
{
if (!extension_loaded('xhprof')) {
throw new Exception("XHProf extension is not loaded.", 1);
}
if ($this->started) {
$this->data = xhprof_disable();
require_once(sprintf('%s/xhprof_lib/utils/xhprof_runs.php', $this->dir));
... | php | public function end()
{
if (!extension_loaded('xhprof')) {
throw new Exception("XHProf extension is not loaded.", 1);
}
if ($this->started) {
$this->data = xhprof_disable();
require_once(sprintf('%s/xhprof_lib/utils/xhprof_runs.php', $this->dir));
... | [
"public",
"function",
"end",
"(",
")",
"{",
"if",
"(",
"!",
"extension_loaded",
"(",
"'xhprof'",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"XHProf extension is not loaded.\"",
",",
"1",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"started",
")"... | Triggers the end of the run
@return boolean True if the run is started before call end method | [
"Triggers",
"the",
"end",
"of",
"the",
"run"
] | 2b262b242bb29a5627c5a9f61545a10035414ae7 | https://github.com/oziks/XHProfServiceProvider/blob/2b262b242bb29a5627c5a9f61545a10035414ae7/src/Oziks/Lib/XHProfRun.php#L66-L81 |
199,001 | oziks/XHProfServiceProvider | src/Oziks/Lib/XHProfRun.php | XHProfRun.getReport | public function getReport($id = null)
{
if ($id === null) {
$id = $this->id;
}
return array('runId' => $id, 'report' => sprintf('%s?run=%s&source=%s', $this->host, $id, $this->namespace));
} | php | public function getReport($id = null)
{
if ($id === null) {
$id = $this->id;
}
return array('runId' => $id, 'report' => sprintf('%s?run=%s&source=%s', $this->host, $id, $this->namespace));
} | [
"public",
"function",
"getReport",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"id",
";",
"}",
"return",
"array",
"(",
"'runId'",
"=>",
"$",
"id",
",",
"'report'",
"=>... | Gets the current report.
@return array The current report | [
"Gets",
"the",
"current",
"report",
"."
] | 2b262b242bb29a5627c5a9f61545a10035414ae7 | https://github.com/oziks/XHProfServiceProvider/blob/2b262b242bb29a5627c5a9f61545a10035414ae7/src/Oziks/Lib/XHProfRun.php#L88-L95 |
199,002 | oziks/XHProfServiceProvider | src/Oziks/Lib/XHProfRun.php | XHProfRun.getReports | public function getReports()
{
$reports = array();
$dir = ini_get("xhprof.output_dir");
if (is_dir($dir)) {
$finder = new Finder();
$finder
->files()
->name('*.'.$this->namespace)
->notName($this->id.'.'.$this->namespac... | php | public function getReports()
{
$reports = array();
$dir = ini_get("xhprof.output_dir");
if (is_dir($dir)) {
$finder = new Finder();
$finder
->files()
->name('*.'.$this->namespace)
->notName($this->id.'.'.$this->namespac... | [
"public",
"function",
"getReports",
"(",
")",
"{",
"$",
"reports",
"=",
"array",
"(",
")",
";",
"$",
"dir",
"=",
"ini_get",
"(",
"\"xhprof.output_dir\"",
")",
";",
"if",
"(",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"$",
"finder",
"=",
"new",
"Fin... | Gets the last reports.
@return array The last reports | [
"Gets",
"the",
"last",
"reports",
"."
] | 2b262b242bb29a5627c5a9f61545a10035414ae7 | https://github.com/oziks/XHProfServiceProvider/blob/2b262b242bb29a5627c5a9f61545a10035414ae7/src/Oziks/Lib/XHProfRun.php#L102-L132 |
199,003 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Expression/Operand/Path.php | Path.funcCondition | private function funcCondition($name, $arg = null)
{
$this->getExpr()->addCondition(new ConditionFunc(
$name,
$this,
$arg !== null ? $this->getExpr()->value($arg) : null
));
return $this->getExpr();
} | php | private function funcCondition($name, $arg = null)
{
$this->getExpr()->addCondition(new ConditionFunc(
$name,
$this,
$arg !== null ? $this->getExpr()->value($arg) : null
));
return $this->getExpr();
} | [
"private",
"function",
"funcCondition",
"(",
"$",
"name",
",",
"$",
"arg",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getExpr",
"(",
")",
"->",
"addCondition",
"(",
"new",
"ConditionFunc",
"(",
"$",
"name",
",",
"$",
"this",
",",
"$",
"arg",
"!==",
... | Add a function call to the current expression.
@param string $name
@param string|null $arg
@return QueryBuilder|Expr | [
"Add",
"a",
"function",
"call",
"to",
"the",
"current",
"expression",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Operand/Path.php#L84-L93 |
199,004 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Expression/Operand/Path.php | Path.prime | public function prime($primer = true)
{
if (!is_bool($primer) && !is_callable($primer)) {
throw new \InvalidArgumentException('$primer is not a boolean or callable');
}
if ($primer === false) {
unset($this->getExpr()->qb->primers[$this->getExpression()]);
... | php | public function prime($primer = true)
{
if (!is_bool($primer) && !is_callable($primer)) {
throw new \InvalidArgumentException('$primer is not a boolean or callable');
}
if ($primer === false) {
unset($this->getExpr()->qb->primers[$this->getExpression()]);
... | [
"public",
"function",
"prime",
"(",
"$",
"primer",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"primer",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"primer",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$primer ... | Use a primer to eagerly load all references in this path segment.
If $primer is true or a callable is provided, referenced documents for
this attribute will loaded into UnitOfWork immediately after the query is
executed. This will avoid multiple queries due to lazy initialization of
Proxy objects.
If $primer is false... | [
"Use",
"a",
"primer",
"to",
"eagerly",
"load",
"all",
"references",
"in",
"this",
"path",
"segment",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Operand/Path.php#L242-L257 |
199,005 | anime-db/catalog-bundle | src/Controller/RefillController.php | RefillController.refillAction | public function refillAction($plugin, $field, Request $request)
{
/* @var $refiller RefillerInterface */
if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
}
$item =... | php | public function refillAction($plugin, $field, Request $request)
{
/* @var $refiller RefillerInterface */
if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
}
$item =... | [
"public",
"function",
"refillAction",
"(",
"$",
"plugin",
",",
"$",
"field",
",",
"Request",
"$",
"request",
")",
"{",
"/* @var $refiller RefillerInterface */",
"if",
"(",
"!",
"(",
"$",
"refiller",
"=",
"$",
"this",
"->",
"get",
"(",
"'anime_db.plugin.refille... | Refill item.
@param string $plugin
@param string $field
@param Request $request
@return Response | [
"Refill",
"item",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/RefillController.php#L47-L63 |
199,006 | anime-db/catalog-bundle | src/Controller/RefillController.php | RefillController.searchAction | public function searchAction($plugin, $field, Request $request)
{
/* @var $refiller RefillerInterface */
if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
}
$item =... | php | public function searchAction($plugin, $field, Request $request)
{
/* @var $refiller RefillerInterface */
if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
}
$item =... | [
"public",
"function",
"searchAction",
"(",
"$",
"plugin",
",",
"$",
"field",
",",
"Request",
"$",
"request",
")",
"{",
"/* @var $refiller RefillerInterface */",
"if",
"(",
"!",
"(",
"$",
"refiller",
"=",
"$",
"this",
"->",
"get",
"(",
"'anime_db.plugin.refille... | Search for refill.
@param string $plugin
@param string $field
@param Request $request
@return Response | [
"Search",
"for",
"refill",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/RefillController.php#L74-L108 |
199,007 | mekras/class-helpers | src/Traits/LoggingHelperTrait.php | LoggingHelperTrait.logException | protected function logException(\Exception $e, $action = null, $level = LogLevel::ERROR)
{
$message = $action
? sprintf('%s failed: %s', $action, $e->getMessage())
: sprintf('%s: %s', get_class($e), $e->getMessage());
$this->getLogger()->log($level, $message, ['backtrace' => ... | php | protected function logException(\Exception $e, $action = null, $level = LogLevel::ERROR)
{
$message = $action
? sprintf('%s failed: %s', $action, $e->getMessage())
: sprintf('%s: %s', get_class($e), $e->getMessage());
$this->getLogger()->log($level, $message, ['backtrace' => ... | [
"protected",
"function",
"logException",
"(",
"\\",
"Exception",
"$",
"e",
",",
"$",
"action",
"=",
"null",
",",
"$",
"level",
"=",
"LogLevel",
"::",
"ERROR",
")",
"{",
"$",
"message",
"=",
"$",
"action",
"?",
"sprintf",
"(",
"'%s failed: %s'",
",",
"$... | Log exception.
@param \Exception $e Exception.
@param string|null $action Failed action short description.
@param mixed $level Log level (default to LogLevel::ERROR).
@since 1.1 Default log level is LogLevel::ERROR
@since 1.0 | [
"Log",
"exception",
"."
] | 4b00db6cba814cb5f8973a5929c167fce555c172 | https://github.com/mekras/class-helpers/blob/4b00db6cba814cb5f8973a5929c167fce555c172/src/Traits/LoggingHelperTrait.php#L68-L74 |
199,008 | PatrolServer/patrolsdk-php | lib/PatrolObject.php | PatrolObject.defaults | public function defaults($defaults) {
$this->defaults = $defaults;
foreach ($defaults as $k => $v) {
if (property_exists($this, $k)) {
$this->{$k} = $v;
}
}
} | php | public function defaults($defaults) {
$this->defaults = $defaults;
foreach ($defaults as $k => $v) {
if (property_exists($this, $k)) {
$this->{$k} = $v;
}
}
} | [
"public",
"function",
"defaults",
"(",
"$",
"defaults",
")",
"{",
"$",
"this",
"->",
"defaults",
"=",
"$",
"defaults",
";",
"foreach",
"(",
"$",
"defaults",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
"... | Sets the default values for this PatrolObject
@param array $defaults | [
"Sets",
"the",
"default",
"values",
"for",
"this",
"PatrolObject"
] | 2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2 | https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/PatrolObject.php#L108-L116 |
199,009 | PatrolServer/patrolsdk-php | lib/PatrolObject.php | PatrolObject.mergeValues | public function mergeValues($object) {
$values = $object->__toArray();
foreach ($values as $k => $v) {
$this->values[$k] = $v;
}
if ($object->id) $this->id = $object->id;
$this->dirty_values = [];
} | php | public function mergeValues($object) {
$values = $object->__toArray();
foreach ($values as $k => $v) {
$this->values[$k] = $v;
}
if ($object->id) $this->id = $object->id;
$this->dirty_values = [];
} | [
"public",
"function",
"mergeValues",
"(",
"$",
"object",
")",
"{",
"$",
"values",
"=",
"$",
"object",
"->",
"__toArray",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"values",
"[",
"$"... | Merges values from another PatrolObject
@param PatrolObject | [
"Merges",
"values",
"from",
"another",
"PatrolObject"
] | 2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2 | https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/PatrolObject.php#L123-L131 |
199,010 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Metadata/MetadataFactory.php | MetadataFactory.isChildOf | public function isChildOf($child, $parent)
{
$childMeta = $this->getMetadataForType($child);
if (false === $childMeta->isChildEntity()) {
return false;
}
return $childMeta->getParentEntityType() === $parent;
} | php | public function isChildOf($child, $parent)
{
$childMeta = $this->getMetadataForType($child);
if (false === $childMeta->isChildEntity()) {
return false;
}
return $childMeta->getParentEntityType() === $parent;
} | [
"public",
"function",
"isChildOf",
"(",
"$",
"child",
",",
"$",
"parent",
")",
"{",
"$",
"childMeta",
"=",
"$",
"this",
"->",
"getMetadataForType",
"(",
"$",
"child",
")",
";",
"if",
"(",
"false",
"===",
"$",
"childMeta",
"->",
"isChildEntity",
"(",
")... | Determines if a type is direct child of another type.
@param string $child
@param string $parent
@return bool | [
"Determines",
"if",
"a",
"type",
"is",
"direct",
"child",
"of",
"another",
"type",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/MetadataFactory.php#L205-L212 |
199,011 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Metadata/MetadataFactory.php | MetadataFactory.isDescendantOf | public function isDescendantOf($child, $parent)
{
$childMeta = $this->getMetadataForType($child);
if (false === $childMeta->isChildEntity()) {
return false;
}
if ($childMeta->getParentEntityType() === $parent) {
return true;
}
return $this->isD... | php | public function isDescendantOf($child, $parent)
{
$childMeta = $this->getMetadataForType($child);
if (false === $childMeta->isChildEntity()) {
return false;
}
if ($childMeta->getParentEntityType() === $parent) {
return true;
}
return $this->isD... | [
"public",
"function",
"isDescendantOf",
"(",
"$",
"child",
",",
"$",
"parent",
")",
"{",
"$",
"childMeta",
"=",
"$",
"this",
"->",
"getMetadataForType",
"(",
"$",
"child",
")",
";",
"if",
"(",
"false",
"===",
"$",
"childMeta",
"->",
"isChildEntity",
"(",... | Determines if a type is a descendant of another type.
@param string $child
@param string $parent
@return bool | [
"Determines",
"if",
"a",
"type",
"is",
"a",
"descendant",
"of",
"another",
"type",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/MetadataFactory.php#L233-L243 |
199,012 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Metadata/MetadataFactory.php | MetadataFactory.mergeMetadata | private function mergeMetadata(EntityMetadata &$metadata = null, EntityMetadata $toAdd)
{
if (null === $metadata) {
$metadata = clone $toAdd;
} else {
$metadata->merge($toAdd);
}
} | php | private function mergeMetadata(EntityMetadata &$metadata = null, EntityMetadata $toAdd)
{
if (null === $metadata) {
$metadata = clone $toAdd;
} else {
$metadata->merge($toAdd);
}
} | [
"private",
"function",
"mergeMetadata",
"(",
"EntityMetadata",
"&",
"$",
"metadata",
"=",
"null",
",",
"EntityMetadata",
"$",
"toAdd",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"metadata",
")",
"{",
"$",
"metadata",
"=",
"clone",
"$",
"toAdd",
";",
"}",
... | Merges two sets of EntityMetadata.
Is used for applying inheritance information.
@param EntityMetadata &$metadata
@param EntityMetadata $toAdd | [
"Merges",
"two",
"sets",
"of",
"EntityMetadata",
".",
"Is",
"used",
"for",
"applying",
"inheritance",
"information",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/MetadataFactory.php#L252-L259 |
199,013 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Metadata/MetadataFactory.php | MetadataFactory.formatEntityType | private function formatEntityType($type)
{
$delim = EntityMetadata::NAMESPACE_DELIM;
if (false === stristr($type, $delim)) {
return $this->inflector->studlify($type);
}
$parts = explode($delim, $type);
foreach ($parts as &$part) {
$part = $this->infle... | php | private function formatEntityType($type)
{
$delim = EntityMetadata::NAMESPACE_DELIM;
if (false === stristr($type, $delim)) {
return $this->inflector->studlify($type);
}
$parts = explode($delim, $type);
foreach ($parts as &$part) {
$part = $this->infle... | [
"private",
"function",
"formatEntityType",
"(",
"$",
"type",
")",
"{",
"$",
"delim",
"=",
"EntityMetadata",
"::",
"NAMESPACE_DELIM",
";",
"if",
"(",
"false",
"===",
"stristr",
"(",
"$",
"type",
",",
"$",
"delim",
")",
")",
"{",
"return",
"$",
"this",
"... | Formats the entity type.
@param string $type
@return string | [
"Formats",
"the",
"entity",
"type",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/MetadataFactory.php#L267-L279 |
199,014 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Metadata/MetadataFactory.php | MetadataFactory.getFromMemory | private function getFromMemory($type)
{
if (isset($this->loaded[$type])) {
return $this->loaded[$type];
}
return null;
} | php | private function getFromMemory($type)
{
if (isset($this->loaded[$type])) {
return $this->loaded[$type];
}
return null;
} | [
"private",
"function",
"getFromMemory",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"loaded",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"loaded",
"[",
"$",
"type",
"]",
";",
"}",
"return",
"nul... | Gets a Metadata instance for a type from memory.
@return EntityMetadata|null | [
"Gets",
"a",
"Metadata",
"instance",
"for",
"a",
"type",
"from",
"memory",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/MetadataFactory.php#L333-L339 |
199,015 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Metadata/MetadataFactory.php | MetadataFactory.getFromCache | private function getFromCache($type)
{
if (false === $this->hasCache()) {
return null;
}
return $this->cache->loadMetadataFromCache($type);
} | php | private function getFromCache($type)
{
if (false === $this->hasCache()) {
return null;
}
return $this->cache->loadMetadataFromCache($type);
} | [
"private",
"function",
"getFromCache",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"hasCache",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"cache",
"->",
"loadMetadataFromCache",
"(",
"$",
... | Retrieves a Metadata instance for a type from cache.
@return EntityMetadata|null | [
"Retrieves",
"a",
"Metadata",
"instance",
"for",
"a",
"type",
"from",
"cache",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/MetadataFactory.php#L358-L364 |
199,016 | wearenolte/assets | src/Assets.php | Assets.set_up_environment | private function set_up_environment() {
if ( $this->it_has( 'environment' ) ) {
$this->environment = $this->options['environment'];
} else {
$this->environment = defined( 'WP_DEBUG' ) && WP_DEBUG
? 'development'
: 'production';
}
} | php | private function set_up_environment() {
if ( $this->it_has( 'environment' ) ) {
$this->environment = $this->options['environment'];
} else {
$this->environment = defined( 'WP_DEBUG' ) && WP_DEBUG
? 'development'
: 'production';
}
} | [
"private",
"function",
"set_up_environment",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"it_has",
"(",
"'environment'",
")",
")",
"{",
"$",
"this",
"->",
"environment",
"=",
"$",
"this",
"->",
"options",
"[",
"'environment'",
"]",
";",
"}",
"else",
"... | Setup the environment based on options given.
@since 1.1.0
@access private
@return void | [
"Setup",
"the",
"environment",
"based",
"on",
"options",
"given",
"."
] | 2082a8085a4d3731c530aed0f2fa183e4aa4b6e8 | https://github.com/wearenolte/assets/blob/2082a8085a4d3731c530aed0f2fa183e4aa4b6e8/src/Assets.php#L135-L143 |
199,017 | wearenolte/assets | src/Assets.php | Assets.set_up_version_numbers | private function set_up_version_numbers() {
if ( $this->it_has( 'js_version' ) ) {
$this->js_version = $this->options['js_version'];
}
if ( $this->it_has( 'css_version' ) ) {
$this->css_version = $this->options['css_version'];
}
if ( $this->it_has( 'jquery_version' ) ) {
$this->jquery_version = $this... | php | private function set_up_version_numbers() {
if ( $this->it_has( 'js_version' ) ) {
$this->js_version = $this->options['js_version'];
}
if ( $this->it_has( 'css_version' ) ) {
$this->css_version = $this->options['css_version'];
}
if ( $this->it_has( 'jquery_version' ) ) {
$this->jquery_version = $this... | [
"private",
"function",
"set_up_version_numbers",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"it_has",
"(",
"'js_version'",
")",
")",
"{",
"$",
"this",
"->",
"js_version",
"=",
"$",
"this",
"->",
"options",
"[",
"'js_version'",
"]",
";",
"}",
"if",
"(... | Setup JS and CSS version numbers based on options given.
@since 1.1.0
@access private
@return void | [
"Setup",
"JS",
"and",
"CSS",
"version",
"numbers",
"based",
"on",
"options",
"given",
"."
] | 2082a8085a4d3731c530aed0f2fa183e4aa4b6e8 | https://github.com/wearenolte/assets/blob/2082a8085a4d3731c530aed0f2fa183e4aa4b6e8/src/Assets.php#L153-L163 |
199,018 | wearenolte/assets | src/Assets.php | Assets.it_has | private function it_has( $option_name ) {
return array_key_exists( $option_name, $this->options ) && ! empty( $this->options[ $option_name ] );
} | php | private function it_has( $option_name ) {
return array_key_exists( $option_name, $this->options ) && ! empty( $this->options[ $option_name ] );
} | [
"private",
"function",
"it_has",
"(",
"$",
"option_name",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"option_name",
",",
"$",
"this",
"->",
"options",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"option_name",
"]",
")",
... | Check whether a given option exists in the options array.
@since 1.1.0
@access private
@param string $option_name The name of the option to check for existence.
@return bool Whether the given option key exists. | [
"Check",
"whether",
"a",
"given",
"option",
"exists",
"in",
"the",
"options",
"array",
"."
] | 2082a8085a4d3731c530aed0f2fa183e4aa4b6e8 | https://github.com/wearenolte/assets/blob/2082a8085a4d3731c530aed0f2fa183e4aa4b6e8/src/Assets.php#L174-L176 |
199,019 | wearenolte/assets | src/Assets.php | Assets.load | public function load() {
$this->load_comments = $this->it_has( 'load_coments', $this->options )
? $this->options['load_comments']
: false;
$this->enqueue_assets();
} | php | public function load() {
$this->load_comments = $this->it_has( 'load_coments', $this->options )
? $this->options['load_comments']
: false;
$this->enqueue_assets();
} | [
"public",
"function",
"load",
"(",
")",
"{",
"$",
"this",
"->",
"load_comments",
"=",
"$",
"this",
"->",
"it_has",
"(",
"'load_coments'",
",",
"$",
"this",
"->",
"options",
")",
"?",
"$",
"this",
"->",
"options",
"[",
"'load_comments'",
"]",
":",
"fals... | Enqueues the theme assets.
@since 1.1.0
@return void | [
"Enqueues",
"the",
"theme",
"assets",
"."
] | 2082a8085a4d3731c530aed0f2fa183e4aa4b6e8 | https://github.com/wearenolte/assets/blob/2082a8085a4d3731c530aed0f2fa183e4aa4b6e8/src/Assets.php#L185-L190 |
199,020 | wearenolte/assets | src/Assets.php | Assets.setup_assets | public function setup_assets() {
$suffix = $this->get_assets_suffix();
if ( ! is_admin() ) {
if ( ! empty( $this->jquery_uri ) ) {
$this->update_jquery();
}
$remove_emoji_exists = array_key_exists( 'remove_emoji', $this->options );
if ( ! $remove_emoji_exists ||
( $remove_emoji_exists && $this-... | php | public function setup_assets() {
$suffix = $this->get_assets_suffix();
if ( ! is_admin() ) {
if ( ! empty( $this->jquery_uri ) ) {
$this->update_jquery();
}
$remove_emoji_exists = array_key_exists( 'remove_emoji', $this->options );
if ( ! $remove_emoji_exists ||
( $remove_emoji_exists && $this-... | [
"public",
"function",
"setup_assets",
"(",
")",
"{",
"$",
"suffix",
"=",
"$",
"this",
"->",
"get_assets_suffix",
"(",
")",
";",
"if",
"(",
"!",
"is_admin",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"jquery_uri",
")",
")",... | Enqueues JS and CSS assets based on options passed.
@since 1.1.0
@return void | [
"Enqueues",
"JS",
"and",
"CSS",
"assets",
"based",
"on",
"options",
"passed",
"."
] | 2082a8085a4d3731c530aed0f2fa183e4aa4b6e8 | https://github.com/wearenolte/assets/blob/2082a8085a4d3731c530aed0f2fa183e4aa4b6e8/src/Assets.php#L214-L253 |
199,021 | wearenolte/assets | src/Assets.php | Assets.update_jquery | private function update_jquery() {
wp_deregister_script( 'jquery' );
if ( apply_filters( self::HOOK_PREFIX . 'include_jquery', false ) ) {
wp_register_script(
// Handle.
'jquery',
// Source path.
$this->jquery_uri,
// No dependencies.
false,
// Version number.
$this->jquery_versio... | php | private function update_jquery() {
wp_deregister_script( 'jquery' );
if ( apply_filters( self::HOOK_PREFIX . 'include_jquery', false ) ) {
wp_register_script(
// Handle.
'jquery',
// Source path.
$this->jquery_uri,
// No dependencies.
false,
// Version number.
$this->jquery_versio... | [
"private",
"function",
"update_jquery",
"(",
")",
"{",
"wp_deregister_script",
"(",
"'jquery'",
")",
";",
"if",
"(",
"apply_filters",
"(",
"self",
"::",
"HOOK_PREFIX",
".",
"'include_jquery'",
",",
"false",
")",
")",
"{",
"wp_register_script",
"(",
"// Handle.",... | Enqueues theme-bundled jQuery instead of default one in WordPress.
@since 1.1.0
@access private
@return void | [
"Enqueues",
"theme",
"-",
"bundled",
"jQuery",
"instead",
"of",
"default",
"one",
"in",
"WordPress",
"."
] | 2082a8085a4d3731c530aed0f2fa183e4aa4b6e8 | https://github.com/wearenolte/assets/blob/2082a8085a4d3731c530aed0f2fa183e4aa4b6e8/src/Assets.php#L263-L282 |
199,022 | phossa/phossa-di | src/Phossa/Di/Extension/Decorate/DecorateExtension.php | DecorateExtension.decorateService | public function decorateService($service)
{
try {
foreach ($this->rules as $rule) {
// if closure returns true
if ($rule[0]($service)) {
// execute the decorate callable
$rule[1]($service);
}
}
... | php | public function decorateService($service)
{
try {
foreach ($this->rules as $rule) {
// if closure returns true
if ($rule[0]($service)) {
// execute the decorate callable
$rule[1]($service);
}
}
... | [
"public",
"function",
"decorateService",
"(",
"$",
"service",
")",
"{",
"try",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"rule",
")",
"{",
"// if closure returns true",
"if",
"(",
"$",
"rule",
"[",
"0",
"]",
"(",
"$",
"service",
")",
... | Apply decorating rules to a service object if matches
@param object $service
@return void
@throws LogicException if something goes wrong
@access public
@internal | [
"Apply",
"decorating",
"rules",
"to",
"a",
"service",
"object",
"if",
"matches"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Extension/Decorate/DecorateExtension.php#L57-L70 |
199,023 | phossa/phossa-di | src/Phossa/Di/Extension/Decorate/DecorateExtension.php | DecorateExtension.setDecorate | public function setDecorate(
/*# string */ $ruleName,
$interfaceOrClosure,
$decorateCallable
) {
// create closure it it is a interface name
if (!is_callable($interfaceOrClosure)) {
$interfaceOrClosure = function ($service) use ($interfaceOrClosure) {
... | php | public function setDecorate(
/*# string */ $ruleName,
$interfaceOrClosure,
$decorateCallable
) {
// create closure it it is a interface name
if (!is_callable($interfaceOrClosure)) {
$interfaceOrClosure = function ($service) use ($interfaceOrClosure) {
... | [
"public",
"function",
"setDecorate",
"(",
"/*# string */",
"$",
"ruleName",
",",
"$",
"interfaceOrClosure",
",",
"$",
"decorateCallable",
")",
"{",
"// create closure it it is a interface name",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"interfaceOrClosure",
")",
")",
... | Set up docorating rules
@param string $ruleName decorate rule name
@param string|callable $interfaceOrClosure callable or interface/class
@param array|callable $decorateCallable callable or [method, arguments]
@return void
@throws LogicException if something goes wrong
@access public
@internal | [
"Set",
"up",
"docorating",
"rules"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Extension/Decorate/DecorateExtension.php#L83-L107 |
199,024 | nicodevs/laito | src/Laito/View.php | View.render | public function render($view, $values = array())
{
// Setup the template path
$folder = $this->app->config('templates.path');
$view = $folder . $view . '.php';
// Check if the template exists
if (!file_exists($view)) {
throw new \Exception('Template not found: ' ... | php | public function render($view, $values = array())
{
// Setup the template path
$folder = $this->app->config('templates.path');
$view = $folder . $view . '.php';
// Check if the template exists
if (!file_exists($view)) {
throw new \Exception('Template not found: ' ... | [
"public",
"function",
"render",
"(",
"$",
"view",
",",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"// Setup the template path",
"$",
"folder",
"=",
"$",
"this",
"->",
"app",
"->",
"config",
"(",
"'templates.path'",
")",
";",
"$",
"view",
"=",
"$"... | Renders a template with optional data
@param string $template Name of the template
@param array $values Array of values to replace in the template
@return string Rendered HTML | [
"Renders",
"a",
"template",
"with",
"optional",
"data"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/View.php#L15-L35 |
199,025 | ScaraMVC/Framework | src/Scara/Mail/MailerServiceProvider.php | MailerServiceProvider.register | public function register()
{
$this->create('mail', function () {
// return new Mailer();
$c = new Configuration();
$config = $c->from('mail');
$mail = new Mailer($config->get('host'), $config->get('port'),
$config->get('smtp_auth'), $config->g... | php | public function register()
{
$this->create('mail', function () {
// return new Mailer();
$c = new Configuration();
$config = $c->from('mail');
$mail = new Mailer($config->get('host'), $config->get('port'),
$config->get('smtp_auth'), $config->g... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"create",
"(",
"'mail'",
",",
"function",
"(",
")",
"{",
"// return new Mailer();",
"$",
"c",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"config",
"=",
"$",
"c",
"->",
"from",
... | Registers the Mailer Service Provider.
@return void | [
"Registers",
"the",
"Mailer",
"Service",
"Provider",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Mail/MailerServiceProvider.php#L18-L30 |
199,026 | RocketPropelledTortoise/Core | src/Translation/I18N.php | I18N.setCurrentLanguage | public function setCurrentLanguage($language)
{
if (!$this->isAvailable($language)) {
return false;
}
$this->session->put('language', $language);
$this->setLanguage($language);
return true;
} | php | public function setCurrentLanguage($language)
{
if (!$this->isAvailable($language)) {
return false;
}
$this->session->put('language', $language);
$this->setLanguage($language);
return true;
} | [
"public",
"function",
"setCurrentLanguage",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isAvailable",
"(",
"$",
"language",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"session",
"->",
"put",
"(",
"'language'"... | Set the current language
@param string $language
@return bool | [
"Set",
"the",
"current",
"language"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Translation/I18N.php#L172-L183 |
199,027 | RocketPropelledTortoise/Core | src/Translation/I18N.php | I18N.setLanguage | public function setLanguage($language)
{
if ($language == $this->currentLanguage) {
return;
}
if (!$this->isLoaded($language)) {
$this->loadLanguage($language);
}
switch ($language) {
case 'fr':
setlocale(LC_ALL, 'fr_FR.ut... | php | public function setLanguage($language)
{
if ($language == $this->currentLanguage) {
return;
}
if (!$this->isLoaded($language)) {
$this->loadLanguage($language);
}
switch ($language) {
case 'fr':
setlocale(LC_ALL, 'fr_FR.ut... | [
"public",
"function",
"setLanguage",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"$",
"language",
"==",
"$",
"this",
"->",
"currentLanguage",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"isLoaded",
"(",
"$",
"language",
")",
")",
... | Set the language to use
@param string $language
@return bool | [
"Set",
"the",
"language",
"to",
"use"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Translation/I18N.php#L233-L257 |
199,028 | RocketPropelledTortoise/Core | src/Translation/I18N.php | I18N.languages | public function languages($key = null, $subkey = null)
{
if ($key === null) {
return $this->languagesIso;
}
if (is_int($key)) {
if (is_null($subkey)) {
return $this->languagesId[$key];
}
return $this->languagesId[$key][$subkey... | php | public function languages($key = null, $subkey = null)
{
if ($key === null) {
return $this->languagesIso;
}
if (is_int($key)) {
if (is_null($subkey)) {
return $this->languagesId[$key];
}
return $this->languagesId[$key][$subkey... | [
"public",
"function",
"languages",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"subkey",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"languagesIso",
";",
"}",
"if",
"(",
"is_int",
"(",
"$",
"key... | Retrieve languages.
this is a hybrid method.
I18N::languages();
returns ['fr' => ['id' => 1, 'name' => 'francais', 'iso' => 'fr'], 'en' => ...]
I18N::languages('fr');
returns ['id' => 1, 'name' => 'francais', 'iso' => 'fr']
I18N::languages(1);
returns ['id' => 1, 'name' => 'francais', 'iso' => 'fr']
I18N::lang... | [
"Retrieve",
"languages",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Translation/I18N.php#L321-L340 |
199,029 | RocketPropelledTortoise/Core | src/Translation/I18N.php | I18N.translate | public function translate($string, $context = 'default', $language = 'default')
{
if ($this->isDefault($language)) {
$language = $this->currentLanguage;
} else {
$this->setLanguage($language);
}
//get string from cache
if (array_key_exists($context, $... | php | public function translate($string, $context = 'default', $language = 'default')
{
if ($this->isDefault($language)) {
$language = $this->currentLanguage;
} else {
$this->setLanguage($language);
}
//get string from cache
if (array_key_exists($context, $... | [
"public",
"function",
"translate",
"(",
"$",
"string",
",",
"$",
"context",
"=",
"'default'",
",",
"$",
"language",
"=",
"'default'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDefault",
"(",
"$",
"language",
")",
")",
"{",
"$",
"language",
"=",
"$",... | Retreive a string to translate
if it doesn't find it, put it in the database
@param string $string
@param string $context
@param string $language
@return string | [
"Retreive",
"a",
"string",
"to",
"translate"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Translation/I18N.php#L395-L429 |
199,030 | RocketPropelledTortoise/Core | src/Translation/I18N.php | I18N.getContext | public function getContext()
{
if ($this->pageContext) {
return $this->pageContext;
}
$current = \Route::getCurrentRoute();
if (!$current) {
return 'default';
}
if ($current->getName()) {
return $this->pageContext = $current->get... | php | public function getContext()
{
if ($this->pageContext) {
return $this->pageContext;
}
$current = \Route::getCurrentRoute();
if (!$current) {
return 'default';
}
if ($current->getName()) {
return $this->pageContext = $current->get... | [
"public",
"function",
"getContext",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pageContext",
")",
"{",
"return",
"$",
"this",
"->",
"pageContext",
";",
"}",
"$",
"current",
"=",
"\\",
"Route",
"::",
"getCurrentRoute",
"(",
")",
";",
"if",
"(",
"!"... | Get the page's context
@return string | [
"Get",
"the",
"page",
"s",
"context"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Translation/I18N.php#L446-L468 |
199,031 | tw88/sso | src/Broker.php | Broker.getAttachUrl | public function getAttachUrl($params = [], $cookieBased = null)
{
$this->generateToken($cookieBased);
$data = [
'command' => 'attach',
'broker' => $this->broker,
'token' => $this->token,
'checksum' => hash('sha256', 'attach' . $this->token . $this->se... | php | public function getAttachUrl($params = [], $cookieBased = null)
{
$this->generateToken($cookieBased);
$data = [
'command' => 'attach',
'broker' => $this->broker,
'token' => $this->token,
'checksum' => hash('sha256', 'attach' . $this->token . $this->se... | [
"public",
"function",
"getAttachUrl",
"(",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"cookieBased",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"generateToken",
"(",
"$",
"cookieBased",
")",
";",
"$",
"data",
"=",
"[",
"'command'",
"=>",
"'attach'",
",",
... | Get URL to attach session at SSO server.
@param array $params
@return string | [
"Get",
"URL",
"to",
"attach",
"session",
"at",
"SSO",
"server",
"."
] | 746323f3087af5a06769f7c207ab4ed5124a14bb | https://github.com/tw88/sso/blob/746323f3087af5a06769f7c207ab4ed5124a14bb/src/Broker.php#L152-L164 |
199,032 | tw88/sso | src/Broker.php | Broker.request | protected function request($method, $command, $data = null)
{
if (!$this->isAttached()) {
throw new NotAttachedException('No token');
}
$url = $this->getRequestUrl($command, !$data || $method === 'POST' ? [] : $data);
$ch = curl_init($url);
curl_setopt($ch, CURLO... | php | protected function request($method, $command, $data = null)
{
if (!$this->isAttached()) {
throw new NotAttachedException('No token');
}
$url = $this->getRequestUrl($command, !$data || $method === 'POST' ? [] : $data);
$ch = curl_init($url);
curl_setopt($ch, CURLO... | [
"protected",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"command",
",",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isAttached",
"(",
")",
")",
"{",
"throw",
"new",
"NotAttachedException",
"(",
"'No token'",
")",
... | Execute on SSO server.
@param string $method HTTP method: 'GET', 'POST', 'DELETE'
@param string $command Command
@param array|string $data Query or post parameters
@return array|object | [
"Execute",
"on",
"SSO",
"server",
"."
] | 746323f3087af5a06769f7c207ab4ed5124a14bb | https://github.com/tw88/sso/blob/746323f3087af5a06769f7c207ab4ed5124a14bb/src/Broker.php#L227-L269 |
199,033 | tw88/sso | src/Broker.php | Broker.login | public function login($username = null, $password = null)
{
if (!isset($username) && isset($_POST['username'])) {
$username = $_POST['username'];
}
if (!isset($password) && isset($_POST['password'])) {
$password = $_POST['password'];
}
$result = $this... | php | public function login($username = null, $password = null)
{
if (!isset($username) && isset($_POST['username'])) {
$username = $_POST['username'];
}
if (!isset($password) && isset($_POST['password'])) {
$password = $_POST['password'];
}
$result = $this... | [
"public",
"function",
"login",
"(",
"$",
"username",
"=",
"null",
",",
"$",
"password",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"username",
")",
"&&",
"isset",
"(",
"$",
"_POST",
"[",
"'username'",
"]",
")",
")",
"{",
"$",
"user... | Log the client in at the SSO server.
Only brokers marked trused can collect and send the user's credentials. Other brokers should omit $username and
$password.
@param string $username
@param string $password
@return array user info
@throws Exception if login fails eg due to incorrect credentials | [
"Log",
"the",
"client",
"in",
"at",
"the",
"SSO",
"server",
"."
] | 746323f3087af5a06769f7c207ab4ed5124a14bb | https://github.com/tw88/sso/blob/746323f3087af5a06769f7c207ab4ed5124a14bb/src/Broker.php#L283-L296 |
199,034 | squareproton/Bond | src/Bond/Pg/QueryExceptionFactory.php | QueryExceptionFactory.get | public function get()
{
$class = null;
// decide the most accurate exception we've got for this state and throw that
if( $this->state ) {
for( $i = 5; $i > 0; $i-- ) {
$exceptionQueue[] = sprintf(
"State%s",
substr( $this->state, ... | php | public function get()
{
$class = null;
// decide the most accurate exception we've got for this state and throw that
if( $this->state ) {
for( $i = 5; $i > 0; $i-- ) {
$exceptionQueue[] = sprintf(
"State%s",
substr( $this->state, ... | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"class",
"=",
"null",
";",
"// decide the most accurate exception we've got for this state and throw that",
"if",
"(",
"$",
"this",
"->",
"state",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"5",
";",
"$",
"i",
">",
... | Get the actual exception
@return Bond\Pg\Exception\QueryException | [
"Get",
"the",
"actual",
"exception"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/QueryExceptionFactory.php#L328-L368 |
199,035 | native5/native5-sdk-client-php | src/Native5/Control/ProtectedController.php | ProtectedController.execute | public function execute($request)
{
$logger = $GLOBALS['logger'];
try {
parent::execute($request);
} catch(AuthenticationException $ex) {
$logger->error('Unauthorized attempt to access resource, being redirected to home page', array($ex->getMessage()));
$... | php | public function execute($request)
{
$logger = $GLOBALS['logger'];
try {
parent::execute($request);
} catch(AuthenticationException $ex) {
$logger->error('Unauthorized attempt to access resource, being redirected to home page', array($ex->getMessage()));
$... | [
"public",
"function",
"execute",
"(",
"$",
"request",
")",
"{",
"$",
"logger",
"=",
"$",
"GLOBALS",
"[",
"'logger'",
"]",
";",
"try",
"{",
"parent",
"::",
"execute",
"(",
"$",
"request",
")",
";",
"}",
"catch",
"(",
"AuthenticationException",
"$",
"ex"... | Checks for secure routing,
currently security is handled at a base route level,
@param mixed $request Execute request.
@access public
@return void | [
"Checks",
"for",
"secure",
"routing",
"currently",
"security",
"is",
"handled",
"at",
"a",
"base",
"route",
"level"
] | e1f598cf27654d81bb5facace1990b737242a2f9 | https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/Control/ProtectedController.php#L72-L83 |
199,036 | native5/native5-sdk-client-php | src/Native5/Control/ProtectedController.php | ProtectedController._handleUnauthenticatedAccess | protected function _handleUnauthenticatedAccess()
{
header("HTTP/1.0 401 Unauthorized");
$renderer = new TwigRenderer();
$output = $renderer->render('unauth.tmpl', array());
$result = array("code"=>"401","message" => $output);
echo parent::encodeData($result);
exit;
... | php | protected function _handleUnauthenticatedAccess()
{
header("HTTP/1.0 401 Unauthorized");
$renderer = new TwigRenderer();
$output = $renderer->render('unauth.tmpl', array());
$result = array("code"=>"401","message" => $output);
echo parent::encodeData($result);
exit;
... | [
"protected",
"function",
"_handleUnauthenticatedAccess",
"(",
")",
"{",
"header",
"(",
"\"HTTP/1.0 401 Unauthorized\"",
")",
";",
"$",
"renderer",
"=",
"new",
"TwigRenderer",
"(",
")",
";",
"$",
"output",
"=",
"$",
"renderer",
"->",
"render",
"(",
"'unauth.tmpl'... | Handle Unauthenticated access.
@access protected
@return void | [
"Handle",
"Unauthenticated",
"access",
"."
] | e1f598cf27654d81bb5facace1990b737242a2f9 | https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/Control/ProtectedController.php#L106-L115 |
199,037 | Kris-Kuiper/sFire-Framework | src/Routing/Extend/Redirect.php | Redirect.domain | public function domain($domain = null) {
if(null !== $domain) {
if(false === is_string($domain)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
}
//Check if identifier exists
if(false === Rout... | php | public function domain($domain = null) {
if(null !== $domain) {
if(false === is_string($domain)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
}
//Check if identifier exists
if(false === Rout... | [
"public",
"function",
"domain",
"(",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"domain",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"domain",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
... | Set the domain
@param string $domain
@return sFire\Routing\Redirect | [
"Set",
"the",
"domain"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Routing/Extend/Redirect.php#L77-L94 |
199,038 | dann95/ts3-php | TeamSpeak3/Adapter/Update.php | Update.syn | public function syn()
{
if (!isset($this->options["host"]) || empty($this->options["host"])) {
$this->options["host"] = $this->default_host;
}
if (!isset($this->options["port"]) || empty($this->options["port"])) {
$this->options["port"] = $this->default_port;
... | php | public function syn()
{
if (!isset($this->options["host"]) || empty($this->options["host"])) {
$this->options["host"] = $this->default_host;
}
if (!isset($this->options["port"]) || empty($this->options["port"])) {
$this->options["port"] = $this->default_port;
... | [
"public",
"function",
"syn",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"\"host\"",
"]",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"\"host\"",
"]",
")",
")",
"{",
"$",
"this",
"->",
"options"... | Connects the AbstractTransport object and performs initial actions on the remote
server.
@throws Ts3Exception
@return void | [
"Connects",
"the",
"AbstractTransport",
"object",
"and",
"performs",
"initial",
"actions",
"on",
"the",
"remote",
"server",
"."
] | d4693d78b54be0177a2b5fab316c0ff9d036238d | https://github.com/dann95/ts3-php/blob/d4693d78b54be0177a2b5fab316c0ff9d036238d/TeamSpeak3/Adapter/Update.php#L78-L107 |
199,039 | t3v/t3v_datamapper | Classes/Command/PageLanguageOverlayCommandController.php | PageLanguageOverlayCommandController.listCommand | public function listCommand(int $sysLanguageUid, int $pid = 1, int $recursion = 99, string $exclude = '') {
$this->beforeCommand();
$table = new ConsoleTable();
$table->setHeaders(['UID', 'Title', 'Page ID', 'Status']);
foreach ($this->getPageUids($pid, $recursion, $exclude) as $pageUid) {
$lang... | php | public function listCommand(int $sysLanguageUid, int $pid = 1, int $recursion = 99, string $exclude = '') {
$this->beforeCommand();
$table = new ConsoleTable();
$table->setHeaders(['UID', 'Title', 'Page ID', 'Status']);
foreach ($this->getPageUids($pid, $recursion, $exclude) as $pageUid) {
$lang... | [
"public",
"function",
"listCommand",
"(",
"int",
"$",
"sysLanguageUid",
",",
"int",
"$",
"pid",
"=",
"1",
",",
"int",
"$",
"recursion",
"=",
"99",
",",
"string",
"$",
"exclude",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"beforeCommand",
"(",
")",
";",
... | Lists page language overlays.
@param int $sysLanguageUid The system language UID of the page language overlays to list
@param int $pid The optional PID of the page to search from, defaults to `1`
@param int $recursion The optional recursion, defaults to `99`
@param string $exclude The optional UIDs of pages to exclude... | [
"Lists",
"page",
"language",
"overlays",
"."
] | bab2de90f467936fbe4270cd133cb4109d1108eb | https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Command/PageLanguageOverlayCommandController.php#L46-L65 |
199,040 | t3v/t3v_datamapper | Classes/Command/PageLanguageOverlayCommandController.php | PageLanguageOverlayCommandController.initializeCommand | public function initializeCommand(int $sysLanguageUid, int $pid = 1, int $recursion = 99, string $exclude = '', bool $verbose = false) {
$this->beforeCommand();
foreach ($this->getPageUids($pid, $recursion, $exclude) as $pageUid) {
$languageOverlay = LanguageOverlay::where([['pid', '=', $pageUid], ['sys_... | php | public function initializeCommand(int $sysLanguageUid, int $pid = 1, int $recursion = 99, string $exclude = '', bool $verbose = false) {
$this->beforeCommand();
foreach ($this->getPageUids($pid, $recursion, $exclude) as $pageUid) {
$languageOverlay = LanguageOverlay::where([['pid', '=', $pageUid], ['sys_... | [
"public",
"function",
"initializeCommand",
"(",
"int",
"$",
"sysLanguageUid",
",",
"int",
"$",
"pid",
"=",
"1",
",",
"int",
"$",
"recursion",
"=",
"99",
",",
"string",
"$",
"exclude",
"=",
"''",
",",
"bool",
"$",
"verbose",
"=",
"false",
")",
"{",
"$... | Initializes page language overlays.
@param int $sysLanguageUid The system language UID of the page language overlays to initialize
@param int $pid The optional PID of the page to search from, defaults to `1`
@param int $recursion The optional recursion, defaults to `99`
@param string $exclude The optional UIDs of page... | [
"Initializes",
"page",
"language",
"overlays",
"."
] | bab2de90f467936fbe4270cd133cb4109d1108eb | https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Command/PageLanguageOverlayCommandController.php#L76-L110 |
199,041 | t3v/t3v_datamapper | Classes/Command/PageLanguageOverlayCommandController.php | PageLanguageOverlayCommandController.hideCommand | public function hideCommand(int $sysLanguageUid, int $pid = 1, int $recursion = 99, string $exclude = '', bool $verbose = false) {
$this->beforeCommand();
foreach ($this->getPageUids($pid, $recursion, $exclude) as $pageUid) {
$languageOverlay = LanguageOverlay::where([['pid', '=', $pageUid], ['sys_langua... | php | public function hideCommand(int $sysLanguageUid, int $pid = 1, int $recursion = 99, string $exclude = '', bool $verbose = false) {
$this->beforeCommand();
foreach ($this->getPageUids($pid, $recursion, $exclude) as $pageUid) {
$languageOverlay = LanguageOverlay::where([['pid', '=', $pageUid], ['sys_langua... | [
"public",
"function",
"hideCommand",
"(",
"int",
"$",
"sysLanguageUid",
",",
"int",
"$",
"pid",
"=",
"1",
",",
"int",
"$",
"recursion",
"=",
"99",
",",
"string",
"$",
"exclude",
"=",
"''",
",",
"bool",
"$",
"verbose",
"=",
"false",
")",
"{",
"$",
"... | Hides page language overlays.
@param int $sysLanguageUid The system language UID of the page language overlays to hide
@param int $pid The optional PID of the page to search from, defaults to `1`
@param int $recursion The optional recursion, defaults to `99`
@param string $exclude The optional UIDs of pages to exclude... | [
"Hides",
"page",
"language",
"overlays",
"."
] | bab2de90f467936fbe4270cd133cb4109d1108eb | https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Command/PageLanguageOverlayCommandController.php#L121-L142 |
199,042 | t3v/t3v_datamapper | Classes/Command/PageLanguageOverlayCommandController.php | PageLanguageOverlayCommandController.getPageUids | protected function getPageUids(int $pid = 1, int $recursion = 99, string $exclude = '') {
$exclude = $exclude === '-' ? '' : $exclude;
$exclude = GeneralUtility::intExplode(',', $exclude, true);
$pagesTreeList = $this->queryGenerator->getTreeList($pid, $recursion, 0, 1);
$pageUids = Gen... | php | protected function getPageUids(int $pid = 1, int $recursion = 99, string $exclude = '') {
$exclude = $exclude === '-' ? '' : $exclude;
$exclude = GeneralUtility::intExplode(',', $exclude, true);
$pagesTreeList = $this->queryGenerator->getTreeList($pid, $recursion, 0, 1);
$pageUids = Gen... | [
"protected",
"function",
"getPageUids",
"(",
"int",
"$",
"pid",
"=",
"1",
",",
"int",
"$",
"recursion",
"=",
"99",
",",
"string",
"$",
"exclude",
"=",
"''",
")",
"{",
"$",
"exclude",
"=",
"$",
"exclude",
"===",
"'-'",
"?",
"''",
":",
"$",
"exclude"... | Gets page UIDs.
@param int $pid The optional PID of the page to search from, defaults to `1`
@param int $recursion The optional recursion, defaults to `99`
@param string $exclude The optional UIDs of pages to exclude from as string, seperated by `,`, empty by default | [
"Gets",
"page",
"UIDs",
"."
] | bab2de90f467936fbe4270cd133cb4109d1108eb | https://github.com/t3v/t3v_datamapper/blob/bab2de90f467936fbe4270cd133cb4109d1108eb/Classes/Command/PageLanguageOverlayCommandController.php#L190-L198 |
199,043 | JurJean/SpraySerializerBundle | src/DependencyInjection/CompilerPass/TaggedSerializerCompilerPass.php | TaggedSerializerCompilerPass.process | public function process(ContainerBuilder $container)
{
$registryDefinition = $container->getDefinition('spray_serializer.serializer_registry');
$tagged = $container->findTaggedServiceIds('spray_serializer');
foreach ($tagged as $id => $tags) {
foreach ($tags as $attr) {
... | php | public function process(ContainerBuilder $container)
{
$registryDefinition = $container->getDefinition('spray_serializer.serializer_registry');
$tagged = $container->findTaggedServiceIds('spray_serializer');
foreach ($tagged as $id => $tags) {
foreach ($tags as $attr) {
... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"registryDefinition",
"=",
"$",
"container",
"->",
"getDefinition",
"(",
"'spray_serializer.serializer_registry'",
")",
";",
"$",
"tagged",
"=",
"$",
"container",
"->",
"fin... | Find services tagged with "spray_serializer" and attach them to the
serializer registry.
@param ContainerBuilder $container
@return void | [
"Find",
"services",
"tagged",
"with",
"spray_serializer",
"and",
"attach",
"them",
"to",
"the",
"serializer",
"registry",
"."
] | 2b822f81bd7a49f120dbe6d75672908727fc40f9 | https://github.com/JurJean/SpraySerializerBundle/blob/2b822f81bd7a49f120dbe6d75672908727fc40f9/src/DependencyInjection/CompilerPass/TaggedSerializerCompilerPass.php#L18-L30 |
199,044 | Vectrex/vxPHP | src/Security/Csrf/CsrfTokenManager.php | CsrfTokenManager.getToken | public function getToken($tokenId) {
if($this->storage->hasToken($tokenId)) {
return $this->storage->getToken($tokenId);
}
$token = new CsrfToken(
$tokenId,
$this->generateValue((int) $this->tokenLength)
);
$this->storage->setToken($tokenId, $token);
return $token;
} | php | public function getToken($tokenId) {
if($this->storage->hasToken($tokenId)) {
return $this->storage->getToken($tokenId);
}
$token = new CsrfToken(
$tokenId,
$this->generateValue((int) $this->tokenLength)
);
$this->storage->setToken($tokenId, $token);
return $token;
} | [
"public",
"function",
"getToken",
"(",
"$",
"tokenId",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"->",
"hasToken",
"(",
"$",
"tokenId",
")",
")",
"{",
"return",
"$",
"this",
"->",
"storage",
"->",
"getToken",
"(",
"$",
"tokenId",
")",
";",
... | returns a CSRF token for the given token id
if previously no token existed for the given id, a new token is
generated, stored and returned; otherwise the existing token is returned
@param string $tokenId
@return CsrfToken | [
"returns",
"a",
"CSRF",
"token",
"for",
"the",
"given",
"token",
"id"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Security/Csrf/CsrfTokenManager.php#L69-L83 |
199,045 | Vectrex/vxPHP | src/Security/Csrf/CsrfTokenManager.php | CsrfTokenManager.refreshToken | public function refreshToken($tokenId) {
$this->storage->removeToken($tokenId);
$token = new CsrfToken(
$tokenId,
$this->generateValue((int) $this->tokenLength)
);
$this->storage->setToken($tokenId, $token);
return $token;
} | php | public function refreshToken($tokenId) {
$this->storage->removeToken($tokenId);
$token = new CsrfToken(
$tokenId,
$this->generateValue((int) $this->tokenLength)
);
$this->storage->setToken($tokenId, $token);
return $token;
} | [
"public",
"function",
"refreshToken",
"(",
"$",
"tokenId",
")",
"{",
"$",
"this",
"->",
"storage",
"->",
"removeToken",
"(",
"$",
"tokenId",
")",
";",
"$",
"token",
"=",
"new",
"CsrfToken",
"(",
"$",
"tokenId",
",",
"$",
"this",
"->",
"generateValue",
... | generates a new token for the given id
a new token will be generated, independent
of whether a token value previously existed or not
useful to enforce once-only tokens
@param string $tokenId
@return CsrfToken | [
"generates",
"a",
"new",
"token",
"for",
"the",
"given",
"id",
"a",
"new",
"token",
"will",
"be",
"generated",
"independent",
"of",
"whether",
"a",
"token",
"value",
"previously",
"existed",
"or",
"not",
"useful",
"to",
"enforce",
"once",
"-",
"only",
"tok... | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Security/Csrf/CsrfTokenManager.php#L94-L107 |
199,046 | Vectrex/vxPHP | src/Security/Csrf/CsrfTokenManager.php | CsrfTokenManager.isTokenValid | public function isTokenValid(CsrfToken $token) {
$tokenId = $token->getId();
if (!$this->storage->hasToken($tokenId)) {
return FALSE;
}
return hash_equals($this->storage->getToken($tokenId)->getValue(), $token->getValue());
} | php | public function isTokenValid(CsrfToken $token) {
$tokenId = $token->getId();
if (!$this->storage->hasToken($tokenId)) {
return FALSE;
}
return hash_equals($this->storage->getToken($tokenId)->getValue(), $token->getValue());
} | [
"public",
"function",
"isTokenValid",
"(",
"CsrfToken",
"$",
"token",
")",
"{",
"$",
"tokenId",
"=",
"$",
"token",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"storage",
"->",
"hasToken",
"(",
"$",
"tokenId",
")",
")",
"{",
"re... | check whether the given CSRF token is valid
returns TRUE if the token is valid, FALSE otherwise
@param CsrfToken $token
@return bool | [
"check",
"whether",
"the",
"given",
"CSRF",
"token",
"is",
"valid",
"returns",
"TRUE",
"if",
"the",
"token",
"is",
"valid",
"FALSE",
"otherwise"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Security/Csrf/CsrfTokenManager.php#L130-L140 |
199,047 | kkthek/diqa-util | src/Util/RequestUtils.php | RequestUtils.getSessionCookieForExportUser | public static function getSessionCookieForExportUser($user, $pass) {
global $wgServerHTTP, $wgScriptPath, $wgODBTechnicalUser;
$user = urlencode ( $user );
$pass = urlencode ( $pass );
// first: request a token
$apiPath = "/api.php?action=login&format=json&lgname=$user&lgpasswo... | php | public static function getSessionCookieForExportUser($user, $pass) {
global $wgServerHTTP, $wgScriptPath, $wgODBTechnicalUser;
$user = urlencode ( $user );
$pass = urlencode ( $pass );
// first: request a token
$apiPath = "/api.php?action=login&format=json&lgname=$user&lgpasswo... | [
"public",
"static",
"function",
"getSessionCookieForExportUser",
"(",
"$",
"user",
",",
"$",
"pass",
")",
"{",
"global",
"$",
"wgServerHTTP",
",",
"$",
"wgScriptPath",
",",
"$",
"wgODBTechnicalUser",
";",
"$",
"user",
"=",
"urlencode",
"(",
"$",
"user",
")",... | Requests a session cookie for a user.
@param string $user
@param string $pass
@throws \Exception
@return [ 'cookieprefix' => ... , 'sessionId' => ... ] | [
"Requests",
"a",
"session",
"cookie",
"for",
"a",
"user",
"."
] | df35d16403b5dbf0f7570daded6cfa26814ae7e0 | https://github.com/kkthek/diqa-util/blob/df35d16403b5dbf0f7570daded6cfa26814ae7e0/src/Util/RequestUtils.php#L25-L65 |
199,048 | geoffadams/bedrest-events | library/BedRest/Events/EventManager.php | EventManager.addClassListeners | public function addClassListeners($instance)
{
if (!$this->driver) {
throw Exception::noDriver();
}
foreach ($this->driver->getListenersForClass($instance) as $listener) {
$this->addListener($listener['event'], array($instance, $listener['method']));
... | php | public function addClassListeners($instance)
{
if (!$this->driver) {
throw Exception::noDriver();
}
foreach ($this->driver->getListenersForClass($instance) as $listener) {
$this->addListener($listener['event'], array($instance, $listener['method']));
... | [
"public",
"function",
"addClassListeners",
"(",
"$",
"instance",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"driver",
")",
"{",
"throw",
"Exception",
"::",
"noDriver",
"(",
")",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"driver",
"->",
"getListene... | Automatically maps event listeners associated with a class using the driver provided to this instance and
registers them.
@param object $instance
@throws \BedRest\Events\MappingException | [
"Automatically",
"maps",
"event",
"listeners",
"associated",
"with",
"a",
"class",
"using",
"the",
"driver",
"provided",
"to",
"this",
"instance",
"and",
"registers",
"them",
"."
] | 470f7b5358b80e3c69e8337670e8d347d4e3dbff | https://github.com/geoffadams/bedrest-events/blob/470f7b5358b80e3c69e8337670e8d347d4e3dbff/library/BedRest/Events/EventManager.php#L62-L71 |
199,049 | geoffadams/bedrest-events | library/BedRest/Events/EventManager.php | EventManager.addListeners | public function addListeners($event, $listeners)
{
foreach ($listeners as $listener) {
$this->addListener($event, $listener);
}
} | php | public function addListeners($event, $listeners)
{
foreach ($listeners as $listener) {
$this->addListener($event, $listener);
}
} | [
"public",
"function",
"addListeners",
"(",
"$",
"event",
",",
"$",
"listeners",
")",
"{",
"foreach",
"(",
"$",
"listeners",
"as",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"addListener",
"(",
"$",
"event",
",",
"$",
"listener",
")",
";",
"}",
"}"... | Adds a set of listeners.
@param string $event
@param callable $listeners | [
"Adds",
"a",
"set",
"of",
"listeners",
"."
] | 470f7b5358b80e3c69e8337670e8d347d4e3dbff | https://github.com/geoffadams/bedrest-events/blob/470f7b5358b80e3c69e8337670e8d347d4e3dbff/library/BedRest/Events/EventManager.php#L94-L99 |
199,050 | geoffadams/bedrest-events | library/BedRest/Events/EventManager.php | EventManager.getListeners | public function getListeners($event)
{
if (!isset($this->listeners[$event]) || !is_array($this->listeners[$event])) {
return array();
}
return $this->listeners[$event];
} | php | public function getListeners($event)
{
if (!isset($this->listeners[$event]) || !is_array($this->listeners[$event])) {
return array();
}
return $this->listeners[$event];
} | [
"public",
"function",
"getListeners",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
"||",
"!",
"is_array",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
... | Retrieves all listeners for an event.
@param string $event
@return array | [
"Retrieves",
"all",
"listeners",
"for",
"an",
"event",
"."
] | 470f7b5358b80e3c69e8337670e8d347d4e3dbff | https://github.com/geoffadams/bedrest-events/blob/470f7b5358b80e3c69e8337670e8d347d4e3dbff/library/BedRest/Events/EventManager.php#L107-L114 |
199,051 | geoffadams/bedrest-events | library/BedRest/Events/EventManager.php | EventManager.dispatch | public function dispatch($event, Event $eventObject)
{
if (!isset($this->listeners[$event])) {
return;
}
foreach ($this->listeners[$event] as $listener) {
call_user_func_array($listener, array($eventObject));
if ($eventObject->propaga... | php | public function dispatch($event, Event $eventObject)
{
if (!isset($this->listeners[$event])) {
return;
}
foreach ($this->listeners[$event] as $listener) {
call_user_func_array($listener, array($eventObject));
if ($eventObject->propaga... | [
"public",
"function",
"dispatch",
"(",
"$",
"event",
",",
"Event",
"$",
"eventObject",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
... | Dispatches an event to all listeners.
@param string $event
@param \BedRest\Events\Event $eventObject | [
"Dispatches",
"an",
"event",
"to",
"all",
"listeners",
"."
] | 470f7b5358b80e3c69e8337670e8d347d4e3dbff | https://github.com/geoffadams/bedrest-events/blob/470f7b5358b80e3c69e8337670e8d347d4e3dbff/library/BedRest/Events/EventManager.php#L122-L135 |
199,052 | agentmedia/phine-core | src/Core/Logic/Module/TemplateModule.php | TemplateModule.BuiltInTemplateFile | protected final function BuiltInTemplateFile()
{
$class = new \ReflectionClass($this);
$classFile = Str::Replace('\\', '/', $class->getFileName());
$templatePath = Str::Replace('/Modules/', '/Templates/', $classFile);
return Path::AddExtension($templatePath, 'phtml', true);
} | php | protected final function BuiltInTemplateFile()
{
$class = new \ReflectionClass($this);
$classFile = Str::Replace('\\', '/', $class->getFileName());
$templatePath = Str::Replace('/Modules/', '/Templates/', $classFile);
return Path::AddExtension($templatePath, 'phtml', true);
} | [
"protected",
"final",
"function",
"BuiltInTemplateFile",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"classFile",
"=",
"Str",
"::",
"Replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"class",
"->",
"g... | Returns the template file that comes with the bundle module
@return string | [
"Returns",
"the",
"template",
"file",
"that",
"comes",
"with",
"the",
"bundle",
"module"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/TemplateModule.php#L30-L36 |
199,053 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.up | public function up ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0],
$this->_currentPosition[1] - $count,
);
return $this;
} | php | public function up ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0],
$this->_currentPosition[1] - $count,
);
return $this;
} | [
"public",
"function",
"up",
"(",
"$",
"count",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"_currentPosition",
"=",
"array",
"(",
"$",
"this",
"->",
"_currentPosition",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"_currentPosition",
"[",
"1",
"]",
"-",
"$",
... | Move up current position
@param int $count Move count
@return CursorObject Self instance | [
"Move",
"up",
"current",
"position"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L56-L62 |
199,054 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.down | public function down ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0],
$this->_currentPosition[1] + $count,
);
return $this;
} | php | public function down ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0],
$this->_currentPosition[1] + $count,
);
return $this;
} | [
"public",
"function",
"down",
"(",
"$",
"count",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"_currentPosition",
"=",
"array",
"(",
"$",
"this",
"->",
"_currentPosition",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"_currentPosition",
"[",
"1",
"]",
"+",
"$",
... | Move down current position
@param int $count Move count
@return CursorObject Self instance | [
"Move",
"down",
"current",
"position"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L70-L76 |
199,055 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.left | public function left ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0] - $count,
$this->_currentPosition[1],
);
return $this;
} | php | public function left ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0] - $count,
$this->_currentPosition[1],
);
return $this;
} | [
"public",
"function",
"left",
"(",
"$",
"count",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"_currentPosition",
"=",
"array",
"(",
"$",
"this",
"->",
"_currentPosition",
"[",
"0",
"]",
"-",
"$",
"count",
",",
"$",
"this",
"->",
"_currentPosition",
"[",
"... | Move left current position
@param int $count Move count
@return CursorObject Self instance | [
"Move",
"left",
"current",
"position"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L84-L90 |
199,056 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.right | public function right ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0] + $count,
$this->_currentPosition[1],
);
return $this;
} | php | public function right ( $count = 0 ) {
$this->_currentPosition = array(
$this->_currentPosition[0] + $count,
$this->_currentPosition[1],
);
return $this;
} | [
"public",
"function",
"right",
"(",
"$",
"count",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"_currentPosition",
"=",
"array",
"(",
"$",
"this",
"->",
"_currentPosition",
"[",
"0",
"]",
"+",
"$",
"count",
",",
"$",
"this",
"->",
"_currentPosition",
"[",
... | Move right current position
@param int $count Move count
@return CursorObject Self instance | [
"Move",
"right",
"current",
"position"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L98-L104 |
199,057 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.move | public function move ( $dx, $dy ) {
if ( $dx < 0 ) {
$this->left(abs($dx));
} else {
$this->right(abs($dx));
}
if ( $dy < 0 ) {
$this->up(abs($dy));
} else {
$this->down(abs($dy));
}
return $this;
} | php | public function move ( $dx, $dy ) {
if ( $dx < 0 ) {
$this->left(abs($dx));
} else {
$this->right(abs($dx));
}
if ( $dy < 0 ) {
$this->up(abs($dy));
} else {
$this->down(abs($dy));
}
return $this;
} | [
"public",
"function",
"move",
"(",
"$",
"dx",
",",
"$",
"dy",
")",
"{",
"if",
"(",
"$",
"dx",
"<",
"0",
")",
"{",
"$",
"this",
"->",
"left",
"(",
"abs",
"(",
"$",
"dx",
")",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"right",
"(",
"ab... | Move current position
@param int $dx Horizontal displacement
@param int $dy Vertical displacement
@return CursorObject Self instance | [
"Move",
"current",
"position"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L113-L125 |
199,058 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.setAncor | public function setAncor ( $position = null ) {
if ( is_null($position) === true ) {
$position = $this->_currentPosition;
}
$this->_ancorPosition = $position;
return $this;
} | php | public function setAncor ( $position = null ) {
if ( is_null($position) === true ) {
$position = $this->_currentPosition;
}
$this->_ancorPosition = $position;
return $this;
} | [
"public",
"function",
"setAncor",
"(",
"$",
"position",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"position",
")",
"===",
"true",
")",
"{",
"$",
"position",
"=",
"$",
"this",
"->",
"_currentPosition",
";",
"}",
"$",
"this",
"->",
"_ancor... | Set ancor position
@param array $position (x, y)
@return CursorObject Self instance | [
"Set",
"ancor",
"position"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L154-L160 |
199,059 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.getEscapeSequencesByPath | public function getEscapeSequencesByPath ( $dx = null, $dy = null ) {
if ( is_null($dx) === true ) {
$dx = $this->_currentPosition[0] - $this->_ancorPosition[0];
}
if ( is_null($dy) === true ) {
$dy = $this->_currentPosition[1] - $this->_ancorPosition[1];
}
... | php | public function getEscapeSequencesByPath ( $dx = null, $dy = null ) {
if ( is_null($dx) === true ) {
$dx = $this->_currentPosition[0] - $this->_ancorPosition[0];
}
if ( is_null($dy) === true ) {
$dy = $this->_currentPosition[1] - $this->_ancorPosition[1];
}
... | [
"public",
"function",
"getEscapeSequencesByPath",
"(",
"$",
"dx",
"=",
"null",
",",
"$",
"dy",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dx",
")",
"===",
"true",
")",
"{",
"$",
"dx",
"=",
"$",
"this",
"->",
"_currentPosition",
"[",
"0... | Get escape sequences by path
@param int $dx Horizontal displacement
@param int $dy Vertical displacement
@return string Escape sequences | [
"Get",
"escape",
"sequences",
"by",
"path"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L169-L177 |
199,060 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility/CursorObject.php | CursorObject.getMovingEscapeSequences | public static function getMovingEscapeSequences ( $dx, $dy ) {
$escapeSequences = '';
if ( $dy < 0 ) {
$escapeSequences .= self::getUpEscapeSequence(abs($dy));
} else if ( $dy > 0 ) {
$escapeSequences .= self::getDownEscapeSequence(abs($dy));
}
if ( $dx < ... | php | public static function getMovingEscapeSequences ( $dx, $dy ) {
$escapeSequences = '';
if ( $dy < 0 ) {
$escapeSequences .= self::getUpEscapeSequence(abs($dy));
} else if ( $dy > 0 ) {
$escapeSequences .= self::getDownEscapeSequence(abs($dy));
}
if ( $dx < ... | [
"public",
"static",
"function",
"getMovingEscapeSequences",
"(",
"$",
"dx",
",",
"$",
"dy",
")",
"{",
"$",
"escapeSequences",
"=",
"''",
";",
"if",
"(",
"$",
"dy",
"<",
"0",
")",
"{",
"$",
"escapeSequences",
".=",
"self",
"::",
"getUpEscapeSequence",
"("... | Get moving escape sequences
@param int $dx
@param int $dy
@return string Moving escape sequences | [
"Get",
"moving",
"escape",
"sequences"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/CursorObject.php#L186-L199 |
199,061 | PenoaksDev/Milky-Framework | src/Milky/Queue/Console/RetryCommand.php | RetryCommand.retryJob | protected function retryJob($id)
{
$failed = $this->laravel['queue.failer']->find($id);
if (! is_null($failed)) {
$failed = (object) $failed;
$failed->payload = $this->resetAttempts($failed->payload);
$this->laravel['queue']->connection($failed->connection)
->pushRaw($failed->payload, $failed->... | php | protected function retryJob($id)
{
$failed = $this->laravel['queue.failer']->find($id);
if (! is_null($failed)) {
$failed = (object) $failed;
$failed->payload = $this->resetAttempts($failed->payload);
$this->laravel['queue']->connection($failed->connection)
->pushRaw($failed->payload, $failed->... | [
"protected",
"function",
"retryJob",
"(",
"$",
"id",
")",
"{",
"$",
"failed",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'queue.failer'",
"]",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"failed",
")",
")",
"{",
"$"... | Retry the queue job with the given ID.
@param string $id
@return void | [
"Retry",
"the",
"queue",
"job",
"with",
"the",
"given",
"ID",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Queue/Console/RetryCommand.php#L47-L65 |
199,062 | PenoaksDev/Milky-Framework | src/Milky/Queue/Console/RetryCommand.php | RetryCommand.resetAttempts | protected function resetAttempts($payload)
{
$payload = json_decode($payload, true);
if (isset($payload['attempts'])) {
$payload['attempts'] = 1;
}
return json_encode($payload);
} | php | protected function resetAttempts($payload)
{
$payload = json_decode($payload, true);
if (isset($payload['attempts'])) {
$payload['attempts'] = 1;
}
return json_encode($payload);
} | [
"protected",
"function",
"resetAttempts",
"(",
"$",
"payload",
")",
"{",
"$",
"payload",
"=",
"json_decode",
"(",
"$",
"payload",
",",
"true",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"payload",
"[",
"'attempts'",
"]",
")",
")",
"{",
"$",
"payload",
"... | Reset the payload attempts.
@param string $payload
@return string | [
"Reset",
"the",
"payload",
"attempts",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Queue/Console/RetryCommand.php#L73-L82 |
199,063 | hiqdev/minii-validators | src/Validator.php | Validator.validate | public function validate($value, &$error = null)
{
$result = $this->validateValue($value);
if (empty($result)) {
return true;
}
list($message, $params) = $result;
$params['attribute'] = Yii::t('yii', 'the input value');
$params['value'] = is_array($value)... | php | public function validate($value, &$error = null)
{
$result = $this->validateValue($value);
if (empty($result)) {
return true;
}
list($message, $params) = $result;
$params['attribute'] = Yii::t('yii', 'the input value');
$params['value'] = is_array($value)... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"&",
"$",
"error",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"validateValue",
"(",
"$",
"value",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"result",
")",
")",
"{",
"retur... | Validates a given value.
You may use this method to validate a value out of the context of a data model.
@param mixed $value the data value to be validated.
@param string $error the error message to be returned, if the validation fails.
@return boolean whether the data is valid. | [
"Validates",
"a",
"given",
"value",
".",
"You",
"may",
"use",
"this",
"method",
"to",
"validate",
"a",
"value",
"out",
"of",
"the",
"context",
"of",
"a",
"data",
"model",
"."
] | 3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741 | https://github.com/hiqdev/minii-validators/blob/3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741/src/Validator.php#L270-L283 |
199,064 | hiqdev/minii-validators | src/Validator.php | Validator.addError | public function addError($model, $attribute, $message, $params = [])
{
$value = $model->$attribute;
$params['attribute'] = $model->getAttributeLabel($attribute);
$params['value'] = is_array($value) ? 'array()' : $value;
$model->addError($attribute, Yii::$app->getI18n()->format($messa... | php | public function addError($model, $attribute, $message, $params = [])
{
$value = $model->$attribute;
$params['attribute'] = $model->getAttributeLabel($attribute);
$params['value'] = is_array($value) ? 'array()' : $value;
$model->addError($attribute, Yii::$app->getI18n()->format($messa... | [
"public",
"function",
"addError",
"(",
"$",
"model",
",",
"$",
"attribute",
",",
"$",
"message",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"value",
"=",
"$",
"model",
"->",
"$",
"attribute",
";",
"$",
"params",
"[",
"'attribute'",
"]",
"=",... | Adds an error about the specified attribute to the model object.
This is a helper method that performs message selection and internationalization.
@param \yii\base\Model $model the data model being validated
@param string $attribute the attribute being validated
@param string $message the error message
@param array $pa... | [
"Adds",
"an",
"error",
"about",
"the",
"specified",
"attribute",
"to",
"the",
"model",
"object",
".",
"This",
"is",
"a",
"helper",
"method",
"that",
"performs",
"message",
"selection",
"and",
"internationalization",
"."
] | 3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741 | https://github.com/hiqdev/minii-validators/blob/3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741/src/Validator.php#L357-L363 |
199,065 | WesamMikhail/Utils | src/Explorer.php | Explorer.getAllFiles | public static function getAllFiles($dir, $subdir = false) {
$path = '';
$stack[] = $dir;
while ($stack) {
$thisdir = array_pop($stack);
if ($dircont = scandir($thisdir)) {
$i = 0;
while (isset($dircont[$i])) {
if ($dirco... | php | public static function getAllFiles($dir, $subdir = false) {
$path = '';
$stack[] = $dir;
while ($stack) {
$thisdir = array_pop($stack);
if ($dircont = scandir($thisdir)) {
$i = 0;
while (isset($dircont[$i])) {
if ($dirco... | [
"public",
"static",
"function",
"getAllFiles",
"(",
"$",
"dir",
",",
"$",
"subdir",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"''",
";",
"$",
"stack",
"[",
"]",
"=",
"$",
"dir",
";",
"while",
"(",
"$",
"stack",
")",
"{",
"$",
"thisdir",
"=",
"a... | Get all directory files and directories
@param string $dir directory location
@param boolean $subdir include subdirectories of directory
@return array | [
"Get",
"all",
"directory",
"files",
"and",
"directories"
] | 54933740f4500a7a1ebd37c7226cc00bc36e58db | https://github.com/WesamMikhail/Utils/blob/54933740f4500a7a1ebd37c7226cc00bc36e58db/src/Explorer.php#L18-L42 |
199,066 | WesamMikhail/Utils | src/Explorer.php | Explorer.getAllSubdirectories | public static function getAllSubdirectories($dir, $subdir = false) {
$path = '';
$stack[] = $dir;
while ($stack) {
$thisdir = array_shift($stack);
if ($dircont = scandir($thisdir)) {
$i = 0;
while (isset($dircont[$i])) {
... | php | public static function getAllSubdirectories($dir, $subdir = false) {
$path = '';
$stack[] = $dir;
while ($stack) {
$thisdir = array_shift($stack);
if ($dircont = scandir($thisdir)) {
$i = 0;
while (isset($dircont[$i])) {
... | [
"public",
"static",
"function",
"getAllSubdirectories",
"(",
"$",
"dir",
",",
"$",
"subdir",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"''",
";",
"$",
"stack",
"[",
"]",
"=",
"$",
"dir",
";",
"while",
"(",
"$",
"stack",
")",
"{",
"$",
"thisdir",
... | Get all subdirectories of directory
@param string $dir directory location
@param boolean $subdir include subdirectories of subdirectory
@return array | [
"Get",
"all",
"subdirectories",
"of",
"directory"
] | 54933740f4500a7a1ebd37c7226cc00bc36e58db | https://github.com/WesamMikhail/Utils/blob/54933740f4500a7a1ebd37c7226cc00bc36e58db/src/Explorer.php#L51-L74 |
199,067 | LitGroup/enumerable.php | src/Enumerable.php | Enumerable.getValueOf | final public static function getValueOf($rawValue)
{
$values = static::getValues();
if (!array_key_exists($rawValue, $values)) {
throw new OutOfBoundsException(
sprintf('Enum "%s" has no value with raw value "%s".', get_called_class(), $rawValue)
);
}
... | php | final public static function getValueOf($rawValue)
{
$values = static::getValues();
if (!array_key_exists($rawValue, $values)) {
throw new OutOfBoundsException(
sprintf('Enum "%s" has no value with raw value "%s".', get_called_class(), $rawValue)
);
}
... | [
"final",
"public",
"static",
"function",
"getValueOf",
"(",
"$",
"rawValue",
")",
"{",
"$",
"values",
"=",
"static",
"::",
"getValues",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"rawValue",
",",
"$",
"values",
")",
")",
"{",
"throw",... | Returns an instance of Enumerable by raw value.
@param int|string $rawValue
@return static | [
"Returns",
"an",
"instance",
"of",
"Enumerable",
"by",
"raw",
"value",
"."
] | 35e49d360a1ceade4c849a6322d0aeed8e120a64 | https://github.com/LitGroup/enumerable.php/blob/35e49d360a1ceade4c849a6322d0aeed8e120a64/src/Enumerable.php#L54-L64 |
199,068 | LitGroup/enumerable.php | src/Enumerable.php | Enumerable.initializeEnum | private static function initializeEnum($enumClass)
{
self::$isInInitializationState = true;
try {
$classReflection = new ReflectionClass($enumClass);
// Enumerable must be final:
if (!$classReflection->isFinal()) {
throw new LogicException(
... | php | private static function initializeEnum($enumClass)
{
self::$isInInitializationState = true;
try {
$classReflection = new ReflectionClass($enumClass);
// Enumerable must be final:
if (!$classReflection->isFinal()) {
throw new LogicException(
... | [
"private",
"static",
"function",
"initializeEnum",
"(",
"$",
"enumClass",
")",
"{",
"self",
"::",
"$",
"isInInitializationState",
"=",
"true",
";",
"try",
"{",
"$",
"classReflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"enumClass",
")",
";",
"// Enumerab... | Initializes values of enumerable class.
@param string $enumClass | [
"Initializes",
"values",
"of",
"enumerable",
"class",
"."
] | 35e49d360a1ceade4c849a6322d0aeed8e120a64 | https://github.com/LitGroup/enumerable.php/blob/35e49d360a1ceade4c849a6322d0aeed8e120a64/src/Enumerable.php#L121-L175 |
199,069 | LitGroup/enumerable.php | src/Enumerable.php | Enumerable.isServiceMethod | private static function isServiceMethod(ReflectionMethod $method)
{
return !$method->isPublic() || in_array($method->getShortName(), self::getServiceMethods());
} | php | private static function isServiceMethod(ReflectionMethod $method)
{
return !$method->isPublic() || in_array($method->getShortName(), self::getServiceMethods());
} | [
"private",
"static",
"function",
"isServiceMethod",
"(",
"ReflectionMethod",
"$",
"method",
")",
"{",
"return",
"!",
"$",
"method",
"->",
"isPublic",
"(",
")",
"||",
"in_array",
"(",
"$",
"method",
"->",
"getShortName",
"(",
")",
",",
"self",
"::",
"getSer... | Checks that given method is for the internal use.
@param ReflectionMethod $method
@return boolean | [
"Checks",
"that",
"given",
"method",
"is",
"for",
"the",
"internal",
"use",
"."
] | 35e49d360a1ceade4c849a6322d0aeed8e120a64 | https://github.com/LitGroup/enumerable.php/blob/35e49d360a1ceade4c849a6322d0aeed8e120a64/src/Enumerable.php#L194-L197 |
199,070 | agentmedia/phine-core | src/Core/Modules/Backend/JsonPageTree.php | JsonPageTree.BeforeDelete | protected function BeforeDelete()
{
foreach (self::$deleteHooks as $hook)
{
$hook->BeforeDelete($this->item);
}
$logger = new Logger(BackendModule::Guard()->GetUser());
$logger->ReportPageAction($this->item, Action::Delete());
$file = Path::Combin... | php | protected function BeforeDelete()
{
foreach (self::$deleteHooks as $hook)
{
$hook->BeforeDelete($this->item);
}
$logger = new Logger(BackendModule::Guard()->GetUser());
$logger->ReportPageAction($this->item, Action::Delete());
$file = Path::Combin... | [
"protected",
"function",
"BeforeDelete",
"(",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"deleteHooks",
"as",
"$",
"hook",
")",
"{",
"$",
"hook",
"->",
"BeforeDelete",
"(",
"$",
"this",
"->",
"item",
")",
";",
"}",
"$",
"logger",
"=",
"new",
"Logge... | Remove htaccess page commands before page is deleted | [
"Remove",
"htaccess",
"page",
"commands",
"before",
"page",
"is",
"deleted"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/JsonPageTree.php#L51-L66 |
199,071 | TiMESPLiNTER/tsFramework | src/ch/timesplinter/core/HttpRequest.php | HttpRequest.sanitize | private function sanitize($value, $sanitizers) {
if(is_string($sanitizers) === true)
return call_user_func($sanitizers, $value);
if(is_array($sanitizers) === true) {
$valueFiltered = $value;
if(count($sanitizers) === 2 && is_callable($sanitizers) === true)
return call_user_func($sanitizers, $valueFil... | php | private function sanitize($value, $sanitizers) {
if(is_string($sanitizers) === true)
return call_user_func($sanitizers, $value);
if(is_array($sanitizers) === true) {
$valueFiltered = $value;
if(count($sanitizers) === 2 && is_callable($sanitizers) === true)
return call_user_func($sanitizers, $valueFil... | [
"private",
"function",
"sanitize",
"(",
"$",
"value",
",",
"$",
"sanitizers",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"sanitizers",
")",
"===",
"true",
")",
"return",
"call_user_func",
"(",
"$",
"sanitizers",
",",
"$",
"value",
")",
";",
"if",
"(",... | Sanitizes a value with the given functions and callbacks
@param string|int|null $value The value to sanitize
@param string|array $sanitizers The functions to sanitize the string. A simple function as string or a callback
as array or an array with simple functions and callback arrays
@return string|int|null The sanitize... | [
"Sanitizes",
"a",
"value",
"with",
"the",
"given",
"functions",
"and",
"callbacks"
] | b3b9fd98f6d456a9e571015877ecca203786fd0c | https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/core/HttpRequest.php#L252-L269 |
199,072 | MARCspec/php-marc-spec | src/MARCspecParser.php | MARCspecParser.parse | public function parse($marcspec)
{
if (!preg_match_all('/'.$this->MARCSPEC.'/', $marcspec, $this->parsed, PREG_SET_ORDER)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::FS.
InvalidMARCspecException::MISSINGFIELD,
$marcspec
... | php | public function parse($marcspec)
{
if (!preg_match_all('/'.$this->MARCSPEC.'/', $marcspec, $this->parsed, PREG_SET_ORDER)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::FS.
InvalidMARCspecException::MISSINGFIELD,
$marcspec
... | [
"public",
"function",
"parse",
"(",
"$",
"marcspec",
")",
"{",
"if",
"(",
"!",
"preg_match_all",
"(",
"'/'",
".",
"$",
"this",
"->",
"MARCSPEC",
".",
"'/'",
",",
"$",
"marcspec",
",",
"$",
"this",
"->",
"parsed",
",",
"PREG_SET_ORDER",
")",
")",
"{",... | parses MARCspec.
@param string $marcspec The MARCspec
@throws CK\MARCspec\Exception\InvalidMARCspecException | [
"parses",
"MARCspec",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspecParser.php#L126-L198 |
199,073 | MARCspec/php-marc-spec | src/MARCspecParser.php | MARCspecParser.parseSubfields | public function parseSubfields($subfieldspec)
{
if (!preg_match_all('/'.$this->SUBFIELD.'/', $subfieldspec, $_subfieldMatches, PREG_SET_ORDER)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SF.
InvalidMARCspecException::SFCHAR,
$s... | php | public function parseSubfields($subfieldspec)
{
if (!preg_match_all('/'.$this->SUBFIELD.'/', $subfieldspec, $_subfieldMatches, PREG_SET_ORDER)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SF.
InvalidMARCspecException::SFCHAR,
$s... | [
"public",
"function",
"parseSubfields",
"(",
"$",
"subfieldspec",
")",
"{",
"if",
"(",
"!",
"preg_match_all",
"(",
"'/'",
".",
"$",
"this",
"->",
"SUBFIELD",
".",
"'/'",
",",
"$",
"subfieldspec",
",",
"$",
"_subfieldMatches",
",",
"PREG_SET_ORDER",
")",
")... | Matches subfieldspecs.
@param string $subfieldspec A string of one or more subfieldspecs | [
"Matches",
"subfieldspecs",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspecParser.php#L205-L260 |
199,074 | MARCspec/php-marc-spec | src/MARCspecParser.php | MARCspecParser.subfieldToArray | public function subfieldToArray($subfieldspec)
{
if (!$_sf = $this->parseSubfields($subfieldspec)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SF.
InvalidMARCspecException::UNKNOWN,
$subfieldspec
);
}
... | php | public function subfieldToArray($subfieldspec)
{
if (!$_sf = $this->parseSubfields($subfieldspec)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SF.
InvalidMARCspecException::UNKNOWN,
$subfieldspec
);
}
... | [
"public",
"function",
"subfieldToArray",
"(",
"$",
"subfieldspec",
")",
"{",
"if",
"(",
"!",
"$",
"_sf",
"=",
"$",
"this",
"->",
"parseSubfields",
"(",
"$",
"subfieldspec",
")",
")",
"{",
"throw",
"new",
"InvalidMARCspecException",
"(",
"InvalidMARCspecExcepti... | calls parseSubfields but makes sure only one subfield is present.
@param string $subfieldspec A subfieldspec
@return array An Array of subfieldspec | [
"calls",
"parseSubfields",
"but",
"makes",
"sure",
"only",
"one",
"subfield",
"is",
"present",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspecParser.php#L269-L296 |
199,075 | MARCspec/php-marc-spec | src/MARCspecParser.php | MARCspecParser.matchSubSpecs | private function matchSubSpecs($subSpecs)
{
$_subSpecs = [];
if (!preg_match_all('/'.$this->SUBSPEC.'/U', $subSpecs, $_subSpecMatches, PREG_SET_ORDER)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SS.
InvalidMARCspecException::UNKNOWN,
... | php | private function matchSubSpecs($subSpecs)
{
$_subSpecs = [];
if (!preg_match_all('/'.$this->SUBSPEC.'/U', $subSpecs, $_subSpecMatches, PREG_SET_ORDER)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SS.
InvalidMARCspecException::UNKNOWN,
... | [
"private",
"function",
"matchSubSpecs",
"(",
"$",
"subSpecs",
")",
"{",
"$",
"_subSpecs",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"preg_match_all",
"(",
"'/'",
".",
"$",
"this",
"->",
"SUBSPEC",
".",
"'/U'",
",",
"$",
"subSpecs",
",",
"$",
"_subSpecMatches... | parses subspecs into an array.
@param string $subSpecs One or more subspecs
@return array Array of subspecs | [
"parses",
"subspecs",
"into",
"an",
"array",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspecParser.php#L305-L329 |
199,076 | MARCspec/php-marc-spec | src/MARCspecParser.php | MARCspecParser.matchSubTerms | private function matchSubTerms($subSpec)
{
if (preg_match('/(?<![\\\\\$])[\{\}]/', $subSpec, $_error, PREG_OFFSET_CAPTURE)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SS.
InvalidMARCspecException::ESCAPE,
$subSpec
)... | php | private function matchSubTerms($subSpec)
{
if (preg_match('/(?<![\\\\\$])[\{\}]/', $subSpec, $_error, PREG_OFFSET_CAPTURE)) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SS.
InvalidMARCspecException::ESCAPE,
$subSpec
)... | [
"private",
"function",
"matchSubTerms",
"(",
"$",
"subSpec",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/(?<![\\\\\\\\\\$])[\\{\\}]/'",
",",
"$",
"subSpec",
",",
"$",
"_error",
",",
"PREG_OFFSET_CAPTURE",
")",
")",
"{",
"throw",
"new",
"InvalidMARCspecException",
... | Parses a single SubSpec into sunTerms.
@param string $subSpec A single SubSpec
@return array subTerms as array | [
"Parses",
"a",
"single",
"SubSpec",
"into",
"sunTerms",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspecParser.php#L338-L368 |
199,077 | codemojo-dr/startkit-php-sdk | src/CodeMojo/Client/Services/WalletService.php | WalletService.getBalance | public function getBalance($user_id, $type = -1){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS_BALANCE;
$url = sprintf($url, $user_id, $type);
$result = $this->authenticationService->getTransport()->fetch($url)... | php | public function getBalance($user_id, $type = -1){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS_BALANCE;
$url = sprintf($url, $user_id, $type);
$result = $this->authenticationService->getTransport()->fetch($url)... | [
"public",
"function",
"getBalance",
"(",
"$",
"user_id",
",",
"$",
"type",
"=",
"-",
"1",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"authenticationService",
"->",
"getServerEndPoint",
"(",
")",
".",
"Endpoints",
"::",
"VERSION",
".",
"Endpoints",
"::... | Get the wallet balance of a user
@param $user_id
@param int $type
@return float
@throws Exception
@throws \CodeMojo\Client\Http\InvalidArgumentException | [
"Get",
"the",
"wallet",
"balance",
"of",
"a",
"user"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Services/WalletService.php#L50-L60 |
199,078 | codemojo-dr/startkit-php-sdk | src/CodeMojo/Client/Services/WalletService.php | WalletService.getTransactionDetail | public function getTransactionDetail($transaction_id){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_TRANSACTION;
$url = sprintf($url,$transaction_id);
$result = $this->authenticationService->getTransport()->fetch($url)... | php | public function getTransactionDetail($transaction_id){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_TRANSACTION;
$url = sprintf($url,$transaction_id);
$result = $this->authenticationService->getTransport()->fetch($url)... | [
"public",
"function",
"getTransactionDetail",
"(",
"$",
"transaction_id",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"authenticationService",
"->",
"getServerEndPoint",
"(",
")",
".",
"Endpoints",
"::",
"VERSION",
".",
"Endpoints",
"::",
"BASE_WALLET",
".",
... | Get details about a particular transaction
@param $transaction_id
@return array
@throws Exception
@throws InvalidArgumentException | [
"Get",
"details",
"about",
"a",
"particular",
"transaction"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Services/WalletService.php#L69-L82 |
199,079 | codemojo-dr/startkit-php-sdk | src/CodeMojo/Client/Services/WalletService.php | WalletService.getTransactionDetailsForUser | public function getTransactionDetailsForUser($user_id, $count = 10, $paginated_url = null, $page = 1){
if($paginated_url) {
$url = $paginated_url;
}else {
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET
. Endp... | php | public function getTransactionDetailsForUser($user_id, $count = 10, $paginated_url = null, $page = 1){
if($paginated_url) {
$url = $paginated_url;
}else {
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET
. Endp... | [
"public",
"function",
"getTransactionDetailsForUser",
"(",
"$",
"user_id",
",",
"$",
"count",
"=",
"10",
",",
"$",
"paginated_url",
"=",
"null",
",",
"$",
"page",
"=",
"1",
")",
"{",
"if",
"(",
"$",
"paginated_url",
")",
"{",
"$",
"url",
"=",
"$",
"p... | Get all transactions for a particular user
@param $user_id
@param int $count
@param null $paginated_url
@param int $page
@return PaginatedResults
@throws Exception
@throws \CodeMojo\Client\Http\InvalidArgumentException | [
"Get",
"all",
"transactions",
"for",
"a",
"particular",
"user"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Services/WalletService.php#L94-L113 |
199,080 | codemojo-dr/startkit-php-sdk | src/CodeMojo/Client/Services/WalletService.php | WalletService.addBalance | public function addBalance($user_id, $value_to_add, $transaction_type = WalletTransactionTypes::TRANSACTIONAL, $expires_in_days = 0, $transaction_id = null, $meta_data = null, $tag = null, $frozen = false){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . ... | php | public function addBalance($user_id, $value_to_add, $transaction_type = WalletTransactionTypes::TRANSACTIONAL, $expires_in_days = 0, $transaction_id = null, $meta_data = null, $tag = null, $frozen = false){
$url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . ... | [
"public",
"function",
"addBalance",
"(",
"$",
"user_id",
",",
"$",
"value_to_add",
",",
"$",
"transaction_type",
"=",
"WalletTransactionTypes",
"::",
"TRANSACTIONAL",
",",
"$",
"expires_in_days",
"=",
"0",
",",
"$",
"transaction_id",
"=",
"null",
",",
"$",
"me... | Add balance to a particular user's wallet
@param $user_id
@param $value_to_add
@param int $transaction_type
@param int|null $expires_in_days
@param null $transaction_id
@param null $meta_data
@param null $tag
@param bool|false $frozen
@return bool
@throws QuotaExceededException | [
"Add",
"balance",
"to",
"a",
"particular",
"user",
"s",
"wallet"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Services/WalletService.php#L223-L239 |
199,081 | zapheus/zapheus | src/Http/Message/UriFactory.php | UriFactory.make | public function make()
{
$authority = $this->host;
$fragment = $this->fragment;
$query = $this->query;
if ($this->host !== '' && $this->user !== null)
{
$user = $this->user;
if ($this->pass)
{
$user = $this->user . ':' .... | php | public function make()
{
$authority = $this->host;
$fragment = $this->fragment;
$query = $this->query;
if ($this->host !== '' && $this->user !== null)
{
$user = $this->user;
if ($this->pass)
{
$user = $this->user . ':' .... | [
"public",
"function",
"make",
"(",
")",
"{",
"$",
"authority",
"=",
"$",
"this",
"->",
"host",
";",
"$",
"fragment",
"=",
"$",
"this",
"->",
"fragment",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"query",
";",
"if",
"(",
"$",
"this",
"->",
"host"... | Creates the URI instance.
@return \Zapheus\Http\Message\UriInterface | [
"Creates",
"the",
"URI",
"instance",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Message/UriFactory.php#L116-L149 |
199,082 | zapheus/zapheus | src/Http/Message/UriFactory.php | UriFactory.user | public function user($user, $pass = null)
{
if ($pass)
{
$this->pass = $pass;
}
$this->user = $user;
return $this;
} | php | public function user($user, $pass = null)
{
if ($pass)
{
$this->pass = $pass;
}
$this->user = $user;
return $this;
} | [
"public",
"function",
"user",
"(",
"$",
"user",
",",
"$",
"pass",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pass",
")",
"{",
"$",
"this",
"->",
"pass",
"=",
"$",
"pass",
";",
"}",
"$",
"this",
"->",
"user",
"=",
"$",
"user",
";",
"return",
"$",... | Sets the user component.
@param string $user
@return self | [
"Sets",
"the",
"user",
"component",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Message/UriFactory.php#L209-L219 |
199,083 | RocketPropelledTortoise/Core | src/Taxonomy/TaxonomyTrait.php | TaxonomyTrait.getTerms | public function getTerms($vocabulary_id)
{
if (!$data = Cache::get($this->getTaxonomyCacheKey())) {
$data = $this->cacheTermsForContent();
}
if (!is_numeric($vocabulary_id)) {
$vocabulary_id = T::vocabulary($vocabulary_id);
}
$results = new Collectio... | php | public function getTerms($vocabulary_id)
{
if (!$data = Cache::get($this->getTaxonomyCacheKey())) {
$data = $this->cacheTermsForContent();
}
if (!is_numeric($vocabulary_id)) {
$vocabulary_id = T::vocabulary($vocabulary_id);
}
$results = new Collectio... | [
"public",
"function",
"getTerms",
"(",
"$",
"vocabulary_id",
")",
"{",
"if",
"(",
"!",
"$",
"data",
"=",
"Cache",
"::",
"get",
"(",
"$",
"this",
"->",
"getTaxonomyCacheKey",
"(",
")",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"cacheTermsFor... | Get the terms from a content
@param int|string $vocabulary_id
@return Collection | [
"Get",
"the",
"terms",
"from",
"a",
"content"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/TaxonomyTrait.php#L85-L103 |
199,084 | RocketPropelledTortoise/Core | src/Taxonomy/TaxonomyTrait.php | TaxonomyTrait.addTerm | public function addTerm($term_id)
{
TermContainer::findOrFail($term_id);
// Cancel if the user wants to add the same term again
if ($this->getTaxonomyQuery()->where('term_id', $term_id)->count()) {
return;
}
$this->taxonomies()->attach($term_id);
Cache:... | php | public function addTerm($term_id)
{
TermContainer::findOrFail($term_id);
// Cancel if the user wants to add the same term again
if ($this->getTaxonomyQuery()->where('term_id', $term_id)->count()) {
return;
}
$this->taxonomies()->attach($term_id);
Cache:... | [
"public",
"function",
"addTerm",
"(",
"$",
"term_id",
")",
"{",
"TermContainer",
"::",
"findOrFail",
"(",
"$",
"term_id",
")",
";",
"// Cancel if the user wants to add the same term again",
"if",
"(",
"$",
"this",
"->",
"getTaxonomyQuery",
"(",
")",
"->",
"where",... | Link a term to this content
@param int $term_id | [
"Link",
"a",
"term",
"to",
"this",
"content"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/TaxonomyTrait.php#L110-L122 |
199,085 | RocketPropelledTortoise/Core | src/Taxonomy/TaxonomyTrait.php | TaxonomyTrait.removeTerms | public function removeTerms($vocabulary_id = null)
{
if ($vocabulary_id === null) {
return $this->getTaxonomyQuery()->delete();
}
if (!is_numeric($vocabulary_id)) {
$vocabulary_id = T::vocabulary($vocabulary_id);
}
return $this->getTaxonomyQuery()->w... | php | public function removeTerms($vocabulary_id = null)
{
if ($vocabulary_id === null) {
return $this->getTaxonomyQuery()->delete();
}
if (!is_numeric($vocabulary_id)) {
$vocabulary_id = T::vocabulary($vocabulary_id);
}
return $this->getTaxonomyQuery()->w... | [
"public",
"function",
"removeTerms",
"(",
"$",
"vocabulary_id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"vocabulary_id",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getTaxonomyQuery",
"(",
")",
"->",
"delete",
"(",
")",
";",
"}",
"if",
"(",
... | Removes terms specified by a vocabulary, or all
@param int|string $vocabulary_id
@return bool | [
"Removes",
"terms",
"specified",
"by",
"a",
"vocabulary",
"or",
"all"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/TaxonomyTrait.php#L145-L158 |
199,086 | RocketPropelledTortoise/Core | src/Taxonomy/TaxonomyTrait.php | TaxonomyTrait.getTaxonomyQuery | private function getTaxonomyQuery()
{
$t = $this->taxonomies();
return $t->newPivotStatement()
->where($t->getForeignKey(), $this->getKey())
->where($t->getMorphType(), $t->getMorphClass());
} | php | private function getTaxonomyQuery()
{
$t = $this->taxonomies();
return $t->newPivotStatement()
->where($t->getForeignKey(), $this->getKey())
->where($t->getMorphType(), $t->getMorphClass());
} | [
"private",
"function",
"getTaxonomyQuery",
"(",
")",
"{",
"$",
"t",
"=",
"$",
"this",
"->",
"taxonomies",
"(",
")",
";",
"return",
"$",
"t",
"->",
"newPivotStatement",
"(",
")",
"->",
"where",
"(",
"$",
"t",
"->",
"getForeignKey",
"(",
")",
",",
"$",... | Get a new plain query builder for the pivot table.
@return Builder | [
"Get",
"a",
"new",
"plain",
"query",
"builder",
"for",
"the",
"pivot",
"table",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/TaxonomyTrait.php#L202-L209 |
199,087 | codeblanche/Web | src/Web/Response/Cookie.php | Cookie.commit | public function commit()
{
return setcookie(
$this->name,
$this->value,
$this->expires,
$this->path,
$this->domain,
$this->secure,
$this->httpOnly
);
} | php | public function commit()
{
return setcookie(
$this->name,
$this->value,
$this->expires,
$this->path,
$this->domain,
$this->secure,
$this->httpOnly
);
} | [
"public",
"function",
"commit",
"(",
")",
"{",
"return",
"setcookie",
"(",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"value",
",",
"$",
"this",
"->",
"expires",
",",
"$",
"this",
"->",
"path",
",",
"$",
"this",
"->",
"domain",
",",
"$",
... | Send the cookie | [
"Send",
"the",
"cookie"
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Response/Cookie.php#L39-L50 |
199,088 | linpax/microphp-framework | src/base/Dispatcher.php | Dispatcher.addListener | public function addListener($listener, $event, $prior = null)
{
if (!is_callable($event)) {
return false;
}
if (!array_key_exists($listener, $this->listeners)) {
$this->listeners[$listener] = [];
}
if (!$prior) {
$this->listeners[$listene... | php | public function addListener($listener, $event, $prior = null)
{
if (!is_callable($event)) {
return false;
}
if (!array_key_exists($listener, $this->listeners)) {
$this->listeners[$listener] = [];
}
if (!$prior) {
$this->listeners[$listene... | [
"public",
"function",
"addListener",
"(",
"$",
"listener",
",",
"$",
"event",
",",
"$",
"prior",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"event",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"array_key_exists",
... | Add listener on event
@access public
@param string $listener listener name
@param array $event ['Object', 'method'] or callable
@param int|null $prior priority
@return bool | [
"Add",
"listener",
"on",
"event"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/base/Dispatcher.php#L36-L53 |
199,089 | linpax/microphp-framework | src/base/Dispatcher.php | Dispatcher.signal | public function signal($listener, array $params = [])
{
$result = null;
if (array_key_exists($listener, $this->listeners) && 0 !== count($this->listeners[$listener])) {
/** @noinspection ForeachSourceInspection */
foreach ($this->listeners[$listener] as $listen) {
... | php | public function signal($listener, array $params = [])
{
$result = null;
if (array_key_exists($listener, $this->listeners) && 0 !== count($this->listeners[$listener])) {
/** @noinspection ForeachSourceInspection */
foreach ($this->listeners[$listener] as $listen) {
... | [
"public",
"function",
"signal",
"(",
"$",
"listener",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"listener",
",",
"$",
"this",
"->",
"listeners",
")",
"&&",
"0",
"... | Send signal to run event
@access public
@param string $listener listener name
@param array $params Signal parameters
@return mixed | [
"Send",
"signal",
"to",
"run",
"event"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/base/Dispatcher.php#L65-L81 |
199,090 | koolkode/security | src/Authentication/Token/NtlmAuthToken.php | NtlmAuthToken.isValidResponse | public function isValidResponse($username, $hash, $challenge)
{
if(self::NTLM_BLOB_HEADER != substr($this->clientBlob, 0, 8))
{
return false;
}
// Timstamp, seconds since january 1, 1601, used in replay-attack prevention.
// $str = (float)vsprintf('%u%04u%04u%04u', array_reverse(unpack('vt1/vt2/vt3/vt4... | php | public function isValidResponse($username, $hash, $challenge)
{
if(self::NTLM_BLOB_HEADER != substr($this->clientBlob, 0, 8))
{
return false;
}
// Timstamp, seconds since january 1, 1601, used in replay-attack prevention.
// $str = (float)vsprintf('%u%04u%04u%04u', array_reverse(unpack('vt1/vt2/vt3/vt4... | [
"public",
"function",
"isValidResponse",
"(",
"$",
"username",
",",
"$",
"hash",
",",
"$",
"challenge",
")",
"{",
"if",
"(",
"self",
"::",
"NTLM_BLOB_HEADER",
"!=",
"substr",
"(",
"$",
"this",
"->",
"clientBlob",
",",
"0",
",",
"8",
")",
")",
"{",
"r... | Needs the MD4 hash of the UTF-16LE encoded password of the user in hex- or binary format.
@param string $username
@param string $hash
@param unknown $challenge | [
"Needs",
"the",
"MD4",
"hash",
"of",
"the",
"UTF",
"-",
"16LE",
"encoded",
"password",
"of",
"the",
"user",
"in",
"hex",
"-",
"or",
"binary",
"format",
"."
] | d3d8d42392f520754847d29b6df19aaa38c79e8e | https://github.com/koolkode/security/blob/d3d8d42392f520754847d29b6df19aaa38c79e8e/src/Authentication/Token/NtlmAuthToken.php#L389-L422 |
199,091 | gocom/rah_beacon | src/Rah/Beacon.php | Rah_Beacon.light | public function light()
{
$forms = safe_column(
'name',
'txp_form',
'1 = 1'
);
$beacon = new Rah_Beacon_Handler();
foreach ($forms as $name) {
if (!preg_match('/^[a-z][a-z0-9_]*$/', $name)) {
trace_add('[rah_beacon: '.... | php | public function light()
{
$forms = safe_column(
'name',
'txp_form',
'1 = 1'
);
$beacon = new Rah_Beacon_Handler();
foreach ($forms as $name) {
if (!preg_match('/^[a-z][a-z0-9_]*$/', $name)) {
trace_add('[rah_beacon: '.... | [
"public",
"function",
"light",
"(",
")",
"{",
"$",
"forms",
"=",
"safe_column",
"(",
"'name'",
",",
"'txp_form'",
",",
"'1 = 1'",
")",
";",
"$",
"beacon",
"=",
"new",
"Rah_Beacon_Handler",
"(",
")",
";",
"foreach",
"(",
"$",
"forms",
"as",
"$",
"name",... | Registers forms as tags. | [
"Registers",
"forms",
"as",
"tags",
"."
] | a5cacf3c7293fb3524c55cc073c820cfbf31e8f7 | https://github.com/gocom/rah_beacon/blob/a5cacf3c7293fb3524c55cc073c820cfbf31e8f7/src/Rah/Beacon.php#L44-L62 |
199,092 | gocom/rah_beacon | src/Rah/Beacon.php | Rah_Beacon.atts | public function atts($atts)
{
global $variable;
foreach (lAtts($atts, $variable, false) as $name => $value) {
$variable[$name] = $value;
}
} | php | public function atts($atts)
{
global $variable;
foreach (lAtts($atts, $variable, false) as $name => $value) {
$variable[$name] = $value;
}
} | [
"public",
"function",
"atts",
"(",
"$",
"atts",
")",
"{",
"global",
"$",
"variable",
";",
"foreach",
"(",
"lAtts",
"(",
"$",
"atts",
",",
"$",
"variable",
",",
"false",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"variable",
"[",
"... | A tag for assigning attribute defaults for tags.
This tag should be called within the Form partial if
it requires defaults for it's variables.
<code>
<txp:rah_beacon_atts color="blue" size="small" />
</code>
The above would create a variable named "color" and "size"
with values "blue" and "small" if one of them isn'... | [
"A",
"tag",
"for",
"assigning",
"attribute",
"defaults",
"for",
"tags",
"."
] | a5cacf3c7293fb3524c55cc073c820cfbf31e8f7 | https://github.com/gocom/rah_beacon/blob/a5cacf3c7293fb3524c55cc073c820cfbf31e8f7/src/Rah/Beacon.php#L82-L89 |
199,093 | eureka-framework/component-application | src/Application/Applicationv3.php | Applicationv3.loadConfigPackages | private function loadConfigPackages()
{
$config = Container::getInstance()->get('config');
$list = $config->get('global.package');
if (empty($list) || !is_array($list)) {
return;
}
foreach ($list as $name => $data) {
if (!isset($data['config'])) {
... | php | private function loadConfigPackages()
{
$config = Container::getInstance()->get('config');
$list = $config->get('global.package');
if (empty($list) || !is_array($list)) {
return;
}
foreach ($list as $name => $data) {
if (!isset($data['config'])) {
... | [
"private",
"function",
"loadConfigPackages",
"(",
")",
"{",
"$",
"config",
"=",
"Container",
"::",
"getInstance",
"(",
")",
"->",
"get",
"(",
"'config'",
")",
";",
"$",
"list",
"=",
"$",
"config",
"->",
"get",
"(",
"'global.package'",
")",
";",
"if",
"... | Load configs from packages.
@return void | [
"Load",
"configs",
"from",
"packages",
"."
] | 5bf70f20967ef15515abe764b465641277a51537 | https://github.com/eureka-framework/component-application/blob/5bf70f20967ef15515abe764b465641277a51537/src/Application/Applicationv3.php#L55-L71 |
199,094 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Executor.php | Executor._merge_values | private function _merge_values($data, $values, $columns)
{
foreach ($values as $key => $value) {
if (!is_numeric($key) && $key != '[]') {
if (isset($columns[$key])) {
$type = strtolower($columns[$key]);
if ($value === null) {
... | php | private function _merge_values($data, $values, $columns)
{
foreach ($values as $key => $value) {
if (!is_numeric($key) && $key != '[]') {
if (isset($columns[$key])) {
$type = strtolower($columns[$key]);
if ($value === null) {
... | [
"private",
"function",
"_merge_values",
"(",
"$",
"data",
",",
"$",
"values",
",",
"$",
"columns",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"key",
")",
"&&",
... | Attach Value to row data.
@param array|\Realboard\Component\Database\DBInstance\DBInterface\DataInterface $data data
@param array $values
@param array $columns
@return array|\Realbo... | [
"Attach",
"Value",
"to",
"row",
"data",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Executor.php#L169-L212 |
199,095 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Executor.php | Executor._define_column_types | private function _define_column_types(\PDOStatement $result)
{
$columns = array();
$intTypes = array('int', 'integer', 'long', 'tiny', 'smallint', 'int4');
try {
for ($i = 0; $i < $result->columnCount(); ++$i) {
$meta = $result->getColumnMeta($i);
... | php | private function _define_column_types(\PDOStatement $result)
{
$columns = array();
$intTypes = array('int', 'integer', 'long', 'tiny', 'smallint', 'int4');
try {
for ($i = 0; $i < $result->columnCount(); ++$i) {
$meta = $result->getColumnMeta($i);
... | [
"private",
"function",
"_define_column_types",
"(",
"\\",
"PDOStatement",
"$",
"result",
")",
"{",
"$",
"columns",
"=",
"array",
"(",
")",
";",
"$",
"intTypes",
"=",
"array",
"(",
"'int'",
",",
"'integer'",
",",
"'long'",
",",
"'tiny'",
",",
"'smallint'",
... | Define columns from result.
@param \PDOStatement $result
@return array | [
"Define",
"columns",
"from",
"result",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Executor.php#L221-L246 |
199,096 | Stillat/Common | src/Stillat/Common/Collections/Sorting/CollectionSortMap.php | CollectionSortMap.addThreshold | public function addThreshold($threshold, $driver)
{
if (!is_int($threshold) || $threshold <= 0) {
throw new InvalidArgumentException("The threshold '{$threshold}' is invalid. The threshold must be an integer and greater than '0'.");
}
$this->sortThresholds[$threshold] = $driver;... | php | public function addThreshold($threshold, $driver)
{
if (!is_int($threshold) || $threshold <= 0) {
throw new InvalidArgumentException("The threshold '{$threshold}' is invalid. The threshold must be an integer and greater than '0'.");
}
$this->sortThresholds[$threshold] = $driver;... | [
"public",
"function",
"addThreshold",
"(",
"$",
"threshold",
",",
"$",
"driver",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"threshold",
")",
"||",
"$",
"threshold",
"<=",
"0",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"The threshold ... | Adds a new sorting algorithm with the specified threshold
@throws InvalidArgumentException if the $threshold is not an integer, or is not greater than 0
@param int $threshold The collection count threshold
@param string $driver The sorting driver to use at the threshold | [
"Adds",
"a",
"new",
"sorting",
"algorithm",
"with",
"the",
"specified",
"threshold"
] | 9f69105292740c307aece588cf58a85892bad350 | https://github.com/Stillat/Common/blob/9f69105292740c307aece588cf58a85892bad350/src/Stillat/Common/Collections/Sorting/CollectionSortMap.php#L20-L27 |
199,097 | Stillat/Common | src/Stillat/Common/Collections/Sorting/CollectionSortMap.php | CollectionSortMap.determineDriver | public function determineDriver($collectionCount)
{
$determinedDriver = 'native';
ksort($this->sortThresholds, SORT_NUMERIC);
foreach ($this->sortThresholds as $threshold => $driver) {
if ($collectionCount <= $threshold) {
$determinedDriver = $driver;
... | php | public function determineDriver($collectionCount)
{
$determinedDriver = 'native';
ksort($this->sortThresholds, SORT_NUMERIC);
foreach ($this->sortThresholds as $threshold => $driver) {
if ($collectionCount <= $threshold) {
$determinedDriver = $driver;
... | [
"public",
"function",
"determineDriver",
"(",
"$",
"collectionCount",
")",
"{",
"$",
"determinedDriver",
"=",
"'native'",
";",
"ksort",
"(",
"$",
"this",
"->",
"sortThresholds",
",",
"SORT_NUMERIC",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"sortThresholds"... | Determines the driver to use based on a collection's size
@param int $collectionCount The size of the collection
@return string The driver to use | [
"Determines",
"the",
"driver",
"to",
"use",
"based",
"on",
"a",
"collection",
"s",
"size"
] | 9f69105292740c307aece588cf58a85892bad350 | https://github.com/Stillat/Common/blob/9f69105292740c307aece588cf58a85892bad350/src/Stillat/Common/Collections/Sorting/CollectionSortMap.php#L46-L61 |
199,098 | Scoilnet/PhpSDK | scoilnetsdk/ScoilnetClient.php | ScoilnetClient.getSessionObject | protected function getSessionObject($access_token = NULL) {
$session = NULL;
// Try generate local version of session cookie.
if (!empty($access_token) && isset($access_token['access_token'])) {
$session['access_token'] = $access_token['access_token'];
$session['base_domain'] = $this->get... | php | protected function getSessionObject($access_token = NULL) {
$session = NULL;
// Try generate local version of session cookie.
if (!empty($access_token) && isset($access_token['access_token'])) {
$session['access_token'] = $access_token['access_token'];
$session['base_domain'] = $this->get... | [
"protected",
"function",
"getSessionObject",
"(",
"$",
"access_token",
"=",
"NULL",
")",
"{",
"$",
"session",
"=",
"NULL",
";",
"// Try generate local version of session cookie.\r",
"if",
"(",
"!",
"empty",
"(",
"$",
"access_token",
")",
"&&",
"isset",
"(",
"$",... | Try to get session object from custom method.
By default we generate session object based on access_token response, or
if it is provided from server with $_REQUEST. For sure, if it is provided
by server it should follow our session object format.
Session object provided by server can ensure the correct expires and
ba... | [
"Try",
"to",
"get",
"session",
"object",
"from",
"custom",
"method",
"."
] | c2d033b020015b3c9c8a741bff857e7d599f18c0 | https://github.com/Scoilnet/PhpSDK/blob/c2d033b020015b3c9c8a741bff857e7d599f18c0/scoilnetsdk/ScoilnetClient.php#L157-L193 |
199,099 | Scoilnet/PhpSDK | scoilnetsdk/ScoilnetClient.php | ScoilnetClient.makeOAuth2Request | protected function makeOAuth2Request($path, $method = 'GET', $params = array()) {
if ((!isset($params['access_token']) || empty($params['access_token'])) && $oauth_token = $this->getAccessToken()) {
$params['access_token'] = $oauth_token;
}
return $this->makeRequest($path, $method, $params);... | php | protected function makeOAuth2Request($path, $method = 'GET', $params = array()) {
if ((!isset($params['access_token']) || empty($params['access_token'])) && $oauth_token = $this->getAccessToken()) {
$params['access_token'] = $oauth_token;
}
return $this->makeRequest($path, $method, $params);... | [
"protected",
"function",
"makeOAuth2Request",
"(",
"$",
"path",
",",
"$",
"method",
"=",
"'GET'",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'access_token'",
"]",
")",
"||",
"empty",
... | Make an OAuth2.0 Request.
Automatically append "oauth_token" in query parameters if not yet
exists and able to discover a valid access token from session. Otherwise
just ignore setup with "oauth_token" and handle the API call AS-IS, and
so may issue a plain API call without OAuth2.0 protection.
@param $path
The targe... | [
"Make",
"an",
"OAuth2",
".",
"0",
"Request",
"."
] | c2d033b020015b3c9c8a741bff857e7d599f18c0 | https://github.com/Scoilnet/PhpSDK/blob/c2d033b020015b3c9c8a741bff857e7d599f18c0/scoilnetsdk/ScoilnetClient.php#L247-L253 |
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.