_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q252900
JavaXmlPropertiesUtils.removeEntriesFromFile
validation
public static function removeEntriesFromFile($file, $entries) { $properties = self::readFromFile($file); if (is_string($entries)) { unset($properties[$entries]); } else { foreach ($entries as $i => $key) { unset($properties[$key]); } } ...
php
{ "resource": "" }
q252901
JavaXmlPropertiesUtils.readFromString
validation
public static function readFromString($string) { $xml = new \DOMDocument(); $xml->loadXML($string); $result = []; $props = $xml->childNodes->item($xml->childNodes->length-1)->childNodes; for ($i=0; $i<$props->length;$i++) { $entry = $props->item($i); ...
php
{ "resource": "" }
q252902
JavaXmlPropertiesUtils.readFromFile
validation
public static function readFromFile($file) { $real_file = File::asFile($file); if ($real_file->exists()) return self::readFromString($file->getContent()); else return array(); }
php
{ "resource": "" }
q252903
JavaXmlPropertiesUtils.saveToString
validation
public static function saveToString($properties) { $xn = new \SimpleXMLElement(self::XML_ROOT_OPEN.self::XML_ROOT_CLOSE,LIBXML_NOXMLDECL); foreach ($properties as $key => $value) { $xn->addChild("entry", htmlspecialchars($value,ENT_XML1))->addAttribute("key",htmlspecialchars($ke...
php
{ "resource": "" }
q252904
JavaXmlPropertiesUtils.saveToFile
validation
public static function saveToFile($file, $properties) { $prop_string = self::saveToString($properties); $real_file = File::asFile($file); if (!$real_file->exists()) { $real_file->touch(); } $real_file->setContent($prop_string); }
php
{ "resource": "" }
q252905
Form.isValid
validation
public function isValid(array $values) { $this->errorMessages = []; foreach ($this->elements->getElements() as $element) { $elementId = $element->getID(); if (empty($elementId)) { continue; } $value = null; ...
php
{ "resource": "" }
q252906
Form.filterElement
validation
private function filterElement(ElementInterface $element) { $value = $element->getValue(); foreach ($this->filters as $scope => $filter) { $elementIds = array_map('trim', explode(',', $scope)); if ($scope === '*' || in_array($element->getID(), $elementIds)) { ...
php
{ "resource": "" }
q252907
FunctionGenerator.addFunction
validation
public function addFunction($functionName, $callback) { if (is_string($functionName) && is_callable($callback)) { $functions = [ 'name' => $functionName, 'callable' => $callback, ]; array_push($this->functionList, $functions); } ...
php
{ "resource": "" }
q252908
FunctionGenerator.addDefaultFunction
validation
private function addDefaultFunction() { $this->addFunction('app', function () { return app(); }); $this->addFunction('url', function ($url, $absolute = false, array $params = array()) { if ($absolute) { return Url::createAbsolute($url, $params); ...
php
{ "resource": "" }
q252909
Sftp.getRemoteClient
validation
public static function getRemoteClient(array $params) { return new m62Sftp([ 'host' => $params['sftp_host'], 'username' => $params['sftp_username'], 'password' => $params['sftp_password'], 'port' => $params['sftp_port'], 'privateKey' => (isset($par...
php
{ "resource": "" }
q252910
Client.createAggregateConnection
validation
protected function createAggregateConnection($parameters, $option) { $options = $this->getOptions(); $initializer = $options->$option; $connection = $initializer($parameters); // TODO: this is dirty but we must skip the redis-sentinel backend for now. if ($option !== 'aggre...
php
{ "resource": "" }
q252911
Client.getClientBy
validation
public function getClientBy($selector, $value, $callable = null) { $selector = strtolower($selector); if (!in_array($selector, array('id', 'key', 'slot', 'role', 'alias', 'command'))) { throw new \InvalidArgumentException("Invalid selector type: `$selector`"); } if (!me...
php
{ "resource": "" }
q252912
Client.executeRaw
validation
public function executeRaw(array $arguments, &$error = null) { $error = false; $commandID = array_shift($arguments); $response = $this->connection->executeCommand( new RawCommand($commandID, $arguments) ); if ($response instanceof ResponseInterface) { ...
php
{ "resource": "" }
q252913
Client.onErrorResponse
validation
protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response) { if ($command instanceof ScriptCommand && $response->getErrorType() === 'NOSCRIPT') { $response = $this->executeCommand($command->getEvalCommand()); if (!$response instanceof ResponseInt...
php
{ "resource": "" }
q252914
Web2All_Table_Collection.offsetExists
validation
public function offsetExists($offset){ if (is_null($this->result)) { $this->fetchData(); } if(array_key_exists($offset,$this->result)){ return true; } else{ return false; } }
php
{ "resource": "" }
q252915
ConfigurationHandler.setConfigurationOptions
validation
public function setConfigurationOptions(array $options = array()) { $resolver = new OptionsResolver(); $resolver->setDefined( array( 'web_dir', 'uploads_dir', ) ); $resolver->resolve($options); if (array_key_exists('web...
php
{ "resource": "" }
q252916
ConfigurationHandler.homepageTemplate
validation
public function homepageTemplate() { if (null === $this->homepageTemplate) { $homepageFile = $this->pagesDir . "/" . $this->homepage() . '/page.json'; $page = json_decode(FilesystemTools::readFile($homepageFile), true); $this->homepageTemplate = $page["template"]; ...
php
{ "resource": "" }
q252917
Translator.get
validation
protected function get($locale, $file, $key) { // load it $this->load($locale, $file); if (array_key_exists($key, $this->translations[$locale][$file]) === false) { throw new TranslationKeyNotFound($key, $this->getPath(), $locale, $file); } $result = $this->translations[$locale][$file][$key]; if (is...
php
{ "resource": "" }
q252918
Translator.isFileLoaded
validation
protected function isFileLoaded($locale, $file) { if (array_key_exists($locale, $this->translations) === false) { return false; } if (array_key_exists($file, $this->translations[$locale]) === false) { return false; } return true; }
php
{ "resource": "" }
q252919
Translator.load
validation
protected function load($locale, $fileName) { // check for already loading if ($this->isFileLoaded($locale, $fileName) === true) { return true; } $startTime = microtime(true); $file = $this->getPath() . '/' . $locale . '/' . $fileName . '.php'; if (file_exists($file) === false) { throw new File...
php
{ "resource": "" }
q252920
Translator.log
validation
protected function log($message, $priority = Logger::DEBUG, array $extra = []) { if ($this->getLogger() === null) { return $this; } $this->getLogger()->log($priority, $message, $extra); return $this; }
php
{ "resource": "" }
q252921
Translator.setPath
validation
public function setPath($path) { if ($path === null) { throw new PathCanNotBeNull(); } $this->path = rtrim($path, '\\/') . '/'; return $this; }
php
{ "resource": "" }
q252922
NativeSessionHandler.read
validation
public function read($id) { $path = $this->getPath($id); if (! file_exists($path)) { return ''; } if (filemtime($path) < time() - $this->lifeTime) { return ''; } return file_get_contents($path); }
php
{ "resource": "" }
q252923
Benri_Controller_Action_Abstract.init
validation
public function init() { $request = $this->getRequest(); // limit actions to HTTP common verbs if ($request->isGet()) { $action = $this->getParam('id') ? 'get' : 'index'; } else { $action = $this->getParam('x-method', $request->getMethod()); } ...
php
{ "resource": "" }
q252924
Benri_Controller_Action_Abstract._pushMessage
validation
protected function _pushMessage($message, $type = 'error', array $interpolateParams = []) { $this->_messages[] = [ 'message' => vsprintf($message, $interpolateParams), 'type' => $type, ]; return $this; }
php
{ "resource": "" }
q252925
LumenServiceProvider.registerCommands
validation
protected function registerCommands() { $this->commands(\Lab123\Odin\Command\AppRestart::class); $this->commands(\Lab123\Odin\Command\AppStart::class); $this->commands(\Lab123\Odin\Command\GeneratePasswordCommand::class); $this->commands(\Lab123\Odin\Command\LumenAppNameCommand::clas...
php
{ "resource": "" }
q252926
AssetBundle.getCachePath
validation
public function getCachePath() { if (empty($this->basePath)) { return false; } $cachePath = $this->basePath . DIRECTORY_SEPARATOR . 'cache'; if (!is_dir($cachePath)) { @mkdir($cachePath, 0777, true); } if (!is_dir($cachePath)) { ret...
php
{ "resource": "" }
q252927
Collector.getLocation
validation
public function getLocation($location, $owner = null) { $bucket = $this->getBucket('locations:' . $location); if (is_null($owner)) { return $bucket->toArray(); } else { $result = []; foreach ($bucket as $key => $widget) { if ($widget->owner...
php
{ "resource": "" }
q252928
Person.getAccompanyingPeriodsOrdered
validation
public function getAccompanyingPeriodsOrdered() { $periods = $this->getAccompanyingPeriods()->toArray(); //order by date : usort($periods, function($a, $b) { $dateA = $a->getOpeningDate(); $dateB = $b->getOpeningDate(); if ($dateA == $dat...
php
{ "resource": "" }
q252929
Person.setCenter
validation
public function setCenter(\Chill\MainBundle\Entity\Center $center) { $this->center = $center; return $this; }
php
{ "resource": "" }
q252930
Person.isAccompanyingPeriodValid
validation
public function isAccompanyingPeriodValid(ExecutionContextInterface $context) { $r = $this->checkAccompanyingPeriodsAreNotCollapsing(); if ($r !== true) { if ($r['result'] === self::ERROR_PERIODS_ARE_COLLAPSING) { $context->addViolationAt('accompanyingPeriods', ...
php
{ "resource": "" }
q252931
CtrlWrapper.processAuth
validation
protected function processAuth(string $actionName, array $actionArgs): void { // Lambda $callAction = function (string $actionName, array $actionArgs) { if (empty($actionArgs)) { $this->ctrl->{$actionName}(); } else { (new \ReflectionMethod($th...
php
{ "resource": "" }
q252932
MetadataFetcher.getData
validation
public function getData($origin) { return array_reduce( $this->structure->getChildren(), function ($acc, $childDef) { return array_merge($acc, array($childDef['name'] => $childDef['name'])); }, $this->getMetadataValues() ); }
php
{ "resource": "" }
q252933
Apib.buildParsedRequests
validation
private function buildParsedRequests(ApiParseResult $parseResult) : array { $requests = []; foreach ($parseResult->getApi()->getResourceGroups() as $apiResourceGroup) { foreach ($apiResourceGroup->getResources() as $apiResource) { foreach ($apiResource->getTransitions() ...
php
{ "resource": "" }
q252934
BuildAsset.run
validation
public function run(): Robo\Result { // Touch the destination so that "realpath" works. $result = $this->collectionBuilder()->taskFilesystemStack() ->mkdir($this->destination->getPath()) ->touch($this->destination->getPathname()) ->run()->wasSuccessful(); // ...
php
{ "resource": "" }
q252935
BuildAsset.getCompiler
validation
protected function getCompiler(SplFileInfo $file): Compiler { // Grab the source type $source_type = $this->getSourceType($file); // Which compiler will we use? $compiler_type = '\Gears\Asset\Compilers\\'; $compiler_type .= ucfirst($source_type); // Does the compile...
php
{ "resource": "" }
q252936
BuildAsset.bustCacheBalls
validation
protected function bustCacheBalls(string $asset_contents) { // Get some details about the asset $asset_ext = $this->destination->getExtension(); $asset_name = $this->destination->getBasename('.'.$asset_ext); $asset_name_quoted = preg_quote($asset_name, '/'); // Create our re...
php
{ "resource": "" }
q252937
BuildAsset.normaliseSrcInput
validation
protected function normaliseSrcInput($input): array { $output = []; if ($input instanceof Finder) { foreach ($input as $fileInfo) { $output[] = $fileInfo->getRealpath(); } } else { if (!is_array($input))...
php
{ "resource": "" }
q252938
TranslatorAwareTrait.__
validation
public function __($key, array $parameters = [], $locale = null, $default = null, $parseBBCode = true) { return $this->translate($key, $parameters, $locale, $default, $parseBBCode); }
php
{ "resource": "" }
q252939
Registry.getService
validation
public function getService($name) { if (array_key_exists($name, $this->services)) { return $this->services[$name]; } throw new KeyNotFoundInSetException($name, array_keys($this->services), 'services'); }
php
{ "resource": "" }
q252940
Registry.addService
validation
public function addService(Service $service) { if (array_key_exists($service->getName(), $this->services)) { throw new KeyTakenInSetException($service->getName(), 'services'); } $this->services[$service->getName()] = $service; return $this; }
php
{ "resource": "" }
q252941
Registry.getCachePool
validation
public function getCachePool($name) { if (array_key_exists($name, $this->cachePools)) { return $this->cachePools[$name]; } throw new KeyNotFoundInSetException($name, array_keys($this->cachePools), 'cache pools'); }
php
{ "resource": "" }
q252942
Registry.get
validation
public function get($component) { $parts = explode('.', $component); if (count($parts) == 1) { return $this->getService($parts[0]); } elseif (count($parts) == 2) { return $this->getService($parts[0])->getGroup($parts[1]); } elseif (count($parts) == 3) { ...
php
{ "resource": "" }
q252943
Form.add
validation
public function add($sName, $mType, $sLabel = null, $mValue = null, $mOptions = null) { if ($mType instanceof Container) { $this->_aElement[$sName] = $mType; } else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel' ...
php
{ "resource": "" }
q252944
Form.getForm
validation
public function getForm() { $oForm = $this->getFormInObject(); $sFormContent = $oForm->start; foreach ($oForm->form as $sValue) { $sFormContent .= $sValue.$this->_sSeparator; } $sFormContent .= $oForm->end; $oContainer = new Container; $oConta...
php
{ "resource": "" }
q252945
Form.getFormInObject
validation
public function getFormInObject() { $sExKey = null; if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) { $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity); $oModel = new $sModelName; $oEntity = new $thi...
php
{ "resource": "" }
q252946
Form.synchronizeEntity
validation
public function synchronizeEntity($sSynchronizeEntity, $iId = null) { if ($iId !== null) { $this->_iIdEntity = $iId; } $this->_sSynchronizeEntity = $sSynchronizeEntity; return $this; }
php
{ "resource": "" }
q252947
ValidatorService.storageValidate
validation
public function storageValidate($validators,$storage){ $errors=[]; foreach($validators as $kValidate=>$validate){ if(!isset($storage[$kValidate])){ $errors[]=['field'=>$kValidate,'message'=>'Value '.$kValidate.' not found.']; continue; } $error=$this->validate($validate,$storage[$kValidate]); i...
php
{ "resource": "" }
q252948
AdminController.actionIndex
validation
public function actionIndex() { $searchModel = \Yii::createObject(UserSearch::className()); $dataProvider = $searchModel->search($_GET); return $this->render('index', [ 'dataProvider' => $dataProvider, 'searchModel' => $searchModel, ]); }
php
{ "resource": "" }
q252949
AdminController.actionCreate
validation
public function actionCreate() { /** @var User $user */ $user = \Yii::createObject([ 'class' => User::className(), 'scenario' => 'create', ]); $this->performAjaxValidation($user); if ($user->load(\Yii::$app->request->post()) && $user->create()) { ...
php
{ "resource": "" }
q252950
AdminController.actionUpdate
validation
public function actionUpdate($id) { $user = $this->findModel($id); $user->scenario = 'update'; $profile = $this->finder->findProfileById($id); $r = \Yii::$app->request; $this->performAjaxValidation([$user, $profile]); if ($user->load($r->post()) && $profile->load($r...
php
{ "resource": "" }
q252951
AdminController.actionConfirm
validation
public function actionConfirm($id, $back = 'index') { $this->findModel($id)->confirm(); \Yii::$app->getSession()->setFlash('success', \Yii::t('user', 'User has been confirmed')); $url = $back == 'index' ? ['index'] : ['update', 'id' => $id]; return $this->redirect($url); }
php
{ "resource": "" }
q252952
AdminController.actionBlock
validation
public function actionBlock($id, $back = 'index') { if ($id == \Yii::$app->user->getId()) { \Yii::$app->getSession()->setFlash('danger', \Yii::t('user', 'You can not block your own account')); } else { $user = $this->findModel($id); if ($user->getIsBlocked()) { ...
php
{ "resource": "" }
q252953
AdminController.performAjaxValidation
validation
protected function performAjaxValidation($models) { if (\Yii::$app->request->isAjax) { if (is_array($models)) { $result = []; foreach ($models as $model) { if ($model->load(\Yii::$app->request->post())) { \Yii::$app->res...
php
{ "resource": "" }
q252954
Downgrade.getCalcData
validation
private function getCalcData() { /** * Create Unqualified Process (Downgrade) calculation. */ $req = new AGetPeriodRequest(); $req->setBaseCalcTypeCode(Cfg::CODE_TYPE_CALC_PV_WRITE_OFF); $req->setDepCalcTypeCode(Cfg::CODE_TYPE_CALC_UNQUALIFIED_PROCESS); /** ...
php
{ "resource": "" }
q252955
AccessToken.getTokenFromServer
validation
public function getTokenFromServer() { $params = [ 'appid' => $this->appId, 'secret' => $this->secret, 'grant_type' => 'client_credential', ]; $http = $this->getHttp(); $token = $http->parseJSON($http->get(self::API_TOKEN_GET, $params)); ...
php
{ "resource": "" }
q252956
CachedIdentityService.getCachedToken
validation
protected function getCachedToken(array $options) { $authOptions = array_intersect_key($options, $this->api->postTokens()['params']); // Determine a unique key for the used authentication options. We add the authUrl // because it is possible to use the same credentials for a different OpenStack ...
php
{ "resource": "" }
q252957
CommandEntry.entry
validation
public static function entry($argv): void { self::initialize(); /* Check Command Entered */ if (isset($argv[1])) { $command = $argv[1]; } else { return; } /* Check Command Defined */ if (!in_array($command, array_keys(self::$commands)...
php
{ "resource": "" }
q252958
CommandEntry.load
validation
public static function load(string $dir): void { self::initialize(); /* Make Directory */ $commandDir = $_SERVER['DOCUMENT_ROOT'] . $dir; /* Get All Files In Directory */ $files = scandir($commandDir); /* Require Files */ foreach ($files as $file) { ...
php
{ "resource": "" }
q252959
AbstractTimelineAccompanyingPeriod.basicFetchQuery
validation
protected function basicFetchQuery($context, array $args) { if ($context !== 'person') { throw new \LogicException('TimelineAccompanyingPeriod is not able ' . 'to render context '.$context); } $metadata = $this->em ->getClassMetadata('...
php
{ "resource": "" }
q252960
SaveQueueController.saveAction
validation
public function saveAction(Request $request, Application $app) { $options = array( "request" => $request, "configuration_handler" => $app["red_kite_cms.configuration_handler"], 'security' => $app["security"], "queue_manager" => $app["red_kite_cms.queue_manager...
php
{ "resource": "" }
q252961
BlogExtension.countPost
validation
public function countPost($actor) { $em = $this->container->get('doctrine')->getManager(); $entities = $em->getRepository('BlogBundle:Post')->findBy(array('actor' => $actor)); return count($entities); }
php
{ "resource": "" }
q252962
BlogExtension.getCarouselItemsBlog
validation
public function getCarouselItemsBlog($entity) { $em = $this->container->get('doctrine')->getManager(); if($entity instanceof Category){ $qb = $em->getRepository('BlogBundle:Post') ->createQueryBuilder('p') ->join('p.categories', 'c') ...
php
{ "resource": "" }
q252963
BlogExtension.getPosts
validation
public function getPosts($limit=null, $offset=null) { $em = $this->container->get('doctrine')->getManager(); if(is_null($limit) && is_null($offset)){ $entities = $em->getRepository('BlogBundle:Post')->findBy(array(),array('published' => 'DESC')); }elseif(is_null($limit) && !is_n...
php
{ "resource": "" }
q252964
ActionActivitySubscriber.collectActivity
validation
public function collectActivity(PostActionEvent $event) { $this->activity[] = array( 'action_name' => $event->getAction()->getName(), 'group_name' => $event->getAction()->getGroup()->getName(), 'service_name' => $event->getAction()->getGroup()->getService()->getName(), ...
php
{ "resource": "" }
q252965
SDIS62_Service_Generic.prepare
validation
protected function prepare($path, Zend_Http_Client $client) { $client->setUri($this->uri . '/' . $path); $client->resetParameters(); }
php
{ "resource": "" }
q252966
View.assign
validation
public function assign(string $key, $value, bool $global = false) { // Assign a new view variable (global or locale) if ($global === false) { $this->vars[$key] = $value; } else { View::$global_vars[$key] = $value; } return $this; }
php
{ "resource": "" }
q252967
View.render
validation
public function render($filter = null) : string { // Is output empty ? if (empty($this->output)) { // Extract variables as references extract(array_merge($this->vars, View::$global_vars), EXTR_REFS); // Turn on output buffering ob_start(); ...
php
{ "resource": "" }
q252968
ActiveTaxonomy.setTaxonomy_id
validation
public function setTaxonomy_id($value) { if (!is_array($value)) { $value = [$value]; } foreach ($value as $k => $v) { if (is_object($v)) { $value[$k] = $v->primaryKey; } elseif (is_array($v)) { unset($value[$k]); ...
php
{ "resource": "" }
q252969
CompilerContextParameterCollection._fetch
validation
private function _fetch($attrName, $default = NULL) { return $this->hasAttribute($attrName) ? $this->getAttribute($attrName)->getValue() : $default; }
php
{ "resource": "" }
q252970
CompilerContextParameterCollection._put
validation
private function _put($attrName, $value = NULL) { $this->_checkModify(); if($value === NULL) $this->removeAttribute($attrName); elseif($this->hasAttribute($attrName) && method_exists($attr = $this->getAttribute($attrName), "setValue")) { /** @var Attribute $attr */ ...
php
{ "resource": "" }
q252971
LoginForm.validatePassword
validation
public function validatePassword() { $user = User::findByEmail($this->email); if (!$user || !$user->validatePassword($this->password)) { $this->addError('password', 'Incorrect username or password.'); } }
php
{ "resource": "" }
q252972
SlotsManager.generateSlot
validation
protected function generateSlot($path, $blocks = array(), $username = null) { if (is_dir($path) && !$this->override) { return; } $folders = array(); $activeDir = $path . '/active'; $contributorsDir = $path . '/contributors'; $folders[] = $activeDir . '/bl...
php
{ "resource": "" }
q252973
SlotsManager.generateBlocks
validation
protected function generateBlocks(array $blocks, $blocksDir, $targetDir) { $c = 1; $generatedBlocks = array(); foreach ($blocks as $block) { $blockName = 'block' . $c; $fileName = sprintf('%s/%s.json', $blocksDir, $blockName); $generatedBlocks[] = $blockNa...
php
{ "resource": "" }
q252974
PageManager.publish
validation
public function publish($pageName, $languageName) { $this->contributorDefined(); $baseDir = $this->pagesDir . '/' . $pageName; $pageCollectionSourceFile = $baseDir . '/' . $this->username . '.json'; $pageCollectionTargetFile = $baseDir . '/page.json'; $pageDir = $baseDir . '...
php
{ "resource": "" }
q252975
PageManager.hide
validation
public function hide($pageName, $languageName) { $this->contributorDefined(); $baseDir = $this->pagesDir . '/' . $pageName . '/' . $languageName; $sourceFile = $baseDir . '/seo.json'; Dispatcher::dispatch(PageEvents::PAGE_HIDING, new PageHidingEvent()); unlink($sourceFile);...
php
{ "resource": "" }
q252976
Ov.updateOv
validation
private function updateOv($dwnl) { $entity = new EBonDwnl(); /** @var EBonDwnl $one */ foreach ($dwnl as $one) { $ov = $one->getOv(); $calcId = $one->getCalculationRef(); $custId = $one->getCustomerRef(); $entity->setOv($ov); $id =...
php
{ "resource": "" }
q252977
Url.setAddress
validation
public function setAddress($address) { $address = trim($address, self::SEPARATOR); if (!filter_var($address, FILTER_VALIDATE_URL)) { throw new \InvalidArgumentException("$address is not valid format of url address."); } $this->address = $address; $this->parse = p...
php
{ "resource": "" }
q252978
Url.getDomain
validation
public function getDomain($scheme = false) { if ($scheme) { return sprintf('%s.%s', $this->get(self::PARSE_SCHEME), $this->get(self::PARSE_HOST)); } return $this->get(self::PARSE_HOST); }
php
{ "resource": "" }
q252979
Url.normalize
validation
protected function normalize($scheme = true, $www = true) { $address = $this->address; if ($scheme && null === $this->get(self::PARSE_SCHEME)) { $address = sprintf('http://%s', $this->address); } elseif (!$scheme && $this->get(self::PARSE_SCHEME)) { $address = str_rep...
php
{ "resource": "" }
q252980
Url.getMd5Address
validation
public function getMd5Address($scheme = true, $www = true) { return md5($this->normalize($scheme, $www)); }
php
{ "resource": "" }
q252981
PersonController.exportAction
validation
public function exportAction() { $em = $this->getDoctrine()->getManager(); $chillSecurityHelper = $this->get('chill.main.security.authorization.helper'); $user = $this->get('security.context')->getToken()->getUser(); $reachableCenters = $chillSecurityHelper->getReachableCenters($use...
php
{ "resource": "" }
q252982
PersonController._getPerson
validation
private function _getPerson($id) { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person') ->find($id); return $person; }
php
{ "resource": "" }
q252983
PageCollectionManager.add
validation
public function add(Theme $theme, array $pageValues) { $pageName = $pageValues["name"]; $pageDir = $this->pagesDir . '/' . $pageName; $this->pageExists($pageDir); // @codeCoverageIgnoreStart if (!@mkdir($pageDir)) { $this->folderNotCreated($pageDir); } ...
php
{ "resource": "" }
q252984
PageCollectionManager.remove
validation
public function remove($pageName) { if ($pageName == $this->configurationHandler->homepage()) { throw new RuntimeException("exception_homepage_cannot_be_removed"); } $pageDir = $this->pagesDir . '/' . $pageName; Dispatcher::dispatch(PageCollectionEvents::PAGE_COLLECTION_...
php
{ "resource": "" }
q252985
ShakeAround.register
validation
public function register($name, $tel, $email, $industryId, array $certUrls, $reason = '') { $params = [ 'name' => $name, 'phone_number' => strval($tel), 'email' => $email, 'industry_id' => $industryId, 'qualification_cert_urls' => $certUrls, ...
php
{ "resource": "" }
q252986
ShakeAround.getShakeInfo
validation
public function getShakeInfo($ticket, $needPoi = null) { $params = [ 'ticket' => $ticket, ]; if ($needPoi !== null) { $params['need_poi'] = intval($needPoi); } return $this->parseJSON('json', [self::API_GET_SHAKE_INFO, $params]); }
php
{ "resource": "" }
q252987
ShakeAround.device
validation
public function device() { if (is_null($this->device)) { $this->device = new Device($this->accessToken); } return $this->device; }
php
{ "resource": "" }
q252988
ShakeAround.group
validation
public function group() { if (is_null($this->group)) { $this->group = new Group($this->accessToken); } return $this->group; }
php
{ "resource": "" }
q252989
ShakeAround.page
validation
public function page() { if (is_null($this->page)) { $this->page = new Page($this->accessToken); } return $this->page; }
php
{ "resource": "" }
q252990
ShakeAround.material
validation
public function material() { if (is_null($this->material)) { $this->material = new Material($this->accessToken); } return $this->material; }
php
{ "resource": "" }
q252991
ShakeAround.relation
validation
public function relation() { if (is_null($this->relation)) { $this->relation = new Relation($this->accessToken); } return $this->relation; }
php
{ "resource": "" }
q252992
ShakeAround.stats
validation
public function stats() { if (is_null($this->stats)) { $this->stats = new Stats($this->accessToken); } return $this->stats; }
php
{ "resource": "" }
q252993
Comment.open
validation
public function open($msgId, $index) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, ]; return $this->parseJSON('json', [self::API_OPEN_COMMENT, $params]); }
php
{ "resource": "" }
q252994
Comment.close
validation
public function close($msgId, $index) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, ]; return $this->parseJSON('json', [self::API_CLOSE_COMMENT, $params]); }
php
{ "resource": "" }
q252995
Comment.lists
validation
public function lists($msgId, $index, $begin, $count, $type = 0) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, 'begin' => $begin, 'count' => $count, 'type' => $type, ]; return $this->parseJSON('json', [self::API_LIST_CO...
php
{ "resource": "" }
q252996
Comment.markElect
validation
public function markElect($msgId, $index, $commentId) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, 'user_comment_id' => $commentId, ]; return $this->parseJSON('json', [self::API_MARK_ELECT, $params]); }
php
{ "resource": "" }
q252997
Comment.unmarkElect
validation
public function unmarkElect($msgId, $index, $commentId) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, 'user_comment_id' => $commentId, ]; return $this->parseJSON('json', [self::API_UNMARK_ELECT, $params]); }
php
{ "resource": "" }
q252998
Comment.delete
validation
public function delete($msgId, $index, $commentId) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, 'user_comment_id' => $commentId, ]; return $this->parseJSON('json', [self::API_DELETE_COMMENT, $params]); }
php
{ "resource": "" }
q252999
Comment.reply
validation
public function reply($msgId, $index, $commentId, $content) { $params = [ 'msg_data_id' => $msgId, 'index' => $index, 'user_comment_id' => $commentId, 'content' => $content, ]; return $this->parseJSON('json', [self::API_REPLY_COMMENT, $params]...
php
{ "resource": "" }