_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q245700 | EventsManager.fireQueue | validation | private function fireQueue(SplPriorityQueue $queue, AbstractUserEvent $event)
{
$eventHappening = $event::getHappening();
$iterator = clone $queue;
$iterator->top();
$arguments = null;
$status = null;
while ($iterator->valid()) {
$handler = $iterator->c... | php | {
"resource": ""
} |
q245701 | ForkingWorker.fork | validation | private function fork(&$socket): int
{
$pair = [];
$domain = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' ? AF_INET : AF_UNIX);
if (\socket_create_pair($domain, SOCK_STREAM, 0, $pair) === false) {
$error = socket_strerror(socket_last_error($pair[0] ?? null));
$this->l... | php | {
"resource": ""
} |
q245702 | ForkingWorker.handleChildErrors | validation | private function handleChildErrors(&$socket): Closure
{
// This storage is freed on error (case of allowed memory exhausted).
$reserved = str_repeat('*', 32 * 1024);
return function () use (&$reserved, &$socket): void {
unset($reserved);
$error = error_get_last();
... | php | {
"resource": ""
} |
q245703 | ForkingWorker.readErrorFromSocket | validation | private function readErrorFromSocket($socket): ?string
{
$error = '';
while (!empty($res = socket_read($socket, 8192))) {
$error .= $res;
}
$error = unserialize($error);
if (is_array($error)) {
$handler = new ErrorFormatter();
return spr... | php | {
"resource": ""
} |
q245704 | ForkingWorker.handleProcessExitStatus | validation | private function handleProcessExitStatus(int $pid, int $childType, int $exitStatus)
{
switch ($childType) {
case self::PROCESS_TYPE_JOB:
$childType = 'Child';
break;
default:
$childType = 'Watchdog';
}
if ($exitStatus =... | php | {
"resource": ""
} |
q245705 | ForkingWorker.childPerform | validation | public function childPerform(BaseJob $job): void
{
$loggerContext = ['job' => $job->jid, 'type' => $this->who];
try {
if ($this->jobPerformHandler) {
if ($this->jobPerformHandler instanceof EventsManagerAwareInterface) {
$this->jobPerformHandler->setE... | php | {
"resource": ""
} |
q245706 | LuaScript.run | validation | public function run(string $command, array $args)
{
if (empty($this->sha)) {
$this->reload();
}
$arguments = $this->normalizeCommandArgs($command, $args);
try {
return call_user_func_array([$this->redis, 'evalsha'], $arguments);
} catch (\Exception ... | php | {
"resource": ""
} |
q245707 | LuaScript.normalizeCommandArgs | validation | private function normalizeCommandArgs(string $command, array $args): array
{
$arguments = array_merge([$command, microtime(true)], $args);
array_unshift($arguments, 0);
array_unshift($arguments, $this->sha);
return $arguments;
} | php | {
"resource": ""
} |
q245708 | LuaScript.reload | validation | private function reload(): void
{
$this->sha = (string) @sha1_file($this->corePath);
if (empty($this->sha)) {
throw new RuntimeException(
'Unable to locate qless-core file at path: ' . $this->corePath
);
}
$res = $this->redis->script('exists'... | php | {
"resource": ""
} |
q245709 | BaseJob.setPriority | validation | public function setPriority(int $priority): void
{
if ($this->client->call('priority', $this->jid, $priority)) {
parent::setPriority($priority);
}
} | php | {
"resource": ""
} |
q245710 | BaseJob.cancel | validation | public function cancel($dependents = false): array
{
if ($dependents && !empty($this->rawData['dependents'])) {
return call_user_func_array(
[$this->client, 'cancel'],
array_merge([$this->jid], $this->rawData['dependents'])
);
}
return... | php | {
"resource": ""
} |
q245711 | BaseJob.complete | validation | public function complete(?string $nextq = null, int $delay = 0, array $depends = []): string
{
if ($this->completed || $this->failed) {
throw new JobAlreadyFinishedException();
}
$params = [
$this->jid,
$this->worker,
$this->queue,
... | php | {
"resource": ""
} |
q245712 | BaseJob.requeue | validation | public function requeue(?string $queue = null, array $opts = []): string
{
$opts = array_merge(
[
'delay' => 0,
'data' => $this->data,
'priority' => $this->priority,
'retries' => $this->retries,
'tags' ... | php | {
"resource": ""
} |
q245713 | BaseJob.retry | validation | public function retry($group, $message, $delay = 0)
{
return $this->client
->retry(
$this->jid,
$this->queue,
$this->worker,
$delay,
$group,
$message
);
} | php | {
"resource": ""
} |
q245714 | BaseJob.heartbeat | validation | public function heartbeat(array $data = []): float
{
try {
$this->expires = $this->client->heartbeat(
$this->jid,
$this->worker,
json_encode($data, JSON_UNESCAPED_SLASHES)
);
} catch (QlessException $e) {
throw new L... | php | {
"resource": ""
} |
q245715 | BaseJob.perform | validation | public function perform(): bool
{
try {
$instance = $this->getInstance();
if (method_exists($instance, 'setUp')) {
$instance->setUp();
}
$this->getEventsManager()->fire(new JobEvent\BeforePerform($this, $this));
$performMethod = $... | php | {
"resource": ""
} |
q245716 | BaseJob.fail | validation | public function fail(string $group, string $message)
{
if ($this->completed || $this->failed) {
throw new JobAlreadyFinishedException();
}
$jsonData = json_encode($this->data, JSON_UNESCAPED_SLASHES) ?: '{}';
$this->getEventsManager()->fire(new JobEvent\OnFailure($this,... | php | {
"resource": ""
} |
q245717 | BaseJob.track | validation | public function track(): void
{
if ($this->client->call('track', 'track', $this->jid)) {
$this->tracked = true;
}
} | php | {
"resource": ""
} |
q245718 | BaseJob.untrack | validation | public function untrack(): void
{
if ($this->client->call('track', 'untrack', $this->jid)) {
$this->tracked = false;
}
} | php | {
"resource": ""
} |
q245719 | BaseJob.getInstance | validation | public function getInstance()
{
if ($this->instance === null) {
$this->instance = $this->jobFactory->create(
$this->klass,
$this->getPerformMethod()
);
}
return $this->instance;
} | php | {
"resource": ""
} |
q245720 | AbstractJob.tag | validation | public function tag(...$tags): void
{
$response = call_user_func_array(
[$this->client, 'call'],
array_merge(['tag', 'add', $this->jid], array_values(func_get_args()))
);
$this->setTags(json_decode($response, true));
} | php | {
"resource": ""
} |
q245721 | AbstractJob.setData | validation | public function setData($data): void
{
if (is_array($data) == false && is_string($data) == false && $data instanceof JobData == false) {
throw new InvalidArgumentException(
sprintf(
"Job's data must be either an array, or a JobData instance, or a JSON string, ... | php | {
"resource": ""
} |
q245722 | RecurringJob.setInterval | validation | public function setInterval(int $interval): void
{
if ($this->client->call('recur.update', $this->jid, 'interval', $interval)) {
$this->interval = $interval;
}
} | php | {
"resource": ""
} |
q245723 | RecurringJob.setBacklog | validation | public function setBacklog(int $backlog): void
{
if ($this->client->call('recur.update', $this->jid, 'backlog', $backlog)) {
$this->backlog = $backlog;
}
} | php | {
"resource": ""
} |
q245724 | RecurringJob.requeue | validation | public function requeue(string $queue): void
{
if ($this->client->call('recur.update', $this->jid, 'queue', $queue)) {
$this->setQueue($queue);
}
} | php | {
"resource": ""
} |
q245725 | SignalsAwareSubscriber.registerSignalHandler | validation | protected function registerSignalHandler(WorkerInterface $worker): void
{
$this->logger->info('Register a signal handler that a worker should respond to');
SignalHandler::create(
SignalHandler::KNOWN_SIGNALS,
function (int $signal, string $signalName) use ($worker) {
... | php | {
"resource": ""
} |
q245726 | WatchdogSubscriber.watchdog | validation | public function watchdog(string $jid, string $worker, ?int $pid = null)
{
if (empty($this->channels) || $pid === null) {
return;
}
ini_set('default_socket_timeout', self::UNLIMITED);
/**
* Initialize a new pubsub consumer.
*
* @var Consumer $p... | php | {
"resource": ""
} |
q245727 | Messages.broadcast | validation | public function broadcast(Message $message, ?string $platform = null)
{
if (null !== $platform && !isset($this->arns[$platform])) {
throw new PlatformNotConfiguredException("There is no configured ARN for $platform");
}
if ($platform) {
$this->broadcastToPlatform($me... | php | {
"resource": ""
} |
q245728 | Messages.send | validation | public function send($message, string $endpointArn)
{
if ($this->debug) {
$this->logger && $this->logger->notice(
"Message would have been sent to $endpointArn",
[
'Message' => $message,
]
);
return;
... | php | {
"resource": ""
} |
q245729 | Messages.broadcastToPlatform | validation | private function broadcastToPlatform($message, string $platform)
{
if ($this->debug) {
$this->logger && $this->logger->notice(
"Message would have been sent to $platform",
[
'Message' => $message,
]
);
r... | php | {
"resource": ""
} |
q245730 | Devices.registerDevice | validation | public function registerDevice(string $deviceId, string $platform, ?string $userData = null): string
{
if (!isset($this->arns[$platform])) {
throw new PlatformNotConfiguredException("There is no configured ARN for $platform");
}
try {
$args = [
'Platf... | php | {
"resource": ""
} |
q245731 | Topics.createTopic | validation | public function createTopic(string $name): string
{
$res = $this->sns->createTopic(
[
'Name' => $name,
]
);
return $res['TopicArn'];
} | php | {
"resource": ""
} |
q245732 | Topics.registerDeviceOnTopic | validation | public function registerDeviceOnTopic(string $deviceArn, string $topicArn)
{
$this->sns->subscribe(
[
'TopicArn' => $topicArn,
'Protocol' => 'application',
'Endpoint' => $deviceArn,
]
);
} | php | {
"resource": ""
} |
q245733 | Topics.broadcast | validation | public function broadcast(Message $message, string $topicArn)
{
if ($this->debug) {
$this->logger && $this->logger->notice(
"Message would have been sent to $topicArn",
[
'Message' => $message,
]
);
retu... | php | {
"resource": ""
} |
q245734 | Message.setLocalizedText | validation | public function setLocalizedText(?string $key, ?array $arguments = null): self
{
$this->setLocalizedKey($key);
$this->setLocalizedArguments($arguments);
return $this;
} | php | {
"resource": ""
} |
q245735 | Message.getApnsJsonInner | validation | private function getApnsJsonInner(?string $text): array
{
$apns = [
'aps' => [],
];
if (null !== $this->localizedKey) {
$apns['aps']['alert'] = [
'loc-key' => $this->localizedKey,
];
if ($this->localizedArguments) {
... | php | {
"resource": ""
} |
q245736 | Message.getAdmJson | validation | private function getAdmJson(): string
{
$adm = [
'data' => $this->getTrimmedJson([$this, 'getAdmJsonInner'], static::ADM_MAX_LENGTH, 'You message for ADM is too long'),
'expiresAfter' => $this->ttl,
];
foreach ($adm['data'] as $key => $value) {
if (!\is_s... | php | {
"resource": ""
} |
q245737 | Message.getGcmJson | validation | private function getGcmJson(): string
{
return json_encode([
'collapse_key' => $this->collapseKey,
'time_to_live' => $this->ttl,
'delay_while_idle' => $this->delayWhileIdle,
'priority' => $this->priority,
'data' => $this->getTrimmedJson([$this, 'ge... | php | {
"resource": ""
} |
q245738 | Message.getAndroidJsonInner | validation | private function getAndroidJsonInner(?string $text): array
{
$data = [];
if (null !== $text) {
$data['message'] = $text;
}
if (null !== $this->localizedKey) {
$data['message-loc-key'] = $this->localizedKey;
if ($this->localizedArguments) {
... | php | {
"resource": ""
} |
q245739 | Message.getTrimmedJson | validation | private function getTrimmedJson(callable $inner, int $limit, string $error): array
{
$gcmInner = $inner($this->text);
$gcmInnerJson = json_encode($gcmInner, JSON_UNESCAPED_UNICODE);
if (($gcmInnerJsonLength = \strlen($gcmInnerJson)) > $limit) {
$cut = $gcmInnerJsonLength - $limit... | php | {
"resource": ""
} |
q245740 | Message.arrayMergeDeep | validation | private function arrayMergeDeep(array $array1, array $array2): array
{
$result = [];
foreach (\func_get_args() as $array) {
foreach ($array as $key => $value) {
// Renumber integer keys as array_merge_recursive() does. Note that PHP
// automatically conver... | php | {
"resource": ""
} |
q245741 | Element.matches | validation | public function matches(string $selectors):bool {
$matches = $this->getRootDocument()->querySelectorAll($selectors);
$i = $matches->length;
while(--$i >= 0 && $matches->item($i) !== $this) {
;
}
return ($i >= 0);
} | php | {
"resource": ""
} |
q245742 | Element.getElementsByClassName | validation | public function getElementsByClassName(string $names):HTMLCollection {
$namesArray = explode(" ", $names);
$dots = "." . implode(".", $namesArray);
return $this->css($dots);
} | php | {
"resource": ""
} |
q245743 | ChildNode.after | validation | public function after(DOMNode $node):void {
$this->parentNode->insertBefore($node, $this->nextSibling);
} | php | {
"resource": ""
} |
q245744 | ChildNode.replaceWith | validation | public function replaceWith(DOMNode $replacement):void {
$this->parentNode->insertBefore($replacement, $this);
$this->remove();
} | php | {
"resource": ""
} |
q245745 | NodeList.item | validation | public function item($index) {
$count = 0;
foreach($this as $element) {
if($index === $count) {
return $element;
}
$count++;
}
return null;
} | php | {
"resource": ""
} |
q245746 | OrganizationPersonaService.getList | validation | public function getList(Parameters $parameters = null): array
{
$options = [];
if ($parameters) {
$options['query'] = (array) $parameters->toObject(true);
if (array_key_exists('organizationUuid', $options['query'])) {
$options['query']['organization.uuid'] =... | php | {
"resource": ""
} |
q245747 | OrganizationPersonaService.create | validation | public function create(OrganizationPersona $persona, Parameters $parameters = null): OrganizationPersona
{
$options = [];
$options['json'] = (array) static::toObject($persona);
if ($parameters) {
$options['query'] = (array) $parameters->toObject(true);
}
$object... | php | {
"resource": ""
} |
q245748 | IpListener.created | validation | public function created(JWTCreatedEvent $event)
{
$request = $this->requestStack->getCurrentRequest();
$data = $event->getData();
$this->accessor->setValue($data, $this->property, $request->getClientIp());
$event->setData($data);
} | php | {
"resource": ""
} |
q245749 | IpListener.decoded | validation | public function decoded(JWTDecodedEvent $event)
{
$request = $this->requestStack->getCurrentRequest();
$payload = $event->getPayload();
// Make property accessor paths compatible by converting payload to recursive associative array
$payload = json_decode(json_encode($payload), true)... | php | {
"resource": ""
} |
q245750 | TenantService.getContext | validation | public function getContext(): string
{
$tenant = $this->parameterService->get('ds_tenant.tenant.default');
$request = $this->requestStack->getCurrentRequest();
if ($request->request->has('tenant') && $request->request->get('tenant')) {
$tenant = $request->request->get('tenant');... | php | {
"resource": ""
} |
q245751 | UuidListener.created | validation | public function created(JWTCreatedEvent $event)
{
$data = $event->getData();
$user = $event->getUser();
$this->accessor->setValue($data, $this->property, $user->getUuid());
$event->setData($data);
} | php | {
"resource": ""
} |
q245752 | UuidListener.decoded | validation | public function decoded(JWTDecodedEvent $event)
{
$payload = $event->getPayload();
// Make property accessor paths compatible by converting payload to recursive associative array
$payload = json_decode(json_encode($payload), true);
if (!$this->accessor->isReadable($payload, $this->... | php | {
"resource": ""
} |
q245753 | LocaleListener.kernelView | validation | public function kernelView(GetResponseForControllerResultEvent $event)
{
$request = $event->getRequest();
if (!$request->query->has('locale')) {
return;
}
$controllerResult = $event->getControllerResult();
$locale = $request->query->get('locale');
if ($... | php | {
"resource": ""
} |
q245754 | Data.toObject | validation | public function toObject(): stdClass
{
$object = new stdClass;
$object->timestamp = $this->timestamp;
$object->collection = $this->collection->toArray();
foreach ($object->collection as $alias => $status) {
$object->collection[$alias] = $status->toObject();
}
... | php | {
"resource": ""
} |
q245755 | Objects.parse | validation | public static function parse(string $string, array $data = []): array
{
if ($data) {
$string = Parameters::replace($string, $data);
}
$data = Yaml::parse($string, Yaml::PARSE_OBJECT_FOR_MAP);
if (!property_exists($data,'objects')) {
throw new LogicException(... | php | {
"resource": ""
} |
q245756 | Objects.parseFile | validation | public static function parseFile(string $file, array $data = []): array
{
$string = file_get_contents($file);
return static::parse($string, $data);
} | php | {
"resource": ""
} |
q245757 | SortOrder.setSortOrder | validation | public function setSortOrder(?string $sortOrder)
{
$this->sortOrder = $sortOrder;
$this->_sortOrder = null !== $sortOrder;
return $this;
} | php | {
"resource": ""
} |
q245758 | PostUpdateListener.postUpdate | validation | public function postUpdate(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof Parameter) {
return;
}
$entity->setValue(unserialize($entity->getValue()));
} | php | {
"resource": ""
} |
q245759 | PreFlushListener.preFlush | validation | public function preFlush(PreFlushEventArgs $args)
{
$entities = $args->getEntityManager()->getUnitOfWork()->getScheduledEntityInsertions();
foreach ($entities as $entity) {
if (!$entity instanceof Parameter) {
continue;
}
$entity->setValue(serial... | php | {
"resource": ""
} |
q245760 | ParameterService.get | validation | public function get(string $key)
{
$parameter = $this->repository->findOneBy(['key' => $key]);
if (!$parameter) {
throw new OutOfRangeException('Parameter "'.$key.'" does not exist.');
}
$this->manager->detach($parameter);
return $parameter->getValue();
} | php | {
"resource": ""
} |
q245761 | ParameterService.set | validation | public function set(string $key, $value)
{
$parameter = $this->repository->findOneBy(['key' => $key]);
if (!$parameter) {
throw new OutOfRangeException('Parameter "'.$key.'" does not exist.');
}
$parameter
->setKey($key)
->setValue($value);
... | php | {
"resource": ""
} |
q245762 | TypeListener.created | validation | public function created(JWTCreatedEvent $event)
{
$data = $event->getData();
$user = $event->getUser();
// @todo Standardize interface between app user entity and security user model
if ($user instanceof User) {
$this->accessor->setValue($data, $this->property, $user->ge... | php | {
"resource": ""
} |
q245763 | EncryptListener.postLoad | validation | public function postLoad(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof Config) {
return;
}
$key = $entity->getKey();
$encrypt = $this->configCollection->get($key)['encrypt'];
$entity->setEncrypt($encrypt);
} | php | {
"resource": ""
} |
q245764 | ZoneRepository.loadDefinition | validation | protected function loadDefinition($id)
{
$filename = $this->definitionPath . $id . '.json';
$definition = @file_get_contents($filename);
if (empty($definition)) {
throw new UnknownZoneException($id);
}
$definition = json_decode($definition, true);
$definit... | php | {
"resource": ""
} |
q245765 | ZoneRepository.createZoneFromDefinition | validation | protected function createZoneFromDefinition(array $definition)
{
$zone = new Zone();
// Bind the closure to the Zone object, giving it access to
// its protected properties. Faster than both setters and reflection.
$setValues = \Closure::bind(function ($definition) {
$thi... | php | {
"resource": ""
} |
q245766 | ZoneRepository.createZoneMemberCountryFromDefinition | validation | protected function createZoneMemberCountryFromDefinition(array $definition)
{
$zoneMember = new ZoneMemberCountry();
$setValues = \Closure::bind(function ($definition) {
$this->id = $definition['id'];
$this->name = $definition['name'];
$this->countryCode = $defini... | php | {
"resource": ""
} |
q245767 | ZoneRepository.createZoneMemberZoneFromDefinition | validation | protected function createZoneMemberZoneFromDefinition(array $definition)
{
$zone = $this->get($definition['zone']);
$zoneMember = new ZoneMemberZone();
$zoneMember->setZone($zone);
$setValues = \Closure::bind(function ($definition) {
$this->id = $definition['id'];
... | php | {
"resource": ""
} |
q245768 | IdentitiableListener.prePersist | validation | public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof Identitiable) {
return;
}
$this->identityService->generateIdentity($entity);
} | php | {
"resource": ""
} |
q245769 | ValueListener.postLoad | validation | public function postLoad(Permission $permission, LifecycleEventArgs $event)
{
$item = $this->permissionCollection->get($permission->getKey());
if (!$item) {
throw new UnexpectedValueException('Permission "'.$permission->getKey().'" does not exist.');
}
$permission
... | php | {
"resource": ""
} |
q245770 | ContentListener.kernelRequest | validation | public function kernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
$content = $request->getContent();
if ('' === $content) {
return;
}
try {
$filters = json_decode($content, true);
} catch (Exception $exception) {
... | php | {
"resource": ""
} |
q245771 | UserUuid.setUserUuid | validation | public function setUserUuid(?string $userUuid)
{
if (null !== $userUuid) {
if (!preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i', $userUuid)) {
throw new InvalidArgumentException('Uuid is not valid.');
}
}
$this->us... | php | {
"resource": ""
} |
q245772 | LoaderPass.process | validation | public function process(ContainerBuilder $container)
{
$definition = $container->findDefinition(LoaderCollection::class);
$services = $container->findTaggedServiceIds('ds_tenant.loader');
$items = [];
foreach ($services as $id => $tags) {
foreach ($tags as $tag) {
... | php | {
"resource": ""
} |
q245773 | FirstResult.setFirstResult | validation | public function setFirstResult(?int $firstResult)
{
$this->firstResult = $firstResult;
$this->_firstResult = null !== $firstResult;
return $this;
} | php | {
"resource": ""
} |
q245774 | VariableService.getList | validation | public function getList($task, Parameters $parameters = null)
{
$resource = str_replace('{id}', $task, static::VARIABLE_LIST);
$options = [
'headers' => [
'Accept' => 'application/json'
],
'query' => (array) $parameters->toObject(true)
];
... | php | {
"resource": ""
} |
q245775 | CandidateGroup.setCandidateGroup | validation | public function setCandidateGroup(?string$candidateGroup)
{
$this->candidateGroup = $candidateGroup;
$this->_candidateGroup = null !== $candidateGroup;
return $this;
} | php | {
"resource": ""
} |
q245776 | TenantableListener.prePersist | validation | public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof Tenantable) {
return;
}
if (null !== $entity->getTenant()) {
return;
}
$tenant = $this->container->get(TenantService::class)->getCon... | php | {
"resource": ""
} |
q245777 | TenantIdIn.setTenantIdIn | validation | public function setTenantIdIn(array $tenantIdIn)
{
$this->tenantIdIn = $tenantIdIn;
$this->_tenantIdIn = null !== $tenantIdIn;
return $this;
} | php | {
"resource": ""
} |
q245778 | UuidentifiableListener.prePersist | validation | public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof Uuidentifiable) {
return;
}
$this->idService->generateUuid($entity);
} | php | {
"resource": ""
} |
q245779 | TenantId.setTenantId | validation | public function setTenantId(?string $tenantId)
{
$this->tenantId = $tenantId;
$this->_tenantId = null !== $tenantId;
return $this;
} | php | {
"resource": ""
} |
q245780 | IndividualUuid.setIndividualUuid | validation | public function setIndividualUuid(?string $individualUuid)
{
$this->individualUuid = $individualUuid;
$this->_individualUuid = true;
return $this;
} | php | {
"resource": ""
} |
q245781 | ConfigService.get | validation | public function get(string $key)
{
$config = $this->repository->findOneBy(['key' => $key]);
if (!$config) {
throw new OutOfRangeException('Config "'.$key.'" does not exist.');
}
$this->manager->detach($config);
return $config->getValue();
} | php | {
"resource": ""
} |
q245782 | ConfigService.set | validation | public function set(string $key, $value)
{
$config = $this->repository->findOneBy(['key' => $key]);
if (!$config) {
throw new OutOfRangeException('Config "'.$key.'" does not exist.');
}
$config
->setKey($key)
->setValue($value);
$this->ma... | php | {
"resource": ""
} |
q245783 | PostFlushListener.postFlush | validation | public function postFlush(PostFlushEventArgs $args)
{
$maps = $args->getEntityManager()->getUnitOfWork()->getIdentityMap();
foreach ($maps as $entities) {
foreach ($entities as $entity) {
if (!$entity instanceof Parameter) {
continue;
... | php | {
"resource": ""
} |
q245784 | TenantFilter.addFilterConstraint | validation | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
{
if (!$targetEntity->reflClass->implementsInterface(Tenantable::class)) {
return '';
}
$tenant = trim($this->getParameter('tenant'), '\'');
if ('' === $tenant) {
$constraint... | php | {
"resource": ""
} |
q245785 | ExceptionListener.kernelException | validation | public function kernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
if ($exception instanceof ValidationException) {
return;
}
$data = [
'type' => 'https://tools.ietf.org/html/rfc2616#section-10',
'title' =... | php | {
"resource": ""
} |
q245786 | SortBy.setSortBy | validation | public function setSortBy(?string $sortBy)
{
$this->sortBy = $sortBy;
$this->_sortBy = null !== $sortBy;
return $this;
} | php | {
"resource": ""
} |
q245787 | IncludeAssignedTasks.setIncludeAssignedTasks | validation | public function setIncludeAssignedTasks(?bool $includeAssignedTasks)
{
$this->includeAssignedTasks = $includeAssignedTasks;
$this->_includeAssignedTasks = null !== $includeAssignedTasks;
return $this;
} | php | {
"resource": ""
} |
q245788 | HealthService.check | validation | public function check($alias = null)
{
if (null === $alias) {
$statuses = new Statuses;
$statuses->setHealthy(true);
foreach ($this->checkCollection as $check) {
$status = $check->execute();
$statuses->getCollection()->add($status);
... | php | {
"resource": ""
} |
q245789 | StatisticService.getAll | validation | public function getAll(): Data
{
$data = new Data;
foreach ($this->statCollection as $stat) {
$datum = $stat->get();
$data->getCollection()->add($datum);
}
return $data;
} | php | {
"resource": ""
} |
q245790 | StatisticService.get | validation | public function get(string $alias)
{
$stat = $this->statCollection->filter(function($element) use($alias) {
return $element->getAlias() === $alias;
})->first();
if (!$stat) {
throw new InvalidAliasException('Stat alias "'.$alias.'" does not exist.');
}
... | php | {
"resource": ""
} |
q245791 | AssigneeLike.setAssigneeLike | validation | public function setAssigneeLike(?string $assigneeLike)
{
$this->assigneeLike = $assigneeLike;
$this->_assigneeLike = null !== $assigneeLike;
return $this;
} | php | {
"resource": ""
} |
q245792 | UserService.getList | validation | public function getList($form): array
{
$objects = $this->execute('GET', 'http://www.mocky.io/v2/592c3c86110000f8016df7de');
$list = [];
foreach ($objects as $object) {
$model = static::toModel($object);
$list[] = $model;
}
return $list;
} | php | {
"resource": ""
} |
q245793 | UserService.exists | validation | public function exists(UserParameters $parameters = null)
{
$object = $this->execute('GET', 'http://www.mocky.io/v2/592c6f7311000029066df850');
if ($object && property_exists($object, '_id') && $object->_id) {
return true;
}
return false;
} | php | {
"resource": ""
} |
q245794 | ModifierListener.created | validation | public function created(JWTCreatedEvent $event)
{
$data = $event->getData();
foreach ($this->removed as $property) {
if (!array_key_exists($property, $data)) {
throw new OutOfRangeException('Property does not exist.');
}
unset($data[$property]);
... | php | {
"resource": ""
} |
q245795 | ModifierListener.decoded | validation | public function decoded(JWTDecodedEvent $event)
{
$payload = $event->getPayload();
// Make property accessor paths compatible by converting payload to recursive associative array
$payload = json_decode(json_encode($payload), true);
foreach ($this->removed as $property) {
... | php | {
"resource": ""
} |
q245796 | Translation.addJoinTranslation | validation | protected function addJoinTranslation(QueryBuilder $queryBuilder, string $resourceClass)
{
$rootAlias = $queryBuilder->getRootAliases()[0];
$translationAlias = $rootAlias.'_t';
$translationClass = call_user_func($resourceClass.'::getTranslationEntityClass');
$parts = $queryBuilder->g... | php | {
"resource": ""
} |
q245797 | OrganizationUuid.setOrganizationUuid | validation | public function setOrganizationUuid(?string $organizationUuid)
{
$this->organizationUuid = $organizationUuid;
$this->_organizationUuid = true;
return $this;
} | php | {
"resource": ""
} |
q245798 | IdService.generateCustomId | validation | public function generateCustomId(CustomIdentifiable $entity, bool $overwrite = false)
{
if (null === $entity->getCustomId() || $overwrite) {
$customId = uniqid();
$entity->setCustomId($customId);
}
return $this;
} | php | {
"resource": ""
} |
q245799 | IdService.generateUuid | validation | public function generateUuid(Uuidentifiable $entity, bool $overwrite = false)
{
if (null === $entity->getUuid() || $overwrite) {
$uuid = Uuid::uuid4()->toString();
$entity->setUuid($uuid);
}
return $this;
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.