repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/FileSystemDefinition.php | FileSystemDefinition.configure | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$service->setArguments(array(
$config['file_system']['directory'],
$config['file_system']['extension'],
$config['file_system']['umask']
));
} | php | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$service->setArguments(array(
$config['file_system']['directory'],
$config['file_system']['extension'],
$config['file_system']['umask']
));
} | [
"public",
"function",
"configure",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"Definition",
"$",
"service",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"service",
"->",
"setArguments",
"(",
"array",
"(",
"$",
"config",
"[",
"'file_sy... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/FileSystemDefinition.php#L27-L34 |
doctrine/DoctrineCacheBundle | Command/DeleteCommand.php | DeleteCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$cacheName = $input->getArgument('cache-name');
$cacheProvider = $this->getCacheProvider($cacheName);
$cacheId = $input->getArgument('cache-id');
$all = $input->getOption('all');
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$cacheName = $input->getArgument('cache-name');
$cacheProvider = $this->getCacheProvider($cacheName);
$cacheId = $input->getArgument('cache-id');
$all = $input->getOption('all');
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"cacheName",
"=",
"$",
"input",
"->",
"getArgument",
"(",
"'cache-name'",
")",
";",
"$",
"cacheProvider",
"=",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Command/DeleteCommand.php#L32-L63 |
doctrine/DoctrineCacheBundle | DependencyInjection/CacheProviderLoader.php | CacheProviderLoader.getProviderDecorator | protected function getProviderDecorator(ContainerBuilder $container, array $config)
{
$type = $config['type'];
$id = 'doctrine_cache.abstract.' . $type;
static $childDefinition;
if (null === $childDefinition) {
$childDefinition = class_exists('Symfony\Component\Depend... | php | protected function getProviderDecorator(ContainerBuilder $container, array $config)
{
$type = $config['type'];
$id = 'doctrine_cache.abstract.' . $type;
static $childDefinition;
if (null === $childDefinition) {
$childDefinition = class_exists('Symfony\Component\Depend... | [
"protected",
"function",
"getProviderDecorator",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"config",
")",
"{",
"$",
"type",
"=",
"$",
"config",
"[",
"'type'",
"]",
";",
"$",
"id",
"=",
"'doctrine_cache.abstract.'",
".",
"$",
"type",
";",
... | @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@param array $config
@return \Symfony\Component\DependencyInjection\DefinitionDecorator | [
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container",
"@param",
"array",
"$config"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/CacheProviderLoader.php#L49-L74 |
doctrine/DoctrineCacheBundle | DependencyInjection/CacheProviderLoader.php | CacheProviderLoader.getCacheDefinition | private function getCacheDefinition($type, ContainerBuilder $container)
{
$class = $this->getDefinitionClass($type, $container);
$object = new $class($type);
return $object;
} | php | private function getCacheDefinition($type, ContainerBuilder $container)
{
$class = $this->getDefinitionClass($type, $container);
$object = new $class($type);
return $object;
} | [
"private",
"function",
"getCacheDefinition",
"(",
"$",
"type",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"getDefinitionClass",
"(",
"$",
"type",
",",
"$",
"container",
")",
";",
"$",
"object",
"=",
"new",
... | @param string $type
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Doctrine\Bundle\DoctrineCacheBundle\DependencyInjection\Definition\CacheDefinition | [
"@param",
"string",
"$type",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/CacheProviderLoader.php#L82-L88 |
doctrine/DoctrineCacheBundle | DependencyInjection/CacheProviderLoader.php | CacheProviderLoader.definitionClassExists | private function definitionClassExists($type, ContainerBuilder $container)
{
if ($container->hasParameter($this->getCustomDefinitionClassParameter($type))) {
return true;
}
return class_exists($this->getDefinitionClass($type, $container));
} | php | private function definitionClassExists($type, ContainerBuilder $container)
{
if ($container->hasParameter($this->getCustomDefinitionClassParameter($type))) {
return true;
}
return class_exists($this->getDefinitionClass($type, $container));
} | [
"private",
"function",
"definitionClassExists",
"(",
"$",
"type",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"$",
"container",
"->",
"hasParameter",
"(",
"$",
"this",
"->",
"getCustomDefinitionClassParameter",
"(",
"$",
"type",
")",
")",
"... | @param string $type
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return boolean | [
"@param",
"string",
"$type",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/CacheProviderLoader.php#L96-L103 |
doctrine/DoctrineCacheBundle | DependencyInjection/CacheProviderLoader.php | CacheProviderLoader.getDefinitionClass | protected function getDefinitionClass($type, ContainerBuilder $container)
{
if ($container->hasParameter($this->getCustomDefinitionClassParameter($type))) {
return $container->getParameter($this->getCustomDefinitionClassParameter($type));
}
$name = Inflector::classify($type) . ... | php | protected function getDefinitionClass($type, ContainerBuilder $container)
{
if ($container->hasParameter($this->getCustomDefinitionClassParameter($type))) {
return $container->getParameter($this->getCustomDefinitionClassParameter($type));
}
$name = Inflector::classify($type) . ... | [
"protected",
"function",
"getDefinitionClass",
"(",
"$",
"type",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"$",
"container",
"->",
"hasParameter",
"(",
"$",
"this",
"->",
"getCustomDefinitionClassParameter",
"(",
"$",
"type",
")",
")",
")... | @param string $type
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return string | [
"@param",
"string",
"$type",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/CacheProviderLoader.php#L111-L121 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/RiakDefinition.php | RiakDefinition.configure | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$riakConf = $config['riak'];
$bucketRef = $this->getBucketReference($name, $riakConf, $container);
$service->setArguments(array($bucketRef));
} | php | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$riakConf = $config['riak'];
$bucketRef = $this->getBucketReference($name, $riakConf, $container);
$service->setArguments(array($bucketRef));
} | [
"public",
"function",
"configure",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"Definition",
"$",
"service",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"riakConf",
"=",
"$",
"config",
"[",
"'riak'",
"]",
";",
"$",
"bucketRef",
"=",... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/RiakDefinition.php#L28-L34 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/RiakDefinition.php | RiakDefinition.getBucketReference | private function getBucketReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['bucket_id'])) {
return new Reference($config['bucket_id']);
}
$bucketName = $config['bucket_name'];
$bucketClass = '%doctrine_cache.riak.bucket.class%';
$... | php | private function getBucketReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['bucket_id'])) {
return new Reference($config['bucket_id']);
}
$bucketName = $config['bucket_name'];
$bucketClass = '%doctrine_cache.riak.bucket.class%';
$... | [
"private",
"function",
"getBucketReference",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'bucket_id'",
"]",
")",
")",
"{",
"return",
"new",
"Reference",
... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Symfony\Component\DependencyInjection\Reference | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/RiakDefinition.php#L43-L63 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/ChainDefinition.php | ChainDefinition.configure | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$providersConf = $config['chain'];
$providers = $this->getProviders($name, $providersConf, $container);
$service->setArguments(array($providers));
} | php | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$providersConf = $config['chain'];
$providers = $this->getProviders($name, $providersConf, $container);
$service->setArguments(array($providers));
} | [
"public",
"function",
"configure",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"Definition",
"$",
"service",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"providersConf",
"=",
"$",
"config",
"[",
"'chain'",
"]",
";",
"$",
"providers",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/ChainDefinition.php#L28-L34 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/ChainDefinition.php | ChainDefinition.getProviders | private function getProviders($name, array $config, ContainerBuilder $container)
{
$providers = array();
foreach ($config['providers'] as $provider) {
if (strpos($provider, 'doctrine_cache.providers.') === false) {
$provider = sprintf('doctrine_cache.providers.%s', $prov... | php | private function getProviders($name, array $config, ContainerBuilder $container)
{
$providers = array();
foreach ($config['providers'] as $provider) {
if (strpos($provider, 'doctrine_cache.providers.') === false) {
$provider = sprintf('doctrine_cache.providers.%s', $prov... | [
"private",
"function",
"getProviders",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"providers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"[",
"'providers'",
"]",
"as",
"$",
... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return array | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/ChainDefinition.php#L43-L56 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.evictFromCacheById | public function evictFromCacheById($primaryKey)
{
if ( ! $this->cache->contains($primaryKey)) {
return;
}
$key = $this->cache->fetch($primaryKey);
$this->cache->delete($primaryKey);
$this->evictFromCacheByKey($key);
} | php | public function evictFromCacheById($primaryKey)
{
if ( ! $this->cache->contains($primaryKey)) {
return;
}
$key = $this->cache->fetch($primaryKey);
$this->cache->delete($primaryKey);
$this->evictFromCacheByKey($key);
} | [
"public",
"function",
"evictFromCacheById",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache",
"->",
"contains",
"(",
"$",
"primaryKey",
")",
")",
"{",
"return",
";",
"}",
"$",
"key",
"=",
"$",
"this",
"->",
"cache",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L45-L55 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.evictFromCacheByIdentity | public function evictFromCacheByIdentity(ObjectIdentityInterface $oid)
{
$key = $this->createKeyFromIdentity($oid);
$this->evictFromCacheByKey($key);
} | php | public function evictFromCacheByIdentity(ObjectIdentityInterface $oid)
{
$key = $this->createKeyFromIdentity($oid);
$this->evictFromCacheByKey($key);
} | [
"public",
"function",
"evictFromCacheByIdentity",
"(",
"ObjectIdentityInterface",
"$",
"oid",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"createKeyFromIdentity",
"(",
"$",
"oid",
")",
";",
"$",
"this",
"->",
"evictFromCacheByKey",
"(",
"$",
"key",
")",
";... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L60-L65 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.getFromCacheById | public function getFromCacheById($primaryKey)
{
if ( ! $this->cache->contains($primaryKey)) {
return null;
}
$key = $this->cache->fetch($primaryKey);
$acl = $this->getFromCacheByKey($key);
if ( ! $acl) {
$this->cache->delete($primaryKey);
... | php | public function getFromCacheById($primaryKey)
{
if ( ! $this->cache->contains($primaryKey)) {
return null;
}
$key = $this->cache->fetch($primaryKey);
$acl = $this->getFromCacheByKey($key);
if ( ! $acl) {
$this->cache->delete($primaryKey);
... | [
"public",
"function",
"getFromCacheById",
"(",
"$",
"primaryKey",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache",
"->",
"contains",
"(",
"$",
"primaryKey",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"key",
"=",
"$",
"this",
"->",
"cache",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L70-L86 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.getFromCacheByIdentity | public function getFromCacheByIdentity(ObjectIdentityInterface $oid)
{
$key = $this->createKeyFromIdentity($oid);
return $this->getFromCacheByKey($key);
} | php | public function getFromCacheByIdentity(ObjectIdentityInterface $oid)
{
$key = $this->createKeyFromIdentity($oid);
return $this->getFromCacheByKey($key);
} | [
"public",
"function",
"getFromCacheByIdentity",
"(",
"ObjectIdentityInterface",
"$",
"oid",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"createKeyFromIdentity",
"(",
"$",
"oid",
")",
";",
"return",
"$",
"this",
"->",
"getFromCacheByKey",
"(",
"$",
"key",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L91-L96 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.unserializeAcl | private function unserializeAcl($serialized)
{
$acl = unserialize($serialized);
$parentId = $acl->getParentAcl();
if (null !== $parentId) {
$parentAcl = $this->getFromCacheById($parentId);
if (null === $parentAcl) {
return null;
}
... | php | private function unserializeAcl($serialized)
{
$acl = unserialize($serialized);
$parentId = $acl->getParentAcl();
if (null !== $parentId) {
$parentAcl = $this->getFromCacheById($parentId);
if (null === $parentAcl) {
return null;
}
... | [
"private",
"function",
"unserializeAcl",
"(",
"$",
"serialized",
")",
"{",
"$",
"acl",
"=",
"unserialize",
"(",
"$",
"serialized",
")",
";",
"$",
"parentId",
"=",
"$",
"acl",
"->",
"getParentAcl",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"parentId... | Unserialize a given ACL.
@param string $serialized
@return \Symfony\Component\Security\Acl\Model\AclInterface | [
"Unserialize",
"a",
"given",
"ACL",
"."
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L134-L194 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.evictFromCacheByKey | private function evictFromCacheByKey($key)
{
if ( ! $this->cache->contains($key)) {
return;
}
$this->cache->delete($key);
} | php | private function evictFromCacheByKey($key)
{
if ( ! $this->cache->contains($key)) {
return;
}
$this->cache->delete($key);
} | [
"private",
"function",
"evictFromCacheByKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache",
"->",
"contains",
"(",
"$",
"key",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"cache",
"->",
"delete",
"(",
"$",
"key",
... | Removes an ACL from the cache
@param string $key | [
"Removes",
"an",
"ACL",
"from",
"the",
"cache"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L213-L220 |
doctrine/DoctrineCacheBundle | Acl/Model/AclCache.php | AclCache.getFromCacheByKey | private function getFromCacheByKey($key)
{
if ( ! $this->cache->contains($key)) {
return null;
}
$serialized = $this->cache->fetch($key);
return $this->unserializeAcl($serialized);
} | php | private function getFromCacheByKey($key)
{
if ( ! $this->cache->contains($key)) {
return null;
}
$serialized = $this->cache->fetch($key);
return $this->unserializeAcl($serialized);
} | [
"private",
"function",
"getFromCacheByKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache",
"->",
"contains",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"serialized",
"=",
"$",
"this",
"->",
"cache",
"->... | Retrieves an ACL for the given key from the cache
@param string $key
@return null|\Symfony\Component\Security\Acl\Model\AclInterface | [
"Retrieves",
"an",
"ACL",
"for",
"the",
"given",
"key",
"from",
"the",
"cache"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Acl/Model/AclCache.php#L229-L238 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/MongodbDefinition.php | MongodbDefinition.configure | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$memcacheConf = $config['mongodb'];
$collRef = $this->getCollectionReference($name, $memcacheConf, $container);
$service->setArguments(array($collRef));
} | php | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$memcacheConf = $config['mongodb'];
$collRef = $this->getCollectionReference($name, $memcacheConf, $container);
$service->setArguments(array($collRef));
} | [
"public",
"function",
"configure",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"Definition",
"$",
"service",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"memcacheConf",
"=",
"$",
"config",
"[",
"'mongodb'",
"]",
";",
"$",
"collRef",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/MongodbDefinition.php#L28-L34 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/MongodbDefinition.php | MongodbDefinition.getCollectionReference | private function getCollectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['collection_id'])) {
return new Reference($config['collection_id']);
}
$databaseName = $config['database_name'];
$collectionName = $config['collection_name'];... | php | private function getCollectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['collection_id'])) {
return new Reference($config['collection_id']);
}
$databaseName = $config['database_name'];
$collectionName = $config['collection_name'];... | [
"private",
"function",
"getCollectionReference",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'collection_id'",
"]",
")",
")",
"{",
"return",
"new",
"Refer... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Symfony\Component\DependencyInjection\Reference | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/MongodbDefinition.php#L43-L70 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/MongodbDefinition.php | MongodbDefinition.getConnectionReference | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['connection_id'])) {
return new Reference($config['connection_id']);
}
$server = $config['server'];
$connClass = '%doctrine_cache.mongodb.connectio... | php | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['connection_id'])) {
return new Reference($config['connection_id']);
}
$server = $config['server'];
$connClass = '%doctrine_cache.mongodb.connectio... | [
"private",
"function",
"getConnectionReference",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'connection_id'",
"]",
")",
")",
"{",
"return",
"new",
"Refer... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Symfony\Component\DependencyInjection\Reference | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/MongodbDefinition.php#L79-L96 |
doctrine/DoctrineCacheBundle | DependencyInjection/DoctrineCacheExtension.php | DoctrineCacheExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$rootConfig = $this->processConfiguration($configuration, $configs);
$locator = new FileLocator(__DIR__ . '/../Resources/config/');
$loader = new XmlFileLoader($container, $... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$rootConfig = $this->processConfiguration($configuration, $configs);
$locator = new FileLocator(__DIR__ . '/../Resources/config/');
$loader = new XmlFileLoader($container, $... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"rootConfig",
"=",
"$",
"this",
"->",
"processConfiguration",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/DoctrineCacheExtension.php#L37-L51 |
doctrine/DoctrineCacheBundle | Command/CacheCommand.php | CacheCommand.getCacheProvider | protected function getCacheProvider($cacheName)
{
$container = $this->getContainer();
// Try to use user input as cache service alias.
$cacheProvider = $container->get($cacheName, ContainerInterface::NULL_ON_INVALID_REFERENCE);
// If cache provider was not found try the service pro... | php | protected function getCacheProvider($cacheName)
{
$container = $this->getContainer();
// Try to use user input as cache service alias.
$cacheProvider = $container->get($cacheName, ContainerInterface::NULL_ON_INVALID_REFERENCE);
// If cache provider was not found try the service pro... | [
"protected",
"function",
"getCacheProvider",
"(",
"$",
"cacheName",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
";",
"// Try to use user input as cache service alias.",
"$",
"cacheProvider",
"=",
"$",
"container",
"->",
"get",
"("... | Get the requested cache provider service.
@param string $cacheName
@return \Doctrine\Common\Cache\Cache
@throws \InvalidArgumentException | [
"Get",
"the",
"requested",
"cache",
"provider",
"service",
"."
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/Command/CacheCommand.php#L31-L48 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/PredisDefinition.php | PredisDefinition.getConnectionReference | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['client_id'])) {
return new Reference($config['client_id']);
}
$parameters = array(
'scheme' => $config['scheme'],
'host' => $config['host'],
... | php | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['client_id'])) {
return new Reference($config['client_id']);
}
$parameters = array(
'scheme' => $config['scheme'],
'host' => $config['host'],
... | [
"private",
"function",
"getConnectionReference",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'client_id'",
"]",
")",
")",
"{",
"return",
"new",
"Reference... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Symfony\Component\DependencyInjection\Reference | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/PredisDefinition.php#L42-L83 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.getProviderParameters | public function getProviderParameters(array $parameters)
{
if (isset($parameters['type'])) {
unset($parameters['type']);
}
if (isset($parameters['aliases'])) {
unset($parameters['aliases']);
}
if (isset($parameters['namespace'])) {
unset(... | php | public function getProviderParameters(array $parameters)
{
if (isset($parameters['type'])) {
unset($parameters['type']);
}
if (isset($parameters['aliases'])) {
unset($parameters['aliases']);
}
if (isset($parameters['namespace'])) {
unset(... | [
"public",
"function",
"getProviderParameters",
"(",
"array",
"$",
"parameters",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"parameters",
"[",
"'type'",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"parameters",
"[",
"'type'",
"]",
")",
";",
"}",
"if",
"(",
"i... | @param array $parameters
@return string | [
"@param",
"array",
"$parameters"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L21-L36 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.resolveNodeType | public function resolveNodeType(array $parameters)
{
$values = $this->getProviderParameters($parameters);
$type = key($values);
return $type;
} | php | public function resolveNodeType(array $parameters)
{
$values = $this->getProviderParameters($parameters);
$type = key($values);
return $type;
} | [
"public",
"function",
"resolveNodeType",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getProviderParameters",
"(",
"$",
"parameters",
")",
";",
"$",
"type",
"=",
"key",
"(",
"$",
"values",
")",
";",
"return",
"$",
... | @param array $parameters
@return string | [
"@param",
"array",
"$parameters"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L43-L49 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.getProviderNames | public function getProviderNames(NodeInterface $tree)
{
foreach ($tree->getChildren() as $providers) {
if ($providers->getName() !== 'providers') {
continue;
}
$children = $providers->getPrototype()->getChildren();
$providers = array_diff(ar... | php | public function getProviderNames(NodeInterface $tree)
{
foreach ($tree->getChildren() as $providers) {
if ($providers->getName() !== 'providers') {
continue;
}
$children = $providers->getPrototype()->getChildren();
$providers = array_diff(ar... | [
"public",
"function",
"getProviderNames",
"(",
"NodeInterface",
"$",
"tree",
")",
"{",
"foreach",
"(",
"$",
"tree",
"->",
"getChildren",
"(",
")",
"as",
"$",
"providers",
")",
"{",
"if",
"(",
"$",
"providers",
"->",
"getName",
"(",
")",
"!==",
"'provider... | @param \Symfony\Component\Config\Definition\NodeInterface $tree
@return array | [
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Config",
"\\",
"Definition",
"\\",
"NodeInterface",
"$tree"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L56-L70 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$self = $this;
$builder = new TreeBuilder('doctrine_cache');
$node = $this->getRootNode($builder, 'doctrine_cache');
$normalization = function ($conf) use ($self, $builder) {
$conf['type'] = isset($c... | php | public function getConfigTreeBuilder()
{
$self = $this;
$builder = new TreeBuilder('doctrine_cache');
$node = $this->getRootNode($builder, 'doctrine_cache');
$normalization = function ($conf) use ($self, $builder) {
$conf['type'] = isset($c... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'doctrine_cache'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L86-L192 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addBasicProviderNode | private function addBasicProviderNode($name)
{
$builder = new TreeBuilder($name);
$node = $this->getRootNode($builder, $name);
return $node;
} | php | private function addBasicProviderNode($name)
{
$builder = new TreeBuilder($name);
$node = $this->getRootNode($builder, $name);
return $node;
} | [
"private",
"function",
"addBasicProviderNode",
"(",
"$",
"name",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"$",
"name",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"$",
"name",
")",
";",
"re... | @param string $name
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"@param",
"string",
"$name"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L199-L205 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addCustomProviderNode | private function addCustomProviderNode()
{
$builder = new TreeBuilder('custom_provider');
$node = $this->getRootNode($builder, 'custom_provider');
$node
->children()
->scalarNode('type')->isRequired()->cannotBeEmpty()->end()
->arrayNode('option... | php | private function addCustomProviderNode()
{
$builder = new TreeBuilder('custom_provider');
$node = $this->getRootNode($builder, 'custom_provider');
$node
->children()
->scalarNode('type')->isRequired()->cannotBeEmpty()->end()
->arrayNode('option... | [
"private",
"function",
"addCustomProviderNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'custom_provider'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'custom_provider'",
")",
";",
"$",
... | Build custom node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"custom",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L212-L228 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addChainNode | private function addChainNode()
{
$builder = new TreeBuilder('chain');
$node = $this->getRootNode($builder, 'chain');
$node
->fixXmlConfig('provider')
->children()
->arrayNode('providers')
->prototype('scalar')->end()
... | php | private function addChainNode()
{
$builder = new TreeBuilder('chain');
$node = $this->getRootNode($builder, 'chain');
$node
->fixXmlConfig('provider')
->children()
->arrayNode('providers')
->prototype('scalar')->end()
... | [
"private",
"function",
"addChainNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'chain'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'chain'",
")",
";",
"$",
"node",
"->",
"fixXmlConf... | Build chain node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"chain",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L235-L250 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addMemcacheNode | private function addMemcacheNode()
{
$builder = new TreeBuilder('memcache');
$node = $this->getRootNode($builder, 'memcache');
$host = '%doctrine_cache.memcache.host%';
$port = '%doctrine_cache.memcache.port%';
$node
->addDefaultsIfNotSet()
-... | php | private function addMemcacheNode()
{
$builder = new TreeBuilder('memcache');
$node = $this->getRootNode($builder, 'memcache');
$host = '%doctrine_cache.memcache.host%';
$port = '%doctrine_cache.memcache.port%';
$node
->addDefaultsIfNotSet()
-... | [
"private",
"function",
"addMemcacheNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'memcache'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'memcache'",
")",
";",
"$",
"host",
"=",
"'%... | Build memcache node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"memcache",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L257-L295 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addRedisNode | private function addRedisNode()
{
$builder = new TreeBuilder('redis');
$node = $this->getRootNode($builder, 'redis');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('connection_id')->defaultNull()->end()
->scalarNode('host'... | php | private function addRedisNode()
{
$builder = new TreeBuilder('redis');
$node = $this->getRootNode($builder, 'redis');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('connection_id')->defaultNull()->end()
->scalarNode('host'... | [
"private",
"function",
"addRedisNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'redis'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'redis'",
")",
";",
"$",
"node",
"->",
"addDefault... | Build redis node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"redis",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L348-L367 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addPredisNode | private function addPredisNode()
{
$builder = new TreeBuilder('predis');
$node = $this->getRootNode($builder, 'predis');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('client_id')->defaultNull()->end()
->scalarNode('scheme... | php | private function addPredisNode()
{
$builder = new TreeBuilder('predis');
$node = $this->getRootNode($builder, 'predis');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('client_id')->defaultNull()->end()
->scalarNode('scheme... | [
"private",
"function",
"addPredisNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'predis'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'predis'",
")",
";",
"$",
"node",
"->",
"addDefa... | Build predis node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"predis",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L374-L397 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addRiakNode | private function addRiakNode()
{
$builder = new TreeBuilder('riak');
$node = $this->getRootNode($builder, 'riak');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('host')->defaultValue('%doctrine_cache.riak.host%')->end()
->... | php | private function addRiakNode()
{
$builder = new TreeBuilder('riak');
$node = $this->getRootNode($builder, 'riak');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('host')->defaultValue('%doctrine_cache.riak.host%')->end()
->... | [
"private",
"function",
"addRiakNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'riak'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'riak'",
")",
";",
"$",
"node",
"->",
"addDefaultsIf... | Build riak node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"riak",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L404-L427 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addCouchbaseNode | private function addCouchbaseNode()
{
$builder = new TreeBuilder('couchbase');
$node = $this->getRootNode($builder, 'couchbase');
$node
->addDefaultsIfNotSet()
->fixXmlConfig('hostname')
->children()
->scalarNode('connection_id')->defau... | php | private function addCouchbaseNode()
{
$builder = new TreeBuilder('couchbase');
$node = $this->getRootNode($builder, 'couchbase');
$node
->addDefaultsIfNotSet()
->fixXmlConfig('hostname')
->children()
->scalarNode('connection_id')->defau... | [
"private",
"function",
"addCouchbaseNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'couchbase'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'couchbase'",
")",
";",
"$",
"node",
"->",
... | Build couchbase node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"couchbase",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L434-L455 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addMongoNode | private function addMongoNode()
{
$builder = new TreeBuilder('mongodb');
$node = $this->getRootNode($builder, 'mongodb');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('connection_id')->defaultNull()->end()
->scalarNode('c... | php | private function addMongoNode()
{
$builder = new TreeBuilder('mongodb');
$node = $this->getRootNode($builder, 'mongodb');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('connection_id')->defaultNull()->end()
->scalarNode('c... | [
"private",
"function",
"addMongoNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'mongodb'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'mongodb'",
")",
";",
"$",
"node",
"->",
"addDef... | Build mongodb node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"mongodb",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L462-L479 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addPhpFileNode | private function addPhpFileNode()
{
$builder = new TreeBuilder('php_file');
$node = $this->getRootNode($builder, 'php_file');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('directory')->defaultValue('%kernel.cache_dir%/doctrine/cache/phpf... | php | private function addPhpFileNode()
{
$builder = new TreeBuilder('php_file');
$node = $this->getRootNode($builder, 'php_file');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('directory')->defaultValue('%kernel.cache_dir%/doctrine/cache/phpf... | [
"private",
"function",
"addPhpFileNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'php_file'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'php_file'",
")",
";",
"$",
"node",
"->",
"ad... | Build php_file node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"php_file",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L486-L501 |
doctrine/DoctrineCacheBundle | DependencyInjection/Configuration.php | Configuration.addSqlite3Node | private function addSqlite3Node()
{
$builder = new TreeBuilder('sqlite3');
$node = $this->getRootNode($builder, 'sqlite3');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('connection_id')->defaultNull()->end()
->scalarNode(... | php | private function addSqlite3Node()
{
$builder = new TreeBuilder('sqlite3');
$node = $this->getRootNode($builder, 'sqlite3');
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('connection_id')->defaultNull()->end()
->scalarNode(... | [
"private",
"function",
"addSqlite3Node",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
"'sqlite3'",
")",
";",
"$",
"node",
"=",
"$",
"this",
"->",
"getRootNode",
"(",
"$",
"builder",
",",
"'sqlite3'",
")",
";",
"$",
"node",
"->",
"addD... | Build sqlite3 node configuration definition
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder | [
"Build",
"sqlite3",
"node",
"configuration",
"definition"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Configuration.php#L530-L545 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/RedisDefinition.php | RedisDefinition.getConnectionReference | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['connection_id'])) {
return new Reference($config['connection_id']);
}
$host = $config['host'];
$port = $config['port'];
$connClass = '%doc... | php | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['connection_id'])) {
return new Reference($config['connection_id']);
}
$host = $config['host'];
$port = $config['port'];
$connClass = '%doc... | [
"private",
"function",
"getConnectionReference",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'connection_id'",
"]",
")",
")",
"{",
"return",
"new",
"Refer... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Symfony\Component\DependencyInjection\Reference | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/RedisDefinition.php#L43-L82 |
doctrine/DoctrineCacheBundle | DependencyInjection/SymfonyBridgeAdapter.php | SymfonyBridgeAdapter.loadCacheDriver | public function loadCacheDriver($cacheName, $objectManagerName, array $cacheDriver, ContainerBuilder $container)
{
$id = $this->getObjectManagerElementName($objectManagerName . '_' . $cacheName);
$host = isset($cacheDriver['host']) ? $cacheDriver['host'] : null;
$port = isset($... | php | public function loadCacheDriver($cacheName, $objectManagerName, array $cacheDriver, ContainerBuilder $container)
{
$id = $this->getObjectManagerElementName($objectManagerName . '_' . $cacheName);
$host = isset($cacheDriver['host']) ? $cacheDriver['host'] : null;
$port = isset($... | [
"public",
"function",
"loadCacheDriver",
"(",
"$",
"cacheName",
",",
"$",
"objectManagerName",
",",
"array",
"$",
"cacheDriver",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getObjectManagerElementName",
"(",
"$",
"o... | @param string $cacheName
@param string $objectManagerName
@param array $cacheDriver
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@retu... | [
"@param",
"string",
"$cacheName",
"@param",
"string",
"$objectManagerName",
"@param",
"array",
"$cacheDriver",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/SymfonyBridgeAdapter.php#L63-L133 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/Sqlite3Definition.php | Sqlite3Definition.configure | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$sqlite3Conf = $config['sqlite3'];
$tableName = $sqlite3Conf['table_name'];
$connectionRef = $this->getConnectionReference($name, $sqlite3Conf, $container);
$service->setArgumen... | php | public function configure($name, array $config, Definition $service, ContainerBuilder $container)
{
$sqlite3Conf = $config['sqlite3'];
$tableName = $sqlite3Conf['table_name'];
$connectionRef = $this->getConnectionReference($name, $sqlite3Conf, $container);
$service->setArgumen... | [
"public",
"function",
"configure",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"Definition",
"$",
"service",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"sqlite3Conf",
"=",
"$",
"config",
"[",
"'sqlite3'",
"]",
";",
"$",
"tableName",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/Sqlite3Definition.php#L28-L35 |
doctrine/DoctrineCacheBundle | DependencyInjection/Definition/Sqlite3Definition.php | Sqlite3Definition.getConnectionReference | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['connection_id'])) {
return new Reference($config['connection_id']);
}
$fileName = $config['file_name'];
$connClass = '%doctrine_cache.sqlite3.connection.class... | php | private function getConnectionReference($name, array $config, ContainerBuilder $container)
{
if (isset($config['connection_id'])) {
return new Reference($config['connection_id']);
}
$fileName = $config['file_name'];
$connClass = '%doctrine_cache.sqlite3.connection.class... | [
"private",
"function",
"getConnectionReference",
"(",
"$",
"name",
",",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'connection_id'",
"]",
")",
")",
"{",
"return",
"new",
"Refer... | @param string $name
@param array $config
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return \Symfony\Component\DependencyInjection\Reference | [
"@param",
"string",
"$name",
"@param",
"array",
"$config",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"DependencyInjection",
"\\",
"ContainerBuilder",
"$container"
] | train | https://github.com/doctrine/DoctrineCacheBundle/blob/61ce8deded490d11c653e68e15f6ca7bd3199d13/DependencyInjection/Definition/Sqlite3Definition.php#L44-L59 |
fico7489/laravel-eloquent-join | src/EloquentJoinBuilder.php | EloquentJoinBuilder.performJoin | private function performJoin($relations, $leftJoin = null)
{
//detect join method
$leftJoin = null !== $leftJoin ? $leftJoin : $this->leftJoin;
$joinMethod = $leftJoin ? 'leftJoin' : 'join';
//detect current model data
$relations = explode('.', $relations);
$column... | php | private function performJoin($relations, $leftJoin = null)
{
//detect join method
$leftJoin = null !== $leftJoin ? $leftJoin : $this->leftJoin;
$joinMethod = $leftJoin ? 'leftJoin' : 'join';
//detect current model data
$relations = explode('.', $relations);
$column... | [
"private",
"function",
"performJoin",
"(",
"$",
"relations",
",",
"$",
"leftJoin",
"=",
"null",
")",
"{",
"//detect join method",
"$",
"leftJoin",
"=",
"null",
"!==",
"$",
"leftJoin",
"?",
"$",
"leftJoin",
":",
"$",
"this",
"->",
"leftJoin",
";",
"$",
"j... | helpers methods | [
"helpers",
"methods"
] | train | https://github.com/fico7489/laravel-eloquent-join/blob/4eab7c77fd53678521685cb3c0c002fb8d188438/src/EloquentJoinBuilder.php#L152-L231 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.cascade | public function cascade($models, $direction, array $directionData = [])
{
try {
$this->direction = $direction;
$this->directionData = $directionData;
$this->run($models);
//All ok we commit all database queries
foreach ($this->dbsToTransact as $con... | php | public function cascade($models, $direction, array $directionData = [])
{
try {
$this->direction = $direction;
$this->directionData = $directionData;
$this->run($models);
//All ok we commit all database queries
foreach ($this->dbsToTransact as $con... | [
"public",
"function",
"cascade",
"(",
"$",
"models",
",",
"$",
"direction",
",",
"array",
"$",
"directionData",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"direction",
"=",
"$",
"direction",
";",
"$",
"this",
"->",
"directionData",
"=",
... | Cascade over Eloquent items.
@param Illuminate\Database\Eloquent\Model $models
@param string $direction update|delete|restore
@param array $directionData
@return void | [
"Cascade",
"over",
"Eloquent",
"items",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L30-L48 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.run | protected function run($models)
{
$models = collect($models);
if ($models->count() > 0) {
$model = $models->first();
if (!is_object($model)) {
return;
}
if (!$this->isCascadable($model)) {
return;
}
... | php | protected function run($models)
{
$models = collect($models);
if ($models->count() > 0) {
$model = $models->first();
if (!is_object($model)) {
return;
}
if (!$this->isCascadable($model)) {
return;
}
... | [
"protected",
"function",
"run",
"(",
"$",
"models",
")",
"{",
"$",
"models",
"=",
"collect",
"(",
"$",
"models",
")",
";",
"if",
"(",
"$",
"models",
"->",
"count",
"(",
")",
">",
"0",
")",
"{",
"$",
"model",
"=",
"$",
"models",
"->",
"first",
"... | Run the cascade.
@param Illuminate\Database\Eloquent\Model $models
@return void | [
"Run",
"the",
"cascade",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L57-L78 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.relations | protected function relations($model, $foreignKeyIds)
{
$relations = $model->getSoftCascade();
if (empty($relations)) {
return;
}
foreach ($relations as $relation) {
extract($this->relationResolver($relation));
$this->validateRelation($model, $rel... | php | protected function relations($model, $foreignKeyIds)
{
$relations = $model->getSoftCascade();
if (empty($relations)) {
return;
}
foreach ($relations as $relation) {
extract($this->relationResolver($relation));
$this->validateRelation($model, $rel... | [
"protected",
"function",
"relations",
"(",
"$",
"model",
",",
"$",
"foreignKeyIds",
")",
"{",
"$",
"relations",
"=",
"$",
"model",
"->",
"getSoftCascade",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"relations",
")",
")",
"{",
"return",
";",
"}",
"f... | Iterate over the relations.
@param Illuminate\Database\Eloquent\Model $model
@param array $foreignKeyIds
@param array $foreignKeyIds
@return mixed | [
"Iterate",
"over",
"the",
"relations",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L89-L131 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.getBelongsToManyData | protected function getBelongsToManyData($relation, $relationForeignKey, $foreignKeyIds)
{
$relationConnection = $relation->getConnection()->getName();
$relationTable = $relation->getTable();
$relationRelatedKey = $relation->getQualifiedRelatedPivotKeyName();
//Get related ids
... | php | protected function getBelongsToManyData($relation, $relationForeignKey, $foreignKeyIds)
{
$relationConnection = $relation->getConnection()->getName();
$relationTable = $relation->getTable();
$relationRelatedKey = $relation->getQualifiedRelatedPivotKeyName();
//Get related ids
... | [
"protected",
"function",
"getBelongsToManyData",
"(",
"$",
"relation",
",",
"$",
"relationForeignKey",
",",
"$",
"foreignKeyIds",
")",
"{",
"$",
"relationConnection",
"=",
"$",
"relation",
"->",
"getConnection",
"(",
")",
"->",
"getName",
"(",
")",
";",
"$",
... | Get many to many related key ids and key use.
@param Illuminate\Database\Eloquent\Relations\Relation $relation
@param string $relationForeignKey
@param array $foreignKeyIds
@return array | [
"Get",
"many",
"to",
"many",
"related",
"key",
"ids",
"and",
"key",
"use",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L142-L161 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.getMorphManyData | protected function getMorphManyData($relation, $foreignKeyIds)
{
$relatedClass = $relation->getRelated();
$foreignKeyUse = $relatedClass->getKeyName();
$foreignKeyIdsUse = $relatedClass::withTrashed()->where($relation->getMorphType(), $relation->getMorphClass())
->whereIn($relati... | php | protected function getMorphManyData($relation, $foreignKeyIds)
{
$relatedClass = $relation->getRelated();
$foreignKeyUse = $relatedClass->getKeyName();
$foreignKeyIdsUse = $relatedClass::withTrashed()->where($relation->getMorphType(), $relation->getMorphClass())
->whereIn($relati... | [
"protected",
"function",
"getMorphManyData",
"(",
"$",
"relation",
",",
"$",
"foreignKeyIds",
")",
"{",
"$",
"relatedClass",
"=",
"$",
"relation",
"->",
"getRelated",
"(",
")",
";",
"$",
"foreignKeyUse",
"=",
"$",
"relatedClass",
"->",
"getKeyName",
"(",
")"... | Get morph many related key ids and key use.
@param Illuminate\Database\Eloquent\Relations\Relation $relation
@param array $foreignKeyIds
@return array | [
"Get",
"morph",
"many",
"related",
"key",
"ids",
"and",
"key",
"use",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L171-L185 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.execute | protected function execute($relation, $foreignKey, $foreignKeyIds, $affectedRows)
{
$relationModel = $relation->getQuery()->getModel();
$relationModel = new $relationModel();
if ($affectedRows > 0) {
$relationModel = $relationModel->withTrashed()->whereIn($foreignKey, $foreignKey... | php | protected function execute($relation, $foreignKey, $foreignKeyIds, $affectedRows)
{
$relationModel = $relation->getQuery()->getModel();
$relationModel = new $relationModel();
if ($affectedRows > 0) {
$relationModel = $relationModel->withTrashed()->whereIn($foreignKey, $foreignKey... | [
"protected",
"function",
"execute",
"(",
"$",
"relation",
",",
"$",
"foreignKey",
",",
"$",
"foreignKeyIds",
",",
"$",
"affectedRows",
")",
"{",
"$",
"relationModel",
"=",
"$",
"relation",
"->",
"getQuery",
"(",
")",
"->",
"getModel",
"(",
")",
";",
"$",... | Execute delete, or restore.
@param Illuminate\Database\Eloquent\Relations\Relation $relation
@param string $foreignKey
@param array $foreignKeyIds
@param int $affectedRows
@return void | [
"Execute",
"delete",
"or",
"restore",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L197-L206 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.validateRelation | protected function validateRelation($model, $relation)
{
$class = get_class($model);
if (!method_exists($model, $relation)) {
DB::rollBack(); //Rollback the transaction before throw exception
throw new \LogicException(sprintf('%s does not have method \'%s\'.', $class, $relati... | php | protected function validateRelation($model, $relation)
{
$class = get_class($model);
if (!method_exists($model, $relation)) {
DB::rollBack(); //Rollback the transaction before throw exception
throw new \LogicException(sprintf('%s does not have method \'%s\'.', $class, $relati... | [
"protected",
"function",
"validateRelation",
"(",
"$",
"model",
",",
"$",
"relation",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"model",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"model",
",",
"$",
"relation",
")",
")",
"{",
"DB"... | Validate the relation method exists and is a type of Eloquent Relation.
@param Illuminate\Database\Eloquent\Model $model
@param string $relation
@return void | [
"Validate",
"the",
"relation",
"method",
"exists",
"and",
"is",
"a",
"type",
"of",
"Eloquent",
"Relation",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L216-L228 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.affectedRows | protected function affectedRows($relation, $foreignKey, $foreignKeyIds)
{
$relationModel = $relation->getQuery()->getModel();
$relationModel = new $relationModel();
return $relationModel->withTrashed()->whereIn($foreignKey, $foreignKeyIds)->count();
} | php | protected function affectedRows($relation, $foreignKey, $foreignKeyIds)
{
$relationModel = $relation->getQuery()->getModel();
$relationModel = new $relationModel();
return $relationModel->withTrashed()->whereIn($foreignKey, $foreignKeyIds)->count();
} | [
"protected",
"function",
"affectedRows",
"(",
"$",
"relation",
",",
"$",
"foreignKey",
",",
"$",
"foreignKeyIds",
")",
"{",
"$",
"relationModel",
"=",
"$",
"relation",
"->",
"getQuery",
"(",
")",
"->",
"getModel",
"(",
")",
";",
"$",
"relationModel",
"=",
... | Affected rows if we do execute.
@param Illuminate\Database\Eloquent\Relations\Relation $relation
@param string $foreignKey
@param array $foreignKeyIds
@return void | [
"Affected",
"rows",
"if",
"we",
"do",
"execute",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L251-L257 |
Askedio/laravel-soft-cascade | src/SoftCascade.php | SoftCascade.relationResolver | protected function relationResolver($relation)
{
$return = ['relation' => '', 'action' => 'update'];
try {
list($relation, $action) = explode('@', $relation);
$return = ['relation' => $relation, 'action' => $action];
} catch (\Exception $e) {
$return['rel... | php | protected function relationResolver($relation)
{
$return = ['relation' => '', 'action' => 'update'];
try {
list($relation, $action) = explode('@', $relation);
$return = ['relation' => $relation, 'action' => $action];
} catch (\Exception $e) {
$return['rel... | [
"protected",
"function",
"relationResolver",
"(",
"$",
"relation",
")",
"{",
"$",
"return",
"=",
"[",
"'relation'",
"=>",
"''",
",",
"'action'",
"=>",
"'update'",
"]",
";",
"try",
"{",
"list",
"(",
"$",
"relation",
",",
"$",
"action",
")",
"=",
"explod... | Resolve relation string.
@param string $relation
@return array | [
"Resolve",
"relation",
"string",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/SoftCascade.php#L266-L283 |
Askedio/laravel-soft-cascade | src/Listeners/CascadeQueryListener.php | CascadeQueryListener.getBacktraceUse | private function getBacktraceUse()
{
$debugBacktrace = collect(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 30))->filter(function ($backtrace) {
$backtraceClass = (isset($backtrace['class'])) ? $backtrace['class'] : null;
return $backtraceClass === $this->listenClass;
})-... | php | private function getBacktraceUse()
{
$debugBacktrace = collect(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 30))->filter(function ($backtrace) {
$backtraceClass = (isset($backtrace['class'])) ? $backtrace['class'] : null;
return $backtraceClass === $this->listenClass;
})-... | [
"private",
"function",
"getBacktraceUse",
"(",
")",
"{",
"$",
"debugBacktrace",
"=",
"collect",
"(",
"debug_backtrace",
"(",
"DEBUG_BACKTRACE_PROVIDE_OBJECT",
",",
"30",
")",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"backtrace",
")",
"{",
"$",
"backtrac... | Return the backtrace will be use to get model object and function.
@return type | [
"Return",
"the",
"backtrace",
"will",
"be",
"use",
"to",
"get",
"model",
"object",
"and",
"function",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/Listeners/CascadeQueryListener.php#L16-L35 |
Askedio/laravel-soft-cascade | src/Listeners/CascadeQueryListener.php | CascadeQueryListener.handle | public function handle()
{
$checkBacktrace = $this->getBacktraceUse();
if (!is_null($checkBacktrace)) {
$model = $checkBacktrace['object']->withTrashed()->get([$checkBacktrace['object']->getModel()->getKeyName()]);
(new QueryBuilderSoftCascade())->cascade($model, $checkBacktr... | php | public function handle()
{
$checkBacktrace = $this->getBacktraceUse();
if (!is_null($checkBacktrace)) {
$model = $checkBacktrace['object']->withTrashed()->get([$checkBacktrace['object']->getModel()->getKeyName()]);
(new QueryBuilderSoftCascade())->cascade($model, $checkBacktr... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"checkBacktrace",
"=",
"$",
"this",
"->",
"getBacktraceUse",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"checkBacktrace",
")",
")",
"{",
"$",
"model",
"=",
"$",
"checkBacktrace",
"[",
"'objec... | Handel the event for eloquent delete.
@return void | [
"Handel",
"the",
"event",
"for",
"eloquent",
"delete",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/Listeners/CascadeQueryListener.php#L42-L49 |
Askedio/laravel-soft-cascade | src/Exceptions/SoftCascadeRestrictedException.php | SoftCascadeRestrictedException.setModel | public function setModel($model, $foreignKey, $foreignKeyIds)
{
$this->model = $model;
$this->foreignKey = $foreignKey;
$this->foreignKeyIds = array_wrap($foreignKeyIds);
$this->message = "Integrity constraint violation [{$model}] where $foreignKey in (".implode(', ', $foreignKeyIds... | php | public function setModel($model, $foreignKey, $foreignKeyIds)
{
$this->model = $model;
$this->foreignKey = $foreignKey;
$this->foreignKeyIds = array_wrap($foreignKeyIds);
$this->message = "Integrity constraint violation [{$model}] where $foreignKey in (".implode(', ', $foreignKeyIds... | [
"public",
"function",
"setModel",
"(",
"$",
"model",
",",
"$",
"foreignKey",
",",
"$",
"foreignKeyIds",
")",
"{",
"$",
"this",
"->",
"model",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"foreignKey",
"=",
"$",
"foreignKey",
";",
"$",
"this",
"->",
"fo... | Set the affected Eloquent model and instance foreignKeyIds.
@param string $model
@param string $foreignKey
@param int|array $foreignKeyIds
@return $this | [
"Set",
"the",
"affected",
"Eloquent",
"model",
"and",
"instance",
"foreignKeyIds",
"."
] | train | https://github.com/Askedio/laravel-soft-cascade/blob/3ffb736d24d3c228734089624a4d821229b78644/src/Exceptions/SoftCascadeRestrictedException.php#L39-L48 |
symfony/monolog-bundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('monolog');
$rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('monolog');
$rootNode
->fixXmlConfig('channel')
->fixXmlConfig('handler... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('monolog');
$rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('monolog');
$rootNode
->fixXmlConfig('channel')
->fixXmlConfig('handler... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'monolog'",
")",
";",
"$",
"rootNode",
"=",
"method_exists",
"(",
"TreeBuilder",
"::",
"class",
",",
"'getRootNode'",
")",
"?",
"$",
"treeBuilder"... | Generates the configuration tree builder.
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder | [
"Generates",
"the",
"configuration",
"tree",
"builder",
"."
] | train | https://github.com/symfony/monolog-bundle/blob/005aefb1c4df246b07791188a65a0485fd6f4c5c/DependencyInjection/Configuration.php#L309-L876 |
symfony/monolog-bundle | DependencyInjection/MonologExtension.php | MonologExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
if (isset($config['handlers'])) {
$loader = new XmlFileLoader($container, new Fil... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
if (isset($config['handlers'])) {
$loader = new XmlFileLoader($container, new Fil... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
"$",
"configs",
",",
"$",
"container",
")",
";",
"$",
"config",
"=",
"... | Loads the Monolog configuration.
@param array $configs An array of configuration settings
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"the",
"Monolog",
"configuration",
"."
] | train | https://github.com/symfony/monolog-bundle/blob/005aefb1c4df246b07791188a65a0485fd6f4c5c/DependencyInjection/MonologExtension.php#L44-L111 |
symfony/monolog-bundle | DependencyInjection/Compiler/LoggerChannelPass.php | LoggerChannelPass.changeReference | private function changeReference(Reference $reference, $serviceId)
{
if (method_exists($reference, 'isStrict')) {
// Stay compatible with Symfony 2
return new Reference($serviceId, $reference->getInvalidBehavior(), $reference->isStrict(false));
}
return new Reference... | php | private function changeReference(Reference $reference, $serviceId)
{
if (method_exists($reference, 'isStrict')) {
// Stay compatible with Symfony 2
return new Reference($serviceId, $reference->getInvalidBehavior(), $reference->isStrict(false));
}
return new Reference... | [
"private",
"function",
"changeReference",
"(",
"Reference",
"$",
"reference",
",",
"$",
"serviceId",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"reference",
",",
"'isStrict'",
")",
")",
"{",
"// Stay compatible with Symfony 2",
"return",
"new",
"Reference",
... | Creates a copy of a reference and alters the service ID.
@param Reference $reference
@param string $serviceId
@return Reference | [
"Creates",
"a",
"copy",
"of",
"a",
"reference",
"and",
"alters",
"the",
"service",
"ID",
"."
] | train | https://github.com/symfony/monolog-bundle/blob/005aefb1c4df246b07791188a65a0485fd6f4c5c/DependencyInjection/Compiler/LoggerChannelPass.php#L149-L157 |
symfony/monolog-bundle | DependencyInjection/Compiler/AddSwiftMailerTransportPass.php | AddSwiftMailerTransportPass.process | public function process(ContainerBuilder $container)
{
$handlers = $container->getParameter('monolog.swift_mailer.handlers');
foreach ($handlers as $id) {
$definition = $container->getDefinition($id);
$mailerId = (string) $definition->getArgument(0);
// Try to f... | php | public function process(ContainerBuilder $container)
{
$handlers = $container->getParameter('monolog.swift_mailer.handlers');
foreach ($handlers as $id) {
$definition = $container->getDefinition($id);
$mailerId = (string) $definition->getArgument(0);
// Try to f... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"handlers",
"=",
"$",
"container",
"->",
"getParameter",
"(",
"'monolog.swift_mailer.handlers'",
")",
";",
"foreach",
"(",
"$",
"handlers",
"as",
"$",
"id",
")",
"{",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/monolog-bundle/blob/005aefb1c4df246b07791188a65a0485fd6f4c5c/DependencyInjection/Compiler/AddSwiftMailerTransportPass.php#L29-L56 |
symfony/monolog-bundle | SwiftMailer/MessageFactory.php | MessageFactory.createMessage | public function createMessage($content, array $records)
{
/** @var \Swift_Message $message */
$message = $this->mailer->createMessage();
$message->setTo($this->toEmail);
$message->setFrom($this->fromEmail);
$message->setSubject($this->subject);
if ($this->contentType... | php | public function createMessage($content, array $records)
{
/** @var \Swift_Message $message */
$message = $this->mailer->createMessage();
$message->setTo($this->toEmail);
$message->setFrom($this->fromEmail);
$message->setSubject($this->subject);
if ($this->contentType... | [
"public",
"function",
"createMessage",
"(",
"$",
"content",
",",
"array",
"$",
"records",
")",
"{",
"/** @var \\Swift_Message $message */",
"$",
"message",
"=",
"$",
"this",
"->",
"mailer",
"->",
"createMessage",
"(",
")",
";",
"$",
"message",
"->",
"setTo",
... | Creates a Swift_Message template that will be used to send the log message
@param string $content formatted email body to be sent
@param array $records Log records that formed the content
@return \Swift_Message | [
"Creates",
"a",
"Swift_Message",
"template",
"that",
"will",
"be",
"used",
"to",
"send",
"the",
"log",
"message"
] | train | https://github.com/symfony/monolog-bundle/blob/005aefb1c4df246b07791188a65a0485fd6f4c5c/SwiftMailer/MessageFactory.php#L47-L60 |
mtdowling/cron-expression | src/Cron/AbstractField.php | AbstractField.isSatisfied | public function isSatisfied($dateValue, $value)
{
if ($this->isIncrementsOfRanges($value)) {
return $this->isInIncrementsOfRanges($dateValue, $value);
} elseif ($this->isRange($value)) {
return $this->isInRange($dateValue, $value);
}
return $value == '*' || $... | php | public function isSatisfied($dateValue, $value)
{
if ($this->isIncrementsOfRanges($value)) {
return $this->isInIncrementsOfRanges($dateValue, $value);
} elseif ($this->isRange($value)) {
return $this->isInRange($dateValue, $value);
}
return $value == '*' || $... | [
"public",
"function",
"isSatisfied",
"(",
"$",
"dateValue",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isIncrementsOfRanges",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->",
"isInIncrementsOfRanges",
"(",
"$",
"dateValue",
... | Check to see if a field is satisfied by a value
@param string $dateValue Date value to check
@param string $value Value to test
@return bool | [
"Check",
"to",
"see",
"if",
"a",
"field",
"is",
"satisfied",
"by",
"a",
"value"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/AbstractField.php#L48-L57 |
mtdowling/cron-expression | src/Cron/AbstractField.php | AbstractField.isInRange | public function isInRange($dateValue, $value)
{
$parts = array_map('trim', explode('-', $value, 2));
return $dateValue >= $parts[0] && $dateValue <= $parts[1];
} | php | public function isInRange($dateValue, $value)
{
$parts = array_map('trim', explode('-', $value, 2));
return $dateValue >= $parts[0] && $dateValue <= $parts[1];
} | [
"public",
"function",
"isInRange",
"(",
"$",
"dateValue",
",",
"$",
"value",
")",
"{",
"$",
"parts",
"=",
"array_map",
"(",
"'trim'",
",",
"explode",
"(",
"'-'",
",",
"$",
"value",
",",
"2",
")",
")",
";",
"return",
"$",
"dateValue",
">=",
"$",
"pa... | Test if a value is within a range
@param string $dateValue Set date value
@param string $value Value to test
@return bool | [
"Test",
"if",
"a",
"value",
"is",
"within",
"a",
"range"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/AbstractField.php#L91-L96 |
mtdowling/cron-expression | src/Cron/AbstractField.php | AbstractField.isInIncrementsOfRanges | public function isInIncrementsOfRanges($dateValue, $value)
{
$chunks = array_map('trim', explode('/', $value, 2));
$range = $chunks[0];
$step = isset($chunks[1]) ? $chunks[1] : 0;
// No step or 0 steps aren't cool
if (is_null($step) || '0' === $step || 0 === $step) {
... | php | public function isInIncrementsOfRanges($dateValue, $value)
{
$chunks = array_map('trim', explode('/', $value, 2));
$range = $chunks[0];
$step = isset($chunks[1]) ? $chunks[1] : 0;
// No step or 0 steps aren't cool
if (is_null($step) || '0' === $step || 0 === $step) {
... | [
"public",
"function",
"isInIncrementsOfRanges",
"(",
"$",
"dateValue",
",",
"$",
"value",
")",
"{",
"$",
"chunks",
"=",
"array_map",
"(",
"'trim'",
",",
"explode",
"(",
"'/'",
",",
"$",
"value",
",",
"2",
")",
")",
";",
"$",
"range",
"=",
"$",
"chunk... | Test if a value is within an increments of ranges (offset[-to]/step size)
@param string $dateValue Set date value
@param string $value Value to test
@return bool | [
"Test",
"if",
"a",
"value",
"is",
"within",
"an",
"increments",
"of",
"ranges",
"(",
"offset",
"[",
"-",
"to",
"]",
"/",
"step",
"size",
")"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/AbstractField.php#L106-L142 |
mtdowling/cron-expression | src/Cron/AbstractField.php | AbstractField.getRangeForExpression | public function getRangeForExpression($expression, $max)
{
$values = array();
if ($this->isRange($expression) || $this->isIncrementsOfRanges($expression)) {
if (!$this->isIncrementsOfRanges($expression)) {
list ($offset, $to) = explode('-', $expression);
... | php | public function getRangeForExpression($expression, $max)
{
$values = array();
if ($this->isRange($expression) || $this->isIncrementsOfRanges($expression)) {
if (!$this->isIncrementsOfRanges($expression)) {
list ($offset, $to) = explode('-', $expression);
... | [
"public",
"function",
"getRangeForExpression",
"(",
"$",
"expression",
",",
"$",
"max",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isRange",
"(",
"$",
"expression",
")",
"||",
"$",
"this",
"->",
"isIncrementsOf... | Returns a range of values for the given cron expression
@param string $expression The expression to evaluate
@param int $max Maximum offset for range
@return array | [
"Returns",
"a",
"range",
"of",
"values",
"for",
"the",
"given",
"cron",
"expression"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/AbstractField.php#L152-L180 |
mtdowling/cron-expression | src/Cron/AbstractField.php | AbstractField.validate | public function validate($value)
{
$value = $this->convertLiterals($value);
// All fields allow * as a valid value
if ('*' === $value) {
return true;
}
// You cannot have a range and a list at the same time
if (strpos($value, ',') !== false && strpos($va... | php | public function validate($value)
{
$value = $this->convertLiterals($value);
// All fields allow * as a valid value
if ('*' === $value) {
return true;
}
// You cannot have a range and a list at the same time
if (strpos($value, ',') !== false && strpos($va... | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"convertLiterals",
"(",
"$",
"value",
")",
";",
"// All fields allow * as a valid value",
"if",
"(",
"'*'",
"===",
"$",
"value",
")",
"{",
"return",
"true"... | Checks to see if a value is valid for the field
@param string $value
@return bool | [
"Checks",
"to",
"see",
"if",
"a",
"value",
"is",
"valid",
"for",
"the",
"field"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/AbstractField.php#L200-L251 |
mtdowling/cron-expression | src/Cron/CronExpression.php | CronExpression.factory | public static function factory($expression, FieldFactory $fieldFactory = null)
{
$mappings = array(
'@yearly' => '0 0 1 1 *',
'@annually' => '0 0 1 1 *',
'@monthly' => '0 0 1 * *',
'@weekly' => '0 0 * * 0',
'@daily' => '0 0 * * *',
'@ho... | php | public static function factory($expression, FieldFactory $fieldFactory = null)
{
$mappings = array(
'@yearly' => '0 0 1 1 *',
'@annually' => '0 0 1 1 *',
'@monthly' => '0 0 1 * *',
'@weekly' => '0 0 * * 0',
'@daily' => '0 0 * * *',
'@ho... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"expression",
",",
"FieldFactory",
"$",
"fieldFactory",
"=",
"null",
")",
"{",
"$",
"mappings",
"=",
"array",
"(",
"'@yearly'",
"=>",
"'0 0 1 1 *'",
",",
"'@annually'",
"=>",
"'0 0 1 1 *'",
",",
"'@monthly'"... | Factory method to create a new CronExpression.
@param string $expression The CRON expression to create. There are
several special predefined values which can be used to substitute the
CRON expression:
`@yearly`, `@annually` - Run once a year, midnight, Jan. 1 - 0 0 1 1 *
`@monthly` - Run once a month, midnight, firs... | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"CronExpression",
"."
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/CronExpression.php#L69-L85 |
mtdowling/cron-expression | src/Cron/CronExpression.php | CronExpression.getNextRunDate | public function getNextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false, $timeZone = null)
{
return $this->getRunDate($currentTime, $nth, false, $allowCurrentDate, $timeZone);
} | php | public function getNextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false, $timeZone = null)
{
return $this->getRunDate($currentTime, $nth, false, $allowCurrentDate, $timeZone);
} | [
"public",
"function",
"getNextRunDate",
"(",
"$",
"currentTime",
"=",
"'now'",
",",
"$",
"nth",
"=",
"0",
",",
"$",
"allowCurrentDate",
"=",
"false",
",",
"$",
"timeZone",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getRunDate",
"(",
"$",
"cur... | Get a next run date relative to the current date or a specific date
@param string|\DateTime $currentTime Relative calculation date
@param int $nth Number of matches to skip before returning a
matching next run date. 0, the default, will return the current
date and time if the next run d... | [
"Get",
"a",
"next",
"run",
"date",
"relative",
"to",
"the",
"current",
"date",
"or",
"a",
"specific",
"date"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/CronExpression.php#L195-L198 |
mtdowling/cron-expression | src/Cron/CronExpression.php | CronExpression.getMultipleRunDates | public function getMultipleRunDates($total, $currentTime = 'now', $invert = false, $allowCurrentDate = false, $timeZone = null)
{
$matches = array();
for ($i = 0; $i < max(0, $total); $i++) {
try {
$matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDat... | php | public function getMultipleRunDates($total, $currentTime = 'now', $invert = false, $allowCurrentDate = false, $timeZone = null)
{
$matches = array();
for ($i = 0; $i < max(0, $total); $i++) {
try {
$matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDat... | [
"public",
"function",
"getMultipleRunDates",
"(",
"$",
"total",
",",
"$",
"currentTime",
"=",
"'now'",
",",
"$",
"invert",
"=",
"false",
",",
"$",
"allowCurrentDate",
"=",
"false",
",",
"$",
"timeZone",
"=",
"null",
")",
"{",
"$",
"matches",
"=",
"array"... | Get multiple run dates starting at the current date or a specific date
@param int $total Set the total number of dates to calculate
@param string|\DateTime $currentTime Relative calculation date
@param bool $invert Set to TRUE to retrieve previous dates
@param bool ... | [
"Get",
"multiple",
"run",
"dates",
"starting",
"at",
"the",
"current",
"date",
"or",
"a",
"specific",
"date"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/CronExpression.php#L230-L242 |
mtdowling/cron-expression | src/Cron/CronExpression.php | CronExpression.getExpression | public function getExpression($part = null)
{
if (null === $part) {
return implode(' ', $this->cronParts);
} elseif (array_key_exists($part, $this->cronParts)) {
return $this->cronParts[$part];
}
return null;
} | php | public function getExpression($part = null)
{
if (null === $part) {
return implode(' ', $this->cronParts);
} elseif (array_key_exists($part, $this->cronParts)) {
return $this->cronParts[$part];
}
return null;
} | [
"public",
"function",
"getExpression",
"(",
"$",
"part",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"part",
")",
"{",
"return",
"implode",
"(",
"' '",
",",
"$",
"this",
"->",
"cronParts",
")",
";",
"}",
"elseif",
"(",
"array_key_exists",
"... | Get all or part of the CRON expression
@param string $part Specify the part to retrieve or NULL to get the full
cron schedule string.
@return string|null Returns the CRON expression, a part of the
CRON expression, or NULL if the part was specified but not found | [
"Get",
"all",
"or",
"part",
"of",
"the",
"CRON",
"expression"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/CronExpression.php#L253-L262 |
mtdowling/cron-expression | src/Cron/CronExpression.php | CronExpression.isDue | public function isDue($currentTime = 'now', $timeZone = null)
{
if (is_null($timeZone)) {
$timeZone = date_default_timezone_get();
}
if ('now' === $currentTime) {
$currentDate = date('Y-m-d H:i');
$currentTime = strtotime($currentDate);
} ... | php | public function isDue($currentTime = 'now', $timeZone = null)
{
if (is_null($timeZone)) {
$timeZone = date_default_timezone_get();
}
if ('now' === $currentTime) {
$currentDate = date('Y-m-d H:i');
$currentTime = strtotime($currentDate);
} ... | [
"public",
"function",
"isDue",
"(",
"$",
"currentTime",
"=",
"'now'",
",",
"$",
"timeZone",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"timeZone",
")",
")",
"{",
"$",
"timeZone",
"=",
"date_default_timezone_get",
"(",
")",
";",
"}",
"if",
... | Determine if the cron is due to run based on the current date or a
specific date. This method assumes that the current number of
seconds are irrelevant, and should be called once per minute.
@param string|\DateTime $currentTime Relative calculation date
@param null|string $timeZone Timezone to use instead of ... | [
"Determine",
"if",
"the",
"cron",
"is",
"due",
"to",
"run",
"based",
"on",
"the",
"current",
"date",
"or",
"a",
"specific",
"date",
".",
"This",
"method",
"assumes",
"that",
"the",
"current",
"number",
"of",
"seconds",
"are",
"irrelevant",
"and",
"should",... | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/CronExpression.php#L284-L316 |
mtdowling/cron-expression | src/Cron/DayOfMonthField.php | DayOfMonthField.getNearestWeekday | private static function getNearestWeekday($currentYear, $currentMonth, $targetDay)
{
$tday = str_pad($targetDay, 2, '0', STR_PAD_LEFT);
$target = DateTime::createFromFormat('Y-m-d', "$currentYear-$currentMonth-$tday");
$currentWeekday = (int) $target->format('N');
if ($currentWeekda... | php | private static function getNearestWeekday($currentYear, $currentMonth, $targetDay)
{
$tday = str_pad($targetDay, 2, '0', STR_PAD_LEFT);
$target = DateTime::createFromFormat('Y-m-d', "$currentYear-$currentMonth-$tday");
$currentWeekday = (int) $target->format('N');
if ($currentWeekda... | [
"private",
"static",
"function",
"getNearestWeekday",
"(",
"$",
"currentYear",
",",
"$",
"currentMonth",
",",
"$",
"targetDay",
")",
"{",
"$",
"tday",
"=",
"str_pad",
"(",
"$",
"targetDay",
",",
"2",
",",
"'0'",
",",
"STR_PAD_LEFT",
")",
";",
"$",
"targe... | Get the nearest day of the week for a given day in a month
@param int $currentYear Current year
@param int $currentMonth Current month
@param int $targetDay Target day of the month
@return \DateTime Returns the nearest date | [
"Get",
"the",
"nearest",
"day",
"of",
"the",
"week",
"for",
"a",
"given",
"day",
"in",
"a",
"month"
] | train | https://github.com/mtdowling/cron-expression/blob/37faa61b1ad8d19037753f893f97da927c787de0/src/Cron/DayOfMonthField.php#L39-L60 |
laravel-notification-channels/webpush | src/WebPushServiceProvider.php | WebPushServiceProvider.boot | public function boot()
{
$this->app->when(WebPushChannel::class)
->needs(WebPush::class)
->give(function () {
return new WebPush($this->webPushConfig());
});
if ($this->app->runningInConsole()) {
$this->definePublishing();
}
... | php | public function boot()
{
$this->app->when(WebPushChannel::class)
->needs(WebPush::class)
->give(function () {
return new WebPush($this->webPushConfig());
});
if ($this->app->runningInConsole()) {
$this->definePublishing();
}
... | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"when",
"(",
"WebPushChannel",
"::",
"class",
")",
"->",
"needs",
"(",
"WebPush",
"::",
"class",
")",
"->",
"give",
"(",
"function",
"(",
")",
"{",
"return",
"new",
"WebPush... | Bootstrap the application services.
@return void | [
"Bootstrap",
"the",
"application",
"services",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/WebPushServiceProvider.php#L28-L39 |
laravel-notification-channels/webpush | src/HasPushSubscriptions.php | HasPushSubscriptions.updatePushSubscription | public function updatePushSubscription($endpoint, $key = null, $token = null)
{
$subscription = PushSubscription::findByEndpoint($endpoint);
if ($subscription && $this->pushSubscriptionBelongsToUser($subscription)) {
$subscription->public_key = $key;
$subscription->auth_toke... | php | public function updatePushSubscription($endpoint, $key = null, $token = null)
{
$subscription = PushSubscription::findByEndpoint($endpoint);
if ($subscription && $this->pushSubscriptionBelongsToUser($subscription)) {
$subscription->public_key = $key;
$subscription->auth_toke... | [
"public",
"function",
"updatePushSubscription",
"(",
"$",
"endpoint",
",",
"$",
"key",
"=",
"null",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"subscription",
"=",
"PushSubscription",
"::",
"findByEndpoint",
"(",
"$",
"endpoint",
")",
";",
"if",
"(",
... | Update (or create) user subscription.
@param string $endpoint
@param string|null $key
@param string|null $token
@return \NotificationChannels\WebPush\PushSubscription | [
"Update",
"(",
"or",
"create",
")",
"user",
"subscription",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/HasPushSubscriptions.php#L25-L46 |
laravel-notification-channels/webpush | src/VapidKeysGenerateCommand.php | VapidKeysGenerateCommand.handle | public function handle()
{
$keys = VAPID::createVapidKeys();
if ($this->option('show')) {
$this->line('<comment>VAPID_PUBLIC_KEY='.$keys['publicKey'].'</comment>');
$this->line('<comment>VAPID_PRIVATE_KEY='.$keys['privateKey'].'</comment>');
return;
}
... | php | public function handle()
{
$keys = VAPID::createVapidKeys();
if ($this->option('show')) {
$this->line('<comment>VAPID_PUBLIC_KEY='.$keys['publicKey'].'</comment>');
$this->line('<comment>VAPID_PRIVATE_KEY='.$keys['privateKey'].'</comment>');
return;
}
... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"keys",
"=",
"VAPID",
"::",
"createVapidKeys",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
"'show'",
")",
")",
"{",
"$",
"this",
"->",
"line",
"(",
"'<comment>VAPID_PUBLIC_KEY='",
".",... | Execute the console command.
@return mixed | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/VapidKeysGenerateCommand.php#L31-L47 |
laravel-notification-channels/webpush | src/VapidKeysGenerateCommand.php | VapidKeysGenerateCommand.setKeysInEnvironmentFile | protected function setKeysInEnvironmentFile($keys)
{
$currentKeys = $this->laravel['config']['webpush.vapid'];
if (strlen($currentKeys['public_key']) !== 0 && (! $this->confirmToProceed())) {
return false;
}
$this->writeNewEnvironmentFileWith($keys);
return tru... | php | protected function setKeysInEnvironmentFile($keys)
{
$currentKeys = $this->laravel['config']['webpush.vapid'];
if (strlen($currentKeys['public_key']) !== 0 && (! $this->confirmToProceed())) {
return false;
}
$this->writeNewEnvironmentFileWith($keys);
return tru... | [
"protected",
"function",
"setKeysInEnvironmentFile",
"(",
"$",
"keys",
")",
"{",
"$",
"currentKeys",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'config'",
"]",
"[",
"'webpush.vapid'",
"]",
";",
"if",
"(",
"strlen",
"(",
"$",
"currentKeys",
"[",
"'public_key'",... | Set the keys in the environment file.
@param array $keys
@return bool | [
"Set",
"the",
"keys",
"in",
"the",
"environment",
"file",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/VapidKeysGenerateCommand.php#L55-L66 |
laravel-notification-channels/webpush | src/VapidKeysGenerateCommand.php | VapidKeysGenerateCommand.writeNewEnvironmentFileWith | protected function writeNewEnvironmentFileWith($keys)
{
$contents = file_get_contents($this->laravel->environmentFilePath());
if (! Str::contains($contents, 'VAPID_PUBLIC_KEY')) {
$contents .= PHP_EOL.'VAPID_PUBLIC_KEY=';
}
if (! Str::contains($contents, 'VAPID_PRIVATE_... | php | protected function writeNewEnvironmentFileWith($keys)
{
$contents = file_get_contents($this->laravel->environmentFilePath());
if (! Str::contains($contents, 'VAPID_PUBLIC_KEY')) {
$contents .= PHP_EOL.'VAPID_PUBLIC_KEY=';
}
if (! Str::contains($contents, 'VAPID_PRIVATE_... | [
"protected",
"function",
"writeNewEnvironmentFileWith",
"(",
"$",
"keys",
")",
"{",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"laravel",
"->",
"environmentFilePath",
"(",
")",
")",
";",
"if",
"(",
"!",
"Str",
"::",
"contains",
"(",
... | Write a new environment file with the given keys.
@param array $keys
@return void | [
"Write",
"a",
"new",
"environment",
"file",
"with",
"the",
"given",
"keys",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/VapidKeysGenerateCommand.php#L74-L99 |
laravel-notification-channels/webpush | src/VapidKeysGenerateCommand.php | VapidKeysGenerateCommand.keyReplacementPattern | protected function keyReplacementPattern($keyName)
{
$key = $this->laravel['config']['webpush.vapid'];
if ($keyName === 'VAPID_PUBLIC_KEY') {
$key = $key['public_key'];
} else {
$key = $key['private_key'];
}
$escaped = preg_quote('='.$key, '/');
... | php | protected function keyReplacementPattern($keyName)
{
$key = $this->laravel['config']['webpush.vapid'];
if ($keyName === 'VAPID_PUBLIC_KEY') {
$key = $key['public_key'];
} else {
$key = $key['private_key'];
}
$escaped = preg_quote('='.$key, '/');
... | [
"protected",
"function",
"keyReplacementPattern",
"(",
"$",
"keyName",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"laravel",
"[",
"'config'",
"]",
"[",
"'webpush.vapid'",
"]",
";",
"if",
"(",
"$",
"keyName",
"===",
"'VAPID_PUBLIC_KEY'",
")",
"{",
"$",
... | Get a regex pattern that will match env $keyName with any key.
@param string $keyName
@return string | [
"Get",
"a",
"regex",
"pattern",
"that",
"will",
"match",
"env",
"$keyName",
"with",
"any",
"key",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/VapidKeysGenerateCommand.php#L107-L120 |
laravel-notification-channels/webpush | src/WebPushChannel.php | WebPushChannel.send | public function send($notifiable, Notification $notification)
{
$subscriptions = $notifiable->routeNotificationFor('WebPush');
if (! $subscriptions || $subscriptions->isEmpty()) {
return;
}
$payload = json_encode($notification->toWebPush($notifiable, $notification)->toA... | php | public function send($notifiable, Notification $notification)
{
$subscriptions = $notifiable->routeNotificationFor('WebPush');
if (! $subscriptions || $subscriptions->isEmpty()) {
return;
}
$payload = json_encode($notification->toWebPush($notifiable, $notification)->toA... | [
"public",
"function",
"send",
"(",
"$",
"notifiable",
",",
"Notification",
"$",
"notification",
")",
"{",
"$",
"subscriptions",
"=",
"$",
"notifiable",
"->",
"routeNotificationFor",
"(",
"'WebPush'",
")",
";",
"if",
"(",
"!",
"$",
"subscriptions",
"||",
"$",... | Send the given notification.
@param mixed $notifiable
@param \Illuminate\Notifications\Notification $notification
@return void | [
"Send",
"the",
"given",
"notification",
"."
] | train | https://github.com/laravel-notification-channels/webpush/blob/cb285b704ec877f2de74a1da0c381962e6c2e45b/src/WebPushChannel.php#L29-L51 |
nunomaduro/collision | src/Highlighter.php | Highlighter.highlight | public function highlight(string $content, int $line): string
{
return rtrim($this->getCodeSnippet($content, $line, 4, 4));
} | php | public function highlight(string $content, int $line): string
{
return rtrim($this->getCodeSnippet($content, $line, 4, 4));
} | [
"public",
"function",
"highlight",
"(",
"string",
"$",
"content",
",",
"int",
"$",
"line",
")",
":",
"string",
"{",
"return",
"rtrim",
"(",
"$",
"this",
"->",
"getCodeSnippet",
"(",
"$",
"content",
",",
"$",
"line",
",",
"4",
",",
"4",
")",
")",
";... | {@inheritdoc} | [
"{"
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Highlighter.php#L57-L60 |
nunomaduro/collision | src/Adapters/Laravel/CollisionServiceProvider.php | CollisionServiceProvider.register | public function register()
{
if ($this->app->runningInConsole() && ! $this->app->runningUnitTests()) {
$this->app->singleton(ListenerContract::class, Listener::class);
$this->app->bind(ProviderContract::class, Provider::class);
$appExceptionHandler = $this->app->make(Exc... | php | public function register()
{
if ($this->app->runningInConsole() && ! $this->app->runningUnitTests()) {
$this->app->singleton(ListenerContract::class, Listener::class);
$this->app->bind(ProviderContract::class, Provider::class);
$appExceptionHandler = $this->app->make(Exc... | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"runningInConsole",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"app",
"->",
"runningUnitTests",
"(",
")",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Adapters/Laravel/CollisionServiceProvider.php#L38-L53 |
nunomaduro/collision | src/Writer.php | Writer.write | public function write(Inspector $inspector): void
{
$this->renderTitle($inspector);
$frames = $this->getFrames($inspector);
$editorFrame = array_shift($frames);
if ($this->showEditor && $editorFrame !== null) {
$this->renderEditor($editorFrame);
}
if ($... | php | public function write(Inspector $inspector): void
{
$this->renderTitle($inspector);
$frames = $this->getFrames($inspector);
$editorFrame = array_shift($frames);
if ($this->showEditor && $editorFrame !== null) {
$this->renderEditor($editorFrame);
}
if ($... | [
"public",
"function",
"write",
"(",
"Inspector",
"$",
"inspector",
")",
":",
"void",
"{",
"$",
"this",
"->",
"renderTitle",
"(",
"$",
"inspector",
")",
";",
"$",
"frames",
"=",
"$",
"this",
"->",
"getFrames",
"(",
"$",
"inspector",
")",
";",
"$",
"ed... | {@inheritdoc} | [
"{"
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Writer.php#L97-L113 |
nunomaduro/collision | src/Writer.php | Writer.getFrames | protected function getFrames(Inspector $inspector): array
{
return $inspector->getFrames()
->filter(
function ($frame) {
foreach ($this->ignore as $ignore) {
if (preg_match($ignore, $frame->getFile())) {
retu... | php | protected function getFrames(Inspector $inspector): array
{
return $inspector->getFrames()
->filter(
function ($frame) {
foreach ($this->ignore as $ignore) {
if (preg_match($ignore, $frame->getFile())) {
retu... | [
"protected",
"function",
"getFrames",
"(",
"Inspector",
"$",
"inspector",
")",
":",
"array",
"{",
"return",
"$",
"inspector",
"->",
"getFrames",
"(",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"frame",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
... | Returns pertinent frames.
@param \Whoops\Exception\Inspector $inspector
@return array | [
"Returns",
"pertinent",
"frames",
"."
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Writer.php#L170-L185 |
nunomaduro/collision | src/Writer.php | Writer.renderTitle | protected function renderTitle(Inspector $inspector): WriterContract
{
$exception = $inspector->getException();
$message = $exception->getMessage();
$class = $inspector->getExceptionName();
$this->render("<bg=red;options=bold> $class </> : <comment>$message</>");
return $th... | php | protected function renderTitle(Inspector $inspector): WriterContract
{
$exception = $inspector->getException();
$message = $exception->getMessage();
$class = $inspector->getExceptionName();
$this->render("<bg=red;options=bold> $class </> : <comment>$message</>");
return $th... | [
"protected",
"function",
"renderTitle",
"(",
"Inspector",
"$",
"inspector",
")",
":",
"WriterContract",
"{",
"$",
"exception",
"=",
"$",
"inspector",
"->",
"getException",
"(",
")",
";",
"$",
"message",
"=",
"$",
"exception",
"->",
"getMessage",
"(",
")",
... | Renders the title of the exception.
@param \Whoops\Exception\Inspector $inspector
@return \NunoMaduro\Collision\Contracts\Writer | [
"Renders",
"the",
"title",
"of",
"the",
"exception",
"."
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Writer.php#L194-L203 |
nunomaduro/collision | src/Writer.php | Writer.renderEditor | protected function renderEditor(Frame $frame): WriterContract
{
$this->render('at <fg=green>'.$frame->getFile().'</>'.':<fg=green>'.$frame->getLine().'</>');
$content = $this->highlighter->highlight((string) $frame->getFileContents(), (int) $frame->getLine());
$this->output->writeln($conte... | php | protected function renderEditor(Frame $frame): WriterContract
{
$this->render('at <fg=green>'.$frame->getFile().'</>'.':<fg=green>'.$frame->getLine().'</>');
$content = $this->highlighter->highlight((string) $frame->getFileContents(), (int) $frame->getLine());
$this->output->writeln($conte... | [
"protected",
"function",
"renderEditor",
"(",
"Frame",
"$",
"frame",
")",
":",
"WriterContract",
"{",
"$",
"this",
"->",
"render",
"(",
"'at <fg=green>'",
".",
"$",
"frame",
"->",
"getFile",
"(",
")",
".",
"'</>'",
".",
"':<fg=green>'",
".",
"$",
"frame",
... | Renders the editor containing the code that was the
origin of the exception.
@param \Whoops\Exception\Frame $frame
@return \NunoMaduro\Collision\Contracts\Writer | [
"Renders",
"the",
"editor",
"containing",
"the",
"code",
"that",
"was",
"the",
"origin",
"of",
"the",
"exception",
"."
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Writer.php#L213-L222 |
nunomaduro/collision | src/Writer.php | Writer.renderTrace | protected function renderTrace(array $frames): WriterContract
{
$this->render('<comment>Exception trace:</comment>');
foreach ($frames as $i => $frame) {
if ($i > static::VERBOSITY_NORMAL_FRAMES && $this->output->getVerbosity(
) < OutputInterface::VERBOSITY_VERBOSE) {
... | php | protected function renderTrace(array $frames): WriterContract
{
$this->render('<comment>Exception trace:</comment>');
foreach ($frames as $i => $frame) {
if ($i > static::VERBOSITY_NORMAL_FRAMES && $this->output->getVerbosity(
) < OutputInterface::VERBOSITY_VERBOSE) {
... | [
"protected",
"function",
"renderTrace",
"(",
"array",
"$",
"frames",
")",
":",
"WriterContract",
"{",
"$",
"this",
"->",
"render",
"(",
"'<comment>Exception trace:</comment>'",
")",
";",
"foreach",
"(",
"$",
"frames",
"as",
"$",
"i",
"=>",
"$",
"frame",
")",... | Renders the trace of the exception.
@param array $frames
@return \NunoMaduro\Collision\Contracts\Writer | [
"Renders",
"the",
"trace",
"of",
"the",
"exception",
"."
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Writer.php#L231-L253 |
nunomaduro/collision | src/Writer.php | Writer.render | protected function render(string $message, bool $break = true): WriterContract
{
if ($break) {
$this->output->writeln('');
}
$this->output->writeln(" $message");
return $this;
} | php | protected function render(string $message, bool $break = true): WriterContract
{
if ($break) {
$this->output->writeln('');
}
$this->output->writeln(" $message");
return $this;
} | [
"protected",
"function",
"render",
"(",
"string",
"$",
"message",
",",
"bool",
"$",
"break",
"=",
"true",
")",
":",
"WriterContract",
"{",
"if",
"(",
"$",
"break",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"''",
")",
";",
"}",
"$... | Renders an message into the console.
@param string $message
@param bool $break
@return $this | [
"Renders",
"an",
"message",
"into",
"the",
"console",
"."
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Writer.php#L263-L272 |
nunomaduro/collision | src/Adapters/Laravel/ExceptionHandler.php | ExceptionHandler.renderForConsole | public function renderForConsole($output, Exception $e)
{
if ($e instanceof SymfonyConsoleExceptionInterface) {
$this->appExceptionHandler->renderForConsole($output, $e);
} else {
$handler = $this->container->make(ProviderContract::class)
->register()
... | php | public function renderForConsole($output, Exception $e)
{
if ($e instanceof SymfonyConsoleExceptionInterface) {
$this->appExceptionHandler->renderForConsole($output, $e);
} else {
$handler = $this->container->make(ProviderContract::class)
->register()
... | [
"public",
"function",
"renderForConsole",
"(",
"$",
"output",
",",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"SymfonyConsoleExceptionInterface",
")",
"{",
"$",
"this",
"->",
"appExceptionHandler",
"->",
"renderForConsole",
"(",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/nunomaduro/collision/blob/af42d339fe2742295a54f6fdd42aaa6f8c4aca68/src/Adapters/Laravel/ExceptionHandler.php#L74-L88 |
s-ichikawa/laravel-sendgrid-driver | src/SendgridTransportServiceProvider.php | SendgridTransportServiceProvider.register | public function register()
{
$this->app->afterResolving(TransportManager::class, function(TransportManager $manager) {
$this->extendTransportManager($manager);
});
} | php | public function register()
{
$this->app->afterResolving(TransportManager::class, function(TransportManager $manager) {
$this->extendTransportManager($manager);
});
} | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"afterResolving",
"(",
"TransportManager",
"::",
"class",
",",
"function",
"(",
"TransportManager",
"$",
"manager",
")",
"{",
"$",
"this",
"->",
"extendTransportManager",
"(",
"... | Register the Swift Transport instance.
@return void | [
"Register",
"the",
"Swift",
"Transport",
"instance",
"."
] | train | https://github.com/s-ichikawa/laravel-sendgrid-driver/blob/5092c3f856581bd61b691d7e86ebb9fcb6867683/src/SendgridTransportServiceProvider.php#L17-L22 |
s-ichikawa/laravel-sendgrid-driver | src/Transport/SendgridTransport.php | SendgridTransport.send | public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
$this->beforeSendPerformed($message);
$data = [
'personalizations' => $this->getPersonalizations($message),
'from' => $this->getFrom($message),
'subject' => ... | php | public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
$this->beforeSendPerformed($message);
$data = [
'personalizations' => $this->getPersonalizations($message),
'from' => $this->getFrom($message),
'subject' => ... | [
"public",
"function",
"send",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
",",
"&",
"$",
"failedRecipients",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"beforeSendPerformed",
"(",
"$",
"message",
")",
";",
"$",
"data",
"=",
"[",
"'personalizations'",
"=>... | {@inheritdoc} | [
"{"
] | train | https://github.com/s-ichikawa/laravel-sendgrid-driver/blob/5092c3f856581bd61b691d7e86ebb9fcb6867683/src/Transport/SendgridTransport.php#L43-L90 |
s-ichikawa/laravel-sendgrid-driver | src/Transport/SendgridTransport.php | SendgridTransport.getFrom | private function getFrom(Swift_Mime_SimpleMessage $message)
{
if ($message->getFrom()) {
foreach ($message->getFrom() as $email => $name) {
return ['email' => $email, 'name' => $name];
}
}
return [];
} | php | private function getFrom(Swift_Mime_SimpleMessage $message)
{
if ($message->getFrom()) {
foreach ($message->getFrom() as $email => $name) {
return ['email' => $email, 'name' => $name];
}
}
return [];
} | [
"private",
"function",
"getFrom",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"message",
"->",
"getFrom",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"message",
"->",
"getFrom",
"(",
")",
"as",
"$",
"email",
"=>",
"$",
"name... | Get From Addresses.
@param Swift_Mime_SimpleMessage $message
@return array | [
"Get",
"From",
"Addresses",
"."
] | train | https://github.com/s-ichikawa/laravel-sendgrid-driver/blob/5092c3f856581bd61b691d7e86ebb9fcb6867683/src/Transport/SendgridTransport.php#L130-L138 |
s-ichikawa/laravel-sendgrid-driver | src/Transport/SendgridTransport.php | SendgridTransport.getReplyTo | private function getReplyTo(Swift_Mime_SimpleMessage $message)
{
if ($message->getReplyTo()) {
foreach ($message->getReplyTo() as $email => $name) {
return ['email' => $email, 'name' => $name];
}
}
return null;
} | php | private function getReplyTo(Swift_Mime_SimpleMessage $message)
{
if ($message->getReplyTo()) {
foreach ($message->getReplyTo() as $email => $name) {
return ['email' => $email, 'name' => $name];
}
}
return null;
} | [
"private",
"function",
"getReplyTo",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"message",
"->",
"getReplyTo",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"message",
"->",
"getReplyTo",
"(",
")",
"as",
"$",
"email",
"=>",
"$"... | Get ReplyTo Addresses.
@param Swift_Mime_SimpleMessage $message
@return array | [
"Get",
"ReplyTo",
"Addresses",
"."
] | train | https://github.com/s-ichikawa/laravel-sendgrid-driver/blob/5092c3f856581bd61b691d7e86ebb9fcb6867683/src/Transport/SendgridTransport.php#L146-L154 |
s-ichikawa/laravel-sendgrid-driver | src/Transport/SendgridTransport.php | SendgridTransport.getContents | private function getContents(Swift_Mime_SimpleMessage $message)
{
$contentType = $message->getContentType();
switch ($contentType) {
case 'text/plain':
return [
[
'type' => 'text/plain',
'value' => $mess... | php | private function getContents(Swift_Mime_SimpleMessage $message)
{
$contentType = $message->getContentType();
switch ($contentType) {
case 'text/plain':
return [
[
'type' => 'text/plain',
'value' => $mess... | [
"private",
"function",
"getContents",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
")",
"{",
"$",
"contentType",
"=",
"$",
"message",
"->",
"getContentType",
"(",
")",
";",
"switch",
"(",
"$",
"contentType",
")",
"{",
"case",
"'text/plain'",
":",
"return",... | Get contents.
@param Swift_Mime_SimpleMessage $message
@return array | [
"Get",
"contents",
"."
] | train | https://github.com/s-ichikawa/laravel-sendgrid-driver/blob/5092c3f856581bd61b691d7e86ebb9fcb6867683/src/Transport/SendgridTransport.php#L162-L203 |
s-ichikawa/laravel-sendgrid-driver | src/Transport/SendgridTransport.php | SendgridTransport.setParameters | protected function setParameters(Swift_Mime_SimpleMessage $message, $data)
{
$this->numberOfRecipients = 0;
$smtp_api = [];
foreach ($message->getChildren() as $attachment) {
if (!$attachment instanceof Swift_Image
|| !in_array(self::SMTP_API_NAME, [$attachment->... | php | protected function setParameters(Swift_Mime_SimpleMessage $message, $data)
{
$this->numberOfRecipients = 0;
$smtp_api = [];
foreach ($message->getChildren() as $attachment) {
if (!$attachment instanceof Swift_Image
|| !in_array(self::SMTP_API_NAME, [$attachment->... | [
"protected",
"function",
"setParameters",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"numberOfRecipients",
"=",
"0",
";",
"$",
"smtp_api",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"message",
"->",
"getCh... | Set Request Body Parameters
@param Swift_Mime_SimpleMessage $message
@param array $data
@return array
@throws \Exception | [
"Set",
"Request",
"Body",
"Parameters"
] | train | https://github.com/s-ichikawa/laravel-sendgrid-driver/blob/5092c3f856581bd61b691d7e86ebb9fcb6867683/src/Transport/SendgridTransport.php#L238-L288 |
algolia/search-bundle | src/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('algolia_search');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $tr... | php | public function getConfigTreeBuilder()
{
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('algolia_search');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $tr... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"if",
"(",
"method_exists",
"(",
"TreeBuilder",
"::",
"class",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'algolia_search'",
")",
";",
"$",
"rootNode",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/algolia/search-bundle/blob/498dff0e9b71183b72a41d79586d67c773dca754/src/DependencyInjection/Configuration.php#L19-L72 |
algolia/search-bundle | src/Entity/Aggregator.php | Aggregator.getEntityClassFromObjectID | public static function getEntityClassFromObjectID($objectID)
{
$type = explode('::', $objectID)[0];
if (in_array($type, static::getEntities(), true)) {
return $type;
}
throw new EntityNotFoundInObjectID("Entity class from ObjectID {$objectID} not found.");
} | php | public static function getEntityClassFromObjectID($objectID)
{
$type = explode('::', $objectID)[0];
if (in_array($type, static::getEntities(), true)) {
return $type;
}
throw new EntityNotFoundInObjectID("Entity class from ObjectID {$objectID} not found.");
} | [
"public",
"static",
"function",
"getEntityClassFromObjectID",
"(",
"$",
"objectID",
")",
"{",
"$",
"type",
"=",
"explode",
"(",
"'::'",
",",
"$",
"objectID",
")",
"[",
"0",
"]",
";",
"if",
"(",
"in_array",
"(",
"$",
"type",
",",
"static",
"::",
"getEnt... | Returns an entity class name from the provided object id.
@param string $objectID
@return object | [
"Returns",
"an",
"entity",
"class",
"name",
"from",
"the",
"provided",
"object",
"id",
"."
] | train | https://github.com/algolia/search-bundle/blob/498dff0e9b71183b72a41d79586d67c773dca754/src/Entity/Aggregator.php#L75-L84 |
algolia/search-bundle | src/Entity/Aggregator.php | Aggregator.normalize | public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
{
return array_merge(['objectID' => $this->objectID], $normalizer->normalize($this->entity, $format, $context));
} | php | public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
{
return array_merge(['objectID' => $this->objectID], $normalizer->normalize($this->entity, $format, $context));
} | [
"public",
"function",
"normalize",
"(",
"NormalizerInterface",
"$",
"normalizer",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"return",
"array_merge",
"(",
"[",
"'objectID'",
"=>",
"$",
"this",
"->",
"objectID",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/algolia/search-bundle/blob/498dff0e9b71183b72a41d79586d67c773dca754/src/Entity/Aggregator.php#L89-L92 |
algolia/search-bundle | src/DependencyInjection/AlgoliaSearchExtension.php | AlgoliaSearchExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$configuration = new Configuration();
$config = $this->processConfiguration($configurat... | php | public function load(array $configs, ContainerBuilder $container)
{
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$configuration = new Configuration();
$config = $this->processConfiguration($configurat... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"Loader",
"\\",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resource... | {@inheritdoc} | [
"{"
] | train | https://github.com/algolia/search-bundle/blob/498dff0e9b71183b72a41d79586d67c773dca754/src/DependencyInjection/AlgoliaSearchExtension.php#L25-L74 |
algolia/search-bundle | src/IndexManager.php | IndexManager.forEachChunk | private function forEachChunk(ObjectManager $objectManager, array $entities, $operation)
{
$batch = [];
foreach (array_chunk($entities, $this->configuration['batchSize']) as $chunk) {
$searchableEntitiesChunk = [];
foreach ($chunk as $entity) {
$entityClassNam... | php | private function forEachChunk(ObjectManager $objectManager, array $entities, $operation)
{
$batch = [];
foreach (array_chunk($entities, $this->configuration['batchSize']) as $chunk) {
$searchableEntitiesChunk = [];
foreach ($chunk as $entity) {
$entityClassNam... | [
"private",
"function",
"forEachChunk",
"(",
"ObjectManager",
"$",
"objectManager",
",",
"array",
"$",
"entities",
",",
"$",
"operation",
")",
"{",
"$",
"batch",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_chunk",
"(",
"$",
"entities",
",",
"$",
"this",
"-... | For each chunk performs the provided operation.
@param \Doctrine\Common\Persistence\ObjectManager $objectManager
@param array $entities
@param callable $operation
@return array | [
"For",
"each",
"chunk",
"performs",
"the",
"provided",
"operation",
"."
] | train | https://github.com/algolia/search-bundle/blob/498dff0e9b71183b72a41d79586d67c773dca754/src/IndexManager.php#L266-L287 |
algolia/search-bundle | src/IndexManager.php | IndexManager.getAggregatorsFromEntities | private function getAggregatorsFromEntities(ObjectManager $objectManager, array $entities)
{
$aggregators = [];
foreach ($entities as $entity) {
$entityClassName = ClassUtils::getClass($entity);
if (array_key_exists($entityClassName, $this->entitiesAggregators)) {
... | php | private function getAggregatorsFromEntities(ObjectManager $objectManager, array $entities)
{
$aggregators = [];
foreach ($entities as $entity) {
$entityClassName = ClassUtils::getClass($entity);
if (array_key_exists($entityClassName, $this->entitiesAggregators)) {
... | [
"private",
"function",
"getAggregatorsFromEntities",
"(",
"ObjectManager",
"$",
"objectManager",
",",
"array",
"$",
"entities",
")",
"{",
"$",
"aggregators",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"entities",
"as",
"$",
"entity",
")",
"{",
"$",
"entityClas... | Returns the aggregators instances of the provided entities.
@param \Doctrine\Common\Persistence\ObjectManager $objectManager
@param object[] $entities
@return array | [
"Returns",
"the",
"aggregators",
"instances",
"of",
"the",
"provided",
"entities",
"."
] | train | https://github.com/algolia/search-bundle/blob/498dff0e9b71183b72a41d79586d67c773dca754/src/IndexManager.php#L296-L310 |
benjaminkott/bootstrap_package | Classes/ViewHelpers/Format/LowercaseDashedViewHelper.php | LowercaseDashedViewHelper.renderStatic | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
preg_match_all(
'!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!',
$renderChildrenClosure(),
$matches
);
$ret = $m... | php | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
preg_match_all(
'!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!',
$renderChildrenClosure(),
$matches
);
$ret = $m... | [
"public",
"static",
"function",
"renderStatic",
"(",
"array",
"$",
"arguments",
",",
"\\",
"Closure",
"$",
"renderChildrenClosure",
",",
"RenderingContextInterface",
"$",
"renderingContext",
")",
"{",
"preg_match_all",
"(",
"'!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z... | @param array $arguments
@param \Closure $renderChildrenClosure
@param RenderingContextInterface $renderingContext
@return string the formatted amount | [
"@param",
"array",
"$arguments",
"@param",
"\\",
"Closure",
"$renderChildrenClosure",
"@param",
"RenderingContextInterface",
"$renderingContext"
] | train | https://github.com/benjaminkott/bootstrap_package/blob/b8f7d912ffbba89cea638566d59cad01c87971a5/Classes/ViewHelpers/Format/LowercaseDashedViewHelper.php#L30-L42 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.