_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q245400 | RedisQueue.pop | validation | function pop()
{
$response = $this->redis->blPop($this->key, 10);
if ($response) {
list($list, $serializedJob) = $response;
$job = unserialize($serializedJob);
return $job;
}
} | php | {
"resource": ""
} |
q245401 | Client.getLoginUrl | validation | public function getLoginUrl($scope = array(), $state = null) {
$scope = $this->mergeScope($scope);
$state = is_string($state) ? "&state={$state}" : '';
return self::API_OAUTH_URL .
'?client_id=' . $this->getApiKey() .
'&redirect_uri=' . urlencode($this->getApiCallback()... | php | {
"resource": ""
} |
q245402 | Client.modifyRelationship | validation | public function modifyRelationship($action, $user) {
if (true === in_array($action, $this->_actions) && isset($user)) {
return $this->_makeCall('users/' . $user . '/relationship', array('action' => $action), 'POST');
}
throw new InvalidParameterException('Error: modifyRelationship() ... | php | {
"resource": ""
} |
q245403 | Client.searchMedia | validation | public function searchMedia($lat, $lng, $distance = 1000, $minTimestamp = NULL, $maxTimestamp = NULL) {
return $this->_makeCall('media/search', array('lat' => $lat, 'lng' => $lng, 'distance' => $distance, 'min_timestamp' => $minTimestamp, 'max_timestamp' => $maxTimestamp));
} | php | {
"resource": ""
} |
q245404 | Client._makeCall | validation | protected function _makeCall($function, $params = null, $method = 'GET') {
if (isset($params['count']) && $params['count'] < 1) {
throw new InvalidParameterException('InstagramClient: you are trying to query 0 records!');
}
// if the call needs an authenticated user
if (true... | php | {
"resource": ""
} |
q245405 | Client.setAccessToken | validation | public function setAccessToken($data) {
(true === is_object($data)) ? $token = $data->access_token : $token = $data;
$this->_accesstoken = $token;
} | php | {
"resource": ""
} |
q245406 | Client.mergeScope | validation | private function mergeScope(array $scope) {
if (empty($scope)) return $this->_scope;
$scope = array_merge($scope, $this->_defaulScope);
$scope = array_unique($scope);
$intersectingScope = array_intersect($scope, $this->_availableScope);
if (count($intersectingScope) !== count($... | php | {
"resource": ""
} |
q245407 | ProcessBuilder.run | validation | public function run($command)
{
$process = new Process(
$command,
null,
null,
null,
ini_get('max_execution_time')
);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
$this->console... | php | {
"resource": ""
} |
q245408 | ConfigFile.stringify | validation | protected function stringify($name)
{
$classes = array_unique(array_merge(
$this->suffixClass($this->getFromConfig($name)),
$this->suffixClass($this->$name)
));
$newLine2Tabs = PHP_EOL.' ';
if ($name == 'providers') {
return "'$name' => [$... | php | {
"resource": ""
} |
q245409 | Add.handle | validation | public function handle()
{
$packageInfo = $this->tokenizePackageInfo();
$packages = $this->getPackages();
$total = $packages->count();
if (!$total) {
$this->warn(' No package found. Make sure you spell it correct as specified on github or packagist.');
}
... | php | {
"resource": ""
} |
q245410 | Add.tokenizePackageInfo | validation | public function tokenizePackageInfo()
{
$info = explode(':', $this->argument('package'));
return [
'name' => $info[0],
'version' => (count($info) > 1) ? last($info) : null,
];
} | php | {
"resource": ""
} |
q245411 | Add.prettify | validation | public function prettify(Collection $packages)
{
$summary = [];
foreach ($packages as $key => $package) {
$summary[] = [
'id' => $key + 1,
'name' => $this->prettifyPackageInfo($package),
];
}
return $packages[$this->askPacka... | php | {
"resource": ""
} |
q245412 | Add.askPackageKey | validation | public function askPackageKey($summary, $message = 'Please provide an id')
{
$this->table(['id', 'name'], $summary);
$selected = $this->ask($message);
$key = collect($summary)->pluck('id')->search($selected);
if ($key === false) {
$this->warn('Invalid package name or i... | php | {
"resource": ""
} |
q245413 | Migration.run | validation | public function run()
{
if ($this->search()) {
$this->registered = true;
return $this->console->call('migrate');
}
return false;
} | php | {
"resource": ""
} |
q245414 | Migration.hasMigrationFile | validation | public function hasMigrationFile()
{
$this->count = $this->fileHas('/class [A-Z]\w+ extends Migration/i')
->getClasses()
->count();
return $this->hasMigrationFile = $this->count > 0;
} | php | {
"resource": ""
} |
q245415 | Manager.build | validation | public function build()
{
$providers = $this->getProviders()->search();
$facades = $this->getFacades()->search();
if (!ConfigFile::instance($providers, $facades)->make()) {
throw new ErrorException('Unable to register providers and facades. Please report this incident at Qafeen/... | php | {
"resource": ""
} |
q245416 | Manager.getProviders | validation | public function getProviders()
{
return $this->providers ?:
$this->providers = new ServiceProvider(clone $this->getFiles(), $this->console);
} | php | {
"resource": ""
} |
q245417 | Manager.getFacades | validation | public function getFacades()
{
return $this->facades ?:
$this->facades = new Facade(clone $this->getFiles(), $this->console);
} | php | {
"resource": ""
} |
q245418 | Manager.getMigration | validation | public function getMigration()
{
return $this->migration ?:
$this->migration = new Migration(clone $this->getFiles(), $this->console);
} | php | {
"resource": ""
} |
q245419 | Manager.getFiles | validation | public function getFiles()
{
return $this->files ?: $this->files = Finder::create()->in(realpath($this->directory));
} | php | {
"resource": ""
} |
q245420 | Manager.hasManagerFile | validation | public function hasManagerFile()
{
if (app('filesystem')->exists($this->directory.'manager.yml')) {
return true;
}
$this->console->warn("No manager.yml file found in {$this->name} package.");
return false;
} | php | {
"resource": ""
} |
q245421 | Manager.notifyUser | validation | protected function notifyUser()
{
$this->console->line('');
$this->console->line("{$this->isDone($this->getProviders()->isRegistered())} ".
"{$this->getProviders()->count()} service provider registered.");
$this->console->line("{$this->isDone($this->getFacades()->isRegistered()... | php | {
"resource": ""
} |
q245422 | Manager.getResources | validation | public function getResources()
{
return $this->resources ?:
$this->resources = Resource::instance(clone $this->getFiles(), $this->console);
} | php | {
"resource": ""
} |
q245423 | Helper.instance | validation | public static function instance()
{
switch (func_num_args()) {
case func_num_args() == 0:
return new static();
case func_num_args() == 1:
return new static(func_get_arg(0));
case func_num_args() == 2:
return new static(func_... | php | {
"resource": ""
} |
q245424 | File.fileHas | validation | public function fileHas($contains)
{
$this->files = (new ClassIterator($this->finder->contains($contains)))->getClassMap();
$this->count = count($this->files);
return $this;
} | php | {
"resource": ""
} |
q245425 | File.getFile | validation | public function getFile($class)
{
if (is_null($this->count)) {
return $this->fileHas($class)->getFile($class);
}
if (isset($this->files[$class])) {
return $this->files[$class];
}
throw new FileException("File does not exists with given `{$class}` cla... | php | {
"resource": ""
} |
q245426 | ServiceProvider.search | validation | public function search()
{
$this->console->info('Searching directory for service providers.');
$sps = $this->getProviders();
if (!$sps->count()) {
$this->console->warn('No service provider file found. Nothing to install.');
return [];
}
$this->cons... | php | {
"resource": ""
} |
q245427 | Packages.search | validation | public function search()
{
$url = self::PACKAGIST_URL.'search.json?q='.$this->getPackageName();
$response = $this->client
->get($url)
->getBody()
->getContents();
$this->rawPackages = collect(json_decode($response, ... | php | {
"resource": ""
} |
q245428 | Resource.publish | validation | public function publish($provider)
{
$class = last(explode('\\', $provider));
$this->console->info("Searching {$provider} to publish vendor file.");
if (!$this->finder->contains($class)->contains('/\$this->publishes/i')->count()) {
$this->console->warn('Nothing to publish.');
... | php | {
"resource": ""
} |
q245429 | PasswordStrengthServiceProvider.boot | validation | public function boot(Factory $validator)
{
$passwordStrength = app('passwordStrength');
$translator = app('passwordStrength.translationProvider')->get($validator);
foreach(['letters', 'numbers', 'caseDiff', 'symbols'] as $rule) {
$snakeCasedRule = snake_case($rule);
... | php | {
"resource": ""
} |
q245430 | HtmlObject.dumpConstants | validation | protected function dumpConstants($constants)
{
$str = '';
if ($constants && $this->debug->output->getCfg('outputConstants')) {
$str = '<dt class="constants">constants</dt>'."\n";
foreach ($constants as $k => $value) {
$str .= '<dd class="constant">'
... | php | {
"resource": ""
} |
q245431 | HtmlObject.dumpMethods | validation | protected function dumpMethods($methods)
{
$label = \count($methods)
? 'methods'
: 'no methods';
$str = '<dt class="methods">'.$label.'</dt>'."\n";
$magicMethods = \array_intersect(array('__call','__callStatic'), \array_keys($methods));
$str .= $this->magicMet... | php | {
"resource": ""
} |
q245432 | HtmlObject.dumpMethodParams | validation | protected function dumpMethodParams($params)
{
$paramStr = '';
foreach ($params as $info) {
$paramStr .= '<span class="parameter">';
if (!empty($info['type'])) {
$paramStr .= '<span class="t_type">'.$info['type'].'</span> ';
}
$paramStr... | php | {
"resource": ""
} |
q245433 | HtmlObject.dumpPhpDoc | validation | protected function dumpPhpDoc($phpDoc)
{
$str = '';
foreach ($phpDoc as $k => $values) {
if (!\is_array($values)) {
continue;
}
foreach ($values as $value) {
if ($k == 'link') {
$value = '<a href="'.$value['uri']... | php | {
"resource": ""
} |
q245434 | HtmlObject.dumpProperties | validation | protected function dumpProperties($abs)
{
$label = \count($abs['properties'])
? 'properties'
: 'no properties';
if ($abs['viaDebugInfo']) {
$label .= ' <span class="text-muted">(via __debugInfo)</span>';
}
$str = '<dt class="properties">'.$label.'<... | php | {
"resource": ""
} |
q245435 | HtmlObject.magicMethodInfo | validation | private function magicMethodInfo($methods)
{
if (!$methods) {
return '';
}
foreach ($methods as $i => $method) {
$methods[$i] = '<code>'.$method.'</code>';
}
$methods = $i == 0
? 'a '.$methods[0].' method'
: \implode(' and ', $m... | php | {
"resource": ""
} |
q245436 | AbstractObject.getAbstraction | validation | public function getAbstraction($obj, $method = null, &$hist = array())
{
if (!\is_object($obj)) {
return $obj;
}
$reflector = new \ReflectionObject($obj);
$className = $reflector->getName();
$isTableTop = $method === 'table' && \count($hist) < 2; // rows (travers... | php | {
"resource": ""
} |
q245437 | AbstractObject.getAbstractionDetails | validation | private function getAbstractionDetails(Event $abs)
{
$reflector = $abs['reflector'];
$abs['phpDoc'] = $this->phpDoc->getParsed($reflector);
$traversed = false;
if ($abs['debugMethod'] === 'table' && \count($abs['hist']) < 2) {
// this is either rows (traversable), or a ro... | php | {
"resource": ""
} |
q245438 | AbstractObject.onStart | validation | public function onStart(Event $event)
{
$obj = $event->getSubject();
if ($obj instanceof \DateTime || $obj instanceof \DateTimeImmutable) {
$event['stringified'] = $obj->format(\DateTime::ISO8601);
} elseif ($obj instanceof \mysqli && ($obj->connect_errno || !$obj->stat)) {
... | php | {
"resource": ""
} |
q245439 | AbstractObject.onEnd | validation | public function onEnd(Event $event)
{
$obj = $event->getSubject();
if ($obj instanceof \DOMNodeList) {
// for reasons unknown, DOMNodeList's properties are invisible to reflection
$event['properties']['length'] = \array_merge(static::$basePropInfo, array(
'typ... | php | {
"resource": ""
} |
q245440 | AbstractObject.addConstants | validation | public function addConstants(Event $abs)
{
if (!$this->abstracter->getCfg('collectConstants')) {
return;
}
$reflector = $abs['reflector'];
$constants = $reflector->getConstants();
while ($reflector = $reflector->getParentClass()) {
$constants = \array_... | php | {
"resource": ""
} |
q245441 | AbstractObject.addMethods | validation | private function addMethods(Event $abs)
{
$obj = $abs->getSubject();
if (!$abs['collectMethods']) {
$this->addMethodsMin($abs);
return;
}
if ($this->abstracter->getCfg('cacheMethods') && isset(static::$methodCache[$abs['className']])) {
$abs['metho... | php | {
"resource": ""
} |
q245442 | AbstractObject.addMethodsMin | validation | private function addMethodsMin(Event $abs)
{
$obj = $abs->getSubject();
if (\method_exists($obj, '__toString')) {
$abs['methods']['__toString'] = array(
'returnValue' => \call_user_func(array($obj, '__toString')),
'visibility' => 'public',
);
... | php | {
"resource": ""
} |
q245443 | AbstractObject.addMethodsPhpDoc | validation | private function addMethodsPhpDoc(Event $abs)
{
$inheritedFrom = null;
if (empty($abs['phpDoc']['method'])) {
// phpDoc doesn't contain any @method tags,
if (\array_intersect_key($abs['methods'], \array_flip(array('__call', '__callStatic')))) {
// we've got __... | php | {
"resource": ""
} |
q245444 | AbstractObject.addProperties | validation | private function addProperties(Event $abs)
{
if ($abs['debugMethod'] === 'table' && $abs['traverseValues']) {
return;
}
$obj = $abs->getSubject();
$reflectionObject = $abs['reflector'];
/*
We trace our ancestory to learn where properties are inherited ... | php | {
"resource": ""
} |
q245445 | AbstractObject.addPropertiesPhpDoc | validation | private function addPropertiesPhpDoc(Event $abs)
{
// tag => visibility
$tags = array(
'property' => 'magic',
'property-read' => 'magic-read',
'property-write' => 'magic-write',
);
$inheritedFrom = null;
if (!\array_intersect_key($abs['phpD... | php | {
"resource": ""
} |
q245446 | AbstractObject.getParams | validation | private function getParams(\ReflectionMethod $reflectionMethod, $phpDoc = array())
{
$paramArray = array();
$params = $reflectionMethod->getParameters();
if (empty($phpDoc)) {
$phpDoc = $this->phpDoc->getParsed($reflectionMethod);
}
foreach ($params as $i => $refl... | php | {
"resource": ""
} |
q245447 | AbstractObject.getPropInfo | validation | private function getPropInfo(Event $abs, \ReflectionProperty $reflectionProperty)
{
$obj = $abs->getSubject();
$reflectionProperty->setAccessible(true); // only accessible via reflection
$className = \get_class($obj); // prop->class is equiv to getDeclaringClass
// get type and comme... | php | {
"resource": ""
} |
q245448 | AbstractObject.getPropCommentInfo | validation | private function getPropCommentInfo(\ReflectionProperty $reflectionProperty)
{
$name = $reflectionProperty->name;
$phpDoc = $this->phpDoc->getParsed($reflectionProperty);
$info = array(
'type' => null,
'desc' => $phpDoc['summary']
? $phpDoc['summary']
... | php | {
"resource": ""
} |
q245449 | AbstractObject.isObjExcluded | validation | private function isObjExcluded($obj)
{
if (\in_array(\get_class($obj), $this->abstracter->getCfg('objectsExclude'))) {
return true;
}
foreach ($this->abstracter->getCfg('objectsExclude') as $exclude) {
if (\is_subclass_of($obj, $exclude)) {
return true... | php | {
"resource": ""
} |
q245450 | AbstractObject.methodInfo | validation | private function methodInfo($obj, \ReflectionMethod $reflectionMethod)
{
// getDeclaringClass() returns LAST-declared/overridden
$declaringClassName = $reflectionMethod->getDeclaringClass()->getName();
$phpDoc = $this->phpDoc->getParsed($reflectionMethod);
$vis = 'public';
if... | php | {
"resource": ""
} |
q245451 | AbstractObject.phpDocParam | validation | private function phpDocParam($param, $className)
{
$constantName = null;
$defaultValue = $this->abstracter->UNDEFINED;
if (\array_key_exists('defaultValue', $param)) {
$defaultValue = $param['defaultValue'];
if (\in_array($defaultValue, array('true','false','null'))) ... | php | {
"resource": ""
} |
q245452 | ErrorLevel.getConstants | validation | public static function getConstants($phpVer = null)
{
$phpVer = $phpVer ?: PHP_VERSION;
/*
version_compare considers 1 < 1.0 < 1.0.0
*/
$phpVer = \preg_match('/^\d+\.\d+$/', $phpVer)
? $phpVer.'.0'
: $phpVer;
$constants = array(
... | php | {
"resource": ""
} |
q245453 | ErrorLevel.filterConstantsByLevel | validation | private static function filterConstantsByLevel($constants, $level)
{
foreach ($constants as $constantName => $value) {
if (!self::inBitmask($value, $level)) {
unset($constants[$constantName]);
}
}
unset($constants['E_ALL']);
return $constants;
... | php | {
"resource": ""
} |
q245454 | MethodTable.colKeys | validation | public static function colKeys($rows)
{
if (!\is_array($rows)) {
return array();
}
if (Abstracter::isAbstraction($rows) && $rows['traverseValues']) {
$rows = $rows['traverseValues'];
}
$lastKeys = array();
$newKeys = array();
$curKeys =... | php | {
"resource": ""
} |
q245455 | MethodTable.keyValues | validation | public static function keyValues($row, $keys, &$objInfo)
{
$objInfo = array(
'row' => false,
'cols' => array(),
);
$rowIsAbstraction = Abstracter::isAbstraction($row);
if ($rowIsAbstraction) {
if ($row['type'] == 'object') {
$objInf... | php | {
"resource": ""
} |
q245456 | MethodTable.keys | validation | private static function keys($val)
{
if (Abstracter::isAbstraction($val)) {
// abstraction
if ($val['type'] == 'object') {
if ($val['traverseValues']) {
// probably Traversable
$val = $val['traverseValues'];
} el... | php | {
"resource": ""
} |
q245457 | MethodClear.clearErrors | validation | private function clearErrors($flags)
{
$clearErrors = $flags & Debug::CLEAR_LOG_ERRORS || $flags & Debug::CLEAR_SUMMARY_ERRORS;
if (!$clearErrors) {
return;
}
$errorsNotCleared = array();
/*
Clear Log Errors
*/
$errorsNotCleared = $this... | php | {
"resource": ""
} |
q245458 | MethodClear.clearErrorsHelper | validation | private function clearErrorsHelper(&$log, $clear = true)
{
$errorsNotCleared = array();
foreach ($log as $k => $entry) {
if (!\in_array($entry[0], array('error','warn'))) {
continue;
}
$clear2 = $clear;
if ($this->channelName) {
... | php | {
"resource": ""
} |
q245459 | MethodClear.clearLog | validation | private function clearLog($flags)
{
$return = null;
$clearErrors = $flags & Debug::CLEAR_LOG_ERRORS;
if ($flags & Debug::CLEAR_LOG) {
$return = 'log ('.($clearErrors ? 'incl errors' : 'sans errors').')';
$curDepth = 0;
foreach ($this->data['groupStacks']['... | php | {
"resource": ""
} |
q245460 | MethodClear.clearSummary | validation | private function clearSummary($flags)
{
$return = null;
$clearErrors = $flags & Debug::CLEAR_SUMMARY_ERRORS;
if ($flags & Debug::CLEAR_SUMMARY) {
$return = 'summary ('.($clearErrors ? 'incl errors' : 'sans errors').')';
$curPriority = \end($this->data['groupPrioritySt... | php | {
"resource": ""
} |
q245461 | MethodClear.getLogArgs | validation | private function getLogArgs($cleared)
{
$cleared = \array_filter($cleared);
if (!$cleared) {
return array();
}
$count = \count($cleared);
$glue = $count == 2
? ' and '
: ', ';
if ($count > 2) {
$cleared[$count-1] = 'and ... | php | {
"resource": ""
} |
q245462 | AbstractArray.getAbstraction | validation | public function getAbstraction(&$array, $method = null, &$hist = array())
{
if (\in_array($array, $hist, true)) {
return $this->abstracter->RECURSION;
}
if (self::isCallable($array)) {
// this appears to be a "callable"
return array(
'debug... | php | {
"resource": ""
} |
q245463 | ErrorHandler.get | validation | public function get($key = null)
{
if ($key == 'lastError') {
return isset($this->data['lastError'])
? $this->data['lastError']->getValues()
: null;
}
if (isset($this->data[$key])) {
return $this->data[$key];
}
if (isset... | php | {
"resource": ""
} |
q245464 | ErrorHandler.getCfg | validation | public function getCfg($key = null)
{
if (!\strlen($key)) {
return $this->cfg;
}
if (isset($this->cfg[$key])) {
return $this->cfg[$key];
}
return null;
} | php | {
"resource": ""
} |
q245465 | ErrorHandler.handleException | validation | public function handleException($exception)
{
// lets store the exception so we can use the backtrace it provides
$this->uncaughtException = $exception;
\http_response_code(500);
$this->handleError(
E_ERROR,
'Uncaught exception \''.\get_class($exception).'\' w... | php | {
"resource": ""
} |
q245466 | ErrorHandler.onShutdown | validation | public function onShutdown(Event $event)
{
if (!$this->registered) {
return;
}
$error = $event['error'] ?: \error_get_last();
if (!$error) {
return;
}
if (\in_array($error['type'], $this->errCategories['fatal'])) {
/*
... | php | {
"resource": ""
} |
q245467 | ErrorHandler.register | validation | public function register()
{
if ($this->registered) {
return;
}
$this->prevDisplayErrors = \ini_set('display_errors', 0);
$this->prevErrorHandler = \set_error_handler(array($this, 'handleError'));
$this->prevExceptionHandler = \set_exception_handler(array($this, '... | php | {
"resource": ""
} |
q245468 | ErrorHandler.unregister | validation | public function unregister()
{
if (!$this->registered) {
return;
}
/*
set and restore error handler to determine the current error handler
*/
$errHandlerCur = \set_error_handler(array($this, 'handleError'));
\restore_error_handler();
if... | php | {
"resource": ""
} |
q245469 | ErrorHandler.buildError | validation | protected function buildError($errType, $errMsg, $file, $line, $vars)
{
// determine $category
foreach ($this->errCategories as $category => $errTypes) {
if (\in_array($errType, $errTypes)) {
break;
}
}
$errorValues = array(
'type' ... | php | {
"resource": ""
} |
q245470 | ErrorHandler.errorHash | validation | protected function errorHash($errorValues)
{
$errMsg = $errorValues['message'];
// (\(.*?)\d+(.*?\)) "(tried to allocate 16384 bytes)" -> "(tried to allocate xxx bytes)"
$errMsg = \preg_replace('/(\(.*?)\d+(.*?\))/', '\1x\2', $errMsg);
// "blah123" -> "blahxxx"
$errMsg = \... | php | {
"resource": ""
} |
q245471 | PhpDoc.getParsed | validation | public static function getParsed($what)
{
$hash = null;
if (\is_object($what)) {
$hash = self::getHash($what);
if (isset(self::$cache[$hash])) {
return self::$cache[$hash];
}
}
$comment = self::getCommentContent($what);
if (... | php | {
"resource": ""
} |
q245472 | PhpDoc.findInheritedDoc | validation | public static function findInheritedDoc(\Reflector $reflector)
{
$name = $reflector->getName();
$reflectionClass = $reflector->getDeclaringClass();
$interfaces = $reflectionClass->getInterfaceNames();
foreach ($interfaces as $className) {
$reflectionClass2 = new \Reflecti... | php | {
"resource": ""
} |
q245473 | PhpDoc.getCommentContent | validation | private static function getCommentContent($what)
{
$reflector = null;
if (\is_object($what)) {
$reflector = $what instanceof \Reflector
? $what
: new \ReflectionObject($what);
$docComment = $reflector->getDocComment();
} else {
... | php | {
"resource": ""
} |
q245474 | PhpDoc.getHash | validation | private static function getHash($what)
{
$str = null;
if (!($what instanceof \Reflector)) {
$str = \get_class($what);
} elseif ($what instanceof \ReflectionClass) {
$str = $what->getName();
} elseif ($what instanceof \ReflectionMethod) {
$str = $wh... | php | {
"resource": ""
} |
q245475 | PhpDoc.splitParams | validation | private static function splitParams($paramStr)
{
$depth = 0;
$startPos = 0;
$chars = \str_split($paramStr);
$params = array();
foreach ($chars as $pos => $char) {
switch ($char) {
case ',':
if ($depth === 0) {
... | php | {
"resource": ""
} |
q245476 | PhpDoc.trimDesc | validation | private static function trimDesc($desc)
{
$lines = \explode("\n", $desc);
$leadingSpaces = array();
foreach ($lines as $line) {
if (\strlen($line)) {
$leadingSpaces[] = \strspn($line, ' ');
}
}
\array_shift($leadingSpaces); // first ... | php | {
"resource": ""
} |
q245477 | Internal.emailLog | validation | public function emailLog()
{
/*
List errors that occured
*/
$errorStr = $this->buildErrorList();
/*
Build Subject
*/
$subject = 'Debug Log';
$subjectMore = '';
if (!empty($_SERVER['HTTP_HOST'])) {
$subjectMore .= ' '... | php | {
"resource": ""
} |
q245478 | Internal.getMetaVals | validation | public static function getMetaVals(&$args, $defaultMeta = array(), $defaultArgs = array(), $argsToMeta = array())
{
$meta = array();
foreach ($args as $i => $v) {
if (\is_array($v) && isset($v['debug']) && $v['debug'] === Debug::META) {
unset($v['debug']);
... | php | {
"resource": ""
} |
q245479 | Internal.hasLog | validation | public function hasLog()
{
$entryCountInitial = $this->debug->getData('entryCountInitial');
$entryCountCurrent = $this->debug->getData('log/__count__');
$haveLog = $entryCountCurrent > $entryCountInitial;
$lastEntryMethod = $this->debug->getData('log/__end__/0');
return $have... | php | {
"resource": ""
} |
q245480 | Internal.onBootstrap | validation | public function onBootstrap()
{
if ($this->debug->parentInstance) {
// only recored php/request info for root instance
return;
}
$collectWas = $this->debug->setCfg('collect', true);
$this->debug->groupSummary();
$this->debug->group('environment', $this... | php | {
"resource": ""
} |
q245481 | Internal.onConfig | validation | public function onConfig(Event $event)
{
$cfg = $event['config'];
if (!isset($cfg['debug'])) {
// no debug config values have changed
return;
}
$cfg = $cfg['debug'];
if (isset($cfg['file'])) {
$this->debug->addPlugin($this->debug->output->f... | php | {
"resource": ""
} |
q245482 | Internal.onError | validation | public function onError(Event $error)
{
if ($this->debug->getCfg('collect')) {
/*
temporarily store error so that we can easily determine error/warn
a) came via error handler
b) calling info
*/
$this->error = $error;
... | php | {
"resource": ""
} |
q245483 | Internal.onOutput | validation | public function onOutput()
{
if ($this->debug->parentInstance) {
// only record runtime info for root instance
return;
}
$vals = $this->runtimeVals();
$this->debug->groupSummary(1);
$this->debug->info('Built In '.$vals['runtime'].' sec');
$this... | php | {
"resource": ""
} |
q245484 | Internal.onShutdown | validation | public function onShutdown()
{
$this->runtimeVals();
if ($this->testEmailLog()) {
$this->emailLog();
}
if (!$this->debug->getData('outputSent')) {
echo $this->debug->output();
}
return;
} | php | {
"resource": ""
} |
q245485 | Internal.buildErrorList | validation | private function buildErrorList()
{
$errorStr = '';
$errors = $this->debug->errorHandler->get('errors');
\uasort($errors, function ($a1, $a2) {
return \strcmp($a1['file'].$a1['line'], $a2['file'].$a2['line']);
});
$lastFile = '';
foreach ($errors as $error... | php | {
"resource": ""
} |
q245486 | Internal.logPhpInfo | validation | private function logPhpInfo()
{
if (!$this->debug->getCfg('logEnvInfo.phpInfo')) {
return;
}
$this->debug->log('PHP Version', PHP_VERSION);
$this->debug->log('ini location', \php_ini_loaded_file());
$this->debug->log('memory_limit', $this->debug->utilities->getByt... | php | {
"resource": ""
} |
q245487 | Internal.logRequest | validation | private function logRequest()
{
$this->logRequestHeaders();
if ($this->debug->getCfg('logEnvInfo.cookies')) {
$cookieVals = $_COOKIE;
\ksort($cookieVals, SORT_NATURAL);
$this->debug->log('$_COOKIE', $cookieVals);
}
// don't expect a request body fo... | php | {
"resource": ""
} |
q245488 | Internal.logRequestHeaders | validation | private function logRequestHeaders()
{
if (!$this->debug->getCfg('logEnvInfo.headers')) {
return;
}
if (!empty($_SERVER['argv'])) {
return;
}
$headers = $this->debug->utilities->getAllHeaders();
\ksort($headers, SORT_NATURAL);
$this->de... | php | {
"resource": ""
} |
q245489 | Firephp.onOutput | validation | public function onOutput(Event $event)
{
$this->outputEvent = $event;
$this->channelName = $this->debug->getCfg('channel');
$this->data = $this->debug->getData();
$event['headers'][] = array('X-Wf-Protocol-1', 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2');
$event['hea... | php | {
"resource": ""
} |
q245490 | Firephp.processLogEntry | validation | public function processLogEntry($method, $args = array(), $meta = array())
{
$value = null;
$firePhpMeta = $this->getMeta($method, $meta);
if ($method == 'alert') {
list($method, $args) = $this->methodAlert($args, $meta);
$value = $args[0];
} elseif (\in_array... | php | {
"resource": ""
} |
q245491 | Firephp.getMeta | validation | private function getMeta($method, $meta)
{
$firePhpMeta = array(
'Type' => isset($this->firephpMethods[$method])
? $this->firephpMethods[$method]
: $this->firephpMethods['log'],
// Label
// File
// Line
// Collapsed ... | php | {
"resource": ""
} |
q245492 | Firephp.methodTable | validation | protected function methodTable($array, $columns = array())
{
if (!\is_array($array)) {
return $this->dump($array);
}
$table = array();
$keys = $columns ?: $this->debug->methodTable->colKeys($array);
$headerVals = $keys;
foreach ($headerVals as $i => $val) ... | php | {
"resource": ""
} |
q245493 | Script.onOutput | validation | public function onOutput(Event $event)
{
$this->channelName = $this->debug->getCfg('channel');
$this->data = $this->debug->getData();
$errorStats = $this->debug->internal->errorStats();
$errorStr = '';
if ($errorStats['inConsole']) {
$errorStr = 'Errors: ';
... | php | {
"resource": ""
} |
q245494 | Script.processLogEntry | validation | public function processLogEntry($method, $args = array(), $meta = array())
{
if ($method == 'alert') {
list($method, $args) = $this->methodAlert($args, $meta);
} elseif ($method == 'assert') {
\array_unshift($args, false);
} elseif (\in_array($method, array('count','t... | php | {
"resource": ""
} |
q245495 | HtmlErrorSummary.build | validation | public function build($stats)
{
$this->stats = $stats;
return ''
.$this->buildFatal()
.$this->buildInConsole()
.$this->buildNotInConsole();
} | php | {
"resource": ""
} |
q245496 | HtmlErrorSummary.buildFatal | validation | protected function buildFatal()
{
$haveFatal = isset($this->stats['counts']['fatal']);
if (!$haveFatal) {
return '';
}
$lastError = $this->errorHandler->get('lastError');
$isHtml = $lastError['isHtml'];
$backtrace = $lastError['backtrace'];
$html =... | php | {
"resource": ""
} |
q245497 | HtmlErrorSummary.buildNotInConsole | validation | protected function buildNotInConsole()
{
if (!$this->stats['notInConsole']) {
return '';
}
$errors = $this->errorHandler->get('errors');
$lis = array();
foreach ($errors as $err) {
if (\array_intersect_assoc(array(
// at least one of th... | php | {
"resource": ""
} |
q245498 | HtmlErrorSummary.getErrorsInCategory | validation | protected function getErrorsInCategory($category)
{
$errors = $this->errorHandler->get('errors');
$errorsInCat = array();
foreach ($errors as $err) {
if ($err['category'] == $category && $err['inConsole']) {
$errorsInCat[] = $err;
}
}
r... | php | {
"resource": ""
} |
q245499 | Manager.addSubscriberInterface | validation | public function addSubscriberInterface(SubscriberInterface $interface)
{
$subscribers = $this->getInterfaceSubscribers($interface);
foreach ($subscribers as $row) {
$this->subscribe($row[0], $row[1], $row[2]);
}
return $subscribers;
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.