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
193,800
miBadger/miBadger.Router
src/Router.php
Router.count
public function count() { $result = 0; foreach ($this->routes as $routes) { $result += count($routes); } return $result; }
php
public function count() { $result = 0; foreach ($this->routes as $routes) { $result += count($routes); } return $result; }
[ "public", "function", "count", "(", ")", "{", "$", "result", "=", "0", ";", "foreach", "(", "$", "this", "->", "routes", "as", "$", "routes", ")", "{", "$", "result", "+=", "count", "(", "$", "routes", ")", ";", "}", "return", "$", "result", ";",...
Returns the number of key-value mappings in the router map. @return int the number of key-value mappings in the router map.
[ "Returns", "the", "number", "of", "key", "-", "value", "mappings", "in", "the", "router", "map", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L76-L85
193,801
miBadger/miBadger.Router
src/Router.php
Router.containsCallable
public function containsCallable(callable $callable) { foreach ($this->routes as $method) { foreach ($method as $entry) { if ($entry->callable === $callable) { return true; } } } return false; }
php
public function containsCallable(callable $callable) { foreach ($this->routes as $method) { foreach ($method as $entry) { if ($entry->callable === $callable) { return true; } } } return false; }
[ "public", "function", "containsCallable", "(", "callable", "$", "callable", ")", "{", "foreach", "(", "$", "this", "->", "routes", "as", "$", "method", ")", "{", "foreach", "(", "$", "method", "as", "$", "entry", ")", "{", "if", "(", "$", "entry", "-...
Returns true if the router map maps one or more routes to the specified callable. @param callable $callable @return bool true if the router map maps one or more routes to the specified callable.
[ "Returns", "true", "if", "the", "router", "map", "maps", "one", "or", "more", "routes", "to", "the", "specified", "callable", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L115-L127
193,802
miBadger/miBadger.Router
src/Router.php
Router.get
public function get($method, $route) { if (!array_key_exists($method, $this->routes)) { return null; } foreach ($this->routes[$method] as $key => $entry) { if ($entry->route == $route) { return $entry->callable; } } return null; }
php
public function get($method, $route) { if (!array_key_exists($method, $this->routes)) { return null; } foreach ($this->routes[$method] as $key => $entry) { if ($entry->route == $route) { return $entry->callable; } } return null; }
[ "public", "function", "get", "(", "$", "method", ",", "$", "route", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "method", ",", "$", "this", "->", "routes", ")", ")", "{", "return", "null", ";", "}", "foreach", "(", "$", "this", "->", ...
Returns the callable to which the specified route is mapped, or null if the router map contains no mapping for the route. @param string $method @param string $route @return callable the callable to which the specified route is mapped, or null if the router map contains no mapping for the route.
[ "Returns", "the", "callable", "to", "which", "the", "specified", "route", "is", "mapped", "or", "null", "if", "the", "router", "map", "contains", "no", "mapping", "for", "the", "route", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L136-L149
193,803
miBadger/miBadger.Router
src/Router.php
Router.set
public function set($methods, $route, callable $callable) { if (is_string($methods)) { $methods = [$methods]; } foreach ($methods as $method) { $this->add($method, $route, $callable); } return $this; }
php
public function set($methods, $route, callable $callable) { if (is_string($methods)) { $methods = [$methods]; } foreach ($methods as $method) { $this->add($method, $route, $callable); } return $this; }
[ "public", "function", "set", "(", "$", "methods", ",", "$", "route", ",", "callable", "$", "callable", ")", "{", "if", "(", "is_string", "(", "$", "methods", ")", ")", "{", "$", "methods", "=", "[", "$", "methods", "]", ";", "}", "foreach", "(", ...
Associates the specified callable with the specified method & route in the route map. @param string|array $methods @param string $route @param callable $callable @return $this
[ "Associates", "the", "specified", "callable", "with", "the", "specified", "method", "&", "route", "in", "the", "route", "map", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L159-L170
193,804
miBadger/miBadger.Router
src/Router.php
Router.add
private function add(string $method, string $route, callable $callable) { $entry = (object)[ 'route' => $route, 'pattern' => $this->createPattern($route), 'callable' => $callable ]; if (!array_key_exists($method, $this->routes)) { $this->routes[$method] = []; } $this->routes[$method][] = $entry...
php
private function add(string $method, string $route, callable $callable) { $entry = (object)[ 'route' => $route, 'pattern' => $this->createPattern($route), 'callable' => $callable ]; if (!array_key_exists($method, $this->routes)) { $this->routes[$method] = []; } $this->routes[$method][] = $entry...
[ "private", "function", "add", "(", "string", "$", "method", ",", "string", "$", "route", ",", "callable", "$", "callable", ")", "{", "$", "entry", "=", "(", "object", ")", "[", "'route'", "=>", "$", "route", ",", "'pattern'", "=>", "$", "this", "->",...
Adds a method & route to the to the route map. @param string $method @param string $route @param callable $callable
[ "Adds", "a", "method", "&", "route", "to", "the", "to", "the", "route", "map", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L179-L192
193,805
miBadger/miBadger.Router
src/Router.php
Router.remove
public function remove($method, $route) { if (!array_key_exists($method, $this->routes)) { return; } foreach ($this->routes[$method] as $key => $entry) { if ($entry->route == $route) { unset($this->routes[$method][$key]); } } if (count($this->routes[$method]) == 0) { unset($this->routes[$me...
php
public function remove($method, $route) { if (!array_key_exists($method, $this->routes)) { return; } foreach ($this->routes[$method] as $key => $entry) { if ($entry->route == $route) { unset($this->routes[$method][$key]); } } if (count($this->routes[$method]) == 0) { unset($this->routes[$me...
[ "public", "function", "remove", "(", "$", "method", ",", "$", "route", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "method", ",", "$", "this", "->", "routes", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "this", "->", "routes...
Removes the mapping for the specified route from the router map if present. @param string $method @param string $route @return null
[ "Removes", "the", "mapping", "for", "the", "specified", "route", "from", "the", "router", "map", "if", "present", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L212-L227
193,806
miBadger/miBadger.Router
src/Router.php
Router.resolve
public function resolve($method = null, $route = null) { $serverRequest = new ServerRequest(); if ($method === null) { $method = $serverRequest->getMethod(); } if ($route === null) { $route = $serverRequest->getUri()->getPath(); } if ($this->basePath !== '' && strpos($route, $this->basePath, 0) ==...
php
public function resolve($method = null, $route = null) { $serverRequest = new ServerRequest(); if ($method === null) { $method = $serverRequest->getMethod(); } if ($route === null) { $route = $serverRequest->getUri()->getPath(); } if ($this->basePath !== '' && strpos($route, $this->basePath, 0) ==...
[ "public", "function", "resolve", "(", "$", "method", "=", "null", ",", "$", "route", "=", "null", ")", "{", "$", "serverRequest", "=", "new", "ServerRequest", "(", ")", ";", "if", "(", "$", "method", "===", "null", ")", "{", "$", "method", "=", "$"...
Returns the result of the given route's callable. @param string|null $method = new ServerRequest()->getMethod() @param string|null $route = new ServerRequest()->getUri()->getPath() @return mixed the result of the given route's callable. @throws ServerResponseException
[ "Returns", "the", "result", "of", "the", "given", "route", "s", "callable", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L247-L264
193,807
miBadger/miBadger.Router
src/Router.php
Router.getCallable
private function getCallable($method, $route) { if (!array_key_exists($method, $this->routes)) { throw new ServerResponseException(new ServerResponse(404)); } foreach ($this->routes[$method] as $entry) { if (preg_match($entry->pattern, $route, $matches) > 0) { array_shift($matches); return [$entry...
php
private function getCallable($method, $route) { if (!array_key_exists($method, $this->routes)) { throw new ServerResponseException(new ServerResponse(404)); } foreach ($this->routes[$method] as $entry) { if (preg_match($entry->pattern, $route, $matches) > 0) { array_shift($matches); return [$entry...
[ "private", "function", "getCallable", "(", "$", "method", ",", "$", "route", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "method", ",", "$", "this", "->", "routes", ")", ")", "{", "throw", "new", "ServerResponseException", "(", "new", "Server...
Returns the callable to which the specied method and route are mapped. @param string $method @param string $route @return array the callable to which the specied method and route are mapped and the route matches. @throws ServerResponseException
[ "Returns", "the", "callable", "to", "which", "the", "specied", "method", "and", "route", "are", "mapped", "." ]
ed6936329b0f7d06adc6519bf57feb1b8e51d2da
https://github.com/miBadger/miBadger.Router/blob/ed6936329b0f7d06adc6519bf57feb1b8e51d2da/src/Router.php#L274-L288
193,808
eureka-framework/component-http
src/Http/Cookies.php
Cookie.set
public function set($name, $value = null, $time = 2592000) { $value = json_encode($value); parent::set($name, $value); setcookie($name, $value, time() + $time, '/', $this->server->get('name')); }
php
public function set($name, $value = null, $time = 2592000) { $value = json_encode($value); parent::set($name, $value); setcookie($name, $value, time() + $time, '/', $this->server->get('name')); }
[ "public", "function", "set", "(", "$", "name", ",", "$", "value", "=", "null", ",", "$", "time", "=", "2592000", ")", "{", "$", "value", "=", "json_encode", "(", "$", "value", ")", ";", "parent", "::", "set", "(", "$", "name", ",", "$", "value", ...
Set cookie information. @param string $name Cookie Name @param mixed $value Cookie Value @param int $time Cookie Lifetime. @return void
[ "Set", "cookie", "information", "." ]
698c3b73581a9703a9c932890c57e50f8774607a
https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Cookies.php#L52-L58
193,809
ARCANESOFT/Auth
src/Seeds/RolesSeeder.php
RolesSeeder.seed
public function seed(array $roles) { Role::query()->insert( $this->prepareRoles($roles) ); $this->syncAdminRole(); }
php
public function seed(array $roles) { Role::query()->insert( $this->prepareRoles($roles) ); $this->syncAdminRole(); }
[ "public", "function", "seed", "(", "array", "$", "roles", ")", "{", "Role", "::", "query", "(", ")", "->", "insert", "(", "$", "this", "->", "prepareRoles", "(", "$", "roles", ")", ")", ";", "$", "this", "->", "syncAdminRole", "(", ")", ";", "}" ]
Seed roles. @param array $roles
[ "Seed", "roles", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/RolesSeeder.php#L26-L33
193,810
ARCANESOFT/Auth
src/Seeds/RolesSeeder.php
RolesSeeder.prepareRoles
protected function prepareRoles(array $roles) { $now = now(); return array_map(function ($role) use ($now) { return array_merge($role, [ 'slug' => $role['slug'] ?? $this->slugify($role['name']), 'is_locked' => $role['is_locked'] ?? true, ...
php
protected function prepareRoles(array $roles) { $now = now(); return array_map(function ($role) use ($now) { return array_merge($role, [ 'slug' => $role['slug'] ?? $this->slugify($role['name']), 'is_locked' => $role['is_locked'] ?? true, ...
[ "protected", "function", "prepareRoles", "(", "array", "$", "roles", ")", "{", "$", "now", "=", "now", "(", ")", ";", "return", "array_map", "(", "function", "(", "$", "role", ")", "use", "(", "$", "now", ")", "{", "return", "array_merge", "(", "$", ...
Prepare roles to seed. @param array $roles @return array
[ "Prepare", "roles", "to", "seed", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/RolesSeeder.php#L47-L60
193,811
ARCANESOFT/Auth
src/Seeds/RolesSeeder.php
RolesSeeder.syncAdminRole
protected function syncAdminRole() { /** @var \Arcanesoft\Auth\Models\Role $admin */ $admin = Role::admin()->first(); $admin->permissions()->sync( Permission::all()->pluck('id')->toArray() ); }
php
protected function syncAdminRole() { /** @var \Arcanesoft\Auth\Models\Role $admin */ $admin = Role::admin()->first(); $admin->permissions()->sync( Permission::all()->pluck('id')->toArray() ); }
[ "protected", "function", "syncAdminRole", "(", ")", "{", "/** @var \\Arcanesoft\\Auth\\Models\\Role $admin */", "$", "admin", "=", "Role", "::", "admin", "(", ")", "->", "first", "(", ")", ";", "$", "admin", "->", "permissions", "(", ")", "->", "sync", "(", ...
Sync the admin role with all permissions.
[ "Sync", "the", "admin", "role", "with", "all", "permissions", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/RolesSeeder.php#L65-L72
193,812
ARCANESOFT/Auth
src/Seeds/RolesSeeder.php
RolesSeeder.syncRoles
protected function syncRoles(array $roles) { /** @var \Illuminate\Database\Eloquent\Collection $permissions */ $permissions = Permission::all(); foreach ($roles as $roleSlug => $permissionSlug) { /** @var \Arcanesoft\Auth\Models\Role $role */ if ($role = Role::quer...
php
protected function syncRoles(array $roles) { /** @var \Illuminate\Database\Eloquent\Collection $permissions */ $permissions = Permission::all(); foreach ($roles as $roleSlug => $permissionSlug) { /** @var \Arcanesoft\Auth\Models\Role $role */ if ($role = Role::quer...
[ "protected", "function", "syncRoles", "(", "array", "$", "roles", ")", "{", "/** @var \\Illuminate\\Database\\Eloquent\\Collection $permissions */", "$", "permissions", "=", "Permission", "::", "all", "(", ")", ";", "foreach", "(", "$", "roles", "as", "$", "roleSlug...
Sync the roles. @param array $roles
[ "Sync", "the", "roles", "." ]
b33ca82597a76b1e395071f71ae3e51f1ec67e62
https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Seeds/RolesSeeder.php#L91-L108
193,813
gplcart/cli
controllers/commands/Product.php
Product.cmdGetProduct
public function cmdGetProduct() { $result = $this->getListProduct(); $this->outputFormat($result); $this->outputFormatTableProduct($result); $this->output(); }
php
public function cmdGetProduct() { $result = $this->getListProduct(); $this->outputFormat($result); $this->outputFormatTableProduct($result); $this->output(); }
[ "public", "function", "cmdGetProduct", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListProduct", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableProduct", "(", "$", "resul...
Callback for "product-get" command
[ "Callback", "for", "product", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Product.php#L49-L55
193,814
gplcart/cli
controllers/commands/Product.php
Product.cmdUpdateProduct
public function cmdUpdateProduct() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateProduct() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateProduct", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "...
Callback for "product-update" command
[ "Callback", "for", "product", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Product.php#L131-L150
193,815
gplcart/cli
controllers/commands/Product.php
Product.addProduct
protected function addProduct() { if (!$this->isError()) { $id = $this->product->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addProduct() { if (!$this->isError()) { $id = $this->product->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addProduct", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "product", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if", ...
Add a new product
[ "Add", "a", "new", "product" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Product.php#L239-L248
193,816
gplcart/cli
controllers/commands/Product.php
Product.submitAddProduct
protected function submitAddProduct() { $this->setSubmitted(null, $this->getParam()); $this->setSubmitted('form', true); // Internal flag. Specifies that the product submitted manually $this->validateComponent('product'); $this->addProduct(); }
php
protected function submitAddProduct() { $this->setSubmitted(null, $this->getParam()); $this->setSubmitted('form', true); // Internal flag. Specifies that the product submitted manually $this->validateComponent('product'); $this->addProduct(); }
[ "protected", "function", "submitAddProduct", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "setSubmitted", "(", "'form'", ",", "true", ")", ";", "// Internal flag...
Add a new product at once
[ "Add", "a", "new", "product", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Product.php#L264-L270
193,817
gplcart/cli
controllers/commands/Product.php
Product.wizardAddProduct
protected function wizardAddProduct() { // Required $this->validatePrompt('title', $this->text('Title'), 'product'); // Optional $this->validatePrompt('description', $this->text('Description'), 'product'); $this->validatePrompt('store_id', $this->text('Store ID'), 'product',...
php
protected function wizardAddProduct() { // Required $this->validatePrompt('title', $this->text('Title'), 'product'); // Optional $this->validatePrompt('description', $this->text('Description'), 'product'); $this->validatePrompt('store_id', $this->text('Store ID'), 'product',...
[ "protected", "function", "wizardAddProduct", "(", ")", "{", "// Required", "$", "this", "->", "validatePrompt", "(", "'title'", ",", "$", "this", "->", "text", "(", "'Title'", ")", ",", "'product'", ")", ";", "// Optional", "$", "this", "->", "validatePrompt...
Add a new product step by step
[ "Add", "a", "new", "product", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Product.php#L275-L311
193,818
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/FileUtility/FileObject/PhpClassFile.php
PhpClassFile.getClassNames
public function getClassNames ( $withNamespace = true ) { $tokens = new \PHP_Token_Stream($this->_content); $classes = $tokens->getClasses(); $classNames = array(); foreach ( $classes as $className => $class ) { $namespace = $class['package']['namespace']; if ( $w...
php
public function getClassNames ( $withNamespace = true ) { $tokens = new \PHP_Token_Stream($this->_content); $classes = $tokens->getClasses(); $classNames = array(); foreach ( $classes as $className => $class ) { $namespace = $class['package']['namespace']; if ( $w...
[ "public", "function", "getClassNames", "(", "$", "withNamespace", "=", "true", ")", "{", "$", "tokens", "=", "new", "\\", "PHP_Token_Stream", "(", "$", "this", "->", "_content", ")", ";", "$", "classes", "=", "$", "tokens", "->", "getClasses", "(", ")", ...
Get class names defined in target file @param bool $withNamespace @return array defined class names
[ "Get", "class", "names", "defined", "in", "target", "file" ]
01df286751f5b9a5c90c47138dca3709e5bc383b
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/FileUtility/FileObject/PhpClassFile.php#L41-L53
193,819
gplcart/cli
controllers/commands/Collection.php
Collection.cmdGetCollection
public function cmdGetCollection() { $result = $this->getListCollection(); $this->outputFormat($result); $this->outputFormatTableCollection($result); $this->output(); }
php
public function cmdGetCollection() { $result = $this->getListCollection(); $this->outputFormat($result); $this->outputFormatTableCollection($result); $this->output(); }
[ "public", "function", "cmdGetCollection", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListCollection", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableCollection", "(", "$",...
Callback for "collection-get" command
[ "Callback", "for", "collection", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Collection.php#L40-L46
193,820
gplcart/cli
controllers/commands/Collection.php
Collection.cmdDeleteCollection
public function cmdDeleteCollection() { $id = $this->getParam(0); $all = $this->getParam('all'); if (empty($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $options = null; if (isset($id)) { if ($this->getParam(...
php
public function cmdDeleteCollection() { $id = $this->getParam(0); $all = $this->getParam('all'); if (empty($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $options = null; if (isset($id)) { if ($this->getParam(...
[ "public", "function", "cmdDeleteCollection", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "all", "=", "$", "this", "->", "getParam", "(", "'all'", ")", ";", "if", "(", "empty", "(", "$", "id", ")", "&&", ...
Callback for "collection-delete" command
[ "Callback", "for", "collection", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Collection.php#L51-L103
193,821
gplcart/cli
controllers/commands/Collection.php
Collection.cmdUpdateCollection
public function cmdUpdateCollection() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateCollection() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateCollection", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", ...
Callback for "collection-update" command
[ "Callback", "for", "collection", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Collection.php#L122-L140
193,822
gplcart/cli
controllers/commands/Collection.php
Collection.addCollection
protected function addCollection() { if (!$this->isError()) { $id = $this->collection->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addCollection() { if (!$this->isError()) { $id = $this->collection->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addCollection", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "collection", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "...
Add a new collection
[ "Add", "a", "new", "collection" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Collection.php#L207-L216
193,823
gplcart/cli
controllers/commands/Collection.php
Collection.submitAddCollection
protected function submitAddCollection() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('collection'); $this->addCollection(); }
php
protected function submitAddCollection() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('collection'); $this->addCollection(); }
[ "protected", "function", "submitAddCollection", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'collection'", ")", ";", "$", "this", "->...
Add a new collection at once
[ "Add", "a", "new", "collection", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Collection.php#L232-L237
193,824
gplcart/cli
controllers/commands/Collection.php
Collection.wizardAddCollection
protected function wizardAddCollection() { $this->validatePrompt('title', $this->text('Title'), 'collection'); $this->validateMenu('type', $this->text('Type'), 'collection', $this->collection->getTypes()); $this->validatePrompt('store_id', $this->text('Store'), 'collection'); $this->...
php
protected function wizardAddCollection() { $this->validatePrompt('title', $this->text('Title'), 'collection'); $this->validateMenu('type', $this->text('Type'), 'collection', $this->collection->getTypes()); $this->validatePrompt('store_id', $this->text('Store'), 'collection'); $this->...
[ "protected", "function", "wizardAddCollection", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'title'", ",", "$", "this", "->", "text", "(", "'Title'", ")", ",", "'collection'", ")", ";", "$", "this", "->", "validateMenu", "(", "'type'", ",", ...
Add a new collection step by step
[ "Add", "a", "new", "collection", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Collection.php#L242-L252
193,825
Xsaven/laravel-intelect-admin
src/Addons/Scaffold/FactoryCreator.php
FactoryCreator.create
public function create($timestamps = true, $softDeletes = false, $fields=[]) { $path = $this->getpath($this->name); if ($this->files->exists($path)) { throw new \Exception("Factory [$this->name] already exists!"); } $stub = $this->files->get($this->getStub()); ...
php
public function create($timestamps = true, $softDeletes = false, $fields=[]) { $path = $this->getpath($this->name); if ($this->files->exists($path)) { throw new \Exception("Factory [$this->name] already exists!"); } $stub = $this->files->get($this->getStub()); ...
[ "public", "function", "create", "(", "$", "timestamps", "=", "true", ",", "$", "softDeletes", "=", "false", ",", "$", "fields", "=", "[", "]", ")", "{", "$", "path", "=", "$", "this", "->", "getpath", "(", "$", "this", "->", "name", ")", ";", "if...
Create a new factory file. @param string $keyName @param bool|true $timestamps @param bool|false $softDeletes @throws \Exception @return string
[ "Create", "a", "new", "factory", "file", "." ]
592574633d12c74cf25b43dd6694fee496abefcb
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/Scaffold/FactoryCreator.php#L59-L77
193,826
Xsaven/laravel-intelect-admin
src/Addons/Scaffold/FactoryCreator.php
FactoryCreator.getPath
public function getPath($name) { $segments = explode('\\', $name); array_shift($segments); if($this->path) return $this->path.'/'.ucfirst(array_last($segments)).'Factory.php'; else return database_path('factories/'.ucfirst(array_last($segments))).'Factory.php...
php
public function getPath($name) { $segments = explode('\\', $name); array_shift($segments); if($this->path) return $this->path.'/'.ucfirst(array_last($segments)).'Factory.php'; else return database_path('factories/'.ucfirst(array_last($segments))).'Factory.php...
[ "public", "function", "getPath", "(", "$", "name", ")", "{", "$", "segments", "=", "explode", "(", "'\\\\'", ",", "$", "name", ")", ";", "array_shift", "(", "$", "segments", ")", ";", "if", "(", "$", "this", "->", "path", ")", "return", "$", "this"...
Get path for migration file. @param string $name @return string
[ "Get", "path", "for", "migration", "file", "." ]
592574633d12c74cf25b43dd6694fee496abefcb
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/Scaffold/FactoryCreator.php#L86-L96
193,827
Xsaven/laravel-intelect-admin
src/Addons/Scaffold/FactoryCreator.php
FactoryCreator.replaceFakerArray
protected function replaceFakerArray(&$stub, $fields, $timestamps, $softDeletes) { $array = []; foreach ($fields as $f){ if(!empty($f['fakerFunction']) || !empty($f['fkey'])){ $params = !empty($f['fakerFunctionParams']) ? "({$f['fakerFunctionParams']})":""; ...
php
protected function replaceFakerArray(&$stub, $fields, $timestamps, $softDeletes) { $array = []; foreach ($fields as $f){ if(!empty($f['fakerFunction']) || !empty($f['fkey'])){ $params = !empty($f['fakerFunctionParams']) ? "({$f['fakerFunctionParams']})":""; ...
[ "protected", "function", "replaceFakerArray", "(", "&", "$", "stub", ",", "$", "fields", ",", "$", "timestamps", ",", "$", "softDeletes", ")", "{", "$", "array", "=", "[", "]", ";", "foreach", "(", "$", "fields", "as", "$", "f", ")", "{", "if", "("...
Replace Faker array dummy. @param string $stub @param string $name @return $this
[ "Replace", "Faker", "array", "dummy", "." ]
592574633d12c74cf25b43dd6694fee496abefcb
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/Scaffold/FactoryCreator.php#L152-L178
193,828
bseddon/XPath20
DOM/DOMXPathItemTrait.php
DOMXPathItemTrait.getIsNode
public function getIsNode() { return ! is_null( $this->domNode ) && isset( DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] ); }
php
public function getIsNode() { return ! is_null( $this->domNode ) && isset( DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] ); }
[ "public", "function", "getIsNode", "(", ")", "{", "return", "!", "is_null", "(", "$", "this", "->", "domNode", ")", "&&", "isset", "(", "DOMXPathNavigator", "::", "$", "nodeTypeMap", "[", "$", "this", "->", "domNode", "->", "nodeType", "]", ")", ";", "...
Gets a value indicating whether the item represents an XPath node or an atomic value @return bool
[ "Gets", "a", "value", "indicating", "whether", "the", "item", "represents", "an", "XPath", "node", "or", "an", "atomic", "value" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathItemTrait.php#L51-L54
193,829
bseddon/XPath20
DOM/DOMXPathItemTrait.php
DOMXPathItemTrait.getValue
public function getValue() { if ( is_null( $this->domNode ) ) { return ""; } if ( $this->domNode instanceof \DOMNameSpaceNode ) { /** @var \DOMNameSpaceNode $ns */ $ns = $this->domNode; return $ns->nodeValue; } // BMS 2017-12-30 This used to return the textContent property. ...
php
public function getValue() { if ( is_null( $this->domNode ) ) { return ""; } if ( $this->domNode instanceof \DOMNameSpaceNode ) { /** @var \DOMNameSpaceNode $ns */ $ns = $this->domNode; return $ns->nodeValue; } // BMS 2017-12-30 This used to return the textContent property. ...
[ "public", "function", "getValue", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "domNode", ")", ")", "{", "return", "\"\"", ";", "}", "if", "(", "$", "this", "->", "domNode", "instanceof", "\\", "DOMNameSpaceNode", ")", "{", "/** @var \\...
Gets the string value of the item @return string
[ "Gets", "the", "string", "value", "of", "the", "item" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathItemTrait.php#L70-L89
193,830
bseddon/XPath20
DOM/DOMXPathItemTrait.php
DOMXPathItemTrait.getValueType
public function getValueType() { $xmlType =SchemaTypes::getInstance()->getTypeForDOMNode( $this->domNode ); // $xmlType = $this->types->getType( $this->domNode->localName, $this->domNode->prefix ); if ( $xmlType ) { $type = Type::XmlTypeToPHPType( $xmlType ); if ( $type ) return $type; } ret...
php
public function getValueType() { $xmlType =SchemaTypes::getInstance()->getTypeForDOMNode( $this->domNode ); // $xmlType = $this->types->getType( $this->domNode->localName, $this->domNode->prefix ); if ( $xmlType ) { $type = Type::XmlTypeToPHPType( $xmlType ); if ( $type ) return $type; } ret...
[ "public", "function", "getValueType", "(", ")", "{", "$", "xmlType", "=", "SchemaTypes", "::", "getInstance", "(", ")", "->", "getTypeForDOMNode", "(", "$", "this", "->", "domNode", ")", ";", "// $xmlType = $this->types->getType( $this->domNode->localName, $this->domNod...
Gets the PHP runtime type of the item. @return Type $ValueType
[ "Gets", "the", "PHP", "runtime", "type", "of", "the", "item", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathItemTrait.php#L152-L162
193,831
bseddon/XPath20
DOM/DOMXPathItemTrait.php
DOMXPathItemTrait.getXmlType
public function getXmlType() { if ( ! property_exists( $this->domNode, "schemaType" ) ) { $effectiveNode = $this->domNode->nodeType == XML_TEXT_NODE ? $this->domNode->parentNode : $this->domNode; $this->domNode->schemaType = DOMSchemaType::getSchemaType( $effectiveNode ); } return $this->domNode->...
php
public function getXmlType() { if ( ! property_exists( $this->domNode, "schemaType" ) ) { $effectiveNode = $this->domNode->nodeType == XML_TEXT_NODE ? $this->domNode->parentNode : $this->domNode; $this->domNode->schemaType = DOMSchemaType::getSchemaType( $effectiveNode ); } return $this->domNode->...
[ "public", "function", "getXmlType", "(", ")", "{", "if", "(", "!", "property_exists", "(", "$", "this", "->", "domNode", ",", "\"schemaType\"", ")", ")", "{", "$", "effectiveNode", "=", "$", "this", "->", "domNode", "->", "nodeType", "==", "XML_TEXT_NODE",...
When overridden in a derived class, gets the XmlSchemaType for the item. @return XmlSchemaType The System.Xml.Schema.XmlSchemaType for the item.
[ "When", "overridden", "in", "a", "derived", "class", "gets", "the", "XmlSchemaType", "for", "the", "item", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathItemTrait.php#L169-L177
193,832
mamasu/mama-parameter
src/parameter/SessionFactory.php
SessionFactory.createSession
public function createSession() { if (!isset($_SESSION)) { if (PHP_SAPI === 'cli') { $_SESSION = array(); } elseif (!headers_sent()) { if (!session_start()) { throw new SessionException('session_start failed.'); } } else...
php
public function createSession() { if (!isset($_SESSION)) { if (PHP_SAPI === 'cli') { $_SESSION = array(); } elseif (!headers_sent()) { if (!session_start()) { throw new SessionException('session_start failed.'); } } else...
[ "public", "function", "createSession", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "_SESSION", ")", ")", "{", "if", "(", "PHP_SAPI", "===", "'cli'", ")", "{", "$", "_SESSION", "=", "array", "(", ")", ";", "}", "elseif", "(", "!", "headers_sen...
Init session parameters and init the class to manage the vars. @return \Session @throws \SessionException
[ "Init", "session", "parameters", "and", "init", "the", "class", "to", "manage", "the", "vars", "." ]
d48529a75d471da2f9f80b9c2ea1fc3d57f0ba4d
https://github.com/mamasu/mama-parameter/blob/d48529a75d471da2f9f80b9c2ea1fc3d57f0ba4d/src/parameter/SessionFactory.php#L28-L42
193,833
kreta/SimpleApiDocBundle
src/Kreta/SimpleApiDocBundle/Annotation/ApiDoc.php
ApiDoc.buildStatusCodes
protected function buildStatusCodes(array $data) { if (isset($data['statusCodes'])) { $this->initializeStatusCodes(); foreach ($data['statusCodes'] as $key => $element) { if ((int) $key < 200) { $this->statusCodes($element); } else ...
php
protected function buildStatusCodes(array $data) { if (isset($data['statusCodes'])) { $this->initializeStatusCodes(); foreach ($data['statusCodes'] as $key => $element) { if ((int) $key < 200) { $this->statusCodes($element); } else ...
[ "protected", "function", "buildStatusCodes", "(", "array", "$", "data", ")", "{", "if", "(", "isset", "(", "$", "data", "[", "'statusCodes'", "]", ")", ")", "{", "$", "this", "->", "initializeStatusCodes", "(", ")", ";", "foreach", "(", "$", "data", "[...
Loads data given status codes. @param array $data Array that contains all the data @return self
[ "Loads", "data", "given", "status", "codes", "." ]
786aa9310cdf087253f65f68165a0a0c8ad5c816
https://github.com/kreta/SimpleApiDocBundle/blob/786aa9310cdf087253f65f68165a0a0c8ad5c816/src/Kreta/SimpleApiDocBundle/Annotation/ApiDoc.php#L69-L83
193,834
kreta/SimpleApiDocBundle
src/Kreta/SimpleApiDocBundle/Annotation/ApiDoc.php
ApiDoc.statusCodes
protected function statusCodes($statusCode, $customDescription = null) { if ($customDescription) { $description = $customDescription; } if ($customDescription !== null || array_key_exists($statusCode, $this->defaultStatusCodes)) { if (!isset($description)) { ...
php
protected function statusCodes($statusCode, $customDescription = null) { if ($customDescription) { $description = $customDescription; } if ($customDescription !== null || array_key_exists($statusCode, $this->defaultStatusCodes)) { if (!isset($description)) { ...
[ "protected", "function", "statusCodes", "(", "$", "statusCode", ",", "$", "customDescription", "=", "null", ")", "{", "if", "(", "$", "customDescription", ")", "{", "$", "description", "=", "$", "customDescription", ";", "}", "if", "(", "$", "customDescripti...
Method that allows to choose between status code passing the code and optional description. @param int $statusCode The status code @param string|null $customDescription The description @return self
[ "Method", "that", "allows", "to", "choose", "between", "status", "code", "passing", "the", "code", "and", "optional", "description", "." ]
786aa9310cdf087253f65f68165a0a0c8ad5c816
https://github.com/kreta/SimpleApiDocBundle/blob/786aa9310cdf087253f65f68165a0a0c8ad5c816/src/Kreta/SimpleApiDocBundle/Annotation/ApiDoc.php#L94-L108
193,835
kreta/SimpleApiDocBundle
src/Kreta/SimpleApiDocBundle/Annotation/ApiDoc.php
ApiDoc.initializeStatusCodes
protected function initializeStatusCodes() { $annotationReflection = new \ReflectionClass('Nelmio\ApiDocBundle\Annotation\ApiDoc'); $statusCodesReflection = $annotationReflection->getProperty('statusCodes'); $statusCodesReflection->setAccessible(true); $statusCodesReflection->setValu...
php
protected function initializeStatusCodes() { $annotationReflection = new \ReflectionClass('Nelmio\ApiDocBundle\Annotation\ApiDoc'); $statusCodesReflection = $annotationReflection->getProperty('statusCodes'); $statusCodesReflection->setAccessible(true); $statusCodesReflection->setValu...
[ "protected", "function", "initializeStatusCodes", "(", ")", "{", "$", "annotationReflection", "=", "new", "\\", "ReflectionClass", "(", "'Nelmio\\ApiDocBundle\\Annotation\\ApiDoc'", ")", ";", "$", "statusCodesReflection", "=", "$", "annotationReflection", "->", "getProper...
Purges the statusCodes array to populate with the new way. This method is required because the $statusCodes is a private field, and the reflection is necessary. @return self
[ "Purges", "the", "statusCodes", "array", "to", "populate", "with", "the", "new", "way", "." ]
786aa9310cdf087253f65f68165a0a0c8ad5c816
https://github.com/kreta/SimpleApiDocBundle/blob/786aa9310cdf087253f65f68165a0a0c8ad5c816/src/Kreta/SimpleApiDocBundle/Annotation/ApiDoc.php#L118-L126
193,836
ZendExperts/phpids
lib/IDS/Report.php
IDS_Report.setCentrifuge
public function setCentrifuge($centrifuge = array()) { if (is_array($centrifuge) && $centrifuge) { $this->centrifuge = $centrifuge; return true; } throw new InvalidArgumentException('Invalid argument given'); }
php
public function setCentrifuge($centrifuge = array()) { if (is_array($centrifuge) && $centrifuge) { $this->centrifuge = $centrifuge; return true; } throw new InvalidArgumentException('Invalid argument given'); }
[ "public", "function", "setCentrifuge", "(", "$", "centrifuge", "=", "array", "(", ")", ")", "{", "if", "(", "is_array", "(", "$", "centrifuge", ")", "&&", "$", "centrifuge", ")", "{", "$", "this", "->", "centrifuge", "=", "$", "centrifuge", ";", "retur...
This method sets the centrifuge property @param array $centrifuge the centrifuge data @throws InvalidArgumentException if argument is illegal @return boolean true is arguments were valid
[ "This", "method", "sets", "the", "centrifuge", "property" ]
f30df04eea47b94d056e2ae9ec8fea1c626f1c03
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Report.php#L275-L282
193,837
congraphcms/core
Repositories/TrunkCache.php
TrunkCache.put
public function put($data) { if( ! $data instanceof DataTransferObject) { throw new Exception('You are trying to put invalid object to trunk.'); } if( ! array_key_exists($data->getType(), $this->storage) ) { $this->storage[$data->getType()] = []; } $storageKey = $this->storageKey($data->getParams...
php
public function put($data) { if( ! $data instanceof DataTransferObject) { throw new Exception('You are trying to put invalid object to trunk.'); } if( ! array_key_exists($data->getType(), $this->storage) ) { $this->storage[$data->getType()] = []; } $storageKey = $this->storageKey($data->getParams...
[ "public", "function", "put", "(", "$", "data", ")", "{", "if", "(", "!", "$", "data", "instanceof", "DataTransferObject", ")", "{", "throw", "new", "Exception", "(", "'You are trying to put invalid object to trunk.'", ")", ";", "}", "if", "(", "!", "array_key_...
Add item or collection to trunk @param mixed $data @return void
[ "Add", "item", "or", "collection", "to", "trunk" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/TrunkCache.php#L50-L64
193,838
congraphcms/core
Repositories/TrunkCache.php
TrunkCache.has
public function has($key, $type) { if(is_array($key)) { return $this->hasItem($this->storageKey($key), $type); } if(is_string($key)) { return $this->hasItem($key, $type); } if(is_int($key)) { return $this->hasItem($this->storageKey([$key]), $type); } return false; }
php
public function has($key, $type) { if(is_array($key)) { return $this->hasItem($this->storageKey($key), $type); } if(is_string($key)) { return $this->hasItem($key, $type); } if(is_int($key)) { return $this->hasItem($this->storageKey([$key]), $type); } return false; }
[ "public", "function", "has", "(", "$", "key", ",", "$", "type", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "return", "$", "this", "->", "hasItem", "(", "$", "this", "->", "storageKey", "(", "$", "key", ")", ",", "$", "type...
Check cache for item or collection @param mixed $key @param string $type @return boolean
[ "Check", "cache", "for", "item", "or", "collection" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/TrunkCache.php#L74-L92
193,839
congraphcms/core
Repositories/TrunkCache.php
TrunkCache.hasItem
protected function hasItem($key, $type) { if(array_key_exists($type, $this->storage) && array_key_exists($key, $this->storage[$type])) { return true; } return false; }
php
protected function hasItem($key, $type) { if(array_key_exists($type, $this->storage) && array_key_exists($key, $this->storage[$type])) { return true; } return false; }
[ "protected", "function", "hasItem", "(", "$", "key", ",", "$", "type", ")", "{", "if", "(", "array_key_exists", "(", "$", "type", ",", "$", "this", "->", "storage", ")", "&&", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "storage", "[...
Check if item exists in cache @param string $key @param string $type @return boolean
[ "Check", "if", "item", "exists", "in", "cache" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/TrunkCache.php#L102-L110
193,840
congraphcms/core
Repositories/TrunkCache.php
TrunkCache.get
public function get($key, $type) { if(is_array($key)) { return $this->getItem($this->storageKey($key), $type); } if(is_string($key)) { return $this->getItem($key, $type); } if(is_int($key)) { return $this->getItem($this->storageKey([$key]), $type); } return null; }
php
public function get($key, $type) { if(is_array($key)) { return $this->getItem($this->storageKey($key), $type); } if(is_string($key)) { return $this->getItem($key, $type); } if(is_int($key)) { return $this->getItem($this->storageKey([$key]), $type); } return null; }
[ "public", "function", "get", "(", "$", "key", ",", "$", "type", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "return", "$", "this", "->", "getItem", "(", "$", "this", "->", "storageKey", "(", "$", "key", ")", ",", "$", "type...
Get item or collection from cache @param mixed $key @param string $type @return DataTransferObject | null
[ "Get", "item", "or", "collection", "from", "cache" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/TrunkCache.php#L120-L138
193,841
congraphcms/core
Repositories/TrunkCache.php
TrunkCache.getItem
protected function getItem($key, $type) { if(array_key_exists($type, $this->storage) && array_key_exists($key, $this->storage[$type])) { return $this->storage[$type][$key]; } return null; }
php
protected function getItem($key, $type) { if(array_key_exists($type, $this->storage) && array_key_exists($key, $this->storage[$type])) { return $this->storage[$type][$key]; } return null; }
[ "protected", "function", "getItem", "(", "$", "key", ",", "$", "type", ")", "{", "if", "(", "array_key_exists", "(", "$", "type", ",", "$", "this", "->", "storage", ")", "&&", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "storage", "[...
Get item by id and type @param string $key @param string $type @return DataTransferObject | null
[ "Get", "item", "by", "id", "and", "type" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/TrunkCache.php#L148-L156
193,842
SlabPHP/controllers
src/Traits/RouteReference.php
RouteReference.getRoutedParameter
protected function getRoutedParameter($parameter, $default = null) { $output = $default; $parameters = $this->route->getParameters(); if (!empty($parameters->$parameter)) { $output = $parameters->$parameter; } $validatedData = $this->route->getValidated...
php
protected function getRoutedParameter($parameter, $default = null) { $output = $default; $parameters = $this->route->getParameters(); if (!empty($parameters->$parameter)) { $output = $parameters->$parameter; } $validatedData = $this->route->getValidated...
[ "protected", "function", "getRoutedParameter", "(", "$", "parameter", ",", "$", "default", "=", "null", ")", "{", "$", "output", "=", "$", "default", ";", "$", "parameters", "=", "$", "this", "->", "route", "->", "getParameters", "(", ")", ";", "if", "...
Function for retrieving routed parameter data from the stored Route reference @param $parameter @param null $default @return null
[ "Function", "for", "retrieving", "routed", "parameter", "data", "from", "the", "stored", "Route", "reference" ]
a1c4fded0265100a85904dd664b972a7f8687652
https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Traits/RouteReference.php#L36-L55
193,843
jabernardo/lollipop-php
Library/Session/Session.php
Session.exists
public function exists($key) { $key = $this->secureKey($key); if (isset($_SESSION[$key])) return true; return false; }
php
public function exists($key) { $key = $this->secureKey($key); if (isset($_SESSION[$key])) return true; return false; }
[ "public", "function", "exists", "(", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "secureKey", "(", "$", "key", ")", ";", "if", "(", "isset", "(", "$", "_SESSION", "[", "$", "key", "]", ")", ")", "return", "true", ";", "return", "f...
Checks if a session variable exists @access public @param string $key Session variable name @return bool
[ "Checks", "if", "a", "session", "variable", "exists" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Session/Session.php#L73-L79
193,844
jabernardo/lollipop-php
Library/Session/Session.php
Session.set
public function set($key, $value) { $key = $this->secureKey($key); $_SESSION[$key] = $this->secureValue($value); return $key; }
php
public function set($key, $value) { $key = $this->secureKey($key); $_SESSION[$key] = $this->secureValue($value); return $key; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "$", "key", "=", "$", "this", "->", "secureKey", "(", "$", "key", ")", ";", "$", "_SESSION", "[", "$", "key", "]", "=", "$", "this", "->", "secureValue", "(", "$", "valu...
Creates a new session or sets an existing sesssion @access public @param string $key Session variable name @param string $value Session variable value @return string Session encrypted key
[ "Creates", "a", "new", "session", "or", "sets", "an", "existing", "sesssion" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Session/Session.php#L90-L95
193,845
jabernardo/lollipop-php
Library/Session/Session.php
Session.get
public function get($key) { $key = $this->secureKey($key); if (isset($_SESSION[$key])) { return trim(Text::unlock($_SESSION[$key], $this->sugar())); } else { return ''; } }
php
public function get($key) { $key = $this->secureKey($key); if (isset($_SESSION[$key])) { return trim(Text::unlock($_SESSION[$key], $this->sugar())); } else { return ''; } }
[ "public", "function", "get", "(", "$", "key", ")", "{", "$", "key", "=", "$", "this", "->", "secureKey", "(", "$", "key", ")", ";", "if", "(", "isset", "(", "$", "_SESSION", "[", "$", "key", "]", ")", ")", "{", "return", "trim", "(", "Text", ...
Gets session variable's value @access public @param string $key Session variable name @return string
[ "Gets", "session", "variable", "s", "value" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Session/Session.php#L105-L113
193,846
dmitrya2e/filtration-bundle
Filter/Filter/AbstractNumberFilter.php
AbstractNumberFilter.appendSingleFormFields
protected function appendSingleFormFields(FormBuilderInterface $formBuilder) { $defaultOptions = [ 'label' => $this->getTitle(), 'required' => false, ]; $userOptions = array_key_exists('single', $this->getFormOptions()) ? $this->getFormOptions(...
php
protected function appendSingleFormFields(FormBuilderInterface $formBuilder) { $defaultOptions = [ 'label' => $this->getTitle(), 'required' => false, ]; $userOptions = array_key_exists('single', $this->getFormOptions()) ? $this->getFormOptions(...
[ "protected", "function", "appendSingleFormFields", "(", "FormBuilderInterface", "$", "formBuilder", ")", "{", "$", "defaultOptions", "=", "[", "'label'", "=>", "$", "this", "->", "getTitle", "(", ")", ",", "'required'", "=>", "false", ",", "]", ";", "$", "us...
Appends form fields for "single" mode. @param FormBuilderInterface $formBuilder @return static
[ "Appends", "form", "fields", "for", "single", "mode", "." ]
fed5764af4e43871835744fb84957b2a76e9a215
https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractNumberFilter.php#L136-L156
193,847
dmitrya2e/filtration-bundle
Filter/Filter/AbstractNumberFilter.php
AbstractNumberFilter.appendRangedFormFields
protected function appendRangedFormFields(FormBuilderInterface $formBuilder) { // "From" options $fromDefaultOptions = [ 'label' => 'da2e.filtration.number_filter.ranged.from.label', 'required' => false, ]; $fromUserOptions = array_key_exists('rang...
php
protected function appendRangedFormFields(FormBuilderInterface $formBuilder) { // "From" options $fromDefaultOptions = [ 'label' => 'da2e.filtration.number_filter.ranged.from.label', 'required' => false, ]; $fromUserOptions = array_key_exists('rang...
[ "protected", "function", "appendRangedFormFields", "(", "FormBuilderInterface", "$", "formBuilder", ")", "{", "// \"From\" options\r", "$", "fromDefaultOptions", "=", "[", "'label'", "=>", "'da2e.filtration.number_filter.ranged.from.label'", ",", "'required'", "=>", "false", ...
Appends form fields for "range" mode. @param FormBuilderInterface $formBuilder @return static
[ "Appends", "form", "fields", "for", "range", "mode", "." ]
fed5764af4e43871835744fb84957b2a76e9a215
https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractNumberFilter.php#L165-L203
193,848
jenskooij/cloudcontrol
src/storage/storage/SitemapStorage.php
SitemapStorage.addSitemapItem
public function addSitemapItem($postValues) { $sitemapObject = SitemapItemFactory::createSitemapItemFromPostValues($postValues); $sitemap = $this->repository->sitemap; $sitemap[] = $sitemapObject; $this->repository->sitemap = $sitemap; $this->save(); }
php
public function addSitemapItem($postValues) { $sitemapObject = SitemapItemFactory::createSitemapItemFromPostValues($postValues); $sitemap = $this->repository->sitemap; $sitemap[] = $sitemapObject; $this->repository->sitemap = $sitemap; $this->save(); }
[ "public", "function", "addSitemapItem", "(", "$", "postValues", ")", "{", "$", "sitemapObject", "=", "SitemapItemFactory", "::", "createSitemapItemFromPostValues", "(", "$", "postValues", ")", ";", "$", "sitemap", "=", "$", "this", "->", "repository", "->", "sit...
Add a sitemap item @param $postValues @throws \Exception
[ "Add", "a", "sitemap", "item" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/SitemapStorage.php#L30-L37
193,849
jenskooij/cloudcontrol
src/storage/storage/SitemapStorage.php
SitemapStorage.getSitemapItemBySlug
public function getSitemapItemBySlug($slug) { $sitemap = $this->repository->sitemap; foreach ($sitemap as $sitemapItem) { if ($sitemapItem->slug == $slug) { return $sitemapItem; } } return null; }
php
public function getSitemapItemBySlug($slug) { $sitemap = $this->repository->sitemap; foreach ($sitemap as $sitemapItem) { if ($sitemapItem->slug == $slug) { return $sitemapItem; } } return null; }
[ "public", "function", "getSitemapItemBySlug", "(", "$", "slug", ")", "{", "$", "sitemap", "=", "$", "this", "->", "repository", "->", "sitemap", ";", "foreach", "(", "$", "sitemap", "as", "$", "sitemapItem", ")", "{", "if", "(", "$", "sitemapItem", "->",...
Get a sitemap item by its slug @param $slug @return mixed
[ "Get", "a", "sitemap", "item", "by", "its", "slug" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/SitemapStorage.php#L111-L121
193,850
AnonymPHP/Anonym-Route
RouteCollector.php
RouteCollector.addRoute
private function addRoute($types = '', $uri, $action = []) { if (is_string($action)) { $action = ['_controller' => $action]; } if (is_array($action)) { if (isset($action['as'])) { AsCollector::addAs($action['as'], $uri); } } ...
php
private function addRoute($types = '', $uri, $action = []) { if (is_string($action)) { $action = ['_controller' => $action]; } if (is_array($action)) { if (isset($action['as'])) { AsCollector::addAs($action['as'], $uri); } } ...
[ "private", "function", "addRoute", "(", "$", "types", "=", "''", ",", "$", "uri", ",", "$", "action", "=", "[", "]", ")", "{", "if", "(", "is_string", "(", "$", "action", ")", ")", "{", "$", "action", "=", "[", "'_controller'", "=>", "$", "action...
Add a route with type, uri and action parameters @param string|array $types @param array $uri @param array $action @return $this
[ "Add", "a", "route", "with", "type", "uri", "and", "action", "parameters" ]
bb7f8004fbbd2998af8b0061f404f026f11466ab
https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/RouteCollector.php#L58-L90
193,851
AnonymPHP/Anonym-Route
RouteCollector.php
RouteCollector.createWhenUri
protected function createWhenUri($uri) { $when = static::$firing['when']; if (substr($when, -1) !== '/') { $when .= '/'; } if(substr($uri, 0,1) === '/'){ $uri = substr($uri, 1, strlen($uri)); } return $when.$uri; }
php
protected function createWhenUri($uri) { $when = static::$firing['when']; if (substr($when, -1) !== '/') { $when .= '/'; } if(substr($uri, 0,1) === '/'){ $uri = substr($uri, 1, strlen($uri)); } return $when.$uri; }
[ "protected", "function", "createWhenUri", "(", "$", "uri", ")", "{", "$", "when", "=", "static", "::", "$", "firing", "[", "'when'", "]", ";", "if", "(", "substr", "(", "$", "when", ",", "-", "1", ")", "!==", "'/'", ")", "{", "$", "when", ".=", ...
prapare uri to merge with when url, and return it. @param string $uri @return string
[ "prapare", "uri", "to", "merge", "with", "when", "url", "and", "return", "it", "." ]
bb7f8004fbbd2998af8b0061f404f026f11466ab
https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/RouteCollector.php#L98-L111
193,852
AnonymPHP/Anonym-Route
RouteCollector.php
RouteCollector.group
public function group($name, $action, Closure $callback) { static::$groups[$name] = [ 'action' => $action, 'callback' => $callback ]; return $this; }
php
public function group($name, $action, Closure $callback) { static::$groups[$name] = [ 'action' => $action, 'callback' => $callback ]; return $this; }
[ "public", "function", "group", "(", "$", "name", ",", "$", "action", ",", "Closure", "$", "callback", ")", "{", "static", "::", "$", "groups", "[", "$", "name", "]", "=", "[", "'action'", "=>", "$", "action", ",", "'callback'", "=>", "$", "callback",...
register a new group collection @param string $name @param array $action @param Closure $callback @return $this
[ "register", "a", "new", "group", "collection" ]
bb7f8004fbbd2998af8b0061f404f026f11466ab
https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/RouteCollector.php#L234-L242
193,853
t-kanstantsin/fileupload
src/formatter/File.php
File.triggerEvent
public function triggerEvent(string $event): void { // TODO: use event library and allow attach events to IFile and ICacheStateful. // cache triggers if ($this->file instanceof ICacheStateful) { switch ($event) { case self::EVENT_CACHED: $this-...
php
public function triggerEvent(string $event): void { // TODO: use event library and allow attach events to IFile and ICacheStateful. // cache triggers if ($this->file instanceof ICacheStateful) { switch ($event) { case self::EVENT_CACHED: $this-...
[ "public", "function", "triggerEvent", "(", "string", "$", "event", ")", ":", "void", "{", "// TODO: use event library and allow attach events to IFile and ICacheStateful.", "// cache triggers", "if", "(", "$", "this", "->", "file", "instanceof", "ICacheStateful", ")", "{"...
Call user function after saving cached file @param string $event
[ "Call", "user", "function", "after", "saving", "cached", "file" ]
d6317a9b9b36d992f09affe3900ef7d7ddfd855f
https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/formatter/File.php#L126-L147
193,854
linpax/microphp-framework
src/filter/XssFilter.php
XssFilter.doXssClean
private function doXssClean($data) { if (is_array($data) && count($data)) { foreach ($data as $k => &$v) { $v = $this->doXssClean($data[$k]); } return $data; } if (trim($data) === '') { return $data; } // xss_...
php
private function doXssClean($data) { if (is_array($data) && count($data)) { foreach ($data as $k => &$v) { $v = $this->doXssClean($data[$k]); } return $data; } if (trim($data) === '') { return $data; } // xss_...
[ "private", "function", "doXssClean", "(", "$", "data", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", "&&", "count", "(", "$", "data", ")", ")", "{", "foreach", "(", "$", "data", "as", "$", "k", "=>", "&", "$", "v", ")", "{", "$", "v...
Do XSS Clean @access private @param array $data data for check @return mixed
[ "Do", "XSS", "Clean" ]
11f3370f3f64c516cce9b84ecd8276c6e9ae8df9
https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/filter/XssFilter.php#L47-L98
193,855
ciims/ciims-modules-hybridauth
HybridauthModule.php
HybridauthModule.getConfig
public function getConfig() { return array( 'baseUrl' => Yii::app()->getBaseUrl(true), 'base_url' => Yii::app()->getBaseUrl(true) . '/hybridauth/callback', // URL for Hybrid_Auth callback 'debug_mode' => YII_DEBUG, 'debug_file' => Yii::getPathOfAlias('application.runtime.hybridauth')...
php
public function getConfig() { return array( 'baseUrl' => Yii::app()->getBaseUrl(true), 'base_url' => Yii::app()->getBaseUrl(true) . '/hybridauth/callback', // URL for Hybrid_Auth callback 'debug_mode' => YII_DEBUG, 'debug_file' => Yii::getPathOfAlias('application.runtime.hybridauth')...
[ "public", "function", "getConfig", "(", ")", "{", "return", "array", "(", "'baseUrl'", "=>", "Yii", "::", "app", "(", ")", "->", "getBaseUrl", "(", "true", ")", ",", "'base_url'", "=>", "Yii", "::", "app", "(", ")", "->", "getBaseUrl", "(", "true", "...
Convert configuration to an array for Hybrid_Auth, rather than object properties as supplied by Yii @return array
[ "Convert", "configuration", "to", "an", "array", "for", "Hybrid_Auth", "rather", "than", "object", "properties", "as", "supplied", "by", "Yii" ]
417b2682bf3468dd509164a9b773d886359a7aec
https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/HybridauthModule.php#L33-L42
193,856
gangachris/potato-orm
src/Connection.php
Connection.db
public static function db() { self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return self::$conn; }
php
public static function db() { self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return self::$conn; }
[ "public", "static", "function", "db", "(", ")", "{", "self", "::", "$", "conn", "->", "setAttribute", "(", "PDO", "::", "ATTR_ERRMODE", ",", "PDO", "::", "ERRMODE_EXCEPTION", ")", ";", "return", "self", "::", "$", "conn", ";", "}" ]
Get an instance of the db connection @return SQLite3 connection
[ "Get", "an", "instance", "of", "the", "db", "connection" ]
12bb25ca31716aac97bbe78596810220e39626b0
https://github.com/gangachris/potato-orm/blob/12bb25ca31716aac97bbe78596810220e39626b0/src/Connection.php#L53-L57
193,857
miknatr/grace-dbal
lib/Grace/SQLBuilder/SelectBuilder.php
SelectBuilder.fields
public function fields(array $fields) { $newFields = array(); $this->fields = ''; $this->fieldsArguments = array(); foreach ($fields as $field) { if (is_scalar($field)) { $newFields[] = '?f:alias:.?f'; $this->fieldsArguments[] = $field; ...
php
public function fields(array $fields) { $newFields = array(); $this->fields = ''; $this->fieldsArguments = array(); foreach ($fields as $field) { if (is_scalar($field)) { $newFields[] = '?f:alias:.?f'; $this->fieldsArguments[] = $field; ...
[ "public", "function", "fields", "(", "array", "$", "fields", ")", "{", "$", "newFields", "=", "array", "(", ")", ";", "$", "this", "->", "fields", "=", "''", ";", "$", "this", "->", "fieldsArguments", "=", "array", "(", ")", ";", "foreach", "(", "$...
Sets fields statement @param $fields array('id', array('AsText(?f) AS ?f', array('coords', 'coords'))) @throws \BadMethodCallException @return $this
[ "Sets", "fields", "statement" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/SQLBuilder/SelectBuilder.php#L53-L75
193,858
miknatr/grace-dbal
lib/Grace/SQLBuilder/SelectBuilder.php
SelectBuilder.join
public function join($tableName, $alias = null) { $this->joins[] = ' LEFT JOIN ?f as ?f'; $this->lastJoinAlias = $alias; $this->joinArguments[] = $tableName; $this->joinArguments[] = $alias; return $this; }
php
public function join($tableName, $alias = null) { $this->joins[] = ' LEFT JOIN ?f as ?f'; $this->lastJoinAlias = $alias; $this->joinArguments[] = $tableName; $this->joinArguments[] = $alias; return $this; }
[ "public", "function", "join", "(", "$", "tableName", ",", "$", "alias", "=", "null", ")", "{", "$", "this", "->", "joins", "[", "]", "=", "' LEFT JOIN ?f as ?f'", ";", "$", "this", "->", "lastJoinAlias", "=", "$", "alias", ";", "$", "this", "->", "jo...
Sets one field in fields statement @param string $tableName @param string $alias @return $this
[ "Sets", "one", "field", "in", "fields", "statement" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/SQLBuilder/SelectBuilder.php#L106-L113
193,859
miknatr/grace-dbal
lib/Grace/SQLBuilder/SelectBuilder.php
SelectBuilder.orderByDirection
protected function orderByDirection($field, $direction, $prefixWithTableAlias = true) { $aliasInsert = $prefixWithTableAlias ? '?f:alias:.' : ''; if ($this->orderSql == '') { $this->orderSql = " ORDER BY {$aliasInsert}?f {$direction}"; } else { $this->orderSql .= ", ...
php
protected function orderByDirection($field, $direction, $prefixWithTableAlias = true) { $aliasInsert = $prefixWithTableAlias ? '?f:alias:.' : ''; if ($this->orderSql == '') { $this->orderSql = " ORDER BY {$aliasInsert}?f {$direction}"; } else { $this->orderSql .= ", ...
[ "protected", "function", "orderByDirection", "(", "$", "field", ",", "$", "direction", ",", "$", "prefixWithTableAlias", "=", "true", ")", "{", "$", "aliasInsert", "=", "$", "prefixWithTableAlias", "?", "'?f:alias:.'", ":", "''", ";", "if", "(", "$", "this",...
Sets order by statement @param string $field @param string $direction @param bool $prefixWithTableAlias @return $this
[ "Sets", "order", "by", "statement" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/SQLBuilder/SelectBuilder.php#L213-L223
193,860
WellCommerce/AdminBundle
Importer/XmlImporter.php
XmlImporter.importItems
protected function importItems(\DOMDocument $xml) { foreach ($xml->documentElement->getElementsByTagName('item') as $item) { $dom = simplexml_import_dom($item); $this->addMenuItem($dom); } }
php
protected function importItems(\DOMDocument $xml) { foreach ($xml->documentElement->getElementsByTagName('item') as $item) { $dom = simplexml_import_dom($item); $this->addMenuItem($dom); } }
[ "protected", "function", "importItems", "(", "\\", "DOMDocument", "$", "xml", ")", "{", "foreach", "(", "$", "xml", "->", "documentElement", "->", "getElementsByTagName", "(", "'item'", ")", "as", "$", "item", ")", "{", "$", "dom", "=", "simplexml_import_dom...
Parses DOM element and adds it as an admin menu item @param \DOMDocument $xml
[ "Parses", "DOM", "element", "and", "adds", "it", "as", "an", "admin", "menu", "item" ]
5721f0b9a506023ed6beb6bdf79e4ccbbe546516
https://github.com/WellCommerce/AdminBundle/blob/5721f0b9a506023ed6beb6bdf79e4ccbbe546516/Importer/XmlImporter.php#L67-L73
193,861
WellCommerce/AdminBundle
Importer/XmlImporter.php
XmlImporter.addMenuItem
protected function addMenuItem(\SimpleXMLElement $item) { $em = $this->doctrineHelper->getEntityManager(); $adminMenuItem = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->identifier]); $parent = $this->adminMenuRepository->findOneBy(['identifier' => (...
php
protected function addMenuItem(\SimpleXMLElement $item) { $em = $this->doctrineHelper->getEntityManager(); $adminMenuItem = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->identifier]); $parent = $this->adminMenuRepository->findOneBy(['identifier' => (...
[ "protected", "function", "addMenuItem", "(", "\\", "SimpleXMLElement", "$", "item", ")", "{", "$", "em", "=", "$", "this", "->", "doctrineHelper", "->", "getEntityManager", "(", ")", ";", "$", "adminMenuItem", "=", "$", "this", "->", "adminMenuRepository", "...
Creates new admin menu item @param \SimpleXMLElement $item
[ "Creates", "new", "admin", "menu", "item" ]
5721f0b9a506023ed6beb6bdf79e4ccbbe546516
https://github.com/WellCommerce/AdminBundle/blob/5721f0b9a506023ed6beb6bdf79e4ccbbe546516/Importer/XmlImporter.php#L80-L98
193,862
codeblanche/Web
src/Web/Route/Router.php
Router.resolveRulePrototype
private function resolveRulePrototype() { if (!isset($this->routeTypeRulePrototypeMap[$this->routeType])) { throw new RuntimeException("Unable to resolve rule for route type '$this->routeType'. Route type is not supported."); } $prototypeClass = $this->routeTypeRulePrototypeMap[...
php
private function resolveRulePrototype() { if (!isset($this->routeTypeRulePrototypeMap[$this->routeType])) { throw new RuntimeException("Unable to resolve rule for route type '$this->routeType'. Route type is not supported."); } $prototypeClass = $this->routeTypeRulePrototypeMap[...
[ "private", "function", "resolveRulePrototype", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "routeTypeRulePrototypeMap", "[", "$", "this", "->", "routeType", "]", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"Unable to resolve r...
Resolve the rule prototype object for the current routeType @throws \Web\Exception\RuntimeException
[ "Resolve", "the", "rule", "prototype", "object", "for", "the", "current", "routeType" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Route/Router.php#L70-L86
193,863
codeblanche/Web
src/Web/Route/Router.php
Router.define
public function define($pattern, $controller, $filters = array()) { $rule = clone $this->rulePrototype; $rule->setPattern($pattern)->setController($controller)->setFilters($filters); array_push($this->rules, $rule); return $this; }
php
public function define($pattern, $controller, $filters = array()) { $rule = clone $this->rulePrototype; $rule->setPattern($pattern)->setController($controller)->setFilters($filters); array_push($this->rules, $rule); return $this; }
[ "public", "function", "define", "(", "$", "pattern", ",", "$", "controller", ",", "$", "filters", "=", "array", "(", ")", ")", "{", "$", "rule", "=", "clone", "$", "this", "->", "rulePrototype", ";", "$", "rule", "->", "setPattern", "(", "$", "patter...
Define a routing rule with corresponding controller @param string $pattern @param string $controller Class name or alias @param array $filters @return $this
[ "Define", "a", "routing", "rule", "with", "corresponding", "controller" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Route/Router.php#L109-L118
193,864
Aviogram/Common
src/ClassUtils.php
ClassUtils.parseClass
protected static function parseClass($class) { static $cache = array(); if (array_key_exists($class, $cache) === false) { // Make reference for original input $string = $class; if ($string[0] === '\\') { $string = substr($string, 1); ...
php
protected static function parseClass($class) { static $cache = array(); if (array_key_exists($class, $cache) === false) { // Make reference for original input $string = $class; if ($string[0] === '\\') { $string = substr($string, 1); ...
[ "protected", "static", "function", "parseClass", "(", "$", "class", ")", "{", "static", "$", "cache", "=", "array", "(", ")", ";", "if", "(", "array_key_exists", "(", "$", "class", ",", "$", "cache", ")", "===", "false", ")", "{", "// Make reference for ...
Parse the class to a namespace and className part @param string $class @return array array(<namespace>, <className>)
[ "Parse", "the", "class", "to", "a", "namespace", "and", "className", "part" ]
bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5
https://github.com/Aviogram/Common/blob/bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5/src/ClassUtils.php#L71-L91
193,865
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.requestHandler
public static function requestHandler($type) { if (! self::validateRequest($type)) { return false; } App::setCurrentID(self::$config['app']); self::loadRemoteComplements(); switch (self::$config['request']) { case 'load-complements': ...
php
public static function requestHandler($type) { if (! self::validateRequest($type)) { return false; } App::setCurrentID(self::$config['app']); self::loadRemoteComplements(); switch (self::$config['request']) { case 'load-complements': ...
[ "public", "static", "function", "requestHandler", "(", "$", "type", ")", "{", "if", "(", "!", "self", "::", "validateRequest", "(", "$", "type", ")", ")", "{", "return", "false", ";", "}", "App", "::", "setCurrentID", "(", "self", "::", "$", "config", ...
HTTP request handler. @param string $type → complement type @uses \Eliasis\Framework\App::setCurrentID()
[ "HTTP", "request", "handler", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L34-L71
193,866
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.sanitizeParams
public static function sanitizeParams() { self::$config['remote'] = []; $remote = is_array($_POST['remote']) ? $_POST['remote'] : []; foreach ($remote as $complement => $url) { $url = filter_var($url, FILTER_VALIDATE_URL); if ($url === false) { return...
php
public static function sanitizeParams() { self::$config['remote'] = []; $remote = is_array($_POST['remote']) ? $_POST['remote'] : []; foreach ($remote as $complement => $url) { $url = filter_var($url, FILTER_VALIDATE_URL); if ($url === false) { return...
[ "public", "static", "function", "sanitizeParams", "(", ")", "{", "self", "::", "$", "config", "[", "'remote'", "]", "=", "[", "]", ";", "$", "remote", "=", "is_array", "(", "$", "_POST", "[", "'remote'", "]", ")", "?", "$", "_POST", "[", "'remote'", ...
Sanitize request parameters. @since 1.1.0 @return bool
[ "Sanitize", "request", "parameters", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L121-L145
193,867
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.loadRemoteComplements
private static function loadRemoteComplements() { $currentID = App::getCurrentID(); $complement = self::getType(); $remote = self::$config['remote']; $complements = array_keys(self::$instances[$currentID][$complement]); foreach ($remote as $complement => $url) { ...
php
private static function loadRemoteComplements() { $currentID = App::getCurrentID(); $complement = self::getType(); $remote = self::$config['remote']; $complements = array_keys(self::$instances[$currentID][$complement]); foreach ($remote as $complement => $url) { ...
[ "private", "static", "function", "loadRemoteComplements", "(", ")", "{", "$", "currentID", "=", "App", "::", "getCurrentID", "(", ")", ";", "$", "complement", "=", "self", "::", "getType", "(", ")", ";", "$", "remote", "=", "self", "::", "$", "config", ...
Load remote complements. @uses \Eliasis\Complement\Complement->$instances @uses \Eliasis\Complement\Complement::load() @uses \Eliasis\Complement\Complement::$errors
[ "Load", "remote", "complements", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L154-L169
193,868
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.complementsLoadRequest
private static function complementsLoadRequest() { $complements = self::getList(self::$config['filter'], self::$config['sort']); $response = [ 'complements' => array_values($complements), 'errors' => self::$errors, ]; echo json_encode($response); }
php
private static function complementsLoadRequest() { $complements = self::getList(self::$config['filter'], self::$config['sort']); $response = [ 'complements' => array_values($complements), 'errors' => self::$errors, ]; echo json_encode($response); }
[ "private", "static", "function", "complementsLoadRequest", "(", ")", "{", "$", "complements", "=", "self", "::", "getList", "(", "self", "::", "$", "config", "[", "'filter'", "]", ",", "self", "::", "$", "config", "[", "'sort'", "]", ")", ";", "$", "re...
Complements load request. @uses \Eliasis\Complement\Complement::getList() @uses \Eliasis\Complement\Complement::$errors
[ "Complements", "load", "request", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L177-L187
193,869
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.changeStateRequest
private static function changeStateRequest() { self::$id = self::$config['id']; $that = self::getInstance(); $state = $that->changeState(); $response = [ 'state' => $state, 'errors' => self::$errors, ]; echo json_encode($response); }
php
private static function changeStateRequest() { self::$id = self::$config['id']; $that = self::getInstance(); $state = $that->changeState(); $response = [ 'state' => $state, 'errors' => self::$errors, ]; echo json_encode($response); }
[ "private", "static", "function", "changeStateRequest", "(", ")", "{", "self", "::", "$", "id", "=", "self", "::", "$", "config", "[", "'id'", "]", ";", "$", "that", "=", "self", "::", "getInstance", "(", ")", ";", "$", "state", "=", "$", "that", "-...
Change state request. @uses \Eliasis\Complement\Complement::getInstance() @uses \Eliasis\Complement\Traits\ComplementState->changeState() @uses \Eliasis\Complement\Complement::$errors
[ "Change", "state", "request", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L196-L208
193,870
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.installRequest
private static function installRequest($isUpdate = false) { self::$id = self::$config['id']; $that = self::getInstance(); $that->install(); $that->setState($isUpdate ? 'active' : 'inactive'); $complements = self::getList(self::$config['filter'], self::$config['sort']); ...
php
private static function installRequest($isUpdate = false) { self::$id = self::$config['id']; $that = self::getInstance(); $that->install(); $that->setState($isUpdate ? 'active' : 'inactive'); $complements = self::getList(self::$config['filter'], self::$config['sort']); ...
[ "private", "static", "function", "installRequest", "(", "$", "isUpdate", "=", "false", ")", "{", "self", "::", "$", "id", "=", "self", "::", "$", "config", "[", "'id'", "]", ";", "$", "that", "=", "self", "::", "getInstance", "(", ")", ";", "$", "t...
Install request. @param string $isUpdate → if it is an update @uses \Eliasis\Complement\Complement::getInstance() @uses \Eliasis\Complement\Traits\ComplementImport->install() @uses \Eliasis\Complement\Complement::$errors
[ "Install", "request", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L219-L239
193,871
eliasis-framework/complement
src/Traits/ComplementRequest.php
ComplementRequest.uninstallRequest
private static function uninstallRequest() { self::$id = self::$config['id']; $that = self::getInstance(); $that->remove(); $state = 'uninstalled'; $response = [ 'state' => $state, 'errors' => self::$errors, ]; echo json_encode($respo...
php
private static function uninstallRequest() { self::$id = self::$config['id']; $that = self::getInstance(); $that->remove(); $state = 'uninstalled'; $response = [ 'state' => $state, 'errors' => self::$errors, ]; echo json_encode($respo...
[ "private", "static", "function", "uninstallRequest", "(", ")", "{", "self", "::", "$", "id", "=", "self", "::", "$", "config", "[", "'id'", "]", ";", "$", "that", "=", "self", "::", "getInstance", "(", ")", ";", "$", "that", "->", "remove", "(", ")...
Uninstall request. @uses \Eliasis\Complement\Complement::getInstance() @uses \string ComplementImport->remove() @uses \Eliasis\Complement\Complement::$errors
[ "Uninstall", "request", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementRequest.php#L248-L261
193,872
AndyDune/DateTime
src/Action/WorkingDaysTrait.php
WorkingDaysTrait.setNoWorkingDays
public function setNoWorkingDays(array $days, $format = null) { $this->noWorkingDays = $days; if ($format) { $this->formatNoWorkingDays = $format; } return $this; }
php
public function setNoWorkingDays(array $days, $format = null) { $this->noWorkingDays = $days; if ($format) { $this->formatNoWorkingDays = $format; } return $this; }
[ "public", "function", "setNoWorkingDays", "(", "array", "$", "days", ",", "$", "format", "=", "null", ")", "{", "$", "this", "->", "noWorkingDays", "=", "$", "days", ";", "if", "(", "$", "format", ")", "{", "$", "this", "->", "formatNoWorkingDays", "="...
Set official no working days for your country. Format: ['j-m', 'j-m', ...] @param $days @param $format @return $this
[ "Set", "official", "no", "working", "days", "for", "your", "country", "." ]
4f49f449b23072ac6d2ae0f1ea4b8e34804b760f
https://github.com/AndyDune/DateTime/blob/4f49f449b23072ac6d2ae0f1ea4b8e34804b760f/src/Action/WorkingDaysTrait.php#L53-L60
193,873
AndyDune/DateTime
src/Action/WorkingDaysTrait.php
WorkingDaysTrait.setWorkingDays
public function setWorkingDays(array $days, $format = null) { $this->workingDays = $days; if ($format) { $this->formatWorkingDays = $format; } return $this; }
php
public function setWorkingDays(array $days, $format = null) { $this->workingDays = $days; if ($format) { $this->formatWorkingDays = $format; } return $this; }
[ "public", "function", "setWorkingDays", "(", "array", "$", "days", ",", "$", "format", "=", "null", ")", "{", "$", "this", "->", "workingDays", "=", "$", "days", ";", "if", "(", "$", "format", ")", "{", "$", "this", "->", "formatWorkingDays", "=", "$...
Set working days as exclusion. @param array $days @param null $format @return $this
[ "Set", "working", "days", "as", "exclusion", "." ]
4f49f449b23072ac6d2ae0f1ea4b8e34804b760f
https://github.com/AndyDune/DateTime/blob/4f49f449b23072ac6d2ae0f1ea4b8e34804b760f/src/Action/WorkingDaysTrait.php#L69-L76
193,874
inetstudio/widgets
src/Models/Traits/HasWidgets.php
HasWidgets.bootHasWidgets
public static function bootHasWidgets() { static::created(function (Model $widgetableModel) { if ($widgetableModel->queuedWidgets) { $widgetableModel->attachWidgets($widgetableModel->queuedWidgets); $widgetableModel->queuedWidgets = []; } }); ...
php
public static function bootHasWidgets() { static::created(function (Model $widgetableModel) { if ($widgetableModel->queuedWidgets) { $widgetableModel->attachWidgets($widgetableModel->queuedWidgets); $widgetableModel->queuedWidgets = []; } }); ...
[ "public", "static", "function", "bootHasWidgets", "(", ")", "{", "static", "::", "created", "(", "function", "(", "Model", "$", "widgetableModel", ")", "{", "if", "(", "$", "widgetableModel", "->", "queuedWidgets", ")", "{", "$", "widgetableModel", "->", "at...
Boot the widgetable trait for a model. @return void
[ "Boot", "the", "widgetable", "trait", "for", "a", "model", "." ]
bc9357a1183a028f93f725b55b9db2867b7ec731
https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Models/Traits/HasWidgets.php#L65-L77
193,875
inetstudio/widgets
src/Models/Traits/HasWidgets.php
HasWidgets.scopeWithAllWidgets
public function scopeWithAllWidgets(Builder $query, $widgets, string $column = 'id'): Builder { $widgets = static::isWidgetsStringBased($widgets) ? $widgets : static::hydrateWidgets($widgets)->pluck($column); collect($widgets)->each(function ($widget) use ($query, $column) { ...
php
public function scopeWithAllWidgets(Builder $query, $widgets, string $column = 'id'): Builder { $widgets = static::isWidgetsStringBased($widgets) ? $widgets : static::hydrateWidgets($widgets)->pluck($column); collect($widgets)->each(function ($widget) use ($query, $column) { ...
[ "public", "function", "scopeWithAllWidgets", "(", "Builder", "$", "query", ",", "$", "widgets", ",", "string", "$", "column", "=", "'id'", ")", ":", "Builder", "{", "$", "widgets", "=", "static", "::", "isWidgetsStringBased", "(", "$", "widgets", ")", "?",...
Scope query with all the given widgets. @param \Illuminate\Database\Eloquent\Builder $query @param int|string|array|\ArrayAccess|WidgetModelContract $widgets @param string $column @return \Illuminate\Database\Eloquent\Builder
[ "Scope", "query", "with", "all", "the", "given", "widgets", "." ]
bc9357a1183a028f93f725b55b9db2867b7ec731
https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Models/Traits/HasWidgets.php#L100-L112
193,876
inetstudio/widgets
src/Models/Traits/HasWidgets.php
HasWidgets.scopeWithoutWidgets
public function scopeWithoutWidgets(Builder $query, $widgets, string $column = 'id'): Builder { $widgets = static::isWidgetsStringBased($widgets) ? $widgets : static::hydrateWidgets($widgets)->pluck($column); return $query->whereDoesntHave('widgets', function (Builder $query) use ($widg...
php
public function scopeWithoutWidgets(Builder $query, $widgets, string $column = 'id'): Builder { $widgets = static::isWidgetsStringBased($widgets) ? $widgets : static::hydrateWidgets($widgets)->pluck($column); return $query->whereDoesntHave('widgets', function (Builder $query) use ($widg...
[ "public", "function", "scopeWithoutWidgets", "(", "Builder", "$", "query", ",", "$", "widgets", ",", "string", "$", "column", "=", "'id'", ")", ":", "Builder", "{", "$", "widgets", "=", "static", "::", "isWidgetsStringBased", "(", "$", "widgets", ")", "?",...
Scope query without the given widgets. @param \Illuminate\Database\Eloquent\Builder $query @param int|string|array|\ArrayAccess|WidgetModelContract $widgets @param string $column @return \Illuminate\Database\Eloquent\Builder
[ "Scope", "query", "without", "the", "given", "widgets", "." ]
bc9357a1183a028f93f725b55b9db2867b7ec731
https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Models/Traits/HasWidgets.php#L156-L164
193,877
inetstudio/widgets
src/Models/Traits/HasWidgets.php
HasWidgets.hasWidget
public function hasWidget($widgets): bool { // Single Widget id if (is_string($widgets)) { return $this->widgets->contains('id', $widgets); } // Single Widget id if (is_int($widgets)) { return $this->widgets->contains('id', $widgets); } ...
php
public function hasWidget($widgets): bool { // Single Widget id if (is_string($widgets)) { return $this->widgets->contains('id', $widgets); } // Single Widget id if (is_int($widgets)) { return $this->widgets->contains('id', $widgets); } ...
[ "public", "function", "hasWidget", "(", "$", "widgets", ")", ":", "bool", "{", "// Single Widget id", "if", "(", "is_string", "(", "$", "widgets", ")", ")", "{", "return", "$", "this", "->", "widgets", "->", "contains", "(", "'id'", ",", "$", "widgets", ...
Determine if the model has any the given widgets. @param int|string|array|\ArrayAccess|WidgetModelContract $widgets @return bool
[ "Determine", "if", "the", "model", "has", "any", "the", "given", "widgets", "." ]
bc9357a1183a028f93f725b55b9db2867b7ec731
https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Models/Traits/HasWidgets.php#L227-L260
193,878
inetstudio/widgets
src/Models/Traits/HasWidgets.php
HasWidgets.hasAllWidgets
public function hasAllWidgets($widgets): bool { // Single widget id if (is_string($widgets)) { return $this->widgets->contains('id', $widgets); } // Single widget id if (is_int($widgets)) { return $this->widgets->contains('id', $widgets); } ...
php
public function hasAllWidgets($widgets): bool { // Single widget id if (is_string($widgets)) { return $this->widgets->contains('id', $widgets); } // Single widget id if (is_int($widgets)) { return $this->widgets->contains('id', $widgets); } ...
[ "public", "function", "hasAllWidgets", "(", "$", "widgets", ")", ":", "bool", "{", "// Single widget id", "if", "(", "is_string", "(", "$", "widgets", ")", ")", "{", "return", "$", "this", "->", "widgets", "->", "contains", "(", "'id'", ",", "$", "widget...
Determine if the model has all of the given widgets. @param int|string|array|\ArrayAccess|WidgetModelContract $widgets @return bool
[ "Determine", "if", "the", "model", "has", "all", "of", "the", "given", "widgets", "." ]
bc9357a1183a028f93f725b55b9db2867b7ec731
https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Models/Traits/HasWidgets.php#L281-L316
193,879
inetstudio/widgets
src/Models/Traits/HasWidgets.php
HasWidgets.hydrateWidgets
protected function hydrateWidgets($widgets) { $isWidgetsStringBased = static::isWidgetsStringBased($widgets); $isWidgetsIntBased = static::isWidgetsIntBased($widgets); $field = $isWidgetsStringBased ? 'id' : 'id'; $className = static::getWidgetClassName(); return $isWidgetsS...
php
protected function hydrateWidgets($widgets) { $isWidgetsStringBased = static::isWidgetsStringBased($widgets); $isWidgetsIntBased = static::isWidgetsIntBased($widgets); $field = $isWidgetsStringBased ? 'id' : 'id'; $className = static::getWidgetClassName(); return $isWidgetsS...
[ "protected", "function", "hydrateWidgets", "(", "$", "widgets", ")", "{", "$", "isWidgetsStringBased", "=", "static", "::", "isWidgetsStringBased", "(", "$", "widgets", ")", ";", "$", "isWidgetsIntBased", "=", "static", "::", "isWidgetsIntBased", "(", "$", "widg...
Hydrate widgets. @param int|string|array|\ArrayAccess|WidgetModelContract $widgets @return \Illuminate\Support\Collection
[ "Hydrate", "widgets", "." ]
bc9357a1183a028f93f725b55b9db2867b7ec731
https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Models/Traits/HasWidgets.php#L351-L360
193,880
AndyDune/ConditionalExecution
src/CheckValue.php
CheckValue.isHaveValue
public function isHaveValue($checkValue) { $this->checkFunctions[] = function ($value) use ($checkValue) { if (!is_array($value)) { return false; } return in_array($checkValue, $value); }; return $this; }
php
public function isHaveValue($checkValue) { $this->checkFunctions[] = function ($value) use ($checkValue) { if (!is_array($value)) { return false; } return in_array($checkValue, $value); }; return $this; }
[ "public", "function", "isHaveValue", "(", "$", "checkValue", ")", "{", "$", "this", "->", "checkFunctions", "[", "]", "=", "function", "(", "$", "value", ")", "use", "(", "$", "checkValue", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")"...
Use it if verifiable value is array For more correction @param $checkValue @return $this
[ "Use", "it", "if", "verifiable", "value", "is", "array", "For", "more", "correction" ]
c92c964bda607644ccc313edb2d59b288f7b7890
https://github.com/AndyDune/ConditionalExecution/blob/c92c964bda607644ccc313edb2d59b288f7b7890/src/CheckValue.php#L101-L110
193,881
sil-project/SeedBatchBundle
src/Entity/Certification.php
Certification.setPlot
public function setPlot(\Librinfo\SeedBatchBundle\Entity\Plot $plot = null) { $this->plot = $plot; return $this; }
php
public function setPlot(\Librinfo\SeedBatchBundle\Entity\Plot $plot = null) { $this->plot = $plot; return $this; }
[ "public", "function", "setPlot", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "Plot", "$", "plot", "=", "null", ")", "{", "$", "this", "->", "plot", "=", "$", "plot", ";", "return", "$", "this", ";", "}" ]
Set plot. @param \Librinfo\SeedBatchBundle\Entity\Plot $plot @return Certification
[ "Set", "plot", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Certification.php#L245-L250
193,882
sil-project/SeedBatchBundle
src/Entity/Certification.php
Certification.setCertifyingBody
public function setCertifyingBody(\Librinfo\SeedBatchBundle\Entity\CertifyingBody $certifyingBody = null) { $this->certifyingBody = $certifyingBody; return $this; }
php
public function setCertifyingBody(\Librinfo\SeedBatchBundle\Entity\CertifyingBody $certifyingBody = null) { $this->certifyingBody = $certifyingBody; return $this; }
[ "public", "function", "setCertifyingBody", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "CertifyingBody", "$", "certifyingBody", "=", "null", ")", "{", "$", "this", "->", "certifyingBody", "=", "$", "certifyingBody", ";", "return", "$", ...
Set certifyingBody. @param \Librinfo\SeedBatchBundle\Entity\CertifyingBody $certifyingBody @return Certification
[ "Set", "certifyingBody", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Certification.php#L269-L274
193,883
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/FileCache.php
FileCache.writeFile
protected function writeFile(EntityMetadata $metadata, $contents) { $file = $this->getCacheFile($metadata->type); $tmpFile = tempnam($this->dir, 'metadata-cache'); file_put_contents($tmpFile, $contents); chmod($tmpFile, 0666 & ~umask()); $this->renameFile($tmpFile, $file); ...
php
protected function writeFile(EntityMetadata $metadata, $contents) { $file = $this->getCacheFile($metadata->type); $tmpFile = tempnam($this->dir, 'metadata-cache'); file_put_contents($tmpFile, $contents); chmod($tmpFile, 0666 & ~umask()); $this->renameFile($tmpFile, $file); ...
[ "protected", "function", "writeFile", "(", "EntityMetadata", "$", "metadata", ",", "$", "contents", ")", "{", "$", "file", "=", "$", "this", "->", "getCacheFile", "(", "$", "metadata", "->", "type", ")", ";", "$", "tmpFile", "=", "tempnam", "(", "$", "...
Writes the cache file. @param EntityMetadata $metadata @param string $contents
[ "Writes", "the", "cache", "file", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/FileCache.php#L91-L98
193,884
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/FileCache.php
FileCache.getCacheFile
private function getCacheFile($type) { $type = str_replace(EntityMetadata::NAMESPACE_DELIM, '_', $type); return $this->dir.'/ModlrData.'.$this->cachePrefix.'.'.$type.'.'.$this->extension; }
php
private function getCacheFile($type) { $type = str_replace(EntityMetadata::NAMESPACE_DELIM, '_', $type); return $this->dir.'/ModlrData.'.$this->cachePrefix.'.'.$type.'.'.$this->extension; }
[ "private", "function", "getCacheFile", "(", "$", "type", ")", "{", "$", "type", "=", "str_replace", "(", "EntityMetadata", "::", "NAMESPACE_DELIM", ",", "'_'", ",", "$", "type", ")", ";", "return", "$", "this", "->", "dir", ".", "'/ModlrData.'", ".", "$"...
Gets the cache file from the entity type. @param string $type @return string
[ "Gets", "the", "cache", "file", "from", "the", "entity", "type", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/FileCache.php#L118-L122
193,885
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/FileCache.php
FileCache.renameFile
private function renameFile($source, $target) { if (false === @rename($source, $target)) { throw new RuntimeException(sprintf('Could not write new cache file to %s.', $target)); } }
php
private function renameFile($source, $target) { if (false === @rename($source, $target)) { throw new RuntimeException(sprintf('Could not write new cache file to %s.', $target)); } }
[ "private", "function", "renameFile", "(", "$", "source", ",", "$", "target", ")", "{", "if", "(", "false", "===", "@", "rename", "(", "$", "source", ",", "$", "target", ")", ")", "{", "throw", "new", "RuntimeException", "(", "sprintf", "(", "'Could not...
Renames a file @param string $source @param string $target @throws \RuntimeException
[ "Renames", "a", "file" ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/FileCache.php#L131-L136
193,886
netbull/CoreBundle
Command/JSRoutingCommand.php
JSRoutingCommand.doDump
private function doDump(OutputInterface $output) { if (!is_dir($dir = dirname($this->targetPath))) { $output->writeln('<info>[dir+]</info> ' . $dir); if (false === @mkdir($dir, 0777, true)) { throw new \RuntimeException('Unable to create directory ' . $dir); ...
php
private function doDump(OutputInterface $output) { if (!is_dir($dir = dirname($this->targetPath))) { $output->writeln('<info>[dir+]</info> ' . $dir); if (false === @mkdir($dir, 0777, true)) { throw new \RuntimeException('Unable to create directory ' . $dir); ...
[ "private", "function", "doDump", "(", "OutputInterface", "$", "output", ")", "{", "if", "(", "!", "is_dir", "(", "$", "dir", "=", "dirname", "(", "$", "this", "->", "targetPath", ")", ")", ")", "{", "$", "output", "->", "writeln", "(", "'<info>[dir+]</...
Performs the routes dump. @param OutputInterface $output The command output
[ "Performs", "the", "routes", "dump", "." ]
0bacc1d9e4733b6da613027400c48421e5a14645
https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Command/JSRoutingCommand.php#L101-L139
193,887
bseddon/XPath20
ExtFuncs.php
ExtFuncs.PrepareRegexFlags
private static function PrepareRegexFlags( $flagString ) { // The flag string can only contain s,m,i and/or x $result = preg_match( "/[^smix]+/", $flagString); if ( $result ) { throw XPath2Exception::withErrorCodeAndParam( "FORX0001", Resources::InvalidRegularExpr, "$flagString" ); } return $f...
php
private static function PrepareRegexFlags( $flagString ) { // The flag string can only contain s,m,i and/or x $result = preg_match( "/[^smix]+/", $flagString); if ( $result ) { throw XPath2Exception::withErrorCodeAndParam( "FORX0001", Resources::InvalidRegularExpr, "$flagString" ); } return $f...
[ "private", "static", "function", "PrepareRegexFlags", "(", "$", "flagString", ")", "{", "// The flag string can only contain s,m,i and/or x\r", "$", "result", "=", "preg_match", "(", "\"/[^smix]+/\"", ",", "$", "flagString", ")", ";", "if", "(", "$", "result", ")", ...
Check the flag string contents @param string $flagString @return string
[ "Check", "the", "flag", "string", "contents" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/ExtFuncs.php#L1314-L1324
193,888
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.names
final public static function names() { $result = []; $classes = self::hierarchy(\get_called_class()); /* @var $class ReflectionClass */ foreach ($classes as $class) { $result = \array_merge(self::namesFor($class->name), $result); } return $result; }
php
final public static function names() { $result = []; $classes = self::hierarchy(\get_called_class()); /* @var $class ReflectionClass */ foreach ($classes as $class) { $result = \array_merge(self::namesFor($class->name), $result); } return $result; }
[ "final", "public", "static", "function", "names", "(", ")", "{", "$", "result", "=", "[", "]", ";", "$", "classes", "=", "self", "::", "hierarchy", "(", "\\", "get_called_class", "(", ")", ")", ";", "/* @var $class ReflectionClass */", "foreach", "(", "$",...
Returns an array containing the names of the enumeration constants of this enumeration type, in the order they are declared. This method may be used to iterate over the names of the enumerated constants as follows: /---code php foreach (ConcreteEnum::names() as $name) { echo $name, \PHP_EOL; } \--- @return string[] ...
[ "Returns", "an", "array", "containing", "the", "names", "of", "the", "enumeration", "constants", "of", "this", "enumeration", "type", "in", "the", "order", "they", "are", "declared", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L299-L310
193,889
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.namesFor
private static function namesFor($enumType) { $result = []; $methods = ReflectionUtils::methodsForClassWithoutInheritedMethods( $enumType, [ ReflectionMethod::IS_FINAL, ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC ...
php
private static function namesFor($enumType) { $result = []; $methods = ReflectionUtils::methodsForClassWithoutInheritedMethods( $enumType, [ ReflectionMethod::IS_FINAL, ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC ...
[ "private", "static", "function", "namesFor", "(", "$", "enumType", ")", "{", "$", "result", "=", "[", "]", ";", "$", "methods", "=", "ReflectionUtils", "::", "methodsForClassWithoutInheritedMethods", "(", "$", "enumType", ",", "[", "ReflectionMethod", "::", "I...
Returns an array containing the names of the enumeration constants of the specified enumeration type. The returned array does **not** contain enumeration constant names from the subclasses of the specified enumeration type. @param string $enumType The enumeration type @return string[] An array containing the names o...
[ "Returns", "an", "array", "containing", "the", "names", "of", "the", "enumeration", "constants", "of", "the", "specified", "enumeration", "type", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L340-L361
193,890
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.values
final public static function values() { $names = self::names(); $result = []; foreach ($names as $name) { $result[] = static::$name(); } return $result; }
php
final public static function values() { $names = self::names(); $result = []; foreach ($names as $name) { $result[] = static::$name(); } return $result; }
[ "final", "public", "static", "function", "values", "(", ")", "{", "$", "names", "=", "self", "::", "names", "(", ")", ";", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "names", "as", "$", "name", ")", "{", "$", "result", "[", "]", "=...
Returns an array containing the enumeration constants of this enumeration type, in the order they are declared. This method may be used to iterate over the enumeration constants as follows: /---code php foreach (ConcreteEnum::values() as $constant) { // Same as "echo $constant->__toString(), \PHP_EOL"; echo $constant...
[ "Returns", "an", "array", "containing", "the", "enumeration", "constants", "of", "this", "enumeration", "type", "in", "the", "order", "they", "are", "declared", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L381-L391
193,891
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.valueOf
final public static function valueOf($name) { $result = null; try { /* @var $constant EnumAbstract */ foreach (self::values() as $constant) { if ($constant->name === $name) { $result = $constant; break; ...
php
final public static function valueOf($name) { $result = null; try { /* @var $constant EnumAbstract */ foreach (self::values() as $constant) { if ($constant->name === $name) { $result = $constant; break; ...
[ "final", "public", "static", "function", "valueOf", "(", "$", "name", ")", "{", "$", "result", "=", "null", ";", "try", "{", "/* @var $constant EnumAbstract */", "foreach", "(", "self", "::", "values", "(", ")", "as", "$", "constant", ")", "{", "if", "("...
Returns the enumeration constant with the specified name from this enumeration type. The string must match exactly an identifier used to declare an enumeration constant in this enumeration type. (Extraneous whitespace characters are not permitted.) @param string $name The name of the enumeration constant to return. ...
[ "Returns", "the", "enumeration", "constant", "with", "the", "specified", "name", "from", "this", "enumeration", "type", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L406-L423
193,892
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.getInstance
final protected static function getInstance() { $backtrace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS); $className = self::retrieveNameOfSuperclassFor( $backtrace[1]['class'] ); $constantName = $backtrace[1]['function']; $constantOrdinal = self::retrieveOrdin...
php
final protected static function getInstance() { $backtrace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS); $className = self::retrieveNameOfSuperclassFor( $backtrace[1]['class'] ); $constantName = $backtrace[1]['function']; $constantOrdinal = self::retrieveOrdin...
[ "final", "protected", "static", "function", "getInstance", "(", ")", "{", "$", "backtrace", "=", "\\", "debug_backtrace", "(", "\\", "DEBUG_BACKTRACE_IGNORE_ARGS", ")", ";", "$", "className", "=", "self", "::", "retrieveNameOfSuperclassFor", "(", "$", "backtrace",...
Creates and returns an enumeration constant for the specified enumeration type with the specified name. This method implements the *Lazy Load* implementation pattern. Use this method as follows in a subclass of this class: /---code php final class ConcreteEnum extends FlorianWolters\Component\Core\Enum\EnumAbstract ...
[ "Creates", "and", "returns", "an", "enumeration", "constant", "for", "the", "specified", "enumeration", "type", "with", "the", "specified", "name", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L452-L467
193,893
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.retrieveNameOfSuperclassFor
private static function retrieveNameOfSuperclassFor($className) { $parents = self::hierarchy($className); return (true === empty($parents)) ? $className : $parents[count($parents) - 1]->name; }
php
private static function retrieveNameOfSuperclassFor($className) { $parents = self::hierarchy($className); return (true === empty($parents)) ? $className : $parents[count($parents) - 1]->name; }
[ "private", "static", "function", "retrieveNameOfSuperclassFor", "(", "$", "className", ")", "{", "$", "parents", "=", "self", "::", "hierarchy", "(", "$", "className", ")", ";", "return", "(", "true", "===", "empty", "(", "$", "parents", ")", ")", "?", "...
Returns the superclass name for the specified classname. @param string $className The name of the class, which superclass name to return. @return string The name of the superclass.
[ "Returns", "the", "superclass", "name", "for", "the", "specified", "classname", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L477-L484
193,894
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.retrieveOrdinalFor
private static function retrieveOrdinalFor($name) { $result = null; foreach (self::names() as $key => $value) { if ($name === $value) { $result = $key; break; } } return $result; }
php
private static function retrieveOrdinalFor($name) { $result = null; foreach (self::names() as $key => $value) { if ($name === $value) { $result = $key; break; } } return $result; }
[ "private", "static", "function", "retrieveOrdinalFor", "(", "$", "name", ")", "{", "$", "result", "=", "null", ";", "foreach", "(", "self", "::", "names", "(", ")", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "name", "===", "$",...
Returns the ordinal of the enumeration constant with the specified name in this enumeration type. @param string $name The name of the enumeration constant, which is the identifier used to declare it. @return integer The ordinal of the enumeration constant (its position in the enumeration declaration, where the initia...
[ "Returns", "the", "ordinal", "of", "the", "enumeration", "constant", "with", "the", "specified", "name", "in", "this", "enumeration", "type", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L497-L509
193,895
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.invokeConstructorIfDeclared
private function invokeConstructorIfDeclared(array $arguments) { $methodName = 'construct'; try { $method = new ReflectionMethod($this, $methodName); if (true === $method->isPublic()) { throw new RuntimeException( 'The constructor of an e...
php
private function invokeConstructorIfDeclared(array $arguments) { $methodName = 'construct'; try { $method = new ReflectionMethod($this, $methodName); if (true === $method->isPublic()) { throw new RuntimeException( 'The constructor of an e...
[ "private", "function", "invokeConstructorIfDeclared", "(", "array", "$", "arguments", ")", "{", "$", "methodName", "=", "'construct'", ";", "try", "{", "$", "method", "=", "new", "ReflectionMethod", "(", "$", "this", ",", "$", "methodName", ")", ";", "if", ...
Invokes the constructor of this enumeration constant with the specified arguments. @param mixed[] $arguments The constructor arguments. @return void
[ "Invokes", "the", "constructor", "of", "this", "enumeration", "constant", "with", "the", "specified", "arguments", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L539-L557
193,896
FlorianWolters/PHP-Component-Core-Enum
src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php
EnumAbstract.compareTo
final public function compareTo(ComparableInterface $other) { if (false === ($other instanceof self)) { throw new ClassCastException( 'The specified object\'s type is not an instance of ' . __CLASS__ . '.' ); } if (false === ($this ins...
php
final public function compareTo(ComparableInterface $other) { if (false === ($other instanceof self)) { throw new ClassCastException( 'The specified object\'s type is not an instance of ' . __CLASS__ . '.' ); } if (false === ($this ins...
[ "final", "public", "function", "compareTo", "(", "ComparableInterface", "$", "other", ")", "{", "if", "(", "false", "===", "(", "$", "other", "instanceof", "self", ")", ")", "{", "throw", "new", "ClassCastException", "(", "'The specified object\\'s type is not an ...
Compares this enumeration constant with the specified enumeration constant for order. Enumeration constants are only comparable to other enumeration constants of the same enumeration type. The natural order implemented by this method is the order in which the enumeration constants are declared. @param ComparableInter...
[ "Compares", "this", "enumeration", "constant", "with", "the", "specified", "enumeration", "constant", "for", "order", "." ]
838dcdc5705c3e1a2c0ff879987590b0a455db38
https://github.com/FlorianWolters/PHP-Component-Core-Enum/blob/838dcdc5705c3e1a2c0ff879987590b0a455db38/src/php/FlorianWolters/Component/Core/Enum/EnumAbstract.php#L648-L665
193,897
staticka/staticka
src/Layout.php
Layout.render
public function render($name, $content) { list($data, $content) = (array) Matter::parse($content); $data = array_merge($data, (array) $this->data); $data['title'] = isset($data['title']) ? $data['title'] : ''; $output = $this->website->content()->make($content); if ($data...
php
public function render($name, $content) { list($data, $content) = (array) Matter::parse($content); $data = array_merge($data, (array) $this->data); $data['title'] = isset($data['title']) ? $data['title'] : ''; $output = $this->website->content()->make($content); if ($data...
[ "public", "function", "render", "(", "$", "name", ",", "$", "content", ")", "{", "list", "(", "$", "data", ",", "$", "content", ")", "=", "(", "array", ")", "Matter", "::", "parse", "(", "$", "content", ")", ";", "$", "data", "=", "array_merge", ...
Renders the specified HTML content with a template. @param string $name @param string $content @return string
[ "Renders", "the", "specified", "HTML", "content", "with", "a", "template", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Layout.php#L56-L75
193,898
aztech-digital/phinject
src/DefaultReferenceResolver.php
DefaultReferenceResolver.resolve
public function resolve($reference) { if (empty($reference)) { return $reference; } if ($this->isResolvableAnonymousReference($reference)) { return $this->resolveAnonymousReference($reference); } return $this->resolveInternal($reference); }
php
public function resolve($reference) { if (empty($reference)) { return $reference; } if ($this->isResolvableAnonymousReference($reference)) { return $this->resolveAnonymousReference($reference); } return $this->resolveInternal($reference); }
[ "public", "function", "resolve", "(", "$", "reference", ")", "{", "if", "(", "empty", "(", "$", "reference", ")", ")", "{", "return", "$", "reference", ";", "}", "if", "(", "$", "this", "->", "isResolvableAnonymousReference", "(", "$", "reference", ")", ...
Return the resolved value of the given reference. @param mixed $reference @return mixed
[ "Return", "the", "resolved", "value", "of", "the", "given", "reference", "." ]
1bb2fb3b5ef44e62f168af71134c613c48b58d95
https://github.com/aztech-digital/phinject/blob/1bb2fb3b5ef44e62f168af71134c613c48b58d95/src/DefaultReferenceResolver.php#L81-L92
193,899
aztech-digital/phinject
src/DefaultReferenceResolver.php
DefaultReferenceResolver.resolveMany
public function resolveMany(array $references) { $convertedParameters = array(); foreach ($references as $reference) { $convertedValue = $this->resolve($reference); $convertedParameters[] = $convertedValue; } return $convertedParameters; }
php
public function resolveMany(array $references) { $convertedParameters = array(); foreach ($references as $reference) { $convertedValue = $this->resolve($reference); $convertedParameters[] = $convertedValue; } return $convertedParameters; }
[ "public", "function", "resolveMany", "(", "array", "$", "references", ")", "{", "$", "convertedParameters", "=", "array", "(", ")", ";", "foreach", "(", "$", "references", "as", "$", "reference", ")", "{", "$", "convertedValue", "=", "$", "this", "->", "...
Resolves an array of references @param array $references @return mixed
[ "Resolves", "an", "array", "of", "references" ]
1bb2fb3b5ef44e62f168af71134c613c48b58d95
https://github.com/aztech-digital/phinject/blob/1bb2fb3b5ef44e62f168af71134c613c48b58d95/src/DefaultReferenceResolver.php#L134-L144