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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
197,200 | atk14/StringBuffer | src/stringbuffer.php | StringBufferItem.replace | function replace($search,$replace){
$this->_String = str_replace($search,$replace,$this->_String);
} | php | function replace($search,$replace){
$this->_String = str_replace($search,$replace,$this->_String);
} | [
"function",
"replace",
"(",
"$",
"search",
",",
"$",
"replace",
")",
"{",
"$",
"this",
"->",
"_String",
"=",
"str_replace",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"this",
"->",
"_String",
")",
";",
"}"
] | Replace part of string in buffer
@param string $search
@param string $replace | [
"Replace",
"part",
"of",
"string",
"in",
"buffer"
] | 32f1580f23aff4d729a0a4ff82d3bd82b9194cc8 | https://github.com/atk14/StringBuffer/blob/32f1580f23aff4d729a0a4ff82d3bd82b9194cc8/src/stringbuffer.php#L189-L191 |
197,201 | atk14/StringBuffer | src/stringbuffer.php | StringBufferFileItem.toString | function toString(){
if(isset($this->_String)){ return parent::toString(); }
return Files::GetFileContent($this->_Filename);
} | php | function toString(){
if(isset($this->_String)){ return parent::toString(); }
return Files::GetFileContent($this->_Filename);
} | [
"function",
"toString",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_String",
")",
")",
"{",
"return",
"parent",
"::",
"toString",
"(",
")",
";",
"}",
"return",
"Files",
"::",
"GetFileContent",
"(",
"$",
"this",
"->",
"_Filename",
")"... | Outputs content of buffer as string.
@return string | [
"Outputs",
"content",
"of",
"buffer",
"as",
"string",
"."
] | 32f1580f23aff4d729a0a4ff82d3bd82b9194cc8 | https://github.com/atk14/StringBuffer/blob/32f1580f23aff4d729a0a4ff82d3bd82b9194cc8/src/stringbuffer.php#L232-L235 |
197,202 | atk14/StringBuffer | src/stringbuffer.php | StringBufferFileItem.replace | function replace($search,$replace){
$this->_String = $this->toString();
return parent::replace($search,$replace);
} | php | function replace($search,$replace){
$this->_String = $this->toString();
return parent::replace($search,$replace);
} | [
"function",
"replace",
"(",
"$",
"search",
",",
"$",
"replace",
")",
"{",
"$",
"this",
"->",
"_String",
"=",
"$",
"this",
"->",
"toString",
"(",
")",
";",
"return",
"parent",
"::",
"replace",
"(",
"$",
"search",
",",
"$",
"replace",
")",
";",
"}"
] | Replaces part of a string with another string.
@param string $search
@param string $replace | [
"Replaces",
"part",
"of",
"a",
"string",
"with",
"another",
"string",
"."
] | 32f1580f23aff4d729a0a4ff82d3bd82b9194cc8 | https://github.com/atk14/StringBuffer/blob/32f1580f23aff4d729a0a4ff82d3bd82b9194cc8/src/stringbuffer.php#L243-L246 |
197,203 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Model/CollectionableTrait.php | CollectionableTrait.toCollection | protected function toCollection($data, $collectionClass)
{
if ($data instanceof $collectionClass) {
return $data;
}
$data = $data ?: array();
if (!is_array($data) && !$data instanceof Collection) {
throw new \InvalidArgumentException('Can transform only Colle... | php | protected function toCollection($data, $collectionClass)
{
if ($data instanceof $collectionClass) {
return $data;
}
$data = $data ?: array();
if (!is_array($data) && !$data instanceof Collection) {
throw new \InvalidArgumentException('Can transform only Colle... | [
"protected",
"function",
"toCollection",
"(",
"$",
"data",
",",
"$",
"collectionClass",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"$",
"collectionClass",
")",
"{",
"return",
"$",
"data",
";",
"}",
"$",
"data",
"=",
"$",
"data",
"?",
":",
"array",... | helper method to use for cast arrays to
collections of entities.
@param Collection|array $data
@param string $collectionClass
@return EntityCollection | [
"helper",
"method",
"to",
"use",
"for",
"cast",
"arrays",
"to",
"collections",
"of",
"entities",
"."
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Model/CollectionableTrait.php#L21-L35 |
197,204 | linpax/microphp-framework | src/base/Autoload.php | Autoload.setAlias | public static function setAlias($alias, $realPath)
{
if (is_string($alias) && is_string($realPath)) {
self::$aliases[strtolower($alias)] = $realPath;
}
} | php | public static function setAlias($alias, $realPath)
{
if (is_string($alias) && is_string($realPath)) {
self::$aliases[strtolower($alias)] = $realPath;
}
} | [
"public",
"static",
"function",
"setAlias",
"(",
"$",
"alias",
",",
"$",
"realPath",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"alias",
")",
"&&",
"is_string",
"(",
"$",
"realPath",
")",
")",
"{",
"self",
"::",
"$",
"aliases",
"[",
"strtolower",
"(... | Setting or installing new alias
@access public
@param string $alias name for new alias
@param string $realPath path of alias
@return void
@static | [
"Setting",
"or",
"installing",
"new",
"alias"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/base/Autoload.php#L34-L39 |
197,205 | linpax/microphp-framework | src/base/Autoload.php | Autoload.getClassPath | public static function getClassPath($className, $extension = '.php')
{
$prefix = $className = self::camelCaseToLowerNamespace(str_replace('_', '\\', $className));
while (false !== $position = strrpos($prefix, '\\')) {
$prefix = substr($prefix, 0, $position);
$alias = self::g... | php | public static function getClassPath($className, $extension = '.php')
{
$prefix = $className = self::camelCaseToLowerNamespace(str_replace('_', '\\', $className));
while (false !== $position = strrpos($prefix, '\\')) {
$prefix = substr($prefix, 0, $position);
$alias = self::g... | [
"public",
"static",
"function",
"getClassPath",
"(",
"$",
"className",
",",
"$",
"extension",
"=",
"'.php'",
")",
"{",
"$",
"prefix",
"=",
"$",
"className",
"=",
"self",
"::",
"camelCaseToLowerNamespace",
"(",
"str_replace",
"(",
"'_'",
",",
"'\\\\'",
",",
... | Get class path
@access public
@param string $className search class name
@param string $extension extension of class
@return string
@static | [
"Get",
"class",
"path"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/base/Autoload.php#L74-L95 |
197,206 | linpax/microphp-framework | src/base/Autoload.php | Autoload.camelCaseToLowerNamespace | private static function camelCaseToLowerNamespace($path)
{
$classNameArr = array_map(function($val) {
return lcfirst($val);
}, explode('\\', $path));
$classNameArr[] = ucfirst(array_pop($classNameArr));
return implode('\\', $classNameArr);
} | php | private static function camelCaseToLowerNamespace($path)
{
$classNameArr = array_map(function($val) {
return lcfirst($val);
}, explode('\\', $path));
$classNameArr[] = ucfirst(array_pop($classNameArr));
return implode('\\', $classNameArr);
} | [
"private",
"static",
"function",
"camelCaseToLowerNamespace",
"(",
"$",
"path",
")",
"{",
"$",
"classNameArr",
"=",
"array_map",
"(",
"function",
"(",
"$",
"val",
")",
"{",
"return",
"lcfirst",
"(",
"$",
"val",
")",
";",
"}",
",",
"explode",
"(",
"'\\\\'... | Convert first symbols of namespace to lowercase
@access protected
@param string $path
@return string
@static | [
"Convert",
"first",
"symbols",
"of",
"namespace",
"to",
"lowercase"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/base/Autoload.php#L107-L116 |
197,207 | ptlis/grep-db | src/Metadata/MySQL/DatabaseMetadata.php | DatabaseMetadata.getTableMetadata | public function getTableMetadata(string $tableName): TableMetadata
{
if (!array_key_exists($tableName, $this->tableMetadataList)) {
throw new \RuntimeException('Database "' . $this->databaseName . '" doesn\'t contain table "' . $tableName . '"');
}
return $this->tableMetadataLis... | php | public function getTableMetadata(string $tableName): TableMetadata
{
if (!array_key_exists($tableName, $this->tableMetadataList)) {
throw new \RuntimeException('Database "' . $this->databaseName . '" doesn\'t contain table "' . $tableName . '"');
}
return $this->tableMetadataLis... | [
"public",
"function",
"getTableMetadata",
"(",
"string",
"$",
"tableName",
")",
":",
"TableMetadata",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"tableName",
",",
"$",
"this",
"->",
"tableMetadataList",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeEx... | Get the metadata for a single table. | [
"Get",
"the",
"metadata",
"for",
"a",
"single",
"table",
"."
] | 7abff68982d426690d0515ccd7adc7a2e3d72a3f | https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Metadata/MySQL/DatabaseMetadata.php#L46-L53 |
197,208 | PenoaksDev/Milky-Framework | src/Milky/Http/Routing/Controller.php | Controller.error | public function error( $code = 404, $msg = "Resource not found" )
{
$request = HttpFactory::i()->request();
if ( $request->ajax() || $request->wantsJson() )
return new JsonResponse( ['error' => $msg] );
else
return new Response( Redirect::back()->withInput( $request->input() )->withErrors( ['error' => $ms... | php | public function error( $code = 404, $msg = "Resource not found" )
{
$request = HttpFactory::i()->request();
if ( $request->ajax() || $request->wantsJson() )
return new JsonResponse( ['error' => $msg] );
else
return new Response( Redirect::back()->withInput( $request->input() )->withErrors( ['error' => $ms... | [
"public",
"function",
"error",
"(",
"$",
"code",
"=",
"404",
",",
"$",
"msg",
"=",
"\"Resource not found\"",
")",
"{",
"$",
"request",
"=",
"HttpFactory",
"::",
"i",
"(",
")",
"->",
"request",
"(",
")",
";",
"if",
"(",
"$",
"request",
"->",
"ajax",
... | Produces a new error response based on if this is an api request or not.
@param int $code
@param string $msg
@return JsonResponse|Response | [
"Produces",
"a",
"new",
"error",
"response",
"based",
"on",
"if",
"this",
"is",
"an",
"api",
"request",
"or",
"not",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/Controller.php#L118-L126 |
197,209 | Nekland/BaseApi | lib/Nekland/BaseApi/Api/AbstractApi.php | AbstractApi.get | protected function get($path, $body = [], array $headers = [])
{
$client = $this->getClient();
$request = AbstractHttpClient::createRequest('GET', $path, $body, $headers);
return $this->transformer->transform($client->send($request));
} | php | protected function get($path, $body = [], array $headers = [])
{
$client = $this->getClient();
$request = AbstractHttpClient::createRequest('GET', $path, $body, $headers);
return $this->transformer->transform($client->send($request));
} | [
"protected",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"body",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"$",
"request",
"=",
"AbstractHttpClient",
... | Execute a http get query
@param string $path
@param array|string $body
@param array $headers
@return array|mixed | [
"Execute",
"a",
"http",
"get",
"query"
] | c96051b36d6982abf2a8b1f1ec16351bcae2455e | https://github.com/Nekland/BaseApi/blob/c96051b36d6982abf2a8b1f1ec16351bcae2455e/lib/Nekland/BaseApi/Api/AbstractApi.php#L57-L63 |
197,210 | ekyna/Table | TableBuilder.php | TableBuilder.createColumn | public function createColumn($name, $type = null, array $options = [])
{
$this->preventIfLocked();
if (null !== $type) {
return $this->getFactory()->createColumnBuilder($name, $type, $options);
}
throw new \InvalidArgumentException('Column type guessing is not yet suppo... | php | public function createColumn($name, $type = null, array $options = [])
{
$this->preventIfLocked();
if (null !== $type) {
return $this->getFactory()->createColumnBuilder($name, $type, $options);
}
throw new \InvalidArgumentException('Column type guessing is not yet suppo... | [
"public",
"function",
"createColumn",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"preventIfLocked",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"type",
")",
"{",
"r... | Creates a column builder.
@param string $name
@param string $type
@param array $options
@return Column\ColumnBuilderInterface | [
"Creates",
"a",
"column",
"builder",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L101-L111 |
197,211 | ekyna/Table | TableBuilder.php | TableBuilder.createFilter | public function createFilter($name, $type = null, array $options = [])
{
$this->preventIfLocked();
if (null !== $type) {
return $this->getFactory()->createFilterBuilder($name, $type, $options);
}
throw new \InvalidArgumentException('Filter type guessing is not yet suppo... | php | public function createFilter($name, $type = null, array $options = [])
{
$this->preventIfLocked();
if (null !== $type) {
return $this->getFactory()->createFilterBuilder($name, $type, $options);
}
throw new \InvalidArgumentException('Filter type guessing is not yet suppo... | [
"public",
"function",
"createFilter",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"preventIfLocked",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"type",
")",
"{",
"r... | Creates a filter builder.
@param string $name
@param string $type
@param array $options
@return Filter\FilterBuilderInterface | [
"Creates",
"a",
"filter",
"builder",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L185-L195 |
197,212 | ekyna/Table | TableBuilder.php | TableBuilder.createAction | public function createAction($name, $type = null, array $options = [])
{
$this->preventIfLocked();
if (null !== $type) {
return $this->getFactory()->createActionBuilder($name, $type, $options);
}
throw new \InvalidArgumentException('Action type guessing is not yet suppo... | php | public function createAction($name, $type = null, array $options = [])
{
$this->preventIfLocked();
if (null !== $type) {
return $this->getFactory()->createActionBuilder($name, $type, $options);
}
throw new \InvalidArgumentException('Action type guessing is not yet suppo... | [
"public",
"function",
"createAction",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"preventIfLocked",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"type",
")",
"{",
"r... | Creates a action builder.
@param string $name
@param string $type
@param array $options
@return Action\ActionBuilderInterface | [
"Creates",
"a",
"action",
"builder",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L269-L279 |
197,213 | ekyna/Table | TableBuilder.php | TableBuilder.resolveColumn | private function resolveColumn($name)
{
$info = $this->unresolvedColumns[$name];
$child = $this->createColumn($name, $info['type'], $info['options']);
$this->columns[$name] = $child;
unset($this->unresolvedColumns[$name]);
return $child;
} | php | private function resolveColumn($name)
{
$info = $this->unresolvedColumns[$name];
$child = $this->createColumn($name, $info['type'], $info['options']);
$this->columns[$name] = $child;
unset($this->unresolvedColumns[$name]);
return $child;
} | [
"private",
"function",
"resolveColumn",
"(",
"$",
"name",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"unresolvedColumns",
"[",
"$",
"name",
"]",
";",
"$",
"child",
"=",
"$",
"this",
"->",
"createColumn",
"(",
"$",
"name",
",",
"$",
"info",
"[",
... | Converts an unresolved column into a column builder instance.
@param string $name The name of the unresolved column
@return Column\ColumnBuilderInterface | [
"Converts",
"an",
"unresolved",
"column",
"into",
"a",
"column",
"builder",
"instance",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L365-L373 |
197,214 | ekyna/Table | TableBuilder.php | TableBuilder.resolveFilter | private function resolveFilter($name)
{
$info = $this->unresolvedFilters[$name];
$child = $this->createFilter($name, $info['type'], $info['options']);
$this->filters[$name] = $child;
unset($this->unresolvedFilters[$name]);
return $child;
} | php | private function resolveFilter($name)
{
$info = $this->unresolvedFilters[$name];
$child = $this->createFilter($name, $info['type'], $info['options']);
$this->filters[$name] = $child;
unset($this->unresolvedFilters[$name]);
return $child;
} | [
"private",
"function",
"resolveFilter",
"(",
"$",
"name",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"unresolvedFilters",
"[",
"$",
"name",
"]",
";",
"$",
"child",
"=",
"$",
"this",
"->",
"createFilter",
"(",
"$",
"name",
",",
"$",
"info",
"[",
... | Converts an unresolved filter into a filter builder instance.
@param string $name The name of the unresolved filter
@return Filter\FilterBuilderInterface | [
"Converts",
"an",
"unresolved",
"filter",
"into",
"a",
"filter",
"builder",
"instance",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L382-L390 |
197,215 | ekyna/Table | TableBuilder.php | TableBuilder.resolveAction | private function resolveAction($name)
{
$info = $this->unresolvedActions[$name];
$child = $this->createAction($name, $info['type'], $info['options']);
$this->actions[$name] = $child;
unset($this->unresolvedActions[$name]);
return $child;
} | php | private function resolveAction($name)
{
$info = $this->unresolvedActions[$name];
$child = $this->createAction($name, $info['type'], $info['options']);
$this->actions[$name] = $child;
unset($this->unresolvedActions[$name]);
return $child;
} | [
"private",
"function",
"resolveAction",
"(",
"$",
"name",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"unresolvedActions",
"[",
"$",
"name",
"]",
";",
"$",
"child",
"=",
"$",
"this",
"->",
"createAction",
"(",
"$",
"name",
",",
"$",
"info",
"[",
... | Converts an unresolved action into a action builder instance.
@param string $name The name of the unresolved action
@return Action\ActionBuilderInterface | [
"Converts",
"an",
"unresolved",
"action",
"into",
"a",
"action",
"builder",
"instance",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L399-L407 |
197,216 | ekyna/Table | TableBuilder.php | TableBuilder.resolveElements | private function resolveElements()
{
foreach ($this->unresolvedColumns as $name => $info) {
$this->columns[$name] = $this->createColumn($name, $info['type'], $info['options']);
}
$this->unresolvedColumns = [];
foreach ($this->unresolvedFilters as $name => $info) {
... | php | private function resolveElements()
{
foreach ($this->unresolvedColumns as $name => $info) {
$this->columns[$name] = $this->createColumn($name, $info['type'], $info['options']);
}
$this->unresolvedColumns = [];
foreach ($this->unresolvedFilters as $name => $info) {
... | [
"private",
"function",
"resolveElements",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"unresolvedColumns",
"as",
"$",
"name",
"=>",
"$",
"info",
")",
"{",
"$",
"this",
"->",
"columns",
"[",
"$",
"name",
"]",
"=",
"$",
"this",
"->",
"createColumn"... | Converts all unresolved elements into builder instances. | [
"Converts",
"all",
"unresolved",
"elements",
"into",
"builder",
"instances",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/TableBuilder.php#L412-L428 |
197,217 | stubbles/stubbles-peer | src/main/php/Uri.php | Uri.isSyntacticallyValid | protected function isSyntacticallyValid(): bool
{
if (preg_match('!^([a-z][a-z0-9\+]*)://([^@]+@)?([^/?#]*)(/([^#?]*))?(.*)$!', $this->parsedUri->asString()) == 0) {
return false;
}
if ($this->parsedUri->hasUser()) {
if (preg_match('~([@:/])~', $this->parsedUri->user... | php | protected function isSyntacticallyValid(): bool
{
if (preg_match('!^([a-z][a-z0-9\+]*)://([^@]+@)?([^/?#]*)(/([^#?]*))?(.*)$!', $this->parsedUri->asString()) == 0) {
return false;
}
if ($this->parsedUri->hasUser()) {
if (preg_match('~([@:/])~', $this->parsedUri->user... | [
"protected",
"function",
"isSyntacticallyValid",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"preg_match",
"(",
"'!^([a-z][a-z0-9\\+]*)://([^@]+@)?([^/?#]*)(/([^#?]*))?(.*)$!'",
",",
"$",
"this",
"->",
"parsedUri",
"->",
"asString",
"(",
")",
")",
"==",
"0",
")",
"{",
... | Checks whether URI is a syntactically correct URI.
@return bool | [
"Checks",
"whether",
"URI",
"is",
"a",
"syntactically",
"correct",
"URI",
"."
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Uri.php#L52-L78 |
197,218 | stubbles/stubbles-peer | src/main/php/Uri.php | Uri.asStringWithNonDefaultPort | public function asStringWithNonDefaultPort(): string
{
if ($this->parsedUri->hasPort() && !$this->hasDefaultPort()) {
return $this->asString();
}
return $this->asStringWithoutPort();
} | php | public function asStringWithNonDefaultPort(): string
{
if ($this->parsedUri->hasPort() && !$this->hasDefaultPort()) {
return $this->asString();
}
return $this->asStringWithoutPort();
} | [
"public",
"function",
"asStringWithNonDefaultPort",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"parsedUri",
"->",
"hasPort",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"hasDefaultPort",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"as... | Returns uri as string containing the port if it is not the default port.
@return string | [
"Returns",
"uri",
"as",
"string",
"containing",
"the",
"port",
"if",
"it",
"is",
"not",
"the",
"default",
"port",
"."
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Uri.php#L139-L146 |
197,219 | stubbles/stubbles-peer | src/main/php/Uri.php | Uri.password | public function password(string $defaultPassword = null)
{
if (!$this->parsedUri->hasUser()) {
return null;
}
if ($this->parsedUri->hasPassword()) {
return $this->parsedUri->password();
}
return $defaultPassword;
} | php | public function password(string $defaultPassword = null)
{
if (!$this->parsedUri->hasUser()) {
return null;
}
if ($this->parsedUri->hasPassword()) {
return $this->parsedUri->password();
}
return $defaultPassword;
} | [
"public",
"function",
"password",
"(",
"string",
"$",
"defaultPassword",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parsedUri",
"->",
"hasUser",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"parsedUri"... | returns the password
@param string $defaultPassword password to return if no password is set
@return string|null
@deprecated since 8.0.0, passing a password via URI is inherintly insecure, will be removed with 9.0.0 | [
"returns",
"the",
"password"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Uri.php#L176-L187 |
197,220 | stubbles/stubbles-peer | src/main/php/Uri.php | Uri.addParams | public function addParams(array $params): self
{
foreach ($params as $name => $value) {
$this->addParam($name, $value);
}
return $this;
} | php | public function addParams(array $params): self
{
foreach ($params as $name => $value) {
$this->addParam($name, $value);
}
return $this;
} | [
"public",
"function",
"addParams",
"(",
"array",
"$",
"params",
")",
":",
"self",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addParam",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"... | adds given map of params
@param array $params map of parameters to add
@return \stubbles\peer\Uri
@since 5.1.2 | [
"adds",
"given",
"map",
"of",
"params"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Uri.php#L281-L288 |
197,221 | stubbles/stubbles-peer | src/main/php/Uri.php | Uri.addParam | public function addParam(string $name, $value): self
{
$this->parsedUri->queryString()->addParam($name, $value);
return $this;
} | php | public function addParam(string $name, $value): self
{
$this->parsedUri->queryString()->addParam($name, $value);
return $this;
} | [
"public",
"function",
"addParam",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"self",
"{",
"$",
"this",
"->",
"parsedUri",
"->",
"queryString",
"(",
")",
"->",
"addParam",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"return",
"$",
"... | add a parameter to the uri
@param string $name name of parameter
@param mixed $value value of parameter
@return \stubbles\peer\Uri | [
"add",
"a",
"parameter",
"to",
"the",
"uri"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Uri.php#L297-L301 |
197,222 | stubbles/stubbles-peer | src/main/php/Uri.php | Uri.removeParam | public function removeParam(string $name): self
{
$this->parsedUri->queryString()->removeParam($name);
return $this;
} | php | public function removeParam(string $name): self
{
$this->parsedUri->queryString()->removeParam($name);
return $this;
} | [
"public",
"function",
"removeParam",
"(",
"string",
"$",
"name",
")",
":",
"self",
"{",
"$",
"this",
"->",
"parsedUri",
"->",
"queryString",
"(",
")",
"->",
"removeParam",
"(",
"$",
"name",
")",
";",
"return",
"$",
"this",
";",
"}"
] | remove a param from uri
@param string $name name of parameter
@return \stubbles\peer\Uri
@since 1.1.2 | [
"remove",
"a",
"param",
"from",
"uri"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/Uri.php#L310-L314 |
197,223 | asaokamei/ScoreSql | src/Builder/Bind.php | Bind.prepare | public function prepare( $val, $col=null, $type=null )
{
if( is_array( $val ) ) {
$holder = [];
foreach( $val as $key => $v ) {
$holder[$key] = $this->prepare( $v, $col, $type );
}
return $holder;
}
if( $val instanceof \Closure ... | php | public function prepare( $val, $col=null, $type=null )
{
if( is_array( $val ) ) {
$holder = [];
foreach( $val as $key => $v ) {
$holder[$key] = $this->prepare( $v, $col, $type );
}
return $holder;
}
if( $val instanceof \Closure ... | [
"public",
"function",
"prepare",
"(",
"$",
"val",
",",
"$",
"col",
"=",
"null",
",",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"val",
")",
")",
"{",
"$",
"holder",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"val",
"as... | replaces value with place holder for prepared statement.
the value is kept in prepared_value array.
if $type is specified, or column data type is set in col_data_types,
types for the place holder is kept in prepared_types array.
@param string|array $val
@param null|int|string $col column name. used to find data ... | [
"replaces",
"value",
"with",
"place",
"holder",
"for",
"prepared",
"statement",
".",
"the",
"value",
"is",
"kept",
"in",
"prepared_value",
"array",
"."
] | f1fce28476629e98b3c4c1216859c7f5309de7a1 | https://github.com/asaokamei/ScoreSql/blob/f1fce28476629e98b3c4c1216859c7f5309de7a1/src/Builder/Bind.php#L55-L72 |
197,224 | fridge-project/dbal | src/Fridge/DBAL/Schema/AbstractAsset.php | AbstractAsset.setName | public function setName($name)
{
if (!is_string($name) || (strlen($name) <= 0)) {
$explodedNamespace = explode('\\', get_class($this));
$class = $explodedNamespace[count($explodedNamespace) - 1];
$asset = strtolower(preg_replace('/(.)([A-Z])/', '\\1 \\2', $class));
... | php | public function setName($name)
{
if (!is_string($name) || (strlen($name) <= 0)) {
$explodedNamespace = explode('\\', get_class($this));
$class = $explodedNamespace[count($explodedNamespace) - 1];
$asset = strtolower(preg_replace('/(.)([A-Z])/', '\\1 \\2', $class));
... | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"name",
")",
"||",
"(",
"strlen",
"(",
"$",
"name",
")",
"<=",
"0",
")",
")",
"{",
"$",
"explodedNamespace",
"=",
"explode",
"(",
"'\\\\'",
",",
"... | Sets the asset name.
@param string $name The asset name.
@throws \Fridge\DBAL\Exception\SchemaException If the name is not a valid string. | [
"Sets",
"the",
"asset",
"name",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/AbstractAsset.php#L55-L66 |
197,225 | fridge-project/dbal | src/Fridge/DBAL/Schema/AbstractAsset.php | AbstractAsset.generateIdentifier | protected function generateIdentifier($prefix, $maxLength)
{
$hash = null;
$dictionary = 'abcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 0; $i < ($maxLength - strlen($prefix)); $i++) {
$hash .= $dictionary[mt_rand(0, strlen($dictionary) - 1)];
}
return $prefix... | php | protected function generateIdentifier($prefix, $maxLength)
{
$hash = null;
$dictionary = 'abcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 0; $i < ($maxLength - strlen($prefix)); $i++) {
$hash .= $dictionary[mt_rand(0, strlen($dictionary) - 1)];
}
return $prefix... | [
"protected",
"function",
"generateIdentifier",
"(",
"$",
"prefix",
",",
"$",
"maxLength",
")",
"{",
"$",
"hash",
"=",
"null",
";",
"$",
"dictionary",
"=",
"'abcdefghijklmnopqrstuvwxyz0123456789'",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
... | Generates a prefixed identifier.
@param string $prefix The identifier prefix.
@param integer $maxLength The identifier max length.
@return string The prefixed identifier. | [
"Generates",
"a",
"prefixed",
"identifier",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/AbstractAsset.php#L76-L86 |
197,226 | Wedeto/Auth | src/ACL/ACLModel.php | ACLModel.isAllowed | public function isAllowed($action, $role = null)
{
if ($this->_acl_entity === null)
{
return $this->getACL()->getDefaultPolicy();
}
if ($role === null)
{
$role = $this->getACL()->getCurrentRole();
}
return $this->_acl_entity-... | php | public function isAllowed($action, $role = null)
{
if ($this->_acl_entity === null)
{
return $this->getACL()->getDefaultPolicy();
}
if ($role === null)
{
$role = $this->getACL()->getCurrentRole();
}
return $this->_acl_entity-... | [
"public",
"function",
"isAllowed",
"(",
"$",
"action",
",",
"$",
"role",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_acl_entity",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getACL",
"(",
")",
"->",
"getDefaultPolicy",
"(",
")",... | Check if an action is allowed on this object. If the ACL subsystem
is not loaded, true will be returned.
@param $action scalar The action to be performed
@param $role Wedeto\ACL\Role The role that wants to perform an action.
If not specified, the current user is used.
@return boolean True if the action is allowed, fal... | [
"Check",
"if",
"an",
"action",
"is",
"allowed",
"on",
"this",
"object",
".",
"If",
"the",
"ACL",
"subsystem",
"is",
"not",
"loaded",
"true",
"will",
"be",
"returned",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/ACLModel.php#L91-L104 |
197,227 | Wedeto/Auth | src/ACL/ACLModel.php | ACLModel.getACLClass | public static function getACLClass()
{
$cl = static::class;
$parts = explode("\\", $cl);
if (count($parts) === 1)
return $parts[0];
$first = reset($parts);
$last = end($parts);
return $first . "_" . $last;
} | php | public static function getACLClass()
{
$cl = static::class;
$parts = explode("\\", $cl);
if (count($parts) === 1)
return $parts[0];
$first = reset($parts);
$last = end($parts);
return $first . "_" . $last;
} | [
"public",
"static",
"function",
"getACLClass",
"(",
")",
"{",
"$",
"cl",
"=",
"static",
"::",
"class",
";",
"$",
"parts",
"=",
"explode",
"(",
"\"\\\\\"",
",",
"$",
"cl",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parts",
")",
"===",
"1",
")",
"ret... | Generate a ACL Class name for the called DAO class. It will be composed
of the first part of the namespace and the classname by default, but
subclasses may override this to alter this behaviour. It should
return a unique name
@return string The ACL class name for this DAO | [
"Generate",
"a",
"ACL",
"Class",
"name",
"for",
"the",
"called",
"DAO",
"class",
".",
"It",
"will",
"be",
"composed",
"of",
"the",
"first",
"part",
"of",
"the",
"namespace",
"and",
"the",
"classname",
"by",
"default",
"but",
"subclasses",
"may",
"override"... | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/ACLModel.php#L114-L126 |
197,228 | Wedeto/Auth | src/ACL/ACLModel.php | ACLModel.generateID | public function generateID()
{
$id = $this->getID();
$fmt_string = "%08s";
if (is_array($id))
$id = implode("-", $id);
if (empty($id))
throw new Exception("Cannot generate an ID for an empty object");
$id = substr(sha1($id), 0, 10);
$acl_clas... | php | public function generateID()
{
$id = $this->getID();
$fmt_string = "%08s";
if (is_array($id))
$id = implode("-", $id);
if (empty($id))
throw new Exception("Cannot generate an ID for an empty object");
$id = substr(sha1($id), 0, 10);
$acl_clas... | [
"public",
"function",
"generateID",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getID",
"(",
")",
";",
"$",
"fmt_string",
"=",
"\"%08s\"",
";",
"if",
"(",
"is_array",
"(",
"$",
"id",
")",
")",
"$",
"id",
"=",
"implode",
"(",
"\"-\"",
",",
... | Generate a ID based on the provided Model object | [
"Generate",
"a",
"ID",
"based",
"on",
"the",
"provided",
"Model",
"object"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/ACLModel.php#L158-L172 |
197,229 | translationexchange/tml-php-clientsdk | library/Tr8n/Cache/Generators/Base.php | Base.cacheApplication | function cacheApplication() {
$this->log("Downloading application...");
$app = Config::instance()->application->apiClient()->get("application", array("definition" => "true"));
$this->cache(Application::cacheKey(), json_encode($app));
$this->log("Application has been cached.");
re... | php | function cacheApplication() {
$this->log("Downloading application...");
$app = Config::instance()->application->apiClient()->get("application", array("definition" => "true"));
$this->cache(Application::cacheKey(), json_encode($app));
$this->log("Application has been cached.");
re... | [
"function",
"cacheApplication",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\"Downloading application...\"",
")",
";",
"$",
"app",
"=",
"Config",
"::",
"instance",
"(",
")",
"->",
"application",
"->",
"apiClient",
"(",
")",
"->",
"get",
"(",
"\"applicat... | Caches application data | [
"Caches",
"application",
"data"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Cache/Generators/Base.php#L95-L101 |
197,230 | translationexchange/tml-php-clientsdk | library/Tr8n/Cache/Generators/Base.php | Base.cacheLanguages | function cacheLanguages() {
$this->log("Downloading languages...");
$count = 0;
$languages = Config::instance()->application->apiClient()->get("application/languages", array("definition" => "true"));
foreach ($languages as $lang) {
$this->cache(Language::cacheKey($lang["local... | php | function cacheLanguages() {
$this->log("Downloading languages...");
$count = 0;
$languages = Config::instance()->application->apiClient()->get("application/languages", array("definition" => "true"));
foreach ($languages as $lang) {
$this->cache(Language::cacheKey($lang["local... | [
"function",
"cacheLanguages",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"\"Downloading languages...\"",
")",
";",
"$",
"count",
"=",
"0",
";",
"$",
"languages",
"=",
"Config",
"::",
"instance",
"(",
")",
"->",
"application",
"->",
"apiClient",
"(",
"... | Caches application languages with full definition | [
"Caches",
"application",
"languages",
"with",
"full",
"definition"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Cache/Generators/Base.php#L106-L116 |
197,231 | modulusphp/http | Request/HasInput.php | HasInput.only | public function only(array $array)
{
$data = [];
foreach($array as $field) {
if ($this->has($field)) {
$data[$field] = $this->data[$field];
}
}
return $data;
} | php | public function only(array $array)
{
$data = [];
foreach($array as $field) {
if ($this->has($field)) {
$data[$field] = $this->data[$field];
}
}
return $data;
} | [
"public",
"function",
"only",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"field",
")",
")",
"{",
"$",
"data... | Grab selected fields.
@param array $array
@return array $data | [
"Grab",
"selected",
"fields",
"."
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Request/HasInput.php#L29-L40 |
197,232 | modulusphp/http | Request/HasInput.php | HasInput.file | public function file($name, $disk = null)
{
return File::make($this->files[$name], $disk);
} | php | public function file($name, $disk = null)
{
return File::make($this->files[$name], $disk);
} | [
"public",
"function",
"file",
"(",
"$",
"name",
",",
"$",
"disk",
"=",
"null",
")",
"{",
"return",
"File",
"::",
"make",
"(",
"$",
"this",
"->",
"files",
"[",
"$",
"name",
"]",
",",
"$",
"disk",
")",
";",
"}"
] | Get request file
@param string $name
@param string|null $disk
@return array | [
"Get",
"request",
"file"
] | fc5c0f2b582a04de1685578d3fb790686a0a240c | https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Request/HasInput.php#L102-L105 |
197,233 | mpf-soft/admin-widgets | form/Field.php | Field.getLabel | public function getLabel() {
if ($this->label) {
return $this->translate($this->label);
}
$labels = array();
if ($this->form->model && is_string($this->form->model)) {
$class = $this->form->model;
$labels = $class::getLabels();
} elseif ($this-... | php | public function getLabel() {
if ($this->label) {
return $this->translate($this->label);
}
$labels = array();
if ($this->form->model && is_string($this->form->model)) {
$class = $this->form->model;
$labels = $class::getLabels();
} elseif ($this-... | [
"public",
"function",
"getLabel",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"label",
")",
"{",
"return",
"$",
"this",
"->",
"translate",
"(",
"$",
"this",
"->",
"label",
")",
";",
"}",
"$",
"labels",
"=",
"array",
"(",
")",
";",
"if",
"(",
"... | Get label for current field. It will first try to get label attribute, if that's not specified it will check for a model
and read the label from there, if it's still not found then it will generate one using the name.
@return string | [
"Get",
"label",
"for",
"current",
"field",
".",
"It",
"will",
"first",
"try",
"to",
"get",
"label",
"attribute",
"if",
"that",
"s",
"not",
"specified",
"it",
"will",
"check",
"for",
"a",
"model",
"and",
"read",
"the",
"label",
"from",
"there",
"if",
"i... | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/form/Field.php#L123-L139 |
197,234 | mpf-soft/admin-widgets | form/Field.php | Field.display | public function display(Form $form) {
if (!$this->visible){
return "";
}
$this->form = $form;
if (!isset($this->rowHtmlOptions['class'])) {
$this->rowHtmlOptions['class'] = $this->rowClass;
} else {
$this->rowHtmlOptions['class'] .= ' ' . $this... | php | public function display(Form $form) {
if (!$this->visible){
return "";
}
$this->form = $form;
if (!isset($this->rowHtmlOptions['class'])) {
$this->rowHtmlOptions['class'] = $this->rowClass;
} else {
$this->rowHtmlOptions['class'] .= ' ' . $this... | [
"public",
"function",
"display",
"(",
"Form",
"$",
"form",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"visible",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"this",
"->",
"form",
"=",
"$",
"form",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this"... | Get html content for current field.
@param \mpf\widgets\form\Form $form
@return string | [
"Get",
"html",
"content",
"for",
"current",
"field",
"."
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/form/Field.php#L146-L160 |
197,235 | mpf-soft/admin-widgets | form/Field.php | Field.getHTMLError | public function getHTMLError() {
$error = $this->getError();
if (!is_null($error)) {
if (is_string($error)) {
$errorContent = Html::get()->tag('span', $error);
} elseif (is_array($error)) {
$errors = array();
foreach ($error as $mes... | php | public function getHTMLError() {
$error = $this->getError();
if (!is_null($error)) {
if (is_string($error)) {
$errorContent = Html::get()->tag('span', $error);
} elseif (is_array($error)) {
$errors = array();
foreach ($error as $mes... | [
"public",
"function",
"getHTMLError",
"(",
")",
"{",
"$",
"error",
"=",
"$",
"this",
"->",
"getError",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"error",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"error",
")",
")",
"{",
"$",
"e... | Get HTML code for errors.
@return string | [
"Get",
"HTML",
"code",
"for",
"errors",
"."
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/form/Field.php#L173-L190 |
197,236 | mpf-soft/admin-widgets | form/Field.php | Field.getError | public function getError() {
if ($this->error) {
return $this->translate($this->error);
}
if ($this->form->model && is_object($this->form->model) && $this->form->model->hasErrors($this->name)) {
$errors = $this->form->model->getErrors($this->name);
foreach ($e... | php | public function getError() {
if ($this->error) {
return $this->translate($this->error);
}
if ($this->form->model && is_object($this->form->model) && $this->form->model->hasErrors($this->name)) {
$errors = $this->form->model->getErrors($this->name);
foreach ($e... | [
"public",
"function",
"getError",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"error",
")",
"{",
"return",
"$",
"this",
"->",
"translate",
"(",
"$",
"this",
"->",
"error",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"form",
"->",
"model",
"&&",... | Return a simple text message or a list of messages with errors for current field
@return string|string[]|null | [
"Return",
"a",
"simple",
"text",
"message",
"or",
"a",
"list",
"of",
"messages",
"with",
"errors",
"for",
"current",
"field"
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/form/Field.php#L202-L214 |
197,237 | SlabPHP/database | src/Driver.php | Driver.query | public function query($sql, $binders = array(), $suggestedClass = null, $debug = false)
{
//By keeping track of the last binding location, we can skip
//binders that are within bound data
$minBinderLocation = 0;
if (!is_array($binders)) $binders = array($binders);
if (!empt... | php | public function query($sql, $binders = array(), $suggestedClass = null, $debug = false)
{
//By keeping track of the last binding location, we can skip
//binders that are within bound data
$minBinderLocation = 0;
if (!is_array($binders)) $binders = array($binders);
if (!empt... | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"binders",
"=",
"array",
"(",
")",
",",
"$",
"suggestedClass",
"=",
"null",
",",
"$",
"debug",
"=",
"false",
")",
"{",
"//By keeping track of the last binding location, we can skip",
"//binders that are wit... | Run an SQL query
@param string $sql
@param string[] $binders
@param string $suggestedClass
@return \Slab\Components\Database\ResponseInterface | [
"Run",
"an",
"SQL",
"query"
] | d77c38f2260429c6e054633eb0daf3f755c988a9 | https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Driver.php#L72-L109 |
197,238 | OxfordInfoLabs/kinikit-core | src/Util/Serialisation/Serialisable.php | Serialisable.__getSerialisablePropertyValue | public function __getSerialisablePropertyValue($propertyName) {
$map = $this->__getSerialisablePropertyMap();
if (array_key_exists($propertyName, $map)) {
return $map [$propertyName];
} elseif (array_key_exists(substr(strtoupper($propertyName), 0, 1) . substr($propertyName, 1), $map)... | php | public function __getSerialisablePropertyValue($propertyName) {
$map = $this->__getSerialisablePropertyMap();
if (array_key_exists($propertyName, $map)) {
return $map [$propertyName];
} elseif (array_key_exists(substr(strtoupper($propertyName), 0, 1) . substr($propertyName, 1), $map)... | [
"public",
"function",
"__getSerialisablePropertyValue",
"(",
"$",
"propertyName",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"__getSerialisablePropertyMap",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"propertyName",
",",
"$",
"map",
")",
")",
... | Get a serialisable property value by name if it exists. Throw an exception if it doesn't exist.
@param string $propertyName | [
"Get",
"a",
"serialisable",
"property",
"value",
"by",
"name",
"if",
"it",
"exists",
".",
"Throw",
"an",
"exception",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Serialisation/Serialisable.php#L32-L41 |
197,239 | OxfordInfoLabs/kinikit-core | src/Util/Serialisation/Serialisable.php | Serialisable.__getSerialisablePropertyMap | public function __getSerialisablePropertyMap() {
$propertyAccessors = $this->__findSerialisablePropertyAccessors();
$propertyMap = array();
foreach ($propertyAccessors as $accessorSet) {
// If a get accessor exists, add it to the map
if (isset ($accessorSet ["get"])) {
... | php | public function __getSerialisablePropertyMap() {
$propertyAccessors = $this->__findSerialisablePropertyAccessors();
$propertyMap = array();
foreach ($propertyAccessors as $accessorSet) {
// If a get accessor exists, add it to the map
if (isset ($accessorSet ["get"])) {
... | [
"public",
"function",
"__getSerialisablePropertyMap",
"(",
")",
"{",
"$",
"propertyAccessors",
"=",
"$",
"this",
"->",
"__findSerialisablePropertyAccessors",
"(",
")",
";",
"$",
"propertyMap",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"propertyAccessors",
... | Get an associative array of all of the serialisable properties defined on this class. | [
"Get",
"an",
"associative",
"array",
"of",
"all",
"of",
"the",
"serialisable",
"properties",
"defined",
"on",
"this",
"class",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Serialisation/Serialisable.php#L56-L98 |
197,240 | OxfordInfoLabs/kinikit-core | src/Util/Serialisation/Serialisable.php | Serialisable.__setSerialisablePropertyMap | public function __setSerialisablePropertyMap($propertyMap, $ignoreNoneWritableProperties = false) {
$propertyAccessors = $this->__findSerialisablePropertyAccessors();
$noneWritables = array();
foreach ($propertyMap as $inputPropertyName => $propertyValue) {
$propertyName = strtolowe... | php | public function __setSerialisablePropertyMap($propertyMap, $ignoreNoneWritableProperties = false) {
$propertyAccessors = $this->__findSerialisablePropertyAccessors();
$noneWritables = array();
foreach ($propertyMap as $inputPropertyName => $propertyValue) {
$propertyName = strtolowe... | [
"public",
"function",
"__setSerialisablePropertyMap",
"(",
"$",
"propertyMap",
",",
"$",
"ignoreNoneWritableProperties",
"=",
"false",
")",
"{",
"$",
"propertyAccessors",
"=",
"$",
"this",
"->",
"__findSerialisablePropertyAccessors",
"(",
")",
";",
"$",
"noneWritables... | Set an associative array of serialisable properties | [
"Set",
"an",
"associative",
"array",
"of",
"serialisable",
"properties"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Serialisation/Serialisable.php#L104-L148 |
197,241 | OxfordInfoLabs/kinikit-core | src/Util/Serialisation/Serialisable.php | Serialisable.__findSerialisablePropertyAccessors | public function __findSerialisablePropertyAccessors() {
// Grab the class name first.
$className = get_class($this);
// If no accessor map has been previously cached for this class type, cache it now.
if (!isset (self::$__accessorMaps [$className])) {
$reflectionClass = n... | php | public function __findSerialisablePropertyAccessors() {
// Grab the class name first.
$className = get_class($this);
// If no accessor map has been previously cached for this class type, cache it now.
if (!isset (self::$__accessorMaps [$className])) {
$reflectionClass = n... | [
"public",
"function",
"__findSerialisablePropertyAccessors",
"(",
")",
"{",
"// Grab the class name first.",
"$",
"className",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"// If no accessor map has been previously cached for this class type, cache it now.",
"if",
"(",
"!",
... | Find all serialisable property objects, return a map of accessor objects keyed in by GET and SET. | [
"Find",
"all",
"serialisable",
"property",
"objects",
"return",
"a",
"map",
"of",
"accessor",
"objects",
"keyed",
"in",
"by",
"GET",
"and",
"SET",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Serialisation/Serialisable.php#L154-L214 |
197,242 | AnonymPHP/Anonym-Cookie | src/Anonym/Components/Cookie.php | Cookie.forever | public function forever(
$name = '',
$value = '',
$path = '/',
$domain = null,
$secure = false,
$httpOnly = false
) {
$this->set($name, $value, 2628000, $path, $domain, $secure, $httpOnly);
return $this;
} | php | public function forever(
$name = '',
$value = '',
$path = '/',
$domain = null,
$secure = false,
$httpOnly = false
) {
$this->set($name, $value, 2628000, $path, $domain, $secure, $httpOnly);
return $this;
} | [
"public",
"function",
"forever",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
",",
"$",
"path",
"=",
"'/'",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"secure",
"=",
"false",
",",
"$",
"httpOnly",
"=",
"false",
")",
"{",
"$",
"thi... | this cookie life very long time
@param string $name
@param string $value
@param string $path
@param null $domain
@param bool $secure
@param bool $httpOnly
@return $this | [
"this",
"cookie",
"life",
"very",
"long",
"time"
] | 7e02403f76fab42355f02326c5589d3fca271e3b | https://github.com/AnonymPHP/Anonym-Cookie/blob/7e02403f76fab42355f02326c5589d3fca271e3b/src/Anonym/Components/Cookie.php#L174-L184 |
197,243 | togucms/FrontendBundle | Data/Formatter.php | Formatter.format | public function format($entities) {
$data = array(
'models' => array(),
'images' => array(),
'links' => array()
);
if(! is_array($entities)) {
$entities = array($entities->getId() => $entities);
}
foreach ($entities as $entity) {
if($entity instanceof \Application\Togu\ApplicationModelsBundle... | php | public function format($entities) {
$data = array(
'models' => array(),
'images' => array(),
'links' => array()
);
if(! is_array($entities)) {
$entities = array($entities->getId() => $entities);
}
foreach ($entities as $entity) {
if($entity instanceof \Application\Togu\ApplicationModelsBundle... | [
"public",
"function",
"format",
"(",
"$",
"entities",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"'models'",
"=>",
"array",
"(",
")",
",",
"'images'",
"=>",
"array",
"(",
")",
",",
"'links'",
"=>",
"array",
"(",
")",
")",
";",
"if",
"(",
"!",
"is_... | Prepares the data to be serialized
@param mixed $entity The entity to serialize
@return string The serialized data | [
"Prepares",
"the",
"data",
"to",
"be",
"serialized"
] | fd165aca0fb6498ce85b39c1ff536cc1bd8ba285 | https://github.com/togucms/FrontendBundle/blob/fd165aca0fb6498ce85b39c1ff536cc1bd8ba285/Data/Formatter.php#L55-L83 |
197,244 | Wedeto/HTTP | src/Forms/AddNonceToForm.php | AddNonceToForm.register | public function register()
{
$this->prepare_hook = $this->prepare_hook ?: Hook::subscribe('Wedeto.HTTP.Forms.Form.prepare', [$this, 'hookPrepareForm']);
$this->validate_hook = $this->validate_hook ?: Hook::subscribe('Wedeto.HTTP.Forms.Form.isValid', [$this, 'hookIsValid']);
} | php | public function register()
{
$this->prepare_hook = $this->prepare_hook ?: Hook::subscribe('Wedeto.HTTP.Forms.Form.prepare', [$this, 'hookPrepareForm']);
$this->validate_hook = $this->validate_hook ?: Hook::subscribe('Wedeto.HTTP.Forms.Form.isValid', [$this, 'hookIsValid']);
} | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"prepare_hook",
"=",
"$",
"this",
"->",
"prepare_hook",
"?",
":",
"Hook",
"::",
"subscribe",
"(",
"'Wedeto.HTTP.Forms.Form.prepare'",
",",
"[",
"$",
"this",
",",
"'hookPrepareForm'",
"]",
")... | Subscribe to two hooks, prepare and isValid | [
"Subscribe",
"to",
"two",
"hooks",
"prepare",
"and",
"isValid"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/AddNonceToForm.php#L56-L60 |
197,245 | Wedeto/HTTP | src/Forms/AddNonceToForm.php | AddNonceToForm.unregister | public function unregister()
{
if ($this->prepare_hook)
{
Hook::unsubscribe('Wedeto.HTTP.Forms.Form.prepare', $this->prepare_hook);
$this->prepare_hook = null;
}
if ($this->validate_hook)
{
Hook::unsubscribe('Wedeto.HTTP.Forms.Form.isValid... | php | public function unregister()
{
if ($this->prepare_hook)
{
Hook::unsubscribe('Wedeto.HTTP.Forms.Form.prepare', $this->prepare_hook);
$this->prepare_hook = null;
}
if ($this->validate_hook)
{
Hook::unsubscribe('Wedeto.HTTP.Forms.Form.isValid... | [
"public",
"function",
"unregister",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"prepare_hook",
")",
"{",
"Hook",
"::",
"unsubscribe",
"(",
"'Wedeto.HTTP.Forms.Form.prepare'",
",",
"$",
"this",
"->",
"prepare_hook",
")",
";",
"$",
"this",
"->",
"prepare_hoo... | Unsubscribe from the two hooks | [
"Unsubscribe",
"from",
"the",
"two",
"hooks"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/AddNonceToForm.php#L65-L78 |
197,246 | Wedeto/HTTP | src/Forms/AddNonceToForm.php | AddNonceToForm.hookPrepareForm | public function hookPrepareForm(Dictionary $params)
{
$session = $params['session'];
$form = $params['form'];
if ($session !== null)
{
$nonce_name = Nonce::getParameterName();
if (!isset($form[$nonce_name]))
{
$context = [];
... | php | public function hookPrepareForm(Dictionary $params)
{
$session = $params['session'];
$form = $params['form'];
if ($session !== null)
{
$nonce_name = Nonce::getParameterName();
if (!isset($form[$nonce_name]))
{
$context = [];
... | [
"public",
"function",
"hookPrepareForm",
"(",
"Dictionary",
"$",
"params",
")",
"{",
"$",
"session",
"=",
"$",
"params",
"[",
"'session'",
"]",
";",
"$",
"form",
"=",
"$",
"params",
"[",
"'form'",
"]",
";",
"if",
"(",
"$",
"session",
"!==",
"null",
"... | The hook called when the form is being prepared. Is used to
add the nonce field to the form. | [
"The",
"hook",
"called",
"when",
"the",
"form",
"is",
"being",
"prepared",
".",
"Is",
"used",
"to",
"add",
"the",
"nonce",
"field",
"to",
"the",
"form",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/AddNonceToForm.php#L84-L98 |
197,247 | Wedeto/HTTP | src/Forms/AddNonceToForm.php | AddNonceToForm.hookIsValid | public function hookIsValid(Dictionary $params)
{
// Validate nonce
$form = $params['form'];
$request = $params['request'];
$arguments = $params['arguments'];
$result = Nonce::validateNonce($form->getName(), $request->session, $arguments);
$nonce_name = Nonce::getPar... | php | public function hookIsValid(Dictionary $params)
{
// Validate nonce
$form = $params['form'];
$request = $params['request'];
$arguments = $params['arguments'];
$result = Nonce::validateNonce($form->getName(), $request->session, $arguments);
$nonce_name = Nonce::getPar... | [
"public",
"function",
"hookIsValid",
"(",
"Dictionary",
"$",
"params",
")",
"{",
"// Validate nonce",
"$",
"form",
"=",
"$",
"params",
"[",
"'form'",
"]",
";",
"$",
"request",
"=",
"$",
"params",
"[",
"'request'",
"]",
";",
"$",
"arguments",
"=",
"$",
... | The hook called when the form is validated. Is used to validate that the
received nonce is valid. | [
"The",
"hook",
"called",
"when",
"the",
"form",
"is",
"validated",
".",
"Is",
"used",
"to",
"validate",
"that",
"the",
"received",
"nonce",
"is",
"valid",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/AddNonceToForm.php#L104-L129 |
197,248 | FlorianWolters/PHP-Component-Util-Reflection | src/main/php/ReflectionUtils.php | ReflectionUtils.createNewInstanceWithoutConstructor | public static function createNewInstanceWithoutConstructor(
$className,
array $arguments = []
) {
$reflectedClass = new ReflectionClass($className);
$newInstance = $reflectedClass->newInstanceWithoutConstructor();
$reflectedConstructor = $reflectedClass->getConstructor();
... | php | public static function createNewInstanceWithoutConstructor(
$className,
array $arguments = []
) {
$reflectedClass = new ReflectionClass($className);
$newInstance = $reflectedClass->newInstanceWithoutConstructor();
$reflectedConstructor = $reflectedClass->getConstructor();
... | [
"public",
"static",
"function",
"createNewInstanceWithoutConstructor",
"(",
"$",
"className",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"reflectedClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"$",
"newInstance",
"=... | Creates a new instance of the class with the specified class name
without invoking its constructor.
The constructor is set accessible if it is not declared with `public`
visibility.
The method `createNewInstanceWithoutConstructor` accepts a variable
number of arguments which are passed to the constructor of the class... | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"class",
"with",
"the",
"specified",
"class",
"name",
"without",
"invoking",
"its",
"constructor",
"."
] | b905c0cd04fc9232da2456fd9eb09752680188dd | https://github.com/FlorianWolters/PHP-Component-Util-Reflection/blob/b905c0cd04fc9232da2456fd9eb09752680188dd/src/main/php/ReflectionUtils.php#L67-L81 |
197,249 | FlorianWolters/PHP-Component-Util-Reflection | src/main/php/ReflectionUtils.php | ReflectionUtils.invokeMethod | public static function invokeMethod(
$object,
$methodName,
array $arguments = []
) {
$reflectedObject = new ReflectionObject($object);
$reflectedMethod = $reflectedObject->getMethod($methodName);
$reflectedMethod->setAccessible(true);
$reflectedMethod->invokeA... | php | public static function invokeMethod(
$object,
$methodName,
array $arguments = []
) {
$reflectedObject = new ReflectionObject($object);
$reflectedMethod = $reflectedObject->getMethod($methodName);
$reflectedMethod->setAccessible(true);
$reflectedMethod->invokeA... | [
"public",
"static",
"function",
"invokeMethod",
"(",
"$",
"object",
",",
"$",
"methodName",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"reflectedObject",
"=",
"new",
"ReflectionObject",
"(",
"$",
"object",
")",
";",
"$",
"reflectedMethod... | Invokes the specified method on the specified object.
The method `invokeMethod` accepts a variable number of arguments which
are passed to the method of the object.
@param object $object The object on which to invoke the method.
@param strin $methodName The name of the method to invoke.
@param mixed[] $argumen... | [
"Invokes",
"the",
"specified",
"method",
"on",
"the",
"specified",
"object",
"."
] | b905c0cd04fc9232da2456fd9eb09752680188dd | https://github.com/FlorianWolters/PHP-Component-Util-Reflection/blob/b905c0cd04fc9232da2456fd9eb09752680188dd/src/main/php/ReflectionUtils.php#L96-L105 |
197,250 | ivopetkov/server-requests-bearframework-addon | classes/ServerRequests.php | ServerRequests.add | public function add(string $name, callable $callback): \IvoPetkov\BearFrameworkAddons\ServerRequests
{
$this->callbacks[$name] = $callback;
return $this;
} | php | public function add(string $name, callable $callback): \IvoPetkov\BearFrameworkAddons\ServerRequests
{
$this->callbacks[$name] = $callback;
return $this;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"name",
",",
"callable",
"$",
"callback",
")",
":",
"\\",
"IvoPetkov",
"\\",
"BearFrameworkAddons",
"\\",
"ServerRequests",
"{",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"name",
"]",
"=",
"$",
"callback",
... | Register a named callback
@param string $name
@param callable $callback
@return IvoPetkov\BearFrameworkAddons\ServerRequests Returns a reference to the object itself. | [
"Register",
"a",
"named",
"callback"
] | 66d6a594557e988dc458d569c7e81ea6af60a58a | https://github.com/ivopetkov/server-requests-bearframework-addon/blob/66d6a594557e988dc458d569c7e81ea6af60a58a/classes/ServerRequests.php#L32-L36 |
197,251 | ivopetkov/server-requests-bearframework-addon | classes/ServerRequests.php | ServerRequests.execute | public function execute(string $name, array $data, \BearFramework\App\Response $response): string
{
if (isset($this->callbacks[$name])) {
return (string) call_user_func($this->callbacks[$name], $data, $response);
}
return '';
} | php | public function execute(string $name, array $data, \BearFramework\App\Response $response): string
{
if (isset($this->callbacks[$name])) {
return (string) call_user_func($this->callbacks[$name], $data, $response);
}
return '';
} | [
"public",
"function",
"execute",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"data",
",",
"\\",
"BearFramework",
"\\",
"App",
"\\",
"Response",
"$",
"response",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"callbacks",
"[",
... | Executes the callback for the name specified
@param string $name The name of the callback
@param array $data The data that will be passed to the callback
@param \BearFramework\App\Response $response The response object that will be passed to the callback
@return string Returns the callback result | [
"Executes",
"the",
"callback",
"for",
"the",
"name",
"specified"
] | 66d6a594557e988dc458d569c7e81ea6af60a58a | https://github.com/ivopetkov/server-requests-bearframework-addon/blob/66d6a594557e988dc458d569c7e81ea6af60a58a/classes/ServerRequests.php#L57-L63 |
197,252 | Palmabit-IT/library | src/Palmabit/Library/Form/FormModel.php | FormModel.process | public function process(array $input)
{
try
{
$success = $this->v->validate($input);
}
catch(ValidationException $e)
{
$this->setErrorsAndThrowException();
}
if( ! $success)
{
$this->setErrorsAndThrowException();
... | php | public function process(array $input)
{
try
{
$success = $this->v->validate($input);
}
catch(ValidationException $e)
{
$this->setErrorsAndThrowException();
}
if( ! $success)
{
$this->setErrorsAndThrowException();
... | [
"public",
"function",
"process",
"(",
"array",
"$",
"input",
")",
"{",
"try",
"{",
"$",
"success",
"=",
"$",
"this",
"->",
"v",
"->",
"validate",
"(",
"$",
"input",
")",
";",
"}",
"catch",
"(",
"ValidationException",
"$",
"e",
")",
"{",
"$",
"this"... | Processa l'input e chiama create o opdate a seconda
@param array $input
@throws \Palmabit\Library\Exceptions\PalmabitExceptionsInterface | [
"Processa",
"l",
"input",
"e",
"chiama",
"create",
"o",
"opdate",
"a",
"seconda"
] | ec49a3c333eb4e94d9610a0f58d82c9ea1ade4b9 | https://github.com/Palmabit-IT/library/blob/ec49a3c333eb4e94d9610a0f58d82c9ea1ade4b9/src/Palmabit/Library/Form/FormModel.php#L52-L69 |
197,253 | eureka-framework/component-response | src/Response/Html/Html.php | Html.renderContent | public function renderContent()
{
if (is_object($this->content) && !method_exists($this->content, '__toString')) {
throw new \LogicException('Cannot render content: it is an object without __toString method!');
}
if (is_array($this->content)) {
throw new \LogicExcept... | php | public function renderContent()
{
if (is_object($this->content) && !method_exists($this->content, '__toString')) {
throw new \LogicException('Cannot render content: it is an object without __toString method!');
}
if (is_array($this->content)) {
throw new \LogicExcept... | [
"public",
"function",
"renderContent",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"content",
")",
"&&",
"!",
"method_exists",
"(",
"$",
"this",
"->",
"content",
",",
"'__toString'",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException... | Render content.
@return string
@throws \LogicException | [
"Render",
"content",
"."
] | f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a | https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Html/Html.php#L36-L47 |
197,254 | ScaraMVC/Framework | src/Scara/Html/BaseBuilder.php | BaseBuilder.attributes | protected function attributes($attributes = [])
{
$ar = [];
foreach ($attributes as $key => $value) {
$element = $this->attribute($key, $value);
if (!is_null($element)) {
$ar[] = $element;
}
}
return count($ar) > 0 ? ' '.implode('... | php | protected function attributes($attributes = [])
{
$ar = [];
foreach ($attributes as $key => $value) {
$element = $this->attribute($key, $value);
if (!is_null($element)) {
$ar[] = $element;
}
}
return count($ar) > 0 ? ' '.implode('... | [
"protected",
"function",
"attributes",
"(",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"ar",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"att... | Cycles through given attributes and sets them for the element.
@param array $attributes - The elements given options (attributes)
@return string | [
"Cycles",
"through",
"given",
"attributes",
"and",
"sets",
"them",
"for",
"the",
"element",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Html/BaseBuilder.php#L17-L29 |
197,255 | ScaraMVC/Framework | src/Scara/Html/BaseBuilder.php | BaseBuilder.attribute | protected function attribute($key, $value)
{
if (is_numeric($key)) {
$key = $value;
}
if (!is_null($value)) {
return $key.'="'.$value.'"';
}
} | php | protected function attribute($key, $value)
{
if (is_numeric($key)) {
$key = $value;
}
if (!is_null($value)) {
return $key.'="'.$value.'"';
}
} | [
"protected",
"function",
"attribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"$",
"key",
"=",
"$",
"value",
";",
"}",
"if",
"(",
"!",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
... | Creates the attribute string.
@param string $key - The attribute's key
@param string $value - The $key's value
@return string | [
"Creates",
"the",
"attribute",
"string",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Html/BaseBuilder.php#L39-L48 |
197,256 | ScaraMVC/Framework | src/Scara/Html/BaseBuilder.php | BaseBuilder.obfuscate | public function obfuscate($value)
{
$safe = '';
foreach (str_split($value) as $letter) {
if (ord($letter) > 128) {
return $letter;
}
switch (rand(1, 3)) {
case 1:
$safe .= '&#'.ord($letter).';';
bre... | php | public function obfuscate($value)
{
$safe = '';
foreach (str_split($value) as $letter) {
if (ord($letter) > 128) {
return $letter;
}
switch (rand(1, 3)) {
case 1:
$safe .= '&#'.ord($letter).';';
bre... | [
"public",
"function",
"obfuscate",
"(",
"$",
"value",
")",
"{",
"$",
"safe",
"=",
"''",
";",
"foreach",
"(",
"str_split",
"(",
"$",
"value",
")",
"as",
"$",
"letter",
")",
"{",
"if",
"(",
"ord",
"(",
"$",
"letter",
")",
">",
"128",
")",
"{",
"r... | Obfuscates a string.
@param string $value - The string to obfuscate
@return string | [
"Obfuscates",
"a",
"string",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Html/BaseBuilder.php#L82-L104 |
197,257 | togucms/MediaBundle | Controller/MediaController.php | MediaController.postMediaAction | public function postMediaAction($provider, Request $request) {
$pool = $this->get("sonata.media.pool");
$manager = $this->get("sonata.media.manager.media");
$formFactory = $this->get('form.factory');
try {
$mediaProvider = $pool->getProvider($provider);
} catch (\RuntimeException $ex)... | php | public function postMediaAction($provider, Request $request) {
$pool = $this->get("sonata.media.pool");
$manager = $this->get("sonata.media.manager.media");
$formFactory = $this->get('form.factory');
try {
$mediaProvider = $pool->getProvider($provider);
} catch (\RuntimeException $ex)... | [
"public",
"function",
"postMediaAction",
"(",
"$",
"provider",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"pool",
"=",
"$",
"this",
"->",
"get",
"(",
"\"sonata.media.pool\"",
")",
";",
"$",
"manager",
"=",
"$",
"this",
"->",
"get",
"(",
"\"sonata.med... | Create a new media
@Route(requirements={"provider"="[A-Za-z0-9.]*"})
@return \Symfony\Component\HttpFoundation\Response | [
"Create",
"a",
"new",
"media"
] | 42065d5fa419654540a52ae8f0047708eac9930b | https://github.com/togucms/MediaBundle/blob/42065d5fa419654540a52ae8f0047708eac9930b/Controller/MediaController.php#L66-L106 |
197,258 | Krinkle/toollabs-base | src/BaseTool.php | BaseTool.addOut | public function addOut( $str, $wrapTag = 0, $attributes = array() ) {
if ( is_string( $str ) ) {
if ( is_string( $wrapTag ) ) {
$str = Html::element( $wrapTag, $attributes, $str );
}
$this->mainOutput['body'] .= $str;
return true;
} else {
return false;
}
} | php | public function addOut( $str, $wrapTag = 0, $attributes = array() ) {
if ( is_string( $str ) ) {
if ( is_string( $wrapTag ) ) {
$str = Html::element( $wrapTag, $attributes, $str );
}
$this->mainOutput['body'] .= $str;
return true;
} else {
return false;
}
} | [
"public",
"function",
"addOut",
"(",
"$",
"str",
",",
"$",
"wrapTag",
"=",
"0",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"str",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"wrapTag",
")",
... | Add a string to the output memory
@param $str string String to be added to the memory
@param $wrapTag string (optional) Name of the tag to wrap the string in.
If this is used the contents of $str will be html-escaped!
@param $attributes string (optional) When using a wrapTag these attributes
will be applied as well. B... | [
"Add",
"a",
"string",
"to",
"the",
"output",
"memory"
] | 784150ca58f4b48cc89534fd6142c54b4f138cd2 | https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/BaseTool.php#L234-L244 |
197,259 | theomessin/ts-framework | src/Node/Server.php | Server.clientKick | public function clientKick($clid, $reasonid = Teamspeak::KICK_CHANNEL, $reasonmsg = null)
{
$this->clientListReset();
$this->execute("clientkick", array("clid" => $clid, "reasonid" => $reasonid, "reasonmsg" => $reasonmsg));
} | php | public function clientKick($clid, $reasonid = Teamspeak::KICK_CHANNEL, $reasonmsg = null)
{
$this->clientListReset();
$this->execute("clientkick", array("clid" => $clid, "reasonid" => $reasonid, "reasonmsg" => $reasonmsg));
} | [
"public",
"function",
"clientKick",
"(",
"$",
"clid",
",",
"$",
"reasonid",
"=",
"Teamspeak",
"::",
"KICK_CHANNEL",
",",
"$",
"reasonmsg",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"clientListReset",
"(",
")",
";",
"$",
"this",
"->",
"execute",
"(",
"\... | Kicks one or more clients from their currently joined channel or from the server.
@param integer $clid
@param integer $reasonid
@param string $reasonmsg
@return void | [
"Kicks",
"one",
"or",
"more",
"clients",
"from",
"their",
"currently",
"joined",
"channel",
"or",
"from",
"the",
"server",
"."
] | d60e36553241db05cb05ef19e749866cc977437c | https://github.com/theomessin/ts-framework/blob/d60e36553241db05cb05ef19e749866cc977437c/src/Node/Server.php#L911-L916 |
197,260 | theomessin/ts-framework | src/Node/Server.php | Server.channelGroupGetByName | public function channelGroupGetByName($name, $type = Teamspeak::GROUP_DBTYPE_REGULAR)
{
foreach ($this->channelGroupList() as $group) {
if ($group["name"] == $name && $group["type"] == $type) {
return $group;
}
}
throw new Ts3Exception("invalid groupI... | php | public function channelGroupGetByName($name, $type = Teamspeak::GROUP_DBTYPE_REGULAR)
{
foreach ($this->channelGroupList() as $group) {
if ($group["name"] == $name && $group["type"] == $type) {
return $group;
}
}
throw new Ts3Exception("invalid groupI... | [
"public",
"function",
"channelGroupGetByName",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"Teamspeak",
"::",
"GROUP_DBTYPE_REGULAR",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"channelGroupList",
"(",
")",
"as",
"$",
"group",
")",
"{",
"if",
"(",
"$",
"g... | Returns the Channelgroup object matching the given name.
@param string $name
@param integer $type
@throws Ts3Exception
@return Channelgroup | [
"Returns",
"the",
"Channelgroup",
"object",
"matching",
"the",
"given",
"name",
"."
] | d60e36553241db05cb05ef19e749866cc977437c | https://github.com/theomessin/ts-framework/blob/d60e36553241db05cb05ef19e749866cc977437c/src/Node/Server.php#L1507-L1516 |
197,261 | theomessin/ts-framework | src/Node/Server.php | Server.snapshotCreate | public function snapshotCreate($mode = Teamspeak::SNAPSHOT_STRING)
{
$snapshot = $this->request("serversnapshotcreate")->toString(false);
switch ($mode) {
case Teamspeak::SNAPSHOT_BASE64:
return $snapshot->toBase64();
break;
case Teamspeak::S... | php | public function snapshotCreate($mode = Teamspeak::SNAPSHOT_STRING)
{
$snapshot = $this->request("serversnapshotcreate")->toString(false);
switch ($mode) {
case Teamspeak::SNAPSHOT_BASE64:
return $snapshot->toBase64();
break;
case Teamspeak::S... | [
"public",
"function",
"snapshotCreate",
"(",
"$",
"mode",
"=",
"Teamspeak",
"::",
"SNAPSHOT_STRING",
")",
"{",
"$",
"snapshot",
"=",
"$",
"this",
"->",
"request",
"(",
"\"serversnapshotcreate\"",
")",
"->",
"toString",
"(",
"false",
")",
";",
"switch",
"(",
... | Creates and returns snapshot data for the selected virtual server.
@param string $mode
@return string | [
"Creates",
"and",
"returns",
"snapshot",
"data",
"for",
"the",
"selected",
"virtual",
"server",
"."
] | d60e36553241db05cb05ef19e749866cc977437c | https://github.com/theomessin/ts-framework/blob/d60e36553241db05cb05ef19e749866cc977437c/src/Node/Server.php#L1880-L1897 |
197,262 | kaiohken1982/NeobazaarMailerModule | src/Mailer/Mail/ClassifiedActivation.php | ClassifiedActivation.checkData | public function checkData(array $data)
{
$keys = array('to', 'fullname', 'title', 'activationLink', 'siteurl', 'cdnurl', 'siteName');
foreach($keys as $key) {
if(!array_key_exists($key, $data)) {
throw new \Exception('Key not in data');
}
}
return $this;
} | php | public function checkData(array $data)
{
$keys = array('to', 'fullname', 'title', 'activationLink', 'siteurl', 'cdnurl', 'siteName');
foreach($keys as $key) {
if(!array_key_exists($key, $data)) {
throw new \Exception('Key not in data');
}
}
return $this;
} | [
"public",
"function",
"checkData",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"keys",
"=",
"array",
"(",
"'to'",
",",
"'fullname'",
",",
"'title'",
",",
"'activationLink'",
",",
"'siteurl'",
",",
"'cdnurl'",
",",
"'siteName'",
")",
";",
"foreach",
"(",
"$... | Checks if data contains neede keye
@param array $data
@throws \Exception
@return \Mailer\Mail\ClassifiedAnswer | [
"Checks",
"if",
"data",
"contains",
"neede",
"keye"
] | 0afc66196a0a392ecb4f052f483f2b5ff606bd8f | https://github.com/kaiohken1982/NeobazaarMailerModule/blob/0afc66196a0a392ecb4f052f483f2b5ff606bd8f/src/Mailer/Mail/ClassifiedActivation.php#L45-L56 |
197,263 | FuzeWorks/Core | src/FuzeWorks/LoggerTracyBridge.php | LoggerTracyBridge.register | public static function register()
{
$class = new self();
Events::addListener(array($class, 'screenLogEventListener'), 'screenLogEvent', EventPriority::NORMAL);
$bar = Debugger::getBar();
$bar->addPanel($class);
} | php | public static function register()
{
$class = new self();
Events::addListener(array($class, 'screenLogEventListener'), 'screenLogEvent', EventPriority::NORMAL);
$bar = Debugger::getBar();
$bar->addPanel($class);
} | [
"public",
"static",
"function",
"register",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"self",
"(",
")",
";",
"Events",
"::",
"addListener",
"(",
"array",
"(",
"$",
"class",
",",
"'screenLogEventListener'",
")",
",",
"'screenLogEvent'",
",",
"EventPriority",
... | Register the bar and register the event which will block the screen log | [
"Register",
"the",
"bar",
"and",
"register",
"the",
"event",
"which",
"will",
"block",
"the",
"screen",
"log"
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/LoggerTracyBridge.php#L53-L59 |
197,264 | net-tools/core | src/Helpers/SecurityHelper.php | SecurityHelper.cryptoJsAesDecrypt | static function cryptoJsAesDecrypt($passphrase, $jsonString){
$jsondata = json_decode($jsonString, true);
try {
$salt = hex2bin($jsondata["s"]);
$iv = hex2bin($jsondata["iv"]);
} catch(\Exception $e) { return null; }
$ct = base64_decode($jsondata["ct"]);
$concatedPassphrase = $passphrase.$salt;
$md5 ... | php | static function cryptoJsAesDecrypt($passphrase, $jsonString){
$jsondata = json_decode($jsonString, true);
try {
$salt = hex2bin($jsondata["s"]);
$iv = hex2bin($jsondata["iv"]);
} catch(\Exception $e) { return null; }
$ct = base64_decode($jsondata["ct"]);
$concatedPassphrase = $passphrase.$salt;
$md5 ... | [
"static",
"function",
"cryptoJsAesDecrypt",
"(",
"$",
"passphrase",
",",
"$",
"jsonString",
")",
"{",
"$",
"jsondata",
"=",
"json_decode",
"(",
"$",
"jsonString",
",",
"true",
")",
";",
"try",
"{",
"$",
"salt",
"=",
"hex2bin",
"(",
"$",
"jsondata",
"[",
... | Decrypt data from a CryptoJS json encoding string
@param mixed $passphrase
@param mixed $jsonString
@return mixed | [
"Decrypt",
"data",
"from",
"a",
"CryptoJS",
"json",
"encoding",
"string"
] | 51446641cee22c0cf53d2b409c76cc8bd1a187e7 | https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/SecurityHelper.php#L90-L108 |
197,265 | net-tools/core | src/Helpers/SecurityHelper.php | SecurityHelper.cryptoJsAesEncrypt | static function cryptoJsAesEncrypt($passphrase, $value){
$salt = openssl_random_pseudo_bytes(8);
$salted = '';
$dx = '';
while (strlen($salted) < 48) {
$dx = md5($dx.$passphrase.$salt, true);
$salted .= $dx;
}
$key = substr($salted, 0, 32);
$iv = substr($salted, 32,16);
$encrypted_data = openssl_... | php | static function cryptoJsAesEncrypt($passphrase, $value){
$salt = openssl_random_pseudo_bytes(8);
$salted = '';
$dx = '';
while (strlen($salted) < 48) {
$dx = md5($dx.$passphrase.$salt, true);
$salted .= $dx;
}
$key = substr($salted, 0, 32);
$iv = substr($salted, 32,16);
$encrypted_data = openssl_... | [
"static",
"function",
"cryptoJsAesEncrypt",
"(",
"$",
"passphrase",
",",
"$",
"value",
")",
"{",
"$",
"salt",
"=",
"openssl_random_pseudo_bytes",
"(",
"8",
")",
";",
"$",
"salted",
"=",
"''",
";",
"$",
"dx",
"=",
"''",
";",
"while",
"(",
"strlen",
"(",... | Encrypt value to a cryptojs compatiable json encoding string
@param mixed $passphrase
@param mixed $value
@return string | [
"Encrypt",
"value",
"to",
"a",
"cryptojs",
"compatiable",
"json",
"encoding",
"string"
] | 51446641cee22c0cf53d2b409c76cc8bd1a187e7 | https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/SecurityHelper.php#L118-L131 |
197,266 | agentmedia/phine-builtin | src/BuiltIn/Modules/Frontend/Login.php | Login.Init | protected function Init()
{
$this->login = ContentLogin::Schema()->ByContent($this->Content());
$this->HandleLoggedIn();
$passwordUrl = $this->login->GetPasswordUrl();
$this->passwordUrl = $passwordUrl ? FrontendRouter::Url($passwordUrl) : '';
$this->AddNameField();
$... | php | protected function Init()
{
$this->login = ContentLogin::Schema()->ByContent($this->Content());
$this->HandleLoggedIn();
$passwordUrl = $this->login->GetPasswordUrl();
$this->passwordUrl = $passwordUrl ? FrontendRouter::Url($passwordUrl) : '';
$this->AddNameField();
$... | [
"protected",
"function",
"Init",
"(",
")",
"{",
"$",
"this",
"->",
"login",
"=",
"ContentLogin",
"::",
"Schema",
"(",
")",
"->",
"ByContent",
"(",
"$",
"this",
"->",
"Content",
"(",
")",
")",
";",
"$",
"this",
"->",
"HandleLoggedIn",
"(",
")",
";",
... | Initializes the login element
@return boolean Returns always true | [
"Initializes",
"the",
"login",
"element"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Frontend/Login.php#L45-L57 |
197,267 | Montage-Inc/php-montage | src/Documents.php | Documents.getIterator | public function getIterator()
{
//Run the query
$resp = $this->query->execute();
//Return the documents as an ArrayIterator to satisfy the requirements
//of the getIterator function.
foreach ($resp->data as $document)
{
yield $document;
}
... | php | public function getIterator()
{
//Run the query
$resp = $this->query->execute();
//Return the documents as an ArrayIterator to satisfy the requirements
//of the getIterator function.
foreach ($resp->data as $document)
{
yield $document;
}
... | [
"public",
"function",
"getIterator",
"(",
")",
"{",
"//Run the query",
"$",
"resp",
"=",
"$",
"this",
"->",
"query",
"->",
"execute",
"(",
")",
";",
"//Return the documents as an ArrayIterator to satisfy the requirements",
"//of the getIterator function.",
"foreach",
"(",... | Required function for any class that implements IteratorAggregate. Will
yield documents as they become available. If cursors are returned
then subsequent requests will be made, yielding more documents.
@return \Generator
@throws MontageException | [
"Required",
"function",
"for",
"any",
"class",
"that",
"implements",
"IteratorAggregate",
".",
"Will",
"yield",
"documents",
"as",
"they",
"become",
"available",
".",
"If",
"cursors",
"are",
"returned",
"then",
"subsequent",
"requests",
"will",
"be",
"made",
"yi... | bcd526985447a31c7e5b74555058e167242b23ed | https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Documents.php#L62-L83 |
197,268 | Montage-Inc/php-montage | src/Documents.php | Documents.save | public function save($doc)
{
return $this->montage->request(
'post',
$this->montage->url('document-save', $this->schema->name),
['body' => json_encode($doc)]
);
} | php | public function save($doc)
{
return $this->montage->request(
'post',
$this->montage->url('document-save', $this->schema->name),
['body' => json_encode($doc)]
);
} | [
"public",
"function",
"save",
"(",
"$",
"doc",
")",
"{",
"return",
"$",
"this",
"->",
"montage",
"->",
"request",
"(",
"'post'",
",",
"$",
"this",
"->",
"montage",
"->",
"url",
"(",
"'document-save'",
",",
"$",
"this",
"->",
"schema",
"->",
"name",
"... | Persist one or more document objects to montage.
@param $doc
@return mixed | [
"Persist",
"one",
"or",
"more",
"document",
"objects",
"to",
"montage",
"."
] | bcd526985447a31c7e5b74555058e167242b23ed | https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Documents.php#L91-L98 |
197,269 | Montage-Inc/php-montage | src/Documents.php | Documents.get | public function get($docId)
{
return $this->montage->request(
'get',
$this->montage->url('document-detail', $this->schema->name, $docId)
);
} | php | public function get($docId)
{
return $this->montage->request(
'get',
$this->montage->url('document-detail', $this->schema->name, $docId)
);
} | [
"public",
"function",
"get",
"(",
"$",
"docId",
")",
"{",
"return",
"$",
"this",
"->",
"montage",
"->",
"request",
"(",
"'get'",
",",
"$",
"this",
"->",
"montage",
"->",
"url",
"(",
"'document-detail'",
",",
"$",
"this",
"->",
"schema",
"->",
"name",
... | Get a single document by it's ID from montage.
@param $docId
@return mixed | [
"Get",
"a",
"single",
"document",
"by",
"it",
"s",
"ID",
"from",
"montage",
"."
] | bcd526985447a31c7e5b74555058e167242b23ed | https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Documents.php#L106-L112 |
197,270 | Montage-Inc/php-montage | src/Documents.php | Documents.delete | public function delete($docId)
{
return $this->montage->request(
'delete',
$this->montage->url('document-detail', $this->schema->name, $docId)
);
} | php | public function delete($docId)
{
return $this->montage->request(
'delete',
$this->montage->url('document-detail', $this->schema->name, $docId)
);
} | [
"public",
"function",
"delete",
"(",
"$",
"docId",
")",
"{",
"return",
"$",
"this",
"->",
"montage",
"->",
"request",
"(",
"'delete'",
",",
"$",
"this",
"->",
"montage",
"->",
"url",
"(",
"'document-detail'",
",",
"$",
"this",
"->",
"schema",
"->",
"na... | Delete a record with montage.
@param $docId
@return mixed | [
"Delete",
"a",
"record",
"with",
"montage",
"."
] | bcd526985447a31c7e5b74555058e167242b23ed | https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Documents.php#L136-L142 |
197,271 | SlabPHP/controllers | src/Traits/Sequenced.php | Sequenced.initializeCallQueues | protected function initializeCallQueues()
{
$this->inputs = new \Slab\Sequencer\CallQueue();
$this->operations = new \Slab\Sequencer\CallQueue();
$this->outputs = new \Slab\Sequencer\CallQueue();
} | php | protected function initializeCallQueues()
{
$this->inputs = new \Slab\Sequencer\CallQueue();
$this->operations = new \Slab\Sequencer\CallQueue();
$this->outputs = new \Slab\Sequencer\CallQueue();
} | [
"protected",
"function",
"initializeCallQueues",
"(",
")",
"{",
"$",
"this",
"->",
"inputs",
"=",
"new",
"\\",
"Slab",
"\\",
"Sequencer",
"\\",
"CallQueue",
"(",
")",
";",
"$",
"this",
"->",
"operations",
"=",
"new",
"\\",
"Slab",
"\\",
"Sequencer",
"\\"... | Sequenced constructor. | [
"Sequenced",
"constructor",
"."
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Traits/Sequenced.php#L36-L41 |
197,272 | SlabPHP/controllers | src/Traits/Sequenced.php | Sequenced.executeCallQueues | protected function executeCallQueues()
{
foreach ($this->inputs->getEntries() as $entry)
{
$this->executeCallQueueEntry($entry);
if (!$this->executeQueues) return;
}
foreach ($this->operations->getEntries() as $entry)
{
$this->executeCallQ... | php | protected function executeCallQueues()
{
foreach ($this->inputs->getEntries() as $entry)
{
$this->executeCallQueueEntry($entry);
if (!$this->executeQueues) return;
}
foreach ($this->operations->getEntries() as $entry)
{
$this->executeCallQ... | [
"protected",
"function",
"executeCallQueues",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"inputs",
"->",
"getEntries",
"(",
")",
"as",
"$",
"entry",
")",
"{",
"$",
"this",
"->",
"executeCallQueueEntry",
"(",
"$",
"entry",
")",
";",
"if",
"(",
"!... | Execute call queues
@throws \Exception | [
"Execute",
"call",
"queues"
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Traits/Sequenced.php#L47-L66 |
197,273 | SlabPHP/controllers | src/Traits/Sequenced.php | Sequenced.stopCallQueues | protected function stopCallQueues()
{
$this->executeQueues = false;
$this->inputs->stopExecution();
$this->operations->stopExecution();
$this->outputs->stopExecution();
} | php | protected function stopCallQueues()
{
$this->executeQueues = false;
$this->inputs->stopExecution();
$this->operations->stopExecution();
$this->outputs->stopExecution();
} | [
"protected",
"function",
"stopCallQueues",
"(",
")",
"{",
"$",
"this",
"->",
"executeQueues",
"=",
"false",
";",
"$",
"this",
"->",
"inputs",
"->",
"stopExecution",
"(",
")",
";",
"$",
"this",
"->",
"operations",
"->",
"stopExecution",
"(",
")",
";",
"$"... | Stop call queues | [
"Stop",
"call",
"queues"
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Traits/Sequenced.php#L85-L91 |
197,274 | kaiohken1982/Thumbnailer | src/Thumbnailer/Thumbnailer/Thumbnailer.php | Thumbnailer.initSourceImageResource | protected function initSourceImageResource()
{
$ext = $this->getExtension();
switch($ext) {
case 'gif':
$this->sourceImageResource = ImageCreateFromGif($this->sourceImagePath);
break;
case 'jpg':
$this->sourceImageResource = ImageCreateFromJpeg($this->sourceImagePath);
break;... | php | protected function initSourceImageResource()
{
$ext = $this->getExtension();
switch($ext) {
case 'gif':
$this->sourceImageResource = ImageCreateFromGif($this->sourceImagePath);
break;
case 'jpg':
$this->sourceImageResource = ImageCreateFromJpeg($this->sourceImagePath);
break;... | [
"protected",
"function",
"initSourceImageResource",
"(",
")",
"{",
"$",
"ext",
"=",
"$",
"this",
"->",
"getExtension",
"(",
")",
";",
"switch",
"(",
"$",
"ext",
")",
"{",
"case",
"'gif'",
":",
"$",
"this",
"->",
"sourceImageResource",
"=",
"ImageCreateFrom... | Init the source image resource
@throws \RuntimeException
@return \Thumbnailer\Thumbnailer\Thumbnailer | [
"Init",
"the",
"source",
"image",
"resource"
] | 8625d41c153fef41979d402837335b1c2320077d | https://github.com/kaiohken1982/Thumbnailer/blob/8625d41c153fef41979d402837335b1c2320077d/src/Thumbnailer/Thumbnailer/Thumbnailer.php#L238-L261 |
197,275 | kaiohken1982/Thumbnailer | src/Thumbnailer/Thumbnailer/Thumbnailer.php | Thumbnailer.initDestImageResource | protected function initDestImageResource()
{
// gif does not supports truecolor for resize
if (function_exists("ImageCreateTrueColor") && $this->getExtension() != 'gif') {
$this->destImageResource = ImageCreateTrueColor($this->destImageWidth, $this->destImageHeight);
} else {
$this->dest... | php | protected function initDestImageResource()
{
// gif does not supports truecolor for resize
if (function_exists("ImageCreateTrueColor") && $this->getExtension() != 'gif') {
$this->destImageResource = ImageCreateTrueColor($this->destImageWidth, $this->destImageHeight);
} else {
$this->dest... | [
"protected",
"function",
"initDestImageResource",
"(",
")",
"{",
"// gif does not supports truecolor for resize",
"if",
"(",
"function_exists",
"(",
"\"ImageCreateTrueColor\"",
")",
"&&",
"$",
"this",
"->",
"getExtension",
"(",
")",
"!=",
"'gif'",
")",
"{",
"$",
"th... | Init the destination resource image.
This is an empty image and use the width and height values
of the source image if resize is not called by the user
@throws \RuntimeException
@return resource | [
"Init",
"the",
"destination",
"resource",
"image",
".",
"This",
"is",
"an",
"empty",
"image",
"and",
"use",
"the",
"width",
"and",
"height",
"values",
"of",
"the",
"source",
"image",
"if",
"resize",
"is",
"not",
"called",
"by",
"the",
"user"
] | 8625d41c153fef41979d402837335b1c2320077d | https://github.com/kaiohken1982/Thumbnailer/blob/8625d41c153fef41979d402837335b1c2320077d/src/Thumbnailer/Thumbnailer/Thumbnailer.php#L271-L281 |
197,276 | libreworks/microformats | src/GeoFormatter.php | GeoFormatter.format | public function format(Geo $geo)
{
return '<span class="h-geo">'
. '<span class="p-latitude">' . (string)$geo->getLatitude() . '</span>, '
. '<span class="p-longitude">' . (string)$geo->getLongitude() . '</span>'
. ($geo->getAltitude() === null ? '' : ' (elevation <span c... | php | public function format(Geo $geo)
{
return '<span class="h-geo">'
. '<span class="p-latitude">' . (string)$geo->getLatitude() . '</span>, '
. '<span class="p-longitude">' . (string)$geo->getLongitude() . '</span>'
. ($geo->getAltitude() === null ? '' : ' (elevation <span c... | [
"public",
"function",
"format",
"(",
"Geo",
"$",
"geo",
")",
"{",
"return",
"'<span class=\"h-geo\">'",
".",
"'<span class=\"p-latitude\">'",
".",
"(",
"string",
")",
"$",
"geo",
"->",
"getLatitude",
"(",
")",
".",
"'</span>, '",
".",
"'<span class=\"p-longitude\"... | Formats a geo.
@param \Libreworks\Microformats\Geo $geo The geo coordinates
@return string The HTML markup | [
"Formats",
"a",
"geo",
"."
] | f208650cb83e8711f5f35878cfa285b7cb505d3d | https://github.com/libreworks/microformats/blob/f208650cb83e8711f5f35878cfa285b7cb505d3d/src/GeoFormatter.php#L36-L43 |
197,277 | agentmedia/phine-core | src/Core/Snippets/BackendRights/SiteRights.php | SiteRights.Save | function Save()
{
$this->pageRights->Save();
if (!$this->rights)
{
$this->rights = new BackendSiteRights();
}
$this->rights->SetEdit($this->Value('Edit'));
$this->rights->SetRemove($this->Value('Remove'));
$this->rights->SetPageRights($thi... | php | function Save()
{
$this->pageRights->Save();
if (!$this->rights)
{
$this->rights = new BackendSiteRights();
}
$this->rights->SetEdit($this->Value('Edit'));
$this->rights->SetRemove($this->Value('Remove'));
$this->rights->SetPageRights($thi... | [
"function",
"Save",
"(",
")",
"{",
"$",
"this",
"->",
"pageRights",
"->",
"Save",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"rights",
")",
"{",
"$",
"this",
"->",
"rights",
"=",
"new",
"BackendSiteRights",
"(",
")",
";",
"}",
"$",
"this",... | Saves the site rights | [
"Saves",
"the",
"site",
"rights"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/BackendRights/SiteRights.php#L41-L53 |
197,278 | SergioMadness/pwf-helpers | src/ConvertHelper.php | ConvertHelper.XML2Array | public static function XML2Array($xmlString)
{
try {
$xml = simplexml_load_string($xmlString, "SimpleXMLElement",
LIBXML_NOCDATA);
$json = json_encode($xml);
$result = json_decode($json, TRUE);
} catch (\Exception $ex) {
$result = ... | php | public static function XML2Array($xmlString)
{
try {
$xml = simplexml_load_string($xmlString, "SimpleXMLElement",
LIBXML_NOCDATA);
$json = json_encode($xml);
$result = json_decode($json, TRUE);
} catch (\Exception $ex) {
$result = ... | [
"public",
"static",
"function",
"XML2Array",
"(",
"$",
"xmlString",
")",
"{",
"try",
"{",
"$",
"xml",
"=",
"simplexml_load_string",
"(",
"$",
"xmlString",
",",
"\"SimpleXMLElement\"",
",",
"LIBXML_NOCDATA",
")",
";",
"$",
"json",
"=",
"json_encode",
"(",
"$"... | Convert XML to array
@param string $xmlString
@return string | [
"Convert",
"XML",
"to",
"array"
] | d6cd44807c120356d60618cb08f237841c35e293 | https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/ConvertHelper.php#L14-L25 |
197,279 | SergioMadness/pwf-helpers | src/ConvertHelper.php | ConvertHelper.array2XML | public static function array2XML($haystack, $rootElementName = '')
{
$args = func_get_args();
$isRoot = !isset($args[2]);
$root = isset($args[3]) ? $args[3] : new \DOMDocument('1.0', 'utf-8');
$parent = isset($args[2]) ? $args[2] : ($rootElementName !== '' ? $root->createElement(... | php | public static function array2XML($haystack, $rootElementName = '')
{
$args = func_get_args();
$isRoot = !isset($args[2]);
$root = isset($args[3]) ? $args[3] : new \DOMDocument('1.0', 'utf-8');
$parent = isset($args[2]) ? $args[2] : ($rootElementName !== '' ? $root->createElement(... | [
"public",
"static",
"function",
"array2XML",
"(",
"$",
"haystack",
",",
"$",
"rootElementName",
"=",
"''",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"isRoot",
"=",
"!",
"isset",
"(",
"$",
"args",
"[",
"2",
"]",
")",
";",
"$",... | Convert array to XML object
@param array $haystack
@param string $rootElementName
@return DOMDocument | [
"Convert",
"array",
"to",
"XML",
"object"
] | d6cd44807c120356d60618cb08f237841c35e293 | https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/ConvertHelper.php#L34-L57 |
197,280 | PuKoren/php-inline-images | src/Fetcher.php | Fetcher.fetchLocal | private function fetchLocal() {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$this->mime = finfo_file($finfo, $this->path);
finfo_close($finfo);
$this->data = file_get_contents($this->path, FILE_USE_INCLUDE_PATH);
} | php | private function fetchLocal() {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$this->mime = finfo_file($finfo, $this->path);
finfo_close($finfo);
$this->data = file_get_contents($this->path, FILE_USE_INCLUDE_PATH);
} | [
"private",
"function",
"fetchLocal",
"(",
")",
"{",
"$",
"finfo",
"=",
"finfo_open",
"(",
"FILEINFO_MIME_TYPE",
")",
";",
"$",
"this",
"->",
"mime",
"=",
"finfo_file",
"(",
"$",
"finfo",
",",
"$",
"this",
"->",
"path",
")",
";",
"finfo_close",
"(",
"$"... | Fetch a local file and grab its mime type and file content
@return void | [
"Fetch",
"a",
"local",
"file",
"and",
"grab",
"its",
"mime",
"type",
"and",
"file",
"content"
] | 22df5d37ad766d06552121d4422d97edc6608c5d | https://github.com/PuKoren/php-inline-images/blob/22df5d37ad766d06552121d4422d97edc6608c5d/src/Fetcher.php#L45-L50 |
197,281 | DzikuVx/phpCache | src/PhpCache.php | PhpCache.create | public function create($sMethod = null) {
/*
* If no method passed, use default
*/
if (empty($sMethod)) {
$sMethod = self::$sDefaultMechanism;
}
/*
* check if passed name is an registered method
*/
if (array_search($sMethod, $this->aRegisteredMechanisms) === false) {
throw new Exception(... | php | public function create($sMethod = null) {
/*
* If no method passed, use default
*/
if (empty($sMethod)) {
$sMethod = self::$sDefaultMechanism;
}
/*
* check if passed name is an registered method
*/
if (array_search($sMethod, $this->aRegisteredMechanisms) === false) {
throw new Exception(... | [
"public",
"function",
"create",
"(",
"$",
"sMethod",
"=",
"null",
")",
"{",
"/*\n\t\t * If no method passed, use default\n\t\t */",
"if",
"(",
"empty",
"(",
"$",
"sMethod",
")",
")",
"{",
"$",
"sMethod",
"=",
"self",
"::",
"$",
"sDefaultMechanism",
";",
"}",
... | Create and return caching mechanism object according to passed name
@param string $sMethod
@return Apc,File,Memcached,Session,Variable
@throws Exception | [
"Create",
"and",
"return",
"caching",
"mechanism",
"object",
"according",
"to",
"passed",
"name"
] | faf3003795ab21913e7ebb02fb04d6a480b7786c | https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/PhpCache.php#L52-L84 |
197,282 | DzikuVx/phpCache | src/PhpCache.php | CacheKey.setModule | public function setModule($value) {
if (is_object($value)) {
$this->module = get_class($value);
}else {
$this->module = (string) $value;
}
} | php | public function setModule($value) {
if (is_object($value)) {
$this->module = get_class($value);
}else {
$this->module = (string) $value;
}
} | [
"public",
"function",
"setModule",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"module",
"=",
"get_class",
"(",
"$",
"value",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"module",
"... | Set module property
@param mixed $value | [
"Set",
"module",
"property"
] | faf3003795ab21913e7ebb02fb04d6a480b7786c | https://github.com/DzikuVx/phpCache/blob/faf3003795ab21913e7ebb02fb04d6a480b7786c/src/PhpCache.php#L133-L139 |
197,283 | aztech-digital/phinject | src/Config/AbstractConfig.php | AbstractConfig.compile | public function compile()
{
$this->doLoad();
$data = (array) $this->data;
$this->removeKey($data, 'include');
$this->removeKey($data, '__META__');
return var_export($data, true);
} | php | public function compile()
{
$this->doLoad();
$data = (array) $this->data;
$this->removeKey($data, 'include');
$this->removeKey($data, '__META__');
return var_export($data, true);
} | [
"public",
"function",
"compile",
"(",
")",
"{",
"$",
"this",
"->",
"doLoad",
"(",
")",
";",
"$",
"data",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"data",
";",
"$",
"this",
"->",
"removeKey",
"(",
"$",
"data",
",",
"'include'",
")",
";",
"$",
... | Compiles the current configuration to a valid PHP snippet.
@return string | [
"Compiles",
"the",
"current",
"configuration",
"to",
"a",
"valid",
"PHP",
"snippet",
"."
] | 1bb2fb3b5ef44e62f168af71134c613c48b58d95 | https://github.com/aztech-digital/phinject/blob/1bb2fb3b5ef44e62f168af71134c613c48b58d95/src/Config/AbstractConfig.php#L28-L38 |
197,284 | aztech-digital/phinject | src/Config/AbstractConfig.php | AbstractConfig.load | public function load()
{
if (empty($this->data)) {
$this->data = $this->doLoad();
}
return $this->data;
} | php | public function load()
{
if (empty($this->data)) {
$this->data = $this->doLoad();
}
return $this->data;
} | [
"public",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"this",
"->",
"doLoad",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"data",
";",
"}"
] | Loads and returns the configuration data.
@return ArrayResolver | [
"Loads",
"and",
"returns",
"the",
"configuration",
"data",
"."
] | 1bb2fb3b5ef44e62f168af71134c613c48b58d95 | https://github.com/aztech-digital/phinject/blob/1bb2fb3b5ef44e62f168af71134c613c48b58d95/src/Config/AbstractConfig.php#L58-L65 |
197,285 | agentmedia/phine-builtin | src/BuiltIn/Logic/Registration/Confirmer.php | Confirmer.CalcKey | private static function CalcKey(Member $member)
{
return sha1($member->GetPasswordSalt() . $member->GetConfirmed() . $member->GetName());
} | php | private static function CalcKey(Member $member)
{
return sha1($member->GetPasswordSalt() . $member->GetConfirmed() . $member->GetName());
} | [
"private",
"static",
"function",
"CalcKey",
"(",
"Member",
"$",
"member",
")",
"{",
"return",
"sha1",
"(",
"$",
"member",
"->",
"GetPasswordSalt",
"(",
")",
".",
"$",
"member",
"->",
"GetConfirmed",
"(",
")",
".",
"$",
"member",
"->",
"GetName",
"(",
"... | Returns the password key
@param Member $member
@return string Returns the calculated key for the member | [
"Returns",
"the",
"password",
"key"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Logic/Registration/Confirmer.php#L77-L80 |
197,286 | Wedeto/DB | src/Query/Parameters.php | Parameters.assign | public function assign($value, int $type = PDO::PARAM_STR)
{
$key = $this->getNextKey();
$this->params[$key] = $value;
$this->param_types[$key] = $type;
return $key;
} | php | public function assign($value, int $type = PDO::PARAM_STR)
{
$key = $this->getNextKey();
$this->params[$key] = $value;
$this->param_types[$key] = $type;
return $key;
} | [
"public",
"function",
"assign",
"(",
"$",
"value",
",",
"int",
"$",
"type",
"=",
"PDO",
"::",
"PARAM_STR",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getNextKey",
"(",
")",
";",
"$",
"this",
"->",
"params",
"[",
"$",
"key",
"]",
"=",
"$",
"... | Set a value for the next parameters in the query
@param mixed $value The value to set
@param int $type The parameter type, one of PDO::PARAM_*
@return string The assigned key | [
"Set",
"a",
"value",
"for",
"the",
"next",
"parameters",
"in",
"the",
"query"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L77-L83 |
197,287 | Wedeto/DB | src/Query/Parameters.php | Parameters.getParameterType | public function getParameterType(string $key)
{
if (!array_key_exists($key, $this->params))
throw new OutOfRangeException("Invalid key: $key");
return $this->param_types[$key];
} | php | public function getParameterType(string $key)
{
if (!array_key_exists($key, $this->params))
throw new OutOfRangeException("Invalid key: $key");
return $this->param_types[$key];
} | [
"public",
"function",
"getParameterType",
"(",
"string",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"params",
")",
")",
"throw",
"new",
"OutOfRangeException",
"(",
"\"Invalid key: $key\"",
")",
";",
"... | Get the type of parameter the key is set to
@param string $key The key to get the parameter type for
@return int The parameter type, one of PDO::PARAM_* | [
"Get",
"the",
"type",
"of",
"parameter",
"the",
"key",
"is",
"set",
"to"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L102-L108 |
197,288 | Wedeto/DB | src/Query/Parameters.php | Parameters.set | public function set(string $key, $value, int $type = PDO::PARAM_STR)
{
$this->params[$key] = $value;
$this->param_types[$key] = $type;
return $this;
} | php | public function set(string $key, $value, int $type = PDO::PARAM_STR)
{
$this->params[$key] = $value;
$this->param_types[$key] = $type;
return $this;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"$",
"value",
",",
"int",
"$",
"type",
"=",
"PDO",
"::",
"PARAM_STR",
")",
"{",
"$",
"this",
"->",
"params",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"param_type... | Set the value for an existing parameters.
@param string $key The key to set
@param mixed $value The value to set it to
@param int $type The parameter type, one of PDO::PARAM_* | [
"Set",
"the",
"value",
"for",
"an",
"existing",
"parameters",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L116-L121 |
197,289 | Wedeto/DB | src/Query/Parameters.php | Parameters.registerTable | public function registerTable($name, $alias)
{
if (!empty($alias) && empty($name))
return;
if (!empty($alias) && !empty($this->parent_scope))
{
$table = $this->parent_scope->resolveAlias($alias);
if (!empty($table))
throw new QueryExcepti... | php | public function registerTable($name, $alias)
{
if (!empty($alias) && empty($name))
return;
if (!empty($alias) && !empty($this->parent_scope))
{
$table = $this->parent_scope->resolveAlias($alias);
if (!empty($table))
throw new QueryExcepti... | [
"public",
"function",
"registerTable",
"(",
"$",
"name",
",",
"$",
"alias",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"alias",
")",
"&&",
"empty",
"(",
"$",
"name",
")",
")",
"return",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"alias",
")",
"&... | Register a table used in the query
@param string $name The name of the table
@param string $alias The alias for the table
@return $this Provides fluent interface | [
"Register",
"a",
"table",
"used",
"in",
"the",
"query"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L172-L208 |
197,290 | Wedeto/DB | src/Query/Parameters.php | Parameters.resolveAlias | public function resolveAlias(string $alias)
{
if (isset($this->aliases[$alias]))
return $this->aliases[$alias];
if (empty($this->parent_scope))
return null;
return $this->parent_scope->resolveAlias($alias);
} | php | public function resolveAlias(string $alias)
{
if (isset($this->aliases[$alias]))
return $this->aliases[$alias];
if (empty($this->parent_scope))
return null;
return $this->parent_scope->resolveAlias($alias);
} | [
"public",
"function",
"resolveAlias",
"(",
"string",
"$",
"alias",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
")",
")",
"return",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
";",
"if",
"(",
... | Find a table by its alias
@param string $alias The alias to find
@return TableClause The table the alias refers to - can be from an outer scope | [
"Find",
"a",
"table",
"by",
"its",
"alias"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L215-L224 |
197,291 | Wedeto/DB | src/Query/Parameters.php | Parameters.resolveTable | public function resolveTable(string $name)
{
if (!empty($name) && is_string($name))
{
if (isset($this->aliases[$name]))
return array($this->aliases[$name], $name);
if (isset($this->tables[$name]))
{
if (count($this->tables[$name]) ... | php | public function resolveTable(string $name)
{
if (!empty($name) && is_string($name))
{
if (isset($this->aliases[$name]))
return array($this->aliases[$name], $name);
if (isset($this->tables[$name]))
{
if (count($this->tables[$name]) ... | [
"public",
"function",
"resolveTable",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"name",
")",
"&&",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"name... | Find a table by its name
@param string $name The name of the table
@return TableClause The table searched for - can be from an outer scope | [
"Find",
"a",
"table",
"by",
"its",
"name"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L231-L252 |
197,292 | Wedeto/DB | src/Query/Parameters.php | Parameters.bindParameters | public function bindParameters(\PDOStatement $statement)
{
foreach (array_keys($this->params) as $key)
{
$type = $this->param_types[$key];
$statement->bindParam($key, $this->params[$key], $type);
}
return $this;
} | php | public function bindParameters(\PDOStatement $statement)
{
foreach (array_keys($this->params) as $key)
{
$type = $this->param_types[$key];
$statement->bindParam($key, $this->params[$key], $type);
}
return $this;
} | [
"public",
"function",
"bindParameters",
"(",
"\\",
"PDOStatement",
"$",
"statement",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"params",
")",
"as",
"$",
"key",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"param_types",
"[",
"$"... | Bind the paramters to a PDOStatement
@param PDOStatement $statement The statement to bind to
@return $this Provides fluent interface | [
"Bind",
"the",
"paramters",
"to",
"a",
"PDOStatement"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L348-L356 |
197,293 | Wedeto/DB | src/Query/Parameters.php | Parameters.generateAlias | public function generateAlias(Clause $clause)
{
if ($clause instanceof FieldName)
{
$table = $clause->getTable();
if (empty($table))
{
// When no table is defined, it means only one table is being
// used in the query. Aliases will ... | php | public function generateAlias(Clause $clause)
{
if ($clause instanceof FieldName)
{
$table = $clause->getTable();
if (empty($table))
{
// When no table is defined, it means only one table is being
// used in the query. Aliases will ... | [
"public",
"function",
"generateAlias",
"(",
"Clause",
"$",
"clause",
")",
"{",
"if",
"(",
"$",
"clause",
"instanceof",
"FieldName",
")",
"{",
"$",
"table",
"=",
"$",
"clause",
"->",
"getTable",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"table",
")... | Generate an alias for a table
@param Clause $clause The field or sub query to refer to
@return string The alias for the table | [
"Generate",
"an",
"alias",
"for",
"a",
"table"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L363-L393 |
197,294 | Wedeto/DB | src/Query/Parameters.php | Parameters.getSubScope | public function getSubScope(int $num = null)
{
// Resolve an existing scope
if ($num !== null)
{
if (!isset($this->scopes[$num]))
throw new QueryException("Invalid scope number: $num");
return $this->scopes[$num];
}
$scope = new Parame... | php | public function getSubScope(int $num = null)
{
// Resolve an existing scope
if ($num !== null)
{
if (!isset($this->scopes[$num]))
throw new QueryException("Invalid scope number: $num");
return $this->scopes[$num];
}
$scope = new Parame... | [
"public",
"function",
"getSubScope",
"(",
"int",
"$",
"num",
"=",
"null",
")",
"{",
"// Resolve an existing scope",
"if",
"(",
"$",
"num",
"!==",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"scopes",
"[",
"$",
"num",
"]",
")",
... | Create a sub scope for a nester query
@param int $num The scope level
@return Parameters A nested parameters object | [
"Create",
"a",
"sub",
"scope",
"for",
"a",
"nester",
"query"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Parameters.php#L401-L430 |
197,295 | praxigento/mobi_mod_pv | Helper/PvProvider.php | PvProvider.loadPvForQuote | private function loadPvForQuote($quoteId)
{
if (!isset($this->cachePvQuote[$quoteId])) {
$found = $this->daoPvQuote->getById((int)$quoteId);
$this->cachePvQuote[$quoteId] = $found;
}
return $this->cachePvQuote[$quoteId];
} | php | private function loadPvForQuote($quoteId)
{
if (!isset($this->cachePvQuote[$quoteId])) {
$found = $this->daoPvQuote->getById((int)$quoteId);
$this->cachePvQuote[$quoteId] = $found;
}
return $this->cachePvQuote[$quoteId];
} | [
"private",
"function",
"loadPvForQuote",
"(",
"$",
"quoteId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cachePvQuote",
"[",
"$",
"quoteId",
"]",
")",
")",
"{",
"$",
"found",
"=",
"$",
"this",
"->",
"daoPvQuote",
"->",
"getById",
"("... | Cacheable loader for quote's PV.
@param int $quoteId
@return \Praxigento\Pv\Repo\Data\Quote | [
"Cacheable",
"loader",
"for",
"quote",
"s",
"PV",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Helper/PvProvider.php#L123-L130 |
197,296 | praxigento/mobi_mod_pv | Helper/PvProvider.php | PvProvider.loadPvForQuoteItem | private function loadPvForQuoteItem($itemId)
{
if (!isset($this->cachePvQuoteItem[$itemId])) {
$found = $this->daoPvQuoteItem->getById((int)$itemId);
$this->cachePvQuoteItem[$itemId] = $found;
}
return $this->cachePvQuoteItem[$itemId];
} | php | private function loadPvForQuoteItem($itemId)
{
if (!isset($this->cachePvQuoteItem[$itemId])) {
$found = $this->daoPvQuoteItem->getById((int)$itemId);
$this->cachePvQuoteItem[$itemId] = $found;
}
return $this->cachePvQuoteItem[$itemId];
} | [
"private",
"function",
"loadPvForQuoteItem",
"(",
"$",
"itemId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cachePvQuoteItem",
"[",
"$",
"itemId",
"]",
")",
")",
"{",
"$",
"found",
"=",
"$",
"this",
"->",
"daoPvQuoteItem",
"->",
"getBy... | Cacheable loader for quote item's PV.
@param int $itemId
@return \Praxigento\Pv\Repo\Data\Quote\Item | [
"Cacheable",
"loader",
"for",
"quote",
"item",
"s",
"PV",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Helper/PvProvider.php#L138-L145 |
197,297 | dmitrya2e/filtration-bundle | Filter/Collection/BaseCollection.php | BaseCollection.remove | protected function remove($filterOrName)
{
$name = $this->getNameByFilter($filterOrName);
if ($this->has($name)) {
unset($this->collection[$name]);
return true;
}
return false;
} | php | protected function remove($filterOrName)
{
$name = $this->getNameByFilter($filterOrName);
if ($this->has($name)) {
unset($this->collection[$name]);
return true;
}
return false;
} | [
"protected",
"function",
"remove",
"(",
"$",
"filterOrName",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getNameByFilter",
"(",
"$",
"filterOrName",
")",
";",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"unset",
"(",
"... | Removes a filter from the collection.
@param string|FilterInterface $filterOrName
@return bool True on success, false on failure (if the filter is not found in the collection) | [
"Removes",
"a",
"filter",
"from",
"the",
"collection",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Collection/BaseCollection.php#L91-L102 |
197,298 | phpguard/listen | src/PhpGuard/Listen/Util/PathUtil.php | PathUtil.createSplFileInfo | static public function createSplFileInfo($baseDir, $path)
{
$absPath = realpath($path);
$baseDirLen = strlen($baseDir);
if($baseDir === substr($absPath,0,$baseDirLen)){
$subPathName = ltrim(substr($absPath,$baseDirLen),'\\/');
$dir = dirname($subPathName);
... | php | static public function createSplFileInfo($baseDir, $path)
{
$absPath = realpath($path);
$baseDirLen = strlen($baseDir);
if($baseDir === substr($absPath,0,$baseDirLen)){
$subPathName = ltrim(substr($absPath,$baseDirLen),'\\/');
$dir = dirname($subPathName);
... | [
"static",
"public",
"function",
"createSplFileInfo",
"(",
"$",
"baseDir",
",",
"$",
"path",
")",
"{",
"$",
"absPath",
"=",
"realpath",
"(",
"$",
"path",
")",
";",
"$",
"baseDirLen",
"=",
"strlen",
"(",
"$",
"baseDir",
")",
";",
"if",
"(",
"$",
"baseD... | Generate SplFileInfo from base dir
@param string $baseDir Base dir for path
@param string $path A file/directory name
@return SplFileInfo | [
"Generate",
"SplFileInfo",
"from",
"base",
"dir"
] | cd0cda150858d6d85deb025a72996873d2af3532 | https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Util/PathUtil.php#L29-L43 |
197,299 | miguelibero/meinhof | src/Meinhof/Config/Loader/TemplateMatterLoader.php | TemplateMatterLoader.loadStorage | protected function loadStorage($resource)
{
$template = $this->parser->parse($resource);
$key = $template->getLogicalName();
if (isset($this->cache[$key])) {
return $this->cache[$key];
}
$storage = $this->template_loader->load($template);
if (!$storage i... | php | protected function loadStorage($resource)
{
$template = $this->parser->parse($resource);
$key = $template->getLogicalName();
if (isset($this->cache[$key])) {
return $this->cache[$key];
}
$storage = $this->template_loader->load($template);
if (!$storage i... | [
"protected",
"function",
"loadStorage",
"(",
"$",
"resource",
")",
"{",
"$",
"template",
"=",
"$",
"this",
"->",
"parser",
"->",
"parse",
"(",
"$",
"resource",
")",
";",
"$",
"key",
"=",
"$",
"template",
"->",
"getLogicalName",
"(",
")",
";",
"if",
"... | Loads a resource from the template loader
@param string $resource the name of the resource to load
@throws \RuntimeException if the template loader does not return a MatterStorage | [
"Loads",
"a",
"resource",
"from",
"the",
"template",
"loader"
] | 3a090f08485dc0da3e27463cf349dba374201072 | https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Config/Loader/TemplateMatterLoader.php#L83-L98 |
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.