sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
private function parse(array $data, NodePath $nodePath, $parentId = null) { $parentId = $this->validateParentId($parentId); $csvFile = $this->createCsvFile($this->structure->getTypeFromNodePath($nodePath), $nodePath, $parentId); $parentCols = array_fill_keys(array_keys($parentId), "string");...
Parse data of known type @param array $data @param NodePath $nodePath @param string|array $parentId
entailment
private function parseRow( \stdClass $dataRow, NodePath $nodePath, array $parentCols = [], $outerObjectHash = null ) { $csvRow = new CsvRow($this->getHeaders($nodePath, $parentCols)); // Generate parent ID for arrays $arrayParentId = $this->getPrimaryKeyValue(...
Parse a single row If the row contains an array, it's recursively parsed @param \stdClass $dataRow Input data @param NodePath $nodePath @param array $parentCols to inject parent columns, which aren't part of $this->struct @param string $outerObjectHash Outer object hash to distinguish different parents in deep nested ...
entailment
private function parseField( \stdClass $dataRow, CsvRow $csvRow, $arrayParentId, $column, $dataType, NodePath $nodePath ) { // A hack allowing access to numeric keys in object if (!isset($dataRow->{$column}) && isset(json_decode(json_encode...
Handle the actual write to CsvRow @param \stdClass $dataRow @param CsvRow $csvRow @param string $arrayParentId @param string $column @param string $dataType @param NodePath $nodePath
entailment
private function getHeaders(NodePath $nodePath, &$parent = false) { $headers = []; $nodeData = $this->structure->getNode($nodePath); if ($nodeData['nodeType'] == 'scalar') { $headers[] = $nodeData['headerNames']; } if (is_array($parent) && !empty($parent)) { ...
Get column names for a particular node path @param NodePath $nodePath @param bool $parent Parent column, may be renamed in case a conflict occurs @return array
entailment
private function createCsvFile($type, NodePath $nodePath, &$parentId) { if (empty($this->csvFiles[$type])) { $this->csvFiles[$type] = Table::create( $type, $this->getHeaders($nodePath, $parentId), $this->temp ); $this->csvFi...
to allow saving a single type to different files @param string $type @param NodePath $nodePath @param $parentId @return Table
entailment
private function validateParentId($parentId) : array { if (!empty($parentId)) { if (is_array($parentId)) { if (count($parentId) != count($parentId, COUNT_RECURSIVE)) { throw new JsonParserException( 'Error assigning parentId to a CSV fi...
Ensure the parentId array is not multidimensional @param string|array $parentId @return array @throws JsonParserException
entailment
public function getCsvFiles() { // parse what's in cache before returning results while ($batch = $this->cache->getNext()) { // root node is always array $this->parse($batch["data"], new NodePath([$batch['type'], Structure::ARRAY_NAME]), $batch["parentId"]); } ...
Returns an array of CSV files containing results @return Table[]
entailment
public function login(Request $request, AuthenticateUser $authenticate, ThrottlesCommand $throttles) { $username = Authen::getIdentifierName(); $input = $request->only([$username, 'password', 'remember']); $throttles->setRequest($request)->setLoginKey($username); return $authentic...
POST Login the user. POST (:orchestra)/login @return mixed
entailment
public function userLoginHasFailedAuthentication(array $input) { $message = trans('orchestra/foundation::response.credential.invalid-combination'); return $this->redirectWithMessage($this->getRedirectToLoginPath(), $message, 'error')->withInput(); }
Response to user log-in trigger has failed authentication. @param array $input @return mixed
entailment
public function sendLockoutResponse(array $input, $seconds) { $message = trans('auth.throttle', ['seconds' => $seconds]); return $this->redirectWithMessage($this->getRedirectToLoginPath(), $message, 'error')->withInput(); }
Redirect the user after determining they are locked out. @param array $input @param int $seconds @return mixed
entailment
public function getUpdatedAt() { return ! empty($value = $this->getContentValue('updated_at', null)) ? $this->convertToCarbon($value) : null; }
Возвращает дату/время, когда был обновлен. @return Carbon|null
entailment
protected function loadBackendRoutesFrom(string $path, ?string $namespace = '', array $attributes = []): void { $foundation = $this->app->make('orchestra.app'); $attributes = $this->resolveRouteGroupAttributes($namespace, $attributes); $foundation->namespaced(null, $attributes, $this->getRo...
Load the backend routes file for the application. @param string $path @param string|null $namespace @param array $attributes @return void
entailment
protected function loadFrontendRoutesFrom(string $path, ?string $namespace = '', array $attributes = []): void { $foundation = $this->app->make('orchestra.app'); $attributes = $this->resolveRouteGroupAttributes($namespace, $attributes); $foundation->group($this->routeGroup, $this->routePref...
Load the frontend routes file for the application. @param string $path @param string|null $namespace @return void
entailment
public function refresh(...$arguments) { $this->token = (func_num_args() >= 2) ? static::generate(...$arguments) : static::generate(...$this->arguments); return $this; }
{@inheritdoc}
entailment
public function handle() { Collection::make([ $this->laravel->getCachedServicesPath(), $this->laravel->getCachedExtensionServicesPath(), ])->filter(function ($file) { return \file_exists($file); })->each(function ($file) { @\unlink($file); ...
Execute the console command. @return void
entailment
public function profile($model, $url) { return $this->form->of('orchestra.account', function (FormGrid $form) use ($model, $url) { $form->setup($this, $url, $model); $form->hidden('id'); $form->fieldset(function (Fieldset $fieldset) { $fieldset->control('...
Form view generator for User Account. @param \Orchestra\Model\User $model @param string $url @return \Orchestra\Contracts\Html\Form\Builder
entailment
public function handle($request, Closure $next) { $as = $request->input('_as'); if ($this->authorize() && ! is_null($as)) { $this->auth->loginUsingId($as); return $this->response->redirectTo($request->url()); } return $next($request); }
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
entailment
public function getRoles() { return \is_string($value = $this->getContentValue('roles', null)) ? array_filter(explode(',', (string) $value)) : null; }
Возвращает массив ролей пользователя. @return null|string[]
entailment
public function types($auth_token, $limit = 200) { return new B2BResponse($this->client->apiRequest( 'get', 'user/report_types', [ '_query' => '_all', // Описатель запроса (язык зависит от контекста) '_size' => (int) $...
Получение типов отчетов, доступных конкретному пользователю. @param string $auth_token Токен безопасности @param int $limit @throws B2BApiException @return B2BResponse
entailment
public function get($auth_token, $report_uid, $detailed = true, $with_content = true) { return new B2BResponse($this->client->apiRequest( 'get', sprintf('user/reports/%s', urlencode($report_uid)), [ '_detailed' => (bool) $detailed ? 'tr...
Получение имеющегося отчета. @param string $auth_token Токен безопасности @param string $report_uid UID отчета @param bool $detailed @param bool $with_content Признак наличия контента @throws B2BApiException @return B2BResponse
entailment
public function make($auth_token, $query_type, $query_id, $report_type_uid, $is_force = false, array $options = []) { if (! QueryTypes::has($query_type)) { throw new B2BApiInvalidArgumentException(sprintf( 'Passed query type "%s" is not valid', $query_type ...
Генерация нового отчета. ВНИМАНИЕ! Данная операция спишет с баланса один отчет. @param string $auth_token Токен безопасности @param string $query_type Тип запрашиваемой сущности @param string $query_id Значение запрашиваемой сущности @param string $report_type_uid UID типа отчета @param bool $is_fo...
entailment
public function refresh($auth_token, $report_uid, array $options = []) { $request_body = empty($options) ? null : ['options' => $options]; return new B2BResponse($this->client->apiRequest( 'post', sprintf('user/reports/%s/_refresh', urlencode($report_...
Запрос на обновление данных в отчете. ВНИМАНИЕ! Данная операция спишет с баланса один отчет. @param string $auth_token Токен безопасности @param string $report_uid UID отчета @param array $options Дополнительные опции запроса @throws B2BApiException @return B2BResponse
entailment
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { $properties['target_id'] = DataDefinition::create('integer')->setLabel(t('Target entity id')); $properties['parent_id'] = DataDefinition::create('integer')->setLabel(t('Parent entity id')); $properties['name'] = ...
{@inheritdoc}
entailment
public static function schema(FieldStorageDefinitionInterface $field_definition) { return array( 'columns' => array( 'target_id' => array( 'type' => 'int', 'unsigned' => true, 'not null' => false, 'default' => 0, ), 'parent_id' => array( ...
{@inheritdoc}
entailment
public function isEmpty() { $isEmpty = TRUE; if ($this->get('target_id')->getValue() || $this->get('name')->getValue()) { $isEmpty = FALSE; } return $isEmpty; }
{@inheritdoc}
entailment
public function activationHasSucceed(Fluent $extension) { $this->dispatch(new RefreshRouteCache()); $message = trans('orchestra/foundation::response.extensions.activate', $extension->getAttributes()); return $this->redirectWithMessage(handles('orchestra::extensions'), $message); }
Response when extension activation has succeed. @param \Illuminate\Support\Fluent $extension @return mixed
entailment
public function configure($content) { foreach ((array) $this->convertToArray($content) as $key => $value) { try { switch (trim(mb_strtolower($key))) { case '_id': case 'name': $this->name = trim((string) $value); ...
{@inheritdoc}
entailment
protected function markAsRegistered($provider) { $this['events']->dispatch(\get_class($provider), [$provider]); parent::markAsRegistered($provider); }
Mark the given provider as registered. @param \Illuminate\Support\ServiceProvider $provider @return void
entailment
public function flush() { parent::flush(); $this->booted = false; $this->hasBeenBootstrapped = false; $this->bootingCallbacks = []; $this->bootedCallbacks = []; $this->reboundCallbacks = []; $this->resolvingCallbacks = []; $this->terminatingCallbacks...
Flush the container of all bindings and resolved instances. @return void
entailment
public static function postInstall(Event $event): void { require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php'; self::clearCompiled(); }
Handle the post-install Composer event. @param \Composer\Script\Event $event @return void
entailment
private static function clearCompiled(): void { $laravel = new Application(getcwd()); if (\file_exists($servicesPath = $laravel->getCachedServicesPath())) { @\unlink($servicesPath); } if (\file_exists($packagesPath = $laravel->getCachedPackagesPath())) { @\u...
Clear the cached Laravel bootstrapping files. @return void
entailment
public function configure(Processor $processor, $vendor, $package = null) { $extension = $this->getExtension($vendor, $package); return $processor->configure($this, $extension); }
Configure an extension. GET (:orchestra)/extensions/configure/(:name) @param \Orchestra\Foundation\Processors\Extension\Configure $processor @param string $vendor @param string|null $package @return mixed
entailment
public function update(Processor $processor, $vendor, $package = null) { $extension = $this->getExtension($vendor, $package); return $processor->update($this, $extension, Input::all()); }
Update extension configuration. POST (:orchestra)/extensions/configure/(:name) @param \Orchestra\Foundation\Processors\Extension\Configure $processor @param string $vendor @param string|null $package @return mixed
entailment
public function showConfigurationChanger(array $data) { $name = $data['extension']->name; set_meta('title', Foundation::memory()->get("extensions.available.{$name}.name", $name)); set_meta('description', trans('orchestra/foundation::title.extensions.configure')); return view('orche...
Response for extension configuration. @param array $data @return mixed
entailment
protected function convertToCarbon($value) { if ($value instanceof Carbon) { return $value; } if ($value instanceof DateTime) { return Carbon::instance($value); } if (\is_numeric($value)) { return Carbon::createFromTimestamp($value); ...
Преобразует полученное значение в объект Carbon. @param Carbon|DateTime|int|string $value @return null|Carbon
entailment
public function processNode(Node $node, Scope $scope): array { $messages = []; $parameters = []; foreach ($node->getParams() as $parameter) { $variable = $parameter->var; if ($variable instanceof Variable && \is_string($variable->name)) { $parameters[...
@param \PhpParser\Node\FunctionLike $node @param \PHPStan\Analyser\Scope $scope @return string[] errors
entailment
public function buildForm(array $form, FormStateInterface $form_state, $cid = 0) { $this->сid = (int) $cid; if ($this->сid) { $this->characteristic = $this->database->characteristicsReadItem($this->сid); } return parent::buildForm($form, $form_state); }
{@inheritdoc}
entailment
public function getQuestion() { return $this->t('Are you sure you want to delete «@title»?', ['@title' => $this->characteristic->title]); }
{@inheritdoc}
entailment
public function submitForm(array &$form, FormStateInterface $form_state) { $this->database->characteristicsDeleteItem($this->characteristic->cid); // Очищает cache. Cache::invalidateTags(['site-commerce-characteristics']); drupal_set_message($this->t('The object <b>@title</b> was successfully deleted....
{@inheritdoc}
entailment
public function buildRow(EntityInterface $entity) { $row['label'] = $this->getLabel($entity); $row['id'] = $entity->id(); return $row + parent::buildRow($entity); }
{@inheritdoc}
entailment
public function getDefaultOperations(EntityInterface $entity) { /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ $operations = parent::getDefaultOperations($entity); if ($this->entityType->hasKey('status')) { if (!$entity->status() && $entity->hasLinkTemplate('enable')) { ...
{@inheritdoc}
entailment
protected function responseOnUnauthorized($request) { if ($request->ajax()) { return $this->response->make('Unauthorized', 401); } $url = $this->config->get('orchestra/foundation::routes.guest'); return $this->response->redirectGuest($this->foundation->handles($url)); ...
Response on authorized request. @param \Illuminate\Http\Request $request @return mixed
entailment
public function bootstrap(Application $app) { if ($app->make('orchestra.extension.status')->is('safe')) { Messages::extend(function (MessageBag $messages) { $messages->add('info', \trans('orchestra/foundation::response.safe-mode')); }); } }
Bootstrap the given application. @param \Illuminate\Contracts\Foundation\Application $app @return void
entailment
public function getSourcesNamesList() { return \is_array($value = $this->getContentValue('content.sources', null)) ? \array_unique(array_filter($value)) : null; }
Возвращает имена источников, используемых в данном типе отчета. @return string[]|array|null
entailment
public function getFieldsList() { return \is_array($value = $this->getContentValue('content.fields', null)) ? \array_unique(array_filter($value)) : null; }
Возвращает имена филдов данных, используемых в данном типе отчета. @return string[]|array|null
entailment
public function setConfigurationPart($configurationID, array $configurationPart) { if (!array_key_exists($configurationID, $this->configuration)) { throw new \InvalidArgumentException(sprintf( 'The configuration ID must be a one of %s, [ %s ] is given.', implode('...
@param string $configurationID @param array $configurationPart @throws \InvalidArgumentException
entailment
public function showCategories($insert = false, $callback = false, $section = false) { if ($insert && !$callback) { abort(404); } if ($section) { $LFM = session()->get('LFM'); if ($LFM[$section]) { if ($LFM[$sect...
categories
entailment
public function load(string $helper) { if (isset($this->filters[$helper])) { return call_user_func_array($this->filters[$helper], array_slice(func_get_args(), 1)); } }
Check if filter is registered, call filter if is registered @param string $helper @return mixed
entailment
public function collect() { $self = $this; $fileSystem = new FileSystem(); $environment = $this->environment; $this->testTargetRepository->walkOnResources(function ($resource, $index, TestTargetRepository $testTargetRepository) use ($self, $fileSystem, $environment) { $ab...
Collects tests. @return mixed @throws \UnexpectedValueException
entailment
protected function getRecord($tableName, $where = null) { $record = $this->database->table($tableName)->order('RAND()'); return $where ? $record->where($where)->limit(1)->fetch() : $record->limit(1)->fetch(); }
Returns random record from given table. @param string $tableName @return IRow|false
entailment
protected function getId($tableName, $where = null) { $record = $this->getRecord($tableName, $where); return $record ? $record->id : null; }
Returns id of random record from given table. @param string $tableName @return int
entailment
public function scaffold() { $this->updateDependencies([ "vue" => "^2.4.3", ]); $this->updateDevDependencies([ "vue-loader" => "^13.3.0", "vue-template-compiler" => "^2.5.2", ]); $this->updateJavascript($this->name); $this->updateAs...
Scaffold a Vue boilerplate preset. @return void
entailment
protected function registerClientScript() { //UEditorAsset::register($this->view); KindEditorAsset::register($this->view); $clientOptions = Json::encode($this->clientOptions); $fileManagerJson = Url::to(['Kupload', 'action' => 'fileManagerJson']); $uploadJson = Url::to(['K...
注册客户端脚本
entailment
public function serialize(MessageInterface $message): string { if (method_exists($message, 'getProcess')) { $process = $message->getProcess(); } else { $process = false; $payload = $message->getPayload(); if (isset($payload['delayed'])) { ...
{@inheritdoc}
entailment
public function unserialize(string $string): MessageInterface { $data = JSON::decode($string, Json::FORCE_ARRAY); $message = $data['message']; if (!isset($message['execute_at'])) { $message['execute_at'] = $message['process']; } if (strpos($message['created'], ' '...
{@inheritdoc}
entailment
public function send($method, $uri, array $options = []) { $request = new Request($method, $uri); return $this->client->send($request, $options); }
/* {@inheritdoc}
entailment
private function buildConfig() { $env = getenv('CRM_ENV'); $configData = [ 'paths' => [ 'migrations' => [ '%%PHINX_CONFIG_DIR%%/../../../../migrations' ] ], 'environments' => [ 'default_migration...
Build phinx config from config.local.neon @return array
entailment
public function clone($destination) { $fs = new Filesystem; if (! $fs->exists($destination)) { $fs->mkdir($destination, 0755); } $fs->mirror($this->source, $destination, null, $this->options); }
Perform source cloning. @param string $destination @return void
entailment
public function copy($file) { $fs = new Filesystem; if (! $fs->exists(dirname($file))) { $fs->mkdir(dirname($file), 0755); } $fs->copy($this->source, $file, true); }
Perform source coping. @param string $file @return void
entailment
public function loadState(array $params) { parent::loadState($params); $this->getPaginator()->page = $this->page; }
Loads state informations. @param array @return void
entailment
public function run($suite) { $printer = $this->createPrinter(); $testResult = new \PHPUnit_Framework_TestResult(); $testRunner = new TestRunner(); $testRunner->setTestResult($testResult); $testRunner->doRun($suite, $this->createArguments($printer, $testResult), false); ...
Runs tests based on the given \PHPUnit_Framework_TestSuite object. @param \PHPUnit_Framework_TestSuite $suite
entailment
protected function createPrinter() { if (defined('PHPUnit_TextUI_ResultPrinter::COLOR_AUTO') && defined('PHPUnit_TextUI_ResultPrinter::COLOR_NEVER')) { $shouldColor = $this->terminal->shouldColor() ? \PHPUnit_TextUI_ResultPrinter::COLOR_AUTO : \PHPUnit_TextUI_ResultPrinter::COLOR_NEVER; ...
@return \Stagehand\TestRunner\Runner\PHPUnitRunner\Printer\ResultPrinter @since Method available since Release 3.3.0
entailment
protected function createArguments(ResultPrinter $printer, \PHPUnit_Framework_TestResult $testResult) { $arguments = array(); $arguments['printer'] = $printer; Stream::register(); $arguments['listeners'] = array( new TestDoxPrinter( fo...
@param \Stagehand\TestRunner\Runner\PHPUnitRunner\Printer\ResultPrinter $printer @param \PHPUnit_Framework_TestResult $testResult @return array @since Method available since Release 3.3.0
entailment
private function getFiltered(bool $public = true): array { $result = []; foreach ($this->events as $event) { if ($event['is_public'] === $public) { $result[] = $event; } } return $result; }
Returns array with events filtered by event's visibility @param bool $public @return array
entailment
public function quoteValue($str) { if (is_int($str) || is_float($str)) { return $str; } return "'" . addcslashes(str_replace("'", "''", $str), "\000\n\r\\\032") . "'"; }
Quotes a string value for use in a query. @param string $str string to be quoted @return string the properly quoted string @see http://www.php.net/manual/en/function.PDO-quote.php
entailment
protected function getTableNames($schema = '') { $client = $this->connection->getClient(); $tables = $client->listTables(); $schemaName = $client->getKeyspace()->name(); $names = []; foreach ($tables as $table) { $name = array_get($table, 'table_name'); ...
Returns all table names in the database. @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema. If not empty, the returned table names will be prefixed with the schema name. @return array all table names in the database.
entailment
public function utmParams() : array { return array_filter([ 'utm_source' => $this->utmSession->utmSource, 'utm_medium' => $this->utmSession->utmMedium, 'utm_campaign' => $this->utmSession->utmCampaign, 'utm_content' => $this->utmSession->utmContent, ])...
Returns array with UTM parameters of campaign @return array
entailment
protected function buildTrackingParamsSession() { $this->utmSession = $this->getSession('utm_session'); $this->utmSession->setExpiration('30 minutes'); if ($this->getParameter('utm_source')) { $this->utmSession->utmSource = $this->getParameter('utm_source'); } if...
Store sales funnel UTM parameters and additional tracking parameters to session
entailment
public function onMethodVerificationSuccess(Member $member, $method) { $this->getAuditLogger()->info( sprintf( '"%s" (ID: %s) successfully verified using MFA method', $member->Email ?: $member->Title, $member->ID ), ['method...
A successful login using an MFA method @param Member $member @param MethodInterface $method
entailment
public function onMethodVerificationFailure(Member $member, $method) { $context = [ 'method' => get_class($method), ]; if ($lockOutAfterCount = $member->config()->get('lock_out_after_incorrect_logins')) { // Add information about how many attempts have been made ...
A failed login using an MFA method @param Member $member @param MethodInterface $method
entailment
public function onSkipRegistration(Member $member) { $this->getAuditLogger()->info(sprintf( '"%s" (ID: %s) skipped MFA registration', $member->Email ?: $member->Title, $member->ID )); }
A user has skipped MFA registration when it is enabled but optional, or within a grace period @param Member $member
entailment
public function getDatabaseSeriesData(Criteria $criteria) { $dbData = []; $res = $this->database->query("SELECT {$criteria->getValueField()} AS value, calendar.week AS week, calendar.month AS month, calendar.year AS year, {$this->getSeries($criteria->getSeries())} {$criteria->getTableName()}.id FRO...
pridat do vsetkych queries ?
entailment
public function run() { \DB::table('lfm_file_mime_types')->delete(); \DB::table('lfm_file_mime_types')->insert(array ( 0 => array ( 'id' => 1, 'user_id' => 21, 'name' => 'JPEG Image', ...
Auto generated seed file @return void
entailment
public function removeByID($itemID) { parent::removeByID($itemID); if ($this->getJoinTable() == 'Group_Members') { $currentMember = Security::getCurrentUser(); if (!($currentMember && $currentMember->exists())) { return; } $member = M...
Overload {@link ManyManyList::removeByID()} so we can log when a Member is removed from a Group.
entailment
public function registerEventHandlers(Emitter $emitter) { $emitter->addListener( \Crm\UsersModule\Events\NewAccessTokenEvent::class, $this->getInstance(\Crm\ApplicationModule\Events\NewAccessTokenHandler::class) ); $emitter->addListener( \Crm\UsersModule\E...
TODO: [users_module] application module by nemal mat ziadny event handler, aby neexistovala zavislost na ostatnych moduloch
entailment
public function add(array $assets) { if (! file_exists($this->file)) { throw new RuntimeException("Could not add assets, `app.json` file do not exists."); } $packages = json_decode(file_get_contents($this->file), true); $packages['assets'] = $assets + $packages['assets'...
Adds additional entries to the `assets` option. @param array $assets @return void
entailment
private function docIsCompatible($headerValidator, $fileContent, $docheaderFile) { return $headerValidator->__invoke($fileContent) || false !== strpos($fileContent, $docheaderFile); }
@param RegExp $headerValidator @param string $fileContent @param string $docheaderFile @return bool
entailment
private function getDocheaderFileContent(InputInterface $input) { $docheaderFile = $input->getOption('docheader'); $docheader = (new DocheaderFileResolution())->resolve($docheaderFile); $filter = new Filter(file_get_contents($docheader)); return $filter->apply(); }
@throws Exception\DocHeaderFileConfiguration @return string
entailment
protected function buildNotifyCommand(Notification $notification) { if ($notification->isPassed()) { $title = self::TITLE_PASSED; $icon = self::$ICON_PASSED; $sound = self::SOUND_PASSED; } elseif ($notification->isFailed()) { $title = self::TITLE_FAILE...
@param \Stagehand\TestRunner\Notification\Notification $notification @return string
entailment
public function loadAndUpdate($key, callable $getValue, DateTime $notOlderThan = null, $forceUpdate = false) { if (!$forceUpdate) { $stat = $this->load($key, $notOlderThan); if ($stat) { return $stat->value; } } $value = $getValue(); ...
Retrieve value either from cache or using $getValue callable (and subsequently cache it in DB) @param $key @param callable $getValue @param DateTime|null $notOlderThan @param bool $forceUpdate @return mixed|\Nette\Database\Table\ActiveRow
entailment
public function offsetSet($name, $value) { if ($name === null) { throw new InvalidArgumentException('The argument name cannot be null.'); } $this->setArgument($name, $value); }
Set the value of an event argument. @param string $name The argument name. @param mixed $value The argument value. @return void @throws InvalidArgumentException If the argument name is null. @since 1.0
entailment
public function negate(MoneyInterface $money) { if ($this->isZero($money)) { return $money; } else { return $this->mul($money, '-1'); } }
Negates money @param MoneyInterface $money @return MoneyInterface
entailment
public function add(MoneyInterface $first, MoneyInterface $second) { return $this->factory->create( $this->math->add($first->getAmount(), $second->getAmount()), $this->resolveCurrency($first, $second) ); }
@param MoneyInterface $first @param MoneyInterface $second @return MoneyInterface @throws CurrencyMismatchException
entailment
public function mul(MoneyInterface $money, $multiplier) { return $this->factory->create( $this->math->mul($money->getAmount(), $multiplier), $money->getCurrency() ); }
@param MoneyInterface $money @param string $multiplier @return MoneyInterface
entailment
public function div(MoneyInterface $money, $divisor) { return $this->factory->create( $this->math->div($money->getAmount(), $divisor), $money->getCurrency() ); }
@param MoneyInterface $money @param string $divisor @return MoneyInterface
entailment
public function round(MoneyInterface $money, $precision = null, $mode = PHP_ROUND_HALF_UP) { if ($precision === null) { $precision = $this->informationProvider->getDefaultPrecision($money->getCurrency()); } return $this->factory->create( $this->math->round($money->get...
@param MoneyInterface $money @param int $precision @param int $mode @return MoneyInterface
entailment
public function ceil(MoneyInterface $money, $precision = null) { if ($precision === null) { $precision = $this->informationProvider->getDefaultPrecision($money->getCurrency()); } return $this->factory->create( $this->math->ceil($money->getAmount(), $precision), ...
@param MoneyInterface $money @param int $precision @return MoneyInterface
entailment
public function comp(MoneyInterface $first, MoneyInterface $second) { $this->resolveCurrency($first, $second); return $this->math->comp($first->getAmount(), $second->getAmount()); }
@param MoneyInterface $first @param MoneyInterface $second @return int @throws CurrencyMismatchException
entailment
public function isGt(MoneyInterface $first, MoneyInterface $second) { $this->resolveCurrency($first, $second); return $this->math->isGt($first->getAmount(), $second->getAmount()); }
@param MoneyInterface $first @param MoneyInterface $second @return boolean @throws CurrencyMismatchException
entailment
public function isGte(MoneyInterface $first, MoneyInterface $second) { $this->resolveCurrency($first, $second); return $this->math->isGte($first->getAmount(), $second->getAmount()); }
@param MoneyInterface $first @param MoneyInterface $second @return boolean @throws CurrencyMismatchException
entailment
public function isLt(MoneyInterface $first, MoneyInterface $second) { $this->resolveCurrency($first, $second); return $this->math->isLt($first->getAmount(), $second->getAmount()); }
@param MoneyInterface $first @param MoneyInterface $second @return boolean @throws CurrencyMismatchException
entailment
public function isLte(MoneyInterface $first, MoneyInterface $second) { $this->resolveCurrency($first, $second); return $this->math->isLte($first->getAmount(), $second->getAmount()); }
@param MoneyInterface $first @param MoneyInterface $second @return boolean @throws CurrencyMismatchException
entailment
public function isEqual(MoneyInterface $first, MoneyInterface $second) { $this->resolveCurrency($first, $second); return $this->math->isEqual($first->getAmount(), $second->getAmount()); }
@param MoneyInterface $first @param MoneyInterface $second @return boolean @throws CurrencyMismatchException
entailment
public function setCredentials(array $credentials) : AuthenticatorInterface { if (array_key_exists('source', $credentials) && preg_match('/^api*/', $credentials['source'])) { $this->api = true; $this->source = $credentials['source']; } return $this; }
@inheritdoc Sets attributes needed globally.
entailment
public function render(Nette\Forms\Form $form, $mode = null) { $form->getElementPrototype()->setClass('form-inline'); foreach ($form->getControls() as $control) { if ($control instanceof Controls\Button) { $usedPrimary = true; } elseif ($control instanceof Co...
Provides complete form rendering. @param Nette\Forms\Form @param string 'begin', 'errors', 'ownerrors', 'body', 'end' or empty to render all @return string
entailment
public function run() { \DB::table('lfm_categories')->delete(); \DB::table('lfm_categories')->insert( array ( 'id' => '0', 'user_id' => 0, 'title' => 'Root folder', 'title_disc' => 'root_folder', 'description...
Auto generated seed file @return void
entailment
public function create($type = null, array $requiredSuperTypes = array()) { $collectingType = parent::create(); $collectingType->setType($type); $collectingType->setRequiredSuperTypes($requiredSuperTypes); return $collectingType; }
@param string $type @param array $requiredSuperTypes @return \Stagehand\TestRunner\Collector\CollectingType
entailment
public function process(ContainerBuilder $container) { $container->setAlias('preparer', $this->plugin->getPluginID().'.preparer'); $container->setAlias('collector', $this->plugin->getPluginID().'.collector'); $container->setAlias('runner', $this->plugin->getPluginID().'.runner'); if...
{@inheritdoc}
entailment
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) { $message = 'raised an error'; $this->write( $this->colors ? Coloring::magenta($message) : $message ); parent::addError($test, $e, $time); }
An error occurred. @param \PHPUnit_Framework_Test $test @param \Exception $e @param float $time
entailment
public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) { $message = 'failed'; $this->write( $this->colors ? Coloring::red($message) : $message ); parent::addFailure($test, $e, $time); }
A failure occurred. @param \PHPUnit_Framework_Test $test @param \PHPUnit_Framework_AssertionFailedError $e @param float $time
entailment