_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q245900 | Container.getChainStrategy | validation | public function getChainStrategy()
{
$strategy = new ChainBuildStrategy();
$strategy->pushStrategy($this->getTravisCiStrategy());
$strategy->pushStrategy($this->getJoliCiStrategy());
return $strategy;
} | php | {
"resource": ""
} |
q245901 | Container.getConsoleLogger | validation | public function getConsoleLogger($verbose = false)
{
$logger = new Logger("standalone-logger");
$handler = new StreamHandler("php://stdout", $verbose ? Logger::DEBUG : Logger::INFO);
$simpleFormatter = new SimpleFormatter();
$handler->setFormatter($si... | php | {
"resource": ""
} |
q245902 | Message.send | validation | public function send()
{
$eventManager = $this->getManager()->getEventsManager();
if ($eventManager) {
$result = $eventManager->fire('mailer:beforeSend', $this);
} else {
$result = true;
}
if ($result === false) {
return false;
}
... | php | {
"resource": ""
} |
q245903 | Message.sendNow | validation | public function sendNow()
{
$config = $this->getManager()->getDI()->getConfig();
$message = $this->getMessage();
$username = $config->email->username;
$password = $config->email->password;
$host = $config->email->host;
$port = $config->email->port;
$transpor... | php | {
"resource": ""
} |
q245904 | Message.smtp | validation | public function smtp(array $params)
{
//validate the user params
if (!array_key_exists('username', $params)) {
throw new Exception('We need a username');
}
if (!array_key_exists('password', $params)) {
throw new Exception('We need a password');
}
... | php | {
"resource": ""
} |
q245905 | Message.setDynamicContent | validation | public function setDynamicContent(array $params, string $content)
{
$processed_content = preg_replace_callback(
'~\{(.*?)\}~si',
function ($match) use ($params) {
return str_replace($match[0], isset($params[$match[1]]) ? $params[$match[1]] : $match[0], $match[0]);
... | php | {
"resource": ""
} |
q245906 | Manager.createMessage | validation | public function createMessage()
{
$eventsManager = $this->getEventsManager();
if ($eventsManager) {
$eventsManager->fire('mailer:beforeCreateMessage', $this);
}
/** @var $message Message */
$message = $this->getDI()->get('\Baka\Mail\Message', [$this]);
if... | php | {
"resource": ""
} |
q245907 | Manager.configure | validation | protected function configure(array $config)
{
$this->config = $config;
$this->registerSwiftTransport();
$this->registerSwiftMailer();
$this->registerQueue();
} | php | {
"resource": ""
} |
q245908 | Manager.setRenderView | validation | public function setRenderView($viewPath, $params)
{
//Set volt tempalte enging and specify the cache path
$this->setViewEngines([
'.volt' => function ($view = null) {
$volt = new Volt($view);
$volt->setOptions([
'compiledPath' => APP_P... | php | {
"resource": ""
} |
q245909 | Generator.generate | validation | public function generate()
{
$this->beforeGeneration();
$this->config->getLogger()->startBreak('Class Generation');
foreach ($this->XSDMap as $fhirElementName => $mapEntry) {
$this->config->getLogger()->debug("Generating class for element {$fhirElementName}...");
$cl... | php | {
"resource": ""
} |
q245910 | Generator.beforeGeneration | validation | protected function beforeGeneration()
{
// Class props
$this->config->getLogger()->startBreak('XSD Parsing');
$this->XSDMap = XSDMapGenerator::buildXSDMap($this->config);
$this->config->getLogger()->endBreak('XSD Parsing');
// Initialize some classes and things.
$thi... | php | {
"resource": ""
} |
q245911 | Generator.afterGeneration | validation | protected function afterGeneration()
{
$this->mapTemplate->writeToFile();
$this->autoloadMap->writeToFile();
$responseParserTemplate = new ResponseParserTemplate($this->config);
$this->autoloadMap->addEntry(
$responseParserTemplate->getClassName(),
$responseP... | php | {
"resource": ""
} |
q245912 | BaseMethodTemplate.addBlockToBody | validation | public function addBlockToBody($block)
{
$this->body = array_merge($this->body, explode(PHP_EOL, $block));
} | php | {
"resource": ""
} |
q245913 | ViewCollection.setPaths | validation | public function setPaths(array $paths) : object
{
foreach ($paths as $path) {
if (!(is_dir($path) && is_readable($path))) {
throw new Exception("Directory '$path' is not readable.");
}
}
$this->paths = $paths;
return $this;
} | php | {
"resource": ""
} |
q245914 | ViewCollection.getTemplateFile | validation | public function getTemplateFile($template)
{
$file = $template . $this->suffix;
if (is_file($file)) {
return $file;
}
foreach ($this->paths as $path) {
$file = $path . "/" . $template . $this->suffix;
if (is_file($file)) {
return $... | php | {
"resource": ""
} |
q245915 | ViewCollection.addCallback | validation | public function addCallback($callback, $data = [], $region = "main", $sort = 0)
{
$view = new View();
$view->set(["callback" => $callback], $data, $sort, "callback");
$this->views[$region][] = $view;
return $this;
} | php | {
"resource": ""
} |
q245916 | ViewCollection.addString | validation | public function addString($content, $region = "main", $sort = 0)
{
$view = new View();
$view->set($content, [], $sort, "string");
$this->views[$region][] = $view;
return $this;
} | php | {
"resource": ""
} |
q245917 | ViewCollection.render | validation | public function render($region = "main")
{
if (!isset($this->views[$region])) {
return $this;
}
mergesort($this->views[$region], function ($viewA, $viewB) {
$sortA = $viewA->sortOrder();
$sortB = $viewB->sortOrder();
if ($sortA == $sortB) {
... | php | {
"resource": ""
} |
q245918 | ViewCollection.renderBuffered | validation | public function renderBuffered($region = "main")
{
ob_start();
$this->render($region);
$res = ob_get_contents();
ob_end_clean();
return $res;
} | php | {
"resource": ""
} |
q245919 | ViewRenderFile.render | validation | public function render(string $file, array $data) : void
{
if (!is_readable($file)) {
throw new Exception("Could not find template file: " . $this->template);
}
$di = $this->di;
$app = null;
if ($di->has("app")) {
$app = $di->get("app");
}
... | php | {
"resource": ""
} |
q245920 | View.set | validation | public function set($template, $data = [], $sort = 0, $type = "file")
{
if (empty($template)) {
$type = "empty";
} elseif (is_array($template)) {
if (isset($template["callback"])) {
$type = "callback";
$this->template = $template["callback"];
... | php | {
"resource": ""
} |
q245921 | View.render | validation | public function render(ContainerInterface $di = null)
{
switch ($this->type) {
case "file":
if ($di->has("viewRenderFile")) {
$viewRender = $di->get("viewRenderFile");
} else {
$viewRender = new ViewRenderFile($di);
... | php | {
"resource": ""
} |
q245922 | Timer.start | validation | public static function start(string $key = 'default'): void {
if (isset(self::$timers[$key])) {
self::$timers[$key]->start();
}
else {
self::$timers[$key] = new Stopwatch();
}
} | php | {
"resource": ""
} |
q245923 | Timer.formatTime | validation | private static function formatTime(float $value, $format): string {
switch ($format) {
case static::FORMAT_PRECISE:
return (string) ($value * 1000);
case static::FORMAT_MILLISECONDS:
return (string) round($value * 1000, 2);
case static::FORMAT_SECONDS:
return (string) ro... | php | {
"resource": ""
} |
q245924 | Timer.stop | validation | public static function stop($key = 'default'): void {
if (isset(self::$timers[$key])) {
self::$timers[$key]->stop();
} else {
throw new \LogicException('Stopping timer when the given key timer was not initialized.');
}
} | php | {
"resource": ""
} |
q245925 | Result.setValueNormalization | validation | public function setValueNormalization(bool $enabled = false)
{
if ($enabled === true) {
$this->initColumnConversions();
} else {
$this->toIntColumns = [];
$this->toFloatColumns = [];
$this->toStringColumns = [];
$this->toBoolColumns = [];
$this->toDateTimeColumns = [];
$this->toDriverColumns =... | php | {
"resource": ""
} |
q245926 | QueryBuilder.select | validation | public function select(?string $expression = null, ...$args): self
{
$this->dirty();
$this->select = $expression === null ? null : [$expression];
$this->args['select'] = $args;
return $this;
} | php | {
"resource": ""
} |
q245927 | QueryBuilder.addSelect | validation | public function addSelect(string $expression, ...$args): self
{
if (!is_string($expression)) {
throw new InvalidArgumentException('Select expression has to be a string.');
}
$this->dirty();
$this->select[] = $expression;
$this->pushArgs('select', $args);
return $this;
} | php | {
"resource": ""
} |
q245928 | QueryBuilder.where | validation | public function where(?string $expression = null, ...$args): self
{
$this->dirty();
$this->where = $expression;
$this->args['where'] = $args;
return $this;
} | php | {
"resource": ""
} |
q245929 | QueryBuilder.andWhere | validation | public function andWhere(string $expression, ...$args): self
{
$this->dirty();
$this->where = $this->where ? '(' . $this->where . ') AND (' . $expression . ')' : $expression;
$this->pushArgs('where', $args);
return $this;
} | php | {
"resource": ""
} |
q245930 | QueryBuilder.groupBy | validation | public function groupBy(?string $expression = null, ...$args): self
{
$this->dirty();
$this->group = $expression === null ? null : [$expression];
$this->args['group'] = $args;
return $this;
} | php | {
"resource": ""
} |
q245931 | QueryBuilder.addGroupBy | validation | public function addGroupBy($expression, ...$args): self
{
$this->dirty();
$this->group[] = $expression;
$this->pushArgs('group', $args);
return $this;
} | php | {
"resource": ""
} |
q245932 | QueryBuilder.having | validation | public function having(?string $expression = null, ...$args): self
{
$this->dirty();
$this->having = $expression;
$this->args['having'] = $args;
return $this;
} | php | {
"resource": ""
} |
q245933 | QueryBuilder.andHaving | validation | public function andHaving(string $expression, ...$args): self
{
$this->dirty();
$this->having = $this->having ? '(' . $this->having . ') AND (' . $expression . ')' : $expression;
$this->pushArgs('having', $args);
return $this;
} | php | {
"resource": ""
} |
q245934 | QueryBuilder.orderBy | validation | public function orderBy(?string $expression = null, ...$args): self
{
$this->dirty();
$this->order = $expression === null ? null : [$expression];
$this->args['order'] = $args;
return $this;
} | php | {
"resource": ""
} |
q245935 | QueryBuilder.addOrderBy | validation | public function addOrderBy(string $expression, ...$args): self
{
$this->dirty();
$this->order[] = $expression;
$this->pushArgs('order', $args);
return $this;
} | php | {
"resource": ""
} |
q245936 | QueryBuilder.limitBy | validation | public function limitBy(?int $limit, int $offset = null): self
{
$this->dirty();
$this->limit = $limit || $offset ? [$limit, $offset] : null;
return $this;
} | php | {
"resource": ""
} |
q245937 | CSRF.getToken | validation | public static function getToken($token_name = self::TOKEN_NAME)
{
if (empty($_SESSION[$token_name])) {
static::generateToken($token_name);
}
return $_SESSION[$token_name];
} | php | {
"resource": ""
} |
q245938 | CSRF.validate | validation | public static function validate($request_data = array(), $token_name = self::TOKEN_NAME)
{
if (empty($_SESSION[$token_name])) {
static::generateToken($token_name);
return false;
} elseif (empty($request_data[$token_name])) {
return false;
} else {
if(static::compare($request_data[$token_name], static... | php | {
"resource": ""
} |
q245939 | CSRF.compare | validation | public static function compare($hasha = "", $hashb = "")
{
// we want hashes_are_not_equal to be false by the end of this if the strings are identical
// if the strings are NOT equal length this will return true, else false
$hashes_are_not_equal = strlen($hasha) ^ strlen($hashb);
// compare the shortest of t... | php | {
"resource": ""
} |
q245940 | ZipArchive.errorInfo | validation | public function errorInfo()
{
static $statusStrings = array(
\ZipArchive::ER_OK => 'No error',
\ZipArchive::ER_MULTIDISK => 'Multi-disk zip archives not supported',
\ZipArchive::ER_RENAME => 'Renaming temporary file failed',
\ZipArchive::ER_CLO... | php | {
"resource": ""
} |
q245941 | CiconiaCommand.handleInput | validation | protected function handleInput(InputInterface $input)
{
if ($file = $input->getArgument('file')) {
if (!file_exists($file)) {
throw new \InvalidArgumentException(sprintf('The input file "%s" not found', $file));
}
return file_get_contents($file);
... | php | {
"resource": ""
} |
q245942 | CiconiaCommand.createCiconia | validation | protected function createCiconia(InputInterface $input)
{
if ($input->getOption('diagnose')) {
$ciconia = new \Ciconia\Diagnose\Ciconia();
} else {
$ciconia = new Ciconia();
}
if ($input->getOption('format') == 'xhtml') {
$ciconia->setRenderer(new... | php | {
"resource": ""
} |
q245943 | CiconiaCommand.runHelp | validation | protected function runHelp(InputInterface $input, OutputInterface $output)
{
/* @var HelpCommand $help */
$help = $this->getApplication()->find('help');
$help->setCommand($this);
$help->run($input, $output);
} | php | {
"resource": ""
} |
q245944 | CiconiaCommand.lint | validation | protected function lint(OutputInterface $output, Ciconia $ciconia, $content)
{
try {
$ciconia->render($content, array('strict' => true));
$output->writeln('No syntax errors detected.');
return 0;
} catch (SyntaxError $e) {
$output->writeln('<error>' .... | php | {
"resource": ""
} |
q245945 | Collection.get | validation | public function get($name)
{
if (!$this->exists($name)) {
throw new \OutOfBoundsException(sprintf('Undefined offset "%s"', $name));
}
return $this->objects[(string)$name];
} | php | {
"resource": ""
} |
q245946 | Collection.slice | validation | public function slice($offset, $length = null)
{
return new Collection(array_slice($this->objects, $offset, $length));
} | php | {
"resource": ""
} |
q245947 | Collection.each | validation | public function each(callable $callable)
{
foreach ($this->objects as $key => $value) {
if (false === call_user_func_array($callable, array($value, $key))) {
break;
}
}
return $this;
} | php | {
"resource": ""
} |
q245948 | InlineStyleExtension.processMultipleUnderScore | validation | public function processMultipleUnderScore(Text $text)
{
$text->replace('{<pre>.*?</pre>}m', function (Text $w) {
$md5 = md5($w);
$this->hashes[$md5] = $w;
return "{gfm-extraction-$md5}";
});
$text->replace('/^(?! {4}|\t)(\[?\w+_\w+_\w[\w_]*\]?)/', functi... | php | {
"resource": ""
} |
q245949 | LinkExtension.initialize | validation | public function initialize(Text $text, array $options = array())
{
/** @noinspection PhpUnusedParameterInspection */
$text->replace('{
^[ ]{0,' . $options['tabWidth'] . '}\[(.+)\]: # id = $1
[ \t]*
\n? # maybe *one* newline
[ \t]*... | php | {
"resource": ""
} |
q245950 | WhitespaceExtension.initialize | validation | public function initialize(Text $text)
{
$text->replaceString("\r\n", "\n");
$text->replaceString("\r", "\n");
$text->append("\n\n");
$this->markdown->emit('detab', array($text));
$text->replace('/^[ \t]+$/m', '');
} | php | {
"resource": ""
} |
q245951 | WhitespaceExtension.detab | validation | public function detab(Text $text, array $options = array())
{
/** @noinspection PhpUnusedParameterInspection */
$text->replace('/(.*?)\t/', function (Text $whole, Text $string) use ($options) {
return $string . str_repeat(' ', $options['tabWidth'] - $string->getLength() % $options['tabWi... | php | {
"resource": ""
} |
q245952 | Text.wrap | validation | public function wrap($start, $end)
{
$this->text = $start . $this->text . $end;
return $this;
} | php | {
"resource": ""
} |
q245953 | Text.escapeHtml | validation | public function escapeHtml($option = ENT_QUOTES)
{
$this->text = htmlspecialchars($this->text, $option, 'UTF-8', false);
return $this;
} | php | {
"resource": ""
} |
q245954 | Text.replace | validation | public function replace($pattern, $replacement)
{
if (is_callable($replacement)) {
$this->text = preg_replace_callback($pattern, function ($matches) use ($replacement) {
$args = array_map(function ($item) {
return new Text($item);
}, $matches);... | php | {
"resource": ""
} |
q245955 | Text.replaceString | validation | public function replaceString($search, $replace)
{
$this->text = str_replace($search, $replace, $this->text);
return $this;
} | php | {
"resource": ""
} |
q245956 | Text.split | validation | public function split($pattern, $flags = PREG_SPLIT_DELIM_CAPTURE)
{
return new Collection(
array_map(function ($item) {
return new static($item);
}, preg_split($pattern, $this->text, -1, $flags))
);
} | php | {
"resource": ""
} |
q245957 | EmitterTrait.on | validation | public function on($event, callable $callback, $priority = 10)
{
if (!isset($this->callbacks[$event])) {
$this->callbacks[$event] = [true, []];
}
$this->callbacks[$event][0] = false;
$this->callbacks[$event][1][] = array($priority, $callback);
return $this;
... | php | {
"resource": ""
} |
q245958 | EmitterTrait.emit | validation | public function emit($event, $parameters)
{
if (!isset($this->callbacks[$event])) {
return;
}
if (!$this->callbacks[$event][0]) {
usort($this->callbacks[$event][1], function ($A, $B) {
if ($A[0] == $B[0]) {
return 0;
... | php | {
"resource": ""
} |
q245959 | UrlAutoLinkExtension.processStandardUrl | validation | public function processStandardUrl(Text $text)
{
$hashes = array();
// escape <code>
$text->replace('{<code>.*?</code>}m', function (Text $w) use (&$hashes) {
$md5 = md5($w);
$hashes[$md5] = $w;
return "{gfm-extraction-$md5}";
});
$text-... | php | {
"resource": ""
} |
q245960 | AttributesExtension.processBlockTags | validation | public function processBlockTags(Tag $tag)
{
if ($tag->isInline()) {
return;
}
$text = null;
$tag->getText()->replace('/(^{([^:\(\)]+)}[ \t]*\n?|(?:[ \t]*|\n?){([^:\(\)]+)}\n*$)/', function (Text $w) use (&$text) {
$text = $w->trim()->trim('{}');
... | php | {
"resource": ""
} |
q245961 | HashRegistry.register | validation | public function register(Text $text)
{
$hash = $this->generateHash($text);
$this->set($hash, $text);
return new Text($hash);
} | php | {
"resource": ""
} |
q245962 | ListExtension.processListItems | validation | public function processListItems(Text $list, array $options = array(), $level = 0)
{
$list->replace('/\n{2,}\z/', "\n");
/** @noinspection PhpUnusedParameterInspection */
$list->replace('{
(\n)? # leading line = $1
(^[ \t]*) ... | php | {
"resource": ""
} |
q245963 | Tag.setText | validation | public function setText($text)
{
$this->text = $text;
if (!$this->text instanceof Text) {
$this->text = new Text($this->text);
}
return $this;
} | php | {
"resource": ""
} |
q245964 | Tag.setAttribute | validation | public function setAttribute($attribute, $value = null)
{
$this->attributes->set($attribute, $value);
return $this;
} | php | {
"resource": ""
} |
q245965 | Tag.render | validation | public function render()
{
$html = new Text();
$html
->append('<')
->append($this->getName());
foreach ($this->attributes as $name => $value) {
$html->append(' ')
->append($name)
->append('=')
->append('"')
... | php | {
"resource": ""
} |
q245966 | Inflector.addRule | validation | private function addRule($data, $ruleType)
{
if (\is_string($data))
{
$data = array($data);
}
elseif (!\is_array($data))
{
// Do not translate.
throw new InvalidArgumentException('Invalid inflector rule data.');
}
foreach ($data as $rule)
{
// Ensure a string is pushed.
array_push($this... | php | {
"resource": ""
} |
q245967 | Inflector.getCachedPlural | validation | private function getCachedPlural($singular)
{
$singular = StringHelper::strtolower($singular);
// Check if the word is in cache.
if (isset($this->cache[$singular]))
{
return $this->cache[$singular];
}
return false;
} | php | {
"resource": ""
} |
q245968 | Inflector.getCachedSingular | validation | private function getCachedSingular($plural)
{
$plural = StringHelper::strtolower($plural);
return array_search($plural, $this->cache);
} | php | {
"resource": ""
} |
q245969 | Inflector.setCache | validation | private function setCache($singular, $plural = null)
{
$singular = StringHelper::strtolower($singular);
if ($plural === null)
{
$plural = $singular;
}
else
{
$plural = StringHelper::strtolower($plural);
}
$this->cache[$singular] = $plural;
} | php | {
"resource": ""
} |
q245970 | Inflector.isSingular | validation | public function isSingular($word)
{
// Try the cache for a known inflection.
$inflection = $this->getCachedPlural($word);
if ($inflection !== false)
{
return true;
}
$pluralWord = $this->toPlural($word);
if ($pluralWord === false)
{
return false;
}
// Compute the inflection to cache the v... | php | {
"resource": ""
} |
q245971 | StringHelper.transcode | validation | public static function transcode($source, $fromEncoding, $toEncoding)
{
if (\is_string($source))
{
switch (ICONV_IMPL)
{
case 'glibc':
return @iconv($fromEncoding, $toEncoding . '//TRANSLIT,IGNORE', $source);
case 'libiconv':
default:
return iconv($fromEncoding, $toEncoding . '//IGNORE... | php | {
"resource": ""
} |
q245972 | StringHelper.unicode_to_utf16 | validation | public static function unicode_to_utf16($str)
{
if (\extension_loaded('mbstring'))
{
return preg_replace_callback(
'/\\\\u([0-9a-fA-F]{4})/',
function ($match)
{
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UTF-16BE');
},
$str
);
}
return $str;
} | php | {
"resource": ""
} |
q245973 | WP_Session.set_expiration | validation | protected function set_expiration() {
$this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 );
$this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
} | php | {
"resource": ""
} |
q245974 | WP_Session.set_cookie | validation | protected function set_cookie() {
@setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant, $this->expires, COOKIEPATH, COOKIE_DOMAIN );
} | php | {
"resource": ""
} |
q245975 | WP_Session.write_data | validation | public function write_data() {
$option_key = "_wp_session_{$this->session_id}";
// Only write the collection to the DB if it's changed.
if ( $this->dirty ) {
if ( false === get_option( $option_key ) ) {
add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' );
add_option( "_wp_sessio... | php | {
"resource": ""
} |
q245976 | WP_Session.regenerate_id | validation | public function regenerate_id( $delete_old = false ) {
if ( $delete_old ) {
delete_option( "_wp_session_{$this->session_id}" );
}
$this->session_id = $this->generate_id();
$this->set_cookie();
} | php | {
"resource": ""
} |
q245977 | CollectAsynchronousEventNames.process | validation | public function process(ContainerBuilder $container)
{
$serviceId = 'simple_bus.asynchronous.publishes_predefined_messages_middleware';
if (!$container->hasDefinition($serviceId)) {
return;
}
$names = array();
$this->collectServiceIds(
$container,
... | php | {
"resource": ""
} |
q245978 | Mailer.sendException | validation | public function sendException(Request $request, \Exception $exception)
{
if (!$this->enabled) {
return;
}
$serverParams = $request->server->all();
if (isset($serverParams['PHP_AUTH_PW'])) {
$serverParams['PHP_AUTH_PW'] = '*****';
}
$message =... | php | {
"resource": ""
} |
q245979 | Exceptions.onKernelException | validation | public function onKernelException(GetResponseForExceptionEvent $event)
{
if ($this->isIgnored($event->getException())) {
return;
}
if ($this->mailer) {
$this->mailer->sendException($event->getRequest(), $event->getException());
}
if ($this->statsd) {
... | php | {
"resource": ""
} |
q245980 | GdprOptinModule.clearTmp | validation | public static function clearTmp($clearFolderPath = '')
{
$folderPath = self::_getFolderToClear($clearFolderPath);
$directoryHandler = opendir($folderPath);
if (!empty($directoryHandler)) {
while (false !== ($fileName = readdir($directoryHandler))) {
$filePath = $... | php | {
"resource": ""
} |
q245981 | GdprOptinModule._clear | validation | protected static function _clear($fileName, $filePath)
{
if (!in_array($fileName, ['.', '..', '.gitkeep', '.htaccess'])) {
if (is_file($filePath)) {
@unlink($filePath);
} else {
self::clearTmp($filePath);
}
}
} | php | {
"resource": ""
} |
q245982 | SoclozMonitoringExtension.createProfilerProbes | validation | private function createProfilerProbes($name, ContainerBuilder $container)
{
$key = sprintf("socloz_monitoring.profiler.probe.definition.%s", $name);
if ($container->hasParameter($key)) {
$definition = $container->getParameter($key);
return array($this->createProbeDefinition(... | php | {
"resource": ""
} |
q245983 | ReviewController.isReviewOptInValidationRequired | validation | public function isReviewOptInValidationRequired()
{
return (bool)\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam(self::REVIEW_OPTIN_PARAM);
} | php | {
"resource": ""
} |
q245984 | ReviewController.validateOptIn | validation | public function validateOptIn()
{
$optInValue = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('rvw_oegdproptin');
if ($this->isReviewOptInValidationRequired() && !$optInValue) {
return false;
}
return true;
} | php | {
"resource": ""
} |
q245985 | ReviewController.isReviewOptInError | validation | public function isReviewOptInError()
{
$formSent = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('rvw_oegdproptin') !== null;
$review = oxNew(\OxidEsales\Eshop\Application\Controller\ReviewController::class);
$result = false;
if ($formSent && !$review->validateOp... | php | {
"resource": ""
} |
q245986 | Review.isReviewOptInValidationRequired | validation | public function isReviewOptInValidationRequired()
{
$review = oxNew(\OxidEsales\Eshop\Application\Controller\ReviewController::class);
return $review->isReviewOptInValidationRequired();
} | php | {
"resource": ""
} |
q245987 | Review.isReviewOptInError | validation | public function isReviewOptInError()
{
$review = oxNew(\OxidEsales\Eshop\Application\Controller\ReviewController::class);
return $review->isReviewOptInError();
} | php | {
"resource": ""
} |
q245988 | Plan.listPlans | validation | public function listPlans(array $filters = [], bool $withAddons = true, string $addonType = null): array
{
$cacheKey = 'plans';
$hit = $this->getFromCache($cacheKey);
if (false === $hit) {
$response = $this->sendRequest('GET', 'plans');
$plans = $this->processRespon... | php | {
"resource": ""
} |
q245989 | Plan.getPlan | validation | public function getPlan(string $planCode): array
{
$cacheKey = sprintf('plan_%s', $planCode);
$hit = $this->getFromCache($cacheKey);
if (false === $hit) {
$response = $this->sendRequest('GET', sprintf('plans/%s', $planCode));
$data = $this->processResponse($response... | php | {
"resource": ""
} |
q245990 | Plan.getAddonsForPlan | validation | public function getAddonsForPlan(array $plans, string $addonType = null): array
{
$addonApi = new Addon($this->token, $this->organizationId, $this->cache, $this->ttl);
foreach ($plans as &$plan) {
$addons = [];
foreach ($plan['addons'] as $planAddon) {
$addo... | php | {
"resource": ""
} |
q245991 | Plan.filterPlans | validation | public function filterPlans(array $plans, array $filters): array
{
foreach ($filters as $key => $filter) {
if (array_key_exists($key, current($plans))) {
$plans = array_filter($plans, function ($element) use ($key, $filter) {
return $element[$key] == $filter;
... | php | {
"resource": ""
} |
q245992 | Plan.getPriceByPlanCode | validation | public function getPriceByPlanCode(string $planCode): float
{
$plan = $this->getPlan($planCode);
return (array_key_exists('recurring_price', $plan)) ? $plan['recurring_price'] : 0;
} | php | {
"resource": ""
} |
q245993 | ContactController.send | validation | public function send()
{
$optInValue = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('c_oegdproptin');
if ($this->isOptInValidationRequired() && !$optInValue) {
\OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\UtilsView::class)->addErrorToDisplay('OEGDPROPT... | php | {
"resource": ""
} |
q245994 | ContactController.getContactFormMethod | validation | private function getContactFormMethod()
{
$method = self::CONTACT_FORM_METHOD_DEFAULT;
if ($configMethod = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('OeGdprOptinContactFormMethod')) {
$method = $configMethod;
}
return $method;
} | php | {
"resource": ""
} |
q245995 | Xhprof.startProfiling | validation | public function startProfiling()
{
if (PHP_SAPI == 'cli') {
$_SERVER['REMOTE_ADDR'] = null;
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
}
if (function_exists('xhprof_enable') && count($this->probes) > 0) {
$this->profiling = true;
xhpro... | php | {
"resource": ""
} |
q245996 | Xhprof.stopProfiling | validation | public function stopProfiling()
{
if (!$this->profiling) {
return false;
}
$this->profiling = false;
$xhprof_data = xhprof_disable();
if (is_array($xhprof_data)) {
$this->parser->parse($xhprof_data);
}
foreach ($this->probes as $probe) ... | php | {
"resource": ""
} |
q245997 | MailerTransformer.transform | validation | public function transform($value)
{
if ($value instanceof \Traversable || is_array($value)) {
return $this->transformIterable($value);
}
if (is_bool($value)) {
return $this->transformBoolean($value);
}
if (is_scalar($value) || (is_object($value) && m... | php | {
"resource": ""
} |
q245998 | MailerTransformer.transformIterable | validation | protected function transformIterable($value)
{
$params = array();
foreach ($value as $key => $val) {
if (!empty($val)) {
$params[$key] = $this->transform($val);
}
}
return $params;
} | php | {
"resource": ""
} |
q245999 | MailerTransformer.transformCacheAnnotation | validation | protected function transformCacheAnnotation(Cache $cache)
{
return array(
'expires' => $cache->getExpires(),
'maxage' => $cache->getMaxAge(),
'smaxage' => $cache->getSMaxAge(),
'public' => $this->transformBoolean($cache->isPublic()),
'vary' => $cac... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.