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
197,500
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/stores/SQLLiteCacheStore.php
SQLLiteCacheStore.getData
protected function getData($key) { $query = $this->db->query("SELECT value FROM cache WHERE key='" . $this->key($key) . "' AND expire >= datetime('now')"); return $query->fetch(); }
php
protected function getData($key) { $query = $this->db->query("SELECT value FROM cache WHERE key='" . $this->key($key) . "' AND expire >= datetime('now')"); return $query->fetch(); }
[ "protected", "function", "getData", "(", "$", "key", ")", "{", "$", "query", "=", "$", "this", "->", "db", "->", "query", "(", "\"SELECT value FROM cache WHERE key='\"", ".", "$", "this", "->", "key", "(", "$", "key", ")", ".", "\"' AND expire >= datetime('n...
Retrieves the data from the database @param string $key The key to retrieve @return array An array containing 'key', 'value', and 'expire' keys
[ "Retrieves", "the", "data", "from", "the", "database" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/SQLLiteCacheStore.php#L79-L83
197,501
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/stores/SQLLiteCacheStore.php
SQLLiteCacheStore.writeData
protected function writeData($key, $value, $ttl) { if (!is_numeric($ttl) || $ttl < 0) throw new CacheException('TTL invalid: '. $ttl); if ($ttl == 0) $expiration = "datetime('now', '+100 years')"; // This will make the cache expire after you die, so it's effectively forever....
php
protected function writeData($key, $value, $ttl) { if (!is_numeric($ttl) || $ttl < 0) throw new CacheException('TTL invalid: '. $ttl); if ($ttl == 0) $expiration = "datetime('now', '+100 years')"; // This will make the cache expire after you die, so it's effectively forever....
[ "protected", "function", "writeData", "(", "$", "key", ",", "$", "value", ",", "$", "ttl", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "ttl", ")", "||", "$", "ttl", "<", "0", ")", "throw", "new", "CacheException", "(", "'TTL invalid: '", ".", ...
Writes the data to the database @param string $key The key to write @param string $value The value to store @param integer $ttl The length of time in seconds for the data to live. @return boolean true if successful
[ "Writes", "the", "data", "to", "the", "database" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/stores/SQLLiteCacheStore.php#L94-L107
197,502
naucon/Utility
src/IteratorAbstract.php
IteratorAbstract.previous
public function previous() { $this->_itemValid = true; if (!prev($this->_items)) { $this->_itemValid = false; } else { $this->_itemPosition--; } }
php
public function previous() { $this->_itemValid = true; if (!prev($this->_items)) { $this->_itemValid = false; } else { $this->_itemPosition--; } }
[ "public", "function", "previous", "(", ")", "{", "$", "this", "->", "_itemValid", "=", "true", ";", "if", "(", "!", "prev", "(", "$", "this", "->", "_items", ")", ")", "{", "$", "this", "->", "_itemValid", "=", "false", ";", "}", "else", "{", "$"...
set previous item as current item @return void
[ "set", "previous", "item", "as", "current", "item" ]
d225bb5d09d82400917f710c9d502949a66442c4
https://github.com/naucon/Utility/blob/d225bb5d09d82400917f710c9d502949a66442c4/src/IteratorAbstract.php#L131-L140
197,503
wb-crowdfusion/crowdfusion
system/core/classes/libraries/feedparser/FeedParser.php
FeedParser.parseFeed
public function parseFeed($url, $nativeOrder = false, $force = false) { require_once PATH_SYSTEM.'/vendors/SimplePie.php'; $feed = new SimplePie(); $feed->set_timeout($this->timeout); $feed->set_feed_url($url); $feed->enable_order_by_date(!$nativeOrder); $feed->force...
php
public function parseFeed($url, $nativeOrder = false, $force = false) { require_once PATH_SYSTEM.'/vendors/SimplePie.php'; $feed = new SimplePie(); $feed->set_timeout($this->timeout); $feed->set_feed_url($url); $feed->enable_order_by_date(!$nativeOrder); $feed->force...
[ "public", "function", "parseFeed", "(", "$", "url", ",", "$", "nativeOrder", "=", "false", ",", "$", "force", "=", "false", ")", "{", "require_once", "PATH_SYSTEM", ".", "'/vendors/SimplePie.php'", ";", "$", "feed", "=", "new", "SimplePie", "(", ")", ";", ...
Opens an RSS feed, parses and loads the contents. @param string $url The URL of the RSS feed @param bool $nativeOrder If true, disable order by date to preserve native ordering @param bool $force Force SimplePie to parse the feed despite errors @return object An object that encapsulates the feed con...
[ "Opens", "an", "RSS", "feed", "parses", "and", "loads", "the", "contents", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/feedparser/FeedParser.php#L61-L86
197,504
Linkvalue-Interne/MajoraGeneratorBundle
src/Majora/Bundle/GeneratorBundle/Generator/ContentModifier/AbstractContentModifier.php
AbstractContentModifier.setUp
public function setUp( $kernelDir, FileLocatorInterface $fileLocator ) { $this->kernelDir = realpath($kernelDir); $this->fileLocator = $fileLocator; }
php
public function setUp( $kernelDir, FileLocatorInterface $fileLocator ) { $this->kernelDir = realpath($kernelDir); $this->fileLocator = $fileLocator; }
[ "public", "function", "setUp", "(", "$", "kernelDir", ",", "FileLocatorInterface", "$", "fileLocator", ")", "{", "$", "this", "->", "kernelDir", "=", "realpath", "(", "$", "kernelDir", ")", ";", "$", "this", "->", "fileLocator", "=", "$", "fileLocator", ";...
abstract class setting up method @param string $kernelDir @param FileLocatorInterface $fileLocator
[ "abstract", "class", "setting", "up", "method" ]
9f745c1f64e913df90d86b4fd0770121c563552d
https://github.com/Linkvalue-Interne/MajoraGeneratorBundle/blob/9f745c1f64e913df90d86b4fd0770121c563552d/src/Majora/Bundle/GeneratorBundle/Generator/ContentModifier/AbstractContentModifier.php#L22-L29
197,505
Linkvalue-Interne/MajoraGeneratorBundle
src/Majora/Bundle/GeneratorBundle/Generator/ContentModifier/AbstractContentModifier.php
AbstractContentModifier.resolveTargetFilePath
protected function resolveTargetFilePath($target, $basePath) { switch (true) { // resource case strpos($target, '@') === 0: $targetPath = $this->fileLocator->locate($target); break; // kernel related case strpos($target, '/') ...
php
protected function resolveTargetFilePath($target, $basePath) { switch (true) { // resource case strpos($target, '@') === 0: $targetPath = $this->fileLocator->locate($target); break; // kernel related case strpos($target, '/') ...
[ "protected", "function", "resolveTargetFilePath", "(", "$", "target", ",", "$", "basePath", ")", "{", "switch", "(", "true", ")", "{", "// resource", "case", "strpos", "(", "$", "target", ",", "'@'", ")", "===", "0", ":", "$", "targetPath", "=", "$", "...
resolve given target file path @param string $target @param string $basePath @return string @throws \InvalidArgumentException if path cannot be resolved
[ "resolve", "given", "target", "file", "path" ]
9f745c1f64e913df90d86b4fd0770121c563552d
https://github.com/Linkvalue-Interne/MajoraGeneratorBundle/blob/9f745c1f64e913df90d86b4fd0770121c563552d/src/Majora/Bundle/GeneratorBundle/Generator/ContentModifier/AbstractContentModifier.php#L41-L73
197,506
makinacorpus/drupal-apubsub
src/Backend/TypeRegistry.php
TypeRegistry.getTypeId
public function getTypeId($type, $createIfMissing = true) { if (null === $this->types) { $this->loadCache(); } if (false === ($key = array_search($type, $this->types, true))) { if (!$createIfMissing) { return null; } try { ...
php
public function getTypeId($type, $createIfMissing = true) { if (null === $this->types) { $this->loadCache(); } if (false === ($key = array_search($type, $this->types, true))) { if (!$createIfMissing) { return null; } try { ...
[ "public", "function", "getTypeId", "(", "$", "type", ",", "$", "createIfMissing", "=", "true", ")", "{", "if", "(", "null", "===", "$", "this", "->", "types", ")", "{", "$", "this", "->", "loadCache", "(", ")", ";", "}", "if", "(", "false", "===", ...
Get type identifier @param string $type Message type @param boolean $createIfMissing Create it if missing @return int Message type id
[ "Get", "type", "identifier" ]
534fbecf67c880996ae02210c0bfdb3e0d3699b6
https://github.com/makinacorpus/drupal-apubsub/blob/534fbecf67c880996ae02210c0bfdb3e0d3699b6/src/Backend/TypeRegistry.php#L53-L86
197,507
makinacorpus/drupal-apubsub
src/Backend/TypeRegistry.php
TypeRegistry.getType
public function getType($id) { if (null === $id) { // The caller might call us using a row from database that contains // a strict null, it is useless for us to do any query since null // typed messages are valid by the MessageInterface signature return null; ...
php
public function getType($id) { if (null === $id) { // The caller might call us using a row from database that contains // a strict null, it is useless for us to do any query since null // typed messages are valid by the MessageInterface signature return null; ...
[ "public", "function", "getType", "(", "$", "id", ")", "{", "if", "(", "null", "===", "$", "id", ")", "{", "// The caller might call us using a row from database that contains", "// a strict null, it is useless for us to do any query since null", "// typed messages are valid by th...
Get type from identifier @param int $id Message type id @return string Message type
[ "Get", "type", "from", "identifier" ]
534fbecf67c880996ae02210c0bfdb3e0d3699b6
https://github.com/makinacorpus/drupal-apubsub/blob/534fbecf67c880996ae02210c0bfdb3e0d3699b6/src/Backend/TypeRegistry.php#L95-L125
197,508
makinacorpus/drupal-apubsub
src/Backend/TypeRegistry.php
TypeRegistry.convertQueryCondition
public function convertQueryCondition($value) { // First fetch the type if (null === $value) { return 0; } if (!is_array($value)) { $value = [$value]; } $hasOperator = false; // FIXME Sorry for this if (!Misc::isIndexed($valu...
php
public function convertQueryCondition($value) { // First fetch the type if (null === $value) { return 0; } if (!is_array($value)) { $value = [$value]; } $hasOperator = false; // FIXME Sorry for this if (!Misc::isIndexed($valu...
[ "public", "function", "convertQueryCondition", "(", "$", "value", ")", "{", "// First fetch the type", "if", "(", "null", "===", "$", "value", ")", "{", "return", "0", ";", "}", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "$", "value"...
Convert given query condition value which is supposed to contain types identifiers to integer identifiers This function will take care of awaited query format
[ "Convert", "given", "query", "condition", "value", "which", "is", "supposed", "to", "contain", "types", "identifiers", "to", "integer", "identifiers" ]
534fbecf67c880996ae02210c0bfdb3e0d3699b6
https://github.com/makinacorpus/drupal-apubsub/blob/534fbecf67c880996ae02210c0bfdb3e0d3699b6/src/Backend/TypeRegistry.php#L133-L177
197,509
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/interfaces/FileCache.php
FileCache.getUsingFileTimestamps
public function getUsingFileTimestamps($key) { $value = $this->get($this->cacheKey($key)); $timestamps = $this->get($this->cachetskey($key)); if ($value !== false && $timestamps !== false) { foreach ($timestamps as $file => $timestamp) { if (filemtime($file) !=...
php
public function getUsingFileTimestamps($key) { $value = $this->get($this->cacheKey($key)); $timestamps = $this->get($this->cachetskey($key)); if ($value !== false && $timestamps !== false) { foreach ($timestamps as $file => $timestamp) { if (filemtime($file) !=...
[ "public", "function", "getUsingFileTimestamps", "(", "$", "key", ")", "{", "$", "value", "=", "$", "this", "->", "get", "(", "$", "this", "->", "cacheKey", "(", "$", "key", ")", ")", ";", "$", "timestamps", "=", "$", "this", "->", "get", "(", "$", ...
get cache using key, but check associated timestamps on cached file array @param string $key The key of the cache item to retrieve @return mixed the value of the stored cache item
[ "get", "cache", "using", "key", "but", "check", "associated", "timestamps", "on", "cached", "file", "array" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/interfaces/FileCache.php#L46-L63
197,510
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/interfaces/FileCache.php
FileCache.putUsingFileTimestamps
public function putUsingFileTimestamps($key, $value, array $filenames, $duration = null) { if (empty($duration)) $duration = 0; $files = array(); foreach ($filenames as $file) { $files[$file] = filemtime($file); } $timestamps = md5($files); ...
php
public function putUsingFileTimestamps($key, $value, array $filenames, $duration = null) { if (empty($duration)) $duration = 0; $files = array(); foreach ($filenames as $file) { $files[$file] = filemtime($file); } $timestamps = md5($files); ...
[ "public", "function", "putUsingFileTimestamps", "(", "$", "key", ",", "$", "value", ",", "array", "$", "filenames", ",", "$", "duration", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "duration", ")", ")", "$", "duration", "=", "0", ";", "$", ...
put cache value into cache store using timestamps of supplied files as a tie on the validity of the cache @param string $key The key for the cache @param string $value The Value to store @param array $filenames An array of filenames to update @param string $duration The time-to-live for the cache data @re...
[ "put", "cache", "value", "into", "cache", "store", "using", "timestamps", "of", "supplied", "files", "as", "a", "tie", "on", "the", "validity", "of", "the", "cache" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/interfaces/FileCache.php#L77-L94
197,511
wb-crowdfusion/crowdfusion
system/core/classes/libraries/caching/interfaces/FileCache.php
FileCache.getFileContents
public function getFileContents($filename) { $cachecontents = $this->get($this->cachefilekey($filename)); // $timestamp = $this->get($this->cachefiletskey($filename)); if ($cachecontents !== false && is_array($cachecontents)) { $contents = array_key_exists('v', $cachecontents)?...
php
public function getFileContents($filename) { $cachecontents = $this->get($this->cachefilekey($filename)); // $timestamp = $this->get($this->cachefiletskey($filename)); if ($cachecontents !== false && is_array($cachecontents)) { $contents = array_key_exists('v', $cachecontents)?...
[ "public", "function", "getFileContents", "(", "$", "filename", ")", "{", "$", "cachecontents", "=", "$", "this", "->", "get", "(", "$", "this", "->", "cachefilekey", "(", "$", "filename", ")", ")", ";", "// $timestamp = $this->get($this->cachefiletskey($fil...
return the file contents, but cache the results indefinitely, break cache if timestamp changes @param string $filename The filename to load @return string the contents of the file specified.
[ "return", "the", "file", "contents", "but", "cache", "the", "results", "indefinitely", "break", "cache", "if", "timestamp", "changes" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/interfaces/FileCache.php#L104-L127
197,512
Montage-Inc/php-montage
src/Montage.php
Montage.request
public function request($type, $url, $args = []) { $response = $this->getHTTPClient() ->$type($url, $args) ->getBody() ->getContents(); return json_decode($response); }
php
public function request($type, $url, $args = []) { $response = $this->getHTTPClient() ->$type($url, $args) ->getBody() ->getContents(); return json_decode($response); }
[ "public", "function", "request", "(", "$", "type", ",", "$", "url", ",", "$", "args", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "getHTTPClient", "(", ")", "->", "$", "type", "(", "$", "url", ",", "$", "args", ")", "->", ...
Our main request method to Montage. Uses Guzzle under the hood to make the request, and will return the json_decoded response from Montage. @param $type @param $url @param array $args @return mixed
[ "Our", "main", "request", "method", "to", "Montage", ".", "Uses", "Guzzle", "under", "the", "hood", "to", "make", "the", "request", "and", "will", "return", "the", "json_decoded", "response", "from", "Montage", "." ]
bcd526985447a31c7e5b74555058e167242b23ed
https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Montage.php#L76-L84
197,513
Montage-Inc/php-montage
src/Montage.php
Montage.auth
public function auth($user = null, $password = null) { if ($this->token) return $this; if (is_null($user) || is_null($password)) { throw new MontageAuthException('Must provide a username and password.'); } try { $response = $this->request('post', $th...
php
public function auth($user = null, $password = null) { if ($this->token) return $this; if (is_null($user) || is_null($password)) { throw new MontageAuthException('Must provide a username and password.'); } try { $response = $this->request('post', $th...
[ "public", "function", "auth", "(", "$", "user", "=", "null", ",", "$", "password", "=", "null", ")", "{", "if", "(", "$", "this", "->", "token", ")", "return", "$", "this", ";", "if", "(", "is_null", "(", "$", "user", ")", "||", "is_null", "(", ...
Authenticate with Montage and set the local token. @param null $user @param null $password @return $this @throws MontageAuthException
[ "Authenticate", "with", "Montage", "and", "set", "the", "local", "token", "." ]
bcd526985447a31c7e5b74555058e167242b23ed
https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Montage.php#L94-L117
197,514
Montage-Inc/php-montage
src/Montage.php
Montage.url
public function url($endpoint, $schema = null, $doc_id = null, $file_id = null) { return sprintf('api/v%d/%s', $this->version, $this->endpoint( $endpoint, $schema, $doc_id, $file_id )); }
php
public function url($endpoint, $schema = null, $doc_id = null, $file_id = null) { return sprintf('api/v%d/%s', $this->version, $this->endpoint( $endpoint, $schema, $doc_id, $file_id )); }
[ "public", "function", "url", "(", "$", "endpoint", ",", "$", "schema", "=", "null", ",", "$", "doc_id", "=", "null", ",", "$", "file_id", "=", "null", ")", "{", "return", "sprintf", "(", "'api/v%d/%s'", ",", "$", "this", "->", "version", ",", "$", ...
Gets a formatted Montage endpoint, prefixed with api version. @param $endpoint @param null $schema @param null $doc_id @param null $file_id @return string @throws MontageUnknownEndpointException
[ "Gets", "a", "formatted", "Montage", "endpoint", "prefixed", "with", "api", "version", "." ]
bcd526985447a31c7e5b74555058e167242b23ed
https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Montage.php#L159-L167
197,515
Montage-Inc/php-montage
src/Montage.php
Montage.getHTTPClient
private function getHTTPClient() { $config = [ 'base_uri' => sprintf( 'http://%s.%s/', $this->subdomain, $this->domain ), 'headers' => [ 'Accept' => 'application/json', 'User-Agent' => sprintf...
php
private function getHTTPClient() { $config = [ 'base_uri' => sprintf( 'http://%s.%s/', $this->subdomain, $this->domain ), 'headers' => [ 'Accept' => 'application/json', 'User-Agent' => sprintf...
[ "private", "function", "getHTTPClient", "(", ")", "{", "$", "config", "=", "[", "'base_uri'", "=>", "sprintf", "(", "'http://%s.%s/'", ",", "$", "this", "->", "subdomain", ",", "$", "this", "->", "domain", ")", ",", "'headers'", "=>", "[", "'Accept'", "=...
Does what it says. Gets a guzzle client, with an Authorization header set in case of an existing token. @return Client
[ "Does", "what", "it", "says", ".", "Gets", "a", "guzzle", "client", "with", "an", "Authorization", "header", "set", "in", "case", "of", "an", "existing", "token", "." ]
bcd526985447a31c7e5b74555058e167242b23ed
https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Montage.php#L175-L202
197,516
Montage-Inc/php-montage
src/Montage.php
Montage.endpoint
private function endpoint($endpoint, $schema = null, $doc_id = null, $file_id = null) { $endpoints = [ 'auth' => 'auth/', 'user' => 'auth/user/', 'schema-list' => 'schemas/', 'schema-detail' => 'schemas/%s/', 'document-query' => 'schemas/%s/query/'...
php
private function endpoint($endpoint, $schema = null, $doc_id = null, $file_id = null) { $endpoints = [ 'auth' => 'auth/', 'user' => 'auth/user/', 'schema-list' => 'schemas/', 'schema-detail' => 'schemas/%s/', 'document-query' => 'schemas/%s/query/'...
[ "private", "function", "endpoint", "(", "$", "endpoint", ",", "$", "schema", "=", "null", ",", "$", "doc_id", "=", "null", ",", "$", "file_id", "=", "null", ")", "{", "$", "endpoints", "=", "[", "'auth'", "=>", "'auth/'", ",", "'user'", "=>", "'auth/...
Creates a formatted Montage API endpoint string. @param $endpoint @param null $schema @param null $doc_id @param null $file_id @return string @throws MontageUnknownEndpointException
[ "Creates", "a", "formatted", "Montage", "API", "endpoint", "string", "." ]
bcd526985447a31c7e5b74555058e167242b23ed
https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Montage.php#L214-L245
197,517
Montage-Inc/php-montage
src/Montage.php
Montage.schemas
public function schemas($schemaName = null) { if (is_null($schemaName)) { $url = $this->url('schema-list'); return $this->request('get', $url); } return $this->schema($schemaName); }
php
public function schemas($schemaName = null) { if (is_null($schemaName)) { $url = $this->url('schema-list'); return $this->request('get', $url); } return $this->schema($schemaName); }
[ "public", "function", "schemas", "(", "$", "schemaName", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "schemaName", ")", ")", "{", "$", "url", "=", "$", "this", "->", "url", "(", "'schema-list'", ")", ";", "return", "$", "this", "->", "re...
Get a list of all schemas for the given users token. @return mixed
[ "Get", "a", "list", "of", "all", "schemas", "for", "the", "given", "users", "token", "." ]
bcd526985447a31c7e5b74555058e167242b23ed
https://github.com/Montage-Inc/php-montage/blob/bcd526985447a31c7e5b74555058e167242b23ed/src/Montage.php#L252-L260
197,518
Innmind/Math
src/Geometry/Theorem/Pythagora.php
Pythagora.hypotenuse
public static function hypotenuse( Segment $a, Segment $b ): Segment { $hypotenuse = $a ->length() ->power(new Integer(2)) ->add($b->length()->power(new Integer(2))) ->squareRoot(); return new Segment($hypotenuse); }
php
public static function hypotenuse( Segment $a, Segment $b ): Segment { $hypotenuse = $a ->length() ->power(new Integer(2)) ->add($b->length()->power(new Integer(2))) ->squareRoot(); return new Segment($hypotenuse); }
[ "public", "static", "function", "hypotenuse", "(", "Segment", "$", "a", ",", "Segment", "$", "b", ")", ":", "Segment", "{", "$", "hypotenuse", "=", "$", "a", "->", "length", "(", ")", "->", "power", "(", "new", "Integer", "(", "2", ")", ")", "->", ...
Compute the hypotenuse for adjacent sides A and B
[ "Compute", "the", "hypotenuse", "for", "adjacent", "sides", "A", "and", "B" ]
ac9ad4dd1852c145e90f5edc0f38a873b125a50b
https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Geometry/Theorem/Pythagora.php#L19-L30
197,519
Innmind/Math
src/Geometry/Theorem/Pythagora.php
Pythagora.adjacentSide
public static function adjacentSide( Segment $hypotenuse, Segment $adjacentSide ): Segment { $side = $hypotenuse ->length() ->power(new Integer(2)) ->subtract($adjacentSide->length()->power(new Integer(2))) ->squareRoot(); return new S...
php
public static function adjacentSide( Segment $hypotenuse, Segment $adjacentSide ): Segment { $side = $hypotenuse ->length() ->power(new Integer(2)) ->subtract($adjacentSide->length()->power(new Integer(2))) ->squareRoot(); return new S...
[ "public", "static", "function", "adjacentSide", "(", "Segment", "$", "hypotenuse", ",", "Segment", "$", "adjacentSide", ")", ":", "Segment", "{", "$", "side", "=", "$", "hypotenuse", "->", "length", "(", ")", "->", "power", "(", "new", "Integer", "(", "2...
Compute a side A or B from the hypotenuse and one side
[ "Compute", "a", "side", "A", "or", "B", "from", "the", "hypotenuse", "and", "one", "side" ]
ac9ad4dd1852c145e90f5edc0f38a873b125a50b
https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Geometry/Theorem/Pythagora.php#L35-L46
197,520
kambalabs/KmbDomain
src/KmbDomain/Service/RevisionFactory.php
RevisionFactory.createFromImportedData
public function createFromImportedData($data) { $revision = new Revision(); $revision->setReleasedAt(new \DateTime($data['released_at'])); $revision->setReleasedBy($data['released_by']); $revision->setComment($data['comment']); foreach ($data['groups'] as $groupData) { ...
php
public function createFromImportedData($data) { $revision = new Revision(); $revision->setReleasedAt(new \DateTime($data['released_at'])); $revision->setReleasedBy($data['released_by']); $revision->setComment($data['comment']); foreach ($data['groups'] as $groupData) { ...
[ "public", "function", "createFromImportedData", "(", "$", "data", ")", "{", "$", "revision", "=", "new", "Revision", "(", ")", ";", "$", "revision", "->", "setReleasedAt", "(", "new", "\\", "DateTime", "(", "$", "data", "[", "'released_at'", "]", ")", ")...
Create Revision instance from imported data. @param array $data @return Revision
[ "Create", "Revision", "instance", "from", "imported", "data", "." ]
b1631bd936c6c6798076b51dfaebd706e1bdc8c2
https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Service/RevisionFactory.php#L36-L46
197,521
Wedeto/DB
src/Driver/Driver.php
Driver.identQuote
public function identQuote(string $name) { return $this->iquotechar . str_replace($this->iquotechar, $this->iquotechar . $this->iquotechar, $name) . $this->iquotechar; }
php
public function identQuote(string $name) { return $this->iquotechar . str_replace($this->iquotechar, $this->iquotechar . $this->iquotechar, $name) . $this->iquotechar; }
[ "public", "function", "identQuote", "(", "string", "$", "name", ")", "{", "return", "$", "this", "->", "iquotechar", ".", "str_replace", "(", "$", "this", "->", "iquotechar", ",", "$", "this", "->", "iquotechar", ".", "$", "this", "->", "iquotechar", ","...
Quote the name of an identity @param $name string The name to quote @return string The quoted name
[ "Quote", "the", "name", "of", "an", "identity" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Driver/Driver.php#L89-L92
197,522
Wedeto/DB
src/Driver/Driver.php
Driver.getName
public function getName($entity, $quote = true) { if (is_object($entity)) $entity = $entity->getName(); if (!is_string($entity)) throw new InvalidTypeException("Provide a string or a object with a getName method"); $entity = $this->table_prefix . $entity; retu...
php
public function getName($entity, $quote = true) { if (is_object($entity)) $entity = $entity->getName(); if (!is_string($entity)) throw new InvalidTypeException("Provide a string or a object with a getName method"); $entity = $this->table_prefix . $entity; retu...
[ "public", "function", "getName", "(", "$", "entity", ",", "$", "quote", "=", "true", ")", "{", "if", "(", "is_object", "(", "$", "entity", ")", ")", "$", "entity", "=", "$", "entity", "->", "getName", "(", ")", ";", "if", "(", "!", "is_string", "...
Return the identity name quoted and prefixed with the configured prefix. @param $entity mixed A string with the name or a Table, Index or ForeignKey object with a getName method. @return string The quoted, prefixed name
[ "Return", "the", "identity", "name", "quoted", "and", "prefixed", "with", "the", "configured", "prefix", "." ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Driver/Driver.php#L101-L109
197,523
Wedeto/DB
src/Driver/Driver.php
Driver.truncateTable
public function truncateTable($table) { $query = "TRUNCATE " . $this->getName($table->getName()); $this->db->exec($query); return $this; }
php
public function truncateTable($table) { $query = "TRUNCATE " . $this->getName($table->getName()); $this->db->exec($query); return $this; }
[ "public", "function", "truncateTable", "(", "$", "table", ")", "{", "$", "query", "=", "\"TRUNCATE \"", ".", "$", "this", "->", "getName", "(", "$", "table", "->", "getName", "(", ")", ")", ";", "$", "this", "->", "db", "->", "exec", "(", "$", "que...
Remove all rows from the table @param $table mixed The table from which to remove @return Driver Provides fluent interface
[ "Remove", "all", "rows", "from", "the", "table" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Driver/Driver.php#L183-L188
197,524
Wedeto/DB
src/Driver/Driver.php
Driver.toSQL
public function toSQL(Parameters $params, Query\Clause $clause, bool $inner_clause = false) { $params->setDriver($this); return $clause->toSQL($params, $inner_clause); }
php
public function toSQL(Parameters $params, Query\Clause $clause, bool $inner_clause = false) { $params->setDriver($this); return $clause->toSQL($params, $inner_clause); }
[ "public", "function", "toSQL", "(", "Parameters", "$", "params", ",", "Query", "\\", "Clause", "$", "clause", ",", "bool", "$", "inner_clause", "=", "false", ")", "{", "$", "params", "->", "setDriver", "(", "$", "this", ")", ";", "return", "$", "clause...
Write an query clause as SQL query syntax @param Parameters $params The query parameters: tables and placeholder values @param Clause $clause The clause to write @param bool $inner_clause Whether this is a inner or outer clause. An inner clause will be wrapped in braces when it's a binary operator. @return string The g...
[ "Write", "an", "query", "clause", "as", "SQL", "query", "syntax" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Driver/Driver.php#L267-L271
197,525
cubicmushroom/valueobjects
src/DateTime/Time.php
Time.fromNative
public static function fromNative() { $args = func_get_args(); $hour = new Hour($args[0]); $minute = new Minute($args[1]); $second = new Second($args[2]); return new static($hour, $minute, $second); }
php
public static function fromNative() { $args = func_get_args(); $hour = new Hour($args[0]); $minute = new Minute($args[1]); $second = new Second($args[2]); return new static($hour, $minute, $second); }
[ "public", "static", "function", "fromNative", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "hour", "=", "new", "Hour", "(", "$", "args", "[", "0", "]", ")", ";", "$", "minute", "=", "new", "Minute", "(", "$", "args", "[",...
Returns a nee Time object from native int hour, minute and second @param int $hour @param int $minute @param int $second @return self
[ "Returns", "a", "nee", "Time", "object", "from", "native", "int", "hour", "minute", "and", "second" ]
4554239ab75d65eeb9773219aa5b07e9fbfabb92
https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Time.php#L27-L36
197,526
cubicmushroom/valueobjects
src/DateTime/Time.php
Time.fromNativeDateTime
public static function fromNativeDateTime(\DateTime $time) { $hour = \intval($time->format('G')); $minute = \intval($time->format('i')); $second = \intval($time->format('s')); return static::fromNative($hour, $minute, $second); }
php
public static function fromNativeDateTime(\DateTime $time) { $hour = \intval($time->format('G')); $minute = \intval($time->format('i')); $second = \intval($time->format('s')); return static::fromNative($hour, $minute, $second); }
[ "public", "static", "function", "fromNativeDateTime", "(", "\\", "DateTime", "$", "time", ")", "{", "$", "hour", "=", "\\", "intval", "(", "$", "time", "->", "format", "(", "'G'", ")", ")", ";", "$", "minute", "=", "\\", "intval", "(", "$", "time", ...
Returns a new Time from a native PHP \DateTime @param \DateTime $time @return self
[ "Returns", "a", "new", "Time", "from", "a", "native", "PHP", "\\", "DateTime" ]
4554239ab75d65eeb9773219aa5b07e9fbfabb92
https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Time.php#L44-L51
197,527
cubicmushroom/valueobjects
src/DateTime/Time.php
Time.sameValueAs
public function sameValueAs(ValueObjectInterface $time) { if (false === Util::classEquals($this, $time)) { return false; } return $this->getHour()->sameValueAs($time->getHour()) && $this->getMinute()->sameValueAs($time->getMinute()) && $this->getSecond()->sameValueAs($time->getS...
php
public function sameValueAs(ValueObjectInterface $time) { if (false === Util::classEquals($this, $time)) { return false; } return $this->getHour()->sameValueAs($time->getHour()) && $this->getMinute()->sameValueAs($time->getMinute()) && $this->getSecond()->sameValueAs($time->getS...
[ "public", "function", "sameValueAs", "(", "ValueObjectInterface", "$", "time", ")", "{", "if", "(", "false", "===", "Util", "::", "classEquals", "(", "$", "this", ",", "$", "time", ")", ")", "{", "return", "false", ";", "}", "return", "$", "this", "->"...
Tells whether two Time are equal by comparing their values @param ValueObjectInterface $time @return bool
[ "Tells", "whether", "two", "Time", "are", "equal", "by", "comparing", "their", "values" ]
4554239ab75d65eeb9773219aa5b07e9fbfabb92
https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Time.php#L97-L104
197,528
horntell/php-sdk
lib/guzzle/GuzzleHttp/Stream/Stream.php
Stream.factory
public static function factory($resource = '', $size = null) { $type = gettype($resource); if ($type == 'string') { $stream = fopen('php://temp', 'r+'); if ($resource !== '') { fwrite($stream, $resource); fseek($stream, 0); } ...
php
public static function factory($resource = '', $size = null) { $type = gettype($resource); if ($type == 'string') { $stream = fopen('php://temp', 'r+'); if ($resource !== '') { fwrite($stream, $resource); fseek($stream, 0); } ...
[ "public", "static", "function", "factory", "(", "$", "resource", "=", "''", ",", "$", "size", "=", "null", ")", "{", "$", "type", "=", "gettype", "(", "$", "resource", ")", ";", "if", "(", "$", "type", "==", "'string'", ")", "{", "$", "stream", "...
Create a new stream based on the input type @param resource|string|StreamInterface $resource Entity body data @param int $size Size of the data contained in the resource @return Stream @throws \InvalidArgumentException if the $resource arg is not valid.
[ "Create", "a", "new", "stream", "based", "on", "the", "input", "type" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Stream/Stream.php#L41-L67
197,529
opis-colibri/core
src/Module.php
Module.getModuleInfo
protected function getModuleInfo(): array { if ($this->moduleInfo === null) { $this->moduleInfo = $this->package()->getExtra()['module'] ?? []; } return $this->moduleInfo; }
php
protected function getModuleInfo(): array { if ($this->moduleInfo === null) { $this->moduleInfo = $this->package()->getExtra()['module'] ?? []; } return $this->moduleInfo; }
[ "protected", "function", "getModuleInfo", "(", ")", ":", "array", "{", "if", "(", "$", "this", "->", "moduleInfo", "===", "null", ")", "{", "$", "this", "->", "moduleInfo", "=", "$", "this", "->", "package", "(", ")", "->", "getExtra", "(", ")", "[",...
Resolve module info @return array
[ "Resolve", "module", "info" ]
77efaf8e2034293588d3759e0b8711e96757d954
https://github.com/opis-colibri/core/blob/77efaf8e2034293588d3759e0b8711e96757d954/src/Module.php#L330-L337
197,530
opis-colibri/core
src/Module.php
Module.resolveTitle
protected function resolveTitle(): string { $title = trim($this->getModuleInfo()['title'] ?? ''); if (empty($title)) { $name = substr($this->name, strpos($this->name, '/') + 1); $name = array_map(function ($value) { return strtolower($value); }, e...
php
protected function resolveTitle(): string { $title = trim($this->getModuleInfo()['title'] ?? ''); if (empty($title)) { $name = substr($this->name, strpos($this->name, '/') + 1); $name = array_map(function ($value) { return strtolower($value); }, e...
[ "protected", "function", "resolveTitle", "(", ")", ":", "string", "{", "$", "title", "=", "trim", "(", "$", "this", "->", "getModuleInfo", "(", ")", "[", "'title'", "]", "??", "''", ")", ";", "if", "(", "empty", "(", "$", "title", ")", ")", "{", ...
Resolve module's title @return string
[ "Resolve", "module", "s", "title" ]
77efaf8e2034293588d3759e0b8711e96757d954
https://github.com/opis-colibri/core/blob/77efaf8e2034293588d3759e0b8711e96757d954/src/Module.php#L344-L357
197,531
opis-colibri/core
src/Module.php
Module.resolveDirectory
protected function resolveDirectory(string $name): string { $dir = rtrim($this->manager->vendorDir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $dir .= rtrim(implode(DIRECTORY_SEPARATOR, explode('/', $name)), DIRECTORY_SEPARATOR); return $dir; }
php
protected function resolveDirectory(string $name): string { $dir = rtrim($this->manager->vendorDir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $dir .= rtrim(implode(DIRECTORY_SEPARATOR, explode('/', $name)), DIRECTORY_SEPARATOR); return $dir; }
[ "protected", "function", "resolveDirectory", "(", "string", "$", "name", ")", ":", "string", "{", "$", "dir", "=", "rtrim", "(", "$", "this", "->", "manager", "->", "vendorDir", "(", ")", ",", "DIRECTORY_SEPARATOR", ")", ".", "DIRECTORY_SEPARATOR", ";", "$...
Resolve module's directory @param string $name @return string
[ "Resolve", "module", "s", "directory" ]
77efaf8e2034293588d3759e0b8711e96757d954
https://github.com/opis-colibri/core/blob/77efaf8e2034293588d3759e0b8711e96757d954/src/Module.php#L375-L380
197,532
opis-colibri/core
src/Module.php
Module.resolveCollector
protected function resolveCollector(): ?string { $value = $this->getModuleInfo()['collector'] ?? null; return is_string($value) ? $value : null; }
php
protected function resolveCollector(): ?string { $value = $this->getModuleInfo()['collector'] ?? null; return is_string($value) ? $value : null; }
[ "protected", "function", "resolveCollector", "(", ")", ":", "?", "string", "{", "$", "value", "=", "$", "this", "->", "getModuleInfo", "(", ")", "[", "'collector'", "]", "??", "null", ";", "return", "is_string", "(", "$", "value", ")", "?", "$", "value...
Resolve collector class @return string|null
[ "Resolve", "collector", "class" ]
77efaf8e2034293588d3759e0b8711e96757d954
https://github.com/opis-colibri/core/blob/77efaf8e2034293588d3759e0b8711e96757d954/src/Module.php#L387-L392
197,533
opis-colibri/core
src/Module.php
Module.resolveInstaller
protected function resolveInstaller(): ?string { $value = $this->getModuleInfo()['installer'] ?? null; return is_string($value) ? $value : null; }
php
protected function resolveInstaller(): ?string { $value = $this->getModuleInfo()['installer'] ?? null; return is_string($value) ? $value : null; }
[ "protected", "function", "resolveInstaller", "(", ")", ":", "?", "string", "{", "$", "value", "=", "$", "this", "->", "getModuleInfo", "(", ")", "[", "'installer'", "]", "??", "null", ";", "return", "is_string", "(", "$", "value", ")", "?", "$", "value...
Resolve installer class @return string|null
[ "Resolve", "installer", "class" ]
77efaf8e2034293588d3759e0b8711e96757d954
https://github.com/opis-colibri/core/blob/77efaf8e2034293588d3759e0b8711e96757d954/src/Module.php#L399-L404
197,534
opis-colibri/core
src/Module.php
Module.resolveAssets
protected function resolveAssets(): ?string { $module = $this->getModuleInfo(); if (!isset($module['assets'])) { return null; } $directory = $this->directory() . DIRECTORY_SEPARATOR . trim($module['assets'], DIRECTORY_SEPARATOR); return is_dir($directory) ? realpa...
php
protected function resolveAssets(): ?string { $module = $this->getModuleInfo(); if (!isset($module['assets'])) { return null; } $directory = $this->directory() . DIRECTORY_SEPARATOR . trim($module['assets'], DIRECTORY_SEPARATOR); return is_dir($directory) ? realpa...
[ "protected", "function", "resolveAssets", "(", ")", ":", "?", "string", "{", "$", "module", "=", "$", "this", "->", "getModuleInfo", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "module", "[", "'assets'", "]", ")", ")", "{", "return", "null", ...
Resolve assets dir @return string|null
[ "Resolve", "assets", "dir" ]
77efaf8e2034293588d3759e0b8711e96757d954
https://github.com/opis-colibri/core/blob/77efaf8e2034293588d3759e0b8711e96757d954/src/Module.php#L411-L419
197,535
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initTableTypes
private function initTableTypes() { $this->tableTypes = []; foreach ($this->loadTableTypes() as $type) { if (!$type instanceof TableTypeInterface) { throw new UnexpectedTypeException($type, TableTypeInterface::class); } $this->tableTypes[get_clas...
php
private function initTableTypes() { $this->tableTypes = []; foreach ($this->loadTableTypes() as $type) { if (!$type instanceof TableTypeInterface) { throw new UnexpectedTypeException($type, TableTypeInterface::class); } $this->tableTypes[get_clas...
[ "private", "function", "initTableTypes", "(", ")", "{", "$", "this", "->", "tableTypes", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadTableTypes", "(", ")", "as", "$", "type", ")", "{", "if", "(", "!", "$", "type", "instanceof", "Table...
Initializes the table types. @throws UnexpectedTypeException if any registered type is not an instance of TableTypeInterface
[ "Initializes", "the", "table", "types", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L432-L443
197,536
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initTableTypeExtensions
private function initTableTypeExtensions() { $this->tableTypeExtensions = []; foreach ($this->loadTableTypeExtensions() as $extension) { if (!$extension instanceof TableTypeExtensionInterface) { throw new UnexpectedTypeException($extension, TableTypeExtensionInterface::c...
php
private function initTableTypeExtensions() { $this->tableTypeExtensions = []; foreach ($this->loadTableTypeExtensions() as $extension) { if (!$extension instanceof TableTypeExtensionInterface) { throw new UnexpectedTypeException($extension, TableTypeExtensionInterface::c...
[ "private", "function", "initTableTypeExtensions", "(", ")", "{", "$", "this", "->", "tableTypeExtensions", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadTableTypeExtensions", "(", ")", "as", "$", "extension", ")", "{", "if", "(", "!", "$", ...
Initializes the table type extensions. @throws UnexpectedTypeException if any registered type extension is not an instance of FormTypeExtensionInterface
[ "Initializes", "the", "table", "type", "extensions", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L451-L464
197,537
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initColumnTypes
private function initColumnTypes() { $this->columnTypes = []; foreach ($this->loadColumnTypes() as $type) { if (!$type instanceof ColumnTypeInterface) { throw new UnexpectedTypeException($type, ColumnTypeInterface::class); } $this->columnTypes[ge...
php
private function initColumnTypes() { $this->columnTypes = []; foreach ($this->loadColumnTypes() as $type) { if (!$type instanceof ColumnTypeInterface) { throw new UnexpectedTypeException($type, ColumnTypeInterface::class); } $this->columnTypes[ge...
[ "private", "function", "initColumnTypes", "(", ")", "{", "$", "this", "->", "columnTypes", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadColumnTypes", "(", ")", "as", "$", "type", ")", "{", "if", "(", "!", "$", "type", "instanceof", "Co...
Initializes the column types. @throws UnexpectedTypeException if any registered type is not an instance of ColumnTypeInterface
[ "Initializes", "the", "column", "types", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L471-L482
197,538
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initColumnTypeExtensions
private function initColumnTypeExtensions() { $this->columnTypeExtensions = []; foreach ($this->loadColumnTypeExtensions() as $extension) { if (!$extension instanceof ColumnTypeExtensionInterface) { throw new UnexpectedTypeException($extension, ColumnTypeExtensionInterfa...
php
private function initColumnTypeExtensions() { $this->columnTypeExtensions = []; foreach ($this->loadColumnTypeExtensions() as $extension) { if (!$extension instanceof ColumnTypeExtensionInterface) { throw new UnexpectedTypeException($extension, ColumnTypeExtensionInterfa...
[ "private", "function", "initColumnTypeExtensions", "(", ")", "{", "$", "this", "->", "columnTypeExtensions", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadColumnTypeExtensions", "(", ")", "as", "$", "extension", ")", "{", "if", "(", "!", "$",...
Initializes the column type extensions. @throws UnexpectedTypeException if any registered type extension is not an instance of FormTypeExtensionInterface
[ "Initializes", "the", "column", "type", "extensions", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L490-L503
197,539
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initFilterTypes
private function initFilterTypes() { $this->filterTypes = []; foreach ($this->loadFilterTypes() as $type) { if (!$type instanceof FilterTypeInterface) { throw new UnexpectedTypeException($type, FilterTypeInterface::class); } $this->filterTypes[ge...
php
private function initFilterTypes() { $this->filterTypes = []; foreach ($this->loadFilterTypes() as $type) { if (!$type instanceof FilterTypeInterface) { throw new UnexpectedTypeException($type, FilterTypeInterface::class); } $this->filterTypes[ge...
[ "private", "function", "initFilterTypes", "(", ")", "{", "$", "this", "->", "filterTypes", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadFilterTypes", "(", ")", "as", "$", "type", ")", "{", "if", "(", "!", "$", "type", "instanceof", "Fi...
Initializes the filter types. @throws UnexpectedTypeException if any registered type is not an instance of FilterTypeInterface
[ "Initializes", "the", "filter", "types", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L510-L521
197,540
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initFilterTypeExtensions
private function initFilterTypeExtensions() { $this->filterTypeExtensions = []; foreach ($this->loadFilterTypeExtensions() as $extension) { if (!$extension instanceof FilterTypeExtensionInterface) { throw new UnexpectedTypeException($extension, FilterTypeExtensionInterfa...
php
private function initFilterTypeExtensions() { $this->filterTypeExtensions = []; foreach ($this->loadFilterTypeExtensions() as $extension) { if (!$extension instanceof FilterTypeExtensionInterface) { throw new UnexpectedTypeException($extension, FilterTypeExtensionInterfa...
[ "private", "function", "initFilterTypeExtensions", "(", ")", "{", "$", "this", "->", "filterTypeExtensions", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadFilterTypeExtensions", "(", ")", "as", "$", "extension", ")", "{", "if", "(", "!", "$",...
Initializes the filter type extensions. @throws UnexpectedTypeException if any registered type extension is not an instance of FormTypeExtensionInterface
[ "Initializes", "the", "filter", "type", "extensions", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L529-L542
197,541
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initActionTypes
private function initActionTypes() { $this->actionTypes = []; foreach ($this->loadActionTypes() as $type) { if (!$type instanceof ActionTypeInterface) { throw new UnexpectedTypeException($type, ActionTypeInterface::class); } $this->actionTypes[ge...
php
private function initActionTypes() { $this->actionTypes = []; foreach ($this->loadActionTypes() as $type) { if (!$type instanceof ActionTypeInterface) { throw new UnexpectedTypeException($type, ActionTypeInterface::class); } $this->actionTypes[ge...
[ "private", "function", "initActionTypes", "(", ")", "{", "$", "this", "->", "actionTypes", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadActionTypes", "(", ")", "as", "$", "type", ")", "{", "if", "(", "!", "$", "type", "instanceof", "Ac...
Initializes the action types. @throws UnexpectedTypeException if any registered type is not an instance of ActionTypeInterface
[ "Initializes", "the", "action", "types", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L549-L560
197,542
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initActionTypeExtensions
private function initActionTypeExtensions() { $this->actionTypeExtensions = []; foreach ($this->loadActionTypeExtensions() as $extension) { if (!$extension instanceof ActionTypeExtensionInterface) { throw new UnexpectedTypeException($extension, ActionTypeExtensionInterfa...
php
private function initActionTypeExtensions() { $this->actionTypeExtensions = []; foreach ($this->loadActionTypeExtensions() as $extension) { if (!$extension instanceof ActionTypeExtensionInterface) { throw new UnexpectedTypeException($extension, ActionTypeExtensionInterfa...
[ "private", "function", "initActionTypeExtensions", "(", ")", "{", "$", "this", "->", "actionTypeExtensions", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadActionTypeExtensions", "(", ")", "as", "$", "extension", ")", "{", "if", "(", "!", "$",...
Initializes the action type extensions. @throws UnexpectedTypeException if any registered type extension is not an instance of FormTypeExtensionInterface
[ "Initializes", "the", "action", "type", "extensions", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L568-L581
197,543
ekyna/Table
Extension/AbstractTableExtension.php
AbstractTableExtension.initAdapterFactories
private function initAdapterFactories() { $this->adapterFactories = []; foreach ($this->loadAdapterFactories() as $adapter) { if (!$adapter instanceof AdapterFactoryInterface) { throw new UnexpectedTypeException($adapter, AdapterFactoryInterface::class); } ...
php
private function initAdapterFactories() { $this->adapterFactories = []; foreach ($this->loadAdapterFactories() as $adapter) { if (!$adapter instanceof AdapterFactoryInterface) { throw new UnexpectedTypeException($adapter, AdapterFactoryInterface::class); } ...
[ "private", "function", "initAdapterFactories", "(", ")", "{", "$", "this", "->", "adapterFactories", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "loadAdapterFactories", "(", ")", "as", "$", "adapter", ")", "{", "if", "(", "!", "$", "adapter", ...
Initializes the adapter factories. @throws UnexpectedTypeException if any registered adapter factory is not an instance of AdapterFactoryInterface
[ "Initializes", "the", "adapter", "factories", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Extension/AbstractTableExtension.php#L588-L599
197,544
squareproton/Bond
src/Bond/Pg/Catalog/Repository/Type.php
Type.getEnumOptions
public function getEnumOptions( $oid ) { $query = new Query( "SELECT enumlabel FROM pg_enum WHERE enumtypid = %oid:int%", array( 'oid' => $oid ) ); return $this->db->query( $query )->fetch(); }
php
public function getEnumOptions( $oid ) { $query = new Query( "SELECT enumlabel FROM pg_enum WHERE enumtypid = %oid:int%", array( 'oid' => $oid ) ); return $this->db->query( $query )->fetch(); }
[ "public", "function", "getEnumOptions", "(", "$", "oid", ")", "{", "$", "query", "=", "new", "Query", "(", "\"SELECT enumlabel FROM pg_enum WHERE enumtypid = %oid:int%\"", ",", "array", "(", "'oid'", "=>", "$", "oid", ")", ")", ";", "return", "$", "this", "->"...
Get array of enum options @return array()
[ "Get", "array", "of", "enum", "options" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Catalog/Repository/Type.php#L96-L108
197,545
squareproton/Bond
src/Bond/Pg/Catalog/Repository/Type.php
Type.findByName
public function findByName( $name ) { $result = $this->db->query( new Query( <<<SQL SELECT t.oid AS oid, t.typname AS name, n.nspname as "schema", t.typlen AS length, t.typtype AS type, t.typcategory AS category, t.typarray AS "arrayType", t.typdefault AS default...
php
public function findByName( $name ) { $result = $this->db->query( new Query( <<<SQL SELECT t.oid AS oid, t.typname AS name, n.nspname as "schema", t.typlen AS length, t.typtype AS type, t.typcategory AS category, t.typarray AS "arrayType", t.typdefault AS default...
[ "public", "function", "findByName", "(", "$", "name", ")", "{", "$", "result", "=", "$", "this", "->", "db", "->", "query", "(", "new", "Query", "(", " <<<SQL\nSELECT\n t.oid AS oid,\n t.typname AS name,\n n.nspname as \"schema\",\n t.typlen AS length,\n t.ty...
Init a type by it's name. Most likely used for enum types @return Type|null
[ "Init", "a", "type", "by", "it", "s", "name", ".", "Most", "likely", "used", "for", "enum", "types" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Catalog/Repository/Type.php#L114-L146
197,546
ornament-orm/core
src/State.php
State.isDirty
public function isDirty() : bool { foreach ($this->__state as $prop => $val) { if ($this->isModified($prop)) { return true; } } return false; }
php
public function isDirty() : bool { foreach ($this->__state as $prop => $val) { if ($this->isModified($prop)) { return true; } } return false; }
[ "public", "function", "isDirty", "(", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "__state", "as", "$", "prop", "=>", "$", "val", ")", "{", "if", "(", "$", "this", "->", "isModified", "(", "$", "prop", ")", ")", "{", "return", "true...
Returns true if any of the model's properties was modified. @return bool
[ "Returns", "true", "if", "any", "of", "the", "model", "s", "properties", "was", "modified", "." ]
b573c89d11a183c2e0e11afe8b6fdd56b2cd5ba8
https://github.com/ornament-orm/core/blob/b573c89d11a183c2e0e11afe8b6fdd56b2cd5ba8/src/State.php#L14-L22
197,547
linpax/microphp-framework
src/file/FileHelper.php
FileHelper.removeDir
public static function removeDir($path) { if (is_file($path)) { unlink($path); } else { foreach (scandir($path) as $dir) { if ($dir === '.' || $dir === '..') { continue; } static::removeDir($path.'/'.$dir); ...
php
public static function removeDir($path) { if (is_file($path)) { unlink($path); } else { foreach (scandir($path) as $dir) { if ($dir === '.' || $dir === '..') { continue; } static::removeDir($path.'/'.$dir); ...
[ "public", "static", "function", "removeDir", "(", "$", "path", ")", "{", "if", "(", "is_file", "(", "$", "path", ")", ")", "{", "unlink", "(", "$", "path", ")", ";", "}", "else", "{", "foreach", "(", "scandir", "(", "$", "path", ")", "as", "$", ...
Recursive remove dir @access public @param string $path path to remove @return void @static
[ "Recursive", "remove", "dir" ]
11f3370f3f64c516cce9b84ecd8276c6e9ae8df9
https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/file/FileHelper.php#L63-L78
197,548
linpax/microphp-framework
src/file/FileHelper.php
FileHelper.recurseCopyIfEdited
public static function recurseCopyIfEdited($src = '', $dst = '', array $excludes = ['php']) { if (!is_dir($dst) && (!mkdir($dst) && !is_dir($dst))) { throw new Exception('Copy dir error, access denied for path: '.$dst); } $dir = opendir($src); if (!$dir) { th...
php
public static function recurseCopyIfEdited($src = '', $dst = '', array $excludes = ['php']) { if (!is_dir($dst) && (!mkdir($dst) && !is_dir($dst))) { throw new Exception('Copy dir error, access denied for path: '.$dst); } $dir = opendir($src); if (!$dir) { th...
[ "public", "static", "function", "recurseCopyIfEdited", "(", "$", "src", "=", "''", ",", "$", "dst", "=", "''", ",", "array", "$", "excludes", "=", "[", "'php'", "]", ")", "{", "if", "(", "!", "is_dir", "(", "$", "dst", ")", "&&", "(", "!", "mkdir...
Recursive copy files if edited @access public @param string $src source path @param string $dst destination path @param array $excludes excludes extensions @return void @throws Exception @static
[ "Recursive", "copy", "files", "if", "edited" ]
11f3370f3f64c516cce9b84ecd8276c6e9ae8df9
https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/file/FileHelper.php#L125-L159
197,549
Wedeto/HTTP
src/Session.php
Session.start
public function start() { if ($this->active) return $this; if (PHP_SAPI === "cli") { $this->startCLISession(); } else { // @codeCoverageIgnoreStart $this->startHTTPSession(); // @codeCoverageIgnoreEnd ...
php
public function start() { if ($this->active) return $this; if (PHP_SAPI === "cli") { $this->startCLISession(); } else { // @codeCoverageIgnoreStart $this->startHTTPSession(); // @codeCoverageIgnoreEnd ...
[ "public", "function", "start", "(", ")", "{", "if", "(", "$", "this", "->", "active", ")", "return", "$", "this", ";", "if", "(", "PHP_SAPI", "===", "\"cli\"", ")", "{", "$", "this", "->", "startCLISession", "(", ")", ";", "}", "else", "{", "// @co...
Actually start the session @return Session Provide fluent interface
[ "Actually", "start", "the", "session" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L130-L150
197,550
Wedeto/HTTP
src/Session.php
Session.setSessionID
public function setSessionID(string $session_id) { if (!defined('WEDETO_TEST') || WEDETO_TEST === 0) throw new \RuntimeException("Cannot change the session ID"); $this->session_id = $session_id; return $this; }
php
public function setSessionID(string $session_id) { if (!defined('WEDETO_TEST') || WEDETO_TEST === 0) throw new \RuntimeException("Cannot change the session ID"); $this->session_id = $session_id; return $this; }
[ "public", "function", "setSessionID", "(", "string", "$", "session_id", ")", "{", "if", "(", "!", "defined", "(", "'WEDETO_TEST'", ")", "||", "WEDETO_TEST", "===", "0", ")", "throw", "new", "\\", "RuntimeException", "(", "\"Cannot change the session ID\"", ")", ...
Change the session ID, useful for tests. Disallowed in normal operation. @return Session Provide fluent interface @codeCoverageIgnore
[ "Change", "the", "session", "ID", "useful", "for", "tests", ".", "Disallowed", "in", "normal", "operation", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L175-L182
197,551
Wedeto/HTTP
src/Session.php
Session.startHTTPSession
public function startHTTPSession() { // @codeCoverageIgnoreStart // Safety measure - can't test this without replacing PHP if (session_status() === PHP_SESSION_DISABLED) throw new \RuntimeException("Sesssions are disabled"); // @codeCoverageIgnoreEnd if (session_...
php
public function startHTTPSession() { // @codeCoverageIgnoreStart // Safety measure - can't test this without replacing PHP if (session_status() === PHP_SESSION_DISABLED) throw new \RuntimeException("Sesssions are disabled"); // @codeCoverageIgnoreEnd if (session_...
[ "public", "function", "startHTTPSession", "(", ")", "{", "// @codeCoverageIgnoreStart", "// Safety measure - can't test this without replacing PHP", "if", "(", "session_status", "(", ")", "===", "PHP_SESSION_DISABLED", ")", "throw", "new", "\\", "RuntimeException", "(", "\"...
Set up a HTTP session using cookies and the PHP session machinery @return Session Provides fluent interface
[ "Set", "up", "a", "HTTP", "session", "using", "cookies", "and", "the", "PHP", "session", "machinery" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L204-L257
197,552
Wedeto/HTTP
src/Session.php
Session.secureSession
private function secureSession() { $expired = false; if ($this->has('session_mgmt', 'destroyed')) { $when = $this->get('session_mgmt', 'destroyed'); $ua = $this->get('session_mgmt', 'last_ua'); $ip = $this->get('session_mgmt', 'last_ip'); $now...
php
private function secureSession() { $expired = false; if ($this->has('session_mgmt', 'destroyed')) { $when = $this->get('session_mgmt', 'destroyed'); $ua = $this->get('session_mgmt', 'last_ua'); $ip = $this->get('session_mgmt', 'last_ip'); $now...
[ "private", "function", "secureSession", "(", ")", "{", "$", "expired", "=", "false", ";", "if", "(", "$", "this", "->", "has", "(", "'session_mgmt'", ",", "'destroyed'", ")", ")", "{", "$", "when", "=", "$", "this", "->", "get", "(", "'session_mgmt'", ...
Secure the session This method checks if the session was destroyed, and if so, if a redirect to a new session should be done. The new session ID is stored and will be sent to the client iff: - Less than 1 minute has passed since the previous session was destroyed - The client has the same user agent and IP-address as...
[ "Secure", "the", "session" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L271-L344
197,553
Wedeto/HTTP
src/Session.php
Session.resetID
public function resetID() { if (session_status() === PHP_SESSION_ACTIVE) { $this->set('session_mgmt', 'destroyed', time()); $auth = $this->get('authentication'); if ($auth) unset($this['authentication']); $new_session_id = self::create...
php
public function resetID() { if (session_status() === PHP_SESSION_ACTIVE) { $this->set('session_mgmt', 'destroyed', time()); $auth = $this->get('authentication'); if ($auth) unset($this['authentication']); $new_session_id = self::create...
[ "public", "function", "resetID", "(", ")", "{", "if", "(", "session_status", "(", ")", "===", "PHP_SESSION_ACTIVE", ")", "{", "$", "this", "->", "set", "(", "'session_mgmt'", ",", "'destroyed'", ",", "time", "(", ")", ")", ";", "$", "auth", "=", "$", ...
Should be called when the session ID should be changed, for example after logging in or out. @return Session Provides fluent interface
[ "Should", "be", "called", "when", "the", "session", "ID", "should", "be", "changed", "for", "example", "after", "logging", "in", "or", "out", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L351-L382
197,554
Wedeto/HTTP
src/Session.php
Session.create_new_id
private static function create_new_id(string $prefix = "Wedeto") { if (version_compare(PHP_VERSION, '7.1.0') > 0) return session_create_id($prefix); return $prefix . bin2hex(random_bytes(16)); }
php
private static function create_new_id(string $prefix = "Wedeto") { if (version_compare(PHP_VERSION, '7.1.0') > 0) return session_create_id($prefix); return $prefix . bin2hex(random_bytes(16)); }
[ "private", "static", "function", "create_new_id", "(", "string", "$", "prefix", "=", "\"Wedeto\"", ")", "{", "if", "(", "version_compare", "(", "PHP_VERSION", ",", "'7.1.0'", ")", ">", "0", ")", "return", "session_create_id", "(", "$", "prefix", ")", ";", ...
Helper function. PHP 7.1 introduces session_create_id function. This is used in PHP 7.1 but a fallback using random_bytes is used on PHP 7.0. @param string $prefix A prefix to prepend to the session ID @return string A hexadecimal session ID
[ "Helper", "function", ".", "PHP", "7", ".", "1", "introduces", "session_create_id", "function", ".", "This", "is", "used", "in", "PHP", "7", ".", "1", "but", "a", "fallback", "using", "random_bytes", "is", "used", "on", "PHP", "7", ".", "0", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L392-L397
197,555
Wedeto/HTTP
src/Session.php
Session.destroy
public function destroy() { if ($this->active) { $this->clear(); if (session_status() === PHP_SESSION_ACTIVE) session_commit(); $this->active = false; } return $this; }
php
public function destroy() { if ($this->active) { $this->clear(); if (session_status() === PHP_SESSION_ACTIVE) session_commit(); $this->active = false; } return $this; }
[ "public", "function", "destroy", "(", ")", "{", "if", "(", "$", "this", "->", "active", ")", "{", "$", "this", "->", "clear", "(", ")", ";", "if", "(", "session_status", "(", ")", "===", "PHP_SESSION_ACTIVE", ")", "session_commit", "(", ")", ";", "$"...
Should be called when the session should be cleared and destroyed. @return Wedeto\HTTP\Session Provides fluent interface
[ "Should", "be", "called", "when", "the", "session", "should", "be", "cleared", "and", "destroyed", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Session.php#L450-L460
197,556
jenskooij/cloudcontrol
src/cc/ResponseHeaders.php
ResponseHeaders.init
public static function init() { self::add(self::HEADER_SET_COOKIE, '__Host-sess=' . session_id() . '; path=' . Request::$subfolders . '; Secure; HttpOnly; SameSite;'); if (Request::isSecure()) { self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_...
php
public static function init() { self::add(self::HEADER_SET_COOKIE, '__Host-sess=' . session_id() . '; path=' . Request::$subfolders . '; Secure; HttpOnly; SameSite;'); if (Request::isSecure()) { self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_...
[ "public", "static", "function", "init", "(", ")", "{", "self", "::", "add", "(", "self", "::", "HEADER_SET_COOKIE", ",", "'__Host-sess='", ".", "session_id", "(", ")", ".", "'; path='", ".", "Request", "::", "$", "subfolders", ".", "'; Secure; HttpOnly; SameSi...
Adds content security policy headers
[ "Adds", "content", "security", "policy", "headers" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/cc/ResponseHeaders.php#L79-L94
197,557
phata/widgetfy
src/Site/Youtube.php
Youtube.parseParams
public static function parseParams($url_parsed) { $vid = FALSE; $url_seperator = FALSE; if (preg_match('/^\/watch$/', $url_parsed['path'])) { // new Youtube utilizes fragment part instead of query $fragment_regex = '/^\!v\=([a-zA-Z0-9]+).*$/'; if (isset($url_parsed...
php
public static function parseParams($url_parsed) { $vid = FALSE; $url_seperator = FALSE; if (preg_match('/^\/watch$/', $url_parsed['path'])) { // new Youtube utilizes fragment part instead of query $fragment_regex = '/^\!v\=([a-zA-Z0-9]+).*$/'; if (isset($url_parsed...
[ "public", "static", "function", "parseParams", "(", "$", "url_parsed", ")", "{", "$", "vid", "=", "FALSE", ";", "$", "url_seperator", "=", "FALSE", ";", "if", "(", "preg_match", "(", "'/^\\/watch$/'", ",", "$", "url_parsed", "[", "'path'", "]", ")", ")",...
helper function extract video id and other parameters from url @param string[] $url_parsed result of parse_url($url)
[ "helper", "function", "extract", "video", "id", "and", "other", "parameters", "from", "url" ]
00102c35ec5267b42c627f1e34b8e64a7dd3590c
https://github.com/phata/widgetfy/blob/00102c35ec5267b42c627f1e34b8e64a7dd3590c/src/Site/Youtube.php#L200-L255
197,558
PageBoost/hipchat-php-v2
src/PageBoost/HipChatV2/Resources/Rooms.php
Rooms.update
public function update($name, $is_public, $is_archived, $is_guest_accessible, $topic, $owner_user_id) { $queryParams = array( 'name' => $name, 'privacy' => (($is_public === true) ? 'public' : 'private' ), 'is_archived' => $is_archived, 'is_guest_accessible' =>...
php
public function update($name, $is_public, $is_archived, $is_guest_accessible, $topic, $owner_user_id) { $queryParams = array( 'name' => $name, 'privacy' => (($is_public === true) ? 'public' : 'private' ), 'is_archived' => $is_archived, 'is_guest_accessible' =>...
[ "public", "function", "update", "(", "$", "name", ",", "$", "is_public", ",", "$", "is_archived", ",", "$", "is_guest_accessible", ",", "$", "topic", ",", "$", "owner_user_id", ")", "{", "$", "queryParams", "=", "array", "(", "'name'", "=>", "$", "name",...
Update room All values are required! @param string $name @param bool $is_public @param bool $is_archived @param bool $is_guest_accessible @param string $topic @param int|string $owner_user_id
[ "Update", "room", "All", "values", "are", "required!" ]
47625e17fba273b7cc916268d972b4ca8cc48c0c
https://github.com/PageBoost/hipchat-php-v2/blob/47625e17fba273b7cc916268d972b4ca8cc48c0c/src/PageBoost/HipChatV2/Resources/Rooms.php#L89-L106
197,559
PageBoost/hipchat-php-v2
src/PageBoost/HipChatV2/Resources/Rooms.php
Rooms.setTopic
public function setTopic($topic) { $queryParams = array( 'topic' => $topic, ); $room_id_or_name = $this->getId(); $response = $this->request->put('room/'.$room_id_or_name.'/topic', $queryParams); return $this->request->returnResponseObject($response); }
php
public function setTopic($topic) { $queryParams = array( 'topic' => $topic, ); $room_id_or_name = $this->getId(); $response = $this->request->put('room/'.$room_id_or_name.'/topic', $queryParams); return $this->request->returnResponseObject($response); }
[ "public", "function", "setTopic", "(", "$", "topic", ")", "{", "$", "queryParams", "=", "array", "(", "'topic'", "=>", "$", "topic", ",", ")", ";", "$", "room_id_or_name", "=", "$", "this", "->", "getId", "(", ")", ";", "$", "response", "=", "$", "...
Set room topic @param string $topic
[ "Set", "room", "topic" ]
47625e17fba273b7cc916268d972b4ca8cc48c0c
https://github.com/PageBoost/hipchat-php-v2/blob/47625e17fba273b7cc916268d972b4ca8cc48c0c/src/PageBoost/HipChatV2/Resources/Rooms.php#L123-L133
197,560
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Controller/RestController.php
RestController.errorAction
public function errorAction() { $validationResults = $this->arguments->getValidationResults()->getFlattenedErrors(); $result = array(); /** @var \Neos\Error\Messages\Error $validationResult */ foreach ($validationResults as $key => $validationResult) { /** @var \Neos\Flow\Validation\Error $error */ forea...
php
public function errorAction() { $validationResults = $this->arguments->getValidationResults()->getFlattenedErrors(); $result = array(); /** @var \Neos\Error\Messages\Error $validationResult */ foreach ($validationResults as $key => $validationResult) { /** @var \Neos\Flow\Validation\Error $error */ forea...
[ "public", "function", "errorAction", "(", ")", "{", "$", "validationResults", "=", "$", "this", "->", "arguments", "->", "getValidationResults", "(", ")", "->", "getFlattenedErrors", "(", ")", ";", "$", "result", "=", "array", "(", ")", ";", "/** @var \\Neos...
Return validation results as json
[ "Return", "validation", "results", "as", "json" ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Controller/RestController.php#L252-L281
197,561
chalasr/RCHCapistranoBundle
Command/Deploy/SetupCommand.php
SetupCommand.interact
protected function interact(InputInterface $input, OutputInterface $output) { $questionHelper = $this->getHelper('question'); $formatter = $this->getHelper('formatter'); $rootDir = $this->getRootDir(); $fs = new Filesystem(); $appPath = explode('/', $rootDir); $appNam...
php
protected function interact(InputInterface $input, OutputInterface $output) { $questionHelper = $this->getHelper('question'); $formatter = $this->getHelper('formatter'); $rootDir = $this->getRootDir(); $fs = new Filesystem(); $appPath = explode('/', $rootDir); $appNam...
[ "protected", "function", "interact", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "questionHelper", "=", "$", "this", "->", "getHelper", "(", "'question'", ")", ";", "$", "formatter", "=", "$", "this", "->", "g...
Configures deployment. @param InputInterface $input @param OutputInterface $output @return OutputInterface
[ "Configures", "deployment", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/SetupCommand.php#L62-L89
197,562
chalasr/RCHCapistranoBundle
Command/Deploy/SetupCommand.php
SetupCommand.initConfig
protected function initConfig(Filesystem $fs, $rootDir) { $bundleDir = $this->getBundleVendorDir(); $path = $this->getCapistranoDir(); if (!$fs->exists($path.'/deploy.rb') || !$fs->exists($path.'/deploy/production.rb')) { return $fs->mirror($bundleDir.'/Resources/config/capistra...
php
protected function initConfig(Filesystem $fs, $rootDir) { $bundleDir = $this->getBundleVendorDir(); $path = $this->getCapistranoDir(); if (!$fs->exists($path.'/deploy.rb') || !$fs->exists($path.'/deploy/production.rb')) { return $fs->mirror($bundleDir.'/Resources/config/capistra...
[ "protected", "function", "initConfig", "(", "Filesystem", "$", "fs", ",", "$", "rootDir", ")", "{", "$", "bundleDir", "=", "$", "this", "->", "getBundleVendorDir", "(", ")", ";", "$", "path", "=", "$", "this", "->", "getCapistranoDir", "(", ")", ";", "...
Dump capistrano configuration skin from Resources directory. @param Filesystem $fs @param string $rootDir Application root dir
[ "Dump", "capistrano", "configuration", "skin", "from", "Resources", "directory", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/SetupCommand.php#L97-L111
197,563
chalasr/RCHCapistranoBundle
Command/Deploy/SetupCommand.php
SetupCommand.configureDeploy
protected function configureDeploy(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $appName) { $data = []; $properties = array( 'application' => array( 'helper' => $appName, 'label' => 'Application', ...
php
protected function configureDeploy(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $appName) { $data = []; $properties = array( 'application' => array( 'helper' => $appName, 'label' => 'Application', ...
[ "protected", "function", "configureDeploy", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ",", "QuestionHelper", "$", "questionHelper", ",", "$", "appName", ")", "{", "$", "data", "=", "[", "]", ";", "$", "properties", "=", "arr...
Configure deploy.rb capistrano file. @param InputInterface $input @param OutputInterface $output @param QuestionHelper $questionHelper @param string $appName @return array
[ "Configure", "deploy", ".", "rb", "capistrano", "file", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/SetupCommand.php#L123-L159
197,564
chalasr/RCHCapistranoBundle
Command/Deploy/SetupCommand.php
SetupCommand.checkComposer
protected function checkComposer(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData) { $question = new Question('<info>Download composer</info> [<comment>yes</comment>]: ', 'yes'); $question->setAutocompleterValues(['yes', 'no']); $downloadComposer = ...
php
protected function checkComposer(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData) { $question = new Question('<info>Download composer</info> [<comment>yes</comment>]: ', 'yes'); $question->setAutocompleterValues(['yes', 'no']); $downloadComposer = ...
[ "protected", "function", "checkComposer", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ",", "QuestionHelper", "$", "questionHelper", ",", "$", "deployData", ")", "{", "$", "question", "=", "new", "Question", "(", "'<info>Download com...
Check need of composer. @param InputInterface $input @param OutputInterface $output @param QuestionHelper $questionHelper @param array $deployData @return bool
[ "Check", "need", "of", "composer", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/SetupCommand.php#L171-L179
197,565
chalasr/RCHCapistranoBundle
Command/Deploy/SetupCommand.php
SetupCommand.checkSchemaUpdate
protected function checkSchemaUpdate(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData) { $question = new Question('<info>Update database schema</info> [<comment>yes</comment>]: ', 'yes'); $question->setAutocompleterValues(['yes', 'no']); $wantDump =...
php
protected function checkSchemaUpdate(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData) { $question = new Question('<info>Update database schema</info> [<comment>yes</comment>]: ', 'yes'); $question->setAutocompleterValues(['yes', 'no']); $wantDump =...
[ "protected", "function", "checkSchemaUpdate", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ",", "QuestionHelper", "$", "questionHelper", ",", "$", "deployData", ")", "{", "$", "question", "=", "new", "Question", "(", "'<info>Update d...
Check for database schema update. @param InputInterface $input @param OutputInterface $output @param QuestionHelper $questionHelper @param array $deployData @return bool
[ "Check", "for", "database", "schema", "update", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/SetupCommand.php#L191-L199
197,566
chalasr/RCHCapistranoBundle
Command/Deploy/SetupCommand.php
SetupCommand.configureSSH
protected function configureSSH(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData) { $serverOptions = [ 'domain' => [ 'helper' => $deployData['ssh_user'], 'label' => 'Domain name', ], ]; $sshOp...
php
protected function configureSSH(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData) { $serverOptions = [ 'domain' => [ 'helper' => $deployData['ssh_user'], 'label' => 'Domain name', ], ]; $sshOp...
[ "protected", "function", "configureSSH", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ",", "QuestionHelper", "$", "questionHelper", ",", "$", "deployData", ")", "{", "$", "serverOptions", "=", "[", "'domain'", "=>", "[", "'helper'"...
Configure SSH options for production staging. @param InputInterface $input @param OutputInterface $output @param QuestionHelper $questionHelper @param array $deployData @return array The production staging configuration
[ "Configure", "SSH", "options", "for", "production", "staging", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/SetupCommand.php#L211-L256
197,567
PenoaksDev/Milky-Framework
src/Milky/Helpers/Func.php
Func.randomStr
public static function randomStr( $base ) { $result = ""; if ( is_int( $base ) ) for ( $i = 0; $i < $base; $i++ ) $result .= static::$randomCharMap[random_int( 0, count( static::$randomCharMap ) )]; else for ( $i = 0; $i < strlen( $base ); $i++ ) $result .= static::randomChar( $base[$i] ); retu...
php
public static function randomStr( $base ) { $result = ""; if ( is_int( $base ) ) for ( $i = 0; $i < $base; $i++ ) $result .= static::$randomCharMap[random_int( 0, count( static::$randomCharMap ) )]; else for ( $i = 0; $i < strlen( $base ); $i++ ) $result .= static::randomChar( $base[$i] ); retu...
[ "public", "static", "function", "randomStr", "(", "$", "base", ")", "{", "$", "result", "=", "\"\"", ";", "if", "(", "is_int", "(", "$", "base", ")", ")", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "base", ";", "$", "i", "++", ...
Scrambles of string of characters but keeps the results either uppercase, lowercase, or numeric @param string|int $base
[ "Scrambles", "of", "string", "of", "characters", "but", "keeps", "the", "results", "either", "uppercase", "lowercase", "or", "numeric" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Func.php#L106-L118
197,568
PenoaksDev/Milky-Framework
src/Milky/Helpers/Func.php
Func.randomChars
public static function randomChars( $seed, $len ) { $result = ''; for ( $i = 0; $i < $len; $i++ ) $result .= $seed[random_int( 0, strlen( $seed ) )]; return $result; }
php
public static function randomChars( $seed, $len ) { $result = ''; for ( $i = 0; $i < $len; $i++ ) $result .= $seed[random_int( 0, strlen( $seed ) )]; return $result; }
[ "public", "static", "function", "randomChars", "(", "$", "seed", ",", "$", "len", ")", "{", "$", "result", "=", "''", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "len", ";", "$", "i", "++", ")", "$", "result", ".=", "$", "...
Randomizes from the provided seed @param string $seed @param int $len @return string
[ "Randomizes", "from", "the", "provided", "seed" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Func.php#L127-L135
197,569
PenoaksDev/Milky-Framework
src/Milky/Helpers/Func.php
Func.randomChar
public static function randomChar( $char ) { if ( strlen( $char ) == 0 ) return ''; $char = ord( $char ); if ( $char > 64 && $char < 91 ) // Uppercase return static::randomCharRange( 65, 90 ); if ( $char > 96 && $char < 123 ) // Lowercase return static::randomCharRange( 97, 122 ); if ( $char > 4...
php
public static function randomChar( $char ) { if ( strlen( $char ) == 0 ) return ''; $char = ord( $char ); if ( $char > 64 && $char < 91 ) // Uppercase return static::randomCharRange( 65, 90 ); if ( $char > 96 && $char < 123 ) // Lowercase return static::randomCharRange( 97, 122 ); if ( $char > 4...
[ "public", "static", "function", "randomChar", "(", "$", "char", ")", "{", "if", "(", "strlen", "(", "$", "char", ")", "==", "0", ")", "return", "''", ";", "$", "char", "=", "ord", "(", "$", "char", ")", ";", "if", "(", "$", "char", ">", "64", ...
Randomizes the first character of string, preserves uppercase, lowercase, and numeric. @param string $char @return string
[ "Randomizes", "the", "first", "character", "of", "string", "preserves", "uppercase", "lowercase", "and", "numeric", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Func.php#L143-L160
197,570
PenoaksDev/Milky-Framework
src/Milky/Helpers/Func.php
Func.randomCharRange
public static function randomCharRange( $start, $end ) { if ( count( static::$randomCharMap ) == 0 ) static::populate(); return chr( random_int( $start, $end ) ); }
php
public static function randomCharRange( $start, $end ) { if ( count( static::$randomCharMap ) == 0 ) static::populate(); return chr( random_int( $start, $end ) ); }
[ "public", "static", "function", "randomCharRange", "(", "$", "start", ",", "$", "end", ")", "{", "if", "(", "count", "(", "static", "::", "$", "randomCharMap", ")", "==", "0", ")", "static", "::", "populate", "(", ")", ";", "return", "chr", "(", "ran...
Returns a random character within the specified range @param int $start @param int $end @return string
[ "Returns", "a", "random", "character", "within", "the", "specified", "range" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Func.php#L169-L175
197,571
PenoaksDev/Milky-Framework
src/Milky/Helpers/Func.php
Func.stacktrace
public static function stacktrace( $stack = null, $withPre = false ) { if ( is_null( $stack ) ) $stack = debug_backtrace(); $output = $withPre ? '<pre>' : ''; $stackLen = count( $stack ); for ( $i = 1; $i < $stackLen; $i++ ) { $entry = $stack[$i]; $func = $entry['function'] . '('; $argsLen = co...
php
public static function stacktrace( $stack = null, $withPre = false ) { if ( is_null( $stack ) ) $stack = debug_backtrace(); $output = $withPre ? '<pre>' : ''; $stackLen = count( $stack ); for ( $i = 1; $i < $stackLen; $i++ ) { $entry = $stack[$i]; $func = $entry['function'] . '('; $argsLen = co...
[ "public", "static", "function", "stacktrace", "(", "$", "stack", "=", "null", ",", "$", "withPre", "=", "false", ")", "{", "if", "(", "is_null", "(", "$", "stack", ")", ")", "$", "stack", "=", "debug_backtrace", "(", ")", ";", "$", "output", "=", "...
Creates a human readable stack trace @param null $stack @return string
[ "Creates", "a", "human", "readable", "stack", "trace" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Func.php#L183-L226
197,572
kambalabs/KmbPuppetDb
src/KmbPuppetDb/Service/NodeStatistics.php
NodeStatistics.processStatistics
protected function processStatistics($query = null) { $this->unchangedCount = 0; $this->changedCount = 0; $this->failedCount = 0; $this->nodesCountByOS = []; $this->nodesPercentageByOS = []; $this->recentlyRebootedNodes = []; $nodes = $this->getNodeService()->...
php
protected function processStatistics($query = null) { $this->unchangedCount = 0; $this->changedCount = 0; $this->failedCount = 0; $this->nodesCountByOS = []; $this->nodesPercentageByOS = []; $this->recentlyRebootedNodes = []; $nodes = $this->getNodeService()->...
[ "protected", "function", "processStatistics", "(", "$", "query", "=", "null", ")", "{", "$", "this", "->", "unchangedCount", "=", "0", ";", "$", "this", "->", "changedCount", "=", "0", ";", "$", "this", "->", "failedCount", "=", "0", ";", "$", "this", ...
Browse all nodes and process all the statistics @param \KmbPuppetDb\Query\Query|array $query
[ "Browse", "all", "nodes", "and", "process", "all", "the", "statistics" ]
df56a275cf00f4402cf121a2e99149168f1f8b2d
https://github.com/kambalabs/KmbPuppetDb/blob/df56a275cf00f4402cf121a2e99149168f1f8b2d/src/KmbPuppetDb/Service/NodeStatistics.php#L221-L253
197,573
AlexanderPoellmann/Laravel-Settings
src/Driver/FileDriver.php
FileDriver.setPath
public function setPath($path) { if ( ! $this->files->exists($path) ) { $result = $this->files->put($path, '{}'); if ( $result === false ) { throw new NotWritableException("Could not write to $path."); } } if ( ! $this->files->isWritable($path) ) { throw new NotWritableException("$path is not wr...
php
public function setPath($path) { if ( ! $this->files->exists($path) ) { $result = $this->files->put($path, '{}'); if ( $result === false ) { throw new NotWritableException("Could not write to $path."); } } if ( ! $this->files->isWritable($path) ) { throw new NotWritableException("$path is not wr...
[ "public", "function", "setPath", "(", "$", "path", ")", "{", "if", "(", "!", "$", "this", "->", "files", "->", "exists", "(", "$", "path", ")", ")", "{", "$", "result", "=", "$", "this", "->", "files", "->", "put", "(", "$", "path", ",", "'{}'"...
Set the path for the JSON file. @param string $path @throws NotWritableException
[ "Set", "the", "path", "for", "the", "JSON", "file", "." ]
bf06f78cbbf86adb8576a29caae496d1e03b32ab
https://github.com/AlexanderPoellmann/Laravel-Settings/blob/bf06f78cbbf86adb8576a29caae496d1e03b32ab/src/Driver/FileDriver.php#L38-L52
197,574
Torann/skosh-generator
src/Twig/AbstractExtension.php
AbstractExtension.isCurrent
public function isCurrent($page, $pattern) { // Remove site URL from string $page = str_replace($this->getBuilder()->app->getSetting('url'), '', $page); return str_is($pattern, $page); }
php
public function isCurrent($page, $pattern) { // Remove site URL from string $page = str_replace($this->getBuilder()->app->getSetting('url'), '', $page); return str_is($pattern, $page); }
[ "public", "function", "isCurrent", "(", "$", "page", ",", "$", "pattern", ")", "{", "// Remove site URL from string", "$", "page", "=", "str_replace", "(", "$", "this", "->", "getBuilder", "(", ")", "->", "app", "->", "getSetting", "(", "'url'", ")", ",", ...
Is given URL the current page? @param $page @param $pattern @return bool
[ "Is", "given", "URL", "the", "current", "page?" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Twig/AbstractExtension.php#L43-L49
197,575
mmethner/engine
src/Core/Exception.php
Exception.collect
private static function collect() { $message = ''; $message .= sprintf("\r\nURL: %s\r\n", $_SERVER['REQUEST_URI']); if (!empty($_POST)) { $message .= "\r\n"; foreach ($_POST as $key => $value) { if (in_array($key, [ 'password', ...
php
private static function collect() { $message = ''; $message .= sprintf("\r\nURL: %s\r\n", $_SERVER['REQUEST_URI']); if (!empty($_POST)) { $message .= "\r\n"; foreach ($_POST as $key => $value) { if (in_array($key, [ 'password', ...
[ "private", "static", "function", "collect", "(", ")", "{", "$", "message", "=", "''", ";", "$", "message", ".=", "sprintf", "(", "\"\\r\\nURL: %s\\r\\n\"", ",", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ")", ";", "if", "(", "!", "empty", "(", "$", "_P...
collects data for current request @return string
[ "collects", "data", "for", "current", "request" ]
89e1bcc644cf8cc3712a67ef1697da2ca4008f74
https://github.com/mmethner/engine/blob/89e1bcc644cf8cc3712a67ef1697da2ca4008f74/src/Core/Exception.php#L53-L111
197,576
Stinger-Soft/TwigExtensions
src/StingerSoft/TwigExtensions/DoctrineExtensions.php
DoctrineExtensions.setDoctrineFunctions
public function setDoctrineFunctions(\StingerSoft\DoctrineCommons\Utils\DoctrineFunctionsInterface $doctrineFunctions = null) { $this->doctrineFunctions = $doctrineFunctions; }
php
public function setDoctrineFunctions(\StingerSoft\DoctrineCommons\Utils\DoctrineFunctionsInterface $doctrineFunctions = null) { $this->doctrineFunctions = $doctrineFunctions; }
[ "public", "function", "setDoctrineFunctions", "(", "\\", "StingerSoft", "\\", "DoctrineCommons", "\\", "Utils", "\\", "DoctrineFunctionsInterface", "$", "doctrineFunctions", "=", "null", ")", "{", "$", "this", "->", "doctrineFunctions", "=", "$", "doctrineFunctions", ...
Set the doctrine commons functions to be used by the twig extension. @param \StingerSoft\DoctrineCommons\Utils\DoctrineFunctionsInterface $doctrineFunctions
[ "Set", "the", "doctrine", "commons", "functions", "to", "be", "used", "by", "the", "twig", "extension", "." ]
7bfce337b0dd33106e22f80b221338451a02d7c5
https://github.com/Stinger-Soft/TwigExtensions/blob/7bfce337b0dd33106e22f80b221338451a02d7c5/src/StingerSoft/TwigExtensions/DoctrineExtensions.php#L23-L25
197,577
Stinger-Soft/TwigExtensions
src/StingerSoft/TwigExtensions/DoctrineExtensions.php
DoctrineExtensions.unproxifyFilter
public function unproxifyFilter($object) { if($this->hasDoctrineFunctions() && method_exists($this->doctrineFunctions, 'unproxifyFilter')) { return $this->doctrineFunctions->unproxifyFilter($object); } return $object; }
php
public function unproxifyFilter($object) { if($this->hasDoctrineFunctions() && method_exists($this->doctrineFunctions, 'unproxifyFilter')) { return $this->doctrineFunctions->unproxifyFilter($object); } return $object; }
[ "public", "function", "unproxifyFilter", "(", "$", "object", ")", "{", "if", "(", "$", "this", "->", "hasDoctrineFunctions", "(", ")", "&&", "method_exists", "(", "$", "this", "->", "doctrineFunctions", ",", "'unproxifyFilter'", ")", ")", "{", "return", "$",...
Transforms the given doctrine proxy object into a 'real' entity @param object $object @return object|NULL
[ "Transforms", "the", "given", "doctrine", "proxy", "object", "into", "a", "real", "entity" ]
7bfce337b0dd33106e22f80b221338451a02d7c5
https://github.com/Stinger-Soft/TwigExtensions/blob/7bfce337b0dd33106e22f80b221338451a02d7c5/src/StingerSoft/TwigExtensions/DoctrineExtensions.php#L70-L75
197,578
Soneritics/Database
Soneritics/Database/DatabaseConnectionFactory.php
DatabaseConnectionFactory.create
public static function create($id, array $config) { static::$databaseConnections[$id] = static::createDatabaseConnection($config); if (static::$activeDatabaseConnection === null) { static::select($id); } }
php
public static function create($id, array $config) { static::$databaseConnections[$id] = static::createDatabaseConnection($config); if (static::$activeDatabaseConnection === null) { static::select($id); } }
[ "public", "static", "function", "create", "(", "$", "id", ",", "array", "$", "config", ")", "{", "static", "::", "$", "databaseConnections", "[", "$", "id", "]", "=", "static", "::", "createDatabaseConnection", "(", "$", "config", ")", ";", "if", "(", ...
Set a database connection. @param string $id @param array $config
[ "Set", "a", "database", "connection", "." ]
20cb74f2a2ee8d9161d3144b5c061a6da11cd066
https://github.com/Soneritics/Database/blob/20cb74f2a2ee8d9161d3144b5c061a6da11cd066/Soneritics/Database/DatabaseConnectionFactory.php#L53-L60
197,579
Soneritics/Database
Soneritics/Database/DatabaseConnectionFactory.php
DatabaseConnectionFactory.get
public static function get($id = null) { if ($id === null && static::$activeDatabaseConnection === null) { throw new MissingDatabaseConnectionException('No databases defined.'); } if ($id === null) { return static::$databaseConnections[static::$activeDatabaseConnecti...
php
public static function get($id = null) { if ($id === null && static::$activeDatabaseConnection === null) { throw new MissingDatabaseConnectionException('No databases defined.'); } if ($id === null) { return static::$databaseConnections[static::$activeDatabaseConnecti...
[ "public", "static", "function", "get", "(", "$", "id", "=", "null", ")", "{", "if", "(", "$", "id", "===", "null", "&&", "static", "::", "$", "activeDatabaseConnection", "===", "null", ")", "{", "throw", "new", "MissingDatabaseConnectionException", "(", "'...
Get a database connection. @param null $id @return IDatabaseConnection @throws MissingDatabaseConnectionException
[ "Get", "a", "database", "connection", "." ]
20cb74f2a2ee8d9161d3144b5c061a6da11cd066
https://github.com/Soneritics/Database/blob/20cb74f2a2ee8d9161d3144b5c061a6da11cd066/Soneritics/Database/DatabaseConnectionFactory.php#L68-L79
197,580
jenskooij/cloudcontrol
src/components/MultiComponent.php
MultiComponent.run
public function run(Storage $storage) { parent::run($storage); $components = $this->getParametersWithoutNamespace(); foreach ($components as $namespace => $component) { $this->loadComponent($namespace, $component); } }
php
public function run(Storage $storage) { parent::run($storage); $components = $this->getParametersWithoutNamespace(); foreach ($components as $namespace => $component) { $this->loadComponent($namespace, $component); } }
[ "public", "function", "run", "(", "Storage", "$", "storage", ")", "{", "parent", "::", "run", "(", "$", "storage", ")", ";", "$", "components", "=", "$", "this", "->", "getParametersWithoutNamespace", "(", ")", ";", "foreach", "(", "$", "components", "as...
Runs all components that are set @param Storage $storage
[ "Runs", "all", "components", "that", "are", "set" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/MultiComponent.php#L40-L49
197,581
jenskooij/cloudcontrol
src/components/MultiComponent.php
MultiComponent.loadComponent
private function loadComponent($namespace, $component) { $fullyQualifiedCloudControlComponent = '\\CloudControl\\Cms\\components\\' . $component; $fullyQualifiedComponent = '\\components\\' . $component; if (class_exists($fullyQualifiedCloudControlComponent, true)) { $this->runCo...
php
private function loadComponent($namespace, $component) { $fullyQualifiedCloudControlComponent = '\\CloudControl\\Cms\\components\\' . $component; $fullyQualifiedComponent = '\\components\\' . $component; if (class_exists($fullyQualifiedCloudControlComponent, true)) { $this->runCo...
[ "private", "function", "loadComponent", "(", "$", "namespace", ",", "$", "component", ")", "{", "$", "fullyQualifiedCloudControlComponent", "=", "'\\\\CloudControl\\\\Cms\\\\components\\\\'", ".", "$", "component", ";", "$", "fullyQualifiedComponent", "=", "'\\\\component...
Tries to determine component class name and wheter it exists @param $namespace String @param $component String
[ "Tries", "to", "determine", "component", "class", "name", "and", "wheter", "it", "exists" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/MultiComponent.php#L57-L66
197,582
jenskooij/cloudcontrol
src/components/MultiComponent.php
MultiComponent.runComponent
private function runComponent($namespace, $fullyQualifiedComponent) { $parameters = $this->getParametersForNameSpace($namespace); $parameters[self::PARAMETER_MULTI_COMPONENT] = $this; $component = new $fullyQualifiedComponent('', $this->request, $parameters, $this->matchedSitemapItem); ...
php
private function runComponent($namespace, $fullyQualifiedComponent) { $parameters = $this->getParametersForNameSpace($namespace); $parameters[self::PARAMETER_MULTI_COMPONENT] = $this; $component = new $fullyQualifiedComponent('', $this->request, $parameters, $this->matchedSitemapItem); ...
[ "private", "function", "runComponent", "(", "$", "namespace", ",", "$", "fullyQualifiedComponent", ")", "{", "$", "parameters", "=", "$", "this", "->", "getParametersForNameSpace", "(", "$", "namespace", ")", ";", "$", "parameters", "[", "self", "::", "PARAMET...
Instantiates the component and runs it @param $namespace String @param $fullyQualifiedComponent String
[ "Instantiates", "the", "component", "and", "runs", "it" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/MultiComponent.php#L74-L86
197,583
jenskooij/cloudcontrol
src/components/MultiComponent.php
MultiComponent.getParametersForNameSpace
private function getParametersForNameSpace($namespace) { $parameters = array(); foreach ($this->parameters as $key => $value) { if (0 === strpos($key, $namespace . ':')) { $parameters[substr($key, strlen($namespace) + 1)] = $value; } } return $...
php
private function getParametersForNameSpace($namespace) { $parameters = array(); foreach ($this->parameters as $key => $value) { if (0 === strpos($key, $namespace . ':')) { $parameters[substr($key, strlen($namespace) + 1)] = $value; } } return $...
[ "private", "function", "getParametersForNameSpace", "(", "$", "namespace", ")", "{", "$", "parameters", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "parameters", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "0", "===",...
Retrieves all parameters for the given namespace @param $namespace @return array
[ "Retrieves", "all", "parameters", "for", "the", "given", "namespace" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/MultiComponent.php#L94-L103
197,584
jenskooij/cloudcontrol
src/components/MultiComponent.php
MultiComponent.getParametersWithoutNamespace
private function getParametersWithoutNamespace() { $parameters = array(); foreach ($this->parameters as $key => $value) { if (strpos($key, ':') === false) { $parameters[$key] = $value; } } return $parameters; }
php
private function getParametersWithoutNamespace() { $parameters = array(); foreach ($this->parameters as $key => $value) { if (strpos($key, ':') === false) { $parameters[$key] = $value; } } return $parameters; }
[ "private", "function", "getParametersWithoutNamespace", "(", ")", "{", "$", "parameters", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "parameters", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "strpos", "(", "$", "key"...
Retrieves all parameters that have no namespace @return array
[ "Retrieves", "all", "parameters", "that", "have", "no", "namespace" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/MultiComponent.php#L110-L119
197,585
Mandarin-Medien/MMCmfRoutingBundle
Resolver/NodeResolver.php
NodeResolver.resolve
public function resolve(NodeRouteInterface $route) { foreach($this->classes as $class) { $qb = $this->manager->createQueryBuilder() ->select('n') ->from($class, 'n') ->join('n.routes', 'r') ->where('r.id = :route') ...
php
public function resolve(NodeRouteInterface $route) { foreach($this->classes as $class) { $qb = $this->manager->createQueryBuilder() ->select('n') ->from($class, 'n') ->join('n.routes', 'r') ->where('r.id = :route') ...
[ "public", "function", "resolve", "(", "NodeRouteInterface", "$", "route", ")", "{", "foreach", "(", "$", "this", "->", "classes", "as", "$", "class", ")", "{", "$", "qb", "=", "$", "this", "->", "manager", "->", "createQueryBuilder", "(", ")", "->", "s...
loads the Node by the given NodeRouteInterface @param NodeRouteInterface $route @return mixed|null
[ "loads", "the", "Node", "by", "the", "given", "NodeRouteInterface" ]
7db1b03f5e120bd473486c0be6ab76c6146cd2d0
https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Resolver/NodeResolver.php#L43-L60
197,586
Mandarin-Medien/MMCmfRoutingBundle
Resolver/NodeResolver.php
NodeResolver.getRoutableNodeClasses
protected function getRoutableNodeClasses() { $metadata = $this->manager->getClassMetadata(Node::class); $routables = array_values(array_filter($metadata->subClasses, function($subNode) { $reflection = new \ReflectionClass($subNode); return $reflection->implementsInterface(Ro...
php
protected function getRoutableNodeClasses() { $metadata = $this->manager->getClassMetadata(Node::class); $routables = array_values(array_filter($metadata->subClasses, function($subNode) { $reflection = new \ReflectionClass($subNode); return $reflection->implementsInterface(Ro...
[ "protected", "function", "getRoutableNodeClasses", "(", ")", "{", "$", "metadata", "=", "$", "this", "->", "manager", "->", "getClassMetadata", "(", "Node", "::", "class", ")", ";", "$", "routables", "=", "array_values", "(", "array_filter", "(", "$", "metad...
builds a list of all classes implementing RoutableNodeInterface @return array
[ "builds", "a", "list", "of", "all", "classes", "implementing", "RoutableNodeInterface" ]
7db1b03f5e120bd473486c0be6ab76c6146cd2d0
https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Resolver/NodeResolver.php#L67-L76
197,587
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DateFilterer.php
DateFilterer.format
protected function format() { if (($this->getParameter('value') == null || $this->getParameter('value') == "0")) return ''; elseif (($this->getParameter('value') != null) && $this->getParameter('value') instanceof Meta) { $dateTime = $this->getParameter('value'); ...
php
protected function format() { if (($this->getParameter('value') == null || $this->getParameter('value') == "0")) return ''; elseif (($this->getParameter('value') != null) && $this->getParameter('value') instanceof Meta) { $dateTime = $this->getParameter('value'); ...
[ "protected", "function", "format", "(", ")", "{", "if", "(", "(", "$", "this", "->", "getParameter", "(", "'value'", ")", "==", "null", "||", "$", "this", "->", "getParameter", "(", "'value'", ")", "==", "\"0\"", ")", ")", "return", "''", ";", "elsei...
Returns the date in a specified format Expected Params: value integer (optional) If specified, we'll use this as the date value. Can also be 'now' to use the current time nonbreaking string (optional) If 'true', then the resultant string will contain &nbsp;'s instead of spaces format string The format for...
[ "Returns", "the", "date", "in", "a", "specified", "format" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DateFilterer.php#L68-L105
197,588
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DateFilterer.php
DateFilterer.ago
protected function ago() { $threshold = $this->getParameter('threshold'); if (($this->getParameter('value') == null || $this->getParameter('value') == "0")) return ''; elseif (($this->getParameter('value') != null) && $this->getParameter('value') instanceof Meta) { $...
php
protected function ago() { $threshold = $this->getParameter('threshold'); if (($this->getParameter('value') == null || $this->getParameter('value') == "0")) return ''; elseif (($this->getParameter('value') != null) && $this->getParameter('value') instanceof Meta) { $...
[ "protected", "function", "ago", "(", ")", "{", "$", "threshold", "=", "$", "this", "->", "getParameter", "(", "'threshold'", ")", ";", "if", "(", "(", "$", "this", "->", "getParameter", "(", "'value'", ")", "==", "null", "||", "$", "this", "->", "get...
Displays a short text description of how long ago the specified timestamp was current. Expected Params: value LocalDate (optional) If specified and 'strdate' is null, use this as the timestamp strdate string (optional) A string to use to create the timestamp threshold integer (optional) If the value is olde...
[ "Displays", "a", "short", "text", "description", "of", "how", "long", "ago", "the", "specified", "timestamp", "was", "current", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DateFilterer.php#L118-L183
197,589
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DateFilterer.php
DateFilterer.heartbeatAgo
protected function heartbeatAgo() { if ($this->getParameter('value') != null) { $min = $this->getParameter('value'); if ($min < 60) return $min.' min ago'; elseif ($min < 1440) return floor($min / 60).' hrs '.($min % 60 > 0 ? floor($min % ...
php
protected function heartbeatAgo() { if ($this->getParameter('value') != null) { $min = $this->getParameter('value'); if ($min < 60) return $min.' min ago'; elseif ($min < 1440) return floor($min / 60).' hrs '.($min % 60 > 0 ? floor($min % ...
[ "protected", "function", "heartbeatAgo", "(", ")", "{", "if", "(", "$", "this", "->", "getParameter", "(", "'value'", ")", "!=", "null", ")", "{", "$", "min", "=", "$", "this", "->", "getParameter", "(", "'value'", ")", ";", "if", "(", "$", "min", ...
Displays the specified minutes in a logical format Example: for 'value' = 1586 => '1 days 2 hours ago' Expected Params: value string The number of minutes ago @return string
[ "Displays", "the", "specified", "minutes", "in", "a", "logical", "format" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DateFilterer.php#L196-L208
197,590
fridge-project/dbal
src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php
NamedQueryRewriter.determinePlaceholderPositions
private static function determinePlaceholderPositions($query, $placeholder) { // Placeholder positions. $placeholderPositions = array(); // TRUE if we are in an escaped section else FALSE. $escaped = false; // The placeholder length. $placeholderLength = strlen($pla...
php
private static function determinePlaceholderPositions($query, $placeholder) { // Placeholder positions. $placeholderPositions = array(); // TRUE if we are in an escaped section else FALSE. $escaped = false; // The placeholder length. $placeholderLength = strlen($pla...
[ "private", "static", "function", "determinePlaceholderPositions", "(", "$", "query", ",", "$", "placeholder", ")", "{", "// Placeholder positions.", "$", "placeholderPositions", "=", "array", "(", ")", ";", "// TRUE if we are in an escaped section else FALSE.", "$", "esca...
Determines the placeholder positions in the query. Example: - parameters: - query: SELECT * FROM foo WHERE foo IN (:foo) AND bar IN (:foo) ^ (32) ^ (50) - placeholder: :foo - result: - placeholderPositions: array(32, 50) @param string $query The query. @param string $placeholder The placeholder. @th...
[ "Determines", "the", "placeholder", "positions", "in", "the", "query", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php#L108-L143
197,591
fridge-project/dbal
src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php
NamedQueryRewriter.generateNewPlaceholders
private static function generateNewPlaceholders($placeholder, $count) { $newPlaceholders = array(); for ($index = 1; $index <= $count; $index++) { $newPlaceholders[] = $placeholder.$index; } return $newPlaceholders; }
php
private static function generateNewPlaceholders($placeholder, $count) { $newPlaceholders = array(); for ($index = 1; $index <= $count; $index++) { $newPlaceholders[] = $placeholder.$index; } return $newPlaceholders; }
[ "private", "static", "function", "generateNewPlaceholders", "(", "$", "placeholder", ",", "$", "count", ")", "{", "$", "newPlaceholders", "=", "array", "(", ")", ";", "for", "(", "$", "index", "=", "1", ";", "$", "index", "<=", "$", "count", ";", "$", ...
Generates the new placeholders according to the placeholder and the number of parameter. Example: - parameters: - placeholder: :foo - count: 3 - result: - newPlaceholders: array(':foo1', ':foo2', ':foo3') @param string $placeholder The placeholder. @param integer $count The number of parameter. @return array ...
[ "Generates", "the", "new", "placeholders", "according", "to", "the", "placeholder", "and", "the", "number", "of", "parameter", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php#L160-L169
197,592
fridge-project/dbal
src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php
NamedQueryRewriter.rewriteQuery
private static function rewriteQuery( $query, array $placeholderPositions, $placeholderLength, array $newPlaceholders ) { // The position gap produced by the rewrite. $positionGap = 0; // Generates new placeholders and his length. $placeholders = impl...
php
private static function rewriteQuery( $query, array $placeholderPositions, $placeholderLength, array $newPlaceholders ) { // The position gap produced by the rewrite. $positionGap = 0; // Generates new placeholders and his length. $placeholders = impl...
[ "private", "static", "function", "rewriteQuery", "(", "$", "query", ",", "array", "$", "placeholderPositions", ",", "$", "placeholderLength", ",", "array", "$", "newPlaceholders", ")", "{", "// The position gap produced by the rewrite.", "$", "positionGap", "=", "0", ...
Rewrites the named query according to the placeholder length and positions and the new placeholders. Example: - parameters: - query; SELECT * FROM foo WHERE foo IN (:foo) AND bar IN (:foo) - placeholderPositions: array(32, 50) - placeholderLength: 4 - newPlaceholders: array(':foo1', ':foo2', ':foo3') - result: - rewri...
[ "Rewrites", "the", "named", "query", "according", "to", "the", "placeholder", "length", "and", "positions", "and", "the", "new", "placeholders", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php#L190-L216
197,593
fridge-project/dbal
src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php
NamedQueryRewriter.rewriteParameterAndType
private static function rewriteParameterAndType( array $parameters, array $types, $parameter, array $newPlaceholders ) { // Extract the fridge type. $type = static::extractType($types[$parameter]); // Iterate new placeholders to rewrite each one. fore...
php
private static function rewriteParameterAndType( array $parameters, array $types, $parameter, array $newPlaceholders ) { // Extract the fridge type. $type = static::extractType($types[$parameter]); // Iterate new placeholders to rewrite each one. fore...
[ "private", "static", "function", "rewriteParameterAndType", "(", "array", "$", "parameters", ",", "array", "$", "types", ",", "$", "parameter", ",", "array", "$", "newPlaceholders", ")", "{", "// Extract the fridge type.", "$", "type", "=", "static", "::", "extr...
Rewrites the query parameter & type by expanding them according to the parameter and the new placeholders. Example: - parameters: - parameters: array('foo' => array(1, 3, 5)) - types: array('foo' => 'integer[]') - parameter: foo - newPlaceholders: array(':foo1', ':foo2', ':foo3') - result: - rewrittenParameters: array...
[ "Rewrites", "the", "query", "parameter", "&", "type", "by", "expanding", "them", "according", "to", "the", "parameter", "and", "the", "new", "placeholders", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Query/Rewriter/NamedQueryRewriter.php#L238-L263
197,594
nice-php/benchmark
src/ResultPrinter/MarkdownPrinter.php
MarkdownPrinter.printBenchmarkIntro
public function printBenchmarkIntro(Benchmark $benchmark) { printf("## %s\n", $benchmark->getName()); if ($description = $benchmark->getDescription()) { printf("%s\n", $description); } print("\n"); printf( "This benchmark consists of %s tests. Each tes...
php
public function printBenchmarkIntro(Benchmark $benchmark) { printf("## %s\n", $benchmark->getName()); if ($description = $benchmark->getDescription()) { printf("%s\n", $description); } print("\n"); printf( "This benchmark consists of %s tests. Each tes...
[ "public", "function", "printBenchmarkIntro", "(", "Benchmark", "$", "benchmark", ")", "{", "printf", "(", "\"## %s\\n\"", ",", "$", "benchmark", "->", "getName", "(", ")", ")", ";", "if", "(", "$", "description", "=", "$", "benchmark", "->", "getDescription"...
Outputs an introduction prior to test execution @param Benchmark $benchmark
[ "Outputs", "an", "introduction", "prior", "to", "test", "execution" ]
2084c77dbb88cd76006abbfe85b2b704f6bbd1cf
https://github.com/nice-php/benchmark/blob/2084c77dbb88cd76006abbfe85b2b704f6bbd1cf/src/ResultPrinter/MarkdownPrinter.php#L28-L41
197,595
spiffyjr/spiffy-package
src/PackageManager.php
PackageManager.writeCache
public function writeCache() { $cacheFile = $this->getCacheFile(); if (!$cacheFile) { return; } if (is_writeable(dirname($cacheFile))) { file_put_contents( $cacheFile, sprintf( '<?php return %s;', ...
php
public function writeCache() { $cacheFile = $this->getCacheFile(); if (!$cacheFile) { return; } if (is_writeable(dirname($cacheFile))) { file_put_contents( $cacheFile, sprintf( '<?php return %s;', ...
[ "public", "function", "writeCache", "(", ")", "{", "$", "cacheFile", "=", "$", "this", "->", "getCacheFile", "(", ")", ";", "if", "(", "!", "$", "cacheFile", ")", "{", "return", ";", "}", "if", "(", "is_writeable", "(", "dirname", "(", "$", "cacheFil...
Writes config to filesystem.
[ "Writes", "config", "to", "filesystem", "." ]
42ca8a687efb2d06ecb3d4e0c09456d938a2bc09
https://github.com/spiffyjr/spiffy-package/blob/42ca8a687efb2d06ecb3d4e0c09456d938a2bc09/src/PackageManager.php#L183-L199
197,596
TiMESPLiNTER/tsFramework
src/ch/timesplinter/controller/StaticPageController.php
StaticPageController.getPage
public function getPage() { $pageData = $this->core->getSettings()->pagedata; $routeID = $this->route->id; $this->logger->info('Requested route: ' . $routeID); $this->logger->debug('Route info', array($this->route)); if(isset($pageData->$routeID->active)) $this->view->addActiveHtmlId($pageData->$routeID...
php
public function getPage() { $pageData = $this->core->getSettings()->pagedata; $routeID = $this->route->id; $this->logger->info('Requested route: ' . $routeID); $this->logger->debug('Route info', array($this->route)); if(isset($pageData->$routeID->active)) $this->view->addActiveHtmlId($pageData->$routeID...
[ "public", "function", "getPage", "(", ")", "{", "$", "pageData", "=", "$", "this", "->", "core", "->", "getSettings", "(", ")", "->", "pagedata", ";", "$", "routeID", "=", "$", "this", "->", "route", "->", "id", ";", "$", "this", "->", "logger", "-...
Displays a template based page by rendering a template file which is generated by route name plus .html ending @throws \UnexpectedValueException @return \HttpResponse The response object with content, headers, HTTP status code, etc.
[ "Displays", "a", "template", "based", "page", "by", "rendering", "a", "template", "file", "which", "is", "generated", "by", "route", "name", "plus", ".", "html", "ending" ]
b3b9fd98f6d456a9e571015877ecca203786fd0c
https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/controller/StaticPageController.php#L49-L69
197,597
ZendExperts/phpids
lib/IDS/Log/File.php
IDS_Log_File.execute
public function execute(IDS_Report $data) { /* * In case the data has been modified before it might be necessary * to convert it to string since we can't store array or object * into a file */ $data = $this->prepareData($data); if (is_string($data)) ...
php
public function execute(IDS_Report $data) { /* * In case the data has been modified before it might be necessary * to convert it to string since we can't store array or object * into a file */ $data = $this->prepareData($data); if (is_string($data)) ...
[ "public", "function", "execute", "(", "IDS_Report", "$", "data", ")", "{", "/*\n * In case the data has been modified before it might be necessary \n * to convert it to string since we can't store array or object \n * into a file\n */", "$", "data", "=", "$...
Stores given data into a file @param object $data IDS_Report @throws Exception if the logfile isn't writeable @return boolean
[ "Stores", "given", "data", "into", "a", "file" ]
f30df04eea47b94d056e2ae9ec8fea1c626f1c03
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Log/File.php#L177-L220
197,598
modulusphp/utility
View.php
View.isCalledByWhoops
public static function isCalledByWhoops() : bool { /** * Get trace */ $trace = debug_backtrace(); $trace = end($trace); return isset($trace['class']) && $trace['class'] == 'Whoops\Run'; }
php
public static function isCalledByWhoops() : bool { /** * Get trace */ $trace = debug_backtrace(); $trace = end($trace); return isset($trace['class']) && $trace['class'] == 'Whoops\Run'; }
[ "public", "static", "function", "isCalledByWhoops", "(", ")", ":", "bool", "{", "/**\n * Get trace\n */", "$", "trace", "=", "debug_backtrace", "(", ")", ";", "$", "trace", "=", "end", "(", "$", "trace", ")", ";", "return", "isset", "(", "$", "trac...
Check if this is an exception @return bool
[ "Check", "if", "this", "is", "an", "exception" ]
c1e127539b13d3ec8381e41c64b881e0701807f5
https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/View.php#L46-L56
197,599
Hnto/nuki
src/Skeletons/Processes/Event.php
Event.notify
public function notify() { foreach($this->watchers as $watcher) { if ($this->stopNotify === true) { break; } $watcher->update($this); } }
php
public function notify() { foreach($this->watchers as $watcher) { if ($this->stopNotify === true) { break; } $watcher->update($this); } }
[ "public", "function", "notify", "(", ")", "{", "foreach", "(", "$", "this", "->", "watchers", "as", "$", "watcher", ")", "{", "if", "(", "$", "this", "->", "stopNotify", "===", "true", ")", "{", "break", ";", "}", "$", "watcher", "->", "update", "(...
Notify all available watchers
[ "Notify", "all", "available", "watchers" ]
c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c
https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Skeletons/Processes/Event.php#L102-L110