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
partition
stringclasses
1 value
MichaelJ2324/PHP-REST-Client
src/Endpoint/Abstracts/AbstractEndpoint.php
AbstractEndpoint.configureRequest
protected function configureRequest(RequestInterface $Request) { if ($Request->getStatus() >= Curl::STATUS_SENT){ $Request->reset(); } if (isset($this->properties[self::PROPERTY_HTTP_METHOD]) && $this->properties[self::PROPERTY_HTTP_METHOD] !== ''){ $Reque...
php
protected function configureRequest(RequestInterface $Request) { if ($Request->getStatus() >= Curl::STATUS_SENT){ $Request->reset(); } if (isset($this->properties[self::PROPERTY_HTTP_METHOD]) && $this->properties[self::PROPERTY_HTTP_METHOD] !== ''){ $Reque...
[ "protected", "function", "configureRequest", "(", "RequestInterface", "$", "Request", ")", "{", "if", "(", "$", "Request", "->", "getStatus", "(", ")", ">=", "Curl", "::", "STATUS_SENT", ")", "{", "$", "Request", "->", "reset", "(", ")", ";", "}", "if", ...
Verifies URL and Data are setup, then sets them on the Request Object @param RequestInterface $Request @return RequestInterface
[ "Verifies", "URL", "and", "Data", "are", "setup", "then", "sets", "them", "on", "the", "Request", "Object" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L285-L308
train
MichaelJ2324/PHP-REST-Client
src/Endpoint/Abstracts/AbstractEndpoint.php
AbstractEndpoint.configureResponse
protected function configureResponse(ResponseInterface $Response){ $Response->setRequest($this->Request); $Response->extract(); return $Response; }
php
protected function configureResponse(ResponseInterface $Response){ $Response->setRequest($this->Request); $Response->extract(); return $Response; }
[ "protected", "function", "configureResponse", "(", "ResponseInterface", "$", "Response", ")", "{", "$", "Response", "->", "setRequest", "(", "$", "this", "->", "Request", ")", ";", "$", "Response", "->", "extract", "(", ")", ";", "return", "$", "Response", ...
Configure the Response Object after sending of the Request @param ResponseInterface $Response @return ResponseInterface
[ "Configure", "the", "Response", "Object", "after", "sending", "of", "the", "Request" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L315-L319
train
MichaelJ2324/PHP-REST-Client
src/Endpoint/Abstracts/AbstractEndpoint.php
AbstractEndpoint.verifyUrl
private function verifyUrl($url) { if (strpos($url, static::$_URL_VAR_CHARACTER) !== false) { throw new InvalidUrl(array(get_class($this), $url)); } return true; }
php
private function verifyUrl($url) { if (strpos($url, static::$_URL_VAR_CHARACTER) !== false) { throw new InvalidUrl(array(get_class($this), $url)); } return true; }
[ "private", "function", "verifyUrl", "(", "$", "url", ")", "{", "if", "(", "strpos", "(", "$", "url", ",", "static", "::", "$", "_URL_VAR_CHARACTER", ")", "!==", "false", ")", "{", "throw", "new", "InvalidUrl", "(", "array", "(", "get_class", "(", "$", ...
Verify if URL is configured properly @param string $url @return bool @throws InvalidUrl
[ "Verify", "if", "URL", "is", "configured", "properly" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L389-L395
train
MichaelJ2324/PHP-REST-Client
src/Endpoint/Abstracts/AbstractEndpoint.php
AbstractEndpoint.requiresOptions
protected function requiresOptions() { $url = $this->getEndPointUrl(); $variables = $this->extractUrlVariables($url); return !empty($variables); }
php
protected function requiresOptions() { $url = $this->getEndPointUrl(); $variables = $this->extractUrlVariables($url); return !empty($variables); }
[ "protected", "function", "requiresOptions", "(", ")", "{", "$", "url", "=", "$", "this", "->", "getEndPointUrl", "(", ")", ";", "$", "variables", "=", "$", "this", "->", "extractUrlVariables", "(", "$", "url", ")", ";", "return", "!", "empty", "(", "$"...
Checks if Endpoint URL requires Options @return bool|array
[ "Checks", "if", "Endpoint", "URL", "requires", "Options" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L402-L407
train
MichaelJ2324/PHP-REST-Client
src/Endpoint/Abstracts/AbstractEndpoint.php
AbstractEndpoint.extractUrlVariables
protected function extractUrlVariables($url){ $variables = array(); $pattern = "/(\\".static::$_URL_VAR_CHARACTER.".*?[^\\/]*)/"; if (preg_match($pattern,$url,$matches)){ array_shift($matches); foreach($matches as $match){ $variables[] = $match[0]; ...
php
protected function extractUrlVariables($url){ $variables = array(); $pattern = "/(\\".static::$_URL_VAR_CHARACTER.".*?[^\\/]*)/"; if (preg_match($pattern,$url,$matches)){ array_shift($matches); foreach($matches as $match){ $variables[] = $match[0]; ...
[ "protected", "function", "extractUrlVariables", "(", "$", "url", ")", "{", "$", "variables", "=", "array", "(", ")", ";", "$", "pattern", "=", "\"/(\\\\\"", ".", "static", "::", "$", "_URL_VAR_CHARACTER", ".", "\".*?[^\\\\/]*)/\"", ";", "if", "(", "preg_matc...
Helper method for extracting variables via Regex from a passed in URL @param $url @return array
[ "Helper", "method", "for", "extracting", "variables", "via", "Regex", "from", "a", "passed", "in", "URL" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Abstracts/AbstractEndpoint.php#L414-L424
train
Innmind/Math
src/Matrix/Vector.php
Vector.lead
public function lead(): Number { return $this->reduce( new Integer(0), static function(Number $lead, Number $number): Number { if (!$lead->equals(new Integer(0))) { return $lead; } return $number; } ...
php
public function lead(): Number { return $this->reduce( new Integer(0), static function(Number $lead, Number $number): Number { if (!$lead->equals(new Integer(0))) { return $lead; } return $number; } ...
[ "public", "function", "lead", "(", ")", ":", "Number", "{", "return", "$", "this", "->", "reduce", "(", "new", "Integer", "(", "0", ")", ",", "static", "function", "(", "Number", "$", "lead", ",", "Number", "$", "number", ")", ":", "Number", "{", "...
First non zero number found
[ "First", "non", "zero", "number", "found" ]
ac9ad4dd1852c145e90f5edc0f38a873b125a50b
https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Matrix/Vector.php#L212-L224
train
bseddon/XPath20
XPath2Parser.php
XPath2Parser.log
public function log( $message ) { if ( ! $this->enableLogging ) return; if ( ! isset( $this->log ) ) $this->log = \lyquidity\XPath2\lyquidity\Log::getInstance(); $this->log->info( $message ); }
php
public function log( $message ) { if ( ! $this->enableLogging ) return; if ( ! isset( $this->log ) ) $this->log = \lyquidity\XPath2\lyquidity\Log::getInstance(); $this->log->info( $message ); }
[ "public", "function", "log", "(", "$", "message", ")", "{", "if", "(", "!", "$", "this", "->", "enableLogging", ")", "return", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "log", ")", ")", "$", "this", "->", "log", "=", "\\", "lyquidity"...
Log a message to the current log target @param string $message
[ "Log", "a", "message", "to", "the", "current", "log", "target" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/XPath2Parser.php#L188-L193
train
bseddon/XPath20
XPath2Parser.php
XPath2Parser.yyExpecting
protected function yyExpecting ( $state ) { $token = 0; $n = 0; $len = 0; $ok = array_fill( 0, count( XPath2Parser::$yyName ), false ); if ( ( $n = XPath2Parser::$yySindex[ $state ] ) != 0 ) { for ( $token = $n < 0 ? -$n : 0; ( $token < count( XPath2Parser::$yyName ) && ( $n + $token < count( ...
php
protected function yyExpecting ( $state ) { $token = 0; $n = 0; $len = 0; $ok = array_fill( 0, count( XPath2Parser::$yyName ), false ); if ( ( $n = XPath2Parser::$yySindex[ $state ] ) != 0 ) { for ( $token = $n < 0 ? -$n : 0; ( $token < count( XPath2Parser::$yyName ) && ( $n + $token < count( ...
[ "protected", "function", "yyExpecting", "(", "$", "state", ")", "{", "$", "token", "=", "0", ";", "$", "n", "=", "0", ";", "$", "len", "=", "0", ";", "$", "ok", "=", "array_fill", "(", "0", ",", "count", "(", "XPath2Parser", "::", "$", "yyName", ...
computes list of expected tokens on error by tracing the tables. @param int $state for which to compute the list. @return array list of token names.
[ "computes", "list", "of", "expected", "tokens", "on", "error", "by", "tracing", "the", "tables", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/XPath2Parser.php#L491-L529
train
itkg/core
src/Itkg/Core/Cache/Adapter/FileSystem.php
FileSystem.get
public function get(CacheableInterface $item) { $targetFile = $this->getTargetFile($item->getHashKey()); $return = false; if (file_exists($targetFile)) { if ($item->getTtl() > 0 && ((filemtime($targetFile) + $item->getTtl()) < time())) { $this->remove($item); ...
php
public function get(CacheableInterface $item) { $targetFile = $this->getTargetFile($item->getHashKey()); $return = false; if (file_exists($targetFile)) { if ($item->getTtl() > 0 && ((filemtime($targetFile) + $item->getTtl()) < time())) { $this->remove($item); ...
[ "public", "function", "get", "(", "CacheableInterface", "$", "item", ")", "{", "$", "targetFile", "=", "$", "this", "->", "getTargetFile", "(", "$", "item", "->", "getHashKey", "(", ")", ")", ";", "$", "return", "=", "false", ";", "if", "(", "file_exis...
Get value from cache Must return false when cache is expired or invalid @param \Itkg\Core\CacheableInterface $item @return mixed
[ "Get", "value", "from", "cache", "Must", "return", "false", "when", "cache", "is", "expired", "or", "invalid" ]
e5e4efb05feb4d23b0df41f2b21fd095103e593b
https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Cache/Adapter/FileSystem.php#L106-L120
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.init
public function init( $config = NULL ) { parent::init( $config ); if ( !isset( $config[ 'migration_path' ] ) ) { throw new \InvalidArgumentException( 'Missing migration_path parameter' ); } foreach ( $config as $key => $value ) { ...
php
public function init( $config = NULL ) { parent::init( $config ); if ( !isset( $config[ 'migration_path' ] ) ) { throw new \InvalidArgumentException( 'Missing migration_path parameter' ); } foreach ( $config as $key => $value ) { ...
[ "public", "function", "init", "(", "$", "config", "=", "NULL", ")", "{", "parent", "::", "init", "(", "$", "config", ")", ";", "if", "(", "!", "isset", "(", "$", "config", "[", "'migration_path'", "]", ")", ")", "{", "throw", "new", "\\", "InvalidA...
Initialises the migrator. @param array $config configuration array @action ON_INIT_ACTION @throws \InvalidArgumentException if a configuration is missing
[ "Initialises", "the", "migrator", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L95-L155
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.createMigration
public function createMigration( ) { $date = new \DateTime(); $tStamp = substr( $date->format( 'U' ), 2 ); if ( self::STYLE_CAMEL_CASE !== $this->migrationClassStyle ) { $parts = preg_split('/(?=[A-Z])/', $this->migrationClass, -1, PREG_SPLIT_NO_EMPTY); ...
php
public function createMigration( ) { $date = new \DateTime(); $tStamp = substr( $date->format( 'U' ), 2 ); if ( self::STYLE_CAMEL_CASE !== $this->migrationClassStyle ) { $parts = preg_split('/(?=[A-Z])/', $this->migrationClass, -1, PREG_SPLIT_NO_EMPTY); ...
[ "public", "function", "createMigration", "(", ")", "{", "$", "date", "=", "new", "\\", "DateTime", "(", ")", ";", "$", "tStamp", "=", "substr", "(", "$", "date", "->", "format", "(", "'U'", ")", ",", "2", ")", ";", "if", "(", "self", "::", "STYLE...
Creates a new migration class file. @filter ON_CREATE_MIGRATION_FILTER @action ON_CREATE_MIGRATION_ACTION @return bool TRUE on success, FALSE on failure @throws MigrationException if configuration is missing
[ "Creates", "a", "new", "migration", "class", "file", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L168-L203
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.getMigrationTemplate
public function getMigrationTemplate( $name ) { $template = '<?php' . PHP_EOL . PHP_EOL; if ( '' !== $this->migrationNamespace ) { $template .= 'namespace ' . $this->migrationNamespace . ';' . PHP_EOL . PHP_EOL; } $template .= 'use RawPHP\RawMigr...
php
public function getMigrationTemplate( $name ) { $template = '<?php' . PHP_EOL . PHP_EOL; if ( '' !== $this->migrationNamespace ) { $template .= 'namespace ' . $this->migrationNamespace . ';' . PHP_EOL . PHP_EOL; } $template .= 'use RawPHP\RawMigr...
[ "public", "function", "getMigrationTemplate", "(", "$", "name", ")", "{", "$", "template", "=", "'<?php'", ".", "PHP_EOL", ".", "PHP_EOL", ";", "if", "(", "''", "!==", "$", "this", "->", "migrationNamespace", ")", "{", "$", "template", ".=", "'namespace '"...
Creates the migration template file code. @param string $name new migration class name @filter ON_GET_MIGRATION_TEMPLATE_FILTER @return string class template
[ "Creates", "the", "migration", "template", "file", "code", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L214-L275
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.createMigrationTable
public function createMigrationTable( ) { if ( empty( $this->migrationTable ) ) { throw new RawException( 'Migration table name must be set' ); } $result = NULL; $table = array( 'migration_id' => 'INTEGER(11) PRIMARY KEY AUT...
php
public function createMigrationTable( ) { if ( empty( $this->migrationTable ) ) { throw new RawException( 'Migration table name must be set' ); } $result = NULL; $table = array( 'migration_id' => 'INTEGER(11) PRIMARY KEY AUT...
[ "public", "function", "createMigrationTable", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "migrationTable", ")", ")", "{", "throw", "new", "RawException", "(", "'Migration table name must be set'", ")", ";", "}", "$", "result", "=", "NULL", ";...
Creates the migration database table if it doesn't exist. @action ON_CREATE_MIGRATION_TABLE_ACTION @return bool TRUE on success, FALSE on failure @throws RawException if migration table is not set
[ "Creates", "the", "migration", "database", "table", "if", "it", "doesn", "t", "exist", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L286-L309
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.getMigrations
public function getMigrations( ) { $migrations = array(); $dir = opendir( $this->migrationPath ); while ( ( $file = readdir( $dir ) ) !== FALSE ) { if ( '.' !== $file && '..' !== $file ) { $migrations[] = str_replace( '.php', ...
php
public function getMigrations( ) { $migrations = array(); $dir = opendir( $this->migrationPath ); while ( ( $file = readdir( $dir ) ) !== FALSE ) { if ( '.' !== $file && '..' !== $file ) { $migrations[] = str_replace( '.php', ...
[ "public", "function", "getMigrations", "(", ")", "{", "$", "migrations", "=", "array", "(", ")", ";", "$", "dir", "=", "opendir", "(", "$", "this", "->", "migrationPath", ")", ";", "while", "(", "(", "$", "file", "=", "readdir", "(", "$", "dir", ")...
Returns a list of migration files. @filter ON_GET_MIGRATIONS_FILTER @return array list of available migrations
[ "Returns", "a", "list", "of", "migration", "files", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L318-L337
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.getNewMigrations
public function getNewMigrations( ) { // check if migration table exists $exists = $this->db->tableExists( $this->migrationTable ); if ( !$exists ) { $this->createMigrationTable( ); } $query = "SELECT * FROM $this->migrationTable"; ...
php
public function getNewMigrations( ) { // check if migration table exists $exists = $this->db->tableExists( $this->migrationTable ); if ( !$exists ) { $this->createMigrationTable( ); } $query = "SELECT * FROM $this->migrationTable"; ...
[ "public", "function", "getNewMigrations", "(", ")", "{", "// check if migration table exists", "$", "exists", "=", "$", "this", "->", "db", "->", "tableExists", "(", "$", "this", "->", "migrationTable", ")", ";", "if", "(", "!", "$", "exists", ")", "{", "$...
Returns a list of new migrations. @filter ON_GET_NEW_MIGRATIONS_FILTER @return array list of migrations
[ "Returns", "a", "list", "of", "new", "migrations", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L346-L397
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.getAppliedMigrations
public function getAppliedMigrations( ) { $query = "SELECT * FROM $this->migrationTable"; $applied = $this->db->query( $query ); $list = array(); foreach( $applied as $mig ) { $list[] = $mig[ 'migration_name' ]; } ...
php
public function getAppliedMigrations( ) { $query = "SELECT * FROM $this->migrationTable"; $applied = $this->db->query( $query ); $list = array(); foreach( $applied as $mig ) { $list[] = $mig[ 'migration_name' ]; } ...
[ "public", "function", "getAppliedMigrations", "(", ")", "{", "$", "query", "=", "\"SELECT * FROM $this->migrationTable\"", ";", "$", "applied", "=", "$", "this", "->", "db", "->", "query", "(", "$", "query", ")", ";", "$", "list", "=", "array", "(", ")", ...
Returns a list of applied migrations. @filter ON_GET_APPLIED_MIGRATIONS_FILTER @return array list of applied migrations
[ "Returns", "a", "list", "of", "applied", "migrations", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L406-L422
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.migrateUp
public function migrateUp( $levels = NULL ) { if ( NULL !== $levels ) { $this->levels = $levels; } $newMigrations = $this->getNewMigrations( ); $i = 0; if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $newMigrat...
php
public function migrateUp( $levels = NULL ) { if ( NULL !== $levels ) { $this->levels = $levels; } $newMigrations = $this->getNewMigrations( ); $i = 0; if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $newMigrat...
[ "public", "function", "migrateUp", "(", "$", "levels", "=", "NULL", ")", "{", "if", "(", "NULL", "!==", "$", "levels", ")", "{", "$", "this", "->", "levels", "=", "$", "levels", ";", "}", "$", "newMigrations", "=", "$", "this", "->", "getNewMigration...
Runs the UP migration. @param mixed $levels optional migration levels size @action ON_MIGRATE_UP_ACTION @throws MigrationException on failed transaction
[ "Runs", "the", "UP", "migration", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L433-L530
train
rawphp/RawMigrator
lib/Migrator.php
Migrator.migrateDown
public function migrateDown( $levels = NULL ) { if ( NULL !== $levels ) { $this->levels = $levels; } $migrations = $this->getAppliedMigrations( ); $i = 0; if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $migrat...
php
public function migrateDown( $levels = NULL ) { if ( NULL !== $levels ) { $this->levels = $levels; } $migrations = $this->getAppliedMigrations( ); $i = 0; if ( self::MIGRATE_ALL === $this->levels || $this->levels > count( $migrat...
[ "public", "function", "migrateDown", "(", "$", "levels", "=", "NULL", ")", "{", "if", "(", "NULL", "!==", "$", "levels", ")", "{", "$", "this", "->", "levels", "=", "$", "levels", ";", "}", "$", "migrations", "=", "$", "this", "->", "getAppliedMigrat...
Runs the DOWN migration. @param mixed $levels optional migration levels size @action ON_MIGRATE_DOWN_ACTION @throws MigrationException on failed transaction
[ "Runs", "the", "DOWN", "migration", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L541-L624
train
rawphp/RawMigrator
lib/Migrator.php
Migrator._addMigrationRecord
private function _addMigrationRecord( $class ) { $name = $this->db->prepareString( $class ); $tm = new \DateTime(); $tm = $tm->getTimestamp(); // update migrations table with the new applied migration $query = "INSERT INTO $this->migrationTable ...
php
private function _addMigrationRecord( $class ) { $name = $this->db->prepareString( $class ); $tm = new \DateTime(); $tm = $tm->getTimestamp(); // update migrations table with the new applied migration $query = "INSERT INTO $this->migrationTable ...
[ "private", "function", "_addMigrationRecord", "(", "$", "class", ")", "{", "$", "name", "=", "$", "this", "->", "db", "->", "prepareString", "(", "$", "class", ")", ";", "$", "tm", "=", "new", "\\", "DateTime", "(", ")", ";", "$", "tm", "=", "$", ...
Inserts an applied migration into the database. @param string $class migration name @return bool TRUE on success, FALSE on failure
[ "Inserts", "an", "applied", "migration", "into", "the", "database", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L633-L660
train
rawphp/RawMigrator
lib/Migrator.php
Migrator._deleteMigrationRecord
private function _deleteMigrationRecord( $class ) { $name = $this->db->prepareString( $class ); $query = "DELETE FROM $this->migrationTable WHERE migration_name = '$name'"; $this->db->lockTables( $this->migrationTable ); $result = $this->db->execute( $query...
php
private function _deleteMigrationRecord( $class ) { $name = $this->db->prepareString( $class ); $query = "DELETE FROM $this->migrationTable WHERE migration_name = '$name'"; $this->db->lockTables( $this->migrationTable ); $result = $this->db->execute( $query...
[ "private", "function", "_deleteMigrationRecord", "(", "$", "class", ")", "{", "$", "name", "=", "$", "this", "->", "db", "->", "prepareString", "(", "$", "class", ")", ";", "$", "query", "=", "\"DELETE FROM $this->migrationTable WHERE migration_name = '$name'\"", ...
Deletes a migration entry from the database. @param string $class migration name @return bool TRUE on success, FALSE on failure
[ "Deletes", "a", "migration", "entry", "from", "the", "database", "." ]
bbf5e354d7ff532552fd6865b38e4c1a3b6f3757
https://github.com/rawphp/RawMigrator/blob/bbf5e354d7ff532552fd6865b38e4c1a3b6f3757/lib/Migrator.php#L669-L687
train
CascadeEnergy/distributed-locking
src/DistributedLocking/LockSet/DefaultLockSet.php
DefaultLockSet.lock
public function lock($lockName) { $lockHandle = $this->lockProvider->lock($lockName); if ($lockHandle === false) { return false; } $this->lockList[$lockName] = $lockHandle; return true; }
php
public function lock($lockName) { $lockHandle = $this->lockProvider->lock($lockName); if ($lockHandle === false) { return false; } $this->lockList[$lockName] = $lockHandle; return true; }
[ "public", "function", "lock", "(", "$", "lockName", ")", "{", "$", "lockHandle", "=", "$", "this", "->", "lockProvider", "->", "lock", "(", "$", "lockName", ")", ";", "if", "(", "$", "lockHandle", "===", "false", ")", "{", "return", "false", ";", "}"...
Attempts to acquire a single lock by name, and adds it to the lock set. @param string $lockName The name of the lock to acquire @return bool True if the lock was acquired, false otherwise
[ "Attempts", "to", "acquire", "a", "single", "lock", "by", "name", "and", "adds", "it", "to", "the", "lock", "set", "." ]
866e5aa41398ec33f7113b42663437005caf498a
https://github.com/CascadeEnergy/distributed-locking/blob/866e5aa41398ec33f7113b42663437005caf498a/src/DistributedLocking/LockSet/DefaultLockSet.php#L42-L52
train
Xsaven/laravel-intelect-admin
src/Addons/JWTAuth/Payload.php
Payload.toArray
public function toArray() { $results = []; foreach ($this->claims as $claim) { $results[$claim->getName()] = $claim->getValue(); } return $results; }
php
public function toArray() { $results = []; foreach ($this->claims as $claim) { $results[$claim->getName()] = $claim->getValue(); } return $results; }
[ "public", "function", "toArray", "(", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "claims", "as", "$", "claim", ")", "{", "$", "results", "[", "$", "claim", "->", "getName", "(", ")", "]", "=", "$", "claim", ...
Get the array of claims. @return array
[ "Get", "the", "array", "of", "claims", "." ]
592574633d12c74cf25b43dd6694fee496abefcb
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Payload.php#L47-L55
train
melisplatform/melis-calendar
src/Service/MelisCalendarService.php
MelisCalendarService.addCalendarEvent
public function addCalendarEvent($postValues){ $responseData = array(); $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth'); $userAuthDatas = $melisCoreAuth->getStorage()->read(); $userId = ...
php
public function addCalendarEvent($postValues){ $responseData = array(); $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth'); $userAuthDatas = $melisCoreAuth->getStorage()->read(); $userId = ...
[ "public", "function", "addCalendarEvent", "(", "$", "postValues", ")", "{", "$", "responseData", "=", "array", "(", ")", ";", "$", "calendarTable", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'MelisCalendarTable'", ")", ";", "...
Adding and Updating Calendar Event @param array $postValues if the action is adding new Event, the postValues containing cal_event_title cal_date_start if the action is updating the Event title, the postValues containing cal_id cal_event_title cal_date_start @return Array
[ "Adding", "and", "Updating", "Calendar", "Event" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Service/MelisCalendarService.php#L48-L101
train
melisplatform/melis-calendar
src/Service/MelisCalendarService.php
MelisCalendarService.deleteCalendarEvent
public function deleteCalendarEvent($postValues) { $calId = null; $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $resultEvent = $calendarTable->getEntryById($postValues['cal_id']); if (!empty($resultEvent)){ $event = $resultEvent->current(); ...
php
public function deleteCalendarEvent($postValues) { $calId = null; $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $resultEvent = $calendarTable->getEntryById($postValues['cal_id']); if (!empty($resultEvent)){ $event = $resultEvent->current(); ...
[ "public", "function", "deleteCalendarEvent", "(", "$", "postValues", ")", "{", "$", "calId", "=", "null", ";", "$", "calendarTable", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'MelisCalendarTable'", ")", ";", "$", "resultEvent"...
Deleting Calendar Item Event @param Array $postValues, this containing the calendar id $postValues['cal_id'] @return Int|null if the deletion is failed
[ "Deleting", "Calendar", "Item", "Event" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Service/MelisCalendarService.php#L146-L162
train
ciims/ciims-modules-api
components/ApiAccessControlFilter.php
ApiAccessControlFilter.accessDenied
protected function accessDenied($user,$message=NULL) { http_response_code(403); Yii::app()->controller->renderOutput(array(), 403, $message); }
php
protected function accessDenied($user,$message=NULL) { http_response_code(403); Yii::app()->controller->renderOutput(array(), 403, $message); }
[ "protected", "function", "accessDenied", "(", "$", "user", ",", "$", "message", "=", "NULL", ")", "{", "http_response_code", "(", "403", ")", ";", "Yii", "::", "app", "(", ")", "->", "controller", "->", "renderOutput", "(", "array", "(", ")", ",", "403...
Denies the access of the user. This method is invoked when access check fails. @param IWebUser $user the current user @param string $message the error message to be displayed
[ "Denies", "the", "access", "of", "the", "user", ".", "This", "method", "is", "invoked", "when", "access", "check", "fails", "." ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiAccessControlFilter.php#L93-L97
train
codemojo-dr/startkit-php-sdk
src/CodeMojo/Client/Services/LoyaltyService.php
LoyaltyService.addLoyaltyPoints
public function addLoyaltyPoints($user_id, $transaction_value, $platform = null, $service = null, $expires_in_days = null, $transaction_id = null, $meta = null, $tag = null, $frozen = false){ $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_LOYALTY . Endpoints::LOY...
php
public function addLoyaltyPoints($user_id, $transaction_value, $platform = null, $service = null, $expires_in_days = null, $transaction_id = null, $meta = null, $tag = null, $frozen = false){ $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_LOYALTY . Endpoints::LOY...
[ "public", "function", "addLoyaltyPoints", "(", "$", "user_id", ",", "$", "transaction_value", ",", "$", "platform", "=", "null", ",", "$", "service", "=", "null", ",", "$", "expires_in_days", "=", "null", ",", "$", "transaction_id", "=", "null", ",", "$", ...
Add loyalty points to users wallet @param $user_id @param $transaction_value @param null $platform @param null $service @param null $expires_in_days @param null $transaction_id @param null $meta @param null $tag @param bool $frozen @return bool @throws \CodeMojo\Client\Http\InvalidArgumentException @throws \CodeMojo\OA...
[ "Add", "loyalty", "points", "to", "users", "wallet" ]
cd2227e1a221be2cd75dc96d1c9e0acfda936fb3
https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Services/LoyaltyService.php#L59-L72
train
Wedeto/DB
src/Query/UnionClause.php
UnionClause.toSQL
public function toSQL(Parameters $params, bool $inner_clause) { $q = $this->getQuery(); $t = $this->getType(); $scope = $params->getSubScope($this->sub_scope_number); $this->sub_scope_number = $scope->getScopeID(); return 'UNION ' . $t . ' (' . $params->getDriver()->...
php
public function toSQL(Parameters $params, bool $inner_clause) { $q = $this->getQuery(); $t = $this->getType(); $scope = $params->getSubScope($this->sub_scope_number); $this->sub_scope_number = $scope->getScopeID(); return 'UNION ' . $t . ' (' . $params->getDriver()->...
[ "public", "function", "toSQL", "(", "Parameters", "$", "params", ",", "bool", "$", "inner_clause", ")", "{", "$", "q", "=", "$", "this", "->", "getQuery", "(", ")", ";", "$", "t", "=", "$", "this", "->", "getType", "(", ")", ";", "$", "scope", "=...
Write a UNION clause as SQL query synta @param Parameters $params The query parameters: tables and placeholder values @param bool $inner_clause Unused @return string The generated SQL
[ "Write", "a", "UNION", "clause", "as", "SQL", "query", "synta" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/UnionClause.php#L79-L87
train
Revys/revy
src/App/EntityBase.php
EntityBase.getRules
public static function getRules() { $rules = static::rules(); if (RevyAdmin::isTranslationMode()) { $object = new static(); foreach ($rules as $field => $rule) { if ($object->isTranslatableField($field)) { unset($rules[$field]); ...
php
public static function getRules() { $rules = static::rules(); if (RevyAdmin::isTranslationMode()) { $object = new static(); foreach ($rules as $field => $rule) { if ($object->isTranslatableField($field)) { unset($rules[$field]); ...
[ "public", "static", "function", "getRules", "(", ")", "{", "$", "rules", "=", "static", "::", "rules", "(", ")", ";", "if", "(", "RevyAdmin", "::", "isTranslationMode", "(", ")", ")", "{", "$", "object", "=", "new", "static", "(", ")", ";", "foreach"...
Validation default rules Prepare rules
[ "Validation", "default", "rules" ]
b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1
https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/EntityBase.php#L177-L195
train
congraphcms/core
Traits/ErrorManagerTrait.php
ErrorManagerTrait.resolveErrorKey
protected function resolveErrorKey($messages = []) { // if there is no error key defined leave messages as they were if(empty($this->errorKey)) { return $messages; } // keys are divided on every . $keys = explode('.', $this->errorKey); // we need to reverse this array for sorting $keys = array_rev...
php
protected function resolveErrorKey($messages = []) { // if there is no error key defined leave messages as they were if(empty($this->errorKey)) { return $messages; } // keys are divided on every . $keys = explode('.', $this->errorKey); // we need to reverse this array for sorting $keys = array_rev...
[ "protected", "function", "resolveErrorKey", "(", "$", "messages", "=", "[", "]", ")", "{", "// if there is no error key defined leave messages as they were", "if", "(", "empty", "(", "$", "this", "->", "errorKey", ")", ")", "{", "return", "$", "messages", ";", "...
Nest messages according to error key @param array $messages @return array
[ "Nest", "messages", "according", "to", "error", "key" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/ErrorManagerTrait.php#L68-L87
train
congraphcms/core
Traits/ErrorManagerTrait.php
ErrorManagerTrait.addErrors
public function addErrors($messages = []) { // check if messages are an array if(! is_array($messages) && ! $messages instanceof MessageProvider) { $messages = (array) $messages; } return $this->errors->merge($this->resolveErrorKey($messages)); }
php
public function addErrors($messages = []) { // check if messages are an array if(! is_array($messages) && ! $messages instanceof MessageProvider) { $messages = (array) $messages; } return $this->errors->merge($this->resolveErrorKey($messages)); }
[ "public", "function", "addErrors", "(", "$", "messages", "=", "[", "]", ")", "{", "// check if messages are an array", "if", "(", "!", "is_array", "(", "$", "messages", ")", "&&", "!", "$", "messages", "instanceof", "MessageProvider", ")", "{", "$", "message...
Add messages to error message bag @param array $messages (optional) @return boolean
[ "Add", "messages", "to", "error", "message", "bag" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/ErrorManagerTrait.php#L96-L105
train
vukbgit/PHPCraft.Subject
src/Traits/Messages.php
Messages.injectMessages
public function injectMessages(Message $messages) { $this->messages = $messages; $this->messages->setCookie($this->cookies); }
php
public function injectMessages(Message $messages) { $this->messages = $messages; $this->messages->setCookie($this->cookies); }
[ "public", "function", "injectMessages", "(", "Message", "$", "messages", ")", "{", "$", "this", "->", "messages", "=", "$", "messages", ";", "$", "this", "->", "messages", "->", "setCookie", "(", "$", "this", "->", "cookies", ")", ";", "}" ]
Injects messages manager instance @param PHPCraft\Message\Message $messages messages manager instance
[ "Injects", "messages", "manager", "instance" ]
a43ad7868098ff1e7bda6819547ea64f9a853732
https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Messages.php#L53-L57
train
juliendidier/BuzzProfilerBundle
Buzz/Client/DebugClient.php
DebugClient.formatBytes
private function formatBytes($bytes, $precision = 2) { $unit = array('B','KB','MB','GB','TB','PB','EB'); if (!$bytes) { return "0 B"; } return @round( $bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision ).' '.$unit[$i]; }
php
private function formatBytes($bytes, $precision = 2) { $unit = array('B','KB','MB','GB','TB','PB','EB'); if (!$bytes) { return "0 B"; } return @round( $bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision ).' '.$unit[$i]; }
[ "private", "function", "formatBytes", "(", "$", "bytes", ",", "$", "precision", "=", "2", ")", "{", "$", "unit", "=", "array", "(", "'B'", ",", "'KB'", ",", "'MB'", ",", "'GB'", ",", "'TB'", ",", "'PB'", ",", "'EB'", ")", ";", "if", "(", "!", "...
formats a bigint into a human readable size @param int $size @param int $precision @return string
[ "formats", "a", "bigint", "into", "a", "human", "readable", "size" ]
7d06f1230630bce8d8514e7af3995d852aa34e14
https://github.com/juliendidier/BuzzProfilerBundle/blob/7d06f1230630bce8d8514e7af3995d852aa34e14/Buzz/Client/DebugClient.php#L79-L90
train
horntell/php-sdk
lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php
BatchContext.removeAll
public function removeAll() { foreach ($this->handles as $transaction) { $ch = $this->handles[$transaction]; curl_multi_remove_handle($this->multi, $ch); curl_close($ch); unset($this->handles[$transaction]); } }
php
public function removeAll() { foreach ($this->handles as $transaction) { $ch = $this->handles[$transaction]; curl_multi_remove_handle($this->multi, $ch); curl_close($ch); unset($this->handles[$transaction]); } }
[ "public", "function", "removeAll", "(", ")", "{", "foreach", "(", "$", "this", "->", "handles", "as", "$", "transaction", ")", "{", "$", "ch", "=", "$", "this", "->", "handles", "[", "$", "transaction", "]", ";", "curl_multi_remove_handle", "(", "$", "...
Closes all of the requests associated with the underlying multi handle.
[ "Closes", "all", "of", "the", "requests", "associated", "with", "the", "underlying", "multi", "handle", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L45-L53
train
horntell/php-sdk
lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php
BatchContext.findTransaction
public function findTransaction($handle) { foreach ($this->handles as $transaction) { if ($this->handles[$transaction] === $handle) { return $transaction; } } throw new AdapterException('No curl handle was found'); }
php
public function findTransaction($handle) { foreach ($this->handles as $transaction) { if ($this->handles[$transaction] === $handle) { return $transaction; } } throw new AdapterException('No curl handle was found'); }
[ "public", "function", "findTransaction", "(", "$", "handle", ")", "{", "foreach", "(", "$", "this", "->", "handles", "as", "$", "transaction", ")", "{", "if", "(", "$", "this", "->", "handles", "[", "$", "transaction", "]", "===", "$", "handle", ")", ...
Find a transaction for a given curl handle @param resource $handle Curl handle @return TransactionInterface @throws AdapterException if a transaction is not found
[ "Find", "a", "transaction", "for", "a", "given", "curl", "handle" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L63-L72
train
horntell/php-sdk
lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php
BatchContext.nextPending
public function nextPending() { if (!$this->hasPending()) { return null; } $current = $this->pending->current(); $this->pending->next(); return $current; }
php
public function nextPending() { if (!$this->hasPending()) { return null; } $current = $this->pending->current(); $this->pending->next(); return $current; }
[ "public", "function", "nextPending", "(", ")", "{", "if", "(", "!", "$", "this", "->", "hasPending", "(", ")", ")", "{", "return", "null", ";", "}", "$", "current", "=", "$", "this", "->", "pending", "->", "current", "(", ")", ";", "$", "this", "...
Pop the next transaction from the transaction queue @return TransactionInterface|null
[ "Pop", "the", "next", "transaction", "from", "the", "transaction", "queue" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L99-L109
train
horntell/php-sdk
lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php
BatchContext.addTransaction
public function addTransaction(TransactionInterface $transaction, $handle) { if (isset($this->handles[$transaction])) { throw new AdapterException('Transaction already registered'); } $code = curl_multi_add_handle($this->multi, $handle); if ($code != CURLM_OK) { ...
php
public function addTransaction(TransactionInterface $transaction, $handle) { if (isset($this->handles[$transaction])) { throw new AdapterException('Transaction already registered'); } $code = curl_multi_add_handle($this->multi, $handle); if ($code != CURLM_OK) { ...
[ "public", "function", "addTransaction", "(", "TransactionInterface", "$", "transaction", ",", "$", "handle", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "handles", "[", "$", "transaction", "]", ")", ")", "{", "throw", "new", "AdapterException", "...
Add a transaction to the multi handle @param TransactionInterface $transaction Transaction to add @param resource $handle Resource to use with the handle @throws AdapterException If the handle is already registered
[ "Add", "a", "transaction", "to", "the", "multi", "handle" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L139-L151
train
horntell/php-sdk
lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php
BatchContext.removeTransaction
public function removeTransaction(TransactionInterface $transaction) { if (!isset($this->handles[$transaction])) { throw new AdapterException('Transaction not registered'); } $handle = $this->handles[$transaction]; $this->handles->detach($transaction); $info = cu...
php
public function removeTransaction(TransactionInterface $transaction) { if (!isset($this->handles[$transaction])) { throw new AdapterException('Transaction not registered'); } $handle = $this->handles[$transaction]; $this->handles->detach($transaction); $info = cu...
[ "public", "function", "removeTransaction", "(", "TransactionInterface", "$", "transaction", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "handles", "[", "$", "transaction", "]", ")", ")", "{", "throw", "new", "AdapterException", "(", "'Transact...
Remove a transaction and associated handle from the context @param TransactionInterface $transaction Transaction to remove @return array Returns the curl_getinfo array @throws AdapterException if the transaction is not found
[ "Remove", "a", "transaction", "and", "associated", "handle", "from", "the", "context" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Adapter/Curl/BatchContext.php#L161-L178
train
Wedeto/Log
src/Writer/MemLogWriter.php
MemLogWriter.write
public function write(string $level, string $message, array $context) { $levnum = Logger::getLevelNumeric($level); if ($levnum < $this->min_level) return; $lvl = sprintf("%10s", $level); $message = $this->format($lvl, $message, $context); $this->log[] = $message;...
php
public function write(string $level, string $message, array $context) { $levnum = Logger::getLevelNumeric($level); if ($levnum < $this->min_level) return; $lvl = sprintf("%10s", $level); $message = $this->format($lvl, $message, $context); $this->log[] = $message;...
[ "public", "function", "write", "(", "string", "$", "level", ",", "string", "$", "message", ",", "array", "$", "context", ")", "{", "$", "levnum", "=", "Logger", "::", "getLevelNumeric", "(", "$", "level", ")", ";", "if", "(", "$", "levnum", "<", "$",...
Log a line to the memory log, if its level is high enough @param string $level The level of the message @param string $message The message @param array $context The variables to fill in the message
[ "Log", "a", "line", "to", "the", "memory", "log", "if", "its", "level", "is", "high", "enough" ]
88252c5052089fdcc5dae466d1ad5889bb2b735f
https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Writer/MemLogWriter.php#L59-L68
train
SCLInternet/SclZfGenericMapper
src/SclZfGenericMapper/ZendDbMapper.php
ZendDbMapper.getSelect
protected function getSelect($table = null) { $this->initialize(); $select = $this->getSlaveSql()->select(); $select->from($table ?: $this->getTableName()); return $select; }
php
protected function getSelect($table = null) { $this->initialize(); $select = $this->getSlaveSql()->select(); $select->from($table ?: $this->getTableName()); return $select; }
[ "protected", "function", "getSelect", "(", "$", "table", "=", "null", ")", "{", "$", "this", "->", "initialize", "(", ")", ";", "$", "select", "=", "$", "this", "->", "getSlaveSql", "(", ")", "->", "select", "(", ")", ";", "$", "select", "->", "fro...
The version allows read-write access. @param string $table @return \Zend\Db\Sql\Select
[ "The", "version", "allows", "read", "-", "write", "access", "." ]
c61c61546bfbc07e9c9a4b425e8e02fd7182d80b
https://github.com/SCLInternet/SclZfGenericMapper/blob/c61c61546bfbc07e9c9a4b425e8e02fd7182d80b/src/SclZfGenericMapper/ZendDbMapper.php#L132-L141
train
melisplatform/melis-composerdeploy
src/Service/MelisComposerService.php
MelisComposerService.runCommand
private function runCommand($cmd, $package = null, $args, $noAddtlArguments = false) { $translator = $this->getServiceLocator()->get('translator'); $docPath = str_replace(['\\', 'public/../'], '', $this->getDocumentRoot()); $docPath = trim(substr($docPath, 0, strlen($docPath) - 1)); // remov...
php
private function runCommand($cmd, $package = null, $args, $noAddtlArguments = false) { $translator = $this->getServiceLocator()->get('translator'); $docPath = str_replace(['\\', 'public/../'], '', $this->getDocumentRoot()); $docPath = trim(substr($docPath, 0, strlen($docPath) - 1)); // remov...
[ "private", "function", "runCommand", "(", "$", "cmd", ",", "$", "package", "=", "null", ",", "$", "args", ",", "$", "noAddtlArguments", "=", "false", ")", "{", "$", "translator", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", ...
This calls the composer CLI to execute a command @param $cmd @param null $package @param $args @param bool $noAddtlArguments @return string|\Symfony\Component\Console\Output\StreamOutput @throws \Exception
[ "This", "calls", "the", "composer", "CLI", "to", "execute", "a", "command" ]
6712bd74be419003048909821a07bafe4ca7ce52
https://github.com/melisplatform/melis-composerdeploy/blob/6712bd74be419003048909821a07bafe4ca7ce52/src/Service/MelisComposerService.php#L102-L160
train
melisplatform/melis-composerdeploy
src/Service/MelisComposerService.php
MelisComposerService.setDocumentRoot
public function setDocumentRoot($documentRoot) { if ($documentRoot) { $this->documentRoot = $documentRoot; } else { $this->documentRoot = $this->getDefaultDocRoot(); } }
php
public function setDocumentRoot($documentRoot) { if ($documentRoot) { $this->documentRoot = $documentRoot; } else { $this->documentRoot = $this->getDefaultDocRoot(); } }
[ "public", "function", "setDocumentRoot", "(", "$", "documentRoot", ")", "{", "if", "(", "$", "documentRoot", ")", "{", "$", "this", "->", "documentRoot", "=", "$", "documentRoot", ";", "}", "else", "{", "$", "this", "->", "documentRoot", "=", "$", "this"...
Sets the path of the platform, if nothing is set, then it will use the default path of this platform @param $documentRoot
[ "Sets", "the", "path", "of", "the", "platform", "if", "nothing", "is", "set", "then", "it", "will", "use", "the", "default", "path", "of", "this", "platform" ]
6712bd74be419003048909821a07bafe4ca7ce52
https://github.com/melisplatform/melis-composerdeploy/blob/6712bd74be419003048909821a07bafe4ca7ce52/src/Service/MelisComposerService.php#L201-L208
train
melisplatform/melis-composerdeploy
src/Service/MelisComposerService.php
MelisComposerService.availableCommands
private function availableCommands() { return [ self::INSTALL, self::UPDATE, self::DUMP_AUTOLOAD, self::DOWNLOAD, self::REMOVE, ]; }
php
private function availableCommands() { return [ self::INSTALL, self::UPDATE, self::DUMP_AUTOLOAD, self::DOWNLOAD, self::REMOVE, ]; }
[ "private", "function", "availableCommands", "(", ")", "{", "return", "[", "self", "::", "INSTALL", ",", "self", "::", "UPDATE", ",", "self", "::", "DUMP_AUTOLOAD", ",", "self", "::", "DOWNLOAD", ",", "self", "::", "REMOVE", ",", "]", ";", "}" ]
Sets the limitation to what commands that can be executed @return array
[ "Sets", "the", "limitation", "to", "what", "commands", "that", "can", "be", "executed" ]
6712bd74be419003048909821a07bafe4ca7ce52
https://github.com/melisplatform/melis-composerdeploy/blob/6712bd74be419003048909821a07bafe4ca7ce52/src/Service/MelisComposerService.php#L225-L234
train
FlexModel/FlexModelBundle
EventListener/ObjectUploadSubscriber.php
ObjectUploadSubscriber.preFlush
public function preFlush(PreFlushEventArgs $args) { $objectManager = $args->getEntityManager(); $unitOfWork = $objectManager->getUnitOfWork(); $entityMap = $unitOfWork->getIdentityMap(); foreach ($entityMap as $objectClass => $objects) { if (in_array(UploadObjectInterfac...
php
public function preFlush(PreFlushEventArgs $args) { $objectManager = $args->getEntityManager(); $unitOfWork = $objectManager->getUnitOfWork(); $entityMap = $unitOfWork->getIdentityMap(); foreach ($entityMap as $objectClass => $objects) { if (in_array(UploadObjectInterfac...
[ "public", "function", "preFlush", "(", "PreFlushEventArgs", "$", "args", ")", "{", "$", "objectManager", "=", "$", "args", "->", "getEntityManager", "(", ")", ";", "$", "unitOfWork", "=", "$", "objectManager", "->", "getUnitOfWork", "(", ")", ";", "$", "en...
Prepares upload file references for all objects implementing the UploadObjectInterface. @param PreFlushEventArgs $args
[ "Prepares", "upload", "file", "references", "for", "all", "objects", "implementing", "the", "UploadObjectInterface", "." ]
7b4720d25b0dc6baf29b1da8ad7c67dfb2686460
https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L74-L87
train
FlexModel/FlexModelBundle
EventListener/ObjectUploadSubscriber.php
ObjectUploadSubscriber.prePersist
public function prePersist(LifecycleEventArgs $args) { $object = $args->getObject(); if ($object instanceof UploadObjectInterface) { $this->prepareUploadFileReferences($object); } }
php
public function prePersist(LifecycleEventArgs $args) { $object = $args->getObject(); if ($object instanceof UploadObjectInterface) { $this->prepareUploadFileReferences($object); } }
[ "public", "function", "prePersist", "(", "LifecycleEventArgs", "$", "args", ")", "{", "$", "object", "=", "$", "args", "->", "getObject", "(", ")", ";", "if", "(", "$", "object", "instanceof", "UploadObjectInterface", ")", "{", "$", "this", "->", "prepareU...
Prepares upload file references for a new object implementing the UploadObjectInterface. @param LifecycleEventArgs $args
[ "Prepares", "upload", "file", "references", "for", "a", "new", "object", "implementing", "the", "UploadObjectInterface", "." ]
7b4720d25b0dc6baf29b1da8ad7c67dfb2686460
https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L94-L100
train
FlexModel/FlexModelBundle
EventListener/ObjectUploadSubscriber.php
ObjectUploadSubscriber.postPersist
public function postPersist(LifecycleEventArgs $args) { $object = $args->getObject(); if ($object instanceof UploadObjectInterface) { $this->storeFileUploads($object); } }
php
public function postPersist(LifecycleEventArgs $args) { $object = $args->getObject(); if ($object instanceof UploadObjectInterface) { $this->storeFileUploads($object); } }
[ "public", "function", "postPersist", "(", "LifecycleEventArgs", "$", "args", ")", "{", "$", "object", "=", "$", "args", "->", "getObject", "(", ")", ";", "if", "(", "$", "object", "instanceof", "UploadObjectInterface", ")", "{", "$", "this", "->", "storeFi...
Stores the file uploads. @param LifecycleEventArgs $args
[ "Stores", "the", "file", "uploads", "." ]
7b4720d25b0dc6baf29b1da8ad7c67dfb2686460
https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L107-L113
train
FlexModel/FlexModelBundle
EventListener/ObjectUploadSubscriber.php
ObjectUploadSubscriber.prepareUploadFileReferences
private function prepareUploadFileReferences(UploadObjectInterface $object) { $object->setFileUploadPath($this->fileUploadPath); $reflectionClass = new ReflectionClass($object); $objectName = $reflectionClass->getShortName(); $fileUploads = $object->getFileUploads(); $fileF...
php
private function prepareUploadFileReferences(UploadObjectInterface $object) { $object->setFileUploadPath($this->fileUploadPath); $reflectionClass = new ReflectionClass($object); $objectName = $reflectionClass->getShortName(); $fileUploads = $object->getFileUploads(); $fileF...
[ "private", "function", "prepareUploadFileReferences", "(", "UploadObjectInterface", "$", "object", ")", "{", "$", "object", "->", "setFileUploadPath", "(", "$", "this", "->", "fileUploadPath", ")", ";", "$", "reflectionClass", "=", "new", "ReflectionClass", "(", "...
Sets the new file references to the uploaded files on the object and schedules the previous file reference for deletion. @param UploadObjectInterface $object
[ "Sets", "the", "new", "file", "references", "to", "the", "uploaded", "files", "on", "the", "object", "and", "schedules", "the", "previous", "file", "reference", "for", "deletion", "." ]
7b4720d25b0dc6baf29b1da8ad7c67dfb2686460
https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L139-L165
train
FlexModel/FlexModelBundle
EventListener/ObjectUploadSubscriber.php
ObjectUploadSubscriber.storeFileUploads
private function storeFileUploads(UploadObjectInterface $object) { $reflectionClass = new ReflectionClass($object); $objectName = $reflectionClass->getShortName(); $fileUploads = $object->getFileUploads(); $fileFieldConfigurations = $this->flexModel->getFieldsByDatatype($objectName,...
php
private function storeFileUploads(UploadObjectInterface $object) { $reflectionClass = new ReflectionClass($object); $objectName = $reflectionClass->getShortName(); $fileUploads = $object->getFileUploads(); $fileFieldConfigurations = $this->flexModel->getFieldsByDatatype($objectName,...
[ "private", "function", "storeFileUploads", "(", "UploadObjectInterface", "$", "object", ")", "{", "$", "reflectionClass", "=", "new", "ReflectionClass", "(", "$", "object", ")", ";", "$", "objectName", "=", "$", "reflectionClass", "->", "getShortName", "(", ")",...
Stores the uploaded files to the specified file system location. @param UploadObjectInterface $object
[ "Stores", "the", "uploaded", "files", "to", "the", "specified", "file", "system", "location", "." ]
7b4720d25b0dc6baf29b1da8ad7c67dfb2686460
https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/EventListener/ObjectUploadSubscriber.php#L172-L191
train
gplcart/twocheckout
Main.php
Main.setOrderCompletePage
protected function setOrderCompletePage(array $order, $model, $controller) { $this->order = $model; $this->data_order = $order; $this->controller = $controller; if ($order['payment'] === 'twocheckout') { $this->submitPayment(); $this->completePayment(); ...
php
protected function setOrderCompletePage(array $order, $model, $controller) { $this->order = $model; $this->data_order = $order; $this->controller = $controller; if ($order['payment'] === 'twocheckout') { $this->submitPayment(); $this->completePayment(); ...
[ "protected", "function", "setOrderCompletePage", "(", "array", "$", "order", ",", "$", "model", ",", "$", "controller", ")", "{", "$", "this", "->", "order", "=", "$", "model", ";", "$", "this", "->", "data_order", "=", "$", "order", ";", "$", "this", ...
Set order complete page @param array $order @param \gplcart\core\models\Order $model @param \gplcart\core\controllers\frontend\Controller $controller
[ "Set", "order", "complete", "page" ]
b1578f866ac29d37720e1d616b8b4783832d5107
https://github.com/gplcart/twocheckout/blob/b1578f866ac29d37720e1d616b8b4783832d5107/Main.php#L164-L174
train
gplcart/twocheckout
Main.php
Main.completePayment
protected function completePayment() { if ($this->controller->isQuery('paid')) { $gateway = $this->getGateway(); $this->response = $gateway->completePurchase($this->getPurchaseParams())->send(); $this->processResponse(); } }
php
protected function completePayment() { if ($this->controller->isQuery('paid')) { $gateway = $this->getGateway(); $this->response = $gateway->completePurchase($this->getPurchaseParams())->send(); $this->processResponse(); } }
[ "protected", "function", "completePayment", "(", ")", "{", "if", "(", "$", "this", "->", "controller", "->", "isQuery", "(", "'paid'", ")", ")", "{", "$", "gateway", "=", "$", "this", "->", "getGateway", "(", ")", ";", "$", "this", "->", "response", ...
Performs actions when purchase is completed
[ "Performs", "actions", "when", "purchase", "is", "completed" ]
b1578f866ac29d37720e1d616b8b4783832d5107
https://github.com/gplcart/twocheckout/blob/b1578f866ac29d37720e1d616b8b4783832d5107/Main.php#L218-L225
train
zodream/database
src/Query/Components/RecordBuilder.php
RecordBuilder.replace
public function replace(array $data) { $addFields = implode('`,`', array_keys($data)); return $this->command() ->insertOrReplace("`{$addFields}`", Str::repeat('?', $data), array_values($data)); }
php
public function replace(array $data) { $addFields = implode('`,`', array_keys($data)); return $this->command() ->insertOrReplace("`{$addFields}`", Str::repeat('?', $data), array_values($data)); }
[ "public", "function", "replace", "(", "array", "$", "data", ")", "{", "$", "addFields", "=", "implode", "(", "'`,`'", ",", "array_keys", "(", "$", "data", ")", ")", ";", "return", "$", "this", "->", "command", "(", ")", "->", "insertOrReplace", "(", ...
INSERT OR REPLACE @param array $data @return mixed
[ "INSERT", "OR", "REPLACE" ]
03712219c057799d07350a3a2650c55bcc92c28e
https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Query/Components/RecordBuilder.php#L106-L111
train
agentmedia/phine-core
src/Core/Logic/Module/AjaxBackendForm.php
AjaxBackendForm.SetJSFieldValue
protected function SetJSFieldValue($field, $value) { $jsField = Str::ToJavascript($field, false); $jsValue = Str::ToJavascript($value, false); echo "<script>$($jsField).val($jsValue);</script>"; }
php
protected function SetJSFieldValue($field, $value) { $jsField = Str::ToJavascript($field, false); $jsValue = Str::ToJavascript($value, false); echo "<script>$($jsField).val($jsValue);</script>"; }
[ "protected", "function", "SetJSFieldValue", "(", "$", "field", ",", "$", "value", ")", "{", "$", "jsField", "=", "Str", "::", "ToJavascript", "(", "$", "field", ",", "false", ")", ";", "$", "jsValue", "=", "Str", "::", "ToJavascript", "(", "$", "value"...
Sets a field value as typical action of a modal form call @param string $field The field specifier; typically starting with '#' @param string $value The value
[ "Sets", "a", "field", "value", "as", "typical", "action", "of", "a", "modal", "form", "call" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/AjaxBackendForm.php#L28-L33
train
agentmedia/phine-core
src/Core/Logic/Module/AjaxBackendForm.php
AjaxBackendForm.SetJSHtml
protected function SetJSHtml($element, $html) { $jsElement = Str::ToJavascript($element, false); $jsHtml = Str::ToJavascript($html, false); echo "<script>$($jsElement).html($jsHtml);</script>"; }
php
protected function SetJSHtml($element, $html) { $jsElement = Str::ToJavascript($element, false); $jsHtml = Str::ToJavascript($html, false); echo "<script>$($jsElement).html($jsHtml);</script>"; }
[ "protected", "function", "SetJSHtml", "(", "$", "element", ",", "$", "html", ")", "{", "$", "jsElement", "=", "Str", "::", "ToJavascript", "(", "$", "element", ",", "false", ")", ";", "$", "jsHtml", "=", "Str", "::", "ToJavascript", "(", "$", "html", ...
Sets element html content as a typical action of a modal form call @param string $element The element specifier; typically starting with '#' @param string $html The html string
[ "Sets", "element", "html", "content", "as", "a", "typical", "action", "of", "a", "modal", "form", "call" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/AjaxBackendForm.php#L40-L45
train
Dev4Media/ngnfeed-ebay
src/D4m/NgnFeed/Ebay/Model/Entity.php
Entity.add
private function add($field, $args) { if ($this->hasField($field) && null !== $args[0]) { $this->virtualFieldsCollection[$field][] = $args[0]; } else if ( null === $args[0]){ throw new \InvalidArgumentException("The argument given is null "); } else { thro...
php
private function add($field, $args) { if ($this->hasField($field) && null !== $args[0]) { $this->virtualFieldsCollection[$field][] = $args[0]; } else if ( null === $args[0]){ throw new \InvalidArgumentException("The argument given is null "); } else { thro...
[ "private", "function", "add", "(", "$", "field", ",", "$", "args", ")", "{", "if", "(", "$", "this", "->", "hasField", "(", "$", "field", ")", "&&", "null", "!==", "$", "args", "[", "0", "]", ")", "{", "$", "this", "->", "virtualFieldsCollection", ...
Add an object to a collection @param string $field @param array $args @throws \BadMethodCallException @throws \InvalidArgumentException
[ "Add", "an", "object", "to", "a", "collection" ]
fb9652e30c7e4823a4e4dd571f41c8839953e72c
https://github.com/Dev4Media/ngnfeed-ebay/blob/fb9652e30c7e4823a4e4dd571f41c8839953e72c/src/D4m/NgnFeed/Ebay/Model/Entity.php#L34-L43
train
goncalomb/asbestos
src/classes/Http/Response.php
Response.setContentType
public function setContentType($type, $statusCode=null) { if (isset(static::$_types[$type])) { $type = static::$_types[$type]; } $this->setHeader('Content-Type', $type); if ($statusCode) { $this->_statusCode = $statusCode; } }
php
public function setContentType($type, $statusCode=null) { if (isset(static::$_types[$type])) { $type = static::$_types[$type]; } $this->setHeader('Content-Type', $type); if ($statusCode) { $this->_statusCode = $statusCode; } }
[ "public", "function", "setContentType", "(", "$", "type", ",", "$", "statusCode", "=", "null", ")", "{", "if", "(", "isset", "(", "static", "::", "$", "_types", "[", "$", "type", "]", ")", ")", "{", "$", "type", "=", "static", "::", "$", "_types", ...
Set the response content type header and status code. @param string $type Response content type. @param int $statusCode Response status code.
[ "Set", "the", "response", "content", "type", "header", "and", "status", "code", "." ]
14a875b6c125cfeefe4eb1c3c524500eb8a51d04
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Http/Response.php#L79-L88
train
goncalomb/asbestos
src/classes/Http/Response.php
Response.send
public function send() { if (headers_sent()) { return false; } // set headers foreach ($this->getHeaders() as $h) { header($h[0] . ': ' . $h[1], false, $this->_statusCode); } // set status code if (function_exists('http_response_code'))...
php
public function send() { if (headers_sent()) { return false; } // set headers foreach ($this->getHeaders() as $h) { header($h[0] . ': ' . $h[1], false, $this->_statusCode); } // set status code if (function_exists('http_response_code'))...
[ "public", "function", "send", "(", ")", "{", "if", "(", "headers_sent", "(", ")", ")", "{", "return", "false", ";", "}", "// set headers", "foreach", "(", "$", "this", "->", "getHeaders", "(", ")", "as", "$", "h", ")", "{", "header", "(", "$", "h",...
Send the response using the normal PHP functions.
[ "Send", "the", "response", "using", "the", "normal", "PHP", "functions", "." ]
14a875b6c125cfeefe4eb1c3c524500eb8a51d04
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Http/Response.php#L93-L109
train
nicmart/DomainSpecificQuery
src/Lucene/LuceneQuery.php
LuceneQuery.convertExpressionsToStrings
public function convertExpressionsToStrings() { $this->setMainQuery((string) $this->getMainQuery()); $this->setFilterQueries(array_map( function($expr) { return (string) $expr; }, $this->getFilterQueries() )); return $this; }
php
public function convertExpressionsToStrings() { $this->setMainQuery((string) $this->getMainQuery()); $this->setFilterQueries(array_map( function($expr) { return (string) $expr; }, $this->getFilterQueries() )); return $this; }
[ "public", "function", "convertExpressionsToStrings", "(", ")", "{", "$", "this", "->", "setMainQuery", "(", "(", "string", ")", "$", "this", "->", "getMainQuery", "(", ")", ")", ";", "$", "this", "->", "setFilterQueries", "(", "array_map", "(", "function", ...
Convert all expressions to strings. @return $this
[ "Convert", "all", "expressions", "to", "strings", "." ]
7c01fe94337afdfae5884809e8b5487127a63ac3
https://github.com/nicmart/DomainSpecificQuery/blob/7c01fe94337afdfae5884809e8b5487127a63ac3/src/Lucene/LuceneQuery.php#L124-L134
train
ekyna/Resource
Event/EventQueue.php
EventQueue.enqueue
protected function enqueue($eventName, $resourceOrEvent) { if (!$this->isOpened()) { throw new RuntimeException("The event queue is closed."); } if (!preg_match('~^[a-z_]+\.[a-z_]+\.[a-z_]+$~', $eventName)) { throw new InvalidArgumentException("Unexpected event name ...
php
protected function enqueue($eventName, $resourceOrEvent) { if (!$this->isOpened()) { throw new RuntimeException("The event queue is closed."); } if (!preg_match('~^[a-z_]+\.[a-z_]+\.[a-z_]+$~', $eventName)) { throw new InvalidArgumentException("Unexpected event name ...
[ "protected", "function", "enqueue", "(", "$", "eventName", ",", "$", "resourceOrEvent", ")", "{", "if", "(", "!", "$", "this", "->", "isOpened", "(", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"The event queue is closed.\"", ")", ";", "}", "...
Schedules a resource event of the given type. @param string $eventName @param ResourceInterface|ResourceEventInterface $resourceOrEvent @throws \Ekyna\Component\Resource\Exception\ResourceExceptionInterface
[ "Schedules", "a", "resource", "event", "of", "the", "given", "type", "." ]
96ee3d28e02bd9513705408e3bb7f88a76e52f56
https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Event/EventQueue.php#L111-L147
train
ekyna/Resource
Event/EventQueue.php
EventQueue.getQueueSortingCallback
protected function getQueueSortingCallback() { // [$resourceId => $parentId] $parentMap = $this->registry->getParentMap(); // [$resourceId => $priority] $priorityMap = $this->registry->getEventPriorityMap(); /** * Returns whether or not $a is a child of $b. ...
php
protected function getQueueSortingCallback() { // [$resourceId => $parentId] $parentMap = $this->registry->getParentMap(); // [$resourceId => $priority] $priorityMap = $this->registry->getEventPriorityMap(); /** * Returns whether or not $a is a child of $b. ...
[ "protected", "function", "getQueueSortingCallback", "(", ")", "{", "// [$resourceId => $parentId]", "$", "parentMap", "=", "$", "this", "->", "registry", "->", "getParentMap", "(", ")", ";", "// [$resourceId => $priority]", "$", "priorityMap", "=", "$", "this", "->"...
Returns the queue sorting callback. @return \Closure
[ "Returns", "the", "queue", "sorting", "callback", "." ]
96ee3d28e02bd9513705408e3bb7f88a76e52f56
https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Event/EventQueue.php#L183-L247
train
antbank/ab-reader
src/Adapter/PopplerAdapter.php
PopplerAdapter.read
public function read(string $file): string { $destFile = tempnam(sys_get_temp_dir(), 'pdf_to_text_'); $command = sprintf( 'pdftotext -layout %s %s', escapeshellarg(realpath($file)), escapeshellarg($destFile) ); $return = 0; $output = syst...
php
public function read(string $file): string { $destFile = tempnam(sys_get_temp_dir(), 'pdf_to_text_'); $command = sprintf( 'pdftotext -layout %s %s', escapeshellarg(realpath($file)), escapeshellarg($destFile) ); $return = 0; $output = syst...
[ "public", "function", "read", "(", "string", "$", "file", ")", ":", "string", "{", "$", "destFile", "=", "tempnam", "(", "sys_get_temp_dir", "(", ")", ",", "'pdf_to_text_'", ")", ";", "$", "command", "=", "sprintf", "(", "'pdftotext -layout %s %s'", ",", "...
Read a file and returns text content @param string $file File path to read @return string File content @throws \Exception
[ "Read", "a", "file", "and", "returns", "text", "content" ]
e8b8d4cae4caa7f0a9248ba7b052d387d2118463
https://github.com/antbank/ab-reader/blob/e8b8d4cae4caa7f0a9248ba7b052d387d2118463/src/Adapter/PopplerAdapter.php#L14-L37
train
TiMESPLiNTER/tsFramework
src/ch/timesplinter/logger/FileLogger.php
FileLogger.writeMessage
protected function writeMessage($level, $msg, $vars = null) { // Because of date('u')-PHP-bug (always 00000) $mtimeParts = explode(' ', microtime()); $repl = array( Logger::PATTERN_CLASS => $this->classContext, Logger::PATTERN_CLASSNAME => StringUtils::afterLast($this->classContext, '\\'), Log...
php
protected function writeMessage($level, $msg, $vars = null) { // Because of date('u')-PHP-bug (always 00000) $mtimeParts = explode(' ', microtime()); $repl = array( Logger::PATTERN_CLASS => $this->classContext, Logger::PATTERN_CLASSNAME => StringUtils::afterLast($this->classContext, '\\'), Log...
[ "protected", "function", "writeMessage", "(", "$", "level", ",", "$", "msg", ",", "$", "vars", "=", "null", ")", "{", "// Because of date('u')-PHP-bug (always 00000)", "$", "mtimeParts", "=", "explode", "(", "' '", ",", "microtime", "(", ")", ")", ";", "$", ...
Writes the message with the given pattern into the defined log-file @param type $level @param type $msg @param type $vars
[ "Writes", "the", "message", "with", "the", "given", "pattern", "into", "the", "defined", "log", "-", "file" ]
b3b9fd98f6d456a9e571015877ecca203786fd0c
https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/logger/FileLogger.php#L72-L85
train
redkite-labs/ThemeEngineBundle
Core/Rendering/Listener/BasePageRenderingListener.php
BasePageRenderingListener.renderSlot
protected function renderSlot(Response $response, SlotContent $slotContent) { if (null === $slotContent->getSlotName()) { throw new \RuntimeException('No slot has been defined for the event ' . get_class($this)); } $isReplacing = $slotContent->isReplacing(); if (null === ...
php
protected function renderSlot(Response $response, SlotContent $slotContent) { if (null === $slotContent->getSlotName()) { throw new \RuntimeException('No slot has been defined for the event ' . get_class($this)); } $isReplacing = $slotContent->isReplacing(); if (null === ...
[ "protected", "function", "renderSlot", "(", "Response", "$", "response", ",", "SlotContent", "$", "slotContent", ")", "{", "if", "(", "null", "===", "$", "slotContent", "->", "getSlotName", "(", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", ...
Renders the current slot @param Response $response @param SlotContent $slotContent @return \Symfony\Component\HttpFoundation\Response @throws \RuntimeException
[ "Renders", "the", "current", "slot" ]
427409110f2d4f8f39d8802c17d5dd4115cbdf2b
https://github.com/redkite-labs/ThemeEngineBundle/blob/427409110f2d4f8f39d8802c17d5dd4115cbdf2b/Core/Rendering/Listener/BasePageRenderingListener.php#L83-L105
train
redkite-labs/ThemeEngineBundle
Core/Rendering/Listener/BasePageRenderingListener.php
BasePageRenderingListener.injectContent
protected function injectContent(SlotContent $slotContent, $content) { $regex = $this->getPattern($slotContent->getSlotName()); if (false == preg_match($regex, $content, $match)) { return; } $newContent = $match[1] . PHP_EOL . $slotContent->getContent(); return p...
php
protected function injectContent(SlotContent $slotContent, $content) { $regex = $this->getPattern($slotContent->getSlotName()); if (false == preg_match($regex, $content, $match)) { return; } $newContent = $match[1] . PHP_EOL . $slotContent->getContent(); return p...
[ "protected", "function", "injectContent", "(", "SlotContent", "$", "slotContent", ",", "$", "content", ")", "{", "$", "regex", "=", "$", "this", "->", "getPattern", "(", "$", "slotContent", "->", "getSlotName", "(", ")", ")", ";", "if", "(", "false", "==...
Injects the content at the end of the given content @param SlotContent $slotContent @param string $content The content to inject @return string
[ "Injects", "the", "content", "at", "the", "end", "of", "the", "given", "content" ]
427409110f2d4f8f39d8802c17d5dd4115cbdf2b
https://github.com/redkite-labs/ThemeEngineBundle/blob/427409110f2d4f8f39d8802c17d5dd4115cbdf2b/Core/Rendering/Listener/BasePageRenderingListener.php#L128-L137
train
ekyna/Table
Bridge/Twig/TwigRenderer.php
TwigRenderer.renderCell
public function renderCell(CellView $cell) { $name = $cell->vars['block_prefix'] . '_cell'; return trim($this->template->renderBlock($name, $cell->vars)); }
php
public function renderCell(CellView $cell) { $name = $cell->vars['block_prefix'] . '_cell'; return trim($this->template->renderBlock($name, $cell->vars)); }
[ "public", "function", "renderCell", "(", "CellView", "$", "cell", ")", "{", "$", "name", "=", "$", "cell", "->", "vars", "[", "'block_prefix'", "]", ".", "'_cell'", ";", "return", "trim", "(", "$", "this", "->", "template", "->", "renderBlock", "(", "$...
Renders a cell. @param CellView $cell @return string
[ "Renders", "a", "cell", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Twig/TwigRenderer.php#L88-L93
train
ekyna/Table
Bridge/Twig/TwigRenderer.php
TwigRenderer.renderPager
public function renderPager(TableView $view, $viewName = 'twitter_bootstrap3', array $options = []) { if (!$view->pager) { return ''; } $pageParam = $view->ui['page_name']; $options = array_merge([ 'pageParameter' => '[' . $pageParam . ']', 'prox...
php
public function renderPager(TableView $view, $viewName = 'twitter_bootstrap3', array $options = []) { if (!$view->pager) { return ''; } $pageParam = $view->ui['page_name']; $options = array_merge([ 'pageParameter' => '[' . $pageParam . ']', 'prox...
[ "public", "function", "renderPager", "(", "TableView", "$", "view", ",", "$", "viewName", "=", "'twitter_bootstrap3'", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "$", "view", "->", "pager", ")", "{", "return", "''", ";", "...
Renders pager. @param TableView $view @param string $viewName @param array $options @return string
[ "Renders", "pager", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Twig/TwigRenderer.php#L104-L125
train
joegreen88/zf1-component-validate
src/Zend/Validate/EmailAddress.php
Zend_Validate_EmailAddress.setOptions
public function setOptions(array $options = array()) { if (array_key_exists('messages', $options)) { $this->setMessages($options['messages']); } if (array_key_exists('hostname', $options)) { if (array_key_exists('allow', $options)) { $this->setHostnam...
php
public function setOptions(array $options = array()) { if (array_key_exists('messages', $options)) { $this->setMessages($options['messages']); } if (array_key_exists('hostname', $options)) { if (array_key_exists('allow', $options)) { $this->setHostnam...
[ "public", "function", "setOptions", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "array_key_exists", "(", "'messages'", ",", "$", "options", ")", ")", "{", "$", "this", "->", "setMessages", "(", "$", "options", "[", "'mess...
Set options for the email validator @param array $options @return Zend_Validate_EmailAddress fluid interface
[ "Set", "options", "for", "the", "email", "validator" ]
88d9ea016f73d48ff0ba7d06ecbbf28951fd279e
https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/EmailAddress.php#L176-L205
train
joegreen88/zf1-component-validate
src/Zend/Validate/EmailAddress.php
Zend_Validate_EmailAddress.setValidateMx
public function setValidateMx($mx) { if ((bool) $mx && !$this->validateMxSupported()) { throw new Zend_Validate_Exception('MX checking not available on this system'); } $this->_options['mx'] = (bool) $mx; return $this; }
php
public function setValidateMx($mx) { if ((bool) $mx && !$this->validateMxSupported()) { throw new Zend_Validate_Exception('MX checking not available on this system'); } $this->_options['mx'] = (bool) $mx; return $this; }
[ "public", "function", "setValidateMx", "(", "$", "mx", ")", "{", "if", "(", "(", "bool", ")", "$", "mx", "&&", "!", "$", "this", "->", "validateMxSupported", "(", ")", ")", "{", "throw", "new", "Zend_Validate_Exception", "(", "'MX checking not available on t...
Set whether we check for a valid MX record via DNS This only applies when DNS hostnames are validated @param boolean $mx Set allowed to true to validate for MX records, and false to not validate them @return Zend_Validate_EmailAddress Fluid Interface
[ "Set", "whether", "we", "check", "for", "a", "valid", "MX", "record", "via", "DNS" ]
88d9ea016f73d48ff0ba7d06ecbbf28951fd279e
https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/EmailAddress.php#L288-L297
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.setLimit
private function setLimit($limit = self::NO_LIMIT) { if (! is_int($limit)) { throw new Exceptions\InvalidIntegerType(gettype($limit)); } // A limit of 0 or less is useless, fallback to no limit if ($limit !== self::NO_LIMIT && $limit <= 0) { throw new Excepti...
php
private function setLimit($limit = self::NO_LIMIT) { if (! is_int($limit)) { throw new Exceptions\InvalidIntegerType(gettype($limit)); } // A limit of 0 or less is useless, fallback to no limit if ($limit !== self::NO_LIMIT && $limit <= 0) { throw new Excepti...
[ "private", "function", "setLimit", "(", "$", "limit", "=", "self", "::", "NO_LIMIT", ")", "{", "if", "(", "!", "is_int", "(", "$", "limit", ")", ")", "{", "throw", "new", "Exceptions", "\\", "InvalidIntegerType", "(", "gettype", "(", "$", "limit", ")",...
Stores the limit. @param int $limit @throws Exceptions\InvalidIntegerType @throws Exceptions\PositiveIntegerRequired
[ "Stores", "the", "limit", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L94-L106
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.setTotalItems
private function setTotalItems($totalItems) { if (! is_int($totalItems)) { throw new Exceptions\InvalidIntegerType(gettype($totalItems)); } // A result may have zero or more items if ($totalItems < 0) { throw new Exceptions\PositiveIntegerRequired($totalItems...
php
private function setTotalItems($totalItems) { if (! is_int($totalItems)) { throw new Exceptions\InvalidIntegerType(gettype($totalItems)); } // A result may have zero or more items if ($totalItems < 0) { throw new Exceptions\PositiveIntegerRequired($totalItems...
[ "private", "function", "setTotalItems", "(", "$", "totalItems", ")", "{", "if", "(", "!", "is_int", "(", "$", "totalItems", ")", ")", "{", "throw", "new", "Exceptions", "\\", "InvalidIntegerType", "(", "gettype", "(", "$", "totalItems", ")", ")", ";", "}...
Stores the total amount of items. @param int $totalItems @throws Exceptions\InvalidIntegerType @throws Exceptions\PositiveIntegerRequired
[ "Stores", "the", "total", "amount", "of", "items", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L143-L157
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.calculateTotalPages
private function calculateTotalPages() { // With zero items, there is still one page if ($this->getTotalItems() === 0) { $this->setTotalPages(1); return; } // The total amount of pages is calculated by dividing the total amount of items by the items per page ...
php
private function calculateTotalPages() { // With zero items, there is still one page if ($this->getTotalItems() === 0) { $this->setTotalPages(1); return; } // The total amount of pages is calculated by dividing the total amount of items by the items per page ...
[ "private", "function", "calculateTotalPages", "(", ")", "{", "// With zero items, there is still one page", "if", "(", "$", "this", "->", "getTotalItems", "(", ")", "===", "0", ")", "{", "$", "this", "->", "setTotalPages", "(", "1", ")", ";", "return", ";", ...
Calculates the total amount of pages.
[ "Calculates", "the", "total", "amount", "of", "pages", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L170-L182
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.setPage
private function setPage($page) { if (! is_int($page)) { throw new Exceptions\InvalidIntegerType(gettype($page)); } // There is at least one page if ($page <= 0) { throw new Exceptions\PositiveIntegerRequired($page); } $this->page = $page; ...
php
private function setPage($page) { if (! is_int($page)) { throw new Exceptions\InvalidIntegerType(gettype($page)); } // There is at least one page if ($page <= 0) { throw new Exceptions\PositiveIntegerRequired($page); } $this->page = $page; ...
[ "private", "function", "setPage", "(", "$", "page", ")", "{", "if", "(", "!", "is_int", "(", "$", "page", ")", ")", "{", "throw", "new", "Exceptions", "\\", "InvalidIntegerType", "(", "gettype", "(", "$", "page", ")", ")", ";", "}", "// There is at lea...
Stores the current page. @param int $page @throws Exceptions\InvalidIntegerType @throws Exceptions\PositiveIntegerRequired
[ "Stores", "the", "current", "page", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L199-L213
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.calculateOffset
private function calculateOffset() { // When no limit is provided, all items are on one page, so the offset is unreasonable if (! $this->hasLimit()) { $this->setOffset(0); return; } $offset = ($this->getPage() * $this->getLimit()) - $this->getLimit(); ...
php
private function calculateOffset() { // When no limit is provided, all items are on one page, so the offset is unreasonable if (! $this->hasLimit()) { $this->setOffset(0); return; } $offset = ($this->getPage() * $this->getLimit()) - $this->getLimit(); ...
[ "private", "function", "calculateOffset", "(", ")", "{", "// When no limit is provided, all items are on one page, so the offset is unreasonable", "if", "(", "!", "$", "this", "->", "hasLimit", "(", ")", ")", "{", "$", "this", "->", "setOffset", "(", "0", ")", ";", ...
Calculates the offset for the current page and limit.
[ "Calculates", "the", "offset", "for", "the", "current", "page", "and", "limit", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L228-L239
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.calculateFirstItemOnPage
private function calculateFirstItemOnPage() { // When an offset is used, increase the first item with 1 $offsetItem = $this->getOffset() !== 0 ? 1 : 0; // When there are a total amount of items and the offset is zero, increase 1 if ($this->getTotalItems() !== 0 && $offsetItem === 0)...
php
private function calculateFirstItemOnPage() { // When an offset is used, increase the first item with 1 $offsetItem = $this->getOffset() !== 0 ? 1 : 0; // When there are a total amount of items and the offset is zero, increase 1 if ($this->getTotalItems() !== 0 && $offsetItem === 0)...
[ "private", "function", "calculateFirstItemOnPage", "(", ")", "{", "// When an offset is used, increase the first item with 1", "$", "offsetItem", "=", "$", "this", "->", "getOffset", "(", ")", "!==", "0", "?", "1", ":", "0", ";", "// When there are a total amount of ite...
Calculates which item number is the first on the current page.
[ "Calculates", "which", "item", "number", "is", "the", "first", "on", "the", "current", "page", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L244-L258
train
vdhicts/dicms-pagination
src/Pagination.php
Pagination.calculateLastItemOnPage
private function calculateLastItemOnPage() { // When no limit, the last item is the total amount of items if (! $this->hasLimit()) { $this->setLastItemOnPage($this->getTotalItems()); return; } // Determine the last item on the page $lastItem = $this->...
php
private function calculateLastItemOnPage() { // When no limit, the last item is the total amount of items if (! $this->hasLimit()) { $this->setLastItemOnPage($this->getTotalItems()); return; } // Determine the last item on the page $lastItem = $this->...
[ "private", "function", "calculateLastItemOnPage", "(", ")", "{", "// When no limit, the last item is the total amount of items", "if", "(", "!", "$", "this", "->", "hasLimit", "(", ")", ")", "{", "$", "this", "->", "setLastItemOnPage", "(", "$", "this", "->", "get...
Calculates which item number is the last on the current page.
[ "Calculates", "which", "item", "number", "is", "the", "last", "on", "the", "current", "page", "." ]
e280cb0015ffbe210bcf94acf68186fa5f31f122
https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L263-L278
train
Eden-PHP/Block
Component.php
Component.alert
public function alert($message, $type = 'info') { Argument::i() ->test(2, 'string') ->test(3, 'string'); return Alert::i($message, $type); }
php
public function alert($message, $type = 'info') { Argument::i() ->test(2, 'string') ->test(3, 'string'); return Alert::i($message, $type); }
[ "public", "function", "alert", "(", "$", "message", ",", "$", "type", "=", "'info'", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "2", ",", "'string'", ")", "->", "test", "(", "3", ",", "'string'", ")", ";", "return", "Alert", ":...
Returns an alert @param string @param string @return Eden\Block\Component\Alert
[ "Returns", "an", "alert" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component.php#L40-L47
train
Eden-PHP/Block
Component.php
Component.hero
public function hero(array $images = array(), $delay = null) { Argument::i()->test(2, 'scalar', 'null'); $field = Hero::i()->setImages($images); if(!is_null($delay) and is_numeric($delay) ) { $field->setDelay($delay); } return $field; }
php
public function hero(array $images = array(), $delay = null) { Argument::i()->test(2, 'scalar', 'null'); $field = Hero::i()->setImages($images); if(!is_null($delay) and is_numeric($delay) ) { $field->setDelay($delay); } return $field; }
[ "public", "function", "hero", "(", "array", "$", "images", "=", "array", "(", ")", ",", "$", "delay", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "2", ",", "'scalar'", ",", "'null'", ")", ";", "$", "field", "=", "...
Returns a hero @param array @param scalar|null @return Eden\Block\Hero
[ "Returns", "a", "hero" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component.php#L66-L77
train
Eden-PHP/Block
Component.php
Component.sort
public function sort(array $query, $key, $label, $url = null) { Argument::i() ->test(2, 'string') ->test(3, 'string') ->test(4, 'string', 'null'); $block = Sort::i($query, $key, $label); if($url) { $block->setUrl($url); } return $block; }
php
public function sort(array $query, $key, $label, $url = null) { Argument::i() ->test(2, 'string') ->test(3, 'string') ->test(4, 'string', 'null'); $block = Sort::i($query, $key, $label); if($url) { $block->setUrl($url); } return $block; }
[ "public", "function", "sort", "(", "array", "$", "query", ",", "$", "key", ",", "$", "label", ",", "$", "url", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "2", ",", "'string'", ")", "->", "test", "(", "3", ",", ...
Returns table sort block @param array @param string @param string @param string|null @return Eden\Block\Sort
[ "Returns", "table", "sort", "block" ]
681b9f01dd118612d0fced84d2f702167b52109b
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component.php#L88-L102
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.setPlatform
public function setPlatform(PlatformInterface $platform) { $this->platform = $platform; $this->createTableSQLCollector->setPlatform($platform); $this->dropTableSQLCollector->setPlatform($platform); $this->alterTableSQLCollector->setPlatform($platform); $this->init(); }
php
public function setPlatform(PlatformInterface $platform) { $this->platform = $platform; $this->createTableSQLCollector->setPlatform($platform); $this->dropTableSQLCollector->setPlatform($platform); $this->alterTableSQLCollector->setPlatform($platform); $this->init(); }
[ "public", "function", "setPlatform", "(", "PlatformInterface", "$", "platform", ")", "{", "$", "this", "->", "platform", "=", "$", "platform", ";", "$", "this", "->", "createTableSQLCollector", "->", "setPlatform", "(", "$", "platform", ")", ";", "$", "this"...
Sets the platform used to collect queries. @param \Fridge\DBAL\Platform\PlatformInterface $platform The platform used to collect queries.
[ "Sets", "the", "platform", "used", "to", "collect", "queries", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L101-L110
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.init
public function init() { $this->createTableSQLCollector->init(); $this->dropTableSQLCollector->init(); $this->alterTableSQLCollector->init(); $this->dropSequenceQueries = array(); $this->dropViewQueries = array(); $this->createViewQueries = array(); $this->cr...
php
public function init() { $this->createTableSQLCollector->init(); $this->dropTableSQLCollector->init(); $this->alterTableSQLCollector->init(); $this->dropSequenceQueries = array(); $this->dropViewQueries = array(); $this->createViewQueries = array(); $this->cr...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "createTableSQLCollector", "->", "init", "(", ")", ";", "$", "this", "->", "dropTableSQLCollector", "->", "init", "(", ")", ";", "$", "this", "->", "alterTableSQLCollector", "->", "init", "(",...
Reinitializes the SQL collector.
[ "Reinitializes", "the", "SQL", "collector", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L115-L126
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.collect
public function collect(SchemaDiff $schemaDiff) { if ($schemaDiff->getOldAsset()->getName() !== $schemaDiff->getNewAsset()->getName()) { $this->renameSchemaQueries = array_merge( $this->renameSchemaQueries, $this->platform->getRenameDatabaseSQLQueries($schemaDiff)...
php
public function collect(SchemaDiff $schemaDiff) { if ($schemaDiff->getOldAsset()->getName() !== $schemaDiff->getNewAsset()->getName()) { $this->renameSchemaQueries = array_merge( $this->renameSchemaQueries, $this->platform->getRenameDatabaseSQLQueries($schemaDiff)...
[ "public", "function", "collect", "(", "SchemaDiff", "$", "schemaDiff", ")", "{", "if", "(", "$", "schemaDiff", "->", "getOldAsset", "(", ")", "->", "getName", "(", ")", "!==", "$", "schemaDiff", "->", "getNewAsset", "(", ")", "->", "getName", "(", ")", ...
Collects queries to alter a schema. @param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference.
[ "Collects", "queries", "to", "alter", "a", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L133-L145
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.getQueries
public function getQueries() { return array_merge( $this->getDropSequenceQueries(), $this->getDropViewQueries(), $this->getRenameTableQueries(), $this->getDropCheckQueries(), $this->getDropForeignKeyQueries(), $this->getDropIndexQueries...
php
public function getQueries() { return array_merge( $this->getDropSequenceQueries(), $this->getDropViewQueries(), $this->getRenameTableQueries(), $this->getDropCheckQueries(), $this->getDropForeignKeyQueries(), $this->getDropIndexQueries...
[ "public", "function", "getQueries", "(", ")", "{", "return", "array_merge", "(", "$", "this", "->", "getDropSequenceQueries", "(", ")", ",", "$", "this", "->", "getDropViewQueries", "(", ")", ",", "$", "this", "->", "getRenameTableQueries", "(", ")", ",", ...
Gets the queries to alter the schema. @return array the queries to alter the schema.
[ "Gets", "the", "queries", "to", "alter", "the", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L348-L371
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.collectTables
private function collectTables(SchemaDiff $schemaDiff) { foreach ($schemaDiff->getCreatedTables() as $table) { $this->createTableSQLCollector->collect($table); } foreach ($schemaDiff->getDroppedTables() as $table) { $this->dropTableSQLCollector->collect($table); ...
php
private function collectTables(SchemaDiff $schemaDiff) { foreach ($schemaDiff->getCreatedTables() as $table) { $this->createTableSQLCollector->collect($table); } foreach ($schemaDiff->getDroppedTables() as $table) { $this->dropTableSQLCollector->collect($table); ...
[ "private", "function", "collectTables", "(", "SchemaDiff", "$", "schemaDiff", ")", "{", "foreach", "(", "$", "schemaDiff", "->", "getCreatedTables", "(", ")", "as", "$", "table", ")", "{", "$", "this", "->", "createTableSQLCollector", "->", "collect", "(", "...
Collects queries about tables to alter a schema. @param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference.
[ "Collects", "queries", "about", "tables", "to", "alter", "a", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L378-L391
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.collectViews
private function collectViews(SchemaDiff $schemaDiff) { foreach ($schemaDiff->getCreatedViews() as $view) { $this->createViewQueries = array_merge( $this->createViewQueries, $this->platform->getCreateViewSQLQueries($view) ); } foreach ...
php
private function collectViews(SchemaDiff $schemaDiff) { foreach ($schemaDiff->getCreatedViews() as $view) { $this->createViewQueries = array_merge( $this->createViewQueries, $this->platform->getCreateViewSQLQueries($view) ); } foreach ...
[ "private", "function", "collectViews", "(", "SchemaDiff", "$", "schemaDiff", ")", "{", "foreach", "(", "$", "schemaDiff", "->", "getCreatedViews", "(", ")", "as", "$", "view", ")", "{", "$", "this", "->", "createViewQueries", "=", "array_merge", "(", "$", ...
Collects queries about views to alter a schema. @param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference.
[ "Collects", "queries", "about", "views", "to", "alter", "a", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L398-L413
train
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php
AlterSchemaSQLCollector.collectSequences
private function collectSequences(SchemaDiff $schemaDiff) { foreach ($schemaDiff->getCreatedSequences() as $sequence) { $this->createSequenceQueries = array_merge( $this->createSequenceQueries, $this->platform->getCreateSequenceSQLQueries($sequence) );...
php
private function collectSequences(SchemaDiff $schemaDiff) { foreach ($schemaDiff->getCreatedSequences() as $sequence) { $this->createSequenceQueries = array_merge( $this->createSequenceQueries, $this->platform->getCreateSequenceSQLQueries($sequence) );...
[ "private", "function", "collectSequences", "(", "SchemaDiff", "$", "schemaDiff", ")", "{", "foreach", "(", "$", "schemaDiff", "->", "getCreatedSequences", "(", ")", "as", "$", "sequence", ")", "{", "$", "this", "->", "createSequenceQueries", "=", "array_merge", ...
Collects queries about sequences to a schema. @param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference.
[ "Collects", "queries", "about", "sequences", "to", "a", "schema", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L420-L435
train
wpdesk/wp-basic-requirements
src/Basic_Requirement_Checker.php
WPDesk_Basic_Requirement_Checker.is_wp_plugin_active
public static function is_wp_plugin_active( $plugin_file ) { $active_plugins = (array) get_option( 'active_plugins', array() ); if ( is_multisite() ) { $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); } return in_array( $plugin_file, $active_plugins )...
php
public static function is_wp_plugin_active( $plugin_file ) { $active_plugins = (array) get_option( 'active_plugins', array() ); if ( is_multisite() ) { $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); } return in_array( $plugin_file, $active_plugins )...
[ "public", "static", "function", "is_wp_plugin_active", "(", "$", "plugin_file", ")", "{", "$", "active_plugins", "=", "(", "array", ")", "get_option", "(", "'active_plugins'", ",", "array", "(", ")", ")", ";", "if", "(", "is_multisite", "(", ")", ")", "{",...
Checks if plugin is active. Needs to be enabled in deferred way. @param string $plugin_file @return bool
[ "Checks", "if", "plugin", "is", "active", ".", "Needs", "to", "be", "enabled", "in", "deferred", "way", "." ]
57d76f5acf312f632210db71884f282d8fcf1838
https://github.com/wpdesk/wp-basic-requirements/blob/57d76f5acf312f632210db71884f282d8fcf1838/src/Basic_Requirement_Checker.php#L279-L287
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.indexAction
public function indexAction($access) { $em = $this->getDoctrineManager(); $sf = $this->container->get('sakonnin.files'); // Todo: paging or just show the last 20 $files = $sf->getFilesForLoggedIn(); if ($this->isRest($access)) { return $this->returnRestData($requ...
php
public function indexAction($access) { $em = $this->getDoctrineManager(); $sf = $this->container->get('sakonnin.files'); // Todo: paging or just show the last 20 $files = $sf->getFilesForLoggedIn(); if ($this->isRest($access)) { return $this->returnRestData($requ...
[ "public", "function", "indexAction", "(", "$", "access", ")", "{", "$", "em", "=", "$", "this", "->", "getDoctrineManager", "(", ")", ";", "$", "sf", "=", "$", "this", "->", "container", "->", "get", "(", "'sakonnin.files'", ")", ";", "// Todo: paging or...
Lists all file entities. @Route("/", name="file_index", methods={"GET"})
[ "Lists", "all", "file", "entities", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L33-L45
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.newAction
public function newAction(Request $request, $access) { $file = new SakonninFile(); $form = $this->createCreateForm($file); $data = $request->request->all(); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $sf = $this->container->g...
php
public function newAction(Request $request, $access) { $file = new SakonninFile(); $form = $this->createCreateForm($file); $data = $request->request->all(); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $sf = $this->container->g...
[ "public", "function", "newAction", "(", "Request", "$", "request", ",", "$", "access", ")", "{", "$", "file", "=", "new", "SakonninFile", "(", ")", ";", "$", "form", "=", "$", "this", "->", "createCreateForm", "(", "$", "file", ")", ";", "$", "data",...
Creates a new file entity. @Route("/new", name="file_new", methods={"GET", "POST"})
[ "Creates", "a", "new", "file", "entity", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L69-L97
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.showAction
public function showAction(Request $request, SakonninFile $file, $access) { $deleteForm = $this->createDeleteForm($file); return $this->render('BisonLabSakonninBundle:SakonninFile:show.html.twig', array( 'file' => $file, 'delete_form' => $deleteForm->createView()...
php
public function showAction(Request $request, SakonninFile $file, $access) { $deleteForm = $this->createDeleteForm($file); return $this->render('BisonLabSakonninBundle:SakonninFile:show.html.twig', array( 'file' => $file, 'delete_form' => $deleteForm->createView()...
[ "public", "function", "showAction", "(", "Request", "$", "request", ",", "SakonninFile", "$", "file", ",", "$", "access", ")", "{", "$", "deleteForm", "=", "$", "this", "->", "createDeleteForm", "(", "$", "file", ")", ";", "return", "$", "this", "->", ...
Finds and displays a file entity. @Route("/{id}", name="file_show", methods={"GET"})
[ "Finds", "and", "displays", "a", "file", "entity", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L104-L113
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.viewAction
public function viewAction(Request $request, SakonninFile $file, $access) { // TODO: Add access control. $path = $this->getFilePath(); $response = new BinaryFileResponse($path . "/" . $file->getStoredAs()); return $response; }
php
public function viewAction(Request $request, SakonninFile $file, $access) { // TODO: Add access control. $path = $this->getFilePath(); $response = new BinaryFileResponse($path . "/" . $file->getStoredAs()); return $response; }
[ "public", "function", "viewAction", "(", "Request", "$", "request", ",", "SakonninFile", "$", "file", ",", "$", "access", ")", "{", "// TODO: Add access control.", "$", "path", "=", "$", "this", "->", "getFilePath", "(", ")", ";", "$", "response", "=", "ne...
View a file. @Route("/{id}/view", name="file_view", methods={"GET"})
[ "View", "a", "file", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L134-L140
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.editAction
public function editAction(Request $request, SakonninFile $file, $access) { $deleteForm = $this->createDeleteForm($file); $editForm = $this->createForm('BisonLab\SakonninBundle\Form\SakonninFileType', $file); $editForm->handleRequest($request); if ($editForm->isSubmitted() && $editF...
php
public function editAction(Request $request, SakonninFile $file, $access) { $deleteForm = $this->createDeleteForm($file); $editForm = $this->createForm('BisonLab\SakonninBundle\Form\SakonninFileType', $file); $editForm->handleRequest($request); if ($editForm->isSubmitted() && $editF...
[ "public", "function", "editAction", "(", "Request", "$", "request", ",", "SakonninFile", "$", "file", ",", "$", "access", ")", "{", "$", "deleteForm", "=", "$", "this", "->", "createDeleteForm", "(", "$", "file", ")", ";", "$", "editForm", "=", "$", "t...
Displays a form to edit an existing file entity. @Route("/{id}/edit", name="file_edit", methods={"GET", "POST"})
[ "Displays", "a", "form", "to", "edit", "an", "existing", "file", "entity", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L171-L189
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.deleteAction
public function deleteAction(Request $request, SakonninFile $file, $access) { $form = $this->createDeleteForm($file); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrineManager(); $em->remove($file); $e...
php
public function deleteAction(Request $request, SakonninFile $file, $access) { $form = $this->createDeleteForm($file); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrineManager(); $em->remove($file); $e...
[ "public", "function", "deleteAction", "(", "Request", "$", "request", ",", "SakonninFile", "$", "file", ",", "$", "access", ")", "{", "$", "form", "=", "$", "this", "->", "createDeleteForm", "(", "$", "file", ")", ";", "$", "form", "->", "handleRequest",...
Deletes a file entity. @Route("/{id}", name="file_delete", methods={"DELETE"})
[ "Deletes", "a", "file", "entity", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L196-L210
train
thomasez/BisonLabSakonninBundle
Controller/SakonninFileController.php
SakonninFileController.createDeleteForm
public function createDeleteForm(SakonninFile $file) { return $this->createFormBuilder() ->setAction($this->generateUrl('file_delete', array('id' => $file->getId()))) ->setMethod('DELETE') ->getForm() ; }
php
public function createDeleteForm(SakonninFile $file) { return $this->createFormBuilder() ->setAction($this->generateUrl('file_delete', array('id' => $file->getId()))) ->setMethod('DELETE') ->getForm() ; }
[ "public", "function", "createDeleteForm", "(", "SakonninFile", "$", "file", ")", "{", "return", "$", "this", "->", "createFormBuilder", "(", ")", "->", "setAction", "(", "$", "this", "->", "generateUrl", "(", "'file_delete'", ",", "array", "(", "'id'", "=>",...
Creates a form to delete a file entity. @param SakonninFile $file The file entity @return \Symfony\Component\Form\Form The form
[ "Creates", "a", "form", "to", "delete", "a", "file", "entity", "." ]
45ca7ce9874c4a2be7b503d7067b3d11d2b518cb
https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L241-L248
train
kaiohken1982/NeobazaarMailerModule
src/Mailer/Module.php
Module.onBootstrap
public function onBootstrap(EventInterface $e) { /* @var $application \Zend\Mvc\Application */ $application = $e->getTarget(); $serviceManager = $application->getServiceManager(); $eventManager = $application->getEventManager(); $eventManager->attachAggregate($serviceManager...
php
public function onBootstrap(EventInterface $e) { /* @var $application \Zend\Mvc\Application */ $application = $e->getTarget(); $serviceManager = $application->getServiceManager(); $eventManager = $application->getEventManager(); $eventManager->attachAggregate($serviceManager...
[ "public", "function", "onBootstrap", "(", "EventInterface", "$", "e", ")", "{", "/* @var $application \\Zend\\Mvc\\Application */", "$", "application", "=", "$", "e", "->", "getTarget", "(", ")", ";", "$", "serviceManager", "=", "$", "application", "->", "getServi...
Registra delle azioni agli eventi che necesitano di invio email Per quanto riguarda le risposte sarebbe da realizzare una nuova tabella che salvi i messaggi inviati, la relativa entità, modello e servizio.
[ "Registra", "delle", "azioni", "agli", "eventi", "che", "necesitano", "di", "invio", "email" ]
0afc66196a0a392ecb4f052f483f2b5ff606bd8f
https://github.com/kaiohken1982/NeobazaarMailerModule/blob/0afc66196a0a392ecb4f052f483f2b5ff606bd8f/src/Mailer/Module.php#L25-L41
train
42Telecom/php-sdk-core
src/Factories/ServiceFactory.php
ServiceFactory.get
public static function get($type) { $instance = null; switch ($type) { case 'IM/Send': $instance = new SendService(); break; case 'IM/Status': $instance = new StatusService(); break; case 'TFA/Req...
php
public static function get($type) { $instance = null; switch ($type) { case 'IM/Send': $instance = new SendService(); break; case 'IM/Status': $instance = new StatusService(); break; case 'TFA/Req...
[ "public", "static", "function", "get", "(", "$", "type", ")", "{", "$", "instance", "=", "null", ";", "switch", "(", "$", "type", ")", "{", "case", "'IM/Send'", ":", "$", "instance", "=", "new", "SendService", "(", ")", ";", "break", ";", "case", "...
Get instance of the specified service. @param string $type type of service to call. @return object Instance of the service.
[ "Get", "instance", "of", "the", "specified", "service", "." ]
41d3cbebe01a93220318a250e08c50a6b69b1594
https://github.com/42Telecom/php-sdk-core/blob/41d3cbebe01a93220318a250e08c50a6b69b1594/src/Factories/ServiceFactory.php#L22-L49
train
linguisticteam/json-ld
src/Generators/json_ld.php
JSON_LD_Maker.make
public function make( $type ) { $type = __NAMESPACE__ . "\\" . $type; if (class_exists( $type )) { /** * @var \Lti\Seo\Generators\Thing $object */ $object = new $type( $this->helper ); $result = $object->format(); if (is_array...
php
public function make( $type ) { $type = __NAMESPACE__ . "\\" . $type; if (class_exists( $type )) { /** * @var \Lti\Seo\Generators\Thing $object */ $object = new $type( $this->helper ); $result = $object->format(); if (is_array...
[ "public", "function", "make", "(", "$", "type", ")", "{", "$", "type", "=", "__NAMESPACE__", ".", "\"\\\\\"", ".", "$", "type", ";", "if", "(", "class_exists", "(", "$", "type", ")", ")", "{", "/**\n * @var \\Lti\\Seo\\Generators\\Thing $object\n ...
Our schema.org object factory Makes a new object provided it can find the class @param string $type The type of object to create @return null|string json encoded json-ld string, ready for output
[ "Our", "schema", ".", "org", "object", "factory" ]
354fd518aff5fa52635f435888056fe0bd926566
https://github.com/linguisticteam/json-ld/blob/354fd518aff5fa52635f435888056fe0bd926566/src/Generators/json_ld.php#L85-L100
train
Xsaven/laravel-intelect-admin
src/Auth/Database/Permission.php
Permission.shouldPassThrough
public function shouldPassThrough(Request $request) : bool { if (empty($this->http_method) && empty($this->http_path)) { return true; } $method = $this->http_method; $matches = array_map(function ($path) use ($method) { $path = trim(config('lia.route.prefix'...
php
public function shouldPassThrough(Request $request) : bool { if (empty($this->http_method) && empty($this->http_path)) { return true; } $method = $this->http_method; $matches = array_map(function ($path) use ($method) { $path = trim(config('lia.route.prefix'...
[ "public", "function", "shouldPassThrough", "(", "Request", "$", "request", ")", ":", "bool", "{", "if", "(", "empty", "(", "$", "this", "->", "http_method", ")", "&&", "empty", "(", "$", "this", "->", "http_path", ")", ")", "{", "return", "true", ";", ...
If request should pass through the current permission. @param Request $request @return bool
[ "If", "request", "should", "pass", "through", "the", "current", "permission", "." ]
592574633d12c74cf25b43dd6694fee496abefcb
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Auth/Database/Permission.php#L61-L87
train
BenGorFile/DoctrineORMBridge
src/BenGorFile/DoctrineORMBridge/Infrastructure/Persistence/EntityManagerFactory.php
EntityManagerFactory.build
public function build($aConnection, $isDevMode = true) { Type::addType('file_id', FileIdType::class); return EntityManager::create( $aConnection, Setup::createYAMLMetadataConfiguration([__DIR__ . '/Mapping'], $isDevMode) ); }
php
public function build($aConnection, $isDevMode = true) { Type::addType('file_id', FileIdType::class); return EntityManager::create( $aConnection, Setup::createYAMLMetadataConfiguration([__DIR__ . '/Mapping'], $isDevMode) ); }
[ "public", "function", "build", "(", "$", "aConnection", ",", "$", "isDevMode", "=", "true", ")", "{", "Type", "::", "addType", "(", "'file_id'", ",", "FileIdType", "::", "class", ")", ";", "return", "EntityManager", "::", "create", "(", "$", "aConnection",...
Decorates the doctrine entity manager with library's mappings and custom types. @param mixed $aConnection Connection parameters as db driver @param bool $isDevMode Enables the dev mode, by default is enabled @return EntityManager
[ "Decorates", "the", "doctrine", "entity", "manager", "with", "library", "s", "mappings", "and", "custom", "types", "." ]
c632521914d20c1bb7e837db7a3bcacbdebeeb7e
https://github.com/BenGorFile/DoctrineORMBridge/blob/c632521914d20c1bb7e837db7a3bcacbdebeeb7e/src/BenGorFile/DoctrineORMBridge/Infrastructure/Persistence/EntityManagerFactory.php#L36-L44
train
miaoxing/plugin
src/Service/V.php
V.message
public function message($ruleOrMessage, $message = null) { if (1 === func_num_args()) { $rule = $this->lastRule; $message = $ruleOrMessage; } else { $rule = $ruleOrMessage; } $this->options['messages'][$this->lastKey][$rule] = $message; r...
php
public function message($ruleOrMessage, $message = null) { if (1 === func_num_args()) { $rule = $this->lastRule; $message = $ruleOrMessage; } else { $rule = $ruleOrMessage; } $this->options['messages'][$this->lastKey][$rule] = $message; r...
[ "public", "function", "message", "(", "$", "ruleOrMessage", ",", "$", "message", "=", "null", ")", "{", "if", "(", "1", "===", "func_num_args", "(", ")", ")", "{", "$", "rule", "=", "$", "this", "->", "lastRule", ";", "$", "message", "=", "$", "rul...
Set rule message for current field @param string $ruleOrMessage @param string|null $message @return $this
[ "Set", "rule", "message", "for", "current", "field" ]
f287a1e6c97abba6f06906255b8c26e8ab0afe61
https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L247-L259
train
miaoxing/plugin
src/Service/V.php
V.check
public function check($data = null) { $validator = $this->getValidator($data); if ($validator->isValid()) { return $this->suc(); } else { return $this->err($validator->getFirstMessage()); } }
php
public function check($data = null) { $validator = $this->getValidator($data); if ($validator->isValid()) { return $this->suc(); } else { return $this->err($validator->getFirstMessage()); } }
[ "public", "function", "check", "(", "$", "data", "=", "null", ")", "{", "$", "validator", "=", "$", "this", "->", "getValidator", "(", "$", "data", ")", ";", "if", "(", "$", "validator", "->", "isValid", "(", ")", ")", "{", "return", "$", "this", ...
Validate the data and return the ret array @param mixed $data @return array
[ "Validate", "the", "data", "and", "return", "the", "ret", "array" ]
f287a1e6c97abba6f06906255b8c26e8ab0afe61
https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L289-L298
train
miaoxing/plugin
src/Service/V.php
V.data
public function data($data) { if (!$data) { return $this; } // Validate without key if (!$this->lastKey) { $data = ['' => $data]; } $this->options['data'] = $data; return $this; }
php
public function data($data) { if (!$data) { return $this; } // Validate without key if (!$this->lastKey) { $data = ['' => $data]; } $this->options['data'] = $data; return $this; }
[ "public", "function", "data", "(", "$", "data", ")", "{", "if", "(", "!", "$", "data", ")", "{", "return", "$", "this", ";", "}", "// Validate without key", "if", "(", "!", "$", "this", "->", "lastKey", ")", "{", "$", "data", "=", "[", "''", "=>"...
Set data for validation @param mixed $data @return $this
[ "Set", "data", "for", "validation" ]
f287a1e6c97abba6f06906255b8c26e8ab0afe61
https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L317-L331
train
miaoxing/plugin
src/Service/V.php
V.getValidator
protected function getValidator($data = null) { if (!$this->validator) { if ($data) { // Validate without key if ($this->lastKey === '') { $data = ['' => $data]; } $this->options['data'] = $data; } ...
php
protected function getValidator($data = null) { if (!$this->validator) { if ($data) { // Validate without key if ($this->lastKey === '') { $data = ['' => $data]; } $this->options['data'] = $data; } ...
[ "protected", "function", "getValidator", "(", "$", "data", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "validator", ")", "{", "if", "(", "$", "data", ")", "{", "// Validate without key", "if", "(", "$", "this", "->", "lastKey", "===", "...
Instance validate object @param mixed $data @return Validate
[ "Instance", "validate", "object" ]
f287a1e6c97abba6f06906255b8c26e8ab0afe61
https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L339-L355
train