_id
stringlengths 2
7
| title
stringlengths 3
151
| partition
stringclasses 3
values | text
stringlengths 83
13k
| language
stringclasses 1
value | meta_information
dict |
---|---|---|---|---|---|
q267600 | Uri.param | test | public function param($key)
{
return isset($this->params[$key])
? $this->params[$key]
: null;
} | php | {
"resource": ""
} |
q267601 | Uri.rebase | test | public function rebase($base)
{
return new static([
'scheme' => $this->scheme,
'user' => $this->user,
'pass' => $this->password,
'host' => $this->host,
'port' => $this->port,
'base' => $base,
'path' => $this->path,
'query' => $this->query,
'fragment' => $this->fragment,
]);
} | php | {
"resource": ""
} |
q267602 | RouteCollection.addRoute | test | public function addRoute(Route $route): void
{
$key = md5(\json_encode((array) $route));
$this->routes[$key] = $route;
foreach ($route->getRequestMethods() as $requestMethod) {
// If this is a dynamic route
if ($route->isDynamic()) {
// Set the route's regex and path in the dynamic routes list
$this->dynamicRoutes[$requestMethod][$route->getRegex()] = $key;
} // Otherwise set it in the static routes array
else {
// Set the route's path in the static routes list
$this->staticRoutes[$requestMethod][$route->getPath()] = $key;
}
}
// If this route has a name set
if ($route->getName()) {
// Set the route in the named routes list
$this->namedRoutes[$route->getName()] = $key;
}
} | php | {
"resource": ""
} |
q267603 | RouteCollection.staticRoute | test | public function staticRoute(string $method, string $path): ? Route
{
return $this->route($this->staticRoutes[$method][$path] ?? $path);
} | php | {
"resource": ""
} |
q267604 | RouteCollection.issetStaticRoute | test | public function issetStaticRoute(string $method, string $path): bool
{
return isset($this->staticRoutes[$method][$path]);
} | php | {
"resource": ""
} |
q267605 | RouteCollection.dynamicRoute | test | public function dynamicRoute(string $method, string $regex): ? Route
{
return $this->route($this->dynamicRoutes[$method][$regex] ?? $regex);
} | php | {
"resource": ""
} |
q267606 | RouteCollection.issetDynamicRoute | test | public function issetDynamicRoute(string $method, string $regex): bool
{
return isset($this->dynamicRoutes[$method][$regex]);
} | php | {
"resource": ""
} |
q267607 | RouteCollection.namedRoute | test | public function namedRoute(string $name): ? Route
{
return $this->route($this->namedRoutes[$name] ?? $name);
} | php | {
"resource": ""
} |
q267608 | CrudView.createSubLeaves | test | protected function createSubLeaves()
{
parent::createSubLeaves();
$this->registerSubLeaf(new Button("Save", "Save", function(){
$this->model->savePressedEvent->raise();
}));
$this->registerSubLeaf(new Button("Delete", "Delete", function(){
$this->model->deletePressedEvent->raise();
}));
$this->registerSubLeaf(new Button("Cancel", "Cancel", function(){
$this->model->cancelPressedEvent->raise();
}));
} | php | {
"resource": ""
} |
q267609 | Locator.locate | test | public static function locate($filename)
{
if (@file_exists($filename)) return $filename;
$_f = CarteBlanche::getPath('carte_blanche_core').$filename;
if (!empty($_f) && @file_exists($_f)) return $_f;
$include_paths = explode(PATH_SEPARATOR,get_include_path());
foreach($include_paths as $_inc) {
$_f = DirectoryHelper::slashDirname($_inc).$filename;
if (@file_exists($_f)) return $_f;
}
if (class_exists('\CarteBlanche\CarteBlanche')) {
$bundles = CarteBlanche::getContainer()->get('bundles');
if (!empty($bundles)) {
foreach($bundles as $_bundle) {
$_f = DirectoryHelper::slashDirname($_bundle->getDirectory()).$filename;
if (@file_exists($_f)) return $_f;
}
}
}
return false;
} | php | {
"resource": ""
} |
q267610 | Number.convert | test | public function convert(NumberSystem $newSystem)
{
$newDigits = [];
$decimalValue = gmp_init($this->decimalValue());
do {
$divisionResult = gmp_div_qr($decimalValue, $newSystem->getBase());
$remainder = gmp_strval($divisionResult[1]);
$decimalValue = $divisionResult[0];
$newDigits[] = $newSystem->getSymbolForPosition($remainder);
} while (gmp_strval($decimalValue) > 0);
return $newSystem->buildNumber(array_reverse($newDigits));
} | php | {
"resource": ""
} |
q267611 | Number.equals | test | public function equals(Number $comparedNumber)
{
if ($this->value() !== $comparedNumber->value() ||
!$this->getNumberSystem()->equals($comparedNumber->getNumberSystem())) {
return false;
}
return true;
} | php | {
"resource": ""
} |
q267612 | Number.decimalValue | test | protected function decimalValue()
{
$base = $this->numberSystem->getBase();
$result = 0;
foreach (array_reverse($this->getDigits()) as $position => $value) {
$numberSystemPosition = $this->numberSystem->getSymbolPosition($value);
$result += $numberSystemPosition * pow($base, $position);
}
return $result;
} | php | {
"resource": ""
} |
q267613 | Number.add | test | public function add(Number $addend)
{
$resultDecimalValue = $this->decimalValue() + $addend->decimalValue();
$result = new Number($resultDecimalValue);
return $result->convert($this->getNumberSystem());
} | php | {
"resource": ""
} |
q267614 | Number.subtract | test | public function subtract(Number $subtractor)
{
$resultDecimalValue = $this->decimalValue() - $subtractor->decimalValue();
$result = new Number($resultDecimalValue);
return $result->convert($this->getNumberSystem());
} | php | {
"resource": ""
} |
q267615 | Number.multiply | test | public function multiply(Number $multiplicator)
{
$resultDecimalValue = $this->decimalValue() * $multiplicator->decimalValue();
$result = new Number($resultDecimalValue);
return $result->convert($this->getNumberSystem());
} | php | {
"resource": ""
} |
q267616 | Number.divide | test | public function divide(Number $multiplicator)
{
$resultDecimalValue = round($this->decimalValue() / $multiplicator->decimalValue(), 0);
$result = new Number($resultDecimalValue);
return $result->convert($this->getNumberSystem());
} | php | {
"resource": ""
} |
q267617 | Mysqli.getAdapter | test | public static function getAdapter(\Mysqli $mysqli)
{
$driver = new Driver\Mysqli\Mysqli($mysqli);
$adapter = new Adapter($driver);
return $adapter;
} | php | {
"resource": ""
} |
q267618 | CloneModel.aliasList | test | public static function aliasList()
{
$result = [];
foreach (\Yii::$aliases as $alias => $data) {
if (is_array($data)) {
$result = array_merge($result, array_keys($data));
} else {
$result[] = $alias;
}
}
asort($result);
return array_values($result);
} | php | {
"resource": ""
} |
q267619 | CloneModel.findAliases | test | public static function findAliases($query)
{
$query = '@' . str_replace('@', '', $query);
$pattern = '/' . preg_quote($query, '/') . '/';
return preg_grep($pattern, self::aliasList());
} | php | {
"resource": ""
} |
q267620 | CloneModel.replace | test | private function replace()
{
$destination = Yii::getAlias($this->destination);
$destinationModuleName = $this->getDestinationModuleName();
foreach (FileHelper::findFiles($destination) as $path) {
if (!$this->replace && in_array($path, $this->keepFiles)) {
continue;
}
if (!preg_match('/^.*\.php$/', $path, $matches)) { // php file.
continue;
} else if (preg_match('/^.*\W([A-Z]\w+)\.php$/', $path, $matches)) { // Class file.
file_put_contents($path, $this->createClassContent($matches[1], $path));
} else if (self::isMigration($path)) { // Class file.
file_put_contents($path, $this->updateFileContent($path));
if ($destinationModuleName) {
$this->renameClassFile($path, function($className) use ($destinationModuleName){
return $className . '_' . $destinationModuleName;
});
}
} else if ($this->inheritContent) {
file_put_contents($path, $this->createFileContent($path));
} else {
file_put_contents($path, $this->updateFileContent($path));
}
}
return true;
} | php | {
"resource": ""
} |
q267621 | HTTP_Request2_SocketWrapper.readLine | test | public function readLine($bufferSize, $localTimeout = null)
{
$line = '';
while (!feof($this->socket)) {
if (null !== $localTimeout) {
stream_set_timeout($this->socket, $localTimeout);
} elseif ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$line .= @fgets($this->socket, $bufferSize);
if (null === $localTimeout) {
$this->checkTimeout();
} else {
$info = stream_get_meta_data($this->socket);
// reset socket timeout if we don't have request timeout specified,
// prevents further calls failing with a bogus Exception
if (!$this->deadline) {
$default = (int)@ini_get('default_socket_timeout');
stream_set_timeout($this->socket, $default > 0 ? $default : PHP_INT_MAX);
}
if ($info['timed_out']) {
throw new HTTP_Request2_MessageException(
"readLine() call timed out", HTTP_Request2_Exception::TIMEOUT
);
}
}
if (substr($line, -1) == "\n") {
return rtrim($line, "\r\n");
}
}
return $line;
} | php | {
"resource": ""
} |
q267622 | HTTP_Request2_SocketWrapper.enableCrypto | test | public function enableCrypto()
{
$modes = array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
STREAM_CRYPTO_METHOD_SSLv2_CLIENT
);
foreach ($modes as $mode) {
if (stream_socket_enable_crypto($this->socket, true, $mode)) {
return;
}
}
throw new HTTP_Request2_ConnectionException(
'Failed to enable secure connection when connecting through proxy'
);
} | php | {
"resource": ""
} |
q267623 | HTTP_Request2_SocketWrapper.checkTimeout | test | protected function checkTimeout()
{
$info = stream_get_meta_data($this->socket);
if ($info['timed_out'] || $this->deadline && time() > $this->deadline) {
$reason = $this->deadline
? "after {$this->timeout} second(s)"
: 'due to default_socket_timeout php.ini setting';
throw new HTTP_Request2_MessageException(
"Request timed out {$reason}", HTTP_Request2_Exception::TIMEOUT
);
}
} | php | {
"resource": ""
} |
q267624 | SlimBridge.addRoute | test | public function addRoute(RouteInterface $route) {
if (!$route->isValid()) {
//perhaps some log?
return;
}
$routeValue = $route->getAction()->getValue();
$this->app->map(
[strtolower($route->getMethod()->getValue())],
$route->getUri()->getValue(),
function (
RequestInterface $request,
ResponseInterface $response,
$params
) use ($routeValue) {
$handler = $this->get($routeValue);
return $handler->execute($request, $response, $params);
}
);
} | php | {
"resource": ""
} |
q267625 | Attributes.setItems | test | private function setItems(array $items)
{
$this->items = array_merge($this->defaults, $items);
$this->checkAttributes();
return $this;
} | php | {
"resource": ""
} |
q267626 | Attributes.build | test | public function build($siteKey, array $items = [])
{
$this->setItems($items);
$output = [];
foreach ($this->getItems($siteKey) as $key => $value) {
$output[] = trim($key) . '="' . trim($value) . '"';
}
return implode(' ', $output);
} | php | {
"resource": ""
} |
q267627 | Attributes.prepareNameAttribute | test | public function prepareNameAttribute($name)
{
if (is_null($name)) return [];
if ($name === NoCaptcha::CAPTCHA_NAME) {
throw new InvalidArgumentException(
'The captcha name must be different from "' . NoCaptcha::CAPTCHA_NAME . '".'
);
}
return array_combine(['id', 'name'], [$name, $name]);
} | php | {
"resource": ""
} |
q267628 | Attributes.checkDataAttribute | test | private function checkDataAttribute($name, $default, array $available)
{
$item = $this->getItem($name);
if ( ! is_null($item)) {
$item = (is_string($item) and in_array($item, $available))
? strtolower(trim($item))
: $default;
$this->setItem($name, $item);
}
} | php | {
"resource": ""
} |
q267629 | SingleUseQueue.add | test | public function add($resource)
{
if (!isset($this->added[$path = $resource->getPath()])) {
$this->queue->add($resource);
$this->added[$path] = true;
}
} | php | {
"resource": ""
} |
q267630 | DayBuilder.fromArray | test | public static function fromArray($dayOfWeek, array $openingIntervals): Day
{
$intervals = [];
foreach ($openingIntervals as $interval) {
if ($interval instanceof TimeIntervalInterface) {
$intervals[] = $interval;
} elseif (\is_array($intervals)) {
$intervals[] = new TimeInterval(
TimeBuilder::fromString($interval[0]),
TimeBuilder::fromString($interval[1])
);
}
}
$day = new Day($dayOfWeek, $intervals);
$dayIntervals = $day->getOpeningHoursIntervals();
/** @var TimeIntervalInterface $dayInterval */
$dayInterval = \reset($dayIntervals);
if (self::isIntervalAllDay($dayInterval->getStart(), $dayInterval->getEnd())) {
return new AllDay($dayOfWeek);
}
return $day;
} | php | {
"resource": ""
} |
q267631 | DayBuilder.fromAssociativeArray | test | public static function fromAssociativeArray(array $data): DayInterface
{
if (!isset($data['openingIntervals'], $data['dayOfWeek']) || !\is_array($data['openingIntervals'])) {
throw new \InvalidArgumentException('Array is not valid.');
}
$openingIntervals = [];
foreach ($data['openingIntervals'] as $openingInterval) {
if (!isset($openingInterval['start'], $openingInterval['end'])) {
throw new \InvalidArgumentException('Array is not valid.');
}
$start = TimeBuilder::fromArray($openingInterval['start']);
$end = TimeBuilder::fromArray($openingInterval['end']);
if (self::isIntervalAllDay($start, $end)) {
return new AllDay($data['dayOfWeek']);
}
$openingIntervals[] = new TimeInterval($start, $end);
}
return new Day($data['dayOfWeek'], $openingIntervals);
} | php | {
"resource": ""
} |
q267632 | DayBuilder.isIntervalAllDay | test | private static function isIntervalAllDay(Time $start, Time $end): bool
{
if ($start->getHours() !== 0 || $start->getMinutes() !== 0 || $start->getSeconds() !== 0) {
return false;
}
if ($end->getHours() !== 24 || $end->getMinutes() !== 0 || $end->getSeconds() !== 0) {
return false;
}
return true;
} | php | {
"resource": ""
} |
q267633 | Request.fromArray | test | public static function fromArray(Array $data)
{
$request = new static();
if (!isset($data['body']) || !isset($data['request'])) {
throw new UnexpectedValueException(
'Unexpected data, invalid data'
);
}
$body = $data['body'];
$params = $data['request'];
$request->setTimestamp(microtime(true));
if (isset($params['RequestURI'])) {
$request->setRequestUrl($params['RequestURI']);
}
if (isset($params['Method'])) {
$request->setRequestMethod($params['Method']);
}
if (isset($params['Header']) && is_array($params['Header'])) {
$headers = $params['Header'];
if (isset($params['Host'])) {
$headers['Host'] = [$params['Host']];
}
$request->setHeaders($headers);
//Malformed cookies will return a fatal error
$cookies = $cookies = new Cookie($request->getHeader('Cookie'));
if ($cookies) {
$request->setCookies($cookies);
}
}
if (isset($params['URL']['RawQuery'])) {
parse_str($params['URL']['RawQuery'], $queryFields);
$request->setQueryFields($queryFields);
}
if (isset($params['Host']) && isset($params['Proto'])) {
$info = parse_url($params['Host']);
$info['proto'] = $params['Proto'];
$request->setServerInfo($info);
}
if (isset($params['RemoteAddr'])) {
$info = parse_url($params['RemoteAddr']);
$request->setRemoteInfo($info);
}
if (strlen($body)) {
parse_str($body, $postFields);
$request->setPostFields($postFields);
}
return $request;
} | php | {
"resource": ""
} |
q267634 | Request.setServerInfo | test | public function setServerInfo(array $info)
{
$this->server = $info;
if (isset($info['name']) && $info['name']) $name = (string) $info['name'];
else $name = sprintf('%s:%s', $info['host'], $info['port']);
$this->setServerGlobal('SERVER_NAME', $name);
$this->setServerGlobal('SERVER_ADDR', (string) $info['host']);
$this->setServerGlobal('SERVER_PORT', (string) $info['port']);
$this->setServerGlobal('SERVER_PROTOCOL', (string) $info['proto']);
//TODO: Version Server
$this->setServerGlobal('SERVER_SOFTWARE', 'Skeetr/0.0.2');
} | php | {
"resource": ""
} |
q267635 | Request.setHeaders | test | public function setHeaders(array $headers)
{
parent::addHeaders($headers);
$this->setServerGlobal('HTTP_HOST', (string) $this->getHeader('Host')[0]);
$this->setServerGlobal('HTTP_ACCEPT', (string) $this->getHeader('Accept')[0]);
$this->setServerGlobal('HTTP_CONNECTION', (string) $this->getHeader('Connection')[0]);
$this->setServerGlobal('HTTP_USER_AGENT', (string) $this->getHeader('User-Agent')[0]);
$this->setServerGlobal('HTTP_ACCEPT_ENCODING', (string) $this->getHeader('Accept-Encoding')[0]);
$this->setServerGlobal('HTTP_ACCEPT_LANGUAGE', (string) $this->getHeader('Accept-Language')[0]);
$this->setServerGlobal('HTTP_ACCEPT_CHARSET', (string) $this->getHeader('Accept-Charset')[0]);
$this->setServerGlobal('HTTP_CACHE_CONTROL', (string) $this->getHeader('Cache-Control')[0]);
$this->setServerGlobal('HTTP_COOKIE', (string) $this->getHeader('Cookie')[0]);
} | php | {
"resource": ""
} |
q267636 | Request.setPostFields | test | public function setPostFields(array $fields)
{
$this->post = $fields;
$body = new Message\Body();
$body->append(http_build_query($fields));
parent::setBody($body);
$_POST = $fields;
$_REQUEST = array_merge($_GET, $_POST);
} | php | {
"resource": ""
} |
q267637 | Request.setQueryFields | test | public function setQueryFields(array $fields)
{
$this->get = $fields;
$this->setServerGlobal('QUERY_STRING', $this->getQueryData());
$_GET = $fields;
$_REQUEST = array_merge($_GET, $_POST);
} | php | {
"resource": ""
} |
q267638 | Request.getHeader | test | public function getHeader($header, $into_class = null)
{
$header = parent::getHeader($header);
if (!is_array($header)) {
return [$header];
}
return $header;
} | php | {
"resource": ""
} |
q267639 | Request.toArray | test | public function toArray()
{
return array(
'url' => $this->getRequestUrl(),
'method' => $this->getRequestMethod(),
'headers' => $this->getHeaders(),
'post' => $this->getPostFields(),
'get' => $this->getQueryFields(),
'server' => $this->getServerInfo(),
'remote' => $this->getRemoteInfo()
);
} | php | {
"resource": ""
} |
q267640 | NativeConsole.addCommand | test | public function addCommand(Command $command): void
{
$command->setMethod($command->getMethod() ?? static::RUN_METHOD);
$dispatcher = $this->app->dispatcher();
$dispatcher->verifyClassMethod($command);
$dispatcher->verifyFunction($command);
$dispatcher->verifyClosure($command);
$this->addParsedCommand(
$command,
$this->app->pathParser()->parse(
$command->getPath()
)
);
} | php | {
"resource": ""
} |
q267641 | NativeConsole.addParsedCommand | test | protected function addParsedCommand(Command $command, array $parsedCommand): void
{
// Set the properties
$command->setRegex($parsedCommand['regex']);
$command->setParams($parsedCommand['params']);
$command->setSegments($parsedCommand['segments']);
// Set the command in the commands list
self::$commands[$command->getPath()] = $command;
// Set the command in the commands paths list
self::$paths[$command->getRegex()] = $command->getPath();
// If the command has a name
if (null !== $command->getName()) {
// Set in the named commands list to find it more easily later
self::$namedCommands[$command->getName()] = $command->getPath();
}
} | php | {
"resource": ""
} |
q267642 | NativeConsole.command | test | public function command(string $name): ? Command
{
return $this->hasCommand($name)
? self::$commands[self::$namedCommands[$name]]
: null;
} | php | {
"resource": ""
} |
q267643 | NativeConsole.removeCommand | test | public function removeCommand(string $name): void
{
if ($this->hasCommand($name)) {
unset(
self::$commands[self::$namedCommands[$name]],
self::$namedCommands[$name]
);
}
} | php | {
"resource": ""
} |
q267644 | NativeConsole.matchCommand | test | public function matchCommand(string $path): Command
{
// If the path matches a set command path
if (isset(self::$commands[$path])) {
return self::$commands[$path];
}
$command = null;
// Otherwise iterate through the commands and attempt to match via regex
foreach (self::$paths as $regex => $commandPath) {
// If the preg match is successful, we've found our command!
if (preg_match($regex, $path, $matches)) {
// Check if this command is provided
if ($this->isProvided($commandPath)) {
// Initialize the provided command
$this->initializeProvided($commandPath);
}
// Clone the command to avoid changing the one set in the master
// array
$command = clone self::$commands[$commandPath];
// The first match is the path itself
unset($matches[0]);
// Set the matches
$command->setMatches($matches);
return $command;
}
}
// If a command was not found
if (null === $command) {
// Throw a not found exception
throw new CommandNotFound('The command ' . $path . ' not found.');
}
return $command;
} | php | {
"resource": ""
} |
q267645 | NativeConsole.all | test | public function all(): array
{
// Iterate through all the command providers to set any deferred
// commands
foreach (self::$provided as $provided => $provider) {
// Initialize the provided command
$this->initializeProvided($provided);
}
return self::$commands;
} | php | {
"resource": ""
} |
q267646 | NativeConsole.setup | test | public function setup(bool $force = false, bool $useCache = true): void
{
// If the console was already setup no need to do it again
if (self::$setup && ! $force) {
return;
}
// The console is setting up
self::$setup = true;
// If the application should use the console cache files
if ($useCache && $this->app->config()['console']['useCache']) {
$this->setupFromCache();
// Then return out of setup
return;
}
self::$paths = [];
self::$commands = [];
self::$namedCommands = [];
// Setup command providers
$this->setupCommandProviders();
// If annotations are enabled and the events should use annotations
if (
$this->app->config()['console']['useAnnotations']
&& $this->app->config()['annotations']['enabled']
) {
// Setup annotated event listeners
$this->setupAnnotations();
// If only annotations should be used
if ($this->app->config()['console']['useAnnotationsExclusively']) {
// Return to avoid loading events file
return;
}
}
// Include the events file
require $this->app->config()['console']['filePath'];
} | php | {
"resource": ""
} |
q267647 | NativeConsole.setupFromCache | test | protected function setupFromCache(): void
{
// Set the application console with said file
$cache = $this->app->config()['cache']['console']
?? require $this->app->config()['console']['cacheFilePath'];
self::$commands = unserialize(
base64_decode($cache['commands'], true),
[
'allowed_classes' => [
Command::class,
],
]
);
self::$paths = $cache['paths'];
self::$namedCommands = $cache['namedCommands'];
self::$provided = $cache['provided'];
} | php | {
"resource": ""
} |
q267648 | NativeConsole.getCacheable | test | public function getCacheable(): array
{
$this->setup(true, false);
return [
'commands' => base64_encode(serialize(self::$commands)),
'paths' => self::$paths,
'namedCommands' => self::$namedCommands,
'provided' => self::$provided,
];
} | php | {
"resource": ""
} |
q267649 | Zend_Filter_Word_Separator_Abstract.setSeparator | test | public function setSeparator($separator)
{
if ($separator == null) {
throw new Zend_Filter_Exception('"' . $separator . '" is not a valid separator.');
}
$this->_separator = $separator;
return $this;
} | php | {
"resource": ""
} |
q267650 | NativeEvents.listen | test | public function listen(string $event, Listener $listener): void
{
$this->add($event);
$this->app->dispatcher()->verifyDispatch($listener);
// If this listener has an id
if (null !== $listener->getId()) {
// Use it when setting to allow removal
// or checking if it exists later
self::$events[$event][$listener->getId()] = $listener;
} else {
// Otherwise set the listener normally
self::$events[$event][] = $listener;
}
} | php | {
"resource": ""
} |
q267651 | NativeEvents.listenMany | test | public function listenMany(Listener $listener, string ...$events): void
{
// Iterate through the events
foreach ($events as $event) {
// Set a new listener for the event
$this->listen($event, $listener);
}
} | php | {
"resource": ""
} |
q267652 | NativeEvents.hasListener | test | public function hasListener(string $event, string $listenerId): bool
{
return $this->has($event) && isset(self::$events[$event][$listenerId]);
} | php | {
"resource": ""
} |
q267653 | NativeEvents.removeListener | test | public function removeListener(string $event, string $listenerId): void
{
// If the listener exists
if ($this->hasListener($event, $listenerId)) {
// Unset it
unset(self::$events[$event][$listenerId]);
}
} | php | {
"resource": ""
} |
q267654 | NativeEvents.hasListeners | test | public function hasListeners(string $event): bool
{
return $this->has($event) && ! empty(self::$events[$event]);
} | php | {
"resource": ""
} |
q267655 | NativeEvents.add | test | public function add(string $event): void
{
if (! $this->has($event)) {
self::$events[$event] = [];
}
} | php | {
"resource": ""
} |
q267656 | NativeEvents.remove | test | public function remove(string $event): void
{
if ($this->has($event)) {
unset(self::$events[$event]);
}
} | php | {
"resource": ""
} |
q267657 | NativeEvents.trigger | test | public function trigger(string $event, array $arguments = null): array
{
// The responses
$responses = [];
if (! $this->has($event) || ! $this->hasListeners($event)) {
return $responses;
}
// Iterate through all the event's listeners
foreach ($this->getListeners($event) as $listener) {
// Attempt to dispatch the event listener using any one of the
// callable options
$dispatch = $this->app->dispatcher()->dispatchCallable(
$listener,
$arguments
);
if (null !== $dispatch) {
$responses[] = $dispatch;
}
}
return $responses;
} | php | {
"resource": ""
} |
q267658 | NativeEvents.setup | test | public function setup(bool $force = false, bool $useCache = true): void
{
if (self::$setup && ! $force) {
return;
}
self::$setup = true;
// If the application should use the events cache files
if ($useCache && $this->app->config()['events']['useCache']) {
$this->setupFromCache();
// Then return out of setup
return;
}
self::$events = [];
// If annotations are enabled and the events should use annotations
if (
$this->app->config()['events']['useAnnotations']
&& $this->app->config()['annotations']['enabled']
) {
// Setup annotated event listeners
$this->setupAnnotations();
// If only annotations should be used
if ($this->app->config()['events']['useAnnotationsExclusively']) {
// Return to avoid loading events file
return;
}
}
// Include the events file
require $this->app->config()['events']['filePath'];
} | php | {
"resource": ""
} |
q267659 | NativeEvents.setupFromCache | test | protected function setupFromCache(): void
{
// Set the application events with said file
$cache = $this->app->config()['cache']['events']
?? require $this->app->config()['events']['cacheFilePath'];
self::$events = unserialize(
base64_decode($cache['events'], true),
[
'allowed_classes' => [
Listener::class,
],
]
);
} | php | {
"resource": ""
} |
q267660 | TemplatingTrait.init | test | public function init($options) {
$this->template = '';
$this->template_data = '';
$this->template_dir_orig = '';
if ($options['templatepath'] != '') {
$this->template_dir_orig = $options['templatepath'];
}
// compile dir is required and must be writable
$this->compile_dir_orig = $options['compiledir'];
$this->caching = $options['usecache'];
if ($this->caching) {
$this->cache_dir = $options['cachedir'];
}
$this->templates_extension = 'tpl';
if ($options['extension'] != '') {
$this->templates_extension = $options['extension'];
}
$this->initPlugins($options['templatingpluginsdir']);
$this->template_vars = array();
} | php | {
"resource": ""
} |
q267661 | TemplatingTrait.checkTemplateExists | test | public function checkTemplateExists($filepath,$options = array(),$tmplpath = '') {
if (is_array($this->template_dir_orig) && $tmplpath == '') {
foreach ($this->template_dir_orig as $path) {
$exists = $this->checkTemplateExists($filepath,$options,$path);
if ($exists) {
return true;
}
}
return false;
}
$filepath = (($tmplpath != '')?$tmplpath:$this->template_dir_orig).$filepath;
if (!$options['extensionpresent']) {
$filepath .= '.'.$this->templates_extension;
}
return file_exists($filepath);
} | php | {
"resource": ""
} |
q267662 | TemplatingTrait.fetchTemplate | test | public function fetchTemplate() {
if ($this->template != '' &&
$this->template_data == '' &&
!$this->checkTemplateExists($this->template)) {
throw new \Exception(sprintf('Template file %s not found',$this->template));
}
if ($this->template != '') {
return $this->fetchFromFile();
} else {
return $this->fetchFromString();
}
} | php | {
"resource": ""
} |
q267663 | Config.load | test | public function load(array $options = [])
{
$options = array_replace_recursive(
$this->getOption('loadOptions', []),
$options
);
// Simple shortcuts
$options['readerOptions']['file'] = $options['readerOptions']['file'] ?? $options['file'];
$options['readerOptions']['data'] = $options['readerOptions']['data'] ?? $options['data'];
$reader = $this->getReader();
$data = $reader->read($options['readerOptions']);
if ($options['processImports'] && isset($data['import'])) {
if (!is_array($data['import'])) {
throw ImportException::create('"import" parameter must be an array.');
}
foreach ($data['import'] as $importData) {
if (!is_array($importData)) {
throw ImportException::create('Each "import" array element must be an array.');
}
if (isset($importData['file'])) {
if ($options['file']) {
$importData['file'] = $importData['file']{0} === '/' ?
$importData['file'] :
dirname($options['file']).'/'.$importData['file'];
}
if (!is_file($importData['file'])) {
continue;
}
}
$readOptions = array_replace_recursive($options['readerOptions'], $importData);
$data = array_replace_recursive($data, $reader->read($readOptions));
}
}
if ($options['clearFirst']) {
$this->setData([], false);
}
if ($options['loadInKey'] !== null) {
if (!is_string($options['loadInKey'])) {
throw InvalidOptionTypeException::create('loadInKey', 'string');
}
$this->set(
$options['loadInKey'],
$this->replaceTemplateVariables(array_replace_recursive($this->get($options['loadInKey'], []), $data))
);
} else {
$this->setData(array_replace_recursive($this->getData(), $data));
}
/** @var Callable $callable */
$callable = $this->getOption('onAfterLoad');
if (!is_callable($callable)) {
throw new \RuntimeException('Option "onAfterLoad" must be a callable.');
}
call_user_func_array($callable, [$this, $options]);
return $this;
} | php | {
"resource": ""
} |
q267664 | Config.save | test | public function save(array $options = [])
{
$options = array_merge(
[
'file' => null,
'writerOptions' => []
],
$options
);
// Simple shortcut
$options['writerOptions']['file'] = $options['file'];
/** @var Callable $callable */
$callable = $this->getOption('onBeforeSave');
if (!is_callable($callable)) {
throw new \RuntimeException('Option "onBeforeSave" must be a callable.');
}
call_user_func_array($callable, [$this, $options]);
$this->getWriter()->write($this->getData(), $options['writerOptions']);
return $this;
} | php | {
"resource": ""
} |
q267665 | Config.initializeReader | test | protected function initializeReader()
{
$reader = $this->getOption('reader');
if (is_string($reader)) {
switch ($reader) {
case 'array':
$reader = new ArrayReader();
break;
case 'file':
$reader = new FileReader();
break;
default:
throw new \InvalidArgumentException(
'Invalid reader "'.$reader.'". Valid reader strings: array, file.'
);
}
} else if (!is_object($reader) || !($reader instanceof ReaderInterface)) {
throw new \InvalidArgumentException(
'Option "reader" must be a string or an instance of IronEdge\Component\Config\Reader\ReaderInterface.'
);
}
$this->setReader($reader);
} | php | {
"resource": ""
} |
q267666 | Config.initializeWriter | test | protected function initializeWriter()
{
$writer = $this->getOption('writer');
if (is_string($writer)) {
switch ($writer) {
case 'array':
$writer = new ArrayWriter();
break;
case 'file':
$writer = new FileWriter();
break;
default:
throw new \InvalidArgumentException(
'Invalid writer "'.$writer.'". Valid writer strings: array, file.'
);
}
} else if (!is_object($writer) || !($writer instanceof WriterInterface)) {
throw new \InvalidArgumentException(
'Option "writer" must be a string or an instance of IronEdge\Component\Config\Writer\WriterInterface.'
);
}
$this->setWriter($writer);
} | php | {
"resource": ""
} |
q267667 | Config.getDefaultOptions | test | public function getDefaultOptions(): array
{
return [
'reader' => 'file',
'writer' => 'file',
'onAfterLoad' => function(Config $config, array $options) {},
'onBeforeSave' => function(Config $config, array $options) {},
'separator' => '.',
'templateVariables' => [],
'loadOptions' => [
'data' => null,
'file' => null,
'loadInKey' => null,
'processImports' => false,
'clearFirst' => false,
'readerOptions' => []
]
];
} | php | {
"resource": ""
} |
q267668 | CryptDatabase.encrypt | test | protected function encrypt($data, $key)
{
$keySize = openssl_cipher_iv_length(static::CRYPT_MODE);
$padding = $keySize - (mb_strlen($data, '8bit') % $keySize);
/** @noinspection CryptographicallySecureRandomnessInspection */
$iv = openssl_random_pseudo_bytes($keySize);
$key = $this->generateKey($key);
$data .= str_repeat(chr($padding), $padding);
// add in our IV and base64 encode the data
$data = base64_encode(
$iv
. openssl_encrypt(
$data, static::CRYPT_MODE, $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv
)
);
return $data;
} | php | {
"resource": ""
} |
q267669 | CryptDatabase.decrypt | test | protected function decrypt($data, $key)
{
$base64 = base64_decode($data, true);
$keySize = openssl_cipher_iv_length(static::CRYPT_MODE);
$key = $this->generateKey($key);
$iv = substr($base64, 0, $keySize);
$results = substr($base64, $keySize);
$results = openssl_decrypt(
$results, static::CRYPT_MODE, $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv
);
return $results;
} | php | {
"resource": ""
} |
q267670 | CryptDatabase.generateKey | test | protected function generateKey($key)
{
$keySize = openssl_cipher_iv_length(static::CRYPT_MODE);
$key = hash(
'SHA256', $this->options->getClassName() . ':' . $this->sessionName . ':' . $key, true
);
return substr($key, 0, $keySize);
} | php | {
"resource": ""
} |
q267671 | ExceptionHandler.throwToStdout | test | public function throwToStdout($exception, $full = true, $asJson = false)
{
$httpCode = method_exists($exception, 'getHttpCode') ? call_user_func([$exception, 'getHttpCode']) : 500;
$logger = $this->getStdioLogger();
$message = $this->getExceptionData($exception, $full, true);
if ($logger) {
$logger->error($message, [], 1);
} else {
echo $message;
}
if ($asJson) {
$exceptionData = $this->getExceptionData($exception, $full, false);
} else {
$exceptionData = 'Error: ' . $exception->getMessage();
}
return $this->getResponse($httpCode, [], $exceptionData);
} | php | {
"resource": ""
} |
q267672 | ExceptionHandler.renderException | test | private function renderException($exception, $full = false)
{
$app = \Reaction::$app;
try {
$rendered = View::renderPhpStateless($this->getViewFileForException($exception), [
'exceptionName' => $this->getExceptionName($exception),
'exception' => $exception,
'app' => $app,
'rootPathLength' => strlen($app->getAlias('@root'))
]);
} catch (\Throwable $e) {
$rendered = $this->getExceptionData($exception, $full, true);
}
return $rendered;
} | php | {
"resource": ""
} |
q267673 | ExceptionHandler.getViewFileForException | test | private function getViewFileForException($exception)
{
$basePath = \Reaction::$app->getAlias('@views/error');
$tplName = 'general.php';
if ($exception instanceof HttpExceptionInterface) {
$code = $exception->statusCode;
} else {
$code = $exception->getCode();
}
if (file_exists($basePath . '/' . $code . '.php')) {
$tplName = $code . '.php';
}
return $basePath . '/' . $tplName;
} | php | {
"resource": ""
} |
q267674 | ExceptionHandler.getResponse | test | private function getResponse($code = 500, $headers = [], $body = null)
{
if (isset($body) && is_array($body)) {
if (!isset($body['error'])) {
$body = ['error' => $body];
}
$body = json_encode($body);
$headers['Content-type'] = 'application/json';
}
return new Response($code, $headers, $body);
} | php | {
"resource": ""
} |
q267675 | ExceptionHandler.getExceptionData | test | private function getExceptionData($exception, $full = false, $plainText = false)
{
if ($plainText) {
$text = $exception->getMessage() . "\n";
if ($full) {
$text .= $exception->getFile() . " #" . $exception->getLine() . "\n";
$text .= $exception->getTraceAsString() . "\n";
}
return $text;
} else {
$data = [
'name' => $this->getExceptionName($exception),
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
];
if ($full) {
$data = ArrayHelper::merge($data, [
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'stacktrace' => $exception->getTrace(),
]);
}
return $data;
}
} | php | {
"resource": ""
} |
q267676 | ExceptionHandler.getStdioLogger | test | private function getStdioLogger()
{
try {
/** @var StdioLogger $logger */
$logger = \Reaction::$di->get('stdioLogger');
} catch (\Throwable $exception) {
$logger = null;
}
return $logger;
} | php | {
"resource": ""
} |
q267677 | CachedSessionHandler.read | test | public function read($id)
{
$key = $this->getSessionKey($id);
return $this->getDataFromCache($key)->then(
function($record) {
return $this->extractData($record, true);
}
)->then(
null,
function($error = null) use ($id) {
//return $self->restoreSessionData($id, true)->then(
return $this->archive->get($id)->then(
function($data) use ($id, $error) {
if (is_array($data)) {
return $this->write($id, $data);
} else {
return \Reaction\Promise\reject($error);
}
}
);
}
)->then(
null,
function($error = null) use ($id) {
$message = sprintf('Failed to read session data for "%s"', $id);
throw new SessionException($message, 0, $error);
}
);
} | php | {
"resource": ""
} |
q267678 | CachedSessionHandler.write | test | public function write($id, $data)
{
$key = $this->getSessionKey($id);
$record = $this->packRecord($data);
return $this->writeDataToCache($key, $record)->then(
function() use ($id) {
$this->keys[$id] = time();
return $this->read($id);
},
function($error = null) use ($id) {
$message = sprintf('Failed to write session data for "%s"', $id);
throw new SessionException($message, 0, $error);
}
);
} | php | {
"resource": ""
} |
q267679 | CachedSessionHandler.destroy | test | public function destroy($id, $archiveRemove = false)
{
if (isset($this->keys[$id])) {
unset($this->keys[$id]);
}
$key = $this->getSessionKey($id);
return $this->cache->delete($key)->then(
function() use ($id) { return $id; },
function($error = null) use ($id) {
$message = sprintf('Failed to destroy session "%s"', $id);
throw new SessionException($message, 0, $error);
}
)->always(function() use ($id, $archiveRemove) {
return $archiveRemove ? $this->archive->remove($id) : true;
});
} | php | {
"resource": ""
} |
q267680 | CachedSessionHandler.updateTimestamp | test | public function updateTimestamp($id, $data = null)
{
$self = $this;
return $this->read($id)->then(
function($dataStored) use ($self, $id, $data) {
if (isset($data)) {
$dataStored = $data;
}
return $self->write($id, $dataStored);
}
)->then(
function() { return true; }
);
} | php | {
"resource": ""
} |
q267681 | CachedSessionHandler.extractData | test | public function extractData($sessionRecord = [], $unserialize = false) {
$data = isset($sessionRecord[$this->dataKey]) ? $sessionRecord[$this->dataKey] : [];
return $unserialize && is_string($data) ? $this->unserializeData($data) : $data;
} | php | {
"resource": ""
} |
q267682 | CachedSessionHandler.extractTimestamp | test | protected function extractTimestamp($record = []) {
return isset($record[$this->timestampKey]) ? $record[$this->timestampKey] : null;
} | php | {
"resource": ""
} |
q267683 | CachedSessionHandler.getDataFromCache | test | protected function getDataFromCache($key) {
$self = $this;
return (new Promise(function($r, $c) use ($self, $key) {
$self->cache
->get($key)
->then(function($data) {
return $data !== null ? $data : reject(null);
})->then(function($data) use ($r) {
$r($data);
}, function() use ($c, $key) {
$message = sprintf('Failed to get session data from cache for "%s"', $key);
$c(new SessionException($message));
});
}));
} | php | {
"resource": ""
} |
q267684 | Exception.getMessageWithVariables | test | final public function getMessageWithVariables(): string
{
if (empty($this->message)) {
throw new \Exception(sprintf(
'Exception %s does not have a message',
get_class($this)
), Level::CRITICAL);
}
$message = $this->message;
preg_match_all(self::VARIABLE_REGEX, $message, $matches);
foreach ($matches['variable'] as $variable) {
$variableName = substr($variable, 1, -1);
if (!isset($this->$variableName)) {
throw new \Exception(sprintf(
'Variable "%s" for exception "%s" not found',
$variableName,
get_class($this)
), Level::CRITICAL);
}
if (!is_string($this->$variableName)) {
throw new \Exception(sprintf(
'Variable "%s" for exception "%s" must be a string, %s found',
$variableName,
get_class($this),
gettype($this->$variableName)
), Level::CRITICAL);
}
$message = str_replace($variable, $this->$variableName, $message);
}
return $message;
} | php | {
"resource": ""
} |
q267685 | CreateMySqlDao.constraint | test | private final function constraint(TableInterface $table): string
{
$mySql = $selfKey = $foreignKey = "";
$name = $table->get($table::ATTR_NAME);
foreach ($table->get($table::ATTR_KEY) as $key => $value) {
if (KeyInterface::FOREIGN !== $value->getType()) {
$selfKey .= $this->addKey($value, $name . "_" . $key);
if (KeyInterface::PRIMARY === $value->getType()) {
foreach ($value->getSubject() as $key) {
$selfKey .= $this->addAutoIncrement(
$key,
$table->get($table::ATTR_COLUMN));
}
}
continue;
}
$foreignKey .= $this->addForeign($value, $name . "_" . $key);
}
foreach ([$selfKey, $foreignKey] as $value) {
$mySql .= $value ? "ALTER TABLE `" . $name . "`\n"
. substr($value, 0, -2) . ";\n"
: $value;
}
return substr($mySql, 0, -1);
} | php | {
"resource": ""
} |
q267686 | CreateMySqlDao.addAutoIncrement | test | private final function addAutoIncrement(string $key, array $column): string
{
$autoIncrement = "";
if (array_key_exists($key, $column) && in_array(
ColumnInterface::OPT_AUTO_INCREMENT,
$column[$key]->getOption())) {
$autoIncrement .= "MODIFY "
. substr($this->getColumnSyntaxe($column[$key]), 0, -2)
. " AUTO_INCREMENT,\n";
}
return $autoIncrement;
} | php | {
"resource": ""
} |
q267687 | CreateMySqlDao.addKey | test | private final function addKey(KeyInterface $key, string $name): string
{
return "ADD " . $this->constant($key->getType())
. " `k_" . $name . "`"
. " (`" . implode("`, `", ($key->getSubject())) . "`),\n";
} | php | {
"resource": ""
} |
q267688 | CreateMySqlDao.addForeign | test | private final function addForeign(KeyInterface $key, string $name): string
{
return "ADD CONSTRAINT" . " `fk_" . $name . "`"
. " " . $this->constant($key->getType())
. " (`" . implode("`, `", ($key->getSubject())) . "`) "
. " REFERENCES `" . $key->getForeigner() . "`"
. " (`" . implode("`, `", ($key->getForeignerSubject())) . "`),\n";
} | php | {
"resource": ""
} |
q267689 | CreateMySqlDao.getColumnSyntaxe | test | private final function getColumnSyntaxe(ColumnInterface $column)
{
$mySql = "`" . $column->getName() . "` "
. $this->constant($column->getType())
. "(" . $column->getSize() . ")";
foreach ($column->getOption() as $option) {
$const = $this->constant($option);
$mySql .= $const ? " " . $const : "";
}
return $mySql . ",\n";
} | php | {
"resource": ""
} |
q267690 | Plugin.jumpstart | test | public function jumpstart()
{
$this->getLoader()->action('activate_' . $this->getBasename(), array($this, 'activate'));
$this->getLoader()->action('deactivate_' . $this->getBasename(), array($this, 'deactivate'));
$this->getLoader()->action('uninstall_' . $this->getBasename(), array($this, 'uninstall'));
$this->getLoader()->run();
} | php | {
"resource": ""
} |
q267691 | CreateIterationExceptionCapableTrait._createIterationException | test | protected function _createIterationException(
$message = null,
$code = null,
RootException $previous = null,
IterationInterface $iteration = null
) {
return new IterationException($message, $code, $previous, $iteration);
} | php | {
"resource": ""
} |
q267692 | NavBar.renderToggleButton | test | protected function renderToggleButton()
{
$icon = $this->htmlHlp->tag('span', '', ['class' => 'navbar-toggler-icon']);
$screenReader = isset($this->screenReaderToggleText)
? "<span class=\"sr-only\">{$this->screenReaderToggleText}</span>"
: '';
return $this->htmlHlp->button("{$screenReader}\n{$icon}", [
'class' => 'navbar-toggler',
'data-toggle' => 'collapse',
'data-target' => "#{$this->containerOptions['id']}",
]);
} | php | {
"resource": ""
} |
q267693 | Money.getResponse | test | protected function getResponse($templateName, $isNaked = false)
{
$this->response = new ResponseTemplate();
$content = $this->getTemplate($templateName);
if (!$isNaked) {
$content = $this->getLayout($content);
}
$this->response->setHttpCode(200)->setContent($content);
return $this->response;
} | php | {
"resource": ""
} |
q267694 | Money.getModuleName | test | protected function getModuleName()
{
if (empty($this->appModuleName)) {
$className = trim(get_class($this));
$namespace = substr(__NAMESPACE__, 0, strrpos(__NAMESPACE__, '\\'));
$namespace = substr($namespace, 0, strrpos($namespace, '\\')) . '\Module\\';
$className = trim(str_replace(array($namespace), array(''), $className));
$this->appModuleName = substr($className, 0, strpos($className, '\\'));
}
return $this->appModuleName;
} | php | {
"resource": ""
} |
q267695 | Reflection.loadClassReflection | test | public static function loadClassReflection($class)
{
if (is_object($class)) {
$class = get_class($class);
}
if (isset(self::$classReflections[$class])) {
return self::$classReflections[$class];
}
$reflection = new \ReflectionClass($class);
self::$classReflections[$class] = $reflection;
return $reflection;
} | php | {
"resource": ""
} |
q267696 | Reflection.loadObjectReflection | test | public static function loadObjectReflection($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException(sprintf(
'Could not load reflection for non object. Given: "%s".',
gettype($object)
));
}
$hash = spl_object_hash($object);
if (isset(self::$objectReflections[$hash])) {
return self::$objectReflections[$hash];
}
$reflection = new \ReflectionObject($object);
self::$objectReflections[$hash] = $reflection;
return $reflection;
} | php | {
"resource": ""
} |
q267697 | Reflection.loadPropertyReflection | test | public static function loadPropertyReflection($object, $property, $searchInParents = true)
{
$reflection = self::loadClassReflection($object);
if (!$searchInParents) {
return $reflection->getProperty($property);
}
$exception = null;
do {
try {
$reflectionProperty = $reflection->getProperty($property);
return $reflectionProperty;
} catch (\ReflectionException $e) {
if (!$exception) {
$exception = $e;
}
}
} while ($reflection = $reflection->getParentClass());
throw $exception;
} | php | {
"resource": ""
} |
q267698 | Reflection.getCalledMethod | test | public static function getCalledMethod(\ReflectionFunctionAbstract $method, $closureInfo = true)
{
if ($method->isClosure()) {
if ($closureInfo) {
return sprintf(
'Closure [%s:%d]',
$method->getFileName(),
$method->getStartLine()
);
}
return 'Closure';
}
if ($method instanceof \ReflectionMethod) {
return sprintf(
'%s::%s',
$method->getDeclaringClass()->getName(),
$method->getName()
);
}
return $method->getName();
} | php | {
"resource": ""
} |
q267699 | Reflection.getClassProperties | test | public static function getClassProperties($class, $inParents = false, $filter = null)
{
if ($filter === null) {
$filter = \ReflectionProperty::IS_PRIVATE
| \ReflectionProperty::IS_PROTECTED
| \ReflectionProperty::IS_PUBLIC;
}
$reflection = self::loadClassReflection($class);
if (!$inParents) {
return $reflection->getProperties($filter);
}
$properties = [];
do {
$properties = array_merge(
$reflection->getProperties($filter),
$properties
);
} while ($reflection = $reflection->getParentClass());
return $properties;
} | php | {
"resource": ""
} |
Subsets and Splits