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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,800 | consigliere/components | src/Traits/MigrationLoaderTrait.php | MigrationLoaderTrait.loadMigrationFiles | protected function loadMigrationFiles($component)
{
$path = $this->laravel['components']->getComponentPath($component) . $this->getMigrationGeneratorPath();
$files = $this->laravel['files']->glob($path . '/*_*.php');
foreach ($files as $file) {
$this->laravel['files']->requireO... | php | protected function loadMigrationFiles($component)
{
$path = $this->laravel['components']->getComponentPath($component) . $this->getMigrationGeneratorPath();
$files = $this->laravel['files']->glob($path . '/*_*.php');
foreach ($files as $file) {
$this->laravel['files']->requireO... | [
"protected",
"function",
"loadMigrationFiles",
"(",
"$",
"component",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'components'",
"]",
"->",
"getComponentPath",
"(",
"$",
"component",
")",
".",
"$",
"this",
"->",
"getMigrationGeneratorPath",... | Include all migrations files from the specified component.
@param string $component | [
"Include",
"all",
"migrations",
"files",
"from",
"the",
"specified",
"component",
"."
] | 9b08bb111f0b55b0a860ed9c3407eda0d9cc1252 | https://github.com/consigliere/components/blob/9b08bb111f0b55b0a860ed9c3407eda0d9cc1252/src/Traits/MigrationLoaderTrait.php#L12-L21 |
12,801 | lasselehtinen/schilling-soap-wrapper | src/SchillingSoapWrapper.php | SchillingSoapWrapper.request | public function request($class, $service, $method, $arguments = [])
{
// Get WSDL URL
$wsdl = $this->getWsdlUri($class);
// Init SOAP client
$this->client = new SoapClient($wsdl, [
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'trace' => true,
... | php | public function request($class, $service, $method, $arguments = [])
{
// Get WSDL URL
$wsdl = $this->getWsdlUri($class);
// Init SOAP client
$this->client = new SoapClient($wsdl, [
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'trace' => true,
... | [
"public",
"function",
"request",
"(",
"$",
"class",
",",
"$",
"service",
",",
"$",
"method",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"// Get WSDL URL\r",
"$",
"wsdl",
"=",
"$",
"this",
"->",
"getWsdlUri",
"(",
"$",
"class",
")",
";",
"// Init... | Forms and send a Web Service request to Schilling.
@param string $class
@param string $service
@param string $method
@param array $arguments
@return array | [
"Forms",
"and",
"send",
"a",
"Web",
"Service",
"request",
"to",
"Schilling",
"."
] | 537a62a1c7e3c0910783a6b4a1da104134347f01 | https://github.com/lasselehtinen/schilling-soap-wrapper/blob/537a62a1c7e3c0910783a6b4a1da104134347f01/src/SchillingSoapWrapper.php#L45-L73 |
12,802 | lasselehtinen/schilling-soap-wrapper | src/SchillingSoapWrapper.php | SchillingSoapWrapper.addAuthHeader | public function addAuthHeader($arguments)
{
$authentication = [
'Username' => $this->username,
'Password' => $this->password,
'Company' => $this->company,
];
$query = array_merge($authentication, $arguments);
return $query;
} | php | public function addAuthHeader($arguments)
{
$authentication = [
'Username' => $this->username,
'Password' => $this->password,
'Company' => $this->company,
];
$query = array_merge($authentication, $arguments);
return $query;
} | [
"public",
"function",
"addAuthHeader",
"(",
"$",
"arguments",
")",
"{",
"$",
"authentication",
"=",
"[",
"'Username'",
"=>",
"$",
"this",
"->",
"username",
",",
"'Password'",
"=>",
"$",
"this",
"->",
"password",
",",
"'Company'",
"=>",
"$",
"this",
"->",
... | Adds authentication information to the Web Service query.
@param array $arguments | [
"Adds",
"authentication",
"information",
"to",
"the",
"Web",
"Service",
"query",
"."
] | 537a62a1c7e3c0910783a6b4a1da104134347f01 | https://github.com/lasselehtinen/schilling-soap-wrapper/blob/537a62a1c7e3c0910783a6b4a1da104134347f01/src/SchillingSoapWrapper.php#L80-L91 |
12,803 | gubler/collection | src/Collection.php | Collection.firstWhere | public function firstWhere($key, $operator, $value = null)
{
return $this->first($this->operatorForWhere(...\func_get_args()));
} | php | public function firstWhere($key, $operator, $value = null)
{
return $this->first($this->operatorForWhere(...\func_get_args()));
} | [
"public",
"function",
"firstWhere",
"(",
"$",
"key",
",",
"$",
"operator",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"first",
"(",
"$",
"this",
"->",
"operatorForWhere",
"(",
"...",
"\\",
"func_get_args",
"(",
")",
")",
"... | Get the first item by the given key value pair.
@param string $key
@param mixed $operator
@param mixed $value
@return static | [
"Get",
"the",
"first",
"item",
"by",
"the",
"given",
"key",
"value",
"pair",
"."
] | 8af2e0478f78b0fe0fbac7437f3f94f01de307b8 | https://github.com/gubler/collection/blob/8af2e0478f78b0fe0fbac7437f3f94f01de307b8/src/Collection.php#L695-L698 |
12,804 | Dhii/data-container-base | src/CreateNotFoundExceptionCapableTrait.php | CreateNotFoundExceptionCapableTrait._createNotFoundException | protected function _createNotFoundException(
$message = null,
$code = null,
RootException $previous = null,
BaseContainerInterface $container = null,
$dataKey = null
) {
return new NotFoundException($message, $code, $previous, $container, $dataKey);
} | php | protected function _createNotFoundException(
$message = null,
$code = null,
RootException $previous = null,
BaseContainerInterface $container = null,
$dataKey = null
) {
return new NotFoundException($message, $code, $previous, $container, $dataKey);
} | [
"protected",
"function",
"_createNotFoundException",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"code",
"=",
"null",
",",
"RootException",
"$",
"previous",
"=",
"null",
",",
"BaseContainerInterface",
"$",
"container",
"=",
"null",
",",
"$",
"dataKey",
"=",
... | Creates a new not found exception.
@param string|Stringable|null $message The exception message, if any.
@param int|string|Stringable|null $code The numeric exception code, if any.
@param RootException|null $previous The inner exception, if any.
@param BaseContainerInterface|null $container The ... | [
"Creates",
"a",
"new",
"not",
"found",
"exception",
"."
] | ed3289171827cdc910d74c5ef76aab5f5985dace | https://github.com/Dhii/data-container-base/blob/ed3289171827cdc910d74c5ef76aab5f5985dace/src/CreateNotFoundExceptionCapableTrait.php#L25-L33 |
12,805 | unyx/diagnostics | debug/Condition.php | Condition.matches | public function matches(\Exception $exception, Handler $handler) : bool
{
return $this->matcher ? call_user_func($this->matcher, $exception, $handler) : false;
} | php | public function matches(\Exception $exception, Handler $handler) : bool
{
return $this->matcher ? call_user_func($this->matcher, $exception, $handler) : false;
} | [
"public",
"function",
"matches",
"(",
"\\",
"Exception",
"$",
"exception",
",",
"Handler",
"$",
"handler",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"matcher",
"?",
"call_user_func",
"(",
"$",
"this",
"->",
"matcher",
",",
"$",
"exception",
","... | Executes code in order to check whether this Condition matches the given Exception.
Note: Not declared abstract because a callable may be given at runtime to be executed (either using the
constructor or the respective setter), but you may want to simply override this for complex Conditions and
store your Condition as ... | [
"Executes",
"code",
"in",
"order",
"to",
"check",
"whether",
"this",
"Condition",
"matches",
"the",
"given",
"Exception",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/Condition.php#L67-L70 |
12,806 | unyx/diagnostics | debug/Condition.php | Condition.onMatch | public function onMatch(\Exception $exception, Handler $handler)
{
return $this->onMatch ? call_user_func($this->onMatch, $exception, $handler) : null;
} | php | public function onMatch(\Exception $exception, Handler $handler)
{
return $this->onMatch ? call_user_func($this->onMatch, $exception, $handler) : null;
} | [
"public",
"function",
"onMatch",
"(",
"\\",
"Exception",
"$",
"exception",
",",
"Handler",
"$",
"handler",
")",
"{",
"return",
"$",
"this",
"->",
"onMatch",
"?",
"call_user_func",
"(",
"$",
"this",
"->",
"onMatch",
",",
"$",
"exception",
",",
"$",
"handl... | Executes code that applies when this Condition is met.
Note: Not declared abstract because a callable may be given at runtime to be executed (either using the
constructor or the respective setter), but you may want to simply override this for complex Conditions and
store your Condition as a separate class to keep your... | [
"Executes",
"code",
"that",
"applies",
"when",
"this",
"Condition",
"is",
"met",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/Condition.php#L96-L99 |
12,807 | swoopaholic/Components | Table/Table.php | Table.normToView | private function normToView($value)
{
// Scalar values should be converted to strings to
// facilitate differentiation between empty ("") and zero (0).
// Only do this for simple forms, as the resulting value in
// compound forms is passed to the data mapper and thus should
... | php | private function normToView($value)
{
// Scalar values should be converted to strings to
// facilitate differentiation between empty ("") and zero (0).
// Only do this for simple forms, as the resulting value in
// compound forms is passed to the data mapper and thus should
... | [
"private",
"function",
"normToView",
"(",
"$",
"value",
")",
"{",
"// Scalar values should be converted to strings to",
"// facilitate differentiation between empty (\"\") and zero (0).",
"// Only do this for simple forms, as the resulting value in",
"// compound forms is passed to the data m... | Transforms the value if a value transformer is set.
@param mixed $value The value to transform
@return mixed | [
"Transforms",
"the",
"value",
"if",
"a",
"value",
"transformer",
"is",
"set",
"."
] | a665248a4d3285dea936579a763b5a7ecfe62c4a | https://github.com/swoopaholic/Components/blob/a665248a4d3285dea936579a763b5a7ecfe62c4a/Table/Table.php#L389-L405 |
12,808 | adrenth/tvrage | lib/Adrenth/Tvrage/Show.php | Show.addGenre | public function addGenre($genre)
{
if (is_null($genre)) {
throw new \InvalidArgumentException('Genre cannot be null');
}
if (!is_string($genre)) {
throw new \InvalidArgumentException('Genre must be string');
}
if (!in_array($genre, $this->genres)) {
... | php | public function addGenre($genre)
{
if (is_null($genre)) {
throw new \InvalidArgumentException('Genre cannot be null');
}
if (!is_string($genre)) {
throw new \InvalidArgumentException('Genre must be string');
}
if (!in_array($genre, $this->genres)) {
... | [
"public",
"function",
"addGenre",
"(",
"$",
"genre",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"genre",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Genre cannot be null'",
")",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
... | Add a genre
@param string $genre Genre
@return $this
@throws \InvalidArgumentException | [
"Add",
"a",
"genre"
] | 291043219e95689f609323f476a25293a53453b0 | https://github.com/adrenth/tvrage/blob/291043219e95689f609323f476a25293a53453b0/lib/Adrenth/Tvrage/Show.php#L297-L312 |
12,809 | rozaverta/cmf | core/Database/Schema/Column.php | Column.set | public function set( string $name, $value )
{
if( $name === "default" )
{
if( is_scalar($value) )
$this->default = $value;
}
else if( $name !== "name" && isset($this->{$name}) && gettype($this->{$name}) === gettype($value) )
{
$this->{$name} = $value;
}
return $this;
} | php | public function set( string $name, $value )
{
if( $name === "default" )
{
if( is_scalar($value) )
$this->default = $value;
}
else if( $name !== "name" && isset($this->{$name}) && gettype($this->{$name}) === gettype($value) )
{
$this->{$name} = $value;
}
return $this;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"\"default\"",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"value",
")",
")",
"$",
"this",
"->",
"default",
"=",
"$",
"value",
";... | Update column value
@param string $name
@param $value
@return $this | [
"Update",
"column",
"value"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Database/Schema/Column.php#L101-L113 |
12,810 | ojhaujjwal/UserRbac | src/Factory/UserRoleLinkerMapperFactory.php | UserRoleLinkerMapperFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$mapper = new UserRoleLinkerMapper;
$options = $serviceLocator->get('UserRbac\ModuleOptions');
$class = $options->getUserRoleLinkerEntityClass();
$mapper->setEntityPrototype(new $class);
$mapper->setDbAd... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$mapper = new UserRoleLinkerMapper;
$options = $serviceLocator->get('UserRbac\ModuleOptions');
$class = $options->getUserRoleLinkerEntityClass();
$mapper->setEntityPrototype(new $class);
$mapper->setDbAd... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"mapper",
"=",
"new",
"UserRoleLinkerMapper",
";",
"$",
"options",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'UserRbac\\ModuleOptions'",
")",
";",
"$"... | Gets user role linker
@param ServiceLocatorInterface $serviceLocator
@return UserRoleLinkerMapper | [
"Gets",
"user",
"role",
"linker"
] | ebe1cdbcbc9956af5a3a90d9c4c0fc7c8cd4c5fe | https://github.com/ojhaujjwal/UserRbac/blob/ebe1cdbcbc9956af5a3a90d9c4c0fc7c8cd4c5fe/src/Factory/UserRoleLinkerMapperFactory.php#L16-L26 |
12,811 | cobonto/module | src/Classes/Hook.php | Hook.register | public static function register($hook, $id_module)
{
$Hook = self::isRegistered($hook);
if (!$Hook)
{
// first register hook in database
$Hook = new Hook();
$Hook->name = $hook;
if (!$Hook->save())
{
\Log::info($Hoo... | php | public static function register($hook, $id_module)
{
$Hook = self::isRegistered($hook);
if (!$Hook)
{
// first register hook in database
$Hook = new Hook();
$Hook->name = $hook;
if (!$Hook->save())
{
\Log::info($Hoo... | [
"public",
"static",
"function",
"register",
"(",
"$",
"hook",
",",
"$",
"id_module",
")",
"{",
"$",
"Hook",
"=",
"self",
"::",
"isRegistered",
"(",
"$",
"hook",
")",
";",
"if",
"(",
"!",
"$",
"Hook",
")",
"{",
"// first register hook in database",
"$",
... | register hook in system
@param $hook
@param $id_module
@return bool | [
"register",
"hook",
"in",
"system"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Hook.php#L24-L40 |
12,812 | cobonto/module | src/Classes/Hook.php | Hook.execute | public static function execute($hook, $params = array())
{
$html = '';
$modules = Hook::getModulesByName($hook);
if (!$modules || !is_array($modules) || !count($modules))
return $html;
else
{
foreach ($modules as $module)
{
... | php | public static function execute($hook, $params = array())
{
$html = '';
$modules = Hook::getModulesByName($hook);
if (!$modules || !is_array($modules) || !count($modules))
return $html;
else
{
foreach ($modules as $module)
{
... | [
"public",
"static",
"function",
"execute",
"(",
"$",
"hook",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"modules",
"=",
"Hook",
"::",
"getModulesByName",
"(",
"$",
"hook",
")",
";",
"if",
"(",
"!",
"$"... | execute hook and load module relation to that
@param $hook
@param array $params
@return string html or nothing | [
"execute",
"hook",
"and",
"load",
"module",
"relation",
"to",
"that"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Hook.php#L48-L72 |
12,813 | cobonto/module | src/Classes/Hook.php | Hook.getModulesByName | public static function getModulesByName($hook)
{
return \Cache::remember('hook'.$hook,100000,function() use($hook){
return \DB::table('modules AS m')->select('m.*','hm.position')
->leftJoin('hooks_modules AS hm', 'hm.id_module', '=', 'm.id')
->leftJoin('hooks AS ... | php | public static function getModulesByName($hook)
{
return \Cache::remember('hook'.$hook,100000,function() use($hook){
return \DB::table('modules AS m')->select('m.*','hm.position')
->leftJoin('hooks_modules AS hm', 'hm.id_module', '=', 'm.id')
->leftJoin('hooks AS ... | [
"public",
"static",
"function",
"getModulesByName",
"(",
"$",
"hook",
")",
"{",
"return",
"\\",
"Cache",
"::",
"remember",
"(",
"'hook'",
".",
"$",
"hook",
",",
"100000",
",",
"function",
"(",
")",
"use",
"(",
"$",
"hook",
")",
"{",
"return",
"\\",
"... | get modules by hook order by position asc
@param $hook
@return mixed | [
"get",
"modules",
"by",
"hook",
"order",
"by",
"position",
"asc"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Hook.php#L79-L90 |
12,814 | cobonto/module | src/Classes/Hook.php | Hook.getHighestPosition | public static function getHighestPosition($id_hook)
{
return (int)\DB::table('hooks_modules as hm')->
leftJoin('hooks as h', 'h.id', '=', 'hm.id_hook')->
where('h.id',$id_hook)->
orderBy('hm.position', 'DESC')->value('position');
} | php | public static function getHighestPosition($id_hook)
{
return (int)\DB::table('hooks_modules as hm')->
leftJoin('hooks as h', 'h.id', '=', 'hm.id_hook')->
where('h.id',$id_hook)->
orderBy('hm.position', 'DESC')->value('position');
} | [
"public",
"static",
"function",
"getHighestPosition",
"(",
"$",
"id_hook",
")",
"{",
"return",
"(",
"int",
")",
"\\",
"DB",
"::",
"table",
"(",
"'hooks_modules as hm'",
")",
"->",
"leftJoin",
"(",
"'hooks as h'",
",",
"'h.id'",
",",
"'='",
",",
"'hm.id_hook'... | get highest position of given hook
@param int $id_hook
@return int | [
"get",
"highest",
"position",
"of",
"given",
"hook"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Hook.php#L106-L112 |
12,815 | indigophp/common | src/Mimetypes.php | Mimetypes.fromExtension | public static function fromExtension($extension)
{
$extension = strtolower($extension);
return isset(static::$mimetypes[$extension])
? static::$mimetypes[$extension]
: null;
} | php | public static function fromExtension($extension)
{
$extension = strtolower($extension);
return isset(static::$mimetypes[$extension])
? static::$mimetypes[$extension]
: null;
} | [
"public",
"static",
"function",
"fromExtension",
"(",
"$",
"extension",
")",
"{",
"$",
"extension",
"=",
"strtolower",
"(",
"$",
"extension",
")",
";",
"return",
"isset",
"(",
"static",
"::",
"$",
"mimetypes",
"[",
"$",
"extension",
"]",
")",
"?",
"stati... | Get a mimetype value from a file extension
@param string $extension File extension
@return string|null | [
"Get",
"a",
"mimetype",
"value",
"from",
"a",
"file",
"extension"
] | dacf2c31409d8ac3cbcb8acd094a149ca5975394 | https://github.com/indigophp/common/blob/dacf2c31409d8ac3cbcb8acd094a149ca5975394/src/Mimetypes.php#L942-L949 |
12,816 | Silvestra/Silvestra | src/Silvestra/Bundle/MediaBundle/DependencyInjection/SilvestraMediaExtension.php | SilvestraMediaExtension.setFilesystemRootDir | private function setFilesystemRootDir($rootDir, ContainerBuilder $container)
{
$definition = $container->getDefinition($this->getAlias() . '.filesystem');
$definition->replaceArgument(0, $rootDir);
} | php | private function setFilesystemRootDir($rootDir, ContainerBuilder $container)
{
$definition = $container->getDefinition($this->getAlias() . '.filesystem');
$definition->replaceArgument(0, $rootDir);
} | [
"private",
"function",
"setFilesystemRootDir",
"(",
"$",
"rootDir",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"definition",
"=",
"$",
"container",
"->",
"getDefinition",
"(",
"$",
"this",
"->",
"getAlias",
"(",
")",
".",
"'.filesystem'",
")",
... | Set filesystem root dir.
@param string $rootDir
@param ContainerBuilder $container | [
"Set",
"filesystem",
"root",
"dir",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Bundle/MediaBundle/DependencyInjection/SilvestraMediaExtension.php#L75-L80 |
12,817 | Silvestra/Silvestra | src/Silvestra/Bundle/MediaBundle/DependencyInjection/SilvestraMediaExtension.php | SilvestraMediaExtension.setImageConfigs | private function setImageConfigs(array $configs, ContainerBuilder $container)
{
$definition = $container->getDefinition('silvestra_media.image.default_config');
$definition->addArgument($configs['available_mime_types']);
$definition->addArgument($configs['default_cropper_enabled']);
... | php | private function setImageConfigs(array $configs, ContainerBuilder $container)
{
$definition = $container->getDefinition('silvestra_media.image.default_config');
$definition->addArgument($configs['available_mime_types']);
$definition->addArgument($configs['default_cropper_enabled']);
... | [
"private",
"function",
"setImageConfigs",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"definition",
"=",
"$",
"container",
"->",
"getDefinition",
"(",
"'silvestra_media.image.default_config'",
")",
";",
"$",
"definition",
... | Set image configs.
@param array $configs
@param ContainerBuilder $container | [
"Set",
"image",
"configs",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Bundle/MediaBundle/DependencyInjection/SilvestraMediaExtension.php#L88-L100 |
12,818 | tonicforhealth/pagerduty-client | src/Client/EventClient.php | EventClient.post | public function post(PagerDutyEntityInterface $pagerDutyEntity)
{
$data = null;
try {
$response = $this->getHttpClient()->post(
$this->getResourceUrl($pagerDutyEntity),
$this->headers,
$this->getRepresentProcessor()->representJSON($pagerDu... | php | public function post(PagerDutyEntityInterface $pagerDutyEntity)
{
$data = null;
try {
$response = $this->getHttpClient()->post(
$this->getResourceUrl($pagerDutyEntity),
$this->headers,
$this->getRepresentProcessor()->representJSON($pagerDu... | [
"public",
"function",
"post",
"(",
"PagerDutyEntityInterface",
"$",
"pagerDutyEntity",
")",
"{",
"$",
"data",
"=",
"null",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getHttpClient",
"(",
")",
"->",
"post",
"(",
"$",
"this",
"->",
"getReso... | Make HTTP POST Request to the Event api.
@param PagerDutyEntityInterface $pagerDutyEntity
@return stdClass
@throws EventClientTransportException
@throws ResponseDataValidationException | [
"Make",
"HTTP",
"POST",
"Request",
"to",
"the",
"Event",
"api",
"."
] | 9a3c7ec96bb921542e45c69e4c6d828c1e7b54b9 | https://github.com/tonicforhealth/pagerduty-client/blob/9a3c7ec96bb921542e45c69e4c6d828c1e7b54b9/src/Client/EventClient.php#L28-L47 |
12,819 | tonicforhealth/pagerduty-client | src/Client/EventClient.php | EventClient.getResourceUrl | private function getResourceUrl(PagerDutyEntityInterface $pagerDutyEntity)
{
return sprintf(
'%s/%s',
$this->getApiRootUrl(),
$this->getRepresentProcessor()->getRESTResourcePath($pagerDutyEntity)
);
} | php | private function getResourceUrl(PagerDutyEntityInterface $pagerDutyEntity)
{
return sprintf(
'%s/%s',
$this->getApiRootUrl(),
$this->getRepresentProcessor()->getRESTResourcePath($pagerDutyEntity)
);
} | [
"private",
"function",
"getResourceUrl",
"(",
"PagerDutyEntityInterface",
"$",
"pagerDutyEntity",
")",
"{",
"return",
"sprintf",
"(",
"'%s/%s'",
",",
"$",
"this",
"->",
"getApiRootUrl",
"(",
")",
",",
"$",
"this",
"->",
"getRepresentProcessor",
"(",
")",
"->",
... | Get Full resource Url.
@param PagerDutyEntityInterface $pagerDutyEntity
@return string | [
"Get",
"Full",
"resource",
"Url",
"."
] | 9a3c7ec96bb921542e45c69e4c6d828c1e7b54b9 | https://github.com/tonicforhealth/pagerduty-client/blob/9a3c7ec96bb921542e45c69e4c6d828c1e7b54b9/src/Client/EventClient.php#L56-L63 |
12,820 | tonicforhealth/pagerduty-client | src/Client/EventClient.php | EventClient.performResponse | private function performResponse($response)
{
$data = false;
if ($response instanceof ResponseInterface) {
$data = json_decode($response->getBody()->getContents());
$this->getValidationResponse()->validateResponseData($data);
}
return $data;
} | php | private function performResponse($response)
{
$data = false;
if ($response instanceof ResponseInterface) {
$data = json_decode($response->getBody()->getContents());
$this->getValidationResponse()->validateResponseData($data);
}
return $data;
} | [
"private",
"function",
"performResponse",
"(",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"false",
";",
"if",
"(",
"$",
"response",
"instanceof",
"ResponseInterface",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"response",
"->",
"getBody",
"(",
... | Perform response and gets it date.
@param mixed $response
@return stdClass
@throws EventValidationResponseException | [
"Perform",
"response",
"and",
"gets",
"it",
"date",
"."
] | 9a3c7ec96bb921542e45c69e4c6d828c1e7b54b9 | https://github.com/tonicforhealth/pagerduty-client/blob/9a3c7ec96bb921542e45c69e4c6d828c1e7b54b9/src/Client/EventClient.php#L74-L83 |
12,821 | ZimTis/array-validation | src/Validator.php | Validator.addSchemaValidation | public function addSchemaValidation($schemaFile, $name = null)
{
$realName = $this->generateName($schemaFile, $name);
$realPath = getcwd() . DIRECTORY_SEPARATOR . $schemaFile;
if (file_exists($realPath)) {
if (!key_exists($realName, $this->schemaValidations)) {
... | php | public function addSchemaValidation($schemaFile, $name = null)
{
$realName = $this->generateName($schemaFile, $name);
$realPath = getcwd() . DIRECTORY_SEPARATOR . $schemaFile;
if (file_exists($realPath)) {
if (!key_exists($realName, $this->schemaValidations)) {
... | [
"public",
"function",
"addSchemaValidation",
"(",
"$",
"schemaFile",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"realName",
"=",
"$",
"this",
"->",
"generateName",
"(",
"$",
"schemaFile",
",",
"$",
"name",
")",
";",
"$",
"realPath",
"=",
"getcwd",
"... | This function adds a schema.json to this Validator.
If no name is supplied, it will use the name of the schema file.
If the Validator is not in developer mode, the Validator will loock for a serialised version of the schema file to save time for instanziating.
If in developer mode, the Validator will read the schema fi... | [
"This",
"function",
"adds",
"a",
"schema",
".",
"json",
"to",
"this",
"Validator",
".",
"If",
"no",
"name",
"is",
"supplied",
"it",
"will",
"use",
"the",
"name",
"of",
"the",
"schema",
"file",
".",
"If",
"the",
"Validator",
"is",
"not",
"in",
"develope... | e908e9598d806e7e5a8da5d46480137c474f93fb | https://github.com/ZimTis/array-validation/blob/e908e9598d806e7e5a8da5d46480137c474f93fb/src/Validator.php#L54-L84 |
12,822 | ZimTis/array-validation | src/Validator.php | Validator.addSchemaFromString | public function addSchemaFromString($string)
{
$json = json_decode($string, true);
if (is_null($json)) {
trigger_error('not a valid json');
}
return $this->createValidation($json);
} | php | public function addSchemaFromString($string)
{
$json = json_decode($string, true);
if (is_null($json)) {
trigger_error('not a valid json');
}
return $this->createValidation($json);
} | [
"public",
"function",
"addSchemaFromString",
"(",
"$",
"string",
")",
"{",
"$",
"json",
"=",
"json_decode",
"(",
"$",
"string",
",",
"true",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"json",
")",
")",
"{",
"trigger_error",
"(",
"'not a valid json'",
")",... | This method creates a Validation object from string
this validation will not get a name or will be stored inside the validator
@param string $string
@return NestedValidation | [
"This",
"method",
"creates",
"a",
"Validation",
"object",
"from",
"string",
"this",
"validation",
"will",
"not",
"get",
"a",
"name",
"or",
"will",
"be",
"stored",
"inside",
"the",
"validator"
] | e908e9598d806e7e5a8da5d46480137c474f93fb | https://github.com/ZimTis/array-validation/blob/e908e9598d806e7e5a8da5d46480137c474f93fb/src/Validator.php#L94-L102 |
12,823 | mooti/framework | src/Util/IdGenerator.php | IdGenerator.uuidV4 | public function uuidV4()
{
return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
mt_rand(0, 0xffff),
mt_rand(0, 0xffff),
// 16 bits for "time_mid"
mt_rand(0, 0xffff),
// 16 bits for "time_hi_and_v... | php | public function uuidV4()
{
return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
mt_rand(0, 0xffff),
mt_rand(0, 0xffff),
// 16 bits for "time_mid"
mt_rand(0, 0xffff),
// 16 bits for "time_hi_and_v... | [
"public",
"function",
"uuidV4",
"(",
")",
"{",
"return",
"sprintf",
"(",
"'%04x%04x-%04x-%04x-%04x-%04x%04x%04x'",
",",
"// 32 bits for \"time_low\"",
"mt_rand",
"(",
"0",
",",
"0xffff",
")",
",",
"mt_rand",
"(",
"0",
",",
"0xffff",
")",
",",
"// 16 bits for \"tim... | Generate a valid V4 UUID
@return string | [
"Generate",
"a",
"valid",
"V4",
"UUID"
] | 078da6699c5c6c7ac4e5a3d36751d645ad8aa93e | https://github.com/mooti/framework/blob/078da6699c5c6c7ac4e5a3d36751d645ad8aa93e/src/Util/IdGenerator.php#L18-L39 |
12,824 | phpgears/immutability | src/ImmutabilityBehaviour.php | ImmutabilityBehaviour.checkImmutability | final protected function checkImmutability(): void
{
$this->checkCallConstraints();
$class = static::class;
if (isset(static::$immutabilityCheckMap[$class])) {
return;
}
$this->checkPropertiesAccessibility();
$this->checkMethodsAccessibility();
... | php | final protected function checkImmutability(): void
{
$this->checkCallConstraints();
$class = static::class;
if (isset(static::$immutabilityCheckMap[$class])) {
return;
}
$this->checkPropertiesAccessibility();
$this->checkMethodsAccessibility();
... | [
"final",
"protected",
"function",
"checkImmutability",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"checkCallConstraints",
"(",
")",
";",
"$",
"class",
"=",
"static",
"::",
"class",
";",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"immutabilityCheckMa... | Check immutability.
@throws ImmutabilityViolationException | [
"Check",
"immutability",
"."
] | 5de141bb2fc71d375e2286f1dd24c1a24f2a6495 | https://github.com/phpgears/immutability/blob/5de141bb2fc71d375e2286f1dd24c1a24f2a6495/src/ImmutabilityBehaviour.php#L60-L74 |
12,825 | phpgears/immutability | src/ImmutabilityBehaviour.php | ImmutabilityBehaviour.checkPropertiesAccessibility | private function checkPropertiesAccessibility(): void
{
$publicProperties = (new \ReflectionObject($this))->getProperties(\ReflectionProperty::IS_PUBLIC);
if (\count($publicProperties) !== 0) {
throw new ImmutabilityViolationException(\sprintf(
'Class %s should not have p... | php | private function checkPropertiesAccessibility(): void
{
$publicProperties = (new \ReflectionObject($this))->getProperties(\ReflectionProperty::IS_PUBLIC);
if (\count($publicProperties) !== 0) {
throw new ImmutabilityViolationException(\sprintf(
'Class %s should not have p... | [
"private",
"function",
"checkPropertiesAccessibility",
"(",
")",
":",
"void",
"{",
"$",
"publicProperties",
"=",
"(",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"this",
")",
")",
"->",
"getProperties",
"(",
"\\",
"ReflectionProperty",
"::",
"IS_PUBLIC",
")",
"... | Check properties accessibility.
@throws ImmutabilityViolationException | [
"Check",
"properties",
"accessibility",
"."
] | 5de141bb2fc71d375e2286f1dd24c1a24f2a6495 | https://github.com/phpgears/immutability/blob/5de141bb2fc71d375e2286f1dd24c1a24f2a6495/src/ImmutabilityBehaviour.php#L111-L120 |
12,826 | phpgears/immutability | src/ImmutabilityBehaviour.php | ImmutabilityBehaviour.checkMethodsAccessibility | private function checkMethodsAccessibility(): void
{
$publicMethods = $this->getClassPublicMethods();
\sort($publicMethods);
$allowedPublicMethods = $this->getAllowedPublicMethods();
foreach (static::$allowedMagicMethods as $magicMethod) {
if (\array_search($magicMethod... | php | private function checkMethodsAccessibility(): void
{
$publicMethods = $this->getClassPublicMethods();
\sort($publicMethods);
$allowedPublicMethods = $this->getAllowedPublicMethods();
foreach (static::$allowedMagicMethods as $magicMethod) {
if (\array_search($magicMethod... | [
"private",
"function",
"checkMethodsAccessibility",
"(",
")",
":",
"void",
"{",
"$",
"publicMethods",
"=",
"$",
"this",
"->",
"getClassPublicMethods",
"(",
")",
";",
"\\",
"sort",
"(",
"$",
"publicMethods",
")",
";",
"$",
"allowedPublicMethods",
"=",
"$",
"t... | Check methods accessibility.
@throws ImmutabilityViolationException | [
"Check",
"methods",
"accessibility",
"."
] | 5de141bb2fc71d375e2286f1dd24c1a24f2a6495 | https://github.com/phpgears/immutability/blob/5de141bb2fc71d375e2286f1dd24c1a24f2a6495/src/ImmutabilityBehaviour.php#L127-L150 |
12,827 | phpgears/immutability | src/ImmutabilityBehaviour.php | ImmutabilityBehaviour.getClassPublicMethods | private function getClassPublicMethods(): array
{
return \array_filter(\array_map(
function (\ReflectionMethod $method): string {
return !$method->isStatic() ? $method->getName() : '';
},
(new \ReflectionObject($this))->getMethods(\ReflectionMethod::IS_PUB... | php | private function getClassPublicMethods(): array
{
return \array_filter(\array_map(
function (\ReflectionMethod $method): string {
return !$method->isStatic() ? $method->getName() : '';
},
(new \ReflectionObject($this))->getMethods(\ReflectionMethod::IS_PUB... | [
"private",
"function",
"getClassPublicMethods",
"(",
")",
":",
"array",
"{",
"return",
"\\",
"array_filter",
"(",
"\\",
"array_map",
"(",
"function",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
")",
":",
"string",
"{",
"return",
"!",
"$",
"method",
"->",
... | Get list of defined public methods.
@return string[] | [
"Get",
"list",
"of",
"defined",
"public",
"methods",
"."
] | 5de141bb2fc71d375e2286f1dd24c1a24f2a6495 | https://github.com/phpgears/immutability/blob/5de141bb2fc71d375e2286f1dd24c1a24f2a6495/src/ImmutabilityBehaviour.php#L157-L165 |
12,828 | phpgears/immutability | src/ImmutabilityBehaviour.php | ImmutabilityBehaviour.getAllowedPublicMethods | protected function getAllowedPublicMethods(): array
{
$allowedInterfaces = \array_unique(\array_merge($this->getAllowedInterfaces(), [ImmutabilityBehaviour::class]));
$allowedMethods = \array_merge(
...\array_map(
function (string $interface): array {
... | php | protected function getAllowedPublicMethods(): array
{
$allowedInterfaces = \array_unique(\array_merge($this->getAllowedInterfaces(), [ImmutabilityBehaviour::class]));
$allowedMethods = \array_merge(
...\array_map(
function (string $interface): array {
... | [
"protected",
"function",
"getAllowedPublicMethods",
"(",
")",
":",
"array",
"{",
"$",
"allowedInterfaces",
"=",
"\\",
"array_unique",
"(",
"\\",
"array_merge",
"(",
"$",
"this",
"->",
"getAllowedInterfaces",
"(",
")",
",",
"[",
"ImmutabilityBehaviour",
"::",
"cl... | Get list of allowed public methods.
@return string[] | [
"Get",
"list",
"of",
"allowed",
"public",
"methods",
"."
] | 5de141bb2fc71d375e2286f1dd24c1a24f2a6495 | https://github.com/phpgears/immutability/blob/5de141bb2fc71d375e2286f1dd24c1a24f2a6495/src/ImmutabilityBehaviour.php#L172-L190 |
12,829 | AnonymPHP/Anonym-Library | src/Anonym/Route/ControllerDispatcher.php | ControllerDispatcher.dispatch | public function dispatch()
{
$name = $this->generateClassName($this->namespace, $this->class);
// the controller instance
$controller = App::make($name);
if ($controller instanceof Controller) {
// register the parameters
$controller->runControllerWithPara... | php | public function dispatch()
{
$name = $this->generateClassName($this->namespace, $this->class);
// the controller instance
$controller = App::make($name);
if ($controller instanceof Controller) {
// register the parameters
$controller->runControllerWithPara... | [
"public",
"function",
"dispatch",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"generateClassName",
"(",
"$",
"this",
"->",
"namespace",
",",
"$",
"this",
"->",
"class",
")",
";",
"// the controller instance",
"$",
"controller",
"=",
"App",
"::",
... | dispatch the controller
@throws ControllerException
@return \Anonym\Route\Controller | [
"dispatch",
"the",
"controller"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Route/ControllerDispatcher.php#L50-L69 |
12,830 | marando/phpSOFA | src/Marando/IAU/iauUt1tai.php | iauUt1tai.Ut1tai | public static function Ut1tai($ut11, $ut12, $dta, &$tai1, &$tai2) {
$dtad;
/* Result, safeguarding precision. */
$dtad = $dta / DAYSEC;
if ($ut11 > $ut12) {
$tai1 = $ut11;
$tai2 = $ut12 - $dtad;
}
else {
$tai1 = $ut11 - $dtad;
$tai2 = $ut12;
}
/* Status (always ... | php | public static function Ut1tai($ut11, $ut12, $dta, &$tai1, &$tai2) {
$dtad;
/* Result, safeguarding precision. */
$dtad = $dta / DAYSEC;
if ($ut11 > $ut12) {
$tai1 = $ut11;
$tai2 = $ut12 - $dtad;
}
else {
$tai1 = $ut11 - $dtad;
$tai2 = $ut12;
}
/* Status (always ... | [
"public",
"static",
"function",
"Ut1tai",
"(",
"$",
"ut11",
",",
"$",
"ut12",
",",
"$",
"dta",
",",
"&",
"$",
"tai1",
",",
"&",
"$",
"tai2",
")",
"{",
"$",
"dtad",
";",
"/* Result, safeguarding precision. */",
"$",
"dtad",
"=",
"$",
"dta",
"/",
"DAYS... | - - - - - - - - - -
i a u U t 1 t a i
- - - - - - - - - -
Time scale transformation: Universal Time, UT1, to International
Atomic Time, TAI.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
ut11,ut12 double ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"U",
"t",
"1",
"t",
"a",
"i",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauUt1tai.php#L51-L67 |
12,831 | alescx/cakephp-utils | src/Model/Behavior/CacheableBehavior.php | CacheableBehavior.beforeFind | public function beforeFind(Model $model, $query)
{
if (Configure::read('Cache.disable') || !isset($query['cache'])) {
$this->_isCaching = false;
return true;
}
// Grab the cache key and expiration
$key = $query['cache'];
$expires = isset($q... | php | public function beforeFind(Model $model, $query)
{
if (Configure::read('Cache.disable') || !isset($query['cache'])) {
$this->_isCaching = false;
return true;
}
// Grab the cache key and expiration
$key = $query['cache'];
$expires = isset($q... | [
"public",
"function",
"beforeFind",
"(",
"Model",
"$",
"model",
",",
"$",
"query",
")",
"{",
"if",
"(",
"Configure",
"::",
"read",
"(",
"'Cache.disable'",
")",
"||",
"!",
"isset",
"(",
"$",
"query",
"[",
"'cache'",
"]",
")",
")",
"{",
"$",
"this",
... | Before a query is executed, look for the cache parameter.
If the cache param exists, generate a cache key and fetch the results from the cache.
If the result is empty or the cache doesn't exist, replace the current datasource
with a dummy shim datasource, allowing us to pull in cached results.
@param Model $model
@par... | [
"Before",
"a",
"query",
"is",
"executed",
"look",
"for",
"the",
"cache",
"parameter",
".",
"If",
"the",
"cache",
"param",
"exists",
"generate",
"a",
"cache",
"key",
"and",
"fetch",
"the",
"results",
"from",
"the",
"cache",
".",
"If",
"the",
"result",
"is... | 02562ad95e25dc3c3b6ef13cabd472a4c4722b69 | https://github.com/alescx/cakephp-utils/blob/02562ad95e25dc3c3b6ef13cabd472a4c4722b69/src/Model/Behavior/CacheableBehavior.php#L171-L236 |
12,832 | alescx/cakephp-utils | src/Model/Behavior/CacheableBehavior.php | CacheableBehavior.cacheKey | public function cacheKey(Model $model, $keys, $prefix = true)
{
// TranslateBehavior support
if (!empty($model->locale)) {
$keys = array_merge((array)$model->locale, (array)$keys);
}
if (is_array($keys)) {
$key = array_shift($keys);
i... | php | public function cacheKey(Model $model, $keys, $prefix = true)
{
// TranslateBehavior support
if (!empty($model->locale)) {
$keys = array_merge((array)$model->locale, (array)$keys);
}
if (is_array($keys)) {
$key = array_shift($keys);
i... | [
"public",
"function",
"cacheKey",
"(",
"Model",
"$",
"model",
",",
"$",
"keys",
",",
"$",
"prefix",
"=",
"true",
")",
"{",
"// TranslateBehavior support\r",
"if",
"(",
"!",
"empty",
"(",
"$",
"model",
"->",
"locale",
")",
")",
"{",
"$",
"keys",
"=",
... | Generate a cache key. The first index should be the method name, the other indices should be unique values.
@param Model $model
@param array|string $keys
@param bool $prefix
@return string | [
"Generate",
"a",
"cache",
"key",
".",
"The",
"first",
"index",
"should",
"be",
"the",
"method",
"name",
"the",
"other",
"indices",
"should",
"be",
"unique",
"values",
"."
] | 02562ad95e25dc3c3b6ef13cabd472a4c4722b69 | https://github.com/alescx/cakephp-utils/blob/02562ad95e25dc3c3b6ef13cabd472a4c4722b69/src/Model/Behavior/CacheableBehavior.php#L384-L416 |
12,833 | zugoripls/laravel-framework | src/Illuminate/Pagination/UrlWindow.php | UrlWindow.getUrlSlider | protected function getUrlSlider($onEachSide)
{
$window = $onEachSide * 2;
if ( ! $this->hasPages())
{
return [
'first' => null,
'slider' => null,
'last' => null,
];
}
// If the current page is very close to the beginning of the page range, we will
// just render the beginning of the ... | php | protected function getUrlSlider($onEachSide)
{
$window = $onEachSide * 2;
if ( ! $this->hasPages())
{
return [
'first' => null,
'slider' => null,
'last' => null,
];
}
// If the current page is very close to the beginning of the page range, we will
// just render the beginning of the ... | [
"protected",
"function",
"getUrlSlider",
"(",
"$",
"onEachSide",
")",
"{",
"$",
"window",
"=",
"$",
"onEachSide",
"*",
"2",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPages",
"(",
")",
")",
"{",
"return",
"[",
"'first'",
"=>",
"null",
",",
"'slider'... | Create a URL slider links.
@param int $onEachSide
@return array | [
"Create",
"a",
"URL",
"slider",
"links",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Pagination/UrlWindow.php#L73-L106 |
12,834 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.setFrom | public function setFrom(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setFrom($addresses);
return $this;
} | php | public function setFrom(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setFrom($addresses);
return $this;
} | [
"public",
"function",
"setFrom",
"(",
"array",
"$",
"addresses",
")",
":",
"Email",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformAddressesToArray",
"(",
"$",
"addresses",
")",
";",
"$",
"this",
"->",
"message",
"->",
"setFrom",
"(",
"$",
"add... | Set the From addresses.
@param Address[] $addresses
@return self | [
"Set",
"the",
"From",
"addresses",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L47-L53 |
12,835 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.setReplyTo | public function setReplyTo(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setReplyTo($addresses);
return $this;
} | php | public function setReplyTo(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setReplyTo($addresses);
return $this;
} | [
"public",
"function",
"setReplyTo",
"(",
"array",
"$",
"addresses",
")",
":",
"Email",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformAddressesToArray",
"(",
"$",
"addresses",
")",
";",
"$",
"this",
"->",
"message",
"->",
"setReplyTo",
"(",
"$",
... | Set the Reply-To addresses.
Any replies from the receiver will be sent to this address.
@param Address[] $addresses
@return self | [
"Set",
"the",
"Reply",
"-",
"To",
"addresses",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L76-L82 |
12,836 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.setTo | public function setTo(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setTo($addresses);
return $this;
} | php | public function setTo(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setTo($addresses);
return $this;
} | [
"public",
"function",
"setTo",
"(",
"array",
"$",
"addresses",
")",
":",
"Email",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformAddressesToArray",
"(",
"$",
"addresses",
")",
";",
"$",
"this",
"->",
"message",
"->",
"setTo",
"(",
"$",
"address... | Set the To addresses.
Recipients set in this field will receive a copy of this message.
@param Address[] $addresses
@return self | [
"Set",
"the",
"To",
"addresses",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L105-L111 |
12,837 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.setCc | public function setCc(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setCc($addresses);
return $this;
} | php | public function setCc(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setCc($addresses);
return $this;
} | [
"public",
"function",
"setCc",
"(",
"array",
"$",
"addresses",
")",
":",
"Email",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformAddressesToArray",
"(",
"$",
"addresses",
")",
";",
"$",
"this",
"->",
"message",
"->",
"setCc",
"(",
"$",
"address... | Set the Cc addresses.
Recipients set in this field will receive a 'carbon-copy' of this message.
@param Address[] $addresses
@return self | [
"Set",
"the",
"Cc",
"addresses",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L134-L140 |
12,838 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.setBcc | public function setBcc(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setBcc($addresses);
return $this;
} | php | public function setBcc(array $addresses): Email
{
$addresses = $this->transformAddressesToArray($addresses);
$this->message->setBcc($addresses);
return $this;
} | [
"public",
"function",
"setBcc",
"(",
"array",
"$",
"addresses",
")",
":",
"Email",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformAddressesToArray",
"(",
"$",
"addresses",
")",
";",
"$",
"this",
"->",
"message",
"->",
"setBcc",
"(",
"$",
"addre... | Set the Bcc addresses.
Recipients set in this field will receive a 'blind-carbon-copy' of this message.
@param Address[] $addresses
@return self | [
"Set",
"the",
"Bcc",
"addresses",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L163-L169 |
12,839 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.getSender | public function getSender()
{
$addresses = $this->transformArrayToAddresses($this->message->getSender());
if ($address = reset($addresses)) {
return $address;
}
return null;
} | php | public function getSender()
{
$addresses = $this->transformArrayToAddresses($this->message->getSender());
if ($address = reset($addresses)) {
return $address;
}
return null;
} | [
"public",
"function",
"getSender",
"(",
")",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformArrayToAddresses",
"(",
"$",
"this",
"->",
"message",
"->",
"getSender",
"(",
")",
")",
";",
"if",
"(",
"$",
"address",
"=",
"reset",
"(",
"$",
"addre... | Get the sender address for this message.
@return Address|null | [
"Get",
"the",
"sender",
"address",
"for",
"this",
"message",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L202-L211 |
12,840 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.setBounce | public function setBounce(Address $address): Email
{
$this->message->setReturnPath($address->getEmail(), $address->getName());
return $this;
} | php | public function setBounce(Address $address): Email
{
$this->message->setReturnPath($address->getEmail(), $address->getName());
return $this;
} | [
"public",
"function",
"setBounce",
"(",
"Address",
"$",
"address",
")",
":",
"Email",
"{",
"$",
"this",
"->",
"message",
"->",
"setReturnPath",
"(",
"$",
"address",
"->",
"getEmail",
"(",
")",
",",
"$",
"address",
"->",
"getName",
"(",
")",
")",
";",
... | Set the bounce address for this message.
@param Address $address | [
"Set",
"the",
"bounce",
"address",
"for",
"this",
"message",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L218-L223 |
12,841 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.getBounce | public function getBounce()
{
$addresses = $this->transformArrayToAddresses($this->message->getReturnPath());
if ($address = reset($addresses)) {
return $address;
}
return null;
} | php | public function getBounce()
{
$addresses = $this->transformArrayToAddresses($this->message->getReturnPath());
if ($address = reset($addresses)) {
return $address;
}
return null;
} | [
"public",
"function",
"getBounce",
"(",
")",
"{",
"$",
"addresses",
"=",
"$",
"this",
"->",
"transformArrayToAddresses",
"(",
"$",
"this",
"->",
"message",
"->",
"getReturnPath",
"(",
")",
")",
";",
"if",
"(",
"$",
"address",
"=",
"reset",
"(",
"$",
"a... | Get the bounce address for this message.
@return Address|null | [
"Get",
"the",
"bounce",
"address",
"for",
"this",
"message",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L230-L239 |
12,842 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.addMessage | public function addMessage(Message $message): Email
{
if (null === $this->message->getBody()) {
$this->message->setBody($message->getBody(), $message->getContentType());
return $this;
}
$this->message->addPart($message->getBody(), $message->getContentType());
... | php | public function addMessage(Message $message): Email
{
if (null === $this->message->getBody()) {
$this->message->setBody($message->getBody(), $message->getContentType());
return $this;
}
$this->message->addPart($message->getBody(), $message->getContentType());
... | [
"public",
"function",
"addMessage",
"(",
"Message",
"$",
"message",
")",
":",
"Email",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"message",
"->",
"getBody",
"(",
")",
")",
"{",
"$",
"this",
"->",
"message",
"->",
"setBody",
"(",
"$",
"message... | Add message body to email.
@param Message $message
@return self | [
"Add",
"message",
"body",
"to",
"email",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L272-L283 |
12,843 | johanderuijter/mailer-swift-mailer-bridge | src/Email/SwiftEmail.php | SwiftEmail.getMessages | public function getMessages(): array
{
$templates = [
new Message($this->message->getBody(), $this->message->getContentType()),
];
// TODO: Loop through parts
return $templates;
} | php | public function getMessages(): array
{
$templates = [
new Message($this->message->getBody(), $this->message->getContentType()),
];
// TODO: Loop through parts
return $templates;
} | [
"public",
"function",
"getMessages",
"(",
")",
":",
"array",
"{",
"$",
"templates",
"=",
"[",
"new",
"Message",
"(",
"$",
"this",
"->",
"message",
"->",
"getBody",
"(",
")",
",",
"$",
"this",
"->",
"message",
"->",
"getContentType",
"(",
")",
")",
",... | Get all message body parts from the email.
@return Message[] | [
"Get",
"all",
"message",
"body",
"parts",
"from",
"the",
"email",
"."
] | be7acf4b6f3f2e448546835038f98fdef9fc2889 | https://github.com/johanderuijter/mailer-swift-mailer-bridge/blob/be7acf4b6f3f2e448546835038f98fdef9fc2889/src/Email/SwiftEmail.php#L290-L299 |
12,844 | codenamephp/prototype.utils | src/main/php/de/codenamephp/prototype/utils/answerCollector/CollectorSwitch.php | CollectorSwitch.getAnswers | public function getAnswers(\Composer\Script\Event $event, array $questions, \SplFileInfo $file): array {
if($event->getIO()->isInteractive()) {
$answers = $this->getComposerIO()->getAnswers($event->getIO(), $questions);
}else {
$answers = $this->getFromArray()->getAnswers($file);
}
return $a... | php | public function getAnswers(\Composer\Script\Event $event, array $questions, \SplFileInfo $file): array {
if($event->getIO()->isInteractive()) {
$answers = $this->getComposerIO()->getAnswers($event->getIO(), $questions);
}else {
$answers = $this->getFromArray()->getAnswers($file);
}
return $a... | [
"public",
"function",
"getAnswers",
"(",
"\\",
"Composer",
"\\",
"Script",
"\\",
"Event",
"$",
"event",
",",
"array",
"$",
"questions",
",",
"\\",
"SplFileInfo",
"$",
"file",
")",
":",
"array",
"{",
"if",
"(",
"$",
"event",
"->",
"getIO",
"(",
")",
"... | Checks if the IO is interactive. If so, it passes the IO and the questions to the ComposerIO collector.
If not, it passes the file to the FromSerializedArrayFile collector.
@param \Composer\Script\Event $event
@param \de\codenamephp\platform\cli\question\iQuestion[string] $questions
@param \SplFileInfo $file
@return ... | [
"Checks",
"if",
"the",
"IO",
"is",
"interactive",
".",
"If",
"so",
"it",
"passes",
"the",
"IO",
"and",
"the",
"questions",
"to",
"the",
"ComposerIO",
"collector",
"."
] | aeb81e1e03624534e8b3e38d6466efda04e435d6 | https://github.com/codenamephp/prototype.utils/blob/aeb81e1e03624534e8b3e38d6466efda04e435d6/src/main/php/de/codenamephp/prototype/utils/answerCollector/CollectorSwitch.php#L102-L109 |
12,845 | tenside/core | src/Util/JsonFile.php | JsonFile.makeBackup | private function makeBackup()
{
if ((null === $this->backupFile) || !file_exists($this->filename)) {
return;
}
if (!is_dir(dirname($this->backupFile))) {
mkdir(dirname($this->backupFile), 0700, true);
}
copy($this->filename, $this->backupFile);
} | php | private function makeBackup()
{
if ((null === $this->backupFile) || !file_exists($this->filename)) {
return;
}
if (!is_dir(dirname($this->backupFile))) {
mkdir(dirname($this->backupFile), 0700, true);
}
copy($this->filename, $this->backupFile);
} | [
"private",
"function",
"makeBackup",
"(",
")",
"{",
"if",
"(",
"(",
"null",
"===",
"$",
"this",
"->",
"backupFile",
")",
"||",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"filename",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_dir",
"(",... | Copy the file contents over to the backup.
@return void | [
"Copy",
"the",
"file",
"contents",
"over",
"to",
"the",
"backup",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Util/JsonFile.php#L110-L121 |
12,846 | tenside/core | src/Util/JsonFile.php | JsonFile.save | public function save()
{
$this->makeBackup();
if (!is_dir(dirname($this->filename))) {
mkdir(dirname($this->filename), 0700, true);
}
file_put_contents($this->filename, (string) $this);
return $this;
} | php | public function save()
{
$this->makeBackup();
if (!is_dir(dirname($this->filename))) {
mkdir(dirname($this->filename), 0700, true);
}
file_put_contents($this->filename, (string) $this);
return $this;
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"this",
"->",
"makeBackup",
"(",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"dirname",
"(",
"$",
"this",
"->",
"filename",
")",
")",
")",
"{",
"mkdir",
"(",
"dirname",
"(",
"$",
"this",
"->",
"filen... | Save the file data.
@return JsonFile | [
"Save",
"the",
"file",
"data",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Util/JsonFile.php#L128-L139 |
12,847 | rozaverta/cmf | core/Filesystem/Filesystem.php | Filesystem.getRequire | public function getRequire( string $path )
{
if( $this->isFile( $path ) )
{
return $this->callback(static function($file) {
/** @noinspection PhpIncludeInspection */
return require $file;
}, $path);
}
throw new NotFoundFileException($path,"File does not exist at path '{$path}'" );
} | php | public function getRequire( string $path )
{
if( $this->isFile( $path ) )
{
return $this->callback(static function($file) {
/** @noinspection PhpIncludeInspection */
return require $file;
}, $path);
}
throw new NotFoundFileException($path,"File does not exist at path '{$path}'" );
} | [
"public",
"function",
"getRequire",
"(",
"string",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFile",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"this",
"->",
"callback",
"(",
"static",
"function",
"(",
"$",
"file",
")",
"{",
"/** ... | Get the returned value of a file
@param string $path
@return mixed
@throws NotFoundFileException | [
"Get",
"the",
"returned",
"value",
"of",
"a",
"file"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Filesystem/Filesystem.php#L89-L99 |
12,848 | rozaverta/cmf | core/Filesystem/Filesystem.php | Filesystem.getRequireData | public function getRequireData( string $path, $default = [] )
{
if( $this->isFile( $path ) )
{
return $this->callback(function($file) use($default) {
/** @noinspection PhpIncludeInspection */
require $file;
return $data ?? $default ?? null;
}, $path);
}
throw new NotFoundFileException($path, ... | php | public function getRequireData( string $path, $default = [] )
{
if( $this->isFile( $path ) )
{
return $this->callback(function($file) use($default) {
/** @noinspection PhpIncludeInspection */
require $file;
return $data ?? $default ?? null;
}, $path);
}
throw new NotFoundFileException($path, ... | [
"public",
"function",
"getRequireData",
"(",
"string",
"$",
"path",
",",
"$",
"default",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFile",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"this",
"->",
"callback",
"(",
"function",
"("... | Get the saved data value of a file
@param string $path
@param array $default
@return mixed
@throws NotFoundFileException | [
"Get",
"the",
"saved",
"data",
"value",
"of",
"a",
"file"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Filesystem/Filesystem.php#L110-L121 |
12,849 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.reset | public function reset()
{
$this->queryType = null;
$this->offset = 0;
$this->limit = null;
$this->joins = array();
$this->fields = array();
$this->fromTable = null;
$this->wheres = array();
$this->orderBy = null;
$this->groupBy = array();
... | php | public function reset()
{
$this->queryType = null;
$this->offset = 0;
$this->limit = null;
$this->joins = array();
$this->fields = array();
$this->fromTable = null;
$this->wheres = array();
$this->orderBy = null;
$this->groupBy = array();
... | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"queryType",
"=",
"null",
";",
"$",
"this",
"->",
"offset",
"=",
"0",
";",
"$",
"this",
"->",
"limit",
"=",
"null",
";",
"$",
"this",
"->",
"joins",
"=",
"array",
"(",
")",
";",
"... | Reset query before run new select, update, insert,...
@return \Puja\SqlBuilder\Builder | [
"Reset",
"query",
"before",
"run",
"new",
"select",
"update",
"insert",
"..."
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L41-L54 |
12,850 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.from | public function from($table, $selectFields = array('*'))
{
list($tableName, $tableAlias) = $this->tableProcess($table);
$this->fromTable[$tableAlias] = $tableName;
if (empty($selectFields)) {
return $this;
}
if ($this->queryType == self::QUERYTYPE_SELECT) {
... | php | public function from($table, $selectFields = array('*'))
{
list($tableName, $tableAlias) = $this->tableProcess($table);
$this->fromTable[$tableAlias] = $tableName;
if (empty($selectFields)) {
return $this;
}
if ($this->queryType == self::QUERYTYPE_SELECT) {
... | [
"public",
"function",
"from",
"(",
"$",
"table",
",",
"$",
"selectFields",
"=",
"array",
"(",
"'*'",
")",
")",
"{",
"list",
"(",
"$",
"tableName",
",",
"$",
"tableAlias",
")",
"=",
"$",
"this",
"->",
"tableProcess",
"(",
"$",
"table",
")",
";",
"$"... | Set from table and select fields
@param mixed $table
@param array $selectFields
@return \Puja\SqlBuilder\Builder | [
"Set",
"from",
"table",
"and",
"select",
"fields"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L62-L75 |
12,851 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.limit | public function limit($offset = null, $limit = null)
{
$args = func_get_args();
if (count($args) === 0) {
throw new Exception('At least 1 argument');
}
if (count($args) == 1) {
$this->limit = $args[0];
} else {
list($this->offset, $this->limit) = $args;
}
ret... | php | public function limit($offset = null, $limit = null)
{
$args = func_get_args();
if (count($args) === 0) {
throw new Exception('At least 1 argument');
}
if (count($args) == 1) {
$this->limit = $args[0];
} else {
list($this->offset, $this->limit) = $args;
}
ret... | [
"public",
"function",
"limit",
"(",
"$",
"offset",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"Exceptio... | Set limit and offset
@param int $offset
@param int $limit
@throws Exception
@return \Puja\SqlBuilder\Builder | [
"Set",
"limit",
"and",
"offset"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L84-L96 |
12,852 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.select | public function select($table = null, $selectFields = array('*'))
{
$this->queryTypeProcess(self::QUERYTYPE_SELECT, $table, $selectFields);
return $this;
} | php | public function select($table = null, $selectFields = array('*'))
{
$this->queryTypeProcess(self::QUERYTYPE_SELECT, $table, $selectFields);
return $this;
} | [
"public",
"function",
"select",
"(",
"$",
"table",
"=",
"null",
",",
"$",
"selectFields",
"=",
"array",
"(",
"'*'",
")",
")",
"{",
"$",
"this",
"->",
"queryTypeProcess",
"(",
"self",
"::",
"QUERYTYPE_SELECT",
",",
"$",
"table",
",",
"$",
"selectFields",
... | Set select stament
@param mixed $table
@param array $selectFields
@return \Puja\SqlBuilder\Builder | [
"Set",
"select",
"stament"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L105-L109 |
12,853 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.update | public function update($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_UPDATE, $table, $updateFields);
return $this;
} | php | public function update($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_UPDATE, $table, $updateFields);
return $this;
} | [
"public",
"function",
"update",
"(",
"$",
"table",
",",
"array",
"$",
"updateFields",
")",
"{",
"$",
"this",
"->",
"queryTypeProcess",
"(",
"self",
"::",
"QUERYTYPE_UPDATE",
",",
"$",
"table",
",",
"$",
"updateFields",
")",
";",
"return",
"$",
"this",
";... | Set update stament
@param string $table
@param array $updateFields
@return \Puja\SqlBuilder\Builder | [
"Set",
"update",
"stament"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L117-L121 |
12,854 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.insert | public function insert($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_INSERT, $table, $updateFields);
//$this->fields = $updateFields;
return $this;
} | php | public function insert($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_INSERT, $table, $updateFields);
//$this->fields = $updateFields;
return $this;
} | [
"public",
"function",
"insert",
"(",
"$",
"table",
",",
"array",
"$",
"updateFields",
")",
"{",
"$",
"this",
"->",
"queryTypeProcess",
"(",
"self",
"::",
"QUERYTYPE_INSERT",
",",
"$",
"table",
",",
"$",
"updateFields",
")",
";",
"//$this->fields = $updateField... | Set insert stament
@param string $table
@param array $updateFields
@return \Puja\SqlBuilder\Builder | [
"Set",
"insert",
"stament"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L129-L134 |
12,855 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.insertIgnore | public function insertIgnore($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_INSERT_IGNORE, $table, $updateFields);
//$this->fields = $updateFields;
return $this;
} | php | public function insertIgnore($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_INSERT_IGNORE, $table, $updateFields);
//$this->fields = $updateFields;
return $this;
} | [
"public",
"function",
"insertIgnore",
"(",
"$",
"table",
",",
"array",
"$",
"updateFields",
")",
"{",
"$",
"this",
"->",
"queryTypeProcess",
"(",
"self",
"::",
"QUERYTYPE_INSERT_IGNORE",
",",
"$",
"table",
",",
"$",
"updateFields",
")",
";",
"//$this->fields =... | Set insert ignore stament
@param string $table
@param array $updateFields
@return \Puja\SqlBuilder\Builder | [
"Set",
"insert",
"ignore",
"stament"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L142-L147 |
12,856 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.replace | public function replace($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_REPLACE, $table, $updateFields);
//$this->fields = $updateFields;
return $this;
} | php | public function replace($table, array $updateFields)
{
$this->queryTypeProcess(self::QUERYTYPE_REPLACE, $table, $updateFields);
//$this->fields = $updateFields;
return $this;
} | [
"public",
"function",
"replace",
"(",
"$",
"table",
",",
"array",
"$",
"updateFields",
")",
"{",
"$",
"this",
"->",
"queryTypeProcess",
"(",
"self",
"::",
"QUERYTYPE_REPLACE",
",",
"$",
"table",
",",
"$",
"updateFields",
")",
";",
"//$this->fields = $updateFie... | Set replace stament
@param string $table
@param array $updateFields
@return \Puja\SqlBuilder\Builder | [
"Set",
"replace",
"stament"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L155-L160 |
12,857 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.where | public function where($cond)
{
$this->wheres[] = $this->whereProcess(self::OPERATION_AND, func_get_args());
return $this;
} | php | public function where($cond)
{
$this->wheres[] = $this->whereProcess(self::OPERATION_AND, func_get_args());
return $this;
} | [
"public",
"function",
"where",
"(",
"$",
"cond",
")",
"{",
"$",
"this",
"->",
"wheres",
"[",
"]",
"=",
"$",
"this",
"->",
"whereProcess",
"(",
"self",
"::",
"OPERATION_AND",
",",
"func_get_args",
"(",
")",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set where AND
@param string $cond
@return \Puja\SqlBuilder\Builder | [
"Set",
"where",
"AND"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L205-L209 |
12,858 | jinnguyen/puja-sqlbuilder | src/Builder.php | Builder.orWhere | public function orWhere($cond)
{
$this->wheres[] = $this->whereProcess(self::OPERATION_OR, func_get_args());
return $this;
} | php | public function orWhere($cond)
{
$this->wheres[] = $this->whereProcess(self::OPERATION_OR, func_get_args());
return $this;
} | [
"public",
"function",
"orWhere",
"(",
"$",
"cond",
")",
"{",
"$",
"this",
"->",
"wheres",
"[",
"]",
"=",
"$",
"this",
"->",
"whereProcess",
"(",
"self",
"::",
"OPERATION_OR",
",",
"func_get_args",
"(",
")",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set where OR
@param string $cond
@return \Puja\SqlBuilder\Builder | [
"Set",
"where",
"OR"
] | c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b | https://github.com/jinnguyen/puja-sqlbuilder/blob/c62e6d0d3cc1e84f8497c4582cc1cd8ad677033b/src/Builder.php#L216-L220 |
12,859 | infusephp/facebook | src/libs/FacebookService.php | FacebookService.setAccessTokenFromProfile | public function setAccessTokenFromProfile(FacebookProfile $profile)
{
$this->app['facebook']->setAccessToken($profile->access_token);
$this->profile = $profile;
return $this;
} | php | public function setAccessTokenFromProfile(FacebookProfile $profile)
{
$this->app['facebook']->setAccessToken($profile->access_token);
$this->profile = $profile;
return $this;
} | [
"public",
"function",
"setAccessTokenFromProfile",
"(",
"FacebookProfile",
"$",
"profile",
")",
"{",
"$",
"this",
"->",
"app",
"[",
"'facebook'",
"]",
"->",
"setAccessToken",
"(",
"$",
"profile",
"->",
"access_token",
")",
";",
"$",
"this",
"->",
"profile",
... | Sets the appropriate API access token using
a given profile.
@param FacebookProfile $profile | [
"Sets",
"the",
"appropriate",
"API",
"access",
"token",
"using",
"a",
"given",
"profile",
"."
] | 2aa1f11803f9e3fa49a8091dba99e5ecdefa9385 | https://github.com/infusephp/facebook/blob/2aa1f11803f9e3fa49a8091dba99e5ecdefa9385/src/libs/FacebookService.php#L26-L32 |
12,860 | mtoolkit/mtoolkit-model | src/sql/MSqlRecord.php | MSqlRecord.clearValues | public function clearValues()
{
foreach ($this->record as $key => $value) {
$this->record[$key] = null;
}
} | php | public function clearValues()
{
foreach ($this->record as $key => $value) {
$this->record[$key] = null;
}
} | [
"public",
"function",
"clearValues",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"record",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"record",
"[",
"$",
"key",
"]",
"=",
"null",
";",
"}",
"}"
] | Clears the value of all fields in the record and sets each field to null. | [
"Clears",
"the",
"value",
"of",
"all",
"fields",
"in",
"the",
"record",
"and",
"sets",
"each",
"field",
"to",
"null",
"."
] | 7836bc1d32b30c14273c7636dc7388ecd347953d | https://github.com/mtoolkit/mtoolkit-model/blob/7836bc1d32b30c14273c7636dc7388ecd347953d/src/sql/MSqlRecord.php#L71-L76 |
12,861 | mtoolkit/mtoolkit-model | src/sql/MSqlRecord.php | MSqlRecord.getFieldName | public function getFieldName(int $index)
{
$keyArray = array_keys($this->record);
if ($index > 0 && $index < $this->count()) {
return $keyArray[$index];
}
return null;
} | php | public function getFieldName(int $index)
{
$keyArray = array_keys($this->record);
if ($index > 0 && $index < $this->count()) {
return $keyArray[$index];
}
return null;
} | [
"public",
"function",
"getFieldName",
"(",
"int",
"$",
"index",
")",
"{",
"$",
"keyArray",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"record",
")",
";",
"if",
"(",
"$",
"index",
">",
"0",
"&&",
"$",
"index",
"<",
"$",
"this",
"->",
"count",
"(",
... | Returns the name of the field at position index. If the field does not
exist, an empty string is returned.
@param int $index
@return null|string|int | [
"Returns",
"the",
"name",
"of",
"the",
"field",
"at",
"position",
"index",
".",
"If",
"the",
"field",
"does",
"not",
"exist",
"an",
"empty",
"string",
"is",
"returned",
"."
] | 7836bc1d32b30c14273c7636dc7388ecd347953d | https://github.com/mtoolkit/mtoolkit-model/blob/7836bc1d32b30c14273c7636dc7388ecd347953d/src/sql/MSqlRecord.php#L121-L130 |
12,862 | mtoolkit/mtoolkit-model | src/sql/MSqlRecord.php | MSqlRecord.getIndexOf | public function getIndexOf(string $name): int
{
if (array_key_exists($name, $this->record) == false) {
return -1;
}
$keyArray = array_keys($this->record);
return array_search($name, $keyArray);
} | php | public function getIndexOf(string $name): int
{
if (array_key_exists($name, $this->record) == false) {
return -1;
}
$keyArray = array_keys($this->record);
return array_search($name, $keyArray);
} | [
"public",
"function",
"getIndexOf",
"(",
"string",
"$",
"name",
")",
":",
"int",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"record",
")",
"==",
"false",
")",
"{",
"return",
"-",
"1",
";",
"}",
"$",
"keyArray",
"=... | Returns the position of the field called name within the record, or -1 if
it cannot be found. Field names are not case-sensitive. If more than one
field matches, the first one is returned.
@param string $name
@return int | [
"Returns",
"the",
"position",
"of",
"the",
"field",
"called",
"name",
"within",
"the",
"record",
"or",
"-",
"1",
"if",
"it",
"cannot",
"be",
"found",
".",
"Field",
"names",
"are",
"not",
"case",
"-",
"sensitive",
".",
"If",
"more",
"than",
"one",
"fiel... | 7836bc1d32b30c14273c7636dc7388ecd347953d | https://github.com/mtoolkit/mtoolkit-model/blob/7836bc1d32b30c14273c7636dc7388ecd347953d/src/sql/MSqlRecord.php#L140-L149 |
12,863 | mtoolkit/mtoolkit-model | src/sql/MSqlRecord.php | MSqlRecord.setNull | public function setNull($name): void
{
if ($this->contains($name) == false) {
return;
}
$this->record[$name] = null;
} | php | public function setNull($name): void
{
if ($this->contains($name) == false) {
return;
}
$this->record[$name] = null;
} | [
"public",
"function",
"setNull",
"(",
"$",
"name",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"contains",
"(",
"$",
"name",
")",
"==",
"false",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"record",
"[",
"$",
"name",
"]",
"=",
"nu... | Sets the value of field index to null. If the field does not exist,
nothing happens.
@param string|int $name | [
"Sets",
"the",
"value",
"of",
"field",
"index",
"to",
"null",
".",
"If",
"the",
"field",
"does",
"not",
"exist",
"nothing",
"happens",
"."
] | 7836bc1d32b30c14273c7636dc7388ecd347953d | https://github.com/mtoolkit/mtoolkit-model/blob/7836bc1d32b30c14273c7636dc7388ecd347953d/src/sql/MSqlRecord.php#L200-L207 |
12,864 | autarky/twig-templating | src/TwigTemplatingProvider.php | TwigTemplatingProvider.makeTwigEnvironment | public function makeTwigEnvironment(ContainerInterface $dic)
{
$config = $this->app->getConfig();
$options = ['debug' => $config->get('app.debug')];
if ($config->has('path.templates_cache')) {
$options['cache'] = $config->get('path.templates_cache');
} else if ($config->has('path.storage')) {
$options['... | php | public function makeTwigEnvironment(ContainerInterface $dic)
{
$config = $this->app->getConfig();
$options = ['debug' => $config->get('app.debug')];
if ($config->has('path.templates_cache')) {
$options['cache'] = $config->get('path.templates_cache');
} else if ($config->has('path.storage')) {
$options['... | [
"public",
"function",
"makeTwigEnvironment",
"(",
"ContainerInterface",
"$",
"dic",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"app",
"->",
"getConfig",
"(",
")",
";",
"$",
"options",
"=",
"[",
"'debug'",
"=>",
"$",
"config",
"->",
"get",
"(",
"'... | Make the twig environment.
@return \Autarky\TwigTemplating\TwigEnvironment | [
"Make",
"the",
"twig",
"environment",
"."
] | d65ec619f10390f27e64f0d1e0ab30dffde3d0ce | https://github.com/autarky/twig-templating/blob/d65ec619f10390f27e64f0d1e0ab30dffde3d0ce/src/TwigTemplatingProvider.php#L55-L103 |
12,865 | jarrettbarnett/RockPaperScissorsSpockLizard | src/Player.php | Player.move | public function move($move)
{
$last_move = $this->getLastMoveIndex();
if (is_array($last_move) && array_shift($last_move) === false)
{
throw new RockPaperScissorsSpockLizardException('Cannot set another move until the previous move has been played');
}
... | php | public function move($move)
{
$last_move = $this->getLastMoveIndex();
if (is_array($last_move) && array_shift($last_move) === false)
{
throw new RockPaperScissorsSpockLizardException('Cannot set another move until the previous move has been played');
}
... | [
"public",
"function",
"move",
"(",
"$",
"move",
")",
"{",
"$",
"last_move",
"=",
"$",
"this",
"->",
"getLastMoveIndex",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"last_move",
")",
"&&",
"array_shift",
"(",
"$",
"last_move",
")",
"===",
"false",
... | Queue a play
@param $move
@return $this
@throws RockPaperScissorsSpockLizardException | [
"Queue",
"a",
"play"
] | c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b | https://github.com/jarrettbarnett/RockPaperScissorsSpockLizard/blob/c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b/src/Player.php#L51-L67 |
12,866 | jarrettbarnett/RockPaperScissorsSpockLizard | src/Player.php | Player.lastMoveIsPlayed | public function lastMoveIsPlayed()
{
$moves = $this->getMoveHistory();
$offset = count($moves) - 1;
$last_item = $this->moves[$offset];
$this->moves[$offset][key($last_item)] = true;
return $this;
} | php | public function lastMoveIsPlayed()
{
$moves = $this->getMoveHistory();
$offset = count($moves) - 1;
$last_item = $this->moves[$offset];
$this->moves[$offset][key($last_item)] = true;
return $this;
} | [
"public",
"function",
"lastMoveIsPlayed",
"(",
")",
"{",
"$",
"moves",
"=",
"$",
"this",
"->",
"getMoveHistory",
"(",
")",
";",
"$",
"offset",
"=",
"count",
"(",
"$",
"moves",
")",
"-",
"1",
";",
"$",
"last_item",
"=",
"$",
"this",
"->",
"moves",
"... | Mark Last Move As Played
@return $this | [
"Mark",
"Last",
"Move",
"As",
"Played"
] | c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b | https://github.com/jarrettbarnett/RockPaperScissorsSpockLizard/blob/c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b/src/Player.php#L129-L136 |
12,867 | jarrettbarnett/RockPaperScissorsSpockLizard | src/Player.php | Player.getLastMoveIndex | public function getLastMoveIndex()
{
$move_history = $this->getMoveHistory();
// get last value
$last_move = end($move_history);
// reset pointer
reset($this->moves);
return $last_move;
} | php | public function getLastMoveIndex()
{
$move_history = $this->getMoveHistory();
// get last value
$last_move = end($move_history);
// reset pointer
reset($this->moves);
return $last_move;
} | [
"public",
"function",
"getLastMoveIndex",
"(",
")",
"{",
"$",
"move_history",
"=",
"$",
"this",
"->",
"getMoveHistory",
"(",
")",
";",
"// get last value",
"$",
"last_move",
"=",
"end",
"(",
"$",
"move_history",
")",
";",
"// reset pointer",
"reset",
"(",
"$... | Get Last Move
@return mixed | [
"Get",
"Last",
"Move"
] | c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b | https://github.com/jarrettbarnett/RockPaperScissorsSpockLizard/blob/c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b/src/Player.php#L142-L153 |
12,868 | jarrettbarnett/RockPaperScissorsSpockLizard | src/Player.php | Player.isBot | public function isBot($is_bot = null)
{
// if no parameter provided, return boolean for whether player is a bot or not
if ($is_bot === null) {
return $this->is_bot;
}
$this->is_bot = (bool) $is_bot;
return $this;
} | php | public function isBot($is_bot = null)
{
// if no parameter provided, return boolean for whether player is a bot or not
if ($is_bot === null) {
return $this->is_bot;
}
$this->is_bot = (bool) $is_bot;
return $this;
} | [
"public",
"function",
"isBot",
"(",
"$",
"is_bot",
"=",
"null",
")",
"{",
"// if no parameter provided, return boolean for whether player is a bot or not",
"if",
"(",
"$",
"is_bot",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"is_bot",
";",
"}",
"$",
"... | Is Bot? or set as a bot
@param bool $is_bot
@return $this if setting player to a bot, otherwise true/false depending on whether player is a bot | [
"Is",
"Bot?",
"or",
"set",
"as",
"a",
"bot"
] | c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b | https://github.com/jarrettbarnett/RockPaperScissorsSpockLizard/blob/c2524045fce41ca1cdfc0b0ce54b5f16eaedb11b/src/Player.php#L171-L181 |
12,869 | tigron/skeleton-core | lib/Skeleton/Core/Web/HTTP/Status.php | Status.code_403 | public static function code_403($message = null, $exit = true) {
if ($message !== null) {
$message = ' (' . $message . ')';
}
header('HTTP/1.1 403 Forbidden', true);
echo '403 Forbidden' . $message;
if ($exit) {
exit();
}
} | php | public static function code_403($message = null, $exit = true) {
if ($message !== null) {
$message = ' (' . $message . ')';
}
header('HTTP/1.1 403 Forbidden', true);
echo '403 Forbidden' . $message;
if ($exit) {
exit();
}
} | [
"public",
"static",
"function",
"code_403",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"exit",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"message",
"!==",
"null",
")",
"{",
"$",
"message",
"=",
"' ('",
".",
"$",
"message",
".",
"')'",
";",
"}",
"he... | Throw a 403 error
@access public
@param string $message An additional message to add to the error
@param bool | [
"Throw",
"a",
"403",
"error"
] | 543af3cc44326651e3fed869c13078474b787ecb | https://github.com/tigron/skeleton-core/blob/543af3cc44326651e3fed869c13078474b787ecb/lib/Skeleton/Core/Web/HTTP/Status.php#L29-L40 |
12,870 | tigron/skeleton-core | lib/Skeleton/Core/Web/HTTP/Status.php | Status.code_404 | public static function code_404($message = null, $exit = true) {
if ($message !== null) {
$message = ' (' . $message . ')';
}
header('HTTP/1.1 404 Not Found' . $message, true);
echo '404 Not Found' . $message;
if ($exit) {
exit();
}
} | php | public static function code_404($message = null, $exit = true) {
if ($message !== null) {
$message = ' (' . $message . ')';
}
header('HTTP/1.1 404 Not Found' . $message, true);
echo '404 Not Found' . $message;
if ($exit) {
exit();
}
} | [
"public",
"static",
"function",
"code_404",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"exit",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"message",
"!==",
"null",
")",
"{",
"$",
"message",
"=",
"' ('",
".",
"$",
"message",
".",
"')'",
";",
"}",
"he... | Throw a 404 error
@access public
@param string $message An additional message to add to the error | [
"Throw",
"a",
"404",
"error"
] | 543af3cc44326651e3fed869c13078474b787ecb | https://github.com/tigron/skeleton-core/blob/543af3cc44326651e3fed869c13078474b787ecb/lib/Skeleton/Core/Web/HTTP/Status.php#L48-L59 |
12,871 | tomphp/TjoAnnotationRouter | src/TjoAnnotationRouter/Service/RouterFactory.php | RouterFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator, $cName = null, $rName = null)
{
$config = $serviceLocator->has('Config') ? $serviceLocator->get('Config') : array();
// Defaults
$routerClass = 'Zend\Mvc\Router\Http\TreeRouteStack';
$routerCon... | php | public function createService(ServiceLocatorInterface $serviceLocator, $cName = null, $rName = null)
{
$config = $serviceLocator->has('Config') ? $serviceLocator->get('Config') : array();
// Defaults
$routerClass = 'Zend\Mvc\Router\Http\TreeRouteStack';
$routerCon... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
",",
"$",
"cName",
"=",
"null",
",",
"$",
"rName",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"has",
"(",
"'Config'",
")",
"?",
"$",
... | Create and return the router
Retrieves the "router" key of the Config service, and uses it
to instantiate the router. Uses the TreeRouteStack implementation by
default.
@param ServiceLocatorInterface $serviceLocator
@param string|null $cName
@param string|null $rName
... | [
"Create",
"and",
"return",
"the",
"router"
] | ee323691e948d82449287eae5c1ecce80cc90971 | https://github.com/tomphp/TjoAnnotationRouter/blob/ee323691e948d82449287eae5c1ecce80cc90971/src/TjoAnnotationRouter/Service/RouterFactory.php#L37-L73 |
12,872 | prastowoagungwidodo/config | src/Transformatika/Config/Config.php | Config.readConfigFile | public static function readConfigFile($path = '')
{
$path = str_replace('..', '', $path);
$realPath = self::$configDir . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);
$cachedFile = self::$cachePath . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path).'.p... | php | public static function readConfigFile($path = '')
{
$path = str_replace('..', '', $path);
$realPath = self::$configDir . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);
$cachedFile = self::$cachePath . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path).'.p... | [
"public",
"static",
"function",
"readConfigFile",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"'..'",
",",
"''",
",",
"$",
"path",
")",
";",
"$",
"realPath",
"=",
"self",
"::",
"$",
"configDir",
".",
"DIRECTORY_SEPARATO... | Read XML Config File
example: readConfigFile('conf.d/usergroup.xml');
@param string $path
@return SimpleXMLElement | [
"Read",
"XML",
"Config",
"File"
] | f7886f982bdf9e24f77e3c095b08bec2093d0e0b | https://github.com/prastowoagungwidodo/config/blob/f7886f982bdf9e24f77e3c095b08bec2093d0e0b/src/Transformatika/Config/Config.php#L144-L173 |
12,873 | mrcoco/phalms-core | user/controllers/UsersController.php | UsersController.editAction | public function editAction()
{
$this->view->disable();
$id = $this->request->getPost('hidden_id');
$user = Users::findFirstById($id);
$msg = "";
if (!$user) {
$alert = "sukses";
$msg .= "User was not found";
}
if ($this->r... | php | public function editAction()
{
$this->view->disable();
$id = $this->request->getPost('hidden_id');
$user = Users::findFirstById($id);
$msg = "";
if (!$user) {
$alert = "sukses";
$msg .= "User was not found";
}
if ($this->r... | [
"public",
"function",
"editAction",
"(",
")",
"{",
"$",
"this",
"->",
"view",
"->",
"disable",
"(",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"request",
"->",
"getPost",
"(",
"'hidden_id'",
")",
";",
"$",
"user",
"=",
"Users",
"::",
"findFirstById... | Saves the user from the 'edit' action | [
"Saves",
"the",
"user",
"from",
"the",
"edit",
"action"
] | 23486c3e75077896e708f0d2e257cde280a79ad4 | https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/controllers/UsersController.php#L137-L175 |
12,874 | mrcoco/phalms-core | user/controllers/UsersController.php | UsersController.changePasswordAction | public function changePasswordAction()
{
$form = new ChangePasswordForm();
if ($this->request->isPost()) {
if (!$form->isValid($this->request->getPost())) {
foreach ($form->getMessages() as $message) {
$this->flash->error($message);
... | php | public function changePasswordAction()
{
$form = new ChangePasswordForm();
if ($this->request->isPost()) {
if (!$form->isValid($this->request->getPost())) {
foreach ($form->getMessages() as $message) {
$this->flash->error($message);
... | [
"public",
"function",
"changePasswordAction",
"(",
")",
"{",
"$",
"form",
"=",
"new",
"ChangePasswordForm",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"isPost",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"form",
"->",
"isValid",
"(",... | Users must use this action to change its password | [
"Users",
"must",
"use",
"this",
"action",
"to",
"change",
"its",
"password"
] | 23486c3e75077896e708f0d2e257cde280a79ad4 | https://github.com/mrcoco/phalms-core/blob/23486c3e75077896e708f0d2e257cde280a79ad4/user/controllers/UsersController.php#L212-L247 |
12,875 | b01/slib | src/Tools/Utilities.php | Utilities.cleanArray | public function cleanArray(array $data)
{
$cleanedArray = [];
foreach ($data as $key => $value) {
$cleanedArray[$key] = \is_array($value)
? $this->cleanArray($value)
: $this->getSafeArray($key, $data);
}
return $cleanedArray;
} | php | public function cleanArray(array $data)
{
$cleanedArray = [];
foreach ($data as $key => $value) {
$cleanedArray[$key] = \is_array($value)
? $this->cleanArray($value)
: $this->getSafeArray($key, $data);
}
return $cleanedArray;
} | [
"public",
"function",
"cleanArray",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"cleanedArray",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"cleanedArray",
"[",
"$",
"key",
"]",
"=",
"\\",
"... | Scrub an entire array of potentially harmful client data with htmlspecialchars.
@param array $data
@return array | [
"Scrub",
"an",
"entire",
"array",
"of",
"potentially",
"harmful",
"client",
"data",
"with",
"htmlspecialchars",
"."
] | 56149adcd85f1493c11651a50dda4612a3705cbb | https://github.com/b01/slib/blob/56149adcd85f1493c11651a50dda4612a3705cbb/src/Tools/Utilities.php#L20-L31 |
12,876 | b01/slib | src/Tools/Utilities.php | Utilities.getFromArray | public function getFromArray(string $key, array $data, string $default = null)
{
$value = $default;
if (\array_key_exists($key, $data)) {
$value = $data[$key];
}
return $value;
} | php | public function getFromArray(string $key, array $data, string $default = null)
{
$value = $default;
if (\array_key_exists($key, $data)) {
$value = $data[$key];
}
return $value;
} | [
"public",
"function",
"getFromArray",
"(",
"string",
"$",
"key",
",",
"array",
"$",
"data",
",",
"string",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"default",
";",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
... | Get a value from an array, returning the default value when not present in the array.
@param string $key
@param array $data
@param string|null $default
@return mixed|null | [
"Get",
"a",
"value",
"from",
"an",
"array",
"returning",
"the",
"default",
"value",
"when",
"not",
"present",
"in",
"the",
"array",
"."
] | 56149adcd85f1493c11651a50dda4612a3705cbb | https://github.com/b01/slib/blob/56149adcd85f1493c11651a50dda4612a3705cbb/src/Tools/Utilities.php#L41-L50 |
12,877 | b01/slib | src/Tools/Utilities.php | Utilities.getSafeArray | public function getSafeArray(string $key, array & $data, string $default = null)
{
$value = $this->getFromArray($key, $data, $default);
return \htmlspecialchars($value);
} | php | public function getSafeArray(string $key, array & $data, string $default = null)
{
$value = $this->getFromArray($key, $data, $default);
return \htmlspecialchars($value);
} | [
"public",
"function",
"getSafeArray",
"(",
"string",
"$",
"key",
",",
"array",
"&",
"$",
"data",
",",
"string",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getFromArray",
"(",
"$",
"key",
",",
"$",
"data",
",",
"$"... | Get a value from an array, returning the default value when not present in the array, and stripping HTML tags.
@param string $key
@param array $data
@param string|null $default
@return mixed|null | [
"Get",
"a",
"value",
"from",
"an",
"array",
"returning",
"the",
"default",
"value",
"when",
"not",
"present",
"in",
"the",
"array",
"and",
"stripping",
"HTML",
"tags",
"."
] | 56149adcd85f1493c11651a50dda4612a3705cbb | https://github.com/b01/slib/blob/56149adcd85f1493c11651a50dda4612a3705cbb/src/Tools/Utilities.php#L77-L82 |
12,878 | b01/slib | src/Tools/Utilities.php | Utilities.loadJsonAsArray | function loadJsonAsArray($pFile)
{
$contents = \file_get_contents($pFile);
$returnValue = \json_decode($contents, true);
if (!$this->isArray($returnValue)) {
$returnValue = [];
}
return $returnValue;
} | php | function loadJsonAsArray($pFile)
{
$contents = \file_get_contents($pFile);
$returnValue = \json_decode($contents, true);
if (!$this->isArray($returnValue)) {
$returnValue = [];
}
return $returnValue;
} | [
"function",
"loadJsonAsArray",
"(",
"$",
"pFile",
")",
"{",
"$",
"contents",
"=",
"\\",
"file_get_contents",
"(",
"$",
"pFile",
")",
";",
"$",
"returnValue",
"=",
"\\",
"json_decode",
"(",
"$",
"contents",
",",
"true",
")",
";",
"if",
"(",
"!",
"$",
... | Load the attribute map from file.
@param string $pFile attribute map file contents.
@throw \Exception
@return array | [
"Load",
"the",
"attribute",
"map",
"from",
"file",
"."
] | 56149adcd85f1493c11651a50dda4612a3705cbb | https://github.com/b01/slib/blob/56149adcd85f1493c11651a50dda4612a3705cbb/src/Tools/Utilities.php#L135-L145 |
12,879 | b01/slib | src/Tools/Utilities.php | Utilities.saveFile | function saveFile($pFileName, $pContent)
{
$directory = \dirname($pFileName);
if (!\is_dir($directory)) {
try {
$madeDir = \mkdir($directory, 0755, TRUE);
} catch (\Exception $err) {
throw new \Exception("mkdir: Unable make directory '{$direc... | php | function saveFile($pFileName, $pContent)
{
$directory = \dirname($pFileName);
if (!\is_dir($directory)) {
try {
$madeDir = \mkdir($directory, 0755, TRUE);
} catch (\Exception $err) {
throw new \Exception("mkdir: Unable make directory '{$direc... | [
"function",
"saveFile",
"(",
"$",
"pFileName",
",",
"$",
"pContent",
")",
"{",
"$",
"directory",
"=",
"\\",
"dirname",
"(",
"$",
"pFileName",
")",
";",
"if",
"(",
"!",
"\\",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"try",
"{",
"$",
"madeDir"... | Save content to a file; but will also make the directory if it does not exists.
@param string $pFileName path.
@param string $pContent data to save in the file.
@throws \Exception
@return bool | [
"Save",
"content",
"to",
"a",
"file",
";",
"but",
"will",
"also",
"make",
"the",
"directory",
"if",
"it",
"does",
"not",
"exists",
"."
] | 56149adcd85f1493c11651a50dda4612a3705cbb | https://github.com/b01/slib/blob/56149adcd85f1493c11651a50dda4612a3705cbb/src/Tools/Utilities.php#L210-L231 |
12,880 | mszewcz/php-light-framework | src/Filesystem/HashFile.php | HashFile.create | public static function create(string $extension = ''): array
{
static::init();
$filePath = $fileName = '';
if (static::verifyPath(static::$hashFileDir)) {
$exists = true;
while ($exists === true) {
$hash = Random::hash();
$hashDir = \im... | php | public static function create(string $extension = ''): array
{
static::init();
$filePath = $fileName = '';
if (static::verifyPath(static::$hashFileDir)) {
$exists = true;
while ($exists === true) {
$hash = Random::hash();
$hashDir = \im... | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"extension",
"=",
"''",
")",
":",
"array",
"{",
"static",
"::",
"init",
"(",
")",
";",
"$",
"filePath",
"=",
"$",
"fileName",
"=",
"''",
";",
"if",
"(",
"static",
"::",
"verifyPath",
"(",
... | Returns unique hash file name.
@param string $extension
@return array | [
"Returns",
"unique",
"hash",
"file",
"name",
"."
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Filesystem/HashFile.php#L29-L45 |
12,881 | mszewcz/php-light-framework | src/Filesystem/HashFile.php | HashFile.getPath | public static function getPath(string $hash = ''): string
{
static::init();
$hashDir = \implode('/', \str_split(\substr($hash, 0, static::$hashFileDirDepth), 1));
$filePath = static::normalizePath(\sprintf('%s%s', static::$hashFileDir, $hashDir));
$filePath .= DIRECTORY_SEPARATOR;
... | php | public static function getPath(string $hash = ''): string
{
static::init();
$hashDir = \implode('/', \str_split(\substr($hash, 0, static::$hashFileDirDepth), 1));
$filePath = static::normalizePath(\sprintf('%s%s', static::$hashFileDir, $hashDir));
$filePath .= DIRECTORY_SEPARATOR;
... | [
"public",
"static",
"function",
"getPath",
"(",
"string",
"$",
"hash",
"=",
"''",
")",
":",
"string",
"{",
"static",
"::",
"init",
"(",
")",
";",
"$",
"hashDir",
"=",
"\\",
"implode",
"(",
"'/'",
",",
"\\",
"str_split",
"(",
"\\",
"substr",
"(",
"$... | Returns hash file path
@param string $hash
@return string | [
"Returns",
"hash",
"file",
"path"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Filesystem/HashFile.php#L64-L72 |
12,882 | xinc-develop/xinc-core | src/Plugin/ModificationSet/BuildAlways.php | BuildAlways.checkModified | public function checkModified(BuildInterface $build)
{
$result = new Result();
$result->setSource('build always task');
$result->setStatus(Result::CHANGED);
return $result;
} | php | public function checkModified(BuildInterface $build)
{
$result = new Result();
$result->setSource('build always task');
$result->setStatus(Result::CHANGED);
return $result;
} | [
"public",
"function",
"checkModified",
"(",
"BuildInterface",
"$",
"build",
")",
"{",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"result",
"->",
"setSource",
"(",
"'build always task'",
")",
";",
"$",
"result",
"->",
"setStatus",
"(",
"Result... | Check if this modification set has been modified.
@return Xinc::Core::Plugin::ModificationSet::Result | [
"Check",
"if",
"this",
"modification",
"set",
"has",
"been",
"modified",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Plugin/ModificationSet/BuildAlways.php#L48-L55 |
12,883 | jeronimos/php-adjutants | src/Arrays/Restructure.php | Restructure.makeFirstLevelArray | public static function makeFirstLevelArray($multilevelData)
{
$it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($multilevelData));
$keyValueArr = [];
foreach ($it as $k => $v) {
$decoded = json_decode($v);
if (!$decoded || is_int($decoded)) {
... | php | public static function makeFirstLevelArray($multilevelData)
{
$it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($multilevelData));
$keyValueArr = [];
foreach ($it as $k => $v) {
$decoded = json_decode($v);
if (!$decoded || is_int($decoded)) {
... | [
"public",
"static",
"function",
"makeFirstLevelArray",
"(",
"$",
"multilevelData",
")",
"{",
"$",
"it",
"=",
"new",
"\\",
"RecursiveIteratorIterator",
"(",
"new",
"\\",
"RecursiveArrayIterator",
"(",
"$",
"multilevelData",
")",
")",
";",
"$",
"keyValueArr",
"=",... | Receive data and make first-level array
@param $multilevelData ; array || object | [
"Receive",
"data",
"and",
"make",
"first",
"-",
"level",
"array"
] | 78b428ed05a9d6029a29a86ac47906adeb9fd41d | https://github.com/jeronimos/php-adjutants/blob/78b428ed05a9d6029a29a86ac47906adeb9fd41d/src/Arrays/Restructure.php#L18-L42 |
12,884 | jeronimos/php-adjutants | src/Arrays/Restructure.php | Restructure.getDelimitersKeys | public static function getDelimitersKeys(array $data, $delimitersNumbers)
{
$delimiterKeys = [];
$elementsNumbers = count($data);
if ($elementsNumbers <= $delimitersNumbers) {
throw new RestructureException("Elements number not bigger than delimiter.");
}
$port... | php | public static function getDelimitersKeys(array $data, $delimitersNumbers)
{
$delimiterKeys = [];
$elementsNumbers = count($data);
if ($elementsNumbers <= $delimitersNumbers) {
throw new RestructureException("Elements number not bigger than delimiter.");
}
$port... | [
"public",
"static",
"function",
"getDelimitersKeys",
"(",
"array",
"$",
"data",
",",
"$",
"delimitersNumbers",
")",
"{",
"$",
"delimiterKeys",
"=",
"[",
"]",
";",
"$",
"elementsNumbers",
"=",
"count",
"(",
"$",
"data",
")",
";",
"if",
"(",
"$",
"elements... | Allow to detect arrays keys, that divide array into portions by delimiter number.
@param array $data
@param $delimitersNumbers
@return array
@throws RestructureException | [
"Allow",
"to",
"detect",
"arrays",
"keys",
"that",
"divide",
"array",
"into",
"portions",
"by",
"delimiter",
"number",
"."
] | 78b428ed05a9d6029a29a86ac47906adeb9fd41d | https://github.com/jeronimos/php-adjutants/blob/78b428ed05a9d6029a29a86ac47906adeb9fd41d/src/Arrays/Restructure.php#L51-L77 |
12,885 | crisu83/yii-caviar | src/generators/FileGenerator.php | FileGenerator.validateTemplate | public function validateTemplate($attribute, array $params)
{
if (!isset(self::$config->templates[$this->template])) {
$this->addError('template', "Unable to find template '{$this->template}'.");
}
} | php | public function validateTemplate($attribute, array $params)
{
if (!isset(self::$config->templates[$this->template])) {
$this->addError('template', "Unable to find template '{$this->template}'.");
}
} | [
"public",
"function",
"validateTemplate",
"(",
"$",
"attribute",
",",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"config",
"->",
"templates",
"[",
"$",
"this",
"->",
"template",
"]",
")",
")",
"{",
"$",
"this",... | Validates the template for this generator.
@param string $attribute the attribute to validate.
@param array $params validation parameters. | [
"Validates",
"the",
"template",
"for",
"this",
"generator",
"."
] | c85286b88e68558224e7f2ea7fff8f6975e46283 | https://github.com/crisu83/yii-caviar/blob/c85286b88e68558224e7f2ea7fff8f6975e46283/src/generators/FileGenerator.php#L86-L91 |
12,886 | crisu83/yii-caviar | src/generators/FileGenerator.php | FileGenerator.runProviders | protected function runProviders(array $providers, array $properties = array())
{
$data = array();
foreach ($providers as $config) {
if (is_string($config)) {
$config = array($config);
}
$className = array_shift($config);
if (isset(se... | php | protected function runProviders(array $providers, array $properties = array())
{
$data = array();
foreach ($providers as $config) {
if (is_string($config)) {
$config = array($config);
}
$className = array_shift($config);
if (isset(se... | [
"protected",
"function",
"runProviders",
"(",
"array",
"$",
"providers",
",",
"array",
"$",
"properties",
"=",
"array",
"(",
")",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"providers",
"as",
"$",
"config",
")",
"{",
"if... | Runs a set of providers for this generator.
@param array $providers provider configurations.
@param array $properties an array of properties to set for providers.
@return array an array with the provided data. | [
"Runs",
"a",
"set",
"of",
"providers",
"for",
"this",
"generator",
"."
] | c85286b88e68558224e7f2ea7fff8f6975e46283 | https://github.com/crisu83/yii-caviar/blob/c85286b88e68558224e7f2ea7fff8f6975e46283/src/generators/FileGenerator.php#L113-L149 |
12,887 | crisu83/yii-caviar | src/generators/FileGenerator.php | FileGenerator.getTemplatePath | protected function getTemplatePath()
{
if (!isset($this->templatePath)) {
$this->templatePath = self::$config->templates[$this->template] . '/' . $this->name;
}
return $this->templatePath;
} | php | protected function getTemplatePath()
{
if (!isset($this->templatePath)) {
$this->templatePath = self::$config->templates[$this->template] . '/' . $this->name;
}
return $this->templatePath;
} | [
"protected",
"function",
"getTemplatePath",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"templatePath",
")",
")",
"{",
"$",
"this",
"->",
"templatePath",
"=",
"self",
"::",
"$",
"config",
"->",
"templates",
"[",
"$",
"this",
"->",
... | Returns the template path for this generator.
@return string template path. | [
"Returns",
"the",
"template",
"path",
"for",
"this",
"generator",
"."
] | c85286b88e68558224e7f2ea7fff8f6975e46283 | https://github.com/crisu83/yii-caviar/blob/c85286b88e68558224e7f2ea7fff8f6975e46283/src/generators/FileGenerator.php#L156-L163 |
12,888 | crisu83/yii-caviar | src/generators/FileGenerator.php | FileGenerator.resolveTemplateFile | protected function resolveTemplateFile(array $templates = array())
{
$templatePath = $this->getTemplatePath();
$templates = array_merge($templates, $this->getDefaultTemplates());
if (empty($templates)) {
throw new Exception("No templates available.");
}
foreach... | php | protected function resolveTemplateFile(array $templates = array())
{
$templatePath = $this->getTemplatePath();
$templates = array_merge($templates, $this->getDefaultTemplates());
if (empty($templates)) {
throw new Exception("No templates available.");
}
foreach... | [
"protected",
"function",
"resolveTemplateFile",
"(",
"array",
"$",
"templates",
"=",
"array",
"(",
")",
")",
"{",
"$",
"templatePath",
"=",
"$",
"this",
"->",
"getTemplatePath",
"(",
")",
";",
"$",
"templates",
"=",
"array_merge",
"(",
"$",
"templates",
",... | Determines the template file to use for generating the file.
@param array $templates list of candidate templates.
@return string path to the template file or null if no template is found. | [
"Determines",
"the",
"template",
"file",
"to",
"use",
"for",
"generating",
"the",
"file",
"."
] | c85286b88e68558224e7f2ea7fff8f6975e46283 | https://github.com/crisu83/yii-caviar/blob/c85286b88e68558224e7f2ea7fff8f6975e46283/src/generators/FileGenerator.php#L171-L190 |
12,889 | crisu83/yii-caviar | src/generators/FileGenerator.php | FileGenerator.compileInternal | protected function compileInternal($templateFile, array $providers = array(), array $properties = array())
{
$providers = array_merge($this->providers, $providers);
$templateData = !empty($providers) ? $this->runProviders($providers, $properties) : array();
return $this->compileTemplate($tem... | php | protected function compileInternal($templateFile, array $providers = array(), array $properties = array())
{
$providers = array_merge($this->providers, $providers);
$templateData = !empty($providers) ? $this->runProviders($providers, $properties) : array();
return $this->compileTemplate($tem... | [
"protected",
"function",
"compileInternal",
"(",
"$",
"templateFile",
",",
"array",
"$",
"providers",
"=",
"array",
"(",
")",
",",
"array",
"$",
"properties",
"=",
"array",
"(",
")",
")",
"{",
"$",
"providers",
"=",
"array_merge",
"(",
"$",
"this",
"->",... | Compiles a specific template file using a set of providers.
@param string $templateFile path to the template file.
@param array $providers a set of providers to run.
@param array $properties properties to pass to the providers.
@return string the compiled template. | [
"Compiles",
"a",
"specific",
"template",
"file",
"using",
"a",
"set",
"of",
"providers",
"."
] | c85286b88e68558224e7f2ea7fff8f6975e46283 | https://github.com/crisu83/yii-caviar/blob/c85286b88e68558224e7f2ea7fff8f6975e46283/src/generators/FileGenerator.php#L211-L216 |
12,890 | crisu83/yii-caviar | src/generators/FileGenerator.php | FileGenerator.compileTemplate | protected function compileTemplate($templateFile, array $templateData)
{
if (!isset(self::$compiler)) {
self::$compiler = new Compiler();
}
if (!is_file($templateFile)) {
throw new Exception("Could not find template file '$templateFile'.");
}
return ... | php | protected function compileTemplate($templateFile, array $templateData)
{
if (!isset(self::$compiler)) {
self::$compiler = new Compiler();
}
if (!is_file($templateFile)) {
throw new Exception("Could not find template file '$templateFile'.");
}
return ... | [
"protected",
"function",
"compileTemplate",
"(",
"$",
"templateFile",
",",
"array",
"$",
"templateData",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"compiler",
")",
")",
"{",
"self",
"::",
"$",
"compiler",
"=",
"new",
"Compiler",
"(",
"... | Compiles a specific template file using the given data.
@param string $templateFile path to the template file.
@param array $templateData an array of data to pass to the template.
@return string the compiled template.
@throws Exception if the template file cannot be found. | [
"Compiles",
"a",
"specific",
"template",
"file",
"using",
"the",
"given",
"data",
"."
] | c85286b88e68558224e7f2ea7fff8f6975e46283 | https://github.com/crisu83/yii-caviar/blob/c85286b88e68558224e7f2ea7fff8f6975e46283/src/generators/FileGenerator.php#L226-L237 |
12,891 | hirnsturm/typo3-extbase-services | TYPO3/Extbase/FAL/FalUtility.php | FalUtility.findFileReferenceObjects | public static function findFileReferenceObjects(array $fileUids)
{
$entities = new ObjectStorage();
if (!empty($fileUids)) {
$resourceFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
foreach ($fileUids as $uid) {
$fileRe... | php | public static function findFileReferenceObjects(array $fileUids)
{
$entities = new ObjectStorage();
if (!empty($fileUids)) {
$resourceFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
foreach ($fileUids as $uid) {
$fileRe... | [
"public",
"static",
"function",
"findFileReferenceObjects",
"(",
"array",
"$",
"fileUids",
")",
"{",
"$",
"entities",
"=",
"new",
"ObjectStorage",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"fileUids",
")",
")",
"{",
"$",
"resourceFactory",
"=",
"... | Finds FAL objects by uid
@param array $fileUids - Array of File-UIDs
@return \TYPO3\CMS\Extbase\Persistence\ObjectStorage | [
"Finds",
"FAL",
"objects",
"by",
"uid"
] | 1cdb97eb260267ea5e5610e802d20a5453296bb1 | https://github.com/hirnsturm/typo3-extbase-services/blob/1cdb97eb260267ea5e5610e802d20a5453296bb1/TYPO3/Extbase/FAL/FalUtility.php#L23-L37 |
12,892 | hirnsturm/typo3-extbase-services | TYPO3/Extbase/FAL/FalUtility.php | FalUtility.downloadFile | public static function downloadFile($fileUid, $additionalHeaders = array())
{
$fileRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
$entity = $fileRepository->findByUid($fileUid);
if (!$entity) {
return false;
}
$propertie... | php | public static function downloadFile($fileUid, $additionalHeaders = array())
{
$fileRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
$entity = $fileRepository->findByUid($fileUid);
if (!$entity) {
return false;
}
$propertie... | [
"public",
"static",
"function",
"downloadFile",
"(",
"$",
"fileUid",
",",
"$",
"additionalHeaders",
"=",
"array",
"(",
")",
")",
"{",
"$",
"fileRepository",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"'TYPO3\\\\CMS\\\\Core\\\\Resource\\\\FileRepository'",
")",
... | Download a FAL-File
@param $fileUid
@param array $additionalHeaders
@return bool|\Exception|Exception | [
"Download",
"a",
"FAL",
"-",
"File"
] | 1cdb97eb260267ea5e5610e802d20a5453296bb1 | https://github.com/hirnsturm/typo3-extbase-services/blob/1cdb97eb260267ea5e5610e802d20a5453296bb1/TYPO3/Extbase/FAL/FalUtility.php#L46-L85 |
12,893 | MASNathan/Curl | src/MASNathan/Curl/StringParser.php | StringParser.toJson | static public function toJson($str)
{
$data = \json_decode($str, true);
switch (json_last_error()) {
case JSON_ERROR_NONE:
return $data;
case JSON_ERROR_DEPTH:
return array('error' => 'Maximum stack depth exceeded');
case JSON_ERROR_STATE_MISM... | php | static public function toJson($str)
{
$data = \json_decode($str, true);
switch (json_last_error()) {
case JSON_ERROR_NONE:
return $data;
case JSON_ERROR_DEPTH:
return array('error' => 'Maximum stack depth exceeded');
case JSON_ERROR_STATE_MISM... | [
"static",
"public",
"function",
"toJson",
"(",
"$",
"str",
")",
"{",
"$",
"data",
"=",
"\\",
"json_decode",
"(",
"$",
"str",
",",
"true",
")",
";",
"switch",
"(",
"json_last_error",
"(",
")",
")",
"{",
"case",
"JSON_ERROR_NONE",
":",
"return",
"$",
"... | Parses a json string into an array
@param string $str
@return array | [
"Parses",
"a",
"json",
"string",
"into",
"an",
"array"
] | f03d33d45d583723dcfde8005c13ae3dd16d4d97 | https://github.com/MASNathan/Curl/blob/f03d33d45d583723dcfde8005c13ae3dd16d4d97/src/MASNathan/Curl/StringParser.php#L22-L42 |
12,894 | MASNathan/Curl | src/MASNathan/Curl/StringParser.php | StringParser.parse | static public function parse($str, $content_type)
{
switch ($content_type) {
case 'json':
return self::toJson($str);
case 'xml':
return self::toXml($str);
default:
return $str;
}
} | php | static public function parse($str, $content_type)
{
switch ($content_type) {
case 'json':
return self::toJson($str);
case 'xml':
return self::toXml($str);
default:
return $str;
}
} | [
"static",
"public",
"function",
"parse",
"(",
"$",
"str",
",",
"$",
"content_type",
")",
"{",
"switch",
"(",
"$",
"content_type",
")",
"{",
"case",
"'json'",
":",
"return",
"self",
"::",
"toJson",
"(",
"$",
"str",
")",
";",
"case",
"'xml'",
":",
"ret... | Parses the data passed into the requested data type
@param string $str
@param string $content_type You can use one of the following: json, xml, none
@return array | [
"Parses",
"the",
"data",
"passed",
"into",
"the",
"requested",
"data",
"type"
] | f03d33d45d583723dcfde8005c13ae3dd16d4d97 | https://github.com/MASNathan/Curl/blob/f03d33d45d583723dcfde8005c13ae3dd16d4d97/src/MASNathan/Curl/StringParser.php#L60-L72 |
12,895 | silverstripe-modular-project/silverstripe-placeable | code/extensions/FieldListExtension.php | FieldListExtension.addFieldsBefore | public function addFieldsBefore($fields, $insertBefore = null)
{
// $this->owner->flushFieldsCache();
// Add the fields to the list
foreach ($fields as $field) {
if ($insertBefore) {
$this->owner->insertBefore($insertBefore, $field);
} elseif (($name ... | php | public function addFieldsBefore($fields, $insertBefore = null)
{
// $this->owner->flushFieldsCache();
// Add the fields to the list
foreach ($fields as $field) {
if ($insertBefore) {
$this->owner->insertBefore($insertBefore, $field);
} elseif (($name ... | [
"public",
"function",
"addFieldsBefore",
"(",
"$",
"fields",
",",
"$",
"insertBefore",
"=",
"null",
")",
"{",
"// $this->owner->flushFieldsCache();",
"// Add the fields to the list",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"i... | Inserts a fields into a FieldList before a particular field if specified
@param array $fields An array of {@link FormField} objects.
@param FormField $item The form field to insert | [
"Inserts",
"a",
"fields",
"into",
"a",
"FieldList",
"before",
"a",
"particular",
"field",
"if",
"specified"
] | 8ac5891493e5af2efaab7afa93ef2d1c1bea946f | https://github.com/silverstripe-modular-project/silverstripe-placeable/blob/8ac5891493e5af2efaab7afa93ef2d1c1bea946f/code/extensions/FieldListExtension.php#L27-L42 |
12,896 | dannyvink/omnipay-komoju | src/Message/AbstractRequest.php | AbstractRequest.getEndpoint | protected function getEndpoint()
{
$locale = $this->getLocale();
$account = $this->getAccountId();
$method = $this->getPaymentMethod();
return '/' . $locale . '/api/' . $account . '/transactions/' . $method . '/new';
} | php | protected function getEndpoint()
{
$locale = $this->getLocale();
$account = $this->getAccountId();
$method = $this->getPaymentMethod();
return '/' . $locale . '/api/' . $account . '/transactions/' . $method . '/new';
} | [
"protected",
"function",
"getEndpoint",
"(",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
")",
";",
"$",
"account",
"=",
"$",
"this",
"->",
"getAccountId",
"(",
")",
";",
"$",
"method",
"=",
"$",
"this",
"->",
"getPaymentMethod",
... | Generate the endpoint based on the current options.
@return string | [
"Generate",
"the",
"endpoint",
"based",
"on",
"the",
"current",
"options",
"."
] | 15eb62abb6b043c93528ea363f0e643e477fb0c7 | https://github.com/dannyvink/omnipay-komoju/blob/15eb62abb6b043c93528ea363f0e643e477fb0c7/src/Message/AbstractRequest.php#L187-L193 |
12,897 | DanielSiepmann/AtomicKitten.Framework | Classes/AtomicKitten/Framework/Service/Generator/Framework.php | Framework.build | public function build()
{
$view = new View\AtomicKitten;
$resultFile = new SplFileObject($this->buildSettings['target'] . 'index.html', 'w');
$resultFile->fwrite($view->render('Generator/Index'));
} | php | public function build()
{
$view = new View\AtomicKitten;
$resultFile = new SplFileObject($this->buildSettings['target'] . 'index.html', 'w');
$resultFile->fwrite($view->render('Generator/Index'));
} | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"\\",
"AtomicKitten",
";",
"$",
"resultFile",
"=",
"new",
"SplFileObject",
"(",
"$",
"this",
"->",
"buildSettings",
"[",
"'target'",
"]",
".",
"'index.html'",
",",
"'w'",
")",... | Generate files from framework.
Contains the outer design like navigation.
@return void | [
"Generate",
"files",
"from",
"framework",
"."
] | 2b08867098459994ef3c1353863d813b2ac6d55a | https://github.com/DanielSiepmann/AtomicKitten.Framework/blob/2b08867098459994ef3c1353863d813b2ac6d55a/Classes/AtomicKitten/Framework/Service/Generator/Framework.php#L45-L50 |
12,898 | jakew/path | src/Path.php | Path.hasContentForKey | protected function hasContentForKey($key, $content): bool
{
if ($content instanceof Treadable) {
return $content->hasChildForKey($key);
}
if (is_array($content) || $content instanceof \ArrayAccess) {
return isset($content[$key]);
}
if (is_object($con... | php | protected function hasContentForKey($key, $content): bool
{
if ($content instanceof Treadable) {
return $content->hasChildForKey($key);
}
if (is_array($content) || $content instanceof \ArrayAccess) {
return isset($content[$key]);
}
if (is_object($con... | [
"protected",
"function",
"hasContentForKey",
"(",
"$",
"key",
",",
"$",
"content",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"Treadable",
")",
"{",
"return",
"$",
"content",
"->",
"hasChildForKey",
"(",
"$",
"key",
")",
";",
"}",
... | Returns true if and only if the content provided has content at the key provided.
@param mixed $key The key we are going to tread down.
@param mixed $content The content we are going to look through for the return content.
@return bool True if and only if the content provided has content at the key provided. | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"the",
"content",
"provided",
"has",
"content",
"at",
"the",
"key",
"provided",
"."
] | 9cc35dad3e74f11b127954a682363f2fa92201fd | https://github.com/jakew/path/blob/9cc35dad3e74f11b127954a682363f2fa92201fd/src/Path.php#L53-L68 |
12,899 | jakew/path | src/Path.php | Path.current | public function current()
{
$key = $this->keys[$this->index];
$this->content = $this->getContentForKey($key, $this->content);
return $this->content;
} | php | public function current()
{
$key = $this->keys[$this->index];
$this->content = $this->getContentForKey($key, $this->content);
return $this->content;
} | [
"public",
"function",
"current",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"keys",
"[",
"$",
"this",
"->",
"index",
"]",
";",
"$",
"this",
"->",
"content",
"=",
"$",
"this",
"->",
"getContentForKey",
"(",
"$",
"key",
",",
"$",
"this",
"-... | Returns the current content based on the current key.
@return mixed The current content. | [
"Returns",
"the",
"current",
"content",
"based",
"on",
"the",
"current",
"key",
"."
] | 9cc35dad3e74f11b127954a682363f2fa92201fd | https://github.com/jakew/path/blob/9cc35dad3e74f11b127954a682363f2fa92201fd/src/Path.php#L101-L106 |
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.