sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
public function dropDownList($items, $options = []) { Html::addCssClass($this->inputOptions,'uk-select'); return parent::dropDownList($items, $options); }
{@inheritdoc}
entailment
public function cacheComponents($num = 1000, $page = 1) { if ($this->cached != null) { return $this->cached; } $this->cached = $this->client->call( 'GET', 'components', [ 'query' => [ 'per_page' => $num, ...
Cache Components for performance improvement. @param int $num @param int $page @return array|bool
entailment
public function indexComponents($num = 1000, $page = 1) { if ($this->cache === true) { return $this->cacheComponents($num, $page); } return $this->client->call( 'GET', 'components', [ 'query' => [ 'per_page'...
Get a defined number of Components. @param int $num @param int $page @return array|bool
entailment
public function searchComponents($search, $by, $limit = 1, $num = 1000, $page = 1) { $components = $this->indexComponents($num, $page)['data']; $filtered = array_filter( $components, function ($component) use ($search, $by) { if (array_key_exists($by, $compo...
Search if a defined number of Components exists. @param string $search @param string $by @param int $num @param int $page @param int $limit @return mixed
entailment
public function setHeadId($headId) { if ($headId > 9.0) { throw new \InvalidArgumentException('invalid value for $headId when calling GetCharactersCharacterIdPlanetsPlanetIdOkExtractorDetailsHeads., must be smaller than or equal to 9.0.'); } if ($headId < 0.0) { thro...
Sets headId @param int $headId head_id integer @return $this
entailment
public function getServiceNameAllowableValues() { return [ self::SERVICE_NAME_BOUNTY_MISSIONS, self::SERVICE_NAME_ASSASSINATION_MISSIONS, self::SERVICE_NAME_COURIER_MISSIONS, self::SERVICE_NAME_INTERBUS, self::SERVICE_NAME_REPROCESSING_PLANT, ...
Gets allowable values of the enum @return string[]
entailment
public function setServiceName($serviceName) { $allowedValues = $this->getServiceNameAllowableValues(); if (!in_array($serviceName, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'serviceName', must be one of '%s'",...
Sets serviceName @param string $serviceName service_name string @return $this
entailment
public static function validate($checkType, $value) { if (array_key_exists($checkType, self::$checks)) { if (empty(self::$checks[$checkType])) { $blnReturn = true; } else { if (is_array($value)) { $arrValues = $value; ...
Validate input against regular expression @param integer $checkType The type to check for @param string $value The value to validate @return boolean True if valid, false if not.
entailment
public static function getCheck($checkType) { $strReturn = ""; if (array_key_exists($checkType, self::$checks)) { $strReturn = self::$checks[$checkType]; } return $strReturn; }
Get the regular expression that is used by the given field type @param integer $checkType Field type @return string The matching regular expression
entailment
public function getIndustrySystems($datasource = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getIndustrySystemsWithHttpInfo($datasource, $userAgent, $xUserAgent); return $response; }
Operation getIndustrySystems List solar system cost indices @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgent Client identifier, takes precedence over User...
entailment
public function loadPluginConfiguration(): void { $builder = $this->getContainerBuilder(); $global = $this->compiler->getExtension()->getConfig(); $config = $this->getConfig(); $builder->addDefinition($this->prefix('entityAdapter')) ->setFactory(EntityAdapter::class); $entityDefinition = $builder->addDe...
Register services
entailment
public function getCharactersCharacterIdLoyaltyPointsAsync($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getCharactersCharacterIdLoyaltyPointsAsyncWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent) ->then( ...
Operation getCharactersCharacterIdLoyaltyPointsAsync Get loyalty points @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to set a header (optional) @param ...
entailment
public function getLoyaltyStoresCorporationIdOffers($corporationId, $datasource = 'tranquility', $userAgent = null, $xUserAgent = null) { list($response) = $this->getLoyaltyStoresCorporationIdOffersWithHttpInfo($corporationId, $datasource, $userAgent, $xUserAgent); return $response; }
Operation getLoyaltyStoresCorporationIdOffers List loyalty store offers @param int $corporationId An EVE corporation ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optiona...
entailment
public function getLoyaltyStoresCorporationIdOffersAsync($corporationId, $datasource = 'tranquility', $userAgent = null, $xUserAgent = null) { return $this->getLoyaltyStoresCorporationIdOffersAsyncWithHttpInfo($corporationId, $datasource, $userAgent, $xUserAgent) ->then( function...
Operation getLoyaltyStoresCorporationIdOffersAsync List loyalty store offers @param int $corporationId An EVE corporation ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (op...
entailment
public function setStatus($status = null) { switch ($status) { //TODO implement all status codes case '500': $this->setStatusCode('HTTP/1.0 500 Internal Server Error'); break; case '404': $this->setStatusCode('HTTP/1.0 404 N...
Método que establece un header de http status code @param string $status @return $this
entailment
private function setReponseHeaders($contentType = 'text/html', array $cookies = array()) { $powered = Config::getParam('poweredBy', 'PSFS'); header('X-Powered-By: ' . $powered); ResponseHelper::setStatusHeader($this->getStatusCode()); ResponseHelper::setAuthHeaders($this->isPublicZon...
Servicio que establece las cabeceras de la respuesta @param string $contentType @param array $cookies
entailment
public function output($output = '', $contentType = 'text/html', array $cookies = array()) { if(!self::isTest()) { Logger::log('Start output response'); ob_start(); $this->setReponseHeaders($contentType, $cookies); header('Content-length: ' . strlen($output));...
Servicio que devuelve el output @param string $output @param string $contentType @param array $cookies @return string HTML
entailment
public function closeRender() { Logger::log('Close template render'); $uri = Request::requestUri(); Security::getInstance()->setSessionKey('lastRequest', array( 'url' => Request::getInstance()->getRootUrl() . $uri, 'ts' => microtime(true), )); Security...
Método que cierra y limpia los buffers de salida
entailment
public function renderCache($data, $headers = array()) { ob_start(); for ($i = 0, $ct = count($headers); $i < $ct; $i++) { header($headers[$i]); } header('X-PSFS-CACHED: true'); echo $data; ob_flush(); ob_end_clean(); $this->closeRender(); ...
Método que devuelve los datos cacheados con las cabeceras que tenía por entonces @param string $data @param array $headers
entailment
public function download($data, $content = 'text/html', $filename = 'data.txt') { ob_start(); header('Pragma: public'); ///////////////////////////////////////////////////////////// // prevent caching.... ///////////////////////////////////////////////////////////// /...
Método que fuerza la descarga de un fichero @param $data @param string $content @param string $filename @return mixed
entailment
public function addColumns(Column $column, $amount) { for ($i = 0; $i < $amount; $i++) { $this->addColumn($column); } return $this; }
@param Column $column @param $amount @return $this
entailment
public function getPanel(): string { ob_start(); $spec = $this->schemaBuilder->build()->toArray(); $url = $this->url; $expansion = $this->expansion; $filter = $this->filter; require __DIR__ . '/templates/panel.phtml'; return (string) ob_get_clean(); }
Renders HTML code for custom panel.
entailment
public function deleteCharactersCharacterIdContacts($characterId, $contactIds, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->deleteCharactersCharacterIdContactsWithHttpInfo($characterId, $contactIds, $datasource, $token, $userAgent, $xUserAgent); ...
Operation deleteCharactersCharacterIdContacts Delete contacts @param int $characterId ID for a character (required) @param int[] $contactIds A list of contacts to edit (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to ...
entailment
public function getCharactersCharacterIdContacts($characterId, $datasource = null, $page = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdContactsWithHttpInfo($characterId, $datasource, $page, $token, $userAgent, $xUserAgent); return $r...
Operation getCharactersCharacterIdContacts Get contacts @param int $characterId ID for a character (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page page integer (optional, default to 1) @param string $token Access token to use, if prefer...
entailment
public function putCharactersCharacterIdContacts($characterId, $contactIds, $standing, $datasource = null, $labelId = null, $token = null, $userAgent = null, $watched = null, $xUserAgent = null) { list($response) = $this->putCharactersCharacterIdContactsWithHttpInfo($characterId, $contactIds, $standing, $da...
Operation putCharactersCharacterIdContacts Edit contacts @param int $characterId ID for a character (required) @param int[] $contactIds A list of contacts to edit (required) @param float $standing Standing for the contact (required) @param string $datasource The server name you would like data from (optional, default...
entailment
protected function configure(): void { // First command : Test the DB Connexion $this->setName($this->command) ->setDescription( 'Generate configuration for the Anonymizer' )->setHelp( 'This command will connect to a DB and extract a list of ta...
Configure the command @return void
entailment
protected function execute(InputInterface $input, OutputInterface $output): void { // Throw an exception immediately if we don't have the required DB parameter if (empty($input->getOption('db'))) { throw new \InvalidArgumentException('Database name is required (--db)'); } ...
@param InputInterface $input @param OutputInterface $output @return void @throws \Doctrine\DBAL\DBALException @throws \Edyan\Neuralyzer\Exception\NeuralyzerConfigurationException
entailment
public function getDogmaAttributes($datasource = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getDogmaAttributesWithHttpInfo($datasource, $userAgent, $xUserAgent); return $response; }
Operation getDogmaAttributes Get attributes @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgent Client identifier, takes precedence over User-Agent (optional...
entailment
public function getDogmaEffectsEffectId($effectId, $datasource = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getDogmaEffectsEffectIdWithHttpInfo($effectId, $datasource, $userAgent, $xUserAgent); return $response; }
Operation getDogmaEffectsEffectId Get effect information @param int $effectId A dogma effect ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgen...
entailment
public static function translateSwaggerFormats($format) { switch (strtolower(preg_replace('/\\\\/im', '', $format))) { case 'bool': case 'boolean': $swaggerType = 'boolean'; $swaggerFormat = ''; break; default: c...
Translator from php types to swagger types @param string $format @return array
entailment
public static function extractSwaggerDefinition($name, array $fields) { $definition = [ $name => [ "type" => "object", "properties" => [], ], ]; foreach ($fields as $field => $info) { if(array_key_exists('type', $info) && in...
Method that parse the definitions for the api's @param string $name @param array $fields @return array
entailment
public function listInvalidProperties() { $invalidProperties = []; if ($this->container['typeId'] === null) { $invalidProperties[] = "'typeId' can't be null"; } if ($this->container['quantity'] === null) { $invalidProperties[] = "'quantity' can't be null"; ...
Show all the invalid properties with reasons. @return array invalid properties with reasons
entailment
public function valid() { if ($this->container['typeId'] === null) { return false; } if ($this->container['quantity'] === null) { return false; } if ($this->container['locationId'] === null) { return false; } if ($this->con...
Validate all the properties in the model return true if all passed @return bool True if all properties are valid
entailment
public function getFleetsFleetId($fleetId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getFleetsFleetIdWithHttpInfo($fleetId, $datasource, $token, $userAgent, $xUserAgent); return $response; }
Operation getFleetsFleetId Get fleet information @param int $fleetId ID for a fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over a header (optional) @param string $userAgent Client identifie...
entailment
public function getFleetsFleetIdWings($fleetId, $datasource = null, $language = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getFleetsFleetIdWingsWithHttpInfo($fleetId, $datasource, $language, $token, $userAgent, $xUserAgent); return $response; }
Operation getFleetsFleetIdWings Get fleet wings @param int $fleetId ID for a fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $language Language to use in the response (optional, default to en-us) @param string $token Access token to ...
entailment
public function postFleetsFleetIdWingsWingIdSquads($fleetId, $wingId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->postFleetsFleetIdWingsWingIdSquadsWithHttpInfo($fleetId, $wingId, $datasource, $token, $userAgent, $xUserAgent); return $response...
Operation postFleetsFleetIdWingsWingIdSquads Create fleet squad @param int $fleetId ID for a fleet (required) @param int $wingId The wing_id to create squad in (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if ...
entailment
public function putFleetsFleetIdMembersMemberId($fleetId, $memberId, $movement, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->putFleetsFleetIdMembersMemberIdWithHttpInfo($fleetId, $memberId, $movement, $datasource, $token, $userAgent, $xUserAgent); ...
Operation putFleetsFleetIdMembersMemberId Move fleet member @param int $fleetId ID for a fleet (required) @param int $memberId The character ID of a member in this fleet (required) @param \nullx27\ESI\Models\PutFleetsFleetIdMembersMemberIdMovement $movement Details of the invitation (required) @param string $datasour...
entailment
public function putFleetsFleetIdSquadsSquadId($fleetId, $naming, $squadId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->putFleetsFleetIdSquadsSquadIdWithHttpInfo($fleetId, $naming, $squadId, $datasource, $token, $userAgent, $xUserAgent); return...
Operation putFleetsFleetIdSquadsSquadId Rename fleet squad @param int $fleetId ID for a fleet (required) @param \nullx27\ESI\Models\PutFleetsFleetIdSquadsSquadIdNaming $naming New name of the squad (required) @param int $squadId The squad to rename (required) @param string $datasource The server name you would like d...
entailment
public function find() { $keys = []; $functions = ['trans', 'trans_choice', 'Lang::get', 'Lang::choice', 'Lang::trans', 'Lang::transChoice', '@lang', '@choice', '__', ]; $pattern = // See http://regexr.com/392hu "[^\w|>]". ...
/* This method is based in Laravel Translation Manager Created by Barry vd. Heuvel GitHub: https://github.com/barryvdh/laravel-translation-manager
entailment
public function getCharactersCharacterIdSkillqueue($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdSkillqueueWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent); return $response; }
Operation getCharactersCharacterIdSkillqueue Get character's skill queue @param int $characterId Character id of the target character (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over a header (o...
entailment
public function getCharactersCharacterIdSkillqueueWithHttpInfo($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { // verify the required parameter 'characterId' is set if ($characterId === null) { throw new \InvalidArgumentException('Missing the req...
Operation getCharactersCharacterIdSkillqueueWithHttpInfo Get character's skill queue @param int $characterId Character id of the target character (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over...
entailment
public function cacheIncidents($num = 1000, $page = 1) { if ($this->cached != null) { return $this->cached; } $this->cached = $this->client->call( 'GET', 'incidents', [ 'query' => [ 'per_page' => $num, ...
Cache Incidents for performance improvement. @param int $num @param int $page @return array|bool
entailment
public function indexIncidents($num = 1000, $page = 1) { if ($this->cache != false) { return $this->cacheIncidents($num, $page); } return $this->client->call( 'GET', 'incidents', [ 'query' => [ 'per_page' =>...
Get a defined number of Incidents. @param int $num @param int $page @return array|bool
entailment
public function searchIncidents($search, $by, $limit = 1, $num = 1000, $page = 1) { $incidents = $this->indexIncidents($num, $page)['data']; $filtered = array_filter( $incidents, function ($incident) use ($search, $by) { if (array_key_exists($by, $incident))...
Search if a defined number of Incidents exists. @param string $search @param string $by @param int $num @param int $page @param int $limit @return mixed
entailment
public function getStatusAllowableValues() { return [ self::STATUS_ACTIVE, self::STATUS_PAUSED, self::STATUS_READY, self::STATUS_DELIVERED, self::STATUS_CANCELLED, self::STATUS_REVERTED, ]; }
Gets allowable values of the enum @return string[]
entailment
public function setStatus($status) { $allowed_values = array('active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted'); if ((!in_array($status, $allowed_values))) { throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'active', 'paused', 'ready', 'deli...
Sets status @param string $status status string @return $this
entailment
public function createTask($handlerClass, $workload = null) { return $this->factory->createTaskBuilder($this->taskRepository->create($handlerClass, $workload), $this); }
{@inheritdoc}
entailment
public function addTask(TaskInterface $task) { $this->eventDispatcher->dispatch(Events::TASK_CREATE, new TaskEvent($task)); $this->taskRepository->save($task); $this->scheduleTask($task); return $this; }
{@inheritdoc}
entailment
public function scheduleTasks() { $tasks = $this->taskRepository->findEndBeforeNow(); foreach ($tasks as $task) { $this->scheduleTask($task); } }
{@inheritdoc}
entailment
protected function scheduleTask(TaskInterface $task) { if (null !== ($execution = $this->taskExecutionRepository->findPending($task))) { return; } if ($task->getInterval() === null && 0 < count($this->taskExecutionRepository->findByTask($task))) { return; } ...
Schedule execution for given task. @param TaskInterface $task
entailment
public function start(Request $request, AuthenticationException $authException = null) { return new JsonResponse(['message' => $authException->getMessage()], Response::HTTP_UNAUTHORIZED); }
Starts the authentication scheme. @param Request $request The request that resulted in an AuthenticationException @param AuthenticationException $authException The exception that started the authentication process @return Response
entailment
public function getModules($requestModule) { $modules = []; $domains = $this->route->getDomains(); if (count($domains)) { foreach ($domains as $module => $info) { try { $module = preg_replace('/(@|\/)/', '', $module); if ($m...
Method that extract all modules @param string $requestModule @return array
entailment
public function extractApiEndpoints(array $module) { $modulePath = $module['path'] . DIRECTORY_SEPARATOR . 'Api'; $moduleName = $module['name']; $endpoints = []; if (file_exists($modulePath)) { $finder = new Finder(); $finder->files()->in($modulePath)->depth(0...
Method that extract all endpoints for each module @param array $module @return array
entailment
protected function extractVisibility($comments = '') { $visible = TRUE; preg_match('/@visible\ (true|false)\n/i', $comments, $visibility); if (count($visibility)) { $visible = !('false' === $visibility[1]); } return $visible; }
Extract visibility from doc comments @param string $comments @return boolean
entailment
protected function extractDescription($comments = '') { $description = ''; $docs = explode("\n", $comments); if (count($docs)) { foreach ($docs as &$doc) { if (!preg_match('/(\*\*|\@)/', $doc) && preg_match('/\*\ /', $doc)) { $doc = explode('* ...
Method that extract the description for the endpoint @param string $comments @return string
entailment
public static function extractVarType($comments = '') { $type = 'string'; preg_match('/@var\ (.*) (.*)\n/i', $comments, $varType); if (count($varType)) { $aux = trim($varType[1]); $type = str_replace(' ', '', strlen($aux) > 0 ? $varType[1] : $varType[2]); } ...
Method that extract the type of a variable @param string $comments @return string
entailment
protected function extractPayload($model, $comments = '') { $payload = []; preg_match('/@payload\ (.*)\n/i', $comments, $doc); $isArray = false; if (count($doc)) { $namespace = str_replace('{__API__}', $model, $doc[1]); if (false !== strpos($namespace, '[') &&...
Method that extract the payload for the endpoint @param string $model @param string $comments @return array
entailment
protected function extractDtoProperties($class) { $properties = []; $reflector = new \ReflectionClass($class); if ($reflector->isSubclassOf(self::DTO_INTERFACE)) { $properties = array_merge($properties, InjectorHelper::extractVariables($reflector)); } return $pro...
Extract all the properties from Dto class @param string $class @return array
entailment
protected function extractReturn($model, $comments = '') { $modelDto = []; preg_match('/\@return\ (.*)\((.*)\)\n/i', $comments, $returnTypes); if (count($returnTypes)) { // Extract principal DTO information if (array_key_exists(1, $returnTypes)) { $mod...
Extract return class for api endpoint @param string $model @param string $comments @return array
entailment
protected function extractModelFields($namespace) { $payload = []; try { $reflector = new \ReflectionClass($namespace); // Checks if reflector is a subclass of propel ActiveRecords if (NULL !== $reflector && $reflector->isSubclassOf(self::MODEL_INTERFACE)) { ...
Extract all fields from a ActiveResource model @param string $namespace @return mixed
entailment
protected function extractMethodInfo($namespace, \ReflectionMethod $method, \ReflectionClass $reflection, $module) { $methodInfo = NULL; $docComments = $method->getDocComment(); if (FALSE !== $docComments && preg_match('/\@route\ /i', $docComments)) { $api = $this->extractApi($re...
Method that extract all the needed info for each method in each API @param string $namespace @param \ReflectionMethod $method @param \ReflectionClass $reflection @param string $module @return array
entailment
public static function swaggerFormatter(array $module) { $formatted = [ "swagger" => "2.0", "host" => preg_replace('/^(http|https)\:\/\/(.*)\/$/i', '$2', Router::getInstance()->getRoute('', true)), "basePath" => '/' . $module['name'] . '/api', "schemes" => [Re...
Method that export @param array $module @return array
entailment
protected function extractDtoName($dto, $isArray = false) { $dto = explode('\\', $dto); $modelDto = array_pop($dto) . "Dto"; if ($isArray) { $modelDto .= "List"; } return $modelDto; }
Method that extract the Dto class for the api documentation @param string $dto @param boolean $isArray @return string
entailment
public static function extractProperties(\ReflectionClass $reflector, $type = \ReflectionProperty::IS_PROTECTED, $pattern = self::INJECTABLE_PATTERN) { $properties = []; foreach ($reflector->getProperties($type) as $property) { $doc = $property->getDocComment(); if (preg_matc...
Method that extract the properties of a Class @param \ReflectionClass $reflector @param integer $type @param string $pattern @return array
entailment
public static function extractVarType($doc) { $type = null; if (false !== preg_match('/@var\s+([^\s]+)/', $doc, $matches)) { list(, $type) = $matches; } return $type; }
Method that extract the instance of the class @param $doc @return null|string
entailment
public static function checkIsRequired($doc) { $required = false; if (false !== preg_match('/@required/', $doc, $matches)) { $required = (bool)count($matches); } return $required; }
Method extract if a variable is required @param $doc @return null|string
entailment
public static function checkIsVisible($doc) { $visible = false; if (false !== preg_match('/@visible\s+([^\s]+)/', $doc, $matches)) { $visible = count($matches) < 2 || 'false' !== strtolower($matches[1]); } return $visible; }
Method extract if a class or variable is visible @param $doc @return null|string
entailment
public static function getClassProperties($class) { $properties = []; Logger::log('Extracting annotations properties from class ' . $class); $selfReflector = new \ReflectionClass($class); if (false !== $selfReflector->getParentClass()) { $properties = self::getClassProper...
Method that extract all the properties of a class @param string $class @return array
entailment
public function getConfigParams() { $response = array_merge(Config::$required, Config::$optional); $domains = Router::getInstance()->getDomains(); foreach ($domains as $domain => $routes) { $pDomain = str_replace('@', '', $domain); $pDomain = str_replace('/', '', $pDo...
Servicio que devuelve los parámetros disponibles @GET @route /admin/config/params @label Parámetros de configuración de PSFS @visible false @return mixed
entailment
public function config() { Logger::log("Config loaded executed by " . $this->getRequest()->getRequestUri()); /* @var $form \PSFS\base\config\ConfigForm */ $form = new ConfigForm(Router::getInstance()->getRoute('admin-config'), Config::$required, Config::$optional, Config::getInstance()->dump...
Método que gestiona la configuración de las variables @GET @Route /admin/config @return string|null @throws \HttpException
entailment
public function saveConfig() { Logger::log(t("Guardando configuración"), LOG_INFO); /* @var $form \PSFS\base\config\ConfigForm */ $form = new ConfigForm(Router::getInstance()->getRoute('admin-config'), Config::$required, Config::$optional, Config::getInstance()->dumpConfig()); $form-...
Servicio que guarda la configuración de la plataforma @POST @route /admin/config @visible false @return string @throws \HttpException
entailment
public function getCharactersCharacterIdLoyaltyPoints($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdLoyaltyPointsWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent); return $response; ...
Operation getCharactersCharacterIdLoyaltyPoints Get loyalty points @param int $characterId ID for a character (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over a header (optional) @param string $...
entailment
protected static function saveConfigParams(array $data, array $extra) { Logger::log('Saving required config parameters'); //En caso de tener parámetros nuevos los guardamos if (array_key_exists('label', $extra) && is_array($extra['label'])) { foreach ($extra['label'] as $index =>...
Method that saves the configuration @param array $data @param array $extra @return array
entailment
protected static function saveExtraParams(array $data) { $final_data = array(); if (count($data) > 0) { Logger::log('Saving extra configuration parameters'); foreach ($data as $key => $value) { if (null !== $value || $value !== '') { $final...
Method that saves the extra parameters into the configuration @param array $data @return array
entailment
public function isConfigured() { Logger::log('Checking configuration'); $configured = (count($this->config) > 0); if ($configured) { foreach (static::$required as $required) { if (!array_key_exists($required, $this->config)) { $configured = fal...
Method that checks if the platform is proper configured @return boolean
entailment
public function checkTryToSaveConfig() { $uri = Request::getInstance()->getRequestUri(); $method = Request::getInstance()->getMethod(); return (preg_match('/^\/admin\/(config|setup)$/', $uri) !== false && strtoupper($method) === 'POST'); }
Method that check if the user is trying to save the config @return bool
entailment
public static function save(array $data, array $extra = null) { $data = self::saveConfigParams($data, $extra); $final_data = self::saveExtraParams($data); $saved = false; try { $final_data = array_filter($final_data, function($key, $value) { return in_arra...
Method that saves all the configuration in the system @param array $data @param array|null $extra @return boolean
entailment
public function get($param, $defaultValue = null) { return array_key_exists($param, $this->config) ? $this->config[$param] : $defaultValue; }
Method that returns a config value @param string $param @param mixed $defaultValue @return mixed|null
entailment
public function loadConfigData() { $this->config = json_decode(file_get_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE), true) ?: []; $this->debug = array_key_exists('debug', $this->config) ? (bool)$this->config['debug'] : FALSE; }
Method that reloads config file
entailment
public static function getParam($key, $defaultValue = null, $module = null) { if(null !== $module) { return self::getParam(strtolower($module) . '.' . $key, self::getParam($key, $defaultValue)); } $param = self::getInstance()->get($key); return (null !== $param) ? $param ...
Static wrapper for extracting params @param string $key @param mixed|null $defaultValue @param string $module @return mixed|null
entailment
public static function setCookieHeaders($cookies) { if (!empty($cookies) && is_array($cookies) && false === headers_sent() && !self::isTest()) { foreach ($cookies as $cookie) { setcookie($cookie["name"], $cookie["value"], (array_key_exists(...
Method that sets the cookie headers @param $cookies
entailment
public static function setAuthHeaders($isPublic = true) { if ($isPublic) { unset($_SERVER["PHP_AUTH_USER"]); unset($_SERVER["PHP_AUTH_PW"]); header_remove("Authorization"); } elseif(!self::isTest()) { header('Authorization:'); } }
Método que inyecta las cabeceras necesarias para la autenticación @param boolean $isPublic
entailment
public static function setDebugHeaders(array $vars) { if (Config::getParam('debug', true) && !self::isTest()) { Logger::log('Adding debug headers to render response'); $vars["__DEBUG__"]["includes"] = get_included_files(); $vars["__DEBUG__"]["trace"] = debug_backtrace(DEB...
Método que mete en las variables de las plantillas las cabeceras de debug @param array $vars @return array
entailment
public function toHtmlInternal($value = null) { $strOutput = "<optgroup label=\"{$this->__label}\">\n"; foreach ($this->__options as $option) { $strOutput .= $option->toHtmlInternal($value); } $strOutput .= "</optgroup>\n"; return $strOutput; }
Generte HTML output @param string $value @return string Generated HTML
entailment
public function getCharactersCharacterIdBookmarksAsync($characterId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getCharactersCharacterIdBookmarksAsyncWithHttpInfo($characterId, $datasource, $page, $token, $userAgent, $xUserAgent) ...
Operation getCharactersCharacterIdBookmarksAsync List bookmarks @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page Which page of results to return (optional, default to 1) @param string $toke...
entailment
public function getCharactersCharacterIdBookmarksFoldersAsync($characterId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getCharactersCharacterIdBookmarksFoldersAsyncWithHttpInfo($characterId, $datasource, $page, $token, $userAgent, $xUserAg...
Operation getCharactersCharacterIdBookmarksFoldersAsync List bookmark folders @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page Which page of results to return (optional, default to 1) @param...
entailment
public function getCorporationsCorporationIdBookmarks($corporationId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCorporationsCorporationIdBookmarksWithHttpInfo($corporationId, $datasource, $page, $token, $userAgent, $xUserAge...
Operation getCorporationsCorporationIdBookmarks List corporation bookmarks @param int $corporationId An EVE corporation ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page Which page of results to return (optional, default to 1) @para...
entailment
public function getCorporationsCorporationIdBookmarksAsync($corporationId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getCorporationsCorporationIdBookmarksAsyncWithHttpInfo($corporationId, $datasource, $page, $token, $userAgent, $xUserAgen...
Operation getCorporationsCorporationIdBookmarksAsync List corporation bookmarks @param int $corporationId An EVE corporation ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page Which page of results to return (optional, default to 1) ...
entailment
public function getCorporationsCorporationIdBookmarksFolders($corporationId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCorporationsCorporationIdBookmarksFoldersWithHttpInfo($corporationId, $datasource, $page, $token, $userAg...
Operation getCorporationsCorporationIdBookmarksFolders List corporation bookmark folders @param int $corporationId An EVE corporation ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page Which page of results to return (optional, defau...
entailment
public function getCorporationsCorporationIdBookmarksFoldersAsync($corporationId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getCorporationsCorporationIdBookmarksFoldersAsyncWithHttpInfo($corporationId, $datasource, $page, $token, $userAge...
Operation getCorporationsCorporationIdBookmarksFoldersAsync List corporation bookmark folders @param int $corporationId An EVE corporation ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param int $page Which page of results to return (optional, ...
entailment
public function setColor($color): DeliveryOptions { if (!in_array($color, static::getOptionsForColor())) { throw new InvalidArgumentException(sprintf('Property %s is not supported for %s', $color, __FUNCTION__)); } $this->data['color'] = $color; return $this; }
The option specifies whether a color or black-and-white printing is carried out @param string $color @return self @throws InvalidArgumentException
entailment
public function setCoverLetter($coverLetter): DeliveryOptions { if (!in_array($coverLetter, static::getOptionsForCoverLetter())) { throw new InvalidArgumentException( sprintf('Property %s is not supported for %s', $coverLetter, __FUNCTION__) ); } $thi...
The option specifies whether a cover letter is generated for delivery or if it is included in the PDF attachment @param string $coverLetter @return self @throws InvalidArgumentException
entailment
public function setRegistered($registered): DeliveryOptions { if (!in_array($registered, static::getOptionsForRegistered())) { throw new InvalidArgumentException( sprintf('Property %s is not supported for %s', $registered, __FUNCTION__) ); } $this->da...
The option specifies if the E‑POST letter is sent as a “Einschreiben” (registered letter), and, if so, which registered letter type is to be selected @param string $registered @return self @throws InvalidArgumentException
entailment
public static function getOptionsForRegistered() { return [ self::OPTION_REGISTERED_STANDARD, self::OPTION_REGISTERED_SUBMISSION_ONLY, self::OPTION_REGISTERED_ADDRESSEE_ONLY, self::OPTION_REGISTERED_WITH_RETURN_RECEIPT, self::OPTION_REGISTERED_ADDR...
Get all options that can be used for setRegistered() @return array
entailment
public function setEventResponse($eventResponse) { $allowed_values = array('declined', 'not_responded', 'accepted', 'tentative'); if (!is_null($eventResponse) && (!in_array($eventResponse, $allowed_values))) { throw new \InvalidArgumentException("Invalid value for 'eventResponse', must b...
Sets eventResponse @param string $eventResponse event_response string @return $this
entailment
public function setPlanetType($planetType) { $allowed_values = array('temperate', 'barren', 'oceanic', 'ice', 'gas', 'lava', 'storm', 'plasma'); if ((!in_array($planetType, $allowed_values))) { throw new \InvalidArgumentException("Invalid value for 'planetType', must be one of 'temperate...
Sets planetType @param string $planetType planet_type string @return $this
entailment
public function findByUuid($uuid) { /** @var TaskInterface $task */ foreach ($this->taskCollection as $task) { if ($task->getUuid() === $uuid) { return $task; } } }
{@inheritdoc}
entailment
public function save(TaskInterface $task) { if ($this->taskCollection->contains($task)) { return $this; } $this->taskCollection->add($task); return $this; }
{@inheritdoc}
entailment
public function findAll($page = 1, $pageSize = null) { return array_values($this->taskCollection->slice(($page - 1) * $pageSize, $pageSize)); }
{@inheritdoc}
entailment
public function findEndBeforeNow() { $now = new \DateTime(); return array_values( $this->taskCollection->filter( function (TaskInterface $task) use ($now) { return $task->getLastExecution() === null || $task->getLastExecution() > $now; ...
{@inheritdoc}
entailment