id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
199,900
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.addSequence
public function addSequence(Sequence $sequence) { if ($this->hasSequence($sequence->getName())) { throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $sequence->getName()); } $this->sequences[$sequence->getName()] = $sequence; }
php
public function addSequence(Sequence $sequence) { if ($this->hasSequence($sequence->getName())) { throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $sequence->getName()); } $this->sequences[$sequence->getName()] = $sequence; }
[ "public", "function", "addSequence", "(", "Sequence", "$", "sequence", ")", "{", "if", "(", "$", "this", "->", "hasSequence", "(", "$", "sequence", "->", "getName", "(", ")", ")", ")", "{", "throw", "SchemaException", "::", "schemaSequenceAlreadyExists", "("...
Adds a sequence to the schema. @param Fridge\DBAL\Schema\Sequence $sequence The sequence to add. @throws \Fridge\DBAL\Exception\SchemaException If the sequence already exists.
[ "Adds", "a", "sequence", "to", "the", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L348-L355
199,901
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.renameSequence
public function renameSequence($oldName, $newName) { if (!$this->hasSequence($oldName)) { throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $oldName); } if ($this->hasSequence($newName)) { throw SchemaException::schemaSequenceAlreadyExists($this->ge...
php
public function renameSequence($oldName, $newName) { if (!$this->hasSequence($oldName)) { throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $oldName); } if ($this->hasSequence($newName)) { throw SchemaException::schemaSequenceAlreadyExists($this->ge...
[ "public", "function", "renameSequence", "(", "$", "oldName", ",", "$", "newName", ")", "{", "if", "(", "!", "$", "this", "->", "hasSequence", "(", "$", "oldName", ")", ")", "{", "throw", "SchemaException", "::", "schemaSequenceDoesNotExist", "(", "$", "thi...
Renames a sequence. @param string $oldName The old sequence name. @param string $newName The new sequence name. @throws \Fridge\DBAL\Exception\SchemaException If the old sequence does not exist or if the new sequence already exists.
[ "Renames", "a", "sequence", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L366-L380
199,902
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.dropSequence
public function dropSequence($name) { if (!$this->hasSequence($name)) { throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $name); } unset($this->sequences[$name]); }
php
public function dropSequence($name) { if (!$this->hasSequence($name)) { throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $name); } unset($this->sequences[$name]); }
[ "public", "function", "dropSequence", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasSequence", "(", "$", "name", ")", ")", "{", "throw", "SchemaException", "::", "schemaSequenceDoesNotExist", "(", "$", "this", "->", "getName", "(", "...
Drops a sequence. @param string $name The sequence name. @throws \Fridge\DBAL\Exception\SchemaException If the sequence does not exist.
[ "Drops", "a", "sequence", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L389-L396
199,903
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.createView
public function createView($name, $sql = null) { $view = new View($name, $sql); $this->addView($view); return $view; }
php
public function createView($name, $sql = null) { $view = new View($name, $sql); $this->addView($view); return $view; }
[ "public", "function", "createView", "(", "$", "name", ",", "$", "sql", "=", "null", ")", "{", "$", "view", "=", "new", "View", "(", "$", "name", ",", "$", "sql", ")", ";", "$", "this", "->", "addView", "(", "$", "view", ")", ";", "return", "$",...
Creates and adds a new view. @param string $name The view name. @param string $sql The view sql. @return \Fridge\DBAL\Schema\View The new view.
[ "Creates", "and", "adds", "a", "new", "view", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L406-L412
199,904
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.setViews
public function setViews(array $views) { $this->views = array(); foreach ($views as $view) { $this->addView($view); } }
php
public function setViews(array $views) { $this->views = array(); foreach ($views as $view) { $this->addView($view); } }
[ "public", "function", "setViews", "(", "array", "$", "views", ")", "{", "$", "this", "->", "views", "=", "array", "(", ")", ";", "foreach", "(", "$", "views", "as", "$", "view", ")", "{", "$", "this", "->", "addView", "(", "$", "view", ")", ";", ...
Sets the schema views. @param array $views The schema views.
[ "Sets", "the", "schema", "views", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L439-L446
199,905
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.getView
public function getView($name) { if (!$this->hasView($name)) { throw SchemaException::schemaViewDoesNotExist($this->getName(), $name); } return $this->views[$name]; }
php
public function getView($name) { if (!$this->hasView($name)) { throw SchemaException::schemaViewDoesNotExist($this->getName(), $name); } return $this->views[$name]; }
[ "public", "function", "getView", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasView", "(", "$", "name", ")", ")", "{", "throw", "SchemaException", "::", "schemaViewDoesNotExist", "(", "$", "this", "->", "getName", "(", ")", ",", ...
Gets a view. @param string $name The view name. @return \Fridge\DBAL\Schema\View The view. @throws \Fridge\DBAL\Exception\SchemaException If the view does not exist.
[ "Gets", "a", "view", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L469-L476
199,906
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.addView
public function addView(View $view) { if ($this->hasView($view->getName())) { throw SchemaException::schemaViewAlreadyExists($this->getName(), $view->getName()); } $this->views[$view->getName()] = $view; }
php
public function addView(View $view) { if ($this->hasView($view->getName())) { throw SchemaException::schemaViewAlreadyExists($this->getName(), $view->getName()); } $this->views[$view->getName()] = $view; }
[ "public", "function", "addView", "(", "View", "$", "view", ")", "{", "if", "(", "$", "this", "->", "hasView", "(", "$", "view", "->", "getName", "(", ")", ")", ")", "{", "throw", "SchemaException", "::", "schemaViewAlreadyExists", "(", "$", "this", "->...
Adds a view to the schema. @param \Fridge\DBAL\Schema\View $view The view to add. @throws \Fridge\DBAL\Exception\SchemaException If the view already exists.
[ "Adds", "a", "view", "to", "the", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L485-L492
199,907
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.renameView
public function renameView($oldName, $newName) { if (!$this->hasView($oldName)) { throw SchemaException::schemaViewDoesNotExist($this->getName(), $oldName); } if ($this->hasView($newName)) { throw SchemaException::schemaViewAlreadyExists($this->getName(), $newName); ...
php
public function renameView($oldName, $newName) { if (!$this->hasView($oldName)) { throw SchemaException::schemaViewDoesNotExist($this->getName(), $oldName); } if ($this->hasView($newName)) { throw SchemaException::schemaViewAlreadyExists($this->getName(), $newName); ...
[ "public", "function", "renameView", "(", "$", "oldName", ",", "$", "newName", ")", "{", "if", "(", "!", "$", "this", "->", "hasView", "(", "$", "oldName", ")", ")", "{", "throw", "SchemaException", "::", "schemaViewDoesNotExist", "(", "$", "this", "->", ...
Renames a view. @param string $oldName The old view name. @param string $newName The new view name. @throws \Fridge\DBAL\Exception\SchemaException If the old view does not exist or if the new view already exists.
[ "Renames", "a", "view", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L502-L516
199,908
fridge-project/dbal
src/Fridge/DBAL/Schema/Schema.php
Schema.dropView
public function dropView($name) { if (!$this->hasView($name)) { throw SchemaException::schemaViewDoesNotExist($this->getName(), $name); } unset($this->views[$name]); }
php
public function dropView($name) { if (!$this->hasView($name)) { throw SchemaException::schemaViewDoesNotExist($this->getName(), $name); } unset($this->views[$name]); }
[ "public", "function", "dropView", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasView", "(", "$", "name", ")", ")", "{", "throw", "SchemaException", "::", "schemaViewDoesNotExist", "(", "$", "this", "->", "getName", "(", ")", ",", ...
Drops a view. @param string $name The view name. @throws \Fridge\DBAL\Exception\SchemaException If the view does not exist.
[ "Drops", "a", "view", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L525-L532
199,909
mossphp/moss-storage
Moss/Storage/Model/Definition/Field.php
Field.prepareAttributes
protected function prepareAttributes(array $attributes) { foreach ($attributes as $key => $value) { if (is_numeric($key)) { unset($attributes[$key]); $attributes[$value] = true; continue; } } if (isset($attributes['null...
php
protected function prepareAttributes(array $attributes) { foreach ($attributes as $key => $value) { if (is_numeric($key)) { unset($attributes[$key]); $attributes[$value] = true; continue; } } if (isset($attributes['null...
[ "protected", "function", "prepareAttributes", "(", "array", "$", "attributes", ")", "{", "foreach", "(", "$", "attributes", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_numeric", "(", "$", "key", ")", ")", "{", "unset", "(", "$", "a...
Prepares attributes, changes them into key value pairs @param array $attributes @return array
[ "Prepares", "attributes", "changes", "them", "into", "key", "value", "pairs" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Model/Definition/Field.php#L51-L67
199,910
mossphp/moss-storage
Moss/Storage/Model/Definition/Field.php
Field.table
public function table($table = null) { if ($table !== null) { $this->table = $table; } return $this->table; }
php
public function table($table = null) { if ($table !== null) { $this->table = $table; } return $this->table; }
[ "public", "function", "table", "(", "$", "table", "=", "null", ")", "{", "if", "(", "$", "table", "!==", "null", ")", "{", "$", "this", "->", "table", "=", "$", "table", ";", "}", "return", "$", "this", "->", "table", ";", "}" ]
Returns table owning the field @param null|string $table @return string
[ "Returns", "table", "owning", "the", "field" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Model/Definition/Field.php#L76-L83
199,911
AmericanCouncils/WebServicesBundle
Negotiator.php
Negotiator.negotiateRequestFormat
public function negotiateRequestFormat(Request $req) { $header = $req->headers->get('Content-Type'); $exp = explode(';', $header); $type = $exp[0]; return isset($this->inputFormatMap[$type]) ? $this->inputFormatMap[$type] : false; }
php
public function negotiateRequestFormat(Request $req) { $header = $req->headers->get('Content-Type'); $exp = explode(';', $header); $type = $exp[0]; return isset($this->inputFormatMap[$type]) ? $this->inputFormatMap[$type] : false; }
[ "public", "function", "negotiateRequestFormat", "(", "Request", "$", "req", ")", "{", "$", "header", "=", "$", "req", "->", "headers", "->", "get", "(", "'Content-Type'", ")", ";", "$", "exp", "=", "explode", "(", "';'", ",", "$", "header", ")", ";", ...
Return the incoming format, derived from the Requests content-type header. Generally this is used for determing which format to use during deserialization. @param Request $req @return string
[ "Return", "the", "incoming", "format", "derived", "from", "the", "Requests", "content", "-", "type", "header", ".", "Generally", "this", "is", "used", "for", "determing", "which", "format", "to", "use", "during", "deserialization", "." ]
3f6270ecf31138ba2271a94a407c0d1a05542929
https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Negotiator.php#L74-L82
199,912
AmericanCouncils/WebServicesBundle
Negotiator.php
Negotiator.negotiateResponseFormat
public function negotiateResponseFormat(Request $req) { return $this->getFormatNegotiator()->getBestFormat($req->headers->get('Accept'), $this->formatPriorities); }
php
public function negotiateResponseFormat(Request $req) { return $this->getFormatNegotiator()->getBestFormat($req->headers->get('Accept'), $this->formatPriorities); }
[ "public", "function", "negotiateResponseFormat", "(", "Request", "$", "req", ")", "{", "return", "$", "this", "->", "getFormatNegotiator", "(", ")", "->", "getBestFormat", "(", "$", "req", "->", "headers", "->", "get", "(", "'Accept'", ")", ",", "$", "this...
Return the response format type, derived from a Request's Accept header, and configured priorities. @param Request $req @return string
[ "Return", "the", "response", "format", "type", "derived", "from", "a", "Request", "s", "Accept", "header", "and", "configured", "priorities", "." ]
3f6270ecf31138ba2271a94a407c0d1a05542929
https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Negotiator.php#L90-L93
199,913
AmericanCouncils/WebServicesBundle
Negotiator.php
Negotiator.negotiateResponseLanguage
public function negotiateResponseLanguage(Request $req) { return $this->getLanguageNegotiator()->getBest($req->headers->get('Accept-Language'), $this->langPriorities)->getValue(); }
php
public function negotiateResponseLanguage(Request $req) { return $this->getLanguageNegotiator()->getBest($req->headers->get('Accept-Language'), $this->langPriorities)->getValue(); }
[ "public", "function", "negotiateResponseLanguage", "(", "Request", "$", "req", ")", "{", "return", "$", "this", "->", "getLanguageNegotiator", "(", ")", "->", "getBest", "(", "$", "req", "->", "headers", "->", "get", "(", "'Accept-Language'", ")", ",", "$", ...
Return preferred language, derived from Requests Accept-Language header, and configured priorities. @param Request $req @return string
[ "Return", "preferred", "language", "derived", "from", "Requests", "Accept", "-", "Language", "header", "and", "configured", "priorities", "." ]
3f6270ecf31138ba2271a94a407c0d1a05542929
https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Negotiator.php#L101-L104
199,914
LCPHP/php-wechat-sdk
src/Wechat.php
Wechat.http_get
public function http_get($url, $data_type='json') { $cl = curl_init(); if(stripos($url, 'https://') !== FALSE) { curl_setopt($cl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($cl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($cl, CURLOPT_SSLVERSION, 1); ...
php
public function http_get($url, $data_type='json') { $cl = curl_init(); if(stripos($url, 'https://') !== FALSE) { curl_setopt($cl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($cl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($cl, CURLOPT_SSLVERSION, 1); ...
[ "public", "function", "http_get", "(", "$", "url", ",", "$", "data_type", "=", "'json'", ")", "{", "$", "cl", "=", "curl_init", "(", ")", ";", "if", "(", "stripos", "(", "$", "url", ",", "'https://'", ")", "!==", "FALSE", ")", "{", "curl_setopt", "...
http curl get @param string $url @param string $data_type @return mixed|boolean
[ "http", "curl", "get" ]
0dc164fc462d5fdae7d9c5c35f96c1b227e42db3
https://github.com/LCPHP/php-wechat-sdk/blob/0dc164fc462d5fdae7d9c5c35f96c1b227e42db3/src/Wechat.php#L345-L366
199,915
Stinger-Soft/PlatformBundle
Controller/BaseController.php
BaseController.hasRole
protected function hasRole($role) { if(!$this->container->has('security.authorization_checker')) { throw new \LogicException('The SecurityBundle is not registered in your application.'); } return false !== $this->get('security.authorization_checker')->isGranted($role); }
php
protected function hasRole($role) { if(!$this->container->has('security.authorization_checker')) { throw new \LogicException('The SecurityBundle is not registered in your application.'); } return false !== $this->get('security.authorization_checker')->isGranted($role); }
[ "protected", "function", "hasRole", "(", "$", "role", ")", "{", "if", "(", "!", "$", "this", "->", "container", "->", "has", "(", "'security.authorization_checker'", ")", ")", "{", "throw", "new", "\\", "LogicException", "(", "'The SecurityBundle is not register...
Checks whether the current user has the specified role or not @param string $role @throws \LogicException @return boolean
[ "Checks", "whether", "the", "current", "user", "has", "the", "specified", "role", "or", "not" ]
922b9405e5ddc474f288b6be84af2de9a335ac28
https://github.com/Stinger-Soft/PlatformBundle/blob/922b9405e5ddc474f288b6be84af2de9a335ac28/Controller/BaseController.php#L120-L125
199,916
Eden-PHP/Block
Field.php
Field.button
public function button($value, $name = null) { Argument::i() ->test(1, 'string') ->test(2, 'string', 'null') ->test(3, 'bool'); $field = Button::i()->setValue($value); if(!is_null($name)) { $field->setName($name); } return $field; }
php
public function button($value, $name = null) { Argument::i() ->test(1, 'string') ->test(2, 'string', 'null') ->test(3, 'bool'); $field = Button::i()->setValue($value); if(!is_null($name)) { $field->setName($name); } return $field; }
[ "public", "function", "button", "(", "$", "value", ",", "$", "name", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ")", "->", "test", "(", "2", ",", "'string'", ",", "'null'", ")", "->", "test", ...
Returns a ui button field @param string @param string|null @param bool @return Eden\Block\Field\Button
[ "Returns", "a", "ui", "button", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L51-L65
199,917
Eden-PHP/Block
Field.php
Field.checkbox
public function checkbox($name = null, $value = null, $items = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'array', 'null') ->test(3, 'string', 'array'); $field = Checkbox::i()->setItems($items); if(!is_null($name)) { $field->setName($name); } if(!is_null($v...
php
public function checkbox($name = null, $value = null, $items = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'array', 'null') ->test(3, 'string', 'array'); $field = Checkbox::i()->setItems($items); if(!is_null($name)) { $field->setName($name); } if(!is_null($v...
[ "public", "function", "checkbox", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ",", "$", "items", "=", "array", "(", ")", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", ...
Returns a checkbox field or fieldset @param string|null @param array @param scalar|null @return Eden\Block\Field\Checkbox
[ "Returns", "a", "checkbox", "field", "or", "fieldset" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L75-L93
199,918
Eden-PHP/Block
Field.php
Field.password
public function password($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Password::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function password($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Password::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "password", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",",...
Returns a password field @param string|null @param scalar|null @return Eden\Block\Field\Text
[ "Returns", "a", "password", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L102-L119
199,919
Eden-PHP/Block
Field.php
Field.radio
public function radio($name = null, $value = null, array $items = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Radio::i($name)->setItems($items); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value...
php
public function radio($name = null, $value = null, array $items = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Radio::i($name)->setItems($items); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value...
[ "public", "function", "radio", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ",", "array", "$", "items", "=", "array", "(", ")", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ...
Returns a radio fieldset @param string|null @param array @param scalar|null @return Eden\Block\Field\Radio
[ "Returns", "a", "radio", "fieldset" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L129-L146
199,920
Eden-PHP/Block
Field.php
Field.select
public function select($name = null, $value = null, array $items = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Select::i()->setItems($items); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); ...
php
public function select($name = null, $value = null, array $items = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Select::i()->setItems($items); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); ...
[ "public", "function", "select", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ",", "array", "$", "items", "=", "array", "(", ")", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ...
Returns a select field @param string|null @param array @param scalar|null @return Eden\Block\Field\Select
[ "Returns", "a", "select", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L156-L173
199,921
Eden-PHP/Block
Field.php
Field.submit
public function submit($value, $name = null, $image = null) { Argument::i() ->test(1, 'string') ->test(2, 'string', 'null'); $field = Submit::i()->setValue($value); if(!is_null($name)) { $field->setName($name); } if($image) { $field->setImage($image); } return $field; }
php
public function submit($value, $name = null, $image = null) { Argument::i() ->test(1, 'string') ->test(2, 'string', 'null'); $field = Submit::i()->setValue($value); if(!is_null($name)) { $field->setName($name); } if($image) { $field->setImage($image); } return $field; }
[ "public", "function", "submit", "(", "$", "value", ",", "$", "name", "=", "null", ",", "$", "image", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ")", "->", "test", "(", "2", ",", "'string'", ...
Returns a submit field @param string @param scalar|null @param string|null @return Eden\Block\Field\Submit
[ "Returns", "a", "submit", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L183-L200
199,922
Eden-PHP/Block
Field.php
Field.mask
public function mask($pattern, $placeholder = null, $name = null, $value = null) { Argument::i() ->test(1, 'string') ->test(2, 'string', 'null') ->test(3, 'string', 'null') ->test(4, 'scalar', 'null'); $field = Mask::i()->setPattern($pattern); if(!is_null($name)) { $field->setName($name); ...
php
public function mask($pattern, $placeholder = null, $name = null, $value = null) { Argument::i() ->test(1, 'string') ->test(2, 'string', 'null') ->test(3, 'string', 'null') ->test(4, 'scalar', 'null'); $field = Mask::i()->setPattern($pattern); if(!is_null($name)) { $field->setName($name); ...
[ "public", "function", "mask", "(", "$", "pattern", ",", "$", "placeholder", "=", "null", ",", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ")", "->",...
Returns an input mask @param string @param string|null @param string|null @param scalar|null @return Eden\Block\Field\Mask
[ "Returns", "an", "input", "mask" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L211-L234
199,923
Eden-PHP/Block
Field.php
Field.text
public function text($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Text::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function text($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Text::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "text", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",", "...
Returns a text field @param string|null @param scalar|null @return Eden\Block\Field\Text
[ "Returns", "a", "text", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L243-L260
199,924
Eden-PHP/Block
Field.php
Field.textarea
public function textarea($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Textarea::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function textarea($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Textarea::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "textarea", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",",...
Returns a textarea field @param string|null @param scalar|null @return Eden\Block\Field\Textarea
[ "Returns", "a", "textarea", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L269-L286
199,925
Eden-PHP/Block
Field.php
Field.color
public function color($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'string', 'null'); $field = Color::i($name); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function color($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'string', 'null'); $field = Color::i($name); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "color", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'string'", ",", ...
Returns a color field @param string|null @param scalar|null @return Eden\Block\Field\Color
[ "Returns", "a", "color", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L321-L338
199,926
Eden-PHP/Block
Field.php
Field.combobox
public function combobox($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Combobox::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function combobox($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Combobox::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "combobox", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",",...
Returns a combobox field @param string|null @param scalar|null @return Eden\Block\Field\Combobox
[ "Returns", "a", "combobox", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L347-L364
199,927
Eden-PHP/Block
Field.php
Field.datetime
public function datetime($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Datetime::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function datetime($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Datetime::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "datetime", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",",...
Returns a datetime field @param string|null @param scalar|null @return Eden\Block\Field\Datetime
[ "Returns", "a", "datetime", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L401-L418
199,928
Eden-PHP/Block
Field.php
Field.file
public function file($name = null, $multiple = false, array $accept = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'bool'); $field = File::i(); if(!is_null($name)) { $field->setName($name); } if($multiple) { $field->setAttributes('multiple', 'multiple'); } if(!...
php
public function file($name = null, $multiple = false, array $accept = array()) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'bool'); $field = File::i(); if(!is_null($name)) { $field->setName($name); } if($multiple) { $field->setAttributes('multiple', 'multiple'); } if(!...
[ "public", "function", "file", "(", "$", "name", "=", "null", ",", "$", "multiple", "=", "false", ",", "array", "$", "accept", "=", "array", "(", ")", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'...
Returns a file field @param string|null @param bool @param array @return Eden\Block\Field\File
[ "Returns", "a", "file", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L428-L449
199,929
Eden-PHP/Block
Field.php
Field.image
public function image($name = null, $multiple = false) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'bool'); $accept = array('image/gif','image/jpg','image/jpeg','image/png'); return $this->file($name, $multiple, $accept); }
php
public function image($name = null, $multiple = false) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'bool'); $accept = array('image/gif','image/jpg','image/jpeg','image/png'); return $this->file($name, $multiple, $accept); }
[ "public", "function", "image", "(", "$", "name", "=", "null", ",", "$", "multiple", "=", "false", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'bool'", ")", ...
Returns an image upload field @param string|null @param bool @return Eden\Block\Field\File
[ "Returns", "an", "image", "upload", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L458-L467
199,930
Eden-PHP/Block
Field.php
Field.markdown
public function markdown($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Markdown::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function markdown($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Markdown::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "markdown", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",",...
Returns a Markdown field @param string|null @param scalar|null @return Eden\Block\Field\Markdown
[ "Returns", "a", "Markdown", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L476-L493
199,931
Eden-PHP/Block
Field.php
Field.slider
public function slider($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Text::i()->setType('range'); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function slider($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Text::i()->setType('range'); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "slider", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",", ...
Returns a slider field @param string|null @param scalar|null @return Eden\Block\Field\Text
[ "Returns", "a", "slider", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L502-L519
199,932
Eden-PHP/Block
Field.php
Field.time
public function time($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Datetime::i() ->setOptions('pickDate', false) ->setOptions('format', 'HH:mm PP'); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) ...
php
public function time($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Datetime::i() ->setOptions('pickDate', false) ->setOptions('format', 'HH:mm PP'); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) ...
[ "public", "function", "time", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",", "...
Returns a time field @param string|null @param scalar|null @return Eden\Block\Field\Datetime
[ "Returns", "a", "time", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L554-L573
199,933
Eden-PHP/Block
Field.php
Field.wysiwyg
public function wysiwyg($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Wysiwyg::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
php
public function wysiwyg($name = null, $value = null) { Argument::i() ->test(1, 'string', 'null') ->test(2, 'scalar', 'null'); $field = Wysiwyg::i(); if(!is_null($name)) { $field->setName($name); } if(!is_null($value)) { $field->setValue($value); } return $field; }
[ "public", "function", "wysiwyg", "(", "$", "name", "=", "null", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'null'", ")", "->", "test", "(", "2", ",", "'scalar'", ",", ...
Returns a WYSIWYG field @param string|null @param scalar|null @return Eden\Block\Field\Wysiwyg
[ "Returns", "a", "WYSIWYG", "field" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L582-L599
199,934
Innmind/Compose
src/Dependencies.php
Dependencies.exposed
public function exposed(): MapInterface { return $this->dependencies->reduce( new Map(Name::class, MapInterface::class), static function(Map $exposed, string $name, Dependency $dependency): Map { return $exposed->put( $dependency->name(), ...
php
public function exposed(): MapInterface { return $this->dependencies->reduce( new Map(Name::class, MapInterface::class), static function(Map $exposed, string $name, Dependency $dependency): Map { return $exposed->put( $dependency->name(), ...
[ "public", "function", "exposed", "(", ")", ":", "MapInterface", "{", "return", "$", "this", "->", "dependencies", "->", "reduce", "(", "new", "Map", "(", "Name", "::", "class", ",", "MapInterface", "::", "class", ")", ",", "static", "function", "(", "Map...
Return the list of exposed services per dependency @return MapInterface<Name, MapInterface<Name, Constructor>>
[ "Return", "the", "list", "of", "exposed", "services", "per", "dependency" ]
1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9
https://github.com/Innmind/Compose/blob/1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9/src/Dependencies.php#L138-L149
199,935
wb-crowdfusion/crowdfusion
system/core/classes/nodedb/permissions/NodePermissions.php
NodePermissions.check
public function check($action, NodeRef &$nodeRef, &$newData = null, $isRead = false) { return $this->checkInternal($action, $nodeRef, $newData, false, $isRead); }
php
public function check($action, NodeRef &$nodeRef, &$newData = null, $isRead = false) { return $this->checkInternal($action, $nodeRef, $newData, false, $isRead); }
[ "public", "function", "check", "(", "$", "action", ",", "NodeRef", "&", "$", "nodeRef", ",", "&", "$", "newData", "=", "null", ",", "$", "isRead", "=", "false", ")", "{", "return", "$", "this", "->", "checkInternal", "(", "$", "action", ",", "$", "...
Returns true if the user is permitted to access the node @param $action @param $nodeRef @param $newData @param $isRead @return unknown_type
[ "Returns", "true", "if", "the", "user", "is", "permitted", "to", "access", "the", "node" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/permissions/NodePermissions.php#L102-L105
199,936
wb-crowdfusion/crowdfusion
system/core/classes/nodedb/permissions/NodePermissions.php
NodePermissions.checkThrow
public function checkThrow($action, NodeRef &$nodeRef, &$newData = null, $isRead = false) { return $this->checkInternal($action, $nodeRef, $newData, true, $isRead); }
php
public function checkThrow($action, NodeRef &$nodeRef, &$newData = null, $isRead = false) { return $this->checkInternal($action, $nodeRef, $newData, true, $isRead); }
[ "public", "function", "checkThrow", "(", "$", "action", ",", "NodeRef", "&", "$", "nodeRef", ",", "&", "$", "newData", "=", "null", ",", "$", "isRead", "=", "false", ")", "{", "return", "$", "this", "->", "checkInternal", "(", "$", "action", ",", "$"...
Throws a PermissionsException if the user is unable to access the node, otherwise returns true @param $action @param $nodeRef @param $newData @param $isRead @return unknown_type
[ "Throws", "a", "PermissionsException", "if", "the", "user", "is", "unable", "to", "access", "the", "node", "otherwise", "returns", "true" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/permissions/NodePermissions.php#L116-L119
199,937
ekyna/MediaBundle
Twig/BrowserExtension.php
BrowserExtension.renderMediaThumb
public function renderMediaThumb(MediaInterface $media = null, array $controls = array()) { if (null !== $media) { $media->setThumb($this->thumbGenerator->generateThumbUrl($media)); } /*if (empty($controls)) { $controls = array( array('role' => 'edit',...
php
public function renderMediaThumb(MediaInterface $media = null, array $controls = array()) { if (null !== $media) { $media->setThumb($this->thumbGenerator->generateThumbUrl($media)); } /*if (empty($controls)) { $controls = array( array('role' => 'edit',...
[ "public", "function", "renderMediaThumb", "(", "MediaInterface", "$", "media", "=", "null", ",", "array", "$", "controls", "=", "array", "(", ")", ")", "{", "if", "(", "null", "!==", "$", "media", ")", "{", "$", "media", "->", "setThumb", "(", "$", "...
Renders the media thumb. @param MediaInterface $media @param array $controls @return string
[ "Renders", "the", "media", "thumb", "." ]
512cf86c801a130a9f17eba8b48d646d23acdbab
https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Twig/BrowserExtension.php#L119-L149
199,938
eureka-framework/component-orm
src/Orm/Builder.php
Builder.build
public function build($configs) { foreach ($configs as $config) { $this->config = $config; $this->initVars(); $this->loadColumns(); $this->buildDataClasses(); $this->buildMapperClasses(); $this->generateClasses(); } ...
php
public function build($configs) { foreach ($configs as $config) { $this->config = $config; $this->initVars(); $this->loadColumns(); $this->buildDataClasses(); $this->buildMapperClasses(); $this->generateClasses(); } ...
[ "public", "function", "build", "(", "$", "configs", ")", "{", "foreach", "(", "$", "configs", "as", "$", "config", ")", "{", "$", "this", "->", "config", "=", "$", "config", ";", "$", "this", "->", "initVars", "(", ")", ";", "$", "this", "->", "l...
Build model classes. @param ConfigInterface[] $configs @return $this
[ "Build", "model", "classes", "." ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L119-L134
199,939
eureka-framework/component-orm
src/Orm/Builder.php
Builder.loadColumns
protected function loadColumns() { $statement = $this->db->query('SHOW COLUMNS FROM ' . $this->config->getDbTable()); $this->columns = array(); while (false !== ($column = $statement->fetchObject())) { $this->columns[] = new Column($column, $this->config->getDbPrefix()); ...
php
protected function loadColumns() { $statement = $this->db->query('SHOW COLUMNS FROM ' . $this->config->getDbTable()); $this->columns = array(); while (false !== ($column = $statement->fetchObject())) { $this->columns[] = new Column($column, $this->config->getDbPrefix()); ...
[ "protected", "function", "loadColumns", "(", ")", "{", "$", "statement", "=", "$", "this", "->", "db", "->", "query", "(", "'SHOW COLUMNS FROM '", ".", "$", "this", "->", "config", "->", "getDbTable", "(", ")", ")", ";", "$", "this", "->", "columns", "...
Load columns data. @return void
[ "Load", "columns", "data", "." ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L156-L164
199,940
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildDataProperties
protected function buildDataProperties() { $properties = ''; $hasAutoincrement = false; foreach ($this->columns as $column) { $properties .= "\n" . $column->getProperty(); $hasAutoincrement |= $column->isAutoIncrement(); } if ($hasAutoincrement) { ...
php
protected function buildDataProperties() { $properties = ''; $hasAutoincrement = false; foreach ($this->columns as $column) { $properties .= "\n" . $column->getProperty(); $hasAutoincrement |= $column->isAutoIncrement(); } if ($hasAutoincrement) { ...
[ "protected", "function", "buildDataProperties", "(", ")", "{", "$", "properties", "=", "''", ";", "$", "hasAutoincrement", "=", "false", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "$", "properties", ".=", "\"\\n\"", ...
Build properties var @return void
[ "Build", "properties", "var" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L192-L211
199,941
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildDataGetters
protected function buildDataGetters() { $getters = ''; foreach ($this->columns as $column) { $getters .= "\n" . $column->getGetter(); } $this->vars['getters'] = $getters; }
php
protected function buildDataGetters() { $getters = ''; foreach ($this->columns as $column) { $getters .= "\n" . $column->getGetter(); } $this->vars['getters'] = $getters; }
[ "protected", "function", "buildDataGetters", "(", ")", "{", "$", "getters", "=", "''", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "$", "getters", ".=", "\"\\n\"", ".", "$", "column", "->", "getGetter", "(", ")", ...
Build getters var @return void
[ "Build", "getters", "var" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L218-L227
199,942
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildDataGetterCacheKey
protected function buildDataGetterCacheKey() { $keys = array(); foreach ($this->columns as $column) { if ($column->isPrimaryKey()) { $keys[] = '$this->' . $column->getMethodNameGet() . '()'; } } $key = "'" . $this->config->getCachePrefix() . ...
php
protected function buildDataGetterCacheKey() { $keys = array(); foreach ($this->columns as $column) { if ($column->isPrimaryKey()) { $keys[] = '$this->' . $column->getMethodNameGet() . '()'; } } $key = "'" . $this->config->getCachePrefix() . ...
[ "protected", "function", "buildDataGetterCacheKey", "(", ")", "{", "$", "keys", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "if", "(", "$", "column", "->", "isPrimaryKey", "(", ")", ")", "...
Build cache key method @return void
[ "Build", "cache", "key", "method" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L234-L256
199,943
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildDataSetters
protected function buildDataSetters() { $setters = ''; foreach ($this->columns as $column) { $setters .= "\n" . $column->getSetter(); } $this->vars['setters'] = $setters; }
php
protected function buildDataSetters() { $setters = ''; foreach ($this->columns as $column) { $setters .= "\n" . $column->getSetter(); } $this->vars['setters'] = $setters; }
[ "protected", "function", "buildDataSetters", "(", ")", "{", "$", "setters", "=", "''", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "$", "setters", ".=", "\"\\n\"", ".", "$", "column", "->", "getSetter", "(", ")", ...
Build setters var @return void
[ "Build", "setters", "var" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L263-L272
199,944
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildDataJoins
protected function buildDataJoins() { $joins = array('one' => array(), 'many' => array()); $joinsUse = array(); foreach ($this->config->getAllJoin() as $name => $join) { $config = $join['class']; if (!($config instanceof ConfigInterface)) { throw...
php
protected function buildDataJoins() { $joins = array('one' => array(), 'many' => array()); $joinsUse = array(); foreach ($this->config->getAllJoin() as $name => $join) { $config = $join['class']; if (!($config instanceof ConfigInterface)) { throw...
[ "protected", "function", "buildDataJoins", "(", ")", "{", "$", "joins", "=", "array", "(", "'one'", "=>", "array", "(", ")", ",", "'many'", "=>", "array", "(", ")", ")", ";", "$", "joinsUse", "=", "array", "(", ")", ";", "foreach", "(", "$", "this"...
Build join getters @return void @throws \LogicException
[ "Build", "join", "getters" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L280-L309
199,945
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildDataJoinsMany
protected function buildDataJoinsMany(ConfigInterface $config, array $joinKeys) { //~ Search for keys $keys = ''; $joinKeys = array_flip($joinKeys); foreach ($this->columns as $column) { if (!isset($joinKeys[$column->getName()])) { continue; } ...
php
protected function buildDataJoinsMany(ConfigInterface $config, array $joinKeys) { //~ Search for keys $keys = ''; $joinKeys = array_flip($joinKeys); foreach ($this->columns as $column) { if (!isset($joinKeys[$column->getName()])) { continue; } ...
[ "protected", "function", "buildDataJoinsMany", "(", "ConfigInterface", "$", "config", ",", "array", "$", "joinKeys", ")", "{", "//~ Search for keys", "$", "keys", "=", "''", ";", "$", "joinKeys", "=", "array_flip", "(", "$", "joinKeys", ")", ";", "foreach", ...
Build join many getters @param ConfigInterface $config @param array $joinKeys @return string @throws \LogicException
[ "Build", "join", "many", "getters" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L374-L420
199,946
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildMapperFields
protected function buildMapperFields() { $fields = array(); $dataNamesMap = ''; foreach ($this->columns as $column) { $field = $column->getName(); $fields[] = " '" . $field . "'"; $dataNamesMap .= " '" . $field . "' => array( ...
php
protected function buildMapperFields() { $fields = array(); $dataNamesMap = ''; foreach ($this->columns as $column) { $field = $column->getName(); $fields[] = " '" . $field . "'"; $dataNamesMap .= " '" . $field . "' => array( ...
[ "protected", "function", "buildMapperFields", "(", ")", "{", "$", "fields", "=", "array", "(", ")", ";", "$", "dataNamesMap", "=", "''", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "$", "field", "=", "$", "column...
Build fields var @return void
[ "Build", "fields", "var" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L456-L474
199,947
eureka-framework/component-orm
src/Orm/Builder.php
Builder.buildMapperPrimaryKeys
protected function buildMapperPrimaryKeys() { $fields = array(); foreach ($this->columns as $column) { if ($column->isPrimaryKey()) { $fields[] = " '" . $column->getName() . "'"; } } $this->vars['db_primary_keys'] = implode(",\n", $fi...
php
protected function buildMapperPrimaryKeys() { $fields = array(); foreach ($this->columns as $column) { if ($column->isPrimaryKey()) { $fields[] = " '" . $column->getName() . "'"; } } $this->vars['db_primary_keys'] = implode(",\n", $fi...
[ "protected", "function", "buildMapperPrimaryKeys", "(", ")", "{", "$", "fields", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "if", "(", "$", "column", "->", "isPrimaryKey", "(", ")", ")", ...
Build primary keys var @return void
[ "Build", "primary", "keys", "var" ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L481-L493
199,948
eureka-framework/component-orm
src/Orm/Builder.php
Builder.generateDataFileAbstract
protected function generateDataFileAbstract($dir) { $file = $dir . '/' . $this->config->getClassname() . 'Abstract.php'; if (!is_readable($file) && false === file_put_contents($file, '')) { throw new \RuntimeException('Cannot create empty class file: ' . $file); } $cont...
php
protected function generateDataFileAbstract($dir) { $file = $dir . '/' . $this->config->getClassname() . 'Abstract.php'; if (!is_readable($file) && false === file_put_contents($file, '')) { throw new \RuntimeException('Cannot create empty class file: ' . $file); } $cont...
[ "protected", "function", "generateDataFileAbstract", "(", "$", "dir", ")", "{", "$", "file", "=", "$", "dir", ".", "'/'", ".", "$", "this", "->", "config", "->", "getClassname", "(", ")", ".", "'Abstract.php'", ";", "if", "(", "!", "is_readable", "(", ...
Generate abstract file class. @param string $dir Directory for class @return void @throws \RuntimeException
[ "Generate", "abstract", "file", "class", "." ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L539-L579
199,949
eureka-framework/component-orm
src/Orm/Builder.php
Builder.generateDataFile
protected function generateDataFile($dir) { $file = $dir . '/' . $this->config->getClassname() . '.php'; if (file_exists($file)) { return; } if (!is_readable($file) && false === file_put_contents($file, '')) { throw new \RuntimeException('Cannot create empty...
php
protected function generateDataFile($dir) { $file = $dir . '/' . $this->config->getClassname() . '.php'; if (file_exists($file)) { return; } if (!is_readable($file) && false === file_put_contents($file, '')) { throw new \RuntimeException('Cannot create empty...
[ "protected", "function", "generateDataFile", "(", "$", "dir", ")", "{", "$", "file", "=", "$", "dir", ".", "'/'", ".", "$", "this", "->", "config", "->", "getClassname", "(", ")", ".", "'.php'", ";", "if", "(", "file_exists", "(", "$", "file", ")", ...
Generate child class if not already exists. @param string $dir Directory for class @return void @throws \RuntimeException
[ "Generate", "child", "class", "if", "not", "already", "exists", "." ]
bce48121d26c4e923534f9dc70da597634184316
https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Builder.php#L588-L624
199,950
ciims/ciims-modules-dashboard
controllers/ContentController.php
ContentController.actionSave
public function actionSave($id = NULL) { $asModel = NULL; if ($id == NULL) { $model = new Content; $model->savePrototype(Yii::app()->user->id); $this->redirect('/dashboard/content/save/id/' . $model->id); } else { $model = $this->loadModel($id); $asModel = Content...
php
public function actionSave($id = NULL) { $asModel = NULL; if ($id == NULL) { $model = new Content; $model->savePrototype(Yii::app()->user->id); $this->redirect('/dashboard/content/save/id/' . $model->id); } else { $model = $this->loadModel($id); $asModel = Content...
[ "public", "function", "actionSave", "(", "$", "id", "=", "NULL", ")", "{", "$", "asModel", "=", "NULL", ";", "if", "(", "$", "id", "==", "NULL", ")", "{", "$", "model", "=", "new", "Content", ";", "$", "model", "->", "savePrototype", "(", "Yii", ...
Rndering action for the entry @param int $id The content ID
[ "Rndering", "action", "for", "the", "entry" ]
94b89239e9ee34ac3b9c398e8d1ba67a08c68c11
https://github.com/ciims/ciims-modules-dashboard/blob/94b89239e9ee34ac3b9c398e8d1ba67a08c68c11/controllers/ContentController.php#L31-L56
199,951
jabernardo/lollipop-php
Library/TimeDate.php
TimeDate.longDateString
static function longDateString($date) { str_replace('now', date('m.d.y'), $date); if (!self::parsable($date)) return null; $r = self::fromString($date); return $r->format('M d, Y'); }
php
static function longDateString($date) { str_replace('now', date('m.d.y'), $date); if (!self::parsable($date)) return null; $r = self::fromString($date); return $r->format('M d, Y'); }
[ "static", "function", "longDateString", "(", "$", "date", ")", "{", "str_replace", "(", "'now'", ",", "date", "(", "'m.d.y'", ")", ",", "$", "date", ")", ";", "if", "(", "!", "self", "::", "parsable", "(", "$", "date", ")", ")", "return", "null", "...
Returns date in long date format @param string $date Date @return string Long Date @return string
[ "Returns", "date", "in", "long", "date", "format" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/TimeDate.php#L71-L79
199,952
jabernardo/lollipop-php
Library/TimeDate.php
TimeDate.shortDateString
static function shortDateString($date, $separator = '/') { str_replace('now', date('m.d.y'), $date); if (!self::parsable($date)) return null; $r = self::fromString($date); return $r->format('m' . $separator . 'd' . $separator . 'Y'); }
php
static function shortDateString($date, $separator = '/') { str_replace('now', date('m.d.y'), $date); if (!self::parsable($date)) return null; $r = self::fromString($date); return $r->format('m' . $separator . 'd' . $separator . 'Y'); }
[ "static", "function", "shortDateString", "(", "$", "date", ",", "$", "separator", "=", "'/'", ")", "{", "str_replace", "(", "'now'", ",", "date", "(", "'m.d.y'", ")", ",", "$", "date", ")", ";", "if", "(", "!", "self", "::", "parsable", "(", "$", "...
Returns date in short date format @param string $date Date @param string $separator Separator @return string
[ "Returns", "date", "in", "short", "date", "format" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/TimeDate.php#L90-L98
199,953
jabernardo/lollipop-php
Library/TimeDate.php
TimeDate.longTimeString
static function longTimeString($time) { str_replace('now', date('h:i:s t'), $time); if (!self::parsable($time)) return null; $r = self::fromString($time); return $r->format('h:i:s a'); }
php
static function longTimeString($time) { str_replace('now', date('h:i:s t'), $time); if (!self::parsable($time)) return null; $r = self::fromString($time); return $r->format('h:i:s a'); }
[ "static", "function", "longTimeString", "(", "$", "time", ")", "{", "str_replace", "(", "'now'", ",", "date", "(", "'h:i:s t'", ")", ",", "$", "time", ")", ";", "if", "(", "!", "self", "::", "parsable", "(", "$", "time", ")", ")", "return", "null", ...
Returns time in long time format @param string $time Time @return string
[ "Returns", "time", "in", "long", "time", "format" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/TimeDate.php#L107-L115
199,954
Wedeto/HTTP
src/Accept.php
Accept.parseAccept
public static function parseAccept(string $accept, bool $is_lang) { // By default accept everything but prefer HTML if (empty($accept)) $accept = "text/html;q=1.0,*/*;q=0.9"; // Normalize locales when the intl extension is available $is_lang = $is_lang && class_exists('L...
php
public static function parseAccept(string $accept, bool $is_lang) { // By default accept everything but prefer HTML if (empty($accept)) $accept = "text/html;q=1.0,*/*;q=0.9"; // Normalize locales when the intl extension is available $is_lang = $is_lang && class_exists('L...
[ "public", "static", "function", "parseAccept", "(", "string", "$", "accept", ",", "bool", "$", "is_lang", ")", "{", "// By default accept everything but prefer HTML", "if", "(", "empty", "(", "$", "accept", ")", ")", "$", "accept", "=", "\"text/html;q=1.0,*/*;q=0....
Parse the HTTP Accept headers into an array of Type => Priority pairs. @param string $accept The accept header to parse @return The parsed accept list
[ "Parse", "the", "HTTP", "Accept", "headers", "into", "an", "array", "of", "Type", "=", ">", "Priority", "pairs", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Accept.php#L78-L106
199,955
Wedeto/HTTP
src/Accept.php
Accept.accepts
public function accepts($type) { foreach ($this->accept as $accept_type => $priority) { if (strpos($accept_type, "*") !== false) { $regexp = "/" . str_replace("WC", ".*", preg_quote(str_replace("*", "WC", $accept_type), "/")) . "/i"; if (preg_m...
php
public function accepts($type) { foreach ($this->accept as $accept_type => $priority) { if (strpos($accept_type, "*") !== false) { $regexp = "/" . str_replace("WC", ".*", preg_quote(str_replace("*", "WC", $accept_type), "/")) . "/i"; if (preg_m...
[ "public", "function", "accepts", "(", "$", "type", ")", "{", "foreach", "(", "$", "this", "->", "accept", "as", "$", "accept_type", "=>", "$", "priority", ")", "{", "if", "(", "strpos", "(", "$", "accept_type", ",", "\"*\"", ")", "!==", "false", ")",...
Check if a specified response type is accepted by the client. When no types are specified, everything is accepted. @param string $type The type of the response that is to be checked @return float Returns 0 if the type is not accepted, and otherwise the priority
[ "Check", "if", "a", "specified", "response", "type", "is", "accepted", "by", "the", "client", ".", "When", "no", "types", "are", "specified", "everything", "is", "accepted", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Accept.php#L115-L130
199,956
Wedeto/HTTP
src/Accept.php
Accept.compareTypes
public function compareTypes(string $l, string $r) { $lq = $this->accept[$l] ?? 0; $rq = $this->accept[$r] ?? 0; return $lq === $rq ? -1 : ($lq < $rq ? 1 : -1); }
php
public function compareTypes(string $l, string $r) { $lq = $this->accept[$l] ?? 0; $rq = $this->accept[$r] ?? 0; return $lq === $rq ? -1 : ($lq < $rq ? 1 : -1); }
[ "public", "function", "compareTypes", "(", "string", "$", "l", ",", "string", "$", "r", ")", "{", "$", "lq", "=", "$", "this", "->", "accept", "[", "$", "l", "]", "??", "0", ";", "$", "rq", "=", "$", "this", "->", "accept", "[", "$", "r", "]"...
Compare the types based on the priorty in the accept header. Aliases for common types are supported. @param string $l The left-hand side of the comparison. Should be a type @param string $r The right-hand side of the comparison. Should be a type
[ "Compare", "the", "types", "based", "on", "the", "priorty", "in", "the", "accept", "header", ".", "Aliases", "for", "common", "types", "are", "supported", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Accept.php#L139-L145
199,957
Wedeto/HTTP
src/Accept.php
Accept.sortTypes
public function sortTypes(array &$types) { if (WF::is_numeric_array($types)) return usort($types, [$this, 'compareTypes']); return uksort($types, [$this, 'compareTypes']); }
php
public function sortTypes(array &$types) { if (WF::is_numeric_array($types)) return usort($types, [$this, 'compareTypes']); return uksort($types, [$this, 'compareTypes']); }
[ "public", "function", "sortTypes", "(", "array", "&", "$", "types", ")", "{", "if", "(", "WF", "::", "is_numeric_array", "(", "$", "types", ")", ")", "return", "usort", "(", "$", "types", ",", "[", "$", "this", ",", "'compareTypes'", "]", ")", ";", ...
Sort a list by their accept priority @param array $types The list to sort. For arrays with numeric keys, the values are expected to be types. Otherwise, the keys are expected to be types. The array is passed by reference. @return bool True on success, false on failure
[ "Sort", "a", "list", "by", "their", "accept", "priority" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Accept.php#L155-L161
199,958
Wedeto/HTTP
src/Accept.php
Accept.getBestResponseType
public function getBestResponseType(array $types) { if (empty($types)) return ""; $this->sortTypes($types); $type = reset($types); return $this->accepts($type) ? current($types) : null; }
php
public function getBestResponseType(array $types) { if (empty($types)) return ""; $this->sortTypes($types); $type = reset($types); return $this->accepts($type) ? current($types) : null; }
[ "public", "function", "getBestResponseType", "(", "array", "$", "types", ")", "{", "if", "(", "empty", "(", "$", "types", ")", ")", "return", "\"\"", ";", "$", "this", "->", "sortTypes", "(", "$", "types", ")", ";", "$", "type", "=", "reset", "(", ...
Select the best response type to return from a list of available types. @param array $types The types that the script is willing to return @return string The type preferred by the client
[ "Select", "the", "best", "response", "type", "to", "return", "from", "a", "list", "of", "available", "types", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Accept.php#L169-L177
199,959
Wedeto/HTTP
src/Accept.php
Accept.chooseResponse
public function chooseResponse(array $types) { if (empty($types)) return null; $this->sortTypes($types); $first = reset($types); $type = key($types); return $this->accepts($type) ? $first : null; }
php
public function chooseResponse(array $types) { if (empty($types)) return null; $this->sortTypes($types); $first = reset($types); $type = key($types); return $this->accepts($type) ? $first : null; }
[ "public", "function", "chooseResponse", "(", "array", "$", "types", ")", "{", "if", "(", "empty", "(", "$", "types", ")", ")", "return", "null", ";", "$", "this", "->", "sortTypes", "(", "$", "types", ")", ";", "$", "first", "=", "reset", "(", "$",...
Select the preferred reponse type based on a list of response types. The response types should be provided in preference of the script, if any. These are then matched with the accepted response types by the client, and the most preferred one is selected. If more than one type is equally desired by the client, the first...
[ "Select", "the", "preferred", "reponse", "type", "based", "on", "a", "list", "of", "response", "types", ".", "The", "response", "types", "should", "be", "provided", "in", "preference", "of", "the", "script", "if", "any", ".", "These", "are", "then", "match...
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Accept.php#L190-L200
199,960
faizalpribadi/Cache
Driver/OpCache/FileCache.php
FileCache.setDirectory
public function setDirectory($directory) { if (!is_dir($directory) && !is_writable($directory)) { throw new FileCacheException( sprintf('The directory "%s" is not directory and not writable', $directory) ); } if (is_null($directory) && !$this->getFile...
php
public function setDirectory($directory) { if (!is_dir($directory) && !is_writable($directory)) { throw new FileCacheException( sprintf('The directory "%s" is not directory and not writable', $directory) ); } if (is_null($directory) && !$this->getFile...
[ "public", "function", "setDirectory", "(", "$", "directory", ")", "{", "if", "(", "!", "is_dir", "(", "$", "directory", ")", "&&", "!", "is_writable", "(", "$", "directory", ")", ")", "{", "throw", "new", "FileCacheException", "(", "sprintf", "(", "'The ...
Set the directory to store you're cache @param string|__DIR__ $directory @throws \Mozart\Library\Cache\Exception\FileCacheException
[ "Set", "the", "directory", "to", "store", "you", "re", "cache" ]
e62a4d71739e542ca6e7bac77f5cc522accef8cb
https://github.com/faizalpribadi/Cache/blob/e62a4d71739e542ca6e7bac77f5cc522accef8cb/Driver/OpCache/FileCache.php#L58-L73
199,961
BapCat/Remodel
src/GatewayQuery.php
GatewayQuery.insert
public function insert(array $values): bool { $this->coerceDataTypesToDatabase($values); return $this->builder->insert($values); }
php
public function insert(array $values): bool { $this->coerceDataTypesToDatabase($values); return $this->builder->insert($values); }
[ "public", "function", "insert", "(", "array", "$", "values", ")", ":", "bool", "{", "$", "this", "->", "coerceDataTypesToDatabase", "(", "$", "values", ")", ";", "return", "$", "this", "->", "builder", "->", "insert", "(", "$", "values", ")", ";", "}" ...
Insert a new record into the database @param mixed[] $values @return bool
[ "Insert", "a", "new", "record", "into", "the", "database" ]
80fcdec8bca22b88c5af9a0a93622c796cf3e7b1
https://github.com/BapCat/Remodel/blob/80fcdec8bca22b88c5af9a0a93622c796cf3e7b1/src/GatewayQuery.php#L96-L99
199,962
BapCat/Remodel
src/GatewayQuery.php
GatewayQuery.insertGetId
public function insertGetId(array $values): int { $this->coerceDataTypesToDatabase($values); return $this->builder->insertGetId($values); }
php
public function insertGetId(array $values): int { $this->coerceDataTypesToDatabase($values); return $this->builder->insertGetId($values); }
[ "public", "function", "insertGetId", "(", "array", "$", "values", ")", ":", "int", "{", "$", "this", "->", "coerceDataTypesToDatabase", "(", "$", "values", ")", ";", "return", "$", "this", "->", "builder", "->", "insertGetId", "(", "$", "values", ")", ";...
Insert a new record and get the value of the primary key @param mixed[] $values @return int
[ "Insert", "a", "new", "record", "and", "get", "the", "value", "of", "the", "primary", "key" ]
80fcdec8bca22b88c5af9a0a93622c796cf3e7b1
https://github.com/BapCat/Remodel/blob/80fcdec8bca22b88c5af9a0a93622c796cf3e7b1/src/GatewayQuery.php#L108-L111
199,963
BapCat/Remodel
src/GatewayQuery.php
GatewayQuery.update
public function update(array $values): int { $this->coerceDataTypesToDatabase($values); return $this->builder->update($values); }
php
public function update(array $values): int { $this->coerceDataTypesToDatabase($values); return $this->builder->update($values); }
[ "public", "function", "update", "(", "array", "$", "values", ")", ":", "int", "{", "$", "this", "->", "coerceDataTypesToDatabase", "(", "$", "values", ")", ";", "return", "$", "this", "->", "builder", "->", "update", "(", "$", "values", ")", ";", "}" ]
Update a record in the database @param mixed[] $values @return int
[ "Update", "a", "record", "in", "the", "database" ]
80fcdec8bca22b88c5af9a0a93622c796cf3e7b1
https://github.com/BapCat/Remodel/blob/80fcdec8bca22b88c5af9a0a93622c796cf3e7b1/src/GatewayQuery.php#L120-L123
199,964
WellCommerce/AdminBundle
Provider/AdminMenuProvider.php
AdminMenuProvider.generateTree
protected function generateTree(Collection $collection, Collection $children) { $children->map(function (AdminMenuInterface $menuItem) use ($collection, &$tree) { $tree[] = [ 'routeName' => $menuItem->getRouteName(), 'cssClass' => $menuItem->getCssClass(), ...
php
protected function generateTree(Collection $collection, Collection $children) { $children->map(function (AdminMenuInterface $menuItem) use ($collection, &$tree) { $tree[] = [ 'routeName' => $menuItem->getRouteName(), 'cssClass' => $menuItem->getCssClass(), ...
[ "protected", "function", "generateTree", "(", "Collection", "$", "collection", ",", "Collection", "$", "children", ")", "{", "$", "children", "->", "map", "(", "function", "(", "AdminMenuInterface", "$", "menuItem", ")", "use", "(", "$", "collection", ",", "...
Generates a tree for given children elements @param Collection $collection @param Collection $children @return array
[ "Generates", "a", "tree", "for", "given", "children", "elements" ]
5721f0b9a506023ed6beb6bdf79e4ccbbe546516
https://github.com/WellCommerce/AdminBundle/blob/5721f0b9a506023ed6beb6bdf79e4ccbbe546516/Provider/AdminMenuProvider.php#L87-L99
199,965
brunschgi/TerrificComposerBundle
EventListener/ToolbarListener.php
ToolbarListener.injectToolbar
protected function injectToolbar(Response $response, $params) { if (function_exists('mb_stripos')) { $posrFunction = 'mb_strripos'; $substrFunction = 'mb_substr'; } else { $posrFunction = 'strripos'; $substrFunction = 'substr'; } $cont...
php
protected function injectToolbar(Response $response, $params) { if (function_exists('mb_stripos')) { $posrFunction = 'mb_strripos'; $substrFunction = 'mb_substr'; } else { $posrFunction = 'strripos'; $substrFunction = 'substr'; } $cont...
[ "protected", "function", "injectToolbar", "(", "Response", "$", "response", ",", "$", "params", ")", "{", "if", "(", "function_exists", "(", "'mb_stripos'", ")", ")", "{", "$", "posrFunction", "=", "'mb_strripos'", ";", "$", "substrFunction", "=", "'mb_substr'...
Injects the Terrific Composer Toolbar into the given Response. @param Response $response A Response instance @param array $params The parameters
[ "Injects", "the", "Terrific", "Composer", "Toolbar", "into", "the", "given", "Response", "." ]
6eef4ace887c19ef166ab6654de385bc1ffbf5f1
https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/EventListener/ToolbarListener.php#L111-L130
199,966
tuanlq11/dbi18n
src/I18NBlueprint.php
I18NBlueprint.parseCommand
public function parseCommand($originCommand) { $mappings = [ 'create' => ['create'], 'drop' => ['drop', 'dropIfExists'], ]; foreach ($mappings as $key => $mapping) { if (in_array($originCommand, $mapping)) { return $key; } ...
php
public function parseCommand($originCommand) { $mappings = [ 'create' => ['create'], 'drop' => ['drop', 'dropIfExists'], ]; foreach ($mappings as $key => $mapping) { if (in_array($originCommand, $mapping)) { return $key; } ...
[ "public", "function", "parseCommand", "(", "$", "originCommand", ")", "{", "$", "mappings", "=", "[", "'create'", "=>", "[", "'create'", "]", ",", "'drop'", "=>", "[", "'drop'", ",", "'dropIfExists'", "]", ",", "]", ";", "foreach", "(", "$", "mappings", ...
Parse origin command to human command @param $originCommand @return int|null|string
[ "Parse", "origin", "command", "to", "human", "command" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NBlueprint.php#L26-L40
199,967
tuanlq11/dbi18n
src/I18NBlueprint.php
I18NBlueprint.primary
public function primary($columns, $name = null) { $this->addCachePrimary($columns); return parent::primary($columns, $name); }
php
public function primary($columns, $name = null) { $this->addCachePrimary($columns); return parent::primary($columns, $name); }
[ "public", "function", "primary", "(", "$", "columns", ",", "$", "name", "=", "null", ")", "{", "$", "this", "->", "addCachePrimary", "(", "$", "columns", ")", ";", "return", "parent", "::", "primary", "(", "$", "columns", ",", "$", "name", ")", ";", ...
Store list primary to create i18n @param array|string $columns @param null $name @return \Illuminate\Support\Fluent
[ "Store", "list", "primary", "to", "create", "i18n" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NBlueprint.php#L80-L85
199,968
tuanlq11/dbi18n
src/I18NBlueprint.php
I18NBlueprint.build
public function build(Connection $connection, Grammar $grammar) { $command = $this->parseCommand($this->commands[0]->get('name')); $schema = $connection->getSchemaBuilder(); if ($command === "drop") { $schema->dropIfExists($this->getI18NTableName()); } parent::...
php
public function build(Connection $connection, Grammar $grammar) { $command = $this->parseCommand($this->commands[0]->get('name')); $schema = $connection->getSchemaBuilder(); if ($command === "drop") { $schema->dropIfExists($this->getI18NTableName()); } parent::...
[ "public", "function", "build", "(", "Connection", "$", "connection", ",", "Grammar", "$", "grammar", ")", "{", "$", "command", "=", "$", "this", "->", "parseCommand", "(", "$", "this", "->", "commands", "[", "0", "]", "->", "get", "(", "'name'", ")", ...
Overrride build function @param Connection $connection @param Grammar $grammar
[ "Overrride", "build", "function" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NBlueprint.php#L119-L149
199,969
tuanlq11/dbi18n
src/I18NBlueprint.php
I18NBlueprint.createColumn
protected function createColumn($name, $type, array $parameters = []) { $attributes = array_merge(compact('type', 'name'), $parameters); $column = new Fluent($attributes); return $column; }
php
protected function createColumn($name, $type, array $parameters = []) { $attributes = array_merge(compact('type', 'name'), $parameters); $column = new Fluent($attributes); return $column; }
[ "protected", "function", "createColumn", "(", "$", "name", ",", "$", "type", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "$", "attributes", "=", "array_merge", "(", "compact", "(", "'type'", ",", "'name'", ")", ",", "$", "parameters", ")"...
Create column fluent @param $name @param $type @param array $parameters @return Fluent
[ "Create", "column", "fluent" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NBlueprint.php#L160-L167
199,970
tuanlq11/dbi18n
src/I18NBlueprint.php
I18NBlueprint.i18n_string
public function i18n_string($name, $length = 255) { $this->i18n_columns[] = $column = $this->createColumn($name, 'string', compact('length')); return $column; }
php
public function i18n_string($name, $length = 255) { $this->i18n_columns[] = $column = $this->createColumn($name, 'string', compact('length')); return $column; }
[ "public", "function", "i18n_string", "(", "$", "name", ",", "$", "length", "=", "255", ")", "{", "$", "this", "->", "i18n_columns", "[", "]", "=", "$", "column", "=", "$", "this", "->", "createColumn", "(", "$", "name", ",", "'string'", ",", "compact...
Add i18n string field @param $name @param int $length @return \Illuminate\Support\Fluent
[ "Add", "i18n", "string", "field" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NBlueprint.php#L205-L210
199,971
tuanlq11/dbi18n
src/I18NBlueprint.php
I18NBlueprint.i18n_char
public function i18n_char($name, $length = 255) { $this->i18n_columns[] = $column = $this->createColumn($name, 'char', compact('length')); return $column; }
php
public function i18n_char($name, $length = 255) { $this->i18n_columns[] = $column = $this->createColumn($name, 'char', compact('length')); return $column; }
[ "public", "function", "i18n_char", "(", "$", "name", ",", "$", "length", "=", "255", ")", "{", "$", "this", "->", "i18n_columns", "[", "]", "=", "$", "column", "=", "$", "this", "->", "createColumn", "(", "$", "name", ",", "'char'", ",", "compact", ...
Add i18n char field @param $name @param int $length @return \Illuminate\Support\Fluent
[ "Add", "i18n", "char", "field" ]
56d01eceae043f2770e01b92e7bcc7e52a5047e7
https://github.com/tuanlq11/dbi18n/blob/56d01eceae043f2770e01b92e7bcc7e52a5047e7/src/I18NBlueprint.php#L220-L225
199,972
OliverMonneke/pennePHP
src/Filesystem/File.php
File.setHandle
private function setHandle($mode) { $this->closeExistingHandle(); $this->handle = fopen($this->file, $mode); return $this->handle; }
php
private function setHandle($mode) { $this->closeExistingHandle(); $this->handle = fopen($this->file, $mode); return $this->handle; }
[ "private", "function", "setHandle", "(", "$", "mode", ")", "{", "$", "this", "->", "closeExistingHandle", "(", ")", ";", "$", "this", "->", "handle", "=", "fopen", "(", "$", "this", "->", "file", ",", "$", "mode", ")", ";", "return", "$", "this", "...
Set file handle @param string $mode Mode for file opening @return resource
[ "Set", "file", "handle" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Filesystem/File.php#L54-L61
199,973
OliverMonneke/pennePHP
src/Filesystem/File.php
File.write
public function write($string, $append = true) { $mode = $this->getMode($append); $this->setHandle($mode); return fwrite($this->handle, $string); }
php
public function write($string, $append = true) { $mode = $this->getMode($append); $this->setHandle($mode); return fwrite($this->handle, $string); }
[ "public", "function", "write", "(", "$", "string", ",", "$", "append", "=", "true", ")", "{", "$", "mode", "=", "$", "this", "->", "getMode", "(", "$", "append", ")", ";", "$", "this", "->", "setHandle", "(", "$", "mode", ")", ";", "return", "fwr...
Write a string into a file @param string $string The string to write @param bool $append Append to file @return int
[ "Write", "a", "string", "into", "a", "file" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Filesystem/File.php#L181-L187
199,974
OliverMonneke/pennePHP
src/Filesystem/File.php
File.read
public function read($length = 0, $asArray = false) { if ($asArray && Number::isZero($length)) { return file($this->file); } elseif (Number::isPositive($length)) { $this->setHandle('r'); return fread($this->handle, $length); } else { ...
php
public function read($length = 0, $asArray = false) { if ($asArray && Number::isZero($length)) { return file($this->file); } elseif (Number::isPositive($length)) { $this->setHandle('r'); return fread($this->handle, $length); } else { ...
[ "public", "function", "read", "(", "$", "length", "=", "0", ",", "$", "asArray", "=", "false", ")", "{", "if", "(", "$", "asArray", "&&", "Number", "::", "isZero", "(", "$", "length", ")", ")", "{", "return", "file", "(", "$", "this", "->", "file...
Read content from file @param int $length Length of content to read @param bool $asArray Get as array @return array|string|bool
[ "Read", "content", "from", "file" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Filesystem/File.php#L209-L222
199,975
Krinkle/toollabs-base
src/Request.php
Request.getSessionData
public function getSessionData( $key ) { self::ensureSession(); if ( !isset( $_SESSION[ $key ] ) ) { return null; } return $_SESSION[$key]; }
php
public function getSessionData( $key ) { self::ensureSession(); if ( !isset( $_SESSION[ $key ] ) ) { return null; } return $_SESSION[$key]; }
[ "public", "function", "getSessionData", "(", "$", "key", ")", "{", "self", "::", "ensureSession", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "_SESSION", "[", "$", "key", "]", ")", ")", "{", "return", "null", ";", "}", "return", "$", "_SESSIO...
Get data from session @param string $key @return mixed
[ "Get", "data", "from", "session" ]
784150ca58f4b48cc89534fd6142c54b4f138cd2
https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/Request.php#L115-L121
199,976
Krinkle/toollabs-base
src/Request.php
Request.initHeaders
private function initHeaders() { if ( $this->headers !== null ) { return; } $apacheHeaders = function_exists( 'apache_request_headers' ) ? apache_request_headers() : false; if ( $apacheHeaders ) { foreach ( $apacheHeaders as $key => $val ) { $this->headers[strtoupper( $key )] = $val; } } else { ...
php
private function initHeaders() { if ( $this->headers !== null ) { return; } $apacheHeaders = function_exists( 'apache_request_headers' ) ? apache_request_headers() : false; if ( $apacheHeaders ) { foreach ( $apacheHeaders as $key => $val ) { $this->headers[strtoupper( $key )] = $val; } } else { ...
[ "private", "function", "initHeaders", "(", ")", "{", "if", "(", "$", "this", "->", "headers", "!==", "null", ")", "{", "return", ";", "}", "$", "apacheHeaders", "=", "function_exists", "(", "'apache_request_headers'", ")", "?", "apache_request_headers", "(", ...
Initialise the header list
[ "Initialise", "the", "header", "list" ]
784150ca58f4b48cc89534fd6142c54b4f138cd2
https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/Request.php#L180-L200
199,977
Krinkle/toollabs-base
src/Request.php
Request.getHeader
public function getHeader( $name ) { $this->initHeaders(); $name = strtoupper( $name ); if ( !isset( $this->headers[$name] ) ) { return false; } return $this->headers[$name]; }
php
public function getHeader( $name ) { $this->initHeaders(); $name = strtoupper( $name ); if ( !isset( $this->headers[$name] ) ) { return false; } return $this->headers[$name]; }
[ "public", "function", "getHeader", "(", "$", "name", ")", "{", "$", "this", "->", "initHeaders", "(", ")", ";", "$", "name", "=", "strtoupper", "(", "$", "name", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "headers", "[", "$", "nam...
Get a request header, or false if it isn't set @param string $name Case-insensitive header name @return string|bool False on failure
[ "Get", "a", "request", "header", "or", "false", "if", "it", "isn", "t", "set" ]
784150ca58f4b48cc89534fd6142c54b4f138cd2
https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/Request.php#L218-L225
199,978
Krinkle/toollabs-base
src/Request.php
Request.tryLastModified
public function tryLastModified( $modifiedTime ) { $clientCache = $this->getHeader( 'If-Modified-Since' ); if ( $clientCache !== false ) { # IE sends sizes after the date like "Wed, 20 Aug 2003 06:51:19 GMT; length=5202" # which would break strtotime() parsing. $clientCache = preg_replace( '/;.*$/', '', $c...
php
public function tryLastModified( $modifiedTime ) { $clientCache = $this->getHeader( 'If-Modified-Since' ); if ( $clientCache !== false ) { # IE sends sizes after the date like "Wed, 20 Aug 2003 06:51:19 GMT; length=5202" # which would break strtotime() parsing. $clientCache = preg_replace( '/;.*$/', '', $c...
[ "public", "function", "tryLastModified", "(", "$", "modifiedTime", ")", "{", "$", "clientCache", "=", "$", "this", "->", "getHeader", "(", "'If-Modified-Since'", ")", ";", "if", "(", "$", "clientCache", "!==", "false", ")", "{", "# IE sends sizes after the date ...
Respond with 304 Last Modified if appropiate @param int $modifiedTime @return bool True if 304 header was sent
[ "Respond", "with", "304", "Last", "Modified", "if", "appropiate" ]
784150ca58f4b48cc89534fd6142c54b4f138cd2
https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/Request.php#L233-L246
199,979
Wedeto/HTTP
src/URL.php
URL.parse
public static function parse(string $url, string $default_scheme = null) { if (substr($url, 0, 4) === "www." && !empty($default_scheme)) $url = $default_scheme . '://' . $url; elseif (substr($url, 0, 2) === '//' && !empty($_SERVER['REQUEST_SCHEME'])) $url = $_SERVER['REQUEST_...
php
public static function parse(string $url, string $default_scheme = null) { if (substr($url, 0, 4) === "www." && !empty($default_scheme)) $url = $default_scheme . '://' . $url; elseif (substr($url, 0, 2) === '//' && !empty($_SERVER['REQUEST_SCHEME'])) $url = $_SERVER['REQUEST_...
[ "public", "static", "function", "parse", "(", "string", "$", "url", ",", "string", "$", "default_scheme", "=", "null", ")", "{", "if", "(", "substr", "(", "$", "url", ",", "0", ",", "4", ")", "===", "\"www.\"", "&&", "!", "empty", "(", "$", "defaul...
Parse a URL @param string $url The URL to parse @param string $default_scheme A default scheme to use when no scheme is used in the URL.
[ "Parse", "a", "URL" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L69-L113
199,980
Wedeto/HTTP
src/URL.php
URL.parseQuery
protected static function parseQuery($query) { if (is_array($query)) return $query; if (empty($query)) return null; if (!is_string($query)) throw new \InvalidArgumentException('Query must be associative array or string'); $query = ltrim(...
php
protected static function parseQuery($query) { if (is_array($query)) return $query; if (empty($query)) return null; if (!is_string($query)) throw new \InvalidArgumentException('Query must be associative array or string'); $query = ltrim(...
[ "protected", "static", "function", "parseQuery", "(", "$", "query", ")", "{", "if", "(", "is_array", "(", "$", "query", ")", ")", "return", "$", "query", ";", "if", "(", "empty", "(", "$", "query", ")", ")", "return", "null", ";", "if", "(", "!", ...
Parse a query string or array @param string|array $query The query to parse @return array The associative array of key/value pairs. If an array was passed in, it is returned as-is.
[ "Parse", "a", "query", "string", "or", "array" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L121-L146
199,981
Wedeto/HTTP
src/URL.php
URL.setPath
public function setPath(string $path) { $path = '/' . ltrim($path, '/'); $this->query = null; $this->fragment = null; if (preg_match('/^(.*?)(\\?([^#]*))?(#(.*))?$/u', $path, $matches)) { $path = $matches[1]; $this->query = !empty($matches[3]) ? $match...
php
public function setPath(string $path) { $path = '/' . ltrim($path, '/'); $this->query = null; $this->fragment = null; if (preg_match('/^(.*?)(\\?([^#]*))?(#(.*))?$/u', $path, $matches)) { $path = $matches[1]; $this->query = !empty($matches[3]) ? $match...
[ "public", "function", "setPath", "(", "string", "$", "path", ")", "{", "$", "path", "=", "'/'", ".", "ltrim", "(", "$", "path", ",", "'/'", ")", ";", "$", "this", "->", "query", "=", "null", ";", "$", "this", "->", "fragment", "=", "null", ";", ...
Set the path of the URL. This will unset the currently set fragment and query and overwrite them with whatever is appended in the path. @param string $path The path to set. May include query and fragment @return URL Provides fluent interface
[ "Set", "the", "path", "of", "the", "URL", ".", "This", "will", "unset", "the", "currently", "set", "fragment", "and", "query", "and", "overwrite", "them", "with", "whatever", "is", "appended", "in", "the", "path", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L154-L168
199,982
Wedeto/HTTP
src/URL.php
URL.toString
public function toString(bool $idn = false) { $o = ""; if (!empty($this->scheme)) $o .= $this->scheme . "://"; if (!empty($this->username) && !empty($this->password)) $o .= $this->username . ':' . $this->password . '@'; // Check for IDN $host...
php
public function toString(bool $idn = false) { $o = ""; if (!empty($this->scheme)) $o .= $this->scheme . "://"; if (!empty($this->username) && !empty($this->password)) $o .= $this->username . ':' . $this->password . '@'; // Check for IDN $host...
[ "public", "function", "toString", "(", "bool", "$", "idn", "=", "false", ")", "{", "$", "o", "=", "\"\"", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "scheme", ")", ")", "$", "o", ".=", "$", "this", "->", "scheme", ".", "\"://\"", ";"...
Convert a URL to a string. @param bool $idn Whether to allow IDN names or convert them to punycode. @return string A string representation of the URL
[ "Convert", "a", "URL", "to", "a", "string", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L183-L218
199,983
Wedeto/HTTP
src/URL.php
URL.setHost
public function setHost(string $hostname) { if (($ppos = strrpos($hostname, ":")) !== false) { $this->port = substr($hostname, $ppos + 1); $hostname = substr($hostname, 0, $ppos); } if (substr($hostname, 0, 4) === "xn--") $hostname = \idn_to_utf8(...
php
public function setHost(string $hostname) { if (($ppos = strrpos($hostname, ":")) !== false) { $this->port = substr($hostname, $ppos + 1); $hostname = substr($hostname, 0, $ppos); } if (substr($hostname, 0, 4) === "xn--") $hostname = \idn_to_utf8(...
[ "public", "function", "setHost", "(", "string", "$", "hostname", ")", "{", "if", "(", "(", "$", "ppos", "=", "strrpos", "(", "$", "hostname", ",", "\":\"", ")", ")", "!==", "false", ")", "{", "$", "this", "->", "port", "=", "substr", "(", "$", "h...
Set the host name of the URL @param string $hostname The hostname to set
[ "Set", "the", "host", "name", "of", "the", "URL" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L224-L237
199,984
Wedeto/HTTP
src/URL.php
URL.set
public function set(string $field, $value) { if ($value === null) $value = ""; switch ($field) { case "scheme": $this->scheme = strtolower($value); return $this; case "port": $value = empty($value) ? null : ...
php
public function set(string $field, $value) { if ($value === null) $value = ""; switch ($field) { case "scheme": $this->scheme = strtolower($value); return $this; case "port": $value = empty($value) ? null : ...
[ "public", "function", "set", "(", "string", "$", "field", ",", "$", "value", ")", "{", "if", "(", "$", "value", "===", "null", ")", "$", "value", "=", "\"\"", ";", "switch", "(", "$", "field", ")", "{", "case", "\"scheme\"", ":", "$", "this", "->...
Set a field to a new value @param string $field The field to set @param mixed $value The value to update @return URL Provides fluent interface
[ "Set", "a", "field", "to", "a", "new", "value" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L287-L314
199,985
Wedeto/HTTP
src/URL.php
URL.get
public function get(string $field) { if ($field === "secure") return $this->scheme === "https"; if ($field === "port" && $this->port === null) { if ($this->scheme === "http") return 80; if ($this->scheme === "https") return 443; if ($this->sch...
php
public function get(string $field) { if ($field === "secure") return $this->scheme === "https"; if ($field === "port" && $this->port === null) { if ($this->scheme === "http") return 80; if ($this->scheme === "https") return 443; if ($this->sch...
[ "public", "function", "get", "(", "string", "$", "field", ")", "{", "if", "(", "$", "field", "===", "\"secure\"", ")", "return", "$", "this", "->", "scheme", "===", "\"https\"", ";", "if", "(", "$", "field", "===", "\"port\"", "&&", "$", "this", "->"...
Get the value for a field @param string field The field to get @return string The value for the field
[ "Get", "the", "value", "for", "a", "field" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L321-L343
199,986
Wedeto/HTTP
src/URL.php
URL.setQueryVariable
public function setQueryVariable(string $key, string $value) { if (empty($value)) unset($this->query[$key]); else $this->query[$key] = $value; return $this; }
php
public function setQueryVariable(string $key, string $value) { if (empty($value)) unset($this->query[$key]); else $this->query[$key] = $value; return $this; }
[ "public", "function", "setQueryVariable", "(", "string", "$", "key", ",", "string", "$", "value", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "unset", "(", "$", "this", "->", "query", "[", "$", "key", "]", ")", ";", "else", "$", "t...
Set or update a query variable @param string $key The name of the query parameter @param string $value The value for the parameter @return URL Provides fluent interface
[ "Set", "or", "update", "a", "query", "variable" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/URL.php#L391-L398
199,987
ReputationVIP/composer-assets-installer
src/AssetsInstaller.php
AssetsInstaller.getVendorPath
public function getVendorPath() { if (is_null($this->vendorPath)) { // We get the current package install path $installPath = $this->composer->getInstallationManager()->getInstallPath($this->package); // We get the name of the package in order to get its target path ...
php
public function getVendorPath() { if (is_null($this->vendorPath)) { // We get the current package install path $installPath = $this->composer->getInstallationManager()->getInstallPath($this->package); // We get the name of the package in order to get its target path ...
[ "public", "function", "getVendorPath", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "vendorPath", ")", ")", "{", "// We get the current package install path", "$", "installPath", "=", "$", "this", "->", "composer", "->", "getInstallationManager", ...
Returns the vendor path of the current package @return string
[ "Returns", "the", "vendor", "path", "of", "the", "current", "package" ]
c8dea009795fe23dcd7f41d8b9a5bf4a970d842b
https://github.com/ReputationVIP/composer-assets-installer/blob/c8dea009795fe23dcd7f41d8b9a5bf4a970d842b/src/AssetsInstaller.php#L107-L118
199,988
ReputationVIP/composer-assets-installer
src/AssetsInstaller.php
AssetsInstaller.install
public function install() { // We get all the packages required $packages = $this->composer->getPackage()->getRequires(); /** @var Package\Link $package */ foreach ($packages as $package) { $this->packagesStatuses[$package->getTarget()] = array('extra' => null, 'dirs' => ...
php
public function install() { // We get all the packages required $packages = $this->composer->getPackage()->getRequires(); /** @var Package\Link $package */ foreach ($packages as $package) { $this->packagesStatuses[$package->getTarget()] = array('extra' => null, 'dirs' => ...
[ "public", "function", "install", "(", ")", "{", "// We get all the packages required", "$", "packages", "=", "$", "this", "->", "composer", "->", "getPackage", "(", ")", "->", "getRequires", "(", ")", ";", "/** @var Package\\Link $package */", "foreach", "(", "$",...
Installs all the assets directories of the dependency packages @return $this
[ "Installs", "all", "the", "assets", "directories", "of", "the", "dependency", "packages" ]
c8dea009795fe23dcd7f41d8b9a5bf4a970d842b
https://github.com/ReputationVIP/composer-assets-installer/blob/c8dea009795fe23dcd7f41d8b9a5bf4a970d842b/src/AssetsInstaller.php#L124-L134
199,989
ReputationVIP/composer-assets-installer
src/AssetsInstaller.php
AssetsInstaller.installPackage
public function installPackage($package) { // We read its composer file $jsonData = $this->getPackageJsonFile($package); // We get the package assets dirs $packagesAssetsDir = $this->getPackageAssetsDirs($jsonData); if (!is_null($packagesAssetsDir)) { $this->log($...
php
public function installPackage($package) { // We read its composer file $jsonData = $this->getPackageJsonFile($package); // We get the package assets dirs $packagesAssetsDir = $this->getPackageAssetsDirs($jsonData); if (!is_null($packagesAssetsDir)) { $this->log($...
[ "public", "function", "installPackage", "(", "$", "package", ")", "{", "// We read its composer file", "$", "jsonData", "=", "$", "this", "->", "getPackageJsonFile", "(", "$", "package", ")", ";", "// We get the package assets dirs", "$", "packagesAssetsDir", "=", "...
Installs all the assets directories of the given package @param Package\Link $package
[ "Installs", "all", "the", "assets", "directories", "of", "the", "given", "package" ]
c8dea009795fe23dcd7f41d8b9a5bf4a970d842b
https://github.com/ReputationVIP/composer-assets-installer/blob/c8dea009795fe23dcd7f41d8b9a5bf4a970d842b/src/AssetsInstaller.php#L140-L161
199,990
ReputationVIP/composer-assets-installer
src/AssetsInstaller.php
AssetsInstaller.getPackageJsonFile
public function getPackageJsonFile($package) { // We get the project vendor path $vendorPath = $this->getVendorPath(); // We get the target dir of the iterated package $targetDir = $package->getTarget(); $jsonPath = $vendorPath . $targetDir . "/composer.json"; if (met...
php
public function getPackageJsonFile($package) { // We get the project vendor path $vendorPath = $this->getVendorPath(); // We get the target dir of the iterated package $targetDir = $package->getTarget(); $jsonPath = $vendorPath . $targetDir . "/composer.json"; if (met...
[ "public", "function", "getPackageJsonFile", "(", "$", "package", ")", "{", "// We get the project vendor path", "$", "vendorPath", "=", "$", "this", "->", "getVendorPath", "(", ")", ";", "// We get the target dir of the iterated package", "$", "targetDir", "=", "$", "...
Returns the Json file of the given Package @param Package\Link $package @return mixed
[ "Returns", "the", "Json", "file", "of", "the", "given", "Package" ]
c8dea009795fe23dcd7f41d8b9a5bf4a970d842b
https://github.com/ReputationVIP/composer-assets-installer/blob/c8dea009795fe23dcd7f41d8b9a5bf4a970d842b/src/AssetsInstaller.php#L168-L184
199,991
ReputationVIP/composer-assets-installer
src/AssetsInstaller.php
AssetsInstaller.getPackageAssetsDirs
public function getPackageAssetsDirs($jsonData) { $packagesAssetsDir = null; // If some assets were set on the package if (isset($jsonData["extra"][self::LABEL_ASSETS_DIR])) { // We get the assets-dir of this package $packagesAssetsDir = $jsonData["extra"][self::LABEL...
php
public function getPackageAssetsDirs($jsonData) { $packagesAssetsDir = null; // If some assets were set on the package if (isset($jsonData["extra"][self::LABEL_ASSETS_DIR])) { // We get the assets-dir of this package $packagesAssetsDir = $jsonData["extra"][self::LABEL...
[ "public", "function", "getPackageAssetsDirs", "(", "$", "jsonData", ")", "{", "$", "packagesAssetsDir", "=", "null", ";", "// If some assets were set on the package", "if", "(", "isset", "(", "$", "jsonData", "[", "\"extra\"", "]", "[", "self", "::", "LABEL_ASSETS...
Returns all the assets directories contained in the given jsonData @param array $jsonData @return array|null
[ "Returns", "all", "the", "assets", "directories", "contained", "in", "the", "given", "jsonData" ]
c8dea009795fe23dcd7f41d8b9a5bf4a970d842b
https://github.com/ReputationVIP/composer-assets-installer/blob/c8dea009795fe23dcd7f41d8b9a5bf4a970d842b/src/AssetsInstaller.php#L191-L204
199,992
ReputationVIP/composer-assets-installer
src/AssetsInstaller.php
AssetsInstaller.installPackageDir
public function installPackageDir($package, $namespace, $packageAssetsDir) { $this->log($package->getTarget(), self::LOG_INFO, self::CODE_INSTALLING_DIR, array('namespace' => $namespace)); if (!isset($this->assetsDirectories[$namespace])) { $this->log($package->getTarget(), self::LOG_WAR...
php
public function installPackageDir($package, $namespace, $packageAssetsDir) { $this->log($package->getTarget(), self::LOG_INFO, self::CODE_INSTALLING_DIR, array('namespace' => $namespace)); if (!isset($this->assetsDirectories[$namespace])) { $this->log($package->getTarget(), self::LOG_WAR...
[ "public", "function", "installPackageDir", "(", "$", "package", ",", "$", "namespace", ",", "$", "packageAssetsDir", ")", "{", "$", "this", "->", "log", "(", "$", "package", "->", "getTarget", "(", ")", ",", "self", "::", "LOG_INFO", ",", "self", "::", ...
Installs a specific directory from the given package @param Package\Link $package @param string $namespace @param string $packageAssetsDir
[ "Installs", "a", "specific", "directory", "from", "the", "given", "package" ]
c8dea009795fe23dcd7f41d8b9a5bf4a970d842b
https://github.com/ReputationVIP/composer-assets-installer/blob/c8dea009795fe23dcd7f41d8b9a5bf4a970d842b/src/AssetsInstaller.php#L212-L245
199,993
ebidtech/options-resolver
src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php
OptionsResolver.setCast
public function setCast($option, $type) { /* Ensure the option exists: not very important, but ensures consistent behavior with underlying code. */ if (! $this->isDefined($option)) { throw new UndefinedOptionsException( sprintf( 'The option "%s" does n...
php
public function setCast($option, $type) { /* Ensure the option exists: not very important, but ensures consistent behavior with underlying code. */ if (! $this->isDefined($option)) { throw new UndefinedOptionsException( sprintf( 'The option "%s" does n...
[ "public", "function", "setCast", "(", "$", "option", ",", "$", "type", ")", "{", "/* Ensure the option exists: not very important, but ensures consistent behavior with underlying code. */", "if", "(", "!", "$", "this", "->", "isDefined", "(", "$", "option", ")", ")", ...
Sets a cast for a specific option. The given option will be cast to the given type before any validation, if possible. @param string $option Option name. @param string|\Closure $type Type to cast the option to or a closure to be lazily evaluated. @return OptionsResolver Returns itself. @throws UndefinedOp...
[ "Sets", "a", "cast", "for", "a", "specific", "option", ".", "The", "given", "option", "will", "be", "cast", "to", "the", "given", "type", "before", "any", "validation", "if", "possible", "." ]
a5a3a81571c4ceaa94d674c3e60b22b5ee720d72
https://github.com/ebidtech/options-resolver/blob/a5a3a81571c4ceaa94d674c3e60b22b5ee720d72/src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php#L115-L158
199,994
ebidtech/options-resolver
src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php
OptionsResolver.clearUndefinedOptions
protected function clearUndefinedOptions(array $options, $allowUndefinedOptions) { if (! $allowUndefinedOptions) { return $options; } /* Find out undefined options by computing the difference between given and defined options. */ $undefinedOptions = array_diff( ...
php
protected function clearUndefinedOptions(array $options, $allowUndefinedOptions) { if (! $allowUndefinedOptions) { return $options; } /* Find out undefined options by computing the difference between given and defined options. */ $undefinedOptions = array_diff( ...
[ "protected", "function", "clearUndefinedOptions", "(", "array", "$", "options", ",", "$", "allowUndefinedOptions", ")", "{", "if", "(", "!", "$", "allowUndefinedOptions", ")", "{", "return", "$", "options", ";", "}", "/* Find out undefined options by computing the dif...
Clears undefined options before resolving, if the appropriate flag is set. @param array $options Map of option names to values. @param bool $allowUndefinedOptions If set to true undefined options will not raise an error. @return array Clean options.
[ "Clears", "undefined", "options", "before", "resolving", "if", "the", "appropriate", "flag", "is", "set", "." ]
a5a3a81571c4ceaa94d674c3e60b22b5ee720d72
https://github.com/ebidtech/options-resolver/blob/a5a3a81571c4ceaa94d674c3e60b22b5ee720d72/src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php#L180-L199
199,995
ebidtech/options-resolver
src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php
OptionsResolver.resolveCasts
protected function resolveCasts(array $options = []) { /* Create a copy of the options to work on. */ $castOptions = $options; /* Iterate every options and cast as needed. */ foreach ($options as $option => $value) { /* No cast was defined, continue. */ if (...
php
protected function resolveCasts(array $options = []) { /* Create a copy of the options to work on. */ $castOptions = $options; /* Iterate every options and cast as needed. */ foreach ($options as $option => $value) { /* No cast was defined, continue. */ if (...
[ "protected", "function", "resolveCasts", "(", "array", "$", "options", "=", "[", "]", ")", "{", "/* Create a copy of the options to work on. */", "$", "castOptions", "=", "$", "options", ";", "/* Iterate every options and cast as needed. */", "foreach", "(", "$", "optio...
Resolves a variable casts in the initial options. @param array $options Options to cast. @return array Options after applying the relevant casts.
[ "Resolves", "a", "variable", "casts", "in", "the", "initial", "options", "." ]
a5a3a81571c4ceaa94d674c3e60b22b5ee720d72
https://github.com/ebidtech/options-resolver/blob/a5a3a81571c4ceaa94d674c3e60b22b5ee720d72/src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php#L208-L229
199,996
ebidtech/options-resolver
src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php
OptionsResolver.castToType
protected function castToType($value, $type) { switch ($type) { case self::TYPE_CAST_INT: $newValue = filter_var($value, FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); $value = (null === $newValue) ? $value : $newValue; break; case se...
php
protected function castToType($value, $type) { switch ($type) { case self::TYPE_CAST_INT: $newValue = filter_var($value, FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); $value = (null === $newValue) ? $value : $newValue; break; case se...
[ "protected", "function", "castToType", "(", "$", "value", ",", "$", "type", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "TYPE_CAST_INT", ":", "$", "newValue", "=", "filter_var", "(", "$", "value", ",", "FILTER_VALIDATE_INT", ","...
Applies specific cast logic for each type. @param mixed $value Value to cast. @param string $type Type to cast to. @return mixed Cast value.
[ "Applies", "specific", "cast", "logic", "for", "each", "type", "." ]
a5a3a81571c4ceaa94d674c3e60b22b5ee720d72
https://github.com/ebidtech/options-resolver/blob/a5a3a81571c4ceaa94d674c3e60b22b5ee720d72/src/EBT/OptionsResolver/Model/OptionsResolver/OptionsResolver.php#L239-L257
199,997
stubbles/stubbles-reflect
src/main/php/annotation/Annotations.php
Annotations.add
public function add(Annotation $annotation) { if (!isset($this->types[$annotation->type()])) { $this->types[$annotation->type()] = [$annotation]; } else { $this->types[$annotation->type()][] = $annotation; } return $this; }
php
public function add(Annotation $annotation) { if (!isset($this->types[$annotation->type()])) { $this->types[$annotation->type()] = [$annotation]; } else { $this->types[$annotation->type()][] = $annotation; } return $this; }
[ "public", "function", "add", "(", "Annotation", "$", "annotation", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "types", "[", "$", "annotation", "->", "type", "(", ")", "]", ")", ")", "{", "$", "this", "->", "types", "[", "$", "anno...
adds given annotation @internal only to be called by the parser @param \stubbles\reflect\annotation\Annotation $annotation
[ "adds", "given", "annotation" ]
ab48f9b8692293ef0d276b52619625dbb8869c97
https://github.com/stubbles/stubbles-reflect/blob/ab48f9b8692293ef0d276b52619625dbb8869c97/src/main/php/annotation/Annotations.php#L67-L76
199,998
stubbles/stubbles-reflect
src/main/php/annotation/Annotations.php
Annotations.firstNamed
public function firstNamed(string $type): Annotation { if ($this->contain($type)) { return $this->types[$type][0]; } throw new \ReflectionException('Can not find annotation ' . $type . ' for ' . $this->target); }
php
public function firstNamed(string $type): Annotation { if ($this->contain($type)) { return $this->types[$type][0]; } throw new \ReflectionException('Can not find annotation ' . $type . ' for ' . $this->target); }
[ "public", "function", "firstNamed", "(", "string", "$", "type", ")", ":", "Annotation", "{", "if", "(", "$", "this", "->", "contain", "(", "$", "type", ")", ")", "{", "return", "$", "this", "->", "types", "[", "$", "type", "]", "[", "0", "]", ";"...
returns first annotation with given type name If no such annotation exists a ReflectionException is thrown. @param string $type @return \stubbles\reflect\annotation\Annotation @throws \ReflectionException @since 5.3.0
[ "returns", "first", "annotation", "with", "given", "type", "name" ]
ab48f9b8692293ef0d276b52619625dbb8869c97
https://github.com/stubbles/stubbles-reflect/blob/ab48f9b8692293ef0d276b52619625dbb8869c97/src/main/php/annotation/Annotations.php#L110-L117
199,999
ivopetkov/html-server-components-bearframework-addon
classes/HTMLServerComponents.php
HTMLServerComponents.addAlias
public function addAlias(string $alias, string $original): self { $this->aliases[$alias] = $original; return $this; }
php
public function addAlias(string $alias, string $original): self { $this->aliases[$alias] = $original; return $this; }
[ "public", "function", "addAlias", "(", "string", "$", "alias", ",", "string", "$", "original", ")", ":", "self", "{", "$", "this", "->", "aliases", "[", "$", "alias", "]", "=", "$", "original", ";", "return", "$", "this", ";", "}" ]
Adds an alias @param string $alias The alias @param string $original The original source name @return IvoPetkov\BearFramework\Addons\HTMLServerComponents Instance of itself.
[ "Adds", "an", "alias" ]
c9a5f275d10f194b2216d733bfea612fd876a0b2
https://github.com/ivopetkov/html-server-components-bearframework-addon/blob/c9a5f275d10f194b2216d733bfea612fd876a0b2/classes/HTMLServerComponents.php#L51-L55