id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
224,500 | doctrine/oxm | lib/Doctrine/OXM/Tools/XmlEntityGenerator.php | XmlEntityGenerator.writeXmlEntityClass | public function writeXmlEntityClass(ClassMetadataInfo $metadata, $outputDirectory)
{
$path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension;
$dir = dirname($path);
if ( ! is_dir($dir)) {
mkdir($dir, 0777, true);
}
... | php | public function writeXmlEntityClass(ClassMetadataInfo $metadata, $outputDirectory)
{
$path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension;
$dir = dirname($path);
if ( ! is_dir($dir)) {
mkdir($dir, 0777, true);
}
... | [
"public",
"function",
"writeXmlEntityClass",
"(",
"ClassMetadataInfo",
"$",
"metadata",
",",
"$",
"outputDirectory",
")",
"{",
"$",
"path",
"=",
"$",
"outputDirectory",
".",
"'/'",
".",
"str_replace",
"(",
"'\\\\'",
",",
"DIRECTORY_SEPARATOR",
",",
"$",
"metadat... | Generated and write xml-entity class to disk for the given ClassMetadataInfo instance
@param ClassMetadataInfo $metadata
@param string $outputDirectory
@return void | [
"Generated",
"and",
"write",
"xml",
"-",
"entity",
"class",
"to",
"disk",
"for",
"the",
"given",
"ClassMetadataInfo",
"instance"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Tools/XmlEntityGenerator.php#L161-L189 |
224,501 | doctrine/oxm | lib/Doctrine/OXM/Tools/XmlEntityGenerator.php | XmlEntityGenerator.generateXmlEntityClass | public function generateXmlEntityClass(ClassMetadataInfo $metadata)
{
$placeHolders = array(
'<namespace>',
'<imports>',
'<xmlEntityAnnotation>',
'<xmlEntityClassName>',
'<xmlEntityBody>'
);
$replacements = array(
$this... | php | public function generateXmlEntityClass(ClassMetadataInfo $metadata)
{
$placeHolders = array(
'<namespace>',
'<imports>',
'<xmlEntityAnnotation>',
'<xmlEntityClassName>',
'<xmlEntityBody>'
);
$replacements = array(
$this... | [
"public",
"function",
"generateXmlEntityClass",
"(",
"ClassMetadataInfo",
"$",
"metadata",
")",
"{",
"$",
"placeHolders",
"=",
"array",
"(",
"'<namespace>'",
",",
"'<imports>'",
",",
"'<xmlEntityAnnotation>'",
",",
"'<xmlEntityClassName>'",
",",
"'<xmlEntityBody>'",
")"... | Generate a PHP5 Doctrine 2 xml-entity class from the given ClassMetadataInfo instance
@param ClassMetadataInfo $metadata
@return string $code | [
"Generate",
"a",
"PHP5",
"Doctrine",
"2",
"xml",
"-",
"entity",
"class",
"from",
"the",
"given",
"ClassMetadataInfo",
"instance"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Tools/XmlEntityGenerator.php#L197-L217 |
224,502 | doctrine/oxm | lib/Doctrine/OXM/Tools/XmlEntityGenerator.php | XmlEntityGenerator.generateUpdatedXmlEntityClass | public function generateUpdatedXmlEntityClass(ClassMetadataInfo $metadata, $path)
{
$currentCode = file_get_contents($path);
$body = $this->generateXmlEntityBody($metadata);
$body = str_replace('<spaces>', $this->spaces, $body);
$last = strrpos($currentCode, '}');
return su... | php | public function generateUpdatedXmlEntityClass(ClassMetadataInfo $metadata, $path)
{
$currentCode = file_get_contents($path);
$body = $this->generateXmlEntityBody($metadata);
$body = str_replace('<spaces>', $this->spaces, $body);
$last = strrpos($currentCode, '}');
return su... | [
"public",
"function",
"generateUpdatedXmlEntityClass",
"(",
"ClassMetadataInfo",
"$",
"metadata",
",",
"$",
"path",
")",
"{",
"$",
"currentCode",
"=",
"file_get_contents",
"(",
"$",
"path",
")",
";",
"$",
"body",
"=",
"$",
"this",
"->",
"generateXmlEntityBody",
... | Generate the updated code for the given ClassMetadataInfo and xml-entity at path
@param ClassMetadataInfo $metadata
@param string $path
@return string $code; | [
"Generate",
"the",
"updated",
"code",
"for",
"the",
"given",
"ClassMetadataInfo",
"and",
"xml",
"-",
"entity",
"at",
"path"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Tools/XmlEntityGenerator.php#L226-L235 |
224,503 | doctrine/oxm | lib/Doctrine/OXM/Mapping/Driver/AbstractFileDriver.php | AbstractFileDriver.getElement | public function getElement($className)
{
if ($file = $this->findMappingFile($className)) {
$result = $this->loadMappingFile($file);
return $result[$className];
}
return false;
} | php | public function getElement($className)
{
if ($file = $this->findMappingFile($className)) {
$result = $this->loadMappingFile($file);
return $result[$className];
}
return false;
} | [
"public",
"function",
"getElement",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"findMappingFile",
"(",
"$",
"className",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"loadMappingFile",
"(",
"$",
"file",
... | Get the element of schema meta data for the class from the mapping file.
This will lazily load the mapping file if it is not loaded yet
@return array $element The element of schema meta data | [
"Get",
"the",
"element",
"of",
"schema",
"meta",
"data",
"for",
"the",
"class",
"from",
"the",
"mapping",
"file",
".",
"This",
"will",
"lazily",
"load",
"the",
"mapping",
"file",
"if",
"it",
"is",
"not",
"loaded",
"yet"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/Driver/AbstractFileDriver.php#L108-L115 |
224,504 | doctrine/oxm | lib/Doctrine/OXM/Mapping/Driver/AbstractFileDriver.php | AbstractFileDriver.isTransient | public function isTransient($className)
{
$fileName = str_replace('\\', '.', $className) . $this->fileExtension;
// Check whether file exists
foreach ((array) $this->paths as $path) {
if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
return false;
... | php | public function isTransient($className)
{
$fileName = str_replace('\\', '.', $className) . $this->fileExtension;
// Check whether file exists
foreach ((array) $this->paths as $path) {
if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
return false;
... | [
"public",
"function",
"isTransient",
"(",
"$",
"className",
")",
"{",
"$",
"fileName",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'.'",
",",
"$",
"className",
")",
".",
"$",
"this",
"->",
"fileExtension",
";",
"// Check whether file exists",
"foreach",
"(",
"(... | Whether the class with the specified name should have its metadata loaded.
This is only the case if it is either mapped as an Entity or a
MappedSuperclass.
@param string $className
@return boolean | [
"Whether",
"the",
"class",
"with",
"the",
"specified",
"name",
"should",
"have",
"its",
"metadata",
"loaded",
".",
"This",
"is",
"only",
"the",
"case",
"if",
"it",
"is",
"either",
"mapped",
"as",
"an",
"Entity",
"or",
"a",
"MappedSuperclass",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/Driver/AbstractFileDriver.php#L125-L137 |
224,505 | doctrine/oxm | lib/Doctrine/OXM/Mapping/Driver/AbstractFileDriver.php | AbstractFileDriver.findMappingFile | protected function findMappingFile($className)
{
$fileName = str_replace('\\', '.', $className) . $this->fileExtension;
// Check whether file exists
foreach ((array) $this->paths as $path) {
if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
return $path... | php | protected function findMappingFile($className)
{
$fileName = str_replace('\\', '.', $className) . $this->fileExtension;
// Check whether file exists
foreach ((array) $this->paths as $path) {
if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
return $path... | [
"protected",
"function",
"findMappingFile",
"(",
"$",
"className",
")",
"{",
"$",
"fileName",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'.'",
",",
"$",
"className",
")",
".",
"$",
"this",
"->",
"fileExtension",
";",
"// Check whether file exists",
"foreach",
"(... | Finds the mapping file for the class with the given name by searching
through the configured paths.
@param $className
@return string The (absolute) file name.
@throws MappingException | [
"Finds",
"the",
"mapping",
"file",
"for",
"the",
"class",
"with",
"the",
"given",
"name",
"by",
"searching",
"through",
"the",
"configured",
"paths",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/Driver/AbstractFileDriver.php#L183-L196 |
224,506 | nealio82/avro-php | src/Avro/DataIO/DataIOWriter.php | DataIOWriter.write_block | private function write_block()
{
if ($this->block_count > 0) {
$this->encoder->write_long($this->block_count);
$to_write = strval($this->buffer);
$this->encoder->write_long(strlen($to_write));
if (DataIO::is_valid_codec(
$this->metadata[DataIO... | php | private function write_block()
{
if ($this->block_count > 0) {
$this->encoder->write_long($this->block_count);
$to_write = strval($this->buffer);
$this->encoder->write_long(strlen($to_write));
if (DataIO::is_valid_codec(
$this->metadata[DataIO... | [
"private",
"function",
"write_block",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"block_count",
">",
"0",
")",
"{",
"$",
"this",
"->",
"encoder",
"->",
"write_long",
"(",
"$",
"this",
"->",
"block_count",
")",
";",
"$",
"to_write",
"=",
"strval",
"... | Writes a block of data to the IO object container.
@throws DataIOException if the codec provided by the encoder
is not supported
@internal Should the codec check happen in the constructor?
Why wait until we're writing data? | [
"Writes",
"a",
"block",
"of",
"data",
"to",
"the",
"IO",
"object",
"container",
"."
] | bf99a4155cb6c2df4a153b2b190389a48c1b79f7 | https://github.com/nealio82/avro-php/blob/bf99a4155cb6c2df4a153b2b190389a48c1b79f7/src/Avro/DataIO/DataIOWriter.php#L145-L165 |
224,507 | nealio82/avro-php | src/Avro/DataIO/DataIOWriter.php | DataIOWriter.write_header | private function write_header()
{
$this->write(DataIO::magic());
$this->datum_writer->write_data(DataIO::metadata_schema(),
$this->metadata, $this->encoder);
$this->write($this->sync_marker);
} | php | private function write_header()
{
$this->write(DataIO::magic());
$this->datum_writer->write_data(DataIO::metadata_schema(),
$this->metadata, $this->encoder);
$this->write($this->sync_marker);
} | [
"private",
"function",
"write_header",
"(",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"DataIO",
"::",
"magic",
"(",
")",
")",
";",
"$",
"this",
"->",
"datum_writer",
"->",
"write_data",
"(",
"DataIO",
"::",
"metadata_schema",
"(",
")",
",",
"$",
"this... | Writes the header of the IO object container | [
"Writes",
"the",
"header",
"of",
"the",
"IO",
"object",
"container"
] | bf99a4155cb6c2df4a153b2b190389a48c1b79f7 | https://github.com/nealio82/avro-php/blob/bf99a4155cb6c2df4a153b2b190389a48c1b79f7/src/Avro/DataIO/DataIOWriter.php#L170-L176 |
224,508 | someline/rest-api-client | src/Someline/Rest/RestClient.php | RestClient.setUp | public function setUp()
{
$base_uri = $this->getServiceConfig('base_uri');
$guzzle_client_config = $this->getConfig('guzzle_client_config', []);
if (!ends_with($base_uri, '/')) {
$base_uri .= '/';
}
$this->printLine("REST CLIENT BASE URI: " . $base_uri);
$... | php | public function setUp()
{
$base_uri = $this->getServiceConfig('base_uri');
$guzzle_client_config = $this->getConfig('guzzle_client_config', []);
if (!ends_with($base_uri, '/')) {
$base_uri .= '/';
}
$this->printLine("REST CLIENT BASE URI: " . $base_uri);
$... | [
"public",
"function",
"setUp",
"(",
")",
"{",
"$",
"base_uri",
"=",
"$",
"this",
"->",
"getServiceConfig",
"(",
"'base_uri'",
")",
";",
"$",
"guzzle_client_config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'guzzle_client_config'",
",",
"[",
"]",
")",
";"... | Set Up Client | [
"Set",
"Up",
"Client"
] | b9ffd265a6ff086941d90a8d899c72a28e5a207e | https://github.com/someline/rest-api-client/blob/b9ffd265a6ff086941d90a8d899c72a28e5a207e/src/Someline/Rest/RestClient.php#L194-L206 |
224,509 | someline/rest-api-client | src/Someline/Rest/RestClient.php | RestClient.useOAuthTokenFromCache | private function useOAuthTokenFromCache()
{
if (!$this->use_cache_token) {
return;
}
$this->oauth_tokens = \Cache::get($this->getOauthTokensCacheKey(), []);
if (!empty($this->oauth_tokens)) {
$this->printLine("Using OAuth Tokens from cache:");
$th... | php | private function useOAuthTokenFromCache()
{
if (!$this->use_cache_token) {
return;
}
$this->oauth_tokens = \Cache::get($this->getOauthTokensCacheKey(), []);
if (!empty($this->oauth_tokens)) {
$this->printLine("Using OAuth Tokens from cache:");
$th... | [
"private",
"function",
"useOAuthTokenFromCache",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"use_cache_token",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"oauth_tokens",
"=",
"\\",
"Cache",
"::",
"get",
"(",
"$",
"this",
"->",
"getOauthToken... | Use OAuth Tokens from Cache | [
"Use",
"OAuth",
"Tokens",
"from",
"Cache"
] | b9ffd265a6ff086941d90a8d899c72a28e5a207e | https://github.com/someline/rest-api-client/blob/b9ffd265a6ff086941d90a8d899c72a28e5a207e/src/Someline/Rest/RestClient.php#L318-L329 |
224,510 | bramstroker/zf2-fullpage-cache | src/Service/CacheService.php | CacheService.load | public function load(MvcEvent $mvcEvent)
{
$id = $this->getIdGenerator()->generate();
if (!$this->getCacheStorage()->hasItem($id)) {
return null;
};
$event = $this->createCacheEvent(CacheEvent::EVENT_LOAD, $mvcEvent, $id);
$results = $this->getEventManager()->tr... | php | public function load(MvcEvent $mvcEvent)
{
$id = $this->getIdGenerator()->generate();
if (!$this->getCacheStorage()->hasItem($id)) {
return null;
};
$event = $this->createCacheEvent(CacheEvent::EVENT_LOAD, $mvcEvent, $id);
$results = $this->getEventManager()->tr... | [
"public",
"function",
"load",
"(",
"MvcEvent",
"$",
"mvcEvent",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getIdGenerator",
"(",
")",
"->",
"generate",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getCacheStorage",
"(",
")",
"->",
"hasItem",... | Check if a page is saved in the cache and return contents. Return null when no item is found.
@param MvcEvent $mvcEvent
@return mixed|null | [
"Check",
"if",
"a",
"page",
"is",
"saved",
"in",
"the",
"cache",
"and",
"return",
"contents",
".",
"Return",
"null",
"when",
"no",
"item",
"is",
"found",
"."
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Service/CacheService.php#L68-L86 |
224,511 | bramstroker/zf2-fullpage-cache | src/Service/CacheService.php | CacheService.save | public function save(MvcEvent $mvcEvent)
{
if (!$this->shouldCacheRequest($mvcEvent)) {
return;
}
$id = $this->getIdGenerator()->generate();
$item = ($this->getOptions()->getCacheResponse() === true) ? serialize($mvcEvent->getResponse()) : $mvcEvent->getResponse()->getC... | php | public function save(MvcEvent $mvcEvent)
{
if (!$this->shouldCacheRequest($mvcEvent)) {
return;
}
$id = $this->getIdGenerator()->generate();
$item = ($this->getOptions()->getCacheResponse() === true) ? serialize($mvcEvent->getResponse()) : $mvcEvent->getResponse()->getC... | [
"public",
"function",
"save",
"(",
"MvcEvent",
"$",
"mvcEvent",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"shouldCacheRequest",
"(",
"$",
"mvcEvent",
")",
")",
"{",
"return",
";",
"}",
"$",
"id",
"=",
"$",
"this",
"->",
"getIdGenerator",
"(",
")",... | Save the page contents to the cache storage.
@param MvcEvent $mvcEvent | [
"Save",
"the",
"page",
"contents",
"to",
"the",
"cache",
"storage",
"."
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Service/CacheService.php#L93-L113 |
224,512 | bramstroker/zf2-fullpage-cache | src/Service/CacheService.php | CacheService.shouldCacheRequest | protected function shouldCacheRequest(MvcEvent $mvcEvent)
{
$event = $this->createCacheEvent(CacheEvent::EVENT_SHOULDCACHE, $mvcEvent);
$results = $this->getEventManager()->triggerEventUntil(function ($result) {
return $result;
}, $event);
if ($results->stopped()) {
... | php | protected function shouldCacheRequest(MvcEvent $mvcEvent)
{
$event = $this->createCacheEvent(CacheEvent::EVENT_SHOULDCACHE, $mvcEvent);
$results = $this->getEventManager()->triggerEventUntil(function ($result) {
return $result;
}, $event);
if ($results->stopped()) {
... | [
"protected",
"function",
"shouldCacheRequest",
"(",
"MvcEvent",
"$",
"mvcEvent",
")",
"{",
"$",
"event",
"=",
"$",
"this",
"->",
"createCacheEvent",
"(",
"CacheEvent",
"::",
"EVENT_SHOULDCACHE",
",",
"$",
"mvcEvent",
")",
";",
"$",
"results",
"=",
"$",
"this... | Determine if we should cache the current request
@param MvcEvent $mvcEvent
@return bool | [
"Determine",
"if",
"we",
"should",
"cache",
"the",
"current",
"request"
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Service/CacheService.php#L121-L134 |
224,513 | bramstroker/zf2-fullpage-cache | src/Service/CacheService.php | CacheService.getTags | public function getTags(MvcEvent $event)
{
$routeName = $event->getRouteMatch()->getMatchedRouteName();
$tags = [
'route_' . $routeName
];
foreach ($event->getRouteMatch()->getParams() as $key => $value) {
if ($key == 'controller') {
$tags[] = ... | php | public function getTags(MvcEvent $event)
{
$routeName = $event->getRouteMatch()->getMatchedRouteName();
$tags = [
'route_' . $routeName
];
foreach ($event->getRouteMatch()->getParams() as $key => $value) {
if ($key == 'controller') {
$tags[] = ... | [
"public",
"function",
"getTags",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"routeName",
"=",
"$",
"event",
"->",
"getRouteMatch",
"(",
")",
"->",
"getMatchedRouteName",
"(",
")",
";",
"$",
"tags",
"=",
"[",
"'route_'",
".",
"$",
"routeName",
"]",
"... | Cache tags to use for this page
@param MvcEvent $event
@return array | [
"Cache",
"tags",
"to",
"use",
"for",
"this",
"page"
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Service/CacheService.php#L159-L174 |
224,514 | doctrine/oxm | lib/Doctrine/OXM/XmlEntityRepository.php | XmlEntityRepository.find | public function find($id, $lockMode = LockMode::NONE, $lockVersion = null)
{
// Check identity map first
if ($entity = $this->xem->getUnitOfWork()->tryGetById($id, $this->class->rootXmlEntityName)) {
if ($lockMode != LockMode::NONE) {
$this->xem->lock($entity, $lockMode, ... | php | public function find($id, $lockMode = LockMode::NONE, $lockVersion = null)
{
// Check identity map first
if ($entity = $this->xem->getUnitOfWork()->tryGetById($id, $this->class->rootXmlEntityName)) {
if ($lockMode != LockMode::NONE) {
$this->xem->lock($entity, $lockMode, ... | [
"public",
"function",
"find",
"(",
"$",
"id",
",",
"$",
"lockMode",
"=",
"LockMode",
"::",
"NONE",
",",
"$",
"lockVersion",
"=",
"null",
")",
"{",
"// Check identity map first",
"if",
"(",
"$",
"entity",
"=",
"$",
"this",
"->",
"xem",
"->",
"getUnitOfWor... | Finds an entity by its identifier.
@param $id The identifier.
@param int $lockMode
@param int $lockVersion
@return object The entity. | [
"Finds",
"an",
"entity",
"by",
"its",
"identifier",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/XmlEntityRepository.php#L103-L132 |
224,515 | doctrine/oxm | lib/Doctrine/OXM/Mapping/Driver/PHPDriver.php | PHPDriver.loadMetadataForClass | public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
{
$this->metadata = $metadata;
$this->loadMappingFile($this->findMappingFile($className));
} | php | public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
{
$this->metadata = $metadata;
$this->loadMappingFile($this->findMappingFile($className));
} | [
"public",
"function",
"loadMetadataForClass",
"(",
"$",
"className",
",",
"ClassMetadataInfo",
"$",
"metadata",
")",
"{",
"$",
"this",
"->",
"metadata",
"=",
"$",
"metadata",
";",
"$",
"this",
"->",
"loadMappingFile",
"(",
"$",
"this",
"->",
"findMappingFile",... | Loads the mapping for the specified class into the provided container.
@param string $className
@param Mapping $mapping | [
"Loads",
"the",
"mapping",
"for",
"the",
"specified",
"class",
"into",
"the",
"provided",
"container",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/Driver/PHPDriver.php#L44-L48 |
224,516 | boboldehampsink/tagmanager | controllers/TagManagerController.php | TagManagerController.actionEditTag | public function actionEditTag(array $variables = array())
{
if (!empty($variables['groupHandle'])) {
$variables['group'] = craft()->tags->getTagGroupByHandle($variables['groupHandle']);
} elseif (!empty($variables['groupId'])) {
$variables['group'] = craft()->tags->getTagGrou... | php | public function actionEditTag(array $variables = array())
{
if (!empty($variables['groupHandle'])) {
$variables['group'] = craft()->tags->getTagGroupByHandle($variables['groupHandle']);
} elseif (!empty($variables['groupId'])) {
$variables['group'] = craft()->tags->getTagGrou... | [
"public",
"function",
"actionEditTag",
"(",
"array",
"$",
"variables",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"variables",
"[",
"'groupHandle'",
"]",
")",
")",
"{",
"$",
"variables",
"[",
"'group'",
"]",
"=",
"craft",
"(... | Edit a tag.
@param array $variables
@throws HttpException | [
"Edit",
"a",
"tag",
"."
] | 99d28c6424e92542142fad766a471bbe7d43e9fa | https://github.com/boboldehampsink/tagmanager/blob/99d28c6424e92542142fad766a471bbe7d43e9fa/controllers/TagManagerController.php#L35-L90 |
224,517 | descubraomundo/omnipay-pagarme | src/Message/Response.php | Response.getCustomerReference | public function getCustomerReference()
{
if (isset($this->data['object']) && 'customer' === $this->data['object']) {
return $this->data['id'];
}
if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
if (! empty($this->data['customer'])) {
... | php | public function getCustomerReference()
{
if (isset($this->data['object']) && 'customer' === $this->data['object']) {
return $this->data['id'];
}
if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
if (! empty($this->data['customer'])) {
... | [
"public",
"function",
"getCustomerReference",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'object'",
"]",
")",
"&&",
"'customer'",
"===",
"$",
"this",
"->",
"data",
"[",
"'object'",
"]",
")",
"{",
"return",
"$",
"this",
"... | Get a customer reference, for createCustomer requests.
@return string|null | [
"Get",
"a",
"customer",
"reference",
"for",
"createCustomer",
"requests",
"."
] | 99e92dffd1640bdaf736560e26ec244326a3dd4a | https://github.com/descubraomundo/omnipay-pagarme/blob/99e92dffd1640bdaf736560e26ec244326a3dd4a/src/Message/Response.php#L66-L83 |
224,518 | descubraomundo/omnipay-pagarme | src/Message/Response.php | Response.getBoleto | public function getBoleto()
{
if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
if ( $this->data['boleto_url'] ) {
$data = array(
'boleto_url' => $this->data['boleto_url'],
'boleto_barcode' => $this->data['bole... | php | public function getBoleto()
{
if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
if ( $this->data['boleto_url'] ) {
$data = array(
'boleto_url' => $this->data['boleto_url'],
'boleto_barcode' => $this->data['bole... | [
"public",
"function",
"getBoleto",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'object'",
"]",
")",
"&&",
"'transaction'",
"===",
"$",
"this",
"->",
"data",
"[",
"'object'",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
... | Get the boleto_url, boleto_barcode and boleto_expiration_date in the
transaction object.
@return array|null the boleto_url, boleto_barcode and boleto_expiration_date | [
"Get",
"the",
"boleto_url",
"boleto_barcode",
"and",
"boleto_expiration_date",
"in",
"the",
"transaction",
"object",
"."
] | 99e92dffd1640bdaf736560e26ec244326a3dd4a | https://github.com/descubraomundo/omnipay-pagarme/blob/99e92dffd1640bdaf736560e26ec244326a3dd4a/src/Message/Response.php#L111-L127 |
224,519 | bramstroker/zf2-fullpage-cache | src/Listener/CacheListener.php | CacheListener.onRoute | public function onRoute(MvcEvent $e)
{
if (!$e->getRequest() instanceof HttpRequest || !$e->getResponse() instanceof HttpResponse) {
return null;
}
/** @var HttpResponse $response */
$response = $e->getResponse();
$data = $this->getCacheService()->load($e);
... | php | public function onRoute(MvcEvent $e)
{
if (!$e->getRequest() instanceof HttpRequest || !$e->getResponse() instanceof HttpResponse) {
return null;
}
/** @var HttpResponse $response */
$response = $e->getResponse();
$data = $this->getCacheService()->load($e);
... | [
"public",
"function",
"onRoute",
"(",
"MvcEvent",
"$",
"e",
")",
"{",
"if",
"(",
"!",
"$",
"e",
"->",
"getRequest",
"(",
")",
"instanceof",
"HttpRequest",
"||",
"!",
"$",
"e",
"->",
"getResponse",
"(",
")",
"instanceof",
"HttpResponse",
")",
"{",
"retu... | Load the page contents from the cache and set the response.
@param MvcEvent $e
@return HttpResponse | [
"Load",
"the",
"page",
"contents",
"from",
"the",
"cache",
"and",
"set",
"the",
"response",
"."
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Listener/CacheListener.php#L67-L94 |
224,520 | bramstroker/zf2-fullpage-cache | src/Listener/CacheListener.php | CacheListener.onFinish | public function onFinish(MvcEvent $e)
{
if (!$e->getRequest() instanceof HttpRequest || $this->loadedFromCache) {
return;
}
$this->getCacheService()->save($e);
} | php | public function onFinish(MvcEvent $e)
{
if (!$e->getRequest() instanceof HttpRequest || $this->loadedFromCache) {
return;
}
$this->getCacheService()->save($e);
} | [
"public",
"function",
"onFinish",
"(",
"MvcEvent",
"$",
"e",
")",
"{",
"if",
"(",
"!",
"$",
"e",
"->",
"getRequest",
"(",
")",
"instanceof",
"HttpRequest",
"||",
"$",
"this",
"->",
"loadedFromCache",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"... | Save page contents to the cache
@param MvcEvent $e
@return void | [
"Save",
"page",
"contents",
"to",
"the",
"cache"
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Listener/CacheListener.php#L113-L120 |
224,521 | descubraomundo/omnipay-pagarme | src/Message/AuthorizeRequest.php | AuthorizeRequest.getBoletoExpirationDate | public function getBoletoExpirationDate($format = 'Y-m-d\TH:i:s')
{
$value = $this->getParameter('boleto_expiration_date');
return $value ? $value->format($format) : null;
} | php | public function getBoletoExpirationDate($format = 'Y-m-d\TH:i:s')
{
$value = $this->getParameter('boleto_expiration_date');
return $value ? $value->format($format) : null;
} | [
"public",
"function",
"getBoletoExpirationDate",
"(",
"$",
"format",
"=",
"'Y-m-d\\TH:i:s'",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'boleto_expiration_date'",
")",
";",
"return",
"$",
"value",
"?",
"$",
"value",
"->",
"format",
... | Get the boleto expiration date
@return string boleto expiration date | [
"Get",
"the",
"boleto",
"expiration",
"date"
] | 99e92dffd1640bdaf736560e26ec244326a3dd4a | https://github.com/descubraomundo/omnipay-pagarme/blob/99e92dffd1640bdaf736560e26ec244326a3dd4a/src/Message/AuthorizeRequest.php#L172-L177 |
224,522 | descubraomundo/omnipay-pagarme | src/Message/AuthorizeRequest.php | AuthorizeRequest.setBoletoExpirationDate | public function setBoletoExpirationDate($value)
{
if ($value) {
$value = new \DateTime($value, new \DateTimeZone('UTC'));
$value = new \DateTime($value->format('Y-m-d\T03:00:00'), new \DateTimeZone('UTC'));
} else {
$value = null;
}
return... | php | public function setBoletoExpirationDate($value)
{
if ($value) {
$value = new \DateTime($value, new \DateTimeZone('UTC'));
$value = new \DateTime($value->format('Y-m-d\T03:00:00'), new \DateTimeZone('UTC'));
} else {
$value = null;
}
return... | [
"public",
"function",
"setBoletoExpirationDate",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"value",
",",
"new",
"\\",
"DateTimeZone",
"(",
"'UTC'",
")",
")",
";",
"$",
"value... | Set the boleto expiration date
@param string $value defaults to atual date + 7 days
@return AuthorizeRequest provides a fluent interface | [
"Set",
"the",
"boleto",
"expiration",
"date"
] | 99e92dffd1640bdaf736560e26ec244326a3dd4a | https://github.com/descubraomundo/omnipay-pagarme/blob/99e92dffd1640bdaf736560e26ec244326a3dd4a/src/Message/AuthorizeRequest.php#L185-L195 |
224,523 | smoqadam/php-telegram-bot | src/Smoqadam/Telegram.php | Telegram.process | public function process($payload) {
$result = $this->convertToObject($payload, true);
return $this->processPayload($result);
} | php | public function process($payload) {
$result = $this->convertToObject($payload, true);
return $this->processPayload($result);
} | [
"public",
"function",
"process",
"(",
"$",
"payload",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"convertToObject",
"(",
"$",
"payload",
",",
"true",
")",
";",
"return",
"$",
"this",
"->",
"processPayload",
"(",
"$",
"result",
")",
";",
"}"
] | this method used for setWebhook sended payload | [
"this",
"method",
"used",
"for",
"setWebhook",
"sended",
"payload"
] | dacd8f8bc0f6709bdd10473dbe130d3788b60f08 | https://github.com/smoqadam/php-telegram-bot/blob/dacd8f8bc0f6709bdd10473dbe130d3788b60f08/src/Smoqadam/Telegram.php#L157-L161 |
224,524 | smoqadam/php-telegram-bot | src/Smoqadam/Telegram.php | Telegram.getArgs | private function getArgs(&$pattern, $payload) {
$args = null;
// if command has argument
if (preg_match('/<<.*>>/', $pattern, $matches)) {
$args_pattern = $matches[0];
//remove << and >> from patterns
$tmp_args_pattern = str_replace(['<<', '>>'], ['(', ')'], ... | php | private function getArgs(&$pattern, $payload) {
$args = null;
// if command has argument
if (preg_match('/<<.*>>/', $pattern, $matches)) {
$args_pattern = $matches[0];
//remove << and >> from patterns
$tmp_args_pattern = str_replace(['<<', '>>'], ['(', ')'], ... | [
"private",
"function",
"getArgs",
"(",
"&",
"$",
"pattern",
",",
"$",
"payload",
")",
"{",
"$",
"args",
"=",
"null",
";",
"// if command has argument",
"if",
"(",
"preg_match",
"(",
"'/<<.*>>/'",
",",
"$",
"pattern",
",",
"$",
"matches",
")",
")",
"{",
... | get arguments part in regex
@param $pattern
@param $payload
@return mixed|null | [
"get",
"arguments",
"part",
"in",
"regex"
] | dacd8f8bc0f6709bdd10473dbe130d3788b60f08 | https://github.com/smoqadam/php-telegram-bot/blob/dacd8f8bc0f6709bdd10473dbe130d3788b60f08/src/Smoqadam/Telegram.php#L214-L237 |
224,525 | smoqadam/php-telegram-bot | src/Smoqadam/Telegram.php | Telegram.exec | private function exec($command, $params = []) {
if (in_array($command, $this->available_commands)) {
// convert json to array then get the last messages info
$output = json_decode($this->curl_get_contents($this->api . '/' . $command, $params), true);
return $this->convertToO... | php | private function exec($command, $params = []) {
if (in_array($command, $this->available_commands)) {
// convert json to array then get the last messages info
$output = json_decode($this->curl_get_contents($this->api . '/' . $command, $params), true);
return $this->convertToO... | [
"private",
"function",
"exec",
"(",
"$",
"command",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"command",
",",
"$",
"this",
"->",
"available_commands",
")",
")",
"{",
"// convert json to array then get the last messages info"... | execute telegram api commands
@param $command
@param array $params | [
"execute",
"telegram",
"api",
"commands"
] | dacd8f8bc0f6709bdd10473dbe130d3788b60f08 | https://github.com/smoqadam/php-telegram-bot/blob/dacd8f8bc0f6709bdd10473dbe130d3788b60f08/src/Smoqadam/Telegram.php#L244-L253 |
224,526 | smoqadam/php-telegram-bot | src/Smoqadam/Telegram.php | Telegram.getChatId | public function getChatId($chat_id = null) {
try {
if ($chat_id)
return $chat_id;
if( isset($this->result->message) ) {
return $this->result->message->chat->id;
} elseif ( isset($this->result->inline_query) ) {
return $this->re... | php | public function getChatId($chat_id = null) {
try {
if ($chat_id)
return $chat_id;
if( isset($this->result->message) ) {
return $this->result->message->chat->id;
} elseif ( isset($this->result->inline_query) ) {
return $this->re... | [
"public",
"function",
"getChatId",
"(",
"$",
"chat_id",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"chat_id",
")",
"return",
"$",
"chat_id",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"result",
"->",
"message",
")",
")",
"{",
"return"... | Get current chat id
@param null $chat_id
@return int | [
"Get",
"current",
"chat",
"id"
] | dacd8f8bc0f6709bdd10473dbe130d3788b60f08 | https://github.com/smoqadam/php-telegram-bot/blob/dacd8f8bc0f6709bdd10473dbe130d3788b60f08/src/Smoqadam/Telegram.php#L302-L317 |
224,527 | RichWeber/yii2-google-translate-api | Translation.php | Translation.translate | public function translate($source, $target, $text)
{
return $this->getResponse($this->getRequest('', $text, $source, $target));
} | php | public function translate($source, $target, $text)
{
return $this->getResponse($this->getRequest('', $text, $source, $target));
} | [
"public",
"function",
"translate",
"(",
"$",
"source",
",",
"$",
"target",
",",
"$",
"text",
")",
"{",
"return",
"$",
"this",
"->",
"getResponse",
"(",
"$",
"this",
"->",
"getRequest",
"(",
"''",
",",
"$",
"text",
",",
"$",
"source",
",",
"$",
"tar... | You can translate text from one language
to another language
@param string $source Source language
@param string $target Target language
@param string $text Source text string
@return array | [
"You",
"can",
"translate",
"text",
"from",
"one",
"language",
"to",
"another",
"language"
] | 8c7e47bd8c3309f6dcb4869141e2c30a3a231537 | https://github.com/RichWeber/yii2-google-translate-api/blob/8c7e47bd8c3309f6dcb4869141e2c30a3a231537/Translation.php#L41-L44 |
224,528 | RichWeber/yii2-google-translate-api | Translation.php | Translation.getRequest | protected function getRequest($method, $text = '', $source = '', $target = '')
{
$request = self::API_URL . '/' . $method . '?' . http_build_query(
[
'key' => $this->key,
'source' => $source,
'target' => $target,
'q' => Html::encode... | php | protected function getRequest($method, $text = '', $source = '', $target = '')
{
$request = self::API_URL . '/' . $method . '?' . http_build_query(
[
'key' => $this->key,
'source' => $source,
'target' => $target,
'q' => Html::encode... | [
"protected",
"function",
"getRequest",
"(",
"$",
"method",
",",
"$",
"text",
"=",
"''",
",",
"$",
"source",
"=",
"''",
",",
"$",
"target",
"=",
"''",
")",
"{",
"$",
"request",
"=",
"self",
"::",
"API_URL",
".",
"'/'",
".",
"$",
"method",
".",
"'?... | Forming query parameters
@param string $method API method
@param string $text Source text string
@param string $source Source language
@param string $target Target language
@return array Data properties | [
"Forming",
"query",
"parameters"
] | 8c7e47bd8c3309f6dcb4869141e2c30a3a231537 | https://github.com/RichWeber/yii2-google-translate-api/blob/8c7e47bd8c3309f6dcb4869141e2c30a3a231537/Translation.php#L73-L85 |
224,529 | doctrine/oxm | lib/Doctrine/OXM/Proxy/ProxyFactory.php | ProxyFactory.getProxy | public function getProxy($className, $identifier)
{
$proxyClassName = str_replace('\\', '', $className) . 'Proxy';
$fqn = $this->proxyNamespace . '\\' . $proxyClassName;
if (! class_exists($fqn, false)) {
$fileName = $this->proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.ph... | php | public function getProxy($className, $identifier)
{
$proxyClassName = str_replace('\\', '', $className) . 'Proxy';
$fqn = $this->proxyNamespace . '\\' . $proxyClassName;
if (! class_exists($fqn, false)) {
$fileName = $this->proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.ph... | [
"public",
"function",
"getProxy",
"(",
"$",
"className",
",",
"$",
"identifier",
")",
"{",
"$",
"proxyClassName",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"''",
",",
"$",
"className",
")",
".",
"'Proxy'",
";",
"$",
"fqn",
"=",
"$",
"this",
"->",
"proxyN... | Gets a reference proxy instance for the xml-entity of the given type and identified by
the given identifier.
@param string $className
@param mixed $identifier
@return object | [
"Gets",
"a",
"reference",
"proxy",
"instance",
"for",
"the",
"xml",
"-",
"entity",
"of",
"the",
"given",
"type",
"and",
"identified",
"by",
"the",
"given",
"identifier",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Proxy/ProxyFactory.php#L75-L95 |
224,530 | descubraomundo/omnipay-pagarme | src/Message/AbstractRequest.php | AbstractRequest.getCustomerData | protected function getCustomerData()
{
$card = $this->getCard();
$data = array();
$data['customer']['name'] = $card->getName();
$data['customer']['email'] = $card->getEmail();
$data['customer']['sex'] = $card->getGender();
$data['customer']['born_at'] = $card->getBir... | php | protected function getCustomerData()
{
$card = $this->getCard();
$data = array();
$data['customer']['name'] = $card->getName();
$data['customer']['email'] = $card->getEmail();
$data['customer']['sex'] = $card->getGender();
$data['customer']['born_at'] = $card->getBir... | [
"protected",
"function",
"getCustomerData",
"(",
")",
"{",
"$",
"card",
"=",
"$",
"this",
"->",
"getCard",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"data",
"[",
"'customer'",
"]",
"[",
"'name'",
"]",
"=",
"$",
"card",
"->",
"... | Get the Customer data.
Because the pagarme gateway uses a common format for passing
customer data to the API, this function can be called to get the
data from the card object in the format that the API requires.
@return array customer data | [
"Get",
"the",
"Customer",
"data",
"."
] | 99e92dffd1640bdaf736560e26ec244326a3dd4a | https://github.com/descubraomundo/omnipay-pagarme/blob/99e92dffd1640bdaf736560e26ec244326a3dd4a/src/Message/AbstractRequest.php#L261-L291 |
224,531 | bramstroker/zf2-fullpage-cache | src/Controller/CacheController.php | CacheController.clearAction | public function clearAction()
{
$tags = $this->params('tags', null);
if (null === $tags) {
$this->console->writeLine('You should provide tags');
return;
}
$tags = explode(',', $tags);
$result = false;
try {
$result = $this->getCa... | php | public function clearAction()
{
$tags = $this->params('tags', null);
if (null === $tags) {
$this->console->writeLine('You should provide tags');
return;
}
$tags = explode(',', $tags);
$result = false;
try {
$result = $this->getCa... | [
"public",
"function",
"clearAction",
"(",
")",
"{",
"$",
"tags",
"=",
"$",
"this",
"->",
"params",
"(",
"'tags'",
",",
"null",
")",
";",
"if",
"(",
"null",
"===",
"$",
"tags",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"writeLine",
"(",
"'You sh... | Clear items from the cache
@return string | [
"Clear",
"items",
"from",
"the",
"cache"
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Controller/CacheController.php#L36-L58 |
224,532 | doctrine/oxm | lib/Doctrine/OXM/Types/Type.php | Type.getType | public static function getType($name)
{
if ( ! isset(self::$_typeObjects[$name])) {
if ( ! isset(self::$_typesMap[$name])) {
throw OXMException::unknownType($name);
}
self::$_typeObjects[$name] = new self::$_typesMap[$name]();
}
return sel... | php | public static function getType($name)
{
if ( ! isset(self::$_typeObjects[$name])) {
if ( ! isset(self::$_typesMap[$name])) {
throw OXMException::unknownType($name);
}
self::$_typeObjects[$name] = new self::$_typesMap[$name]();
}
return sel... | [
"public",
"static",
"function",
"getType",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_typeObjects",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_typesMap",
"[",
"$",
... | Factory method to create type instances.
Type instances are implemented as flyweights.
@static
@throws OXMException
@param string $name The name of the type (as returned by getName()).
@return \Doctrine\OXM\Types\Type | [
"Factory",
"method",
"to",
"create",
"type",
"instances",
".",
"Type",
"instances",
"are",
"implemented",
"as",
"flyweights",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Types/Type.php#L112-L122 |
224,533 | doctrine/oxm | lib/Doctrine/OXM/Tools/Console/ConsoleRunner.php | ConsoleRunner.run | static public function run(HelperSet $helperSet)
{
$cli = new Application('Doctrine OXM Command Line Interface', \Doctrine\OXM\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->run();
} | php | static public function run(HelperSet $helperSet)
{
$cli = new Application('Doctrine OXM Command Line Interface', \Doctrine\OXM\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->run();
} | [
"static",
"public",
"function",
"run",
"(",
"HelperSet",
"$",
"helperSet",
")",
"{",
"$",
"cli",
"=",
"new",
"Application",
"(",
"'Doctrine OXM Command Line Interface'",
",",
"\\",
"Doctrine",
"\\",
"OXM",
"\\",
"Version",
"::",
"VERSION",
")",
";",
"$",
"cl... | Run console with the given helperset.
@param \Symfony\Component\Console\Helper\HelperSet $helperSet
@return void | [
"Run",
"console",
"with",
"the",
"given",
"helperset",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Tools/Console/ConsoleRunner.php#L42-L49 |
224,534 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadata.php | ClassMetadata.getFieldValue | public function getFieldValue($entity, $fieldName)
{
if ($this->fieldMappings[$fieldName]['direct']) {
return $this->reflFields[$fieldName]->getValue($entity);
} else {
if (!array_key_exists('getMethod', $this->fieldMappings[$fieldName])) {
$this->fieldMapping... | php | public function getFieldValue($entity, $fieldName)
{
if ($this->fieldMappings[$fieldName]['direct']) {
return $this->reflFields[$fieldName]->getValue($entity);
} else {
if (!array_key_exists('getMethod', $this->fieldMappings[$fieldName])) {
$this->fieldMapping... | [
"public",
"function",
"getFieldValue",
"(",
"$",
"entity",
",",
"$",
"fieldName",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fieldMappings",
"[",
"$",
"fieldName",
"]",
"[",
"'direct'",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"reflFields",
"[",
"$",
... | Gets the specified field's value off the given entity.
@param object $entity
@param string $fieldName | [
"Gets",
"the",
"specified",
"field",
"s",
"value",
"off",
"the",
"given",
"entity",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadata.php#L152-L168 |
224,535 | doctrine/oxm | lib/Doctrine/OXM/Persisters/RootXmlEntityPersister.php | RootXmlEntityPersister.update | public function update($xmlEntity)
{
$identifier = $this->metadata->getIdentifierValue($xmlEntity);
$xml = $this->marshaller->marshalToString($xmlEntity);
return $this->storage->update($this->metadata, $identifier, $xml);
} | php | public function update($xmlEntity)
{
$identifier = $this->metadata->getIdentifierValue($xmlEntity);
$xml = $this->marshaller->marshalToString($xmlEntity);
return $this->storage->update($this->metadata, $identifier, $xml);
} | [
"public",
"function",
"update",
"(",
"$",
"xmlEntity",
")",
"{",
"$",
"identifier",
"=",
"$",
"this",
"->",
"metadata",
"->",
"getIdentifierValue",
"(",
"$",
"xmlEntity",
")",
";",
"$",
"xml",
"=",
"$",
"this",
"->",
"marshaller",
"->",
"marshalToString",
... | Updates this xml entity in the storage system
@param $xmlEntity
@return bool|int | [
"Updates",
"this",
"xml",
"entity",
"in",
"the",
"storage",
"system"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Persisters/RootXmlEntityPersister.php#L81-L88 |
224,536 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadataFactory.php | ClassMetadataFactory.getParentClasses | protected function getParentClasses($name)
{
// Collect parent classes, ignoring transient (not-mapped) classes.
$parentClasses = array();
foreach (array_reverse(class_parents($name)) as $parentClass) {
if (!$this->driver->isTransient($parentClass)) {
$parentClass... | php | protected function getParentClasses($name)
{
// Collect parent classes, ignoring transient (not-mapped) classes.
$parentClasses = array();
foreach (array_reverse(class_parents($name)) as $parentClass) {
if (!$this->driver->isTransient($parentClass)) {
$parentClass... | [
"protected",
"function",
"getParentClasses",
"(",
"$",
"name",
")",
"{",
"// Collect parent classes, ignoring transient (not-mapped) classes.",
"$",
"parentClasses",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_reverse",
"(",
"class_parents",
"(",
"$",
"name",
... | Get array of parent classes for the given entity class
@param string $name
@return array $parentClasses | [
"Get",
"array",
"of",
"parent",
"classes",
"for",
"the",
"given",
"entity",
"class"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadataFactory.php#L256-L266 |
224,537 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadataFactory.php | ClassMetadataFactory.completeMappingTypeValidation | private function completeMappingTypeValidation($className, ClassMetadataInfo $class)
{
foreach ($class->fieldMappings as $fieldName => $mapping) {
if (Type::hasType($mapping['type'])) {
continue;
}
// Support type as a mapped class?
if (!$this... | php | private function completeMappingTypeValidation($className, ClassMetadataInfo $class)
{
foreach ($class->fieldMappings as $fieldName => $mapping) {
if (Type::hasType($mapping['type'])) {
continue;
}
// Support type as a mapped class?
if (!$this... | [
"private",
"function",
"completeMappingTypeValidation",
"(",
"$",
"className",
",",
"ClassMetadataInfo",
"$",
"class",
")",
"{",
"foreach",
"(",
"$",
"class",
"->",
"fieldMappings",
"as",
"$",
"fieldName",
"=>",
"$",
"mapping",
")",
"{",
"if",
"(",
"Type",
"... | Complete and validate type mappings
@param string $className
@param ClassMetadataInfo $class | [
"Complete",
"and",
"validate",
"type",
"mappings"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadataFactory.php#L366-L383 |
224,538 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadataFactory.php | ClassMetadataFactory.completeIdGeneratorMapping | private function completeIdGeneratorMapping(ClassMetadataInfo $class)
{
$idGenType = $class->generatorType;
if ($idGenType == ClassMetadata::GENERATOR_TYPE_AUTO) {
$class->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
}
// Create & assign an appropriate ID ... | php | private function completeIdGeneratorMapping(ClassMetadataInfo $class)
{
$idGenType = $class->generatorType;
if ($idGenType == ClassMetadata::GENERATOR_TYPE_AUTO) {
$class->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
}
// Create & assign an appropriate ID ... | [
"private",
"function",
"completeIdGeneratorMapping",
"(",
"ClassMetadataInfo",
"$",
"class",
")",
"{",
"$",
"idGenType",
"=",
"$",
"class",
"->",
"generatorType",
";",
"if",
"(",
"$",
"idGenType",
"==",
"ClassMetadata",
"::",
"GENERATOR_TYPE_AUTO",
")",
"{",
"$"... | Completes the ID generator mapping. If "auto" is specified we choose the generator
most appropriate.
@param Doctrine\OXM\Mapping\ClassMetadataInfo $class | [
"Completes",
"the",
"ID",
"generator",
"mapping",
".",
"If",
"auto",
"is",
"specified",
"we",
"choose",
"the",
"generator",
"most",
"appropriate",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadataFactory.php#L413-L434 |
224,539 | doctrine/oxm | lib/Doctrine/OXM/Storage/FileSystemStorage.php | FileSystemStorage.insert | public function insert(ClassMetadataInfo $classMetadata, $id, $xmlContent)
{
$this->prepareStoragePathForClass($this->resolveClassName($classMetadata));
$filePath = $this->getFilename($classMetadata, $id);
$result = file_put_contents($filePath, $xmlContent);
if (false === $result) ... | php | public function insert(ClassMetadataInfo $classMetadata, $id, $xmlContent)
{
$this->prepareStoragePathForClass($this->resolveClassName($classMetadata));
$filePath = $this->getFilename($classMetadata, $id);
$result = file_put_contents($filePath, $xmlContent);
if (false === $result) ... | [
"public",
"function",
"insert",
"(",
"ClassMetadataInfo",
"$",
"classMetadata",
",",
"$",
"id",
",",
"$",
"xmlContent",
")",
"{",
"$",
"this",
"->",
"prepareStoragePathForClass",
"(",
"$",
"this",
"->",
"resolveClassName",
"(",
"$",
"classMetadata",
")",
")",
... | Insert the XML into the filesystem with a specific identifier
@throws StorageException
@param \Doctrine\OXM\Mapping\ClassMetadataInfo $classMetadata
@param string $id
@param string $xmlContent
@return boolean | [
"Insert",
"the",
"XML",
"into",
"the",
"filesystem",
"with",
"a",
"specific",
"identifier"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Storage/FileSystemStorage.php#L100-L114 |
224,540 | doctrine/oxm | lib/Doctrine/OXM/Storage/FileSystemStorage.php | FileSystemStorage.prepareStoragePathForClass | private function prepareStoragePathForClass($className)
{
$filePath = $this->buildStoragePath($className);
if (!file_exists($filePath)) {
mkdir($filePath, $this->fileModeBits, true);
}
return $filePath;
} | php | private function prepareStoragePathForClass($className)
{
$filePath = $this->buildStoragePath($className);
if (!file_exists($filePath)) {
mkdir($filePath, $this->fileModeBits, true);
}
return $filePath;
} | [
"private",
"function",
"prepareStoragePathForClass",
"(",
"$",
"className",
")",
"{",
"$",
"filePath",
"=",
"$",
"this",
"->",
"buildStoragePath",
"(",
"$",
"className",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filePath",
")",
")",
"{",
"mkdir",... | Build the realpath to save the xml in a specific folder
@param string $className
@return string | [
"Build",
"the",
"realpath",
"to",
"save",
"the",
"xml",
"in",
"a",
"specific",
"folder"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Storage/FileSystemStorage.php#L177-L184 |
224,541 | joomla-framework/github-api | src/Package/Activity/Starring.php | Starring.getRepositories | public function getRepositories($user = '', $sort = 'created', $direction = 'desc')
{
$allowedSort = array('created', 'updated');
$allowedDir = array('asc', 'desc');
if (!\in_array($sort, $allowedSort))
{
throw new \InvalidArgumentException(
sprintf(
'The sorting value is invalid. Allowed values ... | php | public function getRepositories($user = '', $sort = 'created', $direction = 'desc')
{
$allowedSort = array('created', 'updated');
$allowedDir = array('asc', 'desc');
if (!\in_array($sort, $allowedSort))
{
throw new \InvalidArgumentException(
sprintf(
'The sorting value is invalid. Allowed values ... | [
"public",
"function",
"getRepositories",
"(",
"$",
"user",
"=",
"''",
",",
"$",
"sort",
"=",
"'created'",
",",
"$",
"direction",
"=",
"'desc'",
")",
"{",
"$",
"allowedSort",
"=",
"array",
"(",
"'created'",
",",
"'updated'",
")",
";",
"$",
"allowedDir",
... | List repositories being starred.
List repositories being starred by a user.
@param string $user User name.
@param string $sort One of `created` (when the repository was starred) or `updated` (when it was last pushed to).
@param string $direction One of `asc` (ascending) or `desc` (descending).
... | [
"List",
"repositories",
"being",
"starred",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Activity/Starring.php#L57-L93 |
224,542 | burnbright/silverstripe-importexport | code/CSVFieldMapper.php | CSVFieldMapper.getMapHeadings | public function getMapHeadings()
{
if (!$this->headings && !$this->mappablecols) {
return;
}
$out = new Arraylist();
foreach ($this->headings as $heading) {
$dropdown = $this->createHeadingDropdown($heading);
if (is_array($this->mappingvalues) &&
... | php | public function getMapHeadings()
{
if (!$this->headings && !$this->mappablecols) {
return;
}
$out = new Arraylist();
foreach ($this->headings as $heading) {
$dropdown = $this->createHeadingDropdown($heading);
if (is_array($this->mappingvalues) &&
... | [
"public",
"function",
"getMapHeadings",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"headings",
"&&",
"!",
"$",
"this",
"->",
"mappablecols",
")",
"{",
"return",
";",
"}",
"$",
"out",
"=",
"new",
"Arraylist",
"(",
")",
";",
"foreach",
"(",
"$... | Provide heading dropdowns for creating mappings
@return ArrayList | [
"Provide",
"heading",
"dropdowns",
"for",
"creating",
"mappings"
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/CSVFieldMapper.php#L34-L54 |
224,543 | JeroenBoersma/php-normalize | src/Manager.php | Manager.get | public function get(string $identifier = '') : Normalize
{
if (!$this->exists($identifier)) {
throw new NotFound("No instance found with the name '{$identifier}'");
}
return $this->instances[$identifier];
} | php | public function get(string $identifier = '') : Normalize
{
if (!$this->exists($identifier)) {
throw new NotFound("No instance found with the name '{$identifier}'");
}
return $this->instances[$identifier];
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"identifier",
"=",
"''",
")",
":",
"Normalize",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
"$",
"identifier",
")",
")",
"{",
"throw",
"new",
"NotFound",
"(",
"\"No instance found with the name '{... | Get existing normalize instance
@param string $identifier
@return Normalize
@throws NotFound | [
"Get",
"existing",
"normalize",
"instance"
] | 254fdcc50bfd8cbf3eba8dae93439c07e28e0396 | https://github.com/JeroenBoersma/php-normalize/blob/254fdcc50bfd8cbf3eba8dae93439c07e28e0396/src/Manager.php#L54-L61 |
224,544 | JeroenBoersma/php-normalize | src/Manager.php | Manager.createAndAdd | public function createAndAdd(array $rules = [], string $identifier = '', string $chain = null) : Manager
{
return $this->add($this->create($rules), $identifier, $chain);
} | php | public function createAndAdd(array $rules = [], string $identifier = '', string $chain = null) : Manager
{
return $this->add($this->create($rules), $identifier, $chain);
} | [
"public",
"function",
"createAndAdd",
"(",
"array",
"$",
"rules",
"=",
"[",
"]",
",",
"string",
"$",
"identifier",
"=",
"''",
",",
"string",
"$",
"chain",
"=",
"null",
")",
":",
"Manager",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"this",
... | Create and add Normalize object
@param array $rules
@param string $identifier
@param string $chain
@return Manager | [
"Create",
"and",
"add",
"Normalize",
"object"
] | 254fdcc50bfd8cbf3eba8dae93439c07e28e0396 | https://github.com/JeroenBoersma/php-normalize/blob/254fdcc50bfd8cbf3eba8dae93439c07e28e0396/src/Manager.php#L104-L107 |
224,545 | neos/setup | Classes/ViewHelpers/Widget/Controller/DatabaseSelectorController.php | DatabaseSelectorController.databaseSupportsUtf8Mb4 | protected function databaseSupportsUtf8Mb4(string $databaseVersion): bool
{
if (strpos($databaseVersion, '-MariaDB') !== false &&
version_compare($databaseVersion, self::MINIMUM_MARIA_DB_VERSION) === -1
) {
return false;
}
if (preg_match('([a-zA-Z])', $databa... | php | protected function databaseSupportsUtf8Mb4(string $databaseVersion): bool
{
if (strpos($databaseVersion, '-MariaDB') !== false &&
version_compare($databaseVersion, self::MINIMUM_MARIA_DB_VERSION) === -1
) {
return false;
}
if (preg_match('([a-zA-Z])', $databa... | [
"protected",
"function",
"databaseSupportsUtf8Mb4",
"(",
"string",
"$",
"databaseVersion",
")",
":",
"bool",
"{",
"if",
"(",
"strpos",
"(",
"$",
"databaseVersion",
",",
"'-MariaDB'",
")",
"!==",
"false",
"&&",
"version_compare",
"(",
"$",
"databaseVersion",
",",... | Check if MySQL based database supports utf8mb4 character set.
@param string $databaseVersion
@return bool | [
"Check",
"if",
"MySQL",
"based",
"database",
"supports",
"utf8mb4",
"character",
"set",
"."
] | 7b5437efe8113e997007be6896628aa9f5c39d2f | https://github.com/neos/setup/blob/7b5437efe8113e997007be6896628aa9f5c39d2f/Classes/ViewHelpers/Widget/Controller/DatabaseSelectorController.php#L189-L204 |
224,546 | joomla-framework/github-api | src/Package/Orgs/Teams.php | Teams.create | public function create($org, $name, array $repoNames = array(), $permission = '')
{
// Build the request path.
$path = '/orgs/' . $org . '/teams';
$data = array(
'name' => $name,
);
if ($repoNames)
{
$data['repo_names'] = $repoNames;
}
if ($permission)
{
if (\in_array($permission, array('... | php | public function create($org, $name, array $repoNames = array(), $permission = '')
{
// Build the request path.
$path = '/orgs/' . $org . '/teams';
$data = array(
'name' => $name,
);
if ($repoNames)
{
$data['repo_names'] = $repoNames;
}
if ($permission)
{
if (\in_array($permission, array('... | [
"public",
"function",
"create",
"(",
"$",
"org",
",",
"$",
"name",
",",
"array",
"$",
"repoNames",
"=",
"array",
"(",
")",
",",
"$",
"permission",
"=",
"''",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/orgs/'",
".",
"$",
"org",
".",
... | Create team.
In order to create a team, the authenticated user must be an owner of the organization.
@param string $org The name of the organization.
@param string $name The name of the team.
@param array $repoNames Repository names.
@param string $permission The permission. (Deprecated... | [
"Create",
"team",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Orgs/Teams.php#L81-L109 |
224,547 | joomla-framework/github-api | src/Package/Orgs/Teams.php | Teams.edit | public function edit($id, $name, $permission = '')
{
// Build the request path.
$path = '/teams/' . (int) $id;
$data = array(
'name' => $name,
);
if ($permission)
{
if (\in_array($permission, array('pull', 'push', 'admin')) == false)
{
throw new \UnexpectedValueException('Permissions must be... | php | public function edit($id, $name, $permission = '')
{
// Build the request path.
$path = '/teams/' . (int) $id;
$data = array(
'name' => $name,
);
if ($permission)
{
if (\in_array($permission, array('pull', 'push', 'admin')) == false)
{
throw new \UnexpectedValueException('Permissions must be... | [
"public",
"function",
"edit",
"(",
"$",
"id",
",",
"$",
"name",
",",
"$",
"permission",
"=",
"''",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/teams/'",
".",
"(",
"int",
")",
"$",
"id",
";",
"$",
"data",
"=",
"array",
"(",
"'name'",
... | Edit team.
In order to edit a team, the authenticated user must be an owner of the org that the team is associated with.
@param integer $id The team id.
@param string $name The name of the team.
@param string $permission The permission. (Deprecated)
pull - team members can pull, but not pu... | [
"Edit",
"team",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Orgs/Teams.php#L128-L150 |
224,548 | flipboxfactory/craft-rest | src/JsonParser.php | JsonParser.filterNullValuesFromArray | public function filterNullValuesFromArray(array $arr): array
{
foreach ($arr as $key => $value) {
if ($value === null) {
unset($arr[$key]);
}
if (is_array($value)) {
$arr[$key] = $this->filterNullValuesFromArray($value);
}
... | php | public function filterNullValuesFromArray(array $arr): array
{
foreach ($arr as $key => $value) {
if ($value === null) {
unset($arr[$key]);
}
if (is_array($value)) {
$arr[$key] = $this->filterNullValuesFromArray($value);
}
... | [
"public",
"function",
"filterNullValuesFromArray",
"(",
"array",
"$",
"arr",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"a... | Filters null values from an array.
@param array $arr
@return array | [
"Filters",
"null",
"values",
"from",
"an",
"array",
"."
] | bb9d0e2e0fbde85edab1cc1ac9d1a033888c4f63 | https://github.com/flipboxfactory/craft-rest/blob/bb9d0e2e0fbde85edab1cc1ac9d1a033888c4f63/src/JsonParser.php#L32-L44 |
224,549 | phootwork/collection | src/CollectionUtils.php | CollectionUtils.toArrayRecursive | public static function toArrayRecursive($collection) {
$arr = $collection;
if (is_object($collection) && method_exists($collection, 'toArray')) {
$arr = $collection->toArray();
}
return array_map(function ($v) {
if (is_object($v) && method_exists($v, 'toArray')) {
return static::toArrayRecursive($v);... | php | public static function toArrayRecursive($collection) {
$arr = $collection;
if (is_object($collection) && method_exists($collection, 'toArray')) {
$arr = $collection->toArray();
}
return array_map(function ($v) {
if (is_object($v) && method_exists($v, 'toArray')) {
return static::toArrayRecursive($v);... | [
"public",
"static",
"function",
"toArrayRecursive",
"(",
"$",
"collection",
")",
"{",
"$",
"arr",
"=",
"$",
"collection",
";",
"if",
"(",
"is_object",
"(",
"$",
"collection",
")",
"&&",
"method_exists",
"(",
"$",
"collection",
",",
"'toArray'",
")",
")",
... | Recursively exports a collection to an array
@param mixed $collection
@return array | [
"Recursively",
"exports",
"a",
"collection",
"to",
"an",
"array"
] | e745fe3735a6f2099015d11ea7b917634ebf76f3 | https://github.com/phootwork/collection/blob/e745fe3735a6f2099015d11ea7b917634ebf76f3/src/CollectionUtils.php#L88-L100 |
224,550 | netz98/n98-deployer | src/Deployer/Task/DeployTasks.php | DeployTasks.initStableRelease | protected static function initStableRelease()
{
$releasePathStable = '';
$path = \Deployer\get('deploy_path');
$hasStableRelease = \Deployer\test("[ -d $path/current/ ]");
if ($hasStableRelease) {
// make shure we do not have an array at this point TODO: Check why this w... | php | protected static function initStableRelease()
{
$releasePathStable = '';
$path = \Deployer\get('deploy_path');
$hasStableRelease = \Deployer\test("[ -d $path/current/ ]");
if ($hasStableRelease) {
// make shure we do not have an array at this point TODO: Check why this w... | [
"protected",
"static",
"function",
"initStableRelease",
"(",
")",
"{",
"$",
"releasePathStable",
"=",
"''",
";",
"$",
"path",
"=",
"\\",
"Deployer",
"\\",
"get",
"(",
"'deploy_path'",
")",
";",
"$",
"hasStableRelease",
"=",
"\\",
"Deployer",
"\\",
"test",
... | Detect the path to current release before actual deployment starts
This is done so we have it later on during rollback and maybe other actions | [
"Detect",
"the",
"path",
"to",
"current",
"release",
"before",
"actual",
"deployment",
"starts"
] | cf7b7c790f45c41ed338b8a33b498eeaaaa765e9 | https://github.com/netz98/n98-deployer/blob/cf7b7c790f45c41ed338b8a33b498eeaaaa765e9/src/Deployer/Task/DeployTasks.php#L121-L144 |
224,551 | netz98/n98-deployer | src/Deployer/Task/DeployTasks.php | DeployTasks.initReleaseName | protected static function initReleaseName()
{
// Ensure the release-name is unique otherwise there are weird consequences in deployer
// them being dep/releases with wrong versions, deployments to same release, …
$release = \Deployer\get('release_name');
$isVersion = version_compare... | php | protected static function initReleaseName()
{
// Ensure the release-name is unique otherwise there are weird consequences in deployer
// them being dep/releases with wrong versions, deployments to same release, …
$release = \Deployer\get('release_name');
$isVersion = version_compare... | [
"protected",
"static",
"function",
"initReleaseName",
"(",
")",
"{",
"// Ensure the release-name is unique otherwise there are weird consequences in deployer",
"// them being dep/releases with wrong versions, deployments to same release, …",
"$",
"release",
"=",
"\\",
"Deployer",
"\\",
... | Initialize a unique release-name checking if the release-name already exists and then postfixing it
this is part of the overwrite of Deployer's own release_name logic | [
"Initialize",
"a",
"unique",
"release",
"-",
"name",
"checking",
"if",
"the",
"release",
"-",
"name",
"already",
"exists",
"and",
"then",
"postfixing",
"it"
] | cf7b7c790f45c41ed338b8a33b498eeaaaa765e9 | https://github.com/netz98/n98-deployer/blob/cf7b7c790f45c41ed338b8a33b498eeaaaa765e9/src/Deployer/Task/DeployTasks.php#L151-L173 |
224,552 | netz98/n98-deployer | src/Deployer/Task/DeployTasks.php | DeployTasks.getUniqueReleaseName | protected static function getUniqueReleaseName($release)
{
// Prevent duplicate release names
$i = 0;
$releaseName = $release;
$cmdTemplate = '[ -d {{deploy_path}}/releases/%s ]';
$cmd = sprintf($cmdTemplate, $releaseName);
while (\Deployer\test($cmd)) {
$... | php | protected static function getUniqueReleaseName($release)
{
// Prevent duplicate release names
$i = 0;
$releaseName = $release;
$cmdTemplate = '[ -d {{deploy_path}}/releases/%s ]';
$cmd = sprintf($cmdTemplate, $releaseName);
while (\Deployer\test($cmd)) {
$... | [
"protected",
"static",
"function",
"getUniqueReleaseName",
"(",
"$",
"release",
")",
"{",
"// Prevent duplicate release names",
"$",
"i",
"=",
"0",
";",
"$",
"releaseName",
"=",
"$",
"release",
";",
"$",
"cmdTemplate",
"=",
"'[ -d {{deploy_path}}/releases/%s ]'",
";... | Determines a unique release-name
@param string $release
@return string | [
"Determines",
"a",
"unique",
"release",
"-",
"name"
] | cf7b7c790f45c41ed338b8a33b498eeaaaa765e9 | https://github.com/netz98/n98-deployer/blob/cf7b7c790f45c41ed338b8a33b498eeaaaa765e9/src/Deployer/Task/DeployTasks.php#L182-L195 |
224,553 | sijad/flarum-ext-pages | src/Page.php | Page.getContentHtmlAttribute | public function getContentHtmlAttribute()
{
if ($this->is_html) {
return $this->content;
}
return static::$formatter->render($this->attributes['content'], $this);
} | php | public function getContentHtmlAttribute()
{
if ($this->is_html) {
return $this->content;
}
return static::$formatter->render($this->attributes['content'], $this);
} | [
"public",
"function",
"getContentHtmlAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_html",
")",
"{",
"return",
"$",
"this",
"->",
"content",
";",
"}",
"return",
"static",
"::",
"$",
"formatter",
"->",
"render",
"(",
"$",
"this",
"->",
"at... | Get the content rendered as HTML.
@return string | [
"Get",
"the",
"content",
"rendered",
"as",
"HTML",
"."
] | d318664af7f8485ddbcf405a329a99880d036b78 | https://github.com/sijad/flarum-ext-pages/blob/d318664af7f8485ddbcf405a329a99880d036b78/src/Page.php#L96-L102 |
224,554 | joomla-framework/github-api | src/Package/Repositories/Deployments.php | Deployments.getList | public function getList($owner, $repo, $sha = '', $ref = '', $task = '', $environment = '', $page = 0, $limit = 0)
{
// Build the request path.
$path = "/repos/$owner/$repo/deployments";
$uri = new Uri($this->fetchUrl($path, $page, $limit));
if ($sha)
{
$uri->setVar('sha', $sha);
}
if ($ref)
{
... | php | public function getList($owner, $repo, $sha = '', $ref = '', $task = '', $environment = '', $page = 0, $limit = 0)
{
// Build the request path.
$path = "/repos/$owner/$repo/deployments";
$uri = new Uri($this->fetchUrl($path, $page, $limit));
if ($sha)
{
$uri->setVar('sha', $sha);
}
if ($ref)
{
... | [
"public",
"function",
"getList",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"sha",
"=",
"''",
",",
"$",
"ref",
"=",
"''",
",",
"$",
"task",
"=",
"''",
",",
"$",
"environment",
"=",
"''",
",",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",... | List Deployments.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $sha The SHA that was recorded at creation time.
@param string $ref The name of the ref. This can be a branch, tag... | [
"List",
"Deployments",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Deployments.php#L39-L67 |
224,555 | joomla-framework/github-api | src/Package/Repositories/Deployments.php | Deployments.create | public function create($owner, $repo, $ref, $task = '', $autoMerge = true, $requiredContexts = null, $payload = '', $environment = '',
$description = ''
)
{
// Build the request path.
$path = "/repos/$owner/$repo/deployments";
$data = array(
'ref' => $ref,
'auto_merge' => $autoMerge,
);
if ... | php | public function create($owner, $repo, $ref, $task = '', $autoMerge = true, $requiredContexts = null, $payload = '', $environment = '',
$description = ''
)
{
// Build the request path.
$path = "/repos/$owner/$repo/deployments";
$data = array(
'ref' => $ref,
'auto_merge' => $autoMerge,
);
if ... | [
"public",
"function",
"create",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"ref",
",",
"$",
"task",
"=",
"''",
",",
"$",
"autoMerge",
"=",
"true",
",",
"$",
"requiredContexts",
"=",
"null",
",",
"$",
"payload",
"=",
"''",
",",
"$",
"environment... | Create a Deployment.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $ref The ref to deploy. This can be a branch, tag, or SHA.
@param string $task O... | [
"Create",
"a",
"Deployment",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Deployments.php#L89-L144 |
224,556 | joomla-framework/github-api | src/Package/Repositories/Deployments.php | Deployments.getDeploymentStatuses | public function getDeploymentStatuses($owner, $repo, $id, $page = 0, $limit = 0)
{
// Build the request path.
$path = "/repos/$owner/$repo/deployments/" . (int) $id . '/statuses';
return $this->processResponse(
$this->client->get($this->fetchUrl($path, $page, $limit))
);
} | php | public function getDeploymentStatuses($owner, $repo, $id, $page = 0, $limit = 0)
{
// Build the request path.
$path = "/repos/$owner/$repo/deployments/" . (int) $id . '/statuses';
return $this->processResponse(
$this->client->get($this->fetchUrl($path, $page, $limit))
);
} | [
"public",
"function",
"getDeploymentStatuses",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"id",
",",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",
"0",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"\"/repos/$owner/$repo/deployments/\"",
"."... | List Deployment Statuses.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $id The Deployment ID to list the statuses from.
@param integer $page The page number from which to get items.
@param integer $l... | [
"List",
"Deployment",
"Statuses",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Deployments.php#L159-L167 |
224,557 | joomla-framework/github-api | src/Package/Repositories/Deployments.php | Deployments.createStatus | public function createStatus($owner, $repo, $id, $state, $targetUrl = '', $description = '')
{
$allowedStates = array('pending', 'success', 'error', 'failure');
// Build the request path.
$path = "/repos/$owner/$repo/deployments/" . (int) $id . '/statuses';
if (!\in_array($state, $allowedStates))
{
thro... | php | public function createStatus($owner, $repo, $id, $state, $targetUrl = '', $description = '')
{
$allowedStates = array('pending', 'success', 'error', 'failure');
// Build the request path.
$path = "/repos/$owner/$repo/deployments/" . (int) $id . '/statuses';
if (!\in_array($state, $allowedStates))
{
thro... | [
"public",
"function",
"createStatus",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"id",
",",
"$",
"state",
",",
"$",
"targetUrl",
"=",
"''",
",",
"$",
"description",
"=",
"''",
")",
"{",
"$",
"allowedStates",
"=",
"array",
"(",
"'pending'",
",",
... | Create a Deployment Status.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $id The Deployment ID to list the statuses from.
@param string $state The state of the status.
@param s... | [
"Create",
"a",
"Deployment",
"Status",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Deployments.php#L185-L215 |
224,558 | acacha/users | src/Http/Controllers/APIFullUsersController.php | APIFullUsersController.executeDestroy | private function executeDestroy($ids){
$models = User::find($ids);
User::destroy($ids);
event(new UserRemoved($models->toJson()));
return Response::json(['deleted' => true ]);
} | php | private function executeDestroy($ids){
$models = User::find($ids);
User::destroy($ids);
event(new UserRemoved($models->toJson()));
return Response::json(['deleted' => true ]);
} | [
"private",
"function",
"executeDestroy",
"(",
"$",
"ids",
")",
"{",
"$",
"models",
"=",
"User",
"::",
"find",
"(",
"$",
"ids",
")",
";",
"User",
"::",
"destroy",
"(",
"$",
"ids",
")",
";",
"event",
"(",
"new",
"UserRemoved",
"(",
"$",
"models",
"->... | Execute destroy.
@param $ids
@return \Illuminate\Http\JsonResponse | [
"Execute",
"destroy",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/APIFullUsersController.php#L71-L80 |
224,559 | kohkimakimoto/workerphp | src/Kohkimakimoto/Worker/Worker.php | Worker.start | public function start()
{
declare (ticks = 1);
register_shutdown_function(array($this, "shutdown"));
pcntl_signal(SIGTERM, array($this, "signalHandler"));
pcntl_signal(SIGINT, array($this, "signalHandler"));
$this->output->writeln("<info>Starting <comment>".$this->config->ge... | php | public function start()
{
declare (ticks = 1);
register_shutdown_function(array($this, "shutdown"));
pcntl_signal(SIGTERM, array($this, "signalHandler"));
pcntl_signal(SIGINT, array($this, "signalHandler"));
$this->output->writeln("<info>Starting <comment>".$this->config->ge... | [
"public",
"function",
"start",
"(",
")",
"{",
"declare",
"(",
"ticks",
"=",
"1",
")",
";",
"register_shutdown_function",
"(",
"array",
"(",
"$",
"this",
",",
"\"shutdown\"",
")",
")",
";",
"pcntl_signal",
"(",
"SIGTERM",
",",
"array",
"(",
"$",
"this",
... | Starts running worker.
@return void | [
"Starts",
"running",
"worker",
"."
] | fd9688d21b6e46b9a5ecb154374a980ca93dffbc | https://github.com/kohkimakimoto/workerphp/blob/fd9688d21b6e46b9a5ecb154374a980ca93dffbc/src/Kohkimakimoto/Worker/Worker.php#L76-L94 |
224,560 | kohkimakimoto/workerphp | src/Kohkimakimoto/Worker/Worker.php | Worker.shutdown | public function shutdown()
{
if ($this->masterPid === posix_getpid() && !$this->finished) {
// only master process.
$this->dispatcher->dispatch(WorkerEvents::SHUTTING_DOWN, new WorkerShuttingDownEvent($this));
$this->output->writeln("<info>Shutdown <comment>".$this->confi... | php | public function shutdown()
{
if ($this->masterPid === posix_getpid() && !$this->finished) {
// only master process.
$this->dispatcher->dispatch(WorkerEvents::SHUTTING_DOWN, new WorkerShuttingDownEvent($this));
$this->output->writeln("<info>Shutdown <comment>".$this->confi... | [
"public",
"function",
"shutdown",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"masterPid",
"===",
"posix_getpid",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"finished",
")",
"{",
"// only master process.",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
... | Shoutdown process.
@return void | [
"Shoutdown",
"process",
"."
] | fd9688d21b6e46b9a5ecb154374a980ca93dffbc | https://github.com/kohkimakimoto/workerphp/blob/fd9688d21b6e46b9a5ecb154374a980ca93dffbc/src/Kohkimakimoto/Worker/Worker.php#L120-L128 |
224,561 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.upload | public function upload(SS_HTTPRequest $request)
{
$field = $this->getUploadField();
$uploadResponse = $field->upload($request);
//decode response body. ugly hack ;o
$body = Convert::json2array($uploadResponse->getBody());
$body = array_shift($body);
//add extra data
... | php | public function upload(SS_HTTPRequest $request)
{
$field = $this->getUploadField();
$uploadResponse = $field->upload($request);
//decode response body. ugly hack ;o
$body = Convert::json2array($uploadResponse->getBody());
$body = array_shift($body);
//add extra data
... | [
"public",
"function",
"upload",
"(",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"getUploadField",
"(",
")",
";",
"$",
"uploadResponse",
"=",
"$",
"field",
"->",
"upload",
"(",
"$",
"request",
")",
";",
"//decode res... | Upload the given file, and import or start preview.
@param SS_HTTPRequest $request
@return string | [
"Upload",
"the",
"given",
"file",
"and",
"import",
"or",
"start",
"preview",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L81-L100 |
224,562 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.preview | public function preview(SS_HTTPRequest $request)
{
$file = File::get()
->byID($request->param('FileID'));
if (!$file) {
return "file not found";
}
//TODO: validate file?
$mapper = new CSVFieldMapper($file->getFullPath());
$mapper->setMappableCo... | php | public function preview(SS_HTTPRequest $request)
{
$file = File::get()
->byID($request->param('FileID'));
if (!$file) {
return "file not found";
}
//TODO: validate file?
$mapper = new CSVFieldMapper($file->getFullPath());
$mapper->setMappableCo... | [
"public",
"function",
"preview",
"(",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"$",
"file",
"=",
"File",
"::",
"get",
"(",
")",
"->",
"byID",
"(",
"$",
"request",
"->",
"param",
"(",
"'FileID'",
")",
")",
";",
"if",
"(",
"!",
"$",
"file",
")",
... | Action for getting preview interface.
@param SS_HTTPRequest $request
@return string | [
"Action",
"for",
"getting",
"preview",
"interface",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L107-L137 |
224,563 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.MapperForm | public function MapperForm()
{
$fields = new FieldList(
CheckboxField::create("HasHeader",
"This data includes a header row.",
true
)
);
if ($this->component->getCanClearData()) {
$fields->push(
CheckboxField... | php | public function MapperForm()
{
$fields = new FieldList(
CheckboxField::create("HasHeader",
"This data includes a header row.",
true
)
);
if ($this->component->getCanClearData()) {
$fields->push(
CheckboxField... | [
"public",
"function",
"MapperForm",
"(",
")",
"{",
"$",
"fields",
"=",
"new",
"FieldList",
"(",
"CheckboxField",
"::",
"create",
"(",
"\"HasHeader\"",
",",
"\"This data includes a header row.\"",
",",
"true",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"com... | The import form for creating mapping,
and choosing options.
@return Form | [
"The",
"import",
"form",
"for",
"creating",
"mapping",
"and",
"choosing",
"options",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L144-L166 |
224,564 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.import | public function import(SS_HTTPRequest $request)
{
$hasheader = (bool)$request->postVar('HasHeader');
$cleardata = $this->component->getCanClearData() ?
(bool)$request->postVar('ClearData') :
false;
if ($request->postVar('action_import')) {
... | php | public function import(SS_HTTPRequest $request)
{
$hasheader = (bool)$request->postVar('HasHeader');
$cleardata = $this->component->getCanClearData() ?
(bool)$request->postVar('ClearData') :
false;
if ($request->postVar('action_import')) {
... | [
"public",
"function",
"import",
"(",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"$",
"hasheader",
"=",
"(",
"bool",
")",
"$",
"request",
"->",
"postVar",
"(",
"'HasHeader'",
")",
";",
"$",
"cleardata",
"=",
"$",
"this",
"->",
"component",
"->",
"getCanC... | Import the current file
@param SS_HTTPRequest $request | [
"Import",
"the",
"current",
"file"
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L182-L211 |
224,565 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.importFile | public function importFile($filepath, $colmap = null, $hasheader = true, $cleardata = false)
{
$loader = $this->component->getLoader($this->gridField);
$loader->deleteExistingRecords = $cleardata;
//set or merge in given col map
if (is_array($colmap)) {
$loader->columnMa... | php | public function importFile($filepath, $colmap = null, $hasheader = true, $cleardata = false)
{
$loader = $this->component->getLoader($this->gridField);
$loader->deleteExistingRecords = $cleardata;
//set or merge in given col map
if (is_array($colmap)) {
$loader->columnMa... | [
"public",
"function",
"importFile",
"(",
"$",
"filepath",
",",
"$",
"colmap",
"=",
"null",
",",
"$",
"hasheader",
"=",
"true",
",",
"$",
"cleardata",
"=",
"false",
")",
"{",
"$",
"loader",
"=",
"$",
"this",
"->",
"component",
"->",
"getLoader",
"(",
... | Do the import using the configured importer.
@param string $filepath
@param array|null $colmap
@return BulkLoader_Result | [
"Do",
"the",
"import",
"using",
"the",
"configured",
"importer",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L219-L234 |
224,566 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.cacheMapping | protected function cacheMapping($mapping)
{
$mapping = array_filter($mapping);
if ($mapping && !empty($mapping)) {
$cache = SS_Cache::factory('gridfieldimporter');
$cache->save(serialize($mapping), $this->cacheKey());
}
} | php | protected function cacheMapping($mapping)
{
$mapping = array_filter($mapping);
if ($mapping && !empty($mapping)) {
$cache = SS_Cache::factory('gridfieldimporter');
$cache->save(serialize($mapping), $this->cacheKey());
}
} | [
"protected",
"function",
"cacheMapping",
"(",
"$",
"mapping",
")",
"{",
"$",
"mapping",
"=",
"array_filter",
"(",
"$",
"mapping",
")",
";",
"if",
"(",
"$",
"mapping",
"&&",
"!",
"empty",
"(",
"$",
"mapping",
")",
")",
"{",
"$",
"cache",
"=",
"SS_Cach... | Store the user defined mapping for future use. | [
"Store",
"the",
"user",
"defined",
"mapping",
"for",
"future",
"use",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L278-L285 |
224,567 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.getCachedMapping | protected function getCachedMapping()
{
$cache = SS_Cache::factory('gridfieldimporter');
if ($result = $cache->load($this->cacheKey())) {
return unserialize($result);
}
} | php | protected function getCachedMapping()
{
$cache = SS_Cache::factory('gridfieldimporter');
if ($result = $cache->load($this->cacheKey())) {
return unserialize($result);
}
} | [
"protected",
"function",
"getCachedMapping",
"(",
")",
"{",
"$",
"cache",
"=",
"SS_Cache",
"::",
"factory",
"(",
"'gridfieldimporter'",
")",
";",
"if",
"(",
"$",
"result",
"=",
"$",
"cache",
"->",
"load",
"(",
"$",
"this",
"->",
"cacheKey",
"(",
")",
"... | Look for a previously stored user defined mapping. | [
"Look",
"for",
"a",
"previously",
"stored",
"user",
"defined",
"mapping",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L290-L296 |
224,568 | burnbright/silverstripe-importexport | code/gridfield/GridFieldImporter_Request.php | GridFieldImporter_Request.getBackURL | protected function getBackURL(SS_HTTPRequest $request) {
// Initialize a sane default (basically redirects to root admin URL).
$controller = $this->getToplevelController();
$url = method_exists($this->requestHandler, "Link") ?
$this->requestHandler->Link() :
$controller->Link()... | php | protected function getBackURL(SS_HTTPRequest $request) {
// Initialize a sane default (basically redirects to root admin URL).
$controller = $this->getToplevelController();
$url = method_exists($this->requestHandler, "Link") ?
$this->requestHandler->Link() :
$controller->Link()... | [
"protected",
"function",
"getBackURL",
"(",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"// Initialize a sane default (basically redirects to root admin URL).",
"$",
"controller",
"=",
"$",
"this",
"->",
"getToplevelController",
"(",
")",
";",
"$",
"url",
"=",
"method_e... | Get's the previous URL that lead up to the current request.
NOTE: Honestly, this should be built into SS_HTTPRequest, but we can't depend on that right now... so instead,
this is being copied verbatim from Controller (in the framework).
@param SS_HTTPRequest $request
@return string | [
"Get",
"s",
"the",
"previous",
"URL",
"that",
"lead",
"up",
"to",
"the",
"current",
"request",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/gridfield/GridFieldImporter_Request.php#L315-L332 |
224,569 | burnbright/silverstripe-importexport | code/bulkloader/sources/CsvBulkLoaderSource.php | CsvBulkLoaderSource.getIterator | public function getIterator()
{
if (!file_exists($this->filepath)) {
//TODO: throw exception instead?
return null;
}
$header = $this->hasheader ? $this->getFirstRow() : null;
$output = array();
$config = new LexerConfig();
$config->setDelimite... | php | public function getIterator()
{
if (!file_exists($this->filepath)) {
//TODO: throw exception instead?
return null;
}
$header = $this->hasheader ? $this->getFirstRow() : null;
$output = array();
$config = new LexerConfig();
$config->setDelimite... | [
"public",
"function",
"getIterator",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"filepath",
")",
")",
"{",
"//TODO: throw exception instead?",
"return",
"null",
";",
"}",
"$",
"header",
"=",
"$",
"this",
"->",
"hasheader",
"?",
... | Get a new CSVParser using defined settings.
@return Iterator | [
"Get",
"a",
"new",
"CSVParser",
"using",
"defined",
"settings",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/sources/CsvBulkLoaderSource.php#L73-L108 |
224,570 | acacha/users | src/Http/Controllers/UserProfileController.php | UserProfileController.index | public function index(User $user)
{
$data = [];
if ($user->id) {
//Requesting another user profile
if ( $user->identifiableName() === Auth::user()->id || Auth::user()->can('see-other-users-profile')) {
$data = $user->toArray();
} else {
... | php | public function index(User $user)
{
$data = [];
if ($user->id) {
//Requesting another user profile
if ( $user->identifiableName() === Auth::user()->id || Auth::user()->can('see-other-users-profile')) {
$data = $user->toArray();
} else {
... | [
"public",
"function",
"index",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"user",
"->",
"id",
")",
"{",
"//Requesting another user profile",
"if",
"(",
"$",
"user",
"->",
"identifiableName",
"(",
")",
"===",
... | Show user profile.
@param User $user
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"Show",
"user",
"profile",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/UserProfileController.php#L20-L32 |
224,571 | acacha/users | src/Providers/UsersServiceProvider.php | UsersServiceProvider.registerGoogleServiceProvider | protected function registerGoogleServiceProvider()
{
$this->app->register(GoogleServiceProvider::class);
$this->app->booting(function() {
$loader = AliasLoader::getInstance();
$loader->alias('Google', Google::class);
});
app()->extend(\PulkitJalan\Google\Cli... | php | protected function registerGoogleServiceProvider()
{
$this->app->register(GoogleServiceProvider::class);
$this->app->booting(function() {
$loader = AliasLoader::getInstance();
$loader->alias('Google', Google::class);
});
app()->extend(\PulkitJalan\Google\Cli... | [
"protected",
"function",
"registerGoogleServiceProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"register",
"(",
"GoogleServiceProvider",
"::",
"class",
")",
";",
"$",
"this",
"->",
"app",
"->",
"booting",
"(",
"function",
"(",
")",
"{",
"$",
"loa... | Register Google Service Provider. | [
"Register",
"Google",
"Service",
"Provider",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Providers/UsersServiceProvider.php#L94-L107 |
224,572 | acacha/users | src/Providers/UsersServiceProvider.php | UsersServiceProvider.defineRoutes | protected function defineRoutes()
{
if (!$this->app->routesAreCached()) {
$router = app('router');
$this->defineWebRoutes($router);
$this->defineApiRoutes($router);
}
} | php | protected function defineRoutes()
{
if (!$this->app->routesAreCached()) {
$router = app('router');
$this->defineWebRoutes($router);
$this->defineApiRoutes($router);
}
} | [
"protected",
"function",
"defineRoutes",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"->",
"routesAreCached",
"(",
")",
")",
"{",
"$",
"router",
"=",
"app",
"(",
"'router'",
")",
";",
"$",
"this",
"->",
"defineWebRoutes",
"(",
"$",
"rout... | Define the AdminLTETemplate routes. | [
"Define",
"the",
"AdminLTETemplate",
"routes",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Providers/UsersServiceProvider.php#L146-L153 |
224,573 | framgia/laravel-skeleton | src/RunCommand.php | RunCommand.removeUserModel | protected function removeUserModel($directory)
{
$modelFile = $directory . '/app/User.php';
if (is_file($modelFile)) {
@chmod($modelFile, 0777);
@unlink($modelFile);
}
return $this;
} | php | protected function removeUserModel($directory)
{
$modelFile = $directory . '/app/User.php';
if (is_file($modelFile)) {
@chmod($modelFile, 0777);
@unlink($modelFile);
}
return $this;
} | [
"protected",
"function",
"removeUserModel",
"(",
"$",
"directory",
")",
"{",
"$",
"modelFile",
"=",
"$",
"directory",
".",
"'/app/User.php'",
";",
"if",
"(",
"is_file",
"(",
"$",
"modelFile",
")",
")",
"{",
"@",
"chmod",
"(",
"$",
"modelFile",
",",
"0777... | Delete old model User.php
@param $directory
@return $this | [
"Delete",
"old",
"model",
"User",
".",
"php"
] | 9439868a36c44b6df8b5a0b735094e4d6f86aa60 | https://github.com/framgia/laravel-skeleton/blob/9439868a36c44b6df8b5a0b735094e4d6f86aa60/src/RunCommand.php#L121-L131 |
224,574 | acacha/users | src/Http/Controllers/UserInvitationsController.php | UserInvitationsController.accept | public function accept(Request $request)
{
if (! $request->has('token')) abort(404);
if (! $invitation = $this->validateToken($request->input('token'))) abort(404);
return $this->showAcceptUserInvitationForm($invitation);
} | php | public function accept(Request $request)
{
if (! $request->has('token')) abort(404);
if (! $invitation = $this->validateToken($request->input('token'))) abort(404);
return $this->showAcceptUserInvitationForm($invitation);
} | [
"public",
"function",
"accept",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"has",
"(",
"'token'",
")",
")",
"abort",
"(",
"404",
")",
";",
"if",
"(",
"!",
"$",
"invitation",
"=",
"$",
"this",
"->",
"validateToke... | Accept user invitation.
@param Request $request
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"Accept",
"user",
"invitation",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/UserInvitationsController.php#L110-L115 |
224,575 | acacha/users | src/Http/Controllers/UserInvitationsController.php | UserInvitationsController.postAccept | public function postAccept(CreateUserWithTokenRequest $request)
{
if (! $request->has('token')) abort(403);
if (! $invitation = $this->validateToken($request->input('token'))) abort(403);
$user = User::create([
'name' => $request->input('name'),
'email' => $request->... | php | public function postAccept(CreateUserWithTokenRequest $request)
{
if (! $request->has('token')) abort(403);
if (! $invitation = $this->validateToken($request->input('token'))) abort(403);
$user = User::create([
'name' => $request->input('name'),
'email' => $request->... | [
"public",
"function",
"postAccept",
"(",
"CreateUserWithTokenRequest",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"has",
"(",
"'token'",
")",
")",
"abort",
"(",
"403",
")",
";",
"if",
"(",
"!",
"$",
"invitation",
"=",
"$",
"this",
... | Process accept user invitation form.
@param CreateUserWithTokenRequest $request
@return \Illuminate\Http\JsonResponse | [
"Process",
"accept",
"user",
"invitation",
"form",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/UserInvitationsController.php#L123-L141 |
224,576 | netz98/n98-deployer | src/Deployer/Task/MagentoTasks.php | MagentoTasks.updateMagentoConfig | public static function updateMagentoConfig()
{
$env = \Deployer\get('config_store_env');
if (empty($env)) {
$env = \Deployer\input()->getArgument('stage');
}
$dir = \Deployer\get('config_store_dir');
if (empty($dir)) {
$dir = '{{release_path}}/config/... | php | public static function updateMagentoConfig()
{
$env = \Deployer\get('config_store_env');
if (empty($env)) {
$env = \Deployer\input()->getArgument('stage');
}
$dir = \Deployer\get('config_store_dir');
if (empty($dir)) {
$dir = '{{release_path}}/config/... | [
"public",
"static",
"function",
"updateMagentoConfig",
"(",
")",
"{",
"$",
"env",
"=",
"\\",
"Deployer",
"\\",
"get",
"(",
"'config_store_env'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"env",
")",
")",
"{",
"$",
"env",
"=",
"\\",
"Deployer",
"\\",
"i... | Import the Magento Config using the config data files
config:
- config_store_env
requirements:
- config:data:import command through semaio/Magento2-ConfigImportExport
- <git-repo>/config/store/<config_store_env> directory tree
@throws \Symfony\Component\Console\Exception\InvalidArgumentException | [
"Import",
"the",
"Magento",
"Config",
"using",
"the",
"config",
"data",
"files"
] | cf7b7c790f45c41ed338b8a33b498eeaaaa765e9 | https://github.com/netz98/n98-deployer/blob/cf7b7c790f45c41ed338b8a33b498eeaaaa765e9/src/Deployer/Task/MagentoTasks.php#L146-L160 |
224,577 | phootwork/collection | src/ArrayList.php | ArrayList.add | public function add($element, $index = null) {
if ($index === null) {
$this->collection[$this->size()] = $element;
} else {
array_splice($this->collection, $index, 0, $element);
}
return $this;
} | php | public function add($element, $index = null) {
if ($index === null) {
$this->collection[$this->size()] = $element;
} else {
array_splice($this->collection, $index, 0, $element);
}
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"element",
",",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"index",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"collection",
"[",
"$",
"this",
"->",
"size",
"(",
")",
"]",
"=",
"$",
"element",
"... | Adds an element to that list
@param mixed $element
@param int $index
@return $this | [
"Adds",
"an",
"element",
"to",
"that",
"list"
] | e745fe3735a6f2099015d11ea7b917634ebf76f3 | https://github.com/phootwork/collection/blob/e745fe3735a6f2099015d11ea7b917634ebf76f3/src/ArrayList.php#L29-L37 |
224,578 | phootwork/collection | src/ArrayList.php | ArrayList.remove | public function remove($element) {
$index = array_search($element, $this->collection, true);
if ($index !== null) {
unset($this->collection[$index]);
}
return $this;
} | php | public function remove($element) {
$index = array_search($element, $this->collection, true);
if ($index !== null) {
unset($this->collection[$index]);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"element",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"collection",
",",
"true",
")",
";",
"if",
"(",
"$",
"index",
"!==",
"null",
")",
"{",
"unset",
"(",
"$",... | Removes an element from the list
@param mixed $element
@return $this | [
"Removes",
"an",
"element",
"from",
"the",
"list"
] | e745fe3735a6f2099015d11ea7b917634ebf76f3 | https://github.com/phootwork/collection/blob/e745fe3735a6f2099015d11ea7b917634ebf76f3/src/ArrayList.php#L81-L88 |
224,579 | joomla-framework/github-api | src/Package/Activity/Feeds.php | Feeds.getFeeds | public function getFeeds()
{
// Build the request path.
$path = '/feeds';
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
} | php | public function getFeeds()
{
// Build the request path.
$path = '/feeds';
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
} | [
"public",
"function",
"getFeeds",
"(",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/feeds'",
";",
"return",
"$",
"this",
"->",
"processResponse",
"(",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
"->",
"fetchUrl",
"(",
"$",
... | List Feeds.
@return object
@since 1.4.0 | [
"List",
"Feeds",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Activity/Feeds.php#L29-L37 |
224,580 | joomla-framework/github-api | src/Package/Repositories/Releases.php | Releases.getByTag | public function getByTag($user, $repo, $tag)
{
// Build the request path.
$path = "/repos/$user/$repo/releases/tags/$tag";
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path)));
} | php | public function getByTag($user, $repo, $tag)
{
// Build the request path.
$path = "/repos/$user/$repo/releases/tags/$tag";
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path)));
} | [
"public",
"function",
"getByTag",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"tag",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"\"/repos/$user/$repo/releases/tags/$tag\"",
";",
"// Send the request.",
"return",
"$",
"this",
"->",
"processResponse",... | Get a release by tag name.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $tag The name of the tag.
@return object
@since 1.4.0 | [
"Get",
"a",
"release",
"by",
"tag",
"name",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Releases.php#L198-L205 |
224,581 | joomla-framework/github-api | src/Package/Repositories/Releases.php | Releases.getListAssets | public function getListAssets($user, $repo, $releaseId, $page = 0, $limit = 0)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/' . (int) $releaseId . '/assets';
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path, $page, $limit)));
} | php | public function getListAssets($user, $repo, $releaseId, $page = 0, $limit = 0)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/' . (int) $releaseId . '/assets';
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path, $page, $limit)));
} | [
"public",
"function",
"getListAssets",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"releaseId",
",",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",
"0",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"... | List assets for a release.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $releaseId The release id.
@param integer $page The page number from which to get items.
@param integer $limit Th... | [
"List",
"assets",
"for",
"a",
"release",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Releases.php#L254-L261 |
224,582 | joomla-framework/github-api | src/Package/Repositories/Releases.php | Releases.getAsset | public function getAsset($user, $repo, $assetId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId;
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path)));
} | php | public function getAsset($user, $repo, $assetId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId;
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path)));
} | [
"public",
"function",
"getAsset",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"assetId",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"'/'",
".",
"$",
"repo",
".",
"'/releases/assets/'",
".",
"(",
"int",... | Get a single release asset.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $assetId The asset id.
@return object
@since 1.4.0 | [
"Get",
"a",
"single",
"release",
"asset",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Releases.php#L274-L281 |
224,583 | joomla-framework/github-api | src/Package/Repositories/Releases.php | Releases.editAsset | public function editAsset($user, $repo, $assetId, $name, $label = '')
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId;
$data = array(
'name' => $name,
);
if ($label)
{
$data['label'] = $label;
}
// Send the request.
return $this->pr... | php | public function editAsset($user, $repo, $assetId, $name, $label = '')
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId;
$data = array(
'name' => $name,
);
if ($label)
{
$data['label'] = $label;
}
// Send the request.
return $this->pr... | [
"public",
"function",
"editAsset",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"assetId",
",",
"$",
"name",
",",
"$",
"label",
"=",
"''",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"'/'",
".",
"$",... | Edit a release asset.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $assetId The asset id.
@param string $name The file name of the asset.
@param string $label An alternate short description o... | [
"Edit",
"a",
"release",
"asset",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Releases.php#L296-L312 |
224,584 | joomla-framework/github-api | src/Package/Repositories/Releases.php | Releases.deleteAsset | public function deleteAsset($user, $repo, $assetId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId;
// Send the request.
$this->processResponse($this->client->delete($this->fetchUrl($path)), 204);
return true;
} | php | public function deleteAsset($user, $repo, $assetId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId;
// Send the request.
$this->processResponse($this->client->delete($this->fetchUrl($path)), 204);
return true;
} | [
"public",
"function",
"deleteAsset",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"assetId",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"'/'",
".",
"$",
"repo",
".",
"'/releases/assets/'",
".",
"(",
"in... | Delete a release asset.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $assetId The asset id.
@return boolean
@since 1.4.0 | [
"Delete",
"a",
"release",
"asset",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Releases.php#L325-L334 |
224,585 | neos/setup | Classes/Core/ConfigureRoutingComponent.php | ConfigureRoutingComponent.handle | public function handle(ComponentContext $componentContext)
{
$configurationSource = $this->objectManager->get(\Neos\Flow\Configuration\Source\YamlSource::class);
$routesConfiguration = $configurationSource->load($this->packageManager->getPackage('Neos.Setup')->getConfigurationPath() . ConfigurationM... | php | public function handle(ComponentContext $componentContext)
{
$configurationSource = $this->objectManager->get(\Neos\Flow\Configuration\Source\YamlSource::class);
$routesConfiguration = $configurationSource->load($this->packageManager->getPackage('Neos.Setup')->getConfigurationPath() . ConfigurationM... | [
"public",
"function",
"handle",
"(",
"ComponentContext",
"$",
"componentContext",
")",
"{",
"$",
"configurationSource",
"=",
"$",
"this",
"->",
"objectManager",
"->",
"get",
"(",
"\\",
"Neos",
"\\",
"Flow",
"\\",
"Configuration",
"\\",
"Source",
"\\",
"YamlSou... | Set the routes configuration for the Neos setup and configures the routing component
to skip initialisation, which would overwrite the specific settings again.
@param ComponentContext $componentContext
@return void | [
"Set",
"the",
"routes",
"configuration",
"for",
"the",
"Neos",
"setup",
"and",
"configures",
"the",
"routing",
"component",
"to",
"skip",
"initialisation",
"which",
"would",
"overwrite",
"the",
"specific",
"settings",
"again",
"."
] | 7b5437efe8113e997007be6896628aa9f5c39d2f | https://github.com/neos/setup/blob/7b5437efe8113e997007be6896628aa9f5c39d2f/Classes/Core/ConfigureRoutingComponent.php#L71-L77 |
224,586 | atorscho/membership | src/Membershipable.php | Membershipable.losePermissions | public function losePermissions($permissions): void
{
if (!is_array($permissions) && !$permissions instanceof Collection) {
$permissions = func_get_args();
}
foreach ($permissions as $permission) {
$permission = $this->resolvePermission($permission);
$th... | php | public function losePermissions($permissions): void
{
if (!is_array($permissions) && !$permissions instanceof Collection) {
$permissions = func_get_args();
}
foreach ($permissions as $permission) {
$permission = $this->resolvePermission($permission);
$th... | [
"public",
"function",
"losePermissions",
"(",
"$",
"permissions",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permissions",
")",
"&&",
"!",
"$",
"permissions",
"instanceof",
"Collection",
")",
"{",
"$",
"permissions",
"=",
"func_get_args",
... | Remove given permissions from the user.
@param array|Permission|Collection|string $permissions | [
"Remove",
"given",
"permissions",
"from",
"the",
"user",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Membershipable.php#L78-L89 |
224,587 | atorscho/membership | src/Membershipable.php | Membershipable.hasPermission | public function hasPermission(string $permission, ?Model $model = null, string $userForeignKey = 'user_id'): bool
{
// Check model's ownership
if ($model && $model->{$userForeignKey} == $this->id) {
return true;
}
// Check user's own permissions
if ($this->permis... | php | public function hasPermission(string $permission, ?Model $model = null, string $userForeignKey = 'user_id'): bool
{
// Check model's ownership
if ($model && $model->{$userForeignKey} == $this->id) {
return true;
}
// Check user's own permissions
if ($this->permis... | [
"public",
"function",
"hasPermission",
"(",
"string",
"$",
"permission",
",",
"?",
"Model",
"$",
"model",
"=",
"null",
",",
"string",
"$",
"userForeignKey",
"=",
"'user_id'",
")",
":",
"bool",
"{",
"// Check model's ownership",
"if",
"(",
"$",
"model",
"&&",... | Check whether the user has given permission. | [
"Check",
"whether",
"the",
"user",
"has",
"given",
"permission",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Membershipable.php#L94-L110 |
224,588 | atorscho/membership | src/Membershipable.php | Membershipable.makeLeaderOf | public function makeLeaderOf($group): void
{
$group = $this->resolveGroup($group);
$this->leadingGroups()->attach($group);
} | php | public function makeLeaderOf($group): void
{
$group = $this->resolveGroup($group);
$this->leadingGroups()->attach($group);
} | [
"public",
"function",
"makeLeaderOf",
"(",
"$",
"group",
")",
":",
"void",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"resolveGroup",
"(",
"$",
"group",
")",
";",
"$",
"this",
"->",
"leadingGroups",
"(",
")",
"->",
"attach",
"(",
"$",
"group",
")",
... | Make the user leader of a group.
@param int|string|Group $group | [
"Make",
"the",
"user",
"leader",
"of",
"a",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Membershipable.php#L117-L122 |
224,589 | atorscho/membership | src/Membershipable.php | Membershipable.isLeaderOf | public function isLeaderOf($group): bool
{
$group = $this->resolveGroup($group);
return $this->leadingGroups()->where('group_id', is_int($group) ? $group : $group->id)->exists();
} | php | public function isLeaderOf($group): bool
{
$group = $this->resolveGroup($group);
return $this->leadingGroups()->where('group_id', is_int($group) ? $group : $group->id)->exists();
} | [
"public",
"function",
"isLeaderOf",
"(",
"$",
"group",
")",
":",
"bool",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"resolveGroup",
"(",
"$",
"group",
")",
";",
"return",
"$",
"this",
"->",
"leadingGroups",
"(",
")",
"->",
"where",
"(",
"'group_id'",
... | Determine whether a given user is leader of the group.
@param int|string|Group $group
@return bool | [
"Determine",
"whether",
"a",
"given",
"user",
"is",
"leader",
"of",
"the",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Membershipable.php#L131-L136 |
224,590 | atorscho/membership | src/Membershipable.php | Membershipable.getFormattedNameAttribute | public function getFormattedNameAttribute(): string
{
$nameField = \Config::get('membership.users.name_column');
if (!$this->primary_group_id) {
return $this->{$nameField};
}
return $this->primaryGroup->open_tag . $this->{$nameField} . $this->primaryGroup->close_tag;
... | php | public function getFormattedNameAttribute(): string
{
$nameField = \Config::get('membership.users.name_column');
if (!$this->primary_group_id) {
return $this->{$nameField};
}
return $this->primaryGroup->open_tag . $this->{$nameField} . $this->primaryGroup->close_tag;
... | [
"public",
"function",
"getFormattedNameAttribute",
"(",
")",
":",
"string",
"{",
"$",
"nameField",
"=",
"\\",
"Config",
"::",
"get",
"(",
"'membership.users.name_column'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"primary_group_id",
")",
"{",
"return",
"... | Get user's formatted name according to his primary group tags. | [
"Get",
"user",
"s",
"formatted",
"name",
"according",
"to",
"his",
"primary",
"group",
"tags",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Membershipable.php#L141-L150 |
224,591 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.processAll | protected function processAll($filepath, $preview = false)
{
if (!$this->source) {
user_error("No source has been configured for the bulk loader",
E_USER_WARNING
);
}
$results = new BetterBulkLoader_Result();
$iterator = $this->getSource()->get... | php | protected function processAll($filepath, $preview = false)
{
if (!$this->source) {
user_error("No source has been configured for the bulk loader",
E_USER_WARNING
);
}
$results = new BetterBulkLoader_Result();
$iterator = $this->getSource()->get... | [
"protected",
"function",
"processAll",
"(",
"$",
"filepath",
",",
"$",
"preview",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"source",
")",
"{",
"user_error",
"(",
"\"No source has been configured for the bulk loader\"",
",",
"E_USER_WARNING",
")... | Import all records from the source.
@param string $filepath
@param boolean $preview
@return BulkLoader_Result | [
"Import",
"all",
"records",
"from",
"the",
"source",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L153-L167 |
224,592 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.processRecord | protected function processRecord($record, $columnMap, &$results, $preview = false)
{
if (!is_array($record) || empty($record) || !array_filter($record)) {
$results->addSkipped("Empty/invalid record data.");
return;
}
//map incoming record according to the standardisat... | php | protected function processRecord($record, $columnMap, &$results, $preview = false)
{
if (!is_array($record) || empty($record) || !array_filter($record)) {
$results->addSkipped("Empty/invalid record data.");
return;
}
//map incoming record according to the standardisat... | [
"protected",
"function",
"processRecord",
"(",
"$",
"record",
",",
"$",
"columnMap",
",",
"&",
"$",
"results",
",",
"$",
"preview",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"record",
")",
"||",
"empty",
"(",
"$",
"record",
")",
... | Import the given record | [
"Import",
"the",
"given",
"record"
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L172-L255 |
224,593 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.columnMapRecord | protected function columnMapRecord($record)
{
$adjustedmap = $this->columnMap;
$newrecord = array();
foreach ($record as $field => $value) {
if (isset($adjustedmap[$field])) {
$newrecord[$adjustedmap[$field]] = $value;
} else {
$newreco... | php | protected function columnMapRecord($record)
{
$adjustedmap = $this->columnMap;
$newrecord = array();
foreach ($record as $field => $value) {
if (isset($adjustedmap[$field])) {
$newrecord[$adjustedmap[$field]] = $value;
} else {
$newreco... | [
"protected",
"function",
"columnMapRecord",
"(",
"$",
"record",
")",
"{",
"$",
"adjustedmap",
"=",
"$",
"this",
"->",
"columnMap",
";",
"$",
"newrecord",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"record",
"as",
"$",
"field",
"=>",
"$",
"value"... | Convert the record's keys to appropriate columnMap keys.
@return array record | [
"Convert",
"the",
"record",
"s",
"keys",
"to",
"appropriate",
"columnMap",
"keys",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L261-L274 |
224,594 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.hasRequiredData | protected function hasRequiredData($mappedrecord)
{
if (!is_array($mappedrecord) || empty($mappedrecord) || !array_filter($mappedrecord)) {
return false;
}
foreach ($this->transforms as $field => $t) {
if (
is_array($t) &&
isset($t['req... | php | protected function hasRequiredData($mappedrecord)
{
if (!is_array($mappedrecord) || empty($mappedrecord) || !array_filter($mappedrecord)) {
return false;
}
foreach ($this->transforms as $field => $t) {
if (
is_array($t) &&
isset($t['req... | [
"protected",
"function",
"hasRequiredData",
"(",
"$",
"mappedrecord",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"mappedrecord",
")",
"||",
"empty",
"(",
"$",
"mappedrecord",
")",
"||",
"!",
"array_filter",
"(",
"$",
"mappedrecord",
")",
")",
"{",
"... | Check if the given mapped record has the required data.
@param array $mappedrecord
@return boolean | [
"Check",
"if",
"the",
"given",
"mapped",
"record",
"has",
"the",
"required",
"data",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L281-L299 |
224,595 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.isRelation | protected function isRelation($field)
{
//get relation name from dot notation
if (strpos($field, '.') !== false) {
list($field, $columnName) = explode('.', $field);
}
$has_ones = singleton($this->objectClass)->has_one();
//check if relation is present in has ones
... | php | protected function isRelation($field)
{
//get relation name from dot notation
if (strpos($field, '.') !== false) {
list($field, $columnName) = explode('.', $field);
}
$has_ones = singleton($this->objectClass)->has_one();
//check if relation is present in has ones
... | [
"protected",
"function",
"isRelation",
"(",
"$",
"field",
")",
"{",
"//get relation name from dot notation",
"if",
"(",
"strpos",
"(",
"$",
"field",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"list",
"(",
"$",
"field",
",",
"$",
"columnName",
")",
"=",
"... | Detect if a given record field is a relation field.
@param string $field
@return boolean | [
"Detect",
"if",
"a",
"given",
"record",
"field",
"is",
"a",
"relation",
"field",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L409-L418 |
224,596 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.getRelationName | protected function getRelationName($recordField)
{
$relationName = null;
if (isset($this->relationCallbacks[$recordField])) {
$relationName = $this->relationCallbacks[$recordField]['relationname'];
}
if (strpos($recordField, '.') !== false) {
list($relationNam... | php | protected function getRelationName($recordField)
{
$relationName = null;
if (isset($this->relationCallbacks[$recordField])) {
$relationName = $this->relationCallbacks[$recordField]['relationname'];
}
if (strpos($recordField, '.') !== false) {
list($relationNam... | [
"protected",
"function",
"getRelationName",
"(",
"$",
"recordField",
")",
"{",
"$",
"relationName",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"relationCallbacks",
"[",
"$",
"recordField",
"]",
")",
")",
"{",
"$",
"relationName",
"=",
... | Given a record field name, find out if this is a relation name
and return the name.
@param string
@return string | [
"Given",
"a",
"record",
"field",
"name",
"find",
"out",
"if",
"this",
"is",
"a",
"relation",
"name",
"and",
"return",
"the",
"name",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L426-L437 |
224,597 | burnbright/silverstripe-importexport | code/bulkloader/BetterBulkLoader.php | BetterBulkLoader.getMappableColumns | public function getMappableColumns()
{
if (!empty($this->mappableFields)) {
return $this->mappableFields;
}
$scaffolded = $this->scaffoldMappableFields();
if (!empty($this->transforms)) {
$transformables = array_keys($this->transforms);
$transforma... | php | public function getMappableColumns()
{
if (!empty($this->mappableFields)) {
return $this->mappableFields;
}
$scaffolded = $this->scaffoldMappableFields();
if (!empty($this->transforms)) {
$transformables = array_keys($this->transforms);
$transforma... | [
"public",
"function",
"getMappableColumns",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"mappableFields",
")",
")",
"{",
"return",
"$",
"this",
"->",
"mappableFields",
";",
"}",
"$",
"scaffolded",
"=",
"$",
"this",
"->",
"scaffoldMapp... | Get the field-label mapping of fields that data can be mapped into.
@return array | [
"Get",
"the",
"field",
"-",
"label",
"mapping",
"of",
"fields",
"that",
"data",
"can",
"be",
"mapped",
"into",
"."
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/bulkloader/BetterBulkLoader.php#L495-L509 |
224,598 | rafasamp/sonus | src/Rafasamp/Sonus/Sonus.php | Sonus.getConverterVersion | public static function getConverterVersion()
{
// Run terminal command to retrieve version
$command = self::getConverterPath().' -version';
$output = shell_exec($command);
// PREG pattern to retrive version information
$ouput = preg_match("/ffmpeg version (?P<major>[0-9]{0,... | php | public static function getConverterVersion()
{
// Run terminal command to retrieve version
$command = self::getConverterPath().' -version';
$output = shell_exec($command);
// PREG pattern to retrive version information
$ouput = preg_match("/ffmpeg version (?P<major>[0-9]{0,... | [
"public",
"static",
"function",
"getConverterVersion",
"(",
")",
"{",
"// Run terminal command to retrieve version",
"$",
"command",
"=",
"self",
"::",
"getConverterPath",
"(",
")",
".",
"' -version'",
";",
"$",
"output",
"=",
"shell_exec",
"(",
"$",
"command",
")... | Returns installed ffmpeg version
@return array | [
"Returns",
"installed",
"ffmpeg",
"version"
] | bdf49840c5de4e72a7b767eec399d3338f1f9779 | https://github.com/rafasamp/sonus/blob/bdf49840c5de4e72a7b767eec399d3338f1f9779/src/Rafasamp/Sonus/Sonus.php#L47-L70 |
224,599 | rafasamp/sonus | src/Rafasamp/Sonus/Sonus.php | Sonus.getSupportedFormats | public static function getSupportedFormats()
{
// Run terminal command
$command = self::getConverterPath().' -formats';
$output = shell_exec($command);
// PREG pattern to retrive version information
$output = preg_match_all("/(?P<mux>(D\s|\sE|DE))\s(?P<format>\S{3,11})\s/",... | php | public static function getSupportedFormats()
{
// Run terminal command
$command = self::getConverterPath().' -formats';
$output = shell_exec($command);
// PREG pattern to retrive version information
$output = preg_match_all("/(?P<mux>(D\s|\sE|DE))\s(?P<format>\S{3,11})\s/",... | [
"public",
"static",
"function",
"getSupportedFormats",
"(",
")",
"{",
"// Run terminal command",
"$",
"command",
"=",
"self",
"::",
"getConverterPath",
"(",
")",
".",
"' -formats'",
";",
"$",
"output",
"=",
"shell_exec",
"(",
"$",
"command",
")",
";",
"// PREG... | Returns all formats ffmpeg supports
@return array | [
"Returns",
"all",
"formats",
"ffmpeg",
"supports"
] | bdf49840c5de4e72a7b767eec399d3338f1f9779 | https://github.com/rafasamp/sonus/blob/bdf49840c5de4e72a7b767eec399d3338f1f9779/src/Rafasamp/Sonus/Sonus.php#L76-L95 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.