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
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Persister/DocumentPersister.php
DocumentPersister.loadReferenceManyWithRepositoryMethod
private function loadReferenceManyWithRepositoryMethod(PersistentCollectionInterface $collection) { $iterator = $this->createReferenceManyWithRepositoryMethodIterator($collection); $mapping = $collection->getMapping(); $documents = $iterator->toArray(); foreach ($documents as $key...
php
private function loadReferenceManyWithRepositoryMethod(PersistentCollectionInterface $collection) { $iterator = $this->createReferenceManyWithRepositoryMethodIterator($collection); $mapping = $collection->getMapping(); $documents = $iterator->toArray(); foreach ($documents as $key...
[ "private", "function", "loadReferenceManyWithRepositoryMethod", "(", "PersistentCollectionInterface", "$", "collection", ")", "{", "$", "iterator", "=", "$", "this", "->", "createReferenceManyWithRepositoryMethodIterator", "(", "$", "collection", ")", ";", "$", "mapping",...
Populate a ReferenceMany association with a custom repository method. @param PersistentCollectionInterface $collection @return void
[ "Populate", "a", "ReferenceMany", "association", "with", "a", "custom", "repository", "method", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Persister/DocumentPersister.php#L565-L577
train
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Persister/DocumentPersister.php
DocumentPersister.lock
public function lock($document, $lockMode) { $qb = $this->dm->createQueryBuilder($this->class->name); $identifier = $this->uow->getDocumentIdentifier($document); $lockMapping = $this->class->lockMetadata; $qb->update(); $qb->setIdentifier($identifier); $qb...
php
public function lock($document, $lockMode) { $qb = $this->dm->createQueryBuilder($this->class->name); $identifier = $this->uow->getDocumentIdentifier($document); $lockMapping = $this->class->lockMetadata; $qb->update(); $qb->setIdentifier($identifier); $qb...
[ "public", "function", "lock", "(", "$", "document", ",", "$", "lockMode", ")", "{", "$", "qb", "=", "$", "this", "->", "dm", "->", "createQueryBuilder", "(", "$", "this", "->", "class", "->", "name", ")", ";", "$", "identifier", "=", "$", "this", "...
Locks document by storing the lock mode on the mapped lock attribute. @param object $document @param int $lockMode @return void
[ "Locks", "document", "by", "storing", "the", "lock", "mode", "on", "the", "mapped", "lock", "attribute", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Persister/DocumentPersister.php#L587-L600
train
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Persister/DocumentPersister.php
DocumentPersister.upsert
public function upsert($document, $parentPath = null) { $class = $this->dm->getClassMetadata(get_class($document)); $changeset = $this->uow->getDocumentChangeSet($document); if (!$class->isEmbeddedDocument) { $qb = $this->dm->createQueryBuilder($class->name); ...
php
public function upsert($document, $parentPath = null) { $class = $this->dm->getClassMetadata(get_class($document)); $changeset = $this->uow->getDocumentChangeSet($document); if (!$class->isEmbeddedDocument) { $qb = $this->dm->createQueryBuilder($class->name); ...
[ "public", "function", "upsert", "(", "$", "document", ",", "$", "parentPath", "=", "null", ")", "{", "$", "class", "=", "$", "this", "->", "dm", "->", "getClassMetadata", "(", "get_class", "(", "$", "document", ")", ")", ";", "$", "changeset", "=", "...
Update a document if it already exists in DynamoDB, or insert if it does not. @param object $document @param RootPath|null $parentPath For embedded documents, the QueryBuilder object representing the top-level document path. @return void
[ "Update", "a", "document", "if", "it", "already", "exists", "in", "DynamoDB", "or", "insert", "if", "it", "does", "not", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Persister/DocumentPersister.php#L881-L960
train
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Schema/Identifier/Identifier.php
Identifier.addToQueryCondition
public function addToQueryCondition(Expr $expr) { $expr->attr($this->getHashKey()->getPropertyMetadata()->name)->equals($this->getHashValue()); }
php
public function addToQueryCondition(Expr $expr) { $expr->attr($this->getHashKey()->getPropertyMetadata()->name)->equals($this->getHashValue()); }
[ "public", "function", "addToQueryCondition", "(", "Expr", "$", "expr", ")", "{", "$", "expr", "->", "attr", "(", "$", "this", "->", "getHashKey", "(", ")", "->", "getPropertyMetadata", "(", ")", "->", "name", ")", "->", "equals", "(", "$", "this", "->"...
Add a conditon for this identifer's values to the provided query expression. @param Expr $expr @return void
[ "Add", "a", "conditon", "for", "this", "identifer", "s", "values", "to", "the", "provided", "query", "expression", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Schema/Identifier/Identifier.php#L75-L78
train
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Schema/Identifier/Identifier.php
Identifier.getDocument
public function getDocument(DocumentManager $dm) { // Check identity map first, if its already in there just return it. $document = $dm->getUnitOfWork()->tryGetByIdentifier($this); if ($document !== false) { return $document; } $document = $dm->getProxyFactory()-...
php
public function getDocument(DocumentManager $dm) { // Check identity map first, if its already in there just return it. $document = $dm->getUnitOfWork()->tryGetByIdentifier($this); if ($document !== false) { return $document; } $document = $dm->getProxyFactory()-...
[ "public", "function", "getDocument", "(", "DocumentManager", "$", "dm", ")", "{", "// Check identity map first, if its already in there just return it.", "$", "document", "=", "$", "dm", "->", "getUnitOfWork", "(", ")", "->", "tryGetByIdentifier", "(", "$", "this", ")...
Gets a reference to the target document without actually loading it. If partial objects are allowed, this method will return a partial object that only has its identifier populated. Otherwise a proxy is returned that automatically loads itself on first access. @param DocumentManager $dm @return object The document r...
[ "Gets", "a", "reference", "to", "the", "target", "document", "without", "actually", "loading", "it", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Schema/Identifier/Identifier.php#L113-L125
train
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Schema/Identifier/Identifier.php
Identifier.getDocumentPartial
public function getDocumentPartial(DocumentManager $dm) { // Check identity map first, if its already in there just return it. $document = $dm->getUnitOfWork()->tryGetByIdentifier($this); if ($document !== false) { return $document; } $document = $this->class->ne...
php
public function getDocumentPartial(DocumentManager $dm) { // Check identity map first, if its already in there just return it. $document = $dm->getUnitOfWork()->tryGetByIdentifier($this); if ($document !== false) { return $document; } $document = $this->class->ne...
[ "public", "function", "getDocumentPartial", "(", "DocumentManager", "$", "dm", ")", "{", "// Check identity map first, if its already in there just return it.", "$", "document", "=", "$", "dm", "->", "getUnitOfWork", "(", ")", "->", "tryGetByIdentifier", "(", "$", "this...
Gets a partial reference to the target document without actually loading it, if the document is not yet loaded. The returned reference may be a partial object if the document is not yet loaded/managed. If it is a partial object it will not initialize the rest of the document state on access. Thus you can only ever saf...
[ "Gets", "a", "partial", "reference", "to", "the", "target", "document", "without", "actually", "loading", "it", "if", "the", "document", "is", "not", "yet", "loaded", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Schema/Identifier/Identifier.php#L146-L159
train
Beotie/Beotie-PSR7-stream
src/Stream/FileInfoComponent/MetadataComponent.php
MetadataComponent.isMetadataMethod
protected function isMetadataMethod(string &$subject, int $key, string $pattern) { unset($key); if (!preg_match($pattern, $subject)) { $subject = false; } return; }
php
protected function isMetadataMethod(string &$subject, int $key, string $pattern) { unset($key); if (!preg_match($pattern, $subject)) { $subject = false; } return; }
[ "protected", "function", "isMetadataMethod", "(", "string", "&", "$", "subject", ",", "int", "$", "key", ",", "string", "$", "pattern", ")", "{", "unset", "(", "$", "key", ")", ";", "if", "(", "!", "preg_match", "(", "$", "pattern", ",", "$", "subjec...
Is metadata method Update the method as subject is is not matching the given patter to false @param string $subject The subject @param int $key The subject key @param string $pattern The matching pattern @return void
[ "Is", "metadata", "method" ]
8f4f4bfb8252e392fc17eed2a2b0682c4e9d08ca
https://github.com/Beotie/Beotie-PSR7-stream/blob/8f4f4bfb8252e392fc17eed2a2b0682c4e9d08ca/src/Stream/FileInfoComponent/MetadataComponent.php#L104-L112
train
shgysk8zer0/core_api
traits/magic/domdocument.php
DOMDocument._nodeBuilder
final protected function _nodeBuilder($key, $value = null, \DOMNode &$parent = null) { if (is_null($parent)) { $parent = $this; } if (is_string($key)) { if (substr($key, 0, 1) === '@' and (is_string($value) or is_numeric($value))) { $parent->setAttribute(substr($key, 1), $value); } else { $node ...
php
final protected function _nodeBuilder($key, $value = null, \DOMNode &$parent = null) { if (is_null($parent)) { $parent = $this; } if (is_string($key)) { if (substr($key, 0, 1) === '@' and (is_string($value) or is_numeric($value))) { $parent->setAttribute(substr($key, 1), $value); } else { $node ...
[ "final", "protected", "function", "_nodeBuilder", "(", "$", "key", ",", "$", "value", "=", "null", ",", "\\", "DOMNode", "&", "$", "parent", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "parent", ")", ")", "{", "$", "parent", "=", "$", ...
Dynamically and seemingly magically build nodes and append to parent @param mixed $key Int or string to become tagname of new node @param mixed $value String, array, sdtClass object, DOMNode @param \DOMNode $parent Parent element to append to (defaults to $this) @return void
[ "Dynamically", "and", "seemingly", "magically", "build", "nodes", "and", "append", "to", "parent" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/magic/domdocument.php#L149-L180
train
cubicmushroom/valueobjects
src/Structure/Collection.php
Collection.fromNative
public static function fromNative() { $array = \func_get_arg(0); $items = array(); foreach ($array as $item) { if ($item instanceof \Traversable || \is_array($item)) { $items[] = static::fromNative($item); } else { $items[] = new Strin...
php
public static function fromNative() { $array = \func_get_arg(0); $items = array(); foreach ($array as $item) { if ($item instanceof \Traversable || \is_array($item)) { $items[] = static::fromNative($item); } else { $items[] = new Strin...
[ "public", "static", "function", "fromNative", "(", ")", "{", "$", "array", "=", "\\", "func_get_arg", "(", "0", ")", ";", "$", "items", "=", "array", "(", ")", ";", "foreach", "(", "$", "array", "as", "$", "item", ")", "{", "if", "(", "$", "item"...
Returns a new Collection object @param \SplFixedArray $array @return self
[ "Returns", "a", "new", "Collection", "object" ]
4554239ab75d65eeb9773219aa5b07e9fbfabb92
https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Structure/Collection.php#L21-L37
train
cubicmushroom/valueobjects
src/Structure/Collection.php
Collection.contains
public function contains(ValueObjectInterface $object) { foreach ($this->items as $item) { if ($item->sameValueAs($object)) { return true; } } return false; }
php
public function contains(ValueObjectInterface $object) { foreach ($this->items as $item) { if ($item->sameValueAs($object)) { return true; } } return false; }
[ "public", "function", "contains", "(", "ValueObjectInterface", "$", "object", ")", "{", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "if", "(", "$", "item", "->", "sameValueAs", "(", "$", "object", ")", ")", "{", "return", ...
Tells whether the Collection contains an object @param ValueObjectInterface $object @return bool
[ "Tells", "whether", "the", "Collection", "contains", "an", "object" ]
4554239ab75d65eeb9773219aa5b07e9fbfabb92
https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Structure/Collection.php#L95-L104
train
drdplusinfo/drdplus-fight-properties
DrdPlus/FightProperties/FightProperties.php
FightProperties.getShieldHolding
private function getShieldHolding(): ItemHoldingCode { if ($this->weaponlikeHolding->holdsByMainHand()) { return ItemHoldingCode::getIt(ItemHoldingCode::OFFHAND); } if ($this->weaponlikeHolding->holdsByOffhand()) { return ItemHoldingCode::getIt(ItemHoldingCode::MAIN_H...
php
private function getShieldHolding(): ItemHoldingCode { if ($this->weaponlikeHolding->holdsByMainHand()) { return ItemHoldingCode::getIt(ItemHoldingCode::OFFHAND); } if ($this->weaponlikeHolding->holdsByOffhand()) { return ItemHoldingCode::getIt(ItemHoldingCode::MAIN_H...
[ "private", "function", "getShieldHolding", "(", ")", ":", "ItemHoldingCode", "{", "if", "(", "$", "this", "->", "weaponlikeHolding", "->", "holdsByMainHand", "(", ")", ")", "{", "return", "ItemHoldingCode", "::", "getIt", "(", "ItemHoldingCode", "::", "OFFHAND",...
Gives holding opposite to given weapon holding. @return ItemHoldingCode @throws \DrdPlus\FightProperties\Exceptions\NoHandLeftForShield
[ "Gives", "holding", "opposite", "to", "given", "weapon", "holding", "." ]
66cfce5fa8ba940ee5b9069c5ce6d5a645d4e1a1
https://github.com/drdplusinfo/drdplus-fight-properties/blob/66cfce5fa8ba940ee5b9069c5ce6d5a645d4e1a1/DrdPlus/FightProperties/FightProperties.php#L346-L361
train
drdplusinfo/drdplus-fight-properties
DrdPlus/FightProperties/FightProperties.php
FightProperties.getFightNumberModifier
private function getFightNumberModifier(): int { $fightNumberModifier = 0; // strength effect $fightNumberModifier += $this->getFightNumberMalusByStrength(); // skills effect $fightNumberModifier += $this->getFightNumberMalusBySkills(); // combat actions effect ...
php
private function getFightNumberModifier(): int { $fightNumberModifier = 0; // strength effect $fightNumberModifier += $this->getFightNumberMalusByStrength(); // skills effect $fightNumberModifier += $this->getFightNumberMalusBySkills(); // combat actions effect ...
[ "private", "function", "getFightNumberModifier", "(", ")", ":", "int", "{", "$", "fightNumberModifier", "=", "0", ";", "// strength effect", "$", "fightNumberModifier", "+=", "$", "this", "->", "getFightNumberMalusByStrength", "(", ")", ";", "// skills effect", "$",...
Fight number update according to a missing strength, missing skill and by a combat action @return int
[ "Fight", "number", "update", "according", "to", "a", "missing", "strength", "missing", "skill", "and", "by", "a", "combat", "action" ]
66cfce5fa8ba940ee5b9069c5ce6d5a645d4e1a1
https://github.com/drdplusinfo/drdplus-fight-properties/blob/66cfce5fa8ba940ee5b9069c5ce6d5a645d4e1a1/DrdPlus/FightProperties/FightProperties.php#L400-L414
train
niridoy/LaraveIinstaller
src/Helpers/FinalInstallManager.php
FinalInstallManager.generateKey
private static function generateKey($outputLog) { try{ Artisan::call('key:generate', ["--force"=> true], $outputLog); } catch(Exception $e){ return $this->response($e->getMessage()); } return $outputLog; }
php
private static function generateKey($outputLog) { try{ Artisan::call('key:generate', ["--force"=> true], $outputLog); } catch(Exception $e){ return $this->response($e->getMessage()); } return $outputLog; }
[ "private", "static", "function", "generateKey", "(", "$", "outputLog", ")", "{", "try", "{", "Artisan", "::", "call", "(", "'key:generate'", ",", "[", "\"--force\"", "=>", "true", "]", ",", "$", "outputLog", ")", ";", "}", "catch", "(", "Exception", "$",...
Generate New Application Key. @param collection $outputLog @return collection
[ "Generate", "New", "Application", "Key", "." ]
8339cf45bf393be57fb4e6c63179a6865028f076
https://github.com/niridoy/LaraveIinstaller/blob/8339cf45bf393be57fb4e6c63179a6865028f076/src/Helpers/FinalInstallManager.php#L32-L42
train
Wedeto/DB
src/Query/FieldName.php
FieldName.toSQL
public function toSQL(Parameters $params, bool $inner_clause) { $field = $this->getField(); $table = $this->getTable(); if (empty($table)) $table = $params->getDefaultTable(); $drv = $params->getDriver(); if (!empty($table)) { list($table, $al...
php
public function toSQL(Parameters $params, bool $inner_clause) { $field = $this->getField(); $table = $this->getTable(); if (empty($table)) $table = $params->getDefaultTable(); $drv = $params->getDriver(); if (!empty($table)) { list($table, $al...
[ "public", "function", "toSQL", "(", "Parameters", "$", "params", ",", "bool", "$", "inner_clause", ")", "{", "$", "field", "=", "$", "this", "->", "getField", "(", ")", ";", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "if", "("...
Write a field name as SQL query syntax @param Parameters $params The query parameters: tables and placeholder values @param bool $inner_clause Unused @return string The generated SQL
[ "Write", "a", "field", "name", "as", "SQL", "query", "syntax" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/FieldName.php#L58-L78
train
wobblecode/WobbleCodeUserBundle
Manager/OrganizationManager.php
OrganizationManager.setupOrganization
public function setupOrganization(User $user) { $guestCreateOrganization = false; $invitationHash = $this->session->get('newInvitation', false); if ($guestCreateOrganization || $invitationHash == false) { $organization = $this->createOrganization($user); } if ($...
php
public function setupOrganization(User $user) { $guestCreateOrganization = false; $invitationHash = $this->session->get('newInvitation', false); if ($guestCreateOrganization || $invitationHash == false) { $organization = $this->createOrganization($user); } if ($...
[ "public", "function", "setupOrganization", "(", "User", "$", "user", ")", "{", "$", "guestCreateOrganization", "=", "false", ";", "$", "invitationHash", "=", "$", "this", "->", "session", "->", "get", "(", "'newInvitation'", ",", "false", ")", ";", "if", "...
Setup organization from signup. It chekcs if there is an invitationHash in session @todo Add Bundle option for $guestCreateOrganization @param User $user @return Organization
[ "Setup", "organization", "from", "signup", ".", "It", "chekcs", "if", "there", "is", "an", "invitationHash", "in", "session" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/OrganizationManager.php#L66-L80
train
wobblecode/WobbleCodeUserBundle
Manager/OrganizationManager.php
OrganizationManager.createOrganization
public function createOrganization(User $user) { $organization = new $this->organizationClass; $organization->setOwner($user); $organization->addUser($user); $role = new Role; $role->setRoles(array('ROLE_ORGANIZATION_OWNER')); $role->setUser($user); $role->se...
php
public function createOrganization(User $user) { $organization = new $this->organizationClass; $organization->setOwner($user); $organization->addUser($user); $role = new Role; $role->setRoles(array('ROLE_ORGANIZATION_OWNER')); $role->setUser($user); $role->se...
[ "public", "function", "createOrganization", "(", "User", "$", "user", ")", "{", "$", "organization", "=", "new", "$", "this", "->", "organizationClass", ";", "$", "organization", "->", "setOwner", "(", "$", "user", ")", ";", "$", "organization", "->", "add...
It creates and completes a new Organization @param OrganizationInterface $organization New empty organization @param User $user User that owns the organizartion @return Organization The new organization
[ "It", "creates", "and", "completes", "a", "new", "Organization" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/OrganizationManager.php#L90-L133
train
wobblecode/WobbleCodeUserBundle
Manager/OrganizationManager.php
OrganizationManager.addMember
public function addMember(OrganizationInterface $organization, User $user, array $roles) { if ($organization->getOwner() === null) { $organization->setOwner($user); } $user->addOrganization($organization); $organization->addUser($user); $role = new Role(); ...
php
public function addMember(OrganizationInterface $organization, User $user, array $roles) { if ($organization->getOwner() === null) { $organization->setOwner($user); } $user->addOrganization($organization); $organization->addUser($user); $role = new Role(); ...
[ "public", "function", "addMember", "(", "OrganizationInterface", "$", "organization", ",", "User", "$", "user", ",", "array", "$", "roles", ")", "{", "if", "(", "$", "organization", "->", "getOwner", "(", ")", "===", "null", ")", "{", "$", "organization", ...
Add member to an organization with specifics roles @param OrganizationInterface $organization @param User $user @param array $roles
[ "Add", "member", "to", "an", "organization", "with", "specifics", "roles" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/OrganizationManager.php#L142-L160
train
wobblecode/WobbleCodeUserBundle
Manager/OrganizationManager.php
OrganizationManager.processInvitationByHash
public function processInvitationByHash(User $user, $hash) { $invitation = $this->dm->getRepository('WobbleCodeUserBundle:Invitation')->findOneBy( [ 'hash' => $hash, 'status' => 'pending' ] ); if (!$invitation) { return f...
php
public function processInvitationByHash(User $user, $hash) { $invitation = $this->dm->getRepository('WobbleCodeUserBundle:Invitation')->findOneBy( [ 'hash' => $hash, 'status' => 'pending' ] ); if (!$invitation) { return f...
[ "public", "function", "processInvitationByHash", "(", "User", "$", "user", ",", "$", "hash", ")", "{", "$", "invitation", "=", "$", "this", "->", "dm", "->", "getRepository", "(", "'WobbleCodeUserBundle:Invitation'", ")", "->", "findOneBy", "(", "[", "'hash'",...
Finds an Invitation by Hash and add member if exists @param User $user @param string $hash Secret Invitation Hash
[ "Finds", "an", "Invitation", "by", "Hash", "and", "add", "member", "if", "exists" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/OrganizationManager.php#L168-L185
train
wobblecode/WobbleCodeUserBundle
Manager/OrganizationManager.php
OrganizationManager.addMemberByInvitation
public function addMemberByInvitation(OrganizationInterface $organization, User $user, Invitation $invitation) { $this->addMember($organization, $user, $invitation->getRoles()); $invitation->setStatus('accepted'); $invitation->setTo($user); $this->dm->persist($invitation); $...
php
public function addMemberByInvitation(OrganizationInterface $organization, User $user, Invitation $invitation) { $this->addMember($organization, $user, $invitation->getRoles()); $invitation->setStatus('accepted'); $invitation->setTo($user); $this->dm->persist($invitation); $...
[ "public", "function", "addMemberByInvitation", "(", "OrganizationInterface", "$", "organization", ",", "User", "$", "user", ",", "Invitation", "$", "invitation", ")", "{", "$", "this", "->", "addMember", "(", "$", "organization", ",", "$", "user", ",", "$", ...
Add member to an Organization using settings from invitation @param OrganizationInterface $organization @param User $user @param Invitation $invitation
[ "Add", "member", "to", "an", "Organization", "using", "settings", "from", "invitation" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/OrganizationManager.php#L194-L202
train
wobblecode/WobbleCodeUserBundle
Manager/OrganizationManager.php
OrganizationManager.getAdminOwner
public function getAdminOwner() { $repo = $this->dm->getRepository($this->organizationClass); return $repo->findOneBy([ 'adminOwner' => true ]); }
php
public function getAdminOwner() { $repo = $this->dm->getRepository($this->organizationClass); return $repo->findOneBy([ 'adminOwner' => true ]); }
[ "public", "function", "getAdminOwner", "(", ")", "{", "$", "repo", "=", "$", "this", "->", "dm", "->", "getRepository", "(", "$", "this", "->", "organizationClass", ")", ";", "return", "$", "repo", "->", "findOneBy", "(", "[", "'adminOwner'", "=>", "true...
Gets the system admin Organization @return OrganizationInterface
[ "Gets", "the", "system", "admin", "Organization" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Manager/OrganizationManager.php#L209-L216
train
agentmedia/phine-core
src/Core/Logic/Rendering/ContentRenderer.php
ContentRenderer.Render
function Render() { if (!self::Guard()->Allow(Action::Read(), $this->content)) { return ''; } ContentTranslator::Singleton()->SetContent($this->content); $module = ClassFinder::CreateFrontendModule($this->content->GetType()); $module->SetTreeItem($this->tr...
php
function Render() { if (!self::Guard()->Allow(Action::Read(), $this->content)) { return ''; } ContentTranslator::Singleton()->SetContent($this->content); $module = ClassFinder::CreateFrontendModule($this->content->GetType()); $module->SetTreeItem($this->tr...
[ "function", "Render", "(", ")", "{", "if", "(", "!", "self", "::", "Guard", "(", ")", "->", "Allow", "(", "Action", "::", "Read", "(", ")", ",", "$", "this", "->", "content", ")", ")", "{", "return", "''", ";", "}", "ContentTranslator", "::", "Si...
Renders the content @return string Returns the rendered content
[ "Renders", "the", "content" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Rendering/ContentRenderer.php#L67-L77
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Media.php
Media.getC2Ms
public function getC2Ms(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collC2MsPartial && !$this->isNew(); if (null === $this->collC2Ms || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collC2Ms) { // return empty...
php
public function getC2Ms(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collC2MsPartial && !$this->isNew(); if (null === $this->collC2Ms || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collC2Ms) { // return empty...
[ "public", "function", "getC2Ms", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collC2MsPartial", "&&", "!", "$", "this", "->", "isNew", "(", ")", "...
Gets an array of ChildC2M objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, the ...
[ "Gets", "an", "array", "of", "ChildC2M", "objects", "which", "contain", "a", "foreign", "key", "that", "references", "this", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Media.php#L3169-L3211
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Media.php
Media.countM2Ps
public function countM2Ps(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collM2PsPartial && !$this->isNew(); if (null === $this->collM2Ps || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collM2Ps) { ...
php
public function countM2Ps(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collM2PsPartial && !$this->isNew(); if (null === $this->collM2Ps || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collM2Ps) { ...
[ "public", "function", "countM2Ps", "(", "Criteria", "$", "criteria", "=", "null", ",", "$", "distinct", "=", "false", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collM2PsPartial", "&&", "!", "$"...
Returns the number of related M2P objects. @param Criteria $criteria @param boolean $distinct @param ConnectionInterface $con @return int Count of related M2P objects. @throws PropelException
[ "Returns", "the", "number", "of", "related", "M2P", "objects", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Media.php#L3511-L3534
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Media.php
Media.getM2PsJoinPage
public function getM2PsJoinPage(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildM2PQuery::create(null, $criteria); $query->joinWith('Page', $joinBehavior); return $this->getM2Ps($query, $con); }
php
public function getM2PsJoinPage(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildM2PQuery::create(null, $criteria); $query->joinWith('Page', $joinBehavior); return $this->getM2Ps($query, $con); }
[ "public", "function", "getM2PsJoinPage", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ",", "$", "joinBehavior", "=", "Criteria", "::", "LEFT_JOIN", ")", "{", "$", "query", "=", "ChildM2PQuery", "::", "cr...
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Media is new, it will return an empty collection; or if this Media has previously been saved, it will retrieve related M2Ps from storage. This method is protected by default in order to keep the pub...
[ "If", "this", "collection", "has", "already", "been", "initialized", "with", "an", "identical", "criteria", "it", "returns", "the", "collection", ".", "Otherwise", "if", "this", "Media", "is", "new", "it", "will", "return", "an", "empty", "collection", ";", ...
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Media.php#L3607-L3613
train
fxpio/fxp-doctrine-extensions
Validator/Constraints/UniqueEntityValidator.php
UniqueEntityValidator.getCriteria
protected function getCriteria($entity, Constraint $constraint, ObjectManager $em) { /** @var UniqueEntity $constraint */ /** @var \Doctrine\ORM\Mapping\ClassMetadata $class */ $class = $em->getClassMetadata(ClassUtils::getClass($entity)); $fields = (array) $constraint->fields; ...
php
protected function getCriteria($entity, Constraint $constraint, ObjectManager $em) { /** @var UniqueEntity $constraint */ /** @var \Doctrine\ORM\Mapping\ClassMetadata $class */ $class = $em->getClassMetadata(ClassUtils::getClass($entity)); $fields = (array) $constraint->fields; ...
[ "protected", "function", "getCriteria", "(", "$", "entity", ",", "Constraint", "$", "constraint", ",", "ObjectManager", "$", "em", ")", "{", "/** @var UniqueEntity $constraint */", "/** @var \\Doctrine\\ORM\\Mapping\\ClassMetadata $class */", "$", "class", "=", "$", "em",...
Gets criteria. @param object $entity @param Constraint $constraint @param ObjectManager $em @throws ConstraintDefinitionException @return null|array Null if there is no constraint
[ "Gets", "criteria", "." ]
82942f51d47cdd79a20a5725ee1b3ecfc69e9d77
https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Validator/Constraints/UniqueEntityValidator.php#L91-L108
train
fxpio/fxp-doctrine-extensions
Validator/Constraints/UniqueEntityValidator.php
UniqueEntityValidator.getResult
private function getResult($entity, Constraint $constraint, array $criteria, ObjectManager $em) { /** @var UniqueEntity $constraint */ $filters = SqlFilterUtil::findFilters($em, (array) $constraint->filters, $constraint->allFilters); SqlFilterUtil::disableFilters($em, $filters); $re...
php
private function getResult($entity, Constraint $constraint, array $criteria, ObjectManager $em) { /** @var UniqueEntity $constraint */ $filters = SqlFilterUtil::findFilters($em, (array) $constraint->filters, $constraint->allFilters); SqlFilterUtil::disableFilters($em, $filters); $re...
[ "private", "function", "getResult", "(", "$", "entity", ",", "Constraint", "$", "constraint", ",", "array", "$", "criteria", ",", "ObjectManager", "$", "em", ")", "{", "/** @var UniqueEntity $constraint */", "$", "filters", "=", "SqlFilterUtil", "::", "findFilters...
Get entity result. @param object $entity @param Constraint $constraint @param array $criteria @param ObjectManager $em @return array
[ "Get", "entity", "result", "." ]
82942f51d47cdd79a20a5725ee1b3ecfc69e9d77
https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Validator/Constraints/UniqueEntityValidator.php#L120-L135
train
fxpio/fxp-doctrine-extensions
Validator/Constraints/UniqueEntityValidator.php
UniqueEntityValidator.isValidResult
private function isValidResult($result, $entity) { return 0 === \count($result) || (1 === \count($result) && $entity === ($result instanceof \Iterator ? $result->current() : current($result))); }
php
private function isValidResult($result, $entity) { return 0 === \count($result) || (1 === \count($result) && $entity === ($result instanceof \Iterator ? $result->current() : current($result))); }
[ "private", "function", "isValidResult", "(", "$", "result", ",", "$", "entity", ")", "{", "return", "0", "===", "\\", "count", "(", "$", "result", ")", "||", "(", "1", "===", "\\", "count", "(", "$", "result", ")", "&&", "$", "entity", "===", "(", ...
Check if the result is valid. If no entity matched the query criteria or a single entity matched, which is the same as the entity being validated, the criteria is unique. @param array|\Iterator $result @param object $entity @return bool
[ "Check", "if", "the", "result", "is", "valid", "." ]
82942f51d47cdd79a20a5725ee1b3ecfc69e9d77
https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Validator/Constraints/UniqueEntityValidator.php#L149-L154
train
fxpio/fxp-doctrine-extensions
Validator/Constraints/UniqueEntityValidator.php
UniqueEntityValidator.findFieldCriteriaStep2
private function findFieldCriteriaStep2(array &$criteria, ObjectManager $em, ClassMetadata $class, $fieldName): void { if (null !== $criteria[$fieldName] && $class->hasAssociation($fieldName)) { /* Ensure the Proxy is initialized before using reflection to * read its identifiers. Th...
php
private function findFieldCriteriaStep2(array &$criteria, ObjectManager $em, ClassMetadata $class, $fieldName): void { if (null !== $criteria[$fieldName] && $class->hasAssociation($fieldName)) { /* Ensure the Proxy is initialized before using reflection to * read its identifiers. Th...
[ "private", "function", "findFieldCriteriaStep2", "(", "array", "&", "$", "criteria", ",", "ObjectManager", "$", "em", ",", "ClassMetadata", "$", "class", ",", "$", "fieldName", ")", ":", "void", "{", "if", "(", "null", "!==", "$", "criteria", "[", "$", "...
Finds the criteria for the entity field. @param array $criteria @param ObjectManager $em @param ClassMetadata $class @param string $fieldName @throws ConstraintDefinitionException
[ "Finds", "the", "criteria", "for", "the", "entity", "field", "." ]
82942f51d47cdd79a20a5725ee1b3ecfc69e9d77
https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Validator/Constraints/UniqueEntityValidator.php#L208-L230
train
climphp/Clim
Clim/Cli/MiddlewareStack.php
MiddlewareStack.handleResult
protected function handleResult(ContextInterface $context, $result) { $validated = $this->validateResult($result); if (is_null($validated)) { $validated = $result; } if ($validated instanceof ContextInterface) { $context = $validated; } elseif (!is_nu...
php
protected function handleResult(ContextInterface $context, $result) { $validated = $this->validateResult($result); if (is_null($validated)) { $validated = $result; } if ($validated instanceof ContextInterface) { $context = $validated; } elseif (!is_nu...
[ "protected", "function", "handleResult", "(", "ContextInterface", "$", "context", ",", "$", "result", ")", "{", "$", "validated", "=", "$", "this", "->", "validateResult", "(", "$", "result", ")", ";", "if", "(", "is_null", "(", "$", "validated", ")", ")...
Validate middleware result. Imprementer shall invoke exceptions in this method if result is not valid. @param ContextInterface $context A context object @param mixed $result @return ContextInterface|null
[ "Validate", "middleware", "result", ".", "Imprementer", "shall", "invoke", "exceptions", "in", "this", "method", "if", "result", "is", "not", "valid", "." ]
d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4
https://github.com/climphp/Clim/blob/d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4/Clim/Cli/MiddlewareStack.php#L111-L125
train
Wedeto/HTTP
src/Response/FileResponse.php
FileResponse.output
public function output(string $mime) { // Nothing to output, the webserver will handle it if ($this->xsendfile) return; $bytes = readfile($this->filename); if (!empty($this->length) && $bytes != $this->length) { self::getLogger()->warning( ...
php
public function output(string $mime) { // Nothing to output, the webserver will handle it if ($this->xsendfile) return; $bytes = readfile($this->filename); if (!empty($this->length) && $bytes != $this->length) { self::getLogger()->warning( ...
[ "public", "function", "output", "(", "string", "$", "mime", ")", "{", "// Nothing to output, the webserver will handle it", "if", "(", "$", "this", "->", "xsendfile", ")", "return", ";", "$", "bytes", "=", "readfile", "(", "$", "this", "->", "filename", ")", ...
Serve the file to the user
[ "Serve", "the", "file", "to", "the", "user" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/FileResponse.php#L142-L156
train
Vectrex/vxPHP
src/Routing/Route.php
Route.getPath
public function getPath(array $pathParameters = null) { $path = $this->path; //insert path parameters if(!empty($this->placeholders)) { foreach ($this->placeholders as $placeholder) { // use path parameter if it was passed on $regExp = '~\{' . $placeholder['name'] . '(=.*?)?\}~'; ...
php
public function getPath(array $pathParameters = null) { $path = $this->path; //insert path parameters if(!empty($this->placeholders)) { foreach ($this->placeholders as $placeholder) { // use path parameter if it was passed on $regExp = '~\{' . $placeholder['name'] . '(=.*?)?\}~'; ...
[ "public", "function", "getPath", "(", "array", "$", "pathParameters", "=", "null", ")", "{", "$", "path", "=", "$", "this", "->", "path", ";", "//insert path parameters", "if", "(", "!", "empty", "(", "$", "this", "->", "placeholders", ")", ")", "{", "...
get path of route When path parameters are passed on to method a path using these parameter values is generated, but path parameters are not stored and do not overwrite previously set path parameters. When no (or only some) path parameters are passed on previously set path parameters are considered when generating th...
[ "get", "path", "of", "route" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Routing/Route.php#L301-L344
train
Vectrex/vxPHP
src/Routing/Route.php
Route.setRequestMethods
public function setRequestMethods(array $requestMethods) { $requestMethods = array_map('strtoupper', $requestMethods); $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']; foreach($requestMethods as $requestMethod) { if(!in_array($requestMethod, $allowedMethods)) { throw new \Inva...
php
public function setRequestMethods(array $requestMethods) { $requestMethods = array_map('strtoupper', $requestMethods); $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']; foreach($requestMethods as $requestMethod) { if(!in_array($requestMethod, $allowedMethods)) { throw new \Inva...
[ "public", "function", "setRequestMethods", "(", "array", "$", "requestMethods", ")", "{", "$", "requestMethods", "=", "array_map", "(", "'strtoupper'", ",", "$", "requestMethods", ")", ";", "$", "allowedMethods", "=", "[", "'GET'", ",", "'POST'", ",", "'PUT'",...
set all allowed request methods for a route @param array $requestMethods @return \vxPHP\Routing\Route
[ "set", "all", "allowed", "request", "methods", "for", "a", "route" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Routing/Route.php#L469-L484
train
Vectrex/vxPHP
src/Routing/Route.php
Route.allowsRequestMethod
public function allowsRequestMethod($requestMethod) { return empty($this->requestMethods) || in_array(strtoupper($requestMethod), $this->requestMethods); }
php
public function allowsRequestMethod($requestMethod) { return empty($this->requestMethods) || in_array(strtoupper($requestMethod), $this->requestMethods); }
[ "public", "function", "allowsRequestMethod", "(", "$", "requestMethod", ")", "{", "return", "empty", "(", "$", "this", "->", "requestMethods", ")", "||", "in_array", "(", "strtoupper", "(", "$", "requestMethod", ")", ",", "$", "this", "->", "requestMethods", ...
check whether a request method is allowed with the route @param string $requestMethod @return boolean
[ "check", "whether", "a", "request", "method", "is", "allowed", "with", "the", "route" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Routing/Route.php#L492-L496
train
Vectrex/vxPHP
src/Routing/Route.php
Route.getPathParameter
public function getPathParameter($name, $default = null) { // lazy initialization of parameters if(empty($this->pathParameters) && !is_null($this->placeholders)) { // collect all placeholder names $names = array_keys($this->placeholders); // extract values if(preg_match('~' . $this->match . '~', l...
php
public function getPathParameter($name, $default = null) { // lazy initialization of parameters if(empty($this->pathParameters) && !is_null($this->placeholders)) { // collect all placeholder names $names = array_keys($this->placeholders); // extract values if(preg_match('~' . $this->match . '~', l...
[ "public", "function", "getPathParameter", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "// lazy initialization of parameters", "if", "(", "empty", "(", "$", "this", "->", "pathParameters", ")", "&&", "!", "is_null", "(", "$", "this", "->", ...
get path parameter @param string $name @param string $default @return string
[ "get", "path", "parameter" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Routing/Route.php#L522-L576
train
Vectrex/vxPHP
src/Routing/Route.php
Route.redirect
public function redirect($queryParams = [], $statusCode = 302) { $request = Request::createFromGlobals(); $application = Application::getInstance(); $urlSegments = [ $request->getSchemeAndHttpHost() ]; if($application->getRouter()->getServerSideRewrite()) { if(($scriptName = basename($request->getS...
php
public function redirect($queryParams = [], $statusCode = 302) { $request = Request::createFromGlobals(); $application = Application::getInstance(); $urlSegments = [ $request->getSchemeAndHttpHost() ]; if($application->getRouter()->getServerSideRewrite()) { if(($scriptName = basename($request->getS...
[ "public", "function", "redirect", "(", "$", "queryParams", "=", "[", "]", ",", "$", "statusCode", "=", "302", ")", "{", "$", "request", "=", "Request", "::", "createFromGlobals", "(", ")", ";", "$", "application", "=", "Application", "::", "getInstance", ...
redirect using configured redirect information if route has no redirect set, redirect will lead to "start page" @param array $queryParams @param int $statusCode @return RedirectResponse @throws \vxPHP\Application\Exception\ApplicationException
[ "redirect", "using", "configured", "redirect", "information", "if", "route", "has", "no", "redirect", "set", "redirect", "will", "lead", "to", "start", "page" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Routing/Route.php#L634-L662
train
as3io/As3ModlrBundle
DependencyInjection/Utility.php
Utility.locateResource
public static function locateResource($path, ContainerBuilder $container) { if (0 === stripos($path, '@')) { // Treat as a bundle path, e.g. @SomeBundle/path/to/something. // Correct backslashed paths. $path = str_replace('\\', '/', $path); $parts = explode(...
php
public static function locateResource($path, ContainerBuilder $container) { if (0 === stripos($path, '@')) { // Treat as a bundle path, e.g. @SomeBundle/path/to/something. // Correct backslashed paths. $path = str_replace('\\', '/', $path); $parts = explode(...
[ "public", "static", "function", "locateResource", "(", "$", "path", ",", "ContainerBuilder", "$", "container", ")", "{", "if", "(", "0", "===", "stripos", "(", "$", "path", ",", "'@'", ")", ")", "{", "// Treat as a bundle path, e.g. @SomeBundle/path/to/something."...
Locates a file resource path for a given config path. Is needed in order to retrieve a bundle's directory, if used. @static @param string $path @param ContainerBuilder $container @return string @throws \RuntimeException
[ "Locates", "a", "file", "resource", "path", "for", "a", "given", "config", "path", ".", "Is", "needed", "in", "order", "to", "retrieve", "a", "bundle", "s", "directory", "if", "used", "." ]
7ce2abb7390c7eaf4081c5b7e00b96e7001774a4
https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/Utility.php#L116-L145
train
horntell/php-sdk
lib/guzzle/GuzzleHttp/Exception/RequestException.php
RequestException.emittedError
public function emittedError($value = null) { if ($value === null) { return $this->emittedErrorEvent; } elseif ($value === true) { $this->emittedErrorEvent = true; } else { throw new \InvalidArgumentException('You cannot set the emitted ' ....
php
public function emittedError($value = null) { if ($value === null) { return $this->emittedErrorEvent; } elseif ($value === true) { $this->emittedErrorEvent = true; } else { throw new \InvalidArgumentException('You cannot set the emitted ' ....
[ "public", "function", "emittedError", "(", "$", "value", "=", "null", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "return", "$", "this", "->", "emittedErrorEvent", ";", "}", "elseif", "(", "$", "value", "===", "true", ")", "{", "$", ...
Check or set if the exception was emitted in an error event. This value is used in the RequestEvents::emitBefore() method to check to see if an exception has already been emitted in an error event. @param bool|null Set to true to set the exception as having emitted an error. Leave null to retrieve the current setting...
[ "Check", "or", "set", "if", "the", "exception", "was", "emitted", "in", "an", "error", "event", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Exception/RequestException.php#L116-L126
train
erenmustafaozdal/laravel-modules-base
src/Requests/BaseRequest.php
BaseRequest.addFileRule
protected function addFileRule($attribute, $size, $mimes, $count = 1, $isRequired = false) { if ($this->has($attribute) && is_string($this->$attribute)) { $this->rules[$attribute] = "elfinder_max:{$size}|elfinder:{$mimes}"; } else if ($this->file($attribute) && is_array($this->$attr...
php
protected function addFileRule($attribute, $size, $mimes, $count = 1, $isRequired = false) { if ($this->has($attribute) && is_string($this->$attribute)) { $this->rules[$attribute] = "elfinder_max:{$size}|elfinder:{$mimes}"; } else if ($this->file($attribute) && is_array($this->$attr...
[ "protected", "function", "addFileRule", "(", "$", "attribute", ",", "$", "size", ",", "$", "mimes", ",", "$", "count", "=", "1", ",", "$", "isRequired", "=", "false", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "attribute", ")", "&&", ...
add file rule to rules @param string $attribute @param string $size @param string $mimes @param integer $count @param boolean $isRequired @return void
[ "add", "file", "rule", "to", "rules" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Requests/BaseRequest.php#L58-L93
train
MBHFramework/mbh-rest
Mbh/App.php
App.getSetting
public function getSetting($key, $defaultValue = null) { return $this->hasSetting($key) ? $this->settings[$key] : $defaultValue; }
php
public function getSetting($key, $defaultValue = null) { return $this->hasSetting($key) ? $this->settings[$key] : $defaultValue; }
[ "public", "function", "getSetting", "(", "$", "key", ",", "$", "defaultValue", "=", "null", ")", "{", "return", "$", "this", "->", "hasSetting", "(", "$", "key", ")", "?", "$", "this", "->", "settings", "[", "$", "key", "]", ":", "$", "defaultValue",...
Get app setting with given key @param string $key @param mixed $defaultValue @return mixed
[ "Get", "app", "setting", "with", "given", "key" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L169-L172
train
MBHFramework/mbh-rest
Mbh/App.php
App.get
public function get($pattern, $callback = null, $inject = null) { return $this->map([ 'GET', 'HEAD' ], $pattern, $callback, $inject); }
php
public function get($pattern, $callback = null, $inject = null) { return $this->map([ 'GET', 'HEAD' ], $pattern, $callback, $inject); }
[ "public", "function", "get", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'GET'", ",", "'HEAD'", "]", ",", "$", "pattern", ",", "$", "callback", ...
Adds a new route for the HTTP request method `GET` @param string $route the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @return ...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "GET" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L206-L209
train
MBHFramework/mbh-rest
Mbh/App.php
App.post
public function post($pattern, $callback = null, $inject = null) { return $this->map([ 'POST' ], $pattern, $callback, $inject); }
php
public function post($pattern, $callback = null, $inject = null) { return $this->map([ 'POST' ], $pattern, $callback, $inject); }
[ "public", "function", "post", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'POST'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$", "in...
Adds a new route for the HTTP request method `POST` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @retu...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "POST" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L219-L222
train
MBHFramework/mbh-rest
Mbh/App.php
App.put
public function put($pattern, $callback = null, $inject = null) { return $this->map([ 'PUT' ], $pattern, $callback, $inject); }
php
public function put($pattern, $callback = null, $inject = null) { return $this->map([ 'PUT' ], $pattern, $callback, $inject); }
[ "public", "function", "put", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'PUT'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$", "inje...
Adds a new route for the HTTP request method `PUT` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @retur...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "PUT" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L232-L235
train
MBHFramework/mbh-rest
Mbh/App.php
App.patch
public function patch($pattern, $callback = null, $inject = null) { return $this->map([ 'PATCH' ], $pattern, $callback, $inject); }
php
public function patch($pattern, $callback = null, $inject = null) { return $this->map([ 'PATCH' ], $pattern, $callback, $inject); }
[ "public", "function", "patch", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'PATCH'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$", "...
Adds a new route for the HTTP request method `PATCH` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @ret...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "PATCH" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L245-L248
train
MBHFramework/mbh-rest
Mbh/App.php
App.delete
public function delete($pattern, $callback = null, $inject = null) { return $this->map([ 'DELETE' ], $pattern, $callback, $inject); }
php
public function delete($pattern, $callback = null, $inject = null) { return $this->map([ 'DELETE' ], $pattern, $callback, $inject); }
[ "public", "function", "delete", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'DELETE'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$", ...
Adds a new route for the HTTP request method `DELETE` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @re...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "DELETE" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L258-L261
train
MBHFramework/mbh-rest
Mbh/App.php
App.head
public function head($pattern, $callback = null, $inject = null) { return $this->map([ 'HEAD' ], $pattern, $callback, $inject); }
php
public function head($pattern, $callback = null, $inject = null) { return $this->map([ 'HEAD' ], $pattern, $callback, $inject); }
[ "public", "function", "head", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'HEAD'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$", "in...
Adds a new route for the HTTP request method `HEAD` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @retu...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "HEAD" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L271-L274
train
MBHFramework/mbh-rest
Mbh/App.php
App.trace
public function trace($pattern, $callback = null, $inject = null) { return $this->map([ 'TRACE' ], $pattern, $callback, $inject); }
php
public function trace($pattern, $callback = null, $inject = null) { return $this->map([ 'TRACE' ], $pattern, $callback, $inject); }
[ "public", "function", "trace", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'TRACE'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$", "...
Adds a new route for the HTTP request method `TRACE` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @ret...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "TRACE" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L284-L287
train
MBHFramework/mbh-rest
Mbh/App.php
App.options
public function options($pattern, $callback = null, $inject = null) { return $this->map([ 'OPTIONS' ], $pattern, $callback, $inject); }
php
public function options($pattern, $callback = null, $inject = null) { return $this->map([ 'OPTIONS' ], $pattern, $callback, $inject); }
[ "public", "function", "options", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'OPTIONS'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$",...
Adds a new route for the HTTP request method `OPTIONS` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @r...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "OPTIONS" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L297-L300
train
MBHFramework/mbh-rest
Mbh/App.php
App.connect
public function connect($pattern, $callback = null, $inject = null) { return $this->map([ 'CONNECT' ], $pattern, $callback, $inject); }
php
public function connect($pattern, $callback = null, $inject = null) { return $this->map([ 'CONNECT' ], $pattern, $callback, $inject); }
[ "public", "function", "connect", "(", "$", "pattern", ",", "$", "callback", "=", "null", ",", "$", "inject", "=", "null", ")", "{", "return", "$", "this", "->", "map", "(", "[", "'CONNECT'", "]", ",", "$", "pattern", ",", "$", "callback", ",", "$",...
Adds a new route for the HTTP request method `CONNECT` @param string $pattern the route to match, e.g. `/users/jane` @param callable|null $callback (optional) the callback to execute, e.g. an anonymous function @param array|null $inject (optional) any arguments that should be prepended to those matched in the route @r...
[ "Adds", "a", "new", "route", "for", "the", "HTTP", "request", "method", "CONNECT" ]
e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83
https://github.com/MBHFramework/mbh-rest/blob/e23b4e66dc2b8da35e06312dcfdba41c4cfc2c83/Mbh/App.php#L310-L313
train
Vectrex/vxPHP
src/Controller/Controller.php
Controller.createControllerFromRoute
public static function createControllerFromRoute(Route $route, array $parameters = null) { $controllerClass = Application::getInstance()->getApplicationNamespace() . $route->getControllerClassName(); /** * @var Controller */ $instance = new $controllerClass($route, $parameters); if($method = $instan...
php
public static function createControllerFromRoute(Route $route, array $parameters = null) { $controllerClass = Application::getInstance()->getApplicationNamespace() . $route->getControllerClassName(); /** * @var Controller */ $instance = new $controllerClass($route, $parameters); if($method = $instan...
[ "public", "static", "function", "createControllerFromRoute", "(", "Route", "$", "route", ",", "array", "$", "parameters", "=", "null", ")", "{", "$", "controllerClass", "=", "Application", "::", "getInstance", "(", ")", "->", "getApplicationNamespace", "(", ")",...
determines controller class name from a routes controllerString property and returns a controller instance an additional parameters array will be passed on to the constructor @param Route $route @param array $parameters @return \vxPHP\Controller\Controller @throws \vxPHP\Application\Exception\ApplicationException
[ "determines", "controller", "class", "name", "from", "a", "routes", "controllerString", "property", "and", "returns", "a", "controller", "instance", "an", "additional", "parameters", "array", "will", "be", "passed", "on", "to", "the", "constructor" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Controller/Controller.php#L190-L208
train
Vectrex/vxPHP
src/Controller/Controller.php
Controller.addEchoToJsonResponse
protected function addEchoToJsonResponse(JsonResponse $r) { // handle JSON encoded request data if($this->isXhr && $this->xhrBag && $this->xhrBag->get('echo') == 1) { // echo is the original xmlHttpRequest sans echo property $echo = json_decode($this->xhrBag->get('xmlHttpRequest')); unset($echo->echo...
php
protected function addEchoToJsonResponse(JsonResponse $r) { // handle JSON encoded request data if($this->isXhr && $this->xhrBag && $this->xhrBag->get('echo') == 1) { // echo is the original xmlHttpRequest sans echo property $echo = json_decode($this->xhrBag->get('xmlHttpRequest')); unset($echo->echo...
[ "protected", "function", "addEchoToJsonResponse", "(", "JsonResponse", "$", "r", ")", "{", "// handle JSON encoded request data", "if", "(", "$", "this", "->", "isXhr", "&&", "$", "this", "->", "xhrBag", "&&", "$", "this", "->", "xhrBag", "->", "get", "(", "...
add an echo property to a JsonResponse, if request indicates that echo was requested useful with vxJS.xhr based widgets @param JsonResponse $r @return JsonResponse @throws \Exception
[ "add", "an", "echo", "property", "to", "a", "JsonResponse", "if", "request", "indicates", "that", "echo", "was", "requested", "useful", "with", "vxJS", ".", "xhr", "based", "widgets" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Controller/Controller.php#L264-L302
train
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Domain/Action/Dal/DalActionTrait.php
DalActionTrait.assertEntityIsValid
protected function assertEntityIsValid($entity, $scope = null) { if (!$this->validator) { throw new \BadMethodCallException(sprintf( 'Method %s() cannot be used while validator is not configured.', __METHOD__ )); } $scopes = $scope ? (...
php
protected function assertEntityIsValid($entity, $scope = null) { if (!$this->validator) { throw new \BadMethodCallException(sprintf( 'Method %s() cannot be used while validator is not configured.', __METHOD__ )); } $scopes = $scope ? (...
[ "protected", "function", "assertEntityIsValid", "(", "$", "entity", ",", "$", "scope", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "validator", ")", "{", "throw", "new", "\\", "BadMethodCallException", "(", "sprintf", "(", "'Method %s() cannot ...
assert given entity is valid on given scope. @param object $entity @param string|array $scope @throws ValidationException If given object is invalid on given scope
[ "assert", "given", "entity", "is", "valid", "on", "given", "scope", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Domain/Action/Dal/DalActionTrait.php#L55-L77
train
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Domain/Action/Dal/DalActionTrait.php
DalActionTrait.fireEvent
protected function fireEvent($eventName, Event $event) { if (!$this->eventDispatcher) { throw new \BadMethodCallException(sprintf( 'Method %s() cannot be used while event dispatcher is not configured.', __METHOD__ )); } $this->eventDis...
php
protected function fireEvent($eventName, Event $event) { if (!$this->eventDispatcher) { throw new \BadMethodCallException(sprintf( 'Method %s() cannot be used while event dispatcher is not configured.', __METHOD__ )); } $this->eventDis...
[ "protected", "function", "fireEvent", "(", "$", "eventName", ",", "Event", "$", "event", ")", "{", "if", "(", "!", "$", "this", "->", "eventDispatcher", ")", "{", "throw", "new", "\\", "BadMethodCallException", "(", "sprintf", "(", "'Method %s() cannot be used...
fire given event. @param string $eventName @param Event $event @throws \BadMethodCallException If any event dispatcher set
[ "fire", "given", "event", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Domain/Action/Dal/DalActionTrait.php#L87-L97
train
pipaslot/forms
src/Forms/Rendering/Bootstrap3StackRenderer.php
Bootstrap3StackRenderer.prepareForm
protected function prepareForm(Form $form) { $form->getElementPrototype()->class[] = 'form-horizontal'; $translator = $form->getTranslator(); foreach ($form->controls as $control) { /** @var BaseControl $control */ if ($control instanceof HiddenField) { continue; } elseif ($control instanceof Button...
php
protected function prepareForm(Form $form) { $form->getElementPrototype()->class[] = 'form-horizontal'; $translator = $form->getTranslator(); foreach ($form->controls as $control) { /** @var BaseControl $control */ if ($control instanceof HiddenField) { continue; } elseif ($control instanceof Button...
[ "protected", "function", "prepareForm", "(", "Form", "$", "form", ")", "{", "$", "form", "->", "getElementPrototype", "(", ")", "->", "class", "[", "]", "=", "'form-horizontal'", ";", "$", "translator", "=", "$", "form", "->", "getTranslator", "(", ")", ...
Make form and controls compatible with Twitter Bootstrap @param Form $form
[ "Make", "form", "and", "controls", "compatible", "with", "Twitter", "Bootstrap" ]
9e1d48db512f843270fd4079ed3ff1b1729c951b
https://github.com/pipaslot/forms/blob/9e1d48db512f843270fd4079ed3ff1b1729c951b/src/Forms/Rendering/Bootstrap3StackRenderer.php#L37-L58
train
clacy-builders/graphics-php
src/Points.php
Points.rectangle
public static function rectangle(Point $corner, $width, $height, $ccw = false) { $points = new Points($corner); $points->addPoint($corner); $points->addPoint($corner)->translateX($width); $points->addPoint($corner)->translate($width, $height); $points->addPoint($corner)->translateY($height); $points->rever...
php
public static function rectangle(Point $corner, $width, $height, $ccw = false) { $points = new Points($corner); $points->addPoint($corner); $points->addPoint($corner)->translateX($width); $points->addPoint($corner)->translate($width, $height); $points->addPoint($corner)->translateY($height); $points->rever...
[ "public", "static", "function", "rectangle", "(", "Point", "$", "corner", ",", "$", "width", ",", "$", "height", ",", "$", "ccw", "=", "false", ")", "{", "$", "points", "=", "new", "Points", "(", "$", "corner", ")", ";", "$", "points", "->", "addPo...
Calculates the points for a rectangle. @param Point $corner The top left corner. @param float $width @param float $height @param boolean $ccw Whether to list the points counterclockwise or not.
[ "Calculates", "the", "points", "for", "a", "rectangle", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L52-L61
train
clacy-builders/graphics-php
src/Points.php
Points.polygon
public static function polygon(Point $center, $n, $radius, $ccw = false) { return self::star($center, $n, $radius, [], $ccw); }
php
public static function polygon(Point $center, $n, $radius, $ccw = false) { return self::star($center, $n, $radius, [], $ccw); }
[ "public", "static", "function", "polygon", "(", "Point", "$", "center", ",", "$", "n", ",", "$", "radius", ",", "$", "ccw", "=", "false", ")", "{", "return", "self", "::", "star", "(", "$", "center", ",", "$", "n", ",", "$", "radius", ",", "[", ...
Calculates the points for a regular polygon. @param Point $center @param int $n Number of corners. @param float $radius @param boolean $ccw Whether to list the points counterclockwise or not.
[ "Calculates", "the", "points", "for", "a", "regular", "polygon", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L71-L74
train
clacy-builders/graphics-php
src/Points.php
Points.star
public static function star(Point $center, $n, $radius, $starRadii = [], $ccw = false) { $points = new Points($center); if (!is_array($starRadii)) { $starRadii = [$starRadii]; } $radii = array_merge([$radius], $starRadii); $count = count($radii); $delta = deg2rad(360) / $n / $count; $angle = Angle::cr...
php
public static function star(Point $center, $n, $radius, $starRadii = [], $ccw = false) { $points = new Points($center); if (!is_array($starRadii)) { $starRadii = [$starRadii]; } $radii = array_merge([$radius], $starRadii); $count = count($radii); $delta = deg2rad(360) / $n / $count; $angle = Angle::cr...
[ "public", "static", "function", "star", "(", "Point", "$", "center", ",", "$", "n", ",", "$", "radius", ",", "$", "starRadii", "=", "[", "]", ",", "$", "ccw", "=", "false", ")", "{", "$", "points", "=", "new", "Points", "(", "$", "center", ")", ...
Calculates the Points for a regular star polygon. @param Point $center @param int $n Number of corners of the underlying polygon. @param float $radius @param float|float[] $starRadii @param boolean $ccw Whether to list the points counterclockwise or not.
[ "Calculates", "the", "Points", "for", "a", "regular", "star", "polygon", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L85-L103
train
clacy-builders/graphics-php
src/Points.php
Points.sector
public static function sector(Point $center, Angle $start, Angle $stop, $radius, $ccw = false) { $points = new Points($center); $points->addPoint($center); $points->addPoint($center)->translateX($radius)->rotate($center, $start); $points->addPoint($center)->translateX($radius)->rotate($center, $stop); $point...
php
public static function sector(Point $center, Angle $start, Angle $stop, $radius, $ccw = false) { $points = new Points($center); $points->addPoint($center); $points->addPoint($center)->translateX($radius)->rotate($center, $start); $points->addPoint($center)->translateX($radius)->rotate($center, $stop); $point...
[ "public", "static", "function", "sector", "(", "Point", "$", "center", ",", "Angle", "$", "start", ",", "Angle", "$", "stop", ",", "$", "radius", ",", "$", "ccw", "=", "false", ")", "{", "$", "points", "=", "new", "Points", "(", "$", "center", ")",...
Calculates the points for a sector of a circle. @param Point $center @param Angle $start @param Angle $stop Must be greater than <code>$start</code>. @param float $radius @param boolean $ccw Whether to list the points counterclockwise or not.
[ "Calculates", "the", "points", "for", "a", "sector", "of", "a", "circle", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L129-L137
train
clacy-builders/graphics-php
src/Points.php
Points.ringSector
public static function ringSector(Point $center, Angle $start, Angle $stop, $radius, $innerRadius, $ccw = false) { $points = new Points($center, false); if ($ccw) { $swap = $start; $start = $stop; $stop = $swap; } $points->addPoint($center)->translateX($radius)->rotate($center, $start); $points->addPoint($c...
php
public static function ringSector(Point $center, Angle $start, Angle $stop, $radius, $innerRadius, $ccw = false) { $points = new Points($center, false); if ($ccw) { $swap = $start; $start = $stop; $stop = $swap; } $points->addPoint($center)->translateX($radius)->rotate($center, $start); $points->addPoint($c...
[ "public", "static", "function", "ringSector", "(", "Point", "$", "center", ",", "Angle", "$", "start", ",", "Angle", "$", "stop", ",", "$", "radius", ",", "$", "innerRadius", ",", "$", "ccw", "=", "false", ")", "{", "$", "points", "=", "new", "Points...
Calculates the points for a sector of a ring. @param Point $center @param Angle $start @param Angle $stop Must be greater than <code>$start</code>. @param float $radius @param float $innerRadius @param boolean $ccw Whether to list the points counterclockwise or not.
[ "Calculates", "the", "points", "for", "a", "sector", "of", "a", "ring", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L149-L159
train
clacy-builders/graphics-php
src/Points.php
Points.roundedRectangle
public static function roundedRectangle(Point $corner, $width, $height, $radius, $ccw = false) { $points = new Points($corner, false); $points->addPoint($corner)->translateX($width - $radius); $points->addPoint($corner)->translate($width, $radius); $points->addPoint($corner)->translate($width, $height - $radiu...
php
public static function roundedRectangle(Point $corner, $width, $height, $radius, $ccw = false) { $points = new Points($corner, false); $points->addPoint($corner)->translateX($width - $radius); $points->addPoint($corner)->translate($width, $radius); $points->addPoint($corner)->translate($width, $height - $radiu...
[ "public", "static", "function", "roundedRectangle", "(", "Point", "$", "corner", ",", "$", "width", ",", "$", "height", ",", "$", "radius", ",", "$", "ccw", "=", "false", ")", "{", "$", "points", "=", "new", "Points", "(", "$", "corner", ",", "false"...
Calculates the points for a rounded rectangle. @param Point $corner The top left corner. @param float $width @param float $height @param float $radius @param boolean $ccw Whether to list the points counterclockwise or not.
[ "Calculates", "the", "points", "for", "a", "rounded", "rectangle", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L170-L183
train
clacy-builders/graphics-php
src/Points.php
Points.scale
public function scale(Point $center, $factor) { foreach ($this->points as $point) { $point->scale($center, $factor); } $this->start->scale($center, $factor); return $this; }
php
public function scale(Point $center, $factor) { foreach ($this->points as $point) { $point->scale($center, $factor); } $this->start->scale($center, $factor); return $this; }
[ "public", "function", "scale", "(", "Point", "$", "center", ",", "$", "factor", ")", "{", "foreach", "(", "$", "this", "->", "points", "as", "$", "point", ")", "{", "$", "point", "->", "scale", "(", "$", "center", ",", "$", "factor", ")", ";", "}...
Scales points. @param Point $center @param float $factor
[ "Scales", "points", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L206-L213
train
clacy-builders/graphics-php
src/Points.php
Points.scaleX
public function scaleX(Point $center, $factor) { foreach ($this->points as $point) { $point->scaleX($center, $factor); } $this->start->scaleX($center, $factor); $this->reverseIfCcw($factor < 0); return $this; }
php
public function scaleX(Point $center, $factor) { foreach ($this->points as $point) { $point->scaleX($center, $factor); } $this->start->scaleX($center, $factor); $this->reverseIfCcw($factor < 0); return $this; }
[ "public", "function", "scaleX", "(", "Point", "$", "center", ",", "$", "factor", ")", "{", "foreach", "(", "$", "this", "->", "points", "as", "$", "point", ")", "{", "$", "point", "->", "scaleX", "(", "$", "center", ",", "$", "factor", ")", ";", ...
Scales points along the X-axis. @param Point $center @param float $factor
[ "Scales", "points", "along", "the", "X", "-", "axis", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L221-L229
train
clacy-builders/graphics-php
src/Points.php
Points.translate
public function translate($deltaX, $deltaY) { foreach ($this->points as $point) { $point->translate($deltaX, $deltaY); } $this->start->translate($deltaX, $deltaY); return $this; }
php
public function translate($deltaX, $deltaY) { foreach ($this->points as $point) { $point->translate($deltaX, $deltaY); } $this->start->translate($deltaX, $deltaY); return $this; }
[ "public", "function", "translate", "(", "$", "deltaX", ",", "$", "deltaY", ")", "{", "foreach", "(", "$", "this", "->", "points", "as", "$", "point", ")", "{", "$", "point", "->", "translate", "(", "$", "deltaX", ",", "$", "deltaY", ")", ";", "}", ...
Translates points. @param float $deltaX @param float $deltaY
[ "Translates", "points", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L283-L290
train
clacy-builders/graphics-php
src/Points.php
Points.translateX
public function translateX($deltaX) { foreach ($this->points as $point) { $point->translateX($deltaX); } $this->start->translateX($deltaX); return $this; }
php
public function translateX($deltaX) { foreach ($this->points as $point) { $point->translateX($deltaX); } $this->start->translateX($deltaX); return $this; }
[ "public", "function", "translateX", "(", "$", "deltaX", ")", "{", "foreach", "(", "$", "this", "->", "points", "as", "$", "point", ")", "{", "$", "point", "->", "translateX", "(", "$", "deltaX", ")", ";", "}", "$", "this", "->", "start", "->", "tra...
Translates points along the X-axis. @param float $deltaX @param float $deltaY
[ "Translates", "points", "along", "the", "X", "-", "axis", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L298-L305
train
clacy-builders/graphics-php
src/Points.php
Points.translateY
public function translateY($deltaY) { foreach ($this->points as $point) { $point->translateY($deltaY); } $this->start->translateY($deltaY); return $this; }
php
public function translateY($deltaY) { foreach ($this->points as $point) { $point->translateY($deltaY); } $this->start->translateY($deltaY); return $this; }
[ "public", "function", "translateY", "(", "$", "deltaY", ")", "{", "foreach", "(", "$", "this", "->", "points", "as", "$", "point", ")", "{", "$", "point", "->", "translateY", "(", "$", "deltaY", ")", ";", "}", "$", "this", "->", "start", "->", "tra...
Translates points along the Y-axis. @param float $deltaX @param float $deltaY
[ "Translates", "points", "along", "the", "Y", "-", "axis", "." ]
c56556c9265ea4537efdc14ae89a8f36454812d9
https://github.com/clacy-builders/graphics-php/blob/c56556c9265ea4537efdc14ae89a8f36454812d9/src/Points.php#L313-L320
train
Wedeto/Log
src/Logger.php
Logger.getLogger
public static function getLogger($module = "") { if (is_object($module)) $module = get_class($module); elseif (empty($module) || strtoupper($module) === "ROOT") $module = ""; $module = trim(str_replace('\\', '.', $module), ". \\"); if (!isset(self::$module_lo...
php
public static function getLogger($module = "") { if (is_object($module)) $module = get_class($module); elseif (empty($module) || strtoupper($module) === "ROOT") $module = ""; $module = trim(str_replace('\\', '.', $module), ". \\"); if (!isset(self::$module_lo...
[ "public", "static", "function", "getLogger", "(", "$", "module", "=", "\"\"", ")", "{", "if", "(", "is_object", "(", "$", "module", ")", ")", "$", "module", "=", "get_class", "(", "$", "module", ")", ";", "elseif", "(", "empty", "(", "$", "module", ...
Get a logger for a specific module. @param mixed $module A string indicating the module, or a class name or object that will be used to find the appropriate name. @return Logger The instance for the specified module
[ "Get", "a", "logger", "for", "a", "specific", "module", "." ]
88252c5052089fdcc5dae466d1ad5889bb2b735f
https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Logger.php#L100-L112
train
Wedeto/Log
src/Logger.php
Logger.resetGlobalState
public static function resetGlobalState() { foreach (self::$module_loggers as $logger) $logger->removeLogWriters(); self::$module_loggers = []; self::$accept_mode = self::MODE_ACCEPT_MOST_SPECIFIC; }
php
public static function resetGlobalState() { foreach (self::$module_loggers as $logger) $logger->removeLogWriters(); self::$module_loggers = []; self::$accept_mode = self::MODE_ACCEPT_MOST_SPECIFIC; }
[ "public", "static", "function", "resetGlobalState", "(", ")", "{", "foreach", "(", "self", "::", "$", "module_loggers", "as", "$", "logger", ")", "$", "logger", "->", "removeLogWriters", "(", ")", ";", "self", "::", "$", "module_loggers", "=", "[", "]", ...
This method will reset all global state in the Logger object. It will remove all writers from all loggers and then remove all loggers. Note that this will not remove existing logger instances from other objects - this is why the writers are removed.
[ "This", "method", "will", "reset", "all", "global", "state", "in", "the", "Logger", "object", ".", "It", "will", "remove", "all", "writers", "from", "all", "loggers", "and", "then", "remove", "all", "loggers", ".", "Note", "that", "this", "will", "not", ...
88252c5052089fdcc5dae466d1ad5889bb2b735f
https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Logger.php#L120-L126
train
Wedeto/Log
src/Logger.php
Logger.setLevel
public function setLevel(string $level) { if (!defined(LogLevel::class . '::' . strtoupper($level))) throw new \DomainException("Invalid log level: $level"); $this->level = $level; $this->level_num = self::$LEVEL_NUMERIC[$level]; return $this; }
php
public function setLevel(string $level) { if (!defined(LogLevel::class . '::' . strtoupper($level))) throw new \DomainException("Invalid log level: $level"); $this->level = $level; $this->level_num = self::$LEVEL_NUMERIC[$level]; return $this; }
[ "public", "function", "setLevel", "(", "string", "$", "level", ")", "{", "if", "(", "!", "defined", "(", "LogLevel", "::", "class", ".", "'::'", ".", "strtoupper", "(", "$", "level", ")", ")", ")", "throw", "new", "\\", "DomainException", "(", "\"Inval...
Set the log level for this module. Any log messages with a severity lower than this threshold will not bubble up. @param string $level The minimum log level of messages to handle
[ "Set", "the", "log", "level", "for", "this", "module", ".", "Any", "log", "messages", "with", "a", "severity", "lower", "than", "this", "threshold", "will", "not", "bubble", "up", "." ]
88252c5052089fdcc5dae466d1ad5889bb2b735f
https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Logger.php#L203-L211
train
Wedeto/Log
src/Logger.php
Logger.fillPlaceholders
public static function fillPlaceholders(string $message, array $context) { $message = (string)$message; foreach ($context as $key => $value) { $placeholder = '{' . $key . '}'; $strval = null; $pos = 0; while (($pos = strpos($message, $placehold...
php
public static function fillPlaceholders(string $message, array $context) { $message = (string)$message; foreach ($context as $key => $value) { $placeholder = '{' . $key . '}'; $strval = null; $pos = 0; while (($pos = strpos($message, $placehold...
[ "public", "static", "function", "fillPlaceholders", "(", "string", "$", "message", ",", "array", "$", "context", ")", "{", "$", "message", "=", "(", "string", ")", "$", "message", ";", "foreach", "(", "$", "context", "as", "$", "key", "=>", "$", "value...
Fill the place holders in the message with values from the context array @param string $message The message to format. Any {var} placeholders will be replaced with a value from the context array. @param array $context Contains the values to replace the placeholders with. @return string The message with placeholders rep...
[ "Fill", "the", "place", "holders", "in", "the", "message", "with", "values", "from", "the", "context", "array" ]
88252c5052089fdcc5dae466d1ad5889bb2b735f
https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Logger.php#L347-L366
train
Wedeto/Log
src/Logger.php
Logger.getLevelNumeric
public static function getLevelNumeric(string $level) { return isset(self::$LEVEL_NUMERIC[$level]) ? self::$LEVEL_NUMERIC[$level] : 0; }
php
public static function getLevelNumeric(string $level) { return isset(self::$LEVEL_NUMERIC[$level]) ? self::$LEVEL_NUMERIC[$level] : 0; }
[ "public", "static", "function", "getLevelNumeric", "(", "string", "$", "level", ")", "{", "return", "isset", "(", "self", "::", "$", "LEVEL_NUMERIC", "[", "$", "level", "]", ")", "?", "self", "::", "$", "LEVEL_NUMERIC", "[", "$", "level", "]", ":", "0"...
Get the severity number for a specific LogLevel. @param string $level The LogLevel to convert to a number @return int The severity - 0 is less important, 7 is most important.
[ "Get", "the", "severity", "number", "for", "a", "specific", "LogLevel", "." ]
88252c5052089fdcc5dae466d1ad5889bb2b735f
https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/Logger.php#L373-L376
train
squareproton/Bond
src/Bond/Pg/ConnectionFactory.php
ConnectionFactory.get
public function get( $connection, $cache = true ) { if( !is_string( $connection ) ) { throw new BadTypeException( $connection, 'string' ); } // use the multiton if( !isset( $this->instances[$connection] ) or !$cache ) { if( !isset( $this->connectionSettings...
php
public function get( $connection, $cache = true ) { if( !is_string( $connection ) ) { throw new BadTypeException( $connection, 'string' ); } // use the multiton if( !isset( $this->instances[$connection] ) or !$cache ) { if( !isset( $this->connectionSettings...
[ "public", "function", "get", "(", "$", "connection", ",", "$", "cache", "=", "true", ")", "{", "if", "(", "!", "is_string", "(", "$", "connection", ")", ")", "{", "throw", "new", "BadTypeException", "(", "$", "connection", ",", "'string'", ")", ";", ...
Get the singleton pg connection @param string $connection @param boolean $cache @return \Bond\Pg
[ "Get", "the", "singleton", "pg", "connection" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/ConnectionFactory.php#L56-L82
train
squareproton/Bond
src/Bond/Pg/ConnectionFactory.php
ConnectionFactory.remove
public function remove( Resource $resource ) { $cnt = 0; if( false !== $key = array_search( $resource, $this->instances, true ) ) { unset( $this->instances[$key] ); $cnt++; } return $cnt; }
php
public function remove( Resource $resource ) { $cnt = 0; if( false !== $key = array_search( $resource, $this->instances, true ) ) { unset( $this->instances[$key] ); $cnt++; } return $cnt; }
[ "public", "function", "remove", "(", "Resource", "$", "resource", ")", "{", "$", "cnt", "=", "0", ";", "if", "(", "false", "!==", "$", "key", "=", "array_search", "(", "$", "resource", ",", "$", "this", "->", "instances", ",", "true", ")", ")", "{"...
Remove a resource from the multiton cache @param Bond\Pg\Resource @return int
[ "Remove", "a", "resource", "from", "the", "multiton", "cache" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/ConnectionFactory.php#L89-L97
train
mrbase/Smesg
src/Smesg/Provider/InMobileProvider.php
InMobileProvider.sendOne
protected function sendOne($dry_run) { $message = $this->messages[0]; $adapter = $this->getAdapter(); $adapter->setEndpoint(self::SINGLE_ENDPOINT); $adapter->setParameters(array( 'user' => $this->config['user'], 'password' => $this->config['password'], ...
php
protected function sendOne($dry_run) { $message = $this->messages[0]; $adapter = $this->getAdapter(); $adapter->setEndpoint(self::SINGLE_ENDPOINT); $adapter->setParameters(array( 'user' => $this->config['user'], 'password' => $this->config['password'], ...
[ "protected", "function", "sendOne", "(", "$", "dry_run", ")", "{", "$", "message", "=", "$", "this", "->", "messages", "[", "0", "]", ";", "$", "adapter", "=", "$", "this", "->", "getAdapter", "(", ")", ";", "$", "adapter", "->", "setEndpoint", "(", ...
We use smspush for sending single messages. @return string $response;
[ "We", "use", "smspush", "for", "sending", "single", "messages", "." ]
e9692ed5915f5a9cd4dca0df875935a2c528e128
https://github.com/mrbase/Smesg/blob/e9692ed5915f5a9cd4dca0df875935a2c528e128/src/Smesg/Provider/InMobileProvider.php#L188-L210
train
duncan3dc/php-ini
src/Ini.php
Ini.restore
public function restore(string $key): self { if (array_key_exists($key, $this->original)) { ini_set($key, $this->original[$key]); } return $this; }
php
public function restore(string $key): self { if (array_key_exists($key, $this->original)) { ini_set($key, $this->original[$key]); } return $this; }
[ "public", "function", "restore", "(", "string", "$", "key", ")", ":", "self", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "original", ")", ")", "{", "ini_set", "(", "$", "key", ",", "$", "this", "->", "original", "[...
Restore a previous ini setting. @return $this
[ "Restore", "a", "previous", "ini", "setting", "." ]
e07435d7ddbbc466e535783e5c4d2b92e3715c7a
https://github.com/duncan3dc/php-ini/blob/e07435d7ddbbc466e535783e5c4d2b92e3715c7a/src/Ini.php#L53-L60
train
duncan3dc/php-ini
src/Ini.php
Ini.cleanup
public function cleanup(): self { foreach ($this->original as $key => $value) { ini_set($key, $value); } $this->original = []; return $this; }
php
public function cleanup(): self { foreach ($this->original as $key => $value) { ini_set($key, $value); } $this->original = []; return $this; }
[ "public", "function", "cleanup", "(", ")", ":", "self", "{", "foreach", "(", "$", "this", "->", "original", "as", "$", "key", "=>", "$", "value", ")", "{", "ini_set", "(", "$", "key", ",", "$", "value", ")", ";", "}", "$", "this", "->", "original...
Restore the previous ini settings. @return $this
[ "Restore", "the", "previous", "ini", "settings", "." ]
e07435d7ddbbc466e535783e5c4d2b92e3715c7a
https://github.com/duncan3dc/php-ini/blob/e07435d7ddbbc466e535783e5c4d2b92e3715c7a/src/Ini.php#L68-L77
train
zarathustra323/modlr-data
src/Zarathustra/ModlrData/DataTypes/TypeFactory.php
TypeFactory.getType
public function getType($name) { if (false === $this->hasType($name)) { throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name)); } if (isset($this->loaded[$name])) { return $this->loaded[$name]; } $fqcn = $this->types[$name];...
php
public function getType($name) { if (false === $this->hasType($name)) { throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name)); } if (isset($this->loaded[$name])) { return $this->loaded[$name]; } $fqcn = $this->types[$name];...
[ "public", "function", "getType", "(", "$", "name", ")", "{", "if", "(", "false", "===", "$", "this", "->", "hasType", "(", "$", "name", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'The type \"%s\" was not found.'", ",", ...
Gets a type object. @param string $name @return DataTypes\Types\Type @throws InvalidArgumentException If the type wasn't found.
[ "Gets", "a", "type", "object", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/DataTypes/TypeFactory.php#L84-L100
train
zarathustra323/modlr-data
src/Zarathustra/ModlrData/DataTypes/TypeFactory.php
TypeFactory.addType
public function addType($name, $fqcn) { if (true === $this->hasType($name)) { throw new InvalidArgumentException(sprintf('The type "%s" already exists.', $name)); } return $this->setType($name, $fqcn); }
php
public function addType($name, $fqcn) { if (true === $this->hasType($name)) { throw new InvalidArgumentException(sprintf('The type "%s" already exists.', $name)); } return $this->setType($name, $fqcn); }
[ "public", "function", "addType", "(", "$", "name", ",", "$", "fqcn", ")", "{", "if", "(", "true", "===", "$", "this", "->", "hasType", "(", "$", "name", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'The type \"%s\" alr...
Adds a type object. @param string $name @param string $fqcn @return self @throws InvalidArgumentException If the type already exists.
[ "Adds", "a", "type", "object", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/DataTypes/TypeFactory.php#L110-L116
train
zarathustra323/modlr-data
src/Zarathustra/ModlrData/DataTypes/TypeFactory.php
TypeFactory.overrideType
public function overrideType($name, $fqcn) { if (false === $this->hasType($name)) { throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name)); } return $this->setType($name, $fqcn); }
php
public function overrideType($name, $fqcn) { if (false === $this->hasType($name)) { throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name)); } return $this->setType($name, $fqcn); }
[ "public", "function", "overrideType", "(", "$", "name", ",", "$", "fqcn", ")", "{", "if", "(", "false", "===", "$", "this", "->", "hasType", "(", "$", "name", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'The type \"%s...
Overrides a type object with new class. @param string $name @param string $fqcn @return self @throws InvalidArgumentException If the type was not found.
[ "Overrides", "a", "type", "object", "with", "new", "class", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/DataTypes/TypeFactory.php#L126-L132
train
bkstg/schedule-bundle
Timeline/EventSubscriber/EventLinkSubscriber.php
EventLinkSubscriber.setInvitedLink
public function setInvitedLink(TimelineLinkEvent $event): void { $action = $event->getAction(); if ('invited' != $action->getVerb()) { return; } $event = $action->getComponent('indirectComplement')->getData(); $event->setLink($this->url_generator->generate('bkst...
php
public function setInvitedLink(TimelineLinkEvent $event): void { $action = $event->getAction(); if ('invited' != $action->getVerb()) { return; } $event = $action->getComponent('indirectComplement')->getData(); $event->setLink($this->url_generator->generate('bkst...
[ "public", "function", "setInvitedLink", "(", "TimelineLinkEvent", "$", "event", ")", ":", "void", "{", "$", "action", "=", "$", "event", "->", "getAction", "(", ")", ";", "if", "(", "'invited'", "!=", "$", "action", "->", "getVerb", "(", ")", ")", "{",...
Set the link for invited actions. @param TimelineLinkEvent $event The timeline action event. @return void
[ "Set", "the", "link", "for", "invited", "actions", "." ]
e64ac897aa7b28bc48319470d65de13cd4788afe
https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Timeline/EventSubscriber/EventLinkSubscriber.php#L54-L67
train
bkstg/schedule-bundle
Timeline/EventSubscriber/EventLinkSubscriber.php
EventLinkSubscriber.setScheduledLink
public function setScheduledLink(TimelineLinkEvent $event): void { $action = $event->getAction(); if ('scheduled' != $action->getVerb()) { return; } $production = $action->getComponent('indirectComplement')->getData(); $schedule = $action->getComponent('directCo...
php
public function setScheduledLink(TimelineLinkEvent $event): void { $action = $event->getAction(); if ('scheduled' != $action->getVerb()) { return; } $production = $action->getComponent('indirectComplement')->getData(); $schedule = $action->getComponent('directCo...
[ "public", "function", "setScheduledLink", "(", "TimelineLinkEvent", "$", "event", ")", ":", "void", "{", "$", "action", "=", "$", "event", "->", "getAction", "(", ")", ";", "if", "(", "'scheduled'", "!=", "$", "action", "->", "getVerb", "(", ")", ")", ...
Set the link for scheduled actions. @param TimelineLinkEvent $event The timeline action event. @return void
[ "Set", "the", "link", "for", "scheduled", "actions", "." ]
e64ac897aa7b28bc48319470d65de13cd4788afe
https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Timeline/EventSubscriber/EventLinkSubscriber.php#L76-L90
train
NukaCode/Front-End-Bootstrap
src/NukaCode/Bootstrap/Filesystem/Config/Theme.php
Theme.updateEntry
public function updateEntry($package, $theme) { $this->verifyCommand($package); $lines = file($this->config); $config = $this->compactConfig($package); $lines = $this->updateConfigDetails($theme, $lines, $config); $this->file->delete($this->config); $this->file->p...
php
public function updateEntry($package, $theme) { $this->verifyCommand($package); $lines = file($this->config); $config = $this->compactConfig($package); $lines = $this->updateConfigDetails($theme, $lines, $config); $this->file->delete($this->config); $this->file->p...
[ "public", "function", "updateEntry", "(", "$", "package", ",", "$", "theme", ")", "{", "$", "this", "->", "verifyCommand", "(", "$", "package", ")", ";", "$", "lines", "=", "file", "(", "$", "this", "->", "config", ")", ";", "$", "config", "=", "$"...
Update the config with the color values for easy retrieval @param $package @param $theme
[ "Update", "the", "config", "with", "the", "color", "values", "for", "easy", "retrieval" ]
46c30fba4c77afb74ec4a4d70c43c9cffd464d6e
https://github.com/NukaCode/Front-End-Bootstrap/blob/46c30fba4c77afb74ec4a4d70c43c9cffd464d6e/src/NukaCode/Bootstrap/Filesystem/Config/Theme.php#L85-L96
train
agentmedia/phine-core
src/Core/Logic/Tree/PageTreeProvider.php
PageTreeProvider.TopMost
public function TopMost() { $sql = Access::SqlBuilder(); $tbl = Page::Schema()->Table(); $where = $sql->Equals($tbl->Field('Site'), $sql->Value($this->site->GetID())) ->And_($sql->IsNull($tbl->Field('Parent'))) ->And_($sql->IsNull($tbl->Field('Previous'))); ...
php
public function TopMost() { $sql = Access::SqlBuilder(); $tbl = Page::Schema()->Table(); $where = $sql->Equals($tbl->Field('Site'), $sql->Value($this->site->GetID())) ->And_($sql->IsNull($tbl->Field('Parent'))) ->And_($sql->IsNull($tbl->Field('Previous'))); ...
[ "public", "function", "TopMost", "(", ")", "{", "$", "sql", "=", "Access", "::", "SqlBuilder", "(", ")", ";", "$", "tbl", "=", "Page", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "where", "=", "$", "sql", "->", "Equals", "(", "...
Gets the first and root page of the site @return Page
[ "Gets", "the", "first", "and", "root", "page", "of", "the", "site" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Tree/PageTreeProvider.php#L31-L40
train
johnnymast/mailreader
src/MailReader/MailReader.php
MailReader.connect
public function connect($credentials = []) { if ($diff = array_diff(array_keys($this->settings), array_keys($credentials))) { throw new \Exception("Missing credentials, the following fields are missing ".implode('/', $diff)); } $this->settings = array_merge($this->settings, $cre...
php
public function connect($credentials = []) { if ($diff = array_diff(array_keys($this->settings), array_keys($credentials))) { throw new \Exception("Missing credentials, the following fields are missing ".implode('/', $diff)); } $this->settings = array_merge($this->settings, $cre...
[ "public", "function", "connect", "(", "$", "credentials", "=", "[", "]", ")", "{", "if", "(", "$", "diff", "=", "array_diff", "(", "array_keys", "(", "$", "this", "->", "settings", ")", ",", "array_keys", "(", "$", "credentials", ")", ")", ")", "{", ...
Open a connection to a mail server. @param array $credentials @return bool @throws \Exception
[ "Open", "a", "connection", "to", "a", "mail", "server", "." ]
9c81843aece984eb6e2a9ba41f3be49733348d10
https://github.com/johnnymast/mailreader/blob/9c81843aece984eb6e2a9ba41f3be49733348d10/src/MailReader/MailReader.php#L47-L67
train
johnnymast/mailreader
src/MailReader/MailReader.php
MailReader.getMailbox
public function getMailbox() { $mailbox = str_replace("{".$this->settings['server']."}", '', $this->mailbox); $mailbox = (substr($mailbox, 0, 6) == 'INBOX.') ? substr($mailbox, -6) : $mailbox; return $mailbox; }
php
public function getMailbox() { $mailbox = str_replace("{".$this->settings['server']."}", '', $this->mailbox); $mailbox = (substr($mailbox, 0, 6) == 'INBOX.') ? substr($mailbox, -6) : $mailbox; return $mailbox; }
[ "public", "function", "getMailbox", "(", ")", "{", "$", "mailbox", "=", "str_replace", "(", "\"{\"", ".", "$", "this", "->", "settings", "[", "'server'", "]", ".", "\"}\"", ",", "''", ",", "$", "this", "->", "mailbox", ")", ";", "$", "mailbox", "=", ...
Return the name of the current mailbox. @return string
[ "Return", "the", "name", "of", "the", "current", "mailbox", "." ]
9c81843aece984eb6e2a9ba41f3be49733348d10
https://github.com/johnnymast/mailreader/blob/9c81843aece984eb6e2a9ba41f3be49733348d10/src/MailReader/MailReader.php#L111-L117
train
johnnymast/mailreader
src/MailReader/MailReader.php
MailReader.subscribeMailbox
public function subscribeMailbox($name = '') { if (empty($name)) { return false; } $name = imap_utf7_encode($name); return imap_subscribe ( $this->conn, "{".$this->settings['server']."}INBOX.".$name ); }
php
public function subscribeMailbox($name = '') { if (empty($name)) { return false; } $name = imap_utf7_encode($name); return imap_subscribe ( $this->conn, "{".$this->settings['server']."}INBOX.".$name ); }
[ "public", "function", "subscribeMailbox", "(", "$", "name", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "name", ")", ")", "{", "return", "false", ";", "}", "$", "name", "=", "imap_utf7_encode", "(", "$", "name", ")", ";", "return", "imap_subsc...
Subscribe to a mailbox. @param string $name @return bool
[ "Subscribe", "to", "a", "mailbox", "." ]
9c81843aece984eb6e2a9ba41f3be49733348d10
https://github.com/johnnymast/mailreader/blob/9c81843aece984eb6e2a9ba41f3be49733348d10/src/MailReader/MailReader.php#L213-L220
train
johnnymast/mailreader
src/MailReader/MailReader.php
MailReader.getMessageInformation
public function getMessageInformation($id = '') { $message = []; if (is_array($this->messages) == true) { foreach($this ->messages as $msg) { if ($msg['index'] == $id) { return $msg; } } } return $message; ...
php
public function getMessageInformation($id = '') { $message = []; if (is_array($this->messages) == true) { foreach($this ->messages as $msg) { if ($msg['index'] == $id) { return $msg; } } } return $message; ...
[ "public", "function", "getMessageInformation", "(", "$", "id", "=", "''", ")", "{", "$", "message", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "this", "->", "messages", ")", "==", "true", ")", "{", "foreach", "(", "$", "this", "->", "mess...
Return message information without reading it from the server @param string $id @return mixed
[ "Return", "message", "information", "without", "reading", "it", "from", "the", "server" ]
9c81843aece984eb6e2a9ba41f3be49733348d10
https://github.com/johnnymast/mailreader/blob/9c81843aece984eb6e2a9ba41f3be49733348d10/src/MailReader/MailReader.php#L408-L419
train
johnnymast/mailreader
src/MailReader/MailReader.php
MailReader.getMessage
public function getMessage($id = '') { $message = []; if (is_array($this->messages) == true) { foreach($this ->messages as $msg) { if ($msg['index'] == $id) { $message = $msg; break; } } } ...
php
public function getMessage($id = '') { $message = []; if (is_array($this->messages) == true) { foreach($this ->messages as $msg) { if ($msg['index'] == $id) { $message = $msg; break; } } } ...
[ "public", "function", "getMessage", "(", "$", "id", "=", "''", ")", "{", "$", "message", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "this", "->", "messages", ")", "==", "true", ")", "{", "foreach", "(", "$", "this", "->", "messages", "a...
Return a message based on its index in the mailbox. @param string $id @return mixed
[ "Return", "a", "message", "based", "on", "its", "index", "in", "the", "mailbox", "." ]
9c81843aece984eb6e2a9ba41f3be49733348d10
https://github.com/johnnymast/mailreader/blob/9c81843aece984eb6e2a9ba41f3be49733348d10/src/MailReader/MailReader.php#L428-L446
train
johnnymast/mailreader
src/MailReader/MailReader.php
MailReader.readMailbox
public function readMailbox() { $msg_cnt = imap_num_msg($this->conn); $messages = []; for ($i = 1; $i <= $msg_cnt; $i++) { $header = imap_headerinfo($this->conn, $i); $messages[] = [ 'index' => trim($header->Msgno), 'header' => ...
php
public function readMailbox() { $msg_cnt = imap_num_msg($this->conn); $messages = []; for ($i = 1; $i <= $msg_cnt; $i++) { $header = imap_headerinfo($this->conn, $i); $messages[] = [ 'index' => trim($header->Msgno), 'header' => ...
[ "public", "function", "readMailbox", "(", ")", "{", "$", "msg_cnt", "=", "imap_num_msg", "(", "$", "this", "->", "conn", ")", ";", "$", "messages", "=", "[", "]", ";", "for", "(", "$", "i", "=", "1", ";", "$", "i", "<=", "$", "msg_cnt", ";", "$...
Retrieve a list of message in the mailbox. @return array
[ "Retrieve", "a", "list", "of", "message", "in", "the", "mailbox", "." ]
9c81843aece984eb6e2a9ba41f3be49733348d10
https://github.com/johnnymast/mailreader/blob/9c81843aece984eb6e2a9ba41f3be49733348d10/src/MailReader/MailReader.php#L454-L469
train
Wedeto/DB
src/Migrate/Module.php
Module.loadVersion
private function loadVersion() { try { $this->dao = $this->db->getDAO(DBVersion::class); $this->db_version = $this->dao->get( QB::where(["module" => $this->module]), QB::order(['migration_date' => 'DESC']) ...
php
private function loadVersion() { try { $this->dao = $this->db->getDAO(DBVersion::class); $this->db_version = $this->dao->get( QB::where(["module" => $this->module]), QB::order(['migration_date' => 'DESC']) ...
[ "private", "function", "loadVersion", "(", ")", "{", "try", "{", "$", "this", "->", "dao", "=", "$", "this", "->", "db", "->", "getDAO", "(", "DBVersion", "::", "class", ")", ";", "$", "this", "->", "db_version", "=", "$", "this", "->", "dao", "->"...
Load the current version from the database
[ "Load", "the", "current", "version", "from", "the", "database" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Migrate/Module.php#L88-L108
train
Wedeto/DB
src/Migrate/Module.php
Module.migrateTo
public function migrateTo(int $target_version) { if ($this->max_version === null) $this->scanMigrations(); $current_version = $this->getCurrentVersion(); $trajectory = $this->plan($current_version, $target_version); $db = $this->db; foreach ($trajectory as $mig...
php
public function migrateTo(int $target_version) { if ($this->max_version === null) $this->scanMigrations(); $current_version = $this->getCurrentVersion(); $trajectory = $this->plan($current_version, $target_version); $db = $this->db; foreach ($trajectory as $mig...
[ "public", "function", "migrateTo", "(", "int", "$", "target_version", ")", "{", "if", "(", "$", "this", "->", "max_version", "===", "null", ")", "$", "this", "->", "scanMigrations", "(", ")", ";", "$", "current_version", "=", "$", "this", "->", "getCurre...
Perform a migration from the current version to the target version @param int $version The target version @throws MigrationException Whenever no migration path can be found to the target version @throws DBException When something goes wrong during the migration
[ "Perform", "a", "migration", "from", "the", "current", "version", "to", "the", "target", "version" ]
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Migrate/Module.php#L242-L301
train
Wedeto/DB
src/Migrate/Module.php
Module.plan
protected function plan(int $from, int $to) { $migrations = []; if ($from === $to) return $migrations; $is_downgrade = $to < $from; $reachable = $this->migrations[$from] ?? []; // For downgrades, we want the lowest reachable target that is above or equa...
php
protected function plan(int $from, int $to) { $migrations = []; if ($from === $to) return $migrations; $is_downgrade = $to < $from; $reachable = $this->migrations[$from] ?? []; // For downgrades, we want the lowest reachable target that is above or equa...
[ "protected", "function", "plan", "(", "int", "$", "from", ",", "int", "$", "to", ")", "{", "$", "migrations", "=", "[", "]", ";", "if", "(", "$", "from", "===", "$", "to", ")", "return", "$", "migrations", ";", "$", "is_downgrade", "=", "$", "to"...
Plan a path through available migrations to reach a specified version from another version. This is always done in one direction, opportunistically. This means that when downgrading, no intermediate upgrades are performed, even if they may result in shorter path. Whenever a more than one step is available, the larger...
[ "Plan", "a", "path", "through", "available", "migrations", "to", "reach", "a", "specified", "version", "from", "another", "version", ".", "This", "is", "always", "done", "in", "one", "direction", "opportunistically", ".", "This", "means", "that", "when", "down...
715f8f2e3ae6b53c511c40b620921cb9c87e6f62
https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Migrate/Module.php#L320-L363
train
agentmedia/phine-core
src/Core/Logic/Module/FrontendForm.php
FrontendForm.AddUniqueSubmit
protected function AddUniqueSubmit($label) { $name = $label . '-' . $this->Content()->GetID(); $fullLabel = $this->Label($label); $this->AddSubmit($name, Trans($fullLabel)); }
php
protected function AddUniqueSubmit($label) { $name = $label . '-' . $this->Content()->GetID(); $fullLabel = $this->Label($label); $this->AddSubmit($name, Trans($fullLabel)); }
[ "protected", "function", "AddUniqueSubmit", "(", "$", "label", ")", "{", "$", "name", "=", "$", "label", ".", "'-'", ".", "$", "this", "->", "Content", "(", ")", "->", "GetID", "(", ")", ";", "$", "fullLabel", "=", "$", "this", "->", "Label", "(", ...
Adds a submit button with a unique name @param string $label The wording label used for the submit button
[ "Adds", "a", "submit", "button", "with", "a", "unique", "name" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/FrontendForm.php#L12-L17
train
mullanaphy/variable
src/PHY/Variable/Obj.php
Obj.toArray
public function toArray() { $class = $this->get(); $class = (array)$class; foreach ($class as $key => $value) { if (is_object($value)) { $class[$key] = (new static($value))->toArray(); } } re...
php
public function toArray() { $class = $this->get(); $class = (array)$class; foreach ($class as $key => $value) { if (is_object($value)) { $class[$key] = (new static($value))->toArray(); } } re...
[ "public", "function", "toArray", "(", ")", "{", "$", "class", "=", "$", "this", "->", "get", "(", ")", ";", "$", "class", "=", "(", "array", ")", "$", "class", ";", "foreach", "(", "$", "class", "as", "$", "key", "=>", "$", "value", ")", "{", ...
Recursively convert our object into an array. @return array
[ "Recursively", "convert", "our", "object", "into", "an", "array", "." ]
e4eb274a1799a25e33e5e21cd260603c74628031
https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/Obj.php#L88-L98
train
Wedeto/Util
src/TypedDictionary.php
TypedDictionary.validateTypes
protected function validateTypes(Dictionary $types, $path = "") { $spath = empty($path) ? "" : $path . "."; foreach ($types as $key => $value) { $kpath = $spath . $key; if ($value instanceof Dictionary) { $this->validateTypes($value, $kpath...
php
protected function validateTypes(Dictionary $types, $path = "") { $spath = empty($path) ? "" : $path . "."; foreach ($types as $key => $value) { $kpath = $spath . $key; if ($value instanceof Dictionary) { $this->validateTypes($value, $kpath...
[ "protected", "function", "validateTypes", "(", "Dictionary", "$", "types", ",", "$", "path", "=", "\"\"", ")", "{", "$", "spath", "=", "empty", "(", "$", "path", ")", "?", "\"\"", ":", "$", "path", ".", "\".\"", ";", "foreach", "(", "$", "types", "...
Validate that all provided types are actually type validators @param Dictionary $types The supplied type validators @param string $path The key path, used for reporting errors
[ "Validate", "that", "all", "provided", "types", "are", "actually", "type", "validators" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/TypedDictionary.php#L69-L90
train
Wedeto/Util
src/TypedDictionary.php
TypedDictionary.setType
public function setType($key, $type) { $args = func_get_args(); $type = array_pop($args); if (!($type instanceof Validator)) $type = new Validator($type); if ($this->types->has($args)) { $old_type = $this->types->get($args); if ($old_typ...
php
public function setType($key, $type) { $args = func_get_args(); $type = array_pop($args); if (!($type instanceof Validator)) $type = new Validator($type); if ($this->types->has($args)) { $old_type = $this->types->get($args); if ($old_typ...
[ "public", "function", "setType", "(", "$", "key", ",", "$", "type", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "type", "=", "array_pop", "(", "$", "args", ")", ";", "if", "(", "!", "(", "$", "type", "instanceof", "Validator", ...
Add a type for a parameter @param string $key The key to set a type for. Can be repeated to go deeper @param Validator $type The type for the parameter @return TypedDictionary Provides fluent interface
[ "Add", "a", "type", "for", "a", "parameter" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/TypedDictionary.php#L98-L118
train
Wedeto/Util
src/TypedDictionary.php
TypedDictionary.set
public function set($key, $value) { if (is_array($key) && $value === null) $args = $key; else $args = func_get_args(); $path = $args; $value = array_pop($path); $type = $this->types->dget($path); $kpath = implode('.', $path); // Key i...
php
public function set($key, $value) { if (is_array($key) && $value === null) $args = $key; else $args = func_get_args(); $path = $args; $value = array_pop($path); $type = $this->types->dget($path); $kpath = implode('.', $path); // Key i...
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", "&&", "$", "value", "===", "null", ")", "$", "args", "=", "$", "key", ";", "else", "$", "args", "=", "func_get_args", "(", "...
Set a value, after type checking @param string $key The key to set. Can be repeated to go deeper @param mixed $value Whatever to set. Will be type checked @return TypedDictionary Provides fluent interface
[ "Set", "a", "value", "after", "type", "checking" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/TypedDictionary.php#L126-L178
train
Wedeto/Util
src/TypedDictionary.php
TypedDictionary.&
public function &dget($key, $default = null) { $args = WF::flatten_array(func_get_args()); if (func_num_args() > 1) { $default = array_pop($args); if (!($default instanceof DefVal)) $default = new DefVal($default); $args[] = $default; ...
php
public function &dget($key, $default = null) { $args = WF::flatten_array(func_get_args()); if (func_num_args() > 1) { $default = array_pop($args); if (!($default instanceof DefVal)) $default = new DefVal($default); $args[] = $default; ...
[ "public", "function", "&", "dget", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "args", "=", "WF", "::", "flatten_array", "(", "func_get_args", "(", ")", ")", ";", "if", "(", "func_num_args", "(", ")", ">", "1", ")", "{", "$"...
We override dget as dget returns a reference, allowing the TypedDictionary to be modified from the outside. This avoids the checks, so this needs to be disallowed. @param string $key The key to set. Can be repeated to go deeper @param mixed $default A default value to return in absence
[ "We", "override", "dget", "as", "dget", "returns", "a", "reference", "allowing", "the", "TypedDictionary", "to", "be", "modified", "from", "the", "outside", ".", "This", "avoids", "the", "checks", "so", "this", "needs", "to", "be", "disallowed", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/TypedDictionary.php#L188-L220
train
Wedeto/Util
src/TypedDictionary.php
TypedDictionary.addAll
public function addAll($values) { foreach ($values as $key => $value) $this->set($key, $value); return $this; }
php
public function addAll($values) { foreach ($values as $key => $value) $this->set($key, $value); return $this; }
[ "public", "function", "addAll", "(", "$", "values", ")", "{", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ")", "$", "this", "->", "set", "(", "$", "key", ",", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
Add all provided values, checking their types @param array $values Array with values. @return TypedDictionary Provides fluent interface
[ "Add", "all", "provided", "values", "checking", "their", "types" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/TypedDictionary.php#L227-L232
train
Wedeto/Util
src/TypedDictionary.php
TypedDictionary.wrap
public static function wrap(array &$values) { $types = new Dictionary; self::determineTypes($values, $types); return new TypedDictionary($types, $values); }
php
public static function wrap(array &$values) { $types = new Dictionary; self::determineTypes($values, $types); return new TypedDictionary($types, $values); }
[ "public", "static", "function", "wrap", "(", "array", "&", "$", "values", ")", "{", "$", "types", "=", "new", "Dictionary", ";", "self", "::", "determineTypes", "(", "$", "values", ",", "$", "types", ")", ";", "return", "new", "TypedDictionary", "(", "...
Customize wrapping of the TypedDictionary - the wrapped array can still be modified externally so we need to make sure the appropriate types are propagated @throws RuntimeException Always
[ "Customize", "wrapping", "of", "the", "TypedDictionary", "-", "the", "wrapped", "array", "can", "still", "be", "modified", "externally", "so", "we", "need", "to", "make", "sure", "the", "appropriate", "types", "are", "propagated" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/TypedDictionary.php#L296-L302
train
mwyatt/core
src/FileSystem.php
FileSystem.globRecursive
private function globRecursive($pattern) { $paths = glob($pattern); foreach ($paths as $path) { if (strpos($path, '.') === false) { $paths = array_merge($paths, $this->globRecursive($path . '/*')); } } return $paths; }
php
private function globRecursive($pattern) { $paths = glob($pattern); foreach ($paths as $path) { if (strpos($path, '.') === false) { $paths = array_merge($paths, $this->globRecursive($path . '/*')); } } return $paths; }
[ "private", "function", "globRecursive", "(", "$", "pattern", ")", "{", "$", "paths", "=", "glob", "(", "$", "pattern", ")", ";", "foreach", "(", "$", "paths", "as", "$", "path", ")", "{", "if", "(", "strpos", "(", "$", "path", ",", "'.'", ")", "=...
watch out can be slow! 4.75s for 20k paths @param string $pattern '/*' @return array paths
[ "watch", "out", "can", "be", "slow!", "4", ".", "75s", "for", "20k", "paths" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/FileSystem.php#L99-L108
train
phossa/phossa-cache
src/Phossa/Cache/Driver/CompositeDriver.php
CompositeDriver.get
public function get(/*# string */ $key)/*# : string */ { // try front-end cache first if ($this->frontHas($key)) { return $this->front->get($key); } // get from backend cache return $this->back->get($key); }
php
public function get(/*# string */ $key)/*# : string */ { // try front-end cache first if ($this->frontHas($key)) { return $this->front->get($key); } // get from backend cache return $this->back->get($key); }
[ "public", "function", "get", "(", "/*# string */", "$", "key", ")", "/*# : string */", "{", "// try front-end cache first", "if", "(", "$", "this", "->", "frontHas", "(", "$", "key", ")", ")", "{", "return", "$", "this", "->", "front", "->", "get", "(", ...
Either end get ok is ok {@inheritDoc}
[ "Either", "end", "get", "ok", "is", "ok" ]
ad86bee9c5c646fbae09f6f58a346b379d16276e
https://github.com/phossa/phossa-cache/blob/ad86bee9c5c646fbae09f6f58a346b379d16276e/src/Phossa/Cache/Driver/CompositeDriver.php#L127-L136
train