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
234,000
wardrobecms/core-archived
src/Wardrobe/Core/Repositories/DbPostRepository.php
DbPostRepository.validatePost
protected function validatePost($title, $slug, $id = null) { $rules = array( 'title' => 'required', 'slug' => 'required|unique:posts,slug', ); if ($id) { $rules['slug'] .= ','.$id; } with($validator = Validator::make(compact('title', 'slug'), $rules))->fails(); return $validator->errors(); ...
php
protected function validatePost($title, $slug, $id = null) { $rules = array( 'title' => 'required', 'slug' => 'required|unique:posts,slug', ); if ($id) { $rules['slug'] .= ','.$id; } with($validator = Validator::make(compact('title', 'slug'), $rules))->fails(); return $validator->errors(); ...
[ "protected", "function", "validatePost", "(", "$", "title", ",", "$", "slug", ",", "$", "id", "=", "null", ")", "{", "$", "rules", "=", "array", "(", "'title'", "=>", "'required'", ",", "'slug'", "=>", "'required|unique:posts,slug'", ",", ")", ";", "if",...
Determine if the given post is valid. @param string $title @param string $slug @param int $id @return \Illuminate\Support\MessageBag
[ "Determine", "if", "the", "given", "post", "is", "valid", "." ]
5c0836ea2e6885a428c852dc392073f2a2541c71
https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L276-L291
234,001
MW-Peachy/Peachy
Includes/Peachy.php
Peachy.newWiki
public static function newWiki( $config_name = null, $pgUsername = null, $password = null, $base_url = 'http://en.wikipedia.org/w/api.php', $classname = 'Wiki' ) { pecho( "Loading Peachy (version " . PEACHYVERSION . ")...\n\n", PECHO_NORMAL ); /*$updater = new AutoUpdate(); $Uptodate = $updater->Checkforupdate();...
php
public static function newWiki( $config_name = null, $pgUsername = null, $password = null, $base_url = 'http://en.wikipedia.org/w/api.php', $classname = 'Wiki' ) { pecho( "Loading Peachy (version " . PEACHYVERSION . ")...\n\n", PECHO_NORMAL ); /*$updater = new AutoUpdate(); $Uptodate = $updater->Checkforupdate();...
[ "public", "static", "function", "newWiki", "(", "$", "config_name", "=", "null", ",", "$", "pgUsername", "=", "null", ",", "$", "password", "=", "null", ",", "$", "base_url", "=", "'http://en.wikipedia.org/w/api.php'", ",", "$", "classname", "=", "'Wiki'", "...
Initializes Peachy, logs in with a either the configuration file or a given username and password @static @access public @param string $config_name Name of the config file stored in the Configs directory, minus the .cfg extension. Default null @param string $pgUsername Username to log in if no config file specified. ...
[ "Initializes", "Peachy", "logs", "in", "with", "a", "either", "the", "configuration", "file", "or", "a", "given", "username", "and", "password" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Peachy.php#L23-L61
234,002
MW-Peachy/Peachy
Includes/Peachy.php
Peachy.parse_config
private static function parse_config( $config_name ) { global $pgIP; if( !is_file( $config_name ) ) { if( !is_file( $pgIP . 'Configs/' . $config_name . '.cfg' ) ) { throw new BadEntryError( "BadConfig", "A non-existent configuration file was specified." ); } else { $config_name = $pgIP . 'Configs/' . ...
php
private static function parse_config( $config_name ) { global $pgIP; if( !is_file( $config_name ) ) { if( !is_file( $pgIP . 'Configs/' . $config_name . '.cfg' ) ) { throw new BadEntryError( "BadConfig", "A non-existent configuration file was specified." ); } else { $config_name = $pgIP . 'Configs/' . ...
[ "private", "static", "function", "parse_config", "(", "$", "config_name", ")", "{", "global", "$", "pgIP", ";", "if", "(", "!", "is_file", "(", "$", "config_name", ")", ")", "{", "if", "(", "!", "is_file", "(", "$", "pgIP", ".", "'Configs/'", ".", "$...
Checks for config files, parses them. @access private @static @param string $config_name Name of config file @throws BadEntryError @return array Config params
[ "Checks", "for", "config", "files", "parses", "them", "." ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Peachy.php#L122-L139
234,003
MW-Peachy/Peachy
Includes/Peachy.php
Peachy.deprecatedWarn
public static function deprecatedWarn($method, $newFunction, $message = null) { if( is_null( $message ) ) { $message = "Warning: $method is deprecated. Please use $newFunction instead."; } $message = "[$message|YELLOW_BAR]\n\n"; pecho( $message, PECHO_WARN, 'cecho' ); }
php
public static function deprecatedWarn($method, $newFunction, $message = null) { if( is_null( $message ) ) { $message = "Warning: $method is deprecated. Please use $newFunction instead."; } $message = "[$message|YELLOW_BAR]\n\n"; pecho( $message, PECHO_WARN, 'cecho' ); }
[ "public", "static", "function", "deprecatedWarn", "(", "$", "method", ",", "$", "newFunction", ",", "$", "message", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "message", ")", ")", "{", "$", "message", "=", "\"Warning: $method is deprecated. Pleas...
Function that displays an error message when an End-User attempts to use a function no longer included in Peachy @param null|string $method @param null|string $newFunction @param string $message
[ "Function", "that", "displays", "an", "error", "message", "when", "an", "End", "-", "User", "attempts", "to", "use", "a", "function", "no", "longer", "included", "in", "Peachy" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Peachy.php#L148-L157
234,004
MW-Peachy/Peachy
Includes/Peachy.php
Peachy.getSvnInfo
public static function getSvnInfo() { global $pgIP; // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html $entries = $pgIP . '/.svn/entries'; if( !file_exists( $entries ) ) { return false; } $lines = file( $entries ); if( !count( $lines ) ) { return false; } // check if file ...
php
public static function getSvnInfo() { global $pgIP; // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html $entries = $pgIP . '/.svn/entries'; if( !file_exists( $entries ) ) { return false; } $lines = file( $entries ); if( !count( $lines ) ) { return false; } // check if file ...
[ "public", "static", "function", "getSvnInfo", "(", ")", "{", "global", "$", "pgIP", ";", "// http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html", "$", "entries", "=", "$", "pgIP", ".", "'/.svn/entries'", ";", "if", "(", "!", "file_exists", "(", "$", ...
Checks for and returns an SVN repository version. @return array|bool
[ "Checks", "for", "and", "returns", "an", "SVN", "repository", "version", "." ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Peachy.php#L164-L197
234,005
MW-Peachy/Peachy
Plugins/AbuseFilter.php
AbuseFilter.abuselog
public function abuselog( $filter = null, $user = null, $title = null, $limit = null, $start = null, $end = null, $dir = 'older', $prop = array( 'ids', 'filter', 'user', 'ip', 'title', 'action', 'details', 'result', 'timestamp' ) ) { $tArray = array( 'prop' => $prop, '_code' => 'afl', 'afldir' => $dir...
php
public function abuselog( $filter = null, $user = null, $title = null, $limit = null, $start = null, $end = null, $dir = 'older', $prop = array( 'ids', 'filter', 'user', 'ip', 'title', 'action', 'details', 'result', 'timestamp' ) ) { $tArray = array( 'prop' => $prop, '_code' => 'afl', 'afldir' => $dir...
[ "public", "function", "abuselog", "(", "$", "filter", "=", "null", ",", "$", "user", "=", "null", ",", "$", "title", "=", "null", ",", "$", "limit", "=", "null", ",", "$", "start", "=", "null", ",", "$", "end", "=", "null", ",", "$", "dir", "="...
Returns the abuse filter log @access public @param int $filter Filter ID. Default null @param string $user Show entries by this user. Default null @param string $title Show entries to this title. Default null @param int $limit Number of entries to retrieve. Defautl null @param string $start Timestamp to start at. Defa...
[ "Returns", "the", "abuse", "filter", "log" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/AbuseFilter.php#L60-L81
234,006
MW-Peachy/Peachy
Plugins/AbuseFilter.php
AbuseFilter.abusefilters
public function abusefilters( $start = null, $end = null, $dir = 'newer', $enabled = null, $deleted = false, $private = null, $limit = null, $prop = array( 'id', 'description', 'pattern', 'actions', 'hits', 'comments', 'lasteditor', 'lastedittime', 'status', 'private' ) ) { $tArray = array( 'prop' => $prop,...
php
public function abusefilters( $start = null, $end = null, $dir = 'newer', $enabled = null, $deleted = false, $private = null, $limit = null, $prop = array( 'id', 'description', 'pattern', 'actions', 'hits', 'comments', 'lasteditor', 'lastedittime', 'status', 'private' ) ) { $tArray = array( 'prop' => $prop,...
[ "public", "function", "abusefilters", "(", "$", "start", "=", "null", ",", "$", "end", "=", "null", ",", "$", "dir", "=", "'newer'", ",", "$", "enabled", "=", "null", ",", "$", "deleted", "=", "false", ",", "$", "private", "=", "null", ",", "$", ...
Returns a list of all filters @access public @param int $start Filter ID to start at. Default null @param int $end Filter ID to end at. Default null @param string $dir Direction to list. Default newer @param bool $enabled Only list enabled filters. true => only enabled, false => only disabled, null => all @param bool ...
[ "Returns", "a", "list", "of", "all", "filters" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/AbuseFilter.php#L97-L142
234,007
yeephp/yeephp
Yee/Http/Response.php
Response.status
public function status($status = null) { if (!is_null($status)) { $this->status = (int) $status; } return $this->status; }
php
public function status($status = null) { if (!is_null($status)) { $this->status = (int) $status; } return $this->status; }
[ "public", "function", "status", "(", "$", "status", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "status", ")", ")", "{", "$", "this", "->", "status", "=", "(", "int", ")", "$", "status", ";", "}", "return", "$", "this", "->", "s...
DEPRECATION WARNING! Use `getStatus` or `setStatus` instead. Get and set status @param int|null $status @return int
[ "DEPRECATION", "WARNING!", "Use", "getStatus", "or", "setStatus", "instead", "." ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Response.php#L160-L167
234,008
yeephp/yeephp
Yee/Http/Response.php
Response.header
public function header($name, $value = null) { if (!is_null($value)) { $this->headers->set($name, $value); } return $this->headers->get($name); }
php
public function header($name, $value = null) { if (!is_null($value)) { $this->headers->set($name, $value); } return $this->headers->get($name); }
[ "public", "function", "header", "(", "$", "name", ",", "$", "value", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "value", ")", ")", "{", "$", "this", "->", "headers", "->", "set", "(", "$", "name", ",", "$", "value", ")", ";", ...
DEPRECATION WARNING! Access `headers` property directly. Get and set header @param string $name Header name @param string|null $value Header value @return string Header value
[ "DEPRECATION", "WARNING!", "Access", "headers", "property", "directly", "." ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Response.php#L177-L184
234,009
yeephp/yeephp
Yee/Http/Response.php
Response.body
public function body($body = null) { if (!is_null($body)) { $this->write($body, true); } return $this->body; }
php
public function body($body = null) { if (!is_null($body)) { $this->write($body, true); } return $this->body; }
[ "public", "function", "body", "(", "$", "body", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "body", ")", ")", "{", "$", "this", "->", "write", "(", "$", "body", ",", "true", ")", ";", "}", "return", "$", "this", "->", "body", ...
DEPRECATION WARNING! use `getBody` or `setBody` instead. Get and set body @param string|null $body Content of HTTP response body @return string
[ "DEPRECATION", "WARNING!", "use", "getBody", "or", "setBody", "instead", "." ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Response.php#L214-L221
234,010
yeephp/yeephp
Yee/Http/Response.php
Response.length
public function length($length = null) { if (!is_null($length)) { $this->length = (int) $length; } return $this->length; }
php
public function length($length = null) { if (!is_null($length)) { $this->length = (int) $length; } return $this->length; }
[ "public", "function", "length", "(", "$", "length", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "length", ")", ")", "{", "$", "this", "->", "length", "=", "(", "int", ")", "$", "length", ";", "}", "return", "$", "this", "->", "l...
DEPRECATION WARNING! Use `getLength` or `write` or `body` instead. Get and set length @param int|null $length @return int
[ "DEPRECATION", "WARNING!", "Use", "getLength", "or", "write", "or", "body", "instead", "." ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Response.php#L253-L260
234,011
yeephp/yeephp
Yee/Http/Response.php
Response.getMessageForCode
public static function getMessageForCode($status) { if (isset(self::$messages[$status])) { return self::$messages[$status]; } else { return null; } }
php
public static function getMessageForCode($status) { if (isset(self::$messages[$status])) { return self::$messages[$status]; } else { return null; } }
[ "public", "static", "function", "getMessageForCode", "(", "$", "status", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "messages", "[", "$", "status", "]", ")", ")", "{", "return", "self", "::", "$", "messages", "[", "$", "status", "]", ";", ...
Get message for HTTP status code @param int $status @return string|null
[ "Get", "message", "for", "HTTP", "status", "code" ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Response.php#L504-L511
234,012
nfephp-org/sped-console
src/XsdConverter/Naming/Factory.php
Factory.addAvailableNamingStrategy
public static function addAvailableNamingStrategy($name, $className) { $ref = new \ReflectionClass($className); if (!$ref->isSubclassOf(NamingStrategy::class)) { throw new \InvalidArgumentException($className); } self::$strategies[$name] = $ref->getName(); }
php
public static function addAvailableNamingStrategy($name, $className) { $ref = new \ReflectionClass($className); if (!$ref->isSubclassOf(NamingStrategy::class)) { throw new \InvalidArgumentException($className); } self::$strategies[$name] = $ref->getName(); }
[ "public", "static", "function", "addAvailableNamingStrategy", "(", "$", "name", ",", "$", "className", ")", "{", "$", "ref", "=", "new", "\\", "ReflectionClass", "(", "$", "className", ")", ";", "if", "(", "!", "$", "ref", "->", "isSubclassOf", "(", "Nam...
Adds a new supported driver. @param string $name Driver's name @param string $className Class name of driver @return void @throws \InvalidArgumentException
[ "Adds", "a", "new", "supported", "driver", "." ]
eaedaa8065744b2e47d8f7c711ae993ff238126f
https://github.com/nfephp-org/sped-console/blob/eaedaa8065744b2e47d8f7c711ae993ff238126f/src/XsdConverter/Naming/Factory.php#L56-L63
234,013
budde377/Part
lib/controller/json/ElementImpl.php
ElementImpl.validValue
protected function validValue(&$val) { if (!is_array($val)) { return $val == null || is_scalar($val) || $val instanceof JsonSerializable; } foreach ($val as $k => $v) { if (!$this->validValue($v)) { $val[$k] = null; } else { ...
php
protected function validValue(&$val) { if (!is_array($val)) { return $val == null || is_scalar($val) || $val instanceof JsonSerializable; } foreach ($val as $k => $v) { if (!$this->validValue($v)) { $val[$k] = null; } else { ...
[ "protected", "function", "validValue", "(", "&", "$", "val", ")", "{", "if", "(", "!", "is_array", "(", "$", "val", ")", ")", "{", "return", "$", "val", "==", "null", "||", "is_scalar", "(", "$", "val", ")", "||", "$", "val", "instanceof", "JsonSer...
Will check input if it is scalars or elements, or arrays of these @param mixed $val @return bool
[ "Will", "check", "input", "if", "it", "is", "scalars", "or", "elements", "or", "arrays", "of", "these" ]
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/controller/json/ElementImpl.php#L31-L45
234,014
xylemical/php-expressions
src/Context.php
Context.getVariable
public function getVariable($name, $default = null) { if (!array_key_exists($name, $this->variables)) { return $default; } return $this->variables[$name]; }
php
public function getVariable($name, $default = null) { if (!array_key_exists($name, $this->variables)) { return $default; } return $this->variables[$name]; }
[ "public", "function", "getVariable", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "variables", ")", ")", "{", "return", "$", "default", ";", "}", "return",...
Get a variable by name, with default support. @param string $name @param mixed $default @return mixed
[ "Get", "a", "variable", "by", "name", "with", "default", "support", "." ]
4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73
https://github.com/xylemical/php-expressions/blob/4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73/src/Context.php#L42-L48
234,015
xylemical/php-expressions
src/Context.php
Context.setVariable
public function setVariable($name, $value) { if (is_null($value)) { unset($this->variables[$name]); } else { $this->variables[$name] = $value; } return $this; }
php
public function setVariable($name, $value) { if (is_null($value)) { unset($this->variables[$name]); } else { $this->variables[$name] = $value; } return $this; }
[ "public", "function", "setVariable", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "is_null", "(", "$", "value", ")", ")", "{", "unset", "(", "$", "this", "->", "variables", "[", "$", "name", "]", ")", ";", "}", "else", "{", "$", "t...
Set a variable value by name. @param string $name @param mixed $value @return static
[ "Set", "a", "variable", "value", "by", "name", "." ]
4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73
https://github.com/xylemical/php-expressions/blob/4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73/src/Context.php#L68-L77
234,016
matrozov/yii2-couchbase
src/Command.php
Command.bindParam
public function bindParam($name, &$value) { $name = ltrim($name, '$'); $this->params[$name] =& $value; return $this; }
php
public function bindParam($name, &$value) { $name = ltrim($name, '$'); $this->params[$name] =& $value; return $this; }
[ "public", "function", "bindParam", "(", "$", "name", ",", "&", "$", "value", ")", "{", "$", "name", "=", "ltrim", "(", "$", "name", ",", "'$'", ")", ";", "$", "this", "->", "params", "[", "$", "name", "]", "=", "&", "$", "value", ";", "return",...
Binds a parameter to the SQL statement to be executed. @param string|int $name parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form `:name`. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter. @par...
[ "Binds", "a", "parameter", "to", "the", "SQL", "statement", "to", "be", "executed", "." ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L185-L192
234,017
matrozov/yii2-couchbase
src/Command.php
Command.insert
public function insert($bucketName, $data) { $sql = $this->db->getQueryBuilder()->insert($bucketName, $data); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function insert($bucketName, $data) { $sql = $this->db->getQueryBuilder()->insert($bucketName, $data); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "insert", "(", "$", "bucketName", ",", "$", "data", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "insert", "(", "$", "bucketName", ",", "$", "data", ")", ";", "return", "$", "thi...
Creates an INSERT command. For example, ```php $connection->createCommand()->insert('user', [ 'name' => 'Sam', 'age' => 30, ])->execute(); ``` or ``` $id = $connection->createCommand()->insert('user', [ 'name' => 'Sam', 'age' => 30, ])->queryScalar(); ``` The method will properly escape the column names, and bind t...
[ "Creates", "an", "INSERT", "command", ".", "For", "example" ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L266-L271
234,018
matrozov/yii2-couchbase
src/Command.php
Command.batchInsert
public function batchInsert($bucketName, $rows) { $sql = $this->db->getQueryBuilder()->batchInsert($bucketName, $rows); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function batchInsert($bucketName, $rows) { $sql = $this->db->getQueryBuilder()->batchInsert($bucketName, $rows); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "batchInsert", "(", "$", "bucketName", ",", "$", "rows", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "batchInsert", "(", "$", "bucketName", ",", "$", "rows", ")", ";", "return", "...
Creates a batch INSERT command. For example, ```php $connection->createCommand()->batchInsert('user', ['name', 'age'], [ ['Tom', 30], ['Jane', 20], ['Linda', 25], ])->execute(); ``` The method will properly escape the column names, and quote the values to be inserted. Note that the values in each row must match the ...
[ "Creates", "a", "batch", "INSERT", "command", ".", "For", "example" ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L296-L301
234,019
matrozov/yii2-couchbase
src/Command.php
Command.upsert
public function upsert($bucketName, $id, $data) { $sql = $this->db->getQueryBuilder()->upsert($bucketName, $id, $data); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function upsert($bucketName, $id, $data) { $sql = $this->db->getQueryBuilder()->upsert($bucketName, $id, $data); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "upsert", "(", "$", "bucketName", ",", "$", "id", ",", "$", "data", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "upsert", "(", "$", "bucketName", ",", "$", "id", ",", "$", "da...
Creates an UPSERT command. For example, ```php $connection->createCommand()->upsert('user', 'my-id', ['status' => 1])->execute(); ``` The method will properly escape the column names and bind the values to be updated. Note that the created command is not executed until [[execute()]] is called. @param string $bucket...
[ "Creates", "an", "UPSERT", "command", ".", "For", "example" ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L349-L354
234,020
matrozov/yii2-couchbase
src/Command.php
Command.delete
public function delete($bucketName, $condition = '', $params = []) { $sql = $this->db->getQueryBuilder()->delete($bucketName, $condition, $params); return $this->setSql($sql)->setBucketName($bucketName)->bindValues($params); }
php
public function delete($bucketName, $condition = '', $params = []) { $sql = $this->db->getQueryBuilder()->delete($bucketName, $condition, $params); return $this->setSql($sql)->setBucketName($bucketName)->bindValues($params); }
[ "public", "function", "delete", "(", "$", "bucketName", ",", "$", "condition", "=", "''", ",", "$", "params", "=", "[", "]", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "delete", "(", "$", "bucketNam...
Creates a DELETE command. For example, ```php $connection->createCommand()->delete('user', 'status = 0')->execute(); ``` The method will properly escape the bucket and column names. Note that the created command is not executed until [[execute()]] is called. @param string $bucketName the bucket where the data...
[ "Creates", "a", "DELETE", "command", ".", "For", "example" ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L376-L381
234,021
matrozov/yii2-couchbase
src/Command.php
Command.buildIndex
public function buildIndex($bucketName, $indexNames) { $sql = $this->db->getQueryBuilder()->buildIndex($bucketName, $indexNames); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function buildIndex($bucketName, $indexNames) { $sql = $this->db->getQueryBuilder()->buildIndex($bucketName, $indexNames); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "buildIndex", "(", "$", "bucketName", ",", "$", "indexNames", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "buildIndex", "(", "$", "bucketName", ",", "$", "indexNames", ")", ";", "re...
Create a SQL command for build index. @param string $bucketName @param string|string[] $indexNames names of index @return $this the command object itself
[ "Create", "a", "SQL", "command", "for", "build", "index", "." ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L418-L423
234,022
matrozov/yii2-couchbase
src/Command.php
Command.createPrimaryIndex
public function createPrimaryIndex($bucketName, $indexName = null, $options = []) { $sql = $this->db->getQueryBuilder()->createPrimaryIndex($bucketName, $indexName, $options); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function createPrimaryIndex($bucketName, $indexName = null, $options = []) { $sql = $this->db->getQueryBuilder()->createPrimaryIndex($bucketName, $indexName, $options); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "createPrimaryIndex", "(", "$", "bucketName", ",", "$", "indexName", "=", "null", ",", "$", "options", "=", "[", "]", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "createPrimaryIndex",...
Create a SQL command for creating a new primary index. @param string $bucketName @param string|null $indexName name of primary index (optional) @param array $options @return $this the command object itself
[ "Create", "a", "SQL", "command", "for", "creating", "a", "new", "primary", "index", "." ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L434-L439
234,023
matrozov/yii2-couchbase
src/Command.php
Command.dropPrimaryIndex
public function dropPrimaryIndex($bucketName) { $sql = $this->db->getQueryBuilder()->dropPrimaryIndex($bucketName); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function dropPrimaryIndex($bucketName) { $sql = $this->db->getQueryBuilder()->dropPrimaryIndex($bucketName); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "dropPrimaryIndex", "(", "$", "bucketName", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "dropPrimaryIndex", "(", "$", "bucketName", ")", ";", "return", "$", "this", "->", "setSql", "(...
Create a SQL command for dropping an unnamed primary index. @param string $bucketName @return $this the command object itself
[ "Create", "a", "SQL", "command", "for", "dropping", "an", "unnamed", "primary", "index", "." ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L448-L453
234,024
matrozov/yii2-couchbase
src/Command.php
Command.createIndex
public function createIndex($bucketName, $indexName, $columns, $condition = null, &$params = [], $options = []) { $sql = $this->db->getQueryBuilder()->createIndex($bucketName, $indexName, $columns, $condition, $params, $options); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function createIndex($bucketName, $indexName, $columns, $condition = null, &$params = [], $options = []) { $sql = $this->db->getQueryBuilder()->createIndex($bucketName, $indexName, $columns, $condition, $params, $options); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "createIndex", "(", "$", "bucketName", ",", "$", "indexName", ",", "$", "columns", ",", "$", "condition", "=", "null", ",", "&", "$", "params", "=", "[", "]", ",", "$", "options", "=", "[", "]", ")", "{", "$", "sql", "=", "$...
Creates a SQL command for creating a new index. @param string $bucketName @param string $indexName @param array $columns @param array|null $condition @param array $params @param array $options @return $this the command object itself @throws Exception
[ "Creates", "a", "SQL", "command", "for", "creating", "a", "new", "index", "." ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L468-L473
234,025
matrozov/yii2-couchbase
src/Command.php
Command.dropIndex
public function dropIndex($bucketName, $indexName) { $sql = $this->db->getQueryBuilder()->dropIndex($bucketName, $indexName); return $this->setSql($sql)->setBucketName($bucketName); }
php
public function dropIndex($bucketName, $indexName) { $sql = $this->db->getQueryBuilder()->dropIndex($bucketName, $indexName); return $this->setSql($sql)->setBucketName($bucketName); }
[ "public", "function", "dropIndex", "(", "$", "bucketName", ",", "$", "indexName", ")", "{", "$", "sql", "=", "$", "this", "->", "db", "->", "getQueryBuilder", "(", ")", "->", "dropIndex", "(", "$", "bucketName", ",", "$", "indexName", ")", ";", "return...
Creates a SQL command for dropping an index. @param string $bucketName @param string $indexName @return $this the command object itself
[ "Creates", "a", "SQL", "command", "for", "dropping", "an", "index", "." ]
07c2e9d18cb90f873c0d88dcacf6bb532e9d648c
https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Command.php#L483-L488
234,026
MW-Peachy/Peachy
Includes/Hooks.php
Hooks.runHook
public static function runHook( $hook_name, $args = array() ) { global $pgHooks; if( !isset( $pgHooks[$hook_name] ) ) return null; if( !is_array( $pgHooks[$hook_name] ) ) { throw new HookError( "Hook assignment for event `$hook_name` is not an array. Syntax is " . '$pgHooks[\'hookname\'][] = "hook_function";...
php
public static function runHook( $hook_name, $args = array() ) { global $pgHooks; if( !isset( $pgHooks[$hook_name] ) ) return null; if( !is_array( $pgHooks[$hook_name] ) ) { throw new HookError( "Hook assignment for event `$hook_name` is not an array. Syntax is " . '$pgHooks[\'hookname\'][] = "hook_function";...
[ "public", "static", "function", "runHook", "(", "$", "hook_name", ",", "$", "args", "=", "array", "(", ")", ")", "{", "global", "$", "pgHooks", ";", "if", "(", "!", "isset", "(", "$", "pgHooks", "[", "$", "hook_name", "]", ")", ")", "return", "null...
Search for hook functions and run them if defined @param string $hook_name Name of hook to search for @param array $args Arguments to pass to the hook function @throws HookError @throws BadEntryError @return mixed Output of hook function
[ "Search", "for", "hook", "functions", "and", "run", "them", "if", "defined" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Hooks.php#L42-L97
234,027
kaliop-uk/kueueingbundle
Service/MessageConsumer.php
MessageConsumer.getDriverForMessage
protected function getDriverForMessage($message) { $this->loadRegisteredDrivers(); foreach ($this->drivers as $driver) { if ($driver->acceptMessage($message)) return $driver; } throw new \Exception('No driver found to decode message of type: ' . get_class...
php
protected function getDriverForMessage($message) { $this->loadRegisteredDrivers(); foreach ($this->drivers as $driver) { if ($driver->acceptMessage($message)) return $driver; } throw new \Exception('No driver found to decode message of type: ' . get_class...
[ "protected", "function", "getDriverForMessage", "(", "$", "message", ")", "{", "$", "this", "->", "loadRegisteredDrivers", "(", ")", ";", "foreach", "(", "$", "this", "->", "drivers", "as", "$", "driver", ")", "{", "if", "(", "$", "driver", "->", "accept...
Finds a driver appropriate to decode the message @param mixed $message @return DriverInterface @throws \Exception
[ "Finds", "a", "driver", "appropriate", "to", "decode", "the", "message" ]
6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987
https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Service/MessageConsumer.php#L134-L143
234,028
kaliop-uk/kueueingbundle
Service/MessageConsumer.php
MessageConsumer.decodeMessageBody
protected function decodeMessageBody(MessageInterface $msg) { // do we accept this type? (nb: this is an optional property) $type = $msg->getContentType(); if ($type == '' && $this->assumedContentType != '') { $type = $this->assumedContentType; } if ($type == '' |...
php
protected function decodeMessageBody(MessageInterface $msg) { // do we accept this type? (nb: this is an optional property) $type = $msg->getContentType(); if ($type == '' && $this->assumedContentType != '') { $type = $this->assumedContentType; } if ($type == '' |...
[ "protected", "function", "decodeMessageBody", "(", "MessageInterface", "$", "msg", ")", "{", "// do we accept this type? (nb: this is an optional property)", "$", "type", "=", "$", "msg", "->", "getContentType", "(", ")", ";", "if", "(", "$", "type", "==", "''", "...
Works on the basis of the assumed and accepted content types @param MessageInterface $msg @return mixed @throws \RuntimeException @throws \UnexpectedValueException
[ "Works", "on", "the", "basis", "of", "the", "assumed", "and", "accepted", "content", "types" ]
6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987
https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Service/MessageConsumer.php#L216-L246
234,029
mrTimofey/laravel-simple-tokens
src/SimpleProvider.php
SimpleProvider.forget
public function forget(string $token): void { $this->cache->forget($this->getCacheKey($token)); }
php
public function forget(string $token): void { $this->cache->forget($this->getCacheKey($token)); }
[ "public", "function", "forget", "(", "string", "$", "token", ")", ":", "void", "{", "$", "this", "->", "cache", "->", "forget", "(", "$", "this", "->", "getCacheKey", "(", "$", "token", ")", ")", ";", "}" ]
Forget token. @param string $token
[ "Forget", "token", "." ]
b481f56167e00d81a70ba019fe88b055600890a8
https://github.com/mrTimofey/laravel-simple-tokens/blob/b481f56167e00d81a70ba019fe88b055600890a8/src/SimpleProvider.php#L71-L74
234,030
mrTimofey/laravel-simple-tokens
src/SimpleProvider.php
SimpleProvider.issueToken
public function issueToken(Authenticatable $user): string { $token = str_random(60); $this->cache->put($this->getCacheKey($token), $user->getAuthIdentifier(), $this->config['token_ttl']); return $token; }
php
public function issueToken(Authenticatable $user): string { $token = str_random(60); $this->cache->put($this->getCacheKey($token), $user->getAuthIdentifier(), $this->config['token_ttl']); return $token; }
[ "public", "function", "issueToken", "(", "Authenticatable", "$", "user", ")", ":", "string", "{", "$", "token", "=", "str_random", "(", "60", ")", ";", "$", "this", "->", "cache", "->", "put", "(", "$", "this", "->", "getCacheKey", "(", "$", "token", ...
Create new token for a model instance and store it in cache. @param Authenticatable $user @return string
[ "Create", "new", "token", "for", "a", "model", "instance", "and", "store", "it", "in", "cache", "." ]
b481f56167e00d81a70ba019fe88b055600890a8
https://github.com/mrTimofey/laravel-simple-tokens/blob/b481f56167e00d81a70ba019fe88b055600890a8/src/SimpleProvider.php#L81-L86
234,031
mintware-de/data-model-mapper
src/ObjectMapper.php
ObjectMapper.map
public function map($rawData, $targetClass) { // Deserialize the data try { if ($this->serializer instanceof SerializerInterface === false) { throw new SerializerException("You've to specify a serializer with the setSerializer() method."); } $data...
php
public function map($rawData, $targetClass) { // Deserialize the data try { if ($this->serializer instanceof SerializerInterface === false) { throw new SerializerException("You've to specify a serializer with the setSerializer() method."); } $data...
[ "public", "function", "map", "(", "$", "rawData", ",", "$", "targetClass", ")", "{", "// Deserialize the data", "try", "{", "if", "(", "$", "this", "->", "serializer", "instanceof", "SerializerInterface", "===", "false", ")", "{", "throw", "new", "SerializerEx...
Maps raw data to a object @param string $rawData The raw data @param string $targetClass The target object class @return mixed The mapped object @throws SerializerException If the data couldn't be deserialized @throws ClassNotFoundException If the target class does not exist @throws PropertyNotAccessibleException If...
[ "Maps", "raw", "data", "to", "a", "object" ]
d7dfbaaee208b0c5feb07ff45166c6b5f00adb14
https://github.com/mintware-de/data-model-mapper/blob/d7dfbaaee208b0c5feb07ff45166c6b5f00adb14/src/ObjectMapper.php#L88-L117
234,032
mintware-de/data-model-mapper
src/ObjectMapper.php
ObjectMapper.setPropertyValue
protected function setPropertyValue($object, \ReflectionProperty $property, $value) { if ($value !== null) { // If the property is public accessible, set the value directly if ($property->isPublic()) { $object->{$property->name} = $value; } else { ...
php
protected function setPropertyValue($object, \ReflectionProperty $property, $value) { if ($value !== null) { // If the property is public accessible, set the value directly if ($property->isPublic()) { $object->{$property->name} = $value; } else { ...
[ "protected", "function", "setPropertyValue", "(", "$", "object", ",", "\\", "ReflectionProperty", "$", "property", ",", "$", "value", ")", "{", "if", "(", "$", "value", "!==", "null", ")", "{", "// If the property is public accessible, set the value directly", "if",...
Sets a property of an object @param object $object The object @param \ReflectionProperty $property The Property @param mixed $value The new value
[ "Sets", "a", "property", "of", "an", "object" ]
d7dfbaaee208b0c5feb07ff45166c6b5f00adb14
https://github.com/mintware-de/data-model-mapper/blob/d7dfbaaee208b0c5feb07ff45166c6b5f00adb14/src/ObjectMapper.php#L581-L597
234,033
willmorgan/silverstripe-cropperfield
code/Cropper/GenericCropper.php
GenericCropper.getCropDimensions
public function getCropDimensions() { $x = $this->getCropX(); $y = $this->getCropY(); $cropWidth = $this->getCropWidth(); $cropHeight = $this->getCropHeight(); $width = $cropWidth; $height = $cropHeight; // Normalise the width/height with respect to the aspect ratio $maxWidth = $this->getMaxWidth(); ...
php
public function getCropDimensions() { $x = $this->getCropX(); $y = $this->getCropY(); $cropWidth = $this->getCropWidth(); $cropHeight = $this->getCropHeight(); $width = $cropWidth; $height = $cropHeight; // Normalise the width/height with respect to the aspect ratio $maxWidth = $this->getMaxWidth(); ...
[ "public", "function", "getCropDimensions", "(", ")", "{", "$", "x", "=", "$", "this", "->", "getCropX", "(", ")", ";", "$", "y", "=", "$", "this", "->", "getCropY", "(", ")", ";", "$", "cropWidth", "=", "$", "this", "->", "getCropWidth", "(", ")", ...
Ensure the aspect ratio is respected regardless of any dodgy data. The aspect ratio is otherwise
[ "Ensure", "the", "aspect", "ratio", "is", "respected", "regardless", "of", "any", "dodgy", "data", ".", "The", "aspect", "ratio", "is", "otherwise" ]
855ca4f44dd392b1cf9d36f411a2c145b4b3d975
https://github.com/willmorgan/silverstripe-cropperfield/blob/855ca4f44dd392b1cf9d36f411a2c145b4b3d975/code/Cropper/GenericCropper.php#L176-L224
234,034
willmorgan/silverstripe-cropperfield
code/Cropper/GenericCropper.php
GenericCropper.normaliseFilename
protected function normaliseFilename($absolutePath) { $regex = sprintf( '#^%s#', addslashes(BASE_PATH) . DIRECTORY_SEPARATOR ); return preg_replace($regex, '', $absolutePath); }
php
protected function normaliseFilename($absolutePath) { $regex = sprintf( '#^%s#', addslashes(BASE_PATH) . DIRECTORY_SEPARATOR ); return preg_replace($regex, '', $absolutePath); }
[ "protected", "function", "normaliseFilename", "(", "$", "absolutePath", ")", "{", "$", "regex", "=", "sprintf", "(", "'#^%s#'", ",", "addslashes", "(", "BASE_PATH", ")", ".", "DIRECTORY_SEPARATOR", ")", ";", "return", "preg_replace", "(", "$", "regex", ",", ...
Convert an absolute path to one relative to the base path @return string
[ "Convert", "an", "absolute", "path", "to", "one", "relative", "to", "the", "base", "path" ]
855ca4f44dd392b1cf9d36f411a2c145b4b3d975
https://github.com/willmorgan/silverstripe-cropperfield/blob/855ca4f44dd392b1cf9d36f411a2c145b4b3d975/code/Cropper/GenericCropper.php#L257-L263
234,035
yarcode/yii2-email-manager
src/EmailManager.php
EmailManager.queue
public function queue($from, $to, $subject, $text, $priority = 0, $files = [], $bcc = null) { if (is_array($bcc)) { $bcc = implode(', ', $bcc); } $model = new Message(); $model->from = $from; $model->to = $to; $model->subject = $subject; $model->t...
php
public function queue($from, $to, $subject, $text, $priority = 0, $files = [], $bcc = null) { if (is_array($bcc)) { $bcc = implode(', ', $bcc); } $model = new Message(); $model->from = $from; $model->to = $to; $model->subject = $subject; $model->t...
[ "public", "function", "queue", "(", "$", "from", ",", "$", "to", ",", "$", "subject", ",", "$", "text", ",", "$", "priority", "=", "0", ",", "$", "files", "=", "[", "]", ",", "$", "bcc", "=", "null", ")", "{", "if", "(", "is_array", "(", "$",...
Queues email message @param $from @param $to @param $subject @param $text @param int $priority @param array $files @param null $bcc @return bool
[ "Queues", "email", "message" ]
4e83eae67199fc2b9eca9f08dcf59cc0440c385a
https://github.com/yarcode/yii2-email-manager/blob/4e83eae67199fc2b9eca9f08dcf59cc0440c385a/src/EmailManager.php#L70-L86
234,036
yarcode/yii2-email-manager
src/EmailManager.php
EmailManager.send
public function send($from, $to, $subject, $text, $files = [], $bcc = null) { $files = $files === null ? [] : $files; return $this->transports[$this->defaultTransport]->send($from, $to, $subject, $text, $files, $bcc); }
php
public function send($from, $to, $subject, $text, $files = [], $bcc = null) { $files = $files === null ? [] : $files; return $this->transports[$this->defaultTransport]->send($from, $to, $subject, $text, $files, $bcc); }
[ "public", "function", "send", "(", "$", "from", ",", "$", "to", ",", "$", "subject", ",", "$", "text", ",", "$", "files", "=", "[", "]", ",", "$", "bcc", "=", "null", ")", "{", "$", "files", "=", "$", "files", "===", "null", "?", "[", "]", ...
Sends email message immediately using default transport @param string $from @param string $to @param string $subject @param string $text @param array $files @param array|string $bcc @return bool
[ "Sends", "email", "message", "immediately", "using", "default", "transport" ]
4e83eae67199fc2b9eca9f08dcf59cc0440c385a
https://github.com/yarcode/yii2-email-manager/blob/4e83eae67199fc2b9eca9f08dcf59cc0440c385a/src/EmailManager.php#L99-L104
234,037
skrz/meta
gen-src/Google/Protobuf/Meta/FileOptionsMeta.php
FileOptionsMeta.create
public static function create() { switch (func_num_args()) { case 0: return new FileOptions(); case 1: return new FileOptions(func_get_arg(0)); case 2: return new FileOptions(func_get_arg(0), func_get_arg(1)); case 3: return new FileOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2...
php
public static function create() { switch (func_num_args()) { case 0: return new FileOptions(); case 1: return new FileOptions(func_get_arg(0)); case 2: return new FileOptions(func_get_arg(0), func_get_arg(1)); case 3: return new FileOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2...
[ "public", "static", "function", "create", "(", ")", "{", "switch", "(", "func_num_args", "(", ")", ")", "{", "case", "0", ":", "return", "new", "FileOptions", "(", ")", ";", "case", "1", ":", "return", "new", "FileOptions", "(", "func_get_arg", "(", "0...
Creates new instance of \Google\Protobuf\FileOptions @throws \InvalidArgumentException @return FileOptions
[ "Creates", "new", "instance", "of", "\\", "Google", "\\", "Protobuf", "\\", "FileOptions" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FileOptionsMeta.php#L72-L96
234,038
skrz/meta
gen-src/Google/Protobuf/Meta/FileOptionsMeta.php
FileOptionsMeta.reset
public static function reset($object) { if (!($object instanceof FileOptions)) { throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FileOptions.'); } $object->javaPackage = NULL; $object->javaOuterClassname = NULL; $object->javaMultipleFiles = NULL; $object->javaGenera...
php
public static function reset($object) { if (!($object instanceof FileOptions)) { throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FileOptions.'); } $object->javaPackage = NULL; $object->javaOuterClassname = NULL; $object->javaMultipleFiles = NULL; $object->javaGenera...
[ "public", "static", "function", "reset", "(", "$", "object", ")", "{", "if", "(", "!", "(", "$", "object", "instanceof", "FileOptions", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'You have to pass object of class Google\\Protobuf\\FileOpt...
Resets properties of \Google\Protobuf\FileOptions to default values @param FileOptions $object @throws \InvalidArgumentException @return void
[ "Resets", "properties", "of", "\\", "Google", "\\", "Protobuf", "\\", "FileOptions", "to", "default", "values" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FileOptionsMeta.php#L109-L130
234,039
yeephp/yeephp
Yee/Router.php
Router.map
public function map(\Yee\Route $route) { list($groupPattern, $groupMiddleware) = $this->processGroups(); $route->setPattern($groupPattern . $route->getPattern()); $this->routes[] = $route; foreach ($groupMiddleware as $middleware) { $route->setMiddleware($middleware); ...
php
public function map(\Yee\Route $route) { list($groupPattern, $groupMiddleware) = $this->processGroups(); $route->setPattern($groupPattern . $route->getPattern()); $this->routes[] = $route; foreach ($groupMiddleware as $middleware) { $route->setMiddleware($middleware); ...
[ "public", "function", "map", "(", "\\", "Yee", "\\", "Route", "$", "route", ")", "{", "list", "(", "$", "groupPattern", ",", "$", "groupMiddleware", ")", "=", "$", "this", "->", "processGroups", "(", ")", ";", "$", "route", "->", "setPattern", "(", "...
Add a route object to the router @param \Yee\Route $route The Yee Route
[ "Add", "a", "route", "object", "to", "the", "router" ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Router.php#L126-L137
234,040
yeephp/yeephp
Yee/Router.php
Router.getNamedRoute
public function getNamedRoute($name) { $this->getNamedRoutes(); if ($this->hasNamedRoute($name)) { return $this->namedRoutes[(string) $name]; } else { return null; } }
php
public function getNamedRoute($name) { $this->getNamedRoutes(); if ($this->hasNamedRoute($name)) { return $this->namedRoutes[(string) $name]; } else { return null; } }
[ "public", "function", "getNamedRoute", "(", "$", "name", ")", "{", "$", "this", "->", "getNamedRoutes", "(", ")", ";", "if", "(", "$", "this", "->", "hasNamedRoute", "(", "$", "name", ")", ")", "{", "return", "$", "this", "->", "namedRoutes", "[", "(...
Get named route @param string $name @return \Yee\Route|null
[ "Get", "named", "route" ]
6107f60ceaf0811a6550872bd669580ac282cb1f
https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Router.php#L230-L238
234,041
baleen/migrations
src/Delta/Collection/Resolver/AbstractResolver.php
AbstractResolver.cacheGet
private function cacheGet($alias, Collection $collection) { $result = false; if ($this->cacheEnabled) { $hash = spl_object_hash($collection); if (isset($this->cache[$hash]) && array_key_exists($alias, $this->cache[$hash])) { $result = $this->cache[$hash][$ali...
php
private function cacheGet($alias, Collection $collection) { $result = false; if ($this->cacheEnabled) { $hash = spl_object_hash($collection); if (isset($this->cache[$hash]) && array_key_exists($alias, $this->cache[$hash])) { $result = $this->cache[$hash][$ali...
[ "private", "function", "cacheGet", "(", "$", "alias", ",", "Collection", "$", "collection", ")", "{", "$", "result", "=", "false", ";", "if", "(", "$", "this", "->", "cacheEnabled", ")", "{", "$", "hash", "=", "spl_object_hash", "(", "$", "collection", ...
Gets an alias from the cache. Returns false if nothing could be found, a Delta if the alias was previously resolved to a version, and null if the alias couldn't be resolved in a previous call. @param string $alias @param Collection $collection @return bool|null|DeltaInterface
[ "Gets", "an", "alias", "from", "the", "cache", ".", "Returns", "false", "if", "nothing", "could", "be", "found", "a", "Delta", "if", "the", "alias", "was", "previously", "resolved", "to", "a", "version", "and", "null", "if", "the", "alias", "couldn", "t"...
cfc8c439858cf4f0d4119af9eb67de493da8d95c
https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Delta/Collection/Resolver/AbstractResolver.php#L82-L94
234,042
baleen/migrations
src/Delta/Collection/Resolver/AbstractResolver.php
AbstractResolver.cacheSet
private function cacheSet($alias, $collection, $result) { if (!$this->cacheEnabled) { return null; } $hash = spl_object_hash($collection); if (!isset($this->cache[$hash])) { $this->cache[$hash] = []; // initialize the collection's cache } $thi...
php
private function cacheSet($alias, $collection, $result) { if (!$this->cacheEnabled) { return null; } $hash = spl_object_hash($collection); if (!isset($this->cache[$hash])) { $this->cache[$hash] = []; // initialize the collection's cache } $thi...
[ "private", "function", "cacheSet", "(", "$", "alias", ",", "$", "collection", ",", "$", "result", ")", "{", "if", "(", "!", "$", "this", "->", "cacheEnabled", ")", "{", "return", "null", ";", "}", "$", "hash", "=", "spl_object_hash", "(", "$", "colle...
Saves the result of resolving an alias against a given collection into the cache. @param string $alias @param \Baleen\Migrations\Delta\Collection\Collection $collection @param null|DeltaInterface $result @return void
[ "Saves", "the", "result", "of", "resolving", "an", "alias", "against", "a", "given", "collection", "into", "the", "cache", "." ]
cfc8c439858cf4f0d4119af9eb67de493da8d95c
https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Delta/Collection/Resolver/AbstractResolver.php#L105-L116
234,043
skrz/meta
gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php
FieldOptionsMeta.create
public static function create() { switch (func_num_args()) { case 0: return new FieldOptions(); case 1: return new FieldOptions(func_get_arg(0)); case 2: return new FieldOptions(func_get_arg(0), func_get_arg(1)); case 3: return new FieldOptions(func_get_arg(0), func_get_arg(1), func_get_a...
php
public static function create() { switch (func_num_args()) { case 0: return new FieldOptions(); case 1: return new FieldOptions(func_get_arg(0)); case 2: return new FieldOptions(func_get_arg(0), func_get_arg(1)); case 3: return new FieldOptions(func_get_arg(0), func_get_arg(1), func_get_a...
[ "public", "static", "function", "create", "(", ")", "{", "switch", "(", "func_num_args", "(", ")", ")", "{", "case", "0", ":", "return", "new", "FieldOptions", "(", ")", ";", "case", "1", ":", "return", "new", "FieldOptions", "(", "func_get_arg", "(", ...
Creates new instance of \Google\Protobuf\FieldOptions @throws \InvalidArgumentException @return FieldOptions
[ "Creates", "new", "instance", "of", "\\", "Google", "\\", "Protobuf", "\\", "FieldOptions" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php#L63-L87
234,044
skrz/meta
gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php
FieldOptionsMeta.reset
public static function reset($object) { if (!($object instanceof FieldOptions)) { throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FieldOptions.'); } $object->ctype = NULL; $object->packed = NULL; $object->jstype = NULL; $object->lazy = NULL; $object->deprecated = ...
php
public static function reset($object) { if (!($object instanceof FieldOptions)) { throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FieldOptions.'); } $object->ctype = NULL; $object->packed = NULL; $object->jstype = NULL; $object->lazy = NULL; $object->deprecated = ...
[ "public", "static", "function", "reset", "(", "$", "object", ")", "{", "if", "(", "!", "(", "$", "object", "instanceof", "FieldOptions", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'You have to pass object of class Google\\Protobuf\\FieldO...
Resets properties of \Google\Protobuf\FieldOptions to default values @param FieldOptions $object @throws \InvalidArgumentException @return void
[ "Resets", "properties", "of", "\\", "Google", "\\", "Protobuf", "\\", "FieldOptions", "to", "default", "values" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php#L100-L112
234,045
skrz/meta
gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php
FieldOptionsMeta.hash
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE) { if (is_string($algoOrCtx)) { $ctx = hash_init($algoOrCtx); } else { $ctx = $algoOrCtx; } if (isset($object->ctype)) { hash_update($ctx, 'ctype'); hash_update($ctx, (string)$object->ctype); } if (isset($object->packed)) {...
php
public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE) { if (is_string($algoOrCtx)) { $ctx = hash_init($algoOrCtx); } else { $ctx = $algoOrCtx; } if (isset($object->ctype)) { hash_update($ctx, 'ctype'); hash_update($ctx, (string)$object->ctype); } if (isset($object->packed)) {...
[ "public", "static", "function", "hash", "(", "$", "object", ",", "$", "algoOrCtx", "=", "'md5'", ",", "$", "raw", "=", "FALSE", ")", "{", "if", "(", "is_string", "(", "$", "algoOrCtx", ")", ")", "{", "$", "ctx", "=", "hash_init", "(", "$", "algoOrC...
Computes hash of \Google\Protobuf\FieldOptions @param object $object @param string|resource $algoOrCtx @param bool $raw @return string|void
[ "Computes", "hash", "of", "\\", "Google", "\\", "Protobuf", "\\", "FieldOptions" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php#L124-L174
234,046
skrz/meta
gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php
FieldOptionsMeta.toProtobuf
public static function toProtobuf($object, $filter = NULL) { $output = ''; if (isset($object->ctype) && ($filter === null || isset($filter['ctype']))) { $output .= "\x08"; $output .= Binary::encodeVarint($object->ctype); } if (isset($object->packed) && ($filter === null || isset($filter['packed']))) { ...
php
public static function toProtobuf($object, $filter = NULL) { $output = ''; if (isset($object->ctype) && ($filter === null || isset($filter['ctype']))) { $output .= "\x08"; $output .= Binary::encodeVarint($object->ctype); } if (isset($object->packed) && ($filter === null || isset($filter['packed']))) { ...
[ "public", "static", "function", "toProtobuf", "(", "$", "object", ",", "$", "filter", "=", "NULL", ")", "{", "$", "output", "=", "''", ";", "if", "(", "isset", "(", "$", "object", "->", "ctype", ")", "&&", "(", "$", "filter", "===", "null", "||", ...
Serialized \Google\Protobuf\FieldOptions to Protocol Buffers message. @param FieldOptions $object @param array $filter @throws \Exception @return string
[ "Serialized", "\\", "Google", "\\", "Protobuf", "\\", "FieldOptions", "to", "Protocol", "Buffers", "message", "." ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FieldOptionsMeta.php#L291-L335
234,047
nymo/silex-twig-breadcrumb-extension
src/nymo/Resources/Library/BreadCrumbCollection.php
BreadCrumbCollection.addItem
public function addItem($linkName, $target = null) { if (is_array($target)) { $target = isset($target['params']) ? $this->urlGen->generate( $target['route'], $target['params'] ) : $this->urlGen->generate($target['route']); } $this->item...
php
public function addItem($linkName, $target = null) { if (is_array($target)) { $target = isset($target['params']) ? $this->urlGen->generate( $target['route'], $target['params'] ) : $this->urlGen->generate($target['route']); } $this->item...
[ "public", "function", "addItem", "(", "$", "linkName", ",", "$", "target", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "target", ")", ")", "{", "$", "target", "=", "isset", "(", "$", "target", "[", "'params'", "]", ")", "?", "$", "thi...
Add new breadcrumb item @param string $linkName @param string|null $target @deprecated since 3.0 will be removed in 3.1 use function addSimpleItem or addRouteItem instead @return void
[ "Add", "new", "breadcrumb", "item" ]
9ddf46710f40ba06b47427d01e5b8c7e6c1d0b56
https://github.com/nymo/silex-twig-breadcrumb-extension/blob/9ddf46710f40ba06b47427d01e5b8c7e6c1d0b56/src/nymo/Resources/Library/BreadCrumbCollection.php#L38-L47
234,048
nymo/silex-twig-breadcrumb-extension
src/nymo/Resources/Library/BreadCrumbCollection.php
BreadCrumbCollection.addSimpleItem
public function addSimpleItem(string $linkName, string $target = null): void { $this->items[] = ["linkName" => $linkName, "target" => $target]; }
php
public function addSimpleItem(string $linkName, string $target = null): void { $this->items[] = ["linkName" => $linkName, "target" => $target]; }
[ "public", "function", "addSimpleItem", "(", "string", "$", "linkName", ",", "string", "$", "target", "=", "null", ")", ":", "void", "{", "$", "this", "->", "items", "[", "]", "=", "[", "\"linkName\"", "=>", "$", "linkName", ",", "\"target\"", "=>", "$"...
Adds new simple breadcrumb item. Leave target empty to create a breadcrumb item without a link. @param string $linkName @param string|null $target @return void
[ "Adds", "new", "simple", "breadcrumb", "item", ".", "Leave", "target", "empty", "to", "create", "a", "breadcrumb", "item", "without", "a", "link", "." ]
9ddf46710f40ba06b47427d01e5b8c7e6c1d0b56
https://github.com/nymo/silex-twig-breadcrumb-extension/blob/9ddf46710f40ba06b47427d01e5b8c7e6c1d0b56/src/nymo/Resources/Library/BreadCrumbCollection.php#L55-L58
234,049
nymo/silex-twig-breadcrumb-extension
src/nymo/Resources/Library/BreadCrumbCollection.php
BreadCrumbCollection.addRouteItem
public function addRouteItem(string $linkName, array $route): void { $url = isset($route['params']) ? $this->urlGen->generate($route['route'], $route['params']) : $this->urlGen->generate($route['route']); $this->addSimpleItem($linkName, $url); }
php
public function addRouteItem(string $linkName, array $route): void { $url = isset($route['params']) ? $this->urlGen->generate($route['route'], $route['params']) : $this->urlGen->generate($route['route']); $this->addSimpleItem($linkName, $url); }
[ "public", "function", "addRouteItem", "(", "string", "$", "linkName", ",", "array", "$", "route", ")", ":", "void", "{", "$", "url", "=", "isset", "(", "$", "route", "[", "'params'", "]", ")", "?", "$", "this", "->", "urlGen", "->", "generate", "(", ...
Adds new breadcrumb item where target is being generated by the url generator @param string $linkName @param array $route @return void
[ "Adds", "new", "breadcrumb", "item", "where", "target", "is", "being", "generated", "by", "the", "url", "generator" ]
9ddf46710f40ba06b47427d01e5b8c7e6c1d0b56
https://github.com/nymo/silex-twig-breadcrumb-extension/blob/9ddf46710f40ba06b47427d01e5b8c7e6c1d0b56/src/nymo/Resources/Library/BreadCrumbCollection.php#L66-L72
234,050
kss-php/kss-php
lib/Section.php
Section.getTitle
public function getTitle() { $title = ''; $titleComment = $this->getTitleComment(); if (preg_match('/^\s*#+\s*(.+)/', $titleComment, $matches)) { $title = $matches[1]; } elseif (self::isReferenceNumeric($this->getReference())) { return $this->getReference(); ...
php
public function getTitle() { $title = ''; $titleComment = $this->getTitleComment(); if (preg_match('/^\s*#+\s*(.+)/', $titleComment, $matches)) { $title = $matches[1]; } elseif (self::isReferenceNumeric($this->getReference())) { return $this->getReference(); ...
[ "public", "function", "getTitle", "(", ")", "{", "$", "title", "=", "''", ";", "$", "titleComment", "=", "$", "this", "->", "getTitleComment", "(", ")", ";", "if", "(", "preg_match", "(", "'/^\\s*#+\\s*(.+)/'", ",", "$", "titleComment", ",", "$", "matche...
Returns the title of the section @return string
[ "Returns", "the", "title", "of", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L108-L123
234,051
kss-php/kss-php
lib/Section.php
Section.getDescription
public function getDescription() { $descriptionSections = array(); foreach ($this->getCommentSections() as $commentSection) { // Anything that is not the section comment or modifiers comment // must be the description comment if ($commentSection != $this->getRefe...
php
public function getDescription() { $descriptionSections = array(); foreach ($this->getCommentSections() as $commentSection) { // Anything that is not the section comment or modifiers comment // must be the description comment if ($commentSection != $this->getRefe...
[ "public", "function", "getDescription", "(", ")", "{", "$", "descriptionSections", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Anything that is not the section comment o...
Returns the description for the section @return string
[ "Returns", "the", "description", "for", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L130-L151
234,052
kss-php/kss-php
lib/Section.php
Section.getMarkup
public function getMarkup() { if ($this->markup === null) { if ($markupComment = $this->getMarkupComment()) { $this->markup = trim(preg_replace('/^\s*Markup:/i', '', $markupComment)); } } return $this->markup; }
php
public function getMarkup() { if ($this->markup === null) { if ($markupComment = $this->getMarkupComment()) { $this->markup = trim(preg_replace('/^\s*Markup:/i', '', $markupComment)); } } return $this->markup; }
[ "public", "function", "getMarkup", "(", ")", "{", "if", "(", "$", "this", "->", "markup", "===", "null", ")", "{", "if", "(", "$", "markupComment", "=", "$", "this", "->", "getMarkupComment", "(", ")", ")", "{", "$", "this", "->", "markup", "=", "t...
Returns the markup defined in the section @return string
[ "Returns", "the", "markup", "defined", "in", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L158-L167
234,053
kss-php/kss-php
lib/Section.php
Section.getDeprecated
public function getDeprecated() { if ($this->deprecated === null) { if ($deprecatedComment = $this->getDeprecatedComment()) { $this->deprecated = trim(preg_replace('/^\s*Deprecated:/i', '', $deprecatedComment)); } } return $this->deprecated; }
php
public function getDeprecated() { if ($this->deprecated === null) { if ($deprecatedComment = $this->getDeprecatedComment()) { $this->deprecated = trim(preg_replace('/^\s*Deprecated:/i', '', $deprecatedComment)); } } return $this->deprecated; }
[ "public", "function", "getDeprecated", "(", ")", "{", "if", "(", "$", "this", "->", "deprecated", "===", "null", ")", "{", "if", "(", "$", "deprecatedComment", "=", "$", "this", "->", "getDeprecatedComment", "(", ")", ")", "{", "$", "this", "->", "depr...
Returns the deprecation notice defined in the section @return string
[ "Returns", "the", "deprecation", "notice", "defined", "in", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L195-L204
234,054
kss-php/kss-php
lib/Section.php
Section.getExperimental
public function getExperimental() { if ($this->experimental === null) { if ($experimentalComment = $this->getExperimentalComment()) { $this->experimental = trim(preg_replace('/^\s*Experimental:/i', '', $experimentalComment)); } } return $this->experim...
php
public function getExperimental() { if ($this->experimental === null) { if ($experimentalComment = $this->getExperimentalComment()) { $this->experimental = trim(preg_replace('/^\s*Experimental:/i', '', $experimentalComment)); } } return $this->experim...
[ "public", "function", "getExperimental", "(", ")", "{", "if", "(", "$", "this", "->", "experimental", "===", "null", ")", "{", "if", "(", "$", "experimentalComment", "=", "$", "this", "->", "getExperimentalComment", "(", ")", ")", "{", "$", "this", "->",...
Returns the experimental notice defined in the section @return string
[ "Returns", "the", "experimental", "notice", "defined", "in", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L211-L220
234,055
kss-php/kss-php
lib/Section.php
Section.getCompatibility
public function getCompatibility() { if ($this->compatibility === null) { if ($compatibilityComment = $this->getCompatibilityComment()) { $this->compatibility = trim($compatibilityComment); } } return $this->compatibility; }
php
public function getCompatibility() { if ($this->compatibility === null) { if ($compatibilityComment = $this->getCompatibilityComment()) { $this->compatibility = trim($compatibilityComment); } } return $this->compatibility; }
[ "public", "function", "getCompatibility", "(", ")", "{", "if", "(", "$", "this", "->", "compatibility", "===", "null", ")", "{", "if", "(", "$", "compatibilityComment", "=", "$", "this", "->", "getCompatibilityComment", "(", ")", ")", "{", "$", "this", "...
Returns the compatibility notice defined in the section @return string
[ "Returns", "the", "compatibility", "notice", "defined", "in", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L227-L236
234,056
kss-php/kss-php
lib/Section.php
Section.getModifiers
public function getModifiers() { $lastIndent = null; $modifiers = array(); if ($modiferComment = $this->getModifiersComment()) { $modifierLines = explode("\n", $modiferComment); foreach ($modifierLines as $line) { if (empty($line)) { ...
php
public function getModifiers() { $lastIndent = null; $modifiers = array(); if ($modiferComment = $this->getModifiersComment()) { $modifierLines = explode("\n", $modiferComment); foreach ($modifierLines as $line) { if (empty($line)) { ...
[ "public", "function", "getModifiers", "(", ")", "{", "$", "lastIndent", "=", "null", ";", "$", "modifiers", "=", "array", "(", ")", ";", "if", "(", "$", "modiferComment", "=", "$", "this", "->", "getModifiersComment", "(", ")", ")", "{", "$", "modifier...
Returns the modifiers used in the section @return array
[ "Returns", "the", "modifiers", "used", "in", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L243-L282
234,057
kss-php/kss-php
lib/Section.php
Section.getReference
public function getReference($trimmed = false) { if ($this->reference === null) { $referenceComment = $this->getReferenceComment(); $referenceComment = preg_replace('/\.$/', '', $referenceComment); if (preg_match('/^\s*Styleguide\s+(.*)/i', $referenceComment, $matches)) ...
php
public function getReference($trimmed = false) { if ($this->reference === null) { $referenceComment = $this->getReferenceComment(); $referenceComment = preg_replace('/\.$/', '', $referenceComment); if (preg_match('/^\s*Styleguide\s+(.*)/i', $referenceComment, $matches)) ...
[ "public", "function", "getReference", "(", "$", "trimmed", "=", "false", ")", "{", "if", "(", "$", "this", "->", "reference", "===", "null", ")", "{", "$", "referenceComment", "=", "$", "this", "->", "getReferenceComment", "(", ")", ";", "$", "referenceC...
Returns the reference number for the section @param boolean $trimmed OPTIONAL @return string
[ "Returns", "the", "reference", "number", "for", "the", "section" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L337-L351
234,058
kss-php/kss-php
lib/Section.php
Section.getReferenceDotDelimited
protected function getReferenceDotDelimited() { if (empty($this->referenceDotDelimited)) { $this->referenceDotDelimited = self::normalizeReference($this->getReference()); } return $this->referenceDotDelimited; }
php
protected function getReferenceDotDelimited() { if (empty($this->referenceDotDelimited)) { $this->referenceDotDelimited = self::normalizeReference($this->getReference()); } return $this->referenceDotDelimited; }
[ "protected", "function", "getReferenceDotDelimited", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "referenceDotDelimited", ")", ")", "{", "$", "this", "->", "referenceDotDelimited", "=", "self", "::", "normalizeReference", "(", "$", "this", "->",...
Returns the reference dot delimited @return string
[ "Returns", "the", "reference", "dot", "delimited" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L358-L364
234,059
kss-php/kss-php
lib/Section.php
Section.trimReference
public static function trimReference($reference) { if (substr($reference, -1) == '.' || substr($reference, -1) == '-') { $reference = trim(substr($reference, 0, -1)); } while (preg_match('/(\.0+)$/', $reference, $matches)) { $reference = substr($reference, 0, strlen($...
php
public static function trimReference($reference) { if (substr($reference, -1) == '.' || substr($reference, -1) == '-') { $reference = trim(substr($reference, 0, -1)); } while (preg_match('/(\.0+)$/', $reference, $matches)) { $reference = substr($reference, 0, strlen($...
[ "public", "static", "function", "trimReference", "(", "$", "reference", ")", "{", "if", "(", "substr", "(", "$", "reference", ",", "-", "1", ")", "==", "'.'", "||", "substr", "(", "$", "reference", ",", "-", "1", ")", "==", "'-'", ")", "{", "$", ...
Trims off all trailing zeros and periods on a reference @param string $reference @return string
[ "Trims", "off", "all", "trailing", "zeros", "and", "periods", "on", "a", "reference" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L405-L414
234,060
kss-php/kss-php
lib/Section.php
Section.belongsToReference
public function belongsToReference($reference) { $reference = self::trimReference($reference); $reference = self::normalizeReference($reference); return stripos($this->getReferenceDotDelimited() . '.', $reference . '.') === 0; }
php
public function belongsToReference($reference) { $reference = self::trimReference($reference); $reference = self::normalizeReference($reference); return stripos($this->getReferenceDotDelimited() . '.', $reference . '.') === 0; }
[ "public", "function", "belongsToReference", "(", "$", "reference", ")", "{", "$", "reference", "=", "self", "::", "trimReference", "(", "$", "reference", ")", ";", "$", "reference", "=", "self", "::", "normalizeReference", "(", "$", "reference", ")", ";", ...
Checks to see if a section belongs to a specified reference @param string $reference @return boolean
[ "Checks", "to", "see", "if", "a", "section", "belongs", "to", "a", "specified", "reference" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L435-L440
234,061
kss-php/kss-php
lib/Section.php
Section.calcDepth
public static function calcDepth($reference) { $reference = self::trimReference($reference); $reference = self::normalizeReference($reference); return substr_count($reference, '.'); }
php
public static function calcDepth($reference) { $reference = self::trimReference($reference); $reference = self::normalizeReference($reference); return substr_count($reference, '.'); }
[ "public", "static", "function", "calcDepth", "(", "$", "reference", ")", "{", "$", "reference", "=", "self", "::", "trimReference", "(", "$", "reference", ")", ";", "$", "reference", "=", "self", "::", "normalizeReference", "(", "$", "reference", ")", ";",...
Calculates and returns the depth of a section reference @param string $reference @return int
[ "Calculates", "and", "returns", "the", "depth", "of", "a", "section", "reference" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L459-L464
234,062
kss-php/kss-php
lib/Section.php
Section.calcDepthScore
public static function calcDepthScore($reference) { if (!self::isReferenceNumeric($reference)) { return null; } $reference = self::trimReference($reference); $sectionParts = explode('.', $reference); $score = 0; foreach ($sectionParts as $level => $part) {...
php
public static function calcDepthScore($reference) { if (!self::isReferenceNumeric($reference)) { return null; } $reference = self::trimReference($reference); $sectionParts = explode('.', $reference); $score = 0; foreach ($sectionParts as $level => $part) {...
[ "public", "static", "function", "calcDepthScore", "(", "$", "reference", ")", "{", "if", "(", "!", "self", "::", "isReferenceNumeric", "(", "$", "reference", ")", ")", "{", "return", "null", ";", "}", "$", "reference", "=", "self", "::", "trimReference", ...
Calculates and returns the depth score for the section. Useful for sorting sections correctly by their section reference numbers @return int|null
[ "Calculates", "and", "returns", "the", "depth", "score", "for", "the", "section", ".", "Useful", "for", "sorting", "sections", "correctly", "by", "their", "section", "reference", "numbers" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L482-L494
234,063
kss-php/kss-php
lib/Section.php
Section.depthSort
public static function depthSort(Section $a, Section $b) { if ($a->getDepth() == $b->getDepth()) { return self::alphaDepthScoreSort($a, $b); } return $a->getDepth() > $b->getDepth(); }
php
public static function depthSort(Section $a, Section $b) { if ($a->getDepth() == $b->getDepth()) { return self::alphaDepthScoreSort($a, $b); } return $a->getDepth() > $b->getDepth(); }
[ "public", "static", "function", "depthSort", "(", "Section", "$", "a", ",", "Section", "$", "b", ")", "{", "if", "(", "$", "a", "->", "getDepth", "(", ")", "==", "$", "b", "->", "getDepth", "(", ")", ")", "{", "return", "self", "::", "alphaDepthSco...
Function to help sort sections by depth and then depth score or alphabetically @param Section $a @param Section $b @return int
[ "Function", "to", "help", "sort", "sections", "by", "depth", "and", "then", "depth", "score", "or", "alphabetically" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L504-L510
234,064
kss-php/kss-php
lib/Section.php
Section.alphaDepthScoreSort
public static function alphaDepthScoreSort(Section $a, Section $b) { $aNumeric = self::isReferenceNumeric($a->getReference()); $bNumeric = self::isReferenceNumeric($b->getReference()); if ($aNumeric && $bNumeric) { return self::depthScoreSort($a, $b); } elseif ($aNumeric...
php
public static function alphaDepthScoreSort(Section $a, Section $b) { $aNumeric = self::isReferenceNumeric($a->getReference()); $bNumeric = self::isReferenceNumeric($b->getReference()); if ($aNumeric && $bNumeric) { return self::depthScoreSort($a, $b); } elseif ($aNumeric...
[ "public", "static", "function", "alphaDepthScoreSort", "(", "Section", "$", "a", ",", "Section", "$", "b", ")", "{", "$", "aNumeric", "=", "self", "::", "isReferenceNumeric", "(", "$", "a", "->", "getReference", "(", ")", ")", ";", "$", "bNumeric", "=", ...
Function to help sort sections either by their depth score if numeric or alphabetically if non-numeric. @param Section $a @param Section $b @return int
[ "Function", "to", "help", "sort", "sections", "either", "by", "their", "depth", "score", "if", "numeric", "or", "alphabetically", "if", "non", "-", "numeric", "." ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L534-L551
234,065
kss-php/kss-php
lib/Section.php
Section.getCommentSections
protected function getCommentSections() { if (empty($this->commentSections) && $this->rawComment) { $this->commentSections = explode("\n\n", $this->rawComment); } return $this->commentSections; }
php
protected function getCommentSections() { if (empty($this->commentSections) && $this->rawComment) { $this->commentSections = explode("\n\n", $this->rawComment); } return $this->commentSections; }
[ "protected", "function", "getCommentSections", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "commentSections", ")", "&&", "$", "this", "->", "rawComment", ")", "{", "$", "this", "->", "commentSections", "=", "explode", "(", "\"\\n\\n\"", ",",...
Returns the comment block used when creating the section as an array of paragraphs within the comment block @return array
[ "Returns", "the", "comment", "block", "used", "when", "creating", "the", "section", "as", "an", "array", "of", "paragraphs", "within", "the", "comment", "block" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L559-L566
234,066
kss-php/kss-php
lib/Section.php
Section.getTitleComment
protected function getTitleComment() { $titleComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the title by the # markdown header syntax if (preg_match('/^\s*#/i', $commentSection)) { $titleComment = $commentSection; ...
php
protected function getTitleComment() { $titleComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the title by the # markdown header syntax if (preg_match('/^\s*#/i', $commentSection)) { $titleComment = $commentSection; ...
[ "protected", "function", "getTitleComment", "(", ")", "{", "$", "titleComment", "=", "null", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Identify the title by the # markdown header syntax", "if",...
Gets the title part of the KSS Comment Block @return string
[ "Gets", "the", "title", "part", "of", "the", "KSS", "Comment", "Block" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L573-L586
234,067
kss-php/kss-php
lib/Section.php
Section.getMarkupComment
protected function getMarkupComment() { $markupComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the markup comment by the Markup: marker if (preg_match('/^\s*Markup:/i', $commentSection)) { $markupComment = $commentSectio...
php
protected function getMarkupComment() { $markupComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the markup comment by the Markup: marker if (preg_match('/^\s*Markup:/i', $commentSection)) { $markupComment = $commentSectio...
[ "protected", "function", "getMarkupComment", "(", ")", "{", "$", "markupComment", "=", "null", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Identify the markup comment by the Markup: marker", "if"...
Returns the part of the KSS Comment Block that contains the markup @return string
[ "Returns", "the", "part", "of", "the", "KSS", "Comment", "Block", "that", "contains", "the", "markup" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L593-L606
234,068
kss-php/kss-php
lib/Section.php
Section.getDeprecatedComment
protected function getDeprecatedComment() { $deprecatedComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the deprecation notice by the Deprecated: marker if (preg_match('/^\s*Deprecated:/i', $commentSection)) { $deprecated...
php
protected function getDeprecatedComment() { $deprecatedComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the deprecation notice by the Deprecated: marker if (preg_match('/^\s*Deprecated:/i', $commentSection)) { $deprecated...
[ "protected", "function", "getDeprecatedComment", "(", ")", "{", "$", "deprecatedComment", "=", "null", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Identify the deprecation notice by the Deprecated:...
Returns the part of the KSS Comment Block that contains the deprecated notice @return string
[ "Returns", "the", "part", "of", "the", "KSS", "Comment", "Block", "that", "contains", "the", "deprecated", "notice" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L614-L627
234,069
kss-php/kss-php
lib/Section.php
Section.getExperimentalComment
protected function getExperimentalComment() { $experimentalComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the experimental notice by the Experimental: marker if (preg_match('/^\s*Experimental:/i', $commentSection)) { $e...
php
protected function getExperimentalComment() { $experimentalComment = null; foreach ($this->getCommentSections() as $commentSection) { // Identify the experimental notice by the Experimental: marker if (preg_match('/^\s*Experimental:/i', $commentSection)) { $e...
[ "protected", "function", "getExperimentalComment", "(", ")", "{", "$", "experimentalComment", "=", "null", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Identify the experimental notice by the Experi...
Returns the part of the KSS Comment Block that contains the experimental notice @return string
[ "Returns", "the", "part", "of", "the", "KSS", "Comment", "Block", "that", "contains", "the", "experimental", "notice" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L635-L648
234,070
kss-php/kss-php
lib/Section.php
Section.getCompatibilityComment
protected function getCompatibilityComment() { $compatibilityComment = null; foreach ($this->getCommentSections() as $commentSection) { // Compatible in IE6+, Firefox 2+, Safari 4+. // Compatibility: IE6+, Firefox 2+, Safari 4+. // Compatibility untested. ...
php
protected function getCompatibilityComment() { $compatibilityComment = null; foreach ($this->getCommentSections() as $commentSection) { // Compatible in IE6+, Firefox 2+, Safari 4+. // Compatibility: IE6+, Firefox 2+, Safari 4+. // Compatibility untested. ...
[ "protected", "function", "getCompatibilityComment", "(", ")", "{", "$", "compatibilityComment", "=", "null", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Compatible in IE6+, Firefox 2+, Safari 4+.",...
Returns the part of the KSS Comment Block that contains the compatibility notice @return string
[ "Returns", "the", "part", "of", "the", "KSS", "Comment", "Block", "that", "contains", "the", "compatibility", "notice" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L656-L671
234,071
kss-php/kss-php
lib/Section.php
Section.getReferenceComment
protected function getReferenceComment() { $referenceComment = null; $commentSections = $this->getCommentSections(); $lastLine = end($commentSections); if (preg_match('/^\s*Styleguide \w/i', $lastLine) || preg_match('/^\s*No styleguide reference/i', $lastLine) ) ...
php
protected function getReferenceComment() { $referenceComment = null; $commentSections = $this->getCommentSections(); $lastLine = end($commentSections); if (preg_match('/^\s*Styleguide \w/i', $lastLine) || preg_match('/^\s*No styleguide reference/i', $lastLine) ) ...
[ "protected", "function", "getReferenceComment", "(", ")", "{", "$", "referenceComment", "=", "null", ";", "$", "commentSections", "=", "$", "this", "->", "getCommentSections", "(", ")", ";", "$", "lastLine", "=", "end", "(", "$", "commentSections", ")", ";",...
Gets the part of the KSS Comment Block that contains the section reference @return string
[ "Gets", "the", "part", "of", "the", "KSS", "Comment", "Block", "that", "contains", "the", "section", "reference" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L678-L691
234,072
kss-php/kss-php
lib/Section.php
Section.getModifiersComment
protected function getModifiersComment() { $modifiersComment = null; foreach ($this->getCommentSections() as $commentSection) { // Assume that the modifiers section starts with either a class or a // pseudo class if (preg_match('/^\s*(?:\.|:)/', $commentSection))...
php
protected function getModifiersComment() { $modifiersComment = null; foreach ($this->getCommentSections() as $commentSection) { // Assume that the modifiers section starts with either a class or a // pseudo class if (preg_match('/^\s*(?:\.|:)/', $commentSection))...
[ "protected", "function", "getModifiersComment", "(", ")", "{", "$", "modifiersComment", "=", "null", ";", "foreach", "(", "$", "this", "->", "getCommentSections", "(", ")", "as", "$", "commentSection", ")", "{", "// Assume that the modifiers section starts with either...
Returns the part of the KSS Comment Block that contains the modifiers @return string
[ "Returns", "the", "part", "of", "the", "KSS", "Comment", "Block", "that", "contains", "the", "modifiers" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Section.php#L698-L712
234,073
kss-php/kss-php
lib/Parser.php
Parser.addSection
protected function addSection($comment, \splFileObject $file) { $section = new Section($comment, $file); $this->sections[$section->getReference(true)] = $section; $this->sectionsSortedByReference = false; }
php
protected function addSection($comment, \splFileObject $file) { $section = new Section($comment, $file); $this->sections[$section->getReference(true)] = $section; $this->sectionsSortedByReference = false; }
[ "protected", "function", "addSection", "(", "$", "comment", ",", "\\", "splFileObject", "$", "file", ")", "{", "$", "section", "=", "new", "Section", "(", "$", "comment", ",", "$", "file", ")", ";", "$", "this", "->", "sections", "[", "$", "section", ...
Adds a section to the Sections collection @param string $comment @param \splFileObject $file
[ "Adds", "a", "section", "to", "the", "Sections", "collection" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Parser.php#L61-L66
234,074
kss-php/kss-php
lib/Parser.php
Parser.getSection
public function getSection($reference) { $reference = Section::trimReference($reference); $reference = strtolower(Section::normalizeReference($reference)); foreach ($this->sections as $sectionKey => $section) { $potentialMatch = strtolower(Section::normalizeReference($sectionKey...
php
public function getSection($reference) { $reference = Section::trimReference($reference); $reference = strtolower(Section::normalizeReference($reference)); foreach ($this->sections as $sectionKey => $section) { $potentialMatch = strtolower(Section::normalizeReference($sectionKey...
[ "public", "function", "getSection", "(", "$", "reference", ")", "{", "$", "reference", "=", "Section", "::", "trimReference", "(", "$", "reference", ")", ";", "$", "reference", "=", "strtolower", "(", "Section", "::", "normalizeReference", "(", "$", "referen...
Returns a Section object matching the requested reference. If reference is not found, an empty Section object is returned instead @param string $reference @return Section @throws UnexepectedValueException if reference does not exist
[ "Returns", "a", "Section", "object", "matching", "the", "requested", "reference", ".", "If", "reference", "is", "not", "found", "an", "empty", "Section", "object", "is", "returned", "instead" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Parser.php#L78-L91
234,075
kss-php/kss-php
lib/Parser.php
Parser.getSectionChildren
public function getSectionChildren($reference, $levelsDown = null) { $reference = strtolower(Section::normalizeReference($reference)); $this->sortSections(); $sectionKeys = array_keys($this->sections); $sections = array(); $maxDepth = null; if ($levelsDown !== null)...
php
public function getSectionChildren($reference, $levelsDown = null) { $reference = strtolower(Section::normalizeReference($reference)); $this->sortSections(); $sectionKeys = array_keys($this->sections); $sections = array(); $maxDepth = null; if ($levelsDown !== null)...
[ "public", "function", "getSectionChildren", "(", "$", "reference", ",", "$", "levelsDown", "=", "null", ")", "{", "$", "reference", "=", "strtolower", "(", "Section", "::", "normalizeReference", "(", "$", "reference", ")", ")", ";", "$", "this", "->", "sor...
Returns an array of children for a specified section reference @param string $reference @param int $levelsDown OPTIONAL @return array
[ "Returns", "an", "array", "of", "children", "for", "a", "specified", "section", "reference" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Parser.php#L132-L163
234,076
kss-php/kss-php
lib/Parser.php
Parser.isKssBlock
public static function isKssBlock($comment) { $commentLines = explode("\n\n", $comment); $lastLine = end($commentLines); return preg_match('/^\s*Styleguide \w/i', $lastLine) || preg_match('/^\s*No styleguide reference/i', $lastLine); }
php
public static function isKssBlock($comment) { $commentLines = explode("\n\n", $comment); $lastLine = end($commentLines); return preg_match('/^\s*Styleguide \w/i', $lastLine) || preg_match('/^\s*No styleguide reference/i', $lastLine); }
[ "public", "static", "function", "isKssBlock", "(", "$", "comment", ")", "{", "$", "commentLines", "=", "explode", "(", "\"\\n\\n\"", ",", "$", "comment", ")", ";", "$", "lastLine", "=", "end", "(", "$", "commentLines", ")", ";", "return", "preg_match", "...
Checks to see if a comment block is a KSS Comment block @param string $comment @return boolean
[ "Checks", "to", "see", "if", "a", "comment", "block", "is", "a", "KSS", "Comment", "block" ]
5431bfb3c3708cfedb6a95fc3413181287d1f776
https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Parser.php#L198-L204
234,077
MW-Peachy/Peachy
HTTP.php
HTTP.get
public function get( $url, $data = null, $headers = array(), $verifyssl = null ) { global $argv, $displayGetOutData; if( is_string( $headers ) ) curl_setopt( $this->curl_instance, CURLOPT_HTTPHEADER, array( $headers ) ); else $this->setCurlHeaders( $headers ); $this->setVerifySSL( $verifyssl ); curl_setopt(...
php
public function get( $url, $data = null, $headers = array(), $verifyssl = null ) { global $argv, $displayGetOutData; if( is_string( $headers ) ) curl_setopt( $this->curl_instance, CURLOPT_HTTPHEADER, array( $headers ) ); else $this->setCurlHeaders( $headers ); $this->setVerifySSL( $verifyssl ); curl_setopt(...
[ "public", "function", "get", "(", "$", "url", ",", "$", "data", "=", "null", ",", "$", "headers", "=", "array", "(", ")", ",", "$", "verifyssl", "=", "null", ")", "{", "global", "$", "argv", ",", "$", "displayGetOutData", ";", "if", "(", "is_string...
Get an url with HTTP GET @access public @param string $url URL to get @param array|null $data Array of data to pass. Gets transformed into the URL inside the function. Default null. @param array $headers Array of headers to pass to curl @param bool $verifyssl override for the global verifyssl value @return bool|stri...
[ "Get", "an", "url", "with", "HTTP", "GET" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/HTTP.php#L230-L261
234,078
MW-Peachy/Peachy
HTTP.php
HTTP.post
public function post($url, $data, $headers = array(), $verifyssl = null) { global $argv, $displayPostOutData; if( is_string( $headers ) ) curl_setopt( $this->curl_instance, CURLOPT_HTTPHEADER, array( $headers ) ); else $this->setCurlHeaders( $headers ); $this->setVerifySSL( $verifyssl ); curl_setopt( $this...
php
public function post($url, $data, $headers = array(), $verifyssl = null) { global $argv, $displayPostOutData; if( is_string( $headers ) ) curl_setopt( $this->curl_instance, CURLOPT_HTTPHEADER, array( $headers ) ); else $this->setCurlHeaders( $headers ); $this->setVerifySSL( $verifyssl ); curl_setopt( $this...
[ "public", "function", "post", "(", "$", "url", ",", "$", "data", ",", "$", "headers", "=", "array", "(", ")", ",", "$", "verifyssl", "=", "null", ")", "{", "global", "$", "argv", ",", "$", "displayPostOutData", ";", "if", "(", "is_string", "(", "$"...
Sends data via HTTP POST @access public @param string $url URL to send @param array $data Array of data to pass. @param array $headers Array of headers to pass to curl @param bool|null $verifyssl override for global verifyssl value @return bool|string Result
[ "Sends", "data", "via", "HTTP", "POST" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/HTTP.php#L288-L316
234,079
MW-Peachy/Peachy
HTTP.php
HTTP.download
function download( $url, $local, $headers = array(), $verifyssl = null ) { global $argv; $out = fopen( $local, 'wb' ); if( is_string( $headers ) ) curl_setopt( $this->curl_instance, CURLOPT_HTTPHEADER, array( $headers ) ); else $this->setCurlHeaders( $headers ); $this->setVerifySSL( $verifyssl ); // curl...
php
function download( $url, $local, $headers = array(), $verifyssl = null ) { global $argv; $out = fopen( $local, 'wb' ); if( is_string( $headers ) ) curl_setopt( $this->curl_instance, CURLOPT_HTTPHEADER, array( $headers ) ); else $this->setCurlHeaders( $headers ); $this->setVerifySSL( $verifyssl ); // curl...
[ "function", "download", "(", "$", "url", ",", "$", "local", ",", "$", "headers", "=", "array", "(", ")", ",", "$", "verifyssl", "=", "null", ")", "{", "global", "$", "argv", ";", "$", "out", "=", "fopen", "(", "$", "local", ",", "'wb'", ")", ";...
Downloads an URL to the local disk @access public @param string $url URL to get @param string $local Local filename to download to @param array $headers Array of headers to pass to curl @param bool|null $verifyssl @return bool
[ "Downloads", "an", "URL", "to", "the", "local", "disk" ]
2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c
https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/HTTP.php#L330-L356
234,080
fab2s/NodalFlow
src/Nodes/NodeAbstract.php
NodeAbstract.enforceIsATraversable
protected function enforceIsATraversable() { if ($this->isFlow()) { if ($this->isATraversable) { throw new NodalFlowException('Cannot Traverse a Branch'); } return $this; } if ($this->isATraversable) { if (!($this instanceof T...
php
protected function enforceIsATraversable() { if ($this->isFlow()) { if ($this->isATraversable) { throw new NodalFlowException('Cannot Traverse a Branch'); } return $this; } if ($this->isATraversable) { if (!($this instanceof T...
[ "protected", "function", "enforceIsATraversable", "(", ")", "{", "if", "(", "$", "this", "->", "isFlow", "(", ")", ")", "{", "if", "(", "$", "this", "->", "isATraversable", ")", "{", "throw", "new", "NodalFlowException", "(", "'Cannot Traverse a Branch'", ")...
Make sure this Node is consistent @throws NodalFlowException @return $this
[ "Make", "sure", "this", "Node", "is", "consistent" ]
da5d458ffea3e6e954d7ee734f938f4be5e46728
https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/Nodes/NodeAbstract.php#L189-L212
234,081
budde377/Part
lib/ConfigImpl.php
ConfigImpl.getPostTasks
public function getPostTasks() { if ($this->postTasks != null) { return $this->postTasks; } /** @noinspection PhpUndefinedFieldInspection */ return $this->postTasks = $this->getScripts($this->configFile->postTasks); }
php
public function getPostTasks() { if ($this->postTasks != null) { return $this->postTasks; } /** @noinspection PhpUndefinedFieldInspection */ return $this->postTasks = $this->getScripts($this->configFile->postTasks); }
[ "public", "function", "getPostTasks", "(", ")", "{", "if", "(", "$", "this", "->", "postTasks", "!=", "null", ")", "{", "return", "$", "this", "->", "postTasks", ";", "}", "/** @noinspection PhpUndefinedFieldInspection */", "return", "$", "this", "->", "postTa...
Will return PostTasks as an array, with the ClassName as key and the link as value. The link should be relative to a root path provided. @return array
[ "Will", "return", "PostTasks", "as", "an", "array", "with", "the", "ClassName", "as", "key", "and", "the", "link", "as", "value", ".", "The", "link", "should", "be", "relative", "to", "a", "root", "path", "provided", "." ]
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/ConfigImpl.php#L104-L112
234,082
budde377/Part
lib/ConfigImpl.php
ConfigImpl.getPreTasks
public function getPreTasks() { if ($this->preTasks != null) { return $this->preTasks; } /** @noinspection PhpUndefinedFieldInspection */ return $this->preTasks = $this->getScripts($this->configFile->preTasks); }
php
public function getPreTasks() { if ($this->preTasks != null) { return $this->preTasks; } /** @noinspection PhpUndefinedFieldInspection */ return $this->preTasks = $this->getScripts($this->configFile->preTasks); }
[ "public", "function", "getPreTasks", "(", ")", "{", "if", "(", "$", "this", "->", "preTasks", "!=", "null", ")", "{", "return", "$", "this", "->", "preTasks", ";", "}", "/** @noinspection PhpUndefinedFieldInspection */", "return", "$", "this", "->", "preTasks"...
Will return pre tasks as an array, with the ClassName as key and the link as value. The link should be relative to a root path provided. @return array
[ "Will", "return", "pre", "tasks", "as", "an", "array", "with", "the", "ClassName", "as", "key", "and", "the", "link", "as", "value", ".", "The", "link", "should", "be", "relative", "to", "a", "root", "path", "provided", "." ]
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/ConfigImpl.php#L135-L143
234,083
budde377/Part
lib/ConfigImpl.php
ConfigImpl.listTemplateNames
public function listTemplateNames() { $this->setUpTemplate(); $ret = array(); foreach ($this->templates as $key => $val) { $ret[] = $key; } return $ret; }
php
public function listTemplateNames() { $this->setUpTemplate(); $ret = array(); foreach ($this->templates as $key => $val) { $ret[] = $key; } return $ret; }
[ "public", "function", "listTemplateNames", "(", ")", "{", "$", "this", "->", "setUpTemplate", "(", ")", ";", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "templates", "as", "$", "key", "=>", "$", "val", ")", "{", "$",...
Will return a array containing all possible templates by name. @return array
[ "Will", "return", "a", "array", "containing", "all", "possible", "templates", "by", "name", "." ]
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/ConfigImpl.php#L222-L230
234,084
budde377/Part
lib/ConfigImpl.php
ConfigImpl.getDefaultPages
public function getDefaultPages() { if ($this->defaultPages != null) { return $this->defaultPages; } $this->defaultPages = []; /** @noinspection PhpUndefinedFieldInspection */ if ($this->configFile->defaultPages->getName()) { /** @noinspection PhpUndef...
php
public function getDefaultPages() { if ($this->defaultPages != null) { return $this->defaultPages; } $this->defaultPages = []; /** @noinspection PhpUndefinedFieldInspection */ if ($this->configFile->defaultPages->getName()) { /** @noinspection PhpUndef...
[ "public", "function", "getDefaultPages", "(", ")", "{", "if", "(", "$", "this", "->", "defaultPages", "!=", "null", ")", "{", "return", "$", "this", "->", "defaultPages", ";", "}", "$", "this", "->", "defaultPages", "=", "[", "]", ";", "/** @noinspection...
Will return an array with default pages. Pages hardcoded into the website. The array will have the page title as key and another array, containing alias', as value. @return array
[ "Will", "return", "an", "array", "with", "default", "pages", ".", "Pages", "hardcoded", "into", "the", "website", ".", "The", "array", "will", "have", "the", "page", "title", "as", "key", "and", "another", "array", "containing", "alias", "as", "value", "."...
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/ConfigImpl.php#L238-L257
234,085
budde377/Part
lib/ConfigImpl.php
ConfigImpl.getAJAXTypeHandlers
public function getAJAXTypeHandlers() { if ($this->ajaxTypeHandlers != null) { return $this->ajaxTypeHandlers; } $this->ajaxTypeHandlers = array(); /** @noinspection PhpUndefinedFieldInspection */ if (!$this->configFile->AJAXTypeHandlers->getName()) { ...
php
public function getAJAXTypeHandlers() { if ($this->ajaxTypeHandlers != null) { return $this->ajaxTypeHandlers; } $this->ajaxTypeHandlers = array(); /** @noinspection PhpUndefinedFieldInspection */ if (!$this->configFile->AJAXTypeHandlers->getName()) { ...
[ "public", "function", "getAJAXTypeHandlers", "(", ")", "{", "if", "(", "$", "this", "->", "ajaxTypeHandlers", "!=", "null", ")", "{", "return", "$", "this", "->", "ajaxTypeHandlers", ";", "}", "$", "this", "->", "ajaxTypeHandlers", "=", "array", "(", ")", ...
Will return AJAXTypeHandlers as an array, with the num key and an array containing "class_name" and "path" as value. The link should be relative to a root path provided. @return array
[ "Will", "return", "AJAXTypeHandlers", "as", "an", "array", "with", "the", "num", "key", "and", "an", "array", "containing", "class_name", "and", "path", "as", "value", ".", "The", "link", "should", "be", "relative", "to", "a", "root", "path", "provided", "...
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/ConfigImpl.php#L408-L431
234,086
budde377/Part
lib/ConfigImpl.php
ConfigImpl.listTemplateFolders
public function listTemplateFolders() { $this->setUpTemplate(); $result = []; foreach ($this->templateNamespace as $ns => $paths) { foreach ($paths as $path) { $path = $this->getRootPath() . "/" . $path; if ($ns == "") { $resul...
php
public function listTemplateFolders() { $this->setUpTemplate(); $result = []; foreach ($this->templateNamespace as $ns => $paths) { foreach ($paths as $path) { $path = $this->getRootPath() . "/" . $path; if ($ns == "") { $resul...
[ "public", "function", "listTemplateFolders", "(", ")", "{", "$", "this", "->", "setUpTemplate", "(", ")", ";", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "templateNamespace", "as", "$", "ns", "=>", "$", "paths", ")", "{", "...
Lists the folders where to look for other templates. @return string[]
[ "Lists", "the", "folders", "where", "to", "look", "for", "other", "templates", "." ]
9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d
https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/ConfigImpl.php#L525-L542
234,087
skrz/meta
gen-src/Google/Protobuf/Meta/EnumValueOptionsMeta.php
EnumValueOptionsMeta.create
public static function create() { switch (func_num_args()) { case 0: return new EnumValueOptions(); case 1: return new EnumValueOptions(func_get_arg(0)); case 2: return new EnumValueOptions(func_get_arg(0), func_get_arg(1)); case 3: return new EnumValueOptions(func_get_arg(0), func_get_ar...
php
public static function create() { switch (func_num_args()) { case 0: return new EnumValueOptions(); case 1: return new EnumValueOptions(func_get_arg(0)); case 2: return new EnumValueOptions(func_get_arg(0), func_get_arg(1)); case 3: return new EnumValueOptions(func_get_arg(0), func_get_ar...
[ "public", "static", "function", "create", "(", ")", "{", "switch", "(", "func_num_args", "(", ")", ")", "{", "case", "0", ":", "return", "new", "EnumValueOptions", "(", ")", ";", "case", "1", ":", "return", "new", "EnumValueOptions", "(", "func_get_arg", ...
Creates new instance of \Google\Protobuf\EnumValueOptions @throws \InvalidArgumentException @return EnumValueOptions
[ "Creates", "new", "instance", "of", "\\", "Google", "\\", "Protobuf", "\\", "EnumValueOptions" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/EnumValueOptionsMeta.php#L58-L82
234,088
skrz/meta
gen-src/Google/Protobuf/Meta/EnumValueOptionsMeta.php
EnumValueOptionsMeta.reset
public static function reset($object) { if (!($object instanceof EnumValueOptions)) { throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\EnumValueOptions.'); } $object->deprecated = NULL; $object->uninterpretedOption = NULL; }
php
public static function reset($object) { if (!($object instanceof EnumValueOptions)) { throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\EnumValueOptions.'); } $object->deprecated = NULL; $object->uninterpretedOption = NULL; }
[ "public", "static", "function", "reset", "(", "$", "object", ")", "{", "if", "(", "!", "(", "$", "object", "instanceof", "EnumValueOptions", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'You have to pass object of class Google\\Protobuf\\En...
Resets properties of \Google\Protobuf\EnumValueOptions to default values @param EnumValueOptions $object @throws \InvalidArgumentException @return void
[ "Resets", "properties", "of", "\\", "Google", "\\", "Protobuf", "\\", "EnumValueOptions", "to", "default", "values" ]
013af6435d3885ab5b2e91fb8ebb051d0f874ab2
https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/EnumValueOptionsMeta.php#L95-L102
234,089
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.setGlobalOptions
public function setGlobalOptions($options = null) { if(!$options) { $css = BASE_PATH . '/themes/' . SSViewer::current_theme() . '/css/pdf.css'; $header = BASE_PATH . '/mysite/templates/Pdf/header.html'; $footer = BASE_PATH . '/mysite/templates/Pdf/footer.html'; $options = array( 'no...
php
public function setGlobalOptions($options = null) { if(!$options) { $css = BASE_PATH . '/themes/' . SSViewer::current_theme() . '/css/pdf.css'; $header = BASE_PATH . '/mysite/templates/Pdf/header.html'; $footer = BASE_PATH . '/mysite/templates/Pdf/footer.html'; $options = array( 'no...
[ "public", "function", "setGlobalOptions", "(", "$", "options", "=", "null", ")", "{", "if", "(", "!", "$", "options", ")", "{", "$", "css", "=", "BASE_PATH", ".", "'/themes/'", ".", "SSViewer", "::", "current_theme", "(", ")", ".", "'/css/pdf.css'", ";",...
Set the global options for all pdfs @param array $options A list with all possible options can be found here http://wkhtmltopdf.org/usage/wkhtmltopdf.txt
[ "Set", "the", "global", "options", "for", "all", "pdfs" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L24-L55
234,090
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.setOption
public function setOption($key, $value = null) { $globalOptions = $this->globalOptions; if($value) { $globalOptions[$key] = $value; } else { $globalOptions[] = $key; } $this->setGlobalOptions($globalOptions); $this->pdf = new Pdf($this->globalOptions); }
php
public function setOption($key, $value = null) { $globalOptions = $this->globalOptions; if($value) { $globalOptions[$key] = $value; } else { $globalOptions[] = $key; } $this->setGlobalOptions($globalOptions); $this->pdf = new Pdf($this->globalOptions); }
[ "public", "function", "setOption", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "globalOptions", "=", "$", "this", "->", "globalOptions", ";", "if", "(", "$", "value", ")", "{", "$", "globalOptions", "[", "$", "key", "]", "=", "$...
Set a specific option for the pdf you are creating @param string $key The name of the option you want to set. A list with all possible options can be found here http://wkhtmltopdf.org/usage/wkhtmltopdf.txt @param string|array $value The value of the option you want to set. Can be left blank.
[ "Set", "a", "specific", "option", "for", "the", "pdf", "you", "are", "creating" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L65-L76
234,091
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.removeOption
public function removeOption($key) { $globalOptions = $this->globalOptions; if(array_key_exists($key, $globalOptions)) { unset($globalOptions[$key]); } else if($key = array_search($key, $globalOptions)) { unset($globalOptions[$key]); } $this->setGlobalOptions($globalOptions); $...
php
public function removeOption($key) { $globalOptions = $this->globalOptions; if(array_key_exists($key, $globalOptions)) { unset($globalOptions[$key]); } else if($key = array_search($key, $globalOptions)) { unset($globalOptions[$key]); } $this->setGlobalOptions($globalOptions); $...
[ "public", "function", "removeOption", "(", "$", "key", ")", "{", "$", "globalOptions", "=", "$", "this", "->", "globalOptions", ";", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "globalOptions", ")", ")", "{", "unset", "(", "$", "globalOptio...
Remove a specific option for the pdf you are creating @param string $key The name of the option you want to set.
[ "Remove", "a", "specific", "option", "for", "the", "pdf", "you", "are", "creating" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L83-L94
234,092
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.setFolderName
public function setFolderName($folder = null) { if($folder) { $folder = Folder::find_or_make($folder); $this->folderID = $folder->ID; $folder = str_replace('assets/', '', $folder->Filename); $this->folder = rtrim($this->folder . $folder, '/') . '/'; } }
php
public function setFolderName($folder = null) { if($folder) { $folder = Folder::find_or_make($folder); $this->folderID = $folder->ID; $folder = str_replace('assets/', '', $folder->Filename); $this->folder = rtrim($this->folder . $folder, '/') . '/'; } }
[ "public", "function", "setFolderName", "(", "$", "folder", "=", "null", ")", "{", "if", "(", "$", "folder", ")", "{", "$", "folder", "=", "Folder", "::", "find_or_make", "(", "$", "folder", ")", ";", "$", "this", "->", "folderID", "=", "$", "folder",...
Specify the pdf location @param string $folder The name of the desired folder. Creates a new one if folder doesn't exist.
[ "Specify", "the", "pdf", "location" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L101-L108
234,093
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.getHtml
static function getHtml($obj, $variables = null, $template = null) { Requirements::clear(); if(!$template) { $template = sprintf("%s_pdf", $obj->ClassName); } $viewer = new SSViewer($template); $html = $viewer->process($obj, $variables); return $html; }
php
static function getHtml($obj, $variables = null, $template = null) { Requirements::clear(); if(!$template) { $template = sprintf("%s_pdf", $obj->ClassName); } $viewer = new SSViewer($template); $html = $viewer->process($obj, $variables); return $html; }
[ "static", "function", "getHtml", "(", "$", "obj", ",", "$", "variables", "=", "null", ",", "$", "template", "=", "null", ")", "{", "Requirements", "::", "clear", "(", ")", ";", "if", "(", "!", "$", "template", ")", "{", "$", "template", "=", "sprin...
Generates the html code you need for the pdf @param DataObject $obj The base DataObject for your pdf @param array $variables Array with customisation for your data. @param string $template If submitted the name of the template used to generate the html. If not, the script will look for a template based on your DataObj...
[ "Generates", "the", "html", "code", "you", "need", "for", "the", "pdf" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L119-L129
234,094
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.add
public function add($content, $type = 'Page', $options = array()) { if($type == 'Page') { $this->pdf->addPage($content, $options); } else if($type == 'Cover') { $this->pdf->addCover($content, $options); } }
php
public function add($content, $type = 'Page', $options = array()) { if($type == 'Page') { $this->pdf->addPage($content, $options); } else if($type == 'Cover') { $this->pdf->addCover($content, $options); } }
[ "public", "function", "add", "(", "$", "content", ",", "$", "type", "=", "'Page'", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "$", "type", "==", "'Page'", ")", "{", "$", "this", "->", "pdf", "->", "addPage", "(", "$", "co...
Adds a normale page or cover to your pdf @param string $content The html code from your DataObject, a pdf file or any website url @param string $type "Page" for a normal page or if you want to add an cover "Cover" @param array $options Specific options only for that page A list with all possible options can be found h...
[ "Adds", "a", "normale", "page", "or", "cover", "to", "your", "pdf" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L139-L145
234,095
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.save
public function save($filename, $class = 'File') { if(!empty($this->pdf->getError())) { throw new Exception('Could not create PDF: ' . $this->pdf->getError()); } else { $filename = rtrim($class::create()->setName($filename), '.pdf') . '.pdf'; $this->pdf->saveAs($this->folder . $filename); ...
php
public function save($filename, $class = 'File') { if(!empty($this->pdf->getError())) { throw new Exception('Could not create PDF: ' . $this->pdf->getError()); } else { $filename = rtrim($class::create()->setName($filename), '.pdf') . '.pdf'; $this->pdf->saveAs($this->folder . $filename); ...
[ "public", "function", "save", "(", "$", "filename", ",", "$", "class", "=", "'File'", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "pdf", "->", "getError", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "'Could not create PD...
Saves the pdf file @param string $filename The desired name of the pdf file @param string $class Dataobject class of file @return DataObject The new created pdf file
[ "Saves", "the", "pdf", "file" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L154-L162
234,096
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.createFile
protected function createFile($filename, $class) { $filename = trim($filename); $file = $class::create(); $file->setName($filename); $file->Filename = $this->folder . $filename; $file->ParentID = $this->folderID; $file->write(); return $file; }
php
protected function createFile($filename, $class) { $filename = trim($filename); $file = $class::create(); $file->setName($filename); $file->Filename = $this->folder . $filename; $file->ParentID = $this->folderID; $file->write(); return $file; }
[ "protected", "function", "createFile", "(", "$", "filename", ",", "$", "class", ")", "{", "$", "filename", "=", "trim", "(", "$", "filename", ")", ";", "$", "file", "=", "$", "class", "::", "create", "(", ")", ";", "$", "file", "->", "setName", "("...
Creates an File DataObject from the pdf @param string $filename The desired name of the pdf file @param string $class Dataobject class of file @return DataObject Pdf file
[ "Creates", "an", "File", "DataObject", "from", "the", "pdf" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L171-L179
234,097
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.preview
public function preview() { if(!empty($this->pdf->getError())) { throw new Exception('Could not create PDF: ' . $this->pdf->getError()); } else { $this->pdf->send(); } die(); }
php
public function preview() { if(!empty($this->pdf->getError())) { throw new Exception('Could not create PDF: ' . $this->pdf->getError()); } else { $this->pdf->send(); } die(); }
[ "public", "function", "preview", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "pdf", "->", "getError", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "'Could not create PDF: '", ".", "$", "this", "->", "pdf", "->", "get...
Streams the pdf to your browser to preview it
[ "Streams", "the", "pdf", "to", "your", "browser", "to", "preview", "it" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L184-L192
234,098
bhofstaetter/silverstripe-wkhtmltopdf
code/SS_PDF.php
SS_PDF.download
public function download($filename) { if(!empty($this->pdf->getError())) { throw new Exception('Could not create PDF: ' . $this->pdf->getError()); } else { $filename = rtrim(File::create()->setName($filename), '.pdf') . '.pdf'; $this->pdf->send($filename); } }
php
public function download($filename) { if(!empty($this->pdf->getError())) { throw new Exception('Could not create PDF: ' . $this->pdf->getError()); } else { $filename = rtrim(File::create()->setName($filename), '.pdf') . '.pdf'; $this->pdf->send($filename); } }
[ "public", "function", "download", "(", "$", "filename", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "pdf", "->", "getError", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "'Could not create PDF: '", ".", "$", "this", "->", ...
Forces the download of the pdf
[ "Forces", "the", "download", "of", "the", "pdf" ]
47a972c205fdb5f5708c37de1637c5911e0edbe5
https://github.com/bhofstaetter/silverstripe-wkhtmltopdf/blob/47a972c205fdb5f5708c37de1637c5911e0edbe5/code/SS_PDF.php#L197-L204
234,099
malahierba-lab/public-id
src/PublicId.php
PublicId.publicIdDecode
static public function publicIdDecode($public_id) { $hashids = new Hashids(self::getSalt(), self::getMinLength(), self::getAlphabet()); $id = $hashids->decode($public_id); if (is_array($id) && isset($id[0])) return $id[0]; return null; }
php
static public function publicIdDecode($public_id) { $hashids = new Hashids(self::getSalt(), self::getMinLength(), self::getAlphabet()); $id = $hashids->decode($public_id); if (is_array($id) && isset($id[0])) return $id[0]; return null; }
[ "static", "public", "function", "publicIdDecode", "(", "$", "public_id", ")", "{", "$", "hashids", "=", "new", "Hashids", "(", "self", "::", "getSalt", "(", ")", ",", "self", "::", "getMinLength", "(", ")", ",", "self", "::", "getAlphabet", "(", ")", "...
Decode public id to real id @access public @param string $public_id @return integer|null
[ "Decode", "public", "id", "to", "real", "id" ]
6a39d2c19401edbf3eeac60e88e93c17f202bd0e
https://github.com/malahierba-lab/public-id/blob/6a39d2c19401edbf3eeac60e88e93c17f202bd0e/src/PublicId.php#L16-L26