_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q267900 | OneOfFilter.matches | test | public function matches(array $data)
{
foreach ($this->filters as $filter) {
if ($filter($data)) {
return true;
}
}
return false;
} | php | {
"resource": ""
} |
q267901 | ConfigurableSchema.createTablesFromConfig | test | public function createTablesFromConfig($config)
{
try{
foreach ($config as $tableName => $className
) {
$this->_addTable(new $className($tableName));
}
} catch(\Exception $e) {
throw $e;
}
return $this;
} | php | {
"resource": ""
} |
q267902 | ConfigurableSchema.bundleMultipleSchemas | test | public function bundleMultipleSchemas($config)
{
foreach ($config as $alias => $schemaClassName) {
$schema = new $schemaClassName();
$this->_tables = array_merge($this->getTables(), $schema->getTables());
}
return $this;
} | php | {
"resource": ""
} |
q267903 | AbstractGeometricObject.getPoint | test | public function getPoint($name)
{
return isset($this->_points[$name]) ? $this->_points[$name] : null;
} | php | {
"resource": ""
} |
q267904 | ProvidesCommand.publish | test | public static function publish(Application $app): void
{
$app->console()->addCommand(
(new Command())
->setPath(static::PATH)
->setName(static::COMMAND)
->setDescription(static::SHORT_DESCRIPTION)
->setClass(static::class)
)... | php | {
"resource": ""
} |
q267905 | LeafRestUrlHandler.getMatchingUrlFragment | test | protected function getMatchingUrlFragment(Request $request, $currentUrlFragment = "")
{
$uri = $currentUrlFragment;
$parentResponse = parent::getMatchingUrlFragment($request, $currentUrlFragment);
if (preg_match('|^' . $this->url . '([0-9]+)/([a-zA-Z0-9\-]+)|', $uri, $matches)) {
... | php | {
"resource": ""
} |
q267906 | LeafRestUrlHandler.generateResponseForRequest | test | protected function generateResponseForRequest($request = null)
{
$leafClass = $this->getLeafClassName();
if ($this->isCollection()) {
$leaf = new $leafClass($this->getModelCollection());
} else {
if (is_callable($leafClass)){
$leaf = $leafClass($this,... | php | {
"resource": ""
} |
q267907 | PEAR_REST.retrieveCacheFirst | test | function retrieveCacheFirst($url, $accept = false, $forcestring = false, $channel = false)
{
$cachefile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR .
md5($url) . 'rest.cachefile';
if (file_exists($cachefile)) {
return unserialize(implode('', file($cachefile)));
... | php | {
"resource": ""
} |
q267908 | StringHelper.endsWith | test | public static function endsWith($string, $with, $caseSensitive = true, $encoding = null)
{
if (!$bytes = static::byteLength($with)) {
return true;
}
if ($caseSensitive) {
// Warning check, see http://php.net/manual/en/function.substr-compare.php#refsect1-function.subs... | php | {
"resource": ""
} |
q267909 | StringHelper.countWords | test | public static function countWords($string)
{
$result = preg_split('/\s+/u', $string, null, PREG_SPLIT_NO_EMPTY);
return !empty($result) ? count($result) : 0;
} | php | {
"resource": ""
} |
q267910 | CreateActingAs.createActingAs | test | protected function createActingAs(array $properties = [], string $userModel = null): Authenticatable
{
$userClass = $userModel ?: config('auth.providers.users.model');
$this->actingAs = factory($userClass)->create($properties);
$this->actingAs($this->actingAs);
return $this->actingA... | php | {
"resource": ""
} |
q267911 | Session.init | test | public function init()
{
parent::init();
$self = $this;
//Close session on end of request
$this->app->once(Reaction\RequestApplicationInterface::EVENT_REQUEST_END, function() use (&$self) {
return $self->close();
});
if ($this->getIsActive()) {
... | php | {
"resource": ""
} |
q267912 | Session.open | test | public function open()
{
if ($this->getIsActive()) {
return \Reaction\Promise\resolve(true);
}
$this->registerSessionHandler();
$self = $this;
return $this->openInternal()->then(
function() use ($self) {
if (Reaction::isDebug()) {
... | php | {
"resource": ""
} |
q267913 | Session.openInternal | test | protected function openInternal()
{
$self = $this;
if (!$this->getId()) {
$self = $this;
return $this->handler->createId($this->app)
->then(function($id = null) use ($self) {
$self->_isActive = true;
$self->setId($id);
... | php | {
"resource": ""
} |
q267914 | Session.registerSessionHandler | test | protected function registerSessionHandler()
{
if ($this->handler !== null) {
if (!is_object($this->handler)) {
if (is_string($this->handler) && Reaction::$app->has($this->handler)) {
$this->handler = Reaction::$app->get($this->handler);
} else ... | php | {
"resource": ""
} |
q267915 | Session.close | test | public function close($destroy = false)
{
if ($this->getIsActive()) {
if (Reaction::isDebug()) {
//Reaction::info('Session closed');
}
return $destroy || $this->isEmpty() ? $this->destroySession() : $this->writeSession();
}
$this->_isActive... | php | {
"resource": ""
} |
q267916 | Session.destroy | test | public function destroy()
{
if ($this->getIsActive()) {
$sessionId = $this->getId();
return $this->close(true)
->otherwise(function() { return true; })
->then(function() use ($sessionId) {
$this->setId($sessionId);
... | php | {
"resource": ""
} |
q267917 | Session.regenerateID | test | public function regenerateID($deleteOldSession = false)
{
if ($this->getIsActive()) {
return $this->handler->regenerateId($this->id, $this->app, $deleteOldSession);
}
return \Reaction\Promise\reject(new Reaction\Exceptions\SessionException('Session is not active'));
} | php | {
"resource": ""
} |
q267918 | Session.readSession | test | public function readSession($id = null)
{
$id = !isset($id) && isset($this->_sessionId) ? $this->_sessionId : $id;
if (!isset($id)) {
return \Reaction\Promise\reject(new Reaction\Exceptions\ErrorException('Param "$id" must be specified in "' . __METHOD__ . '"'));
}
return... | php | {
"resource": ""
} |
q267919 | Session.writeSession | test | public function writeSession($data = null, $id = null)
{
$id = !isset($id) && isset($this->_sessionId) ? $this->_sessionId : $id;
if (!isset($id)) {
return \Reaction\Promise\reject(new Reaction\Exceptions\ErrorException('Param "$id" must be specified in "' . __METHOD__ . '"'));
}... | php | {
"resource": ""
} |
q267920 | Session.destroySession | test | public function destroySession($id = null)
{
$id = !isset($id) && isset($this->_sessionId) ? $this->_sessionId : $id;
if (!isset($id)) {
return \Reaction\Promise\reject(new Reaction\Exceptions\ErrorException('Param "$id" must be specified in "' . __METHOD__ . '"'));
}
ret... | php | {
"resource": ""
} |
q267921 | Session.set | test | public function set($key, $value)
{
$this->open();
$data = $this->data;
$data[$key] = $value;
$this->data = $data;
} | php | {
"resource": ""
} |
q267922 | Session.remove | test | public function remove($key)
{
$this->open();
$data = $this->data;
if (isset($data[$key])) {
unset($data[$key]);
}
$this->data = $data;
} | php | {
"resource": ""
} |
q267923 | Session.removeAll | test | public function removeAll()
{
$this->open();
$data = $this->data;
foreach (array_keys($data) as $key) {
unset($data[$key]);
}
$this->data = $data;
return $this->writeSession();
} | php | {
"resource": ""
} |
q267924 | Session.getFlash | test | public function getFlash($key, $defaultValue = null, $delete = false)
{
$counters = $this->get($this->flashParam, []);
if (isset($counters[$key])) {
$value = $this->get($key, $defaultValue);
if ($delete) {
$this->removeFlash($key);
} elseif ($count... | php | {
"resource": ""
} |
q267925 | Session.getAllFlashes | test | public function getAllFlashes($delete = false)
{
$counters = $this->get($this->flashParam, []);
$flashes = [];
foreach (array_keys($counters) as $key) {
if (array_key_exists($key, $this->data)) {
$flashes[$key] = $this->data[$key];
if ($delete) {
... | php | {
"resource": ""
} |
q267926 | Session.setFlash | test | public function setFlash($key, $value = true, $removeAfterAccess = true)
{
$counters = $this->get($this->flashParam, []);
$counters[$key] = $removeAfterAccess ? -1 : 0;
$this->data[$key] = $value;
$this->data[$this->flashParam] = $counters;
} | php | {
"resource": ""
} |
q267927 | Session.addFlash | test | public function addFlash($key, $value = true, $removeAfterAccess = true)
{
$counters = $this->get($this->flashParam, []);
$counters[$key] = $removeAfterAccess ? -1 : 0;
$this->data[$this->flashParam] = $counters;
if (empty($this->data[$key])) {
$this->data[$key] = [$value... | php | {
"resource": ""
} |
q267928 | Session.removeFlash | test | public function removeFlash($key)
{
$counters = $this->get($this->flashParam, []);
$value = isset($this->data[$key], $counters[$key]) ? $this->data[$key] : null;
unset($counters[$key], $this->data[$key]);
$this->data[$this->flashParam] = $counters;
return $value;
} | php | {
"resource": ""
} |
q267929 | Session.removeAllFlashes | test | public function removeAllFlashes()
{
$counters = $this->get($this->flashParam, []);
foreach (array_keys($counters) as $key) {
unset($this->data[$key]);
}
unset($this->data[$this->flashParam]);
} | php | {
"resource": ""
} |
q267930 | Session.freeze | test | protected function freeze()
{
if ($this->getIsActive()) {
if (isset($this->data)) {
$this->frozenSessionData = $this->data;
}
//$this->close();
if (Reaction::isDebug()) {
Reaction::info('Session frozen');
}
}... | php | {
"resource": ""
} |
q267931 | Session.unfreeze | test | protected function unfreeze()
{
if (null !== $this->frozenSessionData) {
//$this->open();
if ($this->getIsActive()) {
Reaction::info('Session unfrozen');
} else {
$error = error_get_last();
$message = isset($error['message... | php | {
"resource": ""
} |
q267932 | Session.createSessionCookie | test | protected function createSessionCookie() {
$_params = $this->getCookieParams();
$config = [
'class' => 'Reaction\Web\Cookie',
];
foreach ($_params as $key => $value) {
if ($key === 'httponly') {
$key = 'httpOnly';
} elseif ($key === 'li... | php | {
"resource": ""
} |
q267933 | Validator._validateAfter | test | protected function _validateAfter($attribute, $value, $parameters)
{
$this->_requireParameterCount(1, $parameters, 'after');
if (! is_string($value)) {
return false;
}
if ($format = $this->_getDateFormat($attribute)) {
return $this->_validateAfterWithFormat(... | php | {
"resource": ""
} |
q267934 | Validator._validateAfterWithFormat | test | protected function _validateAfterWithFormat($format, $value, $parameters)
{
$param = $this->_getValue($parameters[0]) ?: $parameters[0];
return $this->_checkDateTimeOrder($format, $param, $value);
} | php | {
"resource": ""
} |
q267935 | Validator._validateDateFormat | test | protected function _validateDateFormat($attribute, $value, $parameters)
{
$this->_requireParameterCount(1, $parameters, 'date_format');
if (! is_string($value)) {
return false;
}
$parsed = date_parse_from_format($parameters[0], $value);
return $parsed['error_co... | php | {
"resource": ""
} |
q267936 | NamespaceProphecy.checkPredictions | test | public function checkPredictions()
{
$exception = new AggregateException(sprintf("%s:\n", $this->name));
foreach ($this->prophecies as $prophecy) {
try {
$prophecy->checkPrediction();
} catch (PredictionException $e) {
$exception->append($e);
... | php | {
"resource": ""
} |
q267937 | AssignByPath.assign | test | function assign(array &$arr, string $path, $value, string $separator = '.')
{
$keys = explode($separator, $path);
foreach ($keys as $key) {
$arr = &$arr[$key];
}
$arr = $value;
} | php | {
"resource": ""
} |
q267938 | Module.getControllerPluginConfig | test | public function getControllerPluginConfig()
{
return [
'factories' => [
'resource' => function(\Zend\Mvc\Controller\PluginManager $sm) {
$event = new ResourceEvent();
$event->setIdentity($sm->getServiceLocator()->get('api-identity')... | php | {
"resource": ""
} |
q267939 | BaseManager.executeRule | test | protected function executeRule($user, $item, $params)
{
if ($item->ruleName === null) {
return resolve(true);
}
return $this->getRule($item->ruleName)->then(
function($rule) use ($user, $item, $params) {
if ($rule instanceof Rule) {
... | php | {
"resource": ""
} |
q267940 | PEAR_PackageFile_Generator_v1._processMultipleDepsName | test | function _processMultipleDepsName($deps)
{
$ret = $tests = array();
foreach ($deps as $name => $dep) {
foreach ($dep as $d) {
$tests[$name][] = $this->_processDep($d);
}
}
foreach ($tests as $name => $test) {
$max = $min = $php = a... | php | {
"resource": ""
} |
q267941 | Fragment.parseFragments | test | public static function parseFragments(array $rawData = [])
{
$fragments = [];
foreach ($rawData as $type => $value) {
// Skipp Custom values
if(!is_array($value)) continue;
$fragments[] = RichText::asHtml($value);
}
return $fragments;
} | php | {
"resource": ""
} |
q267942 | PhpView.make | test | public function make(string $template = null, array $variables = []): View
{
return new static($this->app, $template, $variables);
} | php | {
"resource": ""
} |
q267943 | PhpView.setVariables | test | public function setVariables(array $variables = []): View
{
$this->variables = array_merge($this->variables, $variables);
return $this;
} | php | {
"resource": ""
} |
q267944 | PhpView.setVariable | test | public function setVariable(string $key, $value): View
{
$this->variables[$key] = $value;
return $this;
} | php | {
"resource": ""
} |
q267945 | PhpView.escape | test | public function escape(string $value): string
{
$value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
$value = htmlentities($value, ENT_QUOTES, 'UTF-8');
return $value;
} | php | {
"resource": ""
} |
q267946 | PhpView.getTemplateDir | test | public function getTemplateDir(string $path = null): string
{
return $this->templateDir . ($path
? Directory::DIRECTORY_SEPARATOR . $path
: $path);
} | php | {
"resource": ""
} |
q267947 | PhpView.layout | test | public function layout(string $layout = null): View
{
// If no layout has been set
if (null === $layout) {
// Set to null
return $this->withoutLayout();
}
// If we should be tracking layout changes
if ($this->trackLayoutChanges) {
// Set t... | php | {
"resource": ""
} |
q267948 | PhpView.template | test | public function template(string $template): View
{
$this->template = $template;
$this->templatePath = $this->getFullPath($template);
return $this;
} | php | {
"resource": ""
} |
q267949 | PhpView.partial | test | public function partial(string $partial, array $variables = []): string
{
return $this->renderTemplate($this->getFullPath($partial), $variables);
} | php | {
"resource": ""
} |
q267950 | PhpView.endBlock | test | public function endBlock(string $name): string
{
unset($this->blockStatus[$name]);
return $this->blocks[$name] = ob_get_clean();
} | php | {
"resource": ""
} |
q267951 | PhpView.render | test | public function render(array $variables = []): string
{
// Set the variables with the new variables and this view instance
$this->variables = array_merge(
$this->variables,
$variables,
['view' => $this]
);
// Render the template
$template ... | php | {
"resource": ""
} |
q267952 | PhpView.getFullPath | test | protected function getFullPath(string $template): string
{
// If the first character of the template is an @ symbol
// Then this is a template from a path in the config
if (strpos($template, '@') === 0) {
$explodeOn = Directory::DIRECTORY_SEPARATOR;
$parts = explo... | php | {
"resource": ""
} |
q267953 | PhpView.renderTemplate | test | protected function renderTemplate(string $templatePath, array $variables = []): string
{
$variables = array_merge($this->variables, $variables);
extract($variables, EXTR_OVERWRITE);
ob_start();
include $templatePath;
return ob_get_clean();
} | php | {
"resource": ""
} |
q267954 | PhpView.renderLayout | test | protected function renderLayout(string $layoutPath): string
{
// Render the layout
$renderedLayout = $this->renderTemplate($layoutPath);
// Check if the layout has changed
if ($this->hasLayoutChanged) {
// Reset the flag
$this->hasLayoutChanged = false;
... | php | {
"resource": ""
} |
q267955 | RoutesListCommand.setRoute | test | protected function setRoute(Route $route, array &$routes, array &$lengths): void
{
$requestMethod = implode(' | ', $route->getRequestMethods());
$dispatch = 'Closure';
if (null !== $route->getFunction()) {
$dispatch = $route->getFunction();
} elseif (null !== $route... | php | {
"resource": ""
} |
q267956 | RoutesListCommand.getSepLine | test | protected function getSepLine(array $lengths): string
{
return '+-' . str_repeat('-', $lengths[0])
. '-+-' . str_repeat('-', $lengths[1])
. '-+-' . str_repeat('-', $lengths[2])
. '-+-' . str_repeat('-', $lengths[3])
. '-+';
} | php | {
"resource": ""
} |
q267957 | RoutesListCommand.headerMessage | test | protected function headerMessage(array $headerTexts, array $lengths): void
{
$headerMessage = '| ' . $headerTexts[0]
. str_repeat(' ', $lengths[0] - \strlen($headerTexts[0]))
. ' | ' . $headerTexts[1]
. str_repeat(' ', $lengths[1] - \strlen($headerTexts[1]))
.... | php | {
"resource": ""
} |
q267958 | Factory.getNotification | test | public static function getNotification()
{
$notificationClassList = ClassMapGenerator::createMap(base_path().'/vendor/abuseio');
/** @noinspection PhpUnusedParameterInspection */
$notificationClassListFiltered = array_where(
array_keys($notificationClassList),
functio... | php | {
"resource": ""
} |
q267959 | Factory.create | test | public static function create($requiredName)
{
/**
* Loop through the notification list and try to find a match by name
*/
$notifications = Factory::getNotification();
foreach ($notifications as $notificationName) {
if ($notificationName === ucfirst($requiredNa... | php | {
"resource": ""
} |
q267960 | UploadableTrait.setKey | test | public function setKey($key)
{
$this->key = $key;
if (0 < strlen($this->key) && !$this->hasRename()) {
if ($this->hasPath()) {
$this->rename = pathinfo($this->path, PATHINFO_BASENAME);
} else {
$this->rename = pathinfo($this->key, PATHINFO_BAS... | php | {
"resource": ""
} |
q267961 | UploadableTrait.shouldBeRenamed | test | public function shouldBeRenamed()
{
return (bool) ($this->hasPath() && $this->guessFilename() != pathinfo($this->getPath(), PATHINFO_BASENAME));
} | php | {
"resource": ""
} |
q267962 | UploadableTrait.guessExtension | test | public function guessExtension()
{
$extension = null;
if ($this->hasFile()) {
$extension = $this->file->guessExtension();
} elseif ($this->hasKey()) {
$extension = pathinfo($this->getKey(), PATHINFO_EXTENSION);
} elseif ($this->hasPath()) {
$extens... | php | {
"resource": ""
} |
q267963 | UploadableTrait.guessFilename | test | public function guessFilename()
{
// Extension
$extension = $this->guessExtension();
// Filename
$filename = null;
if ($this->hasRename()) {
$filename = Transliterator::urlize(pathinfo($this->rename, PATHINFO_FILENAME));
} elseif ($this->hasFile()) {
... | php | {
"resource": ""
} |
q267964 | UploadableTrait.setRename | test | public function setRename($rename)
{
if ($rename !== $this->rename) {
$this->updatedAt = new \DateTime();
}
$this->rename = strtolower($rename);
return $this;
} | php | {
"resource": ""
} |
q267965 | FileController.downloadAction | test | public function downloadAction(Request $request)
{
$key = $request->attributes->get('key');
if (0 < strlen($key)) {
$fs = $this->get('local_upload_filesystem');
if ($fs->has($key)) {
$file = $fs->get($key);
// TODO 304 not modified
... | php | {
"resource": ""
} |
q267966 | FileController.tinymceUploadAction | test | public function tinymceUploadAction(Request $request)
{
// TODO check admin ?
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$name = $request->request->get('name');
$base64 = $request->request->get('data');
$filename = md5(tim... | php | {
"resource": ""
} |
q267967 | KernelEventSubscriber.onKernelException | test | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
if ($exception instanceof NotFoundHttpException) {
$request = $event->getRequest();
$registry = $this->container->get('ekyna_core.redirection.provider_registry');
... | php | {
"resource": ""
} |
q267968 | Download.getCurl | test | private function getCurl(string $url, int $return = 1, int $timeout = 10, string $lang = 'de-DE')
{
// Define useragent
$agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ' . $lang . '; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
// Url encode
$url = urlencode($url);
... | php | {
"resource": ""
} |
q267969 | Http.execute | test | public function execute() {
if ($this->isMulti) {
return;
}
$this->applyMethod();
$this->responseText = curl_exec($this->curl);
self::log('HTTP RESPONSE: '.$this->responseText);
return $this->parseResponse();
} | php | {
"resource": ""
} |
q267970 | Http.setCookieFile | test | public function setCookieFile($file) {
$file = (string)$file;
return $this->setOption(CURLOPT_COOKIEJAR, $file)
->setOption(CURLOPT_COOKIEFILE, $file);
} | php | {
"resource": ""
} |
q267971 | Http.chooseParameters | test | protected static function chooseParameters(array $item, array $args) {
$data = static::getMapParameters($item, $args);
if (empty($data)) {
throw new Exception('ONE OF MANY IS NEED!');
}
return $data;
} | php | {
"resource": ""
} |
q267972 | ItemController.actionIndex | test | public function actionIndex()
{
$items = Item::updateAll(Yii::$app->request->post('Item'));
if ($items === true) {
Yii::$app->session->setFlash('info', Yii::t('modules/module', 'Updated'));
return $this->refresh();
} else if (!$items) {
$items = Item::find... | php | {
"resource": ""
} |
q267973 | Alert.initOptions | test | protected function initOptions()
{
$this->htmlHlp->addCssClass($this->options, ['alert']);
if ($this->closeButton !== false) {
$this->htmlHlp->addCssClass($this->options, ['alert-dismissible', 'fade', 'show']);
$this->closeButton = array_merge([
'data-dismiss... | php | {
"resource": ""
} |
q267974 | Zend_Config_Writer_FileAbstract.write | test | public function write($filename = null, Zend_Config $config = null, $exclusiveLock = null)
{
if ($filename !== null) {
$this->setFilename($filename);
}
if ($config !== null) {
$this->setConfig($config);
}
if ($exclusiveLock !== null) {
$t... | php | {
"resource": ""
} |
q267975 | ExceptionExtractorTrait.getExceptionFromContext | test | protected function getExceptionFromContext(array $context)
{
$exception = $context['exception'] ?? null;
if ($exception instanceof \Exception) {
return $exception;
}
if ($exception instanceof \Error) {
return new \ErrorException(
$exception->... | php | {
"resource": ""
} |
q267976 | ErrorHandler.convertExceptionToArray | test | protected function convertExceptionToArray($exception)
{
if (!Reaction::isDebug() && !$exception instanceof UserException && !$exception instanceof HttpException) {
$exception = new HttpException(500, Reaction::t('rct', 'An internal server error occurred.'));
}
$array = [
... | php | {
"resource": ""
} |
q267977 | ErrorHandler.renderFile | test | public function renderFile($_file_, $_params_)
{
$_params_['handler'] = $this;
if ($this->exception instanceof ErrorException || !$this->app->has('view')) {
ob_start();
ob_implicit_flush(false);
extract($_params_, EXTR_OVERWRITE);
require Reaction::get... | php | {
"resource": ""
} |
q267978 | ErrorHandler.isCoreFile | test | public function isCoreFile($file)
{
$corePath = Reaction::getAlias('@reaction');
return $file === null || strpos(realpath($file), $corePath . DIRECTORY_SEPARATOR) === 0;
} | php | {
"resource": ""
} |
q267979 | ErrorHandler.getExceptionName | test | public function getExceptionName($exception)
{
if (
$exception instanceof \Reaction\Exceptions\Exception
|| $exception instanceof \Reaction\Exceptions\InvalidCallException
|| $exception instanceof \Reaction\Exceptions\InvalidParamException
|| $exception instan... | php | {
"resource": ""
} |
q267980 | minifyHTMLResponsePlugin.beforeOutput | test | public function beforeOutput() {
if (!($this->response instanceof jResponseHtml))
return;
$conf = &jApp::config()->jResponseHtml;
$basePath = jApp::urlBasePath();
if (isset($conf['minifyCSS']) && $conf['minifyCSS']) {
if (isset($conf['minifyExcludeCSS']) && $conf... | php | {
"resource": ""
} |
q267981 | minifyHTMLResponsePlugin.generateMinifyList | test | protected function generateMinifyList($list, $exclude) {
$pendingList = array();
$pendingParameters = false;
$resultList = array();
foreach ($list as $url=>$parameters) {
if(preg_match('#^https?\://#', $url) || in_array($url, $this->$exclude) ) {
// for absol... | php | {
"resource": ""
} |
q267982 | BudgetAbstract.setAmountDefault | test | public function setAmountDefault($amountDefault)
{
$amountDefault = (float) $amountDefault;
if ($this->exists() && $this->amountDefault !== $amountDefault) {
$this->updated['amountDefault'] = true;
}
$this->amountDefault = $amountDefault;
return $this;
} | php | {
"resource": ""
} |
q267983 | BudgetAbstract.setDateStart | test | public function setDateStart($dateStart)
{
$dateStart = (string) $dateStart;
if ($this->exists() && $this->dateStart !== $dateStart) {
$this->updated['dateStart'] = true;
}
$this->dateStart = $dateStart;
return $this;
} | php | {
"resource": ""
} |
q267984 | BudgetAbstract.setDateEnd | test | public function setDateEnd($dateEnd)
{
$dateEnd = ($dateEnd === null ? $dateEnd : (string) $dateEnd);
if ($this->exists() && $this->dateEnd !== $dateEnd) {
$this->updated['dateEnd'] = true;
}
$this->dateEnd = $dateEnd;
return $this;
} | php | {
"resource": ""
} |
q267985 | BudgetAbstract.setIsRecurrent | test | public function setIsRecurrent($isRecurrent)
{
$isRecurrent = (bool) $isRecurrent;
if ($this->exists() && $this->isRecurrent !== $isRecurrent) {
$this->updated['isRecurrent'] = true;
}
$this->isRecurrent = $isRecurrent;
return $this;
} | php | {
"resource": ""
} |
q267986 | BudgetAbstract.setMonthBitmask | test | public function setMonthBitmask($monthBitmask)
{
$monthBitmask = (int) $monthBitmask;
if ($this->monthBitmask < 0) {
throw new \UnderflowException('Value of "monthBitmask" must be greater than 0');
}
if ($this->exists() && $this->monthBitmask !== $monthBitmask) {
... | php | {
"resource": ""
} |
q267987 | BudgetAbstract.getAllBudgetCategory | test | public function getAllBudgetCategory($isForceReload = false)
{
if ($isForceReload || null === $this->joinManyCacheBudgetCategory) {
$mapper = new BudgetCategoryMapper($this->dependencyContainer->getDatabase('money'));
$mapper->addWhere('budget_id', $this->getId());
$this... | php | {
"resource": ""
} |
q267988 | BudgetAbstract.getAllBudgetMonth | test | public function getAllBudgetMonth($isForceReload = false)
{
if ($isForceReload || null === $this->joinManyCacheBudgetMonth) {
$mapper = new BudgetMonthMapper($this->dependencyContainer->getDatabase('money'));
$mapper->addWhere('budget_id', $this->getId());
$this->joinMan... | php | {
"resource": ""
} |
q267989 | SafePDO.execute | test | protected function execute($sql, array $values = [], \Closure $callback = null)
{
if($statement = $this->pdo->prepare($sql)) {
if($statement->execute($values)) {
// format output
$return = $callback ? $callback($statement) : true;
// close statem... | php | {
"resource": ""
} |
q267990 | SafePDO.error | test | protected function error($sql, \PDOStatement $statement = null)
{
$error = $this->pdo->errorInfo();
if(!$error[1] and $statement) {
$error = $statement->errorInfo();
$statement->closeCursor();
unset($statement);
}
$code = is_int($error[0]) ? $erro... | php | {
"resource": ""
} |
q267991 | Composer.path | test | public static function path($path)
{
$loaders = spl_autoload_functions();
$loader = require $path;
// Check whether autoloader is registered at all
if ($loaders and in_array(array($loader, 'loadClass'), $loaders))
{
// Create new loader first using the previous one
$newLoader = new Loader($loader);
... | php | {
"resource": ""
} |
q267992 | Migration.up | test | public function up()
{
$transaction = $this->db->createTransaction();
return $transaction->begin()->thenLazy(
function($connection) {
//Set transaction connection
$this->_connection = $connection;
$promise = $this->safeUp($connection);
... | php | {
"resource": ""
} |
q267993 | Migration.down | test | public function down()
{
$transaction = $this->db->createTransaction();
return $transaction->begin()->thenLazy(
function($connection) {
$promise = $this->safeDown($connection);
return is_array($promise) ? allInOrder($promise) : $promise;
}
... | php | {
"resource": ""
} |
q267994 | Migration.insert | test | public function insert($table, $columns)
{
$cmdPromise = $this->createCommand()->insert($table, $columns)->execute();
return $this->execPromise($cmdPromise, "insert into $table");
} | php | {
"resource": ""
} |
q267995 | Migration.batchInsert | test | public function batchInsert($table, $columns, $rows)
{
$cmdPromise = $this->createCommand()->batchInsert($table, $columns, $rows)->execute();
return $this->execPromise($cmdPromise, "insert into $table");
} | php | {
"resource": ""
} |
q267996 | Migration.update | test | public function update($table, $columns, $condition = '', $params = [])
{
$cmdPromise = $this->createCommand()->update($table, $columns, $condition, $params)->execute();
return $this->execPromise($cmdPromise, "update $table");
} | php | {
"resource": ""
} |
q267997 | Migration.delete | test | public function delete($table, $condition = '', $params = [])
{
$cmdPromise = $this->createCommand()->delete($table, $condition, $params)->execute();
return $this->execPromise($cmdPromise, "delete from $table");
} | php | {
"resource": ""
} |
q267998 | Migration.renameTable | test | public function renameTable($table, $newName)
{
$cmdPromise = $this->createCommand()->renameTable($table, $newName)->execute();
return $this->execPromise($cmdPromise, "rename table $table to $newName");
} | php | {
"resource": ""
} |
q267999 | Migration.dropTable | test | public function dropTable($table)
{
$cmdPromise = $this->createCommand()->dropTable($table)->execute();
return $this->execPromise($cmdPromise, "drop table $table");
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.