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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
238,700 | strident/Trident | src/Trident/Component/HttpKernel/Controller/ControllerResolver.php | ControllerResolver.getController | public function getController(Request $request, array $matched)
{
if (null !== $request->attributes->get('_controller')) {
return $this->createController($request->attributes->get('_controller'));
}
if ( ! $controller = $matched['_controller']) {
throw new \InvalidAr... | php | public function getController(Request $request, array $matched)
{
if (null !== $request->attributes->get('_controller')) {
return $this->createController($request->attributes->get('_controller'));
}
if ( ! $controller = $matched['_controller']) {
throw new \InvalidAr... | [
"public",
"function",
"getController",
"(",
"Request",
"$",
"request",
",",
"array",
"$",
"matched",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'_controller'",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Get a callable controller
@param Request $request
@param array $matched
@return callable | [
"Get",
"a",
"callable",
"controller"
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Component/HttpKernel/Controller/ControllerResolver.php#L46-L63 |
238,701 | strident/Trident | src/Trident/Component/HttpKernel/Controller/ControllerResolver.php | ControllerResolver.createController | protected function createController($controller)
{
if (false === strpos($controller, '::')) {
throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
}
list($class, $method) = explode('::', $controller, 2);
if ($this->container->has... | php | protected function createController($controller)
{
if (false === strpos($controller, '::')) {
throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
}
list($class, $method) = explode('::', $controller, 2);
if ($this->container->has... | [
"protected",
"function",
"createController",
"(",
"$",
"controller",
")",
"{",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"controller",
",",
"'::'",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Unable to find cont... | Creates the callable from the controller string
@param string $controller
@return callable | [
"Creates",
"the",
"callable",
"from",
"the",
"controller",
"string"
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Component/HttpKernel/Controller/ControllerResolver.php#L71-L94 |
238,702 | strident/Trident | src/Trident/Component/HttpKernel/Controller/ControllerResolver.php | ControllerResolver.getArguments | public function getArguments(Request $request, array $controller, array $matched)
{
$reflection = new \ReflectionMethod($controller[0], $controller[1]);
$attributes = $request->attributes->all();
$arguments = [];
foreach ($reflection->getParameters() as $param) {
if (ar... | php | public function getArguments(Request $request, array $controller, array $matched)
{
$reflection = new \ReflectionMethod($controller[0], $controller[1]);
$attributes = $request->attributes->all();
$arguments = [];
foreach ($reflection->getParameters() as $param) {
if (ar... | [
"public",
"function",
"getArguments",
"(",
"Request",
"$",
"request",
",",
"array",
"$",
"controller",
",",
"array",
"$",
"matched",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionMethod",
"(",
"$",
"controller",
"[",
"0",
"]",
",",
"$",
"cont... | Get controller action arguments
@param Request $request
@param array $controller
@param array $matched
@return array | [
"Get",
"controller",
"action",
"arguments"
] | a112f0b75601b897c470a49d85791dc386c29952 | https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Component/HttpKernel/Controller/ControllerResolver.php#L104-L124 |
238,703 | wearenolte/wp-endpoints-post | src/Inc/Type.php | Type.get | public static function get( $post ) {
$post = is_a( $post, 'WP_Post' ) ? $post : get_post( $post );
$type = $post->post_type;
if ( 'page' === $type ) {
$template_slug = get_page_template_slug( $post->ID );
if ( ! empty( $template_slug ) ) {
$type .= '-' . wp_basename( $template_slug, '.php' );
}
}
... | php | public static function get( $post ) {
$post = is_a( $post, 'WP_Post' ) ? $post : get_post( $post );
$type = $post->post_type;
if ( 'page' === $type ) {
$template_slug = get_page_template_slug( $post->ID );
if ( ! empty( $template_slug ) ) {
$type .= '-' . wp_basename( $template_slug, '.php' );
}
}
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"post",
")",
"{",
"$",
"post",
"=",
"is_a",
"(",
"$",
"post",
",",
"'WP_Post'",
")",
"?",
"$",
"post",
":",
"get_post",
"(",
"$",
"post",
")",
";",
"$",
"type",
"=",
"$",
"post",
"->",
"post_type",... | Returns the type for the post, the term template applies to what type of
post is or what type of template is using.
@param Int|\WP_Post $post The post
@return string | [
"Returns",
"the",
"type",
"for",
"the",
"post",
"the",
"term",
"template",
"applies",
"to",
"what",
"type",
"of",
"post",
"is",
"or",
"what",
"type",
"of",
"template",
"is",
"using",
"."
] | 11f17af89a3164faade5bd05be714cc3ab6e3c08 | https://github.com/wearenolte/wp-endpoints-post/blob/11f17af89a3164faade5bd05be714cc3ab6e3c08/src/Inc/Type.php#L17-L27 |
238,704 | lembarek/auth | src/Controllers/AuthController.php | AuthController.postRegister | public function postRegister(RegisterRequest $request)
{
$inputs = $request->except('_token');
$inputs['password'] = Hash::make($inputs['password']);
$user = $this->userRepo->create($inputs);
Event::fire(new UserHasCreated($user));
return Redirect::to('/');
} | php | public function postRegister(RegisterRequest $request)
{
$inputs = $request->except('_token');
$inputs['password'] = Hash::make($inputs['password']);
$user = $this->userRepo->create($inputs);
Event::fire(new UserHasCreated($user));
return Redirect::to('/');
} | [
"public",
"function",
"postRegister",
"(",
"RegisterRequest",
"$",
"request",
")",
"{",
"$",
"inputs",
"=",
"$",
"request",
"->",
"except",
"(",
"'_token'",
")",
";",
"$",
"inputs",
"[",
"'password'",
"]",
"=",
"Hash",
"::",
"make",
"(",
"$",
"inputs",
... | create a new user in DB
@return Response | [
"create",
"a",
"new",
"user",
"in",
"DB"
] | 783aad2bcde9d8014be34092ba0cbe38b2bbc60a | https://github.com/lembarek/auth/blob/783aad2bcde9d8014be34092ba0cbe38b2bbc60a/src/Controllers/AuthController.php#L41-L50 |
238,705 | lembarek/auth | src/Controllers/AuthController.php | AuthController.postLogin | public function postLogin(LoginRequest $request)
{
$inputs = $request->except('_token','rememberme');
$rememberme = $request->get('rememberme');
$attemp = Auth::attempt($inputs, !!$rememberme);
if (!$attemp) {
$request->session()->flash('error', trans('auth.failed'));
... | php | public function postLogin(LoginRequest $request)
{
$inputs = $request->except('_token','rememberme');
$rememberme = $request->get('rememberme');
$attemp = Auth::attempt($inputs, !!$rememberme);
if (!$attemp) {
$request->session()->flash('error', trans('auth.failed'));
... | [
"public",
"function",
"postLogin",
"(",
"LoginRequest",
"$",
"request",
")",
"{",
"$",
"inputs",
"=",
"$",
"request",
"->",
"except",
"(",
"'_token'",
",",
"'rememberme'",
")",
";",
"$",
"rememberme",
"=",
"$",
"request",
"->",
"get",
"(",
"'rememberme'",
... | try to login the user
@return Response | [
"try",
"to",
"login",
"the",
"user"
] | 783aad2bcde9d8014be34092ba0cbe38b2bbc60a | https://github.com/lembarek/auth/blob/783aad2bcde9d8014be34092ba0cbe38b2bbc60a/src/Controllers/AuthController.php#L69-L84 |
238,706 | zepi/turbo-base | Zepi/Web/General/src/Manager/TemplatesManager.php | TemplatesManager.loadTemplates | protected function loadTemplates()
{
$templates = $this->templatesObjectBackend->loadObject();
if (!is_array($templates)) {
$templates = array();
}
$this->templates = $templates;
} | php | protected function loadTemplates()
{
$templates = $this->templatesObjectBackend->loadObject();
if (!is_array($templates)) {
$templates = array();
}
$this->templates = $templates;
} | [
"protected",
"function",
"loadTemplates",
"(",
")",
"{",
"$",
"templates",
"=",
"$",
"this",
"->",
"templatesObjectBackend",
"->",
"loadObject",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"templates",
")",
")",
"{",
"$",
"templates",
"=",
"arra... | Loads the templates from the object backend
@access public | [
"Loads",
"the",
"templates",
"from",
"the",
"object",
"backend"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Manager/TemplatesManager.php#L106-L114 |
238,707 | zepi/turbo-base | Zepi/Web/General/src/Manager/TemplatesManager.php | TemplatesManager.addTemplate | public function addTemplate($key, $file, $priority = 10)
{
// If the file does not exists we can't add the file
// to the templates...
if (!file_exists($file) || !is_readable($file)) {
return false;
}
// Create the arrays, if they are not existing
... | php | public function addTemplate($key, $file, $priority = 10)
{
// If the file does not exists we can't add the file
// to the templates...
if (!file_exists($file) || !is_readable($file)) {
return false;
}
// Create the arrays, if they are not existing
... | [
"public",
"function",
"addTemplate",
"(",
"$",
"key",
",",
"$",
"file",
",",
"$",
"priority",
"=",
"10",
")",
"{",
"// If the file does not exists we can't add the file",
"// to the templates...",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
"||",
"!",
... | Adds a new template file to the given key with the given priority.
@access public
@param string $key
@param string $file
@param integer $priority
@return boolean | [
"Adds",
"a",
"new",
"template",
"file",
"to",
"the",
"given",
"key",
"with",
"the",
"given",
"priority",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Manager/TemplatesManager.php#L135-L155 |
238,708 | zepi/turbo-base | Zepi/Web/General/src/Manager/TemplatesManager.php | TemplatesManager.removeTemplate | public function removeTemplate($key, $file, $priority = 10)
{
// If we can't find the template file we do not have to remove anything.
if (!isset($this->templates[$key][$priority])) {
return false;
}
// Remove the template file.
unset($this->templates[$ke... | php | public function removeTemplate($key, $file, $priority = 10)
{
// If we can't find the template file we do not have to remove anything.
if (!isset($this->templates[$key][$priority])) {
return false;
}
// Remove the template file.
unset($this->templates[$ke... | [
"public",
"function",
"removeTemplate",
"(",
"$",
"key",
",",
"$",
"file",
",",
"$",
"priority",
"=",
"10",
")",
"{",
"// If we can't find the template file we do not have to remove anything.",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"templates",
"[",
"... | Removes the template file for the given key and priority.
@access public
@param string $key
@param string $file
@param integer $priority | [
"Removes",
"the",
"template",
"file",
"for",
"the",
"given",
"key",
"and",
"priority",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Manager/TemplatesManager.php#L165-L174 |
238,709 | zepi/turbo-base | Zepi/Web/General/src/Manager/TemplatesManager.php | TemplatesManager.addRenderer | public function addRenderer(RendererAbstract $renderer)
{
$extension = $renderer->getExtension();
if (isset($this->renderer[$extension])) {
return false;
}
$this->renderer[$extension] = $renderer;
return true;
} | php | public function addRenderer(RendererAbstract $renderer)
{
$extension = $renderer->getExtension();
if (isset($this->renderer[$extension])) {
return false;
}
$this->renderer[$extension] = $renderer;
return true;
} | [
"public",
"function",
"addRenderer",
"(",
"RendererAbstract",
"$",
"renderer",
")",
"{",
"$",
"extension",
"=",
"$",
"renderer",
"->",
"getExtension",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"renderer",
"[",
"$",
"extension",
"]",
")",... | Add a renderer.
@access public
@param \Zepi\Web\General\Template\RendererAbstract $renderer
@return boolean | [
"Add",
"a",
"renderer",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Manager/TemplatesManager.php#L183-L193 |
238,710 | zepi/turbo-base | Zepi/Web/General/src/Manager/TemplatesManager.php | TemplatesManager.renderTemplate | public function renderTemplate($key, $additionalData = array())
{
if (!isset($this->templates[$key])) {
return '';
}
$output = '';
// Render the template files
foreach ($this->templates[$key] as $priority => $templateFile) {
$output .... | php | public function renderTemplate($key, $additionalData = array())
{
if (!isset($this->templates[$key])) {
return '';
}
$output = '';
// Render the template files
foreach ($this->templates[$key] as $priority => $templateFile) {
$output .... | [
"public",
"function",
"renderTemplate",
"(",
"$",
"key",
",",
"$",
"additionalData",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"templates",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"''",
";",
"}",
"$... | Renders all template files for the given template key.
@access public
@param string $key
@param array $additionalData
@return string | [
"Renders",
"all",
"template",
"files",
"for",
"the",
"given",
"template",
"key",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Manager/TemplatesManager.php#L203-L217 |
238,711 | zepi/turbo-base | Zepi/Web/General/src/Manager/TemplatesManager.php | TemplatesManager.searchRendererAndRenderTemplate | protected function searchRendererAndRenderTemplate($templateFile, $additionalData = array())
{
// Get the file information for the template file
$fileInfo = pathinfo($templateFile);
$extension = $fileInfo['extension'];
// If we haven't a renderer for this extension we return... | php | protected function searchRendererAndRenderTemplate($templateFile, $additionalData = array())
{
// Get the file information for the template file
$fileInfo = pathinfo($templateFile);
$extension = $fileInfo['extension'];
// If we haven't a renderer for this extension we return... | [
"protected",
"function",
"searchRendererAndRenderTemplate",
"(",
"$",
"templateFile",
",",
"$",
"additionalData",
"=",
"array",
"(",
")",
")",
"{",
"// Get the file information for the template file",
"$",
"fileInfo",
"=",
"pathinfo",
"(",
"$",
"templateFile",
")",
";... | Searches a renderer for the given template file and renders the
file.
@access protected
@param string $templateFile
@param array $additionalData
@return string | [
"Searches",
"a",
"renderer",
"for",
"the",
"given",
"template",
"file",
"and",
"renders",
"the",
"file",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Manager/TemplatesManager.php#L228-L251 |
238,712 | 10usb/css-lib | autoloader.php | Autoloader.load | public static function load($name){
if(substr($name, 0, 7)!='csslib\\') return false;
$filename = __DIR__.'/src/'.implode('/', array_slice(explode('\\', $name), 1)).'.php';
if(!file_exists($filename)) throw new \Exception('File "'.$filename.'" not found');
require_once $filename;
if(class_exists(... | php | public static function load($name){
if(substr($name, 0, 7)!='csslib\\') return false;
$filename = __DIR__.'/src/'.implode('/', array_slice(explode('\\', $name), 1)).'.php';
if(!file_exists($filename)) throw new \Exception('File "'.$filename.'" not found');
require_once $filename;
if(class_exists(... | [
"public",
"static",
"function",
"load",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"name",
",",
"0",
",",
"7",
")",
"!=",
"'csslib\\\\'",
")",
"return",
"false",
";",
"$",
"filename",
"=",
"__DIR__",
".",
"'/src/'",
".",
"implode",
... | Load a class or interface by its name, ain't that cool?
@param string $name Class name
@throws \Exception
@return boolean | [
"Load",
"a",
"class",
"or",
"interface",
"by",
"its",
"name",
"ain",
"t",
"that",
"cool?"
] | 6370b1404bae3eecb44c214ed4eaaf33113858dd | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/autoloader.php#L22-L35 |
238,713 | prototypemvc/prototypemvc | Core/Model.php | Model.load | public static function load($model = false) {
$path = DOC_ROOT . Config::get('paths', 'modules');
if ($model && File::isFile($path . $model . '.php')) {
$array = explode('/', $model);
$modelName = end($array);
require $path . $model . '.php';
... | php | public static function load($model = false) {
$path = DOC_ROOT . Config::get('paths', 'modules');
if ($model && File::isFile($path . $model . '.php')) {
$array = explode('/', $model);
$modelName = end($array);
require $path . $model . '.php';
... | [
"public",
"static",
"function",
"load",
"(",
"$",
"model",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"DOC_ROOT",
".",
"Config",
"::",
"get",
"(",
"'paths'",
",",
"'modules'",
")",
";",
"if",
"(",
"$",
"model",
"&&",
"File",
"::",
"isFile",
"(",
"$"... | Load a given model.
@param string path to file
@example load('blog/model/blog')
@example load('blog/model/blog.php')
@return object | [
"Load",
"a",
"given",
"model",
"."
] | 039e238857d4b627e40ba681a376583b0821cd36 | https://github.com/prototypemvc/prototypemvc/blob/039e238857d4b627e40ba681a376583b0821cd36/Core/Model.php#L17-L32 |
238,714 | Silvestra/Silvestra | src/Silvestra/Component/Media/Templating/ImageTemplatingHelper.php | ImageTemplatingHelper.getImagePath | private function getImagePath($path)
{
if ($path && file_exists($this->filesystem->getRootDir() . $path)) {
return $path;
}
return $this->noImagePath;
} | php | private function getImagePath($path)
{
if ($path && file_exists($this->filesystem->getRootDir() . $path)) {
return $path;
}
return $this->noImagePath;
} | [
"private",
"function",
"getImagePath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"path",
"&&",
"file_exists",
"(",
"$",
"this",
"->",
"filesystem",
"->",
"getRootDir",
"(",
")",
".",
"$",
"path",
")",
")",
"{",
"return",
"$",
"path",
";",
"}",
"r... | Get image path.
@param string $path
@return string | [
"Get",
"image",
"path",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Media/Templating/ImageTemplatingHelper.php#L89-L96 |
238,715 | xpl-php/Common | src/Storage/Registry.php | Registry.set | public function set($key, $object) {
if (! is_object($object)) {
throw new \InvalidArgumentException("Registry only accepts objects, given: ".gettype($object));
}
$this->_data[$key] = $object;
return $this;
} | php | public function set($key, $object) {
if (! is_object($object)) {
throw new \InvalidArgumentException("Registry only accepts objects, given: ".gettype($object));
}
$this->_data[$key] = $object;
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Registry only accepts objects, given: \"",
".",
"gettype",
"... | Sets an object.
@param string $key Item key.
@param object $object Object instance.
@return $this | [
"Sets",
"an",
"object",
"."
] | 0669bdcca29f1f8835297c2397c62fee3be5dce3 | https://github.com/xpl-php/Common/blob/0669bdcca29f1f8835297c2397c62fee3be5dce3/src/Storage/Registry.php#L28-L37 |
238,716 | xpl-php/Common | src/Storage/Registry.php | Registry.add | public function add(array $items) {
foreach($items as $name => $object) {
$this->set($name, $object);
}
return $this;
} | php | public function add(array $items) {
foreach($items as $name => $object) {
$this->set($name, $object);
}
return $this;
} | [
"public",
"function",
"add",
"(",
"array",
"$",
"items",
")",
"{",
"foreach",
"(",
"$",
"items",
"as",
"$",
"name",
"=>",
"$",
"object",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"object",
")",
";",
"}",
"return",
"$",
"th... | Adds an array of items.
@param array $items
@return $this | [
"Adds",
"an",
"array",
"of",
"items",
"."
] | 0669bdcca29f1f8835297c2397c62fee3be5dce3 | https://github.com/xpl-php/Common/blob/0669bdcca29f1f8835297c2397c62fee3be5dce3/src/Storage/Registry.php#L46-L53 |
238,717 | xpl-php/Common | src/Storage/Registry.php | Registry.get | public function get($key) {
if (isset($this->_data[$key])) {
return $this->_data[$key];
}
if (isset($this->registered[$key])) {
return $this->_data[$key] = call_user_func($this->registered[$key], $this);
}
return null;
} | php | public function get($key) {
if (isset($this->_data[$key])) {
return $this->_data[$key];
}
if (isset($this->registered[$key])) {
return $this->_data[$key] = call_user_func($this->registered[$key], $this);
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_data",
"[",
"$",
"key",
"]",
";",
"}",
"if",
"(",
"isset",
"(",
... | Returns a registered value.
@param string $key Item key.
@return mixed | [
"Returns",
"a",
"registered",
"value",
"."
] | 0669bdcca29f1f8835297c2397c62fee3be5dce3 | https://github.com/xpl-php/Common/blob/0669bdcca29f1f8835297c2397c62fee3be5dce3/src/Storage/Registry.php#L62-L73 |
238,718 | xpl-php/Common | src/Storage/Registry.php | Registry.exists | public function exists($key) {
return isset($this->_data[$key]) || isset($this->registered[$key]);
} | php | public function exists($key) {
return isset($this->_data[$key]) || isset($this->registered[$key]);
} | [
"public",
"function",
"exists",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"$",
"key",
"]",
")",
"||",
"isset",
"(",
"$",
"this",
"->",
"registered",
"[",
"$",
"key",
"]",
")",
";",
"}"
] | Checks whether an key can be resolved to an object or registered closure.
@param string $key Item key.
@return boolean True if the item can be resolved to an object. | [
"Checks",
"whether",
"an",
"key",
"can",
"be",
"resolved",
"to",
"an",
"object",
"or",
"registered",
"closure",
"."
] | 0669bdcca29f1f8835297c2397c62fee3be5dce3 | https://github.com/xpl-php/Common/blob/0669bdcca29f1f8835297c2397c62fee3be5dce3/src/Storage/Registry.php#L124-L126 |
238,719 | lfalmeida/lbase | src/Controllers/ApiBaseController.php | ApiBaseController.paginate | protected function paginate(Request $request)
{
$fields = $request->input('fields') ? explode(',', $request->input('fields')) : ['*'];
$pageSize = $request->input('pageSize') ? (int)$request->input('pageSize') : null;
$sort = $request->input('sort') ? $request->input('sort') : null;
... | php | protected function paginate(Request $request)
{
$fields = $request->input('fields') ? explode(',', $request->input('fields')) : ['*'];
$pageSize = $request->input('pageSize') ? (int)$request->input('pageSize') : null;
$sort = $request->input('sort') ? $request->input('sort') : null;
... | [
"protected",
"function",
"paginate",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"fields",
"=",
"$",
"request",
"->",
"input",
"(",
"'fields'",
")",
"?",
"explode",
"(",
"','",
",",
"$",
"request",
"->",
"input",
"(",
"'fields'",
")",
")",
":",
"[... | Retorna os resultados paginados.
Este método aceita os seguintes parâmetros fornecidos via Request: **fields, pageSize, sort, order**.
- **fields**: String com as colunas desejadas no retorno, separadas por vírgula.
- **pageSise**: Inteiro indicando a quantidade de resultados por página.
- **sort**: Coluna para orden... | [
"Retorna",
"os",
"resultados",
"paginados",
"."
] | d2ed4b7b9c74c849dde4fd9953e6aca1f4092e37 | https://github.com/lfalmeida/lbase/blob/d2ed4b7b9c74c849dde4fd9953e6aca1f4092e37/src/Controllers/ApiBaseController.php#L151-L165 |
238,720 | lfalmeida/lbase | src/Controllers/ApiBaseController.php | ApiBaseController.update | public function update(Request $request, $id)
{
$response = $this->repository->update($id, $request->all());
return Response::apiResponse([
'data' => $response
]);
} | php | public function update(Request $request, $id)
{
$response = $this->repository->update($id, $request->all());
return Response::apiResponse([
'data' => $response
]);
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"repository",
"->",
"update",
"(",
"$",
"id",
",",
"$",
"request",
"->",
"all",
"(",
")",
")",
";",
"return",
"Respon... | Atualiza os dados de uma entidade com base nos dados obtidos no Request.
@param \Illuminate\Http\Request $request
@param int $id Id da entidade a ser atualizada
@return \Illuminate\Http\Response | [
"Atualiza",
"os",
"dados",
"de",
"uma",
"entidade",
"com",
"base",
"nos",
"dados",
"obtidos",
"no",
"Request",
"."
] | d2ed4b7b9c74c849dde4fd9953e6aca1f4092e37 | https://github.com/lfalmeida/lbase/blob/d2ed4b7b9c74c849dde4fd9953e6aca1f4092e37/src/Controllers/ApiBaseController.php#L223-L230 |
238,721 | prestaconcept/PrestaComposerPublicBundle | Command/BlendCommand.php | BlendCommand.getBundlesToBlend | private function getBundlesToBlend()
{
$toBlend = array();
foreach ($this->config['blend'] as $key => $params) {
$vendor = isset($params['vendor']) ? $params['vendor'] : null;
$name = isset($params['name']) ? $params['name'] : null;
$path = isset($params['path'])... | php | private function getBundlesToBlend()
{
$toBlend = array();
foreach ($this->config['blend'] as $key => $params) {
$vendor = isset($params['vendor']) ? $params['vendor'] : null;
$name = isset($params['name']) ? $params['name'] : null;
$path = isset($params['path'])... | [
"private",
"function",
"getBundlesToBlend",
"(",
")",
"{",
"$",
"toBlend",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'blend'",
"]",
"as",
"$",
"key",
"=>",
"$",
"params",
")",
"{",
"$",
"vendor",
"=",
"isset",
... | Extract bundles to blend from config
@return array | [
"Extract",
"bundles",
"to",
"blend",
"from",
"config"
] | 2d7da2998141c4777301910f912a19d4cc5e8a74 | https://github.com/prestaconcept/PrestaComposerPublicBundle/blob/2d7da2998141c4777301910f912a19d4cc5e8a74/Command/BlendCommand.php#L71-L90 |
238,722 | prestaconcept/PrestaComposerPublicBundle | Command/BlendCommand.php | BlendCommand.blend | private function blend($toBlend, OutputInterface $output)
{
$fs = new Filesystem();
$vendorDir = $this->getContainer()->getParameter('kernel.root_dir') . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor';
foreach ($toBlend as $vendor => $names) {
foreach ($nam... | php | private function blend($toBlend, OutputInterface $output)
{
$fs = new Filesystem();
$vendorDir = $this->getContainer()->getParameter('kernel.root_dir') . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor';
foreach ($toBlend as $vendor => $names) {
foreach ($nam... | [
"private",
"function",
"blend",
"(",
"$",
"toBlend",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"fs",
"=",
"new",
"Filesystem",
"(",
")",
";",
"$",
"vendorDir",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"getParameter",
"(",
"'k... | Blend bundles into prestaComposer vendor directory
@param $toBlend
@param OutputInterface $output
@throws \InvalidArgumentException | [
"Blend",
"bundles",
"into",
"prestaComposer",
"vendor",
"directory"
] | 2d7da2998141c4777301910f912a19d4cc5e8a74 | https://github.com/prestaconcept/PrestaComposerPublicBundle/blob/2d7da2998141c4777301910f912a19d4cc5e8a74/Command/BlendCommand.php#L99-L135 |
238,723 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListQuery.php | Zend_Gdata_Spreadsheets_ListQuery.setSpreadsheetQuery | public function setSpreadsheetQuery($value)
{
if ($value != null) {
$this->_params['sq'] = $value;
} else {
unset($this->_params['sq']);
}
return $this;
} | php | public function setSpreadsheetQuery($value)
{
if ($value != null) {
$this->_params['sq'] = $value;
} else {
unset($this->_params['sq']);
}
return $this;
} | [
"public",
"function",
"setSpreadsheetQuery",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"_params",
"[",
"'sq'",
"]",
"=",
"$",
"value",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
... | Sets the spreadsheet key for this query.
@param string $value
@return Zend_Gdata_Spreadsheets_DocumentQuery Provides a fluent interface | [
"Sets",
"the",
"spreadsheet",
"key",
"for",
"this",
"query",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListQuery.php#L170-L178 |
238,724 | n0m4dz/laracasa | Zend/Gdata/Spreadsheets/ListQuery.php | Zend_Gdata_Spreadsheets_ListQuery.setReverse | public function setReverse($value)
{
if ($value != null) {
$this->_params['reverse'] = $value;
} else {
unset($this->_params['reverse']);
}
return $this;
} | php | public function setReverse($value)
{
if ($value != null) {
$this->_params['reverse'] = $value;
} else {
unset($this->_params['reverse']);
}
return $this;
} | [
"public",
"function",
"setReverse",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"_params",
"[",
"'reverse'",
"]",
"=",
"$",
"value",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"->",
"_pa... | Sets the reverse attribute for this query.
@param string $value
@return Zend_Gdata_Spreadsheets_DocumentQuery Provides a fluent interface | [
"Sets",
"the",
"reverse",
"attribute",
"for",
"this",
"query",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Spreadsheets/ListQuery.php#L226-L234 |
238,725 | znframework/package-image | Thumb.php | Thumb.size | public function size(Int $width, Int $height) : Thumb
{
$this->sets['width'] = $width;
$this->sets['height'] = $height;
return $this;
} | php | public function size(Int $width, Int $height) : Thumb
{
$this->sets['width'] = $width;
$this->sets['height'] = $height;
return $this;
} | [
"public",
"function",
"size",
"(",
"Int",
"$",
"width",
",",
"Int",
"$",
"height",
")",
":",
"Thumb",
"{",
"$",
"this",
"->",
"sets",
"[",
"'width'",
"]",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"sets",
"[",
"'height'",
"]",
"=",
"$",
"height"... | Sets image size
@param int $width
@param int $height
@return Thumb | [
"Sets",
"image",
"size"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/Thumb.php#L109-L115 |
238,726 | znframework/package-image | Thumb.php | Thumb.resize | public function resize(Int $width, Int $height) : Thumb
{
$this->sets['rewidth'] = $width;
$this->sets['reheight'] = $height;
return $this;
} | php | public function resize(Int $width, Int $height) : Thumb
{
$this->sets['rewidth'] = $width;
$this->sets['reheight'] = $height;
return $this;
} | [
"public",
"function",
"resize",
"(",
"Int",
"$",
"width",
",",
"Int",
"$",
"height",
")",
":",
"Thumb",
"{",
"$",
"this",
"->",
"sets",
"[",
"'rewidth'",
"]",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"sets",
"[",
"'reheight'",
"]",
"=",
"$",
"h... | Sets image resize
@param int $width
@param int $height
@return Thumb | [
"Sets",
"image",
"resize"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/Thumb.php#L125-L131 |
238,727 | znframework/package-image | Thumb.php | Thumb.prosize | public function prosize(Int $width, Int $height = 0) : Thumb
{
$this->sets['prowidth'] = $width;
$this->sets['proheight'] = $height;
return $this;
} | php | public function prosize(Int $width, Int $height = 0) : Thumb
{
$this->sets['prowidth'] = $width;
$this->sets['proheight'] = $height;
return $this;
} | [
"public",
"function",
"prosize",
"(",
"Int",
"$",
"width",
",",
"Int",
"$",
"height",
"=",
"0",
")",
":",
"Thumb",
"{",
"$",
"this",
"->",
"sets",
"[",
"'prowidth'",
"]",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"sets",
"[",
"'proheight'",
"]",
... | Sets image proportional size
@param int $width
@param int $height
@return Thumb | [
"Sets",
"image",
"proportional",
"size"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/Thumb.php#L141-L147 |
238,728 | znframework/package-image | Thumb.php | Thumb.create | public function create(String $path = NULL) : String
{
if( isset($this->sets['filePath']) )
{
$path = $this->sets['filePath'];
}
# It keeps the used filters belonging to the GD class.
# [5.7.8]added
$this->sets['filters'] = $this->filters;
$setti... | php | public function create(String $path = NULL) : String
{
if( isset($this->sets['filePath']) )
{
$path = $this->sets['filePath'];
}
# It keeps the used filters belonging to the GD class.
# [5.7.8]added
$this->sets['filters'] = $this->filters;
$setti... | [
"public",
"function",
"create",
"(",
"String",
"$",
"path",
"=",
"NULL",
")",
":",
"String",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"sets",
"[",
"'filePath'",
"]",
")",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"sets",
"[",
"'fileP... | Create new image
@param string $path = NULL
@return string | [
"Create",
"new",
"image"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/Thumb.php#L156-L172 |
238,729 | znframework/package-image | Thumb.php | Thumb.getProsize | public function getProsize(Int $width = 0, Int $height = 0)
{
if( ! isset($this->sets['filePath']) )
{
return false;
}
return $this->image->getProsize($this->sets['filePath'], $width, $height);
} | php | public function getProsize(Int $width = 0, Int $height = 0)
{
if( ! isset($this->sets['filePath']) )
{
return false;
}
return $this->image->getProsize($this->sets['filePath'], $width, $height);
} | [
"public",
"function",
"getProsize",
"(",
"Int",
"$",
"width",
"=",
"0",
",",
"Int",
"$",
"height",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sets",
"[",
"'filePath'",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Get proportional size
@param int $width = 0
@param int $height = 0
@return object|false | [
"Get",
"proportional",
"size"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/Thumb.php#L182-L190 |
238,730 | jaeger-app/log | src/Traits/Log.php | Log.getPathToLogFile | public function getPathToLogFile($name = 'm62')
{
if (is_null($this->log_path)) {
$this->log_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'logs') . DIRECTORY_SEPARATOR . $name . '.log';
}
return $this->log_path;
} | php | public function getPathToLogFile($name = 'm62')
{
if (is_null($this->log_path)) {
$this->log_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'logs') . DIRECTORY_SEPARATOR . $name . '.log';
}
return $this->log_path;
} | [
"public",
"function",
"getPathToLogFile",
"(",
"$",
"name",
"=",
"'m62'",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"log_path",
")",
")",
"{",
"$",
"this",
"->",
"log_path",
"=",
"realpath",
"(",
"dirname",
"(",
"__FILE__",
")",
".",
"D... | Returns the path to the log file
@param string $name
The name of the log file to use
@return \mithra62\Traits::$log_path | [
"Returns",
"the",
"path",
"to",
"the",
"log",
"file"
] | 8b8f81d142cdce5806fc611342441f2d47f15578 | https://github.com/jaeger-app/log/blob/8b8f81d142cdce5806fc611342441f2d47f15578/src/Traits/Log.php#L115-L122 |
238,731 | jaeger-app/log | src/Traits/Log.php | Log.removeLogFile | public function removeLogFile()
{
if (file_exists($this->log_path)) {
$this->logger = null;
unlink($this->log_path);
}
return $this;
} | php | public function removeLogFile()
{
if (file_exists($this->log_path)) {
$this->logger = null;
unlink($this->log_path);
}
return $this;
} | [
"public",
"function",
"removeLogFile",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"log_path",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"null",
";",
"unlink",
"(",
"$",
"this",
"->",
"log_path",
")",
";",
"}",
"return",
... | Removes the logging file
@return \mithra62\Traits\Log | [
"Removes",
"the",
"logging",
"file"
] | 8b8f81d142cdce5806fc611342441f2d47f15578 | https://github.com/jaeger-app/log/blob/8b8f81d142cdce5806fc611342441f2d47f15578/src/Traits/Log.php#L143-L151 |
238,732 | elumina-elearning/event | src/Emitter.php | Emitter.ensureListener | protected function ensureListener($listener)
{
if ($listener instanceof ListenerInterface) {
return $listener;
}
if (is_callable($listener)) {
return CallbackListener::fromCallable($listener);
}
throw new InvalidArgumentException('Listeners should be... | php | protected function ensureListener($listener)
{
if ($listener instanceof ListenerInterface) {
return $listener;
}
if (is_callable($listener)) {
return CallbackListener::fromCallable($listener);
}
throw new InvalidArgumentException('Listeners should be... | [
"protected",
"function",
"ensureListener",
"(",
"$",
"listener",
")",
"{",
"if",
"(",
"$",
"listener",
"instanceof",
"ListenerInterface",
")",
"{",
"return",
"$",
"listener",
";",
"}",
"if",
"(",
"is_callable",
"(",
"$",
"listener",
")",
")",
"{",
"return"... | Ensure the input is a listener.
@param ListenerInterface|callable $listener
@throws InvalidArgumentException
@return ListenerInterface | [
"Ensure",
"the",
"input",
"is",
"a",
"listener",
"."
] | e311372ee4b62388aee3629fb4b3ea530b42d17f | https://github.com/elumina-elearning/event/blob/e311372ee4b62388aee3629fb4b3ea530b42d17f/src/Emitter.php#L106-L117 |
238,733 | Flowpack/Flowpack.SingleSignOn.Server | Classes/Flowpack/SingleSignOn/Server/Controller/SessionController.php | SessionController.touchAction | public function touchAction($sessionId) {
if ($this->request->getHttpRequest()->getMethod() !== 'POST') {
$this->response->setStatus(405);
$this->response->setHeader('Allow', 'POST');
return;
}
$session = $this->sessionManager->getSession($sessionId);
if ($session !== NULL) {
$session->touch();
... | php | public function touchAction($sessionId) {
if ($this->request->getHttpRequest()->getMethod() !== 'POST') {
$this->response->setStatus(405);
$this->response->setHeader('Allow', 'POST');
return;
}
$session = $this->sessionManager->getSession($sessionId);
if ($session !== NULL) {
$session->touch();
... | [
"public",
"function",
"touchAction",
"(",
"$",
"sessionId",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"getHttpRequest",
"(",
")",
"->",
"getMethod",
"(",
")",
"!==",
"'POST'",
")",
"{",
"$",
"this",
"->",
"response",
"->",
"setStatus",
"... | Touch a session to refresh the last active timestamp
POST /sso/session/xyz-123/touch
@param string $sessionId The session id | [
"Touch",
"a",
"session",
"to",
"refresh",
"the",
"last",
"active",
"timestamp"
] | b1fa014f31d0d101a79cb95d5585b9973f35347d | https://github.com/Flowpack/Flowpack.SingleSignOn.Server/blob/b1fa014f31d0d101a79cb95d5585b9973f35347d/Classes/Flowpack/SingleSignOn/Server/Controller/SessionController.php#L73-L94 |
238,734 | Thuata/FrameworkBundle | Repository/RepositoryFactory.php | RepositoryFactory.getRepositoryForEntity | public function getRepositoryForEntity(string $entityName, string $connectionName = null): AbstractRepository
{
/** @var AbstractRepository $repository */
$repository = $this->loadFactorableInstance($entityName);
if (is_string($connectionName)) {
$entityManager = $this->getConta... | php | public function getRepositoryForEntity(string $entityName, string $connectionName = null): AbstractRepository
{
/** @var AbstractRepository $repository */
$repository = $this->loadFactorableInstance($entityName);
if (is_string($connectionName)) {
$entityManager = $this->getConta... | [
"public",
"function",
"getRepositoryForEntity",
"(",
"string",
"$",
"entityName",
",",
"string",
"$",
"connectionName",
"=",
"null",
")",
":",
"AbstractRepository",
"{",
"/** @var AbstractRepository $repository */",
"$",
"repository",
"=",
"$",
"this",
"->",
"loadFact... | Gets a repository for an entity
@param string $entityName
@param string $connectionName
@return AbstractRepository | [
"Gets",
"a",
"repository",
"for",
"an",
"entity"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Repository/RepositoryFactory.php#L130-L143 |
238,735 | Flowpack/Flowpack.SingleSignOn.Client | Classes/Flowpack/SingleSignOn/Client/Domain/Factory/SsoClientFactory.php | SsoClientFactory.create | public function create() {
$ssoClient = new \Flowpack\SingleSignOn\Client\Domain\Model\SsoClient();
if ((string)$this->clientServiceBaseUri === '') {
throw new Exception('Missing Flowpack.SingleSignOn.Client.client.serviceBaseUri setting', 1351075078);
}
$ssoClient->setServiceBaseUri($this->clientServiceBase... | php | public function create() {
$ssoClient = new \Flowpack\SingleSignOn\Client\Domain\Model\SsoClient();
if ((string)$this->clientServiceBaseUri === '') {
throw new Exception('Missing Flowpack.SingleSignOn.Client.client.serviceBaseUri setting', 1351075078);
}
$ssoClient->setServiceBaseUri($this->clientServiceBase... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"ssoClient",
"=",
"new",
"\\",
"Flowpack",
"\\",
"SingleSignOn",
"\\",
"Client",
"\\",
"Domain",
"\\",
"Model",
"\\",
"SsoClient",
"(",
")",
";",
"if",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"c... | Build a SSO client instance from settings
Note: Every SSO entry point and authentication provider uses the same SSO client.
@return \Flowpack\SingleSignOn\Client\Domain\Model\SsoClient | [
"Build",
"a",
"SSO",
"client",
"instance",
"from",
"settings"
] | 0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00 | https://github.com/Flowpack/Flowpack.SingleSignOn.Client/blob/0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00/Classes/Flowpack/SingleSignOn/Client/Domain/Factory/SsoClientFactory.php#L51-L62 |
238,736 | novuso/common | src/Domain/Type/StringObject.php | StringObject.delimitString | private static function delimitString(string $string, string $delimiter): string
{
$output = [];
if (preg_match('/\A[a-z0-9]+\z/ui', $string) && strtoupper($string) !== $string) {
$parts = self::explodeOnCaps($string);
} else {
$parts = self::explodeOnDelims($string)... | php | private static function delimitString(string $string, string $delimiter): string
{
$output = [];
if (preg_match('/\A[a-z0-9]+\z/ui', $string) && strtoupper($string) !== $string) {
$parts = self::explodeOnCaps($string);
} else {
$parts = self::explodeOnDelims($string)... | [
"private",
"static",
"function",
"delimitString",
"(",
"string",
"$",
"string",
",",
"string",
"$",
"delimiter",
")",
":",
"string",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"if",
"(",
"preg_match",
"(",
"'/\\A[a-z0-9]+\\z/ui'",
",",
"$",
"string",
")",
"... | Applies delimiter formatting to a string
@param string $string The original string
@param string $delimiter The delimiter
@return string | [
"Applies",
"delimiter",
"formatting",
"to",
"a",
"string"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Type/StringObject.php#L909-L924 |
238,737 | novuso/common | src/Domain/Type/StringObject.php | StringObject.explodeOnCaps | private static function explodeOnCaps(string $string): array
{
$string = preg_replace('/\B([A-Z])/', '_\1', $string);
$string = preg_replace('/([0-9]+)/', '_\1', $string);
$string = preg_replace('/_+/', '_', $string);
$string = trim($string, '_');
return explode('_', $string... | php | private static function explodeOnCaps(string $string): array
{
$string = preg_replace('/\B([A-Z])/', '_\1', $string);
$string = preg_replace('/([0-9]+)/', '_\1', $string);
$string = preg_replace('/_+/', '_', $string);
$string = trim($string, '_');
return explode('_', $string... | [
"private",
"static",
"function",
"explodeOnCaps",
"(",
"string",
"$",
"string",
")",
":",
"array",
"{",
"$",
"string",
"=",
"preg_replace",
"(",
"'/\\B([A-Z])/'",
",",
"'_\\1'",
",",
"$",
"string",
")",
";",
"$",
"string",
"=",
"preg_replace",
"(",
"'/([0-... | Splits a string into a list on capital letters
@param string $string The input string
@return array | [
"Splits",
"a",
"string",
"into",
"a",
"list",
"on",
"capital",
"letters"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Type/StringObject.php#L933-L941 |
238,738 | novuso/common | src/Domain/Type/StringObject.php | StringObject.explodeOnDelims | private static function explodeOnDelims(string $string): array
{
$string = preg_replace('/[^a-z0-9]+/i', '_', $string);
$string = trim($string, '_');
return explode('_', $string);
} | php | private static function explodeOnDelims(string $string): array
{
$string = preg_replace('/[^a-z0-9]+/i', '_', $string);
$string = trim($string, '_');
return explode('_', $string);
} | [
"private",
"static",
"function",
"explodeOnDelims",
"(",
"string",
"$",
"string",
")",
":",
"array",
"{",
"$",
"string",
"=",
"preg_replace",
"(",
"'/[^a-z0-9]+/i'",
",",
"'_'",
",",
"$",
"string",
")",
";",
"$",
"string",
"=",
"trim",
"(",
"$",
"string"... | Splits a string into a list on non-word breaks
@param string $string The input string
@return array | [
"Splits",
"a",
"string",
"into",
"a",
"list",
"on",
"non",
"-",
"word",
"breaks"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Type/StringObject.php#L950-L956 |
238,739 | gibboncms/gibbon | src/Modules/ModuleBag.php | ModuleBag.get | public function get($key = null)
{
if ($key === null) {
return $this;
}
if (!isset($this->modules[$key])) {
throw new ModuleDoesntExistException($key);
}
return $this->modules[$key];
} | php | public function get($key = null)
{
if ($key === null) {
return $this;
}
if (!isset($this->modules[$key])) {
throw new ModuleDoesntExistException($key);
}
return $this->modules[$key];
} | [
"public",
"function",
"get",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"modules",
"[",
"$",
"key",
"]",
")",
")",
... | Retrieve a registered module
@param string|null $key
@return \GibbonCms\Gibbon\Modules\Module|self | [
"Retrieve",
"a",
"registered",
"module"
] | 2905e90b2902149b3358b385264e98b97cf4fc00 | https://github.com/gibboncms/gibbon/blob/2905e90b2902149b3358b385264e98b97cf4fc00/src/Modules/ModuleBag.php#L32-L43 |
238,740 | JumpGateio/Menu | src/JumpGate/Menu/Traits/Linkable.php | Linkable.insertMenuObject | private function insertMenuObject($slug, $callback, $object)
{
$object->slug = $this->snakeName($slug);
$object->menu = $this->getMenu();
call_user_func($callback, $object);
if (! $object->insert) {
$this->links[] = $object;
}
} | php | private function insertMenuObject($slug, $callback, $object)
{
$object->slug = $this->snakeName($slug);
$object->menu = $this->getMenu();
call_user_func($callback, $object);
if (! $object->insert) {
$this->links[] = $object;
}
} | [
"private",
"function",
"insertMenuObject",
"(",
"$",
"slug",
",",
"$",
"callback",
",",
"$",
"object",
")",
"{",
"$",
"object",
"->",
"slug",
"=",
"$",
"this",
"->",
"snakeName",
"(",
"$",
"slug",
")",
";",
"$",
"object",
"->",
"menu",
"=",
"$",
"t... | Insert an object into the menu
@param $slug
@param $callback
@param $object | [
"Insert",
"an",
"object",
"into",
"the",
"menu"
] | 53e339cc0a070e3b8a8332fe32850699663fa215 | https://github.com/JumpGateio/Menu/blob/53e339cc0a070e3b8a8332fe32850699663fa215/src/JumpGate/Menu/Traits/Linkable.php#L101-L111 |
238,741 | lexide/reposition | src/Repository/AbstractRepository.php | AbstractRepository.configureMetadata | protected function configureMetadata()
{
$this->entityMetadata->setCollection($this->collectionName);
if (!empty($this->primaryKey)) {
$this->entityMetadata->setPrimaryKey($this->primaryKey);
}
} | php | protected function configureMetadata()
{
$this->entityMetadata->setCollection($this->collectionName);
if (!empty($this->primaryKey)) {
$this->entityMetadata->setPrimaryKey($this->primaryKey);
}
} | [
"protected",
"function",
"configureMetadata",
"(",
")",
"{",
"$",
"this",
"->",
"entityMetadata",
"->",
"setCollection",
"(",
"$",
"this",
"->",
"collectionName",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"primaryKey",
")",
")",
"{",
"$"... | Configure the metadata for the entity this repository interacts with
Override this method to set additional fields or define relationships with other entities | [
"Configure",
"the",
"metadata",
"for",
"the",
"entity",
"this",
"repository",
"interacts",
"with"
] | aa02735271f0c0ee4a3fb679093d4d3823963b3a | https://github.com/lexide/reposition/blob/aa02735271f0c0ee4a3fb679093d4d3823963b3a/src/Repository/AbstractRepository.php#L97-L103 |
238,742 | jc21/filelist | src/jc21/FileList.php | FileList.sort | protected function sort($items, $type = self::TYPE_BOTH, $by = self::KEY_NAME, $direction = self::ASC)
{
$returnArray = array();
if (count($items) > 0) {
$tmpArray = array();
foreach($items as $key => $value) {
$tmpArray[$key] = $value[$by];
}
... | php | protected function sort($items, $type = self::TYPE_BOTH, $by = self::KEY_NAME, $direction = self::ASC)
{
$returnArray = array();
if (count($items) > 0) {
$tmpArray = array();
foreach($items as $key => $value) {
$tmpArray[$key] = $value[$by];
}
... | [
"protected",
"function",
"sort",
"(",
"$",
"items",
",",
"$",
"type",
"=",
"self",
"::",
"TYPE_BOTH",
",",
"$",
"by",
"=",
"self",
"::",
"KEY_NAME",
",",
"$",
"direction",
"=",
"self",
"::",
"ASC",
")",
"{",
"$",
"returnArray",
"=",
"array",
"(",
"... | Order the results of a directory listing
@param array $items
@param string $type
@param string $by
@param string $direction
@return array | [
"Order",
"the",
"results",
"of",
"a",
"directory",
"listing"
] | 240c4c20e5ec584e7c5f35305cdec3f95fd48ffc | https://github.com/jc21/filelist/blob/240c4c20e5ec584e7c5f35305cdec3f95fd48ffc/src/jc21/FileList.php#L76-L116 |
238,743 | jc21/filelist | src/jc21/FileList.php | FileList.get | public function get($directory, $type = self::TYPE_BOTH, $order = self::KEY_NAME, $direction = self::ASC, $limit = null, $fileExtensions = array()) {
// Get the contents of the dir
$items = array();
$directory = rtrim($directory,'/');
// Check Dir
if (!is_dir($directory)) {
... | php | public function get($directory, $type = self::TYPE_BOTH, $order = self::KEY_NAME, $direction = self::ASC, $limit = null, $fileExtensions = array()) {
// Get the contents of the dir
$items = array();
$directory = rtrim($directory,'/');
// Check Dir
if (!is_dir($directory)) {
... | [
"public",
"function",
"get",
"(",
"$",
"directory",
",",
"$",
"type",
"=",
"self",
"::",
"TYPE_BOTH",
",",
"$",
"order",
"=",
"self",
"::",
"KEY_NAME",
",",
"$",
"direction",
"=",
"self",
"::",
"ASC",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"file... | Return the listing of a directory
@param string $directory
@param string $type
@param string $order
@param string $direction
@param int $limit
@param array $fileExtensions
@return array
@throws \Exception | [
"Return",
"the",
"listing",
"of",
"a",
"directory"
] | 240c4c20e5ec584e7c5f35305cdec3f95fd48ffc | https://github.com/jc21/filelist/blob/240c4c20e5ec584e7c5f35305cdec3f95fd48ffc/src/jc21/FileList.php#L131-L196 |
238,744 | jc21/filelist | src/jc21/FileList.php | FileList.getExtension | protected function getExtension($file)
{
if (strpos($file, '.') !== false) {
$tempExt = strtolower(substr($file, strrpos($file, '.') + 1, strlen($file) - strrpos($file, '.')));
return strtolower(trim($tempExt,'/'));
}
return '';
} | php | protected function getExtension($file)
{
if (strpos($file, '.') !== false) {
$tempExt = strtolower(substr($file, strrpos($file, '.') + 1, strlen($file) - strrpos($file, '.')));
return strtolower(trim($tempExt,'/'));
}
return '';
} | [
"protected",
"function",
"getExtension",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"file",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"$",
"tempExt",
"=",
"strtolower",
"(",
"substr",
"(",
"$",
"file",
",",
"strrpos",
"(",
"$",
"fi... | Returns the extension of a file, lowercase
@param string $file
@return string | [
"Returns",
"the",
"extension",
"of",
"a",
"file",
"lowercase"
] | 240c4c20e5ec584e7c5f35305cdec3f95fd48ffc | https://github.com/jc21/filelist/blob/240c4c20e5ec584e7c5f35305cdec3f95fd48ffc/src/jc21/FileList.php#L205-L212 |
238,745 | cubiclab/project-cube | controllers/SriController.php | SriController.actionTaskstatusindex | public function actionTaskstatusindex()
{
$searchModel = new SRITaskstatusSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('taskstatus_index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
... | php | public function actionTaskstatusindex()
{
$searchModel = new SRITaskstatusSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('taskstatus_index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
... | [
"public",
"function",
"actionTaskstatusindex",
"(",
")",
"{",
"$",
"searchModel",
"=",
"new",
"SRITaskstatusSearch",
"(",
")",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"queryParam... | Lists all SRITaskstatus models.
@return mixed | [
"Lists",
"all",
"SRITaskstatus",
"models",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/SriController.php#L38-L47 |
238,746 | cubiclab/project-cube | controllers/SriController.php | SriController.actionTaskstatuscreate | public function actionTaskstatuscreate()
{
$model = new SRI_Taskstatus();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['taskstatusview', 'id' => $model->id]);
} else {
return $this->render('taskstatus_create', [
... | php | public function actionTaskstatuscreate()
{
$model = new SRI_Taskstatus();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['taskstatusview', 'id' => $model->id]);
} else {
return $this->render('taskstatus_create', [
... | [
"public",
"function",
"actionTaskstatuscreate",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"SRI_Taskstatus",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
")",
")",
"&&",
"$",
... | Creates a new SRITaskstatus model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"SRITaskstatus",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/SriController.php#L66-L77 |
238,747 | cubiclab/project-cube | controllers/SriController.php | SriController.actionTaskstatusupdate | public function actionTaskstatusupdate($id)
{
$model = $this->findTaskstatusmodel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['taskstatusview', 'id' => $model->id]);
} else {
return $this->render('taskstatus_update'... | php | public function actionTaskstatusupdate($id)
{
$model = $this->findTaskstatusmodel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['taskstatusview', 'id' => $model->id]);
} else {
return $this->render('taskstatus_update'... | [
"public",
"function",
"actionTaskstatusupdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findTaskstatusmodel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->... | Updates an existing SRITaskstatus model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"SRITaskstatus",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 3a2a425d95ed76b999136c8a52bae9f3154b800a | https://github.com/cubiclab/project-cube/blob/3a2a425d95ed76b999136c8a52bae9f3154b800a/controllers/SriController.php#L85-L96 |
238,748 | easy-system/es-http | src/Uploading/UploadTarget.php | UploadTarget.set | public function set($target)
{
if (! is_string($target) || empty($target)) {
throw new InvalidArgumentException(
'Invalid target provided. Must be an non-empty string.'
);
}
$this->target = $target;
} | php | public function set($target)
{
if (! is_string($target) || empty($target)) {
throw new InvalidArgumentException(
'Invalid target provided. Must be an non-empty string.'
);
}
$this->target = $target;
} | [
"public",
"function",
"set",
"(",
"$",
"target",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"target",
")",
"||",
"empty",
"(",
"$",
"target",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Invalid target provided. Must be an non-empty ... | Sets the target of upload.
@param string $target The target of upload
@throws \InvalidArgumentException If the target is not string or empty string | [
"Sets",
"the",
"target",
"of",
"upload",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/UploadTarget.php#L43-L51 |
238,749 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/Query/Expr.php | Expr.references | public function references($document)
{
if ($this->currentField) {
$mapping = $this->class->getFieldMapping($this->currentField);
$dbRef = $this->dm->createDBRef($document, $mapping);
if (isset($mapping['simple']) && $mapping['simple']) {
$this->query[$ma... | php | public function references($document)
{
if ($this->currentField) {
$mapping = $this->class->getFieldMapping($this->currentField);
$dbRef = $this->dm->createDBRef($document, $mapping);
if (isset($mapping['simple']) && $mapping['simple']) {
$this->query[$ma... | [
"public",
"function",
"references",
"(",
"$",
"document",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currentField",
")",
"{",
"$",
"mapping",
"=",
"$",
"this",
"->",
"class",
"->",
"getFieldMapping",
"(",
"$",
"this",
"->",
"currentField",
")",
";",
"$",... | Checks that the value of the current field is a reference to the supplied document. | [
"Checks",
"that",
"the",
"value",
"of",
"the",
"current",
"field",
"is",
"a",
"reference",
"to",
"the",
"supplied",
"document",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/Query/Expr.php#L60-L85 |
238,750 | northern/PHP-Common | src/Northern/Common/Util/ObjectUtil.php | ObjectUtil.apply | public static function apply($object, array $values)
{
foreach ($values as $property => $value) {
// Check if the value is a map (associative array) by checking for
// a zero index.
if (is_array($value) and ! isset($value[0])) {
$method = "get".ucfirst($pr... | php | public static function apply($object, array $values)
{
foreach ($values as $property => $value) {
// Check if the value is a map (associative array) by checking for
// a zero index.
if (is_array($value) and ! isset($value[0])) {
$method = "get".ucfirst($pr... | [
"public",
"static",
"function",
"apply",
"(",
"$",
"object",
",",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
"{",
"// Check if the value is a map (associative array) by checking for",
"// a zero... | This method applies a given set of values to a given object.
The array with values supplied must be actual values of the
object and must be exposed through a corresponding setter method.
E.g. if you wish to set the value on a property called 'firstname'
then the object needs to have a 'setFirstname' setter method. If
... | [
"This",
"method",
"applies",
"a",
"given",
"set",
"of",
"values",
"to",
"a",
"given",
"object",
"."
] | 7c63ef19252fd540fb412a18af956b8563afaa55 | https://github.com/northern/PHP-Common/blob/7c63ef19252fd540fb412a18af956b8563afaa55/src/Northern/Common/Util/ObjectUtil.php#L98-L135 |
238,751 | northern/PHP-Common | src/Northern/Common/Util/ObjectUtil.php | ObjectUtil.validate | public static function validate($object, array $values, array $constraints)
{
$errors = array();
// Build a validator and get the entity constraints from the
// entity object.
$validatorBuilder = new ValidatorBuilder();
$validator = $validatorBuilder->getValidator();
... | php | public static function validate($object, array $values, array $constraints)
{
$errors = array();
// Build a validator and get the entity constraints from the
// entity object.
$validatorBuilder = new ValidatorBuilder();
$validator = $validatorBuilder->getValidator();
... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"object",
",",
"array",
"$",
"values",
",",
"array",
"$",
"constraints",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"// Build a validator and get the entity constraints from the",
"// entity object.",
... | This method will validate an object with the specified values.
If any of the values does not validate an array with errors will
be returned. The error message will be generated by the constraints
which are defined in the entity getConstraints method.
@param array $values
@th... | [
"This",
"method",
"will",
"validate",
"an",
"object",
"with",
"the",
"specified",
"values",
"."
] | 7c63ef19252fd540fb412a18af956b8563afaa55 | https://github.com/northern/PHP-Common/blob/7c63ef19252fd540fb412a18af956b8563afaa55/src/Northern/Common/Util/ObjectUtil.php#L148-L206 |
238,752 | jhorlima/wp-mocabonita | src/tools/MbResponse.php | MbResponse.redirect | public function redirect($url, array $params = [], $status = 302)
{
if (!empty($params)) {
$url = rtrim(preg_replace('/\?.*/', '', $url), '/');
$url .= "?" . http_build_query($params);
}
$this->statusCode = $status;
$this->headers->set('Location', $url);
... | php | public function redirect($url, array $params = [], $status = 302)
{
if (!empty($params)) {
$url = rtrim(preg_replace('/\?.*/', '', $url), '/');
$url .= "?" . http_build_query($params);
}
$this->statusCode = $status;
$this->headers->set('Location', $url);
... | [
"public",
"function",
"redirect",
"(",
"$",
"url",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"status",
"=",
"302",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
")",
")",
"{",
"$",
"url",
"=",
"rtrim",
"(",
"preg_replace",
... | Redirect a page
@param string $url
@param array $params
@param int $status
@return bool | [
"Redirect",
"a",
"page"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbResponse.php#L175-L191 |
238,753 | jhorlima/wp-mocabonita | src/tools/MbResponse.php | MbResponse.ajaxContent | protected function ajaxContent($content)
{
$message = null;
$this->header('Content-Type', 'application/json');
if ($content instanceof Arrayable) {
$content = $content->toArray();
} elseif (is_string($content)) {
$content = ['content' => $content];
}... | php | protected function ajaxContent($content)
{
$message = null;
$this->header('Content-Type', 'application/json');
if ($content instanceof Arrayable) {
$content = $content->toArray();
} elseif (is_string($content)) {
$content = ['content' => $content];
}... | [
"protected",
"function",
"ajaxContent",
"(",
"$",
"content",
")",
"{",
"$",
"message",
"=",
"null",
";",
"$",
"this",
"->",
"header",
"(",
"'Content-Type'",
",",
"'application/json'",
")",
";",
"if",
"(",
"$",
"content",
"instanceof",
"Arrayable",
")",
"{"... | Format content for json output
@param array|\Exception $content
@return array[] | [
"Format",
"content",
"for",
"json",
"output"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbResponse.php#L200-L237 |
238,754 | jhorlima/wp-mocabonita | src/tools/MbResponse.php | MbResponse.htmlContent | protected function htmlContent($content)
{
try {
$this->getMbAudit()->setResponseType('html');
if ($content instanceof \Exception) {
throw $content;
} elseif ($content instanceof \SplFileInfo && !$this->getMbRequest()->isBlogAdmin()) {
... | php | protected function htmlContent($content)
{
try {
$this->getMbAudit()->setResponseType('html');
if ($content instanceof \Exception) {
throw $content;
} elseif ($content instanceof \SplFileInfo && !$this->getMbRequest()->isBlogAdmin()) {
... | [
"protected",
"function",
"htmlContent",
"(",
"$",
"content",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getMbAudit",
"(",
")",
"->",
"setResponseType",
"(",
"'html'",
")",
";",
"if",
"(",
"$",
"content",
"instanceof",
"\\",
"Exception",
")",
"{",
"throw",... | Format content for html output
@param $content
@return void | [
"Format",
"content",
"for",
"html",
"output"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbResponse.php#L246-L291 |
238,755 | jhorlima/wp-mocabonita | src/tools/MbResponse.php | MbResponse.adminNotice | public function adminNotice($message, $type = 'success')
{
MbWPActionHook::addActionCallback('admin_notices', function () use ($message, $type) {
echo self::adminNoticeTemplate($message, $type);
});
} | php | public function adminNotice($message, $type = 'success')
{
MbWPActionHook::addActionCallback('admin_notices', function () use ($message, $type) {
echo self::adminNoticeTemplate($message, $type);
});
} | [
"public",
"function",
"adminNotice",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"'success'",
")",
"{",
"MbWPActionHook",
"::",
"addActionCallback",
"(",
"'admin_notices'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"message",
",",
"$",
"type",
")",
"{",
... | Post an admin notice on the dashboard
@param string $message
@param string $type | [
"Post",
"an",
"admin",
"notice",
"on",
"the",
"dashboard"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbResponse.php#L372-L377 |
238,756 | ronanchilvers/silex-spot2-provider | src/Provider/Spot2ServiceProvider.php | Spot2ServiceProvider.register | public function register(Container $container)
{
$container['spot2.connections'] = [];
$container['spot2.connections.default'] = null;
$container['spot2.config'] = function (Container $container) {
$config = new Config();
foreach ($container['spot2.connections... | php | public function register(Container $container)
{
$container['spot2.connections'] = [];
$container['spot2.connections.default'] = null;
$container['spot2.config'] = function (Container $container) {
$config = new Config();
foreach ($container['spot2.connections... | [
"public",
"function",
"register",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"container",
"[",
"'spot2.connections'",
"]",
"=",
"[",
"]",
";",
"$",
"container",
"[",
"'spot2.connections.default'",
"]",
"=",
"null",
";",
"$",
"container",
"[",
"'spot2... | Register this provider.
The spot2.connections array can have an arbitrary number of connections in
it. The array should use the following format:
<code>
$connections = [
'my_sqlite' => 'sqlite://path/to/my_database.sqlite',
'my_sqlite' => [
'dbname' => 'my_database',
'user' => 'username',
'password' => 'sshhh-s... | [
"Register",
"this",
"provider",
"."
] | 9b13856d9560f13604ad885ee4c94e374d5e3635 | https://github.com/ronanchilvers/silex-spot2-provider/blob/9b13856d9560f13604ad885ee4c94e374d5e3635/src/Provider/Spot2ServiceProvider.php#L45-L61 |
238,757 | setrun/setrun-component-sys | src/controllers/backend/LanguageController.php | LanguageController.actionEdit | public function actionEdit($id)
{
$model = $this->findModel($id);
$form = new LanguageForm($model);
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())){
if (!$errors = ActiveForm::validate($form)) {
try {
$this->service-... | php | public function actionEdit($id)
{
$model = $this->findModel($id);
$form = new LanguageForm($model);
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())){
if (!$errors = ActiveForm::validate($form)) {
try {
$this->service-... | [
"public",
"function",
"actionEdit",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"form",
"=",
"new",
"LanguageForm",
"(",
"$",
"model",
")",
";",
"if",
"(",
"Yii",
"::",
"$",
"app",
... | Edites an existing Language model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Edites",
"an",
"existing",
"Language",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/controllers/backend/LanguageController.php#L96-L112 |
238,758 | n0m4dz/laracasa | Zend/Gdata/AuthSub.php | Zend_Gdata_AuthSub.getAuthSubTokenUri | public static function getAuthSubTokenUri($next, $scope, $secure=0, $session=0,
$request_uri = self::AUTHSUB_REQUEST_URI)
{
$querystring = '?next=' . urlencode($next)
. '&scope=' . urldecode($scope)
. '&secure=' . urlencode($secure)
... | php | public static function getAuthSubTokenUri($next, $scope, $secure=0, $session=0,
$request_uri = self::AUTHSUB_REQUEST_URI)
{
$querystring = '?next=' . urlencode($next)
. '&scope=' . urldecode($scope)
. '&secure=' . urlencode($secure)
... | [
"public",
"static",
"function",
"getAuthSubTokenUri",
"(",
"$",
"next",
",",
"$",
"scope",
",",
"$",
"secure",
"=",
"0",
",",
"$",
"session",
"=",
"0",
",",
"$",
"request_uri",
"=",
"self",
"::",
"AUTHSUB_REQUEST_URI",
")",
"{",
"$",
"querystring",
"=",
... | Creates a URI to request a single-use AuthSub token.
@param string $next (required) URL identifying the service to be
accessed.
The resulting token will enable access to the specified service only.
Some services may limit scope further, such as read-only access.
@param string $scope (required) URL identifying the serv... | [
"Creates",
"a",
"URI",
"to",
"request",
"a",
"single",
"-",
"use",
"AuthSub",
"token",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/AuthSub.php#L79-L87 |
238,759 | n0m4dz/laracasa | Zend/Gdata/AuthSub.php | Zend_Gdata_AuthSub.getAuthSubSessionToken | public static function getAuthSubSessionToken(
$token, $client = null,
$request_uri = self::AUTHSUB_SESSION_TOKEN_URI)
{
$client = self::getHttpClient($token, $client);
if ($client instanceof Zend_Gdata_HttpClient) {
$filterResult = $client->filterHttpRequest('GE... | php | public static function getAuthSubSessionToken(
$token, $client = null,
$request_uri = self::AUTHSUB_SESSION_TOKEN_URI)
{
$client = self::getHttpClient($token, $client);
if ($client instanceof Zend_Gdata_HttpClient) {
$filterResult = $client->filterHttpRequest('GE... | [
"public",
"static",
"function",
"getAuthSubSessionToken",
"(",
"$",
"token",
",",
"$",
"client",
"=",
"null",
",",
"$",
"request_uri",
"=",
"self",
"::",
"AUTHSUB_SESSION_TOKEN_URI",
")",
"{",
"$",
"client",
"=",
"self",
"::",
"getHttpClient",
"(",
"$",
"tok... | Upgrades a single use token to a session token
@param string $token The single use token which is to be upgraded
@param Zend_Http_Client $client (optional) HTTP client to use to
make the request
@param string $request_uri (optional) URI to which to direct
the session token upgrade
@return string The upgraded token val... | [
"Upgrades",
"a",
"single",
"use",
"token",
"to",
"a",
"session",
"token"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/AuthSub.php#L102-L141 |
238,760 | n0m4dz/laracasa | Zend/Gdata/AuthSub.php | Zend_Gdata_AuthSub.AuthSubRevokeToken | public static function AuthSubRevokeToken($token, $client = null,
$request_uri = self::AUTHSUB_REVOKE_TOKEN_URI)
{
$client = self::getHttpClient($token, $client);
if ($client instanceof Zend_Gdata_HttpClient) {
$filterResult = $client->filte... | php | public static function AuthSubRevokeToken($token, $client = null,
$request_uri = self::AUTHSUB_REVOKE_TOKEN_URI)
{
$client = self::getHttpClient($token, $client);
if ($client instanceof Zend_Gdata_HttpClient) {
$filterResult = $client->filte... | [
"public",
"static",
"function",
"AuthSubRevokeToken",
"(",
"$",
"token",
",",
"$",
"client",
"=",
"null",
",",
"$",
"request_uri",
"=",
"self",
"::",
"AUTHSUB_REVOKE_TOKEN_URI",
")",
"{",
"$",
"client",
"=",
"self",
"::",
"getHttpClient",
"(",
"$",
"token",
... | Revoke a token
@param string $token The token to revoke
@param Zend_Http_Client $client (optional) HTTP client to use to make the request
@param string $request_uri (optional) URI to which to direct the revokation request
@return boolean Whether the revokation was successful
@throws Zend_Gdata_App_HttpException | [
"Revoke",
"a",
"token"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/AuthSub.php#L152-L183 |
238,761 | n0m4dz/laracasa | Zend/Gdata/AuthSub.php | Zend_Gdata_AuthSub.getAuthSubTokenInfo | public static function getAuthSubTokenInfo(
$token, $client = null, $request_uri = self::AUTHSUB_TOKEN_INFO_URI)
{
$client = self::getHttpClient($token, $client);
if ($client instanceof Zend_Gdata_HttpClient) {
$filterResult = $client->filterHttpRequest('GET', $request_uri);... | php | public static function getAuthSubTokenInfo(
$token, $client = null, $request_uri = self::AUTHSUB_TOKEN_INFO_URI)
{
$client = self::getHttpClient($token, $client);
if ($client instanceof Zend_Gdata_HttpClient) {
$filterResult = $client->filterHttpRequest('GET', $request_uri);... | [
"public",
"static",
"function",
"getAuthSubTokenInfo",
"(",
"$",
"token",
",",
"$",
"client",
"=",
"null",
",",
"$",
"request_uri",
"=",
"self",
"::",
"AUTHSUB_TOKEN_INFO_URI",
")",
"{",
"$",
"client",
"=",
"self",
"::",
"getHttpClient",
"(",
"$",
"token",
... | get token information
@param string $token The token to retrieve information about
@param Zend_Http_Client $client (optional) HTTP client to use to
make the request
@param string $request_uri (optional) URI to which to direct
the information request | [
"get",
"token",
"information"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/AuthSub.php#L195-L220 |
238,762 | n0m4dz/laracasa | Zend/Gdata/AuthSub.php | Zend_Gdata_AuthSub.getHttpClient | public static function getHttpClient($token, $client = null)
{
if ($client == null) {
$client = new Zend_Gdata_HttpClient();
}
if (!$client instanceof Zend_Gdata_HttpClient) {
require_once 'Zend/Gdata/App/HttpException.php';
throw new Zend_Gdata_App_HttpEx... | php | public static function getHttpClient($token, $client = null)
{
if ($client == null) {
$client = new Zend_Gdata_HttpClient();
}
if (!$client instanceof Zend_Gdata_HttpClient) {
require_once 'Zend/Gdata/App/HttpException.php';
throw new Zend_Gdata_App_HttpEx... | [
"public",
"static",
"function",
"getHttpClient",
"(",
"$",
"token",
",",
"$",
"client",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"client",
"==",
"null",
")",
"{",
"$",
"client",
"=",
"new",
"Zend_Gdata_HttpClient",
"(",
")",
";",
"}",
"if",
"(",
"!",
... | Retrieve a HTTP client object with AuthSub credentials attached
as the Authorization header
@param string $token The token to retrieve information about
@param Zend_Gdata_HttpClient $client (optional) HTTP client to use to make the request | [
"Retrieve",
"a",
"HTTP",
"client",
"object",
"with",
"AuthSub",
"credentials",
"attached",
"as",
"the",
"Authorization",
"header"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/AuthSub.php#L229-L246 |
238,763 | easy-system/es-dispatcher | src/Listener/DispatchesControllerListener.php | DispatchesControllerListener.onDispatch | public function onDispatch(SystemEvent $event)
{
$server = $this->getServer();
$request = $server->getRequest();
$controllerName = $request->getAttribute('controller');
if (! $controllerName) {
throw new RuntimeException(
'Unable to dispatch the system e... | php | public function onDispatch(SystemEvent $event)
{
$server = $this->getServer();
$request = $server->getRequest();
$controllerName = $request->getAttribute('controller');
if (! $controllerName) {
throw new RuntimeException(
'Unable to dispatch the system e... | [
"public",
"function",
"onDispatch",
"(",
"SystemEvent",
"$",
"event",
")",
"{",
"$",
"server",
"=",
"$",
"this",
"->",
"getServer",
"(",
")",
";",
"$",
"request",
"=",
"$",
"server",
"->",
"getRequest",
"(",
")",
";",
"$",
"controllerName",
"=",
"$",
... | Triggers the DispatchEvent.
@param \Es\System\SystemEvent $event The system event
@throws \RuntimeException If the ServerRequest not contain the
"controller" attribute | [
"Triggers",
"the",
"DispatchEvent",
"."
] | 3a2420113c72e544e15c1500717c918e7d5d4bf8 | https://github.com/easy-system/es-dispatcher/blob/3a2420113c72e544e15c1500717c918e7d5d4bf8/src/Listener/DispatchesControllerListener.php#L35-L66 |
238,764 | easy-system/es-dispatcher | src/Listener/DispatchesControllerListener.php | DispatchesControllerListener.doDispatch | public function doDispatch(DispatchEvent $event)
{
$controller = $event->getContext();
$action = $event->getParam('action') . 'Action';
$server = $this->getServer();
$request = $server->getRequest()->withAddedAttributes($event->getParams());
$response = $server->getRe... | php | public function doDispatch(DispatchEvent $event)
{
$controller = $event->getContext();
$action = $event->getParam('action') . 'Action';
$server = $this->getServer();
$request = $server->getRequest()->withAddedAttributes($event->getParams());
$response = $server->getRe... | [
"public",
"function",
"doDispatch",
"(",
"DispatchEvent",
"$",
"event",
")",
"{",
"$",
"controller",
"=",
"$",
"event",
"->",
"getContext",
"(",
")",
";",
"$",
"action",
"=",
"$",
"event",
"->",
"getParam",
"(",
"'action'",
")",
".",
"'Action'",
";",
"... | Dispatch the controller.
@param \Es\Dispatcher\DispatchEvent $event The event of dispatch | [
"Dispatch",
"the",
"controller",
"."
] | 3a2420113c72e544e15c1500717c918e7d5d4bf8 | https://github.com/easy-system/es-dispatcher/blob/3a2420113c72e544e15c1500717c918e7d5d4bf8/src/Listener/DispatchesControllerListener.php#L73-L84 |
238,765 | phossa2/libs | src/Phossa2/Cache/Utility/CachedCallable.php | CachedCallable.getTtlAndKey | protected function getTtlAndKey(array &$args)/*# : array */
{
if (is_numeric($args[0])) {
$ttl = (int) array_shift($args);
$key = $this->generateKey($args);
} else {
$key = $this->generateKey($args);
$ttl = $this->ttl;
}
return [$ttl, $... | php | protected function getTtlAndKey(array &$args)/*# : array */
{
if (is_numeric($args[0])) {
$ttl = (int) array_shift($args);
$key = $this->generateKey($args);
} else {
$key = $this->generateKey($args);
$ttl = $this->ttl;
}
return [$ttl, $... | [
"protected",
"function",
"getTtlAndKey",
"(",
"array",
"&",
"$",
"args",
")",
"/*# : array */",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"args",
"[",
"0",
"]",
")",
")",
"{",
"$",
"ttl",
"=",
"(",
"int",
")",
"array_shift",
"(",
"$",
"args",
")",
";... | Get TTL and unique key
@param array &$args
@return array
@access protected | [
"Get",
"TTL",
"and",
"unique",
"key"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Cache/Utility/CachedCallable.php#L112-L122 |
238,766 | browserfs/base | src/Event.php | Event.create | public static function create( $eventName, $eventArgs = null ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected!');
}
if ( null !== $eventArgs && !is_array( $eventArgs ) ) {
throw new \browserfs\Exception('Invalid argument $eventAr... | php | public static function create( $eventName, $eventArgs = null ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected!');
}
if ( null !== $eventArgs && !is_array( $eventArgs ) ) {
throw new \browserfs\Exception('Invalid argument $eventAr... | [
"public",
"static",
"function",
"create",
"(",
"$",
"eventName",
",",
"$",
"eventArgs",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"eventName",
")",
")",
"{",
"throw",
"new",
"\\",
"browserfs",
"\\",
"Exception",
"(",
"'Invalid argumen... | Creates a new event. Static constructor.
@param eventName - string - the name of the event
@param eventArgs - any[] | null - event arguments.
@throws \browserfs\Exception - if arguments are invalid
@return \browserfs\Event | [
"Creates",
"a",
"new",
"event",
".",
"Static",
"constructor",
"."
] | d98550b5cf6f6e9083f99f39d17fd1b79d61db55 | https://github.com/browserfs/base/blob/d98550b5cf6f6e9083f99f39d17fd1b79d61db55/src/Event.php#L84-L95 |
238,767 | monomelodies/dabble | src/Adapter.php | Adapter.select | public function select($table, $fields, $where = [], $options = [])
{
if (is_scalar($fields)) {
$fields = explode(',', $fields);
}
$query = new Select(
$this,
$table,
$fields,
new Where($where),
new Options($options)
... | php | public function select($table, $fields, $where = [], $options = [])
{
if (is_scalar($fields)) {
$fields = explode(',', $fields);
}
$query = new Select(
$this,
$table,
$fields,
new Where($where),
new Options($options)
... | [
"public",
"function",
"select",
"(",
"$",
"table",
",",
"$",
"fields",
",",
"$",
"where",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"fields",
")",
")",
"{",
"$",
"fields",
"=",
"explode",
"("... | Select rows from a table.
@param string $table The table(s) to query.
@param mixed $fields The field (column) to query.
@param mixed $where The where-clause.
@param mixed $options The options (limit, offset etc.).
@return function A lambda allowing you to access the found rows.
@throws Dabble\Query\SelectException whe... | [
"Select",
"rows",
"from",
"a",
"table",
"."
] | 4ba771cf90116b61821af8d15652cb6e5665e4b7 | https://github.com/monomelodies/dabble/blob/4ba771cf90116b61821af8d15652cb6e5665e4b7/src/Adapter.php#L213-L226 |
238,768 | monomelodies/dabble | src/Adapter.php | Adapter.fetch | public function fetch($table, $fields, $where = null, $options = [])
{
$options['limit'] = 1;
if (!isset($options['offset'])) {
$options['offset'] = 0;
}
$result = $this->select($table, $fields, $where, $options);
foreach ($result as $row) {
return $ro... | php | public function fetch($table, $fields, $where = null, $options = [])
{
$options['limit'] = 1;
if (!isset($options['offset'])) {
$options['offset'] = 0;
}
$result = $this->select($table, $fields, $where, $options);
foreach ($result as $row) {
return $ro... | [
"public",
"function",
"fetch",
"(",
"$",
"table",
",",
"$",
"fields",
",",
"$",
"where",
"=",
"null",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"[",
"'limit'",
"]",
"=",
"1",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"options"... | Retrieve a single row from the database.
@param string $table The table(s) to query.
@param string|array $fields The field(s) (column(s)) to query.
@param array $where An SQL where-array.
@param array $options Array of options.
@return array An array containing the result.
@throws Dabble\Query\SelectException when no ... | [
"Retrieve",
"a",
"single",
"row",
"from",
"the",
"database",
"."
] | 4ba771cf90116b61821af8d15652cb6e5665e4b7 | https://github.com/monomelodies/dabble/blob/4ba771cf90116b61821af8d15652cb6e5665e4b7/src/Adapter.php#L272-L282 |
238,769 | monomelodies/dabble | src/Adapter.php | Adapter.column | public function column($table, $field, $where = null, $options = null)
{
$results = $this->fetch($table, $field, $where, $options);
return array_shift($results);
} | php | public function column($table, $field, $where = null, $options = null)
{
$results = $this->fetch($table, $field, $where, $options);
return array_shift($results);
} | [
"public",
"function",
"column",
"(",
"$",
"table",
",",
"$",
"field",
",",
"$",
"where",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"table",
",",
"$",
"field",
",",
"$",
"... | Retrieve a single value from a single column.
@param string $table The table(s) to query.
@param string $field The field (column) to query.
@param array $where An SQL where-array.
@param array $options Array of options.
@return mixed A scalar containing the result, or null.
@throws Dabble\Query\SelectException when no... | [
"Retrieve",
"a",
"single",
"value",
"from",
"a",
"single",
"column",
"."
] | 4ba771cf90116b61821af8d15652cb6e5665e4b7 | https://github.com/monomelodies/dabble/blob/4ba771cf90116b61821af8d15652cb6e5665e4b7/src/Adapter.php#L295-L299 |
238,770 | monomelodies/dabble | src/Adapter.php | Adapter.fetchObject | public function fetchObject(
$class = null,
$table,
$fields,
$where = null,
$options = []
)
{
if (is_null($class)) {
$class = 'StdClass';
} elseif (is_object($class)) {
$class = get_class($class);
}
if (is_scalar($fi... | php | public function fetchObject(
$class = null,
$table,
$fields,
$where = null,
$options = []
)
{
if (is_null($class)) {
$class = 'StdClass';
} elseif (is_object($class)) {
$class = get_class($class);
}
if (is_scalar($fi... | [
"public",
"function",
"fetchObject",
"(",
"$",
"class",
"=",
"null",
",",
"$",
"table",
",",
"$",
"fields",
",",
"$",
"where",
"=",
"null",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"class",
")",
")",
"{",
"$... | Retrieve a single row as an object.
@param mixed $class Classname, object or null (defaults to StdClass) to
select into.
@param string $table The table(s) to query.
@param string $field The field (column) to query.
@param array $where An SQL where-array.
@param array $options Array of options.
@return mixed An object ... | [
"Retrieve",
"a",
"single",
"row",
"as",
"an",
"object",
"."
] | 4ba771cf90116b61821af8d15652cb6e5665e4b7 | https://github.com/monomelodies/dabble/blob/4ba771cf90116b61821af8d15652cb6e5665e4b7/src/Adapter.php#L324-L354 |
238,771 | monomelodies/dabble | src/Adapter.php | Adapter.update | public function update($table, array $fields, $where, $options = null)
{
$query = new Update(
$this,
$table,
$fields,
new Where($where),
new Options($options)
);
return $query->execute();
} | php | public function update($table, array $fields, $where, $options = null)
{
$query = new Update(
$this,
$table,
$fields,
new Where($where),
new Options($options)
);
return $query->execute();
} | [
"public",
"function",
"update",
"(",
"$",
"table",
",",
"array",
"$",
"fields",
",",
"$",
"where",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"new",
"Update",
"(",
"$",
"this",
",",
"$",
"table",
",",
"$",
"fields",
",",
"new"... | Update one or more rows in the database.
@param string $table The table to update.
@param array $fields Array Field => value pairs to update.
@param array $where Array of where statements to limit updates.
@return integer The number of affected (updated) rows.
@throws Dabble\Query\UpdateException if no rows were updat... | [
"Update",
"one",
"or",
"more",
"rows",
"in",
"the",
"database",
"."
] | 4ba771cf90116b61821af8d15652cb6e5665e4b7 | https://github.com/monomelodies/dabble/blob/4ba771cf90116b61821af8d15652cb6e5665e4b7/src/Adapter.php#L392-L402 |
238,772 | monomelodies/dabble | src/Adapter.php | Adapter.delete | public function delete($table, array $where)
{
$query = new Delete($this, $table, new Where($where));
return $query->execute();
} | php | public function delete($table, array $where)
{
$query = new Delete($this, $table, new Where($where));
return $query->execute();
} | [
"public",
"function",
"delete",
"(",
"$",
"table",
",",
"array",
"$",
"where",
")",
"{",
"$",
"query",
"=",
"new",
"Delete",
"(",
"$",
"this",
",",
"$",
"table",
",",
"new",
"Where",
"(",
"$",
"where",
")",
")",
";",
"return",
"$",
"query",
"->",... | Delete a row from the database.
@param string $table The table to delete from.
@param array $where Array of where statements to limit deletes.
@return int The number of deleted rows.
@throws Dabble\Query\DeleteException if no rows were deleted.
@throws Dabble\Query\SqlException on error. | [
"Delete",
"a",
"row",
"from",
"the",
"database",
"."
] | 4ba771cf90116b61821af8d15652cb6e5665e4b7 | https://github.com/monomelodies/dabble/blob/4ba771cf90116b61821af8d15652cb6e5665e4b7/src/Adapter.php#L413-L417 |
238,773 | rollun-com/rollun-permission | src/Permission/src/ConfigProvider.php | ConfigProvider.getDependencies | protected function getDependencies()
{
return [
'factories' => [
PermissionMiddleware::class => PermissionMiddlewareFactory::class,
ExpressiveRouteName::class => InvokableFactory::class,
PermissionMiddleware::class => PermissionMiddlewareFactory::c... | php | protected function getDependencies()
{
return [
'factories' => [
PermissionMiddleware::class => PermissionMiddlewareFactory::class,
ExpressiveRouteName::class => InvokableFactory::class,
PermissionMiddleware::class => PermissionMiddlewareFactory::c... | [
"protected",
"function",
"getDependencies",
"(",
")",
"{",
"return",
"[",
"'factories'",
"=>",
"[",
"PermissionMiddleware",
"::",
"class",
"=>",
"PermissionMiddlewareFactory",
"::",
"class",
",",
"ExpressiveRouteName",
"::",
"class",
"=>",
"InvokableFactory",
"::",
... | Returns the container dependencies
@return array | [
"Returns",
"the",
"container",
"dependencies"
] | 9f58c814337fcfd1e52ecfbf496f95d276d8217e | https://github.com/rollun-com/rollun-permission/blob/9f58c814337fcfd1e52ecfbf496f95d276d8217e/src/Permission/src/ConfigProvider.php#L140-L184 |
238,774 | binsoul/common | src/PropertyGenerator.php | PropertyGenerator.getGeneratedProperties | protected function getGeneratedProperties(): array
{
$reflectionObject = new \ReflectionObject($this);
$properties = $reflectionObject->getProperties(\ReflectionProperty::IS_PUBLIC);
$result = [];
foreach ($properties as $property) {
if (!$property->isPublic() || @$proper... | php | protected function getGeneratedProperties(): array
{
$reflectionObject = new \ReflectionObject($this);
$properties = $reflectionObject->getProperties(\ReflectionProperty::IS_PUBLIC);
$result = [];
foreach ($properties as $property) {
if (!$property->isPublic() || @$proper... | [
"protected",
"function",
"getGeneratedProperties",
"(",
")",
":",
"array",
"{",
"$",
"reflectionObject",
"=",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"this",
")",
";",
"$",
"properties",
"=",
"$",
"reflectionObject",
"->",
"getProperties",
"(",
"\\",
"Refle... | Returns an array of generated public properties.
@return \ReflectionProperty[] | [
"Returns",
"an",
"array",
"of",
"generated",
"public",
"properties",
"."
] | 668a62dada22727c0b75e9484dce587d7a490889 | https://github.com/binsoul/common/blob/668a62dada22727c0b75e9484dce587d7a490889/src/PropertyGenerator.php#L70-L84 |
238,775 | binsoul/common | src/PropertyGenerator.php | PropertyGenerator.removeGeneratedProperties | protected function removeGeneratedProperties()
{
$properties = $this->getGeneratedProperties();
foreach ($properties as $property) {
$name = $property->getName();
unset($this->{$name});
}
} | php | protected function removeGeneratedProperties()
{
$properties = $this->getGeneratedProperties();
foreach ($properties as $property) {
$name = $property->getName();
unset($this->{$name});
}
} | [
"protected",
"function",
"removeGeneratedProperties",
"(",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getGeneratedProperties",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"property",
")",
"{",
"$",
"name",
"=",
"$",
"property",
... | Removes all generated public properties. | [
"Removes",
"all",
"generated",
"public",
"properties",
"."
] | 668a62dada22727c0b75e9484dce587d7a490889 | https://github.com/binsoul/common/blob/668a62dada22727c0b75e9484dce587d7a490889/src/PropertyGenerator.php#L89-L97 |
238,776 | vitodtagliente/pure-template | View.php | View.namespace | public static function namespace($key, $path){
if(!array_key_exists($key, self::$namespaces))
self::$namespaces[$key] = $path;
} | php | public static function namespace($key, $path){
if(!array_key_exists($key, self::$namespaces))
self::$namespaces[$key] = $path;
} | [
"public",
"static",
"function",
"namespace",
"(",
"$",
"key",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"self",
"::",
"$",
"namespaces",
")",
")",
"self",
"::",
"$",
"namespaces",
"[",
"$",
"key",
"]",
"=... | specifica di namespace per le path | [
"specifica",
"di",
"namespace",
"per",
"le",
"path"
] | d3f3e38d7e425a5f9f6e17df405037f6001ff3e9 | https://github.com/vitodtagliente/pure-template/blob/d3f3e38d7e425a5f9f6e17df405037f6001ff3e9/View.php#L54-L57 |
238,777 | vitodtagliente/pure-template | View.php | View.render | public function render($direct_output = true)
{
// controlla che il file esista
if($this->exists() == false)
return false;
// Carica il contenuto e imposta i parametri settati
// come variabili di contesto
extract($this->params);
ob_start();
inclu... | php | public function render($direct_output = true)
{
// controlla che il file esista
if($this->exists() == false)
return false;
// Carica il contenuto e imposta i parametri settati
// come variabili di contesto
extract($this->params);
ob_start();
inclu... | [
"public",
"function",
"render",
"(",
"$",
"direct_output",
"=",
"true",
")",
"{",
"// controlla che il file esista",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
"==",
"false",
")",
"return",
"false",
";",
"// Carica il contenuto e imposta i parametri settati",... | genera la vista | [
"genera",
"la",
"vista"
] | d3f3e38d7e425a5f9f6e17df405037f6001ff3e9 | https://github.com/vitodtagliente/pure-template/blob/d3f3e38d7e425a5f9f6e17df405037f6001ff3e9/View.php#L92-L128 |
238,778 | vitodtagliente/pure-template | View.php | View.make | public static function make($filename, $params = array(), $direct_output = true){
$view = new View($filename, $params);
return $view->render($direct_output);
} | php | public static function make($filename, $params = array(), $direct_output = true){
$view = new View($filename, $params);
return $view->render($direct_output);
} | [
"public",
"static",
"function",
"make",
"(",
"$",
"filename",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"direct_output",
"=",
"true",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"(",
"$",
"filename",
",",
"$",
"params",
")",
";",
"return... | funzione statica per la generazione di viste immediate | [
"funzione",
"statica",
"per",
"la",
"generazione",
"di",
"viste",
"immediate"
] | d3f3e38d7e425a5f9f6e17df405037f6001ff3e9 | https://github.com/vitodtagliente/pure-template/blob/d3f3e38d7e425a5f9f6e17df405037f6001ff3e9/View.php#L139-L142 |
238,779 | tacowordpress/util | src/Util/Html.php | Html.attribs | public static function attribs($attribs, $leading_space = true)
{
if (!Arr::iterable($attribs)) {
return '';
}
$out = array();
foreach ($attribs as $k => $v) {
$v = (is_array($v)) ? join(' ', $v) : $v;
$out[] = $k . '="' . str_replace('"',... | php | public static function attribs($attribs, $leading_space = true)
{
if (!Arr::iterable($attribs)) {
return '';
}
$out = array();
foreach ($attribs as $k => $v) {
$v = (is_array($v)) ? join(' ', $v) : $v;
$out[] = $k . '="' . str_replace('"',... | [
"public",
"static",
"function",
"attribs",
"(",
"$",
"attribs",
",",
"$",
"leading_space",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"iterable",
"(",
"$",
"attribs",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"out",
"=",
"array",
"(",
... | Get a string of attributes given the attributes as an array
@param array $attribs
@param $leading_space
@return string | [
"Get",
"a",
"string",
"of",
"attributes",
"given",
"the",
"attributes",
"as",
"an",
"array"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Html.php#L17-L29 |
238,780 | tacowordpress/util | src/Util/Html.php | Html.image | public static function image($src, $alt = null, $attribs = array())
{
$attribs = array_merge(array('src'=>$src), $attribs);
if ($alt) {
$attribs['alt'] = htmlentities($alt);
}
return self::tag('img', null, $attribs);
} | php | public static function image($src, $alt = null, $attribs = array())
{
$attribs = array_merge(array('src'=>$src), $attribs);
if ($alt) {
$attribs['alt'] = htmlentities($alt);
}
return self::tag('img', null, $attribs);
} | [
"public",
"static",
"function",
"image",
"(",
"$",
"src",
",",
"$",
"alt",
"=",
"null",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attribs",
"=",
"array_merge",
"(",
"array",
"(",
"'src'",
"=>",
"$",
"src",
")",
",",
"$",
"attri... | Generate an img tag
@param string $src
@param string $alt
@param array $attribs
@return string | [
"Generate",
"an",
"img",
"tag"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Html.php#L74-L82 |
238,781 | tacowordpress/util | src/Util/Html.php | Html.listy | public static function listy($items, $attribs = array(), $type = 'ul')
{
if (!Arr::iterable($items)) {
return '';
}
$htmls = array();
$htmls[] = '<' . $type . self::attribs($attribs) . '>';
foreach ($items as $item) {
$htmls[] = '<li>' . $item... | php | public static function listy($items, $attribs = array(), $type = 'ul')
{
if (!Arr::iterable($items)) {
return '';
}
$htmls = array();
$htmls[] = '<' . $type . self::attribs($attribs) . '>';
foreach ($items as $item) {
$htmls[] = '<li>' . $item... | [
"public",
"static",
"function",
"listy",
"(",
"$",
"items",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
",",
"$",
"type",
"=",
"'ul'",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"iterable",
"(",
"$",
"items",
")",
")",
"{",
"return",
"''",
";",
"}... | Get an HTML list
@param array $items
@param array $attribs
@param string $type | [
"Get",
"an",
"HTML",
"list"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Html.php#L144-L157 |
238,782 | tacowordpress/util | src/Util/Html.php | Html.alisty | public static function alisty($items, $attribs = array(), $type = 'ul', $active_title = null)
{
if (!Arr::iterable($items)) {
return '';
}
$htmls = array();
$htmls[] = '<' . $type . self::attribs($attribs) . '>';
foreach ($items as $title => $href) {
... | php | public static function alisty($items, $attribs = array(), $type = 'ul', $active_title = null)
{
if (!Arr::iterable($items)) {
return '';
}
$htmls = array();
$htmls[] = '<' . $type . self::attribs($attribs) . '>';
foreach ($items as $title => $href) {
... | [
"public",
"static",
"function",
"alisty",
"(",
"$",
"items",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
",",
"$",
"type",
"=",
"'ul'",
",",
"$",
"active_title",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"iterable",
"(",
"$",
"items",
... | Get an HTML list of links
@param array $items
@param array $attribs
@param string $type
@param string $active_title | [
"Get",
"an",
"HTML",
"list",
"of",
"links"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Html.php#L167-L187 |
238,783 | tacowordpress/util | src/Util/Html.php | Html.selecty | public static function selecty($options, $selected = null, $attribs = array())
{
$htmls = array();
$htmls[] = self::select(null, $attribs, false);
if (Arr::iterable($options)) {
foreach ($options as $value => $title) {
$option_attribs = array('value'=>$value);
... | php | public static function selecty($options, $selected = null, $attribs = array())
{
$htmls = array();
$htmls[] = self::select(null, $attribs, false);
if (Arr::iterable($options)) {
foreach ($options as $value => $title) {
$option_attribs = array('value'=>$value);
... | [
"public",
"static",
"function",
"selecty",
"(",
"$",
"options",
",",
"$",
"selected",
"=",
"null",
",",
"$",
"attribs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"htmls",
"=",
"array",
"(",
")",
";",
"$",
"htmls",
"[",
"]",
"=",
"self",
"::",
"selec... | Get a select list
@param array $options
@param string $selected
@param array $attribs
@return string | [
"Get",
"a",
"select",
"list"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Html.php#L197-L213 |
238,784 | tacowordpress/util | src/Util/Html.php | Html.tably | public static function tably($records)
{
if (count($records) === 0) {
return null;
}
$htmls = array();
$htmls[] = '<table>';
foreach ($records as $record) {
$htmls[] = '<tr>';
foreach ($record as $k => $v) {
$htmls[... | php | public static function tably($records)
{
if (count($records) === 0) {
return null;
}
$htmls = array();
$htmls[] = '<table>';
foreach ($records as $record) {
$htmls[] = '<tr>';
foreach ($record as $k => $v) {
$htmls[... | [
"public",
"static",
"function",
"tably",
"(",
"$",
"records",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"records",
")",
"===",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"htmls",
"=",
"array",
"(",
")",
";",
"$",
"htmls",
"[",
"]",
"=",
"'<t... | Get a table
@param array $records
@return string | [
"Get",
"a",
"table"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Html.php#L221-L238 |
238,785 | donquixote/hasty-reflection-common | src/Reflection/ClassLike/AllInterfaces/AllInterfacesBase.php | AllInterfacesBase.getAllInterfaces | function getAllInterfaces($includeSelf) {
if (NULL === $this->interfacesAll) {
$this->interfacesAllInclSelf = $this->interfacesAll = $this->buildAllInterfacesWithoutSelf();
if (NULL !== $this->selfInterfaceName) {
$selfInterface = $this->classIndex->classGetReflection($this->selfInterfaceName);
... | php | function getAllInterfaces($includeSelf) {
if (NULL === $this->interfacesAll) {
$this->interfacesAllInclSelf = $this->interfacesAll = $this->buildAllInterfacesWithoutSelf();
if (NULL !== $this->selfInterfaceName) {
$selfInterface = $this->classIndex->classGetReflection($this->selfInterfaceName);
... | [
"function",
"getAllInterfaces",
"(",
"$",
"includeSelf",
")",
"{",
"if",
"(",
"NULL",
"===",
"$",
"this",
"->",
"interfacesAll",
")",
"{",
"$",
"this",
"->",
"interfacesAllInclSelf",
"=",
"$",
"this",
"->",
"interfacesAll",
"=",
"$",
"this",
"->",
"buildAl... | Gets all interfaces directly or indirectly implemented by this class.
Will include the class itself if it is an interface.
@param bool $includeSelf
@return \Donquixote\HastyReflectionCommon\Reflection\ClassLike\ClassLikeReflectionInterface[] | [
"Gets",
"all",
"interfaces",
"directly",
"or",
"indirectly",
"implemented",
"by",
"this",
"class",
"."
] | e1f4851a80fe82b90e8e145a01e26e90c7f6e3c2 | https://github.com/donquixote/hasty-reflection-common/blob/e1f4851a80fe82b90e8e145a01e26e90c7f6e3c2/src/Reflection/ClassLike/AllInterfaces/AllInterfacesBase.php#L51-L64 |
238,786 | zepi/turbo-base | Zepi/Web/General/src/Entity/MenuEntry.php | MenuEntry.hasVisibleChildren | public function hasVisibleChildren()
{
foreach ($this->children as $child) {
if (!($child instanceof \Zepi\Web\General\Entity\HiddenMenuEntry)) {
return true;
}
}
return false;
} | php | public function hasVisibleChildren()
{
foreach ($this->children as $child) {
if (!($child instanceof \Zepi\Web\General\Entity\HiddenMenuEntry)) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasVisibleChildren",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"child",
"instanceof",
"\\",
"Zepi",
"\\",
"Web",
"\\",
"General",
"\\",
"Entity",
"\\",
... | Returns true if the menu entry has one or more children which are
visible. Otherwise returns false.
@access public
@return boolean | [
"Returns",
"true",
"if",
"the",
"menu",
"entry",
"has",
"one",
"or",
"more",
"children",
"which",
"are",
"visible",
".",
"Otherwise",
"returns",
"false",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Entity/MenuEntry.php#L243-L252 |
238,787 | zepi/turbo-base | Zepi/Web/General/src/Entity/MenuEntry.php | MenuEntry.shouldHide | public function shouldHide()
{
if (!$this->hideWhenEmpty) {
return false;
}
foreach ($this->children as $child) {
if (!$child->shouldHide()) {
return false;
}
}
return true;
} | php | public function shouldHide()
{
if (!$this->hideWhenEmpty) {
return false;
}
foreach ($this->children as $child) {
if (!$child->shouldHide()) {
return false;
}
}
return true;
} | [
"public",
"function",
"shouldHide",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hideWhenEmpty",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"!",
"$",
"child",... | Returns true if the menu entry should be hidden
@access public
@return boolean | [
"Returns",
"true",
"if",
"the",
"menu",
"entry",
"should",
"be",
"hidden"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Entity/MenuEntry.php#L260-L273 |
238,788 | zepi/turbo-base | Zepi/Web/General/src/Entity/MenuEntry.php | MenuEntry.addChild | public function addChild(MenuEntry $child)
{
if (isset($this->children[$child->getKey()])) {
return false;
}
$this->children[$child->getKey()] = $child;
// Sets this MenuEntry as parent of the child
$child->setParent($this);
retu... | php | public function addChild(MenuEntry $child)
{
if (isset($this->children[$child->getKey()])) {
return false;
}
$this->children[$child->getKey()] = $child;
// Sets this MenuEntry as parent of the child
$child->setParent($this);
retu... | [
"public",
"function",
"addChild",
"(",
"MenuEntry",
"$",
"child",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"children",
"[",
"$",
"child",
"->",
"getKey",
"(",
")",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"... | Adds a MenuEntry as child and add this MenuEntry as
parent of the child.
@access public
@param \Zepi\Web\General\Entity\MenuEntry $child
@return boolean | [
"Adds",
"a",
"MenuEntry",
"as",
"child",
"and",
"add",
"this",
"MenuEntry",
"as",
"parent",
"of",
"the",
"child",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Entity/MenuEntry.php#L301-L313 |
238,789 | zepi/turbo-base | Zepi/Web/General/src/Entity/MenuEntry.php | MenuEntry.getBestTarget | public function getBestTarget()
{
if ($this->hasParent() && ($this->target == '' || $this->target == '#')) {
return $this->parent->getBestTarget();
}
return $this->target;
} | php | public function getBestTarget()
{
if ($this->hasParent() && ($this->target == '' || $this->target == '#')) {
return $this->parent->getBestTarget();
}
return $this->target;
} | [
"public",
"function",
"getBestTarget",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasParent",
"(",
")",
"&&",
"(",
"$",
"this",
"->",
"target",
"==",
"''",
"||",
"$",
"this",
"->",
"target",
"==",
"'#'",
")",
")",
"{",
"return",
"$",
"this",
"... | Returns the best available target, if the menu entry has no target the
target of the parent object will be returned.
@return string | [
"Returns",
"the",
"best",
"available",
"target",
"if",
"the",
"menu",
"entry",
"has",
"no",
"target",
"the",
"target",
"of",
"the",
"parent",
"object",
"will",
"be",
"returned",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Entity/MenuEntry.php#L354-L361 |
238,790 | zepi/turbo-base | Zepi/Web/General/src/Entity/MenuEntry.php | MenuEntry.setActive | public function setActive($isActive)
{
$this->isActive = (bool) $isActive;
if ($this->parent !== null) {
$this->parent->setActive($isActive);
}
} | php | public function setActive($isActive)
{
$this->isActive = (bool) $isActive;
if ($this->parent !== null) {
$this->parent->setActive($isActive);
}
} | [
"public",
"function",
"setActive",
"(",
"$",
"isActive",
")",
"{",
"$",
"this",
"->",
"isActive",
"=",
"(",
"bool",
")",
"$",
"isActive",
";",
"if",
"(",
"$",
"this",
"->",
"parent",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"parent",
"->",
"setA... | Sets the menu entry as active
@access public
@param boolean $isActive | [
"Sets",
"the",
"menu",
"entry",
"as",
"active"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/src/Entity/MenuEntry.php#L369-L376 |
238,791 | jagilpe/entity-list-bundle | EntityList/Cell/SingleFieldCell.php | SingleFieldCell.getFieldGetter | protected function getFieldGetter(\ReflectionClass $reflectionClass, $fieldName)
{
foreach (array('get', 'is', 'has') as $prefix) {
$getter = $prefix.ucfirst($fieldName);
$reflectionMethod = $reflectionClass->getMethod($getter);
if ($reflectionMethod && $reflectionMethod... | php | protected function getFieldGetter(\ReflectionClass $reflectionClass, $fieldName)
{
foreach (array('get', 'is', 'has') as $prefix) {
$getter = $prefix.ucfirst($fieldName);
$reflectionMethod = $reflectionClass->getMethod($getter);
if ($reflectionMethod && $reflectionMethod... | [
"protected",
"function",
"getFieldGetter",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
",",
"$",
"fieldName",
")",
"{",
"foreach",
"(",
"array",
"(",
"'get'",
",",
"'is'",
",",
"'has'",
")",
"as",
"$",
"prefix",
")",
"{",
"$",
"getter",
"=",
"$... | Returns the Reflection Method of the getter of the field
@param \ReflectionClass $reflectionClass
@param string $fieldName
@throws EntityListException
@return ReflectionMethod | [
"Returns",
"the",
"Reflection",
"Method",
"of",
"the",
"getter",
"of",
"the",
"field"
] | 54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc | https://github.com/jagilpe/entity-list-bundle/blob/54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc/EntityList/Cell/SingleFieldCell.php#L154-L166 |
238,792 | bkdotcom/Form | src/Field.php | Field.build | public function build($propOverride = array())
{
$this->debug->info(__METHOD__, $this->attribs['name']);
if ($propOverride == 'tagOnly') {
$propOverride = array('tagOnly' => true);
} elseif (!\is_array($propOverride)) {
$this->debug->warn('invalid propOverride', $prop... | php | public function build($propOverride = array())
{
$this->debug->info(__METHOD__, $this->attribs['name']);
if ($propOverride == 'tagOnly') {
$propOverride = array('tagOnly' => true);
} elseif (!\is_array($propOverride)) {
$this->debug->warn('invalid propOverride', $prop... | [
"public",
"function",
"build",
"(",
"$",
"propOverride",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"info",
"(",
"__METHOD__",
",",
"$",
"this",
"->",
"attribs",
"[",
"'name'",
"]",
")",
";",
"if",
"(",
"$",
"propOverride",
... | Build html control
@param array $propOverride properties to override
@return string | [
"Build",
"html",
"control"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L93-L110 |
238,793 | bkdotcom/Form | src/Field.php | Field.doValidate | public function doValidate()
{
$isValid = true;
if ($this->props['validate']) {
$isValid = \call_user_func($this->props['validate'], $this);
}
return $isValid;
} | php | public function doValidate()
{
$isValid = true;
if ($this->props['validate']) {
$isValid = \call_user_func($this->props['validate'], $this);
}
return $isValid;
} | [
"public",
"function",
"doValidate",
"(",
")",
"{",
"$",
"isValid",
"=",
"true",
";",
"if",
"(",
"$",
"this",
"->",
"props",
"[",
"'validate'",
"]",
")",
"{",
"$",
"isValid",
"=",
"\\",
"call_user_func",
"(",
"$",
"this",
"->",
"props",
"[",
"'validat... | Extend me to perform custom validation
@return boolean valid? | [
"Extend",
"me",
"to",
"perform",
"custom",
"validation"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L141-L148 |
238,794 | bkdotcom/Form | src/Field.php | Field.flag | public function flag($reason = null)
{
$this->props['isValid'] = false;
$this->classAdd($this->props['attribsContainer'], 'has-error');
if ($this->attribs['type'] == 'file' && isset($this->form->currentValues[ $this->attribs['name'] ])) {
$fileInfo = $this->form->currentValues[ $... | php | public function flag($reason = null)
{
$this->props['isValid'] = false;
$this->classAdd($this->props['attribsContainer'], 'has-error');
if ($this->attribs['type'] == 'file' && isset($this->form->currentValues[ $this->attribs['name'] ])) {
$fileInfo = $this->form->currentValues[ $... | [
"public",
"function",
"flag",
"(",
"$",
"reason",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"props",
"[",
"'isValid'",
"]",
"=",
"false",
";",
"$",
"this",
"->",
"classAdd",
"(",
"$",
"this",
"->",
"props",
"[",
"'attribsContainer'",
"]",
",",
"'has-... | Flag a field as invalid
@param string $reason The reason that will be given to the user
@return void | [
"Flag",
"a",
"field",
"as",
"invalid"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L157-L170 |
238,795 | bkdotcom/Form | src/Field.php | Field.focus | public function focus()
{
if (\in_array($this->attribs['type'], array('checkbox', 'radio'))) {
$keys = \array_keys($this->props['options']);
$this->props['options'][ $keys[0] ]['autofocus'] = true;
} else {
$this->attribs['autofocus'] = true;
}
} | php | public function focus()
{
if (\in_array($this->attribs['type'], array('checkbox', 'radio'))) {
$keys = \array_keys($this->props['options']);
$this->props['options'][ $keys[0] ]['autofocus'] = true;
} else {
$this->attribs['autofocus'] = true;
}
} | [
"public",
"function",
"focus",
"(",
")",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"this",
"->",
"attribs",
"[",
"'type'",
"]",
",",
"array",
"(",
"'checkbox'",
",",
"'radio'",
")",
")",
")",
"{",
"$",
"keys",
"=",
"\\",
"array_keys",
"(",
"$",
... | Sets autofocus attribute
@return void | [
"Sets",
"autofocus",
"attribute"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L177-L185 |
238,796 | bkdotcom/Form | src/Field.php | Field.getId | public function getId()
{
$id = $this->props['attribs']['id'];
$sepChar = '_'; // character to join prefix and id
$repChar = '_'; // replace \W with this char
if (!$id && $this->props['attribs']['name']) {
$id = \preg_replace('/\W/', $repChar, $this->props['attribs']['nam... | php | public function getId()
{
$id = $this->props['attribs']['id'];
$sepChar = '_'; // character to join prefix and id
$repChar = '_'; // replace \W with this char
if (!$id && $this->props['attribs']['name']) {
$id = \preg_replace('/\W/', $repChar, $this->props['attribs']['nam... | [
"public",
"function",
"getId",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"props",
"[",
"'attribs'",
"]",
"[",
"'id'",
"]",
";",
"$",
"sepChar",
"=",
"'_'",
";",
"// character to join prefix and id",
"$",
"repChar",
"=",
"'_'",
";",
"// replace \\... | Returns ID attribute
If ID attribute is non-existant, ID will be derived from name and prefix
@return string|null | [
"Returns",
"ID",
"attribute",
"If",
"ID",
"attribute",
"is",
"non",
"-",
"existant",
"ID",
"will",
"be",
"derived",
"from",
"name",
"and",
"prefix"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L193-L214 |
238,797 | bkdotcom/Form | src/Field.php | Field.getUniqueId | public function getUniqueId($increment = true)
{
$id = $this->getId();
if ($id) {
$sepChar = '_';
if (isset(self::$idCounts[$id])) {
if ($increment) {
self::$idCounts[$id] ++;
}
if (self::$idCounts[$id] > 1) ... | php | public function getUniqueId($increment = true)
{
$id = $this->getId();
if ($id) {
$sepChar = '_';
if (isset(self::$idCounts[$id])) {
if ($increment) {
self::$idCounts[$id] ++;
}
if (self::$idCounts[$id] > 1) ... | [
"public",
"function",
"getUniqueId",
"(",
"$",
"increment",
"=",
"true",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"$",
"id",
")",
"{",
"$",
"sepChar",
"=",
"'_'",
";",
"if",
"(",
"isset",
"(",
"self",
"::"... | Returns unique ID.
Checks if ID already used... Increments static counter
@param boolean $increment increment static counter?
@return string|null u\Unique ID | [
"Returns",
"unique",
"ID",
"."
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L225-L242 |
238,798 | bkdotcom/Form | src/Field.php | Field.isRequired | public function isRequired()
{
$isRequired = $this->attribs['required'];
if (\is_string($isRequired)) {
$replaced = \preg_replace('/{{(.*?)}}/', '$this->form->getField("$1")->val()', $isRequired);
$evalString = '$isRequired = (bool) '.$replaced.';';
eval($evalStri... | php | public function isRequired()
{
$isRequired = $this->attribs['required'];
if (\is_string($isRequired)) {
$replaced = \preg_replace('/{{(.*?)}}/', '$this->form->getField("$1")->val()', $isRequired);
$evalString = '$isRequired = (bool) '.$replaced.';';
eval($evalStri... | [
"public",
"function",
"isRequired",
"(",
")",
"{",
"$",
"isRequired",
"=",
"$",
"this",
"->",
"attribs",
"[",
"'required'",
"]",
";",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"isRequired",
")",
")",
"{",
"$",
"replaced",
"=",
"\\",
"preg_replace",
"(",
... | Is field required?
@return boolean | [
"Is",
"field",
"required?"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L249-L258 |
238,799 | bkdotcom/Form | src/Field.php | Field.setProps | public function setProps($props = array())
{
$props = $this->moveShortcuts($props);
$type = isset($props['attribs']['type']) ? $props['attribs']['type'] : null;
$typeChanging = $type && (!isset($this->attribs['type']) || $type !== $this->attribs['type']);
$propsType = $typeChanging &... | php | public function setProps($props = array())
{
$props = $this->moveShortcuts($props);
$type = isset($props['attribs']['type']) ? $props['attribs']['type'] : null;
$typeChanging = $type && (!isset($this->attribs['type']) || $type !== $this->attribs['type']);
$propsType = $typeChanging &... | [
"public",
"function",
"setProps",
"(",
"$",
"props",
"=",
"array",
"(",
")",
")",
"{",
"$",
"props",
"=",
"$",
"this",
"->",
"moveShortcuts",
"(",
"$",
"props",
")",
";",
"$",
"type",
"=",
"isset",
"(",
"$",
"props",
"[",
"'attribs'",
"]",
"[",
"... | Set field properties
@param array $props [description]
@return void | [
"Set",
"field",
"properties"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Field.php#L267-L290 |
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.