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
205,700
ezsystems/ezprestapiprovider
classes/models/rest_content_model.php
ezpRestContentModel.getLocationsByContent
public static function getLocationsByContent( ezpContent $content ) { $aReturnLocations = array(); $assignedNodes = $content->assigned_nodes; foreach ( $assignedNodes as $node ) { $location = ezpContentLocation::fromNode( $node ); $locationData = self::getMeta...
php
public static function getLocationsByContent( ezpContent $content ) { $aReturnLocations = array(); $assignedNodes = $content->assigned_nodes; foreach ( $assignedNodes as $node ) { $location = ezpContentLocation::fromNode( $node ); $locationData = self::getMeta...
[ "public", "static", "function", "getLocationsByContent", "(", "ezpContent", "$", "content", ")", "{", "$", "aReturnLocations", "=", "array", "(", ")", ";", "$", "assignedNodes", "=", "$", "content", "->", "assigned_nodes", ";", "foreach", "(", "$", "assignedNo...
Returns all locations for provided content as array. @param ezpContent $content @return array Associative array with following keys : - fullUrl => URL for content, including server - nodeId => NodeID for location - remoteId => RemoteID for location - isMain => whether location is main for provided content
[ "Returns", "all", "locations", "for", "provided", "content", "as", "array", "." ]
98012d22225fca242fa6b87cd7c71bf912ca8cbd
https://github.com/ezsystems/ezprestapiprovider/blob/98012d22225fca242fa6b87cd7c71bf912ca8cbd/classes/models/rest_content_model.php#L61-L74
205,701
ezsystems/ezprestapiprovider
classes/models/rest_content_model.php
ezpRestContentModel.getFieldsByContent
public static function getFieldsByContent( ezpContent $content ) { $aReturnFields = array(); foreach ( $content->fields as $name => $field ) { $aReturnFields[$name] = self::attributeOutputData( $field ); } return $aReturnFields; }
php
public static function getFieldsByContent( ezpContent $content ) { $aReturnFields = array(); foreach ( $content->fields as $name => $field ) { $aReturnFields[$name] = self::attributeOutputData( $field ); } return $aReturnFields; }
[ "public", "static", "function", "getFieldsByContent", "(", "ezpContent", "$", "content", ")", "{", "$", "aReturnFields", "=", "array", "(", ")", ";", "foreach", "(", "$", "content", "->", "fields", "as", "$", "name", "=>", "$", "field", ")", "{", "$", ...
Returns all fields for provided content @param ezpContent $content @return array Associative array with following keys : - type => Field type (datatype string) - identifier => Attribute identifier - value => String representation of field content - id => Attribute numerical ID - classattribute_id => Numerical class att...
[ "Returns", "all", "fields", "for", "provided", "content" ]
98012d22225fca242fa6b87cd7c71bf912ca8cbd
https://github.com/ezsystems/ezprestapiprovider/blob/98012d22225fca242fa6b87cd7c71bf912ca8cbd/classes/models/rest_content_model.php#L86-L95
205,702
ezsystems/ezprestapiprovider
classes/models/rest_content_model.php
ezpRestContentModel.attributeOutputData
public static function attributeOutputData( ezpContentField $field ) { // @TODO move to datatype representation layer switch ( $field->data_type_string ) { case 'ezxmltext': $html = $field->content->attribute( 'output' )->attribute( 'output_text' ); ...
php
public static function attributeOutputData( ezpContentField $field ) { // @TODO move to datatype representation layer switch ( $field->data_type_string ) { case 'ezxmltext': $html = $field->content->attribute( 'output' )->attribute( 'output_text' ); ...
[ "public", "static", "function", "attributeOutputData", "(", "ezpContentField", "$", "field", ")", "{", "// @TODO move to datatype representation layer", "switch", "(", "$", "field", "->", "data_type_string", ")", "{", "case", "'ezxmltext'", ":", "$", "html", "=", "$...
Transforms an ezpContentField in an array representation @todo Refactor, this doesn't really belong here. Either in ezpContentField, or in an extend class @param ezpContentField $field @return array Associative array with following keys : - type => Field type (datatype string) - identifier => Attribute identifier - val...
[ "Transforms", "an", "ezpContentField", "in", "an", "array", "representation" ]
98012d22225fca242fa6b87cd7c71bf912ca8cbd
https://github.com/ezsystems/ezprestapiprovider/blob/98012d22225fca242fa6b87cd7c71bf912ca8cbd/classes/models/rest_content_model.php#L108-L157
205,703
ezsystems/ezprestapiprovider
classes/models/rest_content_model.php
ezpRestContentModel.getChildrenList
public static function getChildrenList( ezpContentCriteria $c, ezpRestRequest $currentRequest, array $responseGroups = array() ) { $aRetData = array(); $aChildren = ezpContentRepository::query( $c ); foreach ( $aChildren as $childNode ) { $childEntry = self::getMetadataB...
php
public static function getChildrenList( ezpContentCriteria $c, ezpRestRequest $currentRequest, array $responseGroups = array() ) { $aRetData = array(); $aChildren = ezpContentRepository::query( $c ); foreach ( $aChildren as $childNode ) { $childEntry = self::getMetadataB...
[ "public", "static", "function", "getChildrenList", "(", "ezpContentCriteria", "$", "c", ",", "ezpRestRequest", "$", "currentRequest", ",", "array", "$", "responseGroups", "=", "array", "(", ")", ")", "{", "$", "aRetData", "=", "array", "(", ")", ";", "$", ...
Returns all children node data, based on the provided criteria object @param ezpContentCriteria $c @param ezpRestRequest $currentRequest @param array $responseGroups Requested ResponseGroups @return array
[ "Returns", "all", "children", "node", "data", "based", "on", "the", "provided", "criteria", "object" ]
98012d22225fca242fa6b87cd7c71bf912ca8cbd
https://github.com/ezsystems/ezprestapiprovider/blob/98012d22225fca242fa6b87cd7c71bf912ca8cbd/classes/models/rest_content_model.php#L189-L213
205,704
luoxiaojun1992/lb_framework
components/Auth.php
Auth.authQueryString
public static function authQueryString($authKey, $accessToken, $request = null) { return HashHelper::hash($request ? $request->getParam($authKey) : Lb::app()->getParam($authKey)) == $accessToken; }
php
public static function authQueryString($authKey, $accessToken, $request = null) { return HashHelper::hash($request ? $request->getParam($authKey) : Lb::app()->getParam($authKey)) == $accessToken; }
[ "public", "static", "function", "authQueryString", "(", "$", "authKey", ",", "$", "accessToken", ",", "$", "request", "=", "null", ")", "{", "return", "HashHelper", "::", "hash", "(", "$", "request", "?", "$", "request", "->", "getParam", "(", "$", "auth...
Query String Authentication @param $authKey @param $accessToken @param $request RequestContract @return bool
[ "Query", "String", "Authentication" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/Auth.php#L39-L42
205,705
alphacomm/alpharpc
src/AlphaRPC/Manager/Protocol/ClientHandlerJobRequest.php
ClientHandlerJobRequest.toMessage
public function toMessage() { $m = new Message(array( $this->getRequestId(), $this->getActionName(), )); $m->append($this->getParameters()); return $m; }
php
public function toMessage() { $m = new Message(array( $this->getRequestId(), $this->getActionName(), )); $m->append($this->getParameters()); return $m; }
[ "public", "function", "toMessage", "(", ")", "{", "$", "m", "=", "new", "Message", "(", "array", "(", "$", "this", "->", "getRequestId", "(", ")", ",", "$", "this", "->", "getActionName", "(", ")", ",", ")", ")", ";", "$", "m", "->", "append", "(...
Create a new Message from this StorageStatus. @return Message
[ "Create", "a", "new", "Message", "from", "this", "StorageStatus", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Manager/Protocol/ClientHandlerJobRequest.php#L107-L116
205,706
rnijveld/pgt
lib/Pgettext/Pgettext.php
Pgettext.msgfmt
public static function msgfmt($po, $mo = null) { $stringset = Po::fromFile($po); if ($mo === null) { $mo = substr($po, 0, -3) . '.mo'; } Mo::toFile($stringset, $mo); }
php
public static function msgfmt($po, $mo = null) { $stringset = Po::fromFile($po); if ($mo === null) { $mo = substr($po, 0, -3) . '.mo'; } Mo::toFile($stringset, $mo); }
[ "public", "static", "function", "msgfmt", "(", "$", "po", ",", "$", "mo", "=", "null", ")", "{", "$", "stringset", "=", "Po", "::", "fromFile", "(", "$", "po", ")", ";", "if", "(", "$", "mo", "===", "null", ")", "{", "$", "mo", "=", "substr", ...
Read a po file and store a mo file. If no MO filename is given, one will be generated from the PO filename. @param string $po Filename of the input PO file. @param string $mo Filename of the output MO file. @return void
[ "Read", "a", "po", "file", "and", "store", "a", "mo", "file", ".", "If", "no", "MO", "filename", "is", "given", "one", "will", "be", "generated", "from", "the", "PO", "filename", "." ]
9d64b4858438a9833065265c2e6d2db94b7e6fcd
https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Pgettext.php#L22-L29
205,707
rnijveld/pgt
lib/Pgettext/Pgettext.php
Pgettext.msgunfmt
public static function msgunfmt($mo, $po = null) { $stringset = Mo::fromFile($mo); if ($po === null) { print Po::toString($stringset); } else { Po::toFile($stringset, $po); } }
php
public static function msgunfmt($mo, $po = null) { $stringset = Mo::fromFile($mo); if ($po === null) { print Po::toString($stringset); } else { Po::toFile($stringset, $po); } }
[ "public", "static", "function", "msgunfmt", "(", "$", "mo", ",", "$", "po", "=", "null", ")", "{", "$", "stringset", "=", "Mo", "::", "fromFile", "(", "$", "mo", ")", ";", "if", "(", "$", "po", "===", "null", ")", "{", "print", "Po", "::", "toS...
Reads a mo file and stores the po file. If no PO file was given, only displays what would be the result. @param string $mo Filename of the input MO file. @param string $po Filename of the output PO file. @return void
[ "Reads", "a", "mo", "file", "and", "stores", "the", "po", "file", ".", "If", "no", "PO", "file", "was", "given", "only", "displays", "what", "would", "be", "the", "result", "." ]
9d64b4858438a9833065265c2e6d2db94b7e6fcd
https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Pgettext.php#L38-L46
205,708
cmmarslender/post-iterator
includes/Cmmarslender/PostIterator/PostIterator.php
PostIterator.have_pages
public function have_pages() { $this->setup(); $offset = $this->get_query_offset(); return (bool) ( $offset < $this->total_posts ); }
php
public function have_pages() { $this->setup(); $offset = $this->get_query_offset(); return (bool) ( $offset < $this->total_posts ); }
[ "public", "function", "have_pages", "(", ")", "{", "$", "this", "->", "setup", "(", ")", ";", "$", "offset", "=", "$", "this", "->", "get_query_offset", "(", ")", ";", "return", "(", "bool", ")", "(", "$", "offset", "<", "$", "this", "->", "total_p...
Indicates if we have posts to process
[ "Indicates", "if", "we", "have", "posts", "to", "process" ]
5c9007614a4979183c77ea5fb009bb577d44d3a1
https://github.com/cmmarslender/post-iterator/blob/5c9007614a4979183c77ea5fb009bb577d44d3a1/includes/Cmmarslender/PostIterator/PostIterator.php#L94-L100
205,709
cmmarslender/post-iterator
includes/Cmmarslender/PostIterator/PostIterator.php
PostIterator.count_posts
protected function count_posts() { global $wpdb; $query = $this->get_count_query(); $this->total_posts = $wpdb->get_var( $query ); }
php
protected function count_posts() { global $wpdb; $query = $this->get_count_query(); $this->total_posts = $wpdb->get_var( $query ); }
[ "protected", "function", "count_posts", "(", ")", "{", "global", "$", "wpdb", ";", "$", "query", "=", "$", "this", "->", "get_count_query", "(", ")", ";", "$", "this", "->", "total_posts", "=", "$", "wpdb", "->", "get_var", "(", "$", "query", ")", ";...
Counts the total number of posts that match the restrictions, not including pagination.
[ "Counts", "the", "total", "number", "of", "posts", "that", "match", "the", "restrictions", "not", "including", "pagination", "." ]
5c9007614a4979183c77ea5fb009bb577d44d3a1
https://github.com/cmmarslender/post-iterator/blob/5c9007614a4979183c77ea5fb009bb577d44d3a1/includes/Cmmarslender/PostIterator/PostIterator.php#L131-L137
205,710
bruno-barros/w.eloquent-framework
src/weloquent/Support/Breadcrumb.php
Breadcrumb.getCurrentTaxonomy
protected function getCurrentTaxonomy() { if (!isset($this->args['taxonomies']) || empty($this->args['taxonomies'])) { $this->args['taxonomies'] = $this->getDefaultTaxonomies(); } foreach ($this->args['taxonomies'] as $tax) { if ($tax = get_term_by('slug', get_query_var($tax), $tax)) { return $...
php
protected function getCurrentTaxonomy() { if (!isset($this->args['taxonomies']) || empty($this->args['taxonomies'])) { $this->args['taxonomies'] = $this->getDefaultTaxonomies(); } foreach ($this->args['taxonomies'] as $tax) { if ($tax = get_term_by('slug', get_query_var($tax), $tax)) { return $...
[ "protected", "function", "getCurrentTaxonomy", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "args", "[", "'taxonomies'", "]", ")", "||", "empty", "(", "$", "this", "->", "args", "[", "'taxonomies'", "]", ")", ")", "{", "$", "this",...
Find a custom taxonomy @return mixed|null
[ "Find", "a", "custom", "taxonomy" ]
d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd
https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Support/Breadcrumb.php#L217-L234
205,711
bruno-barros/w.eloquent-framework
src/weloquent/Support/Breadcrumb.php
Breadcrumb.getOverloaded
protected function getOverloaded($postType) { if (!isset($this->args['overload'][$postType])) { return null; } return $this->args['overload'][$postType]; }
php
protected function getOverloaded($postType) { if (!isset($this->args['overload'][$postType])) { return null; } return $this->args['overload'][$postType]; }
[ "protected", "function", "getOverloaded", "(", "$", "postType", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "args", "[", "'overload'", "]", "[", "$", "postType", "]", ")", ")", "{", "return", "null", ";", "}", "return", "$", "this", ...
return the fake post type @param $postType @return null
[ "return", "the", "fake", "post", "type" ]
d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd
https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Support/Breadcrumb.php#L242-L250
205,712
fxpio/fxp-doctrine-console
Adapter/ServiceManagerAdapter.php
ServiceManagerAdapter.validate
private function validate($method) { $actionMethod = $method.'Method'; $ref = new \ReflectionClass($this->manager); if (null === $this->$actionMethod || !$ref->hasMethod($this->$actionMethod)) { throw new \RuntimeException(sprintf('The "%s" method for "%s" adapter is does not su...
php
private function validate($method) { $actionMethod = $method.'Method'; $ref = new \ReflectionClass($this->manager); if (null === $this->$actionMethod || !$ref->hasMethod($this->$actionMethod)) { throw new \RuntimeException(sprintf('The "%s" method for "%s" adapter is does not su...
[ "private", "function", "validate", "(", "$", "method", ")", "{", "$", "actionMethod", "=", "$", "method", ".", "'Method'", ";", "$", "ref", "=", "new", "\\", "ReflectionClass", "(", "$", "this", "->", "manager", ")", ";", "if", "(", "null", "===", "$...
Validate the adapter method. @param string $method The method name @throws \RuntimeException When the method does not supported
[ "Validate", "the", "adapter", "method", "." ]
2fc16d7a4eb0f247075c50de225ec2670ca5479a
https://github.com/fxpio/fxp-doctrine-console/blob/2fc16d7a4eb0f247075c50de225ec2670ca5479a/Adapter/ServiceManagerAdapter.php#L254-L262
205,713
fxpio/fxp-doctrine-console
Adapter/ServiceManagerAdapter.php
ServiceManagerAdapter.validateObject
public function validateObject($instance) { if (null !== $this->validator) { $violations = $this->validator->validate($instance); if (!empty($violations)) { throw new ValidationException($violations); } } }
php
public function validateObject($instance) { if (null !== $this->validator) { $violations = $this->validator->validate($instance); if (!empty($violations)) { throw new ValidationException($violations); } } }
[ "public", "function", "validateObject", "(", "$", "instance", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "validator", ")", "{", "$", "violations", "=", "$", "this", "->", "validator", "->", "validate", "(", "$", "instance", ")", ";", "if", ...
Validate the object instance. @param object $instance The object instance @throws ValidationException When an error exist
[ "Validate", "the", "object", "instance", "." ]
2fc16d7a4eb0f247075c50de225ec2670ca5479a
https://github.com/fxpio/fxp-doctrine-console/blob/2fc16d7a4eb0f247075c50de225ec2670ca5479a/Adapter/ServiceManagerAdapter.php#L271-L280
205,714
Fuzzyma/contao-eloquent-bundle
Hooks/DCAEloquentifier.php
DCAEloquentifier.relationFromField
public static function relationFromField($fieldName, $method = null) { if ($method) return $method; if (substr($fieldName, -3) == '_id') { return substr($fieldName, 0, -3); } if (substr($fieldName, -4) == '_ids') { return substr($fieldName, 0, -4) . 's'; ...
php
public static function relationFromField($fieldName, $method = null) { if ($method) return $method; if (substr($fieldName, -3) == '_id') { return substr($fieldName, 0, -3); } if (substr($fieldName, -4) == '_ids') { return substr($fieldName, 0, -4) . 's'; ...
[ "public", "static", "function", "relationFromField", "(", "$", "fieldName", ",", "$", "method", "=", "null", ")", "{", "if", "(", "$", "method", ")", "return", "$", "method", ";", "if", "(", "substr", "(", "$", "fieldName", ",", "-", "3", ")", "==", ...
Consider this as a bit of magic This method will return a "guessed" method name which is used from the relation Since there is no way in Eloquent to "read" the relations from a model, we have to work with what we get This method only does something when no method was set in the dca It takes one $field of the dca and r...
[ "Consider", "this", "as", "a", "bit", "of", "magic", "This", "method", "will", "return", "a", "guessed", "method", "name", "which", "is", "used", "from", "the", "relation", "Since", "there", "is", "no", "way", "in", "Eloquent", "to", "read", "the", "rela...
d5af2a3f48807db278ec3c92df463171f9514179
https://github.com/Fuzzyma/contao-eloquent-bundle/blob/d5af2a3f48807db278ec3c92df463171f9514179/Hooks/DCAEloquentifier.php#L270-L283
205,715
addwiki/guzzle-mediawiki-client
src/MediawikiApiClient.php
MediawikiApiClient.factory
public static function factory($config = array()) { $required = array('base_url'); $config = Collection::fromConfig($config, array(), $required); $client = new self($config->get('base_url')); $cookiePlugin = new CookiePlugin(new ArrayCookieJar()); $client->addSubscriber($co...
php
public static function factory($config = array()) { $required = array('base_url'); $config = Collection::fromConfig($config, array(), $required); $client = new self($config->get('base_url')); $cookiePlugin = new CookiePlugin(new ArrayCookieJar()); $client->addSubscriber($co...
[ "public", "static", "function", "factory", "(", "$", "config", "=", "array", "(", ")", ")", "{", "$", "required", "=", "array", "(", "'base_url'", ")", ";", "$", "config", "=", "Collection", "::", "fromConfig", "(", "$", "config", ",", "array", "(", ...
Factory method to create a new MediawikiApiClient @param array|Collection $config Configuration data. Array keys: base_url - Base URL of web service @throws InvalidArgumentException @return MediawikiApiClient
[ "Factory", "method", "to", "create", "a", "new", "MediawikiApiClient" ]
60dc2c27d40196f90d1e5eef8cf0fc90b6b4d440
https://github.com/addwiki/guzzle-mediawiki-client/blob/60dc2c27d40196f90d1e5eef8cf0fc90b6b4d440/src/MediawikiApiClient.php#L65-L80
205,716
rzajac/php-test-helper
src/Database/DbGet.php
DbGet.factory
public static function factory(array $dbConfig): DbItf { /** @var DbItf[] $instances */ static $instances = []; $key = md5(json_encode($dbConfig)); if (isset($instances[$key])) { return $instances[$key]; } switch ($dbConfig[DbItf::DB_CFG_DRIVER]) { ...
php
public static function factory(array $dbConfig): DbItf { /** @var DbItf[] $instances */ static $instances = []; $key = md5(json_encode($dbConfig)); if (isset($instances[$key])) { return $instances[$key]; } switch ($dbConfig[DbItf::DB_CFG_DRIVER]) { ...
[ "public", "static", "function", "factory", "(", "array", "$", "dbConfig", ")", ":", "DbItf", "{", "/** @var DbItf[] $instances */", "static", "$", "instances", "=", "[", "]", ";", "$", "key", "=", "md5", "(", "json_encode", "(", "$", "dbConfig", ")", ")", ...
Database factory. It returns the same instance for the same config. @param array $dbConfig The database configuration @throws DatabaseEx @return DbItf
[ "Database", "factory", "." ]
37280e9ff639b25cf9413909cc080c5d8deb311c
https://github.com/rzajac/php-test-helper/blob/37280e9ff639b25cf9413909cc080c5d8deb311c/src/Database/DbGet.php#L39-L67
205,717
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.calculateChangeSet
public function calculateChangeSet() { if (false === $this->isDirty()) { return []; } return [ 'old' => empty($this->original) ? null : $this->original, 'new' => empty($this->models) ? null : $this->models, ]; }
php
public function calculateChangeSet() { if (false === $this->isDirty()) { return []; } return [ 'old' => empty($this->original) ? null : $this->original, 'new' => empty($this->models) ? null : $this->models, ]; }
[ "public", "function", "calculateChangeSet", "(", ")", "{", "if", "(", "false", "===", "$", "this", "->", "isDirty", "(", ")", ")", "{", "return", "[", "]", ";", "}", "return", "[", "'old'", "=>", "empty", "(", "$", "this", "->", "original", ")", "?...
Calculates the change set of this collection. @return array
[ "Calculates", "the", "change", "set", "of", "this", "collection", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L105-L114
205,718
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.has
public function has(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->models[$key]); }
php
public function has(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->models[$key]); }
[ "public", "function", "has", "(", "AbstractModel", "$", "model", ")", "{", "$", "key", "=", "$", "model", "->", "getCompositeKey", "(", ")", ";", "return", "isset", "(", "$", "this", "->", "models", "[", "$", "key", "]", ")", ";", "}" ]
Determines if the Model is included in the collection. @param AbstractModel $model The model to check. @return bool
[ "Determines", "if", "the", "Model", "is", "included", "in", "the", "collection", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L184-L188
205,719
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.push
public function push(AbstractModel $model) { $this->validateAdd($model); if (true === $this->willAdd($model)) { return $this; } if (true === $this->willRemove($model)) { $this->evict('removed', $model); $this->set('models', $model); ret...
php
public function push(AbstractModel $model) { $this->validateAdd($model); if (true === $this->willAdd($model)) { return $this; } if (true === $this->willRemove($model)) { $this->evict('removed', $model); $this->set('models', $model); ret...
[ "public", "function", "push", "(", "AbstractModel", "$", "model", ")", "{", "$", "this", "->", "validateAdd", "(", "$", "model", ")", ";", "if", "(", "true", "===", "$", "this", "->", "willAdd", "(", "$", "model", ")", ")", "{", "return", "$", "thi...
Pushes a Model into the collection. @param AbstractModel $model The model to push. @return self
[ "Pushes", "a", "Model", "into", "the", "collection", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L257-L274
205,720
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.rollback
public function rollback() { $this->models = $this->original; $this->added = []; $this->removed = []; return $this; }
php
public function rollback() { $this->models = $this->original; $this->added = []; $this->removed = []; return $this; }
[ "public", "function", "rollback", "(", ")", "{", "$", "this", "->", "models", "=", "$", "this", "->", "original", ";", "$", "this", "->", "added", "=", "[", "]", ";", "$", "this", "->", "removed", "=", "[", "]", ";", "return", "$", "this", ";", ...
Rollsback the collection it it's original state. @return self
[ "Rollsback", "the", "collection", "it", "it", "s", "original", "state", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L315-L321
205,721
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.willAdd
public function willAdd(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->added[$key]); }
php
public function willAdd(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->added[$key]); }
[ "public", "function", "willAdd", "(", "AbstractModel", "$", "model", ")", "{", "$", "key", "=", "$", "model", "->", "getCompositeKey", "(", ")", ";", "return", "isset", "(", "$", "this", "->", "added", "[", "$", "key", "]", ")", ";", "}" ]
Determines if the model is scheduled for addition to the collection. @param AbstractModel $model The model to check. @return bool
[ "Determines", "if", "the", "model", "is", "scheduled", "for", "addition", "to", "the", "collection", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L337-L341
205,722
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.willRemove
public function willRemove(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->removed[$key]); }
php
public function willRemove(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->removed[$key]); }
[ "public", "function", "willRemove", "(", "AbstractModel", "$", "model", ")", "{", "$", "key", "=", "$", "model", "->", "getCompositeKey", "(", ")", ";", "return", "isset", "(", "$", "this", "->", "removed", "[", "$", "key", "]", ")", ";", "}" ]
Determines if the model is scheduled for removal from the collection. @param AbstractModel $model The model to check. @return bool
[ "Determines", "if", "the", "model", "is", "scheduled", "for", "removal", "from", "the", "collection", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L349-L353
205,723
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.add
protected function add(AbstractModel $model) { if (true === $this->has($model)) { return $this; } $this->validateAdd($model); if (true === $model->getState()->is('empty')) { $this->loaded = false; } $key = $model->getCompositeKey(); $t...
php
protected function add(AbstractModel $model) { if (true === $this->has($model)) { return $this; } $this->validateAdd($model); if (true === $model->getState()->is('empty')) { $this->loaded = false; } $key = $model->getCompositeKey(); $t...
[ "protected", "function", "add", "(", "AbstractModel", "$", "model", ")", "{", "if", "(", "true", "===", "$", "this", "->", "has", "(", "$", "model", ")", ")", "{", "return", "$", "this", ";", "}", "$", "this", "->", "validateAdd", "(", "$", "model"...
Adds an model to this collection. Is used during initial collection construction. @param AbstractModel $model @return self
[ "Adds", "an", "model", "to", "this", "collection", ".", "Is", "used", "during", "initial", "collection", "construction", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L362-L380
205,724
as3io/modlr
src/Models/Collections/AbstractCollection.php
AbstractCollection.hasOriginal
protected function hasOriginal(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->original[$key]); }
php
protected function hasOriginal(AbstractModel $model) { $key = $model->getCompositeKey(); return isset($this->original[$key]); }
[ "protected", "function", "hasOriginal", "(", "AbstractModel", "$", "model", ")", "{", "$", "key", "=", "$", "model", "->", "getCompositeKey", "(", ")", ";", "return", "isset", "(", "$", "this", "->", "original", "[", "$", "key", "]", ")", ";", "}" ]
Determines if the model is included in the original set. @param AbstractModel $model The model to check. @return bool
[ "Determines", "if", "the", "model", "is", "included", "in", "the", "original", "set", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/AbstractCollection.php#L413-L417
205,725
PhoxPHP/Glider
src/Connection/PlatformResolver.php
PlatformResolver.resolvePlatform
public function resolvePlatform(EventManager $eventManager) { $eventManager->attachSubscriber(new ConnectionAttemptSubscriber()); if (!$this->connectionManager instanceof ConnectionInterface) { throw new RuntimeException('Connection must implement \ConnectionInterface'); } $reflector = new \ReflectionClas...
php
public function resolvePlatform(EventManager $eventManager) { $eventManager->attachSubscriber(new ConnectionAttemptSubscriber()); if (!$this->connectionManager instanceof ConnectionInterface) { throw new RuntimeException('Connection must implement \ConnectionInterface'); } $reflector = new \ReflectionClas...
[ "public", "function", "resolvePlatform", "(", "EventManager", "$", "eventManager", ")", "{", "$", "eventManager", "->", "attachSubscriber", "(", "new", "ConnectionAttemptSubscriber", "(", ")", ")", ";", "if", "(", "!", "$", "this", "->", "connectionManager", "in...
Resolve provided connection's platform. @param $eventManager <Kit\Glider\Events\EventManager> @access public @return <Object> <Kit\Glider\Platform\Contract\PlatformProvider>
[ "Resolve", "provided", "connection", "s", "platform", "." ]
17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042
https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Connection/PlatformResolver.php#L89-L116
205,726
PhoxPHP/Glider
src/Connection/PlatformResolver.php
PlatformResolver.getPlatformProvider
private function getPlatformProvider($platform=[], EventManager $eventManager) { if (is_null($platform)) { return false; } $platformId = key($platform); $platform = current($platform); if (!isset($platform['provider'])) { $this->connectionFailed = ':noPlatform'; return false; } $provider = $p...
php
private function getPlatformProvider($platform=[], EventManager $eventManager) { if (is_null($platform)) { return false; } $platformId = key($platform); $platform = current($platform); if (!isset($platform['provider'])) { $this->connectionFailed = ':noPlatform'; return false; } $provider = $p...
[ "private", "function", "getPlatformProvider", "(", "$", "platform", "=", "[", "]", ",", "EventManager", "$", "eventManager", ")", "{", "if", "(", "is_null", "(", "$", "platform", ")", ")", "{", "return", "false", ";", "}", "$", "platformId", "=", "key", ...
Resolves a connector's provider and returns it's object. @param $eventManager <Kit\Glider\Events\EventManager > @param $platform <Array> @access private @return <Mixed>
[ "Resolves", "a", "connector", "s", "provider", "and", "returns", "it", "s", "object", "." ]
17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042
https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Connection/PlatformResolver.php#L126-L159
205,727
axypro/codecs-base64vlq
Base64.php
Base64.encode
public function encode($numbers) { $chars = []; $alphabet = $this->alphabet; foreach ($numbers as $number) { if (isset($alphabet[$number])) { $chars[] = $alphabet[$number]; } else { throw new InvalidBase64Input($number); } ...
php
public function encode($numbers) { $chars = []; $alphabet = $this->alphabet; foreach ($numbers as $number) { if (isset($alphabet[$number])) { $chars[] = $alphabet[$number]; } else { throw new InvalidBase64Input($number); } ...
[ "public", "function", "encode", "(", "$", "numbers", ")", "{", "$", "chars", "=", "[", "]", ";", "$", "alphabet", "=", "$", "this", "->", "alphabet", ";", "foreach", "(", "$", "numbers", "as", "$", "number", ")", "{", "if", "(", "isset", "(", "$"...
Encodes a block of numbers to a base64-string @param int[]|int $numbers @return string @throws \axy\codecs\base64vlq\errors\InvalidBase64Input
[ "Encodes", "a", "block", "of", "numbers", "to", "a", "base64", "-", "string" ]
0d658b7fafdabb824fa1c91c0f6977ebac707dad
https://github.com/axypro/codecs-base64vlq/blob/0d658b7fafdabb824fa1c91c0f6977ebac707dad/Base64.php#L44-L56
205,728
axypro/codecs-base64vlq
Base64.php
Base64.decode
public function decode($based) { if (!is_array($based)) { $based = str_split($based); } $numbers = []; $char2int = $this->char2int; foreach ($based as $char) { if (isset($char2int[$char])) { $numbers[] = $char2int[$char]; } ...
php
public function decode($based) { if (!is_array($based)) { $based = str_split($based); } $numbers = []; $char2int = $this->char2int; foreach ($based as $char) { if (isset($char2int[$char])) { $numbers[] = $char2int[$char]; } ...
[ "public", "function", "decode", "(", "$", "based", ")", "{", "if", "(", "!", "is_array", "(", "$", "based", ")", ")", "{", "$", "based", "=", "str_split", "(", "$", "based", ")", ";", "}", "$", "numbers", "=", "[", "]", ";", "$", "char2int", "=...
Decodes a base64-string to a block of numbers @param string|string[] $based the base64-string or the array of characters @return int[] @throws \axy\codecs\base64vlq\errors\InvalidBase64
[ "Decodes", "a", "base64", "-", "string", "to", "a", "block", "of", "numbers" ]
0d658b7fafdabb824fa1c91c0f6977ebac707dad
https://github.com/axypro/codecs-base64vlq/blob/0d658b7fafdabb824fa1c91c0f6977ebac707dad/Base64.php#L66-L81
205,729
pascalchevrel/vcs
src/VCS/Base.php
Base.parseLog
public function parseLog($log) { $commits = $tags = []; for ($i = 0, $lines = count($log); $i < $lines; $i++) { $tmp = explode(': ', $log[$i]); $tmp = array_map('trim', $tmp); if ($tmp[0] == 'changeset') { $commit = $tmp[1]; } ...
php
public function parseLog($log) { $commits = $tags = []; for ($i = 0, $lines = count($log); $i < $lines; $i++) { $tmp = explode(': ', $log[$i]); $tmp = array_map('trim', $tmp); if ($tmp[0] == 'changeset') { $commit = $tmp[1]; } ...
[ "public", "function", "parseLog", "(", "$", "log", ")", "{", "$", "commits", "=", "$", "tags", "=", "[", "]", ";", "for", "(", "$", "i", "=", "0", ",", "$", "lines", "=", "count", "(", "$", "log", ")", ";", "$", "i", "<", "$", "lines", ";",...
Parse the log provided as a string @param string $log VCS log @return array structured data extracted from the log
[ "Parse", "the", "log", "provided", "as", "a", "string" ]
23d4827d5f8f44f20cd9a59fdf71ee7dfc895bfa
https://github.com/pascalchevrel/vcs/blob/23d4827d5f8f44f20cd9a59fdf71ee7dfc895bfa/src/VCS/Base.php#L33-L73
205,730
pascalchevrel/vcs
src/VCS/Base.php
Base.extractAuthor
public function extractAuthor($string) { preg_match_all('/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i', $string, $matches); $string = str_replace($matches[0], '', $string); $string = str_replace(['<', '>', '()'], '', $string); $string = trim($string); return empty($string) ? 'Unknow...
php
public function extractAuthor($string) { preg_match_all('/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i', $string, $matches); $string = str_replace($matches[0], '', $string); $string = str_replace(['<', '>', '()'], '', $string); $string = trim($string); return empty($string) ? 'Unknow...
[ "public", "function", "extractAuthor", "(", "$", "string", ")", "{", "preg_match_all", "(", "'/[\\._a-zA-Z0-9-]+@[\\._a-zA-Z0-9-]+/i'", ",", "$", "string", ",", "$", "matches", ")", ";", "$", "string", "=", "str_replace", "(", "$", "matches", "[", "0", "]", ...
Extract the Author name from the string, remove emails if they exist @param string $string String to analyze @return string Author name
[ "Extract", "the", "Author", "name", "from", "the", "string", "remove", "emails", "if", "they", "exist" ]
23d4827d5f8f44f20cd9a59fdf71ee7dfc895bfa
https://github.com/pascalchevrel/vcs/blob/23d4827d5f8f44f20cd9a59fdf71ee7dfc895bfa/src/VCS/Base.php#L95-L103
205,731
schpill/thin
src/Html/Sizer.php
Sizer.save
public function save($savePath, $imageQuality = 95) { // If the image wasn't resized, fetch original image. if (!$this->imageResized) { $this->imageResized = $this->image; } // Get extension of the output file. $extension = Inflector::...
php
public function save($savePath, $imageQuality = 95) { // If the image wasn't resized, fetch original image. if (!$this->imageResized) { $this->imageResized = $this->image; } // Get extension of the output file. $extension = Inflector::...
[ "public", "function", "save", "(", "$", "savePath", ",", "$", "imageQuality", "=", "95", ")", "{", "// If the image wasn't resized, fetch original image.", "if", "(", "!", "$", "this", "->", "imageResized", ")", "{", "$", "this", "->", "imageResized", "=", "$"...
Save the image based on its file type. @param string $savePath Where to save the image @param int $imageQuality The output quality of the image @return boolean
[ "Save", "the", "image", "based", "on", "its", "file", "type", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Sizer.php#L130-L177
205,732
schpill/thin
src/Html/Sizer.php
Sizer.get_dimensions
private function get_dimensions($newWidth, $newHeight, $option) { switch ($option) { case 'exact': $optimalWidth = $newWidth; $optimalHeight = $newHeight; break; case 'portrait': $optimal...
php
private function get_dimensions($newWidth, $newHeight, $option) { switch ($option) { case 'exact': $optimalWidth = $newWidth; $optimalHeight = $newHeight; break; case 'portrait': $optimal...
[ "private", "function", "get_dimensions", "(", "$", "newWidth", ",", "$", "newHeight", ",", "$", "option", ")", "{", "switch", "(", "$", "option", ")", "{", "case", "'exact'", ":", "$", "optimalWidth", "=", "$", "newWidth", ";", "$", "optimalHeight", "=",...
Return the image dimensions based on the option that was chosen. @param int $newWidth The width of the image @param int $newHeight The height of the image @param string $option Either exact, portrait, landscape, auto or crop. @return array
[ "Return", "the", "image", "dimensions", "based", "on", "the", "option", "that", "was", "chosen", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Sizer.php#L222-L258
205,733
schpill/thin
src/Html/Sizer.php
Sizer.getCropPoints
private function getCropPoints($optimalWidth, $optimalHeight, $newWidth, $newHeight) { $cropPoints = array(); $vertical_start = arrayGet($this->config, 'crop_vertical_start_point'); $horizontal_start = arrayGet($this->config, 'crop_horizontal_start_point'); // W...
php
private function getCropPoints($optimalWidth, $optimalHeight, $newWidth, $newHeight) { $cropPoints = array(); $vertical_start = arrayGet($this->config, 'crop_vertical_start_point'); $horizontal_start = arrayGet($this->config, 'crop_horizontal_start_point'); // W...
[ "private", "function", "getCropPoints", "(", "$", "optimalWidth", ",", "$", "optimalHeight", ",", "$", "newWidth", ",", "$", "newHeight", ")", "{", "$", "cropPoints", "=", "array", "(", ")", ";", "$", "vertical_start", "=", "arrayGet", "(", "$", "this", ...
Gets the crop points based on the configuration either set in the file or overridden by user in their own config file, or on the fly. @param int $optimalWidth The width of the image @param int $optimalHeight The height of the image @param int $newWidth The new width @param int $newHeight The n...
[ "Gets", "the", "crop", "points", "based", "on", "the", "configuration", "either", "set", "in", "the", "file", "or", "overridden", "by", "user", "in", "their", "own", "config", "file", "or", "on", "the", "fly", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Sizer.php#L430-L472
205,734
theloopyewe/ravelry-api.php
src/RavelryApi/TypeConversion.php
TypeConversion.toRavelryPostFile
public static function toRavelryPostFile($value, Parameter $parameter) { if (is_string($value)) { $value = fopen($value, 'r'); } if (!($value instanceof StreamInterface)) { $value = \GuzzleHttp\Stream\create($value); } if ($value instanceof MetadataS...
php
public static function toRavelryPostFile($value, Parameter $parameter) { if (is_string($value)) { $value = fopen($value, 'r'); } if (!($value instanceof StreamInterface)) { $value = \GuzzleHttp\Stream\create($value); } if ($value instanceof MetadataS...
[ "public", "static", "function", "toRavelryPostFile", "(", "$", "value", ",", "Parameter", "$", "parameter", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "$", "value", "=", "fopen", "(", "$", "value", ",", "'r'", ")", ";", "}", ...
This is duplicating logic from `GuzzleHttp\Post\PostFile` in order to patch odd API server behavior. It also makes sure the value is a proper stream reference. See http://www.ravelry.com/discuss/ravelry-api/2936052/1-25#5
[ "This", "is", "duplicating", "logic", "from", "GuzzleHttp", "\\", "Post", "\\", "PostFile", "in", "order", "to", "patch", "odd", "API", "server", "behavior", ".", "It", "also", "makes", "sure", "the", "value", "is", "a", "proper", "stream", "reference", "....
4dacae056e15cf5fd4e236b79843d0736db1e885
https://github.com/theloopyewe/ravelry-api.php/blob/4dacae056e15cf5fd4e236b79843d0736db1e885/src/RavelryApi/TypeConversion.php#L108-L138
205,735
bruno-barros/w.eloquent-framework
src/weloquent/Support/TaxonomyTrait.php
TaxonomyTrait.getPostType
public function getPostType() { global $wp_query; if(isset($wp_query->post) && $wp_query->post->post_type) { return $wp_query->post->post_type; } if (isset($wp_query->query) && isset($wp_query->query['post_type'])) { return $wp_query->query['post_type']; } else if(isset($wp_query->query_vars) &&...
php
public function getPostType() { global $wp_query; if(isset($wp_query->post) && $wp_query->post->post_type) { return $wp_query->post->post_type; } if (isset($wp_query->query) && isset($wp_query->query['post_type'])) { return $wp_query->query['post_type']; } else if(isset($wp_query->query_vars) &&...
[ "public", "function", "getPostType", "(", ")", "{", "global", "$", "wp_query", ";", "if", "(", "isset", "(", "$", "wp_query", "->", "post", ")", "&&", "$", "wp_query", "->", "post", "->", "post_type", ")", "{", "return", "$", "wp_query", "->", "post", ...
Return the post type slug if available @return bool|string
[ "Return", "the", "post", "type", "slug", "if", "available" ]
d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd
https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Support/TaxonomyTrait.php#L17-L35
205,736
bruno-barros/w.eloquent-framework
src/weloquent/Support/TaxonomyTrait.php
TaxonomyTrait.getTax
public function getTax() { global $wp_query; if (isset($wp_query->tax_query) && !empty($wp_query->tax_query)) { return reset($wp_query->tax_query->queries)['taxonomy']; } return false; }
php
public function getTax() { global $wp_query; if (isset($wp_query->tax_query) && !empty($wp_query->tax_query)) { return reset($wp_query->tax_query->queries)['taxonomy']; } return false; }
[ "public", "function", "getTax", "(", ")", "{", "global", "$", "wp_query", ";", "if", "(", "isset", "(", "$", "wp_query", "->", "tax_query", ")", "&&", "!", "empty", "(", "$", "wp_query", "->", "tax_query", ")", ")", "{", "return", "reset", "(", "$", ...
Return the taxonomy slug if available @return bool|mixed
[ "Return", "the", "taxonomy", "slug", "if", "available" ]
d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd
https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Support/TaxonomyTrait.php#L42-L52
205,737
bruno-barros/w.eloquent-framework
src/weloquent/Support/TaxonomyTrait.php
TaxonomyTrait.getTerm
public function getTerm() { global $wp_query; if (isset($wp_query->tax_query) && !empty($wp_query->tax_query)) { $first = reset($wp_query->tax_query->queries); return is_array($first) ? reset($first['terms']) : false; } return false; }
php
public function getTerm() { global $wp_query; if (isset($wp_query->tax_query) && !empty($wp_query->tax_query)) { $first = reset($wp_query->tax_query->queries); return is_array($first) ? reset($first['terms']) : false; } return false; }
[ "public", "function", "getTerm", "(", ")", "{", "global", "$", "wp_query", ";", "if", "(", "isset", "(", "$", "wp_query", "->", "tax_query", ")", "&&", "!", "empty", "(", "$", "wp_query", "->", "tax_query", ")", ")", "{", "$", "first", "=", "reset", ...
Return the taxonomy term if available @return bool|mixed
[ "Return", "the", "taxonomy", "term", "if", "available" ]
d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd
https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Support/TaxonomyTrait.php#L59-L70
205,738
inhere/php-library-plus
libs/Network/Telnet.php
Telnet.watch
public function watch($command, $interval = 500) { $count = 0; $activeTime = time(); $maxTime = (int)$this->config['max_watch_time']; $intervalUs = $interval * 1000; //echo "watch command: $command, refresh interval: {$interval}ms\n"; while (true) { $cou...
php
public function watch($command, $interval = 500) { $count = 0; $activeTime = time(); $maxTime = (int)$this->config['max_watch_time']; $intervalUs = $interval * 1000; //echo "watch command: $command, refresh interval: {$interval}ms\n"; while (true) { $cou...
[ "public", "function", "watch", "(", "$", "command", ",", "$", "interval", "=", "500", ")", "{", "$", "count", "=", "0", ";", "$", "activeTime", "=", "time", "(", ")", ";", "$", "maxTime", "=", "(", "int", ")", "$", "this", "->", "config", "[", ...
watch a command @param string $command @param integer $interval (ms)
[ "watch", "a", "command" ]
8604e037937d31fa2338d79aaf9d0910cb48f559
https://github.com/inhere/php-library-plus/blob/8604e037937d31fa2338d79aaf9d0910cb48f559/libs/Network/Telnet.php#L179-L210
205,739
inhere/php-library-plus
libs/Network/Telnet.php
Telnet.interactive
public function interactive() { echo "welcome! please input command('quit' or 'exit' to Quit).\n "; while (true) { echo '> '; if ($cmd = trim(fgets(\STDIN))) { // echo "input command: $cmd\n"; if ($cmd === 'quit' || $cmd === 'exit') { ...
php
public function interactive() { echo "welcome! please input command('quit' or 'exit' to Quit).\n "; while (true) { echo '> '; if ($cmd = trim(fgets(\STDIN))) { // echo "input command: $cmd\n"; if ($cmd === 'quit' || $cmd === 'exit') { ...
[ "public", "function", "interactive", "(", ")", "{", "echo", "\"welcome! please input command('quit' or 'exit' to Quit).\\n \"", ";", "while", "(", "true", ")", "{", "echo", "'> '", ";", "if", "(", "$", "cmd", "=", "trim", "(", "fgets", "(", "\\", "STDIN", ")",...
into interactive environment
[ "into", "interactive", "environment" ]
8604e037937d31fa2338d79aaf9d0910cb48f559
https://github.com/inhere/php-library-plus/blob/8604e037937d31fa2338d79aaf9d0910cb48f559/libs/Network/Telnet.php#L215-L235
205,740
thelia-modules/SmartyFilter
Model/Base/SmartyFilterI18n.php
SmartyFilterI18n.setSmartyFilter
public function setSmartyFilter(ChildSmartyFilter $v = null) { if ($v === null) { $this->setId(null); } else { $this->setId($v->getId()); } $this->aSmartyFilter = $v; // Add binding for other direction of this n:n relationship. // If this obj...
php
public function setSmartyFilter(ChildSmartyFilter $v = null) { if ($v === null) { $this->setId(null); } else { $this->setId($v->getId()); } $this->aSmartyFilter = $v; // Add binding for other direction of this n:n relationship. // If this obj...
[ "public", "function", "setSmartyFilter", "(", "ChildSmartyFilter", "$", "v", "=", "null", ")", "{", "if", "(", "$", "v", "===", "null", ")", "{", "$", "this", "->", "setId", "(", "null", ")", ";", "}", "else", "{", "$", "this", "->", "setId", "(", ...
Declares an association between this object and a ChildSmartyFilter object. @param ChildSmartyFilter $v @return \SmartyFilter\Model\SmartyFilterI18n The current object (for fluent API support) @throws PropelException
[ "Declares", "an", "association", "between", "this", "object", "and", "a", "ChildSmartyFilter", "object", "." ]
e510d281f51ddc4344e563d0f6aaa192fa7171e9
https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterI18n.php#L1127-L1145
205,741
thelia-modules/SmartyFilter
Model/Base/SmartyFilterI18n.php
SmartyFilterI18n.getSmartyFilter
public function getSmartyFilter(ConnectionInterface $con = null) { if ($this->aSmartyFilter === null && ($this->id !== null)) { $this->aSmartyFilter = ChildSmartyFilterQuery::create()->findPk($this->id, $con); /* The following can be used additionally to guarantee the...
php
public function getSmartyFilter(ConnectionInterface $con = null) { if ($this->aSmartyFilter === null && ($this->id !== null)) { $this->aSmartyFilter = ChildSmartyFilterQuery::create()->findPk($this->id, $con); /* The following can be used additionally to guarantee the...
[ "public", "function", "getSmartyFilter", "(", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "$", "this", "->", "aSmartyFilter", "===", "null", "&&", "(", "$", "this", "->", "id", "!==", "null", ")", ")", "{", "$", "this", "->", ...
Get the associated ChildSmartyFilter object @param ConnectionInterface $con Optional Connection object. @return ChildSmartyFilter The associated ChildSmartyFilter object. @throws PropelException
[ "Get", "the", "associated", "ChildSmartyFilter", "object" ]
e510d281f51ddc4344e563d0f6aaa192fa7171e9
https://github.com/thelia-modules/SmartyFilter/blob/e510d281f51ddc4344e563d0f6aaa192fa7171e9/Model/Base/SmartyFilterI18n.php#L1155-L1169
205,742
cityware/city-format
src/Date.php
Date.getMonthsRange
public static function getMonthsRange($startData, $endDate) { $time1 = strtotime($startData); //absolute date comparison needs to be done here, because PHP doesn't do date comparisons $time2 = strtotime($endDate); //$my1 = date('mY', $time1); //need these to compare dates at 'month' granularity ...
php
public static function getMonthsRange($startData, $endDate) { $time1 = strtotime($startData); //absolute date comparison needs to be done here, because PHP doesn't do date comparisons $time2 = strtotime($endDate); //$my1 = date('mY', $time1); //need these to compare dates at 'month' granularity ...
[ "public", "static", "function", "getMonthsRange", "(", "$", "startData", ",", "$", "endDate", ")", "{", "$", "time1", "=", "strtotime", "(", "$", "startData", ")", ";", "//absolute date comparison needs to be done here, because PHP doesn't do date comparisons", "$", "ti...
Cria um intervalo de Meses de acordo com a data inicial e final @param date $startData @param date $endDate @return array
[ "Cria", "um", "intervalo", "de", "Meses", "de", "acordo", "com", "a", "data", "inicial", "e", "final" ]
1e292670639a950ecf561b545462427512950c74
https://github.com/cityware/city-format/blob/1e292670639a950ecf561b545462427512950c74/src/Date.php#L217-L240
205,743
WolfMicrosystems/ldap
src/WMS/Library/Ldap/Collection/AccountNodeCollection.php
AccountNodeCollection.createEntry
protected function createEntry(array $data) { return Entity\AccountNode::fromNode(parent::createEntry($data), $this->getConnection()->getConfiguration()); }
php
protected function createEntry(array $data) { return Entity\AccountNode::fromNode(parent::createEntry($data), $this->getConnection()->getConfiguration()); }
[ "protected", "function", "createEntry", "(", "array", "$", "data", ")", "{", "return", "Entity", "\\", "AccountNode", "::", "fromNode", "(", "parent", "::", "createEntry", "(", "$", "data", ")", ",", "$", "this", "->", "getConnection", "(", ")", "->", "g...
Creates the data structure for the given entry data @param array $data @return Entity\AccountNode
[ "Creates", "the", "data", "structure", "for", "the", "given", "entry", "data" ]
872bbdc6127a41f0c51f2aa73425b8063a5c8148
https://github.com/WolfMicrosystems/ldap/blob/872bbdc6127a41f0c51f2aa73425b8063a5c8148/src/WMS/Library/Ldap/Collection/AccountNodeCollection.php#L22-L25
205,744
xiewulong/yii2-wechat
Manager.php
Manager.sendTemplateMessageByType
public function sendTemplateMessageByType($touser, $type, $data, $url = null) { return isset($this->templates[$type]) && $this->sendTemplateMessage($touser, $this->templates[$type], $data, $url); }
php
public function sendTemplateMessageByType($touser, $type, $data, $url = null) { return isset($this->templates[$type]) && $this->sendTemplateMessage($touser, $this->templates[$type], $data, $url); }
[ "public", "function", "sendTemplateMessageByType", "(", "$", "touser", ",", "$", "type", ",", "$", "data", ",", "$", "url", "=", "null", ")", "{", "return", "isset", "(", "$", "this", "->", "templates", "[", "$", "type", "]", ")", "&&", "$", "this", ...
Send template by type @since 0.0.1 @param {string} $touser openid @param {string} $type @param {array} $data @param {string} [$url] @return {boolean} @example \Yii::$app->wechat->sendTemplateMessageByType($touser, $type, $data, $url);
[ "Send", "template", "by", "type" ]
e7a209072c9d16bd6ec8d51808439f806c3e56a2
https://github.com/xiewulong/yii2-wechat/blob/e7a209072c9d16bd6ec8d51808439f806c3e56a2/Manager.php#L93-L95
205,745
xiewulong/yii2-wechat
Manager.php
Manager.setTemplateIndustry
public function setTemplateIndustry($industry_id1, $industry_id2) { $data = $this->getData('/cgi-bin/template/api_set_industry', [ 'access_token' => $this->getAccessToken(), ], Json::encode([ 'industry_id1' => $industry_id1, 'industry_id2' => $industry_id2, ])); return $this->errcode == 0; }
php
public function setTemplateIndustry($industry_id1, $industry_id2) { $data = $this->getData('/cgi-bin/template/api_set_industry', [ 'access_token' => $this->getAccessToken(), ], Json::encode([ 'industry_id1' => $industry_id1, 'industry_id2' => $industry_id2, ])); return $this->errcode == 0; }
[ "public", "function", "setTemplateIndustry", "(", "$", "industry_id1", ",", "$", "industry_id2", ")", "{", "$", "data", "=", "$", "this", "->", "getData", "(", "'/cgi-bin/template/api_set_industry'", ",", "[", "'access_token'", "=>", "$", "this", "->", "getAcces...
Set template industry @since 0.0.1 @param {integer} $industry_id1 primary @param {integer} $industry_id2 secondary @return {boolean} @example \Yii::$app->wechat->setTemplateIndustry($industry_id1, $industry_id2);
[ "Set", "template", "industry" ]
e7a209072c9d16bd6ec8d51808439f806c3e56a2
https://github.com/xiewulong/yii2-wechat/blob/e7a209072c9d16bd6ec8d51808439f806c3e56a2/Manager.php#L208-L217
205,746
oscarpalmer/shelf
src/oscarpalmer/Shelf/Blob.php
Blob.delete
public function delete($key) : Blob { if ($this->offsetExists($key)) { $this->offsetUnset($key); } return $this; }
php
public function delete($key) : Blob { if ($this->offsetExists($key)) { $this->offsetUnset($key); } return $this; }
[ "public", "function", "delete", "(", "$", "key", ")", ":", "Blob", "{", "if", "(", "$", "this", "->", "offsetExists", "(", "$", "key", ")", ")", "{", "$", "this", "->", "offsetUnset", "(", "$", "key", ")", ";", "}", "return", "$", "this", ";", ...
Delete value for key in Blob. @param mixed $key Key to delete. @return Blob Blob object for optional chaining.
[ "Delete", "value", "for", "key", "in", "Blob", "." ]
47bccf7fd8f1750defe1f2805480a6721f1a0e79
https://github.com/oscarpalmer/shelf/blob/47bccf7fd8f1750defe1f2805480a6721f1a0e79/src/oscarpalmer/Shelf/Blob.php#L28-L35
205,747
as3io/symfony-data-importer
src/Console/Import.php
Import.doCommandImportSetUp
final protected function doCommandImportSetUp() { $this->writeln('Executing <info>setup</info> tasks', true); // $this->updateSchema(); $this->importManager->setUp(); $this->writeln('Startup tasks complete.', true, true); }
php
final protected function doCommandImportSetUp() { $this->writeln('Executing <info>setup</info> tasks', true); // $this->updateSchema(); $this->importManager->setUp(); $this->writeln('Startup tasks complete.', true, true); }
[ "final", "protected", "function", "doCommandImportSetUp", "(", ")", "{", "$", "this", "->", "writeln", "(", "'Executing <info>setup</info> tasks'", ",", "true", ")", ";", "// $this->updateSchema();", "$", "this", "->", "importManager", "->", "setUp", "(", ")", ";"...
Performs startup tasks
[ "Performs", "startup", "tasks" ]
33383e38f20f6b7a4b83da619bd028ac84ced579
https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Console/Import.php#L247-L255
205,748
as3io/symfony-data-importer
src/Console/Import.php
Import.doCommandImport
final protected function doCommandImport() { $this->writeln('Starting Import', true, true); $this->indent(); foreach ($this->importManager->getConfiguration()->getSegments() as $segment) { $this->importSegment($segment); } $this->outdent(); $this->writel...
php
final protected function doCommandImport() { $this->writeln('Starting Import', true, true); $this->indent(); foreach ($this->importManager->getConfiguration()->getSegments() as $segment) { $this->importSegment($segment); } $this->outdent(); $this->writel...
[ "final", "protected", "function", "doCommandImport", "(", ")", "{", "$", "this", "->", "writeln", "(", "'Starting Import'", ",", "true", ",", "true", ")", ";", "$", "this", "->", "indent", "(", ")", ";", "foreach", "(", "$", "this", "->", "importManager"...
The main import loop
[ "The", "main", "import", "loop" ]
33383e38f20f6b7a4b83da619bd028ac84ced579
https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Console/Import.php#L260-L271
205,749
as3io/symfony-data-importer
src/Console/Import.php
Import.doCommandImportTearDown
final protected function doCommandImportTearDown() { $this->writeln('Executing <info>teardown</info> tasks', false, true); $this->indent(); $this->subscriberPass(); $this->outdent(); $this->writeln('Teardown tasks complete.', false, true); }
php
final protected function doCommandImportTearDown() { $this->writeln('Executing <info>teardown</info> tasks', false, true); $this->indent(); $this->subscriberPass(); $this->outdent(); $this->writeln('Teardown tasks complete.', false, true); }
[ "final", "protected", "function", "doCommandImportTearDown", "(", ")", "{", "$", "this", "->", "writeln", "(", "'Executing <info>teardown</info> tasks'", ",", "false", ",", "true", ")", ";", "$", "this", "->", "indent", "(", ")", ";", "$", "this", "->", "sub...
Performs teardown tasks
[ "Performs", "teardown", "tasks" ]
33383e38f20f6b7a4b83da619bd028ac84ced579
https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Console/Import.php#L276-L285
205,750
iron-bound-designs/wp-notifications
src/Template/Manager.php
Manager.listen
public function listen( Listener $listener ) { if ( isset( $this->listeners[ $listener->get_tag() ] ) ) { return false; } $this->listeners[ $listener->get_tag() ] = $listener; return true; }
php
public function listen( Listener $listener ) { if ( isset( $this->listeners[ $listener->get_tag() ] ) ) { return false; } $this->listeners[ $listener->get_tag() ] = $listener; return true; }
[ "public", "function", "listen", "(", "Listener", "$", "listener", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "listeners", "[", "$", "listener", "->", "get_tag", "(", ")", "]", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->"...
Listen for a template tag. @since 1.0 @param Listener $listener @return bool
[ "Listen", "for", "a", "template", "tag", "." ]
4fdf67d28d194576d35f86245b2f539c4815cde2
https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Template/Manager.php#L50-L59
205,751
iron-bound-designs/wp-notifications
src/Template/Manager.php
Manager.get_listener
public function get_listener( $tag ) { return isset( $this->listeners[ $tag ] ) ? $this->listeners[ $tag ] : new Null_Listener(); }
php
public function get_listener( $tag ) { return isset( $this->listeners[ $tag ] ) ? $this->listeners[ $tag ] : new Null_Listener(); }
[ "public", "function", "get_listener", "(", "$", "tag", ")", "{", "return", "isset", "(", "$", "this", "->", "listeners", "[", "$", "tag", "]", ")", "?", "$", "this", "->", "listeners", "[", "$", "tag", "]", ":", "new", "Null_Listener", "(", ")", ";...
Get a listener for a certain tag. @param string $tag @return Listener|Null_Listener Null Listener is returned if listener for given tag does not exist.
[ "Get", "a", "listener", "for", "a", "certain", "tag", "." ]
4fdf67d28d194576d35f86245b2f539c4815cde2
https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Template/Manager.php#L68-L70
205,752
iron-bound-designs/wp-notifications
src/Template/Manager.php
Manager.render_tags
public function render_tags( array $data_sources ) { $replaced = array(); foreach ( $this->get_listeners() as $tag => $listener ) { $params = $listener->get_callback_reflection()->getParameters(); $args = array(); foreach ( $params as $param ) { $found = false; foreach ( $data_sources as $na...
php
public function render_tags( array $data_sources ) { $replaced = array(); foreach ( $this->get_listeners() as $tag => $listener ) { $params = $listener->get_callback_reflection()->getParameters(); $args = array(); foreach ( $params as $param ) { $found = false; foreach ( $data_sources as $na...
[ "public", "function", "render_tags", "(", "array", "$", "data_sources", ")", "{", "$", "replaced", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "get_listeners", "(", ")", "as", "$", "tag", "=>", "$", "listener", ")", "{", "$", "par...
Return an array of the rendered tags. @since 1.0 @param array $data_sources @return array @throws \BadMethodCallException
[ "Return", "an", "array", "of", "the", "rendered", "tags", "." ]
4fdf67d28d194576d35f86245b2f539c4815cde2
https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Template/Manager.php#L107-L159
205,753
jelix/file-utilities
lib/Directory.php
Directory.create
public static function create($dir, $chmod = null) { if (!file_exists($dir)) { if ($chmod === null) { $chmod = self::$defaultChmod; } mkdir($dir, $chmod, true); // php mkdir apply umask on the given mode, so we must to // do a chmod...
php
public static function create($dir, $chmod = null) { if (!file_exists($dir)) { if ($chmod === null) { $chmod = self::$defaultChmod; } mkdir($dir, $chmod, true); // php mkdir apply umask on the given mode, so we must to // do a chmod...
[ "public", "static", "function", "create", "(", "$", "dir", ",", "$", "chmod", "=", "null", ")", "{", "if", "(", "!", "file_exists", "(", "$", "dir", ")", ")", "{", "if", "(", "$", "chmod", "===", "null", ")", "{", "$", "chmod", "=", "self", "::...
create a directory. @return bool false if the directory did already exist
[ "create", "a", "directory", "." ]
05fd364860ed147e6367de9db3dc544f58c5a05c
https://github.com/jelix/file-utilities/blob/05fd364860ed147e6367de9db3dc544f58c5a05c/lib/Directory.php#L26-L40
205,754
jelix/file-utilities
lib/Directory.php
Directory.remove
public static function remove($path, $deleteDir = true) { // minimum security check if ($path == '' || $path == '/' || $path == DIRECTORY_SEPARATOR) { throw new \InvalidArgumentException('The root cannot be removed !!'); } if (!file_exists($path)) { return tr...
php
public static function remove($path, $deleteDir = true) { // minimum security check if ($path == '' || $path == '/' || $path == DIRECTORY_SEPARATOR) { throw new \InvalidArgumentException('The root cannot be removed !!'); } if (!file_exists($path)) { return tr...
[ "public", "static", "function", "remove", "(", "$", "path", ",", "$", "deleteDir", "=", "true", ")", "{", "// minimum security check", "if", "(", "$", "path", "==", "''", "||", "$", "path", "==", "'/'", "||", "$", "path", "==", "DIRECTORY_SEPARATOR", ")"...
Recursive function deleting a directory. @param string $path The path of the directory to remove recursively @param bool $deleteDir If the path must be deleted too @author Loic Mathaud
[ "Recursive", "function", "deleting", "a", "directory", "." ]
05fd364860ed147e6367de9db3dc544f58c5a05c
https://github.com/jelix/file-utilities/blob/05fd364860ed147e6367de9db3dc544f58c5a05c/lib/Directory.php#L50-L80
205,755
jelix/file-utilities
lib/Directory.php
Directory.removeExcept
public static function removeExcept($path, $except, $deleteDir = true) { if (!is_array($except) || !count($except)) { throw new \InvalidArgumentException('list of exception is not an array or is empty'); } if ($path == '' || $path == '/' || $path == DIRECTORY_SEPARATOR) { ...
php
public static function removeExcept($path, $except, $deleteDir = true) { if (!is_array($except) || !count($except)) { throw new \InvalidArgumentException('list of exception is not an array or is empty'); } if ($path == '' || $path == '/' || $path == DIRECTORY_SEPARATOR) { ...
[ "public", "static", "function", "removeExcept", "(", "$", "path", ",", "$", "except", ",", "$", "deleteDir", "=", "true", ")", "{", "if", "(", "!", "is_array", "(", "$", "except", ")", "||", "!", "count", "(", "$", "except", ")", ")", "{", "throw",...
Recursive function deleting all files into a directory except those indicated. @param string $path The path of the directory to remove recursively @param array $except filenames and suffix of filename, for files to NOT delete @param bool $deleteDir If the path must be deleted too @return bool true if all t...
[ "Recursive", "function", "deleting", "all", "files", "into", "a", "directory", "except", "those", "indicated", "." ]
05fd364860ed147e6367de9db3dc544f58c5a05c
https://github.com/jelix/file-utilities/blob/05fd364860ed147e6367de9db3dc544f58c5a05c/lib/Directory.php#L93-L150
205,756
jelix/file-utilities
lib/Directory.php
Directory.copy
static function copy($srcDir, $destDir, $overwrite = true) { Directory::create($destDir); $dir = new \DirectoryIterator($srcDir); foreach ($dir as $dirContent) { if ($dirContent->isFile() || $dirContent->isLink()) { $target = $destDir.'/'.$dirContent->getFilename(); ...
php
static function copy($srcDir, $destDir, $overwrite = true) { Directory::create($destDir); $dir = new \DirectoryIterator($srcDir); foreach ($dir as $dirContent) { if ($dirContent->isFile() || $dirContent->isLink()) { $target = $destDir.'/'.$dirContent->getFilename(); ...
[ "static", "function", "copy", "(", "$", "srcDir", ",", "$", "destDir", ",", "$", "overwrite", "=", "true", ")", "{", "Directory", "::", "create", "(", "$", "destDir", ")", ";", "$", "dir", "=", "new", "\\", "DirectoryIterator", "(", "$", "srcDir", ")...
Copy a content directory into an other @param string $srcDir the directory from which content will be copied @param string $destDir the directory in which content will be copied @param boolean $overwrite set to false to not overwrite existing files in the target directory
[ "Copy", "a", "content", "directory", "into", "an", "other" ]
05fd364860ed147e6367de9db3dc544f58c5a05c
https://github.com/jelix/file-utilities/blob/05fd364860ed147e6367de9db3dc544f58c5a05c/lib/Directory.php#L159-L173
205,757
ellipsephp/container-reflection
src/AbstractReflectionContainer.php
AbstractReflectionContainer.isAutoWirable
private function isAutoWirable($id): bool { if (is_string($id) && class_exists($id)) { if (count($this->interfaces) > 0) { return (bool) array_intersect($this->interfaces, class_implements($id)); } return true; } return false; }
php
private function isAutoWirable($id): bool { if (is_string($id) && class_exists($id)) { if (count($this->interfaces) > 0) { return (bool) array_intersect($this->interfaces, class_implements($id)); } return true; } return false; }
[ "private", "function", "isAutoWirable", "(", "$", "id", ")", ":", "bool", "{", "if", "(", "is_string", "(", "$", "id", ")", "&&", "class_exists", "(", "$", "id", ")", ")", "{", "if", "(", "count", "(", "$", "this", "->", "interfaces", ")", ">", "...
Return whether the given id is an auto wirable class. @param $id @return bool
[ "Return", "whether", "the", "given", "id", "is", "an", "auto", "wirable", "class", "." ]
bd35a26e0fc924788f54b560d4a2d72ecf9a2be9
https://github.com/ellipsephp/container-reflection/blob/bd35a26e0fc924788f54b560d4a2d72ecf9a2be9/src/AbstractReflectionContainer.php#L99-L114
205,758
ellipsephp/container-reflection
src/AbstractReflectionContainer.php
AbstractReflectionContainer.make
private function make(string $class) { if (! array_key_exists($class, $this->instances)) { try { return $this->instances[$class] = ($this->factory)($class)->value($this); } catch (ResolvingExceptionInterface $e) { throw new ReflectionC...
php
private function make(string $class) { if (! array_key_exists($class, $this->instances)) { try { return $this->instances[$class] = ($this->factory)($class)->value($this); } catch (ResolvingExceptionInterface $e) { throw new ReflectionC...
[ "private", "function", "make", "(", "string", "$", "class", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "class", ",", "$", "this", "->", "instances", ")", ")", "{", "try", "{", "return", "$", "this", "->", "instances", "[", "$", "class", ...
Return an instance of the given class name. Cache the created instance so the same one is returned on multiple calls. @param string $class @return mixed @throws \Ellipse\Container\Exceptions\ReflectionContainerException
[ "Return", "an", "instance", "of", "the", "given", "class", "name", ".", "Cache", "the", "created", "instance", "so", "the", "same", "one", "is", "returned", "on", "multiple", "calls", "." ]
bd35a26e0fc924788f54b560d4a2d72ecf9a2be9
https://github.com/ellipsephp/container-reflection/blob/bd35a26e0fc924788f54b560d4a2d72ecf9a2be9/src/AbstractReflectionContainer.php#L124-L143
205,759
pmdevelopment/tool-bundle
Framework/Model/ChartJs/DataObject.php
DataObject.exportDataSets
public function exportDataSets($dataSetConfig = null) { $response = []; foreach ($this->getDataSets() as $set) { if ($set instanceof DataSet) { $response[] = $set->export($dataSetConfig); } else { $response[] = $set; } } ...
php
public function exportDataSets($dataSetConfig = null) { $response = []; foreach ($this->getDataSets() as $set) { if ($set instanceof DataSet) { $response[] = $set->export($dataSetConfig); } else { $response[] = $set; } } ...
[ "public", "function", "exportDataSets", "(", "$", "dataSetConfig", "=", "null", ")", "{", "$", "response", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getDataSets", "(", ")", "as", "$", "set", ")", "{", "if", "(", "$", "set", "instanceof"...
Export Data Sets @param DataSetConfig|null $dataSetConfig @return array
[ "Export", "Data", "Sets" ]
2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129
https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Framework/Model/ChartJs/DataObject.php#L64-L77
205,760
crisu83/yii-consoletools
commands/PermissionsCommand.php
PermissionsCommand.changeOwner
protected function changeOwner($path, $newOwner) { $ownerUid = fileowner($path); $ownerData = posix_getpwuid($ownerUid); $oldOwner = $ownerData['name']; if ($oldOwner !== $this->user) { if(!@chown($path, $newOwner)) { throw new CException(sprintf('Unable t...
php
protected function changeOwner($path, $newOwner) { $ownerUid = fileowner($path); $ownerData = posix_getpwuid($ownerUid); $oldOwner = $ownerData['name']; if ($oldOwner !== $this->user) { if(!@chown($path, $newOwner)) { throw new CException(sprintf('Unable t...
[ "protected", "function", "changeOwner", "(", "$", "path", ",", "$", "newOwner", ")", "{", "$", "ownerUid", "=", "fileowner", "(", "$", "path", ")", ";", "$", "ownerData", "=", "posix_getpwuid", "(", "$", "ownerUid", ")", ";", "$", "oldOwner", "=", "$",...
Changes the owner for a directory. @param string $path the directory path. @param string $newOwner the name of the new owner.
[ "Changes", "the", "owner", "for", "a", "directory", "." ]
53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc
https://github.com/crisu83/yii-consoletools/blob/53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc/commands/PermissionsCommand.php#L94-L106
205,761
crisu83/yii-consoletools
commands/PermissionsCommand.php
PermissionsCommand.changeGroup
protected function changeGroup($path, $newGroup) { $groupGid = filegroup($path); $groupData = posix_getgrgid($groupGid); $oldGroup = $groupData['name']; if ($oldGroup !== $newGroup) { if(!@chgrp($path, $newGroup)) { throw new CException(sprintf('Unable to ...
php
protected function changeGroup($path, $newGroup) { $groupGid = filegroup($path); $groupData = posix_getgrgid($groupGid); $oldGroup = $groupData['name']; if ($oldGroup !== $newGroup) { if(!@chgrp($path, $newGroup)) { throw new CException(sprintf('Unable to ...
[ "protected", "function", "changeGroup", "(", "$", "path", ",", "$", "newGroup", ")", "{", "$", "groupGid", "=", "filegroup", "(", "$", "path", ")", ";", "$", "groupData", "=", "posix_getgrgid", "(", "$", "groupGid", ")", ";", "$", "oldGroup", "=", "$",...
Changes the group for a directory. @param string $path the directory path. @param string $newGroup the name of the new group.
[ "Changes", "the", "group", "for", "a", "directory", "." ]
53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc
https://github.com/crisu83/yii-consoletools/blob/53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc/commands/PermissionsCommand.php#L113-L125
205,762
crisu83/yii-consoletools
commands/PermissionsCommand.php
PermissionsCommand.changeMode
protected function changeMode($path, $mode) { $oldPermission = substr(sprintf('%o', fileperms($path)), -4); $newPermission = sprintf('%04o', $mode); if ($oldPermission !== $newPermission) { if(!@chmod($path, $mode)) { throw new CException (sprintf("Unable to chang...
php
protected function changeMode($path, $mode) { $oldPermission = substr(sprintf('%o', fileperms($path)), -4); $newPermission = sprintf('%04o', $mode); if ($oldPermission !== $newPermission) { if(!@chmod($path, $mode)) { throw new CException (sprintf("Unable to chang...
[ "protected", "function", "changeMode", "(", "$", "path", ",", "$", "mode", ")", "{", "$", "oldPermission", "=", "substr", "(", "sprintf", "(", "'%o'", ",", "fileperms", "(", "$", "path", ")", ")", ",", "-", "4", ")", ";", "$", "newPermission", "=", ...
Changes the mode for a directory. @param string $path the directory path. @param integer $mode the mode.
[ "Changes", "the", "mode", "for", "a", "directory", "." ]
53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc
https://github.com/crisu83/yii-consoletools/blob/53bcb1bcdd33b9ef79034ff9c0d5bbfb3f971afc/commands/PermissionsCommand.php#L132-L143
205,763
IftekherSunny/Planet-Framework
src/Sun/Http/Redirect.php
Redirect.with
public function with($key, $value) { $this->hasData = true; $this->session->create($key, $value); return $this; }
php
public function with($key, $value) { $this->hasData = true; $this->session->create($key, $value); return $this; }
[ "public", "function", "with", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "hasData", "=", "true", ";", "$", "this", "->", "session", "->", "create", "(", "$", "key", ",", "$", "value", ")", ";", "return", "$", "this", ";", ...
To store data in a session @param string $key @param mixed $value @return $this
[ "To", "store", "data", "in", "a", "session" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Redirect.php#L72-L79
205,764
IftekherSunny/Planet-Framework
src/Sun/Http/Redirect.php
Redirect.backWith
public function backWith($key, $value) { $this->with($key, $value); $url = $this->session->get('previous_uri'); header('location: ' . $url); exit(); }
php
public function backWith($key, $value) { $this->with($key, $value); $url = $this->session->get('previous_uri'); header('location: ' . $url); exit(); }
[ "public", "function", "backWith", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "with", "(", "$", "key", ",", "$", "value", ")", ";", "$", "url", "=", "$", "this", "->", "session", "->", "get", "(", "'previous_uri'", ")", ";", ...
To redirect back with value @param string $key @param mixed $value
[ "To", "redirect", "back", "with", "value" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Redirect.php#L97-L105
205,765
akumar2-velsof/guzzlehttp
src/RingBridge.php
RingBridge.createRingRequest
public static function createRingRequest(RequestInterface $request) { $options = $request->getConfig()->toArray(); $url = $request->getUrl(); // No need to calculate the query string twice (in URL and query). $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null; ...
php
public static function createRingRequest(RequestInterface $request) { $options = $request->getConfig()->toArray(); $url = $request->getUrl(); // No need to calculate the query string twice (in URL and query). $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null; ...
[ "public", "static", "function", "createRingRequest", "(", "RequestInterface", "$", "request", ")", "{", "$", "options", "=", "$", "request", "->", "getConfig", "(", ")", "->", "toArray", "(", ")", ";", "$", "url", "=", "$", "request", "->", "getUrl", "("...
Creates a Ring request from a request object. This function does not hook up the "then" and "progress" events that would be required for actually sending a Guzzle request through a RingPHP handler. @param RequestInterface $request Request to convert. @return array Converted Guzzle Ring request.
[ "Creates", "a", "Ring", "request", "from", "a", "request", "object", "." ]
9588a489c52b27e2d4047f146ddacffc3e111b7e
https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/RingBridge.php#L28-L47
205,766
akumar2-velsof/guzzlehttp
src/RingBridge.php
RingBridge.prepareRingRequest
public static function prepareRingRequest(Transaction $trans) { // Clear out the transaction state when initiating. $trans->exception = null; $request = self::createRingRequest($trans->request); // Emit progress events if any progress listeners are registered. if ($trans->re...
php
public static function prepareRingRequest(Transaction $trans) { // Clear out the transaction state when initiating. $trans->exception = null; $request = self::createRingRequest($trans->request); // Emit progress events if any progress listeners are registered. if ($trans->re...
[ "public", "static", "function", "prepareRingRequest", "(", "Transaction", "$", "trans", ")", "{", "// Clear out the transaction state when initiating.", "$", "trans", "->", "exception", "=", "null", ";", "$", "request", "=", "self", "::", "createRingRequest", "(", "...
Creates a Ring request from a request object AND prepares the callbacks. @param Transaction $trans Transaction to update. @return array Converted Guzzle Ring request.
[ "Creates", "a", "Ring", "request", "from", "a", "request", "object", "AND", "prepares", "the", "callbacks", "." ]
9588a489c52b27e2d4047f146ddacffc3e111b7e
https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/RingBridge.php#L56-L71
205,767
akumar2-velsof/guzzlehttp
src/RingBridge.php
RingBridge.completeRingResponse
public static function completeRingResponse( Transaction $trans, array $response, MessageFactoryInterface $messageFactory ) { $trans->state = 'complete'; $trans->transferInfo = isset($response['transfer_stats']) ? $response['transfer_stats'] : []; if (!em...
php
public static function completeRingResponse( Transaction $trans, array $response, MessageFactoryInterface $messageFactory ) { $trans->state = 'complete'; $trans->transferInfo = isset($response['transfer_stats']) ? $response['transfer_stats'] : []; if (!em...
[ "public", "static", "function", "completeRingResponse", "(", "Transaction", "$", "trans", ",", "array", "$", "response", ",", "MessageFactoryInterface", "$", "messageFactory", ")", "{", "$", "trans", "->", "state", "=", "'complete'", ";", "$", "trans", "->", "...
Handles the process of processing a response received from a ring handler. The created response is added to the transaction, and the transaction stat is set appropriately. @param Transaction $trans Owns request and response. @param array $response Ring response array @param...
[ "Handles", "the", "process", "of", "processing", "a", "response", "received", "from", "a", "ring", "handler", ".", "The", "created", "response", "is", "added", "to", "the", "transaction", "and", "the", "transaction", "stat", "is", "set", "appropriately", "." ]
9588a489c52b27e2d4047f146ddacffc3e111b7e
https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/RingBridge.php#L82-L117
205,768
akumar2-velsof/guzzlehttp
src/RingBridge.php
RingBridge.fromRingRequest
public static function fromRingRequest(array $request) { $options = []; if (isset($request['version'])) { $options['protocol_version'] = $request['version']; } if (!isset($request['http_method'])) { throw new \InvalidArgumentException('No http_method'); ...
php
public static function fromRingRequest(array $request) { $options = []; if (isset($request['version'])) { $options['protocol_version'] = $request['version']; } if (!isset($request['http_method'])) { throw new \InvalidArgumentException('No http_method'); ...
[ "public", "static", "function", "fromRingRequest", "(", "array", "$", "request", ")", "{", "$", "options", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "request", "[", "'version'", "]", ")", ")", "{", "$", "options", "[", "'protocol_version'", "]"...
Creates a Guzzle request object using a ring request array. @param array $request Ring request @return Request @throws \InvalidArgumentException for incomplete requests.
[ "Creates", "a", "Guzzle", "request", "object", "using", "a", "ring", "request", "array", "." ]
9588a489c52b27e2d4047f146ddacffc3e111b7e
https://github.com/akumar2-velsof/guzzlehttp/blob/9588a489c52b27e2d4047f146ddacffc3e111b7e/src/RingBridge.php#L127-L145
205,769
loevgaard/dandomain-api
src/Api.php
Api.objectToArray
protected function objectToArray($obj) : array { if ($obj instanceof \stdClass) { $obj = json_decode(json_encode($obj), true); } return (array)$obj; }
php
protected function objectToArray($obj) : array { if ($obj instanceof \stdClass) { $obj = json_decode(json_encode($obj), true); } return (array)$obj; }
[ "protected", "function", "objectToArray", "(", "$", "obj", ")", ":", "array", "{", "if", "(", "$", "obj", "instanceof", "\\", "stdClass", ")", "{", "$", "obj", "=", "json_decode", "(", "json_encode", "(", "$", "obj", ")", ",", "true", ")", ";", "}", ...
Helper method to convert a \stdClass into an array @param $obj @return array
[ "Helper", "method", "to", "convert", "a", "\\", "stdClass", "into", "an", "array" ]
cd420d5f92a78eece4201ab57a5f6356537ed371
https://github.com/loevgaard/dandomain-api/blob/cd420d5f92a78eece4201ab57a5f6356537ed371/src/Api.php#L307-L314
205,770
selikhovleonid/nadir
src/core/ViewFactory.php
ViewFactory.createView
public static function createView($sCtrlName = null, $sActionName) { $sViewsRoot = AppHelper::getInstance()->getComponentRoot('views'); $sAddPath = ''; if (!empty($sCtrlName)) { $sAddPath .= DIRECTORY_SEPARATOR.strtolower($sCtrlName); } $sViewFile = $sViewsRoot....
php
public static function createView($sCtrlName = null, $sActionName) { $sViewsRoot = AppHelper::getInstance()->getComponentRoot('views'); $sAddPath = ''; if (!empty($sCtrlName)) { $sAddPath .= DIRECTORY_SEPARATOR.strtolower($sCtrlName); } $sViewFile = $sViewsRoot....
[ "public", "static", "function", "createView", "(", "$", "sCtrlName", "=", "null", ",", "$", "sActionName", ")", "{", "$", "sViewsRoot", "=", "AppHelper", "::", "getInstance", "(", ")", "->", "getComponentRoot", "(", "'views'", ")", ";", "$", "sAddPath", "=...
The method creates a view object assigned with the specific controller and action in it. If controller name is empty it means a markup file determined only with action name. It doesn't physically consist into the direcory named as controller, it's in the root of the view directory. @param string $sCtrlName|null The con...
[ "The", "method", "creates", "a", "view", "object", "assigned", "with", "the", "specific", "controller", "and", "action", "in", "it", ".", "If", "controller", "name", "is", "empty", "it", "means", "a", "markup", "file", "determined", "only", "with", "action",...
47545fccd8516c8f0a20c02ba62f68269c7199da
https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/ViewFactory.php#L29-L42
205,771
selikhovleonid/nadir
src/core/ViewFactory.php
ViewFactory.createLayout
public static function createLayout($sLayoutName, View $oView) { $sLayoutsRoot = AppHelper::getInstance()->getComponentRoot('layouts'); $sLayoutFile = $sLayoutsRoot.DIRECTORY_SEPARATOR .strtolower($sLayoutName).'.php'; if (is_readable($sLayoutFile)) { return new Layo...
php
public static function createLayout($sLayoutName, View $oView) { $sLayoutsRoot = AppHelper::getInstance()->getComponentRoot('layouts'); $sLayoutFile = $sLayoutsRoot.DIRECTORY_SEPARATOR .strtolower($sLayoutName).'.php'; if (is_readable($sLayoutFile)) { return new Layo...
[ "public", "static", "function", "createLayout", "(", "$", "sLayoutName", ",", "View", "$", "oView", ")", "{", "$", "sLayoutsRoot", "=", "AppHelper", "::", "getInstance", "(", ")", "->", "getComponentRoot", "(", "'layouts'", ")", ";", "$", "sLayoutFile", "=",...
It creates a layout object. @param type $sLayoutName The layout name. @param \nadir\core\View $oView The object of view. @return \nadir\core\Layout|null
[ "It", "creates", "a", "layout", "object", "." ]
47545fccd8516c8f0a20c02ba62f68269c7199da
https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/ViewFactory.php#L50-L59
205,772
selikhovleonid/nadir
src/core/ViewFactory.php
ViewFactory.createSnippet
public static function createSnippet($sSnptName) { $sSnptRoot = AppHelper::getInstance()->getComponentRoot('snippets'); $SnptFile = $sSnptRoot.DIRECTORY_SEPARATOR .strtolower($sSnptName).'.php'; if (is_readable($SnptFile)) { return new Snippet($SnptFile); } ...
php
public static function createSnippet($sSnptName) { $sSnptRoot = AppHelper::getInstance()->getComponentRoot('snippets'); $SnptFile = $sSnptRoot.DIRECTORY_SEPARATOR .strtolower($sSnptName).'.php'; if (is_readable($SnptFile)) { return new Snippet($SnptFile); } ...
[ "public", "static", "function", "createSnippet", "(", "$", "sSnptName", ")", "{", "$", "sSnptRoot", "=", "AppHelper", "::", "getInstance", "(", ")", "->", "getComponentRoot", "(", "'snippets'", ")", ";", "$", "SnptFile", "=", "$", "sSnptRoot", ".", "DIRECTOR...
The method creates a snippet-object. @param type $sSnptName The snippet name. @return \nadir\core\Snippet|null.
[ "The", "method", "creates", "a", "snippet", "-", "object", "." ]
47545fccd8516c8f0a20c02ba62f68269c7199da
https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/ViewFactory.php#L66-L75
205,773
fxpio/fxp-gluon
Twig/Extension/GoogleFontsExtension.php
GoogleFontsExtension.addStylesheetGoogleFonts
public function addStylesheetGoogleFonts() { $str = ''; foreach ($this->fonts as $url) { $str .= sprintf('<link href="%s" rel="stylesheet">', $url); } return $str; }
php
public function addStylesheetGoogleFonts() { $str = ''; foreach ($this->fonts as $url) { $str .= sprintf('<link href="%s" rel="stylesheet">', $url); } return $str; }
[ "public", "function", "addStylesheetGoogleFonts", "(", ")", "{", "$", "str", "=", "''", ";", "foreach", "(", "$", "this", "->", "fonts", "as", "$", "url", ")", "{", "$", "str", ".=", "sprintf", "(", "'<link href=\"%s\" rel=\"stylesheet\">'", ",", "$", "url...
Build the stylesheet links of google fonts. @return string
[ "Build", "the", "stylesheet", "links", "of", "google", "fonts", "." ]
0548b7d598ef4b0785b5df3b849a10f439b2dc65
https://github.com/fxpio/fxp-gluon/blob/0548b7d598ef4b0785b5df3b849a10f439b2dc65/Twig/Extension/GoogleFontsExtension.php#L51-L60
205,774
IftekherSunny/Planet-Framework
src/Sun/Console/Commands/AppName.php
AppName.setAppNamespace
private function setAppNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(app_path()); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . "\\b/", $newName...
php
private function setAppNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(app_path()); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . "\\b/", $newName...
[ "private", "function", "setAppNamespace", "(", "$", "oldNamespace", ",", "$", "newNamespace", ")", "{", "$", "files", "=", "$", "this", "->", "filesystem", "->", "files", "(", "app_path", "(", ")", ")", ";", "foreach", "(", "$", "files", "as", "$", "fi...
To set app directory files namespace @param $oldNamespace @param $newNamespace
[ "To", "set", "app", "directory", "files", "namespace" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Console/Commands/AppName.php#L88-L96
205,775
IftekherSunny/Planet-Framework
src/Sun/Console/Commands/AppName.php
AppName.setBootstrapNamespace
private function setBootstrapNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(base_path() . '/bootstrap'); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, str_replace($oldNamespace . '\Co...
php
private function setBootstrapNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(base_path() . '/bootstrap'); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, str_replace($oldNamespace . '\Co...
[ "private", "function", "setBootstrapNamespace", "(", "$", "oldNamespace", ",", "$", "newNamespace", ")", "{", "$", "files", "=", "$", "this", "->", "filesystem", "->", "files", "(", "base_path", "(", ")", ".", "'/bootstrap'", ")", ";", "foreach", "(", "$",...
To set bootstrap file namespace @param $oldNamespace @param $newNamespace @return array
[ "To", "set", "bootstrap", "file", "namespace" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Console/Commands/AppName.php#L106-L114
205,776
IftekherSunny/Planet-Framework
src/Sun/Console/Commands/AppName.php
AppName.setConfigNamespace
private function setConfigNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(base_path() . '/config'); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . ...
php
private function setConfigNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(base_path() . '/config'); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . ...
[ "private", "function", "setConfigNamespace", "(", "$", "oldNamespace", ",", "$", "newNamespace", ")", "{", "$", "files", "=", "$", "this", "->", "filesystem", "->", "files", "(", "base_path", "(", ")", ".", "'/config'", ")", ";", "foreach", "(", "$", "fi...
To set config directory files namespace @param $oldNamespace @param $newNamespace @return array
[ "To", "set", "config", "directory", "files", "namespace" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Console/Commands/AppName.php#L124-L132
205,777
IftekherSunny/Planet-Framework
src/Sun/Console/Commands/AppName.php
AppName.setComposerNamespace
private function setComposerNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(base_path() . '/vendor/composer'); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, preg_replace("/\\b" . $oldN...
php
private function setComposerNamespace($oldNamespace, $newNamespace) { $files = $this->filesystem->files(base_path() . '/vendor/composer'); foreach ($files as $file) { $content = $this->filesystem->get($file); $this->filesystem->create($file, preg_replace("/\\b" . $oldN...
[ "private", "function", "setComposerNamespace", "(", "$", "oldNamespace", ",", "$", "newNamespace", ")", "{", "$", "files", "=", "$", "this", "->", "filesystem", "->", "files", "(", "base_path", "(", ")", ".", "'/vendor/composer'", ")", ";", "foreach", "(", ...
To set composer namespace @param $oldNamespace @param $newNamespace
[ "To", "set", "composer", "namespace" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Console/Commands/AppName.php#L140-L152
205,778
inhere/php-library-plus
libs/Task/Worker/OptionAndConfigTrait.php
OptionAndConfigTrait.loadCliOptions
protected function loadCliOptions(array $opts) { $map = [ 'c' => 'conf_file', // config file 's' => 'servers', // server address 'n' => 'workerNum', // worker number do all tasks 'u' => 'user', 'g' => 'group', 'l' => 'logFile', ...
php
protected function loadCliOptions(array $opts) { $map = [ 'c' => 'conf_file', // config file 's' => 'servers', // server address 'n' => 'workerNum', // worker number do all tasks 'u' => 'user', 'g' => 'group', 'l' => 'logFile', ...
[ "protected", "function", "loadCliOptions", "(", "array", "$", "opts", ")", "{", "$", "map", "=", "[", "'c'", "=>", "'conf_file'", ",", "// config file", "'s'", "=>", "'servers'", ",", "// server address", "'n'", "=>", "'workerNum'", ",", "// worker number do all...
load the command line options @param array $opts
[ "load", "the", "command", "line", "options" ]
8604e037937d31fa2338d79aaf9d0910cb48f559
https://github.com/inhere/php-library-plus/blob/8604e037937d31fa2338d79aaf9d0910cb48f559/libs/Task/Worker/OptionAndConfigTrait.php#L134-L222
205,779
chilimatic/chilimatic-framework
lib/request/CLI.php
CLI._transform
public function _transform(array $array = null) { if (empty($array)) return; foreach ($array as $param) { if (strpos($param, '=') > 0) { $tmp = explode(Generic::ASSIGNMENT_OPERATOR, $param); $this->$tmp[0] = $tmp[1]; } } ...
php
public function _transform(array $array = null) { if (empty($array)) return; foreach ($array as $param) { if (strpos($param, '=') > 0) { $tmp = explode(Generic::ASSIGNMENT_OPERATOR, $param); $this->$tmp[0] = $tmp[1]; } } ...
[ "public", "function", "_transform", "(", "array", "$", "array", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "array", ")", ")", "return", ";", "foreach", "(", "$", "array", "as", "$", "param", ")", "{", "if", "(", "strpos", "(", "$", "par...
adapted "transform" method for the argv we need a different approach ofc @param array $array @return void
[ "adapted", "transform", "method", "for", "the", "argv", "we", "need", "a", "different", "approach", "ofc" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/request/CLI.php#L72-L85
205,780
danhanly/signalert
src/Signalert/Renderer/FoundationRenderer.php
FoundationRenderer.render
public function render(array $notifications, $type = 'info') { // Ensure Type is Supported if (in_array($type, $this->supportedTypes) === false) { // If not, fall back to default $type = 'info'; } // If there aren't any notifications, then return an empty str...
php
public function render(array $notifications, $type = 'info') { // Ensure Type is Supported if (in_array($type, $this->supportedTypes) === false) { // If not, fall back to default $type = 'info'; } // If there aren't any notifications, then return an empty str...
[ "public", "function", "render", "(", "array", "$", "notifications", ",", "$", "type", "=", "'info'", ")", "{", "// Ensure Type is Supported", "if", "(", "in_array", "(", "$", "type", ",", "$", "this", "->", "supportedTypes", ")", "===", "false", ")", "{", ...
Renders all messages as part of the notification stack, beneath the defined identifier, as HTML @param array $notifications @param string $type @return string|void
[ "Renders", "all", "messages", "as", "part", "of", "the", "notification", "stack", "beneath", "the", "defined", "identifier", "as", "HTML" ]
21ee50e3fc0352306a2966b555984b5c9eada582
https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Renderer/FoundationRenderer.php#L23-L38
205,781
danhanly/signalert
src/Signalert/Renderer/FoundationRenderer.php
FoundationRenderer.createHtmlByType
private function createHtmlByType(array $notifications, $type) { $html = "<div class='alert-box {$type} radius' data-alert>"; foreach ($notifications as $notification) { $html .= "{$notification}"; // If it's not the last notification, add a line break for the next one ...
php
private function createHtmlByType(array $notifications, $type) { $html = "<div class='alert-box {$type} radius' data-alert>"; foreach ($notifications as $notification) { $html .= "{$notification}"; // If it's not the last notification, add a line break for the next one ...
[ "private", "function", "createHtmlByType", "(", "array", "$", "notifications", ",", "$", "type", ")", "{", "$", "html", "=", "\"<div class='alert-box {$type} radius' data-alert>\"", ";", "foreach", "(", "$", "notifications", "as", "$", "notification", ")", "{", "$...
Create and return html string. @param array $notifications @param string $type @return string
[ "Create", "and", "return", "html", "string", "." ]
21ee50e3fc0352306a2966b555984b5c9eada582
https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Renderer/FoundationRenderer.php#L47-L61
205,782
IftekherSunny/Planet-Framework
src/Sun/Support/Str.php
Str.random
public static function random($size = 32) { $bytes = openssl_random_pseudo_bytes($size, $strong); if ($bytes !== false && $strong !== false) { $string = ''; while (($len = strlen($string)) < $size) { $length = $size - $len; $string .= substr(...
php
public static function random($size = 32) { $bytes = openssl_random_pseudo_bytes($size, $strong); if ($bytes !== false && $strong !== false) { $string = ''; while (($len = strlen($string)) < $size) { $length = $size - $len; $string .= substr(...
[ "public", "static", "function", "random", "(", "$", "size", "=", "32", ")", "{", "$", "bytes", "=", "openssl_random_pseudo_bytes", "(", "$", "size", ",", "$", "strong", ")", ";", "if", "(", "$", "bytes", "!==", "false", "&&", "$", "strong", "!==", "f...
To generate random string @param int $size @return string
[ "To", "generate", "random", "string" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Support/Str.php#L14-L28
205,783
nekudo/shiny_gears
src/Worker.php
Worker.getJobInfo
public function getJobInfo($Job) : void { $uptimeSeconds = time() - $this->startupTime; $uptimeSeconds = ($uptimeSeconds === 0) ? 1 : $uptimeSeconds; $avgJobsMin = $this->jobsTotal / ($uptimeSeconds / 60); $avgJobsMin = round($avgJobsMin, 2); $response = [ 'jobs_t...
php
public function getJobInfo($Job) : void { $uptimeSeconds = time() - $this->startupTime; $uptimeSeconds = ($uptimeSeconds === 0) ? 1 : $uptimeSeconds; $avgJobsMin = $this->jobsTotal / ($uptimeSeconds / 60); $avgJobsMin = round($avgJobsMin, 2); $response = [ 'jobs_t...
[ "public", "function", "getJobInfo", "(", "$", "Job", ")", ":", "void", "{", "$", "uptimeSeconds", "=", "time", "(", ")", "-", "$", "this", "->", "startupTime", ";", "$", "uptimeSeconds", "=", "(", "$", "uptimeSeconds", "===", "0", ")", "?", "1", ":",...
Returns information about jobs handled. @param \GearmanJob $Job @return void
[ "Returns", "information", "about", "jobs", "handled", "." ]
5cb72e1efc7df1c9d97c8bf14ef1d8ba6d44df9a
https://github.com/nekudo/shiny_gears/blob/5cb72e1efc7df1c9d97c8bf14ef1d8ba6d44df9a/src/Worker.php#L154-L166
205,784
nekudo/shiny_gears
src/Worker.php
Worker.updatePidFile
public function updatePidFile() : void { $pidFolder = $this->getRunPath($this->poolName); if (!file_exists($pidFolder)) { mkdir($pidFolder, 0755, true); } $pidFile = $pidFolder . '/' . $this->workerName . '.pid'; $pid = getmypid(); if (file_put_contents($p...
php
public function updatePidFile() : void { $pidFolder = $this->getRunPath($this->poolName); if (!file_exists($pidFolder)) { mkdir($pidFolder, 0755, true); } $pidFile = $pidFolder . '/' . $this->workerName . '.pid'; $pid = getmypid(); if (file_put_contents($p...
[ "public", "function", "updatePidFile", "(", ")", ":", "void", "{", "$", "pidFolder", "=", "$", "this", "->", "getRunPath", "(", "$", "this", "->", "poolName", ")", ";", "if", "(", "!", "file_exists", "(", "$", "pidFolder", ")", ")", "{", "mkdir", "("...
Updates PID file for the worker. @return void @throws WorkerException
[ "Updates", "PID", "file", "for", "the", "worker", "." ]
5cb72e1efc7df1c9d97c8bf14ef1d8ba6d44df9a
https://github.com/nekudo/shiny_gears/blob/5cb72e1efc7df1c9d97c8bf14ef1d8ba6d44df9a/src/Worker.php#L174-L185
205,785
mlocati/concrete5-translation-library
src/Parser/Dynamic.php
Dynamic.getSubParsers
public function getSubParsers() { $result = array(); $dir = __DIR__.'/DynamicItem'; if (is_dir($dir) && is_readable($dir)) { $matches = null; foreach (scandir($dir) as $item) { if (($item[0] !== '.') && preg_match('/^(.+)\.php$/i', $item, $matches) && ...
php
public function getSubParsers() { $result = array(); $dir = __DIR__.'/DynamicItem'; if (is_dir($dir) && is_readable($dir)) { $matches = null; foreach (scandir($dir) as $item) { if (($item[0] !== '.') && preg_match('/^(.+)\.php$/i', $item, $matches) && ...
[ "public", "function", "getSubParsers", "(", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "dir", "=", "__DIR__", ".", "'/DynamicItem'", ";", "if", "(", "is_dir", "(", "$", "dir", ")", "&&", "is_readable", "(", "$", "dir", ")", ")", "{"...
Returns the fully-qualified class names of all the sub-parsers. @return array[\C5TL\Parser\DynamicItem\DynamicItem]
[ "Returns", "the", "fully", "-", "qualified", "class", "names", "of", "all", "the", "sub", "-", "parsers", "." ]
26f806c8c1ecb6ce63115a4058ab396303622e00
https://github.com/mlocati/concrete5-translation-library/blob/26f806c8c1ecb6ce63115a4058ab396303622e00/src/Parser/Dynamic.php#L49-L66
205,786
hummer2k/ConLayout
src/Listener/ActionHandlesListener.php
ActionHandlesListener.injectActionHandles
public function injectActionHandles(EventInterface $event) { $handles = $this->getActionHandles($event); foreach ($handles as $handle) { $this->updater->addHandle($handle); } }
php
public function injectActionHandles(EventInterface $event) { $handles = $this->getActionHandles($event); foreach ($handles as $handle) { $this->updater->addHandle($handle); } }
[ "public", "function", "injectActionHandles", "(", "EventInterface", "$", "event", ")", "{", "$", "handles", "=", "$", "this", "->", "getActionHandles", "(", "$", "event", ")", ";", "foreach", "(", "$", "handles", "as", "$", "handle", ")", "{", "$", "this...
Callback handler invoked when the dispatch event is triggered. @param EventInterface $event @return void
[ "Callback", "handler", "invoked", "when", "the", "dispatch", "event", "is", "triggered", "." ]
15e472eaabc9b23ec6a5547524874e30d95e8d3e
https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Listener/ActionHandlesListener.php#L102-L108
205,787
hummer2k/ConLayout
src/Listener/ActionHandlesListener.php
ActionHandlesListener.getActionHandles
protected function getActionHandles(EventInterface $event) { /* @var $routeMatch MvcEvent */ $routeMatch = $event->getRouteMatch(); $controller = $event->getTarget(); if (is_object($controller)) { $controller = get_class($controller); } $routeMatchContro...
php
protected function getActionHandles(EventInterface $event) { /* @var $routeMatch MvcEvent */ $routeMatch = $event->getRouteMatch(); $controller = $event->getTarget(); if (is_object($controller)) { $controller = get_class($controller); } $routeMatchContro...
[ "protected", "function", "getActionHandles", "(", "EventInterface", "$", "event", ")", "{", "/* @var $routeMatch MvcEvent */", "$", "routeMatch", "=", "$", "event", "->", "getRouteMatch", "(", ")", ";", "$", "controller", "=", "$", "event", "->", "getTarget", "(...
Retrieve the action handles from the matched route. @param EventInterface $event @return array
[ "Retrieve", "the", "action", "handles", "from", "the", "matched", "route", "." ]
15e472eaabc9b23ec6a5547524874e30d95e8d3e
https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Listener/ActionHandlesListener.php#L127-L183
205,788
mover-io/belt
lib/Trace.php
Trace._generateLine
public function _generateLine($string, $start=5) { if($this->options['trace']['enabled']) { $trace = $this->_stackString($this->options['trace']['depth'], $start+$this->options['trace']['offset'], $this->options['separator']); } else { $trace = ""; } $result = ""; if($this->options['ti...
php
public function _generateLine($string, $start=5) { if($this->options['trace']['enabled']) { $trace = $this->_stackString($this->options['trace']['depth'], $start+$this->options['trace']['offset'], $this->options['separator']); } else { $trace = ""; } $result = ""; if($this->options['ti...
[ "public", "function", "_generateLine", "(", "$", "string", ",", "$", "start", "=", "5", ")", "{", "if", "(", "$", "this", "->", "options", "[", "'trace'", "]", "[", "'enabled'", "]", ")", "{", "$", "trace", "=", "$", "this", "->", "_stackString", "...
Common method for generating the main logging line.
[ "Common", "method", "for", "generating", "the", "main", "logging", "line", "." ]
c966a70aa0f4eb51be55bbb86c89b1e85b773d68
https://github.com/mover-io/belt/blob/c966a70aa0f4eb51be55bbb86c89b1e85b773d68/lib/Trace.php#L149-L169
205,789
mover-io/belt
lib/Trace.php
Trace._toFile
public function _toFile($file = null) { $file = $file ?: sys_get_temp_dir() . '/belt_trace.log'; $this->options['printer'] = 'file://'.$file; return $this; }
php
public function _toFile($file = null) { $file = $file ?: sys_get_temp_dir() . '/belt_trace.log'; $this->options['printer'] = 'file://'.$file; return $this; }
[ "public", "function", "_toFile", "(", "$", "file", "=", "null", ")", "{", "$", "file", "=", "$", "file", "?", ":", "sys_get_temp_dir", "(", ")", ".", "'/belt_trace.log'", ";", "$", "this", "->", "options", "[", "'printer'", "]", "=", "'file://'", ".", ...
Use file based output. Useful to work around nginx's log swallowing annoyingness. @fluent
[ "Use", "file", "based", "output", ".", "Useful", "to", "work", "around", "nginx", "s", "log", "swallowing", "annoyingness", "." ]
c966a70aa0f4eb51be55bbb86c89b1e85b773d68
https://github.com/mover-io/belt/blob/c966a70aa0f4eb51be55bbb86c89b1e85b773d68/lib/Trace.php#L190-L194
205,790
phpcq/autoload-validation
src/ClassMapGenerator.php
ClassMapGenerator.dump
public static function dump($dirs, $file, $blackList = null) { $maps = array(); foreach ($dirs as $dir) { $maps = array_merge($maps, static::createMap($dir, null, null, $blackList)); } file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true))); }
php
public static function dump($dirs, $file, $blackList = null) { $maps = array(); foreach ($dirs as $dir) { $maps = array_merge($maps, static::createMap($dir, null, null, $blackList)); } file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true))); }
[ "public", "static", "function", "dump", "(", "$", "dirs", ",", "$", "file", ",", "$", "blackList", "=", "null", ")", "{", "$", "maps", "=", "array", "(", ")", ";", "foreach", "(", "$", "dirs", "as", "$", "dir", ")", "{", "$", "maps", "=", "arra...
Generate a class map file. @param \Traversable $dirs Directories or a single path to search in. @param string $file The name of the class map file. @param string[] $blackList Optional list of blacklist regex for files to exclude. @return void
[ "Generate", "a", "class", "map", "file", "." ]
c24d331f16034c2096ce0e55492993befbaa687a
https://github.com/phpcq/autoload-validation/blob/c24d331f16034c2096ce0e55492993befbaa687a/src/ClassMapGenerator.php#L82-L91
205,791
phpcq/autoload-validation
src/ClassMapGenerator.php
ClassMapGenerator.pathMatchesRegex
private static function pathMatchesRegex($path, $blackList) { foreach ($blackList as $item) { $match = '#' . strtr($item, '#', '\#') . '#'; if (preg_match($match, $path)) { return true; } } return false; }
php
private static function pathMatchesRegex($path, $blackList) { foreach ($blackList as $item) { $match = '#' . strtr($item, '#', '\#') . '#'; if (preg_match($match, $path)) { return true; } } return false; }
[ "private", "static", "function", "pathMatchesRegex", "(", "$", "path", ",", "$", "blackList", ")", "{", "foreach", "(", "$", "blackList", "as", "$", "item", ")", "{", "$", "match", "=", "'#'", ".", "strtr", "(", "$", "item", ",", "'#'", ",", "'\\#'",...
Test path against blacklist regex list. @param string $path The path to check. @param string[] $blackList List of blacklist regexes. @return bool
[ "Test", "path", "against", "blacklist", "regex", "list", "." ]
c24d331f16034c2096ce0e55492993befbaa687a
https://github.com/phpcq/autoload-validation/blob/c24d331f16034c2096ce0e55492993befbaa687a/src/ClassMapGenerator.php#L177-L187
205,792
phpcq/autoload-validation
src/ClassMapGenerator.php
ClassMapGenerator.extractClasses
private static function extractClasses($contents, $extraTypes) { // strip heredocs/nowdocs $contents = preg_replace( '{<<<\s*(\'?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)\\2(?=\r\n|\n|\r|;)}s', 'null', $contents ); // strip strings $cont...
php
private static function extractClasses($contents, $extraTypes) { // strip heredocs/nowdocs $contents = preg_replace( '{<<<\s*(\'?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)\\2(?=\r\n|\n|\r|;)}s', 'null', $contents ); // strip strings $cont...
[ "private", "static", "function", "extractClasses", "(", "$", "contents", ",", "$", "extraTypes", ")", "{", "// strip heredocs/nowdocs", "$", "contents", "=", "preg_replace", "(", "'{<<<\\s*(\\'?)(\\w+)\\\\1(?:\\r\\n|\\n|\\r)(?:.*?)(?:\\r\\n|\\n|\\r)\\\\2(?=\\r\\n|\\n|\\r|;)}s'", ...
Prepare the file contents. @param string $contents The file contents. @param string $extraTypes The extra types to match. @return array
[ "Prepare", "the", "file", "contents", "." ]
c24d331f16034c2096ce0e55492993befbaa687a
https://github.com/phpcq/autoload-validation/blob/c24d331f16034c2096ce0e55492993befbaa687a/src/ClassMapGenerator.php#L260-L303
205,793
phpcq/autoload-validation
src/ClassMapGenerator.php
ClassMapGenerator.buildClassList
private static function buildClassList($matches) { if (array() === $matches) { return array(); } $classes = array(); $namespace = ''; for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { if (!empty($matches['ns'][$i])) { ...
php
private static function buildClassList($matches) { if (array() === $matches) { return array(); } $classes = array(); $namespace = ''; for ($i = 0, $len = count($matches['type']); $i < $len; $i++) { if (!empty($matches['ns'][$i])) { ...
[ "private", "static", "function", "buildClassList", "(", "$", "matches", ")", "{", "if", "(", "array", "(", ")", "===", "$", "matches", ")", "{", "return", "array", "(", ")", ";", "}", "$", "classes", "=", "array", "(", ")", ";", "$", "namespace", "...
Build the class list from the passed matches. @param array $matches The matches from extractClasses(). @return array
[ "Build", "the", "class", "list", "from", "the", "passed", "matches", "." ]
c24d331f16034c2096ce0e55492993befbaa687a
https://github.com/phpcq/autoload-validation/blob/c24d331f16034c2096ce0e55492993befbaa687a/src/ClassMapGenerator.php#L312-L345
205,794
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceModels.php
HCServiceModels.optimize
public function optimize (stdClass $data) { $data->modelDirectory = str_replace ('/http/controllers', '/models', $data->controllerDestination); $data->modelNamespace = str_replace ('\\http\\controllers', '\\models', $data->controllerNamespace); foreach ($data->database as $dbItem) { ...
php
public function optimize (stdClass $data) { $data->modelDirectory = str_replace ('/http/controllers', '/models', $data->controllerDestination); $data->modelNamespace = str_replace ('\\http\\controllers', '\\models', $data->controllerNamespace); foreach ($data->database as $dbItem) { ...
[ "public", "function", "optimize", "(", "stdClass", "$", "data", ")", "{", "$", "data", "->", "modelDirectory", "=", "str_replace", "(", "'/http/controllers'", ",", "'/models'", ",", "$", "data", "->", "controllerDestination", ")", ";", "$", "data", "->", "mo...
Optimizing configuration for models @param $data @internal param $item @internal param $modelData @return stdClass
[ "Optimizing", "configuration", "for", "models" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceModels.php#L25-L46
205,795
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceModels.php
HCServiceModels.getTableColumns
private function getTableColumns (string $tableName) { $columns = DB::getSchemaBuilder ()->getColumnListing ($tableName); if (!count ($columns)) $this->abort ("Table not found: " . $tableName); else $columns = DB::select (DB::raw ('SHOW COLUMNS FROM ' . $tableName));...
php
private function getTableColumns (string $tableName) { $columns = DB::getSchemaBuilder ()->getColumnListing ($tableName); if (!count ($columns)) $this->abort ("Table not found: " . $tableName); else $columns = DB::select (DB::raw ('SHOW COLUMNS FROM ' . $tableName));...
[ "private", "function", "getTableColumns", "(", "string", "$", "tableName", ")", "{", "$", "columns", "=", "DB", "::", "getSchemaBuilder", "(", ")", "->", "getColumnListing", "(", "$", "tableName", ")", ";", "if", "(", "!", "count", "(", "$", "columns", "...
Getting table columns @param $tableName @return mixed
[ "Getting", "table", "columns" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceModels.php#L54-L65
205,796
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceModels.php
HCServiceModels.getColumnsFillable
private function getColumnsFillable (array $columns, bool $translations = false) { $names = []; foreach ($columns as $column) { if ($translations) { if (!in_array ($column->Field, $this->getTranslationsAutoFill ())) array_push ($names, $column->Field)...
php
private function getColumnsFillable (array $columns, bool $translations = false) { $names = []; foreach ($columns as $column) { if ($translations) { if (!in_array ($column->Field, $this->getTranslationsAutoFill ())) array_push ($names, $column->Field)...
[ "private", "function", "getColumnsFillable", "(", "array", "$", "columns", ",", "bool", "$", "translations", "=", "false", ")", "{", "$", "names", "=", "[", "]", ";", "foreach", "(", "$", "columns", "as", "$", "column", ")", "{", "if", "(", "$", "tra...
Get models fillable fields @param array $columns @param bool $translations @return string
[ "Get", "models", "fillable", "fields" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceModels.php#L130-L144
205,797
newup/core
src/Templates/BasePackageTemplate.php
BasePackageTemplate.shareData
public function shareData($key, $value= null) { if (is_array($key)) { foreach ($key as $variableName => $variableValue) { $this->templateRenderer->setData($variableName, $variableValue); } return $this; } $this->templateRenderer->setData(...
php
public function shareData($key, $value= null) { if (is_array($key)) { foreach ($key as $variableName => $variableValue) { $this->templateRenderer->setData($variableName, $variableValue); } return $this; } $this->templateRenderer->setData(...
[ "public", "function", "shareData", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "foreach", "(", "$", "key", "as", "$", "variableName", "=>", "$", "variableValue", ")", "{", "$", ...
Shares data with package template files. @param $key The name of the variable to share. @param null $value The value of the variable to share. @return $this
[ "Shares", "data", "with", "package", "template", "files", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/BasePackageTemplate.php#L225-L236
205,798
newup/core
src/Templates/BasePackageTemplate.php
BasePackageTemplate.ignorePath
public function ignorePath($path) { if (is_array($path)) { foreach ($path as $pathToIgnore) { $this->ignorePath($pathToIgnore); } return $this; } $this->ignoredPaths[] = $path; return $this; }
php
public function ignorePath($path) { if (is_array($path)) { foreach ($path as $pathToIgnore) { $this->ignorePath($pathToIgnore); } return $this; } $this->ignoredPaths[] = $path; return $this; }
[ "public", "function", "ignorePath", "(", "$", "path", ")", "{", "if", "(", "is_array", "(", "$", "path", ")", ")", "{", "foreach", "(", "$", "path", "as", "$", "pathToIgnore", ")", "{", "$", "this", "->", "ignorePath", "(", "$", "pathToIgnore", ")", ...
Adds a path to the ignore list. @param $path @return $this
[ "Adds", "a", "path", "to", "the", "ignore", "list", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/BasePackageTemplate.php#L256-L268
205,799
mover-io/belt
lib/Stack.php
Stack.filtered
public static function filtered($classes = array(), $files = array(), &$stack = null) { $skip_self_trace = 0; if ($stack === null) { $stack = debug_backtrace(); } $classes = array_merge((array) $classes, array(__CLASS__)); // Note: in a php backtrace, the class r...
php
public static function filtered($classes = array(), $files = array(), &$stack = null) { $skip_self_trace = 0; if ($stack === null) { $stack = debug_backtrace(); } $classes = array_merge((array) $classes, array(__CLASS__)); // Note: in a php backtrace, the class r...
[ "public", "static", "function", "filtered", "(", "$", "classes", "=", "array", "(", ")", ",", "$", "files", "=", "array", "(", ")", ",", "&", "$", "stack", "=", "null", ")", "{", "$", "skip_self_trace", "=", "0", ";", "if", "(", "$", "stack", "==...
Generates a stack trace while skipping internal and self calls. @return array
[ "Generates", "a", "stack", "trace", "while", "skipping", "internal", "and", "self", "calls", "." ]
c966a70aa0f4eb51be55bbb86c89b1e85b773d68
https://github.com/mover-io/belt/blob/c966a70aa0f4eb51be55bbb86c89b1e85b773d68/lib/Stack.php#L11-L48