_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q12600
GitAuthorExtractor.copyDetection
train
private function copyDetection(array $logItem, array &$fileHistory, GitRepository $git) { if ($logItem['criteria'] !== 'C') { return; } $fromLastCommit = $this->commitCollection[$logItem['commit']]['parent']; $fromFileContent = $this->getFileContent($fromLas...
php
{ "resource": "" }
q12601
GitAuthorExtractor.createTempFile
train
private function createTempFile($name, $content) { $tempDir = \sys_get_temp_dir(); $fileName = \md5($name); $filePath = $tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation' . DIRECTORY_SEPARATOR . $fileName; if (\file_exists($filePath)) { return $filePath; ...
php
{ "resource": "" }
q12602
GitAuthorExtractor.removeTempDirectory
train
private function removeTempDirectory() { $tempDir = \sys_get_temp_dir(); $directoryPath = $tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation'; if (!\file_exists($directoryPath)) { return; } $directory = \opendir($directoryPath); while (($fi...
php
{ "resource": "" }
q12603
FileConfigService.save
train
public function save() { $this->load(); // Do the work in case we have only changed hash if ($this->isChanged()) { @chmod($this->path, 0777); return file_put_contents($this->path, $this->fileType->render($this->config)); } else { return true; ...
php
{ "resource": "" }
q12604
FileConfigService.store
train
public function store($key, $value) { $this->load(); $this->config[$key] = $value; return true; }
php
{ "resource": "" }
q12605
FileConfigService.storeMany
train
public function storeMany(array $pair) { foreach ($pair as $key => $value) { $this->set($key, $value); } return true; }
php
{ "resource": "" }
q12606
FileConfigService.get
train
public function get($key, $default = false) { $this->load(); if ($this->has($key)) { return $this->config[$key]; } else { return $default; } }
php
{ "resource": "" }
q12607
FileConfigService.remove
train
public function remove($key) { $this->load(); if ($this->exists($key)) { unset($this->config[$key]); return true; } else { throw new RuntimeException(sprintf('Attempted to read non-existing key "%s"', $key)); } }
php
{ "resource": "" }
q12608
FileConfigService.load
train
private function load() { if ($this->loaded === false) { if ($this->autoCreate === true) { if (!is_file($this->path)) { $this->touch(); } } $array = $this->fileType->fetch($this->path); if (is_array($array)...
php
{ "resource": "" }
q12609
ServiceLocator.get
train
public function get($service) { if ($this->has($service)) { return $this->container[$service]; } else { throw new RuntimeException(sprintf( 'Attempted to grab non-existing service "%s"', $service )); } }
php
{ "resource": "" }
q12610
ServiceLocator.registerArray
train
public function registerArray(array $instances) { foreach ($instances as $name => $instance) { $this->register($name, $instance); } return $this; }
php
{ "resource": "" }
q12611
ServiceLocator.register
train
public function register($name, $instance) { if (!is_string($name)) { throw new InvalidArgumentException(sprintf( 'Argument #1 $name must be a string, received "%s"', gettype($name) )); } $this->container[$name] = $instance; return $this; ...
php
{ "resource": "" }
q12612
ServiceLocator.has
train
public function has($service) { if (!is_string($service)) { throw new InvalidArgumentException(sprintf( 'Service name must be a string, received "%s"', gettype($service) )); } return isset($this->container[$service]); }
php
{ "resource": "" }
q12613
ServiceLocator.remove
train
public function remove($service) { if ($this->has($service)) { unset($this->container[$service]); return true; } else { trigger_error(sprintf( 'Attempted to un-register non-existing service "%s"', $service )); return false;...
php
{ "resource": "" }
q12614
Template_Tag.get_pure_post_content
train
public static function get_pure_post_content() { $post = get_post(); if ( ! $post || ! isset( $post->post_content ) ) { return; } if ( post_password_required( $post ) ) { return; } $extended = get_extended( $post->post_content ); $content = $extended['main']; return $content; }
php
{ "resource": "" }
q12615
Template_Tag.pure_trim_excerpt
train
public static function pure_trim_excerpt() { $raw_excerpt = ''; $text = static::get_pure_post_content(); $text = strip_shortcodes( $text ); $text = str_replace( ']]>', ']]>', $text ); $excerpt_length = apply_filters( 'excerpt_length', 55 ); $excerpt_more = apply_filters( 'excerpt_more', ' […]'...
php
{ "resource": "" }
q12616
Template_Tag.get_page_templates
train
public static function get_page_templates() { static $wrappers = []; if ( $wrappers ) { return $wrappers; } $page_templates = new Model\Page_Templates(); $wrappers = $page_templates->get(); return $wrappers; }
php
{ "resource": "" }
q12617
ModelResult.last
train
public function last() { if ($this->count()) { $models = $this->getModels(); return $models[$this->count() - 1]; } return null; }
php
{ "resource": "" }
q12618
ModelResult.json
train
public function json($fields = array(), $recursive = true) { $list = array(); foreach ($this->getModels() as $model) { $list[] = $model->json($fields, $recursive); } return $list; }
php
{ "resource": "" }
q12619
ModelResult.order
train
public function order($field, $desc = false) { if(count($this->models) > 0) { $instance = $this->reflection->newInstance(); $string = $instance->isString($field); usort($this->models, function ($a, $b) use ($field, $string) { if($string) { ...
php
{ "resource": "" }
q12620
Question.send
train
public static function send( Bookboon $bookboon, array $variables = [], string $rootSegmentId = '' ) : BookboonResponse { $url = $rootSegmentId == '' ? '/questions' : '/questions/' . $rootSegmentId; $bResponse = $bookboon->rawRequest($url, $variables, ClientInterface::HTTP_PO...
php
{ "resource": "" }
q12621
Book.getThumbnail
train
public function getThumbnail(int $size = 210, bool $ssl = false) { $thumbs = []; foreach ($this->safeGet('thumbnail') as $thumb) { $thumbs[$thumb['width']] = $thumb['_link']; } $sizes = array_keys($thumbs); while (true) { $thumbSize = array_shift($siz...
php
{ "resource": "" }
q12622
HttpResponse.authenticate
train
public function authenticate($login, $password) { if (!isset($this->server['PHP_AUTH_USER'])) { $this->forbid(); return false; } else { if (($this->server['PHP_AUTH_USER'] == $login) && ($this->server['PHP_AUTH_PW'] == $password)) { return true; ...
php
{ "resource": "" }
q12623
HttpResponse.setStatusCode
train
public function setStatusCode($code) { $this->headerBag->setStatusCode($code); $this->statusCode = $code; return $this; }
php
{ "resource": "" }
q12624
HttpResponse.enableCache
train
public function enableCache($timestamp, $ttl) { // HttpCache alters HeaderBag's state internally $handler = new HttpCache($this->headerBag); $handler->configure($timestamp, $ttl); return $this; }
php
{ "resource": "" }
q12625
HttpResponse.setContentType
train
public function setContentType($type) { $this->headerBag->appendPair('Content-Type', sprintf('%s;charset=%s', $type, $this->charset)); return $this; }
php
{ "resource": "" }
q12626
TurtleCoind.getBlockTemplate
train
public function getBlockTemplate(int $reserveSize, string $address):JsonResponse { $params = [ 'reserve_size' => $reserveSize, 'wallet_address' => $address, ]; return $this->rpcPost('getblocktemplate', $params); }
php
{ "resource": "" }
q12627
ExtraShortcodeParser.TweetHandler
train
public static function TweetHandler($arguments) { if (!isset($arguments['id'])) { return null; } if (substr($arguments['id'], 0, 4) === 'http') { list($unneeded, $id) = explode('/status/', $arguments['id']); } else { $id = $arguments['id']; ...
php
{ "resource": "" }
q12628
Uri.isSamePrimaryResource
train
public function isSamePrimaryResource(Uri $uri) { if (!$this->isAbsolute() || !$uri->isAbsolute()) { throw new \LogicException('Cannot compare URIs: both must be absolute'); } return $this->primaryIdentifier === $uri->getPrimaryResourceIdentifier(); }
php
{ "resource": "" }
q12629
CollectionSelect2TypeExtension.normalizeOptions
train
protected function normalizeOptions(array $options, array $value) { return $options['select2']['enabled'] ? array_merge($value, [ 'error_bubbling' => false, 'multiple' => false, 'select2' => array_merge($options['select2'], [ 't...
php
{ "resource": "" }
q12630
FileEntity.getUniqueName
train
public function getUniqueName() { $key = 'uniq'; // Lazy initialization if (!isset($this->container[$key])) { $extension = $this->getExtension(); // If extension avaiable, use it if ($extension) { $name = sprintf('%s.%s', uniqid(), $exten...
php
{ "resource": "" }
q12631
SlideshowCMSExtension.updateCMSFields
train
public function updateCMSFields(FieldList $fields) { $owner = $this->owner; $fields->removeByName(array('News', 'NewsID', 'SortOrder')); $fields->addFieldsToTab( 'Root.Main', array( TextField::create('Title', $owner->fieldLabel('Title')), HtmlEdito...
php
{ "resource": "" }
q12632
Http.setPutFromRequest
train
public function setPutFromRequest() { if ($this->_put === null) { if ($_SERVER['REQUEST_METHOD'] == 'PUT') { $this->_put = file_get_contents("php://input"); } } else { $this->_put = ''; } }
php
{ "resource": "" }
q12633
Http.redirectForTrailingSlash
train
public function redirectForTrailingSlash() { $config = \Nf\Registry::get('config'); $redirectionUrl = false; $requestParams = ''; $requestPage = '/' . $this->_uri; // we don't redirect for the home page... if ($requestPage != '/' && mb_strpos($requestPage, '/...
php
{ "resource": "" }
q12634
ParentChild.isChildPost
train
public static function isChildPost($postOrPostId = null) { $post = self::getPost($postOrPostId); if (empty($post)) { return false; } return $post->post_parent > 0; }
php
{ "resource": "" }
q12635
ParentChild.getNextParentPost
train
public static function getNextParentPost($inSameTerm = false, $excludedTerms = '', $taxonomy = 'category') { add_filter('get_next_post_where', [__CLASS__, 'addParentPostToAdjacentSql']); return get_adjacent_post($inSameTerm, $excludedTerms, false, $taxonomy); }
php
{ "resource": "" }
q12636
ParentChild.getPreviousParentPost
train
public static function getPreviousParentPost($inSameTerm = false, $excludedTerms = '', $taxonomy = 'category') { add_filter('get_previous_post_where', [__CLASS__, 'addParentPostToAdjacentSql']); return get_adjacent_post($inSameTerm, $excludedTerms, true, $taxonomy); }
php
{ "resource": "" }
q12637
ParentChild.extractPostId
train
public static function extractPostId($postOrPostId = null) { if (is_object($postOrPostId)) { return property_exists($postOrPostId, 'ID') ? (int) $postOrPostId->ID : null; } if ($postOrPostId > 0) { return (int) $postOrPostId; }...
php
{ "resource": "" }
q12638
Position.createRandomized
train
public function createRandomized($minDistance = -0.005, $maxDistance = 0.005) { $newCoordinates = Geo::calculateNewCoordinates($this->latitude, $this->longitude, Random::randomFloat($minDistance, $maxDistance), rand(0,360)); $newAltitude = $this->altitude + round(Random::randomFloat(-2, 2), 2); ...
php
{ "resource": "" }
q12639
AjaxChoiceListHelper.extractChoiceLoader
train
protected static function extractChoiceLoader($form) { $form = static::getForm($form); $choiceLoader = $form->getAttribute('choice_loader', $form->getOption('choice_loader')); return $choiceLoader; }
php
{ "resource": "" }
q12640
AjaxChoiceListHelper.extractAjaxFormatter
train
protected static function extractAjaxFormatter($form) { $form = static::getForm($form); $formatter = $form->getAttribute('select2', $form->getOption('select2')); $formatter = $formatter['ajax_formatter']; if (!$formatter instanceof AjaxChoiceListFormatterInterface) { thr...
php
{ "resource": "" }
q12641
StringHelper.camelize
train
public static function camelize($string, $delimiter = ' '): string { $stringParts = explode($delimiter, $string); $camelized = array_map('ucwords', $stringParts); return implode($delimiter, $camelized); }
php
{ "resource": "" }
q12642
StringHelper.compileAttributeStringFromArray
train
public static function compileAttributeStringFromArray(array $array): string { $attributeString = ''; foreach ($array as $key => $value) { if (null === $value || (\is_bool($value) && $value)) { $attributeString .= "$key "; } else if (!\is_bool($value)) { ...
php
{ "resource": "" }
q12643
IDEntityGrz.getFormatPatternByGostType
train
public static function getFormatPatternByGostType($gost_type) { foreach (static::$patterns_and_types_map as $format_pattern => $gost_types) { foreach ((array) $gost_types as $iterated_gost_type) { if ($iterated_gost_type === $gost_type) { return $format_patter...
php
{ "resource": "" }
q12644
IDEntityGrz.getFormatPattern
train
public function getFormatPattern() { static $kyr = self::KYR_CHARS; switch (true) { // X000XX77_OR_X000XX777 case \preg_match("~^[{$kyr}]{1}\d{3}[{$kyr}]{2}\d{2,3}$~iu", $this->value) === 1: return self::FORMAT_PATTERN_1; // X000XX ca...
php
{ "resource": "" }
q12645
ImageBag.getPath
train
public function getPath($size) { if ($this->isProvided()) { return $this->locationBuilder->buildPath($this->id, $this->cover, $size); } else { throw new RuntimeException('You gotta provide both id and cover to use this method'); } }
php
{ "resource": "" }
q12646
ImageBag.getUrl
train
public function getUrl($size) { if ($this->isProvided()) { return $this->locationBuilder->buildUrl($this->id, $this->cover, $size); } else { throw new RuntimeException('You gotta provide both id and cover to use this method'); } }
php
{ "resource": "" }
q12647
Between.isValid
train
public function isValid($target) { if ($target >= $this->start && $target <= $this->end) { return true; } else { $this->violate(sprintf($this->message, $this->start, $this->end)); return false; } }
php
{ "resource": "" }
q12648
DeployTasks.deployBuild
train
public function deployBuild($opts = [ 'build-path' => null, 'deploy-type' => 'git', 'include-asset' => [], ]) { $this->executeCommandHook(__FUNCTION__, 'before'); $build_path = $this->buildPath($opts); $deploy_type = $opts['deploy-type']; if (!file_exists...
php
{ "resource": "" }
q12649
DeployTasks.deployPush
train
public function deployPush($opts = [ 'build-path' => null, 'deploy-type' => 'git', ]) { $this->executeCommandHook(__FUNCTION__, 'before'); $build_path = $this->buildPath($opts); if (!file_exists($build_path)) { throw new DeploymentRuntimeException( ...
php
{ "resource": "" }
q12650
DeployTasks.executeIncludeAssets
train
protected function executeIncludeAssets(array $assets, $build_path) { $root_path = ProjectX::projectRoot(); foreach ($assets as $asset) { $file_info = new \splFileInfo("{$root_path}/{$asset}"); if (!file_exists($file_info)) { continue; } ...
php
{ "resource": "" }
q12651
DeployTasks.executeBuild
train
protected function executeBuild($method, $build_path) { $this->say('Build has initialized!'); $this->executeCommandHook($method, 'before_build'); $this->projectInstance()->onDeployBuild($build_path); $this->executeCommandHook($method, 'after_build'); $this->say('Build has com...
php
{ "resource": "" }
q12652
DeployTasks.executeDeploy
train
protected function executeDeploy($method, DeployBase $deploy) { $this->say('Deploy has initialized!'); $deploy->beforeDeploy(); $this->executeCommandHook($method, 'before_deploy'); $deploy->onDeploy(); $this->executeCommandHook($method, 'after_deploy'); $deploy->after...
php
{ "resource": "" }
q12653
DeployTasks.loadDeployTask
train
protected function loadDeployTask($type, $build_path, array $configurations = []) { $definitions = $this->deployDefinitions(); $classname = isset($definitions[$type]) && class_exists($definitions[$type]) ? $definitions[$type] : 'Droath\ProjectX\Deploy\NullDeploy'; ...
php
{ "resource": "" }
q12654
GitProjectAuthorExtractor.hasUncommittedChanges
train
private function hasUncommittedChanges($git) { $status = $git->status()->short()->getIndexStatus(); if (empty($status)) { return false; } return true; }
php
{ "resource": "" }
q12655
Request.sslRedirect
train
public function sslRedirect() { if (!$this->isSecure()) { $redirect = 'https://' . $this->server['HTTP_HOST'] . $this->server['REQUEST_URI']; header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $redirect); exit(); } }
php
{ "resource": "" }
q12656
Request.getAll
train
public function getAll($separate = true) { if ($this->isPost()) { $data = $this->getPost(); } if ($this->isGet()) { $data = $this->getQuery(); } // Append files also, if we have them if ($this->hasFiles()) { $files = $this->getFil...
php
{ "resource": "" }
q12657
Request.buildQuery
train
public function buildQuery(array $params, $includeCurrent = true) { if ($includeCurrent == true) { $params = array_replace_recursive($this->getQuery(), $params); } return $this->serialize($params); }
php
{ "resource": "" }
q12658
Request.getFile
train
public function getFile($name = null, $index = 0, $default = false) { $files = $this->getFiles($name); if (isset($files[$index])) { return $files[$index]; } else { return $default; } }
php
{ "resource": "" }
q12659
Request.hasFiles
train
public function hasFiles($name = null) { if (!empty($this->files)) { // if $name is null, then a global checking must be done return $this->getFilesbag()->hasFiles($name); } // By default return false; }
php
{ "resource": "" }
q12660
Request.getFilesbag
train
private function getFilesbag() { static $filesBag = null; if (is_null($filesBag)) { $filesBag = new FileInput($this->files); } return $filesBag; }
php
{ "resource": "" }
q12661
Request.getSubdomains
train
public function getSubdomains() { $current = $this->server['HTTP_HOST']; $parts = explode('.', $current); // two steps back array_pop($parts); array_pop($parts); return $parts; }
php
{ "resource": "" }
q12662
Request.getDomain
train
public function getDomain() { $current = $this->server['HTTP_HOST']; $parts = explode('.', $current); $zone = array_pop($parts); $provider = array_pop($parts); return $provider . '.' . $zone; }
php
{ "resource": "" }
q12663
Request.getLanguages
train
public function getLanguages() { $source = $this->server['HTTP_ACCEPT_LANGUAGE']; if (strpos($source, ',') !== false) { $langs = explode(',', $source); return $langs; } else { return array($source); } }
php
{ "resource": "" }
q12664
Request.isSecure
train
public function isSecure() { return ( (!empty($this->server['HTTPS']) && $this->server['HTTPS'] != 'off') || (!empty($this->server['HTTP_HTTPS']) && $this->server['HTTP_HTTPS'] != 'off') || $this->server['REQUEST_SCHEME'] == 'https' || $this->server['SERVER_PORT'] == 44...
php
{ "resource": "" }
q12665
Request.hasQueryNs
train
public function hasQueryNs($ns, $key) { $data = $this->getQuery($ns); // If there's no such key, then $data isn't an array, so just make sure if (is_array($data)) { return array_key_exists($key, $data); } else { // If $data isn't an array, then there's no suc...
php
{ "resource": "" }
q12666
Request.getQueryNs
train
public function getQueryNs($ns, $key, $default) { if ($this->hasQueryNs($ns, $key)) { $data = $this->getQuery($ns); if (isset($data[$key])) { return $data[$key]; } } return $default; }
php
{ "resource": "" }
q12667
Request.getWithNsQuery
train
public function getWithNsQuery($ns, array $data, $mark = true) { if ($this->hasQuery($ns)) { $query = $this->getQuery($ns); $url = null; if ($mark === true) { $url = '?'; } $url .= http_build_query(array($ns => array_merge($query,...
php
{ "resource": "" }
q12668
Request.getWithQuery
train
public function getWithQuery(array $data, $mark = true) { if ($this->hasQuery()) { $url = null; if ($mark === true) { $url = '?'; } $url .= http_build_query(array_merge($this->getQuery(), $data)); $url = str_replace('%25s', '%s', ...
php
{ "resource": "" }
q12669
Request.hasQuery
train
public function hasQuery() { if (func_num_args() == 0) { return !empty($this->query); } foreach (func_get_args() as $key) { if (!$this->hasParam($this->query, $key)) { return false; } } return true; }
php
{ "resource": "" }
q12670
Request.hasPost
train
public function hasPost() { if (func_num_args() == 0) { return !empty($this->post); } foreach (func_get_args() as $key) { if (!$this->hasParam($this->post, $key)) { return false; } } return true; }
php
{ "resource": "" }
q12671
Request.getPost
train
public function getPost($key = null, $default = false) { if ($key !== null) { if (array_key_exists($key, $this->post)) { return $this->post[$key]; } else { return $default; } } else { return $this->post; } }
php
{ "resource": "" }
q12672
Request.getQuery
train
public function getQuery($key = null, $default = false) { if ($key !== null) { if (array_key_exists($key, $this->query)) { return $this->query[$key]; } else { return $default; } } else { return $this->query; } ...
php
{ "resource": "" }
q12673
SqlCacheEngine.isOutdated
train
private function isOutdated($key, $time) { return ($this->getTouchByKey($key) + $this->getKeyTtl($key)) < $time; }
php
{ "resource": "" }
q12674
SqlCacheEngine.set
train
public function set($key, $value, $ttl) { $this->initializeOnDemand(); if (!is_string($key)) { throw new InvalidArgumentException(sprintf('Argument #1 must be a string and only, received "%s"', gettype($key))); } $time = time(); if ($this->has($key)) { ...
php
{ "resource": "" }
q12675
SqlCacheEngine.getAll
train
public function getAll() { $this->initializeOnDemand(); $result = array(); foreach ($this->cache as $key => $options) { $result[$key] = $options[ConstProviderInterface::CACHE_PARAM_VALUE]; } return $result; }
php
{ "resource": "" }
q12676
SqlCacheEngine.get
train
public function get($key, $default = false) { $this->initializeOnDemand(); if ($this->has($key)) { return $this->cache[$key][ConstProviderInterface::CACHE_PARAM_VALUE]; } else { return $default; } }
php
{ "resource": "" }
q12677
ResponsiveExtension.normaliseViewport
train
protected function normaliseViewport($prefix, array $valid, $value) { $value = $this->convertToArray($value); foreach ($value as $i => $viewport) { if (!\in_array($viewport, $valid)) { throw new InvalidConfigurationException(sprintf('The "%s" %s viewport option does not ...
php
{ "resource": "" }
q12678
ElasticsearchAudit.createIndex
train
public function createIndex($index = null) { if (!$this->elasticsearch->indices()->exists(['index' => $index['index']])) { return $this->elasticsearch->indices()->create($index); } }
php
{ "resource": "" }
q12679
PhpTasks.phpTravisCi
train
public function phpTravisCi() { $this->executeCommandHook(__FUNCTION__, 'before'); $this->getProjectInstance() ->setupTravisCi(); $this->executeCommandHook(__FUNCTION__, 'after'); return $this; }
php
{ "resource": "" }
q12680
PhpTasks.phpBehat
train
public function phpBehat() { $this->executeCommandHook(__FUNCTION__, 'before'); $this->getProjectInstance() ->setupBehat() ->saveComposer() ->updateComposer() ->initBehat(); $this->executeCommandHook(__FUNCTION__, 'after'); return $thi...
php
{ "resource": "" }
q12681
PhpTasks.phpPhpCs
train
public function phpPhpCs() { $this->executeCommandHook(__FUNCTION__, 'before'); $this->getProjectInstance() ->setupPhpCodeSniffer() ->saveComposer() ->updateComposer(); $this->executeCommandHook(__FUNCTION__, 'after'); return $this; }
php
{ "resource": "" }
q12682
PhpTasks.phpComposer
train
public function phpComposer(array $composer_command, $opts = [ 'remote-binary-path' => 'composer', 'remote-working-dir' => '/var/www/html', ]) { /** @var DrupalProjectType $project */ $instance = $this->getProjectInstance(); $engine = ProjectX::getEngineType(); $...
php
{ "resource": "" }
q12683
PhpTasks.phpImportDatabase
train
public function phpImportDatabase($opts = [ 'service' => null, 'import_path' => null, 'localhost' => false, ]) { $this->executeCommandHook(__FUNCTION__, 'before'); /** @var PhpProjectType $instance */ $instance = $this->getProjectInstance(); $service = is...
php
{ "resource": "" }
q12684
PhpTasks.getProjectInstance
train
protected function getProjectInstance() { $project = ProjectX::getProjectType(); if (!$project instanceof PhpProjectType) { throw new \Exception( 'These tasks can only be ran for PHP based projects.' ); } $project->setBuilder($this->getBuilder...
php
{ "resource": "" }
q12685
LazyPDO.getPdo
train
private function getPdo() { static $pdo = null; if (is_null($pdo)) { $builder = new InstanceBuilder(); $pdo = $builder->build('PDO', $this->args); } return $pdo; }
php
{ "resource": "" }
q12686
BaseHandler.startConversation
train
protected function startConversation(\KeythKatz\TelegramBotCore\Conversation $conversation): void { $conversation->setBot($this->bot); $conversation->setMessage($this->message); $conversation->start(); }
php
{ "resource": "" }
q12687
BaseHandler.sendMessageReply
train
public function sendMessageReply(bool $quoteOriginal = false): SendMessage { $m = $this->bot->sendMessage(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12688
BaseHandler.sendPhotoReply
train
public function sendPhotoReply(bool $quoteOriginal = false): SendPhoto { $m = $this->bot->sendPhoto(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12689
BaseHandler.sendAudioReply
train
public function sendAudioReply(bool $quoteOriginal = false): SendAudio { $m = $this->bot->sendAudio(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12690
BaseHandler.sendDocumentReply
train
public function sendDocumentReply(bool $quoteOriginal = false): SendDocument { $m = $this->bot->sendDocument(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12691
BaseHandler.sendVideoReply
train
public function sendVideoReply(bool $quoteOriginal = false): SendVideo { $m = $this->bot->sendVideo(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12692
BaseHandler.sendVoiceReply
train
public function sendVoiceReply(bool $quoteOriginal = false): SendVoice { $m = $this->bot->sendVoice(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12693
BaseHandler.sendVideoNoteReply
train
public function sendVideoNoteReply(bool $quoteOriginal = false): SendVideoNote { $m = $this->bot->sendVideoNote(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12694
BaseHandler.sendMediaGroupReply
train
public function sendMediaGroupReply(bool $quoteOriginal = false): SendMediaGroup { $m = $this->bot->sendMediaGroup(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12695
BaseHandler.sendLocationReply
train
public function sendLocationReply(bool $quoteOriginal = false): SendLocation { $m = $this->bot->sendLocation(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12696
BaseHandler.editMessageLiveLocationReply
train
public function editMessageLiveLocationReply(): EditMessageLiveLocation { $m = $this->bot->editMessageLiveLocation(); $this->setReplyMarkup($m, false); return $m; }
php
{ "resource": "" }
q12697
BaseHandler.stopMessageLiveLocationReply
train
public function stopMessageLiveLocationReply(): StopMessageLiveLocation { $m = $this->bot->stopMessageLiveLocation(); $this->setReplyMarkup($m, false); return $m; }
php
{ "resource": "" }
q12698
BaseHandler.sendVenueReply
train
public function sendVenueReply(bool $quoteOriginal = false): SendVenue { $m = $this->bot->sendVenue(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }
q12699
BaseHandler.sendContactReply
train
public function sendContactReply(bool $quoteOriginal = false): SendContact { $m = $this->bot->sendContact(); $this->setReplyMarkup($m, $quoteOriginal); return $m; }
php
{ "resource": "" }